diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index d2b50904b2..a6fd9cca1a 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -170,6 +170,51 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) { } +# Mesa +local mesaBaseURL = http://pub.haikufire.com/mesa ; +if $(TARGET_ARCH) = x86 { + local zipFile ; + if $(HAIKU_GCC_VERSION[1]) >= 4 { + HAIKU_MESA_FILE = mesa-71cc639-gcc4-x86.zip ; + } else { + HAIKU_MESA_FILE = mesa-7.8.2-gcc2-x86.zip ; + } + + zipFile = [ DownloadFile $(HAIKU_MESA_FILE) + : $(mesaBaseURL)/$(HAIKU_MESA_FILE) ] ; + + HAIKU_MESA_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) + $(HAIKU_MESA_FILE:B) ] ; + + HAIKU_MESA_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_MESA_DIR) + : include/ : $(zipFile) : extracted-mesa ] ; + + if $(HAIKU_GCC_VERSION[1]) >= 4 { + HAIKU_MESA_LIBS = [ ExtractArchive $(HAIKU_MESA_DIR) + : + src/mesa/libmesa.a + src/mapi/glapi/libglapi.a + lib/libGLU.a + : $(zipFile) + : extracted-mesa ] ; + } else { + # Older Mesa 7.8 + HAIKU_MESA_LIBS = [ ExtractArchive $(HAIKU_MESA_DIR) + : + src/mesa/libmesa.a + src/mesa/libglapi.a + lib/libGLU.a + : $(zipFile) + : extracted-mesa ] ; + } + + HAIKU_MESA_HEADERS = [ FDirName $(HAIKU_MESA_DIR) include ] ; + +} else { + Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ; +} + + # TagLib # Automatically install the TagLib feature, when the optional TagLib optional diff --git a/headers/os/opengl/GL/gl.h b/headers/os/opengl/GL/gl.h deleted file mode 100644 index 7b34a395f7..0000000000 --- a/headers/os/opengl/GL/gl.h +++ /dev/null @@ -1,2285 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.4 - * - * Copyright (C) 1999-2006 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 __gl_h_ -#define __gl_h_ - -#if defined(USE_MGL_NAMESPACE) -#include "gl_mangle.h" -#endif - - -/********************************************************************** - * Begin system-specific stuff. Do not do any of this when building - * for SciTech SNAP, as this is all done before this header file is - * included. - */ -#if !defined(__SCITECH_SNAP__) - -#if (defined(__BEOS__) || defined(__HAIKU__)) -#include /* to get some BeOS-isms */ -#endif - -#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) -#define OPENSTEP -#endif - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) -#define __WIN32__ -#endif - -#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# endif /* _STATIC_MESA support */ -# define GLAPIENTRY __stdcall -#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ -# define GLAPI extern -# define GLAPIENTRY __stdcall -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 -# define GLAPI __attribute__((visibility("default"))) -# define GLAPIENTRY -#endif /* WIN32 && !CYGWIN */ - -#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) -# define PRAGMA_EXPORT_SUPPORTED 1 -#endif - -/* - * WINDOWS: Include windows.h here to define APIENTRY. - * It is also useful when applications include this file by - * including only glut.h, since glut.h depends on windows.h. - * Applications needing to include windows.h with parms other - * than "WIN32_LEAN_AND_MEAN" may include windows.h before - * glut.h or gl.h. - */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \ - && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__) -#include -#endif - -#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED -#pragma import on -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef APIENTRY -#define APIENTRY GLAPIENTRY -#endif - -/* "P" suffix to be used for a pointer to a function */ -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#ifdef CENTERLINE_CLPP -#define signed -#endif - -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export on -#endif - -#endif /* !__SCITECH_SNAP__ */ -/* - * End system-specific stuff. - **********************************************************************/ - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 - - -/* - * Datatypes - */ -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 */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -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_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A - -/* 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_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 - -/* 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_BITS 0x0D57 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#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_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_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_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_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_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_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 - -/* Hints */ -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* Scissor box */ -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 - -/* 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 - -/* 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_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 - -/* 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 - - -/* OpenGL 1.1 */ -#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 -#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 -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - - - -/* - * Miscellaneous - */ - -GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); - -GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glClear( GLbitfield mask ); - -GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); - -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); - -GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); - -GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); - -GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); - -GLAPI void GLAPIENTRY glCullFace( GLenum mode ); - -GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); - -GLAPI void GLAPIENTRY glPointSize( GLfloat size ); - -GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); - -GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); - -GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); - -GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); - -GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); - -GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); - -GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); - -GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); - -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); - -GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); - -GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glEnable( GLenum cap ); - -GLAPI void GLAPIENTRY glDisable( GLenum cap ); - -GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); - - -GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ - -GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ - - -GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); - -GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); - -GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); - -GLAPI void GLAPIENTRY glPopAttrib( void ); - - -GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ - -GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ - - -GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); - -GLAPI GLenum GLAPIENTRY glGetError( void ); - -GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); - -GLAPI void GLAPIENTRY glFinish( void ); - -GLAPI void GLAPIENTRY glFlush( void ); - -GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - - -/* - * Depth Buffer - */ - -GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); - -GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); - -GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); - -GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); - - -/* - * Accumulation Buffer - */ - -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - - -/* - * Transformation - */ - -GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); - -GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, - GLsizei width, GLsizei height ); - -GLAPI void GLAPIENTRY glPushMatrix( void ); - -GLAPI void GLAPIENTRY glPopMatrix( void ); - -GLAPI void GLAPIENTRY glLoadIdentity( void ); - -GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glRotated( GLdouble angle, - GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRotatef( GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - - -/* - * Display Lists - */ - -GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); - -GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); - -GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); - -GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); - -GLAPI void GLAPIENTRY glEndList( void ); - -GLAPI void GLAPIENTRY glCallList( GLuint list ); - -GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, - const GLvoid *lists ); - -GLAPI void GLAPIENTRY glListBase( GLuint base ); - - -/* - * Drawing Functions - */ - -GLAPI void GLAPIENTRY glBegin( GLenum mode ); - -GLAPI void GLAPIENTRY glEnd( void ); - - -GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); -GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); -GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); -GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); -GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); - -GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); -GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glIndexd( GLdouble c ); -GLAPI void GLAPIENTRY glIndexf( GLfloat c ); -GLAPI void GLAPIENTRY glIndexi( GLint c ); -GLAPI void GLAPIENTRY glIndexs( GLshort c ); -GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); -GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); -GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); -GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); -GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); -GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); -GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); -GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); -GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); -GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); -GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); -GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); - -GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, - GLbyte blue, GLbyte alpha ); -GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, - GLdouble blue, GLdouble alpha ); -GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); -GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, - GLint blue, GLint alpha ); -GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, - GLshort blue, GLshort alpha ); -GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ); -GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, - GLuint blue, GLuint alpha ); -GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, - GLushort blue, GLushort alpha ); - - -GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); - -GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); - - -GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); -GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); -GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); -GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); - -GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); -GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); -GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); -GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); -GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); -GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); -GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); -GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); -GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); -GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); -GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); -GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); -GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); - - -GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); -GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); -GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); -GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - - -/* - * Vertex Arrays (1.1) - */ - -GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElement( GLint i ); - -GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); - -GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, - const GLvoid *pointer ); - -/* - * Lighting - */ - -GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); - -GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, - GLfloat *params ); -GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - -/* - * Raster functions - */ - -GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); - -GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, - const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, - const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, - const GLushort *values ); - -GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); -GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); -GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); - -GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - -GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLvoid *pixels ); - -GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type ); - -/* - * Stenciling - */ - -GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); - -GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); - -GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - -GLAPI void GLAPIENTRY glClearStencil( GLint s ); - - - -/* - * Texture mapping - */ - -GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); -GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); -GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, - GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, - GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, - GLvoid *pixels ); - - -/* 1.1 functions */ - -GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); - - -GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, - GLint xoffset, - GLsizei width, GLenum format, - GLenum type, const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -/* - * Evaluators - */ - -GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble *points ); -GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat *points ); - -GLAPI void GLAPIENTRY glMap2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); -GLAPI void GLAPIENTRY glMap2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); -GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); -GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); - -GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); -GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); - -GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); -GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); - -GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); -GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); - -GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); - -GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); - -GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - - -/* - * Fog - */ - -GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); - -GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); - -GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - - -/* - * Selection and Feedback - */ - -GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); - -GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); - -GLAPI void GLAPIENTRY glInitNames( void ); - -GLAPI void GLAPIENTRY glLoadName( GLuint name ); - -GLAPI void GLAPIENTRY glPushName( GLuint name ); - -GLAPI void GLAPIENTRY glPopName( void ); - - - -/* - * 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 -#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 - -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3D( 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 glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - - -/* - * GL_ARB_imaging - */ - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#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 -#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 -#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 -#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 -#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 - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ); - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ); - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ); - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ); - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height); - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ); - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ); - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); - -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); - - - -/* - * OpenGL 1.3 - */ - -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - -GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); - -GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); - - -GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); - - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ -#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); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - - - -/* - * Define this token if you want "old-style" header file behaviour (extensions - * defined in gl.h). Otherwise, extensions will be included from glext.h. - */ -#if defined(GL_GLEXT_LEGACY) - -/* All extensions that used to be here are now found in glext.h */ - -#else /* GL_GLEXT_LEGACY */ - -#include - -#endif /* GL_GLEXT_LEGACY */ - - - -#if GL_ARB_shader_objects - -#ifndef GL_MESA_shader_debug -#define GL_MESA_shader_debug 1 - -#define GL_DEBUG_OBJECT_MESA 0x8759 -#define GL_DEBUG_PRINT_MESA 0x875A -#define GL_DEBUG_ASSERT_MESA 0x875B - -GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void); -GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); -GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, - GLsizei *length, GLcharARB *debugLog); -GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); - -#endif /* GL_MESA_shader_debug */ - -#endif /* GL_ARB_shader_objects */ - - -/* - * ???. GL_MESA_packed_depth_stencil - * XXX obsolete - */ -#ifndef GL_MESA_packed_depth_stencil -#define GL_MESA_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_MESA 0x8750 -#define GL_UNSIGNED_INT_24_8_MESA 0x8751 -#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 -#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 -#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 - -#endif /* GL_MESA_packed_depth_stencil */ - - -#ifndef GL_MESA_program_debug -#define GL_MESA_program_debug 1 - -#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 -#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 -#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 -#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 -#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 -#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 -#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 -#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 - -typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); - -GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); - -GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); - -#endif /* GL_MESA_program_debug */ - - -#ifndef GL_MESA_texture_array -#define GL_MESA_texture_array 1 - -/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. - */ -#ifndef GL_EXT_texture_array - -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif /* GL_GLEXT_PROTOTYPES */ - -#if 0 -/* (temporarily) disabled because of collision with typedef in glext.h - * that happens if apps include both gl.h and glext.h - */ -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#endif - -#endif - - -#ifndef GL_ATI_blend_equation_separate -#define GL_ATI_blend_equation_separate 1 - -#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D - -GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); - -#endif /* GL_ATI_blend_equation_separate */ - - - -/** - ** NOTE!!!!! If you add new functions to this file, or update - ** glext.h be sure to regenerate the gl_mangle.h file. See comments - ** in that file for details. - **/ - - - -/********************************************************************** - * Begin system-specific stuff - */ -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export off -#endif - -#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED -#pragma import off -#endif -/* - * End system-specific stuff - **********************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_h_ */ diff --git a/headers/os/opengl/GL/glext.h b/headers/os/opengl/GL/glext.h deleted file mode 100644 index b24142934e..0000000000 --- a/headers/os/opengl/GL/glext.h +++ /dev/null @@ -1,8565 +0,0 @@ -#ifndef __glext_h_ -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are 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 Materials. -** -** THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2009/03/19 */ -/* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 48 - -#ifndef GL_VERSION_1_2 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#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_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_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#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_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#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 -#endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#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_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 -#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 -#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 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -#ifndef GL_VERSION_1_3 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#endif - -#ifndef GL_VERSION_1_4 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#endif - -#ifndef GL_VERSION_1_5 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#endif - -#ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_VERSION_2_1 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -#endif - -#ifndef GL_VERSION_3_0 -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB -#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -/* Reuse tokens from ARB_depth_buffer_float */ -/* reuse GL_DEPTH_COMPONENT32F */ -/* reuse GL_DEPTH32F_STENCIL8 */ -/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ -/* Reuse tokens from ARB_framebuffer_object */ -/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_DEFAULT */ -/* reuse GL_FRAMEBUFFER_UNDEFINED */ -/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ -/* reuse GL_INDEX */ -/* reuse GL_MAX_RENDERBUFFER_SIZE */ -/* reuse GL_DEPTH_STENCIL */ -/* reuse GL_UNSIGNED_INT_24_8 */ -/* reuse GL_DEPTH24_STENCIL8 */ -/* reuse GL_TEXTURE_STENCIL_SIZE */ -/* reuse GL_TEXTURE_RED_TYPE */ -/* reuse GL_TEXTURE_GREEN_TYPE */ -/* reuse GL_TEXTURE_BLUE_TYPE */ -/* reuse GL_TEXTURE_ALPHA_TYPE */ -/* reuse GL_TEXTURE_LUMINANCE_TYPE */ -/* reuse GL_TEXTURE_INTENSITY_TYPE */ -/* reuse GL_TEXTURE_DEPTH_TYPE */ -/* reuse GL_UNSIGNED_NORMALIZED */ -/* reuse GL_FRAMEBUFFER_BINDING */ -/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_BINDING */ -/* reuse GL_READ_FRAMEBUFFER */ -/* reuse GL_DRAW_FRAMEBUFFER */ -/* reuse GL_READ_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_SAMPLES */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -/* reuse GL_FRAMEBUFFER_COMPLETE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ -/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ -/* reuse GL_MAX_COLOR_ATTACHMENTS */ -/* reuse GL_COLOR_ATTACHMENT0 */ -/* reuse GL_COLOR_ATTACHMENT1 */ -/* reuse GL_COLOR_ATTACHMENT2 */ -/* reuse GL_COLOR_ATTACHMENT3 */ -/* reuse GL_COLOR_ATTACHMENT4 */ -/* reuse GL_COLOR_ATTACHMENT5 */ -/* reuse GL_COLOR_ATTACHMENT6 */ -/* reuse GL_COLOR_ATTACHMENT7 */ -/* reuse GL_COLOR_ATTACHMENT8 */ -/* reuse GL_COLOR_ATTACHMENT9 */ -/* reuse GL_COLOR_ATTACHMENT10 */ -/* reuse GL_COLOR_ATTACHMENT11 */ -/* reuse GL_COLOR_ATTACHMENT12 */ -/* reuse GL_COLOR_ATTACHMENT13 */ -/* reuse GL_COLOR_ATTACHMENT14 */ -/* reuse GL_COLOR_ATTACHMENT15 */ -/* reuse GL_DEPTH_ATTACHMENT */ -/* reuse GL_STENCIL_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER */ -/* reuse GL_RENDERBUFFER */ -/* reuse GL_RENDERBUFFER_WIDTH */ -/* reuse GL_RENDERBUFFER_HEIGHT */ -/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ -/* reuse GL_STENCIL_INDEX1 */ -/* reuse GL_STENCIL_INDEX4 */ -/* reuse GL_STENCIL_INDEX8 */ -/* reuse GL_STENCIL_INDEX16 */ -/* reuse GL_RENDERBUFFER_RED_SIZE */ -/* reuse GL_RENDERBUFFER_GREEN_SIZE */ -/* reuse GL_RENDERBUFFER_BLUE_SIZE */ -/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ -/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ -/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ -/* reuse GL_MAX_SAMPLES */ -/* Reuse tokens from ARB_framebuffer_sRGB */ -/* reuse GL_FRAMEBUFFER_SRGB */ -/* Reuse tokens from ARB_half_float_vertex */ -/* reuse GL_HALF_FLOAT */ -/* Reuse tokens from ARB_map_buffer_range */ -/* reuse GL_MAP_READ_BIT */ -/* reuse GL_MAP_WRITE_BIT */ -/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ -/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ -/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ -/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ -/* Reuse tokens from ARB_texture_compression_rgtc */ -/* reuse GL_COMPRESSED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_RG_RGTC2 */ -/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ -/* Reuse tokens from ARB_texture_rg */ -/* reuse GL_RG */ -/* reuse GL_RG_INTEGER */ -/* reuse GL_R8 */ -/* reuse GL_R16 */ -/* reuse GL_RG8 */ -/* reuse GL_RG16 */ -/* reuse GL_R16F */ -/* reuse GL_R32F */ -/* reuse GL_RG16F */ -/* reuse GL_RG32F */ -/* reuse GL_R8I */ -/* reuse GL_R8UI */ -/* reuse GL_R16I */ -/* reuse GL_R16UI */ -/* reuse GL_R32I */ -/* reuse GL_R32UI */ -/* reuse GL_RG8I */ -/* reuse GL_RG8UI */ -/* reuse GL_RG16I */ -/* reuse GL_RG16UI */ -/* reuse GL_RG32I */ -/* reuse GL_RG32UI */ -/* Reuse tokens from ARB_vertex_array_object */ -/* reuse GL_VERTEX_ARRAY_BINDING */ -#endif - -#ifndef GL_ARB_multitexture -#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 -#endif - -#ifndef GL_ARB_transpose_matrix -#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 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_ARB_depth_buffer_float -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#endif - -#ifndef GL_ARB_draw_instanced -#endif - -#ifndef GL_ARB_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_INDEX 0x8222 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -/* reuse GL_MAX_VARYING_COMPONENTS */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -#endif - -#ifndef GL_ARB_half_float_vertex -#define GL_HALF_FLOAT 0x140B -#endif - -#ifndef GL_ARB_instanced_arrays -#endif - -#ifndef GL_ARB_map_buffer_range -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#endif - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#endif - -#ifndef GL_ARB_texture_rg -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#endif - -#ifndef GL_ARB_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#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 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#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 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#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 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#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 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#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 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#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 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#endif - -#ifndef GL_NV_texture_compression_vtc -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#endif - -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#endif - -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#endif - -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -#ifndef GL_NV_vertex_program1_1 -#endif - -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -#ifndef GL_NV_float_buffer -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -#ifndef GL_NV_fragment_program -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif - -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif - -#ifndef GL_GREMEDY_string_marker -#endif - -#ifndef GL_EXT_packed_depth_stencil -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif - -#ifndef GL_EXT_stencil_clear_tag -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -#endif - -#ifndef GL_EXT_texture_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif - -#ifndef GL_EXT_timer_query -#define GL_TIME_ELAPSED_EXT 0x88BF -#endif - -#ifndef GL_EXT_gpu_program_parameters -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -#endif - -#ifndef GL_NV_gpu_program4 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -#endif - -#ifndef GL_NV_geometry_program4 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ -/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ -/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ -/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -/* reuse GL_LINES_ADJACENCY_EXT */ -/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ -/* reuse GL_TRIANGLES_ADJACENCY_EXT */ -/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -/* reuse GL_PROGRAM_POINT_SIZE_EXT */ -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#endif - -#ifndef GL_EXT_draw_instanced -#endif - -#ifndef GL_EXT_packed_float -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif - -#ifndef GL_EXT_texture_array -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -#endif - -#ifndef GL_NV_fragment_program4 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif - -#ifndef GL_NV_geometry_shader4 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -#endif - -#ifndef GL_EXT_draw_buffers2 -#endif - -#ifndef GL_NV_transform_feedback -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -#endif - -#ifndef GL_EXT_texture_integer -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -#endif - -#ifndef GL_GREMEDY_frame_terminator -#endif - -#ifndef GL_NV_conditional_render -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -#endif - -#ifndef GL_NV_present_video -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -#endif - -#ifndef GL_EXT_vertex_array_bgra -/* reuse GL_BGRA */ -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -#endif - -#ifndef GL_ATI_meminfo -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#endif - -#ifndef GL_AMD_performance_monitor -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#endif - -#ifndef GL_AMD_texture_texture4 -#endif - -#ifndef GL_AMD_vertex_shader_tesselator -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -#endif - -#ifndef GL_EXT_provoking_vertex -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -#endif - - -/*************************************************************/ - -#include -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; /* native character */ -#endif - -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ -typedef unsigned int GLhandleARB; /* shader object handle */ -#endif - -/* GL types for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif - -#ifndef GL_NV_half_float -typedef unsigned short GLhalfNV; -#endif - -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -#include /* Fallback option */ -#endif -#endif - -#ifndef GL_EXT_timer_query -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -/* OpenGL 3.0 also reuses entry points from these extensions: */ -/* ARB_framebuffer_object */ -/* ARB_map_buffer_range */ -/* ARB_vertex_array_object */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnablei (GLenum, GLuint); -GLAPI void APIENTRY glDisablei (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -GLAPI void APIENTRY glClampColor (GLenum, GLenum); -GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1ui (GLint, GLuint); -GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *); -GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *); -GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *); -GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint); -GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint); -GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint); -GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmap (GLenum); -GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -#endif - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArray (GLuint); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#endif - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#endif - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); -#endif - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#endif - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#endif - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); -GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -#endif - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#endif - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); -GLAPI void APIENTRY glClearDepthdNV (GLdouble); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#endif - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#endif - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -#endif - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -#endif - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum); -GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#endif - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#endif - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#endif - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint); -GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *); -GLAPI void APIENTRY glVideoParameterivNV (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint *params); -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixPopEXT (GLenum); -GLAPI void APIENTRY glMatrixPushEXT (GLenum); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *); -GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -#endif - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#endif - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -#endif - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -#endif - -#ifndef GL_AMD_vertex_shader_tesselator -#define GL_AMD_vertex_shader_tesselator 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat); -GLAPI void APIENTRY glTessellationModeAMD (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/headers/os/opengl/GL/glu.h b/headers/os/opengl/GL/glu.h deleted file mode 100644 index cd967ac5ed..0000000000 --- a/headers/os/opengl/GL/glu.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#ifndef __glu_h__ -#define __glu_h__ - -#if defined(USE_MGL_NAMESPACE) -#include "glu_mangle.h" -#endif - -#include - -#ifndef GLAPIENTRY -#if defined(_MSC_VER) || defined(__MINGW32__) -#define GLAPIENTRY __stdcall -#else -#define GLAPIENTRY -#endif -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) -# undef GLAPI -# define GLAPI __declspec(dllexport) -#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) -/* tag specifying we're building for DLL runtime support */ -# undef GLAPI -# define GLAPI __declspec(dllimport) -#elif !defined(GLAPI) -/* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -#endif /* _STATIC_MESA support */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*************************************************************/ - -/* Extensions */ -#define GLU_EXT_object_space_tess 1 -#define GLU_EXT_nurbs_tessellator 1 - -/* Boolean */ -#define GLU_FALSE 0 -#define GLU_TRUE 1 - -/* Version */ -#define GLU_VERSION_1_1 1 -#define GLU_VERSION_1_2 1 -#define GLU_VERSION_1_3 1 - -/* StringName */ -#define GLU_VERSION 100800 -#define GLU_EXTENSIONS 100801 - -/* ErrorCode */ -#define GLU_INVALID_ENUM 100900 -#define GLU_INVALID_VALUE 100901 -#define GLU_OUT_OF_MEMORY 100902 -#define GLU_INCOMPATIBLE_GL_VERSION 100903 -#define GLU_INVALID_OPERATION 100904 - -/* NurbsDisplay */ -/* GLU_FILL */ -#define GLU_OUTLINE_POLYGON 100240 -#define GLU_OUTLINE_PATCH 100241 - -/* NurbsCallback */ -#define GLU_NURBS_ERROR 100103 -#define GLU_ERROR 100103 -#define GLU_NURBS_BEGIN 100164 -#define GLU_NURBS_BEGIN_EXT 100164 -#define GLU_NURBS_VERTEX 100165 -#define GLU_NURBS_VERTEX_EXT 100165 -#define GLU_NURBS_NORMAL 100166 -#define GLU_NURBS_NORMAL_EXT 100166 -#define GLU_NURBS_COLOR 100167 -#define GLU_NURBS_COLOR_EXT 100167 -#define GLU_NURBS_TEXTURE_COORD 100168 -#define GLU_NURBS_TEX_COORD_EXT 100168 -#define GLU_NURBS_END 100169 -#define GLU_NURBS_END_EXT 100169 -#define GLU_NURBS_BEGIN_DATA 100170 -#define GLU_NURBS_BEGIN_DATA_EXT 100170 -#define GLU_NURBS_VERTEX_DATA 100171 -#define GLU_NURBS_VERTEX_DATA_EXT 100171 -#define GLU_NURBS_NORMAL_DATA 100172 -#define GLU_NURBS_NORMAL_DATA_EXT 100172 -#define GLU_NURBS_COLOR_DATA 100173 -#define GLU_NURBS_COLOR_DATA_EXT 100173 -#define GLU_NURBS_TEXTURE_COORD_DATA 100174 -#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 -#define GLU_NURBS_END_DATA 100175 -#define GLU_NURBS_END_DATA_EXT 100175 - -/* NurbsError */ -#define GLU_NURBS_ERROR1 100251 -#define GLU_NURBS_ERROR2 100252 -#define GLU_NURBS_ERROR3 100253 -#define GLU_NURBS_ERROR4 100254 -#define GLU_NURBS_ERROR5 100255 -#define GLU_NURBS_ERROR6 100256 -#define GLU_NURBS_ERROR7 100257 -#define GLU_NURBS_ERROR8 100258 -#define GLU_NURBS_ERROR9 100259 -#define GLU_NURBS_ERROR10 100260 -#define GLU_NURBS_ERROR11 100261 -#define GLU_NURBS_ERROR12 100262 -#define GLU_NURBS_ERROR13 100263 -#define GLU_NURBS_ERROR14 100264 -#define GLU_NURBS_ERROR15 100265 -#define GLU_NURBS_ERROR16 100266 -#define GLU_NURBS_ERROR17 100267 -#define GLU_NURBS_ERROR18 100268 -#define GLU_NURBS_ERROR19 100269 -#define GLU_NURBS_ERROR20 100270 -#define GLU_NURBS_ERROR21 100271 -#define GLU_NURBS_ERROR22 100272 -#define GLU_NURBS_ERROR23 100273 -#define GLU_NURBS_ERROR24 100274 -#define GLU_NURBS_ERROR25 100275 -#define GLU_NURBS_ERROR26 100276 -#define GLU_NURBS_ERROR27 100277 -#define GLU_NURBS_ERROR28 100278 -#define GLU_NURBS_ERROR29 100279 -#define GLU_NURBS_ERROR30 100280 -#define GLU_NURBS_ERROR31 100281 -#define GLU_NURBS_ERROR32 100282 -#define GLU_NURBS_ERROR33 100283 -#define GLU_NURBS_ERROR34 100284 -#define GLU_NURBS_ERROR35 100285 -#define GLU_NURBS_ERROR36 100286 -#define GLU_NURBS_ERROR37 100287 - -/* NurbsProperty */ -#define GLU_AUTO_LOAD_MATRIX 100200 -#define GLU_CULLING 100201 -#define GLU_SAMPLING_TOLERANCE 100203 -#define GLU_DISPLAY_MODE 100204 -#define GLU_PARAMETRIC_TOLERANCE 100202 -#define GLU_SAMPLING_METHOD 100205 -#define GLU_U_STEP 100206 -#define GLU_V_STEP 100207 -#define GLU_NURBS_MODE 100160 -#define GLU_NURBS_MODE_EXT 100160 -#define GLU_NURBS_TESSELLATOR 100161 -#define GLU_NURBS_TESSELLATOR_EXT 100161 -#define GLU_NURBS_RENDERER 100162 -#define GLU_NURBS_RENDERER_EXT 100162 - -/* NurbsSampling */ -#define GLU_OBJECT_PARAMETRIC_ERROR 100208 -#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 -#define GLU_OBJECT_PATH_LENGTH 100209 -#define GLU_OBJECT_PATH_LENGTH_EXT 100209 -#define GLU_PATH_LENGTH 100215 -#define GLU_PARAMETRIC_ERROR 100216 -#define GLU_DOMAIN_DISTANCE 100217 - -/* NurbsTrim */ -#define GLU_MAP1_TRIM_2 100210 -#define GLU_MAP1_TRIM_3 100211 - -/* QuadricDrawStyle */ -#define GLU_POINT 100010 -#define GLU_LINE 100011 -#define GLU_FILL 100012 -#define GLU_SILHOUETTE 100013 - -/* QuadricCallback */ -/* GLU_ERROR */ - -/* QuadricNormal */ -#define GLU_SMOOTH 100000 -#define GLU_FLAT 100001 -#define GLU_NONE 100002 - -/* QuadricOrientation */ -#define GLU_OUTSIDE 100020 -#define GLU_INSIDE 100021 - -/* TessCallback */ -#define GLU_TESS_BEGIN 100100 -#define GLU_BEGIN 100100 -#define GLU_TESS_VERTEX 100101 -#define GLU_VERTEX 100101 -#define GLU_TESS_END 100102 -#define GLU_END 100102 -#define GLU_TESS_ERROR 100103 -#define GLU_TESS_EDGE_FLAG 100104 -#define GLU_EDGE_FLAG 100104 -#define GLU_TESS_COMBINE 100105 -#define GLU_TESS_BEGIN_DATA 100106 -#define GLU_TESS_VERTEX_DATA 100107 -#define GLU_TESS_END_DATA 100108 -#define GLU_TESS_ERROR_DATA 100109 -#define GLU_TESS_EDGE_FLAG_DATA 100110 -#define GLU_TESS_COMBINE_DATA 100111 - -/* TessContour */ -#define GLU_CW 100120 -#define GLU_CCW 100121 -#define GLU_INTERIOR 100122 -#define GLU_EXTERIOR 100123 -#define GLU_UNKNOWN 100124 - -/* TessProperty */ -#define GLU_TESS_WINDING_RULE 100140 -#define GLU_TESS_BOUNDARY_ONLY 100141 -#define GLU_TESS_TOLERANCE 100142 - -/* TessError */ -#define GLU_TESS_ERROR1 100151 -#define GLU_TESS_ERROR2 100152 -#define GLU_TESS_ERROR3 100153 -#define GLU_TESS_ERROR4 100154 -#define GLU_TESS_ERROR5 100155 -#define GLU_TESS_ERROR6 100156 -#define GLU_TESS_ERROR7 100157 -#define GLU_TESS_ERROR8 100158 -#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 -#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 -#define GLU_TESS_MISSING_END_POLYGON 100153 -#define GLU_TESS_MISSING_END_CONTOUR 100154 -#define GLU_TESS_COORD_TOO_LARGE 100155 -#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 - -/* TessWinding */ -#define GLU_TESS_WINDING_ODD 100130 -#define GLU_TESS_WINDING_NONZERO 100131 -#define GLU_TESS_WINDING_POSITIVE 100132 -#define GLU_TESS_WINDING_NEGATIVE 100133 -#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 - -/*************************************************************/ - - -#ifdef __cplusplus -class GLUnurbs; -class GLUquadric; -class GLUtesselator; -#else -typedef struct GLUnurbs GLUnurbs; -typedef struct GLUquadric GLUquadric; -typedef struct GLUtesselator GLUtesselator; -#endif - -typedef GLUnurbs GLUnurbsObj; -typedef GLUquadric GLUquadricObj; -typedef GLUtesselator GLUtesselatorObj; -typedef GLUtesselator GLUtriangulatorObj; - -#define GLU_TESS_MAX_COORD 1.0e150 - -/* Internal convenience typedefs */ -typedef void (GLAPIENTRYP _GLUfuncptr)(); - -GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); -GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb); -GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb); -GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); -GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); -GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString); -GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); -GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); -GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad); -GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); -GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb); -GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb); -GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb); -GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error); -GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); -GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name); -GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); -GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); -GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); -GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void); -GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void); -GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void); -GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type); -GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); -GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); -GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); -GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); -GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); -GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); -GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); -GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); -GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); -GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); -GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); -GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); -GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); -GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); -GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); -GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); -GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); -GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); -GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); -GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); -GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); -GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess); -GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); -GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); -GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); -GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); -GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); - -#ifdef __cplusplus -} -#endif - -#endif /* __glu_h__ */ diff --git a/src/add-ons/opengl/mesa_software_renderer/Jamfile b/src/add-ons/opengl/mesa_software_renderer/Jamfile index e9f555bf5b..855bda7c7e 100644 --- a/src/add-ons/opengl/mesa_software_renderer/Jamfile +++ b/src/add-ons/opengl/mesa_software_renderer/Jamfile @@ -7,12 +7,13 @@ if $(TARGET_PLATFORM) != haiku { # We need our public GL headers also when not compiling for Haiku. } + { local defines ; defines = BEOS_THREADS GNU_ASSEMBLER ; if $(TARGET_ARCH) = x86 { - defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; + defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; } else if $(TARGET_ARCH) = ppc { # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! # defines += USE_PPC_ASM ; @@ -20,23 +21,34 @@ if $(TARGET_PLATFORM) != haiku { defines += USE_SPARC_ASM ; } - SubDirC++Flags [ FDefines $(defines) ] ; + # For GCC2 + local flags ; + if $(HAIKU_GCC_VERSION[1]) < 3 { + flags = --no-warnings ; + } + + SubDirC++Flags [ FDefines $(defines) ] $(flags) ; } -UsePrivateHeaders interface ; -UseLibraryHeaders mesa ; +local sources = MesaSoftwareRenderer.cpp ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa main ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa glapi ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa tnl ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa x86 ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa ppc ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa sparc ] ; +UsePrivateHeaders interface ; +SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; +Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ; + +UseHeaders [ FDirName $(HAIKU_MESA_DIR) include ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa main ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mapi ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mapi glapi ] ; + +# For older versions of Mesa +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa glapi ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa tnl ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa x86 ] ; Addon Mesa\ Software\ Renderer : MesaSoftwareRenderer.cpp - : libGL.so libmesa.a be $(TARGET_LIBSUPC++) + : libGL.so be $(TARGET_LIBSUPC++) ; - diff --git a/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp b/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp index 5874fb28f5..f94b8f4b0f 100644 --- a/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp +++ b/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp @@ -1,11 +1,12 @@ /* - * Copyright 2006-2008, Haiku. All rights reserved. + * Copyright 2006-2011, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Jérôme Duval, korli@users.berlios.de * Philippe Houdoin, philippe.houdoin@free.fr * Artur Wyszynski, harakash@gmail.com + * Alexander von Gluck, kallisti5@unixzen.com */ /* * Mesa 3-D graphics library @@ -23,17 +24,20 @@ #include #include - extern "C" { #include "extensions.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "main/colormac.h" #include "main/buffers.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/state.h" -#include "main/version.h" #include "swrast/swrast.h" +#if __GNUC__ > 2 +#include "swrast/s_renderbuffer.h" +#endif #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "tnl/t_context.h" @@ -199,6 +203,7 @@ extern "C" { } + extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView* view, ulong options, BGLDispatcher* dispatcher) @@ -208,7 +213,7 @@ instantiate_gl_renderer(BGLView* view, ulong options, MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, - BGLDispatcher* dispatcher) + BGLDispatcher* dispatcher) : BGLRenderer(view, options, dispatcher), fBitmap(NULL), fDirectModeEnabled(false), @@ -233,7 +238,7 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, fColorSpace = BScreen(GLView()->Window()).ColorSpace(); // We force single buffering for the time being - //options &= !BGL_DOUBLE; + options &= !BGL_DOUBLE; const GLboolean rgbFlag = ((options & BGL_INDEX) == 0); const GLboolean alphaFlag = ((options & BGL_ALPHA) == BGL_ALPHA); @@ -242,7 +247,6 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, const GLint depth = (options & BGL_DEPTH) ? 16 : 0; const GLint stencil = (options & BGL_STENCIL) ? 8 : 0; const GLint accum = (options & BGL_ACCUM) ? 16 : 0; - const GLint index = (options & BGL_INDEX) ? 32 : 0; const GLint red = rgbFlag ? 8 : 0; const GLint green = rgbFlag ? 8 : 0; const GLint blue = rgbFlag ? 8 : 0; @@ -251,8 +255,8 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, fOptions = options; // | BGL_INDIRECT; struct dd_function_table functions; - fVisual = _mesa_create_visual(rgbFlag, dblFlag, stereoFlag, red, green, - blue, alpha, index, depth, stencil, accum, accum, accum, + fVisual = _mesa_create_visual(dblFlag, stereoFlag, red, green, + blue, alpha, depth, stencil, accum, accum, accum, alpha ? accum : 0, 1); // Initialize device driver function table @@ -266,7 +270,13 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, functions.Flush = _Flush; // create core context +#if HAIKU_MESA_VER <= 708 fContext = _mesa_create_context(fVisual, NULL, &functions, this); +#else + fContext = _mesa_create_context(API_OPENGL, fVisual, NULL, + &functions, this); +#endif + if (!fContext) { _mesa_destroy_visual(fVisual); return; @@ -282,6 +292,7 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, // Use default TCL pipeline TNL_CONTEXT(fContext)->Driver.RunPipeline = _tnl_run_pipeline; + _mesa_meta_init(fContext); _mesa_enable_sw_extensions(fContext); _mesa_enable_1_3_extensions(fContext); _mesa_enable_1_4_extensions(fContext); @@ -290,50 +301,86 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, _mesa_enable_2_1_extensions(fContext); // create core framebuffer - fFrameBuffer = (struct msr_framebuffer*)_mesa_calloc( + fFrameBuffer = (struct msr_framebuffer*)calloc(1, sizeof(*fFrameBuffer)); - _mesa_initialize_framebuffer(&fFrameBuffer->Base, fVisual); + _mesa_initialize_window_framebuffer(&fFrameBuffer->base, fVisual); - fFrontRenderBuffer = (struct msr_renderbuffer*)_mesa_calloc( + fFrontRenderBuffer = (struct msr_renderbuffer*)calloc(1, sizeof(*fFrontRenderBuffer)); - _mesa_init_renderbuffer(&fFrontRenderBuffer->Base, 0); + _mesa_init_renderbuffer(&fFrontRenderBuffer->base, 0); - fFrontRenderBuffer->Base.AllocStorage = _FrontRenderbufferStorage; - fFrontRenderBuffer->Base.Data = NULL; - fFrontRenderBuffer->Base.InternalFormat = GL_RGBA; - fFrontRenderBuffer->Base._BaseFormat = GL_RGBA; - fFrontRenderBuffer->Base.DataType = GL_UNSIGNED_BYTE; - fFrontRenderBuffer->Base.RedBits = 8 * sizeof(GLubyte); - fFrontRenderBuffer->Base.GreenBits = 8 * sizeof(GLubyte); - fFrontRenderBuffer->Base.BlueBits = 8 * sizeof(GLubyte); - fFrontRenderBuffer->Base.AlphaBits = 8 * sizeof(GLubyte); - _SetSpanFuncs(fFrontRenderBuffer, fColorSpace); - _mesa_add_renderbuffer(&fFrameBuffer->Base, BUFFER_FRONT_LEFT, - &fFrontRenderBuffer->Base); + fFrontRenderBuffer->active = true; + fFrontRenderBuffer->base.InternalFormat = GL_RGBA; + fFrontRenderBuffer->base._BaseFormat = GL_RGBA; + fFrontRenderBuffer->base.DataType = GL_UNSIGNED_BYTE; - if (dblFlag) { - fBackRenderBuffer = (struct msr_renderbuffer*)_mesa_calloc( - sizeof(*fBackRenderBuffer)); - _mesa_init_renderbuffer(&fBackRenderBuffer->Base, 0); - - fBackRenderBuffer->Base.AllocStorage = _BackRenderbufferStorage; - fBackRenderBuffer->Base.Data = NULL; - fBackRenderBuffer->Base.Delete = _DeleteBackBuffer; - fBackRenderBuffer->Base.InternalFormat = GL_RGBA; - fBackRenderBuffer->Base._BaseFormat = GL_RGBA; - fBackRenderBuffer->Base.DataType = GL_UNSIGNED_BYTE; - fBackRenderBuffer->Base.RedBits = 8 * sizeof(GLubyte); - fBackRenderBuffer->Base.GreenBits = 8 * sizeof(GLubyte); - fBackRenderBuffer->Base.BlueBits = 8 * sizeof(GLubyte); - fBackRenderBuffer->Base.AlphaBits = 8 * sizeof(GLubyte); - _SetSpanFuncs(fBackRenderBuffer, fColorSpace); - _mesa_add_renderbuffer(&fFrameBuffer->Base, BUFFER_BACK_LEFT, - &fBackRenderBuffer->Base); + switch(fColorSpace) { + case B_RGB32: +#if HAIKU_MESA_VER >= 709 + // Only in New Mesa + fFrontRenderBuffer->base.Format = MESA_FORMAT_XRGB8888; + break; +#endif + case B_RGBA32: + fFrontRenderBuffer->base.Format = MESA_FORMAT_ARGB8888; + break; + case B_RGB24: + fFrontRenderBuffer->base.Format = MESA_FORMAT_ARGB8888; + break; + case B_RGB16: + fFrontRenderBuffer->base.Format = MESA_FORMAT_RGB565; + break; + case B_RGB15: + case B_RGBA15: + fFrontRenderBuffer->base.Format = MESA_FORMAT_ARGB1555; + break; + case B_CMAP8: + default: + fprintf(stderr, "Unsupported screen color space %d\n", fColorSpace); + debugger("Unsupported OpenGL color space"); + break; } - _mesa_add_soft_renderbuffers(&fFrameBuffer->Base, GL_FALSE, + fFrontRenderBuffer->base.AllocStorage = _FrontRenderbufferStorage; + fFrontRenderBuffer->base.Data = NULL; + + _SetSpanFuncs(fFrontRenderBuffer, fColorSpace); + _mesa_add_renderbuffer(&fFrameBuffer->base, BUFFER_FRONT_LEFT, + &fFrontRenderBuffer->base); + + fBackRenderBuffer = (struct msr_renderbuffer*)calloc(1, + sizeof(*fBackRenderBuffer)); + if (dblFlag) { + _mesa_init_renderbuffer(&fBackRenderBuffer->base, 0); + + fBackRenderBuffer->active = true; + fBackRenderBuffer->base.AllocStorage = _BackRenderbufferStorage; + fBackRenderBuffer->base.Data = NULL; + fBackRenderBuffer->base.Delete = _DeleteBackBuffer; + fBackRenderBuffer->base.InternalFormat + = fFrontRenderBuffer->base.InternalFormat; + fBackRenderBuffer->base._BaseFormat + = fFrontRenderBuffer->base._BaseFormat; + fBackRenderBuffer->base.Format = fFrontRenderBuffer->base.Format; + + _SetSpanFuncs(fBackRenderBuffer, fColorSpace); + _mesa_add_renderbuffer(&fFrameBuffer->base, BUFFER_BACK_LEFT, + &fBackRenderBuffer->base); + } else { + fBackRenderBuffer->active = false; + } + +#if HAIKU_MESA_VER >= 709 + // New Mesa + _swrast_add_soft_renderbuffers(&fFrameBuffer->base, GL_FALSE, fVisual->haveDepthBuffer, fVisual->haveStencilBuffer, fVisual->haveAccumBuffer, alphaFlag, GL_FALSE); +#else + // Old Mesa + _mesa_add_soft_renderbuffers(&fFrameBuffer->base, GL_FALSE, + fVisual->haveDepthBuffer, fVisual->haveStencilBuffer, + fVisual->haveAccumBuffer, alphaFlag, GL_FALSE); +#endif BRect bounds = view->Bounds(); fWidth = fNewWidth = (GLint)bounds.Width(); @@ -349,6 +396,7 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, } } + MesaSoftwareRenderer::~MesaSoftwareRenderer() { CALLED(); @@ -357,7 +405,7 @@ MesaSoftwareRenderer::~MesaSoftwareRenderer() _tnl_DestroyContext(fContext); _vbo_DestroyContext(fContext); _mesa_destroy_visual(fVisual); - _mesa_destroy_framebuffer(&fFrameBuffer->Base); + _mesa_destroy_framebuffer(&fFrameBuffer->base); _mesa_destroy_context(fContext); free(fInfo); @@ -372,7 +420,7 @@ MesaSoftwareRenderer::LockGL() CALLED(); BGLRenderer::LockGL(); - _mesa_make_current(fContext, &fFrameBuffer->Base, &fFrameBuffer->Base); + _mesa_make_current(fContext, &fFrameBuffer->base, &fFrameBuffer->base); color_space cs = B_RGBA32; @@ -385,16 +433,17 @@ MesaSoftwareRenderer::LockGL() - fInfo->window_bounds.top + 1; } - if (fBitmap && cs == fColorSpace && fNewWidth == fWidth - && fNewHeight == fHeight) - return; - if (cs != fColorSpace) { fColorSpace = cs; _SetSpanFuncs(fFrontRenderBuffer, fColorSpace); - _SetSpanFuncs(fBackRenderBuffer, fColorSpace); + if (fBackRenderBuffer->active) + _SetSpanFuncs(fBackRenderBuffer, fColorSpace); } + if (fBitmap && fNewWidth == fWidth + && fNewHeight == fHeight) + return; + fWidth = fNewWidth; fHeight = fNewHeight; @@ -418,7 +467,7 @@ void MesaSoftwareRenderer::SwapBuffers(bool VSync) { CALLED(); - + if (!fBitmap) return; @@ -582,12 +631,13 @@ MesaSoftwareRenderer::_AllocateBitmap() + i * fBitmap->BytesPerRow()); } - _mesa_resize_framebuffer(fContext, &fFrameBuffer->Base, fWidth, fHeight); - fFrontRenderBuffer->Base.Data = fBitmap->Bits(); - fFrontRenderBuffer->Size = fBitmap->BitsLength(); - fBackRenderBuffer->Size = fBitmap->BitsLength(); - fFrameBuffer->Width = fWidth; - fFrameBuffer->Height = fHeight; + _mesa_resize_framebuffer(fContext, &fFrameBuffer->base, fWidth, fHeight); + fFrontRenderBuffer->base.Data = fBitmap->Bits(); + fFrontRenderBuffer->size = fBitmap->BitsLength(); + if (fBackRenderBuffer->active) + fBackRenderBuffer->size = fBitmap->BitsLength(); + fFrameBuffer->width = fWidth; + fFrameBuffer->height = fHeight; } @@ -595,7 +645,7 @@ MesaSoftwareRenderer::_AllocateBitmap() void -MesaSoftwareRenderer::_Error(GLcontext* ctx) +MesaSoftwareRenderer::_Error(gl_context* ctx) { MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx; if (mr && mr->GLView()) @@ -604,17 +654,17 @@ MesaSoftwareRenderer::_Error(GLcontext* ctx) const GLubyte* -MesaSoftwareRenderer::_GetString(GLcontext* ctx, GLenum name) +MesaSoftwareRenderer::_GetString(gl_context* ctx, GLenum name) { switch (name) { + case GL_VENDOR: + return (const GLubyte*) "Mesa Project"; case GL_RENDERER: { static char buffer[256] = { '\0' }; if (!buffer[0]) { // Let's build an renderer string - // TODO: add SVN revision - strncat(buffer, "Haiku's Mesa " MESA_VERSION_STRING - " Software Renderer", sizeof(buffer)); + strncat(buffer, "Software Rasterizer", sizeof(buffer)); // Append any CPU-specific information. #ifdef USE_X86_ASM @@ -661,7 +711,7 @@ MesaSoftwareRenderer::_GetString(GLcontext* ctx, GLenum name) #endif } - return (const GLubyte *) buffer; + return (const GLubyte*) buffer; } default: // Let core library handle all other cases @@ -671,22 +721,22 @@ MesaSoftwareRenderer::_GetString(GLcontext* ctx, GLenum name) void -MesaSoftwareRenderer::_Viewport(GLcontext* ctx, GLint x, GLint y, GLsizei w, +MesaSoftwareRenderer::_Viewport(gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h) { CALLED(); - GLframebuffer* draw = ctx->WinSysDrawBuffer; - GLframebuffer* read = ctx->WinSysReadBuffer; + gl_framebuffer* draw = ctx->WinSysDrawBuffer; + gl_framebuffer* read = ctx->WinSysReadBuffer; struct msr_framebuffer* msr = msr_framebuffer(draw); - _mesa_resize_framebuffer(ctx, draw, msr->Width, msr->Height); - _mesa_resize_framebuffer(ctx, read, msr->Width, msr->Height); + _mesa_resize_framebuffer(ctx, draw, msr->width, msr->height); + _mesa_resize_framebuffer(ctx, read, msr->width, msr->height); } void -MesaSoftwareRenderer::_UpdateState(GLcontext* ctx, GLuint new_state) +MesaSoftwareRenderer::_UpdateState(gl_context* ctx, GLuint new_state) { if (!ctx) return; @@ -700,7 +750,7 @@ MesaSoftwareRenderer::_UpdateState(GLcontext* ctx, GLuint new_state) void -MesaSoftwareRenderer::_ClearFront(GLcontext* ctx) +MesaSoftwareRenderer::_ClearFront(gl_context* ctx) { CALLED(); @@ -745,32 +795,36 @@ MesaSoftwareRenderer::_ClearFront(GLcontext* ctx) GLboolean -MesaSoftwareRenderer::_FrontRenderbufferStorage(GLcontext* ctx, +MesaSoftwareRenderer::_FrontRenderbufferStorage(gl_context* ctx, struct gl_renderbuffer* render, GLenum internalFormat, GLuint width, GLuint height) { + render->Data = NULL; render->Width = width; render->Height = height; +#if HAIKU_MESA_VER >= 712 + render->RowStride = width; +#endif return GL_TRUE; } GLboolean -MesaSoftwareRenderer::_BackRenderbufferStorage(GLcontext* ctx, +MesaSoftwareRenderer::_BackRenderbufferStorage(gl_context* ctx, struct gl_renderbuffer* render, GLenum internalFormat, GLuint width, GLuint height) { struct msr_renderbuffer* mrb = msr_renderbuffer(render); - _mesa_free(render->Data); + free(render->Data); _FrontRenderbufferStorage(ctx, render, internalFormat, width, height); - render->Data = _mesa_malloc(mrb->Size); + render->Data = malloc(mrb->size); return GL_TRUE; } void -MesaSoftwareRenderer::_Flush(GLcontext* ctx) +MesaSoftwareRenderer::_Flush(gl_context* ctx) { CALLED(); MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx; @@ -787,60 +841,75 @@ void MesaSoftwareRenderer::_SetSpanFuncs( struct msr_renderbuffer* buffer, color_space colorSpace) { + if (!buffer->active) + return; + switch (colorSpace) { case B_RGBA32: - buffer->Base.GetRow = get_row_RGBA32; - buffer->Base.GetValues = get_values_RGBA32; - buffer->Base.PutRow = put_row_RGBA32; - buffer->Base.PutRowRGB = put_row_rgb_RGBA32; - buffer->Base.PutMonoRow = put_mono_row_RGBA32; - buffer->Base.PutValues = put_values_RGBA32; - buffer->Base.PutMonoValues = put_mono_values_RGBA32; + buffer->base.GetRow = get_row_RGBA32; + buffer->base.GetValues = get_values_RGBA32; + buffer->base.PutRow = put_row_RGBA32; + buffer->base.PutValues = put_values_RGBA32; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_RGBA32; + buffer->base.PutMonoRow = put_mono_row_RGBA32; + buffer->base.PutMonoValues = put_values_RGBA32; +#endif break; case B_RGB32: - buffer->Base.GetRow = get_row_RGB32; - buffer->Base.GetValues = get_values_RGB32; - buffer->Base.PutRow = put_row_RGB32; - buffer->Base.PutRowRGB = put_row_rgb_RGB32; - buffer->Base.PutMonoRow = put_mono_row_RGB32; - buffer->Base.PutValues = put_values_RGB32; - buffer->Base.PutMonoValues = put_mono_values_RGB32; + buffer->base.GetRow = get_row_RGB32; + buffer->base.GetValues = get_values_RGB32; + buffer->base.PutRow = put_row_RGB32; + buffer->base.PutValues = put_values_RGB32; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_RGB32; + buffer->base.PutMonoRow = put_mono_row_RGB32; + buffer->base.PutMonoValues = put_values_RGB32; +#endif break; case B_RGB24: - buffer->Base.GetRow = get_row_RGB24; - buffer->Base.GetValues = get_values_RGB24; - buffer->Base.PutRow = put_row_RGB24; - buffer->Base.PutRowRGB = put_row_rgb_RGB24; - buffer->Base.PutMonoRow = put_mono_row_RGB24; - buffer->Base.PutValues = put_values_RGB24; - buffer->Base.PutMonoValues = put_mono_values_RGB24; + buffer->base.GetRow = get_row_RGB24; + buffer->base.GetValues = get_values_RGB24; + buffer->base.PutRow = put_row_RGB24; + buffer->base.PutValues = put_values_RGB24; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_RGB24; + buffer->base.PutMonoRow = put_mono_row_RGB24; + buffer->base.PutMonoValues = put_values_RGB24; +#endif break; case B_RGB16: - buffer->Base.GetRow = get_row_RGB16; - buffer->Base.GetValues = get_values_RGB16; - buffer->Base.PutRow = put_row_RGB16; - buffer->Base.PutRowRGB = put_row_rgb_RGB16; - buffer->Base.PutMonoRow = put_mono_row_RGB16; - buffer->Base.PutValues = put_values_RGB16; - buffer->Base.PutMonoValues = put_mono_values_RGB16; + buffer->base.GetRow = get_row_RGB16; + buffer->base.GetValues = get_values_RGB16; + buffer->base.PutRow = put_row_RGB16; + buffer->base.PutValues = put_values_RGB16; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_RGB16; + buffer->base.PutMonoRow = put_mono_row_RGB16; + buffer->base.PutMonoValues = put_values_RGB16; +#endif break; case B_RGB15: - buffer->Base.GetRow = get_row_RGB15; - buffer->Base.GetValues = get_values_RGB15; - buffer->Base.PutRow = put_row_RGB15; - buffer->Base.PutRowRGB = put_row_rgb_RGB15; - buffer->Base.PutMonoRow = put_mono_row_RGB15; - buffer->Base.PutValues = put_values_RGB15; - buffer->Base.PutMonoValues = put_mono_values_RGB15; + buffer->base.GetRow = get_row_RGB15; + buffer->base.GetValues = get_values_RGB15; + buffer->base.PutRow = put_row_RGB15; + buffer->base.PutValues = put_values_RGB15; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_RGB15; + buffer->base.PutMonoRow = put_mono_row_RGB15; + buffer->base.PutMonoValues = put_values_RGB15; +#endif break; case B_CMAP8: - buffer->Base.GetRow = get_row_CMAP8; - buffer->Base.GetValues = get_values_CMAP8; - buffer->Base.PutRow = put_row_CMAP8; - buffer->Base.PutRowRGB = put_row_rgb_CMAP8; - buffer->Base.PutMonoRow = put_mono_row_CMAP8; - buffer->Base.PutValues = put_values_CMAP8; - buffer->Base.PutMonoValues = put_mono_values_CMAP8; + buffer->base.GetRow = get_row_CMAP8; + buffer->base.GetValues = get_values_CMAP8; + buffer->base.PutRow = put_row_CMAP8; + buffer->base.PutValues = put_values_CMAP8; +#if HAIKU_MESA_VER <= 711 + buffer->base.PutRowRGB = put_row_rgb_CMAP8; + buffer->base.PutMonoRow = put_mono_row_CMAP8; + buffer->base.PutMonoValues = put_values_CMAP8; +#endif break; default: fprintf(stderr, "Unsupported screen color space %d\n", fColorSpace); @@ -853,8 +922,8 @@ MesaSoftwareRenderer::_SetSpanFuncs( void MesaSoftwareRenderer::_DeleteBackBuffer(struct gl_renderbuffer* rb) { - _mesa_free(rb->Data); - _mesa_free(rb); + free(rb->Data); + free(rb); } diff --git a/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h b/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h index f61ceeaa2a..c49e09ed98 100644 --- a/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h +++ b/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h @@ -19,12 +19,26 @@ #include "GLRenderer.h" extern "C" { +#include "main/version.h" +#define HAIKU_MESA_VER (MESA_MAJOR * 100) + MESA_MINOR #include "context.h" +#if HAIKU_MESA_VER >= 712 +#include "swrast/s_chan.h" +#endif + + +#if HAIKU_MESA_VER <= 711 +#define gl_context GLcontext +#define gl_config GLvisual +#endif + + struct msr_renderbuffer { - struct gl_renderbuffer Base; - uint32 Size; + struct gl_renderbuffer base; + uint32 size; + bool active; }; @@ -36,9 +50,9 @@ msr_renderbuffer(struct gl_renderbuffer* rb) struct msr_framebuffer { - struct gl_framebuffer Base; - uint32 Width; - uint32 Height; + struct gl_framebuffer base; + uint32 width; + uint32 height; }; @@ -48,8 +62,10 @@ msr_framebuffer(struct gl_framebuffer* rb) return (struct msr_framebuffer*)rb; } + } + class MesaSoftwareRenderer : public BGLRenderer { public: MesaSoftwareRenderer(BGLView* view, @@ -72,21 +88,21 @@ public: virtual void DirectConnected(direct_buffer_info* info); private: - static void _Error(GLcontext* ctx); - static const GLubyte* _GetString(GLcontext* ctx, GLenum name); - static void _Viewport(GLcontext* ctx, GLint x, GLint y, + static void _Error(gl_context* ctx); + static const GLubyte* _GetString(gl_context* ctx, GLenum name); + static void _Viewport(gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h); - static void _UpdateState(GLcontext* ctx, GLuint newState); - static void _ClearFront(GLcontext* ctx); - static GLboolean _FrontRenderbufferStorage(GLcontext* ctx, + static void _UpdateState(gl_context* ctx, GLuint newState); + static void _ClearFront(gl_context* ctx); + static GLboolean _FrontRenderbufferStorage(gl_context* ctx, struct gl_renderbuffer* render, GLenum internalFormat, GLuint width, GLuint height); - static GLboolean _BackRenderbufferStorage(GLcontext* ctx, + static GLboolean _BackRenderbufferStorage(gl_context* ctx, struct gl_renderbuffer* render, GLenum internalFormat, GLuint width, GLuint height); - static void _Flush(GLcontext *ctx); + static void _Flush(gl_context *ctx); void _SetSpanFuncs(struct msr_renderbuffer* buffer, color_space colorSpace); static void _DeleteBackBuffer(struct gl_renderbuffer* rb); @@ -100,8 +116,8 @@ private: BLocker fInfoLocker; ulong fOptions; - GLcontext* fContext; - GLvisual* fVisual; + gl_context* fContext; + gl_config* fVisual; struct msr_framebuffer* fFrameBuffer; struct msr_renderbuffer* fFrontRenderBuffer; struct msr_renderbuffer* fBackRenderBuffer; diff --git a/src/add-ons/screen_savers/flurry/Jamfile b/src/add-ons/screen_savers/flurry/Jamfile index 28d5be2293..61854d35fa 100644 --- a/src/add-ons/screen_savers/flurry/Jamfile +++ b/src/add-ons/screen_savers/flurry/Jamfile @@ -1,4 +1,11 @@ SubDir HAIKU_TOP src add-ons screen_savers flurry ; +SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; + +# For GCC2 +if $(HAIKU_GCC_VERSION[1]) < 3 { + SubDirC++Flags --no-warnings ; +} + AddResources Message : Flurry.rdef ; diff --git a/src/add-ons/screen_savers/flurry/Shared.h b/src/add-ons/screen_savers/flurry/Shared.h index fd6f8c43cf..d586d0183d 100644 --- a/src/add-ons/screen_savers/flurry/Shared.h +++ b/src/add-ons/screen_savers/flurry/Shared.h @@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include diff --git a/src/apps/glteapot/Jamfile b/src/apps/glteapot/Jamfile index 6bfc3ea88f..575d254f29 100644 --- a/src/apps/glteapot/Jamfile +++ b/src/apps/glteapot/Jamfile @@ -1,7 +1,14 @@ SubDir HAIKU_TOP src apps glteapot ; +SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; SetSubDirSupportedPlatformsBeOSCompatible ; +# For GCC2 +if $(HAIKU_GCC_VERSION[1]) < 3 { + SubDirC++Flags --no-warnings ; +} + + Application GLTeapot : FPS.cpp GLObject.cpp diff --git a/src/apps/glteapot/util.h b/src/apps/glteapot/util.h index 719e81d63f..f8a4f36cf0 100644 --- a/src/apps/glteapot/util.h +++ b/src/apps/glteapot/util.h @@ -7,6 +7,7 @@ #define UTIL_H #include +#include #include "error.h" template diff --git a/src/kits/opengl/GLDispatcher.cpp b/src/kits/opengl/GLDispatcher.cpp index d9d819900c..31a35b655a 100644 --- a/src/kits/opengl/GLDispatcher.cpp +++ b/src/kits/opengl/GLDispatcher.cpp @@ -32,13 +32,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include -#include "glheader.h" - extern "C" { #include "glapi.h" +#if __GNUC__ > 2 +// New Mesa +#include "glapi_priv.h" #include "glapitable.h" +#endif /* * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints @@ -66,7 +67,9 @@ extern "C" { return (dispatch->func) args +#if __GNUC__ > 2 #include "glapitemp.h" +#endif #endif /* USE_X86_ASM */ diff --git a/src/kits/opengl/GLDispatcher.h b/src/kits/opengl/GLDispatcher.h index 440c32115d..146921aa98 100644 --- a/src/kits/opengl/GLDispatcher.h +++ b/src/kits/opengl/GLDispatcher.h @@ -3,8 +3,11 @@ #include +#include #include +#include "glheader.h" + extern "C" { #include "glapi.h" } diff --git a/src/kits/opengl/GLView.cpp b/src/kits/opengl/GLView.cpp index 78dc4a619d..55881acf48 100644 --- a/src/kits/opengl/GLView.cpp +++ b/src/kits/opengl/GLView.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/src/kits/opengl/Jamfile b/src/kits/opengl/Jamfile index 2f32f033ab..42e54b4fd0 100644 --- a/src/kits/opengl/Jamfile +++ b/src/kits/opengl/Jamfile @@ -3,61 +3,50 @@ SubDir HAIKU_TOP src kits opengl ; SetSubDirSupportedPlatformsBeOSCompatible ; UsePrivateHeaders interface ; -UseLibraryHeaders mesa ; UsePrivateSystemHeaders ; +local sources = + GLView.cpp + GLDispatcher.cpp + GLRenderer.cpp + GLRendererRoster.cpp + ; + + if $(TARGET_PLATFORM) != haiku { UseHeaders [ FDirName $(HAIKU_TOP) headers os opengl ] : true ; # We need our public GL headers also when not compiling for Haiku. } -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa main ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa glapi ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa math ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa tnl ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa shader ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa swrast ] ; -UseHeaders [ FDirName $(HAIKU_TOP) src libs mesa mesa swrast_setup ] ; +SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; +Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ; -{ - local defines ; - defines = BEOS_THREADS GNU_ASSEMBLER ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) include ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa main ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mapi ] ; +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mapi glapi ] ; - if $(TARGET_ARCH) = x86 { - defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; - } else if $(TARGET_ARCH) = ppc { - # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! - # defines += USE_PPC_ASM ; - } else if $(TARGET_ARCH) = sparc { - defines += USE_SPARC_ASM ; - } +# For older versions of Mesa +UseHeaders [ FDirName $(HAIKU_MESA_DIR) src mesa glapi ] ; - defines = [ FDefines $(defines) ] ; - SubDirCcFlags $(defines) ; - SubDirC++Flags $(defines) ; - SubDirAsFlags $(defines) ; +LINKFLAGS on libGL.so = [ on libGL.so return $(LINKFLAGS) ] + -Xlinker --strip-debug -Xlinker --whole-archive -Xlinker -zmuldefs ; + +# For GCC2 +if $(HAIKU_GCC_VERSION[1]) < 3 { + SubDirC++Flags --no-warnings ; } + -SharedLibrary libGL.so : - GLView.cpp - GLDispatcher.cpp - GLRenderer.cpp - GLRendererRoster.cpp - : +SharedLibrary libGL.so : $(sources) : - # Mesa GL API dispatching code - glapi-dispatching.o + # Mesa libraries (from Mesa optional package): + $(HAIKU_MESA_LIBS) - # GLU API is included in libGL.so under BeOS R5, not a separate libglu.so library - sgi-glu.o - - # GLUT API is included in libGL.so under Haiku, not a separate libglut.so library - glut.o - - # External libs: - be - game # BWindowScreen needed by BGLScreen stub class + # External libraries: + be + game # BWindowScreen needed by BGLScreen stub class $(TARGET_LIBSTDC++) ; diff --git a/src/libs/Jamfile b/src/libs/Jamfile index 592c6b38bd..07caf290f7 100644 --- a/src/libs/Jamfile +++ b/src/libs/Jamfile @@ -9,6 +9,7 @@ SubInclude HAIKU_TOP src libs edit ; SubInclude HAIKU_TOP src libs expat ; SubInclude HAIKU_TOP src libs fluidsynth ; SubInclude HAIKU_TOP src libs freetype2 ; +SubInclude HAIKU_TOP src libs glut ; SubInclude HAIKU_TOP src libs gnu ; SubInclude HAIKU_TOP src libs icon ; SubInclude HAIKU_TOP src libs iconv ; @@ -17,7 +18,6 @@ SubInclude HAIKU_TOP src libs libtelnet ; SubInclude HAIKU_TOP src libs linprog ; SubInclude HAIKU_TOP src libs lp_solve ; SubInclude HAIKU_TOP src libs mapm ; -SubInclude HAIKU_TOP src libs mesa ; SubInclude HAIKU_TOP src libs ncurses ; SubInclude HAIKU_TOP src libs pdflib ; SubInclude HAIKU_TOP src libs png ; diff --git a/src/libs/mesa/glut/Jamfile b/src/libs/glut/Jamfile similarity index 95% rename from src/libs/mesa/glut/Jamfile rename to src/libs/glut/Jamfile index 7f80af4e0e..8558018557 100644 --- a/src/libs/mesa/glut/Jamfile +++ b/src/libs/glut/Jamfile @@ -1,4 +1,4 @@ -SubDir HAIKU_TOP src libs mesa glut ; +SubDir HAIKU_TOP src libs glut ; SetSubDirSupportedPlatformsBeOSCompatible ; diff --git a/src/libs/mesa/glut/beos_x11.cpp b/src/libs/glut/beos_x11.cpp similarity index 100% rename from src/libs/mesa/glut/beos_x11.cpp rename to src/libs/glut/beos_x11.cpp diff --git a/src/libs/mesa/glut/beos_x11.h b/src/libs/glut/beos_x11.h similarity index 100% rename from src/libs/mesa/glut/beos_x11.h rename to src/libs/glut/beos_x11.h diff --git a/src/libs/mesa/glut/glutBlocker.cpp b/src/libs/glut/glutBlocker.cpp similarity index 100% rename from src/libs/mesa/glut/glutBlocker.cpp rename to src/libs/glut/glutBlocker.cpp diff --git a/src/libs/mesa/glut/glutBlocker.h b/src/libs/glut/glutBlocker.h similarity index 100% rename from src/libs/mesa/glut/glutBlocker.h rename to src/libs/glut/glutBlocker.h diff --git a/src/libs/mesa/glut/glutCallback.cpp b/src/libs/glut/glutCallback.cpp similarity index 100% rename from src/libs/mesa/glut/glutCallback.cpp rename to src/libs/glut/glutCallback.cpp diff --git a/src/libs/mesa/glut/glutColor.cpp b/src/libs/glut/glutColor.cpp similarity index 100% rename from src/libs/mesa/glut/glutColor.cpp rename to src/libs/glut/glutColor.cpp diff --git a/src/libs/mesa/glut/glutCursor.cpp b/src/libs/glut/glutCursor.cpp similarity index 100% rename from src/libs/mesa/glut/glutCursor.cpp rename to src/libs/glut/glutCursor.cpp diff --git a/src/libs/mesa/glut/glutCursors.h b/src/libs/glut/glutCursors.h similarity index 100% rename from src/libs/mesa/glut/glutCursors.h rename to src/libs/glut/glutCursors.h diff --git a/src/libs/mesa/glut/glutDstr.cpp b/src/libs/glut/glutDstr.cpp similarity index 100% rename from src/libs/mesa/glut/glutDstr.cpp rename to src/libs/glut/glutDstr.cpp diff --git a/src/libs/mesa/glut/glutEvent.cpp b/src/libs/glut/glutEvent.cpp similarity index 100% rename from src/libs/mesa/glut/glutEvent.cpp rename to src/libs/glut/glutEvent.cpp diff --git a/src/libs/mesa/glut/glutGameMode.cpp b/src/libs/glut/glutGameMode.cpp similarity index 100% rename from src/libs/mesa/glut/glutGameMode.cpp rename to src/libs/glut/glutGameMode.cpp diff --git a/src/libs/mesa/glut/glutGameMode.h b/src/libs/glut/glutGameMode.h similarity index 100% rename from src/libs/mesa/glut/glutGameMode.h rename to src/libs/glut/glutGameMode.h diff --git a/src/libs/mesa/glut/glutGet.cpp b/src/libs/glut/glutGet.cpp similarity index 100% rename from src/libs/mesa/glut/glutGet.cpp rename to src/libs/glut/glutGet.cpp diff --git a/src/libs/mesa/glut/glutInit.cpp b/src/libs/glut/glutInit.cpp similarity index 100% rename from src/libs/mesa/glut/glutInit.cpp rename to src/libs/glut/glutInit.cpp diff --git a/src/libs/mesa/glut/glutMenu.cpp b/src/libs/glut/glutMenu.cpp similarity index 100% rename from src/libs/mesa/glut/glutMenu.cpp rename to src/libs/glut/glutMenu.cpp diff --git a/src/libs/mesa/glut/glutMenu.h b/src/libs/glut/glutMenu.h similarity index 100% rename from src/libs/mesa/glut/glutMenu.h rename to src/libs/glut/glutMenu.h diff --git a/src/libs/mesa/glut/glutOverlay.cpp b/src/libs/glut/glutOverlay.cpp similarity index 100% rename from src/libs/mesa/glut/glutOverlay.cpp rename to src/libs/glut/glutOverlay.cpp diff --git a/src/libs/mesa/glut/glutState.h b/src/libs/glut/glutState.h similarity index 100% rename from src/libs/mesa/glut/glutState.h rename to src/libs/glut/glutState.h diff --git a/src/libs/mesa/glut/glutWindow.cpp b/src/libs/glut/glutWindow.cpp similarity index 100% rename from src/libs/mesa/glut/glutWindow.cpp rename to src/libs/glut/glutWindow.cpp diff --git a/src/libs/mesa/glut/glutWindow.h b/src/libs/glut/glutWindow.h similarity index 100% rename from src/libs/mesa/glut/glutWindow.h rename to src/libs/glut/glutWindow.h diff --git a/src/libs/mesa/glut/glut_8x13.c b/src/libs/glut/glut_8x13.c similarity index 100% rename from src/libs/mesa/glut/glut_8x13.c rename to src/libs/glut/glut_8x13.c diff --git a/src/libs/mesa/glut/glut_9x15.c b/src/libs/glut/glut_9x15.c similarity index 100% rename from src/libs/mesa/glut/glut_9x15.c rename to src/libs/glut/glut_9x15.c diff --git a/src/libs/mesa/glut/glut_bitmap.c b/src/libs/glut/glut_bitmap.c similarity index 100% rename from src/libs/mesa/glut/glut_bitmap.c rename to src/libs/glut/glut_bitmap.c diff --git a/src/libs/mesa/glut/glut_bwidth.c b/src/libs/glut/glut_bwidth.c similarity index 100% rename from src/libs/mesa/glut/glut_bwidth.c rename to src/libs/glut/glut_bwidth.c diff --git a/src/libs/mesa/glut/glut_ext.c b/src/libs/glut/glut_ext.c similarity index 100% rename from src/libs/mesa/glut/glut_ext.c rename to src/libs/glut/glut_ext.c diff --git a/src/libs/mesa/glut/glut_hel10.c b/src/libs/glut/glut_hel10.c similarity index 100% rename from src/libs/mesa/glut/glut_hel10.c rename to src/libs/glut/glut_hel10.c diff --git a/src/libs/mesa/glut/glut_hel12.c b/src/libs/glut/glut_hel12.c similarity index 100% rename from src/libs/mesa/glut/glut_hel12.c rename to src/libs/glut/glut_hel12.c diff --git a/src/libs/mesa/glut/glut_hel18.c b/src/libs/glut/glut_hel18.c similarity index 100% rename from src/libs/mesa/glut/glut_hel18.c rename to src/libs/glut/glut_hel18.c diff --git a/src/libs/mesa/glut/glut_mroman.c b/src/libs/glut/glut_mroman.c similarity index 100% rename from src/libs/mesa/glut/glut_mroman.c rename to src/libs/glut/glut_mroman.c diff --git a/src/libs/mesa/glut/glut_roman.c b/src/libs/glut/glut_roman.c similarity index 100% rename from src/libs/mesa/glut/glut_roman.c rename to src/libs/glut/glut_roman.c diff --git a/src/libs/mesa/glut/glut_shapes.c b/src/libs/glut/glut_shapes.c similarity index 100% rename from src/libs/mesa/glut/glut_shapes.c rename to src/libs/glut/glut_shapes.c diff --git a/src/libs/mesa/glut/glut_stroke.c b/src/libs/glut/glut_stroke.c similarity index 100% rename from src/libs/mesa/glut/glut_stroke.c rename to src/libs/glut/glut_stroke.c diff --git a/src/libs/mesa/glut/glut_swidth.c b/src/libs/glut/glut_swidth.c similarity index 100% rename from src/libs/mesa/glut/glut_swidth.c rename to src/libs/glut/glut_swidth.c diff --git a/src/libs/mesa/glut/glut_teapot.c b/src/libs/glut/glut_teapot.c similarity index 100% rename from src/libs/mesa/glut/glut_teapot.c rename to src/libs/glut/glut_teapot.c diff --git a/src/libs/mesa/glut/glut_tr10.c b/src/libs/glut/glut_tr10.c similarity index 100% rename from src/libs/mesa/glut/glut_tr10.c rename to src/libs/glut/glut_tr10.c diff --git a/src/libs/mesa/glut/glut_tr24.c b/src/libs/glut/glut_tr24.c similarity index 100% rename from src/libs/mesa/glut/glut_tr24.c rename to src/libs/glut/glut_tr24.c diff --git a/src/libs/mesa/glut/glut_util.c b/src/libs/glut/glut_util.c similarity index 100% rename from src/libs/mesa/glut/glut_util.c rename to src/libs/glut/glut_util.c diff --git a/src/libs/mesa/glut/glut_vidresize.c b/src/libs/glut/glut_vidresize.c similarity index 100% rename from src/libs/mesa/glut/glut_vidresize.c rename to src/libs/glut/glut_vidresize.c diff --git a/src/libs/mesa/glut/glutbitmap.h b/src/libs/glut/glutbitmap.h similarity index 100% rename from src/libs/mesa/glut/glutbitmap.h rename to src/libs/glut/glutbitmap.h diff --git a/src/libs/mesa/glut/glutint.h b/src/libs/glut/glutint.h similarity index 100% rename from src/libs/mesa/glut/glutint.h rename to src/libs/glut/glutint.h diff --git a/src/libs/mesa/glut/glutstroke.h b/src/libs/glut/glutstroke.h similarity index 100% rename from src/libs/mesa/glut/glutstroke.h rename to src/libs/glut/glutstroke.h diff --git a/src/libs/mesa/Jamfile b/src/libs/mesa/Jamfile deleted file mode 100644 index 11c0a70763..0000000000 --- a/src/libs/mesa/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir HAIKU_TOP src libs mesa ; - -SubInclude HAIKU_TOP src libs mesa glu ; -SubInclude HAIKU_TOP src libs mesa glut ; -SubInclude HAIKU_TOP src libs mesa mesa ; diff --git a/src/libs/mesa/glu/Jamfile b/src/libs/mesa/glu/Jamfile deleted file mode 100644 index 5835d628b1..0000000000 --- a/src/libs/mesa/glu/Jamfile +++ /dev/null @@ -1,124 +0,0 @@ -SubDir HAIKU_TOP src libs mesa glu ; - -SetSubDirSupportedPlatformsBeOSCompatible ; - -if $(TARGET_PLATFORM) != haiku { - UseHeaders [ FDirName $(HAIKU_TOP) headers os opengl ] : true ; - # We need our public GL headers also when not compiling for Haiku. -} - -UseHeaders [ FDirName $(SUBDIR) include ] ; -UseHeaders [ FDirName $(SUBDIR) libnurbs interface ] ; -UseHeaders [ FDirName $(SUBDIR) libnurbs internals ] ; -UseHeaders [ FDirName $(SUBDIR) libnurbs nurbtess ] ; - -SubDirCcFlags -DNDEBUG -DLIBRARYBUILD ; -SubDirC++Flags -DNDEBUG -DLIBRARYBUILD ; - -SEARCH_SOURCE += [ FDirName $(SUBDIR) libutil ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) libtess ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) libnurbs interface ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) libnurbs internals ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) libnurbs nurbtess ] ; - -MergeObject sgi-glu.o : - - # libutil - error.c - glue.c - mipmap.c - project.c - quad.c - registry.c - - # libtess - dict.c - geom.c - memalloc.c - mesh.c - normal.c - priorityq.c - render.c - sweep.c - tess.c - tessmono.c - - # libnurbs/interface - bezierEval.cc - bezierPatch.cc - bezierPatchMesh.cc - glcurveval.cc - glinterface.cc - glrenderer.cc - glsurfeval.cc - incurveeval.cc - insurfeval.cc - - # libnurbs/internals - arc.cc - arcsorter.cc - arctess.cc - backend.cc - basiccrveval.cc - basicsurfeval.cc - bin.cc - bufpool.cc - cachingeval.cc - ccw.cc - coveandtiler.cc - curve.cc - curvelist.cc - curvesub.cc - dataTransform.cc - displaylist.cc - flist.cc - flistsorter.cc - hull.cc - intersect.cc - knotvector.cc - mapdesc.cc - mapdescv.cc - maplist.cc - mesher.cc - monoTriangulationBackend.cc - monotonizer.cc - mycode.cc - nurbsinterfac.cc - nurbstess.cc - patch.cc - patchlist.cc - quilt.cc - reader.cc - renderhints.cc - slicer.cc - sorter.cc - splitarcs.cc - subdivider.cc - tobezier.cc - trimline.cc - trimregion.cc - trimvertpool.cc - uarray.cc - varray.cc - - # libnurbs/nurbtess - directedLine.cc - gridWrap.cc - monoChain.cc - monoPolyPart.cc - monoTriangulation.cc - partitionX.cc - partitionY.cc - polyDBG.cc - polyUtil.cc - primitiveStream.cc - quicksort.cc - rectBlock.cc - sampleComp.cc - sampleCompBot.cc - sampleCompRight.cc - sampleCompTop.cc - sampleMonoPoly.cc - sampledLine.cc - searchTree.cc -; diff --git a/src/libs/mesa/glu/include/gluos.h b/src/libs/mesa/glu/include/gluos.h deleted file mode 100644 index 8eaa7a153b..0000000000 --- a/src/libs/mesa/glu/include/gluos.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -** gluos.h - operating system dependencies for GLU -** -*/ -#ifdef __VMS -#ifdef __cplusplus -#pragma message disable nocordel -#pragma message disable codeunreachable -#pragma message disable codcauunr -#endif -#endif - -#ifdef __WATCOMC__ -/* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the - * code at the moment, as it is pretty ugly. - */ -#pragma warning 7 10 -#pragma warning 13 10 -#pragma warning 14 10 -#pragma warning 367 10 -#pragma warning 379 10 -#pragma warning 726 10 -#pragma warning 836 10 -#endif - -#ifdef BUILD_FOR_SNAP - -#include -#include -#include - -#elif defined(_WIN32) - -#include /* For _MAX_PATH definition */ -#include -#include - -#define WIN32_LEAN_AND_MEAN -#define NOGDI -#define NOIME -#define NOMINMAX - -#define _WIN32_WINNT 0x0400 -#ifndef STRICT - #define STRICT 1 -#endif - -#include - -/* Disable warnings */ -#pragma warning(disable : 4101) -#pragma warning(disable : 4244) -#pragma warning(disable : 4761) - -#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300 -#pragma comment(linker, "/OPT:NOWIN98") -#endif - -#elif defined(__OS2__) - -#include -#include -#include -#define WINGDIAPI - -#else - -/* Disable Microsoft-specific keywords */ -#define GLAPIENTRY -#define WINGDIAPI - -#endif diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierEval.cc b/src/libs/mesa/glu/libnurbs/interface/bezierEval.cc deleted file mode 100644 index b414f535f9..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierEval.cc +++ /dev/null @@ -1,260 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include -#include -#include "bezierEval.h" - -#ifdef __WATCOMC__ -#pragma warning 14 10 -#endif - -#define TOLERANCE 0.0001 - -#ifndef MAX_ORDER -#define MAX_ORDER 16 -#endif - -#ifndef MAX_DIMENSION -#define MAX_DIMENSION 4 -#endif - -static void normalize(float vec[3]); -static void crossProduct(float x[3], float y[3], float ret[3]); -#if 0 // UNUSED -static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]); -#endif - -static float binomialCoefficients[8][8] = { - {1,0,0,0,0,0,0,0}, - {1,1,0,0,0,0,0,0}, - {1,2,1,0,0,0,0,0}, - {1,3,3,1,0,0,0,0}, - {1,4,6,4,1,0,0,0}, - {1,5,10,10,5,1,0,0}, - {1,6,15,20,15,6,1,0}, - {1,7,21,35,35,21,7,1} -}; - -void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) -{ - float uprime = (u-u0)/(u1-u0); - float *ctlptr = ctlpoints; - float oneMinusX = 1.0f-uprime; - float XPower = 1.0f; - - int i,k; - for(k=0; k=1. - */ -void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) -{ - float uprime = (u-u0)/(u1-u0); - float buf[MAX_ORDER][MAX_ORDER][MAX_DIMENSION]; - float* ctlptr = ctlpoints; - int r, i,j; - for(i=0; i=1. - */ -void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]) -{ - int i,k; - float width = u1-u0; - float *ctlptr = ctlpoints; - - float buf[MAX_ORDER][MAX_DIMENSION]; - if(order == 1){ - for(k=0; k=3 && dimension <=4); - bezierSurfEvalDerGen(1,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialU); - bezierSurfEvalDerGen(0,1, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialV); - - if(dimension == 3){/*inhomogeneous*/ - crossProduct(partialU, partialV, retNormal); - - normalize(retNormal); - - return; - } - else { /*homogeneous*/ - float val[4]; /*the point coordinates (without derivative)*/ - float newPartialU[MAX_DIMENSION]; - float newPartialV[MAX_DIMENSION]; - int i; - bezierSurfEvalDerGen(0,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, val); - - for(i=0; i<=2; i++){ - newPartialU[i] = partialU[i] * val[3] - val[i] * partialU[3]; - newPartialV[i] = partialV[i] * val[3] - val[i] * partialV[3]; - } - crossProduct(newPartialU, newPartialV, retNormal); - normalize(retNormal); - } -} - -/*if size is 0, then nothing is done*/ -static void normalize(float vec[3]) -{ - float size = (float)sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]); - - if(size < TOLERANCE) - { -#ifdef DEBUG - fprintf(stderr, "Warning: in oglBSpline.c normal is 0\n"); -#endif - return; - } - else { - vec[0] = vec[0]/size; - vec[1] = vec[1]/size; - vec[2] = vec[2]/size; - } -} - - -static void crossProduct(float x[3], float y[3], float ret[3]) -{ - ret[0] = x[1]*y[2] - y[1]*x[2]; - ret[1] = x[2]*y[0] - y[2]*x[0]; - ret[2] = x[0]*y[1] - y[0]*x[1]; - -} - diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierEval.h b/src/libs/mesa/glu/libnurbs/interface/bezierEval.h deleted file mode 100644 index 93e8c69d12..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierEval.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _BEZIEREVAL_H -#define _BEZIEREVAL_H - -void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]); -void bezierCurveEvalDer(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]); -void bezierCurveEvalDerGen(int der, float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retDer[]); - - -void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]); - -void bezierSurfEval(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]); - -void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float retNormal[]); - - -#endif diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierPatch.cc b/src/libs/mesa/glu/libnurbs/interface/bezierPatch.cc deleted file mode 100644 index dbab3a1a2b..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierPatch.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include /*for drawing bzier patch*/ -#include "bezierPatch.h" -#include "bezierEval.h" - -/* - *allocate an instance of bezierPatch. The control points are unknown. But - *the space of this array is allocated with size of - * uorder*vorder*dimension - * - */ -bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension) -{ - bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch)); - assert(ret); - ret->umin = umin; - ret->vmin = vmin; - ret->umax = umax; - ret->vmax = vmax; - ret->uorder = uorder; - ret->vorder = vorder; - ret->dimension = dimension; - ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder); - assert(ret->ctlpoints); - - ret->next = NULL; - - return ret; -} - -bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int uorder, int vorder, int dimension, int ustride, int vstride, float* ctlpoints) -{ - bezierPatch* ret = (bezierPatch*) malloc(sizeof(bezierPatch)); - assert(ret); - ret->umin = umin; - ret->vmin = vmin; - ret->umax = umax; - ret->vmax = vmax; - ret->uorder = uorder; - ret->vorder = vorder; - ret->dimension = dimension; - ret->ctlpoints = (float*) malloc(sizeof(float) * dimension * uorder * vorder); - assert(ret->ctlpoints); - - /*copy the control points there*/ - int the_ustride = vorder * dimension; - int the_vstride = dimension; - for(int i=0; ictlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; - - ret->next = NULL; - - return ret; -} - -/* - *deallocate the space as allocated by Make - */ -void bezierPatchDelete(bezierPatch *b) -{ - free(b->ctlpoints); - free(b); -} - -/*delete the whole linked list - */ -void bezierPatchDeleteList(bezierPatch *b) -{ - bezierPatch *temp; - while (b != NULL) { - temp = b; - b = b->next; - bezierPatchDelete(temp); - } -} - -bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b) -{ - b->next = list; - return b; -} - -/*print the data stored in this patch*/ -void bezierPatchPrint(bezierPatch *b) -{ - printf("bezierPatch:\n"); - printf("umin,umax=(%f,%f), (vmin, vmax)=(%f,%f)\n", b->umin, b->umax, b->vmin, b->vmax); - printf("uorder=%i, vorder=%i\n", b->uorder, b->vorder); - printf("idmension = %i\n", b->dimension); -} - -/*print the whole list*/ -void bezierPatchPrintList(bezierPatch *list) -{ - bezierPatch* temp; - for(temp=list; temp != NULL; temp = temp->next) - bezierPatchPrint(temp); -} - -void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]) -{ - if( u >= b->umin && u<= b->umax - && v >= b->vmin && v<= b->vmax) - { - - bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); - - } - else if(b->next != NULL) - bezierPatchEval(b->next, u,v, ret); - else - bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); -} - -/*the returned normal is normlized - */ -void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]) -{ - bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); - - if( u >= b->umin && u<= b->umax - && v >= b->vmin && v<= b->vmax) - { - bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); - } - else if(b->next != NULL) - bezierPatchEvalNormal(b->next, u,v, ret); - else - bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); - -} - -void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso) -{ - if(bpatch->dimension == 3) - glMap2f(GL_MAP2_VERTEX_3, bpatch->umin, bpatch->umax, 3*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); - else - glMap2f(GL_MAP2_VERTEX_4, bpatch->umin, bpatch->umax, 4*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); - - glMapGrid2f(u_reso, bpatch->umin, bpatch->umax, - v_reso, bpatch->vmin, bpatch->vmax); - glEvalMesh2(GL_LINE, 0, u_reso, 0, v_reso); -} - -void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso) -{ - bezierPatch *temp; -glEnable(GL_LIGHTING); -glEnable(GL_LIGHT0); -glEnable(GL_MAP2_VERTEX_3); -glEnable(GL_AUTO_NORMAL); -glEnable(GL_NORMALIZE); -glColor3f(1,0,0); -#ifdef DEBUG -printf("mapmap\n"); -#endif - - - for(temp = list; temp != NULL; temp = temp->next) - bezierPatchDraw(temp, u_reso, v_reso); -} - - - diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierPatch.h b/src/libs/mesa/glu/libnurbs/interface/bezierPatch.h deleted file mode 100644 index 981183afae..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierPatch.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _BEZIERPATCH_H -#define _BEZIERPATCH_H - -typedef struct bezierPatch{ - float umin, vmin, umax, vmax; - int uorder; /*order= degree + 1*/ - int vorder; - - /* - *the control points are stored in a one dimensional array. - *the surface is defined as: - * s(u,v) = sum_{i,j} P(i,j) * B_i(u) * B_j(v). - *where P(i,j) are the control points, B_i(.) are Bezier - *basis functions. - *Each control point can have dimension 3 or 4: (x,y,z,w). - *The components of P(i,j) are stored in a one dimensional - *array: - * ctlpoints[] - *in the order of: - * P[0,0], P[0,1], ..., P[0,vorder-1], - * P[1,0], P[1,1], ..., P[1,vorder-1], - * ... - * P[uorder-1,0], P[uorder-1,1], ..., P[uorder-1,vorder-1]. - */ - int dimension; - float* ctlpoints; - - /* - *in case we have to manage multiple bezierPatches. - */ - struct bezierPatch *next; - -} bezierPatch; - -#ifdef __cplusplus -extern "C" { -#endif - -bezierPatch* bezierPatchMake(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension); - -bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, int urder, int vorder, int dimension, int ustride, int vstride, float *ctlpoints); - - -bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b); - -void bezierPatchDelete(bezierPatch *b); - -void bezierPatchDeleteList(bezierPatch *b); - -void bezierPatchPrint(bezierPatch *b); - -void bezierPatchPrintList(bezierPatch *list); - -void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]); - -void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float retNormal[]); - -void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]); - -void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]); - - -void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso); - -void bezierPatchListDraw(bezierPatch *list, int u_reso, int v_reso); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.cc b/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.cc deleted file mode 100644 index ac7ff84fc4..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.cc +++ /dev/null @@ -1,610 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include -#include "bezierEval.h" -#include "bezierPatchMesh.h" - -static int isDegenerate(float A[2], float B[2], float C[2]); - -void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips) -{ - int i,j,k; - k=0; - /*k is the index of the first component of the current vertex*/ - for(i=0; inext) - { - bezierPatchMeshDelDeg(temp); - } -} - -void bezierPatchMeshListDelete(bezierPatchMesh *list) -{ - if(list == NULL) return; - bezierPatchMeshListDelete(list->next); - bezierPatchMeshDelete(list); -} - - - - -bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list) -{ - bezierPatchMesh* ret=NULL; - bezierPatchMesh* temp; - bezierPatchMesh* nextone; - for(temp = list; temp != NULL; temp = nextone) - { - nextone = temp->next; - ret=bezierPatchMeshListInsert(ret, temp); - } - return ret; -} - -/*maptype is either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 - */ -bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array) -{ - int i,j,k; - int dimension; - int the_ustride; - int the_vstride; - - if(maptype == GL_MAP2_VERTEX_3) dimension = 3; - else if (maptype==GL_MAP2_VERTEX_4) dimension = 4; - else { - fprintf(stderr, "error in inMap2f, maptype=%i is wrong, maptype,map is invalid\n", maptype); - return NULL; - } - - bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); - assert(ret); - - ret->bpatch_normal = NULL; - ret->bpatch_color = NULL; - ret->bpatch_texcoord = NULL; - ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension); - - /*copy the control points there*/ - the_ustride = vorder * dimension; - the_vstride = dimension; - for(i=0; ibpatch->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; - - - ret->size_UVarray = size_UVarray; - ret->size_length_array = size_length_array; - ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); - assert(ret->UVarray); - ret->length_array = (int *)malloc(sizeof(int) * size_length_array); - assert(ret->length_array); - ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); - assert(ret->type_array); - - ret->index_UVarray = 0; - ret->index_length_array = 0; - - ret->vertex_array = NULL; - ret->normal_array = NULL; - ret->color_array = NULL; - ret->texcoord_array = NULL; - - ret->next = NULL; - return ret; -} - -bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array) -{ - bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); - assert(ret); - - ret->bpatch = NULL; - ret->bpatch_normal = NULL; - ret->bpatch_color = NULL; - ret->bpatch_texcoord = NULL; - - ret->size_UVarray = size_UVarray; - ret->size_length_array = size_length_array; - ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); - assert(ret->UVarray); - ret->length_array = (int *)malloc(sizeof(int) * size_length_array); - assert(ret->length_array); - ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); - assert(ret->type_array); - - ret->index_UVarray = 0; - ret->index_length_array = 0; - - ret->vertex_array = NULL; - ret->normal_array = NULL; - ret->color_array = NULL; - ret->texcoord_array = NULL; - - ret->next = NULL; - return ret; -} - -void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints) -{ - switch(maptype){ - case GL_MAP2_VERTEX_3: - bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); - break; - case GL_MAP2_VERTEX_4: - bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4,ustride, vstride, ctlpoints ); - break; - case GL_MAP2_NORMAL: - bpm->bpatch_normal = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); - break; - case GL_MAP2_INDEX: - bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); - break; - case GL_MAP2_COLOR_4: - bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); - break; - case GL_MAP2_TEXTURE_COORD_1: - bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); - break; - case GL_MAP2_TEXTURE_COORD_2: - bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 2, ustride, vstride, ctlpoints); - break; - case GL_MAP2_TEXTURE_COORD_3: - bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); - break; - case GL_MAP2_TEXTURE_COORD_4: - bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); - break; - default: - fprintf(stderr, "error in bezierPatchMeshPutPatch, maptype=%i is wrong, maptype,map is invalid\n", maptype); - } -} - - -/*delete everything including the arrays. So if you want to output the - *pointers of the arrays, you should not use this function to deallocate space. - *you should dealocate manually - */ -void bezierPatchMeshDelete(bezierPatchMesh *bpm) -{ - if(bpm->bpatch != NULL) - bezierPatchDelete(bpm->bpatch); - if(bpm->bpatch_normal != NULL) - bezierPatchDelete(bpm->bpatch_normal); - if(bpm->bpatch_color != NULL) - bezierPatchDelete(bpm->bpatch_color); - if(bpm->bpatch_texcoord != NULL) - bezierPatchDelete(bpm->bpatch_texcoord); - - free(bpm->UVarray); - free(bpm->length_array); - free(bpm->vertex_array); - free(bpm->normal_array); - free(bpm->type_array); - free(bpm); -} - -/*begin a strip - *type is the primitive type: - */ -void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type) -{ - bpm->counter = 0; - bpm->type = type; -} - -/*signal the end of the current strip*/ -void bezierPatchMeshEndStrip(bezierPatchMesh *bpm) -{ - int i; - - /*if there are no vertices in this strip, then nothing needs to be done*/ - if(bpm->counter == 0) return; - - /*if the length_array is full, it should be expanded*/ - if(bpm->index_length_array >= bpm->size_length_array) - { - int *temp = (int*) malloc(sizeof(int) * (bpm->size_length_array*2 + 1)); - assert(temp); - GLenum *temp_type = (GLenum*) malloc(sizeof(GLenum) * (bpm->size_length_array*2 + 1)); - assert(temp_type); - /*update the size*/ - bpm->size_length_array = bpm->size_length_array*2 + 1; - - /*copy*/ - for(i=0; iindex_length_array; i++) - { - temp[i] = bpm->length_array[i]; - temp_type[i] = bpm->type_array[i]; - } - - /*deallocate old array*/ - free(bpm->length_array); - free(bpm->type_array); - - /*point to the new array which is twice as bigger*/ - bpm->length_array = temp; - bpm->type_array = temp_type; - } - bpm->type_array[bpm->index_length_array] = bpm->type; - bpm->length_array[bpm->index_length_array++] = bpm->counter; - -} - -/*insert (u,v) */ -void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v) -{ - int i; - /*if the UVarray is full, it should be expanded*/ - if(bpm->index_UVarray+1 >= bpm->size_UVarray) - { - float *temp = (float*) malloc(sizeof(float) * (bpm->size_UVarray * 2 + 2)); - assert(temp); - - /*update the size*/ - bpm->size_UVarray = bpm->size_UVarray*2 + 2; - - /*copy*/ - for(i=0; iindex_UVarray; i++) - { - temp[i] = bpm->UVarray[i]; - } - - /*deallocate old array*/ - free(bpm->UVarray); - - /*pointing to the new arrays*/ - bpm->UVarray = temp; - } - /*insert the new UV*/ - bpm->UVarray[bpm->index_UVarray] = u; - bpm->index_UVarray++; - bpm->UVarray[bpm->index_UVarray] = v; - bpm->index_UVarray++; - - /*update counter: one more vertex*/ - bpm->counter++; - - -} - -void bezierPatchMeshPrint(bezierPatchMesh *bpm) -{ - int i; - printf("the bezier patch is\n"); - bezierPatchPrint(bpm->bpatch); - printf("index_length_array= %i\n", bpm->index_length_array); - printf("size_length_array =%i\n", bpm->size_length_array); - printf("index_UVarray =%i\n", bpm->index_UVarray); - printf("size_UVarray =%i\n", bpm->size_UVarray); - printf("UVarray is\n"); - for(i=0; iindex_UVarray; i++) - printf("%f ", bpm->UVarray[i]); - - printf("length_array is\n"); - for(i=0; iindex_length_array; i++) - printf("%i ", bpm->length_array[i]); - printf("\n"); - -} - -/*insert a new patch in front of the current linked list and return the new list*/ -bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm) -{ - bpm->next=list; - return bpm; -} - -/*print all the patches*/ -void bezierPatchMeshListPrint(bezierPatchMesh* list) -{ - bezierPatchMesh *temp; - for(temp = list; temp != NULL; temp = temp->next) - { - bezierPatchMeshPrint(temp); - } -} - -int bezierPatchMeshListTotalStrips(bezierPatchMesh* list) -{ - int sum=0; - bezierPatchMesh *temp; - for(temp=list; temp != NULL; temp = temp->next) - { - sum += temp->index_length_array; - } - return sum; -} - -int bezierPatchMeshListTotalVert(bezierPatchMesh* list) -{ - int sum=0; - bezierPatchMesh *temp; - for(temp=list; temp != NULL; temp = temp->next) - { - sum += temp->index_UVarray; - } - return sum/2; -} - -int bezierPatchMeshListNumTriangles(bezierPatchMesh* list) -{ - int sum=0; - bezierPatchMesh* temp; - for(temp=list; temp != NULL; temp = temp->next) - { - sum += bezierPatchMeshNumTriangles(temp); - } - return sum; -} - -int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm) -{ - int i; - int sum=0; - for(i=0; iindex_length_array; i++) - { - switch(bpm->type_array[i]) - { - case GL_TRIANGLES: - sum += bpm->length_array[i]/3; - break; - case GL_TRIANGLE_FAN: - if(bpm->length_array[i] > 2) - sum += bpm->length_array[i]-2; - break; - case GL_TRIANGLE_STRIP: - if(bpm->length_array[i] > 2) - sum += bpm->length_array[i]-2; - break; - case GL_QUAD_STRIP: - if(bpm->length_array[i]>2) - sum += (bpm->length_array[i]-2); - break; - default: - fprintf(stderr,"error in bezierPatchMeshListNumTriangles, type invalid\n"); - } - } - return sum; -} - -/*delete degenerate triangles*/ -void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) -{ - if(bpm == NULL) return; - int i,j,k; - int *new_length_array; - GLenum *new_type_array; - int index_new_length_array; - float *new_UVarray; - int index_new_UVarray; - - new_length_array = (int*)malloc(sizeof(int) * bpm->index_length_array); - assert(new_length_array); - new_type_array = (GLenum*)malloc(sizeof(GLenum) * bpm->index_length_array); - assert(new_length_array); - new_UVarray = (float*) malloc(sizeof(float) * bpm->index_UVarray); - assert(new_UVarray); - - index_new_length_array = 0; - index_new_UVarray=0; - k=0; - for(i=0; iindex_length_array; i++){ - - /*(if not degenerate, we have to copy*/ - if( (bpm->length_array[i] != 3) || (!isDegenerate(bpm->UVarray+k, bpm->UVarray+k+2, bpm->UVarray+k+4))) - { - for(j=0; j<2* bpm->length_array[i]; j++) - new_UVarray[index_new_UVarray++] = bpm->UVarray[k++]; - - new_length_array[index_new_length_array] = bpm->length_array[i]; - new_type_array[index_new_length_array] = bpm->type_array[i]; - index_new_length_array++; - } - else - { - k += 6; - } - } - free(bpm->UVarray); - free(bpm->length_array); - free(bpm->type_array); - bpm->UVarray=new_UVarray; - bpm->length_array=new_length_array; - bpm->type_array=new_type_array; - bpm->index_UVarray = index_new_UVarray; - bpm->index_length_array = index_new_length_array; - -} - -/*(u,v) to XYZ - *the xyz and normals are stored in vertex_array, - *and normal_array. the spaces of both are allocated here - */ -void bezierPatchMeshEval(bezierPatchMesh* bpm) -{ - int i,j,k,l; - float u,v; - float u0 = bpm->bpatch->umin; - float u1 = bpm->bpatch->umax; - int uorder = bpm->bpatch->uorder; - float v0 = bpm->bpatch->vmin; - float v1 = bpm->bpatch->vmax; - int vorder = bpm->bpatch->vorder; - int dimension = bpm->bpatch->dimension; - int ustride = dimension * vorder; - int vstride = dimension; - float *ctlpoints = bpm->bpatch->ctlpoints; - - bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); - assert(bpm->vertex_array); - bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); - assert(bpm->normal_array); - - k=0; - l=0; - for(i=0; iindex_length_array; i++) - { - for(j=0; jlength_array[i]; j++) - { - u = bpm->UVarray[k]; - v = bpm->UVarray[k+1]; - bezierSurfEval(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->vertex_array+l); - bezierSurfEvalNormal(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->normal_array+l); - k += 2; - l += 3; - } - } -} - -void bezierPatchMeshListEval(bezierPatchMesh* list) -{ - bezierPatchMesh* temp; - for(temp = list; temp != NULL; temp = temp->next) - { - bezierPatchMeshEval(temp); - } -} - -void bezierPatchMeshDraw(bezierPatchMesh* bpm) -{ - int i,j,k; - k=0; - /*k is the index of the first component of the current vertex*/ - for(i=0; iindex_length_array; i++) - { - glBegin(bpm->type_array[i]); - for(j=0; jlength_array[i]; j++) - { - glNormal3fv(bpm->normal_array+k); - glVertex3fv(bpm->vertex_array+k); - k+= 3; - } - glEnd(); - } -} - -void bezierPatchMeshListDraw(bezierPatchMesh* list) -{ - bezierPatchMesh* temp; - for(temp = list; temp != NULL; temp = temp->next) - { - bezierPatchMeshDraw(temp); - } -} - -void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips) -{ - int i,j,k,l; - bezierPatchMesh *temp; - int total_num_vertices = bezierPatchMeshListTotalVert(list); - (*vertex_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); - assert(*vertex_array); - (*normal_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); - assert(*normal_array); - - *num_strips = bezierPatchMeshListTotalStrips(list); - - *length_array = (int*) malloc(sizeof(int) * (*num_strips)); - assert(*length_array); - - *type_array = (GLenum*) malloc(sizeof(GLenum) * (*num_strips)); - assert(*type_array); - - k=0; - l=0; - for(temp = list; temp != NULL; temp = temp->next) - { - int x=0; - for(i=0; iindex_length_array; i++) - { - for(j=0; jlength_array[i]; j++) - { - (*vertex_array)[k] = temp->vertex_array[x]; - (*vertex_array)[k+1] = temp->vertex_array[x+1]; - (*vertex_array)[k+2] = temp->vertex_array[x+2]; - - (*normal_array)[k] = temp->normal_array[x]; - (*normal_array)[k+1] = temp->normal_array[x+1]; - (*normal_array)[k+2] = temp->normal_array[x+2]; - - x += 3; - k += 3; - } - (*type_array)[l] = temp->type_array[i]; - (*length_array)[l++] = temp->length_array[i]; - } - } -} - - - -static int isDegenerate(float A[2], float B[2], float C[2]) -{ - if( (A[0] == B[0] && A[1]==B[1]) || - (A[0] == C[0] && A[1]==C[1]) || - (B[0] == C[0] && B[1]==C[1]) - ) - return 1; - else - return 0; -} - - - - diff --git a/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.h b/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.h deleted file mode 100644 index 449329665c..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/bezierPatchMesh.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _BEZIERPATCHMESH_H -#define _BEZIERPATCHMESH_H - -#include "bezierPatch.h" - -typedef struct bezierPatchMesh{ - bezierPatch *bpatch; /*vertex*/ - bezierPatch *bpatch_normal; - bezierPatch *bpatch_texcoord; /*s,t,r,q*/ - bezierPatch *bpatch_color; /*RGBA*/ - - float *UVarray; /*all UV components of all vertices of all strips*/ - int *length_array; /*[i] is the number of vertices in the ith strip*/ - GLenum *type_array; /*[i] is the type of the ith primitive*/ - - /*to support dynamic insertion*/ - int size_UVarray; - int index_UVarray; - int size_length_array; - int index_length_array; - - int counter; /*track the current strip size*/ - GLenum type; /*track the current type: 0: GL_TRIANGLES, 1: GL_TRIANGLE_STRIP*/ - - /*we eventually want to evaluate from (u,v) to (x,y,z) and draw them*/ - float *vertex_array; /*each vertex contains three components*/ - float *normal_array; /*each normal contains three components*/ - float *color_array; - float *texcoord_array; - - /*in case we need a linked list*/ - struct bezierPatchMesh *next; -} bezierPatchMesh; - -#ifdef __cplusplus -extern "C" { -#endif - - - -bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array); - -/*initilize patches to be null*/ -bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array); - -void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints); - -void bezierPatchMeshDelete(bezierPatchMesh *bpm); - -void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type); - -void bezierPatchMeshEndStrip(bezierPatchMesh *bpm); - -void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v); - -void bezierPatchMeshPrint(bezierPatchMesh *bpm); - -bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm); - -void bezierPatchMeshListPrint(bezierPatchMesh* list); - -int bezierPatchMeshListTotalStrips(bezierPatchMesh* list); - -int bezierPatchMeshListTotalVert(bezierPatchMesh* list); -int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm); -int bezierPatchMeshListNumTriangles(bezierPatchMesh* list); - -void bezierPatchMeshDelDeg(bezierPatchMesh* bpm); - - -void bezierPatchMeshEval(bezierPatchMesh* bpm); - -void bezierPatchMeshDraw(bezierPatchMesh* bpm); - -void bezierPatchMeshListDraw(bezierPatchMesh* list); -void bezierPatchMeshListEval(bezierPatchMesh* list); -void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips); - -void bezierPatchMeshListDelDeg(bezierPatchMesh* list); -void bezierPatchMeshListDelete(bezierPatchMesh *list); -bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list); -void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/libs/mesa/glu/libnurbs/interface/glcurveval.cc b/src/libs/mesa/glu/libnurbs/interface/glcurveval.cc deleted file mode 100644 index b6591dba0d..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glcurveval.cc +++ /dev/null @@ -1,402 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * glcurveval.c++ - * - */ - -/* Polynomial Evaluator Interface */ - -#include "gluos.h" -#include "glimports.h" -#include "glrenderer.h" -#include "glcurveval.h" -#include "nurbsconsts.h" - -OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) -{ - //no default callback functions - beginCallBackN = NULL; - endCallBackN = NULL; - vertexCallBackN = NULL; - normalCallBackN = NULL; - colorCallBackN = NULL; - texcoordCallBackN = NULL; - beginCallBackData = NULL; - endCallBackData = NULL; - vertexCallBackData = NULL; - normalCallBackData = NULL; - colorCallBackData = NULL; - texcoordCallBackData = NULL; - - userData = NULL; - - vertex_flag = 0; - normal_flag = 0; - color_flag = 0; - texcoord_flag = 0; - - em_vertex.uprime = -1.0; - em_normal.uprime = -1.0; - em_color.uprime = -1.0; - em_texcoord.uprime = -1.0; - output_triangles = 0; // don't output triangles by default -} - -OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void) -{ -} - -/* added nonsense to avoid the warning messages at compile time */ -void -OpenGLCurveEvaluator::addMap(CurveMap *m) -{ - m = m; -} - -void -OpenGLCurveEvaluator::range1f(long type, REAL *from, REAL *to) -{ - type = type; - from = from; - to = to; -} - -void -OpenGLCurveEvaluator::domain1f(REAL ulo, REAL uhi) -{ - ulo = ulo; - uhi = uhi; -} - -void -OpenGLCurveEvaluator::bgnline(void) -{ - if(output_triangles) - beginCallBack(GL_LINE_STRIP, userData); - else - glBegin((GLenum) GL_LINE_STRIP); -} - -void -OpenGLCurveEvaluator::endline(void) -{ - if(output_triangles) - endCallBack(userData); - else - glEnd(); -} - -/*--------------------------------------------------------------------------- - * disable - turn off a curve map - *--------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::disable(long type) -{ - glDisable((GLenum) type); -} - -/*--------------------------------------------------------------------------- - * enable - turn on a curve map - *--------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::enable(long type) -{ - glEnable((GLenum) type); -} - -/*------------------------------------------------------------------------- - * mapgrid1f - define a lattice of points with origin and offset - *------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::mapgrid1f(long nu, REAL u0, REAL u1) -{ - if(output_triangles) - { - global_grid_u0 = u0; - global_grid_u1 = u1; - global_grid_nu = (int) nu; - } - else - glMapGrid1f((GLint) nu, (GLfloat) u0, (GLfloat) u1); -} - -/*------------------------------------------------------------------------- - * bgnmap1 - preamble to curve definition and evaluations - *------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::bgnmap1f(long) -{ - if(output_triangles) - { - //initialized so that no maps are set initially - vertex_flag = 0; - normal_flag = 0; - color_flag = 0; - texcoord_flag = 0; - //no need to worry about gl states when doing callback - } - else - glPushAttrib((GLbitfield) GL_EVAL_BIT); -} - -/*------------------------------------------------------------------------- - * endmap1 - postamble to a curve map - *------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::endmap1f(void) -{ - if(output_triangles) - { - - } - else - glPopAttrib(); -} - -/*------------------------------------------------------------------------- - * map1f - pass a desription of a curve map - *------------------------------------------------------------------------- - */ -void -OpenGLCurveEvaluator::map1f( - long type, /* map type */ - REAL ulo, /* lower parametric bound */ - REAL uhi, /* upper parametric bound */ - long stride, /* distance to next point in REALS */ - long order, /* parametric order */ - REAL *pts /* control points */ -) -{ - if(output_triangles) - { - int dimension = 0; - int which = 0; - switch(type){ - case GL_MAP1_VERTEX_3: - which = 0; - dimension = 3; - break; - case GL_MAP1_VERTEX_4: - which=0; - dimension = 4; - break; - case GL_MAP1_INDEX: - which=2; - dimension = 1; - break; - case GL_MAP1_COLOR_4: - which=2; - dimension = 4; - break; - case GL_MAP1_NORMAL: - which=1; - dimension = 3; - break; - case GL_MAP1_TEXTURE_COORD_1: - which=3; - dimension = 1; - break; - case GL_MAP1_TEXTURE_COORD_2: - which=3; - dimension = 2; - break; - - case GL_MAP1_TEXTURE_COORD_3: - which=3; - dimension = 3; - break; - case GL_MAP1_TEXTURE_COORD_4: - which=3; - dimension = 4; - break; - } - inMap1f(which, dimension, ulo, uhi, stride, order, pts); - } - else - glMap1f((GLenum) type, (GLfloat) ulo, (GLfloat) uhi, (GLint) stride, - (GLint) order, (const GLfloat *) pts); -} - -/*------------------------------------------------------------------------- - * mapmesh1f - evaluate a mesh of points on lattice - *------------------------------------------------------------------------- - */ -void OpenGLCurveEvaluator::mapmesh1f(long style, long from, long to) -{ - if(output_triangles) - { - inMapMesh1f((int) from, (int) to); - } - else - { - switch(style) { - default: - case N_MESHFILL: - case N_MESHLINE: - glEvalMesh1((GLenum) GL_LINE, (GLint) from, (GLint) to); - break; - case N_MESHPOINT: - glEvalMesh1((GLenum) GL_POINT, (GLint) from, (GLint) to); - break; - } - } -} - -/*------------------------------------------------------------------------- - * evalpoint1i - evaluate a point on a curve - *------------------------------------------------------------------------- - */ -void OpenGLCurveEvaluator::evalpoint1i(long i) -{ - glEvalPoint1((GLint) i); -} - -/*------------------------------------------------------------------------- - * evalcoord1f - evaluate a point on a curve - *------------------------------------------------------------------------- - */ -void OpenGLCurveEvaluator::evalcoord1f(long, REAL u) -{ - glEvalCoord1f((GLfloat) u); -} - -void -#ifdef _WIN32 -OpenGLCurveEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)()) -#else -OpenGLCurveEvaluator::putCallBack(GLenum which, _GLUfuncptr fn) -#endif -{ - switch(which) - { - case GLU_NURBS_BEGIN: - beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn; - break; - case GLU_NURBS_END: - endCallBackN = (void (GLAPIENTRY *) (void)) fn; - break; - case GLU_NURBS_VERTEX: - vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_NORMAL: - normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_COLOR: - colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_TEXTURE_COORD: - texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_BEGIN_DATA: - beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn; - break; - case GLU_NURBS_END_DATA: - endCallBackData = (void (GLAPIENTRY *) (void*)) fn; - break; - case GLU_NURBS_VERTEX_DATA: - vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_NORMAL_DATA: - normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_COLOR_DATA: - colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_TEXTURE_COORD_DATA: - texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - } -} - -void -OpenGLCurveEvaluator::beginCallBack(GLenum which, void *data) -{ - if(beginCallBackData) - beginCallBackData(which, data); - else if(beginCallBackN) - beginCallBackN(which); -} - -void -OpenGLCurveEvaluator::endCallBack(void *data) -{ - if(endCallBackData) - endCallBackData(data); - else if(endCallBackN) - endCallBackN(); -} - -void -OpenGLCurveEvaluator::vertexCallBack(const GLfloat *vert, void* data) -{ - if(vertexCallBackData) - vertexCallBackData(vert, data); - else if(vertexCallBackN) - vertexCallBackN(vert); -} - - -void -OpenGLCurveEvaluator::normalCallBack(const GLfloat *normal, void* data) -{ - if(normalCallBackData) - normalCallBackData(normal, data); - else if(normalCallBackN) - normalCallBackN(normal); -} - -void -OpenGLCurveEvaluator::colorCallBack(const GLfloat *color, void* data) -{ - if(colorCallBackData) - colorCallBackData(color, data); - else if(colorCallBackN) - colorCallBackN(color); -} - -void -OpenGLCurveEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data) -{ - if(texcoordCallBackData) - texcoordCallBackData(texcoord, data); - else if(texcoordCallBackN) - texcoordCallBackN(texcoord); -} diff --git a/src/libs/mesa/glu/libnurbs/interface/glcurveval.h b/src/libs/mesa/glu/libnurbs/interface/glcurveval.h deleted file mode 100644 index 8fa493034b..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glcurveval.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * glcurveval.h - * - */ - -#ifndef __gluglcurveval_h_ -#define __gluglcurveval_h_ - -#include "gluos.h" -#include -#include -#include "basiccrveval.h" - -class CurveMap; - -/*for internal evaluator callback stuff*/ -#ifndef IN_MAX_BEZIER_ORDER -#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ -#endif - -#ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 -#endif - -typedef struct curveEvalMachine{ - REAL uprime; //cached previously evaluated uprime - int k; //the dimension - REAL u1; - REAL u2; - int ustride; - int uorder; - REAL ctlpoints[IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; - REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values -} curveEvalMachine; - -class OpenGLCurveEvaluator : public BasicCurveEvaluator { -public: - OpenGLCurveEvaluator(void); - virtual ~OpenGLCurveEvaluator(void); - void range1f(long, REAL *, REAL *); - void domain1f(REAL, REAL); - void addMap(CurveMap *); - - void enable(long); - void disable(long); - void bgnmap1f(long); - void map1f(long, REAL, REAL, long, long, REAL *); - void mapgrid1f(long, REAL, REAL); - void mapmesh1f(long, long, long); - void evalpoint1i(long); - void evalcoord1f(long, REAL); - void endmap1f(void); - - void bgnline(void); - void endline(void); - - void put_vertices_call_back(int flag) - { - output_triangles = flag; - } -#ifdef _WIN32 - void putCallBack(GLenum which, void (GLAPIENTRY *fn)() ); -#else - void putCallBack(GLenum which, _GLUfuncptr fn ); -#endif - void set_callback_userData(void *data) - { - userData = data; - } - -/*------------------begin for curveEvalMachine------------*/ -curveEvalMachine em_vertex; -curveEvalMachine em_normal; -curveEvalMachine em_color; -curveEvalMachine em_texcoord; -int vertex_flag; //whether there is a vertex map or not -int normal_flag; //whether there is a normal map or not -int color_flag; //whether there is a color map or not -int texcoord_flag; //whether there is a texture map or not - -REAL global_grid_u0; -REAL global_grid_u1; -int global_grid_nu; - -void inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex - int dimension, - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL *ctlpoints); - -void inPreEvaluate(int order, REAL vprime, REAL *coeff); -void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint); -void inDoEvalCoord1(REAL u); -void inMapMesh1f(int umin, int umax); - -void (GLAPIENTRY *beginCallBackN) (GLenum type); -void (GLAPIENTRY *endCallBackN) (void); -void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert); -void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal); -void (GLAPIENTRY *colorCallBackN) (const GLfloat *color); -void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord); - -void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data); -void (GLAPIENTRY *endCallBackData) (void* data); -void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data); -void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data); -void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data); -void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data); - -void* userData; //the opaque pointer for Data callback functions -void beginCallBack(GLenum type, void* data); -void endCallBack(void* data); -void vertexCallBack(const GLfloat *vert, void *data); -void normalCallBack(const GLfloat *normal, void* data); -void colorCallBack(const GLfloat *color, void* data); -void texcoordCallBack(const GLfloat *texcoord, void* data); - - -/*------------------end for curveEvalMachine------------*/ - -private: - int output_triangles; //true 1; false 0 -}; - -#endif /* __gluglcurveval_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/interface/glimports.h b/src/libs/mesa/glu/libnurbs/interface/glimports.h deleted file mode 100644 index 6e69feb405..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glimports.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * glimports.h - * - */ - -#ifndef __gluimports_h_ -#define __gluimports_h_ - -#include "mystdlib.h" -#include "mystdio.h" - -#endif /* __gluimports_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/interface/glinterface.cc b/src/libs/mesa/glu/libnurbs/interface/glinterface.cc deleted file mode 100644 index ba64bcd2dc..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glinterface.cc +++ /dev/null @@ -1,469 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include "glimports.h" -#include "glrenderer.h" -#include "nurbsconsts.h" - -//#define DOWN_LOAD_NURBS -#ifdef DOWN_LOAD_NURBS - -#include "oglTrimNurbs.h" -static int surfcount = 0; -static oglTrimNurbs* otn = NULL; -nurbSurf* tempNurb = NULL; -oglTrimLoops* tempTrim = NULL; -#endif - - -//for LOD -extern "C" {void glu_LOD_eval_list(GLUnurbs *nurb, int level);} - -void glu_LOD_eval_list(GLUnurbs *nurb, int level) -{ - nurb->LOD_eval_list(level); -} - -GLUnurbs * GLAPIENTRY -gluNewNurbsRenderer(void) -{ - GLUnurbs *t; - - t = new GLUnurbs(); - return t; -} - -void GLAPIENTRY -gluDeleteNurbsRenderer(GLUnurbs *r) -{ - delete r; -} - -extern "C" -void GLAPIENTRY - -gluDeleteNurbsTessellatorEXT(GLUnurbsObj *r) -{ - delete r; -} - -void GLAPIENTRY -gluBeginSurface(GLUnurbs *r) -{ -#ifdef DOWN_LOAD_NURBS -surfcount++; -tempTrim = OTL_make(10,10); -#endif - r->bgnsurface(0); -} - -void GLAPIENTRY -gluBeginCurve(GLUnurbs *r) -{ - r->bgncurve(0); -} - -void GLAPIENTRY -gluEndCurve(GLUnurbs *r) -{ - r->endcurve(); -} - -void GLAPIENTRY -gluEndSurface(GLUnurbs *r) -{ -#ifdef DOWN_LOAD_NURBS -if(surfcount == 1) - otn = OTN_make(1); -OTN_insert(otn, tempNurb, tempTrim); -if(surfcount >= 1) -{ -#ifdef DEBUG -printf("write file\n"); -#endif -OTN_write(otn, "out.otn"); - -} -#endif - - r->endsurface(); -} - -void GLAPIENTRY -gluBeginTrim(GLUnurbs *r) -{ -#ifdef DOWN_LOAD_NURBS -OTL_bgnTrim(tempTrim); -#endif - - r->bgntrim(); -} - -void GLAPIENTRY -gluEndTrim(GLUnurbs *r) -{ -#ifdef DOWN_LOAD_NURBS -OTL_endTrim(tempTrim); -#endif - r->endtrim(); -} - -void GLAPIENTRY -gluPwlCurve(GLUnurbs *r, GLint count, INREAL array[], - GLint stride, GLenum type) -{ -#ifdef DOWN_LOAD_NURBS -OTL_pwlCurve(tempTrim, count, array, stride, type); -#endif - - int realType; - switch(type) { - case GLU_MAP1_TRIM_2: - realType = N_P2D; - break; - case GLU_MAP1_TRIM_3: - realType = N_P2DR; - break; - default: - realType = type; - break; - } - r->pwlcurve(count, array, sizeof(INREAL) * stride, realType); -} - -void GLAPIENTRY -gluNurbsCurve(GLUnurbs *r, GLint nknots, INREAL knot[], GLint stride, - INREAL ctlarray[], GLint order, GLenum type) -{ -#ifdef DOWN_LOAD_NURBS -OTL_nurbsCurve(tempTrim, nknots, knot, stride, ctlarray, order, type); -#endif - - int realType; - - switch(type) { - case GLU_MAP1_TRIM_2: - realType = N_P2D; - break; - case GLU_MAP1_TRIM_3: - realType = N_P2DR; - break; - default: - realType = type; - break; - } - - r->nurbscurve(nknots, knot, sizeof(INREAL) * stride, ctlarray, order, - realType); -} - -void GLAPIENTRY -gluNurbsSurface(GLUnurbs *r, GLint sknot_count, GLfloat *sknot, - GLint tknot_count, GLfloat *tknot, - GLint s_stride, GLint t_stride, - GLfloat *ctlarray, GLint sorder, GLint torder, - GLenum type) -{ -#ifdef DOWN_LOAD_NURBS - { - int dimension; - switch(type){ - case GL_MAP2_VERTEX_3: - dimension = 3; - break; - case GL_MAP2_VERTEX_4: - dimension = 4; - break; - default: - fprintf(stderr, "error in glinterface.c++, type no implemented\n"); - exit(1); - } -tempNurb = nurbSurfMake(sknot_count, sknot, - tknot_count, tknot, - sorder, torder, - dimension, - ctlarray, - s_stride, t_stride); - - } -#endif - - r->nurbssurface(sknot_count, sknot, tknot_count, tknot, - sizeof(INREAL) * s_stride, sizeof(INREAL) * t_stride, - ctlarray, sorder, torder, type); -} - -void GLAPIENTRY -gluLoadSamplingMatrices(GLUnurbs *r, const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4]) -{ - r->useGLMatrices(modelMatrix, projMatrix, viewport); -} - -void GLAPIENTRY -gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) -{ - GLfloat nurbsValue; - - switch (property) { - case GLU_AUTO_LOAD_MATRIX: - r->setautoloadmode(value); - return; - - case GLU_CULLING: - if (value != 0.0) { - nurbsValue = N_CULLINGON; - } else { - nurbsValue = N_NOCULLING; - } - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, nurbsValue); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLING, nurbsValue); - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLING, nurbsValue); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLING, nurbsValue); - return; - - case GLU_SAMPLING_METHOD: - if (value == GLU_PATH_LENGTH) { - nurbsValue = N_PATHLENGTH; - } else if (value == GLU_PARAMETRIC_ERROR) { - nurbsValue = N_PARAMETRICDISTANCE; - } else if (value == GLU_DOMAIN_DISTANCE) { - nurbsValue = N_DOMAINDISTANCE; - r->set_is_domain_distance_sampling(1); //optimzing untrimmed case - - } else if (value == GLU_OBJECT_PARAMETRIC_ERROR) { - nurbsValue = N_OBJECTSPACE_PARA; - r->setautoloadmode( 0.0 ); - r->setSamplingMatrixIdentity(); - } else if (value == GLU_OBJECT_PATH_LENGTH) { - nurbsValue = N_OBJECTSPACE_PATH; - r->setautoloadmode( 0.0 ); - r->setSamplingMatrixIdentity(); - } else { - r->postError(GLU_INVALID_VALUE); - return; - } - - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue); - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, nurbsValue); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, nurbsValue); - return; - - case GLU_SAMPLING_TOLERANCE: - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, value); - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, value); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, value); - return; - - case GLU_PARAMETRIC_TOLERANCE: - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, value); - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, value); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, value); - return; - - - case GLU_DISPLAY_MODE: - - if (value == GLU_FILL) { - nurbsValue = N_FILL; - } else if (value == GLU_OUTLINE_POLYGON) { - nurbsValue = N_OUTLINE_POLY; - } else if (value == GLU_OUTLINE_PATCH) { - nurbsValue = N_OUTLINE_PATCH; - } else { - r->postError(GLU_INVALID_VALUE); - return; - } - r->setnurbsproperty(N_DISPLAY, nurbsValue); - - break; - - case GLU_U_STEP: - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, value); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, value); - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, value); - - //added for optimizing untrimmed case - r->set_domain_distance_u_rate(value); - break; - - case GLU_V_STEP: - r->setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, value); - r->setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, value); - r->setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value); - r->setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, value); - - //added for optimizing untrimmed case - r->set_domain_distance_v_rate(value); - break; - - case GLU_NURBS_MODE: - if(value == GLU_NURBS_RENDERER) - r->put_callbackFlag(0); - else if(value == GLU_NURBS_TESSELLATOR) - r->put_callbackFlag(1); - else - r->postError(GLU_INVALID_ENUM); - break; - - default: - r->postError(GLU_INVALID_ENUM); - return; - } -} - -void GLAPIENTRY -gluGetNurbsProperty(GLUnurbs *r, GLenum property, GLfloat *value) -{ - GLfloat nurbsValue; - - switch(property) { - case GLU_AUTO_LOAD_MATRIX: - if (r->getautoloadmode()) { - *value = GL_TRUE; - } else { - *value = GL_FALSE; - } - break; - case GLU_CULLING: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_CULLING, &nurbsValue); - if (nurbsValue == N_CULLINGON) { - *value = GL_TRUE; - } else { - *value = GL_FALSE; - } - break; - case GLU_SAMPLING_METHOD: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, value); - if(*value == N_PATHLENGTH) - *value = GLU_PATH_LENGTH; - else if(*value == N_PARAMETRICDISTANCE) - *value = GLU_PARAMETRIC_ERROR; - else if(*value == N_DOMAINDISTANCE) - *value = GLU_DOMAIN_DISTANCE; - else if(*value == N_OBJECTSPACE_PATH) - *value = GLU_OBJECT_PATH_LENGTH; - else if(*value == N_OBJECTSPACE_PARA) - *value = GLU_OBJECT_PARAMETRIC_ERROR; - break; - case GLU_SAMPLING_TOLERANCE: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value); - break; - case GLU_PARAMETRIC_TOLERANCE: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, value); - break; - - case GLU_U_STEP: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value); - break; - case GLU_V_STEP: - r->getnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, value); - break; - case GLU_DISPLAY_MODE: - r->getnurbsproperty(N_DISPLAY, &nurbsValue); - if (nurbsValue == N_FILL) { - *value = GLU_FILL; - } else if (nurbsValue == N_OUTLINE_POLY) { - *value = GLU_OUTLINE_POLYGON; - } else { - *value = GLU_OUTLINE_PATCH; - } - break; - - case GLU_NURBS_MODE: - if(r->is_callback()) - *value = GLU_NURBS_TESSELLATOR; - else - *value = GLU_NURBS_RENDERER; - break; - - default: - r->postError(GLU_INVALID_ENUM); - return; - } -} - -extern "C" void GLAPIENTRY -gluNurbsCallback(GLUnurbs *r, GLenum which, _GLUfuncptr fn ) -{ - switch (which) { - case GLU_NURBS_BEGIN: - case GLU_NURBS_END: - case GLU_NURBS_VERTEX: - case GLU_NURBS_NORMAL: - case GLU_NURBS_TEXTURE_COORD: - case GLU_NURBS_COLOR: - case GLU_NURBS_BEGIN_DATA: - case GLU_NURBS_END_DATA: - case GLU_NURBS_VERTEX_DATA: - case GLU_NURBS_NORMAL_DATA: - case GLU_NURBS_TEXTURE_COORD_DATA: - case GLU_NURBS_COLOR_DATA: - r->putSurfCallBack(which, fn); - break; - - case GLU_NURBS_ERROR: - r->errorCallback = (void (APIENTRY *)( GLenum e )) fn; - break; - default: - r->postError(GLU_INVALID_ENUM); - return; - } -} - -extern "C" -void GLAPIENTRY -gluNurbsCallbackDataEXT(GLUnurbs* r, void* userData) -{ - r->setNurbsCallbackData(userData); -} - -extern "C" -void GLAPIENTRY -gluNurbsCallbackData(GLUnurbs* r, void* userData) -{ - gluNurbsCallbackDataEXT(r,userData); -} diff --git a/src/libs/mesa/glu/libnurbs/interface/glrenderer.cc b/src/libs/mesa/glu/libnurbs/interface/glrenderer.cc deleted file mode 100644 index 17123fbc61..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glrenderer.cc +++ /dev/null @@ -1,301 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include "glimports.h" -#include "glrenderer.h" - -GLUnurbs::GLUnurbs() - : NurbsTessellator(curveEvaluator, surfaceEvaluator) -{ - redefineMaps(); - defineMap(GL_MAP2_NORMAL, 0, 3); - defineMap(GL_MAP1_NORMAL, 0, 3); - defineMap(GL_MAP2_TEXTURE_COORD_1, 0, 1); - defineMap(GL_MAP1_TEXTURE_COORD_1, 0, 1); - defineMap(GL_MAP2_TEXTURE_COORD_2, 0, 2); - defineMap(GL_MAP1_TEXTURE_COORD_2, 0, 2); - defineMap(GL_MAP2_TEXTURE_COORD_3, 0, 3); - defineMap(GL_MAP1_TEXTURE_COORD_3, 0, 3); - defineMap(GL_MAP2_TEXTURE_COORD_4, 1, 4); - defineMap(GL_MAP1_TEXTURE_COORD_4, 1, 4); - defineMap(GL_MAP2_VERTEX_4, 1, 4); - defineMap(GL_MAP1_VERTEX_4, 1, 4); - defineMap(GL_MAP2_VERTEX_3, 0, 3); - defineMap(GL_MAP1_VERTEX_3, 0, 3); - defineMap(GL_MAP2_COLOR_4, 0, 4); - defineMap(GL_MAP1_COLOR_4, 0, 4); - defineMap(GL_MAP2_INDEX, 0, 1); - defineMap(GL_MAP1_INDEX, 0, 1); - - setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); - setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); - setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); - setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMETHOD, (float) N_PATHLENGTH); - - setnurbsproperty(GL_MAP1_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0); - setnurbsproperty(GL_MAP1_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0); - setnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, (float) 50.0); - setnurbsproperty(GL_MAP2_VERTEX_4, N_PIXEL_TOLERANCE, (float) 50.0); - - setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50); - setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50); - setnurbsproperty(GL_MAP2_VERTEX_3, N_ERROR_TOLERANCE, (float) 0.50); - setnurbsproperty(GL_MAP2_VERTEX_4, N_ERROR_TOLERANCE, (float) 0.50); - - setnurbsproperty(GL_MAP1_VERTEX_3, N_S_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, (float) 100.0); - - //added for optimizing untrimmed case - set_domain_distance_u_rate(100.0); - - setnurbsproperty(GL_MAP1_VERTEX_3, N_T_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP1_VERTEX_4, N_T_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP2_VERTEX_3, N_T_STEPS, (float) 100.0); - setnurbsproperty(GL_MAP2_VERTEX_4, N_T_STEPS, (float) 100.0); - - //added for optimizing untrimmed case - set_domain_distance_v_rate(100.0); - set_is_domain_distance_sampling(0); //since the default is path_length - - //default autoloadmode is true - autoloadmode = 1; - - //default callbackFlag is 0 - callbackFlag = 0; - - errorCallback = NULL; -} - -void -GLUnurbs::bgnrender(void) -{ - if (autoloadmode) { - loadGLMatrices(); - } -} - -void -GLUnurbs::endrender(void) -{ -} - -void -GLUnurbs::errorHandler(int i) -{ - int gluError; - - gluError = i + (GLU_NURBS_ERROR1 - 1); - postError( gluError ); -} - -void -GLUnurbs::loadGLMatrices(void) -{ - GLfloat vmat[4][4]; - GLint viewport[4]; - - grabGLMatrix((GLfloat (*)[4]) vmat); - loadCullingMatrix((GLfloat (*)[4]) vmat); - ::glGetIntegerv((GLenum) GL_VIEWPORT, (GLint *) viewport); - loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport); -} - -void -GLUnurbs::useGLMatrices(const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4]) -{ - GLfloat vmat[4][4]; - - multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix, - (const GLfloat (*)[4]) projMatrix); - loadCullingMatrix((GLfloat (*)[4]) vmat); - loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport); -} - -/*-------------------------------------------------------------------------- - * grabGLMatrix - *-------------------------------------------------------------------------- - */ - -void -GLUnurbs::grabGLMatrix(GLfloat vmat[4][4]) -{ - GLfloat m1[4][4], m2[4][4]; - - ::glGetFloatv((GLenum) GL_MODELVIEW_MATRIX, (GLfloat *) &(m1[0][0])); - ::glGetFloatv((GLenum) GL_PROJECTION_MATRIX, (GLfloat *) &(m2[0][0])); - multmatrix4d((GLfloat (*)[4]) vmat, - (const GLfloat (*)[4]) m1, (const GLfloat (*)[4]) m2); -} - -//for object space tesselation: view independent -void -GLUnurbs::setSamplingMatrixIdentity( void ) -{ - INREAL smat[4][4] = { - {1,0,0,0}, - {0,1,0,0}, - {0,0,1,0}, - {0,0,0,1} - }; - const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); - const long cstride = 1; - - setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); -} - - -void -GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4], - const GLint viewport[4]) -{ - - /* rescale the mapping to correspond to pixels in x/y */ - REAL xsize = 0.5 * (REAL) (viewport[2]); - REAL ysize = 0.5 * (REAL) (viewport[3]); - - INREAL smat[4][4]; - smat[0][0] = vmat[0][0] * xsize; - smat[1][0] = vmat[1][0] * xsize; - smat[2][0] = vmat[2][0] * xsize; - smat[3][0] = vmat[3][0] * xsize; - - smat[0][1] = vmat[0][1] * ysize; - smat[1][1] = vmat[1][1] * ysize; - smat[2][1] = vmat[2][1] * ysize; - smat[3][1] = vmat[3][1] * ysize; - - smat[0][2] = 0.0; - smat[1][2] = 0.0; - smat[2][2] = 0.0; - smat[3][2] = 0.0; - - smat[0][3] = vmat[0][3]; - smat[1][3] = vmat[1][3]; - smat[2][3] = vmat[2][3]; - smat[3][3] = vmat[3][3]; - - const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); - const long cstride = 1; - - setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, - cstride); -} - -void -GLUnurbs::loadCullingMatrix(GLfloat vmat[4][4]) -{ - INREAL cmat[4][4]; - - cmat[0][0] = vmat[0][0]; - cmat[0][1] = vmat[0][1]; - cmat[0][2] = vmat[0][2]; - cmat[0][3] = vmat[0][3]; - - cmat[1][0] = vmat[1][0]; - cmat[1][1] = vmat[1][1]; - cmat[1][2] = vmat[1][2]; - cmat[1][3] = vmat[1][3]; - - cmat[2][0] = vmat[2][0]; - cmat[2][1] = vmat[2][1]; - cmat[2][2] = vmat[2][2]; - cmat[2][3] = vmat[2][3]; - - cmat[3][0] = vmat[3][0]; - cmat[3][1] = vmat[3][1]; - cmat[3][2] = vmat[3][2]; - cmat[3][3] = vmat[3][3]; - - const long rstride = sizeof(cmat[0]) / sizeof(cmat[0][0]); - const long cstride = 1; - - setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, - cstride); - //added for curves by zl - setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, - cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, - cstride); -} - -/*--------------------------------------------------------------------- - * A = B * MAT ; transform a 4d vector through a 4x4 matrix - *--------------------------------------------------------------------- - */ -void -GLUnurbs::transform4d(GLfloat A[4], GLfloat B[4], GLfloat mat[4][4]) -{ - - A[0] = B[0]*mat[0][0] + B[1]*mat[1][0] + B[2]*mat[2][0] + B[3]*mat[3][0]; - A[1] = B[0]*mat[0][1] + B[1]*mat[1][1] + B[2]*mat[2][1] + B[3]*mat[3][1]; - A[2] = B[0]*mat[0][2] + B[1]*mat[1][2] + B[2]*mat[2][2] + B[3]*mat[3][2]; - A[3] = B[0]*mat[0][3] + B[1]*mat[1][3] + B[2]*mat[2][3] + B[3]*mat[3][3]; -} - -/*--------------------------------------------------------------------- - * new = [left][right] ; multiply two matrices together - *--------------------------------------------------------------------- - */ -void -GLUnurbs::multmatrix4d (GLfloat n[4][4], const GLfloat left[4][4], - const GLfloat right[4][4]) -{ - transform4d ((GLfloat *) n[0],(GLfloat *) left[0],(GLfloat (*)[4]) right); - transform4d ((GLfloat *) n[1],(GLfloat *) left[1],(GLfloat (*)[4]) right); - transform4d ((GLfloat *) n[2],(GLfloat *) left[2],(GLfloat (*)[4]) right); - transform4d ((GLfloat *) n[3],(GLfloat *) left[3],(GLfloat (*)[4]) right); -} diff --git a/src/libs/mesa/glu/libnurbs/interface/glrenderer.h b/src/libs/mesa/glu/libnurbs/interface/glrenderer.h deleted file mode 100644 index 3b72d44d1f..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glrenderer.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * glrenderer.h - * - */ - -#ifndef __gluglrenderer_h_ -#define __gluglrenderer_h_ - -#include -#include -#include "nurbstess.h" -#include "glsurfeval.h" -#include "glcurveval.h" - -extern "C" { - typedef void (APIENTRY *errorCallbackType)( GLenum ); -} - -class GLUnurbs : public NurbsTessellator { - -public: - GLUnurbs( void ); - void loadGLMatrices( void ); - void useGLMatrices( const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4] ); - void setSamplingMatrixIdentity( void ); - - void errorHandler( int ); - void bgnrender( void ); - void endrender( void ); - void setautoloadmode( INREAL value ) - { - - if (value) autoloadmode = GL_TRUE; - else autoloadmode = GL_FALSE; - - } - GLboolean getautoloadmode( void ) { return autoloadmode; } - - errorCallbackType errorCallback; - void postError( int which ) - { if (errorCallback) (errorCallback)( (GLenum)which ); } -#ifdef _WIN32 - void putSurfCallBack(GLenum which, void (GLAPIENTRY *fn)() ) -#else - void putSurfCallBack(GLenum which, _GLUfuncptr fn ) -#endif - { - curveEvaluator.putCallBack(which, fn); - surfaceEvaluator.putCallBack(which, fn); - } - - int get_vertices_call_back() - { - return surfaceEvaluator.get_vertices_call_back(); - } - - void put_vertices_call_back(int flag) - { - surfaceEvaluator.put_vertices_call_back(flag); - } - - int get_callback_auto_normal() - { - return surfaceEvaluator.get_callback_auto_normal(); - } - - void put_callback_auto_normal(int flag) - { - surfaceEvaluator.put_callback_auto_normal(flag); - } - - void setNurbsCallbackData(void* userData) - { - curveEvaluator.set_callback_userData(userData); - surfaceEvaluator.set_callback_userData(userData); - } - - - //for LOD - void LOD_eval_list(int level) - { - surfaceEvaluator.LOD_eval_list(level); - } - - //NEWCALLBACK - int is_callback() - { - return callbackFlag; - } - void put_callbackFlag(int flag) - { - callbackFlag = flag; - surfaceEvaluator.put_vertices_call_back(flag); - curveEvaluator.put_vertices_call_back(flag); - } - -private: - GLboolean autoloadmode; - OpenGLSurfaceEvaluator surfaceEvaluator; - OpenGLCurveEvaluator curveEvaluator; - - void loadSamplingMatrix( const GLfloat vmat[4][4], - const GLint viewport[4] ); - void loadCullingMatrix( GLfloat vmat[4][4] ); - static void grabGLMatrix( GLfloat vmat[4][4] ); - static void transform4d( GLfloat A[4], GLfloat B[4], - GLfloat mat[4][4] ); - static void multmatrix4d( GLfloat n[4][4], const GLfloat left[4][4], - const GLfloat right[4][4] ); - - int callbackFlag; -}; - -#endif /* __gluglrenderer_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/interface/glsurfeval.cc b/src/libs/mesa/glu/libnurbs/interface/glsurfeval.cc deleted file mode 100644 index b5bfab1e28..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glsurfeval.cc +++ /dev/null @@ -1,1293 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * glsurfeval.c++ - * - */ - -/* Polynomial Evaluator Interface */ -#include "gluos.h" -#include -#include "glimports.h" -#include "glrenderer.h" -#include "glsurfeval.h" -#include "nurbsconsts.h" -#include "bezierPatchMesh.h" - - -//extern int surfcount; -//int surfcount=0; - -/*#define USE_INTERNAL_EVAL*/ //use internal evaluator - -/*whether do evaluation or not*/ -/*#define NO_EVALUATION*/ - -//#define USE_LOD //for LOD test, have to turn on USE_LOD in insurfeval.c++ too - -/*for statistics*/ -//#define STATISTICS -#ifdef STATISTICS -static int STAT_num_of_triangles=0; -static int STAT_num_of_eval_vertices=0; -static int STAT_num_of_quad_strips=0; -#endif - -/*for output triangles*/ -/*#define OUTPUT_TRIANGLES*/ - - -/*#define FOR_CHRIS*/ -#ifdef FOR_CHRIS -extern "C" { void evalUStripExt(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val);} - -extern "C" { void evalVStripExt(int n_left, REAL u_left, REAL* left_val, - int n_right, REAL u_right, REAL* right_val); - } -#endif - - -/**************begin for LOD_eval_list***********/ -void OpenGLSurfaceEvaluator::LOD_eval_list(int level) -{ - if(level == 0) - LOD_eval_level = 1; - else if(level == 1) - LOD_eval_level = 2; - else if(level == 2) - LOD_eval_level = 4; - else - LOD_eval_level = 8; - - inBPMListEvalEM(global_bpm); -} - - -OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator() -{ - int i; - - for (i=0; i= n_upper) /*case1: no more in upper*/ - { - if(j= n_lower) /*case2: no more in lower*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ - { - coord2f(upper_val[k], v_upper); -// glNormal3fv(upperNormal[k]); -// glVertex3fv(upperXYZ[k]); - } - - endtfan(); - } - break; /*exit the main loop*/ - } - else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ - { - if(upper_val[i] <= lower_val[j]) - { - bgntfan(); - coord2f(lower_val[j], v_lower); -// glNormal3fv(lowerNormal[j]); -// glVertex3fv(lowerXYZ[j]); - - /*find the last k>=i such that - *upperverts[k][0] <= lowerverts[j][0] - */ - k=i; - - while(k lower_val[j]) - break; - k++; - - } - k--; - - - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { - coord2f(upper_val[l], v_upper); -// glNormal3fv(upperNormal[l]); -// glVertex3fv(upperXYZ[l]); - - } - coord2f(leftMostV[0], leftMostV[1]); -// glNormal3fv(leftMostNormal); -// glVertex3fv(leftMostXYZ); - - endtfan(); - - /*update i and leftMostV for next loop - */ - i = k+1; - - leftMostV[0] = upper_val[k]; - leftMostV[1] = v_upper; -// leftMostNormal = upperNormal[k]; -// leftMostXYZ = upperXYZ[k]; - } - else /*upperVerts[i][0] > lowerVerts[j][0]*/ - { - bgntfan(); - coord2f(upper_val[i], v_upper); -// glNormal3fv(upperNormal[i]); -// glVertex3fv(upperXYZ[i]); - - coord2f(leftMostV[0], leftMostV[1]); -// glNormal3fv(leftMostNormal); -// glVertex3fv(leftMostXYZ); - - - /*find the last k>=j such that - *lowerverts[k][0] < upperverts[i][0] - */ - k=j; - while(k< n_lower) - { - if(lower_val[k] >= upper_val[i]) - break; - coord2f(lower_val[k], v_lower); -// glNormal3fv(lowerNormal[k]); -// glVertex3fv(lowerXYZ[k]); - - k++; - } - endtfan(); - - /*update j and leftMostV for next loop - */ - j=k; - leftMostV[0] = lower_val[j-1]; - leftMostV[1] = v_lower; - -// leftMostNormal = lowerNormal[j-1]; -// leftMostXYZ = lowerXYZ[j-1]; - } - } - } - //clean up -// free(upperXYZ); -// free(lowerXYZ); -// free(upperNormal); -// free(lowerNormal); -#endif - -} - - -void -OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) -{ -#ifdef USE_INTERNAL_EVAL - inEvalVStrip(n_left, u_left, left_val, - n_right, u_right, right_val); -#else - -#ifdef FOR_CHRIS - evalVStripExt(n_left, u_left, left_val, - n_right, u_right, right_val); - return; - -#endif - - int i,j,k,l; - REAL botMostV[2]; - /* - *the algorithm works by scanning from bot to top. - *botMostV: the bot most of the remaining verteces (on both left and right). - * it could an element of leftVerts or rightVerts. - *i: leftVerts[i] is the first vertex to the top of botMostV on left line - *j: rightVerts[j] is the first vertex to the top of botMostV on rightline - */ - - /*initialize i,j,and botMostV - */ - if(left_val[0] <= right_val[0]) - { - i=1; - j=0; - - botMostV[0] = u_left; - botMostV[1] = left_val[0]; - } - else - { - i=0; - j=1; - - botMostV[0] = u_right; - botMostV[1] = right_val[0]; - } - - /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and botMostV are - *maintained - */ - while(1) - { - if(i >= n_left) /*case1: no more in left*/ - { - if(j= n_right) /*case2: no more in right*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ - { - coord2f(u_left, left_val[k]); -// glNormal3fv(leftNormal[k]); -// glVertex3fv(leftXYZ[k]); - } - - endtfan(); - } - break; /*exit the main loop*/ - } - else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ - { - if(left_val[i] <= right_val[j]) - { - bgntfan(); - coord2f(u_right, right_val[j]); -// glNormal3fv(rightNormal[j]); -// glVertex3fv(rightXYZ[j]); - - /*find the last k>=i such that - *leftverts[k][0] <= rightverts[j][0] - */ - k=i; - - while(k right_val[j]) - break; - k++; - - } - k--; - - - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { - coord2f(u_left, left_val[l]); -// glNormal3fv(leftNormal[l]); -// glVertex3fv(leftXYZ[l]); - - } - coord2f(botMostV[0], botMostV[1]); -// glNormal3fv(botMostNormal); -// glVertex3fv(botMostXYZ); - - endtfan(); - - /*update i and botMostV for next loop - */ - i = k+1; - - botMostV[0] = u_left; - botMostV[1] = left_val[k]; -// botMostNormal = leftNormal[k]; -// botMostXYZ = leftXYZ[k]; - } - else /*left_val[i] > right_val[j])*/ - { - bgntfan(); - coord2f(u_left, left_val[i]); -// glNormal3fv(leftNormal[i]); -// glVertex3fv(leftXYZ[i]); - - coord2f(botMostV[0], botMostV[1]); -// glNormal3fv(botMostNormal); -// glVertex3fv(botMostXYZ); - - - /*find the last k>=j such that - *rightverts[k][0] < leftverts[i][0] - */ - k=j; - while(k< n_right) - { - if(right_val[k] >= left_val[i]) - break; - coord2f(u_right, right_val[k]); -// glNormal3fv(rightNormal[k]); -// glVertex3fv(rightXYZ[k]); - - k++; - } - endtfan(); - - /*update j and botMostV for next loop - */ - j=k; - botMostV[0] = u_right; - botMostV[1] = right_val[j-1]; - -// botMostNormal = rightNormal[j-1]; -// botMostXYZ = rightXYZ[j-1]; - } - } - } - //clean up -// free(leftXYZ); -// free(leftNormal); -// free(rightXYZ); -// free(rightNormal); -#endif -} - - -void -OpenGLSurfaceEvaluator::bgnqstrip(void) -{ - if(output_triangles) - bezierPatchMeshBeginStrip(global_bpm, GL_QUAD_STRIP); - else - glBegin((GLenum) GL_QUAD_STRIP); - -#ifdef STATISTICS - STAT_num_of_quad_strips++; -#endif -} - -void -OpenGLSurfaceEvaluator::endqstrip(void) -{ - if(output_triangles) - bezierPatchMeshEndStrip(global_bpm); - else - glEnd(); - -} - -/*------------------------------------------------------------------------- - * bgnmap2f - preamble to surface definition and evaluations - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::bgnmap2f(long) -{ - if(output_triangles) - { - /*deallocate the space which may has been - *allocated by global_bpm previously - */ - if(global_bpm != NULL) { - bezierPatchMeshListDelete(global_bpm); - global_bpm = NULL; - } - - - /* - auto_normal_flag = 1; //always output normal in callback mode. - //we could have used the following code, - //but Inspector doesn't have gl context - //before it calls tessellator. - //this way is temporary. - */ - //NEWCALLBACK - //if one of the two normal callback functions are set, - //then set - if(normalCallBackN != NULL || - normalCallBackData != NULL) - auto_normal_flag = 1; - else - auto_normal_flag = 0; - - //initialize so that no maps initially - vertex_flag = 0; - normal_flag = 0; - color_flag = 0; - texcoord_flag = 0; - - /* - if(glIsEnabled(GL_AUTO_NORMAL) == GL_TRUE) - auto_normal_flag = 1; - else if (callback_auto_normal == 1) - auto_normal_flag = 1; - else - auto_normal_flag = 0; - */ - glPushAttrib((GLbitfield) GL_EVAL_BIT); - - } - else - { - glPushAttrib((GLbitfield) GL_EVAL_BIT); - - /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE - */ - glGetIntegerv(GL_POLYGON_MODE, gl_polygon_mode); - } - -} - -/*------------------------------------------------------------------------- - * endmap2f - postamble to a map - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::endmap2f(void) -{ - - if(output_triangles) - { - //bezierPatchMeshListDelDeg(global_bpm); - - // bezierPatchMeshListEval(global_bpm); - - //surfcount++; - //printf("surfcount=%i\n", surfcount); - //if(surfcount == 8) exit(0); - - inBPMListEvalEM(global_bpm); - - - -/* - global_bpm = bezierPatchMeshListReverse(global_bpm); - { - float *vertex_array; - float *normal_array; - int *length_array; - int *type_array; - int num_strips; - bezierPatchMeshListCollect(global_bpm, &vertex_array, &normal_array, &length_array, &type_array, &num_strips); - drawStrips(vertex_array, normal_array, length_array, type_array, num_strips); - free(vertex_array); - free(normal_array); - free(length_array); - free(type_array); - } -*/ - - //bezierPatchMeshListPrint(global_bpm); - //bezierPatchMeshListDraw(global_bpm); - -// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm)); - -#ifdef USE_LOD -#else - bezierPatchMeshListDelete(global_bpm); - global_bpm = NULL; -#endif - glPopAttrib(); - } -else - { -#ifndef USE_LOD - glPopAttrib(); -#endif - -#ifdef STATISTICS - fprintf(stderr, "num_vertices=%i,num_triangles=%i,num_quads_strips=%i\n", STAT_num_of_eval_vertices,STAT_num_of_triangles,STAT_num_of_quad_strips); -#endif - - /*to restore the gl_polygon_mode - */ -#ifndef USE_LOD - glPolygonMode( GL_FRONT, (GLenum) gl_polygon_mode[0]); - glPolygonMode( GL_BACK, (GLenum) gl_polygon_mode[1]); -#endif -} - -} - -/*------------------------------------------------------------------------- - * map2f - pass a desription of a surface map - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::map2f( - long _type, - REAL _ulower, /* u lower domain coord */ - REAL _uupper, /* u upper domain coord */ - long _ustride, /* interpoint distance */ - long _uorder, /* parametric order */ - REAL _vlower, /* v lower domain coord */ - REAL _vupper, /* v upper domain coord */ - long _vstride, /* interpoint distance */ - long _vorder, /* parametric order */ - REAL *pts) /* control points */ -{ -#ifdef USE_INTERNAL_EVAL - inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper, - (int) _ustride, (int) _uorder, (REAL) _vlower, - (REAL) _vupper, (int) _vstride, (int) _vorder, - (REAL *) pts); -#else - - - - if(output_triangles) - { - if(global_bpm == NULL) - global_bpm = bezierPatchMeshMake2(10,10); - if( - (global_bpm->bpatch == NULL && - (_type == GL_MAP2_VERTEX_3 || _type == GL_MAP2_VERTEX_4)) - || - (global_bpm->bpatch_normal == NULL && - (_type == GL_MAP2_NORMAL)) - || - (global_bpm->bpatch_color == NULL && - (_type == GL_MAP2_INDEX || _type == GL_MAP2_COLOR_4)) - || - (global_bpm->bpatch_texcoord == NULL && - (_type == GL_MAP2_TEXTURE_COORD_1 || - _type == GL_MAP2_TEXTURE_COORD_2 || - _type == GL_MAP2_TEXTURE_COORD_3 || - _type == GL_MAP2_TEXTURE_COORD_4 ) - )) - { - bezierPatchMeshPutPatch(global_bpm, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts); - } - else /*new surface patch (with multiple maps) starts*/ - { - bezierPatchMesh *temp = bezierPatchMeshMake2(10,10); - bezierPatchMeshPutPatch(temp, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts); - global_bpm = bezierPatchMeshListInsert(global_bpm, temp); - - /* - global_bpm = bezierPatchMeshListInsert(global_bpm, - bezierPatchMeshMake( - (int) _type, _ulower, _uupper,(int) _ustride, (int) _uorder, _vlower, _vupper, (int) _vstride, (int) _vorder, pts, 10, 10)); - */ - } - } - else /*not output triangles*/ - { - glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper, - (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower, - (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder, - (const GLfloat *) pts); - } - -#endif -} - - -/*------------------------------------------------------------------------- - * mapmesh2f - evaluate a mesh of points on lattice - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::mapmesh2f(long style, long umin, long umax, long vmin, long vmax) -{ -#ifdef NO_EVALUATION -return; -#endif - -#ifdef USE_INTERNAL_EVAL - inEvalMesh2((int)umin, (int)vmin, (int)umax, (int)vmax); -#else - - - -if(output_triangles) -{ -#ifdef USE_LOD - bezierPatchMeshBeginStrip(global_bpm, GL_POLYGON); - bezierPatchMeshInsertUV(global_bpm, global_grid_u0, global_grid_v0); - bezierPatchMeshInsertUV(global_bpm, global_grid_u1, global_grid_v1); - bezierPatchMeshInsertUV(global_bpm, (REAL)global_grid_nu, (REAL)global_grid_nv); - bezierPatchMeshInsertUV(global_bpm, (REAL)umin, (REAL)vmin); - bezierPatchMeshInsertUV(global_bpm, (REAL)umax, (REAL)vmax); - bezierPatchMeshEndStrip(global_bpm); - -#else - - REAL du, dv; - long i,j; - if(global_grid_nu == 0 || global_grid_nv == 0) - return; /*no points need to be output*/ - du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - - if(global_grid_nu >= global_grid_nv){ - - for(i=umin; i=vmin; j--){ - REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - - coord2f(u1, v1); - coord2f(u2, v1); - } - endqstrip(); - } - } - else{ - - for(i=vmin; i=umin; j--){ - REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); - coord2f(u1, v2); - coord2f(u1, v1); - } - endqstrip(); - } - } -#endif -} -else -{ - switch(style) { - default: - case N_MESHFILL: - glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax, - (GLint) vmin, (GLint) vmax); - break; - case N_MESHLINE: - glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax, - (GLint) vmin, (GLint) vmax); - break; - case N_MESHPOINT: - glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax, - (GLint) vmin, (GLint) vmax); - break; - } - } - -#endif - -#ifdef STATISTICS - STAT_num_of_quad_strips += (umax-umin)*(vmax-vmin); -#endif -} - -/*------------------------------------------------------------------------- - * evalcoord2f - evaluate a point on a surface - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::evalcoord2f(long, REAL u, REAL v) -{ - - -#ifdef NO_EVALUATION -return; -#endif - - - newtmeshvert(u, v); -} - -/*------------------------------------------------------------------------- - * evalpoint2i - evaluate a grid point - *------------------------------------------------------------------------- - */ -void -OpenGLSurfaceEvaluator::evalpoint2i(long u, long v) -{ -#ifdef NO_EVALUATION -return; -#endif - - newtmeshvert(u, v); -} - -void -OpenGLSurfaceEvaluator::point2i( long u, long v ) -{ -#ifdef NO_EVALUATION -return; -#else - -#ifdef USE_INTERNAL_EVAL - inEvalPoint2( (int)u, (int)v); -#else - - -if(output_triangles) -{ - - REAL du, dv; - REAL fu,fv; - du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - fu = (u==global_grid_nu)? global_grid_u1:(global_grid_u0 + u*du); - fv = (v == global_grid_nv)? global_grid_v1: (global_grid_v0 +v*dv); - coord2f(fu,fv); -} -else - glEvalPoint2((GLint) u, (GLint) v); - - -#endif - -#ifdef STATISTICS - STAT_num_of_eval_vertices++; -#endif - -#endif - -} - -void -OpenGLSurfaceEvaluator::coord2f( REAL u, REAL v ) -{ -#ifdef NO_EVALUATION -return; -#else - -#ifdef USE_INTERNAL_EVAL - inEvalCoord2f( u, v); -#else - - -if(output_triangles) - bezierPatchMeshInsertUV(global_bpm, u,v); -else - glEvalCoord2f((GLfloat) u, (GLfloat) v); - - -#endif - - -#ifdef STATISTICS - STAT_num_of_eval_vertices++; -#endif - -#endif -} - -void -OpenGLSurfaceEvaluator::newtmeshvert( long u, long v ) -{ -#ifdef NO_EVALUATION -return; -#else - - if (tmeshing) { - - if (vcount == 2) { - vertexCache[0]->invoke(this); - vertexCache[1]->invoke(this); - point2i( u, v); - - } else { - vcount++; - } - - vertexCache[which]->saveEvalPoint(u, v); - which = 1 - which; - } else { - point2i( u, v); - } -#endif -} - -void -OpenGLSurfaceEvaluator::newtmeshvert( REAL u, REAL v ) -{ -#ifdef NO_EVALUATION -return; -#else - if (tmeshing) { - - - if (vcount == 2) { - vertexCache[0]->invoke(this); - vertexCache[1]->invoke(this); - coord2f(u,v); - - } else { - vcount++; - } - - vertexCache[which]->saveEvalCoord(u, v); - which = 1 - which; - } else { - - coord2f( u, v); - } -#endif - -} - -#ifdef _WIN32 -void OpenGLSurfaceEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)() ) -#else -void OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn ) -#endif -{ - switch(which) - { - case GLU_NURBS_BEGIN: - beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn; - break; - case GLU_NURBS_END: - endCallBackN = (void (GLAPIENTRY *) (void)) fn; - break; - case GLU_NURBS_VERTEX: - vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_NORMAL: - normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_COLOR: - colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_TEXTURE_COORD: - texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn; - break; - case GLU_NURBS_BEGIN_DATA: - beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn; - break; - case GLU_NURBS_END_DATA: - endCallBackData = (void (GLAPIENTRY *) (void*)) fn; - break; - case GLU_NURBS_VERTEX_DATA: - vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_NORMAL_DATA: - normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_COLOR_DATA: - colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - case GLU_NURBS_TEXTURE_COORD_DATA: - texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn; - break; - - } -} - - -void -OpenGLSurfaceEvaluator::beginCallBack(GLenum which, void *data) -{ - if(beginCallBackData) - beginCallBackData(which, data); - else if(beginCallBackN) - beginCallBackN(which); -} - -void -OpenGLSurfaceEvaluator::endCallBack(void *data) -{ - if(endCallBackData) - endCallBackData(data); - else if(endCallBackN) - endCallBackN(); -} - -void -OpenGLSurfaceEvaluator::vertexCallBack(const GLfloat *vert, void* data) -{ - if(vertexCallBackData) - vertexCallBackData(vert, data); - else if(vertexCallBackN) - vertexCallBackN(vert); -} - - -void -OpenGLSurfaceEvaluator::normalCallBack(const GLfloat *normal, void* data) -{ - if(normalCallBackData) - normalCallBackData(normal, data); - else if(normalCallBackN) - normalCallBackN(normal); -} - -void -OpenGLSurfaceEvaluator::colorCallBack(const GLfloat *color, void* data) -{ - if(colorCallBackData) - colorCallBackData(color, data); - else if(colorCallBackN) - colorCallBackN(color); -} - -void -OpenGLSurfaceEvaluator::texcoordCallBack(const GLfloat *texcoord, void* data) -{ - if(texcoordCallBackData) - texcoordCallBackData(texcoord, data); - else if(texcoordCallBackN) - texcoordCallBackN(texcoord); -} - - - - diff --git a/src/libs/mesa/glu/libnurbs/interface/glsurfeval.h b/src/libs/mesa/glu/libnurbs/interface/glsurfeval.h deleted file mode 100644 index 1567c6b098..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/glsurfeval.h +++ /dev/null @@ -1,404 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * glsurfeval.h - * - */ - -#ifndef __gluglsurfeval_h_ -#define __gluglsurfeval_h_ - -#include "basicsurfeval.h" -#include "bezierPatchMesh.h" //in case output triangles -#include -#include - -class SurfaceMap; -class OpenGLSurfaceEvaluator; -class StoredVertex; - -#define TYPECOORD 1 -#define TYPEPOINT 2 - -/* Cache up to 3 vertices from tmeshes */ -#define VERTEX_CACHE_SIZE 3 - -/*for internal evaluator callback stuff*/ -#ifndef IN_MAX_BEZIER_ORDER -#define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ -#endif - -#ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 -#endif - -typedef struct surfEvalMachine{ - REAL uprime;//cached previusly evaluated uprime. - REAL vprime; - int k; /*the dimension*/ - REAL u1; - REAL u2; - int ustride; - int uorder; - REAL v1; - REAL v2; - int vstride; - int vorder; - REAL ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; - REAL ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/ - REAL vcoeff[IN_MAX_BEZIER_ORDER]; - REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ - REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER]; -} surfEvalMachine; - - - -class StoredVertex { -public: - StoredVertex() { type = 0; } - ~StoredVertex(void) {} - void saveEvalCoord(REAL x, REAL y) - {coord[0] = x; coord[1] = y; type = TYPECOORD; } - void saveEvalPoint(long x, long y) - {point[0] = x; point[1] = y; type = TYPEPOINT; } - void invoke(OpenGLSurfaceEvaluator *eval); - -private: - int type; - REAL coord[2]; - long point[2]; -}; - -class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { -public: - OpenGLSurfaceEvaluator(); - virtual ~OpenGLSurfaceEvaluator( void ); - void polymode( long style ); - void range2f( long, REAL *, REAL * ); - void domain2f( REAL, REAL, REAL, REAL ); - void addMap( SurfaceMap * ) { } - - void enable( long ); - void disable( long ); - void bgnmap2f( long ); - void map2f( long, REAL, REAL, long, long, - REAL, REAL, long, long, REAL * ); - void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); - void mapmesh2f( long, long, long, long, long ); - void evalcoord2f( long, REAL, REAL ); - void evalpoint2i( long, long ); - void endmap2f( void ); - - void bgnline( void ); - void endline( void ); - void bgnclosedline( void ); - void endclosedline( void ); - void bgntmesh( void ); - void swaptmesh( void ); - void endtmesh( void ); - void bgnqstrip( void ); - void endqstrip( void ); - - void bgntfan( void ); - void endtfan( void ); - void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val); - void evalVStrip(int n_left, REAL u_left, REAL* left_val, - int n_right, REAL u_right, REAL* right_val); - - void coord2f( REAL, REAL ); - void point2i( long, long ); - - void newtmeshvert( REAL, REAL ); - void newtmeshvert( long, long ); - -#ifdef _WIN32 - void putCallBack(GLenum which, void (GLAPIENTRY *fn)() ); -#else - void putCallBack(GLenum which, _GLUfuncptr fn ); -#endif - - int get_vertices_call_back() - { - return output_triangles; - } - void put_vertices_call_back(int flag) - { - output_triangles = flag; - } - - void put_callback_auto_normal(int flag) - { - callback_auto_normal = flag; - } - - int get_callback_auto_normal() - { - return callback_auto_normal; - } - - void set_callback_userData(void* data) - { - userData = data; - } - - /**************begin for LOD_eval_list***********/ - void LOD_eval_list(int level); - - - - -private: - StoredVertex *vertexCache[VERTEX_CACHE_SIZE]; - int tmeshing; - int which; - int vcount; - - GLint gl_polygon_mode[2];/*to save and restore so that - *no side effect - */ - bezierPatchMesh *global_bpm; //for output triangles - int output_triangles; //true 1 or false 0 - - - - void (GLAPIENTRY *beginCallBackN) (GLenum type); - void (GLAPIENTRY *endCallBackN) (void); - void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert); - void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal); - void (GLAPIENTRY *colorCallBackN) (const GLfloat *color); - void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord); - - void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data); - void (GLAPIENTRY *endCallBackData) (void* data); - void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data); - void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data); - void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data); - void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data); - - void beginCallBack (GLenum type, void* data); - void endCallBack (void* data); - void vertexCallBack (const GLfloat *vert, void* data); - void normalCallBack (const GLfloat *normal, void* data); - void colorCallBack (const GLfloat *color, void* data); - void texcoordCallBack (const GLfloat *texcoord, void* data); - - - void* userData; //the opaque pointer for Data callback functions. - - /*LOD evaluation*/ - void LOD_triangle(REAL A[2], REAL B[2], REAL C[2], - int level); - void LOD_eval(int num_vert, REAL* verts, int type, int level); - - int LOD_eval_level; //set by LOD_eval_list() - - /*************begin for internal evaluators*****************/ - - /*the following global variables are only defined in this file. - *They are used to cache the precomputed Bezier polynomial values. - *These calues may be used consecutively in which case we don't have - *recompute these values again. - */ - int global_uorder; /*store the uorder in the previous evaluation*/ - int global_vorder; /*store the vorder in the previous evaluation*/ - REAL global_uprime; - REAL global_vprime; - REAL global_vprime_BV; - REAL global_uprime_BU; - int global_uorder_BV; /*store the uorder in the previous evaluation*/ - int global_vorder_BV; /*store the vorder in the previous evaluation*/ - int global_uorder_BU; /*store the uorder in the previous evaluation*/ - int global_vorder_BU; /*store the vorder in the previous evaluation*/ - - REAL global_ucoeff[IN_MAX_BEZIER_ORDER]; /*cache the polynomial values*/ - REAL global_vcoeff[IN_MAX_BEZIER_ORDER]; - REAL global_ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ - REAL global_vcoeffDeriv[IN_MAX_BEZIER_ORDER]; - - REAL global_BV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; - REAL global_PBV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; - REAL global_BU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; - REAL global_PBU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]; - REAL* global_baseData; - - int global_ev_k; /*the dimension*/ - REAL global_ev_u1; - REAL global_ev_u2; - int global_ev_ustride; - int global_ev_uorder; - REAL global_ev_v1; - REAL global_ev_v2; - int global_ev_vstride; - int global_ev_vorder; - REAL global_ev_ctlPoints[IN_MAX_BEZIER_ORDER*IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION]; - - REAL global_grid_u0; - REAL global_grid_u1; - int global_grid_nu; - REAL global_grid_v0; - REAL global_grid_v1; - int global_grid_nv; - -/*functions*/ - void inDoDomain2WithDerivs(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, - REAL *baseData, - REAL *retPoint, REAL *retdu, REAL *retdv); - void inPreEvaluate(int order, REAL vprime, REAL *coeff); - void inPreEvaluateWithDeriv(int order, REAL vprime, REAL *coeff, REAL *coeffDeriv); - void inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv); - void inComputeNormal2(REAL *pu, REAL *pv, REAL *n); - void inDoEvalCoord2(REAL u, REAL v, - REAL *retPoint, REAL *retNormal); - void inDoEvalCoord2NOGE(REAL u, REAL v, - REAL *retPoint, REAL *retNormal); - void inMap2f(int k, - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL vlower, - REAL vupper, - int vstride, - int vorder, - REAL *ctlPoints); - - void inMapGrid2f(int nu, REAL u0, REAL u1, - int nv, REAL v0, REAL v1); - - void inEvalMesh2(int lowU, int lowV, int highU, int highV); - void inEvalPoint2(int i, int j); - void inEvalCoord2f(REAL u, REAL v); - -void inEvalULine(int n_points, REAL v, REAL* u_vals, - int stride, REAL ret_points[][3], REAL ret_normals[][3]); - -void inEvalVLine(int n_points, REAL u, REAL* v_vals, - int stride, REAL ret_points[][3], REAL ret_normals[][3]); - -void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val - ); -void inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val); - -void inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData); -void inPreEvaluateBU(int k, int uorder, int vorder, REAL uprime, REAL *baseData); -void inPreEvaluateBV_intfac(REAL v ) - { - inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); - } - -void inPreEvaluateBU_intfac(REAL u) - { - inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); - } - -void inDoDomain2WithDerivsBV(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, - REAL *baseData, - REAL *retPoint, REAL* retdu, REAL *retdv); - -void inDoDomain2WithDerivsBU(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, - REAL *baseData, - REAL *retPoint, REAL* retdu, REAL *retdv); - - -void inDoEvalCoord2NOGE_BV(REAL u, REAL v, - REAL *retPoint, REAL *retNormal); - -void inDoEvalCoord2NOGE_BU(REAL u, REAL v, - REAL *retPoint, REAL *retNormal); - -void inBPMEval(bezierPatchMesh* bpm); -void inBPMListEval(bezierPatchMesh* list); - -/*-------------begin for surfEvalMachine -------------*/ -surfEvalMachine em_vertex; -surfEvalMachine em_normal; -surfEvalMachine em_color; -surfEvalMachine em_texcoord; - -int auto_normal_flag; //whether to output normla or not in callback - //determined by GL_AUTO_NORMAL and callback_auto_normal -int callback_auto_normal; //GLU_CALLBACK_AUTO_NORMAL_EXT -int vertex_flag; -int normal_flag; -int color_flag; -int texcoord_flag; - -void inMap2fEM(int which, //0:vert,1:norm,2:color,3:tex - int dimension, - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL vlower, - REAL vupper, - int vstride, - int vorder, - REAL *ctlPoints); - -void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, - REAL *retPoint, REAL *retdu, REAL *retdv); -void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, - REAL *retPoint); - void inDoEvalCoord2EM(REAL u, REAL v); - -void inBPMEvalEM(bezierPatchMesh* bpm); -void inBPMListEvalEM(bezierPatchMesh* list); - -/*-------------end for surfEvalMachine -------------*/ - - - /*************end for internal evaluators*****************/ - -}; - -inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval) -{ - switch(type) { - case TYPECOORD: - eval->coord2f(coord[0], coord[1]); - break; - case TYPEPOINT: - eval->point2i(point[0], point[1]); - break; - default: - break; - } -} - -#endif /* __gluglsurfeval_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/interface/incurveeval.cc b/src/libs/mesa/glu/libnurbs/interface/incurveeval.cc deleted file mode 100644 index 96ea8896ae..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/incurveeval.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include - -#include "glcurveval.h" - - -/* - *compute the Bezier polynomials C[n,j](v) for all j at v with - *return values stored in coeff[], where - * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j), - * j=0,1,2,...,n. - *order : n+1 - *vprime: v - *coeff : coeff[j]=C[n,j](v), this array store the returned values. - *The algorithm is a recursive scheme: - * C[0,0]=1; - * C[n,j](v) = (1-v)*C[n-1,j](v) + v*C[n-1,j-1](v), n>=1 - *This code is copied from opengl/soft/so_eval.c:PreEvaluate - */ -void OpenGLCurveEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) -{ - int i, j; - REAL oldval, temp; - REAL oneMinusvprime; - - /* - * Minor optimization - * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to - * their i==1 loop values to avoid the initialization and the i==1 loop. - */ - if (order == 1) { - coeff[0] = 1.0; - return; - } - - oneMinusvprime = 1-vprime; - coeff[0] = oneMinusvprime; - coeff[1] = vprime; - if (order == 2) return; - - for (i = 2; i < order; i++) { - oldval = coeff[0] * vprime; - coeff[0] = oneMinusvprime * coeff[0]; - for (j = 1; j < i; j++) { - temp = oldval; - oldval = coeff[j] * vprime; - coeff[j] = temp + oneMinusvprime * coeff[j]; - } - coeff[j] = oldval; - } -} - -void OpenGLCurveEvaluator::inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex - int k, //dimension - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL *ctlpoints) -{ - int i,x; - curveEvalMachine *temp_em; - switch(which){ - case 0: //vertex - vertex_flag = 1; - temp_em = &em_vertex; - break; - case 1: //normal - normal_flag = 1; - temp_em = &em_normal; - break; - case 2: //color - color_flag = 1; - temp_em = &em_color; - break; - default: - texcoord_flag = 1; - temp_em = &em_texcoord; - break; - } - - REAL *data = temp_em->ctlpoints; - temp_em->uprime = -1; //initialized - temp_em->k = k; - temp_em->u1 = ulower; - temp_em->u2 = uupper; - temp_em->ustride = ustride; - temp_em->uorder = uorder; - /*copy the control points*/ - for(i=0; iu2 == em->u1) - return; - the_uprime = (u-em->u1) / (em->u2-em->u1); - /*use already cached values if possible*/ - if(em->uprime != the_uprime){ - inPreEvaluate(em->uorder, the_uprime, em->ucoeff); - em->uprime = the_uprime; - } - - for(j=0; jk; j++){ - data = em->ctlpoints+j; - retPoint[j] = 0.0; - for(row=0; rowuorder; row++) - { - retPoint[j] += em->ucoeff[row] * (*data); - data += em->k; - } - } -} - -void OpenGLCurveEvaluator::inDoEvalCoord1(REAL u) -{ - REAL temp_vertex[4]; - REAL temp_normal[3]; - REAL temp_color[4]; - REAL temp_texcoord[4]; - if(texcoord_flag) //there is a texture map - { - inDoDomain1(&em_texcoord, u, temp_texcoord); - texcoordCallBack(temp_texcoord, userData); - } -#ifdef DEBUG -printf("color_flag = %i\n", color_flag); -#endif - if(color_flag) //there is a color map - { - inDoDomain1(&em_color, u, temp_color); - colorCallBack(temp_color, userData); - } - if(normal_flag) //there is a normal map - { - inDoDomain1(&em_normal, u, temp_normal); - normalCallBack(temp_normal, userData); - } - if(vertex_flag) - { - inDoDomain1(&em_vertex, u, temp_vertex); - vertexCallBack(temp_vertex, userData); - } -} - -void OpenGLCurveEvaluator::inMapMesh1f(int umin, int umax) -{ - REAL du, u; - int i; - if(global_grid_nu == 0) - return; //no points to output - du = (global_grid_u1 - global_grid_u0) / (REAL) global_grid_nu; - bgnline(); - for(i=umin; i<= umax; i++){ - u = (i==global_grid_nu)? global_grid_u1: global_grid_u0 + i*du; - inDoEvalCoord1(u); - } - endline(); -} diff --git a/src/libs/mesa/glu/libnurbs/interface/insurfeval.cc b/src/libs/mesa/glu/libnurbs/interface/insurfeval.cc deleted file mode 100644 index 9d0c82a91c..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/insurfeval.cc +++ /dev/null @@ -1,2064 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include -#include - -#include "glsurfeval.h" - -//extern int surfcount; - -//#define CRACK_TEST - -#define AVOID_ZERO_NORMAL - -#ifdef AVOID_ZERO_NORMAL -#define myabs(x) ((x>0)? x: (-x)) -#define MYZERO 0.000001 -#define MYDELTA 0.001 -#endif - -//#define USE_LOD -#ifdef USE_LOD -//#define LOD_EVAL_COORD(u,v) inDoEvalCoord2EM(u,v) -#define LOD_EVAL_COORD(u,v) glEvalCoord2f(u,v) - -static void LOD_interpolate(REAL A[2], REAL B[2], REAL C[2], int j, int k, int pow2_level, - REAL& u, REAL& v) -{ - REAL a,a1,b,b1; - - a = ((REAL) j) / ((REAL) pow2_level); - a1 = 1-a; - - if(j != 0) - { - b = ((REAL) k) / ((REAL)j); - b1 = 1-b; - } - REAL x,y,z; - x = a1; - if(j==0) - { - y=0; z=0; - } - else{ - y = b1*a; - z = b *a; - } - - u = x*A[0] + y*B[0] + z*C[0]; - v = x*A[1] + y*B[1] + z*C[1]; -} - -void OpenGLSurfaceEvaluator::LOD_triangle(REAL A[2], REAL B[2], REAL C[2], - int level) -{ - int k,j; - int pow2_level; - /*compute 2^level*/ - pow2_level = 1; - - for(j=0; jnext) - { - inBPMEval(temp); - } -} - -void OpenGLSurfaceEvaluator::inBPMEval(bezierPatchMesh* bpm) -{ - int i,j,k,l; - float u,v; - - int ustride = bpm->bpatch->dimension * bpm->bpatch->vorder; - int vstride = bpm->bpatch->dimension; - inMap2f( - (bpm->bpatch->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4, - bpm->bpatch->umin, - bpm->bpatch->umax, - ustride, - bpm->bpatch->uorder, - bpm->bpatch->vmin, - bpm->bpatch->vmax, - vstride, - bpm->bpatch->vorder, - bpm->bpatch->ctlpoints); - - bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3+1); /*in case the origional dimenion is 4, then we need 4 space to pass to evaluator.*/ - assert(bpm->vertex_array); - bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); - assert(bpm->normal_array); -#ifdef CRACK_TEST -if( global_ev_u1 ==2 && global_ev_u2 == 3 - && global_ev_v1 ==2 && global_ev_v2 == 3) -{ -REAL vertex[4]; -REAL normal[4]; -#ifdef DEBUG -printf("***number 1\n"); -#endif - -beginCallBack(GL_QUAD_STRIP, NULL); -inEvalCoord2f(3.0, 3.0); -inEvalCoord2f(2.0, 3.0); -inEvalCoord2f(3.0, 2.7); -inEvalCoord2f(2.0, 2.7); -inEvalCoord2f(3.0, 2.0); -inEvalCoord2f(2.0, 2.0); -endCallBack(NULL); - - -beginCallBack(GL_TRIANGLE_STRIP, NULL); -inEvalCoord2f(2.0, 3.0); -inEvalCoord2f(2.0, 2.0); -inEvalCoord2f(2.0, 2.7); -endCallBack(NULL); - -} - -/* -if( global_ev_u1 ==2 && global_ev_u2 == 3 - && global_ev_v1 ==1 && global_ev_v2 == 2) -{ -#ifdef DEBUG -printf("***number 2\n"); -#endif -beginCallBack(GL_QUAD_STRIP); -inEvalCoord2f(2.0, 2.0); -inEvalCoord2f(2.0, 1.0); -inEvalCoord2f(3.0, 2.0); -inEvalCoord2f(3.0, 1.0); -endCallBack(); -} -*/ -if( global_ev_u1 ==1 && global_ev_u2 == 2 - && global_ev_v1 ==2 && global_ev_v2 == 3) -{ -#ifdef DEBUG -printf("***number 3\n"); -#endif -beginCallBack(GL_QUAD_STRIP, NULL); -inEvalCoord2f(2.0, 3.0); -inEvalCoord2f(1.0, 3.0); -inEvalCoord2f(2.0, 2.3); -inEvalCoord2f(1.0, 2.3); -inEvalCoord2f(2.0, 2.0); -inEvalCoord2f(1.0, 2.0); -endCallBack(NULL); - -beginCallBack(GL_TRIANGLE_STRIP, NULL); -inEvalCoord2f(2.0, 2.3); -inEvalCoord2f(2.0, 2.0); -inEvalCoord2f(2.0, 3.0); -endCallBack(NULL); - -} -return; -#endif - - k=0; - l=0; - - for(i=0; iindex_length_array; i++) - { - beginCallBack(bpm->type_array[i], userData); - for(j=0; jlength_array[i]; j++) - { - u = bpm->UVarray[k]; - v = bpm->UVarray[k+1]; - inDoEvalCoord2NOGE(u,v, - bpm->vertex_array+l, - bpm->normal_array+l); - - normalCallBack(bpm->normal_array+l, userData); - vertexCallBack(bpm->vertex_array+l, userData); - - k += 2; - l += 3; - } - endCallBack(userData); - } -} - -void OpenGLSurfaceEvaluator::inEvalPoint2(int i, int j) -{ - REAL du, dv; - REAL point[4]; - REAL normal[3]; - REAL u,v; - du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - u = (i==global_grid_nu)? global_grid_u1:(global_grid_u0 + i*du); - v = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - inDoEvalCoord2(u,v,point,normal); -} - -void OpenGLSurfaceEvaluator::inEvalCoord2f(REAL u, REAL v) -{ - - REAL point[4]; - REAL normal[3]; - inDoEvalCoord2(u,v,point, normal); -} - - - -/*define a grid. store the values into the global variabls: - * global_grid_* - *These values will be used later by evaluating functions - */ -void OpenGLSurfaceEvaluator::inMapGrid2f(int nu, REAL u0, REAL u1, - int nv, REAL v0, REAL v1) -{ - global_grid_u0 = u0; - global_grid_u1 = u1; - global_grid_nu = nu; - global_grid_v0 = v0; - global_grid_v1 = v1; - global_grid_nv = nv; -} - -void OpenGLSurfaceEvaluator::inEvalMesh2(int lowU, int lowV, int highU, int highV) -{ - REAL du, dv; - int i,j; - REAL point[4]; - REAL normal[3]; - if(global_grid_nu == 0 || global_grid_nv == 0) - return; /*no points need to be output*/ - du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - - if(global_grid_nu >= global_grid_nv){ - for(i=lowU; i=lowV; j--){ - REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - - inDoEvalCoord2(u1, v1, point, normal); - inDoEvalCoord2(u2, v1, point, normal); - } - endqstrip(); - } - } - - else{ - for(i=lowV; i=lowU; j--){ - REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); - inDoEvalCoord2(u1, v2, point, normal); - inDoEvalCoord2(u1, v1, point, normal); - } - endqstrip(); - } - } - -} - -void OpenGLSurfaceEvaluator::inMap2f(int k, - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL vlower, - REAL vupper, - int vstride, - int vorder, - REAL *ctlPoints) -{ - int i,j,x; - REAL *data = global_ev_ctlPoints; - - - - if(k == GL_MAP2_VERTEX_3) k=3; - else if (k==GL_MAP2_VERTEX_4) k =4; - else { - printf("error in inMap2f, maptype=%i is wrong, k,map is not updated\n", k); - return; - } - - global_ev_k = k; - global_ev_u1 = ulower; - global_ev_u2 = uupper; - global_ev_ustride = ustride; - global_ev_uorder = uorder; - global_ev_v1 = vlower; - global_ev_v2 = vupper; - global_ev_vstride = vstride; - global_ev_vorder = vorder; - - /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/ - for (i=0; i 0.0) { - n[0] /= mag; - n[1] /= mag; - n[2] /= mag; - } -} - - - -/*Compute point and normal - *see the head of inDoDomain2WithDerivs - *for the meaning of the arguments - */ -void OpenGLSurfaceEvaluator::inDoEvalCoord2(REAL u, REAL v, - REAL *retPoint, REAL *retNormal) -{ - - REAL du[4]; - REAL dv[4]; - - - assert(global_ev_k>=3 && global_ev_k <= 4); - /*compute homegeneous point and partial derivatives*/ - inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); - -#ifdef AVOID_ZERO_NORMAL - - if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) - { - - REAL tempdu[4]; - REAL tempdata[4]; - REAL u1 = global_ev_u1; - REAL u2 = global_ev_u2; - if(u-MYDELTA*(u2-u1) < u1) - u = u+ MYDELTA*(u2-u1); - else - u = u-MYDELTA*(u2-u1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); - } - if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) - { - REAL tempdv[4]; - REAL tempdata[4]; - REAL v1 = global_ev_v1; - REAL v2 = global_ev_v2; - if(v-MYDELTA*(v2-v1) < v1) - v = v+ MYDELTA*(v2-v1); - else - v = v-MYDELTA*(v2-v1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); - } -#endif - - - /*compute normal*/ - switch(global_ev_k){ - case 3: - inComputeNormal2(du, dv, retNormal); - - break; - case 4: - inComputeFirstPartials(retPoint, du, dv); - inComputeNormal2(du, dv, retNormal); - /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ - retPoint[0] /= retPoint[3]; - retPoint[1] /= retPoint[3]; - retPoint[2] /= retPoint[3]; - break; - } - /*output this vertex*/ -/* inMeshStreamInsert(global_ms, retPoint, retNormal);*/ - - - - glNormal3fv(retNormal); - glVertex3fv(retPoint); - - - - - #ifdef DEBUG - printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]); - #endif - - - -} - -/*Compute point and normal - *see the head of inDoDomain2WithDerivs - *for the meaning of the arguments - */ -void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BU(REAL u, REAL v, - REAL *retPoint, REAL *retNormal) -{ - - REAL du[4]; - REAL dv[4]; - - - assert(global_ev_k>=3 && global_ev_k <= 4); - /*compute homegeneous point and partial derivatives*/ -// inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); - inDoDomain2WithDerivsBU(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); - - -#ifdef AVOID_ZERO_NORMAL - - if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) - { - - REAL tempdu[4]; - REAL tempdata[4]; - REAL u1 = global_ev_u1; - REAL u2 = global_ev_u2; - if(u-MYDELTA*(u2-u1) < u1) - u = u+ MYDELTA*(u2-u1); - else - u = u-MYDELTA*(u2-u1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); - } - if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) - { - REAL tempdv[4]; - REAL tempdata[4]; - REAL v1 = global_ev_v1; - REAL v2 = global_ev_v2; - if(v-MYDELTA*(v2-v1) < v1) - v = v+ MYDELTA*(v2-v1); - else - v = v-MYDELTA*(v2-v1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); - } -#endif - - /*compute normal*/ - switch(global_ev_k){ - case 3: - inComputeNormal2(du, dv, retNormal); - break; - case 4: - inComputeFirstPartials(retPoint, du, dv); - inComputeNormal2(du, dv, retNormal); - /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ - retPoint[0] /= retPoint[3]; - retPoint[1] /= retPoint[3]; - retPoint[2] /= retPoint[3]; - break; - } -} - -/*Compute point and normal - *see the head of inDoDomain2WithDerivs - *for the meaning of the arguments - */ -void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV(REAL u, REAL v, - REAL *retPoint, REAL *retNormal) -{ - - REAL du[4]; - REAL dv[4]; - - - assert(global_ev_k>=3 && global_ev_k <= 4); - /*compute homegeneous point and partial derivatives*/ -// inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); - - inDoDomain2WithDerivsBV(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); - - -#ifdef AVOID_ZERO_NORMAL - - if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) - { - - REAL tempdu[4]; - REAL tempdata[4]; - REAL u1 = global_ev_u1; - REAL u2 = global_ev_u2; - if(u-MYDELTA*(u2-u1) < u1) - u = u+ MYDELTA*(u2-u1); - else - u = u-MYDELTA*(u2-u1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); - } - if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) - { - REAL tempdv[4]; - REAL tempdata[4]; - REAL v1 = global_ev_v1; - REAL v2 = global_ev_v2; - if(v-MYDELTA*(v2-v1) < v1) - v = v+ MYDELTA*(v2-v1); - else - v = v-MYDELTA*(v2-v1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); - } -#endif - - /*compute normal*/ - switch(global_ev_k){ - case 3: - inComputeNormal2(du, dv, retNormal); - break; - case 4: - inComputeFirstPartials(retPoint, du, dv); - inComputeNormal2(du, dv, retNormal); - /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ - retPoint[0] /= retPoint[3]; - retPoint[1] /= retPoint[3]; - retPoint[2] /= retPoint[3]; - break; - } -} - - -/*Compute point and normal - *see the head of inDoDomain2WithDerivs - *for the meaning of the arguments - */ -void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE(REAL u, REAL v, - REAL *retPoint, REAL *retNormal) -{ - - REAL du[4]; - REAL dv[4]; - - - assert(global_ev_k>=3 && global_ev_k <= 4); - /*compute homegeneous point and partial derivatives*/ - inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); - - -#ifdef AVOID_ZERO_NORMAL - - if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) - { - - REAL tempdu[4]; - REAL tempdata[4]; - REAL u1 = global_ev_u1; - REAL u2 = global_ev_u2; - if(u-MYDELTA*(u2-u1) < u1) - u = u+ MYDELTA*(u2-u1); - else - u = u-MYDELTA*(u2-u1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, tempdu, dv); - } - if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) - { - REAL tempdv[4]; - REAL tempdata[4]; - REAL v1 = global_ev_v1; - REAL v2 = global_ev_v2; - if(v-MYDELTA*(v2-v1) < v1) - v = v+ MYDELTA*(v2-v1); - else - v = v-MYDELTA*(v2-v1); - inDoDomain2WithDerivs(global_ev_k, u,v,global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, tempdata, du, tempdv); - } -#endif - - /*compute normal*/ - switch(global_ev_k){ - case 3: - inComputeNormal2(du, dv, retNormal); - break; - case 4: - inComputeFirstPartials(retPoint, du, dv); - inComputeNormal2(du, dv, retNormal); - /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ - retPoint[0] /= retPoint[3]; - retPoint[1] /= retPoint[3]; - retPoint[2] /= retPoint[3]; - break; - } -// glNormal3fv(retNormal); -// glVertex3fv(retPoint); -} - -void OpenGLSurfaceEvaluator::inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData) -{ - int j,row,col; - REAL p, pdv; - REAL *data; - - if(global_vprime != vprime || global_vorder != vorder) { - inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv); - global_vprime = vprime; - global_vorder = vorder; - } - - for(j=0; j=1 - *This code is copied from opengl/soft/so_eval.c:PreEvaluate - */ -void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) -{ - int i, j; - REAL oldval, temp; - REAL oneMinusvprime; - - /* - * Minor optimization - * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to - * their i==1 loop values to avoid the initialization and the i==1 loop. - */ - if (order == 1) { - coeff[0] = 1.0; - return; - } - - oneMinusvprime = 1-vprime; - coeff[0] = oneMinusvprime; - coeff[1] = vprime; - if (order == 2) return; - - for (i = 2; i < order; i++) { - oldval = coeff[0] * vprime; - coeff[0] = oneMinusvprime * coeff[0]; - for (j = 1; j < i; j++) { - temp = oldval; - oldval = coeff[j] * vprime; - coeff[j] = temp + oneMinusvprime * coeff[j]; - } - coeff[j] = oldval; - } -} - -/* - *compute the Bezier polynomials C[n,j](v) and derivatives for all j at v with - *return values stored in coeff[] and coeffDeriv[]. - *see the head of function inPreEvaluate for the definition of C[n,j](v) - *and how to compute the values. - *The algorithm to compute the derivative is: - * dC[0,0](v) = 0. - * dC[n,j](v) = n*(dC[n-1,j-1](v) - dC[n-1,j](v)). - * - *This code is copied from opengl/soft/so_eval.c:PreEvaluateWidthDeriv - */ -void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, - REAL *coeff, REAL *coeffDeriv) -{ - int i, j; - REAL oldval, temp; - REAL oneMinusvprime; - - oneMinusvprime = 1-vprime; - /* - * Minor optimization - * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to - * their i==1 loop values to avoid the initialization and the i==1 loop. - */ - if (order == 1) { - coeff[0] = 1.0; - coeffDeriv[0] = 0.0; - return; - } else if (order == 2) { - coeffDeriv[0] = -1.0; - coeffDeriv[1] = 1.0; - coeff[0] = oneMinusvprime; - coeff[1] = vprime; - return; - } - coeff[0] = oneMinusvprime; - coeff[1] = vprime; - for (i = 2; i < order - 1; i++) { - oldval = coeff[0] * vprime; - coeff[0] = oneMinusvprime * coeff[0]; - for (j = 1; j < i; j++) { - temp = oldval; - oldval = coeff[j] * vprime; - coeff[j] = temp + oneMinusvprime * coeff[j]; - } - coeff[j] = oldval; - } - coeffDeriv[0] = -coeff[0]; - /* - ** Minor optimization: - ** Would make this a "for (j=1; j=1 - *n_lower >=1 - */ -void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val) -{ - int i,j,k,l; - REAL leftMostV[2]; - typedef REAL REAL3[3]; - - REAL3* upperXYZ = (REAL3*) malloc(sizeof(REAL3)*n_upper); - assert(upperXYZ); - REAL3* upperNormal = (REAL3*) malloc(sizeof(REAL3) * n_upper); - assert(upperNormal); - REAL3* lowerXYZ = (REAL3*) malloc(sizeof(REAL3)*n_lower); - assert(lowerXYZ); - REAL3* lowerNormal = (REAL3*) malloc(sizeof(REAL3) * n_lower); - assert(lowerNormal); - - inEvalULine(n_upper, v_upper, upper_val, 1, upperXYZ, upperNormal); - inEvalULine(n_lower, v_lower, lower_val, 1, lowerXYZ, lowerNormal); - - - - REAL* leftMostXYZ; - REAL* leftMostNormal; - - /* - *the algorithm works by scanning from left to right. - *leftMostV: the left most of the remaining verteces (on both upper and lower). - * it could an element of upperVerts or lowerVerts. - *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line */ - - /*initialize i,j,and leftMostV - */ - if(upper_val[0] <= lower_val[0]) - { - i=1; - j=0; - - leftMostV[0] = upper_val[0]; - leftMostV[1] = v_upper; - leftMostXYZ = upperXYZ[0]; - leftMostNormal = upperNormal[0]; - } - else - { - i=0; - j=1; - - leftMostV[0] = lower_val[0]; - leftMostV[1] = v_lower; - - leftMostXYZ = lowerXYZ[0]; - leftMostNormal = lowerNormal[0]; - } - - /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and leftMostV are - *maintained - */ - while(1) - { - if(i >= n_upper) /*case1: no more in upper*/ - { - if(j= n_lower) /*case2: no more in lower*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ - { - glNormal3fv(upperNormal[k]); - glVertex3fv(upperXYZ[k]); - } - - endtfan(); - } - break; /*exit the main loop*/ - } - else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ - { - if(upper_val[i] <= lower_val[j]) - { - bgntfan(); - - glNormal3fv(lowerNormal[j]); - glVertex3fv(lowerXYZ[j]); - - /*find the last k>=i such that - *upperverts[k][0] <= lowerverts[j][0] - */ - k=i; - - while(k lower_val[j]) - break; - k++; - - } - k--; - - - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { - glNormal3fv(upperNormal[l]); - glVertex3fv(upperXYZ[l]); - - } - glNormal3fv(leftMostNormal); - glVertex3fv(leftMostXYZ); - - endtfan(); - - /*update i and leftMostV for next loop - */ - i = k+1; - - leftMostV[0] = upper_val[k]; - leftMostV[1] = v_upper; - leftMostNormal = upperNormal[k]; - leftMostXYZ = upperXYZ[k]; - } - else /*upperVerts[i][0] > lowerVerts[j][0]*/ - { - bgntfan(); - glNormal3fv(upperNormal[i]); - glVertex3fv(upperXYZ[i]); - - glNormal3fv(leftMostNormal); - glVertex3fv(leftMostXYZ); - - - /*find the last k>=j such that - *lowerverts[k][0] < upperverts[i][0] - */ - k=j; - while(k< n_lower) - { - if(lower_val[k] >= upper_val[i]) - break; - glNormal3fv(lowerNormal[k]); - glVertex3fv(lowerXYZ[k]); - - k++; - } - endtfan(); - - /*update j and leftMostV for next loop - */ - j=k; - leftMostV[0] = lower_val[j-1]; - leftMostV[1] = v_lower; - - leftMostNormal = lowerNormal[j-1]; - leftMostXYZ = lowerXYZ[j-1]; - } - } - } - //clean up - free(upperXYZ); - free(lowerXYZ); - free(upperNormal); - free(lowerNormal); -} - -/*triangulate a strip bounded by two lines which are parallel to V-axis - *leftVerts: the verteces on the left line - *rightVertx: the verteces on the right line - *n_left >=1 - *n_right >=1 - */ -void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) -{ - int i,j,k,l; - REAL botMostV[2]; - typedef REAL REAL3[3]; - - REAL3* leftXYZ = (REAL3*) malloc(sizeof(REAL3)*n_left); - assert(leftXYZ); - REAL3* leftNormal = (REAL3*) malloc(sizeof(REAL3) * n_left); - assert(leftNormal); - REAL3* rightXYZ = (REAL3*) malloc(sizeof(REAL3)*n_right); - assert(rightXYZ); - REAL3* rightNormal = (REAL3*) malloc(sizeof(REAL3) * n_right); - assert(rightNormal); - - inEvalVLine(n_left, u_left, left_val, 1, leftXYZ, leftNormal); - inEvalVLine(n_right, u_right, right_val, 1, rightXYZ, rightNormal); - - - - REAL* botMostXYZ; - REAL* botMostNormal; - - /* - *the algorithm works by scanning from bot to top. - *botMostV: the bot most of the remaining verteces (on both left and right). - * it could an element of leftVerts or rightVerts. - *i: leftVerts[i] is the first vertex to the top of botMostV on left line - *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */ - - /*initialize i,j,and botMostV - */ - if(left_val[0] <= right_val[0]) - { - i=1; - j=0; - - botMostV[0] = u_left; - botMostV[1] = left_val[0]; - botMostXYZ = leftXYZ[0]; - botMostNormal = leftNormal[0]; - } - else - { - i=0; - j=1; - - botMostV[0] = u_right; - botMostV[1] = right_val[0]; - - botMostXYZ = rightXYZ[0]; - botMostNormal = rightNormal[0]; - } - - /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and botMostV are - *maintained - */ - while(1) - { - if(i >= n_left) /*case1: no more in left*/ - { - if(j= n_right) /*case2: no more in right*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ - { - glNormal3fv(leftNormal[k]); - glVertex3fv(leftXYZ[k]); - } - - endtfan(); - } - break; /*exit the main loop*/ - } - else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ - { - if(left_val[i] <= right_val[j]) - { - bgntfan(); - - glNormal3fv(rightNormal[j]); - glVertex3fv(rightXYZ[j]); - - /*find the last k>=i such that - *leftverts[k][0] <= rightverts[j][0] - */ - k=i; - - while(k right_val[j]) - break; - k++; - - } - k--; - - - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { - glNormal3fv(leftNormal[l]); - glVertex3fv(leftXYZ[l]); - - } - glNormal3fv(botMostNormal); - glVertex3fv(botMostXYZ); - - endtfan(); - - /*update i and botMostV for next loop - */ - i = k+1; - - botMostV[0] = u_left; - botMostV[1] = left_val[k]; - botMostNormal = leftNormal[k]; - botMostXYZ = leftXYZ[k]; - } - else /*left_val[i] > right_val[j])*/ - { - bgntfan(); - glNormal3fv(leftNormal[i]); - glVertex3fv(leftXYZ[i]); - - glNormal3fv(botMostNormal); - glVertex3fv(botMostXYZ); - - - /*find the last k>=j such that - *rightverts[k][0] < leftverts[i][0] - */ - k=j; - while(k< n_right) - { - if(right_val[k] >= left_val[i]) - break; - glNormal3fv(rightNormal[k]); - glVertex3fv(rightXYZ[k]); - - k++; - } - endtfan(); - - /*update j and botMostV for next loop - */ - j=k; - botMostV[0] = u_right; - botMostV[1] = right_val[j-1]; - - botMostNormal = rightNormal[j-1]; - botMostXYZ = rightXYZ[j-1]; - } - } - } - //clean up - free(leftXYZ); - free(rightXYZ); - free(leftNormal); - free(rightNormal); -} - -/*-----------------------begin evalMachine-------------------*/ -void OpenGLSurfaceEvaluator::inMap2fEM(int which, int k, - REAL ulower, - REAL uupper, - int ustride, - int uorder, - REAL vlower, - REAL vupper, - int vstride, - int vorder, - REAL *ctlPoints) -{ - int i,j,x; - surfEvalMachine *temp_em; - switch(which){ - case 0: //vertex - vertex_flag = 1; - temp_em = &em_vertex; - break; - case 1: //normal - normal_flag = 1; - temp_em = &em_normal; - break; - case 2: //color - color_flag = 1; - temp_em = &em_color; - break; - default: - texcoord_flag = 1; - temp_em = &em_texcoord; - break; - } - - REAL *data = temp_em->ctlPoints; - - temp_em->uprime = -1;//initilized - temp_em->vprime = -1; - - temp_em->k = k; - temp_em->u1 = ulower; - temp_em->u2 = uupper; - temp_em->ustride = ustride; - temp_em->uorder = uorder; - temp_em->v1 = vlower; - temp_em->v2 = vupper; - temp_em->vstride = vstride; - temp_em->vorder = vorder; - - /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/ - for (i=0; iu2 == em->u1) || (em->v2 == em->v1)) - return; - the_uprime = (u - em->u1) / (em->u2 - em->u1); - the_vprime = (v - em->v1) / (em->v2 - em->v1); - - /* Compute coefficients for values and derivs */ - - /* Use already cached values if possible */ - if(em->uprime != the_uprime) { - inPreEvaluateWithDeriv(em->uorder, the_uprime, em->ucoeff, em->ucoeffDeriv); - em->uprime = the_uprime; - } - if (em->vprime != the_vprime) { - inPreEvaluateWithDeriv(em->vorder, the_vprime, em->vcoeff, em->vcoeffDeriv); - em->vprime = the_vprime; - } - - for (j = 0; j < em->k; j++) { - data=em->ctlPoints+j; - retPoint[j] = retdu[j] = retdv[j] = 0.0; - for (row = 0; row < em->uorder; row++) { - /* - ** Minor optimization. - ** The col == 0 part of the loop is extracted so we don't - ** have to initialize p and pdv to 0. - */ - p = em->vcoeff[0] * (*data); - pdv = em->vcoeffDeriv[0] * (*data); - data += em->k; - for (col = 1; col < em->vorder; col++) { - /* Incrementally build up p, pdv value */ - p += em->vcoeff[col] * (*data); - pdv += em->vcoeffDeriv[col] * (*data); - data += em->k; - } - /* Use p, pdv value to incrementally add up r, du, dv */ - retPoint[j] += em->ucoeff[row] * p; - retdu[j] += em->ucoeffDeriv[row] * p; - retdv[j] += em->ucoeff[row] * pdv; - } - } -} - -void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, - REAL *retPoint) -{ - int j, row, col; - REAL the_uprime; - REAL the_vprime; - REAL p; - REAL *data; - - if((em->u2 == em->u1) || (em->v2 == em->v1)) - return; - the_uprime = (u - em->u1) / (em->u2 - em->u1); - the_vprime = (v - em->v1) / (em->v2 - em->v1); - - /* Compute coefficients for values and derivs */ - - /* Use already cached values if possible */ - if(em->uprime != the_uprime) { - inPreEvaluate(em->uorder, the_uprime, em->ucoeff); - em->uprime = the_uprime; - } - if (em->vprime != the_vprime) { - inPreEvaluate(em->vorder, the_vprime, em->vcoeff); - em->vprime = the_vprime; - } - - for (j = 0; j < em->k; j++) { - data=em->ctlPoints+j; - retPoint[j] = 0.0; - for (row = 0; row < em->uorder; row++) { - /* - ** Minor optimization. - ** The col == 0 part of the loop is extracted so we don't - ** have to initialize p and pdv to 0. - */ - p = em->vcoeff[0] * (*data); - data += em->k; - for (col = 1; col < em->vorder; col++) { - /* Incrementally build up p, pdv value */ - p += em->vcoeff[col] * (*data); - data += em->k; - } - /* Use p, pdv value to incrementally add up r, du, dv */ - retPoint[j] += em->ucoeff[row] * p; - } - } -} - - -void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) -{ - REAL temp_vertex[5]; - REAL temp_normal[3]; - REAL temp_color[4]; - REAL temp_texcoord[4]; - - if(texcoord_flag) - { - inDoDomain2EM(&em_texcoord, u,v, temp_texcoord); - texcoordCallBack(temp_texcoord, userData); - } - if(color_flag) - { - inDoDomain2EM(&em_color, u,v, temp_color); - colorCallBack(temp_color, userData); - } - - if(normal_flag) //there is a normla map - { - inDoDomain2EM(&em_normal, u,v, temp_normal); - normalCallBack(temp_normal, userData); - - if(vertex_flag) - { - inDoDomain2EM(&em_vertex, u,v,temp_vertex); - if(em_vertex.k == 4) - { - temp_vertex[0] /= temp_vertex[3]; - temp_vertex[1] /= temp_vertex[3]; - temp_vertex[2] /= temp_vertex[3]; - } - temp_vertex[3]=u; - temp_vertex[4]=v; - vertexCallBack(temp_vertex, userData); - } - } - else if(auto_normal_flag) //no normal map but there is a normal callbackfunctin - { - REAL du[4]; - REAL dv[4]; - - /*compute homegeneous point and partial derivatives*/ - inDoDomain2WithDerivsEM(&em_vertex, u,v,temp_vertex,du,dv); - - if(em_vertex.k ==4) - inComputeFirstPartials(temp_vertex, du, dv); - -#ifdef AVOID_ZERO_NORMAL - if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) - { - - REAL tempdu[4]; - REAL tempdata[4]; - REAL u1 = em_vertex.u1; - REAL u2 = em_vertex.u2; - if(u-MYDELTA*(u2-u1) < u1) - u = u+ MYDELTA*(u2-u1); - else - u = u-MYDELTA*(u2-u1); - inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, tempdu, dv); - - if(em_vertex.k ==4) - inComputeFirstPartials(temp_vertex, du, dv); - } - else if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) - { - REAL tempdv[4]; - REAL tempdata[4]; - REAL v1 = em_vertex.v1; - REAL v2 = em_vertex.v2; - if(v-MYDELTA*(v2-v1) < v1) - v = v+ MYDELTA*(v2-v1); - else - v = v-MYDELTA*(v2-v1); - inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, du, tempdv); - - if(em_vertex.k ==4) - inComputeFirstPartials(temp_vertex, du, dv); - } -#endif - - /*compute normal*/ - switch(em_vertex.k){ - case 3: - - inComputeNormal2(du, dv, temp_normal); - break; - case 4: - -// inComputeFirstPartials(temp_vertex, du, dv); - inComputeNormal2(du, dv, temp_normal); - - /*transform the homegeneous coordinate of retPoint into inhomogenous one*/ - temp_vertex[0] /= temp_vertex[3]; - temp_vertex[1] /= temp_vertex[3]; - temp_vertex[2] /= temp_vertex[3]; - break; - } - normalCallBack(temp_normal, userData); - temp_vertex[3] = u; - temp_vertex[4] = v; - vertexCallBack(temp_vertex, userData); - - }/*end if auto_normal*/ - else //no normal map, and no normal callback function - { - if(vertex_flag) - { - inDoDomain2EM(&em_vertex, u,v,temp_vertex); - if(em_vertex.k == 4) - { - temp_vertex[0] /= temp_vertex[3]; - temp_vertex[1] /= temp_vertex[3]; - temp_vertex[2] /= temp_vertex[3]; - } - temp_vertex[3] = u; - temp_vertex[4] = v; - vertexCallBack(temp_vertex, userData); - } - } -} - - -void OpenGLSurfaceEvaluator::inBPMEvalEM(bezierPatchMesh* bpm) -{ - int i,j,k; - float u,v; - - int ustride; - int vstride; - -#ifdef USE_LOD - if(bpm->bpatch != NULL) - { - bezierPatch* p=bpm->bpatch; - ustride = p->dimension * p->vorder; - vstride = p->dimension; - - glMap2f( (p->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); - - -/* - inMap2fEM(0, p->dimension, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); -*/ - } -#else - - if(bpm->bpatch != NULL){ - bezierPatch* p = bpm->bpatch; - ustride = p->dimension * p->vorder; - vstride = p->dimension; - inMap2fEM(0, p->dimension, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); - } - if(bpm->bpatch_normal != NULL){ - bezierPatch* p = bpm->bpatch_normal; - ustride = p->dimension * p->vorder; - vstride = p->dimension; - inMap2fEM(1, p->dimension, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); - } - if(bpm->bpatch_color != NULL){ - bezierPatch* p = bpm->bpatch_color; - ustride = p->dimension * p->vorder; - vstride = p->dimension; - inMap2fEM(2, p->dimension, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); - } - if(bpm->bpatch_texcoord != NULL){ - bezierPatch* p = bpm->bpatch_texcoord; - ustride = p->dimension * p->vorder; - vstride = p->dimension; - inMap2fEM(3, p->dimension, - p->umin, - p->umax, - ustride, - p->uorder, - p->vmin, - p->vmax, - vstride, - p->vorder, - p->ctlpoints); - } -#endif - - - k=0; - for(i=0; iindex_length_array; i++) - { -#ifdef USE_LOD - if(bpm->type_array[i] == GL_POLYGON) //a mesh - { - GLfloat *temp = bpm->UVarray+k; - GLfloat u0 = temp[0]; - GLfloat v0 = temp[1]; - GLfloat u1 = temp[2]; - GLfloat v1 = temp[3]; - GLint nu = (GLint) ( temp[4]); - GLint nv = (GLint) ( temp[5]); - GLint umin = (GLint) ( temp[6]); - GLint vmin = (GLint) ( temp[7]); - GLint umax = (GLint) ( temp[8]); - GLint vmax = (GLint) ( temp[9]); - - glMapGrid2f(LOD_eval_level*nu, u0, u1, LOD_eval_level*nv, v0, v1); - glEvalMesh2(GL_FILL, LOD_eval_level*umin, LOD_eval_level*umax, LOD_eval_level*vmin, LOD_eval_level*vmax); - } - else - { - LOD_eval(bpm->length_array[i], bpm->UVarray+k, bpm->type_array[i], - 0 - ); - } - k+= 2*bpm->length_array[i]; - -#else //undef USE_LOD - -#ifdef CRACK_TEST -if( bpm->bpatch->umin == 2 && bpm->bpatch->umax == 3 - && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3) -{ -REAL vertex[4]; -REAL normal[4]; -#ifdef DEBUG -printf("***number ****1\n"); -#endif - -beginCallBack(GL_QUAD_STRIP, NULL); -inDoEvalCoord2EM(3.0, 3.0); -inDoEvalCoord2EM(2.0, 3.0); -inDoEvalCoord2EM(3.0, 2.7); -inDoEvalCoord2EM(2.0, 2.7); -inDoEvalCoord2EM(3.0, 2.0); -inDoEvalCoord2EM(2.0, 2.0); -endCallBack(NULL); - -beginCallBack(GL_TRIANGLE_STRIP, NULL); -inDoEvalCoord2EM(2.0, 3.0); -inDoEvalCoord2EM(2.0, 2.0); -inDoEvalCoord2EM(2.0, 2.7); -endCallBack(NULL); - -} -if( bpm->bpatch->umin == 1 && bpm->bpatch->umax == 2 - && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3) -{ -#ifdef DEBUG -printf("***number 3\n"); -#endif -beginCallBack(GL_QUAD_STRIP, NULL); -inDoEvalCoord2EM(2.0, 3.0); -inDoEvalCoord2EM(1.0, 3.0); -inDoEvalCoord2EM(2.0, 2.3); -inDoEvalCoord2EM(1.0, 2.3); -inDoEvalCoord2EM(2.0, 2.0); -inDoEvalCoord2EM(1.0, 2.0); -endCallBack(NULL); - -beginCallBack(GL_TRIANGLE_STRIP, NULL); -inDoEvalCoord2EM(2.0, 2.3); -inDoEvalCoord2EM(2.0, 2.0); -inDoEvalCoord2EM(2.0, 3.0); -endCallBack(NULL); - -} -return; -#endif //CRACK_TEST - - beginCallBack(bpm->type_array[i], userData); - - for(j=0; jlength_array[i]; j++) - { - u = bpm->UVarray[k]; - v = bpm->UVarray[k+1]; -#ifdef USE_LOD - LOD_EVAL_COORD(u,v); -// glEvalCoord2f(u,v); -#else - -#ifdef GENERIC_TEST - float temp_normal[3]; - float temp_vertex[3]; - if(temp_signal == 0) - { - gTessVertexSphere(u,v, temp_normal, temp_vertex); -//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]); - normalCallBack(temp_normal, userData); - vertexCallBack(temp_vertex, userData); - } - else if(temp_signal == 1) - { - gTessVertexCyl(u,v, temp_normal, temp_vertex); -//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]); - normalCallBack(temp_normal, userData); - vertexCallBack(temp_vertex, userData); - } - else -#endif //GENERIC_TEST - - inDoEvalCoord2EM(u,v); - -#endif //USE_LOD - - k += 2; - } - endCallBack(userData); - -#endif //USE_LOD - } -} - -void OpenGLSurfaceEvaluator::inBPMListEvalEM(bezierPatchMesh* list) -{ - bezierPatchMesh* temp; - for(temp = list; temp != NULL; temp = temp->next) - { - inBPMEvalEM(temp); - } -} - diff --git a/src/libs/mesa/glu/libnurbs/interface/mystdio.h b/src/libs/mesa/glu/libnurbs/interface/mystdio.h deleted file mode 100644 index 5ab49effd1..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/mystdio.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mystdio.h - * - */ - -#ifndef __glumystdio_h_ -#define __glumystdio_h_ - -#ifdef STANDALONE -inline void _glu_dprintf( const char *, ... ) { } -#endif - -#ifdef LIBRARYBUILD -#ifndef NDEBUG -#include -#define _glu_dprintf printf -#else -inline void _glu_dprintf( const char *, ... ) { } -#endif -#endif - -#ifdef GLBUILD -inline void _glu_dprintf( const char *, ... ) { } -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#endif /* __glumystdio_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/interface/mystdlib.h b/src/libs/mesa/glu/libnurbs/interface/mystdlib.h deleted file mode 100644 index ab7a3b273a..0000000000 --- a/src/libs/mesa/glu/libnurbs/interface/mystdlib.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mystdlib.h - * - */ - -#ifndef __glumystdlib_h_ -#define __glumystdlib_h_ - -#ifdef STANDALONE -typedef unsigned int size_t; -extern "C" void abort( void ); -extern "C" void * malloc( size_t ); -extern "C" void free( void * ); -#endif - -#ifdef LIBRARYBUILD -#include -#endif - -#ifdef GLBUILD -typedef unsigned int size_t; -extern "C" void abort( void ); -extern "C" void * malloc( size_t ); -extern "C" void free( void * ); -#endif - -#endif /* __glumystdlib_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/arc.cc b/src/libs/mesa/glu/libnurbs/internals/arc.cc deleted file mode 100644 index b85139de93..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arc.cc +++ /dev/null @@ -1,347 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * arc.c++ - * - */ - -#include -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "arc.h" -#include "bin.h" -#include "bezierarc.h" -#include "pwlarc.h" -#include "simplemath.h" - -/* local preprocessor definitions */ -#define ZERO 0.00001/*0.000001*/ - -const int Arc::bezier_tag = (1<<13); -const int Arc::arc_tag = (1<<3); -const int Arc::tail_tag = (1<<6); - -/*-------------------------------------------------------------------------- - * makeSide - attach a pwl arc to an arc and mark it as a border arc - *-------------------------------------------------------------------------- - */ - -void -Arc::makeSide( PwlArc *pwl, arc_side side ) -{ - assert( pwl != 0); - assert( pwlArc == 0 ); - assert( pwl->npts > 0 ); - assert( pwl->pts != 0); - pwlArc = pwl; - clearbezier(); - setside( side ); -} - - -/*-------------------------------------------------------------------------- - * numpts - count number of points on arc loop - *-------------------------------------------------------------------------- - */ - -int -Arc::numpts( void ) -{ - Arc_ptr jarc = this; - int npts = 0; - do { - npts += jarc->pwlArc->npts; - jarc = jarc->next; - } while( jarc != this ); - return npts; -} - -/*-------------------------------------------------------------------------- - * markverts - mark each point with id of arc - *-------------------------------------------------------------------------- - */ - -void -Arc::markverts( void ) -{ - Arc_ptr jarc = this; - - do { - TrimVertex *p = jarc->pwlArc->pts; - for( int i=0; ipwlArc->npts; i++ ) - p[i].nuid = jarc->nuid; - jarc = jarc->next; - } while( jarc != this ); -} - -/*-------------------------------------------------------------------------- - * getextrema - find axis extrema on arc loop - *-------------------------------------------------------------------------- - */ - -void -Arc::getextrema( Arc_ptr extrema[4] ) -{ - REAL leftpt, botpt, rightpt, toppt; - - extrema[0] = extrema[1] = extrema[2] = extrema[3] = this; - - leftpt = rightpt = this->tail()[0]; - botpt = toppt = this->tail()[1]; - - for( Arc_ptr jarc = this->next; jarc != this; jarc = jarc->next ) { - if ( jarc->tail()[0] < leftpt || - (jarc->tail()[0] <= leftpt && jarc->rhead()[0]<=leftpt)) { - leftpt = jarc->pwlArc->pts->param[0]; - extrema[1] = jarc; - } - if ( jarc->tail()[0] > rightpt || - (jarc->tail()[0] >= rightpt && jarc->rhead()[0] >= rightpt)) { - rightpt = jarc->pwlArc->pts->param[0]; - extrema[3] = jarc; - } - if ( jarc->tail()[1] < botpt || - (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) { - botpt = jarc->pwlArc->pts->param[1]; - extrema[2] = jarc; - } - if ( jarc->tail()[1] > toppt || - (jarc->tail()[1] >= toppt && jarc->rhead()[1] >= toppt)) { - toppt = jarc->pwlArc->pts->param[1]; - extrema[0] = jarc; - } - } -} - - -/*------------------------------------------------------------------------- - * show - print to the stdout the vertices of a pwl arc - *------------------------------------------------------------------------- - */ - -void -Arc::show() -{ -#ifndef NDEBUG - _glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts ); - for( int i = 0; i < pwlArc->npts; i++ ) { - _glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0], - pwlArc->pts[i].param[1] ); - } -#endif -} - -/*------------------------------------------------------------------------- - * print - print out the vertices of all pwl arcs on a loop - *------------------------------------------------------------------------- - */ - -void -Arc::print( void ) -{ - Arc_ptr jarc = this; - -#ifndef NDEBUG - _glu_dprintf( "BGNTRIM\n" ); -#endif - do { - jarc->show( ); - jarc = jarc->next; - } while (jarc != this); -#ifndef NDEBUG - _glu_dprintf("ENDTRIM\n" ); -#endif -} - -/*------------------------------------------------------------------------- - * isDisconnected - check if tail of arc and head of prev meet - *------------------------------------------------------------------------- - */ - -int -Arc::isDisconnected( void ) -{ - if( pwlArc == 0 ) return 0; - if( prev->pwlArc == 0 ) return 0; - - REAL *p0 = tail(); - REAL *p1 = prev->rhead(); - - if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) || - ((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) { -#ifndef NDEBUG - _glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] ); - _glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] ); -#endif - return 1; - } else { - /* average two points together */ - p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5; - p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5; - return 0; - } -} - -/*------------------------------------------------------------------------- - * neq_vert - assert that two 2D vertices are not equal - *------------------------------------------------------------------------- - */ - -inline static int -neq_vert( REAL *v1, REAL *v2 ) -{ - return ((v1[0] != v2[0]) || (v1[1] != v2[1] )) ? 1 : 0; -} - -/*------------------------------------------------------------------------- - * check - verify consistency of a loop, including - * 1) if pwl, no two consecutive vertices are identical - * 2) the circular link pointers are valid - * 3) the geometric info at the head and tail are consistent - *------------------------------------------------------------------------- - */ - -int -Arc::check( void ) -{ - if( this == 0 ) return 1; - Arc_ptr jarc = this; - do { - assert( (jarc->pwlArc != 0) || (jarc->bezierArc != 0) ); - - if (jarc->prev == 0 || jarc->next == 0) { -#ifndef NDEBUG - _glu_dprintf( "checkjarc:null next/prev pointer\n"); - jarc->print( ); -#endif - return 0; - } - - if (jarc->next->prev != jarc) { -#ifndef NDEBUG - _glu_dprintf( "checkjarc: pointer linkage screwed up\n"); - jarc->print( ); -#endif - return 0; - } - - if( jarc->pwlArc ) { -#ifndef NDEBUG - assert( jarc->pwlArc->npts >= 1 ); - assert( jarc->pwlArc->npts < 100000 ); -/* - for( int i=0; i < jarc->pwlArc->npts-1; i++ ) - assert( neq_vert( jarc->pwlArc->pts[i].param, - jarc->pwlArc->pts[i+1].param) ); -*/ -#endif - if( jarc->prev->pwlArc ) { - if( jarc->tail()[1] != jarc->prev->rhead()[1] ) { -#ifndef NDEBUG - _glu_dprintf( "checkjarc: geometric linkage screwed up 1\n"); - jarc->prev->show(); - jarc->show(); -#endif - return 0; - } - if( jarc->tail()[0] != jarc->prev->rhead()[0] ) { - -#ifndef NDEBUG - _glu_dprintf( "checkjarc: geometric linkage screwed up 2\n"); - jarc->prev->show(); - jarc->show(); -#endif - return 0; - } - } - if( jarc->next->pwlArc ) { - if( jarc->next->tail()[0] != jarc->rhead()[0] ) { -#ifndef NDEBUG - _glu_dprintf( "checkjarc: geometric linkage screwed up 3\n"); - jarc->show(); - jarc->next->show(); -#endif - return 0; - } - if( jarc->next->tail()[1] != jarc->rhead()[1] ) { -#ifndef NDEBUG - _glu_dprintf( "checkjarc: geometric linkage screwed up 4\n"); - jarc->show(); - jarc->next->show(); -#endif - return 0; - } - } - if( jarc->isbezier() ) { - assert( jarc->pwlArc->npts == 2 ); - assert( (jarc->pwlArc->pts[0].param[0] == \ - jarc->pwlArc->pts[1].param[0]) ||\ - (jarc->pwlArc->pts[0].param[1] == \ - jarc->pwlArc->pts[1].param[1]) ); - } - } - jarc = jarc->next; - } while (jarc != this); - return 1; -} - - -#define TOL 0.00001 - -inline long tooclose( REAL x, REAL y ) -{ - return (glu_abs(x-y) < TOL) ? 1 : 0; -} - - -/*-------------------------------------------------------------------------- - * append - append a jordan arc to a circularly linked list - *-------------------------------------------------------------------------- - */ - -Arc_ptr -Arc::append( Arc_ptr jarc ) -{ - if( jarc != 0 ) { - next = jarc->next; - prev = jarc; - next->prev = prev->next = this; - } else { - next = prev = this; - } - return this; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/arc.h b/src/libs/mesa/glu/libnurbs/internals/arc.h deleted file mode 100644 index e986019c3a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arc.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * arc.h - * - */ - -#ifndef __gluarc_h_ -#define __gluarc_h_ - -#include "myassert.h" -#include "bufpool.h" -#include "mystdio.h" -#include "types.h" -#include "pwlarc.h" -#include "trimvertex.h" - -class Bin; -class Arc; -struct BezierArc; - -typedef class Arc *Arc_ptr; - -enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom }; - - -class Arc: public PooledObj { /* an arc, in two list, the trim list and bin */ - -public: - static const int bezier_tag; - static const int arc_tag; - static const int tail_tag; - Arc_ptr prev; /* trim list pointer */ - Arc_ptr next; /* trim list pointer */ - Arc_ptr link; /* bin pointers */ - BezierArc * bezierArc; /* associated bezier arc */ - PwlArc * pwlArc; /* associated pwl arc */ - long type; /* curve type */ - long nuid; - - inline Arc( Arc *, PwlArc * ); - inline Arc( arc_side, long ); - - Arc_ptr append( Arc_ptr ); - int check( void ); - int isMonotone( void ); - int isDisconnected( void ); - int numpts( void ); - void markverts( void ); - void getextrema( Arc_ptr[4] ); - void print( void ); - void show( void ); - void makeSide( PwlArc *, arc_side ); - inline int isTessellated() { return pwlArc ? 1 : 0; } - inline long isbezier() { return type & bezier_tag; } - inline void setbezier() { type |= bezier_tag; } - inline void clearbezier() { type &= ~bezier_tag; } - inline long npts() { return pwlArc->npts; } - inline TrimVertex * pts() { return pwlArc->pts; } - inline REAL * tail() { return pwlArc->pts[0].param; } - inline REAL * head() { return next->pwlArc->pts[0].param; } - inline REAL * rhead() { return pwlArc->pts[pwlArc->npts-1].param; } - inline long ismarked() { return type & arc_tag; } - inline void setmark() { type |= arc_tag; } - inline void clearmark() { type &= (~arc_tag); } - inline void clearside() { type &= ~(0x7 << 8); } - inline void setside( arc_side s ) { clearside(); type |= (((long)s)<<8); } - inline arc_side getside() { return (arc_side) ((type>>8) & 0x7); } - inline int getitail() { return type & tail_tag; } - inline void setitail() { type |= tail_tag; } - inline void clearitail() { type &= (~tail_tag); } -}; - -/*-------------------------------------------------------------------------- - * Arc - initialize a new Arc with the same type and uid of - * a given Arc and a given pwl arc - *-------------------------------------------------------------------------- - */ - -inline -Arc::Arc( Arc *j, PwlArc *p ) -{ - bezierArc = NULL; - pwlArc = p; - type = j->type; - nuid = j->nuid; -} - -/*-------------------------------------------------------------------------- - * Arc - initialize a new Arc with the same type and uid of - * a given Arc and a given pwl arc - *-------------------------------------------------------------------------- - */ - -inline -Arc::Arc( arc_side side, long _nuid ) -{ - bezierArc = NULL; - pwlArc = NULL; - type = 0; - setside( side ); - nuid = _nuid; -} - -#endif /* __gluarc_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/arcsorter.cc b/src/libs/mesa/glu/libnurbs/internals/arcsorter.cc deleted file mode 100644 index 1f85cb7108..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arcsorter.cc +++ /dev/null @@ -1,172 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * arcsorter.c++ - * - */ - -#ifndef __gluarcsorter_c_ -#define __gluarcsorter_c_ - -#include "glimports.h" -#include "arc.h" -#include "arcsorter.h" -#include "subdivider.h" - -ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s) -{ -} - -int -ArcSorter::qscmp( char *, char * ) -{ - _glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" ); - return 0; -} - -void -ArcSorter::qsort( Arc **a, int n ) -{ - Sorter::qsort( (void *) a, n ); -} - -void -ArcSorter::qsexc( char *i, char *j )// i<-j, j<-i -{ - Arc **jarc1 = (Arc **) i; - Arc **jarc2 = (Arc **) j; - Arc *tmp = *jarc1; - *jarc1 = *jarc2; - *jarc2 = tmp; -} - -void -ArcSorter::qstexc( char *i, char *j, char *k )// i<-k, k<-j, j<-i -{ - Arc **jarc1 = (Arc **) i; - Arc **jarc2 = (Arc **) j; - Arc **jarc3 = (Arc **) k; - Arc *tmp = *jarc1; - *jarc1 = *jarc3; - *jarc3 = *jarc2; - *jarc2 = tmp; -} - - -ArcSdirSorter::ArcSdirSorter( Subdivider &s ) : ArcSorter(s) -{ -} - -int -ArcSdirSorter::qscmp( char *i, char *j ) -{ - Arc *jarc1 = *(Arc **) i; - Arc *jarc2 = *(Arc **) j; - - int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1)); - int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1)); - - REAL diff = jarc1->pwlArc->pts[v1].param[1] - - jarc2->pwlArc->pts[v2].param[1]; - - if( diff < 0.0) - return -1; - else if( diff > 0.0) - return 1; - else { - if( v1 == 0 ) { - if( jarc2->tail()[0] < jarc1->tail()[0] ) { - return subdivider.ccwTurn_sl( jarc2, jarc1 ) ? 1 : -1; - } else { - return subdivider.ccwTurn_sr( jarc2, jarc1 ) ? -1 : 1; - } - } else { - if( jarc2->head()[0] < jarc1->head()[0] ) { - return subdivider.ccwTurn_sl( jarc1, jarc2 ) ? -1 : 1; - } else { - return subdivider.ccwTurn_sr( jarc1, jarc2 ) ? 1 : -1; - } - } - } -} - -ArcTdirSorter::ArcTdirSorter( Subdivider &s ) : ArcSorter(s) -{ -} - -/*---------------------------------------------------------------------------- - * ArcTdirSorter::qscmp - - * compare two axis monotone arcs that are incident - * to the line T == compare_value. Determine which of the - * two intersects that line with a LESSER S value. If - * jarc1 does, return 1. If jarc2 does, return -1. - *---------------------------------------------------------------------------- - */ -int -ArcTdirSorter::qscmp( char *i, char *j ) -{ - Arc *jarc1 = *(Arc **) i; - Arc *jarc2 = *(Arc **) j; - - int v1 = (jarc1->getitail() ? 0 : (jarc1->pwlArc->npts - 1)); - int v2 = (jarc2->getitail() ? 0 : (jarc2->pwlArc->npts - 1)); - - REAL diff = jarc1->pwlArc->pts[v1].param[0] - - jarc2->pwlArc->pts[v2].param[0]; - - if( diff < 0.0) - return 1; - else if( diff > 0.0) - return -1; - else { - if( v1 == 0 ) { - if (jarc2->tail()[1] < jarc1->tail()[1]) { - return subdivider.ccwTurn_tl( jarc2, jarc1 ) ? 1 : -1; - } else { - return subdivider.ccwTurn_tr( jarc2, jarc1 ) ? -1 : 1; - } - } else { - if( jarc2->head()[1] < jarc1->head()[1] ) { - return subdivider.ccwTurn_tl( jarc1, jarc2 ) ? -1 : 1; - } else { - return subdivider.ccwTurn_tr( jarc1, jarc2 ) ? 1 : -1; - } - } - } -} - - - -#endif /* __gluarcsorter_c_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/arcsorter.h b/src/libs/mesa/glu/libnurbs/internals/arcsorter.h deleted file mode 100644 index d72dd1e86c..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arcsorter.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * arcsorter.h - * - */ - -#ifndef __gluarcsorter_h_ -#define __gluarcsorter_h_ - -#include "sorter.h" -#include "arcsorter.h" - -class Arc; -class Subdivider; - -class ArcSorter : private Sorter { -public: - ArcSorter(Subdivider &); - void qsort( Arc **a, int n ); -protected: - virtual int qscmp( char *, char * ); - Subdivider& subdivider; -private: - void qsexc( char *i, char *j ); // i<-j, j<-i - void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i -}; - - -class ArcSdirSorter : public ArcSorter { -public: - ArcSdirSorter( Subdivider & ); -private: - int qscmp( char *, char * ); -}; - - -class ArcTdirSorter : public ArcSorter { -public: - ArcTdirSorter( Subdivider & ); -private: - int qscmp( char *, char * ); -}; - -#endif /* __gluarcsorter_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/arctess.cc b/src/libs/mesa/glu/libnurbs/internals/arctess.cc deleted file mode 100644 index 29e7cf4c00..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arctess.cc +++ /dev/null @@ -1,611 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * arctessellator.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "arctess.h" -#include "bufpool.h" -#include "simplemath.h" -#include "bezierarc.h" -#include "trimvertex.h" -#include "trimvertpool.h" - -#define NOELIMINATION - -#define steps_function(large, small, rate) (max(1, 1+ (int) ((large-small)/rate))); - -/*----------------------------------------------------------------------------- - * ArcTessellator - construct an ArcTessellator - *----------------------------------------------------------------------------- - */ - -ArcTessellator::ArcTessellator( TrimVertexPool& t, Pool& p ) - : pwlarcpool(p), trimvertexpool(t) -{ -} - -/*----------------------------------------------------------------------------- - * ~ArcTessellator - destroy an ArcTessellator - *----------------------------------------------------------------------------- - */ - -ArcTessellator::~ArcTessellator( void ) -{ -} - -/*----------------------------------------------------------------------------- - * bezier - construct a bezier arc and attach it to an Arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::bezier( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2 ) -{ - assert( arc != 0 ); - assert( ! arc->isTessellated() ); - -#ifndef NDEBUG - switch( arc->getside() ) { - case arc_left: - assert( s1 == s2 ); - assert( t2 < t1 ); - break; - case arc_right: - assert( s1 == s2 ); - assert( t1 < t2 ); - break; - case arc_top: - assert( t1 == t2 ); - assert( s2 < s1 ); - break; - case arc_bottom: - assert( t1 == t2 ); - assert( s1 < s2 ); - break; - case arc_none: - (void) abort(); - break; - } -#endif - - TrimVertex *p = trimvertexpool.get(2); - arc->pwlArc = new(pwlarcpool) PwlArc( 2, p ); - p[0].param[0] = s1; - p[0].param[1] = t1; - p[1].param[0] = s2; - p[1].param[1] = t2; - assert( (s1 == s2) || (t1 == t2) ); - arc->setbezier(); -} - - -/*----------------------------------------------------------------------------- - * pwl_left - construct a left boundary pwl arc and attach it to an arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::pwl_left( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate ) -{ - assert( t2 < t1 ); - -/* if(rate <= 0.06) rate = 0.06;*/ -/* int nsteps = 1 + (int) ((t1 - t2) / rate ); */ - int nsteps = steps_function(t1, t2, rate); - - - REAL stepsize = (t1 - t2) / (REAL) nsteps; - - TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); - int i; - for( i = nsteps; i > 0; i-- ) { - newvert[i].param[0] = s; - newvert[i].param[1] = t2; - t2 += stepsize; - } - newvert[i].param[0] = s; - newvert[i].param[1] = t1; - - arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_left ); -} - -/*----------------------------------------------------------------------------- - * pwl_right - construct a right boundary pwl arc and attach it to an arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::pwl_right( Arc *arc, REAL s, REAL t1, REAL t2, REAL rate ) -{ - assert( t1 < t2 ); - -/* if(rate <= 0.06) rate = 0.06;*/ - -/* int nsteps = 1 + (int) ((t2 - t1) / rate ); */ - int nsteps = steps_function(t2,t1,rate); - REAL stepsize = (t2 - t1) / (REAL) nsteps; - - TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); - int i; - for( i = 0; i < nsteps; i++ ) { - newvert[i].param[0] = s; - newvert[i].param[1] = t1; - t1 += stepsize; - } - newvert[i].param[0] = s; - newvert[i].param[1] = t2; - - arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_right ); -} - - -/*----------------------------------------------------------------------------- - * pwl_top - construct a top boundary pwl arc and attach it to an arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::pwl_top( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate ) -{ - assert( s2 < s1 ); - -/* if(rate <= 0.06) rate = 0.06;*/ - -/* int nsteps = 1 + (int) ((s1 - s2) / rate ); */ - int nsteps = steps_function(s1,s2,rate); - REAL stepsize = (s1 - s2) / (REAL) nsteps; - - TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); - int i; - for( i = nsteps; i > 0; i-- ) { - newvert[i].param[0] = s2; - newvert[i].param[1] = t; - s2 += stepsize; - } - newvert[i].param[0] = s1; - newvert[i].param[1] = t; - - arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_top ); -} - -/*----------------------------------------------------------------------------- - * pwl_bottom - construct a bottom boundary pwl arc and attach it to an arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::pwl_bottom( Arc *arc, REAL t, REAL s1, REAL s2, REAL rate ) -{ - assert( s1 < s2 ); - -/* if(rate <= 0.06) rate = 0.06;*/ - -/* int nsteps = 1 + (int) ((s2 - s1) / rate ); */ - int nsteps = steps_function(s2,s1,rate); - REAL stepsize = (s2 - s1) / (REAL) nsteps; - - TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); - int i; - for( i = 0; i < nsteps; i++ ) { - newvert[i].param[0] = s1; - newvert[i].param[1] = t; - s1 += stepsize; - } - newvert[i].param[0] = s2; - newvert[i].param[1] = t; - - arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom ); -} - -/*----------------------------------------------------------------------------- - * pwl - construct a pwl arc and attach it to an arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::pwl( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2, REAL rate ) -{ - -/* if(rate <= 0.06) rate = 0.06;*/ - - int snsteps = 1 + (int) (glu_abs(s2 - s1) / rate ); - int tnsteps = 1 + (int) (glu_abs(t2 - t1) / rate ); - int nsteps = max(1,max( snsteps, tnsteps )); - - REAL sstepsize = (s2 - s1) / (REAL) nsteps; - REAL tstepsize = (t2 - t1) / (REAL) nsteps; - TrimVertex *newvert = trimvertexpool.get( nsteps+1 ); - long i; - for( i = 0; i < nsteps; i++ ) { - newvert[i].param[0] = s1; - newvert[i].param[1] = t1; - s1 += sstepsize; - t1 += tstepsize; - } - newvert[i].param[0] = s2; - newvert[i].param[1] = t2; - - /* arc->makeSide( new(pwlarcpool) PwlArc( nsteps+1, newvert ), arc_bottom ); */ - arc->pwlArc = new(pwlarcpool) PwlArc( nsteps+1, newvert ); - - arc->clearbezier(); - arc->clearside( ); -} - - -/*----------------------------------------------------------------------------- - * tessellateLinear - constuct a linear pwl arc and attach it to an Arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::tessellateLinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational ) -{ - assert( arc->pwlArc == NULL ); - REAL s1, s2, t1, t2; - - //we don't need to scale by arc_stepsize if the trim curve - //is piecewise linear. Reason: In pwl_right, pwl_left, pwl_top, pwl_left, - //and pwl, the nsteps is computed by deltaU (or V) /stepsize. - //The quantity deltaU/arc_stepsize doesn't have any meaning. And - //it causes problems: see bug 517641 - REAL stepsize = geo_stepsize; /* * arc_stepsize*/; - - BezierArc *b = arc->bezierArc; - - if( isrational ) { - s1 = b->cpts[0] / b->cpts[2]; - t1 = b->cpts[1] / b->cpts[2]; - s2 = b->cpts[b->stride+0] / b->cpts[b->stride+2]; - t2 = b->cpts[b->stride+1] / b->cpts[b->stride+2]; - } else { - s1 = b->cpts[0]; - t1 = b->cpts[1]; - s2 = b->cpts[b->stride+0]; - t2 = b->cpts[b->stride+1]; - } - if( s1 == s2 ) - if( t1 < t2 ) - pwl_right( arc, s1, t1, t2, stepsize ); - else - pwl_left( arc, s1, t1, t2, stepsize ); - else if( t1 == t2 ) - if( s1 < s2 ) - pwl_bottom( arc, t1, s1, s2, stepsize ); - else - pwl_top( arc, t1, s1, s2, stepsize ); - else - pwl( arc, s1, s2, t1, t2, stepsize ); -} - -/*----------------------------------------------------------------------------- - * tessellateNonlinear - constuct a nonlinear pwl arc and attach it to an Arc - *----------------------------------------------------------------------------- - */ - -void -ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize, int isrational ) -{ - assert( arc->pwlArc == NULL ); - - REAL stepsize = geo_stepsize * arc_stepsize; - - BezierArc *bezierArc = arc->bezierArc; - - REAL size; //bounding box size of the curve in UV - { - int i,j; - REAL min_u, min_v, max_u,max_v; - min_u = max_u = bezierArc->cpts[0]; - min_v = max_v = bezierArc->cpts[1]; - for(i=1, j=bezierArc->stride; iorder; i++, j+= bezierArc->stride) - { - if(bezierArc->cpts[j] < min_u) - min_u = bezierArc->cpts[j]; - if(bezierArc->cpts[j] > max_u) - max_u = bezierArc->cpts[j]; - if(bezierArc->cpts[j+1] < min_v) - min_v = bezierArc->cpts[j+1]; - if(bezierArc->cpts[j+1] > max_v) - max_v = bezierArc->cpts[j+1]; - } - - size = max_u - min_u; - if(size < max_v - min_v) - size = max_v - min_v; - } - - /*int nsteps = 1 + (int) (1.0/stepsize);*/ - - int nsteps = (int) (size/stepsize); - if(nsteps <=0) - nsteps=1; - - TrimVertex *vert = trimvertexpool.get( nsteps+1 ); - REAL dp = 1.0/nsteps; - - - arc->pwlArc = new(pwlarcpool) PwlArc(); - arc->pwlArc->pts = vert; - - if( isrational ) { - REAL pow_u[MAXORDER], pow_v[MAXORDER], pow_w[MAXORDER]; - trim_power_coeffs( bezierArc, pow_u, 0 ); - trim_power_coeffs( bezierArc, pow_v, 1 ); - trim_power_coeffs( bezierArc, pow_w, 2 ); - - /* compute first point exactly */ - REAL *b = bezierArc->cpts; - vert->param[0] = b[0]/b[2]; - vert->param[1] = b[1]/b[2]; - - /* strength reduction on p = dp * step would introduce error */ - int step; -#ifndef NOELIMINATION - int ocanremove = 0; -#endif - register long order = bezierArc->order; - for( step=1, ++vert; stepparam[0] = u/w; - vert->param[1] = v/w; -#ifndef NOELIMINATION - REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]); - REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]); - int canremove = (dsstride; - vert->param[0] = b[0]/b[2]; - vert->param[1] = b[1]/b[2]; - - } else { - REAL pow_u[MAXORDER], pow_v[MAXORDER]; - trim_power_coeffs( bezierArc, pow_u, 0 ); - trim_power_coeffs( bezierArc, pow_v, 1 ); - - /* compute first point exactly */ - REAL *b = bezierArc->cpts; - vert->param[0] = b[0]; - vert->param[1] = b[1]; - - /* strength reduction on p = dp * step would introduce error */ - int step; -#ifndef NOELIMINATION - int ocanremove = 0; -#endif - register long order = bezierArc->order; - for( step=1, ++vert; steporder; i++ ) { - u = u * p + pow_u[i]; - v = v * p + pow_v[i]; - } - vert->param[0] = u; - vert->param[1] = v; -#ifndef NOELIMINATION - REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]); - REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]); - int canremove = (dsstride; - vert->param[0] = b[0]; - vert->param[1] = b[1]; - } - arc->pwlArc->npts = vert - arc->pwlArc->pts + 1; -/* - for( TrimVertex *vt=pwlArc->pts; vt != vert-1; vt++ ) { - if( tooclose( vt[0].param[0], vt[1].param[0] ) ) - vt[1].param[0] = vt[0].param[0]; - if( tooclose( vt[0].param[1], vt[1].param[1] ) ) - vt[1].param[1] = vt[0].param[1]; - } -*/ -} - -const REAL ArcTessellator::gl_Bernstein[][MAXORDER][MAXORDER] = { - { - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {-1, 1, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {1, -2, 1, 0, 0, 0, 0, 0 }, - {-2, 2, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {-1, 3, -3, 1, 0, 0, 0, 0 }, - {3, -6, 3, 0, 0, 0, 0, 0 }, - {-3, 3, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {1, -4, 6, -4, 1, 0, 0, 0 }, - {-4, 12, -12, 4, 0, 0, 0, 0 }, - {6, -12, 6, 0, 0, 0, 0, 0 }, - {-4, 4, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {-1, 5, -10, 10, -5, 1, 0, 0 }, - {5, -20, 30, -20, 5, 0, 0, 0 }, - {-10, 30, -30, 10, 0, 0, 0, 0 }, - {10, -20, 10, 0, 0, 0, 0, 0 }, - {-5, 5, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {1, -6, 15, -20, 15, -6, 1, 0 }, - {-6, 30, -60, 60, -30, 6, 0, 0 }, - {15, -60, 90, -60, 15, 0, 0, 0 }, - {-20, 60, -60, 20, 0, 0, 0, 0 }, - {15, -30, 15, 0, 0, 0, 0, 0 }, - {-6, 6, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 }, - {0, 0, 0, 0, 0, 0, 0, 0 } - }, - { - {-1, 7, -21, 35, -35, 21, -7, 1 }, - {7, -42, 105, -140, 105, -42, 7, 0 }, - {-21, 105, -210, 210, -105, 21, 0, 0 }, - {35, -140, 210, -140, 35, 0, 0, 0 }, - {-35, 105, -105, 35, 0, 0, 0, 0 }, - {21, -42, 21, 0, 0, 0, 0, 0 }, - {-7, 7, 0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0, 0, 0 } - }}; - - -/*----------------------------------------------------------------------------- - * trim_power_coeffs - compute power basis coefficients from bezier coeffients - *----------------------------------------------------------------------------- - */ -void -ArcTessellator::trim_power_coeffs( BezierArc *bez_arc, REAL *p, int coord ) -{ - register int stride = bez_arc->stride; - register int order = bez_arc->order; - register REAL *base = bez_arc->cpts + coord; - - REAL const (*mat)[MAXORDER][MAXORDER] = &gl_Bernstein[order-1]; - REAL const (*lrow)[MAXORDER] = &(*mat)[order]; - - /* WIN32 didn't like the following line within the for-loop */ - REAL const (*row)[MAXORDER] = &(*mat)[0]; - for( ; row != lrow; row++ ) { - register REAL s = 0.0; - register REAL *point = base; - register REAL const *mlast = *row + order; - for( REAL const *m = *row; m != mlast; m++, point += stride ) - s += *(m) * (*point); - *(p++) = s; - } -} diff --git a/src/libs/mesa/glu/libnurbs/internals/arctess.h b/src/libs/mesa/glu/libnurbs/internals/arctess.h deleted file mode 100644 index 7802af90c0..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/arctess.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * arctess.h - * - */ - -#ifndef __gluarctess_h_ -#define __gluarctess_h_ - -#include "defines.h" -#include "types.h" -#include "arc.h" - -struct BezierArc; -class Pool; -class TrimVertexPool; - -class ArcTessellator { -public: - ArcTessellator( TrimVertexPool&, Pool& ); - ~ArcTessellator( void ); - void bezier( Arc_ptr, REAL, REAL, REAL, REAL ); - void pwl( Arc_ptr, REAL, REAL, REAL, REAL, REAL ); - void pwl_left( Arc_ptr, REAL, REAL, REAL, REAL ); - void pwl_right( Arc_ptr, REAL, REAL, REAL, REAL ); - void pwl_top( Arc_ptr, REAL, REAL, REAL, REAL ); - void pwl_bottom( Arc_ptr, REAL, REAL, REAL, REAL ); - void tessellateLinear( Arc_ptr, REAL, REAL, int ); - void tessellateNonlinear( Arc_ptr, REAL, REAL, int ); -private: - static const REAL gl_Bernstein[][MAXORDER][MAXORDER]; - Pool& pwlarcpool; - TrimVertexPool& trimvertexpool; - static void trim_power_coeffs( BezierArc *, REAL[MAXORDER], int ); -}; - -#endif /* __gluarctess_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/backend.cc b/src/libs/mesa/glu/libnurbs/internals/backend.cc deleted file mode 100644 index 88dc3f5168..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/backend.cc +++ /dev/null @@ -1,589 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * backend.c++ - * - */ - -/* Bezier surface backend - - interprets display mode (wireframe,shaded,...) -*/ -#include -#include "glimports.h" -#include "mystdio.h" -#include "backend.h" -#include "basiccrveval.h" -#include "basicsurfeval.h" -#include "nurbsconsts.h" - -#define NOWIREFRAME - - -/*------------------------------------------------------------------------- - * bgnsurf - preamble to surface definition and evaluations - *------------------------------------------------------------------------- - */ -void -Backend::bgnsurf( int wiretris, int wirequads, long nuid ) -{ -/*#ifndef NOWIREFRAME*/ //need this for old version - wireframetris = wiretris; - wireframequads = wirequads; -/*#endif*/ - - /*in the spec, GLU_DISPLAY_MODE is either - * GLU_FILL - * GLU_OUTLINE_POLY - * GLU_OUTLINE_PATCH. - *In fact, GLU_FLL is has the same effect as - * set GL_FRONT_AND_BACK to be GL_FILL - * and GLU_OUTLINE_POLY is the same as set - * GL_FRONT_AND_BACK to be GL_LINE - *It is more efficient to do this once at the beginning of - *each surface than to do it for each primitive. - * The internal has more options: outline_triangle and outline_quad - *can be seperated. But since this is not in spec, and more importantly, - *this is not so useful, so we don't need to keep this option. - */ - - surfaceEvaluator.bgnmap2f( nuid ); - - if(wiretris) - surfaceEvaluator.polymode(N_MESHLINE); - else - surfaceEvaluator.polymode(N_MESHFILL); -} - -void -Backend::patch( REAL ulo, REAL uhi, REAL vlo, REAL vhi ) -{ - surfaceEvaluator.domain2f( ulo, uhi, vlo, vhi ); -} - -void -Backend::surfbbox( long type, REAL *from, REAL *to ) -{ - surfaceEvaluator.range2f( type, from, to ); -} - -/*------------------------------------------------------------------------- - * surfpts - pass a desription of a surface map - *------------------------------------------------------------------------- - */ -void -Backend::surfpts( - long type, /* geometry, color, texture, normal */ - REAL *pts, /* control points */ - long ustride, /* distance to next point in u direction */ - long vstride, /* distance to next point in v direction */ - int uorder, /* u parametric order */ - int vorder, /* v parametric order */ - REAL ulo, /* u lower bound */ - REAL uhi, /* u upper bound */ - REAL vlo, /* v lower bound */ - REAL vhi ) /* v upper bound */ -{ - surfaceEvaluator.map2f( type,ulo,uhi,ustride,uorder,vlo,vhi,vstride,vorder,pts ); - surfaceEvaluator.enable( type ); -} - -/*------------------------------------------------------------------------- - * surfgrid - define a lattice of points with origin and offset - *------------------------------------------------------------------------- - */ -void -Backend::surfgrid( REAL u0, REAL u1, long nu, REAL v0, REAL v1, long nv ) -{ - surfaceEvaluator.mapgrid2f( nu, u0, u1, nv, v0, v1 ); -} - -/*------------------------------------------------------------------------- - * surfmesh - evaluate a mesh of points on lattice - *------------------------------------------------------------------------- - */ -void -Backend::surfmesh( long u, long v, long n, long m ) -{ -#ifndef NOWIREFRAME - if( wireframequads ) { - long v0, v1; - long u0f = u, u1f = u+n; - long v0f = v, v1f = v+m; - long parity = (u & 1); - - for( v0 = v0f, v1 = v0f++ ; v0isGridVert() ) { - tmeshvert( v->g ); - } else { - tmeshvert( v->t ); - } -} - -void -Backend::tmeshvertNOGE(TrimVertex *t) -{ -// surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], temp, ttt); -#ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal); -#endif -} - -//opt for a line with the same u. -void -Backend::tmeshvertNOGE_BU(TrimVertex *t) -{ -#ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal); -#endif -} - -//opt for a line with the same v. -void -Backend::tmeshvertNOGE_BV(TrimVertex *t) -{ -#ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal); -#endif -} - -void -Backend::preEvaluateBU(REAL u) -{ - surfaceEvaluator.inPreEvaluateBU_intfac(u); -} - -void -Backend::preEvaluateBV(REAL v) -{ - surfaceEvaluator.inPreEvaluateBV_intfac(v); -} - - -/*------------------------------------------------------------------------- - * tmeshvert - evaluate a point on a triangle mesh - *------------------------------------------------------------------------- - */ -void -Backend::tmeshvert( TrimVertex *t ) -{ - -#ifndef NOWIREFRAME - const long nuid = t->nuid; -#endif - const REAL u = t->param[0]; - const REAL v = t->param[1]; - -#ifndef NOWIREFRAME - npts++; - if( wireframetris ) { - if( npts >= 3 ) { - surfaceEvaluator.bgnclosedline(); - if( mesh[0][2] == 0 ) - surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); - if( mesh[1][2] == 0 ) - surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); - surfaceEvaluator.evalcoord2f( nuid, u, v ); - surfaceEvaluator.endclosedline(); - } - mesh[meshindex][0] = u; - mesh[meshindex][1] = v; - mesh[meshindex][2] = 0; - mesh[meshindex][3] = nuid; - meshindex = (meshindex+1) % 2; - } else { - surfaceEvaluator.evalcoord2f( nuid, u, v ); - } -#else - - surfaceEvaluator.evalcoord2f( 0, u, v ); -//for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v ); -#endif -} - -//the same as tmeshvert(trimvertex), for efficiency purpose -void -Backend::tmeshvert( REAL u, REAL v ) -{ -#ifndef NOWIREFRAME - const long nuid = 0; - - npts++; - if( wireframetris ) { - if( npts >= 3 ) { - surfaceEvaluator.bgnclosedline(); - if( mesh[0][2] == 0 ) - surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); - if( mesh[1][2] == 0 ) - surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); - surfaceEvaluator.evalcoord2f( nuid, u, v ); - surfaceEvaluator.endclosedline(); - } - mesh[meshindex][0] = u; - mesh[meshindex][1] = v; - mesh[meshindex][2] = 0; - mesh[meshindex][3] = nuid; - meshindex = (meshindex+1) % 2; - } else { - surfaceEvaluator.evalcoord2f( nuid, u, v ); - } -#else - - surfaceEvaluator.evalcoord2f( 0, u, v ); -#endif -} - -/*------------------------------------------------------------------------- - * tmeshvert - evaluate a grid point of a triangle mesh - *------------------------------------------------------------------------- - */ -void -Backend::tmeshvert( GridVertex *g ) -{ - const long u = g->gparam[0]; - const long v = g->gparam[1]; - -#ifndef NOWIREFRAME - npts++; - if( wireframetris ) { - if( npts >= 3 ) { - surfaceEvaluator.bgnclosedline(); - if( mesh[0][2] == 0 ) - surfaceEvaluator.evalcoord2f( (long) mesh[0][3], mesh[0][0], mesh[0][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] ); - if( mesh[1][2] == 0 ) - surfaceEvaluator.evalcoord2f( (long) mesh[1][3], mesh[1][0], mesh[1][1] ); - else - surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] ); - surfaceEvaluator.evalpoint2i( u, v ); - surfaceEvaluator.endclosedline(); - } - mesh[meshindex][0] = u; - mesh[meshindex][1] = v; - mesh[meshindex][2] = 1; - meshindex = (meshindex+1) % 2; - } else { - surfaceEvaluator.evalpoint2i( u, v ); - } -#else - surfaceEvaluator.evalpoint2i( u, v ); -#endif -} - -/*------------------------------------------------------------------------- - * swaptmesh - perform a swap of the triangle mesh pointers - *------------------------------------------------------------------------- - */ -void -Backend::swaptmesh( void ) -{ -#ifndef NOWIREFRAME - if( wireframetris ) { - meshindex = 1 - meshindex; - } else { - surfaceEvaluator.swaptmesh(); - } -#else - surfaceEvaluator.swaptmesh(); -#endif -} - -/*------------------------------------------------------------------------- - * endtmesh - postamble to triangle mesh - *------------------------------------------------------------------------- - */ -void -Backend::endtmesh( void ) -{ -#ifndef NOWIREFRAME - if( ! wireframetris ) - surfaceEvaluator.endtmesh(); -#else - surfaceEvaluator.endtmesh(); -/* surfaceEvaluator.polymode( N_MESHFILL );*/ -#endif -} - - -/*------------------------------------------------------------------------- - * bgnoutline - preamble to outlined rendering - *------------------------------------------------------------------------- - */ -void -Backend::bgnoutline( void ) -{ - surfaceEvaluator.bgnline(); -} - -/*------------------------------------------------------------------------- - * linevert - evaluate a point on an outlined contour - *------------------------------------------------------------------------- - */ -void -Backend::linevert( TrimVertex *t ) -{ - surfaceEvaluator.evalcoord2f( t->nuid, t->param[0], t->param[1] ); -} - -/*------------------------------------------------------------------------- - * linevert - evaluate a grid point of an outlined contour - *------------------------------------------------------------------------- - */ -void -Backend::linevert( GridVertex *g ) -{ - surfaceEvaluator.evalpoint2i( g->gparam[0], g->gparam[1] ); -} - -/*------------------------------------------------------------------------- - * endoutline - postamble to outlined rendering - *------------------------------------------------------------------------- - */ -void -Backend::endoutline( void ) -{ - surfaceEvaluator.endline(); -} - -/*------------------------------------------------------------------------- - * triangle - output a triangle - *------------------------------------------------------------------------- - */ -void -Backend::triangle( TrimVertex *a, TrimVertex *b, TrimVertex *c ) -{ -/* bgntmesh( "spittriangle" );*/ - bgntfan(); - tmeshvert( a ); - tmeshvert( b ); - tmeshvert( c ); - endtfan(); -/* endtmesh();*/ -} - -void -Backend::bgncurv( void ) -{ - curveEvaluator.bgnmap1f( 0 ); -} - -void -Backend::segment( REAL ulo, REAL uhi ) -{ - curveEvaluator.domain1f( ulo, uhi ); -} - -void -Backend::curvpts( - long type, /* geometry, color, texture, normal */ - REAL *pts, /* control points */ - long stride, /* distance to next point */ - int order, /* parametric order */ - REAL ulo, /* lower parametric bound */ - REAL uhi ) /* upper parametric bound */ - -{ - curveEvaluator.map1f( type, ulo, uhi, stride, order, pts ); - curveEvaluator.enable( type ); -} - -void -Backend::curvgrid( REAL u0, REAL u1, long nu ) -{ - curveEvaluator.mapgrid1f( nu, u0, u1 ); -} - -void -Backend::curvmesh( long from, long n ) -{ - curveEvaluator.mapmesh1f( N_MESHFILL, from, from+n ); -} - -void -Backend::curvpt(REAL u) -{ - curveEvaluator.evalcoord1f( 0, u ); -} - -void -Backend::bgnline( void ) -{ - curveEvaluator.bgnline(); -} - -void -Backend::endline( void ) -{ - curveEvaluator.endline(); -} - -void -Backend::endcurv( void ) -{ - curveEvaluator.endmap1f(); -} diff --git a/src/libs/mesa/glu/libnurbs/internals/backend.h b/src/libs/mesa/glu/libnurbs/internals/backend.h deleted file mode 100644 index 6840cb19e9..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/backend.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * backend.h - * - */ - -#ifndef __glubackend_h_ -#define __glubackend_h_ - -#include "trimvertex.h" -#include "gridvertex.h" -#include "gridtrimvertex.h" - -class BasicCurveEvaluator; -class BasicSurfaceEvaluator; - -class Backend { -private: - BasicCurveEvaluator& curveEvaluator; - BasicSurfaceEvaluator& surfaceEvaluator; -public: - Backend( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e ) - : curveEvaluator(c), surfaceEvaluator(e) {} - - /* surface backend routines */ - void bgnsurf( int, int, long ); - void patch( REAL, REAL, REAL, REAL ); - void surfpts( long, REAL *, long, long, int, int, - REAL, REAL, REAL, REAL ); - void surfbbox( long, REAL *, REAL * ); - void surfgrid( REAL, REAL, long, REAL, REAL, long ); - void surfmesh( long, long, long, long ); - void bgntmesh( const char * ); - void endtmesh( void ); - void swaptmesh( void ); - void tmeshvert( GridTrimVertex * ); - void tmeshvert( TrimVertex * ); - void tmeshvert( GridVertex * ); - void tmeshvert( REAL u, REAL v ); - void linevert( TrimVertex * ); - void linevert( GridVertex * ); - void bgnoutline( void ); - void endoutline( void ); - void endsurf( void ); - void triangle( TrimVertex*, TrimVertex*, TrimVertex* ); - - void bgntfan(); - void endtfan(); - void bgnqstrip(); - void endqstrip(); - void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val - ); - void evalVStrip(int n_left, REAL u_left, REAL* left_val, - int n_right, REAL v_right, REAL* right_val - ); - void tmeshvertNOGE(TrimVertex *t); - void tmeshvertNOGE_BU(TrimVertex *t); - void tmeshvertNOGE_BV(TrimVertex *t); - void preEvaluateBU(REAL u); - void preEvaluateBV(REAL v); - - - /* curve backend routines */ - void bgncurv( void ); - void segment( REAL, REAL ); - void curvpts( long, REAL *, long, int, REAL, REAL ); - void curvgrid( REAL, REAL, long ); - void curvmesh( long, long ); - void curvpt( REAL ); - void bgnline( void ); - void endline( void ); - void endcurv( void ); -private: -#ifndef NOWIREFRAME - int wireframetris; - int wireframequads; - int npts; - REAL mesh[3][4]; - int meshindex; -#endif -}; - -#endif /* __glubackend_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/basiccrveval.cc b/src/libs/mesa/glu/libnurbs/internals/basiccrveval.cc deleted file mode 100644 index cc473e4c2a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/basiccrveval.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * basiccrveval.c++ - * - */ - -#include "mystdio.h" -#include "types.h" -#include "basiccrveval.h" - -void -BasicCurveEvaluator::domain1f( REAL, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "domain1f\n" ); -#endif -} - -void -BasicCurveEvaluator::range1f( long , REAL *, REAL * ) -{ -#ifndef NDEBUG - _glu_dprintf( "range1f\n" ); -#endif -} - -void -BasicCurveEvaluator::enable( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "enable\n" ); -#endif -} - -void -BasicCurveEvaluator::disable( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "disable\n" ); -#endif -} - -void -BasicCurveEvaluator::bgnmap1f( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnmap1f\n" ); -#endif -} - -void -BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * ) -{ -#ifndef NDEBUG - _glu_dprintf( "map1f\n" ); -#endif -} - -void -BasicCurveEvaluator::mapgrid1f( long, REAL, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "mapgrid1f\n" ); -#endif -} - -void -BasicCurveEvaluator::mapmesh1f( long, long, long ) -{ -#ifndef NDEBUG - _glu_dprintf( "mapmesh1f\n" ); -#endif -} - -void -BasicCurveEvaluator::evalcoord1f( long, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "evalcoord1f\n" ); -#endif -} - -void -BasicCurveEvaluator::endmap1f( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endmap1f\n" ); -#endif -} - -void -BasicCurveEvaluator::bgnline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnline\n" ); -#endif -} - -void -BasicCurveEvaluator::endline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endline\n" ); -#endif -} diff --git a/src/libs/mesa/glu/libnurbs/internals/basiccrveval.h b/src/libs/mesa/glu/libnurbs/internals/basiccrveval.h deleted file mode 100644 index 277dc8dc96..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/basiccrveval.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * basiccurveeval.h - * - */ - -#ifndef __glubasiccrveval_h_ -#define __glubasiccrveval_h_ - -#include "types.h" -#include "displaymode.h" -#include "cachingeval.h" - -class BasicCurveEvaluator : public CachingEvaluator { -public: - virtual ~BasicCurveEvaluator() { /* silence warning*/ } - virtual void domain1f( REAL, REAL ); - virtual void range1f( long, REAL *, REAL * ); - - virtual void enable( long ); - virtual void disable( long ); - virtual void bgnmap1f( long ); - virtual void map1f( long, REAL, REAL, long, long, REAL * ); - virtual void mapgrid1f( long, REAL, REAL ); - virtual void mapmesh1f( long, long, long ); - virtual void evalcoord1f( long, REAL ); - virtual void endmap1f( void ); - - virtual void bgnline( void ); - virtual void endline( void ); -}; - -#endif /* __glubasiccrveval_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.cc b/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.cc deleted file mode 100644 index fad5dd0ada..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.cc +++ /dev/null @@ -1,232 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * basicsurfaceevaluator.c++ - * - */ - -#include "mystdio.h" -#include "types.h" -#include "basicsurfeval.h" - -#ifdef __WATCOMC__ -#pragma warning 726 10 -#endif - -void -BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "domain2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::polymode( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "polymode\n" ); -#endif -} - -void -BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to ) -{ -#ifndef NDEBUG - _glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n", - type, from[0], from[1], to[0], to[1] ); -#endif -} - -void -BasicSurfaceEvaluator::enable( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "enable\n" ); -#endif -} - -void -BasicSurfaceEvaluator::disable( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "disable\n" ); -#endif -} - -void -BasicSurfaceEvaluator::bgnmap2f( long ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnmap2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endmap2f( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endmap2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long, - REAL, REAL, long, long, - REAL * ) -{ -#ifndef NDEBUG - _glu_dprintf( "map2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "mapgrid2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long ) -{ -#ifndef NDEBUG - _glu_dprintf( "mapmesh2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL ) -{ -#ifndef NDEBUG - _glu_dprintf( "evalcoord2f\n" ); -#endif -} - -void -BasicSurfaceEvaluator::evalpoint2i( long, long ) -{ -#ifndef NDEBUG - _glu_dprintf( "evalpoint2i\n" ); -#endif -} - -void -BasicSurfaceEvaluator::bgnline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnline\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endline\n" ); -#endif -} - -void -BasicSurfaceEvaluator::bgnclosedline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnclosedline\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endclosedline( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endclosedline\n" ); -#endif -} - -void -BasicSurfaceEvaluator::bgntfan( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgntfan\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endtfan( void ) -{ -} - - -void -BasicSurfaceEvaluator::bgntmesh( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgntmesh\n" ); -#endif -} - -void -BasicSurfaceEvaluator::swaptmesh( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "swaptmesh\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endtmesh( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endtmesh\n" ); -#endif -} - -void -BasicSurfaceEvaluator::bgnqstrip( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnqstrip\n" ); -#endif -} - -void -BasicSurfaceEvaluator::endqstrip( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endqstrip\n" ); -#endif -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.h b/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.h deleted file mode 100644 index 8fe18a67fb..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/basicsurfeval.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * basicsurfeval.h - * - */ - -#ifndef __glubasicsurfeval_h_ -#define __glubasicsurfeval_h_ - -#include "types.h" -#include "displaymode.h" -#include "cachingeval.h" - -class BasicSurfaceEvaluator : public CachingEvaluator { -public: - virtual ~BasicSurfaceEvaluator() { /* silence warning*/ } - virtual void range2f( long, REAL *, REAL * ); - virtual void domain2f( REAL, REAL, REAL, REAL ); - - virtual void enable( long ); - virtual void disable( long ); - virtual void bgnmap2f( long ); - virtual void map2f( long, REAL, REAL, long, long, - REAL, REAL, long, long, - REAL * ); - virtual void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); - virtual void mapmesh2f( long, long, long, long, long ); - virtual void evalcoord2f( long, REAL, REAL ); - virtual void evalpoint2i( long, long ); - virtual void endmap2f( void ); - - virtual void polymode( long ); - virtual void bgnline( void ); - virtual void endline( void ); - virtual void bgnclosedline( void ); - virtual void endclosedline( void ); - virtual void bgntmesh( void ); - virtual void swaptmesh( void ); - virtual void endtmesh( void ); - virtual void bgnqstrip( void ); - virtual void endqstrip( void ); - - virtual void bgntfan( void ); - virtual void endtfan( void ); - - virtual void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val - ) = 0; - - virtual void evalVStrip(int n_left, REAL u_left, REAL* left_val, - int n_right, REAL u_right, REAL* right_val - ) = 0; - virtual void inDoEvalCoord2NOGE(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; - virtual void inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; - virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; - virtual void inPreEvaluateBV_intfac(REAL v ) = 0; - virtual void inPreEvaluateBU_intfac(REAL u ) = 0; - -}; - -#endif /* __glubasicsurfeval_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/bezierarc.h b/src/libs/mesa/glu/libnurbs/internals/bezierarc.h deleted file mode 100644 index 4acfb09488..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/bezierarc.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * bezierarc.h - * - */ - -#ifndef __glubezierarc_h -#define __glubezierarc_h - -#include "myassert.h" - -class Mapdesc; - -struct BezierArc : public PooledObj { /* a bezier arc */ - REAL * cpts; /* control points of arc */ - int order; /* order of arc */ - int stride; /* REAL distance between points */ - long type; /* curve type */ - Mapdesc * mapdesc; -}; - -#endif /* __glubezierarc_h */ diff --git a/src/libs/mesa/glu/libnurbs/internals/bin.cc b/src/libs/mesa/glu/libnurbs/internals/bin.cc deleted file mode 100644 index 54b406147b..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/bin.cc +++ /dev/null @@ -1,166 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * bin.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "bin.h" - -/*---------------------------------------------------------------------------- - * Constructor and destructor - *---------------------------------------------------------------------------- - */ -Bin::Bin() -{ - head = NULL; -} - -Bin::~Bin() -{ - assert( head == NULL); -} - -/*---------------------------------------------------------------------------- - * remove_this_arc - remove given Arc_ptr from bin - *---------------------------------------------------------------------------- - */ - -void -Bin::remove_this_arc( Arc_ptr arc ) -{ - Arc_ptr *j; - for( j = &(head); (*j != 0) && (*j != arc); j = &((*j)->link) ); - - if( *j != 0 ) { - if( *j == current ) - current = (*j)->link; - *j = (*j)->link; - } -} - -/*---------------------------------------------------------------------------- - * numarcs - count number of arcs in bin - *---------------------------------------------------------------------------- - */ - -int -Bin::numarcs() -{ - long count = 0; - for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() ) - count++; - return count; -} - -/*---------------------------------------------------------------------------- - * adopt - place an orphaned arcs into their new parents bin - *---------------------------------------------------------------------------- - */ - -void -Bin::adopt() -{ - markall(); - - Arc_ptr orphan; - while( (orphan = removearc()) != NULL ) { - for( Arc_ptr parent = orphan->next; parent != orphan; parent = parent->next ) { - if (! parent->ismarked() ) { - orphan->link = parent->link; - parent->link = orphan; - orphan->clearmark(); - break; - } - } - } -} - - -/*---------------------------------------------------------------------------- - * show - print out descriptions of the arcs in the bin - *---------------------------------------------------------------------------- - */ - -void -Bin::show( char *name ) -{ -#ifndef NDEBUG - _glu_dprintf( "%s\n", name ); - for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() ) - jarc->show( ); -#endif -} - - - -/*---------------------------------------------------------------------------- - * markall - mark all arcs with an identifying tag - *---------------------------------------------------------------------------- - */ - -void -Bin::markall() -{ - for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) - jarc->setmark(); -} - -/*---------------------------------------------------------------------------- - * listBezier - print out all arcs that are untessellated border arcs - *---------------------------------------------------------------------------- - */ - -void -Bin::listBezier( void ) -{ - for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) { - if( jarc->isbezier( ) ) { - assert( jarc->pwlArc->npts == 2 ); -#ifndef NDEBUG - TrimVertex *pts = jarc->pwlArc->pts; - REAL s1 = pts[0].param[0]; - REAL t1 = pts[0].param[1]; - REAL s2 = pts[1].param[0]; - REAL t2 = pts[1].param[1]; - _glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 ); -#endif - } - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/bin.h b/src/libs/mesa/glu/libnurbs/internals/bin.h deleted file mode 100644 index 2f976eb9bd..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/bin.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * bin.h - * - */ - -#ifndef __glubin_h_ -#define __glubin_h_ - -#include "myassert.h" -#include "arc.h" -#include "defines.h" - -class Bin -{ /* a linked list of jordan arcs */ -private: - Arc_ptr head;/*first arc on list */ - Arc_ptr current; /* current arc on list */ -public: - Bin(); - ~Bin(); - inline Arc_ptr firstarc( void ); - inline Arc_ptr nextarc( void ); - inline Arc_ptr removearc( void ); - inline int isnonempty( void ) { return (head ? 1 : 0); } - inline void addarc( Arc_ptr ); - void remove_this_arc( Arc_ptr ); - int numarcs( void ); - void adopt( void ); - void markall( void ); - void show( char * ); - void listBezier( void ); -}; - -/*---------------------------------------------------------------------------- - * Bin::addarc - add an Arc_ptr to head of linked list of Arc_ptr - *---------------------------------------------------------------------------- - */ - -inline void -Bin::addarc( Arc_ptr jarc ) -{ - jarc->link = head; - head = jarc; -} - -/*---------------------------------------------------------------------------- - * Bin::removearc - remove first Arc_ptr from bin - *---------------------------------------------------------------------------- - */ - -inline Arc_ptr -Bin::removearc( void ) -{ - Arc_ptr jarc = head; - - if( jarc ) head = jarc->link; - return jarc; -} - - -/*---------------------------------------------------------------------------- - * BinIter::nextarc - return current arc in bin and advance pointer to next arc - *---------------------------------------------------------------------------- - */ - -inline Arc_ptr -Bin::nextarc( void ) -{ - Arc_ptr jarc = current; - -#ifdef DEBUG - assert( jarc->check() != 0 ); -#endif - - if( jarc ) current = jarc->link; - return jarc; -} - -/*---------------------------------------------------------------------------- - * BinIter::firstarc - set current arc to first arc of bin advance to next arc - *---------------------------------------------------------------------------- - */ - -inline Arc_ptr -Bin::firstarc( void ) -{ - current = head; - return nextarc( ); -} - -#endif /* __glubin_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/bufpool.cc b/src/libs/mesa/glu/libnurbs/internals/bufpool.cc deleted file mode 100644 index 8cc847ab22..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/bufpool.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * bufpool.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "bufpool.h" - - -/*----------------------------------------------------------------------------- - * Pool - allocate a new pool of buffers - *----------------------------------------------------------------------------- - */ -Pool::Pool( int _buffersize, int initpoolsize, const char *n ) -{ - if((unsigned)_buffersize < sizeof(Buffer)) - buffersize = sizeof(Buffer); - else - buffersize = _buffersize; - initsize = initpoolsize * buffersize; - nextsize = initsize; - name = n; - magic = is_allocated; - nextblock = 0; - curblock = 0; - freelist = 0; - nextfree = 0; -} - -/*----------------------------------------------------------------------------- - * ~Pool - free a pool of buffers and the pool itself - *----------------------------------------------------------------------------- - */ - -Pool::~Pool( void ) -{ - assert( (this != 0) && (magic == is_allocated) ); - - while( nextblock ) { - delete [] blocklist[--nextblock]; - blocklist[nextblock] = 0; - } - magic = is_free; -} - - -void Pool::grow( void ) -{ - assert( (this != 0) && (magic == is_allocated) ); - curblock = new char[nextsize]; - blocklist[nextblock++] = curblock; - nextfree = nextsize; - nextsize *= 2; -} - -/*----------------------------------------------------------------------------- - * Pool::clear - free buffers associated with pool but keep pool - *----------------------------------------------------------------------------- - */ - -void -Pool::clear( void ) -{ - assert( (this != 0) && (magic == is_allocated) ); - - while( nextblock ) { - delete [] blocklist[--nextblock]; - blocklist[nextblock] = 0; - } - curblock = 0; - freelist = 0; - nextfree = 0; - if( nextsize > initsize ) - nextsize /= 2; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/bufpool.h b/src/libs/mesa/glu/libnurbs/internals/bufpool.h deleted file mode 100644 index 0fa9433750..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/bufpool.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * bufpool.h - * - */ - -#ifndef __glubufpool_h_ -#define __glubufpool_h_ - -#include "gluos.h" -#include "myassert.h" -#include "mystdlib.h" - -#define NBLOCKS 32 - -class Buffer { - friend class Pool; - Buffer * next; /* next buffer on free list */ -}; - -class Pool { -public: - Pool( int, int, const char * ); - ~Pool( void ); - inline void* new_buffer( void ); - inline void free_buffer( void * ); - void clear( void ); - -private: - void grow( void ); - -protected: - Buffer *freelist; /* linked list of free buffers */ - char *blocklist[NBLOCKS]; /* blocks of malloced memory */ - int nextblock; /* next free block index */ - char *curblock; /* last malloced block */ - int buffersize; /* bytes per buffer */ - int nextsize; /* size of next block of memory */ - int nextfree; /* byte offset past next free buffer */ - int initsize; - enum Magic { is_allocated = 0xf3a1, is_free = 0xf1a2 }; - const char *name; /* name of the pool */ - Magic magic; /* marker for valid pool */ -}; - -/*----------------------------------------------------------------------------- - * Pool::free_buffer - return a buffer to a pool - *----------------------------------------------------------------------------- - */ - -inline void -Pool::free_buffer( void *b ) -{ - assert( (this != 0) && (magic == is_allocated) ); - - /* add buffer to singly connected free list */ - - ((Buffer *) b)->next = freelist; - freelist = (Buffer *) b; -} - - -/*----------------------------------------------------------------------------- - * Pool::new_buffer - allocate a buffer from a pool - *----------------------------------------------------------------------------- - */ - -inline void * -Pool::new_buffer( void ) -{ - void *buffer; - - assert( (this != 0) && (magic == is_allocated) ); - - /* find free buffer */ - - if( freelist ) { - buffer = (void *) freelist; - freelist = freelist->next; - } else { - if( ! nextfree ) - grow( ); - nextfree -= buffersize;; - buffer = (void *) (curblock + nextfree); - } - return buffer; -} - -class PooledObj { -public: - inline void * operator new( size_t, Pool & ); - inline void * operator new( size_t, void *); - inline void * operator new( size_t s) - { return ::new char[s]; } - inline void operator delete( void * ) { assert( 0 ); } - inline void operator delete( void *, Pool & ) { assert( 0 ); } - inline void deleteMe( Pool & ); -}; - -inline void * -PooledObj::operator new( size_t, Pool& pool ) -{ - return pool.new_buffer(); -} - -inline void -PooledObj::deleteMe( Pool& pool ) -{ - pool.free_buffer( (void *) this ); -} - -#endif /* __glubufpool_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/cachingeval.cc b/src/libs/mesa/glu/libnurbs/internals/cachingeval.cc deleted file mode 100644 index 3fab38c106..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/cachingeval.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * cachingeval.c++ - * - */ - -#include "cachingeval.h" - -int -CachingEvaluator::canRecord( void ) -{ - return 0; -} - -int -CachingEvaluator::canPlayAndRecord( void ) -{ - return 0; -} - -int -CachingEvaluator::createHandle( int ) -{ - return 0; -} - -void -CachingEvaluator::beginOutput( ServiceMode, int ) -{ -} - -void -CachingEvaluator::endOutput( void ) -{ -} - -void -CachingEvaluator::discardRecording( int ) -{ -} - -void -CachingEvaluator::playRecording( int ) -{ -} diff --git a/src/libs/mesa/glu/libnurbs/internals/cachingeval.h b/src/libs/mesa/glu/libnurbs/internals/cachingeval.h deleted file mode 100644 index b390067a28..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/cachingeval.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * cachingeval.h - * - */ - -#ifndef __glucachingval_h_ -#define __glucachingval_h_ - -class CachingEvaluator { -public: - virtual ~CachingEvaluator() { /* silence warning*/ } - enum ServiceMode { play, record, playAndRecord }; - virtual int canRecord( void ); - virtual int canPlayAndRecord( void ); - virtual int createHandle( int handle ); - virtual void beginOutput( ServiceMode, int handle ); - virtual void endOutput( void ); - virtual void discardRecording( int handle ); - virtual void playRecording( int handle ); -}; -#endif /* __glucachingval_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/ccw.cc b/src/libs/mesa/glu/libnurbs/internals/ccw.cc deleted file mode 100644 index eb01b7781a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/ccw.cc +++ /dev/null @@ -1,565 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * ccw.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "subdivider.h" -#include "types.h" -#include "arc.h" -#include "trimvertex.h" -#include "simplemath.h" - -inline int -Subdivider::bbox( TrimVertex *a, TrimVertex *b, TrimVertex *c, int p ) -{ - return bbox( a->param[p], b->param[p], c->param[p], - a->param[1-p], b->param[1-p], c->param[1-p] ); -} - -int -Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 -{ - register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; - register TrimVertex *v1last = &j1->pwlArc->pts[0]; - register TrimVertex *v2 = &j2->pwlArc->pts[0]; - register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; - register TrimVertex *v1next = v1-1; - register TrimVertex *v2next = v2+1; - int sgn; - - assert( v1 != v1last ); - assert( v2 != v2last ); - -#ifndef NDEBUG - _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 ); -#endif - - // the arcs lie on the line (0 == v1->param[0]) - if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] ) - return 0; - - if( v2next->param[0] < v2->param[0] || v1next->param[0] < v1->param[0] ) - ::mylongjmp( jumpbuffer, 28 ); - - if( v1->param[1] < v2->param[1] ) - return 0; - else if( v1->param[1] > v2->param[1] ) - return 1; - - while( 1 ) { - if( v1next->param[0] < v2next->param[0] ) { -#ifndef NDEBUG - _glu_dprintf( "case a\n" ); -#endif - assert( v1->param[0] <= v1next->param[0] ); - assert( v2->param[0] <= v1next->param[0] ); - switch( bbox( v2, v2next, v1next, 1 ) ) { - case -1: - return 0; - case 0: - sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) { - return sgn; - } else { -#ifdef DEBUG - _glu_dprintf( "decr\n" ); -#endif - v1 = v1next--; - if( v1 == v1last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 1; - } - } else if( v1next->param[0] > v2next->param[0] ) { -#ifndef NDEBUG - _glu_dprintf( "case b\n" ); -#endif - assert( v1->param[0] <= v2next->param[0] ); - assert( v2->param[0] <= v2next->param[0] ); - switch( bbox( v1, v1next, v2next, 1 ) ) { - case -1: - return 1; - case 0: - sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) { - return sgn; - } else { -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - v2 = v2next++; - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 0; - } - } else { -#ifndef NDEBUG - _glu_dprintf( "case ab\n" ); -#endif - if( v1next->param[1] < v2next->param[1] ) - return 0; - else if( v1next->param[1] > v2next->param[1] ) - return 1; - else { -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - v2 = v2next++; - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - } - } -} - -int -Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0 -{ - register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; - register TrimVertex *v1last = &j1->pwlArc->pts[0]; - register TrimVertex *v2 = &j2->pwlArc->pts[0]; - register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; - register TrimVertex *v1next = v1-1; - register TrimVertex *v2next = v2+1; - int sgn; - - assert( v1 != v1last ); - assert( v2 != v2last ); - -#ifndef NDEBUG - _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 ); -#endif - - // the arcs lie on the line (0 == v1->param[0]) - if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] ) - return 0; - - if( v2next->param[0] > v2->param[0] || v1next->param[0] > v1->param[0] ) - ::mylongjmp( jumpbuffer, 28 ); - - if( v1->param[1] < v2->param[1] ) - return 1; - else if( v1->param[1] > v2->param[1] ) - return 0; - - while( 1 ) { - if( v1next->param[0] > v2next->param[0] ) { -#ifndef NDEBUG - _glu_dprintf( "case c\n" ); -#endif - assert( v1->param[0] >= v1next->param[0] ); - assert( v2->param[0] >= v1next->param[0] ); - switch( bbox( v2next, v2, v1next, 1 ) ) { - case -1: - return 1; - case 0: - sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) - return sgn; - else { - v1 = v1next--; -#ifdef DEBUG - _glu_dprintf( "decr\n" ); -#endif - if( v1 == v1last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 0; - } - } else if( v1next->param[0] < v2next->param[0] ) { -#ifndef NDEBUG - _glu_dprintf( "case d\n" ); -#endif - assert( v1->param[0] >= v2next->param[0] ); - assert( v2->param[0] >= v2next->param[0] ); - switch( bbox( v1next, v1, v2next, 1 ) ) { - case -1: - return 0; - case 0: - sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) - return sgn; - else { - v2 = v2next++; -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 1; - } - } else { -#ifdef DEBUG - _glu_dprintf( "case cd\n" ); -#endif - if( v1next->param[1] < v2next->param[1] ) - return 1; - else if( v1next->param[1] > v2next->param[1] ) - return 0; - else { - v2 = v2next++; -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - } - } -} - -int -Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 -{ - register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; - register TrimVertex *v1last = &j1->pwlArc->pts[0]; - register TrimVertex *v2 = &j2->pwlArc->pts[0]; - register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; - register TrimVertex *v1next = v1-1; - register TrimVertex *v2next = v2+1; - int sgn; - - assert( v1 != v1last ); - assert( v2 != v2last ); - -#ifndef NDEBUG - _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 ); -#endif - - // the arcs lie on the line (1 == v1->param[1]) - if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] ) - return 0; - - if( v2next->param[1] < v2->param[1] || v1next->param[1] < v1->param[1] ) - ::mylongjmp( jumpbuffer, 28 ); - - if( v1->param[0] < v2->param[0] ) - return 1; - else if( v1->param[0] > v2->param[0] ) - return 0; - - while( 1 ) { - if( v1next->param[1] < v2next->param[1] ) { -#ifndef NDEBUG - _glu_dprintf( "case a\n" ); -#endif - assert( v1->param[1] <= v1next->param[1] ); - assert( v2->param[1] <= v1next->param[1] ); - switch( bbox( v2, v2next, v1next, 0 ) ) { - case -1: - return 1; - case 0: - sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) { - return sgn; - } else { -#ifdef DEBUG - _glu_dprintf( "decr\n" ); -#endif - v1 = v1next--; - if( v1 == v1last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 0; - } - } else if( v1next->param[1] > v2next->param[1] ) { -#ifndef NDEBUG - _glu_dprintf( "case b\n" ); -#endif - assert( v1->param[1] <= v2next->param[1] ); - assert( v2->param[1] <= v2next->param[1] ); - switch( bbox( v1, v1next, v2next, 0 ) ) { - case -1: - return 0; - case 0: - sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) { - return sgn; - } else { -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - v2 = v2next++; - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 1; - } - } else { -#ifdef DEBUG - _glu_dprintf( "case ab\n" ); -#endif - if( v1next->param[0] < v2next->param[0] ) - return 1; - else if( v1next->param[0] > v2next->param[0] ) - return 0; - else { -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - v2 = v2next++; - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - } - } -} - -int -Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 ) -{ - register TrimVertex *v1 = &j1->pwlArc->pts[j1->pwlArc->npts-1]; - register TrimVertex *v1last = &j1->pwlArc->pts[0]; - register TrimVertex *v2 = &j2->pwlArc->pts[0]; - register TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1]; - register TrimVertex *v1next = v1-1; - register TrimVertex *v2next = v2+1; - int sgn; - - assert( v1 != v1last ); - assert( v2 != v2last ); - -#ifndef NDEBUG - _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 ); -#endif - - // the arcs lie on the line (1 == v1->param[1]) - if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] ) - return 0; - - if( v2next->param[1] > v2->param[1] || v1next->param[1] > v1->param[1] ) - ::mylongjmp( jumpbuffer, 28 ); - - if( v1->param[0] < v2->param[0] ) - return 0; - else if( v1->param[0] > v2->param[0] ) - return 1; - - while( 1 ) { - if( v1next->param[1] > v2next->param[1] ) { -#ifndef NDEBUG - _glu_dprintf( "case c\n" ); -#endif - assert( v1->param[1] >= v1next->param[1] ); - assert( v2->param[1] >= v1next->param[1] ); - switch( bbox( v2next, v2, v1next, 0 ) ) { - case -1: - return 0; - case 0: - sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) - return sgn; - else { - v1 = v1next--; -#ifdef DEBUG - _glu_dprintf( "decr\n" ); -#endif - if( v1 == v1last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 1; - } - } else if( v1next->param[1] < v2next->param[1] ) { -#ifndef NDEBUG - _glu_dprintf( "case d\n" ); - assert( v1->param[1] >= v2next->param[1] ); - assert( v2->param[1] >= v2next->param[1] ); -#endif - switch( bbox( v1next, v1, v2next, 0 ) ) { - case -1: - return 1; - case 0: - sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) - return sgn; - else { - v2 = v2next++; -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - break; - case 1: - return 0; - } - } else { -#ifdef DEBUG - _glu_dprintf( "case cd\n" ); -#endif - if( v1next->param[0] < v2next->param[0] ) - return 0; - else if( v1next->param[0] > v2next->param[0] ) - return 1; - else { - v2 = v2next++; -#ifdef DEBUG - _glu_dprintf( "incr\n" ); -#endif - if( v2 == v2last ) { -#ifdef DEBUG - _glu_dprintf( "no good results\n" ); -#endif - return 0; // ill-conditioned, guess answer - } - } - } - } -} - - -#ifndef NDEBUG -int -Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc, - register REAL ta, register REAL tb, register REAL tc ) -#else -int -Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc, - register REAL , register REAL , register REAL ) -#endif -{ -#ifndef NDEBUG - assert( tc >= ta ); - assert( tc <= tb ); -#endif - - if( sa < sb ) { - if( sc <= sa ) { - return -1; - } else if( sb <= sc ) { - return 1; - } else { - return 0; - } - } else if( sa > sb ) { - if( sc >= sa ) { - return 1; - } else if( sb >= sc ) { - return -1; - } else { - return 0; - } - } else { - if( sc > sa ) { - return 1; - } else if( sb > sc ) { - return -1; - } else { - return 0; - } - } -} - -/*---------------------------------------------------------------------------- - * ccw - determine how three points are oriented by computing their - * determinant. - * Return 1 if the vertices are ccw oriented, - * 0 if they are cw oriented, or - * -1 if the computation is ill-conditioned. - *---------------------------------------------------------------------------- - */ -int -Subdivider::ccw( TrimVertex *a, TrimVertex *b, TrimVertex *c ) -{ - REAL d = det3( a, b, c ); - if( glu_abs(d) < 0.0001 ) return -1; - return (d < 0.0) ? 0 : 1; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/coveandtiler.cc b/src/libs/mesa/glu/libnurbs/internals/coveandtiler.cc deleted file mode 100644 index ca5bf36b36..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/coveandtiler.cc +++ /dev/null @@ -1,440 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * coveandtiler.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "coveandtiler.h" -#include "gridvertex.h" -#include "gridtrimvertex.h" -#include "uarray.h" -#include "backend.h" - - -const int CoveAndTiler::MAXSTRIPSIZE = 1000; - -CoveAndTiler::CoveAndTiler( Backend& b ) - : backend( b ) -{ } - -CoveAndTiler::~CoveAndTiler( void ) -{ } - -inline void -CoveAndTiler::output( GridVertex &gv ) -{ - backend.tmeshvert( &gv ); -} - -inline void -CoveAndTiler::output( TrimVertex *tv ) -{ - backend.tmeshvert( tv ); -} - -inline void -CoveAndTiler::output( GridTrimVertex& g ) -{ - backend.tmeshvert( &g ); -} - -void -CoveAndTiler::coveAndTile( void ) -{ - long ustart = (top.ustart >= bot.ustart) ? top.ustart : bot.ustart; - long uend = (top.uend <= bot.uend) ? top.uend : bot.uend; - if( ustart <= uend ) { - tile( bot.vindex, ustart, uend ); - if( top.ustart >= bot.ustart ) - coveUpperLeft(); - else - coveLowerLeft(); - - if( top.uend <= bot.uend ) - coveUpperRight(); - else - coveLowerRight(); - } else { - TrimVertex blv, tlv, *bl, *tl; - GridTrimVertex bllv, tllv; - TrimVertex *lf = left.first(); - TrimVertex *ll = left.last(); - if( lf->param[0] >= ll->param[0] ) { - blv.param[0] = lf->param[0]; - blv.param[1] = ll->param[1]; - blv.nuid = 0; // XXX - assert( blv.param[1] == bot.vval ); - bl = &blv; - tl = lf; - tllv.set( lf ); - if( ll->param[0] > uarray.uarray[top.ustart-1] ) { - bllv.set( ll ); - assert( ll->param[0] <= uarray.uarray[bot.ustart] ); - } else { - bllv.set( top.ustart-1, bot.vindex ); - } - coveUpperLeftNoGrid( bl ); - } else { - tlv.param[0] = ll->param[0]; - tlv.param[1] = lf->param[1]; - tlv.nuid = 0; // XXX - assert( tlv.param[1] == top.vval ); - tl = &tlv; - bl = ll; - bllv.set( ll ); - if( lf->param[0] > uarray.uarray[bot.ustart-1] ) { - assert( lf->param[0] <= uarray.uarray[bot.ustart] ); - tllv.set( lf ); - } else { - tllv.set( bot.ustart-1, top.vindex ); - } - coveLowerLeftNoGrid( tl ); - } - - TrimVertex brv, trv, *br, *tr; - GridTrimVertex brrv, trrv; - TrimVertex *rf = right.first(); - TrimVertex *rl = right.last(); - - if( rf->param[0] <= rl->param[0] ) { - brv.param[0] = rf->param[0]; - brv.param[1] = rl->param[1]; - brv.nuid = 0; // XXX - assert( brv.param[1] == bot.vval ); - br = &brv; - tr = rf; - trrv.set( rf ); - if( rl->param[0] < uarray.uarray[top.uend+1] ) { - assert( rl->param[0] >= uarray.uarray[top.uend] ); - brrv.set( rl ); - } else { - brrv.set( top.uend+1, bot.vindex ); - } - coveUpperRightNoGrid( br ); - } else { - trv.param[0] = rl->param[0]; - trv.param[1] = rf->param[1]; - trv.nuid = 0; // XXX - assert( trv.param[1] == top.vval ); - tr = &trv; - br = rl; - brrv.set( rl ); - if( rf->param[0] < uarray.uarray[bot.uend+1] ) { - assert( rf->param[0] >= uarray.uarray[bot.uend] ); - trrv.set( rf ); - } else { - trrv.set( bot.uend+1, top.vindex ); - } - coveLowerRightNoGrid( tr ); - } - - backend.bgntmesh( "doit" ); - output(trrv); - output(tllv); - output( tr ); - output( tl ); - output( br ); - output( bl ); - output(brrv); - output(bllv); - backend.endtmesh(); - } -} - -void -CoveAndTiler::tile( long vindex, long ustart, long uend ) -{ - long numsteps = uend - ustart; - - if( numsteps == 0 ) return; - - if( numsteps > MAXSTRIPSIZE ) { - long umid = ustart + (uend - ustart) / 2; - tile( vindex, ustart, umid ); - tile( vindex, umid, uend ); - } else { - backend.surfmesh( ustart, vindex-1, numsteps, 1 ); - } -} - -void -CoveAndTiler::coveUpperRight( void ) -{ - GridVertex tgv( top.uend, top.vindex ); - GridVertex gv( top.uend, bot.vindex ); - - right.first(); - backend.bgntmesh( "coveUpperRight" ); - output( right.next() ); - output( tgv ); - backend.swaptmesh(); - output( gv ); - coveUR(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveUpperRightNoGrid( TrimVertex* br ) -{ - backend.bgntmesh( "coveUpperRight" ); - output( right.first() ); - output( right.next() ); - backend.swaptmesh(); - output( br ); - coveUR(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveUR( ) -{ - GridVertex gv( top.uend, bot.vindex ); - TrimVertex *vert = right.next(); - if( vert == NULL ) return; - - assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] ); - - if( gv.nextu() >= bot.uend ) { - for( ; vert; vert = right.next() ) { - output( vert ); - backend.swaptmesh(); - } - } else while( 1 ) { - if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { - output( vert ); - backend.swaptmesh(); - vert = right.next(); - if( vert == NULL ) break; - } else { - backend.swaptmesh(); - output( gv ); - if( gv.nextu() == bot.uend ) { - for( ; vert; vert = right.next() ) { - output( vert ); - backend.swaptmesh(); - } - break; - } - } - } -} - -void -CoveAndTiler::coveUpperLeft( void ) -{ - GridVertex tgv( top.ustart, top.vindex ); - GridVertex gv( top.ustart, bot.vindex ); - - left.first(); - backend.bgntmesh( "coveUpperLeft" ); - output( tgv ); - output( left.next() ); - output( gv ); - backend.swaptmesh(); - coveUL(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveUpperLeftNoGrid( TrimVertex* bl ) -{ - backend.bgntmesh( "coveUpperLeftNoGrid" ); - output( left.first() ); - output( left.next() ); - output( bl ); - backend.swaptmesh(); - coveUL(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveUL() -{ - GridVertex gv( top.ustart, bot.vindex ); - TrimVertex *vert = left.next(); - if( vert == NULL ) return; - assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] ); - - if( gv.prevu() <= bot.ustart ) { - for( ; vert; vert = left.next() ) { - backend.swaptmesh(); - output( vert ); - } - } else while( 1 ) { - if( vert->param[0] > uarray.uarray[gv.gparam[0]] ) { - backend.swaptmesh(); - output( vert ); - vert = left.next(); - if( vert == NULL ) break; - } else { - output( gv ); - backend.swaptmesh(); - if( gv.prevu() == bot.ustart ) { - for( ; vert; vert = left.next() ) { - backend.swaptmesh(); - output( vert ); - } - break; - } - } - } -} - -void -CoveAndTiler::coveLowerLeft( void ) -{ - GridVertex bgv( bot.ustart, bot.vindex ); - GridVertex gv( bot.ustart, top.vindex ); - - left.last(); - backend.bgntmesh( "coveLowerLeft" ); - output( left.prev() ); - output( bgv ); - backend.swaptmesh(); - output( gv ); - coveLL(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveLowerLeftNoGrid( TrimVertex* tl ) -{ - backend.bgntmesh( "coveLowerLeft" ); - output( left.last() ); - output( left.prev() ); - backend.swaptmesh(); - output( tl ); - coveLL( ); - backend.endtmesh(); -} - -void -CoveAndTiler::coveLL() -{ - GridVertex gv( bot.ustart, top.vindex ); - TrimVertex *vert = left.prev(); - if( vert == NULL ) return; - assert( vert->param[0] <= uarray.uarray[gv.gparam[0]] ); - - if( gv.prevu() <= top.ustart ) { - for( ; vert; vert = left.prev() ) { - output( vert ); - backend.swaptmesh(); - } - } else while( 1 ) { - if( vert->param[0] > uarray.uarray[gv.gparam[0]] ){ - output( vert ); - backend.swaptmesh(); - vert = left.prev(); - if( vert == NULL ) break; - } else { - backend.swaptmesh(); - output( gv ); - if( gv.prevu() == top.ustart ) { - for( ; vert; vert = left.prev() ) { - output( vert ); - backend.swaptmesh(); - } - break; - } - } - } -} - -void -CoveAndTiler::coveLowerRight( void ) -{ - GridVertex bgv( bot.uend, bot.vindex ); - GridVertex gv( bot.uend, top.vindex ); - - right.last(); - backend.bgntmesh( "coveLowerRight" ); - output( bgv ); - output( right.prev() ); - output( gv ); - backend.swaptmesh(); - coveLR(); - backend.endtmesh( ); -} - -void -CoveAndTiler::coveLowerRightNoGrid( TrimVertex* tr ) -{ - backend.bgntmesh( "coveLowerRIght" ); - output( right.last() ); - output( right.prev() ); - output( tr ); - backend.swaptmesh(); - coveLR(); - backend.endtmesh(); -} - -void -CoveAndTiler::coveLR( ) -{ - GridVertex gv( bot.uend, top.vindex ); - TrimVertex *vert = right.prev(); - if( vert == NULL ) return; - assert( vert->param[0] >= uarray.uarray[gv.gparam[0]] ); - - if( gv.nextu() >= top.uend ) { - for( ; vert; vert = right.prev() ) { - backend.swaptmesh(); - output( vert ); - } - } else while( 1 ) { - if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { - backend.swaptmesh(); - output( vert ); - vert = right.prev(); - if( vert == NULL ) break; - } else { - output( gv ); - backend.swaptmesh(); - if( gv.nextu() == top.uend ) { - for( ; vert; vert = right.prev() ) { - backend.swaptmesh(); - output( vert ); - } - break; - } - } - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/coveandtiler.h b/src/libs/mesa/glu/libnurbs/internals/coveandtiler.h deleted file mode 100644 index d454202e6d..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/coveandtiler.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * coveandtiler.h - * - */ - -#ifndef __glucoveandtiler_h -#define __glucoveandtiler_h - -#include "trimregion.h" -#include "trimvertex.h" -#include "gridvertex.h" - -class Backend; -class GridTrimVertex; - -class CoveAndTiler : virtual public TrimRegion { -public: - CoveAndTiler( Backend& ); - ~CoveAndTiler( void ); - void coveAndTile( void ); -private: - Backend& backend; - static const int MAXSTRIPSIZE; - void tile( long, long, long ); - void coveLowerLeft( void ); - void coveLowerRight( void ); - void coveUpperLeft( void ); - void coveUpperRight( void ); - void coveUpperLeftNoGrid( TrimVertex * ); - void coveUpperRightNoGrid( TrimVertex * ); - void coveLowerLeftNoGrid( TrimVertex * ); - void coveLowerRightNoGrid( TrimVertex * ); - void coveLL( void ); - void coveLR( void ); - void coveUL( void ); - void coveUR( void ); - inline void output( GridTrimVertex& ); - inline void output( GridVertex& ); - inline void output( TrimVertex* ); -}; - -#endif /* __glucoveandtiler_h */ diff --git a/src/libs/mesa/glu/libnurbs/internals/curve.cc b/src/libs/mesa/glu/libnurbs/internals/curve.cc deleted file mode 100644 index 33e2752643..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/curve.cc +++ /dev/null @@ -1,198 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * curve.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "mymath.h" -#include "curve.h" -#include "mapdesc.h" -#include "types.h" -#include "quilt.h" -#include "nurbsconsts.h" - -/*-------------------------------------------------------------------------- - * Curve::Curve - copy curve from quilt and transform control points - *-------------------------------------------------------------------------- - */ - -Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) -{ - mapdesc = geo->mapdesc; - next = c; - needsSampling = mapdesc->isRangeSampling() ? 1 : 0; - cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; - order = geo->qspec[0].order; - stride = MAXCOORDS; - - REAL *ps = geo->cpts; - Quiltspec_ptr qs = geo->qspec; - ps += qs->offset; - ps += qs->index * qs->order * qs->stride; - - if( needsSampling ) - mapdesc->xformSampling( ps, qs->order, qs->stride, spts, stride ); - - if( cullval == CULL_ACCEPT ) - mapdesc->xformCulling( ps, qs->order, qs->stride, cpts, stride ); - - /* set untrimmed curve range */ - range[0] = qs->breakpoints[qs->index]; - range[1] = qs->breakpoints[qs->index+1]; - range[2] = range[1] - range[0]; - - if( range[0] != pta ) { - Curve lower( *this, pta, 0 ); - lower.next = next; - *this = lower; - } - if( range[1] != ptb ) { - Curve lower( *this, ptb, 0 ); - } -} - -/*-------------------------------------------------------------------------- - * Curve::Curve - subdivide a curve along an isoparametric line - *-------------------------------------------------------------------------- - */ - -Curve::Curve( Curve& upper, REAL value, Curve *c ) -{ - Curve &lower = *this; - - lower.next = c; - lower.mapdesc = upper.mapdesc; - lower.needsSampling = upper.needsSampling; - lower.order = upper.order; - lower.stride = upper.stride; - lower.cullval = upper.cullval; - - REAL d = (value - upper.range[0]) / upper.range[2]; - - if( needsSampling ) - mapdesc->subdivide( upper.spts, lower.spts, d, upper.stride, upper.order ); - - if( cullval == CULL_ACCEPT ) - mapdesc->subdivide( upper.cpts, lower.cpts, d, upper.stride, upper.order ); - - lower.range[0] = upper.range[0]; - lower.range[1] = value; - lower.range[2] = value - upper.range[0]; - upper.range[0] = value; - upper.range[2] = upper.range[1] - value; -} - - -/*-------------------------------------------------------------------------- - * Curve::clamp - clamp the sampling rate to a given maximum - *-------------------------------------------------------------------------- - */ - -void -Curve::clamp( void ) -{ - if( stepsize < minstepsize ) - stepsize = mapdesc->clampfactor * minstepsize; -} - -void -Curve::setstepsize( REAL max ) -{ - stepsize = ( max >= 1.0 ) ? (range[2] / max) : range[2]; - minstepsize = stepsize; -} - -void -Curve::getstepsize( void ) -{ - minstepsize= 0; - - if( mapdesc->isConstantSampling() ) { - // fixed number of samples per patch in each direction - // maxrate is number of s samples per patch - setstepsize( mapdesc->maxrate ); - } else if( mapdesc->isDomainSampling() ) { - // maxrate is number of s samples per unit s length of domain - setstepsize( mapdesc->maxrate * range[2] ); - } else { - // upper bound on path length between sample points - - assert( order <= MAXORDER ); - - /* points have been transformed, therefore they are homogeneous */ - REAL tmp[MAXORDER][MAXCOORDS]; - const int tstride = sizeof(tmp[0]) / sizeof(REAL); - int val = mapdesc->project( spts, stride, &tmp[0][0], tstride, order ); - - if( val == 0 ) { - // control points cross infinity, therefore derivatives are undefined - setstepsize( mapdesc->maxrate ); - } else { - REAL t = mapdesc->getProperty( N_PIXEL_TOLERANCE ); - if( mapdesc->isParametricDistanceSampling() ) { - REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 2, range[2] ); - stepsize = (d > 0.0) ? sqrtf( 8.0 * t / d ) : range[2]; - minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0; - } else if( mapdesc->isPathLengthSampling() ) { - // t is upper bound on path (arc) length - REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 1, range[2] ); - stepsize = ( d > 0.0 ) ? (t / d) : range[2]; - minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0; - } else { - // control points cross infinity, therefore partials are undefined - setstepsize( mapdesc->maxrate ); - } - } - } -} - -int -Curve::needsSamplingSubdivision( void ) -{ - return ( stepsize < minstepsize ) ? 1 : 0; -} - -int -Curve::cullCheck( void ) -{ - if( cullval == CULL_ACCEPT ) - cullval = mapdesc->cullCheck( cpts, order, stride ); - return cullval; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/curve.h b/src/libs/mesa/glu/libnurbs/internals/curve.h deleted file mode 100644 index 0da81c7216..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/curve.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * curve.h - * - */ - -#ifndef __glucurve_h_ -#define __glucurve_h_ - -#include "types.h" -#include "defines.h" - -class Mapdesc; -class Quilt; - - -class Curve { -public: -friend class Curvelist; - Curve( Quilt *, REAL, REAL, Curve * ); - Curve( Curve&, REAL, Curve * ); - Curve * next; -private: - Mapdesc * mapdesc; - int stride; - int order; - int cullval; - int needsSampling; - REAL cpts[MAXORDER*MAXCOORDS]; - REAL spts[MAXORDER*MAXCOORDS]; - REAL stepsize; - REAL minstepsize; - REAL range[3]; - - void clamp( void ); - void setstepsize( REAL ); - void getstepsize( void ); - int cullCheck( void ); - int needsSamplingSubdivision( void ); -}; -#endif /* __glucurve_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/curvelist.cc b/src/libs/mesa/glu/libnurbs/internals/curvelist.cc deleted file mode 100644 index 872eb5816d..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/curvelist.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * curvelist.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "quilt.h" -#include "curvelist.h" -#include "curve.h" -#include "nurbsconsts.h" -#include "types.h" - -Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) -{ - curve = 0; - for( Quilt *q = quilts; q; q = q->next ) - curve = new Curve( q, pta, ptb, curve ); - range[0] = pta; - range[1] = ptb; - range[2] = ptb - pta; -} - -Curvelist::Curvelist( Curvelist &upper, REAL value ) -{ - Curvelist &lower = *this; - curve = 0; - for( Curve *c = upper.curve; c; c = c->next ) - curve = new Curve( *c, value, curve ); - - lower.range[0] = upper.range[0]; - lower.range[1] = value; - lower.range[2] = value - upper.range[0]; - upper.range[0] = value; - upper.range[2] = upper.range[1] - value; -} - -Curvelist::~Curvelist() -{ - while( curve ) { - Curve *c = curve; - curve = curve->next; - delete c; - } -} - -int -Curvelist::cullCheck( void ) -{ - for( Curve *c = curve; c; c = c->next ) - if( c->cullCheck() == CULL_TRIVIAL_REJECT ) - return CULL_TRIVIAL_REJECT; - return CULL_ACCEPT; -} - -void -Curvelist::getstepsize( void ) -{ - stepsize = range[2]; - Curve *c; - for( c = curve; c; c = c->next ) { - c->getstepsize(); - c->clamp(); - stepsize = ((c->stepsize < stepsize) ? c->stepsize : stepsize); - if( c->needsSamplingSubdivision() ) break; - } - needsSubdivision = ( c ) ? 1 : 0; -} - -int -Curvelist::needsSamplingSubdivision( void ) -{ - return needsSubdivision; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/curvelist.h b/src/libs/mesa/glu/libnurbs/internals/curvelist.h deleted file mode 100644 index 733a5115d0..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/curvelist.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * curvelist.h - * - */ - -#ifndef __glucurvelist_h_ -#define __glucurvelist_h_ - -#include "types.h" -#include "defines.h" - -class Mapdesc; -class Quilt; -class Curve; - -class Curvelist -{ -friend class Subdivider; -public: - Curvelist( Quilt *, REAL, REAL ); - Curvelist( Curvelist &, REAL ); - ~Curvelist( void ); - int cullCheck( void ); - void getstepsize( void ); - int needsSamplingSubdivision(); -private: - Curve *curve; - float range[3]; - int needsSubdivision; - float stepsize; -}; -#endif /* __glucurvelist_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/curvesub.cc b/src/libs/mesa/glu/libnurbs/internals/curvesub.cc deleted file mode 100644 index f85acc269a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/curvesub.cc +++ /dev/null @@ -1,103 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * curvesub.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "subdivider.h" -#include "renderhints.h" -#include "backend.h" -#include "quilt.h" -#include "curvelist.h" -#include "curve.h" -#include "nurbsconsts.h" - -/*-------------------------------------------------------------------------- - * drawCurves - main curve rendering entry point - *-------------------------------------------------------------------------- - */ - -void -Subdivider::drawCurves( void ) -{ - REAL from[1], to[1]; - Flist bpts; - qlist->getRange( from, to, bpts ); - - renderhints.init( ); - - backend.bgncurv(); - for( int i=bpts.start; idownloadAll( &pta, &ptb, backend ); - - Curvelist curvelist( qlist, pta, ptb ); - samplingSplit( curvelist, renderhints.maxsubdivisions ); - } - backend.endcurv(); -} - - -/*-------------------------------------------------------------------------- - * samplingSplit - recursively subdivide patch, cull check each subpatch - *-------------------------------------------------------------------------- - */ - -void -Subdivider::samplingSplit( Curvelist& curvelist, int subdivisions ) -{ - if( curvelist.cullCheck() == CULL_TRIVIAL_REJECT ) return; - - curvelist.getstepsize(); - - if( curvelist.needsSamplingSubdivision() && (subdivisions > 0) ) { - REAL mid = ( curvelist.range[0] + curvelist.range[1] ) * 0.5; - Curvelist lowerlist( curvelist, mid ); - samplingSplit( lowerlist, subdivisions-1 ); // lower - samplingSplit( curvelist, subdivisions-1 ); // upper - } else { - long nu = 1 + ((long) (curvelist.range[2] / curvelist.stepsize)); - backend.curvgrid( curvelist.range[0], curvelist.range[1], nu ); - backend.curvmesh( 0, nu ); - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/dataTransform.cc b/src/libs/mesa/glu/libnurbs/internals/dataTransform.cc deleted file mode 100644 index 55c0fbb159..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/dataTransform.cc +++ /dev/null @@ -1,209 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "glimports.h" -#include "myassert.h" -#include "nurbsconsts.h" -#include "trimvertex.h" -#include "dataTransform.h" - -extern directedLine* arcLoopToDLineLoop(Arc_ptr loop); - -#if 0 // UNUSED -static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, directedLine dline_buf[], sampledLine sline_buf[], int& index_dline) -{ - directedLine *ret; - int old_index = index; - int i = index; - int j; - for(j=0; jpwlArc->npts-1; j++, i++) - { - vertArray[i][0] = loop->pwlArc->pts[j].param[0]; - vertArray[i][1] = loop->pwlArc->pts[j].param[1]; - } - loop->clearmark(); - - for(Arc_ptr jarc = loop->next; jarc != loop; jarc=jarc->next) - { - for(j=0; jpwlArc->npts-1; j++, i++) - { - vertArray[i][0] = jarc->pwlArc->pts[j].param[0]; - vertArray[i][1] = jarc->pwlArc->pts[j].param[1]; - } - jarc->clearmark(); - } - //copy the first vertex again - vertArray[i][0] = loop->pwlArc->pts[0].param[0]; - vertArray[i][1] = loop->pwlArc->pts[0].param[1]; - i++; - index=i; - - directedLine* dline; - sampledLine* sline; - sline = &sline_buf[index_dline]; - dline = &dline_buf[index_dline]; - sline->init(2, &vertArray[old_index]); - dline->init(INCREASING, sline); - ret = dline; - index_dline++; - - for(i=old_index+1; i<= index-2; i++) - { - sline = &sline_buf[index_dline]; - dline = &dline_buf[index_dline]; - sline->init(2, &vertArray[i]); - dline->init(INCREASING, sline); - ret->insert(dline); - index_dline++; - } - return ret; -} -#endif - -#if 0 // UNUSED -static int num_edges(Bin& bin) -{ - int sum=0; - for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc()) - sum += jarc->pwlArc->npts-1; - return sum; -} -#endif - -/* -directedLine* bin_to_DLineLoops(Bin& bin) -{ - directedLine *ret=NULL; - directedLine *temp; - - int numedges = num_edges(bin); - directedLine* dline_buf = new directedLine[numedges]; //not work for N32? - sampledLine* sline_buf=new sampledLine[numedges]; - - Real2* vertArray = new Real2[numedges*2]; - int index = 0; - int index_dline = 0; - bin.markall(); - - for(Arc_ptr jarc = bin.firstarc(); jarc; jarc=bin.nextarc()) - { - if(jarc->ismarked()) - { - assert(jarc->check() != 0); - Arc_ptr jarchead = jarc; - do { - jarc->clearmark(); - jarc = jarc->next; - } while(jarc != jarchead); - temp=copy_loop(jarchead, vertArray, index, dline_buf, sline_buf, index_dline); - ret = temp->insertPolygon(ret); - } - } - - return ret; -} -*/ - - -directedLine* bin_to_DLineLoops(Bin& bin) -{ - directedLine *ret=NULL; - directedLine *temp; - bin.markall(); - for(Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc()){ - if(jarc->ismarked()) { - assert(jarc->check() != 0); - Arc_ptr jarchead = jarc; - do { - jarc->clearmark(); - jarc = jarc->next; - } while(jarc != jarchead); - temp = arcLoopToDLineLoop(jarc); - ret = temp->insertPolygon(ret); - } - } - return ret; -} - -directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl) -{ - directedLine* ret = original; - for(Int i=0; inpts-1; i++) - { - sampledLine* sline = new sampledLine(2); - sline->setPoint(0, pwl->pts[i].param); - sline->setPoint(1, pwl->pts[i+1].param); - directedLine* dline = new directedLine(INCREASING, sline); - if(ret == NULL) - ret = dline; - else - ret->insert(dline); - } - return ret; -} - -directedLine* o_curve_to_DLineLoop(O_curve* cur) -{ - directedLine *ret; - if(cur == NULL) - return NULL; - assert(cur->curvetype == ct_pwlcurve); - ret = o_pwlcurve_to_DLines(NULL, cur->curve.o_pwlcurve); - for(O_curve* temp = cur->next; temp != NULL; temp = temp->next) - { - assert(temp->curvetype == ct_pwlcurve); - ret = o_pwlcurve_to_DLines(ret, temp->curve.o_pwlcurve); - } - return ret; -} - -directedLine* o_trim_to_DLineLoops(O_trim* trim) -{ - O_trim* temp; - directedLine *ret; - if(trim == NULL) - return NULL; - ret = o_curve_to_DLineLoop(trim->o_curve); - - for(temp=trim->next; temp != NULL; temp = temp->next) - { - ret = ret->insertPolygon(o_curve_to_DLineLoop(temp->o_curve)); - } - return ret; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/dataTransform.h b/src/libs/mesa/glu/libnurbs/internals/dataTransform.h deleted file mode 100644 index 7898df754d..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/dataTransform.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _DATA_TRANSFORM_H -#define _DATA_TRANSFORM_H - -#include "reader.h" -#include "directedLine.h" -#include "bin.h" -directedLine* bin_to_DLineLoops(Bin& bin); - -/*transform the pwlcurve into a number of directedline lines - *insert these directedlines into orignal which is supposed to be - *the part of the trimming loop obtained so far. - *return the updated trimkming loop. - */ -directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl); - -/*transform a trim loop (curve) into a directedLine loop - */ -directedLine* o_curve_to_DLineLoop(O_curve* curve); - -/*transform a list of trim loops (trim) into - *a list of polygons represented as directedLine*. - */ -directedLine* o_trim_to_DLineLoops(O_trim* trim); - - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/internals/defines.h b/src/libs/mesa/glu/libnurbs/internals/defines.h deleted file mode 100644 index 32950d613b..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/defines.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * defines.h - * - */ - -#ifndef __gludefines_h_ -#define __gludefines_h_ - -/* culling constants */ -#define CULL_TRIVIAL_REJECT 0 -#define CULL_TRIVIAL_ACCEPT 1 -#define CULL_ACCEPT 2 - -/* maximum order of a B-Spline */ -#define MAXORDER 24 - -/* maximum dimension of any B-spline range space */ -#define MAXCOORDS 5 - -#endif /* __gludefines_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/displaylist.cc b/src/libs/mesa/glu/libnurbs/internals/displaylist.cc deleted file mode 100644 index 48593c6371..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/displaylist.cc +++ /dev/null @@ -1,82 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * displaylist.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "nurbstess.h" -#include "displaylist.h" - - -DisplayList::DisplayList( NurbsTessellator *_nt ) : - dlnodePool( sizeof( Dlnode ), 1, "dlnodepool" ) -{ - lastNode = &nodes; - nt = _nt; -} - -DisplayList::~DisplayList( void ) -{ - for( Dlnode *nextNode; nodes; nodes = nextNode ) { - nextNode = nodes->next; - if( nodes->cleanup != 0 ) (nt->*nodes->cleanup)( nodes->arg ); - //nodes->deleteMe(dlnodePool); - } -} - -void -DisplayList::play( void ) -{ - for( Dlnode *node = nodes; node; node = node->next ) - if( node->work != 0 ) (nt->*node->work)( node->arg ); -} - -void -DisplayList::endList( void ) -{ - *lastNode = 0; -} - -void -DisplayList::append( PFVS work, void *arg, PFVS cleanup ) -{ - Dlnode *node = new(dlnodePool) Dlnode( work, arg, cleanup ); - *lastNode = node; - lastNode = &(node->next); -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/displaylist.h b/src/libs/mesa/glu/libnurbs/internals/displaylist.h deleted file mode 100644 index 22cbec3787..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/displaylist.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * displaylist.h - * - */ - -#ifndef __gludisplaylist_h_ -#define __gludisplaylist_h_ - -#include "glimports.h" -#include "mysetjmp.h" -#include "mystdio.h" -#include "bufpool.h" - -class NurbsTessellator; - -typedef void (NurbsTessellator::*PFVS)( void * ); - -struct Dlnode : public PooledObj { - Dlnode( PFVS, void *, PFVS ); - PFVS work; - void * arg; - PFVS cleanup; - Dlnode * next; -}; - -inline -Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) -{ - work = _work; - arg = _arg; - cleanup = _cleanup; -} - -class DisplayList { -public: - DisplayList( NurbsTessellator * ); - ~DisplayList( void ); - void play( void ); - void append( PFVS work, void *arg, PFVS cleanup ); - void endList( void ); -private: - Dlnode *nodes; - Pool dlnodePool; - Dlnode **lastNode; - NurbsTessellator *nt; -}; - -#endif /* __gludisplaylist_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/displaymode.h b/src/libs/mesa/glu/libnurbs/internals/displaymode.h deleted file mode 100644 index 53968b2f1c..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/displaymode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef __gludisplaymode_h_ -#define __gludisplaymode_h_ - -#define N_MESHFILL 0 -#define N_MESHLINE 1 -#define N_MESHPOINT 2 - -#endif /* __gludisplaymode_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/flist.cc b/src/libs/mesa/glu/libnurbs/internals/flist.cc deleted file mode 100644 index d3162b9f5f..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/flist.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * flist.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "flist.h" - -/*---------------------------------------------------------------------------- - * Flist::Flist - initialize a REAL number array - *---------------------------------------------------------------------------- - */ -Flist::Flist( void ) -{ - npts = 0; - pts = 0; - start = end = 0; -} - -/*---------------------------------------------------------------------------- - * Flist::~Flist - free a REAL number array - *---------------------------------------------------------------------------- - */ -Flist::~Flist( void ) -{ - if( npts ) delete[] pts; -} - -void -Flist::add( REAL x ) -{ - pts[end++] = x; - assert( end <= npts ); -} - -/*---------------------------------------------------------------------------- - * Flist::filter - remove duplicate numbers from array - *---------------------------------------------------------------------------- - */ -void Flist::filter( void ) -{ - sorter.qsort( pts, end ); - start = 0; - - int j = 0; - for( int i = 1; i < end; i++ ) { - if( pts[i] == pts[i-j-1] ) - j++; - pts[i-j] = pts[i]; - } - end -= j; -} - -/*---------------------------------------------------------------------------- - * Flist::grow - ensure that array is large enough - *---------------------------------------------------------------------------- - */ -void Flist::grow( int maxpts ) -{ - if( npts < maxpts ) { - if( npts ) delete[] pts; - npts = 2 * maxpts; - pts = new REAL[npts]; - assert( pts != 0 ); - } - start = end = 0; -} - -/*---------------------------------------------------------------------------- - * Flist::taper - ignore head and tail of array - *---------------------------------------------------------------------------- - */ -void Flist::taper( REAL from, REAL to ) -{ - while( pts[start] != from ) - start++; - - while( pts[end-1] != to ) - end--; -} - - diff --git a/src/libs/mesa/glu/libnurbs/internals/flist.h b/src/libs/mesa/glu/libnurbs/internals/flist.h deleted file mode 100644 index 014273ebe5..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/flist.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * flist.h - * - */ - -#ifndef __gluflist_h_ -#define __gluflist_h_ - -#include "types.h" -#include "flistsorter.h" - -class Flist { -public: - REAL * pts; /* head of array */ - int npts; /* number of points in array */ - int start; /* first important point index */ - int end; /* last important point index */ - - Flist( void ); - ~Flist( void ); - void add( REAL x ); - void filter( void ); - void grow( int); - void taper( REAL , REAL ); -protected: - FlistSorter sorter; -}; - -#endif /* __gluflist_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/flistsorter.cc b/src/libs/mesa/glu/libnurbs/internals/flistsorter.cc deleted file mode 100644 index d49bdea3e0..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/flistsorter.cc +++ /dev/null @@ -1,81 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * flistsorter.c++ - * - */ - -#include "glimports.h" -#include "flistsorter.h" - -FlistSorter::FlistSorter( void ) : Sorter( sizeof( REAL ) ) -{ -} - -void -FlistSorter::qsort( REAL *p, int n ) -{ - Sorter::qsort( (char *)p, n ); -} - -int -FlistSorter::qscmp( char *i, char *j ) -{ - REAL f0 = *(REAL *)i; - REAL f1 = *(REAL *)j; - return (f0 < f1) ? -1 : 1; -} - -void -FlistSorter::qsexc( char *i, char *j ) -{ - REAL *f0 = (REAL *)i; - REAL *f1 = (REAL *)j; - REAL tmp = *f0; - *f0 = *f1; - *f1 = tmp; -} - -void -FlistSorter::qstexc( char *i, char *j, char *k ) -{ - REAL *f0 = (REAL *)i; - REAL *f1 = (REAL *)j; - REAL *f2 = (REAL *)k; - REAL tmp = *f0; - *f0 = *f2; - *f2 = *f1; - *f1 = tmp; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/flistsorter.h b/src/libs/mesa/glu/libnurbs/internals/flistsorter.h deleted file mode 100644 index 65e6a572e3..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/flistsorter.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * flistsorter.h - * - */ - -#ifndef __gluflistsorter_h_ -#define __gluflistsorter_h_ - -#include "sorter.h" -#include "types.h" - -class FlistSorter : public Sorter { -public: - FlistSorter(void); - virtual ~FlistSorter() { /* silence warning*/ } - void qsort( REAL *a, int n ); - -protected: - virtual int qscmp( char *, char * ); - virtual void qsexc( char *i, char *j ); // i<-j, j<-i - virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i -}; -#endif /* __gluflistsorter_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/gridline.h b/src/libs/mesa/glu/libnurbs/internals/gridline.h deleted file mode 100644 index 1a92e3b13b..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/gridline.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * gridline.h - * - */ - -#ifndef __glugridline_h_ -#define __glugridline_h_ - -struct Gridline { - long v; - REAL vval; - long vindex; - long ustart; - long uend; - }; -#endif /* __glugridline_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/gridtrimvertex.h b/src/libs/mesa/glu/libnurbs/internals/gridtrimvertex.h deleted file mode 100644 index 707f649d20..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/gridtrimvertex.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * gridtrimvertex.h - * - */ - -#ifndef __glugridtrimvertex_h_ -#define __glugridtrimvertex_h_ - -#include "mystdlib.h" -#include "bufpool.h" -#include "trimvertex.h" -#include "gridvertex.h" - -class GridTrimVertex : public PooledObj -{ -private: - TrimVertex dummyt; - GridVertex dummyg; -public: - GridTrimVertex() { g = 0; t = 0; } - TrimVertex *t; - GridVertex *g; - - inline void set( long, long ); - inline void set( REAL, REAL ); - inline void set( TrimVertex * ); - inline void clear( void ) { t = 0; g = 0; }; - inline int isGridVert() { return g ? 1 : 0 ; } - inline int isTrimVert() { return t ? 1 : 0 ; } - inline void output(); -}; - -inline void -GridTrimVertex::set( long x, long y ) -{ - g = &dummyg; - dummyg.gparam[0] = x; - dummyg.gparam[1] = y; -} - -inline void -GridTrimVertex::set( REAL x, REAL y ) -{ - g = 0; - t = &dummyt; - dummyt.param[0] = x; - dummyt.param[1] = y; - dummyt.nuid = 0; -} - -inline void -GridTrimVertex::set( TrimVertex *v ) -{ - g = 0; - t = v; -} - -typedef GridTrimVertex *GridTrimVertex_p; -#endif /* __glugridtrimvertex_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/gridvertex.h b/src/libs/mesa/glu/libnurbs/internals/gridvertex.h deleted file mode 100644 index 36a65c7bdd..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/gridvertex.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * gridvertex.h - * - */ - -#ifndef __glugridvertex_h_ -#define __glugridvertex_h_ - -struct GridVertex { - long gparam[2]; - GridVertex( void ) {} - GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; } - void set( long u, long v ) { gparam[0] = u, gparam[1] = v; } - long nextu() { return gparam[0]++; } - long prevu() { return gparam[0]--; } -}; - -#endif /* __glugridvertex_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/hull.cc b/src/libs/mesa/glu/libnurbs/internals/hull.cc deleted file mode 100644 index 389ba66fb8..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/hull.cc +++ /dev/null @@ -1,165 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * hull.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "hull.h" -#include "gridvertex.h" -#include "gridtrimvertex.h" -#include "gridline.h" -#include "trimline.h" -#include "uarray.h" -#include "trimregion.h" - -Hull::Hull( void ) -{} - -Hull::~Hull( void ) -{} - -/*---------------------------------------------------------------------- - * Hull:init - this routine does the initialization needed before any - * calls to nextupper or nextlower can be made. - *---------------------------------------------------------------------- - */ -void -Hull::init( void ) -{ - TrimVertex *lfirst = left.first(); - TrimVertex *llast = left.last(); - if( lfirst->param[0] <= llast->param[0] ) { - fakeleft.init( left.first() ); - upper.left = &fakeleft; - lower.left = &left; - } else { - fakeleft.init( left.last() ); - lower.left = &fakeleft; - upper.left = &left; - } - upper.left->last(); - lower.left->first(); - - if( top.ustart <= top.uend ) { - upper.line = ⊤ - upper.index = top.ustart; - } else - upper.line = 0; - - if( bot.ustart <= bot.uend ) { - lower.line = ⊥ - lower.index = bot.ustart; - } else - lower.line = 0; - - TrimVertex *rfirst = right.first(); - TrimVertex *rlast = right.last(); - if( rfirst->param[0] <= rlast->param[0] ) { - fakeright.init( right.last() ); - lower.right = &fakeright; - upper.right = &right; - } else { - fakeright.init( right.first() ); - upper.right = &fakeright; - lower.right = &right; - } - upper.right->first(); - lower.right->last(); -} - -/*---------------------------------------------------------------------- - * nextupper - find next vertex on upper hull of trim region. - * - if vertex is on trim curve, set vtop point to - * that vertex. if vertex is on grid, set vtop to - * point to temporary area and stuff coordinants into - * temporary vertex. Also, place grid coords in temporary - * grid vertex. - *---------------------------------------------------------------------- - */ -GridTrimVertex * -Hull::nextupper( GridTrimVertex *gv ) -{ - if( upper.left ) { - gv->set( upper.left->prev() ); - if( gv->isTrimVert() ) return gv; - upper.left = 0; - } - - if( upper.line ) { - assert( upper.index <= upper.line->uend ); - gv->set( uarray.uarray[upper.index], upper.line->vval ); - gv->set( upper.index, upper.line->vindex ); - if( upper.index++ == upper.line->uend ) upper.line = 0; - return gv; - } - - if( upper.right ) { - gv->set( upper.right->next() ); - if( gv->isTrimVert() ) return gv; - upper.right = 0; - } - - return 0; -} - -GridTrimVertex * -Hull::nextlower( register GridTrimVertex *gv ) -{ - if( lower.left ) { - gv->set( lower.left->next() ); - if( gv->isTrimVert() ) return gv; - lower.left = 0; - } - - if( lower.line ) { - gv->set( uarray.uarray[lower.index], lower.line->vval ); - gv->set( lower.index, lower.line->vindex ); - if( lower.index++ == lower.line->uend ) lower.line = 0; - return gv; - } - - if( lower.right ) { - gv->set( lower.right->prev() ); - if( gv->isTrimVert() ) return gv; - lower.right = 0; - } - - return 0; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/hull.h b/src/libs/mesa/glu/libnurbs/internals/hull.h deleted file mode 100644 index dfe865267f..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/hull.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * hull.h - * - */ - -#ifndef __gluhull_h_ -#define __gluhull_h_ - -#include "trimline.h" -#include "trimregion.h" -#include "trimvertex.h" -#include "gridtrimvertex.h" - -struct Gridline; -class Uarray; - -class Hull : virtual public TrimRegion { -public: - Hull( void ); - ~Hull( void ); - void init( void ); - GridTrimVertex * nextlower( GridTrimVertex * ); - GridTrimVertex * nextupper( GridTrimVertex * ); -private: - struct Side { - Trimline *left; - Gridline *line; - Trimline *right; - long index; - }; - - Side lower; - Side upper; - Trimline fakeleft; - Trimline fakeright; -}; - - -#endif /* __gluhull_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/intersect.cc b/src/libs/mesa/glu/libnurbs/internals/intersect.cc deleted file mode 100644 index b39ea2121e..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/intersect.cc +++ /dev/null @@ -1,665 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * intersect.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "subdivider.h" -#include "arc.h" -#include "bin.h" -#include "backend.h" -#include "trimvertpool.h" - -/*#define NOTDEF*/ - -enum i_result { INTERSECT_VERTEX, INTERSECT_EDGE }; - -/* local functions */ -#ifndef NDEBUG // for asserts only -static int arc_classify( Arc_ptr, int, REAL ); -#endif -static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] ); - - -void -Subdivider::partition( Bin & bin, Bin & left, Bin & intersections, - Bin & right, Bin & unknown, int param, REAL value ) -{ - Bin headonleft, headonright, tailonleft, tailonright; - - for( Arc_ptr jarc = bin.removearc(); jarc; jarc = bin.removearc() ) { - - REAL tdiff = jarc->tail()[param] - value; - REAL hdiff = jarc->head()[param] - value; - - if( tdiff > 0.0 ) { - if( hdiff > 0.0 ) { - right.addarc( jarc ); - } else if( hdiff == 0.0 ) { - tailonright.addarc( jarc ); - } else { - Arc_ptr jtemp; - switch( arc_split(jarc, param, value, 0) ) { - case 2: - tailonright.addarc( jarc ); - headonleft.addarc( jarc->next ); - break; - case 31: - assert( jarc->head()[param] > value ); - right.addarc( jarc ); - tailonright.addarc( jtemp = jarc->next ); - headonleft.addarc( jtemp->next ); - break; - case 32: - assert( jarc->head()[param] <= value ); - tailonright .addarc( jarc ); - headonleft.addarc( jtemp = jarc->next ); - left.addarc( jtemp->next ); - break; - case 4: - right.addarc( jarc ); - tailonright.addarc( jtemp = jarc->next ); - headonleft.addarc( jtemp = jtemp->next ); - left.addarc( jtemp->next ); - } - } - } else if( tdiff == 0.0 ) { - if( hdiff > 0.0 ) { - headonright.addarc( jarc ); - } else if( hdiff == 0.0 ) { - unknown.addarc( jarc ); - } else { - headonleft.addarc( jarc ); - } - } else { - if( hdiff > 0.0 ) { - Arc_ptr jtemp; - switch( arc_split(jarc, param, value, 1) ) { - case 2: - tailonleft.addarc( jarc ); - headonright.addarc( jarc->next ); - break; - case 31: - assert( jarc->head()[param] < value ); - left.addarc( jarc ); - tailonleft.addarc( jtemp = jarc->next ); - headonright.addarc( jtemp->next ); - break; - case 32: - assert( jarc->head()[param] >= value ); - tailonleft.addarc( jarc ); - headonright.addarc( jtemp = jarc->next ); - right.addarc( jtemp->next ); - break; - case 4: - left.addarc( jarc ); - tailonleft.addarc( jtemp = jarc->next ); - headonright.addarc( jtemp = jtemp->next ); - right.addarc( jtemp->next ); - } - } else if( hdiff == 0.0 ) { - tailonleft.addarc( jarc ); - } else { - left.addarc( jarc ); - } - } - } - if( param == 0 ) { - classify_headonleft_s( headonleft, intersections, left, value ); - classify_tailonleft_s( tailonleft, intersections, left, value ); - classify_headonright_s( headonright, intersections, right, value ); - classify_tailonright_s( tailonright, intersections, right, value ); - } else { - classify_headonleft_t( headonleft, intersections, left, value ); - classify_tailonleft_t( tailonleft, intersections, left, value ); - classify_headonright_t( headonright, intersections, right, value ); - classify_tailonright_t( tailonright, intersections, right, value ); - } -} - -inline static void -vert_interp( TrimVertex *n, TrimVertex *l, TrimVertex *r, int p, REAL val ) -{ - assert( val > l->param[p]); - assert( val < r->param[p]); - - n->nuid = l->nuid; - - n->param[p] = val; - if( l->param[1-p] != r->param[1-p] ) { - REAL ratio = (val - l->param[p]) / (r->param[p] - l->param[p]); - n->param[1-p] = l->param[1-p] + - ratio * (r->param[1-p] - l->param[1-p]); - } else { - n->param[1-p] = l->param[1-p]; - } -} - -int -Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) -{ - int maxvertex = jarc->pwlArc->npts; - Arc_ptr jarc1; - TrimVertex* v = jarc->pwlArc->pts; - - int loc[3]; - switch( pwlarc_intersect( jarc->pwlArc, param, value, dir, loc ) ) { - - // When the parameter value lands on a vertex, life is sweet - case INTERSECT_VERTEX: { - jarc1 = new(arcpool) Arc( jarc, new( pwlarcpool) PwlArc( maxvertex-loc[1], &v[loc[1]] ) ); - jarc->pwlArc->npts = loc[1] + 1; - jarc1->next = jarc->next; - jarc1->next->prev = jarc1; - jarc->next = jarc1; - jarc1->prev = jarc; - assert(jarc->check() != 0); - return 2; - } - - // When the parameter value intersects an edge, we have to - // interpolate a new vertex. There are special cases - // if the new vertex is adjacent to one or both of the - // endpoints of the arc. - case INTERSECT_EDGE: { - int i, j; - if( dir == 0 ) { - i = loc[0]; - j = loc[2]; - } else { - i = loc[2]; - j = loc[0]; - } - -#ifndef NOTDEF - // The split is between vertices at index j and i, in that - // order (j < i) - - // JEB: This code is my idea of how to do the split without - // increasing the number of links. I'm doing this so that - // the is_rect routine can recognize rectangles created by - // subdivision. In exchange for simplifying the curve list, - // however, it costs in allocated space and vertex copies. - - TrimVertex *newjunk = trimvertexpool.get(maxvertex -i+1 /*-j*/); - int k; - for(k=0; knuid; - } - - TrimVertex *vcopy = trimvertexpool.get(maxvertex); - for(k=0; kpwlArc->pts=vcopy; - - v[i].nuid = jarc->nuid; - v[j].nuid = jarc->nuid; - vert_interp( &newjunk[0], &v[loc[0]], &v[loc[2]], param, value ); - - if( showingDegenerate() ) - backend.triangle( &v[i], &newjunk[0], &v[j] ); - - vcopy[j+1].param[0]=newjunk[0].param[0]; - vcopy[j+1].param[1]=newjunk[0].param[1]; - - - jarc1 = new(arcpool) Arc( jarc, - new(pwlarcpool) PwlArc(maxvertex-i+1 , newjunk ) ); - - jarc->pwlArc->npts = j+2; - jarc1->next = jarc->next; - jarc1->next->prev = jarc1; - jarc->next = jarc1; - jarc1->prev = jarc; - assert(jarc->check() != 0); - - return 2; -#endif //not NOTDEF - // JEB: This is the original version: -#ifdef NOTDEF - Arc_ptr jarc2, jarc3; - - TrimVertex *newjunk = trimvertexpool.get(3); - v[i].nuid = jarc->nuid; - v[j].nuid = jarc->nuid; - newjunk[0] = v[j]; - newjunk[2] = v[i]; - vert_interp( &newjunk[1], &v[loc[0]], &v[loc[2]], param, value ); - - if( showingDegenerate() ) - backend.triangle( &newjunk[2], &newjunk[1], &newjunk[0] ); - - // New vertex adjacent to both endpoints - if (maxvertex == 2) { - jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); - jarc->pwlArc->npts = 2; - jarc->pwlArc->pts = newjunk; - jarc1->next = jarc->next; - jarc1->next->prev = jarc1; - jarc->next = jarc1; - jarc1->prev = jarc; - assert(jarc->check() != 0); - - return 2; - - // New vertex adjacent to ending point of arc - } else if (maxvertex - j == 2) { - jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) ); - jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); - jarc->pwlArc->npts = maxvertex-1; - jarc2->next = jarc->next; - jarc2->next->prev = jarc2; - jarc->next = jarc1; - jarc1->prev = jarc; - jarc1->next = jarc2; - jarc2->prev = jarc1; - assert(jarc->check() != 0); - return 31; - - // New vertex adjacent to starting point of arc - } else if (i == 1) { - jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); - jarc2 = new(arcpool) Arc( jarc, - new(pwlarcpool) PwlArc( maxvertex-1, &jarc->pwlArc->pts[1] ) ); - jarc->pwlArc->npts = 2; - jarc->pwlArc->pts = newjunk; - jarc2->next = jarc->next; - jarc2->next->prev = jarc2; - jarc->next = jarc1; - jarc1->prev = jarc; - jarc1->next = jarc2; - jarc2->prev = jarc1; - assert(jarc->check() != 0); - return 32; - - // It's somewhere in the middle - } else { - jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk ) ); - jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); - jarc3 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( maxvertex-i, v+i ) ); - jarc->pwlArc->npts = j + 1; - jarc3->next = jarc->next; - jarc3->next->prev = jarc3; - jarc->next = jarc1; - jarc1->prev = jarc; - jarc1->next = jarc2; - jarc2->prev = jarc1; - jarc2->next = jarc3; - jarc3->prev = jarc2; - assert(jarc->check() != 0); - return 4; - } -#endif // NOTDEF - } - default: - return -1; //picked -1 since it's not used - } -} - -/*---------------------------------------------------------------------------- - * pwlarc_intersect - find intersection of pwlArc and isoparametric line - *---------------------------------------------------------------------------- - */ - -static enum i_result -pwlarc_intersect( - PwlArc *pwlArc, - int param, - REAL value, - int dir, - int loc[3] ) -{ - assert( pwlArc->npts > 0 ); - - if( dir ) { - TrimVertex *v = pwlArc->pts; - int imin = 0; - int imax = pwlArc->npts - 1; - assert( value > v[imin].param[param] ); - assert( value < v[imax].param[param] ); - while( (imax - imin) > 1 ) { - int imid = (imax + imin)/2; - if( v[imid].param[param] > value ) - imax = imid; - else if( v[imid].param[param] < value ) - imin = imid; - else { - loc[1] = imid; - return INTERSECT_VERTEX; - } - } - loc[0] = imin; - loc[2] = imax; - return INTERSECT_EDGE; - } else { - TrimVertex *v = pwlArc->pts; - int imax = 0; - int imin = pwlArc->npts - 1; - assert( value > v[imin].param[param] ); - assert( value < v[imax].param[param] ); - while( (imin - imax) > 1 ) { - int imid = (imax + imin)/2; - if( v[imid].param[param] > value ) - imax = imid; - else if( v[imid].param[param] < value ) - imin = imid; - else { - loc[1] = imid; - return INTERSECT_VERTEX; - } - } - loc[0] = imin; - loc[2] = imax; - return INTERSECT_EDGE; - } -} - -/*---------------------------------------------------------------------------- - * arc_classify - determine which side of a line a jarc lies - *---------------------------------------------------------------------------- - */ - -#ifndef NDEBUG // for asserts only -static int -arc_classify( Arc_ptr jarc, int param, REAL value ) -{ - REAL tdiff, hdiff; - if( param == 0 ) { - tdiff = jarc->tail()[0] - value; - hdiff = jarc->head()[0] - value; - } else { - tdiff = jarc->tail()[1] - value; - hdiff = jarc->head()[1] - value; - } - - if( tdiff > 0.0 ) { - if( hdiff > 0.0 ) { - return 0x11; - } else if( hdiff == 0.0 ) { - return 0x12; - } else { - return 0x10; - } - } else if( tdiff == 0.0 ) { - if( hdiff > 0.0 ) { - return 0x21; - } else if( hdiff == 0.0 ) { - return 0x22; - } else { - return 0x20; - } - } else { - if( hdiff > 0.0 ) { - return 0x01; - } else if( hdiff == 0.0 ) { - return 0x02; - } else { - return 0; - } - } -} -#endif - -void -Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail at left, head on line */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 0, val ) == 0x02 ); - j->clearitail(); - - REAL diff = j->next->head()[0] - val; - if( diff > 0.0 ) { - in.addarc( j ); - } else if( diff < 0.0 ) { - if( ccwTurn_sl( j, j->next ) ) - out.addarc( j ); - else - in.addarc( j ); - } else { - if( j->next->tail()[1] > j->next->head()[1] ) - in.addarc(j); - else - out.addarc(j); - } - } -} - -void -Subdivider::classify_tailonleft_t( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail at left, head on line */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 1, val ) == 0x02 ); - j->clearitail(); - - REAL diff = j->next->head()[1] - val; - if( diff > 0.0 ) { - in.addarc( j ); - } else if( diff < 0.0 ) { - if( ccwTurn_tl( j, j->next ) ) - out.addarc( j ); - else - in.addarc( j ); - } else { - if (j->next->tail()[0] > j->next->head()[0] ) - out.addarc( j ); - else - in.addarc( j ); - } - } -} - -void -Subdivider::classify_headonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail on line, head at left */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 0, val ) == 0x20 ); - - j->setitail(); - - REAL diff = j->prev->tail()[0] - val; - if( diff > 0.0 ) { - out.addarc( j ); - } else if( diff < 0.0 ) { - if( ccwTurn_sl( j->prev, j ) ) - out.addarc( j ); - else - in.addarc( j ); - } else { - if( j->prev->tail()[1] > j->prev->head()[1] ) - in.addarc( j ); - else - out.addarc( j ); - } - } -} - -void -Subdivider::classify_headonleft_t( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail on line, head at left */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 1, val ) == 0x20 ); - j->setitail(); - - REAL diff = j->prev->tail()[1] - val; - if( diff > 0.0 ) { - out.addarc( j ); - } else if( diff < 0.0 ) { - if( ccwTurn_tl( j->prev, j ) ) - out.addarc( j ); - else - in.addarc( j ); - } else { - if( j->prev->tail()[0] > j->prev->head()[0] ) - out.addarc( j ); - else - in.addarc( j ); - } - } -} - - -void -Subdivider::classify_tailonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail at right, head on line */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 0, val ) == 0x12); - - j->clearitail(); - - REAL diff = j->next->head()[0] - val; - if( diff > 0.0 ) { - if( ccwTurn_sr( j, j->next ) ) - out.addarc( j ); - else - in.addarc( j ); - } else if( diff < 0.0 ) { - in.addarc( j ); - } else { - if( j->next->tail()[1] > j->next->head()[1] ) - out.addarc( j ); - else - in.addarc( j ); - } - } -} - -void -Subdivider::classify_tailonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail at right, head on line */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 1, val ) == 0x12); - - j->clearitail(); - - REAL diff = j->next->head()[1] - val; - if( diff > 0.0 ) { - if( ccwTurn_tr( j, j->next ) ) - out.addarc( j ); - else - in.addarc( j ); - } else if( diff < 0.0 ) { - in.addarc( j ); - } else { - if( j->next->tail()[0] > j->next->head()[0] ) - in.addarc( j ); - else - out.addarc( j ); - } - } -} - -void -Subdivider::classify_headonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail on line, head at right */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 0, val ) == 0x21 ); - - j->setitail(); - - REAL diff = j->prev->tail()[0] - val; - if( diff > 0.0 ) { - if( ccwTurn_sr( j->prev, j ) ) - out.addarc( j ); - else - in.addarc( j ); - } else if( diff < 0.0 ) { - out.addarc( j ); - } else { - if( j->prev->tail()[1] > j->prev->head()[1] ) - out.addarc( j ); - else - in.addarc( j ); - } - } -} - -void -Subdivider::classify_headonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) -{ - /* tail on line, head at right */ - Arc_ptr j; - - while( (j = bin.removearc()) != NULL ) { - assert( arc_classify( j, 1, val ) == 0x21 ); - - j->setitail(); - - REAL diff = j->prev->tail()[1] - val; - if( diff > 0.0 ) { - if( ccwTurn_tr( j->prev, j ) ) - out.addarc( j ); - else - in.addarc( j ); - } else if( diff < 0.0 ) { - out.addarc( j ); - } else { - if( j->prev->tail()[0] > j->prev->head()[0] ) - in.addarc( j ); - else - out.addarc( j ); - } - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/jarcloc.h b/src/libs/mesa/glu/libnurbs/internals/jarcloc.h deleted file mode 100644 index 5297036fa5..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/jarcloc.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * jarcloc.h - * - */ - -#ifndef __glujarcloc_h_ -#define __glujarcloc_h_ - -#include "arc.h" - -class Jarcloc { -private: - Arc_ptr arc; - TrimVertex *p; - TrimVertex *plast; -public: - inline void init( Arc_ptr a, long first, long last ) { arc = a; p=&a->pwlArc->pts[first]; plast = &a->pwlArc->pts[last]; } - inline TrimVertex * getnextpt( void ); - inline TrimVertex * getprevpt( void ); - inline void reverse(); -}; - -inline void -Jarcloc::reverse() -{ - if( plast == &arc->pwlArc->pts[0] ) - plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; - else - plast = &arc->pwlArc->pts[0]; -} - -inline TrimVertex * -Jarcloc::getnextpt() -{ - assert( p <= plast ); - if( p == plast ) { - arc = arc->next; - p = &arc->pwlArc->pts[0]; - plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; - assert( p < plast ); - } - return p++; -} - -inline TrimVertex * -Jarcloc::getprevpt() -{ - assert( p >= plast ); - if( p == plast ) { - arc = arc->prev; - p = &arc->pwlArc->pts[arc->pwlArc->npts - 1]; - plast = &arc->pwlArc->pts[0]; - assert( p > plast ); - } - return p--; -} -#endif /* __glujarcloc_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/knotvector.cc b/src/libs/mesa/glu/libnurbs/internals/knotvector.cc deleted file mode 100644 index 9eb5cbace9..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/knotvector.cc +++ /dev/null @@ -1,139 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * knotvector.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "knotvector.h" -#include "defines.h" - -#ifdef __WATCOMC__ -#pragma warning 726 10 -#endif - -void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knotlist ) -{ - knotcount = _knotcount; - stride = _stride; - order = _order; - knotlist = new Knot[_knotcount]; - assert( knotlist != 0 ); - - for( int i = 0; i != _knotcount; i++ ) - knotlist[i] = (Knot) _knotlist[i]; -} - -Knotvector::Knotvector( void ) -{ - knotlist = 0; -} - -Knotvector::~Knotvector( void ) -{ - if( knotlist ) delete[] knotlist; -} - -int Knotvector::validate( void ) -{ - /* kindex is used as an array index so subtract one first, - * this propagates throughout the code so study carefully */ - long kindex = knotcount-1; - - if( order < 1 || order > MAXORDER ) { - // spline order un-supported - return( 1 ); - } - - if( knotcount < (2 * order) ) { - // too few knots - return( 2 ); - } - - if( identical( knotlist[kindex-(order-1)], knotlist[order-1]) ) { - // valid knot range is empty - return( 3 ); - } - - for( long i = 0; i < kindex; i++) - if( knotlist[i] > knotlist[i+1] ) { - // decreasing knot sequence - return( 4 ); - } - - /* check for valid multiplicity */ - - /* kindex is currently the index of the last knot. - * In the next loop it is decremented to ignore the last knot - * and the loop stops when kindex is 2 so as to ignore the first - * knot as well. These knots are not used in computing - * knot multiplicities. - */ - - long multi = 1; - for( ; kindex >= 1; kindex-- ) { - if( knotlist[kindex] - knotlist[kindex-1] < TOLERANCE ) { - multi++; - continue; - } - if ( multi > order ) { - // knot multiplicity greater than order of spline - return( 5 ); - } - multi = 1; - } - - if ( multi > order ) { - // knot multiplicity greater than order of spline - return( 5 ); - } - - return 0; -} - -void Knotvector::show( const char *msg ) -{ -#ifndef NDEBUG - _glu_dprintf( "%s\n", msg ); - _glu_dprintf( "order = %ld, count = %ld\n", order, knotcount ); - - for( int i=0; i -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "mystring.h" -#include "mymath.h" -#include "backend.h" -#include "nurbsconsts.h" -#include "mapdesc.h" - -Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) - : backend( b ) -{ - type = _type; - isrational = _israt; - ncoords = _ncoords; - hcoords = _ncoords + (_israt ? 0 : 1 ); - inhcoords = _ncoords - (_israt ? 1 : 0 ); - mask = ((1<<(inhcoords*2))-1); - next = 0; - - assert( hcoords <= MAXCOORDS ); - assert( inhcoords >= 1 ); - - pixel_tolerance = 1.0; - error_tolerance = 1.0; - bbox_subdividing = N_NOBBOXSUBDIVISION; - culling_method = N_NOCULLING; - sampling_method = N_NOSAMPLING; - clampfactor = N_NOCLAMPING; - minsavings = N_NOSAVINGSSUBDIVISION; - s_steps = 0.0; - t_steps = 0.0; - maxrate = ( s_steps < 0.0 ) ? 0.0 : s_steps; - maxsrate = ( s_steps < 0.0 ) ? 0.0 : s_steps; - maxtrate = ( t_steps < 0.0 ) ? 0.0 : t_steps; - identify( bmat ); - identify( cmat ); - identify( smat ); - for( int i = 0; i != inhcoords; i++ ) - bboxsize[i] = 1.0; -} - -void -Mapdesc::setBboxsize( INREAL *mat ) -{ - for( int i = 0; i != inhcoords; i++ ) - bboxsize[i] = (REAL) mat[i]; -} - -void -Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] ) -{ - memset( dest, 0, sizeof( dest ) ); - for( int i=0; i != hcoords; i++ ) - dest[i][i] = 1.0; -} - -void -Mapdesc::surfbbox( REAL bb[2][MAXCOORDS] ) -{ - backend.surfbbox( type, bb[0], bb[1] ); -} - -void -Mapdesc::copy( REAL dest[MAXCOORDS][MAXCOORDS], long n, INREAL *src, - long rstride, long cstride ) -{ - assert( n >= 0 ); - for( int i=0; i != n; i++ ) - for( int j=0; j != n; j++ ) - dest[i][j] = src[i*rstride + j*cstride]; -} - -/*-------------------------------------------------------------------------- - * copyPt - copy a homogeneous point - *-------------------------------------------------------------------------- - */ -void -Mapdesc::copyPt( REAL *d, REAL *s ) -{ - assert( hcoords > 0 ); - switch( hcoords ) { - case 4: - d[3] = s[3]; - d[2] = s[2]; - d[1] = s[1]; - d[0] = s[0]; - break; - case 3: - d[2] = s[2]; - d[1] = s[1]; - d[0] = s[0]; - break; - case 2: - d[1] = s[1]; - d[0] = s[0]; - break; - case 1: - d[0] = s[0]; - break; - case 5: - d[4] = s[4]; - d[3] = s[3]; - d[2] = s[2]; - d[1] = s[1]; - d[0] = s[0]; - break; - default: - memcpy( d, s, hcoords * sizeof( REAL ) ); - break; - } -} - -/*-------------------------------------------------------------------------- - * sumPt - compute affine combination of two homogeneous points - *-------------------------------------------------------------------------- - */ -void -Mapdesc::sumPt( REAL *dst, REAL *src1, REAL *src2, register REAL alpha, register REAL beta ) -{ - assert( hcoords > 0 ); - switch( hcoords ) { - case 4: - dst[3] = src1[3] * alpha + src2[3] * beta; - dst[2] = src1[2] * alpha + src2[2] * beta; - dst[1] = src1[1] * alpha + src2[1] * beta; - dst[0] = src1[0] * alpha + src2[0] * beta; - break; - case 3: - dst[2] = src1[2] * alpha + src2[2] * beta; - dst[1] = src1[1] * alpha + src2[1] * beta; - dst[0] = src1[0] * alpha + src2[0] * beta; - break; - case 2: - dst[1] = src1[1] * alpha + src2[1] * beta; - dst[0] = src1[0] * alpha + src2[0] * beta; - break; - case 1: - dst[0] = src1[0] * alpha + src2[0] * beta; - break; - case 5: - dst[4] = src1[4] * alpha + src2[4] * beta; - dst[3] = src1[3] * alpha + src2[3] * beta; - dst[2] = src1[2] * alpha + src2[2] * beta; - dst[1] = src1[1] * alpha + src2[1] * beta; - dst[0] = src1[0] * alpha + src2[0] * beta; - break; - default: { - for( int i = 0; i != hcoords; i++ ) - dst[i] = src1[i] * alpha + src2[i] * beta; - } - break; - } -} - -/*-------------------------------------------------------------------------- - * clipbits - compute bit-vector indicating point/window position - * of a (transformed) homogeneous point - *-------------------------------------------------------------------------- - */ -unsigned int -Mapdesc::clipbits( REAL *p ) -{ - assert( inhcoords >= 0 ); - assert( inhcoords <= 3 ); - - register int nc = inhcoords; - register REAL pw = p[nc]; - register REAL nw = -pw; - register unsigned int bits = 0; - - if( pw == 0.0 ) return mask; - - if( pw > 0.0 ) { - switch( nc ) { - case 3: - if( p[2] <= pw ) bits |= (1<<5); - if( p[2] >= nw ) bits |= (1<<4); - if( p[1] <= pw ) bits |= (1<<3); - if( p[1] >= nw ) bits |= (1<<2); - if( p[0] <= pw ) bits |= (1<<1); - if( p[0] >= nw ) bits |= (1<<0); - return bits; - case 2: - if( p[1] <= pw ) bits |= (1<<3); - if( p[1] >= nw ) bits |= (1<<2); - if( p[0] <= pw ) bits |= (1<<1); - if( p[0] >= nw ) bits |= (1<<0); - return bits; - case 1: - if( p[0] <= pw ) bits |= (1<<1); - if( p[0] >= nw ) bits |= (1<<0); - return bits; - default: { - int bit = 1; - for( int i=0; i= nw ) bits |= bit; - bit <<= 1; - if( p[i] <= pw ) bits |= bit; - bit <<= 1; - } - abort(); - break; - } - } - } else { - switch( nc ) { - case 3: - if( p[2] <= nw ) bits |= (1<<5); - if( p[2] >= pw ) bits |= (1<<4); - if( p[1] <= nw ) bits |= (1<<3); - if( p[1] >= pw ) bits |= (1<<2); - if( p[0] <= nw ) bits |= (1<<1); - if( p[0] >= pw ) bits |= (1<<0); - return bits; - case 2: - if( p[1] <= nw ) bits |= (1<<3); - if( p[1] >= pw ) bits |= (1<<2); - if( p[0] <= nw ) bits |= (1<<1); - if( p[0] >= pw ) bits |= (1<<0); - return bits; - case 1: - if( p[0] <= nw ) bits |= (1<<1); - if( p[0] >= pw ) bits |= (1<<0); - return bits; - default: { - int bit = 1; - for( int i=0; i= pw ) bits |= bit; - bit <<= 1; - if( p[i] <= nw ) bits |= bit; - bit <<= 1; - } - abort(); - break; - } - } - } - return bits; -} - -/*-------------------------------------------------------------------------- - * xformRational - transform a homogeneous point - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformRational( Maxmatrix mat, REAL *d, REAL *s ) -{ - assert( hcoords >= 0 ); - - if( hcoords == 3 ) { - REAL x = s[0]; - REAL y = s[1]; - REAL z = s[2]; - d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]; - d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]; - d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]; - } else if( hcoords == 4 ) { - REAL x = s[0]; - REAL y = s[1]; - REAL z = s[2]; - REAL w = s[3]; - d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+w*mat[3][0]; - d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+w*mat[3][1]; - d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+w*mat[3][2]; - d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+w*mat[3][3]; - } else { - for( int i=0; i != hcoords; i++ ) { - d[i] = 0; - for( int j = 0; j != hcoords; j++ ) - d[i] += s[j] * mat[j][i]; - } - } -} - -/*-------------------------------------------------------------------------- - * xformNonrational - transform a inhomogeneous point to a homogeneous point - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformNonrational( Maxmatrix mat, REAL *d, REAL *s ) -{ - if( inhcoords == 2 ) { - REAL x = s[0]; - REAL y = s[1]; - d[0] = x*mat[0][0]+y*mat[1][0]+mat[2][0]; - d[1] = x*mat[0][1]+y*mat[1][1]+mat[2][1]; - d[2] = x*mat[0][2]+y*mat[1][2]+mat[2][2]; - } else if( inhcoords == 3 ) { - REAL x = s[0]; - REAL y = s[1]; - REAL z = s[2]; - d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+mat[3][0]; - d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+mat[3][1]; - d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+mat[3][2]; - d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+mat[3][3]; - } else { - assert( inhcoords >= 0 ); - for( int i=0; i != hcoords; i++ ) { - d[i] = mat[inhcoords][i]; - for( int j = 0; j < inhcoords; j++ ) - d[i] += s[j] * mat[j][i]; - } - } -} - -/*-------------------------------------------------------------------------- - * xformAndCullCheck - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description and - * check if they are either completely inside, completely outside, - * or intersecting the viewing frustrum. - *-------------------------------------------------------------------------- - */ -int -Mapdesc::xformAndCullCheck( - REAL *pts, int uorder, int ustride, int vorder, int vstride ) -{ - assert( uorder > 0 ); - assert( vorder > 0 ); - - unsigned int inbits = mask; - unsigned int outbits = 0; - - REAL *p = pts; - for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) { - REAL *q = p; - for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) { - REAL cpts[MAXCOORDS]; - xformCulling( cpts, q ); - unsigned int bits = clipbits( cpts ); - outbits |= bits; - inbits &= bits; - if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; - } - } - - if( outbits != (unsigned int)mask ) { - return CULL_TRIVIAL_REJECT; - } else if( inbits == (unsigned int)mask ) { - return CULL_TRIVIAL_ACCEPT; - } else { - return CULL_ACCEPT; - } -} - -/*-------------------------------------------------------------------------- - * cullCheck - check if a set of homogeneous transformed points are - * either completely inside, completely outside, - * or intersecting the viewing frustrum. - *-------------------------------------------------------------------------- - */ -int -Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride ) -{ - unsigned int inbits = mask; - unsigned int outbits = 0; - - REAL *p = pts; - for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) { - REAL *q = p; - for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) { - unsigned int bits = clipbits( q ); - outbits |= bits; - inbits &= bits; - if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; - } - } - - if( outbits != (unsigned int)mask ) { - return CULL_TRIVIAL_REJECT; - } else if( inbits == (unsigned int)mask ) { - return CULL_TRIVIAL_ACCEPT; - } else { - return CULL_ACCEPT; - } -} - -/*-------------------------------------------------------------------------- - * cullCheck - check if a set of homogeneous transformed points are - * either completely inside, completely outside, - * or intersecting the viewing frustrum. - *-------------------------------------------------------------------------- - */ -int -Mapdesc::cullCheck( REAL *pts, int order, int stride ) -{ - unsigned int inbits = mask; - unsigned int outbits = 0; - - REAL *p = pts; - for( REAL *pend = p + order * stride; p != pend; p += stride ) { - unsigned int bits = clipbits( p ); - outbits |= bits; - inbits &= bits; - if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; - } - - if( outbits != (unsigned int)mask ) { - return CULL_TRIVIAL_REJECT; - } else if( inbits == (unsigned int)mask ) { - return CULL_TRIVIAL_ACCEPT; - } else { - return CULL_ACCEPT; - } -} - -/*-------------------------------------------------------------------------- - * xformSampling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into sampling space - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformSampling( REAL *pts, int order, int stride, REAL *sp, int outstride ) -{ - xformMat( smat, pts, order, stride, sp, outstride ); -} - -void -Mapdesc::xformBounding( REAL *pts, int order, int stride, REAL *sp, int outstride ) -{ - xformMat( bmat, pts, order, stride, sp, outstride ); -} - -/*-------------------------------------------------------------------------- - * xformCulling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into culling space - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformCulling( REAL *pts, int order, int stride, REAL *cp, int outstride ) -{ - xformMat( cmat, pts, order, stride, cp, outstride ); -} - -/*-------------------------------------------------------------------------- - * xformCulling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into culling space - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformCulling( REAL *pts, - int uorder, int ustride, - int vorder, int vstride, - REAL *cp, int outustride, int outvstride ) -{ - xformMat( cmat, pts, uorder, ustride, vorder, vstride, cp, outustride, outvstride ); -} - -/*-------------------------------------------------------------------------- - * xformSampling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into sampling space - *-------------------------------------------------------------------------- - */ -void -Mapdesc::xformSampling( REAL *pts, - int uorder, int ustride, - int vorder, int vstride, - REAL *sp, int outustride, int outvstride ) -{ - xformMat( smat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); -} - -void -Mapdesc::xformBounding( REAL *pts, - int uorder, int ustride, - int vorder, int vstride, - REAL *sp, int outustride, int outvstride ) -{ - xformMat( bmat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); -} - -void -Mapdesc::xformMat( - Maxmatrix mat, - REAL * pts, - int order, - int stride, - REAL * cp, - int outstride ) -{ - if( isrational ) { - REAL *pend = pts + order * stride; - for( REAL *p = pts ; p != pend; p += stride ) { - xformRational( mat, cp, p ); - cp += outstride; - } - } else { - REAL *pend = pts + order * stride; - for( REAL *p = pts ; p != pend; p += stride ) { - xformNonrational( mat, cp, p ); - cp += outstride; - } - } -} - -void -Mapdesc::xformMat( Maxmatrix mat, REAL *pts, - int uorder, int ustride, - int vorder, int vstride, - REAL *cp, int outustride, int outvstride ) -{ - if( isrational ) { - REAL *pend = pts + uorder * ustride; - for( REAL *p = pts ; p != pend; p += ustride ) { - REAL *cpts2 = cp; - REAL *qend = p + vorder * vstride; - for( REAL *q = p; q != qend; q += vstride ) { - xformRational( mat, cpts2, q ); - cpts2 += outvstride; - } - cp += outustride; - } - } else { - REAL *pend = pts + uorder * ustride; - for( REAL *p = pts ; p != pend; p += ustride ) { - REAL *cpts2 = cp; - REAL *qend = p + vorder * vstride; - for( REAL *q = p; q != qend; q += vstride ) { - xformNonrational( mat, cpts2, q ); - cpts2 += outvstride; - } - cp += outustride; - } - } -} - -/*-------------------------------------------------------------------------- - * subdivide - subdivide a curve along an isoparametric line - *-------------------------------------------------------------------------- - */ - -void -Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, int stride, int order ) -{ - REAL mv = 1.0 - v; - - for( REAL *send=src+stride*order; src!=send; send-=stride, dst+=stride ) { - copyPt( dst, src ); - REAL *qpnt = src + stride; - for( REAL *qp=src; qpnt!=send; qp=qpnt, qpnt+=stride ) - sumPt( qp, qp, qpnt, mv, v ); - } -} - -/*-------------------------------------------------------------------------- - * subdivide - subdivide a patch along an isoparametric line - *-------------------------------------------------------------------------- - */ - -void -Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, - int so, int ss, int to, int ts ) -{ - REAL mv = 1.0 - v; - - for( REAL *slast = src+ss*so; src != slast; src += ss, dst += ss ) { - REAL *sp = src; - REAL *dp = dst; - for( REAL *send = src+ts*to; sp != send; send -= ts, dp += ts ) { - copyPt( dp, sp ); - REAL *qp = sp; - for( REAL *qpnt = sp+ts; qpnt != send; qp = qpnt, qpnt += ts ) - sumPt( qp, qp, qpnt, mv, v ); - } - } -} - - -#define sign(x) ((x > 0) ? 1 : ((x < 0.0) ? -1 : 0)) - -/*-------------------------------------------------------------------------- - * project - project a set of homogeneous coordinates into inhomogeneous ones - *-------------------------------------------------------------------------- - */ -int -Mapdesc::project( REAL *src, int rstride, int cstride, - REAL *dest, int trstride, int tcstride, - int nrows, int ncols ) -{ - int s = sign( src[inhcoords] ); - REAL *rlast = src + nrows * rstride; - REAL *trptr = dest; - for( REAL *rptr=src; rptr != rlast; rptr+=rstride, trptr+=trstride ) { - REAL *clast = rptr + ncols * cstride; - REAL *tcptr = trptr; - for( REAL *cptr = rptr; cptr != clast; cptr+=cstride, tcptr+=tcstride ) { - REAL *coordlast = cptr + inhcoords; - if( sign( *coordlast ) != s ) return 0; - REAL *tcoord = tcptr; - for( REAL *coord = cptr; coord != coordlast; coord++, tcoord++ ) { - *tcoord = *coord / *coordlast; - } - } - } - return 1; -} - -/*-------------------------------------------------------------------------- - * project - project a set of homogeneous coordinates into inhomogeneous ones - *-------------------------------------------------------------------------- - */ -int -Mapdesc::project( REAL *src, int stride, REAL *dest, int tstride, int ncols ) -{ - int s = sign( src[inhcoords] ); - - REAL *clast = src + ncols * stride; - for( REAL *cptr = src, *tcptr = dest; cptr != clast; cptr+=stride, tcptr+=tstride ) { - REAL *coordlast = cptr + inhcoords; - if( sign( *coordlast ) != s ) return 0; - for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ ) - *tcoord = *coord / *coordlast; - } - - return 1; -} - -int -Mapdesc::bboxTooBig( - REAL *p, - int rstride, - int cstride, - int nrows, - int ncols, - REAL bb[2][MAXCOORDS] ) -{ - REAL bbpts[MAXORDER][MAXORDER][MAXCOORDS]; - const int trstride = sizeof(bbpts[0]) / sizeof(REAL); - const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL); - - // points have been transformed, therefore they are homogeneous - // project points - int val = project( p, rstride, cstride, - &bbpts[0][0][0], trstride, tcstride, nrows, ncols ); - if( val == 0 ) return -1; - - // compute bounding box - bbox( bb, &bbpts[0][0][0], trstride, tcstride, nrows, ncols ); - - // find out if bounding box can't fit in unit cube - if( bbox_subdividing == N_BBOXROUND ) { - for( int k=0; k != inhcoords; k++ ) - if( ceilf(bb[1][k]) - floorf(bb[0][k]) > bboxsize[k] ) return 1; - } else { - for( int k=0; k != inhcoords; k++ ) - if( bb[1][k] - bb[0][k] > bboxsize[k] ) return 1; - } - return 0; -} - -void -Mapdesc::bbox( - REAL bb[2][MAXCOORDS], - REAL *p, - int rstride, - int cstride, - int nrows, - int ncols ) -{ - int k; - for( k=0; k != inhcoords; k++ ) - bb[0][k] = bb[1][k] = p[k]; - - for( int i=0; i != nrows; i++ ) - for( int j=0; j != ncols; j++ ) - for( k=0; k != inhcoords; k++ ) { - REAL x = p[i*rstride + j*cstride + k]; - if( x < bb[0][k] ) bb[0][k] = x; - else if( x > bb[1][k] ) bb[1][k] = x; - } -} - -/*-------------------------------------------------------------------------- - * calcVelocityRational - calculate upper bound on first partial derivative - * of a homogeneous set of points and bounds on each row of points. - *-------------------------------------------------------------------------- - */ -REAL -Mapdesc::calcVelocityRational( REAL *p, int stride, int ncols ) -{ - REAL tmp[MAXORDER][MAXCOORDS]; - - assert( ncols <= MAXORDER ); - - const int tstride = sizeof(tmp[0]) / sizeof(REAL); - - if( project( p, stride, &tmp[0][0], tstride, ncols ) ) { - return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 ); - } else { /* XXX */ - return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 ); - } -} - -/*-------------------------------------------------------------------------- - * calcVelocityNonrational - calculate upper bound on first partial - * derivative of a inhomogeneous set of points. - *-------------------------------------------------------------------------- - */ -REAL -Mapdesc::calcVelocityNonrational( REAL *pts, int stride, int ncols ) -{ - return calcPartialVelocity( pts, stride, ncols, 1, 1.0 ); -} - -int -Mapdesc::isProperty( long property ) -{ - switch ( property ) { - case N_PIXEL_TOLERANCE: - case N_ERROR_TOLERANCE: - case N_CULLING: - case N_BBOX_SUBDIVIDING: - case N_S_STEPS: - case N_T_STEPS: - case N_SAMPLINGMETHOD: - case N_CLAMPFACTOR: - case N_MINSAVINGS: - return 1; - default: - return 0; - } -} - -REAL -Mapdesc::getProperty( long property ) -{ - switch ( property ) { - case N_PIXEL_TOLERANCE: - return pixel_tolerance; - case N_ERROR_TOLERANCE: - return error_tolerance; - case N_CULLING: - return culling_method; - case N_BBOX_SUBDIVIDING: - return bbox_subdividing; - case N_S_STEPS: - return s_steps; - case N_T_STEPS: - return t_steps; - case N_SAMPLINGMETHOD: - return sampling_method; - case N_CLAMPFACTOR: - return clampfactor; - case N_MINSAVINGS: - return minsavings; - default: - abort(); - return -1; //not necessary, needed to shut up compiler - } -} - -void -Mapdesc::setProperty( long property, REAL value ) -{ - - switch ( property ) { - case N_PIXEL_TOLERANCE: - pixel_tolerance = value; - break; - case N_ERROR_TOLERANCE: - error_tolerance = value; - break; - case N_CULLING: - culling_method = value; - break; - case N_BBOX_SUBDIVIDING: - if( value <= 0.0 ) value = N_NOBBOXSUBDIVISION; - bbox_subdividing = value; - break; - case N_S_STEPS: - if( value < 0.0 ) value = 0.0; - s_steps = value; - maxrate = ( value < 0.0 ) ? 0.0 : value; - maxsrate = ( value < 0.0 ) ? 0.0 : value; - break; - case N_T_STEPS: - if( value < 0.0 ) value = 0.0; - t_steps = value; - maxtrate = ( value < 0.0 ) ? 0.0 : value; - break; - case N_SAMPLINGMETHOD: - sampling_method = value; - break; - case N_CLAMPFACTOR: - if( value <= 0.0 ) value = N_NOCLAMPING; - clampfactor = value; - break; - case N_MINSAVINGS: - if( value <= 0.0 ) value = N_NOSAVINGSSUBDIVISION; - minsavings = value; - break; - default: - abort(); - break; - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/mapdesc.h b/src/libs/mesa/glu/libnurbs/internals/mapdesc.h deleted file mode 100644 index 6f06154f92..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mapdesc.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mapdesc.h - * - */ - -#ifndef __glumapdesc_h_ -#define __glumapdesc_h_ - -#include "mystdio.h" -#include "types.h" -#include "defines.h" -#include "bufpool.h" -#include "nurbsconsts.h" - -typedef REAL Maxmatrix[MAXCOORDS][MAXCOORDS]; - -class Backend; - -class Mapdesc : public PooledObj { - friend class Maplist; - -public: - Mapdesc( long, int, int, Backend & ); - int isProperty( long ); - REAL getProperty( long ); - void setProperty( long, REAL ); - int isConstantSampling( void ); - int isDomainSampling( void ); - int isRangeSampling( void ); - int isSampling( void ); - int isParametricDistanceSampling( void ); - int isObjectSpaceParaSampling( void ); - int isObjectSpacePathSampling( void ); - int isSurfaceAreaSampling( void ); - int isPathLengthSampling( void ); - int isCulling( void ); - int isBboxSubdividing( void ); - long getType( void ); - - /* curve routines */ - void subdivide( REAL *, REAL *, REAL, int, int ); - int cullCheck( REAL *, int, int ); - void xformBounding( REAL *, int, int, REAL *, int ); - void xformCulling( REAL *, int, int, REAL *, int ); - void xformSampling( REAL *, int, int, REAL *, int ); - void xformMat( Maxmatrix, REAL *, int, int, REAL *, int ); - REAL calcPartialVelocity ( REAL *, int, int, int, REAL ); - int project( REAL *, int, REAL *, int, int ); - REAL calcVelocityRational( REAL *, int, int ); - REAL calcVelocityNonrational( REAL *, int, int ); - - /* surface routines */ - void subdivide( REAL *, REAL *, REAL, int, int, int, int ); - int cullCheck( REAL *, int, int, int, int ); - void xformBounding( REAL *, int, int, int, int, REAL *, int, int ); - void xformCulling( REAL *, int, int, int, int, REAL *, int, int ); - void xformSampling( REAL *, int, int, int, int, REAL *, int, int ); - void xformMat( Maxmatrix, REAL *, int, int, int, int, REAL *, int, int ); - REAL calcPartialVelocity ( REAL *, REAL *, int, int, int, int, int, int, REAL, REAL, int ); - int project( REAL *, int, int, REAL *, int, int, int, int); - void surfbbox( REAL bb[2][MAXCOORDS] ); - - int bboxTooBig( REAL *, int, int, int, int, REAL [2][MAXCOORDS] ); - int xformAndCullCheck( REAL *, int, int, int, int ); - - void identify( REAL[MAXCOORDS][MAXCOORDS] ); - void setBboxsize( INREAL *); - inline void setBmat( INREAL*, long, long ); - inline void setCmat( INREAL*, long, long ); - inline void setSmat( INREAL*, long, long ); - inline int isRational( void ); - inline int getNcoords( void ); - - REAL pixel_tolerance; /* pathlength sampling tolerance */ - REAL error_tolerance; /* parametric error sampling tolerance*/ - REAL object_space_error_tolerance; /* object space tess*/ - REAL clampfactor; - REAL minsavings; - REAL maxrate; - REAL maxsrate; - REAL maxtrate; - REAL bboxsize[MAXCOORDS]; - -private: - long type; - int isrational; - int ncoords; - int hcoords; - int inhcoords; - int mask; - Maxmatrix bmat; - Maxmatrix cmat; - Maxmatrix smat; - REAL s_steps; /* max samples in s direction */ - REAL t_steps; /* max samples in t direction */ - REAL sampling_method; - REAL culling_method; /* check for culling */ - REAL bbox_subdividing; - Mapdesc * next; - Backend & backend; - - void bbox( REAL [2][MAXCOORDS], REAL *, int, int, int, int ); - REAL maxDifference( int, REAL *, int ); - static void copy( Maxmatrix, long, INREAL *, long, long ); - - /* individual control point routines */ - static void transform4d( float[4], float[4], float[4][4] ); - static void multmatrix4d ( float[4][4], const float[4][4], - const float[4][4] ); - void copyPt( REAL *, REAL * ); - void sumPt( REAL *, REAL *, REAL *, REAL, REAL ); - void xformSampling( REAL *, REAL * ); - void xformCulling( REAL *, REAL * ); - void xformRational( Maxmatrix, REAL *, REAL * ); - void xformNonrational( Maxmatrix, REAL *, REAL * ); - unsigned int clipbits( REAL * ); -}; - -inline void -Mapdesc::setBmat( INREAL *mat, long rstride, long cstride ) -{ - copy( bmat, hcoords, mat, rstride, cstride ); -} - -inline void -Mapdesc::setCmat( INREAL *mat, long rstride, long cstride ) -{ - copy( cmat, hcoords, mat, rstride, cstride ); -} - -inline void -Mapdesc::setSmat( INREAL *mat, long rstride, long cstride ) -{ - copy( smat, hcoords, mat, rstride, cstride ); -} - -inline long -Mapdesc::getType( void ) -{ - return type; -} - -inline void -Mapdesc::xformCulling( REAL *d, REAL *s ) -{ - if( isrational ) - xformRational( cmat, d, s ); - else - xformNonrational( cmat, d, s ); -} - -inline void -Mapdesc::xformSampling( REAL *d, REAL *s ) -{ - if( isrational ) - xformRational( smat, d, s ); - else - xformNonrational( smat, d, s ); -} - -inline int -Mapdesc::isRational( void ) -{ - return isrational ? 1 : 0; -} - -inline int -Mapdesc::getNcoords( void ) -{ - return ncoords; -} - -inline int -Mapdesc::isConstantSampling( void ) -{ - return ((sampling_method == N_FIXEDRATE) ? 1 : 0); -} - -inline int -Mapdesc::isDomainSampling( void ) -{ - return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); -} - -inline int -Mapdesc::isParametricDistanceSampling( void ) -{ - return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0); -} - -inline int -Mapdesc::isObjectSpaceParaSampling( void ) -{ - return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0); -} - -inline int -Mapdesc::isObjectSpacePathSampling( void ) -{ - return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0); -} - -inline int -Mapdesc::isSurfaceAreaSampling( void ) -{ - return ((sampling_method == N_SURFACEAREA) ? 1 : 0); -} - -inline int -Mapdesc::isPathLengthSampling( void ) -{ - return ((sampling_method == N_PATHLENGTH) ? 1 : 0); -} - -inline int -Mapdesc::isRangeSampling( void ) -{ - return ( isParametricDistanceSampling() || isPathLengthSampling() || - isSurfaceAreaSampling() || - isObjectSpaceParaSampling() || - isObjectSpacePathSampling()); -} - -inline int -Mapdesc::isSampling( void ) -{ - return isRangeSampling() || isConstantSampling() || isDomainSampling(); -} - -inline int -Mapdesc::isCulling( void ) -{ - return ((culling_method != N_NOCULLING) ? 1 : 0); -} - -inline int -Mapdesc::isBboxSubdividing( void ) -{ - return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0); -} -#endif /* __glumapdesc_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/mapdescv.cc b/src/libs/mesa/glu/libnurbs/internals/mapdescv.cc deleted file mode 100644 index 35b38b141b..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mapdescv.cc +++ /dev/null @@ -1,243 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * mapdescv.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "mystring.h" -#include "mymath.h" -#include "nurbsconsts.h" -#include "mapdesc.h" - -/*-------------------------------------------------------------------------- - * calcPartialVelocity - calculate maximum magnitude of a given partial - * derivative - *-------------------------------------------------------------------------- - */ -REAL -Mapdesc::calcPartialVelocity ( - REAL *p, - int stride, - int ncols, - int partial, - REAL range ) -{ - REAL tmp[MAXORDER][MAXCOORDS]; - REAL mag[MAXORDER]; - - assert( ncols <= MAXORDER ); - - int j, k, t; - // copy inhomogeneous control points into temporary array - for( j=0; j != ncols; j++ ) - for( k=0; k != inhcoords; k++ ) - tmp[j][k] = p[j*stride + k]; - - for( t=0; t != partial; t++ ) - for( j=0; j != ncols-t-1; j++ ) - for( k=0; k != inhcoords; k++ ) - tmp[j][k] = tmp[j+1][k] - tmp[j][k]; - - // compute magnitude and store in mag array - for( j=0; j != ncols-partial; j++ ) { - mag[j] = 0.0; - for( k=0; k != inhcoords; k++ ) - mag[j] += tmp[j][k] * tmp[j][k]; - } - - // compute scale factor - REAL fac = 1; - REAL invt = 1.0 / range; - for( t = ncols-1; t != ncols-1-partial; t-- ) - fac *= t * invt; - - // compute max magnitude of all entries in array - REAL max = 0.0; - for( j=0; j != ncols-partial; j++ ) - if( mag[j] > max ) max = mag[j]; - max = fac * sqrtf( (float) max ); - - return max; -} - -/*-------------------------------------------------------------------------- - * calcPartialVelocity - calculate maximum magnitude of a given partial - * derivative - *-------------------------------------------------------------------------- - */ -REAL -Mapdesc::calcPartialVelocity ( - REAL *dist, - REAL *p, - int rstride, - int cstride, - int nrows, - int ncols, - int spartial, - int tpartial, - REAL srange, - REAL trange, - int side ) -{ - REAL tmp[MAXORDER][MAXORDER][MAXCOORDS]; - REAL mag[MAXORDER][MAXORDER]; - - assert( nrows <= MAXORDER ); - assert( ncols <= MAXORDER ); - - REAL *tp = &tmp[0][0][0]; - REAL *mp = &mag[0][0]; - const int istride = sizeof( tmp[0]) / sizeof( tmp[0][0][0] ); - const int jstride = sizeof( tmp[0][0]) / sizeof( tmp[0][0][0] ); - /* - const int kstride = sizeof( tmp[0][0][0]) / sizeof( tmp[0][0][0] ); - */ - const int mistride = sizeof( mag[0]) / sizeof( mag[0][0] ); - const int mjstride = sizeof( mag[0][0]) / sizeof( mag[0][0] ); - const int idist = nrows * istride; - const int jdist = ncols * jstride; - /* - const int kdist = inhcoords * kstride; - */ - const int id = idist - spartial * istride; - const int jd = jdist - tpartial * jstride; - - { - // copy control points - REAL *ti = tp; - REAL *qi = p; - REAL *til = tp + idist; - for( ; ti != til; ) { - REAL *tj = ti; - REAL *qj = qi; - REAL *tjl = ti + jdist; - for( ; tj != tjl; ) { - for( int k=0; k != inhcoords; k++ ) { - tj[k] = qj[k]; - } - tj += jstride; - qj += cstride; - } - ti += istride; - qi += rstride; - } - } - - { - // compute (s)-partial derivative control points - REAL *til = tp + idist - istride; - const REAL *till = til - ( spartial * istride ); - for( ; til != till; til -= istride ) - for( REAL *ti = tp; ti != til; ti += istride ) - for( REAL *tj = ti, *tjl = tj + jdist; tj != tjl; tj += jstride ) - for( int k=0; k != inhcoords; k++ ) - tj[k] = tj[k+istride] - tj[k]; - } - - { - // compute (s,t)-partial derivative control points - REAL *tjl = tp + jdist - jstride; - const REAL *tjll = tjl - ( tpartial * jstride ); - for( ; tjl != tjll; tjl -= jstride ) - for( REAL *tj = tp; tj != tjl; tj += jstride ) - for( REAL *ti = tj, *til = ti + id; ti != til; ti += istride ) - for( int k=0; k != inhcoords; k++ ) - ti[k] = ti[k+jstride] - ti[k]; - - } - - REAL max = 0.0; - { - // compute magnitude and store in mag array - memset( (void *) mp, 0, sizeof( mag ) ); - for( REAL *ti = tp, *mi = mp, *til = tp + id; ti != til; ti += istride, mi += mistride ) - for( REAL *tj = ti, *mj = mi, *tjl = ti + jd; tj != tjl; tj += jstride, mj += mjstride ) { - for( int k=0; k != inhcoords; k++ ) - *mj += tj[k] * tj[k]; - if( *mj > max ) max = *mj; - } - - } - - int i, j; - - // compute scale factor - REAL fac = 1.0; - { - REAL invs = 1.0 / srange; - REAL invt = 1.0 / trange; - for( int s = nrows-1, slast = s-spartial; s != slast; s-- ) - fac *= s * invs; - for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- ) - fac *= t * invt; - } - - if( side == 0 ) { - // compute max magnitude of first and last column - dist[0] = 0.0; - dist[1] = 0.0; - for( i=0; i != nrows-spartial; i++ ) { - j = 0; - if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; - - j = ncols-tpartial-1; - if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; - } - dist[0] = fac * sqrtf( dist[0] ); - dist[1] = fac * sqrtf( dist[1] ); - } else if( side == 1 ) { - // compute max magnitude of first and last row - dist[0] = 0.0; - dist[1] = 0.0; - for( j=0; j != ncols-tpartial; j++ ) { - i = 0; - if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; - - i = nrows-spartial-1; - if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; - } - dist[0] = fac * sqrtf( dist[0] ); - dist[1] = fac * sqrtf( dist[1] ); - } - - max = fac * sqrtf( (float) max ); - - return max; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/maplist.cc b/src/libs/mesa/glu/libnurbs/internals/maplist.cc deleted file mode 100644 index f944d1529e..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/maplist.cc +++ /dev/null @@ -1,117 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * maplist.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "mymath.h" -#include "nurbsconsts.h" -#include "maplist.h" -#include "mapdesc.h" -#include "backend.h" - -Maplist::Maplist( Backend& b ) - : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ), - backend( b ) -{ - maps = 0; lastmap = &maps; -} - -void -Maplist::initialize( void ) -{ - freeMaps(); - define( N_P2D, 0, 2 ); - define( N_P2DR, 1, 3 ); -} - -void -Maplist::add( long type, int israt, int ncoords ) -{ - *lastmap = new(mapdescPool) Mapdesc( type, israt, ncoords, backend ); - lastmap = &((*lastmap)->next); -} - -void -Maplist::define( long type, int israt, int ncoords ) -{ -#ifndef NDEBUG // to avoid warning - Mapdesc *m = locate( type ); - assert( m == NULL || ( m->isrational == israt && m->ncoords == ncoords ) ); -#endif - add( type, israt, ncoords ); -} - -void -Maplist::remove( Mapdesc *m ) -{ - for( Mapdesc **curmap = &maps; *curmap; curmap = &((*curmap)->next) ) { - if( *curmap == m ) { - *curmap = m->next; - m->deleteMe( mapdescPool ); - return; - } - } - abort(); -} - -void -Maplist::freeMaps( void ) -{ - mapdescPool.clear(); - maps = 0; - lastmap = &maps; -} - -Mapdesc * -Maplist::find( long type ) -{ - Mapdesc *val = locate( type ); - assert( val != 0 ); - return val; -} - -Mapdesc * -Maplist::locate( long type ) -{ - Mapdesc *m; - for( m = maps; m; m = m->next ) - if( m->getType() == type ) break; - return m; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/maplist.h b/src/libs/mesa/glu/libnurbs/internals/maplist.h deleted file mode 100644 index 49720e49b4..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/maplist.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * maplist.h - * - */ - -#ifndef __glumaplist_h_ -#define __glumaplist_h_ - -#include "types.h" -#include "defines.h" -#include "bufpool.h" - -class Backend; -class Mapdesc; - -class Maplist { -public: - Maplist( Backend & ); - void define( long, int, int ); - inline void undefine( long ); - inline int isMap( long ); - - void initialize( void ); - Mapdesc * find( long ); - Mapdesc * locate( long ); - -private: - Pool mapdescPool; - Mapdesc * maps; - Mapdesc ** lastmap; - Backend & backend; - - void add( long, int, int ); - void remove( Mapdesc * ); - void freeMaps( void ); -}; - -inline int -Maplist::isMap( long type ) -{ - return (locate( type ) ? 1 : 0); -} - -inline void -Maplist::undefine( long type ) -{ - Mapdesc *m = locate( type ); - assert( m != 0 ); - remove( m ); -} -#endif /* __glumaplist_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/mesher.cc b/src/libs/mesa/glu/libnurbs/internals/mesher.cc deleted file mode 100644 index 9cc436adbf..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mesher.cc +++ /dev/null @@ -1,486 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * mesher.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "gridvertex.h" -#include "gridtrimvertex.h" -#include "jarcloc.h" -#include "gridline.h" -#include "trimline.h" -#include "uarray.h" -#include "backend.h" -#include "mesher.h" - - -const float Mesher::ZERO = 0.0; - -Mesher::Mesher( Backend& b ) - : backend( b ), - p( sizeof( GridTrimVertex ), 100, "GridTrimVertexPool" ) -{ - stacksize = 0; - vdata = 0; - lastedge = 0; //needed to prevent purify UMR -} - -Mesher::~Mesher( void ) -{ - if( vdata ) delete[] vdata; -} - -void -Mesher::init( unsigned int npts ) -{ - p.clear(); - if( stacksize < npts ) { - stacksize = 2 * npts; - if( vdata ) delete[] vdata; - vdata = new GridTrimVertex_p[stacksize]; - } -} - -inline void -Mesher::push( GridTrimVertex *gt ) -{ - assert( itop+1 != (int)stacksize ); - vdata[++itop] = gt; -} - -inline void -Mesher::pop( long ) -{ -} - -inline void -Mesher::openMesh() -{ - backend.bgntmesh( "addedge" ); -} - -inline void -Mesher::closeMesh() -{ - backend.endtmesh(); -} - -inline void -Mesher::swapMesh() -{ - backend.swaptmesh(); -} - -inline void -Mesher::clearStack() -{ - itop = -1; - last[0] = 0; -} - -void -Mesher::finishLower( GridTrimVertex *gtlower ) -{ - for( push(gtlower); - nextlower( gtlower=new(p) GridTrimVertex ); - push(gtlower) ) - addLower(); - addLast(); -} - -void -Mesher::finishUpper( GridTrimVertex *gtupper ) -{ - for( push(gtupper); - nextupper( gtupper=new(p) GridTrimVertex ); - push(gtupper) ) - addUpper(); - addLast(); -} - -void -Mesher::mesh( void ) -{ - GridTrimVertex *gtlower, *gtupper; - - Hull::init( ); - nextupper( gtupper = new(p) GridTrimVertex ); - nextlower( gtlower = new(p) GridTrimVertex ); - - clearStack(); - openMesh(); - push(gtupper); - - nextupper( gtupper = new(p) GridTrimVertex ); - nextlower( gtlower ); - - assert( gtupper->t && gtlower->t ); - - if( gtupper->t->param[0] < gtlower->t->param[0] ) { - push(gtupper); - lastedge = 1; - if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { - finishLower(gtlower); - return; - } - } else if( gtupper->t->param[0] > gtlower->t->param[0] ) { - push(gtlower); - lastedge = 0; - if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { - finishUpper(gtupper); - return; - } - } else { - if( lastedge == 0 ) { - push(gtupper); - lastedge = 1; - if( nextupper(gtupper=new(p) GridTrimVertex) == 0 ) { - finishLower(gtlower); - return; - } - } else { - push(gtlower); - lastedge = 0; - if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { - finishUpper(gtupper); - return; - } - } - } - - while ( 1 ) { - if( gtupper->t->param[0] < gtlower->t->param[0] ) { - push(gtupper); - addUpper(); - if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { - finishLower(gtlower); - return; - } - } else if( gtupper->t->param[0] > gtlower->t->param[0] ) { - push(gtlower); - addLower(); - if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { - finishUpper(gtupper); - return; - } - } else { - if( lastedge == 0 ) { - push(gtupper); - addUpper(); - if( nextupper( gtupper=new(p) GridTrimVertex ) == 0 ) { - finishLower(gtlower); - return; - } - } else { - push(gtlower); - addLower(); - if( nextlower( gtlower=new(p) GridTrimVertex ) == 0 ) { - finishUpper(gtupper); - return; - } - } - } - } -} - -inline int -Mesher::isCcw( int ilast ) -{ - REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t ); - return (area < ZERO) ? 0 : 1; -} - -inline int -Mesher::isCw( int ilast ) -{ - REAL area = det3( vdata[ilast]->t, vdata[itop-1]->t, vdata[itop-2]->t ); - return (area > -ZERO) ? 0 : 1; -} - -inline int -Mesher::equal( int x, int y ) -{ - return( last[0] == vdata[x] && last[1] == vdata[y] ); -} - -inline void -Mesher::copy( int x, int y ) -{ - last[0] = vdata[x]; last[1] = vdata[y]; -} - -inline void -Mesher::move( int x, int y ) -{ - vdata[x] = vdata[y]; -} - -inline void -Mesher::output( int x ) -{ - backend.tmeshvert( vdata[x] ); -} - -/*--------------------------------------------------------------------------- - * addedge - addedge an edge to the triangulation - * - * This code has been re-written to generate large triangle meshes - * from a monotone polygon. Although smaller triangle meshes - * could be generated faster and with less code, larger meshes - * actually give better SYSTEM performance. This is because - * vertices are processed in the backend slower than they are - * generated by this code and any decrease in the number of vertices - * results in a decrease in the time spent in the backend. - *--------------------------------------------------------------------------- - */ - -void -Mesher::addLast( ) -{ - register int ilast = itop; - - if( lastedge == 0 ) { - if( equal( 0, 1 ) ) { - output( ilast ); - swapMesh(); - for( register int i = 2; i < ilast; i++ ) { - swapMesh(); - output( i ); - } - copy( ilast, ilast-1 ); - } else if( equal( ilast-2, ilast-1) ) { - swapMesh(); - output( ilast ); - for( register int i = ilast-3; i >= 0; i-- ) { - output( i ); - swapMesh(); - } - copy( 0, ilast ); - } else { - closeMesh(); openMesh(); - output( ilast ); - output( 0 ); - for( register int i = 1; i < ilast; i++ ) { - swapMesh(); - output( i ); - } - copy( ilast, ilast-1 ); - } - } else { - if( equal( 1, 0) ) { - swapMesh(); - output( ilast ); - for( register int i = 2; i < ilast; i++ ) { - output( i ); - swapMesh(); - } - copy( ilast-1, ilast ); - } else if( equal( ilast-1, ilast-2) ) { - output( ilast ); - swapMesh(); - for( register int i = ilast-3; i >= 0; i-- ) { - swapMesh(); - output( i ); - } - copy( ilast, 0 ); - } else { - closeMesh(); openMesh(); - output( 0 ); - output( ilast ); - for( register int i = 1; i < ilast; i++ ) { - output( i ); - swapMesh(); - } - copy( ilast-1, ilast ); - } - } - closeMesh(); - //for( register long k=0; k<=ilast; k++ ) pop( k ); -} - -void -Mesher::addUpper( ) -{ - register int ilast = itop; - - if( lastedge == 0 ) { - if( equal( 0, 1 ) ) { - output( ilast ); - swapMesh(); - for( register int i = 2; i < ilast; i++ ) { - swapMesh(); - output( i ); - } - copy( ilast, ilast-1 ); - } else if( equal( ilast-2, ilast-1) ) { - swapMesh(); - output( ilast ); - for( register int i = ilast-3; i >= 0; i-- ) { - output( i ); - swapMesh(); - } - copy( 0, ilast ); - } else { - closeMesh(); openMesh(); - output( ilast ); - output( 0 ); - for( register int i = 1; i < ilast; i++ ) { - swapMesh(); - output( i ); - } - copy( ilast, ilast-1 ); - } - lastedge = 1; - //for( register long k=0; k 1) && isCcw( ilast ) ); - - if( equal( ilast-1, ilast-2 ) ) { - output( ilast ); - swapMesh(); - for( register int i=ilast-3; i>=itop-1; i-- ) { - swapMesh(); - output( i ); - } - copy( ilast, itop-1 ); - } else if( equal( itop, itop-1 ) ) { - swapMesh(); - output( ilast ); - for( register int i = itop+1; i < ilast; i++ ) { - output( i ); - swapMesh(); - } - copy( ilast-1, ilast ); - } else { - closeMesh(); openMesh(); - output( ilast ); - output( ilast-1 ); - for( register int i=ilast-2; i>=itop-1; i-- ) { - swapMesh(); - output( i ); - } - copy( ilast, itop-1 ); - } - //for( register int k=itop; k= 0; i-- ) { - swapMesh(); - output( i ); - } - copy( ilast, 0 ); - } else { - closeMesh(); openMesh(); - output( 0 ); - output( ilast ); - for( register int i = 1; i < ilast; i++ ) { - output( i ); - swapMesh(); - } - copy( ilast-1, ilast ); - } - - lastedge = 0; - //for( register long k=0; k 1) && isCw( ilast ) ); - - if( equal( ilast-2, ilast-1) ) { - swapMesh(); - output( ilast ); - for( register int i=ilast-3; i>=itop-1; i--) { - output( i ); - swapMesh( ); - } - copy( itop-1, ilast ); - } else if( equal( itop-1, itop) ) { - output( ilast ); - swapMesh(); - for( register int i=itop+1; i=itop-1; i-- ) { - output( i ); - swapMesh( ); - } - copy( itop-1, ilast ); - } - //for( register int k=itop; kbgntfan(); - - /* - trimVert.param[0]=v[0]; - trimVert.param[1]=v[1]; - backend->tmeshvert(&trimVert); - */ - backend->tmeshvert(v[0], v[1]); - - if(isIncreasing) { - for(i=0; itmeshvert(&trimVert); - */ - backend->tmeshvert(queue[i][0], queue[i][1]); - } - } - else { - for(i=index_queue-1; i>=0; i--) - { - /* - trimVert.param[0]=queue[i][0]; - trimVert.param[1]=queue[i][1]; - backend->tmeshvert(&trimVert); - */ - backend->tmeshvert(queue[i][0], queue[i][1]); - } - } - backend->endtfan(); -} - -void reflexChain::processNewVertex(Real v[2], Backend* backend) -{ - Int i,j,k; - Int isReflex; - /*TrimVertex trimVert;*/ - /*if there are at most one vertex in the queue, then simply insert - */ - if(index_queue <=1){ - insert(v); - return; - } - - /*there are at least two vertices in the queue*/ - j=index_queue-1; - - for(i=j; i>=1; i--) { - if(isIncreasing) { - isReflex = (area(queue[i-1], queue[i], v) <= 0.0); - } - else /*decreasing*/{ - isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); - } - if(isReflex) { - break; - } - } - - /* - *if ibgntfan(); - /* - trimVert.param[0]=v[0]; - trimVert.param[1]=v[1]; - backend->tmeshvert(& trimVert); - */ - backend->tmeshvert(v[0], v[1]); - - if(isIncreasing) { - for(k=i; k<=j; k++) - { - /* - trimVert.param[0]=queue[k][0]; - trimVert.param[1]=queue[k][1]; - backend->tmeshvert(& trimVert); - */ - backend->tmeshvert(queue[k][0], queue[k][1]); - } - } - else { - for(k=j; k>=i; k--) - { - /* - trimVert.param[0]=queue[k][0]; - trimVert.param[1]=queue[k][1]; - backend->tmeshvert(& trimVert); - */ - backend->tmeshvert(queue[k][0], queue[k][1]); - } - } - - backend->endtfan(); - } - - /*delete vertices i+1--j from the queue*/ - index_queue = i+1; - /*finally insert v at the end of the queue*/ - insert(v); - -} - - -void monoTriangulationRec(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, - vertexArray* dec_chain, Int dec_current, - Backend* backend) -{ - assert( inc_chain != NULL && dec_chain != NULL); - assert( ! (inc_current>=inc_chain->getNumElements() && - dec_current>=dec_chain->getNumElements())); - Int inc_nVertices; - Int dec_nVertices; - Real** inc_array ; - Real** dec_array ; - Int i; - assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); - - if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ - { - - dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); - reflexChain rChain(20,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, backend); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - inc_nVertices= inc_chain->getNumElements(); - reflexChain rChain(20,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, backend); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i getArray(); - dec_array = dec_chain -> getArray(); - inc_nVertices= inc_chain->getNumElements(); - dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex, backend); - for(i=dec_current; i 0*/ - { - - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex, backend); - for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], backend); - else - break; - } - rChain.outputFan(dec_array[dec_current], backend); - monoTriangulationRec(inc_array[i-1], botVertex, - inc_chain, i, - dec_chain, dec_current, - backend); - } - }/*end case neither is empty*/ -} - - -void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend) -{ - Int i; - /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, - *then call monoTriangulationRec - */ - Arc_ptr tempV; - Arc_ptr topV; - Arc_ptr botV; - topV = botV = loop; - for(tempV = loop->next; tempV != loop; tempV = tempV->next) - { - if(compFun(topV->tail(), tempV->tail())<0) { - topV = tempV; - } - if(compFun(botV->tail(), tempV->tail())>0) { - botV = tempV; - } - } - - /*creat increase and decrease chains*/ - vertexArray inc_chain(20); /*this is a dynamic array*/ - for(i=1; i<=topV->pwlArc->npts-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ - inc_chain.appendVertex(topV->pwlArc->pts[i].param); - } - for(tempV = topV->next; tempV != botV; tempV = tempV->next) - { - for(i=0; i<=tempV->pwlArc->npts-2; i++){ - inc_chain.appendVertex(tempV->pwlArc->pts[i].param); - } - } - - vertexArray dec_chain(20); - for(tempV = topV->prev; tempV != botV; tempV = tempV->prev) - { - for(i=tempV->pwlArc->npts-2; i>=0; i--){ - dec_chain.appendVertex(tempV->pwlArc->pts[i].param); - } - } - for(i=botV->pwlArc->npts-2; i>=1; i--){ - dec_chain.appendVertex(tempV->pwlArc->pts[i].param); - } - - monoTriangulationRecFunBackend(topV->tail(), botV->tail(), &inc_chain, 0, &dec_chain, 0, compFun, backend); - -} - -/*if compFun == compV2InY, top to bottom: V-monotone - *if compFun == compV2InX, right to left: U-monotone - */ -void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, - vertexArray* dec_chain, Int dec_current, - Int (*compFun)(Real*, Real*), - Backend* backend) -{ - assert( inc_chain != NULL && dec_chain != NULL); - assert( ! (inc_current>=inc_chain->getNumElements() && - dec_current>=dec_chain->getNumElements())); - Int inc_nVertices; - Int dec_nVertices; - Real** inc_array ; - Real** dec_array ; - Int i; - assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); - - if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ - { - - dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); - reflexChain rChain(20,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, backend); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - inc_nVertices= inc_chain->getNumElements(); - reflexChain rChain(20,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, backend); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i getArray(); - dec_array = dec_chain -> getArray(); - inc_nVertices= inc_chain->getNumElements(); - dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex, backend); - for(i=dec_current; i 0*/ - { - - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex, backend); - for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], backend); - else - break; - } - rChain.outputFan(dec_array[dec_current], backend); - monoTriangulationRecFunBackend(inc_array[i-1], botVertex, - inc_chain, i, - dec_chain, dec_current, - compFun, - backend); - } - }/*end case neither is empty*/ -} diff --git a/src/libs/mesa/glu/libnurbs/internals/monotonizer.cc b/src/libs/mesa/glu/libnurbs/internals/monotonizer.cc deleted file mode 100644 index 5845d310ba..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/monotonizer.cc +++ /dev/null @@ -1,260 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * monotonizer.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "arc.h" -#include "arctess.h" -#include "bezierarc.h" -#include "bin.h" -#include "mapdesc.h" -#include "nurbsconsts.h" -#include "subdivider.h" - -/*----------------------------------------------------------------------------- - * Subdivider::decompose - break all curves into monotone arcs - *----------------------------------------------------------------------------- - */ -int -Subdivider::decompose( Bin& bin, REAL geo_stepsize ) -{ - Arc_ptr jarc; - for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - if( ! jarc->isTessellated() ) { - /* points have not been transformed, therefore they may be either - homogeneous or inhomogeneous */ - tessellate( jarc, geo_stepsize ); - if( jarc->isDisconnected() || jarc->next->isDisconnected() ) - return 1; - } - } - - for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - monotonize( jarc, bin ); - } - -#ifndef NDEBUG - for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - assert( isMonotone( jarc ) != 0 ); - } -#endif - - return 0; -} - -void -Subdivider::tessellate( Arc_ptr jarc, REAL geo_stepsize ) -{ - BezierArc *b = jarc->bezierArc; - Mapdesc *mapdesc = b->mapdesc; - - if( mapdesc->isRational() ) { - REAL max = mapdesc->calcVelocityRational( b->cpts, b->stride, b->order ); - REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; - if( jarc->bezierArc->order != 2 ) - arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 1 ); - else { - arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 1 ); - } - } else { - REAL max = mapdesc->calcVelocityNonrational( b->cpts, b->stride, b->order ); - REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; - if( jarc->bezierArc->order != 2 ) - arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 0 ); - else { - arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 0 ); - } - } -} - -/*------------------------------------------------------------------------- - * Subdivider::monotonize - break up a jordan arc into s,t-monotone - * components. This code will remove degenerate segments, including - * arcs of only a single point. - *------------------------------------------------------------------------- - */ -void -Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) -{ - TrimVertex *firstvert = jarc->pwlArc->pts; - TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1); - long uid = jarc->nuid; - arc_side side = jarc->getside(); - dir sdir = none; - dir tdir = none; - int degenerate = 1; - - int nudegenerate; - int change; - - TrimVertex *vert; - for( vert = firstvert; vert != lastvert; vert++ ) { - - nudegenerate = 1; - change = 0; - - /* check change relative to s axis, clear degenerate bit if needed */ - REAL sdiff = vert[1].param[0] - vert[0].param[0]; - if( sdiff == 0 ) { - if( sdir != same ) { - sdir = same; - change = 1; - } - } else if( sdiff < 0.0 ) { - if( sdir != down ) { - sdir = down; - change = 1; - } - nudegenerate = 0; - } else { - if( sdir != up ) { - sdir = up; - change = 1; - } - nudegenerate = 0; - } - - /* check change relative to t axis, clear degenerate bit if needed */ - REAL tdiff = vert[1].param[1] - vert[0].param[1]; - if( tdiff == 0 ) { - if( tdir != same ) { - tdir = same; - change = 1; - } - } else if( tdiff < 0.0 ) { - if( tdir != down ) { - tdir = down; - change = 1; - } - nudegenerate = 0; - } else { - if( tdir != up ) { - tdir = up; - change = 1; - } - nudegenerate = 0; - } - - if( change ) { - if( ! degenerate ) { - /* make last segment into separate pwl curve */ - jarc->pwlArc->npts = vert - firstvert + 1; - jarc = (new(arcpool) Arc( side, uid ))->append( jarc ); - jarc->pwlArc = new(pwlarcpool) PwlArc(); - bin.addarc( jarc ); - } - firstvert = jarc->pwlArc->pts = vert; - degenerate = nudegenerate; - } - } - jarc->pwlArc->npts = vert - firstvert + 1; - - if( degenerate ) { - /* remove jarc from circularly linked list */ - jarc->prev->next = jarc->next; - jarc->next->prev = jarc->prev; - - assert( jarc->prev->check( ) != 0 ); - assert( jarc->next->check( ) != 0 ); - - /* remove jarc from bin */ - bin.remove_this_arc( jarc ); - - jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; - jarc->deleteMe( arcpool ); - } -} - -/*------------------------------------------------------------------------- - * Subdivider::isMonotone - return true if arc is monotone AND non-degenerate - *------------------------------------------------------------------------- - */ -int -Subdivider::isMonotone( Arc_ptr jarc ) -{ - TrimVertex *firstvert = jarc->pwlArc->pts; - TrimVertex *lastvert = firstvert + (jarc->pwlArc->npts - 1); - - if( firstvert == lastvert ) return 1; - - TrimVertex *vert = firstvert; - enum dir sdir; - enum dir tdir; - - REAL diff = vert[1].param[0] - vert[0].param[0]; - if( diff == 0.0 ) - sdir = same; - else if( diff < 0.0 ) - sdir = down; - else - sdir = up; - - diff = vert[1].param[1] - vert[0].param[1]; - if( diff == 0.0 ) - tdir = same; - else if( diff < 0.0 ) - tdir = down; - else - tdir = up; - - if( (sdir == same) && (tdir == same) ) return 0; - - for( ++vert ; vert != lastvert; vert++ ) { - diff = vert[1].param[0] - vert[0].param[0]; - if( diff == 0.0 ) { - if( sdir != same ) return 0; - } else if( diff < 0.0 ) { - if( sdir != down ) return 0; - } else { - if( sdir != up ) return 0; - } - - diff = vert[1].param[1] - vert[0].param[1]; - if( diff == 0.0 ) { - if( tdir != same ) return 0; - } else if( diff < 0.0 ) { - if( tdir != down ) return 0; - } else { - if( tdir != up ) return 0; - } - } - return 1; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/monotonizer.h b/src/libs/mesa/glu/libnurbs/internals/monotonizer.h deleted file mode 100644 index e951084ff0..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/monotonizer.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * monotonizer.h - * - */ - -#ifndef __glumonotonizer_h_ -#define __glumonotonizer_h_ - -#include "mysetjmp.h" -#include "types.h" - -class Arc; -class ArcTessellator; -class Pool; -class Bin; -class PwlArcPool; -class Mapdesc; - -class Monotonizer { - ArcTessellator& arctessellator; - Pool& arcpool; - Pool& pwlarcpool; - jmp_buf& nurbsJmpBuf; - - enum dir { down, same, up, none }; - void tessellate( Arc *, REAL ); - void monotonize( Arc *, Bin & ); - int isMonotone( Arc * ); -public: - Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) - : arctessellator(at), arcpool(ap), pwlarcpool(p), nurbsJmpBuf(j) {} - int decompose( Bin &, REAL ); -}; -#endif /* __glumonotonizer_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/myassert.h b/src/libs/mesa/glu/libnurbs/internals/myassert.h deleted file mode 100644 index cbd6006f55..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/myassert.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * myassert.h - * - */ - -#ifndef __glumyassert_h_ -#define __glumyassert_h_ - -#ifdef STANDALONE -#define assert(EX) ((void)0) -#endif - -#ifdef LIBRARYBUILD -#include -#endif - -#ifdef GLBUILD -#define assert(EX) ((void)0) -#endif - -#endif /* __glumyassert_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/mycode.cc b/src/libs/mesa/glu/libnurbs/internals/mycode.cc deleted file mode 100644 index 3625cacd74..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mycode.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "mymath.h" - -#ifdef NEEDCEILF - -float ceilf( float x ) -{ - if( x < 0 ) { - float nx = -x; - int ix = (int) nx; - return (float) -ix; - } else { - int ix = (int) x; - if( x == (float) ix ) return x; - return (float) (ix+1); - } -} - -float floorf( float x ) -{ - if( x < 0 ) { - float nx = -x; - int ix = (int) nx; - if( nx == (float) ix ) return x; - return (float) -(ix+1); - } else { - int ix = (int) x; - return (float) ix; - } -} -#endif diff --git a/src/libs/mesa/glu/libnurbs/internals/mymath.h b/src/libs/mesa/glu/libnurbs/internals/mymath.h deleted file mode 100644 index 17ef7237fe..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mymath.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mymath.h - * - */ - -#ifndef __glumymath_h_ -#define __glumymath_h_ - -#ifdef GLBUILD -#define sqrtf gl_fsqrt -#endif - -#if defined(GLBUILD) || defined(STANDALONE) -#define M_SQRT2 1.41421356237309504880 -#define ceilf myceilf -#define floorf myfloorf -#define sqrtf sqrt -extern "C" double sqrt(double); -extern "C" float ceilf(float); -extern "C" float floorf(float); -#define NEEDCEILF -#endif - -#ifdef LIBRARYBUILD -#include -#endif - -#if !defined sqrtf -# define sqrtf(x) ((float)sqrt(x)) -#endif -#if !defined ceilf -# define ceilf(x) ((float)ceil(x)) -#endif -#if !defined floorf -# define floorf(x) ((float)floor(x)) -#endif - -#endif /* __glumymath_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/mysetjmp.h b/src/libs/mesa/glu/libnurbs/internals/mysetjmp.h deleted file mode 100644 index 2a3f6a87b3..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mysetjmp.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mysetjmp.h - * - */ - -#ifndef __glumysetjmp_h_ -#define __glumysetjmp_h_ - -#ifdef STANDALONE -struct JumpBuffer; -extern "C" JumpBuffer *newJumpbuffer( void ); -extern "C" void deleteJumpbuffer(JumpBuffer *); -extern "C" void mylongjmp( JumpBuffer *, int ); -extern "C" int mysetjmp( JumpBuffer * ); -#endif - -#ifdef GLBUILD -#define setjmp gl_setjmp -#define longjmp gl_longjmp -#endif - -#if defined(LIBRARYBUILD) || defined(GLBUILD) -#include -#include - -struct JumpBuffer { - jmp_buf buf; -}; - -inline JumpBuffer * -newJumpbuffer( void ) -{ - return (JumpBuffer *) malloc( sizeof( JumpBuffer ) ); -} - -inline void -deleteJumpbuffer(JumpBuffer *jb) -{ - free( (void *) jb); -} - -inline void -mylongjmp( JumpBuffer *j, int code ) -{ - ::longjmp( j->buf, code ); -} - -inline int -mysetjmp( JumpBuffer *j ) -{ - return setjmp( j->buf ); -} -#endif - -#endif /* __glumysetjmp_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/mystring.h b/src/libs/mesa/glu/libnurbs/internals/mystring.h deleted file mode 100644 index d2952da894..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/mystring.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mystring.h - * - */ - -#ifndef __glumystring_h_ -#define __glumystring_h_ - -#ifdef STANDALONE -typedef unsigned int size_t; -extern "C" void * memcpy(void *, const void *, size_t); -extern "C" void * memset(void *, int, size_t); -#endif - -#ifdef GLBUILD -#define memcpy(a,b,c) bcopy(b,a,c) -#define memset(a,b,c) bzero(a,c) -extern "C" void bcopy(const void *, void *, int); -extern "C" void bzero(void *, int); -#endif - -#ifdef LIBRARYBUILD -#include -#endif - -#endif /* __glumystring_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/nurbsconsts.h b/src/libs/mesa/glu/libnurbs/internals/nurbsconsts.h deleted file mode 100644 index acc5d7f31f..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/nurbsconsts.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * nurbsconsts.h - * - */ - -#ifndef __glunurbsconsts_h_ -#define __glunurbsconsts_h_ - -/* NURBS Properties - one set per map, - each takes a single INREAL arg */ -#define N_SAMPLING_TOLERANCE 1 -#define N_S_RATE 6 -#define N_T_RATE 7 -#define N_CLAMPFACTOR 13 -#define N_NOCLAMPING 0.0 -#define N_MINSAVINGS 14 -#define N_NOSAVINGSSUBDIVISION 0.0 - -/* NURBS Properties - one set per map, - each takes an enumerated value */ -#define N_CULLING 2 -#define N_NOCULLING 0.0 -#define N_CULLINGON 1.0 -#define N_SAMPLINGMETHOD 10 -#define N_NOSAMPLING 0.0 -#define N_FIXEDRATE 3.0 -#define N_DOMAINDISTANCE 2.0 -#define N_PARAMETRICDISTANCE 5.0 -#define N_PATHLENGTH 6.0 -#define N_SURFACEAREA 7.0 -#define N_OBJECTSPACE_PARA 8.0 -#define N_OBJECTSPACE_PATH 9.0 -#define N_BBOX_SUBDIVIDING 17 -#define N_NOBBOXSUBDIVISION 0.0 -#define N_BBOXTIGHT 1.0 -#define N_BBOXROUND 2.0 - -/* NURBS Rendering Properties - one set per renderer - each takes an enumerated value */ -#define N_DISPLAY 3 -#define N_FILL 1.0 -#define N_OUTLINE_POLY 2.0 -#define N_OUTLINE_TRI 3.0 -#define N_OUTLINE_QUAD 4.0 -#define N_OUTLINE_PATCH 5.0 -#define N_OUTLINE_PARAM 6.0 -#define N_OUTLINE_PARAM_S 7.0 -#define N_OUTLINE_PARAM_ST 8.0 -#define N_OUTLINE_SUBDIV 9.0 -#define N_OUTLINE_SUBDIV_S 10.0 -#define N_OUTLINE_SUBDIV_ST 11.0 -#define N_ISOLINE_S 12.0 -#define N_ERRORCHECKING 4 -#define N_NOMSG 0.0 -#define N_MSG 1.0 - -/* GL 4.0 propeties not defined above */ -#ifndef N_PIXEL_TOLERANCE -#define N_PIXEL_TOLERANCE N_SAMPLING_TOLERANCE -#define N_ERROR_TOLERANCE 20 -#define N_SUBDIVISIONS 5 -#define N_TILES 8 -#define N_TMP1 9 -#define N_TMP2 N_SAMPLINGMETHOD -#define N_TMP3 11 -#define N_TMP4 12 -#define N_TMP5 N_CLAMPFACTOR -#define N_TMP6 N_MINSAVINGS -#define N_S_STEPS N_S_RATE -#define N_T_STEPS N_T_RATE -#endif - -/* NURBS Rendering Properties - one set per map, - each takes an INREAL matrix argument */ -#define N_CULLINGMATRIX 1 -#define N_SAMPLINGMATRIX 2 -#define N_BBOXMATRIX 3 - - -/* NURBS Rendering Properties - one set per map, - each takes an INREAL vector argument */ -#define N_BBOXSIZE 4 - -/* type argument for trimming curves */ -#ifndef N_P2D -#define N_P2D 0x8 -#define N_P2DR 0xd -#endif - -#endif /* __glunurbsconsts_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/nurbsinterfac.cc b/src/libs/mesa/glu/libnurbs/internals/nurbsinterfac.cc deleted file mode 100644 index 520bd419ea..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/nurbsinterfac.cc +++ /dev/null @@ -1,537 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * nurbsinterfac.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "nurbsconsts.h" -#include "nurbstess.h" -#include "bufpool.h" -#include "quilt.h" -#include "displaylist.h" -#include "knotvector.h" -#include "mapdesc.h" - -#define THREAD( work, arg, cleanup ) \ - if( dl ) {\ - arg->save = 1;\ - dl->append( (PFVS)&NurbsTessellator::work, (void *) arg, (PFVS)&NurbsTessellator::cleanup );\ - } else {\ - arg->save = 0;\ - work( arg );\ - } - -#define THREAD2( work ) \ - if( dl ) {\ - dl->append( (PFVS)&NurbsTessellator::work, 0, 0 );\ - } else {\ - work( );\ - } - -NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e) - : maplist( backend ), - backend( c, e ), - subdivider( renderhints, backend ), - o_pwlcurvePool( sizeof( O_pwlcurve ), 32, "o_pwlcurvePool" ), - o_nurbscurvePool( sizeof( O_nurbscurve ), 32, "o_nurbscurvePool"), - o_curvePool( sizeof( O_curve ), 32, "o_curvePool" ), - o_trimPool( sizeof( O_trim ), 32, "o_trimPool" ), - o_surfacePool( sizeof( O_surface ), 1, "o_surfacePool" ), - o_nurbssurfacePool( sizeof( O_nurbssurface ), 4, "o_nurbssurfacePool" ), - propertyPool( sizeof( Property ), 32, "propertyPool" ), - quiltPool( sizeof( Quilt ), 32, "quiltPool" ) -{ - dl = 0; - inSurface = 0; - inCurve = 0; - inTrim = 0; - playBack = 0; - jumpbuffer = newJumpbuffer(); - subdivider.setJumpbuffer( jumpbuffer ); -} - -NurbsTessellator::~NurbsTessellator( void ) -{ - if( inTrim ) { - do_nurbserror( 12 ); - endtrim(); - } - - if( inSurface ) { - *nextNurbssurface = 0; - do_freeall(); - } - - if (jumpbuffer) { - deleteJumpbuffer(jumpbuffer); - jumpbuffer= 0; - } -} - -/*----------------------------------------------------------------------------- - * bgnsurface - allocate and initialize an o_surface structure - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::bgnsurface( long nuid ) -{ - O_surface *o_surface = new(o_surfacePool) O_surface; - o_surface->nuid = nuid; - THREAD( do_bgnsurface, o_surface, do_freebgnsurface ); -} - -/*----------------------------------------------------------------------------- - * bgncurve - allocate an initialize an o_curve structure - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::bgncurve( long nuid ) -{ - O_curve *o_curve = new(o_curvePool) O_curve; - o_curve->nuid = nuid; - THREAD( do_bgncurve, o_curve, do_freebgncurve ); -} -/*----------------------------------------------------------------------------- - * endcurve - - * - * Client: - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::endcurve( void ) -{ - THREAD2( do_endcurve ); -} - -/*----------------------------------------------------------------------------- - * endsurface - user level end of surface call - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::endsurface( void ) -{ - THREAD2( do_endsurface ); -} - - -/*----------------------------------------------------------------------------- - * bgntrim - allocate and initialize a new trim loop structure (o_trim ) - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::bgntrim( void ) -{ - O_trim *o_trim = new(o_trimPool) O_trim; - THREAD( do_bgntrim, o_trim, do_freebgntrim ); -} - -/*----------------------------------------------------------------------------- - * endtrim - - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::endtrim( void ) -{ - THREAD2( do_endtrim ); -} - - -/*----------------------------------------------------------------------------- - * pwlcurve - - * - * count - number of points on curve - * array - array of points on curve - * byte_stride - distance between points in bytes - * type - valid data flag - * - * Client: Gl user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long type ) -{ - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - isDataValid = 0; - return; - } - - if ( (type != N_P2D) && (type != N_P2DR) ) { - do_nurbserror( 22 ); - isDataValid = 0; - return; - } - if( count < 0 ) { - do_nurbserror( 33 ); - isDataValid = 0; - return; - } - if( byte_stride < 0 ) { - do_nurbserror( 34 ); - isDataValid = 0; - return; - } - -#ifdef NOTDEF - if( mapdesc->isRational() ) { - INREAL *p = array; - INREAL x = p[0]; INREAL y = p[1]; INREAL w = p[2]; - p = (INREAL *) (((char *) p) + byte_stride); - for( long i = 1; i != count; i++ ) { - if( p[0] == x && p[1] == y && p[2] == w ) break; - x = p[0]; y = p[1]; w = p[2]; - p = (INREAL *) (((char *) p) + byte_stride); - } - if( i != count ) { - do_nurbserror( 37 ); - _glu_dprintf( "point %d (%f,%f)\n", i, x, y ); - isDataValid = 0; - return; - } - } else { - INREAL *p = array; - INREAL x = p[0]; INREAL y = p[1]; - p = (INREAL *) (((char *) p) + byte_stride); - for( long i = 1; i != count; i++ ) { - if( p[0] == x && p[1] == y ) break; - x = p[0]; y = p[1]; - p = (INREAL *) (((char *) p) + byte_stride); - } - if( i != count ) { - do_nurbserror( 37 ); - _glu_dprintf( "point %d (%f,%f)\n", i, x, y ); - isDataValid = 0; - return; - } - } -#endif - - O_pwlcurve *o_pwlcurve = new(o_pwlcurvePool) O_pwlcurve( type, count, array, byte_stride, extTrimVertexPool.get((int)count) ); - THREAD( do_pwlcurve, o_pwlcurve, do_freepwlcurve ); -} - - -/*----------------------------------------------------------------------------- - * nurbscurve - - * - * Client: GL user - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::nurbscurve( - long nknots, /* number of p knots */ - INREAL knot[], /* nondecreasing knot values in p */ - long byte_stride, /* distance in bytes between control points */ - INREAL ctlarray[], /* pointer to first control point */ - long order, /* order of spline */ - long type ) /* description of range space */ -{ - - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - isDataValid = 0; - return; - } - - if( ctlarray == 0 ) { - do_nurbserror( 36 ); - isDataValid = 0; - return; - } - - if( byte_stride < 0 ) { - do_nurbserror( 34 ); - isDataValid = 0; - return; - } - - Knotvector knots; - - knots.init( nknots, byte_stride, order, knot ); - if( do_check_knots( &knots, "curve" ) ) return; - - O_nurbscurve *o_nurbscurve = new(o_nurbscurvePool) O_nurbscurve(type); - o_nurbscurve->bezier_curves = new(quiltPool) Quilt(mapdesc); - o_nurbscurve->bezier_curves->toBezier( knots,ctlarray, mapdesc->getNcoords() ); - - THREAD( do_nurbscurve, o_nurbscurve, do_freenurbscurve ); -} - - -/*----------------------------------------------------------------------------- - * nurbssurface - - * - * Client: User routine - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::nurbssurface( - long sknot_count, /* number of s knots */ - INREAL sknot[], /* nondecreasing knot values in s */ - long tknot_count, /* number of t knots */ - INREAL tknot[], /* nondecreasing knot values in t */ - long s_byte_stride, /* s step size in memory bytes */ - long t_byte_stride, /* t step size in memory bytes */ - INREAL ctlarray[], /* pointer to first control point */ - long sorder, /* order of the spline in s parameter */ - long torder, /* order of the spline in t parameter */ - long type) /* description of range space */ -{ - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - isDataValid = 0; - return; - } - - if( s_byte_stride < 0 ) { - do_nurbserror( 34 ); - isDataValid = 0; - return; - } - - if( t_byte_stride < 0 ) { - do_nurbserror( 34 ); - isDataValid = 0; - return; - } - - Knotvector sknotvector, tknotvector; - - sknotvector.init( sknot_count, s_byte_stride, sorder, sknot ); - if( do_check_knots( &sknotvector, "surface" ) ) return; - - tknotvector.init( tknot_count, t_byte_stride, torder, tknot ); - if( do_check_knots( &tknotvector, "surface" ) ) return; - - O_nurbssurface *o_nurbssurface = new(o_nurbssurfacePool) O_nurbssurface(type); - o_nurbssurface->bezier_patches = new(quiltPool) Quilt(mapdesc); - - o_nurbssurface->bezier_patches->toBezier( sknotvector, tknotvector, - ctlarray, mapdesc->getNcoords() ); - THREAD( do_nurbssurface, o_nurbssurface, do_freenurbssurface ); -} - - -/*----------------------------------------------------------------------------- - * setnurbsproperty - - * - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::setnurbsproperty( long tag, INREAL value ) -{ - if( ! renderhints.isProperty( tag ) ) { - do_nurbserror( 26 ); - } else { - Property *prop = new(propertyPool) Property( tag, value ); - THREAD( do_setnurbsproperty, prop, do_freenurbsproperty ); - } -} - -/*----------------------------------------------------------------------------- - * setnurbsproperty - - * - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::setnurbsproperty( long type, long tag, INREAL value ) -{ - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - return; - } - - if( ! mapdesc->isProperty( tag ) ) { - do_nurbserror( 26 ); - return; - } - - Property *prop = new(propertyPool) Property( type, tag, value ); - THREAD( do_setnurbsproperty2, prop, do_freenurbsproperty ); -} - - -/*----------------------------------------------------------------------------- - * getnurbsproperty - - * - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::getnurbsproperty( long tag, INREAL *value ) -{ - if( renderhints.isProperty( tag ) ) { - *value = renderhints.getProperty( tag ); - } else { - do_nurbserror( 26 ); - } -} - -/*----------------------------------------------------------------------------- - * getnurbsproperty - - * - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::getnurbsproperty( long type, long tag, INREAL *value ) -{ - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) - do_nurbserror( 35 ); - - if( mapdesc->isProperty( tag ) ) { - *value = mapdesc->getProperty( tag ); - } else { - do_nurbserror( 26 ); - } -} - -/*-------------------------------------------------------------------------- - * setnurbsproperty - accept a user supplied matrix as culling or sampling mat - *-------------------------------------------------------------------------- - */ - -void -NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat ) -{ - // XXX - cannot be put in display list - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - isDataValid = 0; - } else if( purpose == N_BBOXSIZE ) { - mapdesc->setBboxsize( mat ); - } else { -#ifndef NDEBUG - _glu_dprintf( "ERRORRORRORR!!!\n"); -#endif - } -} - -/*-------------------------------------------------------------------------- - * setnurbsproperty - accept a user supplied matrix as culling or sampling mat - *-------------------------------------------------------------------------- - */ - -void -NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat, - long rstride, long cstride ) -{ - // XXX - cannot be put in display list - Mapdesc *mapdesc = maplist.locate( type ); - - if( mapdesc == 0 ) { - do_nurbserror( 35 ); - isDataValid = 0; - } else if( purpose == N_CULLINGMATRIX ) { - mapdesc->setCmat( mat, rstride, cstride ); - } else if( purpose == N_SAMPLINGMATRIX ) { - mapdesc->setSmat( mat, rstride, cstride ); - } else if( purpose == N_BBOXMATRIX ) { - mapdesc->setBmat( mat, rstride, cstride ); - } else { -#ifndef NDEBUG - _glu_dprintf( "ERRORRORRORR!!!\n"); -#endif - } -} - -void -NurbsTessellator::redefineMaps( void ) -{ - maplist.initialize(); -} - -void -NurbsTessellator::defineMap( long type, long rational, long ncoords ) -{ - maplist.define( type, (int) rational, (int) ncoords ); -} - -void -NurbsTessellator::discardRecording( void *_dl ) -{ - delete (DisplayList *) _dl; -} - -void * -NurbsTessellator::beginRecording( void ) -{ - dl = new DisplayList( this ); - return (void *) dl; -} - -void -NurbsTessellator::endRecording( void ) -{ - dl->endList(); - dl = 0; -} - -void -NurbsTessellator::playRecording( void *_dl ) -{ - playBack = 1; - bgnrender(); - ((DisplayList *)_dl)->play(); - endrender(); - playBack = 0; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/nurbstess.cc b/src/libs/mesa/glu/libnurbs/internals/nurbstess.cc deleted file mode 100644 index 68dfd95f39..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/nurbstess.cc +++ /dev/null @@ -1,691 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * nurbstess.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mysetjmp.h" -#include "mystdio.h" -#include "nurbsconsts.h" -#include "nurbstess.h" -#include "bufpool.h" -#include "quilt.h" -#include "knotvector.h" -#include "mapdesc.h" -#include "maplist.h" - -void -NurbsTessellator::set_domain_distance_u_rate(REAL u_rate) -{ - subdivider.set_domain_distance_u_rate(u_rate); -} - -void -NurbsTessellator::set_domain_distance_v_rate(REAL v_rate) -{ - subdivider.set_domain_distance_v_rate(v_rate); -} - -void -NurbsTessellator::set_is_domain_distance_sampling(int flag) -{ - subdivider.set_is_domain_distance_sampling(flag); -} - -void -NurbsTessellator::resetObjects( void ) -{ - subdivider.clear(); -} - -void -NurbsTessellator::makeobj( int ) -{ -#ifndef NDEBUG - _glu_dprintf( "makeobj\n" ); -#endif -} - -void -NurbsTessellator::closeobj( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "closeobj\n" ); -#endif -} - -void -NurbsTessellator::bgnrender( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "bgnrender\n" ); -#endif -} - -void -NurbsTessellator::endrender( void ) -{ -#ifndef NDEBUG - _glu_dprintf( "endrender\n" ); -#endif -} - -/*----------------------------------------------------------------------------- - * do_freebgnsurface - free o_surface structure - * - * Client: do_freeall(), bgnsurface() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_freebgnsurface( O_surface *o_surface ) -{ - o_surface->deleteMe( o_surfacePool ); -} - - -/*----------------------------------------------------------------------------- - * do_bgnsurface - begin the display of a surface - * - * Client: bgnsurface() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_bgnsurface( O_surface *o_surface ) -{ - if( inSurface ) { - do_nurbserror( 27 ); - endsurface(); - } - inSurface = 1; - - if( ! playBack ) bgnrender(); - - isTrimModified = 0; - isSurfaceModified = 0; - isDataValid = 1; - numTrims = 0; - currentSurface = o_surface; - nextTrim = &( currentSurface->o_trim ); - nextNurbssurface = &( currentSurface->o_nurbssurface ); -} - -/*----------------------------------------------------------------------------- - * do_bgncurve - begin the display of a curve - * - * Client: bgncurve() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_bgncurve( O_curve *o_curve ) -{ - if ( inCurve ) { - do_nurbserror( 6 ); - endcurve(); - } - - inCurve = 1; - currentCurve = o_curve; - currentCurve->curvetype = ct_none; - - if( inTrim ) { - if( *nextCurve != o_curve ) { - isCurveModified = 1; - *nextCurve = o_curve; - } - } else { - if( ! playBack ) bgnrender(); - isDataValid = 1; - } - nextCurve = &(o_curve->next); - nextPwlcurve = &(o_curve->curve.o_pwlcurve); - nextNurbscurve = &(o_curve->curve.o_nurbscurve); -} - -/*----------------------------------------------------------------------------- - * do_endcurve - - * - * Client: endcurve() - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::do_endcurve( void ) -{ - if( ! inCurve ) { - do_nurbserror( 7 ); - return; - } - inCurve = 0; - - *nextCurve = 0; - if (currentCurve->curvetype == ct_nurbscurve) - *nextNurbscurve = 0; - else - *nextPwlcurve = 0; - - if ( ! inTrim ) { - if( ! isDataValid ) { - do_freecurveall( currentCurve ); - return; - } - - int errval; - errval = ::mysetjmp( jumpbuffer ); - if( errval == 0 ) { - if( currentCurve->curvetype == ct_nurbscurve ) { - subdivider.beginQuilts(); - for( O_nurbscurve *n = currentCurve->curve.o_nurbscurve; n != 0; n = n->next ) - subdivider.addQuilt( n->bezier_curves ); - subdivider.endQuilts(); - subdivider.drawCurves(); - if( ! playBack ) endrender(); - } else { - /* XXX */ - if( ! playBack ) endrender(); - /*do_draw_pwlcurve( currentCurve->curve.o_pwlcurve ) */; - do_nurbserror( 9 ); - } - } else { - if( ! playBack ) endrender(); - do_nurbserror( errval ); - } - do_freecurveall( currentCurve ); - resetObjects(); - } -} - -/*----------------------------------------------------------------------------- - * do_endsurface - mark end of surface, display surface, free immediate data - * - * Client: - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_endsurface( void ) -{ - if( inTrim ) { - do_nurbserror( 12 ); - endtrim(); - } - - if( ! inSurface ) { - do_nurbserror( 13 ); - return; - } - inSurface = 0; - - *nextNurbssurface = 0; - - if( ! isDataValid ) { - do_freeall( ); - return; - } - - if( *nextTrim != 0 ) { - isTrimModified = 1; - *nextTrim = 0; - } - - int errval; - - errval = ::mysetjmp( jumpbuffer ); - if( errval == 0 ) { - if( numTrims > 0 ) { - - subdivider.beginTrims(); - for( O_trim *trim = currentSurface->o_trim; trim; trim = trim->next ) { - subdivider.beginLoop(); - for( O_curve *curve = trim->o_curve; curve; curve = curve->next ) { - curve->used = 0; - assert( curve->curvetype != ct_none ); - if (curve->curvetype == ct_pwlcurve) { - O_pwlcurve *c = curve->curve.o_pwlcurve; - subdivider.addArc( c->npts, c->pts, curve->nuid ); - } else { - Quilt *quilt = curve->curve.o_nurbscurve->bezier_curves; - Quiltspec *qspec = quilt->qspec; - REAL *cpts = quilt->cpts + qspec->offset; - REAL *cptsend = cpts + (qspec->width * qspec->order * qspec->stride); - for( ; cpts != cptsend; cpts += qspec->order*qspec->stride ) - subdivider.addArc( cpts, quilt, curve->nuid ); - } - } - subdivider.endLoop(); - } - subdivider.endTrims(); - } - - subdivider.beginQuilts(); - for( O_nurbssurface *n = currentSurface->o_nurbssurface; n; n = n->next ) - subdivider.addQuilt( n->bezier_patches ); - subdivider.endQuilts(); - subdivider.drawSurfaces( currentSurface->nuid ); - if( ! playBack ) endrender(); - } else { - if( ! playBack ) endrender(); - do_nurbserror( errval ); - } - - do_freeall( ); - resetObjects(); -} - -/*----------------------------------------------------------------------------- - * do_freeall - free all data allocated in immediate mode - * - * Client: - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_freeall( void ) -{ - for( O_trim *o_trim = currentSurface->o_trim; o_trim; ) { - O_trim *next_o_trim = o_trim->next; - for( O_curve *curve = o_trim->o_curve; curve; ) { - O_curve *next_o_curve = curve->next; - do_freecurveall( curve ); - curve = next_o_curve; - } - if( o_trim->save == 0 ) do_freebgntrim( o_trim ); - o_trim = next_o_trim; - } - - O_nurbssurface *nurbss, *next_nurbss; - for( nurbss= currentSurface->o_nurbssurface; nurbss; nurbss = next_nurbss) { - next_nurbss = nurbss->next; - if( nurbss->save == 0 ) - do_freenurbssurface( nurbss ); - else - nurbss->used = 0; - } - - if( currentSurface->save == 0 ) do_freebgnsurface( currentSurface ); -} - -void -NurbsTessellator::do_freecurveall( O_curve *curve ) -{ - assert( curve->curvetype != ct_none ); - - if( curve->curvetype == ct_nurbscurve ) { - O_nurbscurve *ncurve, *next_ncurve; - for( ncurve=curve->curve.o_nurbscurve; ncurve; ncurve=next_ncurve ) { - next_ncurve = ncurve->next; - if( ncurve->save == 0 ) - do_freenurbscurve( ncurve ); - else - ncurve->used = 0; - } - } else { - O_pwlcurve *pcurve, *next_pcurve; - for( pcurve=curve->curve.o_pwlcurve; pcurve; pcurve=next_pcurve ) { - next_pcurve = pcurve->next; - if( pcurve->save == 0 ) - do_freepwlcurve( pcurve ); - else - pcurve->used = 0; - } - } - if( curve->save == 0 ) - do_freebgncurve( curve ); -} - - -/*----------------------------------------------------------------------------- - * do_freebgntrim - free the space allocated for a trim loop - * - * Client: - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_freebgntrim( O_trim *o_trim ) -{ - o_trim->deleteMe( o_trimPool ); -} - - -/*----------------------------------------------------------------------------- - * do_bgntrim - link in a trim loop to the current trimmed surface description - * - * Client: bgntrim() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_bgntrim( O_trim *o_trim ) -{ - - if( ! inSurface ) { - do_nurbserror( 15 ); - bgnsurface( 0 ); - inSurface = 2; - } - - if( inTrim ) { - do_nurbserror( 16 ); - endtrim(); - } - inTrim = 1; - - if( *nextTrim != o_trim ) { - isTrimModified = 1; - *nextTrim = o_trim; - } - - currentTrim = o_trim; - nextTrim = &(o_trim->next); - nextCurve = &(o_trim->o_curve); -} - - -/*----------------------------------------------------------------------------- - * do_endtrim - mark the end of the current trim loop - * - * Client: endtrim() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_endtrim( void ) -{ - if( ! inTrim ) { - do_nurbserror( 17 ); - return; - } - inTrim = 0; - - if( currentTrim->o_curve == 0 ) { - do_nurbserror( 18 ); - isDataValid = 0; - } - - numTrims++; - - if( *nextCurve != 0 ) { - isTrimModified = 1; - *nextCurve = 0; - } -} - -/*----------------------------------------------------------------------------- - * do_freepwlcurve - - * - * Client: - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_freepwlcurve( O_pwlcurve *o_pwlcurve ) -{ - o_pwlcurve->deleteMe( o_pwlcurvePool ); -} - -void -NurbsTessellator::do_freebgncurve( O_curve *o_curve ) -{ - o_curve->deleteMe( o_curvePool ); -} - -/*----------------------------------------------------------------------------- - * do_pwlcurve - link in pwl trim loop to the current surface description - * - * Client: pwlcurve() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve ) -{ - if( ! inTrim ) { - do_nurbserror( 19 ); - if( o_pwlcurve->save == 0 ) - do_freepwlcurve(o_pwlcurve ); - return; - } - - if( ! inCurve ) { - bgncurve( 0 ); - inCurve = 2; - } - - if( o_pwlcurve->used ) { - do_nurbserror( 20 ); - isDataValid = 0; - return; - } else - o_pwlcurve->used = 1; - - if( currentCurve->curvetype == ct_none ) { - currentCurve->curvetype = ct_pwlcurve; - } else if( currentCurve->curvetype != ct_pwlcurve ) { - do_nurbserror( 21 ); - isDataValid = 0; - return; - } - - if( *nextPwlcurve != o_pwlcurve ) { - isCurveModified = 1; - *nextPwlcurve = o_pwlcurve; - } - nextPwlcurve = &(o_pwlcurve->next); - - if( o_pwlcurve->owner != currentCurve ) { - isCurveModified = 1; - o_pwlcurve->owner = currentCurve; - } - - if( (inCurve == 2) ) - endcurve(); -} - - -/*----------------------------------------------------------------------------- - * do_freenurbscurve - - * - * Client: - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_freenurbscurve( O_nurbscurve *o_nurbscurve ) -{ - o_nurbscurve->bezier_curves->deleteMe( quiltPool ); - o_nurbscurve->deleteMe( o_nurbscurvePool ); -} - - -/*----------------------------------------------------------------------------- - * do_nurbscurve - - * - * Client: nurbscurve() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_nurbscurve( O_nurbscurve *o_nurbscurve ) -{ - if ( ! inCurve ) { - bgncurve( 0 ); - inCurve = 2; - } - - if( o_nurbscurve->used ) { - /* error - curve was already called in current surface */ - do_nurbserror( 23 ); - isDataValid = 0; - return; - } else - o_nurbscurve->used = 1; - - if( currentCurve->curvetype == ct_none ) { - currentCurve->curvetype = ct_nurbscurve; - } else if( currentCurve->curvetype != ct_nurbscurve ) { - do_nurbserror( 24 ); - isDataValid = 0; - return; - } - - if( *nextNurbscurve != o_nurbscurve ) { - isCurveModified = 1; - *nextNurbscurve = o_nurbscurve; - } - - nextNurbscurve = &(o_nurbscurve->next); - - if( o_nurbscurve->owner != currentCurve ) { - isCurveModified = 1; - o_nurbscurve->owner = currentCurve; - } - - if( o_nurbscurve->owner == 0 ) - isCurveModified = 1; - - if( inCurve == 2 ) - endcurve(); -} - - -/*----------------------------------------------------------------------------- - * do_freenurbssurface - - * - * Client: - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::do_freenurbssurface( O_nurbssurface *o_nurbssurface ) -{ - o_nurbssurface->bezier_patches->deleteMe( quiltPool ); - o_nurbssurface->deleteMe( o_nurbssurfacePool ); -} - -/*----------------------------------------------------------------------------- - * do_nurbssurface - - * - * Client: nurbssurface() - *----------------------------------------------------------------------------- - */ -void -NurbsTessellator::do_nurbssurface( O_nurbssurface *o_nurbssurface ) -{ - if( ! inSurface ) { - bgnsurface( 0 ); - inSurface = 2; - } - - if( o_nurbssurface->used ) { - /* error - surface was already called in current block */ - do_nurbserror( 25 ); - isDataValid = 0; - return; - } else - o_nurbssurface->used = 1; - - if( *nextNurbssurface != o_nurbssurface ) { - isSurfaceModified = 1; - *nextNurbssurface = o_nurbssurface; - } - - if( o_nurbssurface->owner != currentSurface ) { - isSurfaceModified = 1; - o_nurbssurface->owner = currentSurface; - } - nextNurbssurface = &(o_nurbssurface->next); - - if( inSurface == 2 ) - endsurface(); -} - - -/*----------------------------------------------------------------------------- - * do_freenurbsproperty - * - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::do_freenurbsproperty( Property *prop ) -{ - prop->deleteMe( propertyPool ); -} - - -/*----------------------------------------------------------------------------- - * do_setnurbsproperty - - * - *----------------------------------------------------------------------------- - */ - -void -NurbsTessellator::do_setnurbsproperty( Property *prop ) -{ - renderhints.setProperty( prop->tag, prop->value ); - if( prop->save == 0 ) - do_freenurbsproperty( prop ); -} - -void -NurbsTessellator::do_setnurbsproperty2( Property *prop ) -{ - Mapdesc *mapdesc = maplist.find( prop->type ); - - mapdesc->setProperty( prop->tag, prop->value ); - if( prop->save == 0 ) - do_freenurbsproperty( prop ); -} - -void -NurbsTessellator::errorHandler( int ) -{ -} - -void -NurbsTessellator::do_nurbserror( int msg ) -{ - errorHandler( msg ); -} - -int -NurbsTessellator::do_check_knots( Knotvector *knots, const char *msg ) -{ - int status = knots->validate(); - if( status ) { - do_nurbserror( status ); - if( renderhints.errorchecking != N_NOMSG ) knots->show( msg ); - } - return status; -} - - - - - diff --git a/src/libs/mesa/glu/libnurbs/internals/nurbstess.h b/src/libs/mesa/glu/libnurbs/internals/nurbstess.h deleted file mode 100644 index a6869002fb..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/nurbstess.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * nurbstess.h - * - */ - -#ifndef __glunurbstess_h_ -#define __glunurbstess_h_ - -#include "mysetjmp.h" -#include "subdivider.h" -#include "renderhints.h" -#include "backend.h" -#include "maplist.h" -#include "reader.h" -#include "nurbsconsts.h" - -struct Knotvector; -class Quilt; -class DisplayList; -class BasicCurveEvaluator; -class BasicSurfaceEvaluator; - -class NurbsTessellator { -public: - NurbsTessellator( BasicCurveEvaluator &c, - BasicSurfaceEvaluator &e ); - virtual ~NurbsTessellator( void ); - - void getnurbsproperty( long, INREAL * ); - void getnurbsproperty( long, long, INREAL * ); - void setnurbsproperty( long, INREAL ); - void setnurbsproperty( long, long, INREAL ); - void setnurbsproperty( long, long, INREAL * ); - void setnurbsproperty( long, long, INREAL *, long, long ); - - // called before a tessellation begins/ends - virtual void bgnrender( void ); - virtual void endrender( void ); - - // called to make a display list of the output vertices - virtual void makeobj( int n ); - virtual void closeobj( void ); - - // called when a error occurs - virtual void errorHandler( int ); - - void bgnsurface( long ); - void endsurface( void ); - void bgntrim( void ); - void endtrim( void ); - void bgncurve( long ); - void endcurve( void ); - void pwlcurve( long, INREAL[], long, long ); - void nurbscurve( long, INREAL[], long, INREAL[], long, long ); - void nurbssurface( long, INREAL[], long, INREAL[], long, long, - INREAL[], long, long, long ); - - void defineMap( long, long, long ); - void redefineMaps( void ); - - // recording of input description - void discardRecording( void * ); - void * beginRecording( void ); - void endRecording( void ); - void playRecording( void * ); - - //for optimizing untrimmed nurbs in the case of domain distance sampling - void set_domain_distance_u_rate(REAL u_rate); - void set_domain_distance_v_rate(REAL v_rate); - void set_is_domain_distance_sampling(int flag); - - -protected: - Renderhints renderhints; - Maplist maplist; - Backend backend; - -private: - - void resetObjects( void ); - int do_check_knots( Knotvector *, const char * ); - void do_nurbserror( int ); - void do_bgncurve( O_curve * ); - void do_endcurve( void ); - void do_freeall( void ); - void do_freecurveall( O_curve * ); - void do_freebgntrim( O_trim * ); - void do_freebgncurve( O_curve * ); - void do_freepwlcurve( O_pwlcurve * ); - void do_freenurbscurve( O_nurbscurve * ); - void do_freenurbssurface( O_nurbssurface * ); - void do_freebgnsurface( O_surface * ); - void do_bgnsurface( O_surface * ); - void do_endsurface( void ); - void do_bgntrim( O_trim * ); - void do_endtrim( void ); - void do_pwlcurve( O_pwlcurve * ); - void do_nurbscurve( O_nurbscurve * ); - void do_nurbssurface( O_nurbssurface * ); - void do_freenurbsproperty( Property * ); - void do_setnurbsproperty( Property * ); - void do_setnurbsproperty2( Property * ); - - Subdivider subdivider; - JumpBuffer* jumpbuffer; - Pool o_pwlcurvePool; - Pool o_nurbscurvePool; - Pool o_curvePool; - Pool o_trimPool; - Pool o_surfacePool; - Pool o_nurbssurfacePool; - Pool propertyPool; -public: - Pool quiltPool; -private: - TrimVertexPool extTrimVertexPool; - - int inSurface; /* bgnsurface seen */ - int inCurve; /* bgncurve seen */ - int inTrim; /* bgntrim seen */ - int isCurveModified; /* curve changed */ - int isTrimModified; /* trim curves changed */ - int isSurfaceModified; /* surface changed */ - int isDataValid; /* all data is good */ - int numTrims; /* valid trim regions */ - int playBack; - - O_trim** nextTrim; /* place to link o_trim */ - O_curve** nextCurve; /* place to link o_curve */ - O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */ - O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */ - O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */ - - O_surface* currentSurface; - O_trim* currentTrim; - O_curve* currentCurve; - - DisplayList *dl; - -}; - -#endif /* __glunurbstess_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/patch.cc b/src/libs/mesa/glu/libnurbs/internals/patch.cc deleted file mode 100644 index 808baa69e4..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/patch.cc +++ /dev/null @@ -1,504 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * patch.c++ - * - */ - -#include -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "mymath.h" -#include "mystring.h" -#include "patch.h" -#include "mapdesc.h" -#include "quilt.h" -#include "nurbsconsts.h" -#include "simplemath.h" //for glu_abs function in ::singleStep(); - - -/*-------------------------------------------------------------------------- - * Patch - copy patch from quilt and transform control points - *-------------------------------------------------------------------------- - */ - -Patch::Patch( Quilt_ptr geo, REAL *pta, REAL *ptb, Patch *n ) -{ -/* pspec[i].range is uninit here */ - mapdesc = geo->mapdesc; - cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; - notInBbox = mapdesc->isBboxSubdividing() ? 1 : 0; - needsSampling = mapdesc->isRangeSampling() ? 1 : 0; - pspec[0].order = geo->qspec[0].order; - pspec[1].order = geo->qspec[1].order; - pspec[0].stride = pspec[1].order * MAXCOORDS; - pspec[1].stride = MAXCOORDS; - - /* transform control points to sampling and culling spaces */ - REAL *ps = geo->cpts; - geo->select( pta, ptb ); - ps += geo->qspec[0].offset; - ps += geo->qspec[1].offset; - ps += geo->qspec[0].index * geo->qspec[0].order * geo->qspec[0].stride; - ps += geo->qspec[1].index * geo->qspec[1].order * geo->qspec[1].stride; - - if( needsSampling ) { - mapdesc->xformSampling( ps, geo->qspec[0].order, geo->qspec[0].stride, - geo->qspec[1].order, geo->qspec[1].stride, - spts, pspec[0].stride, pspec[1].stride ); - } - - if( cullval == CULL_ACCEPT ) { - mapdesc->xformCulling( ps, geo->qspec[0].order, geo->qspec[0].stride, - geo->qspec[1].order, geo->qspec[1].stride, - cpts, pspec[0].stride, pspec[1].stride ); - } - - if( notInBbox ) { - mapdesc->xformBounding( ps, geo->qspec[0].order, geo->qspec[0].stride, - geo->qspec[1].order, geo->qspec[1].stride, - bpts, pspec[0].stride, pspec[1].stride ); - } - - /* set scale range */ - pspec[0].range[0] = geo->qspec[0].breakpoints[geo->qspec[0].index]; - pspec[0].range[1] = geo->qspec[0].breakpoints[geo->qspec[0].index+1]; - pspec[0].range[2] = pspec[0].range[1] - pspec[0].range[0]; - - pspec[1].range[0] = geo->qspec[1].breakpoints[geo->qspec[1].index]; - pspec[1].range[1] = geo->qspec[1].breakpoints[geo->qspec[1].index+1]; - pspec[1].range[2] = pspec[1].range[1] - pspec[1].range[0]; - - // may need to subdivide to match range of sub-patch - if( pspec[0].range[0] != pta[0] ) { - assert( pspec[0].range[0] < pta[0] ); - Patch lower( *this, 0, pta[0], 0 ); - *this = lower; - } - - if( pspec[0].range[1] != ptb[0] ) { - assert( pspec[0].range[1] > ptb[0] ); - Patch upper( *this, 0, ptb[0], 0 ); - } - - if( pspec[1].range[0] != pta[1] ) { - assert( pspec[1].range[0] < pta[1] ); - Patch lower( *this, 1, pta[1], 0 ); - *this = lower; - } - - if( pspec[1].range[1] != ptb[1] ) { - assert( pspec[1].range[1] > ptb[1] ); - Patch upper( *this, 1, ptb[1], 0 ); - } - checkBboxConstraint(); - next = n; -} - -/*-------------------------------------------------------------------------- - * Patch - subdivide a patch along an isoparametric line - *-------------------------------------------------------------------------- - */ - -Patch::Patch( Patch& upper, int param, REAL value, Patch *n ) -{ - Patch& lower = *this; - - lower.cullval = upper.cullval; - lower.mapdesc = upper.mapdesc; - lower.notInBbox = upper.notInBbox; - lower.needsSampling = upper.needsSampling; - lower.pspec[0].order = upper.pspec[0].order; - lower.pspec[1].order = upper.pspec[1].order; - lower.pspec[0].stride = upper.pspec[0].stride; - lower.pspec[1].stride = upper.pspec[1].stride; - lower.next = n; - - /* reset scale range */ - switch( param ) { - case 0: { - REAL d = (value-upper.pspec[0].range[0]) / upper.pspec[0].range[2]; - if( needsSampling ) - mapdesc->subdivide( upper.spts, lower.spts, d, pspec[1].order, - pspec[1].stride, pspec[0].order, pspec[0].stride ); - - if( cullval == CULL_ACCEPT ) - mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[1].order, - pspec[1].stride, pspec[0].order, pspec[0].stride ); - - if( notInBbox ) - mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[1].order, - pspec[1].stride, pspec[0].order, pspec[0].stride ); - - lower.pspec[0].range[0] = upper.pspec[0].range[0]; - lower.pspec[0].range[1] = value; - lower.pspec[0].range[2] = value - upper.pspec[0].range[0]; - upper.pspec[0].range[0] = value; - upper.pspec[0].range[2] = upper.pspec[0].range[1] - value; - - lower.pspec[1].range[0] = upper.pspec[1].range[0]; - lower.pspec[1].range[1] = upper.pspec[1].range[1]; - lower.pspec[1].range[2] = upper.pspec[1].range[2]; - break; - } - case 1: { - REAL d = (value-upper.pspec[1].range[0]) / upper.pspec[1].range[2]; - if( needsSampling ) - mapdesc->subdivide( upper.spts, lower.spts, d, pspec[0].order, - pspec[0].stride, pspec[1].order, pspec[1].stride ); - if( cullval == CULL_ACCEPT ) - mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[0].order, - pspec[0].stride, pspec[1].order, pspec[1].stride ); - if( notInBbox ) - mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[0].order, - pspec[0].stride, pspec[1].order, pspec[1].stride ); - lower.pspec[0].range[0] = upper.pspec[0].range[0]; - lower.pspec[0].range[1] = upper.pspec[0].range[1]; - lower.pspec[0].range[2] = upper.pspec[0].range[2]; - - lower.pspec[1].range[0] = upper.pspec[1].range[0]; - lower.pspec[1].range[1] = value; - lower.pspec[1].range[2] = value - upper.pspec[1].range[0]; - upper.pspec[1].range[0] = value; - upper.pspec[1].range[2] = upper.pspec[1].range[1] - value; - break; - } - } - - // inherit bounding box - if( mapdesc->isBboxSubdividing() && ! notInBbox ) - memcpy( lower.bb, upper.bb, sizeof( bb ) ); - - lower.checkBboxConstraint(); - upper.checkBboxConstraint(); -} - -/*-------------------------------------------------------------------------- - * clamp - clamp the sampling rate to a given maximum - *-------------------------------------------------------------------------- - */ - -void -Patch::clamp( void ) -{ - if( mapdesc->clampfactor != N_NOCLAMPING ) { - pspec[0].clamp( mapdesc->clampfactor ); - pspec[1].clamp( mapdesc->clampfactor ); - } -} - -void -Patchspec::clamp( REAL clampfactor ) -{ - if( sidestep[0] < minstepsize ) - sidestep[0] = clampfactor * minstepsize; - if( sidestep[1] < minstepsize ) - sidestep[1] = clampfactor * minstepsize; - if( stepsize < minstepsize ) - stepsize = clampfactor * minstepsize; -} - -void -Patch::checkBboxConstraint( void ) -{ - if( notInBbox && - mapdesc->bboxTooBig( bpts, pspec[0].stride, pspec[1].stride, - pspec[0].order, pspec[1].order, bb ) != 1 ) { - notInBbox = 0; - } -} - -void -Patch::bbox( void ) -{ - if( mapdesc->isBboxSubdividing() ) - mapdesc->surfbbox( bb ); -} - -/*-------------------------------------------------------------------------- - * getstepsize - compute the sampling density across the patch - * and determine if patch needs to be subdivided - *-------------------------------------------------------------------------- - */ - -void -Patch::getstepsize( void ) -{ - pspec[0].minstepsize = pspec[1].minstepsize = 0; - pspec[0].needsSubdivision = pspec[1].needsSubdivision = 0; - - if( mapdesc->isConstantSampling() ) { - // fixed number of samples per patch in each direction - // maxsrate is number of s samples per patch - // maxtrate is number of t samples per patch - pspec[0].getstepsize( mapdesc->maxsrate ); - pspec[1].getstepsize( mapdesc->maxtrate ); - - } else if( mapdesc->isDomainSampling() ) { - // maxsrate is number of s samples per unit s length of domain - // maxtrate is number of t samples per unit t length of domain - pspec[0].getstepsize( mapdesc->maxsrate * pspec[0].range[2] ); - pspec[1].getstepsize( mapdesc->maxtrate * pspec[1].range[2] ); - - } else if( ! needsSampling ) { - pspec[0].singleStep(); - pspec[1].singleStep(); - } else { - // upper bound on path length between sample points - REAL tmp[MAXORDER][MAXORDER][MAXCOORDS]; - const int trstride = sizeof(tmp[0]) / sizeof(REAL); - const int tcstride = sizeof(tmp[0][0]) / sizeof(REAL); - - assert( pspec[0].order <= MAXORDER ); - - /* points have been transformed, therefore they are homogeneous */ - - int val = mapdesc->project( spts, pspec[0].stride, pspec[1].stride, - &tmp[0][0][0], trstride, tcstride, - pspec[0].order, pspec[1].order ); - if( val == 0 ) { - // control points cross infinity, therefore partials are undefined - pspec[0].getstepsize( mapdesc->maxsrate ); - pspec[1].getstepsize( mapdesc->maxtrate ); - } else { - REAL t1 = mapdesc->getProperty( N_PIXEL_TOLERANCE ); -// REAL t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); - pspec[0].minstepsize = ( mapdesc->maxsrate > 0.0 ) ? - (pspec[0].range[2] / mapdesc->maxsrate) : 0.0; - pspec[1].minstepsize = ( mapdesc->maxtrate > 0.0 ) ? - (pspec[1].range[2] / mapdesc->maxtrate) : 0.0; - if( mapdesc->isParametricDistanceSampling() || - mapdesc->isObjectSpaceParaSampling() ) { - - REAL t2; - t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); - - // t2 is upper bound on the distance between surface and tessellant - REAL ssv[2], ttv[2]; - REAL ss = mapdesc->calcPartialVelocity( ssv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 2, 0, pspec[0].range[2], pspec[1].range[2], 0 ); - REAL st = mapdesc->calcPartialVelocity( 0, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 1, pspec[0].range[2], pspec[1].range[2], -1 ); - REAL tt = mapdesc->calcPartialVelocity( ttv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 2, pspec[0].range[2], pspec[1].range[2], 1 ); - //make sure that ss st and tt are nonnegative: - if(ss <0) ss = -ss; - if(st <0) st = -st; - if(tt <0) tt = -tt; - - if( ss != 0.0 && tt != 0.0 ) { - /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n", - ssv[0], ssv[1], ttv[0], ttv[1] ); */ - REAL ttq = sqrtf( (float) ss ); - REAL ssq = sqrtf( (float) tt ); - REAL ds = sqrtf( 4 * t2 * ttq / ( ss * ttq + st * ssq ) ); - REAL dt = sqrtf( 4 * t2 * ssq / ( tt * ssq + st * ttq ) ); - pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; - REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); - pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; - pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; - - pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); - pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; - pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; - } else if( ss != 0.0 ) { - REAL x = pspec[1].range[2] * st; - REAL ds = ( sqrtf( x * x + 8.0 * t2 * ss ) - x ) / ss; - pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; - REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); - pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; - pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; - pspec[1].singleStep(); - } else if( tt != 0.0 ) { - REAL x = pspec[0].range[2] * st; - REAL dt = ( sqrtf( x * x + 8.0 * t2 * tt ) - x ) / tt; - pspec[0].singleStep(); - REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); - pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; - pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; - } else { - if( 4.0 * t2 > st * pspec[0].range[2] * pspec[1].range[2] ) { - pspec[0].singleStep(); - pspec[1].singleStep(); - } else { - REAL area = 4.0 * t2 / st; - REAL ds = sqrtf( area * pspec[0].range[2] / pspec[1].range[2] ); - REAL dt = sqrtf( area * pspec[1].range[2] / pspec[0].range[2] ); - pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; - pspec[0].sidestep[0] = pspec[0].range[2]; - pspec[0].sidestep[1] = pspec[0].range[2]; - - pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - pspec[1].sidestep[0] = pspec[1].range[2]; - pspec[1].sidestep[1] = pspec[1].range[2]; - } - } - } else if( mapdesc->isPathLengthSampling() || - mapdesc->isObjectSpacePathSampling()) { - // t1 is upper bound on path length - REAL msv[2], mtv[2]; - REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 ); - REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 ); - REAL side_scale = 1.0; - - if( ms != 0.0 ) { - if( mt != 0.0 ) { -/* REAL d = t1 / ( ms * ms + mt * mt );*/ -/* REAL ds = mt * d;*/ - REAL ds = t1 / (2.0*ms); -/* REAL dt = ms * d;*/ - REAL dt = t1 / (2.0*mt); - pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; - pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[0]) : pspec[0].range[2]; - pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[1]) : pspec[0].range[2]; - - pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[0]) : pspec[1].range[2]; - pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[1]) : pspec[1].range[2]; - } else { - pspec[0].stepsize = ( t1 < ms * pspec[0].range[2] ) ? (t1 / ms) : pspec[0].range[2]; - pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (t1 / msv[0]) : pspec[0].range[2]; - pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (t1 / msv[1]) : pspec[0].range[2]; - - pspec[1].singleStep(); - } - } else { - if( mt != 0.0 ) { - pspec[0].singleStep(); - - pspec[1].stepsize = ( t1 < mt * pspec[1].range[2] ) ? (t1 / mt) : pspec[1].range[2]; - pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (t1 / mtv[0]) : pspec[1].range[2]; - pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (t1 / mtv[1]) : pspec[1].range[2]; - } else { - pspec[0].singleStep(); - pspec[1].singleStep(); - } - } - } else if( mapdesc->isSurfaceAreaSampling() ) { - // t is the square root of area -/* - REAL msv[2], mtv[2]; - REAL ms = mapdesc->calcPartialVelocity( msv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 0, pspec[0].range[2], pspec[1].range[2], 0 ); - REAL mt = mapdesc->calcPartialVelocity( mtv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 0, 1, pspec[0].range[2], pspec[1].range[2], 1 ); - if( ms != 0.0 && mt != 0.0 ) { - REAL d = 1.0 / (ms * mt); - t *= M_SQRT2; - REAL ds = t * sqrtf( d * pspec[0].range[2] / pspec[1].range[2] ); - REAL dt = t * sqrtf( d * pspec[1].range[2] / pspec[0].range[2] ); - pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; - pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t ) ? (t / msv[0]) : pspec[0].range[2]; - pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t ) ? (t / msv[1]) : pspec[0].range[2]; - - pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t ) ? (t / mtv[0]) : pspec[1].range[2]; - pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t ) ? (t / mtv[1]) : pspec[1].range[2]; - } else { - pspec[0].singleStep(); - pspec[1].singleStep(); - } -*/ - } else { - pspec[0].singleStep(); - pspec[1].singleStep(); - } - } - } - -#ifdef DEBUG - _glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n", - pspec[0].sidestep[0], pspec[0].sidestep[1], - pspec[1].sidestep[0], pspec[1].sidestep[1], - pspec[0].stepsize, pspec[1].stepsize ); -#endif - - if( mapdesc->minsavings != N_NOSAVINGSSUBDIVISION ) { - REAL savings = 1./(pspec[0].stepsize * pspec[1].stepsize) ; - savings-= (2./( pspec[0].sidestep[0] + pspec[0].sidestep[1] )) * - (2./( pspec[1].sidestep[0] + pspec[1].sidestep[1] )); - - savings *= pspec[0].range[2] * pspec[1].range[2]; - if( savings > mapdesc->minsavings ) { - pspec[0].needsSubdivision = pspec[1].needsSubdivision = 1; - } - } - - if( pspec[0].stepsize < pspec[0].minstepsize ) pspec[0].needsSubdivision = 1; - if( pspec[1].stepsize < pspec[1].minstepsize ) pspec[1].needsSubdivision = 1; - needsSampling = (needsSampling ? needsSamplingSubdivision() : 0); -} - -void -Patchspec::singleStep() -{ - stepsize = sidestep[0] = sidestep[1] = glu_abs(range[2]); -} - -void -Patchspec::getstepsize( REAL max ) // max is number of samples for entire patch -{ - stepsize = ( max >= 1.0 ) ? range[2] / max : range[2]; - if (stepsize < 0.0) { - stepsize = -stepsize; - } - sidestep[0] = sidestep[1] = minstepsize = stepsize; -} - -int -Patch::needsSamplingSubdivision( void ) -{ - return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0; -} - -int -Patch::needsNonSamplingSubdivision( void ) -{ - return notInBbox; -} - -int -Patch::needsSubdivision( int param ) -{ - return pspec[param].needsSubdivision; -} - -int -Patch::cullCheck( void ) -{ - if( cullval == CULL_ACCEPT ) - cullval = mapdesc->cullCheck( cpts, pspec[0].order, pspec[0].stride, - pspec[1].order, pspec[1].stride ); - return cullval; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/patch.h b/src/libs/mesa/glu/libnurbs/internals/patch.h deleted file mode 100644 index 324a25938b..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/patch.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * patch.h - * - */ - -#ifndef __glupatch_h_ -#define __glupatch_h_ - -#include "types.h" -#include "defines.h" - -class Quilt; -class Mapdesc; - - -struct Pspec { - REAL range[3]; - REAL sidestep[2]; - REAL stepsize; - REAL minstepsize; - int needsSubdivision; -}; - -struct Patchspec : public Pspec { - int order; - int stride; - void clamp( REAL ); - void getstepsize( REAL ); - void singleStep( void ); -}; - -class Patch { -public: -friend class Subdivider; -friend class Quilt; -friend class Patchlist; - Patch( Quilt *, REAL*, REAL *, Patch * ); - Patch( Patch &, int, REAL, Patch * ); - void bbox( void ); - void clamp( void ); - void getstepsize( void ); - int cullCheck( void ); - int needsSubdivision( int ); - int needsSamplingSubdivision( void ); - int needsNonSamplingSubdivision( void ); - - int get_uorder() {return pspec[0].order;} - int get_vorder() {return pspec[1].order;} - -private: - - Mapdesc* mapdesc; - Patch* next; - int cullval; - int notInBbox; - int needsSampling; - REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts - REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts - REAL bpts[MAXORDER*MAXORDER*MAXCOORDS]; //bbox pts - Patchspec pspec[2]; - void checkBboxConstraint( void ); - REAL bb[2][MAXCOORDS]; -}; -#endif /* __glupatch_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/patchlist.cc b/src/libs/mesa/glu/libnurbs/internals/patchlist.cc deleted file mode 100644 index 989d2dd00a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/patchlist.cc +++ /dev/null @@ -1,170 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * patchlist.c++ - * - */ - -#include -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "quilt.h" -#include "patchlist.h" -#include "patch.h" -#include "nurbsconsts.h" - -Patchlist::Patchlist( Quilt *quilts, REAL *pta, REAL *ptb ) -{ - patch = 0; - for( Quilt *q = quilts; q; q = q->next ) - patch = new Patch( q, pta, ptb, patch ); - pspec[0].range[0] = pta[0]; - pspec[0].range[1] = ptb[0]; - pspec[0].range[2] = ptb[0] - pta[0]; - - pspec[1].range[0] = pta[1]; - pspec[1].range[1] = ptb[1]; - pspec[1].range[2] = ptb[1] - pta[1]; -} - -Patchlist::Patchlist( Patchlist &upper, int param, REAL value) -{ - Patchlist &lower = *this; - patch = 0; - for( Patch *p = upper.patch; p; p = p->next ) - patch = new Patch( *p, param, value, patch ); - - if( param == 0 ) { - lower.pspec[0].range[0] = upper.pspec[0].range[0]; - lower.pspec[0].range[1] = value; - lower.pspec[0].range[2] = value - upper.pspec[0].range[0]; - upper.pspec[0].range[0] = value; - upper.pspec[0].range[2] = upper.pspec[0].range[1] - value; - lower.pspec[1] = upper.pspec[1]; - } else { - lower.pspec[0] = upper.pspec[0]; - lower.pspec[1].range[0] = upper.pspec[1].range[0]; - lower.pspec[1].range[1] = value; - lower.pspec[1].range[2] = value - upper.pspec[1].range[0]; - upper.pspec[1].range[0] = value; - upper.pspec[1].range[2] = upper.pspec[1].range[1] - value; - } -} - -Patchlist::~Patchlist() -{ - while( patch ) { - Patch *p = patch; - patch = patch->next; - delete p; - } -} - -int -Patchlist::cullCheck( void ) -{ - for( Patch *p = patch; p; p = p->next ) - if( p->cullCheck() == CULL_TRIVIAL_REJECT ) - return CULL_TRIVIAL_REJECT; - return CULL_ACCEPT; -} - -void -Patchlist::getRanges(REAL ranges[4]) -{ - ranges[0] = pspec[0].range[0]; - ranges[1] = pspec[0].range[1]; - ranges[2] = pspec[1].range[0]; - ranges[3] = pspec[1].range[1]; -} - -void -Patchlist::getstepsize( void ) -{ - pspec[0].stepsize = pspec[0].range[2]; - pspec[0].sidestep[0] = pspec[0].range[2]; - pspec[0].sidestep[1] = pspec[0].range[2]; - - pspec[1].stepsize = pspec[1].range[2]; - pspec[1].sidestep[0] = pspec[1].range[2]; - pspec[1].sidestep[1] = pspec[1].range[2]; - - for( Patch *p = patch; p; p = p->next ) { - p->getstepsize(); - p->clamp(); - pspec[0].stepsize = ((p->pspec[0].stepsize < pspec[0].stepsize) ? p->pspec[0].stepsize : pspec[0].stepsize); - pspec[0].sidestep[0] = ((p->pspec[0].sidestep[0] < pspec[0].sidestep[0]) ? p->pspec[0].sidestep[0] : pspec[0].sidestep[0]); - pspec[0].sidestep[1] = ((p->pspec[0].sidestep[1] < pspec[0].sidestep[1]) ? p->pspec[0].sidestep[1] : pspec[0].sidestep[1]); - pspec[1].stepsize = ((p->pspec[1].stepsize < pspec[1].stepsize) ? p->pspec[1].stepsize : pspec[1].stepsize); - pspec[1].sidestep[0] = ((p->pspec[1].sidestep[0] < pspec[1].sidestep[0]) ? p->pspec[1].sidestep[0] : pspec[1].sidestep[0]); - pspec[1].sidestep[1] = ((p->pspec[1].sidestep[1] < pspec[1].sidestep[1]) ? p->pspec[1].sidestep[1] : pspec[1].sidestep[1]); - } -} - -void -Patchlist::bbox( void ) -{ - for( Patch *p = patch; p; p = p->next ) - p->bbox(); -} - -int -Patchlist::needsNonSamplingSubdivision( void ) -{ - notInBbox = 0; - for( Patch *p = patch; p; p = p->next ) - notInBbox |= p->needsNonSamplingSubdivision(); - return notInBbox; -} - -int -Patchlist::needsSamplingSubdivision( void ) -{ - pspec[0].needsSubdivision = 0; - pspec[1].needsSubdivision = 0; - - for( Patch *p = patch; p; p = p->next ) { - pspec[0].needsSubdivision |= p->pspec[0].needsSubdivision; - pspec[1].needsSubdivision |= p->pspec[0].needsSubdivision; - } - return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0; -} - -int -Patchlist::needsSubdivision( int param ) -{ - return pspec[param].needsSubdivision; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/patchlist.h b/src/libs/mesa/glu/libnurbs/internals/patchlist.h deleted file mode 100644 index 9bfc5b47a2..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/patchlist.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * patchlist.h - * - */ - -#ifndef __glupatchlist_h_ -#define __glupatchlist_h_ - -#include "types.h" -#include "defines.h" -#include "patch.h" - -class Quilt; - -class Patchlist { -friend class Subdivider; -public: - Patchlist( Quilt *, REAL *, REAL * ); - Patchlist( Patchlist &, int , REAL ); - ~Patchlist(); - void bbox(); - int cullCheck( void ); - void getstepsize( void ); - int needsNonSamplingSubdivision( void ); - int needsSamplingSubdivision( void ); - int needsSubdivision( int ); - REAL getStepsize( int ); - void getRanges(REAL ranges[4]); - - int get_uorder(); - int get_vorder(); -private: - Patch *patch; - int notInBbox; - int needsSampling; - Pspec pspec[2]; -}; - -inline REAL -Patchlist::getStepsize( int param ) -{ - return pspec[param].stepsize; -} - -inline int -Patchlist::get_uorder() -{ - return patch->get_uorder(); - -} - -inline int - Patchlist::get_vorder() -{ - return patch->get_vorder(); -} - - - - - -#endif /* __glupatchlist_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/pwlarc.h b/src/libs/mesa/glu/libnurbs/internals/pwlarc.h deleted file mode 100644 index 2e5175a6f3..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/pwlarc.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * pwlarc.h - * - */ - -#ifndef __glupwlarc_h_ -#define __glupwlarc_h_ - -#include "myassert.h" -#include "nurbsconsts.h" - -class TrimVertex; - -class PwlArc : public PooledObj { /* a piecewise-linear arc */ -public: - TrimVertex * pts; /* sample points */ - int npts; /* number of sample points */ - long type; /* curve type */ - inline PwlArc( void ); - inline PwlArc( int, TrimVertex * ); - inline PwlArc( int, TrimVertex *, long ); -}; - -inline -PwlArc::PwlArc( void ) -{ - type = N_P2D; - pts = 0; - npts = -1; -} - -inline -PwlArc::PwlArc( int _npts, TrimVertex *_pts ) -{ - pts = _pts; - npts = _npts; - type = N_P2D; -} - -inline -PwlArc::PwlArc( int _npts, TrimVertex *_pts, long _type ) -{ - pts = _pts; - npts = _npts; - type = _type; -} - -#endif /* __glupwlarc_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/quilt.cc b/src/libs/mesa/glu/libnurbs/internals/quilt.cc deleted file mode 100644 index 4fc58b7473..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/quilt.cc +++ /dev/null @@ -1,276 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * quilt.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "quilt.h" -#include "backend.h" -#include "mapdesc.h" -#include "flist.h" -#include "knotvector.h" -#include "patchlist.h" -#include "math.h" //fglu_abs() -#include "simplemath.h" //min() - -/* local preprocessor definitions */ -#define DEF_PATCH_STEPSIZE .4 -#define fsizeof(x) (sizeof(x)/sizeof(REAL)) - - -Quilt::Quilt( Mapdesc *_mapdesc ) -{ - mapdesc = _mapdesc; -} - -void -Quilt::deleteMe( Pool& p ) -{ - for( Quiltspec *q=qspec; q != eqspec; q++ ) { -#if 1 - if( q->breakpoints) delete[] q->breakpoints; q->breakpoints = 0; -#else - if( q->breakpoints) { - delete[] q->breakpoints; - q->breakpoints = 0; -printf("in here\n"); - } -#endif - } - if( cpts ) delete[] cpts; - cpts = 0; - PooledObj::deleteMe( p ); -} - -void -Quilt::show( void ) -{ -#ifndef NDEBUG - int nc = mapdesc->getNcoords(); - REAL *ps = cpts; - ps += qspec[0].offset; - ps += qspec[1].offset; - for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) { - for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) { - for( int k=0; k < nc; k++ ) - _glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] ); - _glu_dprintf( "\n" ); - } - _glu_dprintf( "\n" ); - } - _glu_dprintf( "\n" ); -#endif -} - -/*-------------------------------------------------------------------------- - * Quilt::select - find which map in each quilt contains the points - * pta and ptb with pta[i] < ptb[i] - *-------------------------------------------------------------------------- - */ - -void -Quilt::select( REAL *pta, REAL *ptb ) -{ - int dim = eqspec - qspec; - int i, j; - for( i=0; i=0; j-- ) - if( (qspec[i].breakpoints[j] <= pta[i] ) && - (ptb[i] <= qspec[i].breakpoints[j+1] ) ) - break; - assert( j != -1 ); - qspec[i].index = j; - } -} - -void -Quilt::download( Backend &backend ) -{ - if( getDimension() == 2 ) { - REAL *ps = cpts; - ps += qspec[0].offset; - ps += qspec[1].offset; - ps += qspec[0].index * qspec[0].order * qspec[0].stride; - ps += qspec[1].index * qspec[1].order * qspec[1].stride; - backend.surfpts( mapdesc->getType(), ps, - qspec[0].stride, - qspec[1].stride, - qspec[0].order, - qspec[1].order, - qspec[0].breakpoints[qspec[0].index], - qspec[0].breakpoints[qspec[0].index+1], - qspec[1].breakpoints[qspec[1].index], - qspec[1].breakpoints[qspec[1].index+1] ); - } else { - REAL *ps = cpts; - ps += qspec[0].offset; - ps += qspec[0].index * qspec[0].order * qspec[0].stride; - backend.curvpts( mapdesc->getType(), ps, - qspec[0].stride, - qspec[0].order, - qspec[0].breakpoints[qspec[0].index], - qspec[0].breakpoints[qspec[0].index+1] ); - } -} - -/*-------------------------------------------------------------------------- - * Quilt::downloadAll - download each map that contains the current patch - *-------------------------------------------------------------------------- - */ - -void -Quilt::downloadAll( REAL *pta, REAL *ptb, Backend &backend ) -{ - for( Quilt *m = this; m; m=m->next ) { - m->select( pta, ptb ); - m->download( backend ); - } -} - -/*-------------------------------------------------------------------------- - * Quilt::isCulled - determine if an entire quilt is trivially rejected. - *-------------------------------------------------------------------------- - */ - -int -Quilt::isCulled( void ) -{ - if( mapdesc->isCulling() ) - return mapdesc->xformAndCullCheck( cpts + qspec[0].offset + qspec[1].offset, - qspec[0].order * qspec[0].width, qspec[0].stride, - qspec[1].order * qspec[1].width, qspec[1].stride ); - else - return CULL_ACCEPT; -} - -/*--------------------------------------------------------------------------- - * Quilt::getRange - retrieve the valid paramater range of a set of quilts - *--------------------------------------------------------------------------- - */ -void -Quilt::getRange( REAL *from, REAL *to, Flist& slist, Flist &tlist ) -{ - getRange( from, to, 0, slist ); - getRange( from, to, 1, tlist ); -} - -/*--------------------------------------------------------------------------- - * Quilt::getRange - retrieve the valid paramater range of a set of quilts - *--------------------------------------------------------------------------- - */ -void -Quilt::getRange( REAL *from, REAL *to, int i, Flist &list ) -{ - Quilt *maps = this; - from[i] = maps->qspec[i].breakpoints[0]; - to[i] = maps->qspec[i].breakpoints[maps->qspec[i].width]; - int maxpts = 0; - Quilt_ptr m; - for( m=maps; m; m=m->next ) { - if( m->qspec[i].breakpoints[0] > from[i] ) - from[i] = m->qspec[i].breakpoints[0]; - if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] ) - to[i] = m->qspec[i].breakpoints[m->qspec[i].width]; - maxpts += m->qspec[i].width + 1; - } - - list.grow( maxpts ); - - for( m=maps; m; m=m->next ) - for( int j=0; j<=m->qspec[i].width; j++ ) { - list.add( m->qspec[i].breakpoints[j] ); - } - - list.filter( ); - list.taper( from[i], to[i] ); -} - -void -Quilt::getRange( REAL *from, REAL *to, Flist& slist ) -{ - getRange( from, to, 0, slist ); -} - -void -Quilt::findRates( Flist& slist, Flist& tlist, REAL rate[2] ) -{ - findSampleRates( slist, tlist ); - rate[0] = qspec[0].step_size; - rate[1] = qspec[1].step_size; - - for( Quilt *q = next; q; q = q->next ) { - q->findSampleRates( slist, tlist ); - if( q->qspec[0].step_size < rate[0] ) - rate[0] = q->qspec[0].step_size; - if( q->qspec[1].step_size < rate[1] ) - rate[1] = q->qspec[1].step_size; - } -} - -void -Quilt::findSampleRates( Flist& slist, Flist& tlist ) -{ - qspec[0].step_size = DEF_PATCH_STEPSIZE * - (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]); - qspec[1].step_size = DEF_PATCH_STEPSIZE * - (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]); - - for( int i = slist.start; i < slist.end-1; i++ ) { - for( int j = tlist.start; j < tlist.end-1; j++ ) { - - REAL pta[2], ptb[2]; - pta[0] = slist.pts[i]; - ptb[0] = slist.pts[i+1]; - pta[1] = tlist.pts[j]; - ptb[1] = tlist.pts[j+1]; - Patchlist patchlist( this, pta, ptb ); - patchlist.getstepsize(); - - { - float edge_len_s = min(glu_abs(ptb[0]-pta[0]),1.0); - float edge_len_t = min(glu_abs(ptb[1]-pta[1]),1.0); - - if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size ) - qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s; - if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size ) - qspec[1].step_size = patchlist.getStepsize(1)/edge_len_t; - } - } - } -} diff --git a/src/libs/mesa/glu/libnurbs/internals/quilt.h b/src/libs/mesa/glu/libnurbs/internals/quilt.h deleted file mode 100644 index fe1e3309ea..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/quilt.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * quilt.h - * - */ - -#ifndef __gluquilt_h_ -#define __gluquilt_h_ - -#include "defines.h" -#include "bufpool.h" -#include "types.h" - -class Backend; -class Mapdesc; -class Flist; -struct Knotvector; - -/* constants for memory allocation of NURBS to Bezier conversion */ -#define MAXDIM 2 - -struct Quiltspec { /* a specification for a dimension of a quilt */ - int stride; /* words between points */ - int width; /* number of segments */ - int offset; /* words to first point */ - int order; /* order */ - int index; /* current segment number */ - int bdry[2]; /* boundary edge flag */ - REAL step_size; - Knot * breakpoints; -}; - -typedef Quiltspec *Quiltspec_ptr; - -class Quilt : public PooledObj { /* an array of bezier patches */ -public: - Quilt( Mapdesc * ); - Mapdesc * mapdesc; /* map descriptor */ - REAL * cpts; /* control points */ - Quiltspec qspec[MAXDIM]; /* the dimensional data */ - Quiltspec_ptr eqspec; /* qspec trailer */ - Quilt *next; /* next quilt in linked list */ - -public: - void deleteMe( Pool& ); - void toBezier( Knotvector &, INREAL *, long ); - void toBezier( Knotvector &, Knotvector &, INREAL *, long ); - void select( REAL *, REAL * ); - int getDimension( void ) { return eqspec - qspec; } - void download( Backend & ); - void downloadAll( REAL *, REAL *, Backend & ); - int isCulled( void ); - void getRange( REAL *, REAL *, Flist&, Flist & ); - void getRange( REAL *, REAL *, int, Flist & ); - void getRange( REAL *, REAL *, Flist& ); - void findRates( Flist& slist, Flist& tlist, REAL[2] ); - void findSampleRates( Flist& slist, Flist& tlist ); - void show(); -}; - -typedef class Quilt *Quilt_ptr; - -#endif /* __gluquilt_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/reader.cc b/src/libs/mesa/glu/libnurbs/internals/reader.cc deleted file mode 100644 index 6135eef60e..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/reader.cc +++ /dev/null @@ -1,146 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * reader.c++ - * - */ - -#include -#include "glimports.h" -#include "nurbsconsts.h" -#include "reader.h" -#include "trimvertex.h" -#include "simplemath.h" - -//when read a pwlCurve, if two consecutive points are the same, then -//eliminate one of them. This makes the tessellator more robust. The spec -//assumes the application makes sure there are no redundant points. -//but in Inspector, the trim curves seem to have redundant points a lot. -//I guess other similar users may have the same problem. - -#define ELIMINATE_REDUNDANT_POINTS - -#ifdef ELIMINATE_REDUNDANT_POINTS -#define equal(x,y) ( glu_abs(x-y) <= 0.00001) -#endif - -#ifdef ELIMINATE_REDUNDANT_POINTS -O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts ) -{ - next = 0; - used = 0; - owner = 0; - pts = trimpts; - npts = (int) count; - int i; - - /* copy user data into internal trimming data structures */ - switch( _type ) { - case N_P2D: { - TrimVertex *v = pts; - TrimVertex *prev = NULL; - int num = 0; - int doit; - for(i=0; iparam[0], array[0]) && equal(prev->param[1], array[1])) - { - doit = 0; - } - } - - if(doit) - { - v->param[0] = (REAL) array[0]; - v->param[1] = (REAL) array[1]; - prev = v; - v++; - num++; - } - array = (INREAL *) (((char *) array) + byte_stride); - } - npts = num; - break; - } - case N_P2DR: { - TrimVertex *v = pts; - for( TrimVertex *lastv = v + count; v != lastv; v++ ) { - v->param[0] = (REAL) array[0] / (REAL) array[2]; - v->param[1] = (REAL) array[1] / (REAL) array[2]; - array = (INREAL *) (((char *) array) + byte_stride); - } - break; - } - } -} -#else -O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts ) -{ - next = 0; - used = 0; - owner = 0; - pts = trimpts; - npts = (int) count; - - /* copy user data into internal trimming data structures */ - switch( _type ) { - case N_P2D: { - TrimVertex *v = pts; - for( TrimVertex *lastv = v + count; v != lastv; v++ ) { - v->param[0] = (REAL) array[0]; - v->param[1] = (REAL) array[1]; - array = (INREAL *) (((char *) array) + byte_stride); - } - break; - } - case N_P2DR: { - TrimVertex *v = pts; - for( TrimVertex *lastv = v + count; v != lastv; v++ ) { - v->param[0] = (REAL) array[0] / (REAL) array[2]; - v->param[1] = (REAL) array[1] / (REAL) array[2]; - array = (INREAL *) (((char *) array) + byte_stride); - } - break; - } - } -} -#endif - - - - - diff --git a/src/libs/mesa/glu/libnurbs/internals/reader.h b/src/libs/mesa/glu/libnurbs/internals/reader.h deleted file mode 100644 index 8a8dcebb50..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/reader.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * reader.h - * - */ - -#ifndef __glureader_h_ -#define __glureader_h_ - -#include "bufpool.h" -#include "types.h" - -enum Curvetype { ct_nurbscurve, ct_pwlcurve, ct_none }; - -struct Property; -struct O_surface; -struct O_nurbssurface; -struct O_trim; -class O_pwlcurve; -struct O_nurbscurve; -struct O_curve; -class Quilt; -class TrimVertex; - - -struct O_curve : public PooledObj { - union { - O_nurbscurve *o_nurbscurve; - O_pwlcurve *o_pwlcurve; - } curve; - Curvetype curvetype; /* arc type: pwl or nurbs */ - O_curve * next; /* next arc in loop */ - O_surface * owner; /* owning surface */ - int used; /* curve called in cur surf */ - int save; /* 1 if in display list */ - long nuid; - O_curve() { next = 0; used = 0; owner = 0; - curve.o_pwlcurve = 0; } - }; - -struct O_nurbscurve : public PooledObj { - Quilt *bezier_curves; /* array of bezier curves */ - long type; /* range descriptor */ - REAL tesselation; /* tesselation tolerance */ - int method; /* tesselation method */ - O_nurbscurve * next; /* next curve in list */ - int used; /* curve called in cur surf */ - int save; /* 1 if in display list */ - O_curve * owner; /* owning curve */ - O_nurbscurve( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } - }; - -class O_pwlcurve : public PooledObj { -public: - TrimVertex *pts; /* array of trim vertices */ - int npts; /* number of trim vertices */ - O_pwlcurve * next; /* next curve in list */ - int used; /* curve called in cur surf */ - int save; /* 1 if in display list */ - O_curve * owner; /* owning curve */ - O_pwlcurve( long, long, INREAL *, long, TrimVertex * ); - }; - -struct O_trim : public PooledObj { - O_curve *o_curve; /* closed trim loop */ - O_trim * next; /* next loop along trim */ - int save; /* 1 if in display list */ - O_trim() { next = 0; o_curve = 0; } - }; - -struct O_nurbssurface : public PooledObj { - Quilt * bezier_patches;/* array of bezier patches */ - long type; /* range descriptor */ - O_surface * owner; /* owning surface */ - O_nurbssurface * next; /* next surface in chain */ - int save; /* 1 if in display list */ - int used; /* 1 if prev called in block */ - O_nurbssurface( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } - }; - -struct O_surface : public PooledObj { - O_nurbssurface * o_nurbssurface; /* linked list of surfaces */ - O_trim * o_trim; /* list of trim loops */ - int save; /* 1 if in display list */ - long nuid; - O_surface() { o_trim = 0; o_nurbssurface = 0; } - }; - -struct Property : public PooledObj { - long type; - long tag; - REAL value; - int save; /* 1 if in display list */ - Property( long _type, long _tag, INREAL _value ) - { type = _type; tag = _tag; value = (REAL) _value; } - Property( long _tag, INREAL _value ) - { type = 0; tag = _tag; value = (REAL) _value; } - }; - -class NurbsTessellator; -#endif /* __glureader_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/renderhints.cc b/src/libs/mesa/glu/libnurbs/internals/renderhints.cc deleted file mode 100644 index a3aa62d42c..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/renderhints.cc +++ /dev/null @@ -1,133 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * renderhints.c++ - * - */ - -#include "glimports.h" -#include "mystdio.h" -#include "renderhints.h" -#include "defines.h" -#include "nurbsconsts.h" - - -/*-------------------------------------------------------------------------- - * Renderhints::Renderhints - set all window specific options - *-------------------------------------------------------------------------- - */ -Renderhints::Renderhints() -{ - display_method = N_FILL; - errorchecking = N_MSG; - subdivisions = 6.0; - tmp1 = 0.0; -} - -void -Renderhints::init( void ) -{ - maxsubdivisions = (int) subdivisions; - if( maxsubdivisions < 0 ) maxsubdivisions = 0; - - - if( display_method == N_FILL ) { - wiretris = 0; - wirequads = 0; - } else if( display_method == N_OUTLINE_TRI ) { - wiretris = 1; - wirequads = 0; - } else if( display_method == N_OUTLINE_QUAD ) { - wiretris = 0; - wirequads = 1; - } else { - wiretris = 1; - wirequads = 1; - } -} - -int -Renderhints::isProperty( long property ) -{ - switch ( property ) { - case N_DISPLAY: - case N_ERRORCHECKING: - case N_SUBDIVISIONS: - case N_TMP1: - return 1; - default: - return 0; - } -} - -REAL -Renderhints::getProperty( long property ) -{ - switch ( property ) { - case N_DISPLAY: - return display_method; - case N_ERRORCHECKING: - return errorchecking; - case N_SUBDIVISIONS: - return subdivisions; - case N_TMP1: - return tmp1; - default: - abort(); - return -1; //not necessary, needed to shut up compiler - } -} - -void -Renderhints::setProperty( long property, REAL value ) -{ - switch ( property ) { - case N_DISPLAY: - display_method = value; - break; - case N_ERRORCHECKING: - errorchecking = value; - break; - case N_SUBDIVISIONS: - subdivisions = value; - break; - case N_TMP1: /* unused */ - tmp1 = value; - break; - default: - abort(); - break; - } -} diff --git a/src/libs/mesa/glu/libnurbs/internals/renderhints.h b/src/libs/mesa/glu/libnurbs/internals/renderhints.h deleted file mode 100644 index 444f649be2..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/renderhints.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * renderhints.h - * - */ - -#ifndef __glurenderhints_h_ -#define __glurenderhints_h_ - -#include "types.h" - -class Renderhints { -public: - Renderhints( void ); - void init( void ); - int isProperty( long ); - REAL getProperty( long ); - void setProperty( long, REAL ); - - REAL display_method; /* display mode */ - REAL errorchecking; /* activate error checking */ - REAL subdivisions; /* maximum number of subdivisions per patch */ - REAL tmp1; /* unused */ - - int displaydomain; - int maxsubdivisions; - int wiretris; - int wirequads; -}; - -#endif /* __glurenderhints_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/simplemath.h b/src/libs/mesa/glu/libnurbs/internals/simplemath.h deleted file mode 100644 index 0a060c57ea..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/simplemath.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * simplemath.h - * - */ - -#ifndef __glusimplemath_h_ -#define __glusimplemath_h_ - -/* simple inline routines */ - -inline int -max( int x, int y ) { return ( x < y ) ? y : x; } - -inline REAL -min( REAL x, REAL y ) { return ( x > y ) ? y : x; } - -inline REAL -glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; } - -#endif /* __glusimplemath_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/slicer.cc b/src/libs/mesa/glu/libnurbs/internals/slicer.cc deleted file mode 100644 index 27d2a650d1..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/slicer.cc +++ /dev/null @@ -1,1300 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * slicer.c++ - * - */ - -#include -#include -#include -#include "glimports.h" -#include "mystdio.h" -#include "myassert.h" -#include "bufpool.h" -#include "slicer.h" -#include "backend.h" -#include "arc.h" -#include "gridtrimvertex.h" -#include "simplemath.h" -#include "trimvertex.h" -#include "varray.h" - -#include "polyUtil.h" //for area() - -//static int count=0; - -/*USE_OPTTT is initiated in trimvertex.h*/ - -#ifdef USE_OPTTT - #include -#endif - -//#define USE_READ_FLAG //whether to use new or old tesselator - //if defined, it reads "flagFile", - // if the number is 1, then use new tess - // otherwise, use the old tess. - //if not defined, then use new tess. -#ifdef USE_READ_FLAG -static Int read_flag(char* name); -Int newtess_flag = read_flag("flagFile"); -#endif - -//#define COUNT_TRIANGLES -#ifdef COUNT_TRIANGLES -Int num_triangles = 0; -Int num_quads = 0; -#endif - -#define max(a,b) ((a>b)? a:b) -#define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/ -#define equalRect(a,b) ((glu_abs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle - -#if 0 // UNUSED -static Int is_Convex(Arc_ptr loop) -{ - if(area(loop->tail(), loop->head(), loop->next->head()) <0 ) - return 0; - for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next) - { - if(area(jarc->tail(), jarc->head(), jarc->next->head()) < 0) - return 0; - } - return 1; -} -#endif - -/******triangulate a monotone polygon**************/ -#include "monoTriangulation.h" -#if 0 // UNUSED -static int is_U_monotone(Arc_ptr loop) -{ - int n_changes=0; - int prev_sign; - int cur_sign; - Arc_ptr temp; - - cur_sign = compV2InX(loop->head(), loop->tail()); - - n_changes = (compV2InX(loop->prev->head(), loop->prev->tail()) - != cur_sign); - - for(temp=loop->next; temp != loop; temp = temp->next) - { - prev_sign = cur_sign; - cur_sign = compV2InX(temp->head(), temp->tail()); - if(cur_sign != prev_sign) - { -#ifdef DEBUG - printf("***change signe\n"); -#endif - n_changes++; - } - } - if(n_changes == 2) return 1; - else - return 0; -} -#endif - -inline int compInY(REAL a[2], REAL b[2]) -{ - if(a[1] < b[1]) - return -1; - else if (a[1] > b[1]) - return 1; - else if(a[0] > b[0]) - return 1; - else return -1; -} - -void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream) -{ - int i; - //find the top, bottom, increasing and decreasing chain - //then call monoTrianulation - Arc_ptr jarc, temp; - Arc_ptr top; - Arc_ptr bot; - top = bot = loop; - if(compInY(loop->tail(), loop->prev->tail()) < 0) - { - //first find bot - for(temp = loop->next; temp != loop; temp = temp->next) - { - if(compInY(temp->tail(), temp->prev->tail()) > 0) - break; - } - bot = temp->prev; - //then find top - for(temp=loop->prev; temp != loop; temp = temp->prev) - { - if(compInY(temp->tail(), temp->prev->tail()) > 0) - break; - } - top = temp; - } - else //loop > loop->prev - { - for(temp=loop->next; temp != loop; temp = temp->next) - { - if(compInY(temp->tail(), temp->prev->tail()) < 0) - break; - } - top = temp->prev; - for(temp=loop->prev; temp != loop; temp = temp->prev) - { - if(compInY(temp->tail(), temp->prev->tail()) < 0) - break; - } - bot = temp; - } - //creat increase and decrease chains - vertexArray inc_chain(50); //this is a dynamci array - for(i=1; i<=top->pwlArc->npts-2; i++) - { - //the first vertex is the top which doesn't below to inc_chain - inc_chain.appendVertex(top->pwlArc->pts[i].param); - } - for(jarc=top->next; jarc != bot; jarc = jarc->next) - { - for(i=0; i<=jarc->pwlArc->npts-2; i++) - { - inc_chain.appendVertex(jarc->pwlArc->pts[i].param); - } - - } - vertexArray dec_chain(50); - for(jarc = top->prev; jarc != bot; jarc = jarc->prev) - { - for(i=jarc->pwlArc->npts-2; i>=0; i--) - { - dec_chain.appendVertex(jarc->pwlArc->pts[i].param); - } - } - for(i=bot->pwlArc->npts-2; i>=1; i--) - { - dec_chain.appendVertex(jarc->pwlArc->pts[i].param); - } - - monoTriangulationRec(top->tail(), bot->tail(), &inc_chain, 0, - &dec_chain, 0, &backend); - -} - -/********tesselate a rectanlge (OPTIMIZATION**************/ -static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend); - -static Int is_rect(Arc_ptr loop) -{ - Int nlines =1; - for(Arc_ptr jarc = loop->next; jarc != loop; jarc = jarc->next) - { - nlines++; - if(nlines == 5) - break; - } - if(nlines != 4) - return 0; - - -/* -printf("here1\n"); -printf("loop->tail=(%f,%f)\n", loop->tail()[0], loop->tail()[1]); -printf("loop->head=(%f,%f)\n", loop->head()[0], loop->head()[1]); -printf("loop->next->tail=(%f,%f)\n", loop->next->tail()[0], loop->next->tail()[1]); -printf("loop->next->head=(%f,%f)\n", loop->next->head()[0], loop->next->head()[1]); -if(fglu_abs(loop->tail()[0] - loop->head()[0])<0.000001) - printf("equal 1\n"); -if(loop->next->tail()[1] == loop->next->head()[1]) - printf("equal 2\n"); -*/ - - if( (glu_abs(loop->tail()[0] - loop->head()[0])<=ZERO) && - (glu_abs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) && - (glu_abs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) && - (glu_abs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO) - ) - return 1; - else if - ( (glu_abs(loop->tail()[1] - loop->head()[1]) <= ZERO) && - (glu_abs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) && - (glu_abs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) && - (glu_abs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO) - ) - return 1; - else - return 0; -} - - -//a line with the same u for opt -#ifdef USE_OPTTT -static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend) -{ - int i; - backend.preEvaluateBU(verts[0].param[0]); - for(i=0; itail()[1] == loop->head()[1]) - { - if(loop->tail()[1] > loop->prev->prev->tail()[1]) - { - - top = loop; - } - else{ - - top = loop->prev->prev; - } - } - else - { - if(loop->tail()[0] > loop->prev->prev->tail()[0]) - { - //loop is the right arc - - top = loop->next; - } - else - { - - top = loop->prev; - } - } - left = top->next; - bot = left->next; - right= bot->next; - - //if u, v are both nonlinear, then if the - //boundary is tessellated dense, we also - //sample the inside to get a better tesslletant. - if( (!ulinear) && (!vlinear)) - { - int nu = top->pwlArc->npts; - if(nu < bot->pwlArc->npts) - nu = bot->pwlArc->npts; - int nv = left->pwlArc->npts; - if(nv < right->pwlArc->npts) - nv = right->pwlArc->npts; -/* - if(nu > 2 && nv > 2) - { - triangulateRectGen(top, nu-2, nv-2, backend); - return; - } -*/ - } - - if(TB_or_LR == 1) - triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); - else if(TB_or_LR == -1) - triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); - else - { - Int maxPointsTB = top->pwlArc->npts + bot->pwlArc->npts; - Int maxPointsLR = left->pwlArc->npts + right->pwlArc->npts; - - if(maxPointsTB < maxPointsLR) - triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); - else - triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); - } -} - -static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* right, Backend& backend) -{ //if(maxPointsTB >= maxPointsLR) - { - - Int d, topd_left, topd_right, botd_left, botd_right, i,j; - d = left->npts /2; - -#ifdef USE_OPTTT - evalLineNOGE(top->pts, top->npts, backend); - evalLineNOGE(bot->pts, bot->npts, backend); - evalLineNOGE(left->pts, left->npts, backend); - evalLineNOGE(right->pts, right->npts, backend); -#endif - - if(top->npts == 2) { - backend.bgntfan(); - OPT_OUTVERT(top->pts[0], backend);//the root - for(i=0; inpts; i++){ - OPT_OUTVERT(left->pts[i], backend); - } - for(i=1; i<= bot->npts-2; i++){ - OPT_OUTVERT(bot->pts[i], backend); - } - backend.endtfan(); - - backend.bgntfan(); - OPT_OUTVERT(bot->pts[bot->npts-2], backend); - for(i=0; inpts; i++){ - OPT_OUTVERT(right->pts[i], backend); - } - backend.endtfan(); - } - else if(bot->npts == 2) { - backend.bgntfan(); - OPT_OUTVERT(bot->pts[0], backend);//the root - for(i=0; inpts; i++){ - OPT_OUTVERT(right->pts[i], backend); - } - for(i=1; i<= top->npts-2; i++){ - OPT_OUTVERT(top->pts[i], backend); - } - backend.endtfan(); - - backend.bgntfan(); - OPT_OUTVERT(top->pts[top->npts-2], backend); - for(i=0; inpts; i++){ - OPT_OUTVERT(left->pts[i], backend); - } - backend.endtfan(); - } - else { //both top and bot have >=3 points - - backend.bgntfan(); - - OPT_OUTVERT(top->pts[top->npts-2], backend); - - for(i=0; i<=d; i++) - { - OPT_OUTVERT(left->pts[i], backend); - } - backend.endtfan(); - - backend.bgntfan(); - - OPT_OUTVERT(bot->pts[1], backend); - - OPT_OUTVERT(top->pts[top->npts-2], backend); - - for(i=d; i< left->npts; i++) - { - OPT_OUTVERT(left->pts[i], backend); - } - backend.endtfan(); - - d = right->npts/2; - //output only when dnpts-1 and - // - if(dnpts-1) - { - backend.bgntfan(); - // backend.tmeshvert(& top->pts[1]); - OPT_OUTVERT(top->pts[1], backend); - for(i=d; i< right->npts; i++) - { - // backend.tmeshvert(& right->pts[i]); - - OPT_OUTVERT(right->pts[i], backend); - - } - backend.endtfan(); - } - - backend.bgntfan(); - // backend.tmeshvert(& bot->pts[bot->npts-2]); - OPT_OUTVERT( bot->pts[bot->npts-2], backend); - for(i=0; i<=d; i++) - { - // backend.tmeshvert(& right->pts[i]); - OPT_OUTVERT(right->pts[i], backend); - - } - - // backend.tmeshvert(& top->pts[1]); - OPT_OUTVERT(top->pts[1], backend); - - backend.endtfan(); - - - topd_left = top->npts-2; - topd_right = 1; //topd_left>= topd_right - - botd_left = 1; - botd_right = bot->npts-2; //botd_left<= bot_dright - - - if(top->npts < bot->npts) - { - int delta=bot->npts - top->npts; - int u = delta/2; - botd_left = 1+ u; - botd_right = bot->npts-2-( delta-u); - - if(botd_left >1) - { - backend.bgntfan(); - // backend.tmeshvert(& top->pts[top->npts-2]); - OPT_OUTVERT(top->pts[top->npts-2], backend); - for(i=1; i<= botd_left; i++) - { - // backend.tmeshvert(& bot->pts[i]); - OPT_OUTVERT(bot->pts[i] , backend); - } - backend.endtfan(); - } - if(botd_right < bot->npts-2) - { - backend.bgntfan(); - OPT_OUTVERT(top->pts[1], backend); - for(i=botd_right; i<= bot->npts-2; i++) - OPT_OUTVERT(bot->pts[i], backend); - backend.endtfan(); - } - } - else if(top->npts> bot->npts) - { - int delta=top->npts-bot->npts; - int u = delta/2; - topd_left = top->npts-2 - u; - topd_right = 1+delta-u; - - if(topd_left < top->npts-2) - { - backend.bgntfan(); - // backend.tmeshvert(& bot->pts[1]); - OPT_OUTVERT(bot->pts[1], backend); - for(i=topd_left; i<= top->npts-2; i++) - { - // backend.tmeshvert(& top->pts[i]); - OPT_OUTVERT(top->pts[i], backend); - } - backend.endtfan(); - } - if(topd_right > 1) - { - backend.bgntfan(); - OPT_OUTVERT(bot->pts[bot->npts-2], backend); - for(i=1; i<= topd_right; i++) - OPT_OUTVERT(top->pts[i], backend); - backend.endtfan(); - } - } - - if(topd_left <= topd_right) - return; - - backend.bgnqstrip(); - for(j=botd_left, i=topd_left; i>=topd_right; i--,j++) - { - // backend.tmeshvert(& top->pts[i]); - // backend.tmeshvert(& bot->pts[j]); - OPT_OUTVERT(top->pts[i], backend); - OPT_OUTVERT(bot->pts[j], backend); - } - backend.endqstrip(); - - } - } -} - - -static void triangulateRectCenter(int n_ulines, REAL* u_val, - int n_vlines, REAL* v_val, - Backend& backend) -{ - - // XXX this code was patched by Diego Santa Cruz - // to fix a problem in which glMapGrid2f() was called with bad parameters. - // This has beens submitted to SGI but not integrated as of May 1, 2001. - if(n_ulines>1 && n_vlines>1) { - backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1, - v_val[n_vlines-1], v_val[0], n_vlines-1); - backend.surfmesh(0,0,n_ulines-1,n_vlines-1); - } - - return; - - /* - for(i=0; ipwlArc->npts); - assert(upper_val); - if(dir) - { - for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) - { - upper_val[k] = arc->pwlArc->pts[i].param[0]; - } - backend.evalUStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], - upper_val, - n_ulines, v, u_val); - } - else - { - for(k=0,i=0; ipwlArc->npts; i++,k++) - { - upper_val[k] = arc->pwlArc->pts[i].param[0]; - - } - - backend.evalUStrip( - n_ulines, v, u_val, - arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], upper_val - ); - } - - free(upper_val); - return; - } - else //is_v - { - int i,k; - REAL* left_val = (REAL*) malloc(sizeof(REAL) * arc->pwlArc->npts); - assert(left_val); - if(dir) - { - for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) - { - left_val[k] = arc->pwlArc->pts[i].param[1]; - } - backend.evalVStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], - left_val, - n_ulines, v, u_val); - } - else - { - for(k=0,i=0; ipwlArc->npts; i++,k++) - { - left_val[k] = arc->pwlArc->pts[i].param[1]; - } - backend.evalVStrip( - n_ulines, v, u_val, - arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], left_val - ); - } - free(left_val); - return; - } - - //the following is a different version of the above code. If you comment - //the above code, the following code will still work. The reason to leave - //the folliwng code here is purely for testing purpose. - /* - int i,j; - PwlArc* parc = arc->pwlArc; - int d1 = parc->npts-1; - int d2 = 0; - TrimVertex trimVert; - trimVert.nuid = 0;//???? - REAL* temp_u_val = u_val; - if(dir ==0) //have to reverse u_val - { - temp_u_val = (REAL*) malloc(sizeof(REAL) * n_ulines); - assert(temp_u_val); - for(i=0; inpts > n_ulines) - { - d1 = n_ulines-1; - - backend.bgntfan(); - if(is_u){ - trimVert.param[0] = u_val[0]; - trimVert.param[1] = v; - } - else - { - trimVert.param[1] = u_val[0]; - trimVert.param[0] = v; - } - - backend.tmeshvert(& trimVert); - for(i=d1; i< parc->npts; i++) - backend.tmeshvert(& parc->pts[i]); - backend.endtfan(); - - - } - else if(parc->npts < n_ulines) - { - d2 = n_ulines-parc->npts; - - - backend.bgntfan(); - backend.tmeshvert(& parc->pts[parc->npts-1]); - for(i=0; i<= d2; i++) - { - if(is_u){ - trimVert.param[0] = u_val[i]; - trimVert.param[1] = v; - } - else - { - trimVert.param[1] = u_val[i]; - trimVert.param[0] = v; - } - backend.tmeshvert(&trimVert); - } - backend.endtfan(); - - } - if(d1>0){ - - - backend.bgnqstrip(); - for(i=d1, j=d2; i>=0; i--, j++) - { - backend.tmeshvert(& parc->pts[i]); - - if(is_u){ - trimVert.param[0] = u_val[j]; - trimVert.param[1] = v; - } - else{ - trimVert.param[1] = u_val[j]; - trimVert.param[0] = v; - } - backend.tmeshvert(&trimVert); - - - - } - backend.endqstrip(); - - - } - if(dir == 0) //temp_u_val was mallocated - free(temp_u_val); - */ -} - -//n_ulines is the number of ulines inside, and n_vlines is the number of vlines -//inside, different from meanings elsewhere!!! -static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend& backend) -{ - - int i; - //we know the loop is a rectangle, but not sure which is top - Arc_ptr top, bot, left, right; - - if(equalRect(loop->tail()[1] , loop->head()[1])) - { - - if(loop->tail()[1] > loop->prev->prev->tail()[1]) - { - - top = loop; - } - else{ - - top = loop->prev->prev; - } - } - else - { - if(loop->tail()[0] > loop->prev->prev->tail()[0]) - { - //loop is the right arc - - top = loop->next; - } - else - { - - top = loop->prev; - } - } - - left = top->next; - bot = left->next; - right= bot->next; - -#ifdef COUNT_TRIANGLES - num_triangles += loop->pwlArc->npts + - left->pwlArc->npts + - bot->pwlArc->npts + - right->pwlArc->npts - + 2*n_ulines + 2*n_vlines - -8; - num_quads += (n_ulines-1)*(n_vlines-1); -#endif -/* - backend.surfgrid(left->tail()[0], right->tail()[0], n_ulines+1, - top->tail()[1], bot->tail()[1], n_vlines+1); -// if(n_ulines>1 && n_vlines>1) - backend.surfmesh(0,0,n_ulines+1,n_vlines+1); -return; -*/ - REAL* u_val=(REAL*) malloc(sizeof(REAL)*n_ulines); - assert(u_val); - REAL* v_val=(REAL*)malloc(sizeof(REAL) * n_vlines); - assert(v_val); - REAL u_stepsize = (right->tail()[0] - left->tail()[0])/( (REAL) n_ulines+1); - REAL v_stepsize = (top->tail()[1] - bot->tail()[1])/( (REAL) n_vlines+1); - Real temp=left->tail()[0]+u_stepsize; - for(i=0; itail()[1] + v_stepsize; - for(i=0; ipwlArc->npts); - for(i=0; ipwlArc->npts; i++) - { - vert[0] = arc->pwlArc->pts[i].param[0]; - vert[1] = arc->pwlArc->pts[i].param[1]; - sline->setPoint(i, vert); - } - ret = new directedLine(INCREASING, sline); - return ret; -} - -/*an pwlArc may not be a straight line*/ -directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) -{ - directedLine* ret = original; - int is_linear = 0; - if(arc->pwlArc->npts == 2 ) - is_linear = 1; - else if(area(arc->pwlArc->pts[0].param, arc->pwlArc->pts[1].param, arc->pwlArc->pts[arc->pwlArc->npts-1].param) == 0.0) - is_linear = 1; - - if(is_linear) - { - directedLine *dline = arcToDLine(arc); - if(ret == NULL) - ret = dline; - else - ret->insert(dline); - return ret; - } - else /*not linear*/ - { - for(Int i=0; ipwlArc->npts-1; i++) - { - Real vert[2][2]; - vert[0][0] = arc->pwlArc->pts[i].param[0]; - vert[0][1] = arc->pwlArc->pts[i].param[1]; - vert[1][0] = arc->pwlArc->pts[i+1].param[0]; - vert[1][1] = arc->pwlArc->pts[i+1].param[1]; - - sampledLine *sline = new sampledLine(2, vert); - directedLine *dline = new directedLine(INCREASING, sline); - if(ret == NULL) - ret = dline; - else - ret->insert(dline); - } - return ret; - } -} - - - -directedLine* arcLoopToDLineLoop(Arc_ptr loop) -{ - directedLine* ret; - - if(loop == NULL) - return NULL; - ret = arcToMultDLines(NULL, loop); -//ret->printSingle(); - for(Arc_ptr temp = loop->next; temp != loop; temp = temp->next){ - ret = arcToMultDLines(ret, temp); -//ret->printSingle(); - } - - return ret; -} - -/* -void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) -{ - TrimVertex *trimVert = (TrimVertex*)malloc(sizeof(TrimVertex)); - trimVert -> nuid = 0;//???? - - Real* u_values = grid->get_u_values(); - Real* v_values = grid->get_v_values(); - - Int i,j,k,l; - - for(l=0; lget_n_elements(); l++) - { - rectBlock* block = rbArray->get_element(l); - for(k=0, i=block->get_upGridLineIndex(); i>block->get_lowGridLineIndex(); i--, k++) - { - - backend.bgnqstrip(); - for(j=block->get_leftIndices()[k+1]; j<= block->get_rightIndices()[k+1]; j++) - { - trimVert->param[0] = u_values[j]; - trimVert->param[1] = v_values[i]; - backend.tmeshvert(trimVert); - - trimVert->param[1] = v_values[i-1]; - backend.tmeshvert(trimVert); - - } - backend.endqstrip(); - - } - } - - free(trimVert); -} -*/ - -void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) -{ - Int i,j,k; - - Int n_vlines=grid->get_n_vlines(); - //the reason to switch the position of v_max and v_min is because of the - //the orientation problem. glEvalMesh generates quad_strip clockwise, but - //we need counter-clockwise. - backend.surfgrid(grid->get_u_min(), grid->get_u_max(), grid->get_n_ulines()-1, - grid->get_v_max(), grid->get_v_min(), n_vlines-1); - - - for(j=0; jget_n_elements(); j++) - { - rectBlock* block = rbArray->get_element(j); - Int low = block->get_lowGridLineIndex(); - Int high = block->get_upGridLineIndex(); - - for(k=0, i=high; i>low; i--, k++) - { - backend.surfmesh(block->get_leftIndices()[k+1], n_vlines-1-i, block->get_rightIndices()[k+1]-block->get_leftIndices()[k+1], 1); - } - } -} - - -void Slicer::evalStream(primStream* pStream) -{ - Int i,j,k; - k=0; -/* TrimVertex X;*/ - TrimVertex *trimVert =/*&X*/ (TrimVertex*)malloc(sizeof(TrimVertex)); - trimVert -> nuid = 0;//??? - Real* vertices = pStream->get_vertices(); //for efficiency - for(i=0; iget_n_prims(); i++) - { - - //ith primitive has #vertices = lengths[i], type=types[i] - switch(pStream->get_type(i)){ - case PRIMITIVE_STREAM_FAN: - - backend.bgntfan(); - - for(j=0; jget_length(i); j++) - { - trimVert->param[0] = vertices[k]; - trimVert->param[1] = vertices[k+1]; - backend.tmeshvert(trimVert); - -// backend.tmeshvert(vertices[k], vertices[k+1]); - k += 2; - } - backend.endtfan(); - break; - - default: - fprintf(stderr, "evalStream: not implemented yet\n"); - exit(1); - - } - } - free(trimVert); -} - - - - -void Slicer::slice_new(Arc_ptr loop) -{ -//count++; -//if(count == 78) count=1; -//printf("count=%i\n", count); -//if( ! (4<= count && count <=4)) return; - - - Int num_ulines; - Int num_vlines; - Real uMin, uMax, vMin, vMax; - Real mydu, mydv; - uMin = uMax = loop->tail()[0]; - vMin = vMax = loop->tail()[1]; - mydu = (du>0)? du: -du; - mydv = (dv>0)? dv: -dv; - - for(Arc_ptr jarc=loop->next; jarc != loop; jarc = jarc->next) - { - - if(jarc->tail()[0] < uMin) - uMin = jarc->tail()[0]; - if(jarc->tail()[0] > uMax) - uMax = jarc->tail()[0]; - if(jarc->tail()[1] < vMin) - vMin = jarc->tail()[1]; - if(jarc->tail()[1] > vMax) - vMax = jarc->tail()[1]; - } - - if (uMax == uMin) - return; // prevent divide-by-zero. Jon Perry. 17 June 2002 - - if(mydu > uMax - uMin) - num_ulines = 2; - else - { - num_ulines = 3 + (Int) ((uMax-uMin)/mydu); - } - if(mydv>=vMax-vMin) - num_vlines = 2; - else - { - num_vlines = 2+(Int)((vMax-vMin)/mydv); - } - - Int isRect = is_rect(loop); - - if(isRect && (num_ulines<=2 || num_vlines<=2)) - { - if(vlinear) - triangulateRect(loop, backend, 1, ulinear, vlinear); - else if(ulinear) - triangulateRect(loop, backend, -1, ulinear, vlinear); - else - triangulateRect(loop, backend, 0, ulinear, vlinear); - } - - else if(isRect) - { - triangulateRectGen(loop, num_ulines-2, num_vlines-2, backend); - } - else if( (num_ulines<=2 || num_vlines <=2) && ulinear) - { - monoTriangulationFunBackend(loop, compV2InY, &backend); - } - else if( (!ulinear) && (!vlinear) && (num_ulines == 2) && (num_vlines > 2)) - { - monoTriangulationFunBackend(loop, compV2InY, &backend); - } - else - { - directedLine* poly = arcLoopToDLineLoop(loop); - - gridWrap grid(num_ulines, num_vlines, uMin, uMax, vMin, vMax); - primStream pStream(20, 20); - rectBlockArray rbArray(20); - - sampleMonoPoly(poly, &grid, ulinear, vlinear, &pStream, &rbArray); - - evalStream(&pStream); - - evalRBArray(&rbArray, &grid); - -#ifdef COUNT_TRIANGLES - num_triangles += pStream.num_triangles(); - num_quads += rbArray.num_quads(); -#endif - poly->deleteSinglePolygonWithSline(); - } - -#ifdef COUNT_TRIANGLES - printf("num_triangles=%i\n", num_triangles); - printf("num_quads = %i\n", num_quads); -#endif -} - -void Slicer::slice(Arc_ptr loop) -{ -#ifdef USE_READ_FLAG - if(read_flag("flagFile")) - slice_new(loop); - else - slice_old(loop); - -#else - slice_new(loop); -#endif - -} - - - -Slicer::Slicer( Backend &b ) - : CoveAndTiler( b ), Mesher( b ), backend( b ) -{ - ulinear = 0; - vlinear = 0; -} - -Slicer::~Slicer() -{ -} - -void -Slicer::setisolines( int x ) -{ - isolines = x; -} - -void -Slicer::setstriptessellation( REAL x, REAL y ) -{ - assert(x > 0 && y > 0); - du = x; - dv = y; - setDu( du ); -} - -void -Slicer::slice_old( Arc_ptr loop ) -{ - loop->markverts(); - - Arc_ptr extrema[4]; - loop->getextrema( extrema ); - - unsigned int npts = loop->numpts(); - TrimRegion::init( npts, extrema[0] ); - - Mesher::init( npts ); - - long ulines = uarray.init( du, extrema[1], extrema[3] ); -//printf("ulines = %i\n", ulines); - Varray varray; - long vlines = varray.init( dv, extrema[0], extrema[2] ); -//printf("vlines = %i\n", vlines); - long botv = 0; - long topv; - TrimRegion::init( varray.varray[botv] ); - getGridExtent( &extrema[0]->pwlArc->pts[0], &extrema[0]->pwlArc->pts[0] ); - - for( long quad=0; quadmarkverts(); - - if( jarc->pwlArc->npts >= 2 ) { - backend.bgnoutline(); - for( int j = jarc->pwlArc->npts-1; j >= 0; j-- ) - backend.linevert( &(jarc->pwlArc->pts[j]) ); - backend.endoutline(); - } -} - - diff --git a/src/libs/mesa/glu/libnurbs/internals/slicer.h b/src/libs/mesa/glu/libnurbs/internals/slicer.h deleted file mode 100644 index e1f5d22ff1..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/slicer.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * slicer.h - * - */ - -#ifndef __gluslicer_h_ -#define __gluslicer_h_ - -#include "trimregion.h" -#include "mesher.h" -#include "coveandtiler.h" -#include "primitiveStream.h" -#include "rectBlock.h" - -class Backend; -class Arc; -class TrimVertex; - -class Slicer : public CoveAndTiler, public Mesher { -public: - Slicer( Backend & ); - ~Slicer( void ); - void slice( Arc_ptr ); - void slice_old( Arc_ptr); - void slice_new( Arc_ptr ); - void evalStream(primStream* ); - void evalRBArray(rectBlockArray* rbArray, gridWrap* grid); - - void outline( Arc_ptr ); - void setstriptessellation( REAL, REAL ); - void setisolines( int ); - - void set_ulinear(int ulinear_flag) - { - ulinear = ulinear_flag; - } - void set_vlinear(int vlinear_flag) - { - vlinear = vlinear_flag; - } -private: - Backend& backend; - REAL oneOverDu; - REAL du, dv; - int isolines; - - void outline( void ); - void initGridlines( void ); - void advanceGridlines( long ); - - int ulinear; //indicate whether uorder is 2 or not - int vlinear; //indicate whether vorder is 2 or not -}; -#endif /* __gluslicer_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/sorter.cc b/src/libs/mesa/glu/libnurbs/internals/sorter.cc deleted file mode 100644 index 7a79941492..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/sorter.cc +++ /dev/null @@ -1,139 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * sorter.c++ - * - */ - -#include "glimports.h" -#include "sorter.h" -#include "mystdio.h" - -Sorter::Sorter( int _es ) -{ - es = _es; -} - -void -Sorter::qsort( void *a, int n ) -{ - qs1( (char *)a, ((char *)a)+n*es); -} - -int -Sorter::qscmp( char *, char * ) -{ - _glu_dprintf( "Sorter::qscmp: pure virtual called\n" ); - return 0; -} - - -void -Sorter::qsexc( char *, char * ) -{ - _glu_dprintf( "Sorter::qsexc: pure virtual called\n" ); -} - - -void -Sorter::qstexc( char *, char *, char * ) -{ - _glu_dprintf( "Sorter::qstexc: pure virtual called\n" ); -} - -void -Sorter::qs1( char *a, char *l ) -{ - char *i, *j; - char *lp, *hp; - int c; - unsigned int n; - -start: - if((n=l-a) <= (unsigned int)es) - return; - n = es * (n / (2*es)); - hp = lp = a+n; - i = a; - j = l-es; - while(1) { - if(i < lp) { - if((c = qscmp(i, lp)) == 0) { - qsexc(i, lp -= es); - continue; - } - if(c < 0) { - i += es; - continue; - } - } - -loop: - if(j > hp) { - if((c = qscmp(hp, j)) == 0) { - qsexc(hp += es, j); - goto loop; - } - if(c > 0) { - if(i == lp) { - qstexc(i, hp += es, j); - i = lp += es; - goto loop; - } - qsexc(i, j); - j -= es; - i += es; - continue; - } - j -= es; - goto loop; - } - - if(i == lp) { - if(lp-a >= l-hp) { - qs1(hp+es, l); - l = lp; - } else { - qs1(a, lp); - a = hp+es; - } - goto start; - } - - qstexc(j, lp -= es, i); - j = hp -= es; - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/sorter.h b/src/libs/mesa/glu/libnurbs/internals/sorter.h deleted file mode 100644 index 57ea121290..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/sorter.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef __glusorter_h_ -#define __glusorter_h_ - -class Sorter { -public: - Sorter( int es ); - virtual ~Sorter() { /* silence warning*/ } - void qsort( void *a, int n ); - -protected: - virtual int qscmp( char *, char * ); - virtual void qsexc( char *i, char *j ); // i<-j, j<-i - virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i - -private: - void qs1( char *, char * ); - int es; -}; -#endif /* __glusorter_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/splitarcs.cc b/src/libs/mesa/glu/libnurbs/internals/splitarcs.cc deleted file mode 100644 index 1f79d543fb..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/splitarcs.cc +++ /dev/null @@ -1,293 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * splitarcs.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mysetjmp.h" -#include "mystdio.h" -#include "subdivider.h" -#include "arcsorter.h" -#include "arc.h" -#include "bin.h" - -/* local preprocessor definitions */ -#define MAXARCS 10 - -/*---------------------------------------------------------------------------- - * Subdivider::split - split trim regions in source bin by line (param == value). - *---------------------------------------------------------------------------- - */ - -void -Subdivider::split( Bin& bin, Bin& left, Bin& right, int param, REAL value ) -{ - Bin intersections, unknown; - - partition( bin, left, intersections, right, unknown, param, value ); - - int count = intersections.numarcs(); - if( count % 2 ) { -#ifndef NDEBUG - left.show( "left" ); - intersections.show( "intersections" ); - right.show( "right" ); -#endif - ::mylongjmp( jumpbuffer, 29 ); - } - - Arc_ptr arclist[MAXARCS], *list; - if( count >= MAXARCS ) { - list = new Arc_ptr[count]; - } else { - list = arclist; - } - - Arc_ptr jarc, *last, *lptr; - for( last = list; (jarc=intersections.removearc()) != NULL; last++ ) - *last = jarc; - - if( param == 0 ) { /* sort into increasing t order */ - ArcSdirSorter sorter(*this); - sorter.qsort( list, count ); - - //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_s); - for( lptr=list; lptrhead()[0] <= value) && ((*lptr)->tail()[0] <= value) ) - left.addarc( *lptr ); - else - right.addarc( *lptr ); - } - } else { /* sort into decreasing s order */ - ArcTdirSorter sorter(*this); - sorter.qsort( list, count ); - //::qsort ((void *)list, count, sizeof(Arc_ptr), (cmpfunc)compare_t); - for( lptr=list; lptrhead()[1] <= value) && ((*lptr)->tail()[1] <= value) ) - left.addarc( *lptr ); - else - right.addarc( *lptr ); - } - } - - if( list != arclist ) delete[] list; - unknown.adopt(); -} - - -void -Subdivider::check_s( Arc_ptr jarc1, Arc_ptr jarc2 ) -{ - assert( jarc1->check( ) != 0 ); - assert( jarc2->check( ) != 0 ); - assert( jarc1->next->check( ) != 0 ); - assert( jarc2->next->check( ) != 0 ); - assert( jarc1 != jarc2 ); - - /* XXX - if these assertions fail, it is due to user error or - undersampling */ - if( ! ( jarc1->tail()[0] < (jarc1)->head()[0] ) ) { -#ifndef NDEBUG - _glu_dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] ); -#endif - ::mylongjmp( jumpbuffer, 28 ); - } - - if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) { -#ifndef NDEBUG - _glu_dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] ); -#endif - ::mylongjmp( jumpbuffer, 28 ); - } -} - -inline void -Subdivider::link( Arc_ptr jarc1, Arc_ptr jarc2, Arc_ptr up, Arc_ptr down ) -{ - up->nuid = down->nuid = 0; // XXX - - up->next = jarc2; - down->next = jarc1; - up->prev = jarc1->prev; - down->prev = jarc2->prev; - - down->next->prev = down; - up->next->prev = up; - down->prev->next = down; - up->prev->next = up; -} - -inline void -Subdivider::simple_link( Arc_ptr jarc1, Arc_ptr jarc2 ) -{ - Arc_ptr tmp = jarc2->prev; - jarc2->prev = jarc1->prev; - jarc1->prev = tmp; - jarc2->prev->next = jarc2; - jarc1->prev->next = jarc1; -} - - -/*---------------------------------------------------------------------------- - * join - add a pair of oppositely directed jordan arcs between two arcs - *---------------------------------------------------------------------------- - */ - -void -Subdivider::join_s( Bin& left, Bin& right, Arc_ptr jarc1, Arc_ptr jarc2 ) -{ - assert( jarc1->check( ) != 0); - assert( jarc2->check( ) != 0); - assert( jarc1 != jarc2 ); - - if( ! jarc1->getitail() ) - jarc1 = jarc1->next; - - if( ! jarc2->getitail() ) - jarc2 = jarc2->next; - - REAL s = jarc1->tail()[0]; - REAL t1 = jarc1->tail()[1]; - REAL t2 = jarc2->tail()[1]; - - if( t1 == t2 ) { - simple_link( jarc1, jarc2 ); - } else { - Arc_ptr newright = new(arcpool) Arc( arc_right, 0 ); - Arc_ptr newleft = new(arcpool) Arc( arc_left, 0 ); - assert( t1 < t2 ); - if( isBezierArcType() ) { - arctessellator.bezier( newright, s, s, t1, t2 ); - arctessellator.bezier( newleft, s, s, t2, t1 ); - } else { - arctessellator.pwl_right( newright, s, t1, t2, stepsizes[0] ); - arctessellator.pwl_left( newleft, s, t2, t1, stepsizes[2] ); - } - link( jarc1, jarc2, newright, newleft ); - left.addarc( newright ); - right.addarc( newleft ); - } - - assert( jarc1->check( ) != 0 ); - assert( jarc2->check( ) != 0 ); - assert( jarc1->next->check( ) != 0); - assert( jarc2->next->check( ) != 0); -} - -void -Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 ) -{ - assert( jarc1->check( ) != 0 ); - assert( jarc2->check( ) != 0 ); - assert( jarc1->next->check( ) != 0 ); - assert( jarc2->next->check( ) != 0 ); - assert( jarc1 != jarc2 ); - - /* XXX - if these assertions fail, it is due to user error or - undersampling */ - if( ! ( jarc1->tail()[1] < (jarc1)->head()[1] ) ) { -#ifndef NDEBUG - _glu_dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] ); -#endif - ::mylongjmp( jumpbuffer, 28 ); - } - - if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) { -#ifndef NDEBUG - _glu_dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] ); -#endif - ::mylongjmp( jumpbuffer, 28 ); - } -} - -/*---------------------------------------------------------------------------- - * join_t - add a pair of oppositely directed jordan arcs between two arcs - *---------------------------------------------------------------------------- - */ - -void -Subdivider::join_t( Bin& bottom, Bin& top, Arc_ptr jarc1, Arc_ptr jarc2 ) -{ - assert( jarc1->check( ) != 0 ); - assert( jarc2->check( ) != 0 ); - assert( jarc1->next->check( ) != 0 ); - assert( jarc2->next->check( ) != 0 ); - assert( jarc1 != jarc2 ); - - if( ! jarc1->getitail() ) - jarc1 = jarc1->next; - - if( ! jarc2->getitail() ) - jarc2 = jarc2->next; - - REAL s1 = jarc1->tail()[0]; - REAL s2 = jarc2->tail()[0]; - REAL t = jarc1->tail()[1]; - - if( s1 == s2 ) { - simple_link( jarc1, jarc2 ); - } else { - Arc_ptr newtop = new(arcpool) Arc( arc_top, 0 ); - Arc_ptr newbot = new(arcpool) Arc( arc_bottom, 0 ); - assert( s1 > s2 ); - if( isBezierArcType() ) { - arctessellator.bezier( newtop, s1, s2, t, t ); - arctessellator.bezier( newbot, s2, s1, t, t ); - } else { - arctessellator.pwl_top( newtop, t, s1, s2, stepsizes[1] ); - arctessellator.pwl_bottom( newbot, t, s2, s1, stepsizes[3] ); - } - link( jarc1, jarc2, newtop, newbot ); - bottom.addarc( newtop ); - top.addarc( newbot ); - } - - assert( jarc1->check( ) != 0 ); - assert( jarc2->check( ) != 0 ); - assert( jarc1->next->check( ) != 0 ); - assert( jarc2->next->check( ) != 0 ); -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/subdivider.cc b/src/libs/mesa/glu/libnurbs/internals/subdivider.cc deleted file mode 100644 index cc0b514706..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/subdivider.cc +++ /dev/null @@ -1,910 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * subdivider.cxx - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "subdivider.h" -#include "arc.h" -#include "bezierarc.h" -#include "bin.h" -#include "renderhints.h" -#include "backend.h" -#include "mapdesc.h" -#include "quilt.h" -#include "patchlist.h" -#include "patch.h" -#include "nurbsconsts.h" -#include "trimvertpool.h" -#include "simplemath.h" - -#include "polyUtil.h" //for function area() - -//#define PARTITION_TEST -#ifdef PARTITION_TEST -#include "partitionY.h" -#include "monoTriangulation.h" -#include "dataTransform.h" -#include "monoChain.h" - -#endif - - -#define OPTIMIZE_UNTRIMED_CASE - - -Bin* -Subdivider::makePatchBoundary( const REAL *from, const REAL *to ) -{ - Bin* ret = new Bin(); - REAL smin = from[0]; - REAL smax = to[0]; - REAL tmin = from[1]; - REAL tmax = to[1]; - - pjarc = 0; - - Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 ); - arctessellator.bezier( jarc, smin, smax, tmin, tmin ); - ret->addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_right, 0 ); - arctessellator.bezier( jarc, smax, smax, tmin, tmax ); - ret->addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_top, 0 ); - arctessellator.bezier( jarc, smax, smin, tmax, tmax ); - ret->addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_left, 0 ); - arctessellator.bezier( jarc, smin, smin, tmax, tmin ); - ret->addarc( jarc ); - jarc->append( pjarc ); - - assert( jarc->check() != 0 ); - return ret; -} - -/*--------------------------------------------------------------------------- - * Subdivider - construct a subdivider - *--------------------------------------------------------------------------- - */ - -Subdivider::Subdivider( Renderhints& r, Backend& b ) - : slicer( b ), - arctessellator( trimvertexpool, pwlarcpool ), - arcpool( sizeof( Arc), 1, "arcpool" ), - bezierarcpool( sizeof( BezierArc ), 1, "Bezarcpool" ), - pwlarcpool( sizeof( PwlArc ), 1, "Pwlarcpool" ), - renderhints( r ), - backend( b ) -{ -} - -void -Subdivider::setJumpbuffer( JumpBuffer *j ) -{ - jumpbuffer = j; -} - -/*--------------------------------------------------------------------------- - * clear - reset all state after possible error condition - *--------------------------------------------------------------------------- - */ - -void -Subdivider::clear( void ) -{ - trimvertexpool.clear(); - arcpool.clear(); - pwlarcpool.clear(); - bezierarcpool.clear(); -} - -/*--------------------------------------------------------------------------- - * ~Subdivider - destroy a subdivider - *--------------------------------------------------------------------------- - */ - -Subdivider::~Subdivider( void ) -{ -} - -/*--------------------------------------------------------------------------- - * addArc - add a bezier arc to a trim loop and to a bin - *--------------------------------------------------------------------------- - */ -void -Subdivider::addArc( REAL *cpts, Quilt *quilt, long _nuid ) -{ - BezierArc *bezierArc = new(bezierarcpool) BezierArc; - Arc *jarc = new(arcpool) Arc( arc_none, _nuid ); - jarc->pwlArc = 0; - jarc->bezierArc = bezierArc; - bezierArc->order = quilt->qspec->order; - bezierArc->stride = quilt->qspec->stride; - bezierArc->mapdesc = quilt->mapdesc; - bezierArc->cpts = cpts; - initialbin.addarc( jarc ); - pjarc = jarc->append( pjarc ); -} - -/*--------------------------------------------------------------------------- - * addArc - add a pwl arc to a trim loop and to a bin - *--------------------------------------------------------------------------- - */ - -void -Subdivider::addArc( int npts, TrimVertex *pts, long _nuid ) -{ - Arc *jarc = new(arcpool) Arc( arc_none, _nuid ); - jarc->pwlArc = new(pwlarcpool) PwlArc( npts, pts ); - initialbin.addarc( jarc ); - pjarc = jarc->append( pjarc ); -} - -void -Subdivider::beginQuilts( void ) -{ - qlist = 0; -} - -void -Subdivider::addQuilt( Quilt *quilt ) -{ - quilt->next = qlist; - qlist = quilt; -} - -/*--------------------------------------------------------------------------- - * drawSurfaces - main entry point for surface tessellation - *--------------------------------------------------------------------------- - */ - -void -Subdivider::drawSurfaces( long nuid ) -{ - renderhints.init( ); - - if (qlist == NULL) - { - //initialbin could be nonempty due to some errors - freejarcs(initialbin); - return; - } - - for( Quilt *q = qlist; q; q = q->next ) { - if( q->isCulled( ) == CULL_TRIVIAL_REJECT ) { - freejarcs( initialbin ); - return; - } - } - - - REAL from[2], to[2]; - qlist->getRange( from, to, spbrkpts, tpbrkpts ); -#ifdef OPTIMIZE_UNTRIMED_CASE - //perform optimization only when the samplng method is - //DOMAIN_DISTANCE and the display methdo is either - //fill or outline_polygon. - int optimize = (is_domain_distance_sampling && (renderhints.display_method != N_OUTLINE_PATCH)); -#endif - - if( ! initialbin.isnonempty() ) { -#ifdef OPTIMIZE_UNTRIMED_CASE - if(! optimize ) - { - - makeBorderTrim( from, to ); - } -#else - makeBorderTrim( from, to ); -#endif - } else { - REAL rate[2]; - qlist->findRates( spbrkpts, tpbrkpts, rate ); - - if( decompose( initialbin, min(rate[0], rate[1]) ) ) - mylongjmp( jumpbuffer, 31 ); - } - - backend.bgnsurf( renderhints.wiretris, renderhints.wirequads, nuid ); - -#ifdef PARTITION_TEST - if( initialbin.isnonempty() && spbrkpts.end-2 == spbrkpts.start && - tpbrkpts.end-2 == tpbrkpts.start) -{ - for(int i=spbrkpts.start; idownloadAll(pta, ptb, backend); - - directedLine *poly; - - { - - poly = bin_to_DLineLoops(initialbin); - - poly=poly->deleteDegenerateLinesAllPolygons(); - - sampledLine* retSampledLines; -//printf("before MC_partition\n"); - poly = MC_partitionY(poly, &retSampledLines); -//printf("after MC_partition\n"); - - } - - - { - primStream pStream(5000,5000); - directedLine* temp; - - for(temp=poly; temp != NULL; temp=temp->getNextPolygon()) - - monoTriangulation(temp, &pStream); - - slicer.evalStream(&pStream); - - } - //need to clean up space - } - } - freejarcs( initialbin ); - backend.endsurf(); - return; - - /* - printf("num_polygons=%i\n", poly->numPolygons()); - printf("num_edges=%i\n", poly->numEdgesAllPolygons()); - poly->writeAllPolygons("zloutputFile"); - return; - { - primStream pStream(20,20); - for(directedLine* tempD = poly; tempD != NULL; tempD = tempD->getNextPolygon()) - monoTriangulation(tempD, &pStream); - } - return; - */ -} -#endif //PARTITION_TEST - - -#ifdef OPTIMIZE_UNTRIMED_CASE - if( (!initialbin.isnonempty()) && optimize ) - { - int i,j; - int num_u_steps; - int num_v_steps; - for(i=spbrkpts.start; idownloadAll(pta, ptb, backend); - - num_u_steps = (int) (domain_distance_u_rate * (ptb[0]-pta[0])); - num_v_steps = (int) (domain_distance_v_rate * (ptb[1]-pta[1])); - - if(num_u_steps <= 0) num_u_steps = 1; - if(num_v_steps <= 0) num_v_steps = 1; - - backend.surfgrid(pta[0], ptb[0], num_u_steps, - ptb[1], pta[1], num_v_steps); - backend.surfmesh(0,0,num_u_steps,num_v_steps); - - - - continue; - /* the following is left for reference purpose, don't delete - { - Bin* tempSource; - Patchlist patchlist(qlist, pta, ptb); - patchlist.getstepsize(); - - tempSource=makePatchBoundary(pta, ptb); - - tessellation(*tempSource, patchlist); - - render(*tempSource); - delete tempSource; - } - */ - } - } - } - else - subdivideInS( initialbin ); -#else - - subdivideInS( initialbin ); -#endif - - backend.endsurf(); - -} - -void -Subdivider::subdivideInS( Bin& source ) -{ - if( renderhints.display_method == N_OUTLINE_PARAM ) { - outline( source ); - freejarcs( source ); - } else { - setArcTypeBezier(); - setNonDegenerate(); - splitInS( source, spbrkpts.start, spbrkpts.end ); - } -} - - -/*--------------------------------------------------------------------------- - * splitInS - split a patch and a bin by an isoparametric line - *--------------------------------------------------------------------------- - */ - -void -Subdivider::splitInS( Bin& source, int start, int end ) -{ - if( source.isnonempty() ) { - if( start != end ) { - int i = start + (end - start) / 2; - Bin left, right; - split( source, left, right, 0, spbrkpts.pts[i] ); - splitInS( left, start, i ); - splitInS( right, i+1, end ); - } else { - if( start == spbrkpts.start || start == spbrkpts.end ) { - freejarcs( source ); - } else if( renderhints.display_method == N_OUTLINE_PARAM_S ) { - outline( source ); - freejarcs( source ); - } else { - setArcTypeBezier(); - setNonDegenerate(); - s_index = start; - splitInT( source, tpbrkpts.start, tpbrkpts.end ); - } - } - } -} - -/*--------------------------------------------------------------------------- - * splitInT - split a patch and a bin by an isoparametric line - *--------------------------------------------------------------------------- - */ - -void -Subdivider::splitInT( Bin& source, int start, int end ) -{ - if( source.isnonempty() ) { - if( start != end ) { - int i = start + (end - start) / 2; - Bin left, right; - split( source, left, right, 1, tpbrkpts.pts[i] ); - splitInT( left, start, i ); - splitInT( right, i+1, end ); - } else { - if( start == tpbrkpts.start || start == tpbrkpts.end ) { - freejarcs( source ); - } else if( renderhints.display_method == N_OUTLINE_PARAM_ST ) { - outline( source ); - freejarcs( source ); - } else { - t_index = start; - setArcTypeBezier(); - setDegenerate(); - - REAL pta[2], ptb[2]; - pta[0] = spbrkpts.pts[s_index-1]; - pta[1] = tpbrkpts.pts[t_index-1]; - - ptb[0] = spbrkpts.pts[s_index]; - ptb[1] = tpbrkpts.pts[t_index]; - qlist->downloadAll( pta, ptb, backend ); - - Patchlist patchlist( qlist, pta, ptb ); -/* -printf("-------samplingSplit-----\n"); -source.show("samplingSplit source"); -*/ - samplingSplit( source, patchlist, renderhints.maxsubdivisions, 0 ); - setNonDegenerate(); - setArcTypeBezier(); - } - } - } -} - -/*-------------------------------------------------------------------------- - * samplingSplit - recursively subdivide patch, cull check each subpatch - *-------------------------------------------------------------------------- - */ - -void -Subdivider::samplingSplit( - Bin& source, - Patchlist& patchlist, - int subdivisions, - int param ) -{ - if( ! source.isnonempty() ) return; - - if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) { - freejarcs( source ); - return; - } - - patchlist.getstepsize(); - - if( renderhints.display_method == N_OUTLINE_PATCH ) { - tessellation( source, patchlist ); - outline( source ); - freejarcs( source ); - return; - } - - //patchlist.clamp(); - - tessellation( source, patchlist ); - - if( patchlist.needsSamplingSubdivision() && (subdivisions > 0) ) { - if( ! patchlist.needsSubdivision( 0 ) ) - param = 1; - else if( ! patchlist.needsSubdivision( 1 ) ) - param = 0; - else - param = 1 - param; - - Bin left, right; - REAL mid = ( patchlist.pspec[param].range[0] + - patchlist.pspec[param].range[1] ) * 0.5; - split( source, left, right, param, mid ); - Patchlist subpatchlist( patchlist, param, mid ); - samplingSplit( left, subpatchlist, subdivisions-1, param ); - samplingSplit( right, patchlist, subdivisions-1, param ); - } else { - setArcTypePwl(); - setDegenerate(); - nonSamplingSplit( source, patchlist, subdivisions, param ); - setDegenerate(); - setArcTypeBezier(); - } -} - -void -Subdivider::nonSamplingSplit( - Bin& source, - Patchlist& patchlist, - int subdivisions, - int param ) -{ - if( patchlist.needsNonSamplingSubdivision() && (subdivisions > 0) ) { - param = 1 - param; - - Bin left, right; - REAL mid = ( patchlist.pspec[param].range[0] + - patchlist.pspec[param].range[1] ) * 0.5; - split( source, left, right, param, mid ); - Patchlist subpatchlist( patchlist, param, mid ); - if( left.isnonempty() ) - if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) - freejarcs( left ); - else - nonSamplingSplit( left, subpatchlist, subdivisions-1, param ); - if( right.isnonempty() ) - if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) - freejarcs( right ); - else - nonSamplingSplit( right, patchlist, subdivisions-1, param ); - - } else { - // make bbox calls - patchlist.bbox(); - backend.patch( patchlist.pspec[0].range[0], patchlist.pspec[0].range[1], - patchlist.pspec[1].range[0], patchlist.pspec[1].range[1] ); - - if( renderhints.display_method == N_OUTLINE_SUBDIV ) { - outline( source ); - freejarcs( source ); - } else { - setArcTypePwl(); - setDegenerate(); - findIrregularS( source ); - monosplitInS( source, smbrkpts.start, smbrkpts.end ); - } - } -} - -/*-------------------------------------------------------------------------- - * tessellation - set tessellation of interior and boundary of patch - *-------------------------------------------------------------------------- - */ - -void -Subdivider::tessellation( Bin& bin, Patchlist &patchlist ) -{ - // tessellate unsampled trim curves - tessellate( bin, patchlist.pspec[1].sidestep[1], patchlist.pspec[0].sidestep[1], - patchlist.pspec[1].sidestep[0], patchlist.pspec[0].sidestep[0] ); - - // set interior sampling rates - slicer.setstriptessellation( patchlist.pspec[0].stepsize, patchlist.pspec[1].stepsize ); - - //added by zl: set the order which will be used in slicer.c++ - slicer.set_ulinear( (patchlist.get_uorder() == 2)); - slicer.set_vlinear( (patchlist.get_vorder() == 2)); - - // set boundary sampling rates - stepsizes[0] = patchlist.pspec[1].stepsize; - stepsizes[1] = patchlist.pspec[0].stepsize; - stepsizes[2] = patchlist.pspec[1].stepsize; - stepsizes[3] = patchlist.pspec[0].stepsize; -} - -/*--------------------------------------------------------------------------- - * monosplitInS - split a patch and a bin by an isoparametric line - *--------------------------------------------------------------------------- - */ - -void -Subdivider::monosplitInS( Bin& source, int start, int end ) -{ - if( source.isnonempty() ) { - if( start != end ) { - int i = start + (end - start) / 2; - Bin left, right; - split( source, left, right, 0, smbrkpts.pts[i] ); - monosplitInS( left, start, i ); - monosplitInS( right, i+1, end ); - } else { - if( renderhints.display_method == N_OUTLINE_SUBDIV_S ) { - outline( source ); - freejarcs( source ); - } else { - setArcTypePwl(); - setDegenerate(); - findIrregularT( source ); - monosplitInT( source, tmbrkpts.start, tmbrkpts.end ); - } - } - } -} - -/*--------------------------------------------------------------------------- - * monosplitInT - split a patch and a bin by an isoparametric line - *--------------------------------------------------------------------------- - */ - -void -Subdivider::monosplitInT( Bin& source, int start, int end ) -{ - if( source.isnonempty() ) { - if( start != end ) { - int i = start + (end - start) / 2; - Bin left, right; - split( source, left, right, 1, tmbrkpts.pts[i] ); - monosplitInT( left, start, i ); - monosplitInT( right, i+1, end ); - } else { - if( renderhints.display_method == N_OUTLINE_SUBDIV_ST ) { - outline( source ); - freejarcs( source ); - } else { -/* -printf("*******render\n"); -source.show("source\n"); -*/ - render( source ); - freejarcs( source ); - } - } - } -} - - -/*---------------------------------------------------------------------------- - * findIrregularS - determine points of non-monotonicity is s direction - *---------------------------------------------------------------------------- - */ - -void -Subdivider::findIrregularS( Bin& bin ) -{ - assert( bin.firstarc()->check() != 0 ); - - smbrkpts.grow( bin.numarcs() ); - - for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - REAL *a = jarc->prev->tail(); - REAL *b = jarc->tail(); - REAL *c = jarc->head(); - - if( b[1] == a[1] && b[1] == c[1] ) continue; - - //corrected code - if((b[1]<=a[1] && b[1] <= c[1]) || - (b[1]>=a[1] && b[1] >= c[1])) - { - //each arc (jarc, jarc->prev, jarc->next) is a - //monotone arc consisting of multiple line segements. - //it may happen that jarc->prev and jarc->next are the same, - //that is, jarc->prev and jarc form a closed loop. - //In such case, a and c will be the same. - if(a[0]==c[0] && a[1] == c[1]) - { - if(jarc->pwlArc->npts >2) - { - c = jarc->pwlArc->pts[jarc->pwlArc->npts-2].param; - } - else - { - assert(jarc->prev->pwlArc->npts>2); - a = jarc->prev->pwlArc->pts[jarc->prev->pwlArc->npts-2].param; - } - - } - if(area(a,b,c) < 0) - { - smbrkpts.add(b[0]); - } - - } - - /* old code, - if( b[1] <= a[1] && b[1] <= c[1] ) { - if( ! ccwTurn_tr( jarc->prev, jarc ) ) - smbrkpts.add( b[0] ); - } else if( b[1] >= a[1] && b[1] >= c[1] ) { - if( ! ccwTurn_tl( jarc->prev, jarc ) ) - smbrkpts.add( b[0] ); - } - */ - - } - - smbrkpts.filter(); -} - -/*---------------------------------------------------------------------------- - * findIrregularT - determine points of non-monotonicity in t direction - * where one arc is parallel to the s axis. - *---------------------------------------------------------------------------- - */ - -void -Subdivider::findIrregularT( Bin& bin ) -{ - assert( bin.firstarc()->check() != 0 ); - - tmbrkpts.grow( bin.numarcs() ); - - for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - REAL *a = jarc->prev->tail(); - REAL *b = jarc->tail(); - REAL *c = jarc->head(); - - if( b[0] == a[0] && b[0] == c[0] ) continue; - - if( b[0] <= a[0] && b[0] <= c[0] ) { - if( a[1] != b[1] && b[1] != c[1] ) continue; - if( ! ccwTurn_sr( jarc->prev, jarc ) ) - tmbrkpts.add( b[1] ); - } else if ( b[0] >= a[0] && b[0] >= c[0] ) { - if( a[1] != b[1] && b[1] != c[1] ) continue; - if( ! ccwTurn_sl( jarc->prev, jarc ) ) - tmbrkpts.add( b[1] ); - } - } - tmbrkpts.filter( ); -} - -/*----------------------------------------------------------------------------- - * makeBorderTrim - if no user input trimming data then create - * a trimming curve around the boundaries of the Quilt. The curve consists of - * four Jordan arcs, one for each side of the Quilt, connected, of course, - * head to tail. - *----------------------------------------------------------------------------- - */ - -void -Subdivider::makeBorderTrim( const REAL *from, const REAL *to ) -{ - REAL smin = from[0]; - REAL smax = to[0]; - REAL tmin = from[1]; - REAL tmax = to[1]; - - pjarc = 0; - - Arc_ptr jarc = new(arcpool) Arc( arc_bottom, 0 ); - arctessellator.bezier( jarc, smin, smax, tmin, tmin ); - initialbin.addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_right, 0 ); - arctessellator.bezier( jarc, smax, smax, tmin, tmax ); - initialbin.addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_top, 0 ); - arctessellator.bezier( jarc, smax, smin, tmax, tmax ); - initialbin.addarc( jarc ); - pjarc = jarc->append( pjarc ); - - jarc = new(arcpool) Arc( arc_left, 0 ); - arctessellator.bezier( jarc, smin, smin, tmax, tmin ); - initialbin.addarc( jarc ); - jarc->append( pjarc ); - - assert( jarc->check() != 0 ); -} - -/*---------------------------------------------------------------------------- - * render - renders all monotone regions in a bin and frees the bin - *---------------------------------------------------------------------------- - */ - -void -Subdivider::render( Bin& bin ) -{ - bin.markall(); - -#ifdef N_ISOLINE_S - slicer.setisolines( ( renderhints.display_method == N_ISOLINE_S ) ? 1 : 0 ); -#else - slicer.setisolines( 0 ); -#endif - - for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - if( jarc->ismarked() ) { - assert( jarc->check( ) != 0 ); - Arc_ptr jarchead = jarc; - do { - jarc->clearmark(); - jarc = jarc->next; - } while (jarc != jarchead); - slicer.slice( jarc ); - } - } -} - -/*--------------------------------------------------------------------------- - * outline - render the trimmed patch by outlining the boundary - *--------------------------------------------------------------------------- - */ - -void -Subdivider::outline( Bin& bin ) -{ - bin.markall(); - for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - if( jarc->ismarked() ) { - assert( jarc->check( ) != 0 ); - Arc_ptr jarchead = jarc; - do { - slicer.outline( jarc ); - jarc->clearmark(); - jarc = jarc->prev; - } while (jarc != jarchead); - } - } -} - -/*--------------------------------------------------------------------------- - * freejarcs - free all arcs in a bin - *--------------------------------------------------------------------------- - */ - -void -Subdivider::freejarcs( Bin& bin ) -{ - bin.adopt(); /* XXX - should not be necessary */ - - Arc_ptr jarc; - while( (jarc = bin.removearc()) != NULL ) { - if( jarc->pwlArc ) jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; - if( jarc->bezierArc) jarc->bezierArc->deleteMe( bezierarcpool ); jarc->bezierArc = 0; - jarc->deleteMe( arcpool ); - } -} - -/*---------------------------------------------------------------------------- - * tessellate - tessellate all Bezier arcs in a bin - * 1) only accepts linear Bezier arcs as input - * 2) the Bezier arcs are stored in the pwlArc structure - * 3) only vertical or horizontal lines work - * -- should - * 1) represent Bezier arcs in BezierArc structure - * (this requires a multitude of changes to the code) - * 2) accept high degree Bezier arcs (hard) - * 3) map the curve onto the surface to determine tessellation - * 4) work for curves of arbitrary geometry - *---------------------------------------------------------------------------- - */ - - -void -Subdivider::tessellate( Bin& bin, REAL rrate, REAL trate, REAL lrate, REAL brate ) -{ - for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { - if( jarc->isbezier( ) ) { - assert( jarc->pwlArc->npts == 2 ); - TrimVertex *pts = jarc->pwlArc->pts; - REAL s1 = pts[0].param[0]; - REAL t1 = pts[0].param[1]; - REAL s2 = pts[1].param[0]; - REAL t2 = pts[1].param[1]; - - jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; - - switch( jarc->getside() ) { - case arc_left: - assert( s1 == s2 ); - arctessellator.pwl_left( jarc, s1, t1, t2, lrate ); - break; - case arc_right: - assert( s1 == s2 ); - arctessellator.pwl_right( jarc, s1, t1, t2, rrate ); - break; - case arc_top: - assert( t1 == t2 ); - arctessellator.pwl_top( jarc, t1, s1, s2, trate ); - break; - case arc_bottom: - assert( t1 == t2 ); - arctessellator.pwl_bottom( jarc, t1, s1, s2, brate ); - break; - case arc_none: - (void) abort(); - break; - } - assert( ! jarc->isbezier() ); - assert( jarc->check() != 0 ); - } - } -} diff --git a/src/libs/mesa/glu/libnurbs/internals/subdivider.h b/src/libs/mesa/glu/libnurbs/internals/subdivider.h deleted file mode 100644 index 4d53951818..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/subdivider.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * subdivider.h - * - */ - -#ifndef __glusubdivider_h_ -#define __glusubdivider_h_ - -#include "mysetjmp.h" -#include "bin.h" -#include "flist.h" -#include "slicer.h" -#include "arctess.h" -#include "trimvertex.h" -#include "trimvertpool.h" - -class Arc; -class Pool; -class Renderhints; -class Quilt; -class Patchlist; -class Curvelist; -struct JumpBuffer; - -class Subdivider { -public: - Subdivider( Renderhints&, Backend& ); - ~Subdivider( void ); - void clear( void ); - - void beginTrims( void ) {} - void beginLoop( void ); - void addArc( REAL *, Quilt *, long ); - void addArc( int, TrimVertex *, long ); - void endLoop( void ) {} - void endTrims( void ) {} - - void beginQuilts( void ); - void addQuilt( Quilt * ); - void endQuilts( void ) {} - - void drawCurves( void ); - void drawSurfaces( long ); - - int ccwTurn_sl( Arc_ptr, Arc_ptr ); - int ccwTurn_sr( Arc_ptr , Arc_ptr ); - int ccwTurn_tl( Arc_ptr , Arc_ptr ); - int ccwTurn_tr( Arc_ptr , Arc_ptr ); - - void setJumpbuffer( JumpBuffer * ); - - void set_domain_distance_u_rate(REAL u_rate) - { - domain_distance_u_rate = u_rate; - } - void set_domain_distance_v_rate(REAL v_rate) - { - domain_distance_v_rate = v_rate; - } - void set_is_domain_distance_sampling(int flag) - { - is_domain_distance_sampling = flag; - } - -private: - void classify_headonleft_s( Bin &, Bin &, Bin &, REAL ); - void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL ); - void classify_headonright_s( Bin &, Bin &, Bin &, REAL ); - void classify_tailonright_s( Bin &, Bin &, Bin &, REAL ); - void classify_headonleft_t( Bin &, Bin &, Bin &, REAL ); - void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL ); - void classify_headonright_t( Bin &, Bin &, Bin &, REAL ); - void classify_tailonright_t( Bin &, Bin &, Bin &, REAL ); - - enum dir { down, same, up, none }; - void tessellate( Arc_ptr, REAL ); - void monotonize( Arc_ptr , Bin & ); - int isMonotone( Arc_ptr ); - int decompose( Bin &, REAL ); - - - Slicer slicer; - ArcTessellator arctessellator; - Pool arcpool; - Pool bezierarcpool; - Pool pwlarcpool; - TrimVertexPool trimvertexpool; - - JumpBuffer* jumpbuffer; - Renderhints& renderhints; - Backend& backend; - - Bin initialbin; - Arc_ptr pjarc; - int s_index; - int t_index; - Quilt * qlist; - Flist spbrkpts; - Flist tpbrkpts; - Flist smbrkpts; - Flist tmbrkpts; - REAL stepsizes[4]; - int showDegenerate; - int isArcTypeBezier; - - void samplingSplit( Curvelist&, int ); - - void subdivideInS( Bin& ); - void splitInS( Bin&, int, int ); - void splitInT( Bin&, int, int ); - void samplingSplit( Bin&, Patchlist&, int, int ); - void nonSamplingSplit( Bin&, Patchlist&, int, int ); - void tessellation( Bin&, Patchlist& ); - void monosplitInS( Bin&, int, int ); - void monosplitInT( Bin&, int, int ); - - void outline( Bin & ); - void freejarcs( Bin & ); - void render( Bin & ); - void split( Bin &, Bin &, Bin &, int, REAL ); - void tessellate( Bin &, REAL, REAL, REAL, REAL ); - - inline void setDegenerate( void ) { showDegenerate = 1; } - inline void setNonDegenerate( void ) { showDegenerate = 0; } - inline int showingDegenerate( void ) { return showDegenerate; } - inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; } - inline void setArcTypePwl( void ) { isArcTypeBezier = 0; } - inline int isBezierArcType( void ) { return isArcTypeBezier; } - - void makeBorderTrim( const REAL *, const REAL * ); - void split( Bin &, int, const REAL *, int, int ); - void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL ); - void findIrregularS( Bin & ); - void findIrregularT( Bin & ); - - - inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int ); - static int bbox( REAL, REAL, REAL, REAL, REAL, REAL ); - static int ccw( TrimVertex *, TrimVertex *, TrimVertex * ); - void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr ); - void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr ); - int arc_split( Arc_ptr , int, REAL, int ); - void check_s( Arc_ptr , Arc_ptr ); - void check_t( Arc_ptr , Arc_ptr ); - inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr ); - inline void simple_link( Arc_ptr , Arc_ptr ); - - Bin* makePatchBoundary( const REAL *from, const REAL *to ); - - /*in domain distance method, the tessellation is controled by two numbers: - *GLU_U_STEP: number of u-segments per unit u length of domain - *GLU_V_STEP: number of v-segments per unit v length of domain - *These two numbers are normally stored in mapdesc->maxs(t)rate. - *I (ZL) put these two numbers here so that I can optimize the untrimmed - *case in the case of domain distance sampling. - *These two numbers are set by set_domain_distance_u_rate() and ..._v_..(). - */ - REAL domain_distance_u_rate; - REAL domain_distance_v_rate; - int is_domain_distance_sampling; -}; - -inline void -Subdivider::beginLoop( void ) -{ - pjarc = 0; -} - - -#endif /* __glusubdivider_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/tobezier.cc b/src/libs/mesa/glu/libnurbs/internals/tobezier.cc deleted file mode 100644 index 531f26bc78..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/tobezier.cc +++ /dev/null @@ -1,687 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * tobezier.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "mystring.h" -#include "quilt.h" -#include "knotvector.h" - -/* local type definitions */ -struct Breakpt { /* breakpoints */ - Knot value; /* value */ - int multi; /* multiplicity */ - int def; /* deficit */ -}; - -struct Knotspec { /* knotvector format */ - long order; /* order of spline */ - Knot_ptr inkbegin; /* input knot sequence */ - Knot_ptr inkend; /* location after last knot */ - Knot_ptr outkbegin; /* in-process knot subsequence */ - Knot_ptr outkend; /* location after last knot */ - Knot_ptr kleft; /* */ - Knot_ptr kright; /* */ - Knot_ptr kfirst; /* */ - Knot_ptr klast; /* */ - Knot_ptr sbegin; /* conversion factor values */ - Breakpt * bbegin; /* in-process breakpoints */ - Breakpt * bend; /* last breakpoint */ - int ncoords; /* coordinates per control point */ - int prestride; /* stride between input points */ - int poststride; /* stride between output points */ - int preoffset; /* scaled point offset */ - int postoffset; /* scaled point offset */ - int prewidth; /* width of dimension */ - int postwidth; /* width of dimension */ - int istransformed; /* was dimension transformed */ - Knotspec * next; /* next knotspec */ - Knotspec * kspectotrans; /* knotspec in transformation direction */ - - Knotspec( void ); - ~Knotspec( void ); - void factors( void ); - void insert( REAL * ); - void preselect(); - void select( void ); - void copy( INREAL *, REAL * ); - void breakpoints( void ); - void knots( void ); - void transform( REAL * ); - void showpts( REAL * ); - - void pt_io_copy( REAL *, INREAL * ); - void pt_oo_copy( REAL *, REAL * ); - void pt_oo_sum( REAL*, REAL*, REAL*, Knot, Knot ); -}; - -struct Splinespec { /* a non-uniform tensor element */ - Splinespec( int ); - ~Splinespec(void); - Knotspec *kspec; /* format of each param. dir. */ - int dim; /* domain dimension */ - REAL * outcpts; /* Bezier control points */ - - void kspecinit( Knotvector & ); - void kspecinit( Knotvector &, Knotvector & ); - void select( void ); - void layout( long ); - void setupquilt( Quilt_ptr ); - void copy( INREAL * ); - void transform( void ); -}; - -/*----------------------------------------------------------------------------- - * Quilt::toBezier - convert from NURBS to rational Bezier - *----------------------------------------------------------------------------- - */ - -void -Quilt::toBezier( - Knotvector& knotvector, /* a knot vector */ - INREAL *ctlpts, /* input contol points */ - long ncoords ) /* number of coordinates per control point */ -{ - Splinespec spline( 1 ); - spline.kspecinit( knotvector ); - spline.select(); - spline.layout( ncoords ); - spline.setupquilt( this ); - spline.copy( ctlpts ); - spline.transform(); -} - -void -Quilt::toBezier( - Knotvector& sknotvector, /* a knot vector */ - Knotvector& tknotvector, /* a knot vector */ - INREAL *ctlpts, /* input contol points */ - long ncoords ) /* number of coordinates per control point */ -{ - Splinespec spline( 2 ); - spline.kspecinit( sknotvector, tknotvector ); - spline.select(); - spline.layout( ncoords ); - spline.setupquilt( this ); - spline.copy( ctlpts ); - spline.transform(); -} -Splinespec::Splinespec( int dimen ) -{ - dim = dimen; -} - -Splinespec::~Splinespec( void ) -{ - /* Note: do NOT delete 'outcpts' here since its address (not contents) - * is copied in 'cpts' in this file in function Splinespec::setupquilt(). - * This block of memory will eventually be deleted in file quilt.c++ in - * function Quilt::deleteMe() through 'cpts' so do NOT delete it here! - */ - Knotspec *ktrav= kspec; //start at beginning of list - while (ktrav != 0) { //any items to delete? - Knotspec *deleteThis= ktrav; //remember to delete this - ktrav= ktrav->next; //go to next item if any - delete deleteThis; //delete it - } -} /* ~Splinespec() */ - -/*----------------------------------------------------------------------------- - * Splinespec::kspecinit - initialize Splinespec structure - * - * Client: Quilt::toBezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::kspecinit( Knotvector& knotvector ) -{ - kspec = new Knotspec; - kspec->inkbegin = knotvector.knotlist; - kspec->inkend = knotvector.knotlist + knotvector.knotcount; - kspec->prestride = (int) knotvector.stride; - kspec->order = knotvector.order; - kspec->next = NULL; -} - -void -Splinespec::kspecinit( Knotvector& sknotvector, Knotvector& tknotvector ) -{ - kspec = new Knotspec; - Knotspec *tkspec = new Knotspec; - - kspec->inkbegin = sknotvector.knotlist; - kspec->inkend = sknotvector.knotlist + sknotvector.knotcount; - kspec->prestride = (int) sknotvector.stride; - kspec->order = sknotvector.order; - kspec->next = tkspec; - - tkspec->inkbegin = tknotvector.knotlist; - tkspec->inkend = tknotvector.knotlist + tknotvector.knotcount; - tkspec->prestride = (int) tknotvector.stride; - tkspec->order = tknotvector.order; - tkspec->next = NULL; -} - - -/*----------------------------------------------------------------------------- - * Splinespec::select - select the subsegments to copy - * - * Client: gl_quilt_to_bezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::select( ) -{ - for( Knotspec *knotspec = kspec; knotspec; knotspec = knotspec->next ) { - knotspec->preselect(); - knotspec->select(); - } -} - -/*----------------------------------------------------------------------------- - * Splinespec::layout - - * - * Client: gl_quilt_to_bezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::layout( long ncoords ) -{ - - long stride = ncoords; - for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next ) { - knotspec->poststride = (int) stride; - stride *= ((knotspec->bend-knotspec->bbegin)*knotspec->order + knotspec->postoffset); - knotspec->preoffset *= knotspec->prestride; - knotspec->prewidth *= knotspec->poststride; - knotspec->postwidth *= knotspec->poststride; - knotspec->postoffset *= knotspec->poststride; - knotspec->ncoords = (int) ncoords; - } - outcpts = new REAL[stride]; - assert( outcpts != 0 ); -} - -/*----------------------------------------------------------------------------- - * Splinespec::copy - copy the control points of current subobject - * - * Client: gl_quilt_to_bezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::copy( INREAL *incpts ) -{ - kspec->copy( incpts, outcpts ); -} - -/*----------------------------------------------------------------------------- - * Splinespec::setupquilt - assign all quilt variables from knotspec - * - * Client: gl_quilt_to_bezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::setupquilt( Quilt_ptr quilt ) -{ - Quiltspec_ptr qspec = quilt->qspec; - quilt->eqspec = qspec + dim; - for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next, qspec++ ) { - qspec->stride = knotspec->poststride; - qspec->width = knotspec->bend - knotspec->bbegin; - qspec->order = (int) knotspec->order; - qspec->offset = knotspec->postoffset; - qspec->index = 0; - qspec->bdry[0] = (knotspec->kleft == knotspec->kfirst) ? 1 : 0; - qspec->bdry[1] = (knotspec->kright == knotspec->klast) ? 1 : 0; - qspec->breakpoints = new Knot[qspec->width+1]; - Knot_ptr k = qspec->breakpoints; - for( Breakpt *bk = knotspec->bbegin; bk <= knotspec->bend; bk++ ) - *(k++) = bk->value; - } - quilt->cpts = outcpts; - quilt->next = 0; -} - -/*----------------------------------------------------------------------------- - * Splinespec::transform - convert a spline to Bezier format - * - * Client: gl_quilt_to_bezier - *----------------------------------------------------------------------------- - */ - -void -Splinespec::transform( void ) -{ - Knotspec *knotspec; - for( knotspec = kspec; knotspec; knotspec=knotspec->next ) - knotspec->istransformed = 0; - - for( knotspec = kspec; knotspec; knotspec=knotspec->next ) { - for( Knotspec *kspec2 = kspec; kspec2; kspec2=kspec2->next ) - kspec2->kspectotrans = knotspec; - kspec->transform( outcpts ); - knotspec->istransformed = 1; - } -} - - -/*----------------------------------------------------------------------------- - * Knotspec::Knotspec - constuct a knot spec - *----------------------------------------------------------------------------- - */ - -Knotspec::Knotspec( void ) -{ - bbegin = 0; - sbegin = 0; - outkbegin = 0; -} - -/*----------------------------------------------------------------------------- - * Knotspec::copy - copy the control points along minor direction - * - * Client: Splinespec::copy - *----------------------------------------------------------------------------- - */ - -void -Knotspec::copy( INREAL *inpt, REAL *outpt ) -{ - inpt = (INREAL *) (((char *) inpt) + preoffset); - - if( next ) { - for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) { - next->copy( inpt, outpt ); - inpt = (INREAL *) (((char *) inpt) + prestride); - } - } else { - for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) { - pt_io_copy( outpt, inpt ); - inpt = (INREAL *) (((char *) inpt) + prestride); - } - } -} - -/*----------------------------------------------------------------------------- - * Knotspec::showpts - print out points before transformation - * - * Client: Knotspec::select - *----------------------------------------------------------------------------- - */ -void -Knotspec::showpts( REAL *outpt ) -{ - if( next ) { - for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) - next->showpts( outpt ); - } else { - for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride ) - _glu_dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] ); - } -} - -/*----------------------------------------------------------------------------- - * Knotspec::factors - precompute scale factors - * - overwrites knot vector, actual new knot vector is NOT produced - * - * Client: Knotspec::select - *----------------------------------------------------------------------------- - */ - -void -Knotspec::factors( void ) -{ - Knot *mid = (outkend - 1) - order + bend->multi; - Knot_ptr fptr = sbegin; - - for( Breakpt *bpt = bend; bpt >= bbegin; bpt-- ) { - mid -= bpt->multi; // last knot less than knot to insert - int def = bpt->def - 1; // number of knots to insert - if( def <= 0 ) continue; - Knot kv = bpt->value; // knot to insert - - Knot *kf = (mid-def) + (order-1); - for( Knot *kl = kf + def; kl != kf; kl-- ) { - Knot *kh, *kt; - for( kt=kl, kh=mid; kt != kf; kh--, kt-- ) - *(fptr++) = (kv - *kh) / (*kt - *kh); - *kl = kv; - } - } -} - -/*----------------------------------------------------------------------------- - * Knotspec::insert - convert subobject in direction of kspec into Bezier - * - * Client: Knotspec::transform - *----------------------------------------------------------------------------- - */ - -void -Knotspec::insert( REAL *p ) -{ - Knot_ptr fptr = sbegin; - REAL *srcpt = p + prewidth - poststride; - REAL *dstpt = p + postwidth + postoffset - poststride; - Breakpt *bpt = bend; - - for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride ) { - REAL *p1 = srcpt; - for( REAL *p2 = srcpt-poststride; p2 != pend; p1 = p2, p2 -= poststride ) { - pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr ); - fptr++; - } - } - - for( --bpt; bpt >= bbegin; bpt-- ) { - - for( int multi = bpt->multi; multi > 0; multi-- ) { - pt_oo_copy( dstpt, srcpt ); - dstpt -= poststride; - srcpt -= poststride; - } - - for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride, dstpt-=poststride ) { - pt_oo_copy( dstpt, srcpt ); - REAL *p1 = srcpt; - - for( REAL *p2 = srcpt-poststride; p2 != pend; p1=p2, p2 -= poststride ) { - pt_oo_sum( p1, p1, p2, *fptr, 1.0-*fptr ); - fptr++; - } - } - } -} - -/*----------------------------------------------------------------------------- - * Knotspec::preselect - initialize kspec for processing - * - * Client: Splinespec::select - *----------------------------------------------------------------------------- - */ - -void -Knotspec::preselect( void ) -{ - Knot kval; - - /* position klast after last knot of "last" breakpoint */ - for( klast = inkend - order, kval = *klast; klast != inkend; klast++ ) - if( ! identical( *klast, kval ) ) break; - - /* position kfirst after last knot of "first" breakpoint */ - for( kfirst = inkbegin+order-1, kval= *kfirst; kfirst != inkend; kfirst++ ) - if( ! identical( *kfirst, kval ) ) break; - - /* compute multiplicity of first breakpoint */ - Knot_ptr k; - for( k = kfirst - 1; k >= inkbegin; k-- ) - if( ! identical( kval, *k ) ) break; - k++; - - /* allocate space for breakpoints - - use worst case estimate on number of breakpoints */ - - bbegin = new Breakpt[(klast - kfirst)+1]; - /* record multiplicity and value of first breakpoint */ - bbegin->multi = kfirst - k; - bbegin->value = kval; - bend = bbegin; - - kleft = kright = kfirst; -} - - -/*----------------------------------------------------------------------------- - * Knotspec::select - Knotspec::select segments and precompute scale factors - * - * Client: Splinespec::select - *----------------------------------------------------------------------------- - */ - -void -Knotspec::select( void ) -{ - breakpoints(); - knots(); - factors(); - - preoffset = kleft - (inkbegin + order); - postwidth = (int)((bend - bbegin) * order); - prewidth = (int)((outkend - outkbegin) - order); - postoffset = (bbegin->def > 1) ? (bbegin->def-1) : 0; -} - -/*----------------------------------------------------------------------------- - * Knotspec::breakpoints - compute breakpoints for knotspec - * - * Client: Knotspec::select - *----------------------------------------------------------------------------- - */ - -void -Knotspec::breakpoints( void ) -{ - Breakpt *ubpt = bbegin; - Breakpt *ubend = bend; - long nfactors = 0; - - ubpt->value = ubend->value; - ubpt->multi = ubend->multi; - - kleft = kright; - - for( ; kright != klast; kright++ ) { - if ( identical(*kright,ubpt->value) ) { - (ubpt->multi)++; - } else { - ubpt->def = (int) (order - ubpt->multi); - nfactors += (ubpt->def * (ubpt->def - 1)) / 2; - (++ubpt)->value = *kright; - ubpt->multi = 1; - } - } - ubpt->def = (int) (order - ubpt->multi); - nfactors += (ubpt->def * (ubpt->def - 1)) / 2; - - bend = ubpt; - - if( nfactors ) { - sbegin = new Knot[nfactors]; - } else { - sbegin = NULL; - } -} - - -/*----------------------------------------------------------------------------- - * Knotspec::knots - copy relevant subsequence of knots into temporary area - * - * Client: Knotspec::select - *----------------------------------------------------------------------------- - */ - -void -Knotspec::knots( void ) -{ - Knot_ptr inkpt = kleft - order; - Knot_ptr inkend = kright + bend->def; - - /* allocate space for knots and factors */ - outkbegin = new Knot[inkend-inkpt]; - Knot_ptr outkpt; - for( outkpt = outkbegin; inkpt != inkend; inkpt++, outkpt++ ) - *outkpt = *inkpt; - - outkend = outkpt; -} - - -/*----------------------------------------------------------------------------- - * Knotspec::transform - convert a spline along a given direction - * - * Client: Splienspec::transform - *----------------------------------------------------------------------------- - */ - -void -Knotspec::transform( REAL *p ) -{ - if( next ) { - if( this == kspectotrans ) { - next->transform( p ); - } else { - if( istransformed ) { - p += postoffset; - for( REAL *pend = p + postwidth; p != pend; p += poststride ) - next->transform( p ); - } else { - REAL *pend = p + prewidth; - for( ; p != pend; p += poststride ) - next->transform( p ); - } - } - } else { - if( this == kspectotrans ) { - insert( p ); - } else { - if( istransformed ) { - p += postoffset; - for( REAL *pend = p + postwidth; p != pend; p += poststride ) - kspectotrans->insert( p ); - } else { - REAL *pend = p + prewidth; - for( ; p != pend; p += poststride ) - kspectotrans->insert( p ); - } - } - } -} - -/*----------------------------------------------------------------------------- - * Knotspec::~Knotspec - free space alocated for knotspec - *----------------------------------------------------------------------------- - */ - -Knotspec::~Knotspec( void ) -{ - if( bbegin ) delete[] bbegin; - if( sbegin ) delete[] sbegin; - if( outkbegin ) delete[] outkbegin; -} - - -/*----------------------------------------------------------------------------- - * pt_io_copy - make internal copy of input cntrl pt. of x coords - *----------------------------------------------------------------------------- - */ - -void -Knotspec::pt_io_copy( REAL *topt, INREAL *frompt ) -{ - switch( ncoords ) { - case 4: - topt[3] = (REAL) frompt[3]; - case 3: - topt[2] = (REAL) frompt[2]; - case 2: - topt[1] = (REAL) frompt[1]; - case 1: - topt[0] = (REAL) frompt[0]; - break; - default: { - for( int i = 0; i < ncoords; i++ ) - *topt++ = (REAL) *frompt++; - } - } -} - -/*----------------------------------------------------------------------------- - * pt_oo_copy - make internal copy of internal cntrl pt. of x coords - *----------------------------------------------------------------------------- - */ - -void -Knotspec::pt_oo_copy( REAL *topt, REAL *frompt ) -{ - switch( ncoords ) { - case 4: - topt[3] = frompt[3]; - case 3: - topt[2] = frompt[2]; - case 2: - topt[1] = frompt[1]; - case 1: - topt[0] = frompt[0]; - break; - default: - memcpy( topt, frompt, ncoords * sizeof( REAL ) ); - } -} - -/*----------------------------------------------------------------------------- - * pt_oo_sum - compute affine combination of internal cntrl pts - *----------------------------------------------------------------------------- - */ - -void -Knotspec::pt_oo_sum( REAL *x, REAL *y, REAL *z, Knot a, Knot b ) -{ - switch( ncoords ) { - case 4: - x[3] = a * y[3] + b * z[3]; - case 3: - x[2] = a * y[2] + b * z[2]; - case 2: - x[1] = a * y[1] + b * z[1]; - case 1: - x[0] = a * y[0] + b * z[0]; - break; - default: { - for( int i = 0; i < ncoords; i++ ) - *x++ = a * *y++ + b * *z++; - } - } -} diff --git a/src/libs/mesa/glu/libnurbs/internals/trimline.cc b/src/libs/mesa/glu/libnurbs/internals/trimline.cc deleted file mode 100644 index 61f34cd38a..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimline.cc +++ /dev/null @@ -1,223 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * trimline.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "trimline.h" -#include "backend.h" - -Trimline::Trimline() -{ - size = 0; pts = 0; numverts = 0; - tinterp = &t; binterp = &b; -} - -Trimline::~Trimline() -{ - if( pts ) delete[] pts; -} - -void -Trimline::init( TrimVertex *v ) -{ - reset(); - grow(1); - append(v); -} - -inline void -Trimline::grow( long npts ) -{ - if( size < npts ) { - size = 2 * npts; - if( pts ) delete[] pts; - pts = new TrimVertex_p[size]; - } -} - -inline void -Trimline::append( TrimVertex *v ) -{ - assert( numverts != size ); - pts[numverts++] = v; -} - -void -Trimline::init( long npts, Arc_ptr jarc, long last ) -{ - jarcl.init( jarc, 0, last ); - grow( npts + 2 ); -} - -inline void -Trimline::swap() -{ - TrimVertex *tmp=tinterp; - tinterp=binterp; - binterp=tmp; -} - -void -Trimline::getNextPt() -{ - *binterp = *jarcl.getnextpt(); -} - -void -Trimline::getPrevPt() -{ - *binterp = *jarcl.getprevpt(); -} - -/*---------------------------------------------------------------------- - * getNextPts - make arrays of pointers to trim points on left and right - * hulls of trim strip. - *---------------------------------------------------------------------- - */ -void -Trimline::getNextPts( REAL vval, Backend& backend ) -{ - reset(); swap(); append( tinterp ); - assert( tinterp->param[1] >= vval ); - - register TrimVertex *p; - for( p=jarcl.getnextpt() ; p->param[1] >= vval; p=jarcl.getnextpt() ) { - append( p ); - } - - /* compute and copy pointer to final point on left hull */ - if( interpvert( last(), p, binterp, vval ) ) { - binterp->nuid = p->nuid; - backend.triangle( p, binterp, last() ); - append( binterp ); - } - jarcl.reverse(); - (void) jarcl.getprevpt(); /* reset jarcl to proper position */ - jarcl.reverse(); -} - -void -Trimline::getPrevPts( REAL vval, Backend& backend ) -{ - reset(); swap(); append( tinterp ); - assert( tinterp->param[1] >= vval ); - - register TrimVertex *q; - for( q=jarcl.getprevpt(); q->param[1] >= vval; q=jarcl.getprevpt() ) { - append( q ); - } - - /* compute and copy pointer to final point on right hull */ - if( interpvert( q, last(), binterp, vval ) ) { - binterp->nuid = q->nuid; - backend.triangle( last(), binterp, q ); - append( binterp ); - } - jarcl.reverse(); - (void) jarcl.getnextpt(); /* reset jarcl to proper position */ - jarcl.reverse(); -} - -void -Trimline::getNextPts( Arc_ptr botarc ) -{ - reset(); swap(); append( tinterp ); - -#ifndef NDEBUG - PwlArc *lastpwl = botarc->prev->pwlArc; - TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; -#endif - TrimVertex *lastpt2 = botarc->pwlArc->pts; - register TrimVertex *p = jarcl.getnextpt(); - for( append( p ); p != lastpt2; append( p ) ) { - assert( p != lastpt1 ); - p = jarcl.getnextpt(); - } -} - -void -Trimline::getPrevPts( Arc_ptr botarc ) -{ - reset(); swap(); append( tinterp ); - - PwlArc *lastpwl = botarc->prev->pwlArc; - TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; -#ifndef NDEBUG - TrimVertex *lastpt2 = botarc->pwlArc->pts; -#endif - - register TrimVertex *q = jarcl.getprevpt(); - for( append( q ); q != lastpt1; append( q ) ) { - assert( q != lastpt2 ); - q = jarcl.getprevpt(); - } -} - - -long -Trimline::interpvert( TrimVertex *a, TrimVertex *b, TrimVertex *c, REAL vval ) -{ - REAL denom = a->param[1] - b->param[1]; - - if(denom != 0) { - if( vval == a->param[1] ) { - c->param[0] = a->param[0]; - c->param[1] = a->param[1]; - c->nuid = a->nuid; - return 0; - } else if( vval == b->param[1] ) { - c->param[0] = b->param[0]; - c->param[1] = b->param[1]; - c->nuid = b->nuid; - return 0; - } else { - REAL r = (a->param[1] - vval)/denom; - c->param[0] = a->param[0] - r * (a->param[0] - b->param[0]); - c->param[1] = vval; - return 1; - } - } else { - c->param[0] = a->param[0]; - c->param[1] = a->param[1]; - c->nuid = a->nuid; - return 0; - } -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/trimline.h b/src/libs/mesa/glu/libnurbs/internals/trimline.h deleted file mode 100644 index ecc884284c..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimline.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * trimline.h - * - */ - -#ifndef __glutrimline_h_ -#define __glutrimline_h_ - -class Arc; -class Backend; - -#include "trimvertex.h" -#include "jarcloc.h" - - -class Trimline { -private: - TrimVertex** pts; - long numverts; - long i; - long size; - Jarcloc jarcl; - TrimVertex t, b; - TrimVertex *tinterp, *binterp; - void reset( void ) { numverts = 0; } - inline void grow( long ); - inline void swap( void ); - inline void append( TrimVertex * ); - static long interpvert( TrimVertex *, TrimVertex *, TrimVertex *, REAL ); - - - -public: - Trimline(); - ~Trimline(); - void init( TrimVertex * ); - void init( long, Arc_ptr, long ); - void getNextPt( void ); - void getPrevPt( void ); - void getNextPts( REAL, Backend & ); - void getPrevPts( REAL, Backend & ); - void getNextPts( Arc_ptr ); - void getPrevPts( Arc_ptr ); - inline TrimVertex * next( void ); - inline TrimVertex * prev( void ); - inline TrimVertex * first( void ); - inline TrimVertex * last( void ); -}; - -inline TrimVertex * -Trimline::next( void ) -{ - if( i < numverts) return pts[i++]; else return 0; -} - -inline TrimVertex * -Trimline::prev( void ) -{ - if( i >= 0 ) return pts[i--]; else return 0; -} - -inline TrimVertex * -Trimline::first( void ) -{ - i = 0; return pts[i]; -} - -inline TrimVertex * -Trimline::last( void ) -{ - i = numverts; return pts[--i]; -} -#endif /* __glutrimline_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/trimregion.cc b/src/libs/mesa/glu/libnurbs/internals/trimregion.cc deleted file mode 100644 index efe7893569..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimregion.cc +++ /dev/null @@ -1,114 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * trimregion.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "trimregion.h" -#include "backend.h" - -TrimRegion::TrimRegion( void ) -{ -} - -void -TrimRegion::setDu( REAL du ) -{ - oneOverDu = 1.0/du; -} - -void -TrimRegion::init( long npts, Arc_ptr extrema ) -{ - left.init( npts, extrema, extrema->pwlArc->npts - 1 ); - left.getNextPt(); - - right.init( npts, extrema, 0 ); - right.getPrevPt(); -} - -void -TrimRegion::getPts( Arc_ptr extrema ) -{ - left.getNextPts( extrema ); - right.getPrevPts( extrema ); -} - -void -TrimRegion::getPts( Backend &backend ) -{ - left.getNextPts( bot.vval, backend ); - right.getPrevPts( bot.vval, backend ); -} - -void -TrimRegion::getGridExtent( void ) -{ - getGridExtent( left.last(), right.last() ); -} - -void -TrimRegion::getGridExtent( TrimVertex *l, TrimVertex *r ) -{ - bot.ustart = (long) ((l->param[0] - uarray.uarray[0])*oneOverDu); - if( l->param[0] >= uarray.uarray[bot.ustart] ) bot.ustart++; -// if( l->param[0] > uarray.uarray[bot.ustart] ) bot.ustart++; - assert( l->param[0] <= uarray.uarray[bot.ustart] ); - assert( l->param[0] >= uarray.uarray[bot.ustart-1] ); - - bot.uend = (long) ((r->param[0] - uarray.uarray[0])*oneOverDu); - if( uarray.uarray[bot.uend] >= r->param[0] ) bot.uend--; -// if( uarray.uarray[bot.uend] > r->param[0] ) bot.uend--; - assert( r->param[0] >= uarray.uarray[bot.uend] ); - assert( r->param[0] <= uarray.uarray[bot.uend+1] ); -} - -int -TrimRegion::canTile( void ) -{ - TrimVertex *lf = left.first(); - TrimVertex *ll = left.last(); - TrimVertex *l = ( ll->param[0] > lf->param[0] ) ? ll : lf; - - TrimVertex *rf = right.first(); - TrimVertex *rl = right.last(); - TrimVertex *r = ( rl->param[0] < rf->param[0] ) ? rl : rf; - return (l->param[0] <= r->param[0]) ? 1 : 0; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/trimregion.h b/src/libs/mesa/glu/libnurbs/internals/trimregion.h deleted file mode 100644 index ee15d7b988..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimregion.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * trimregion.h - * - */ - -#ifndef __glutrimregion_h_ -#define __glutrimregion_h_ - -#include "trimline.h" -#include "gridline.h" -#include "uarray.h" - -class Arc; -class Backend; - -class TrimRegion { -public: - TrimRegion(); - Trimline left; - Trimline right; - Gridline top; - Gridline bot; - Uarray uarray; - - void init( REAL ); - void advance( REAL, REAL, REAL ); - void setDu( REAL ); - void init( long, Arc_ptr ); - void getPts( Arc_ptr ); - void getPts( Backend & ); - void getGridExtent( TrimVertex *, TrimVertex * ); - void getGridExtent( void ); - int canTile( void ); -private: - REAL oneOverDu; -}; - -inline void -TrimRegion::init( REAL vval ) -{ - bot.vval = vval; -} - -inline void -TrimRegion::advance( REAL topVindex, REAL botVindex, REAL botVval ) -{ - top.vindex = (long) topVindex; - bot.vindex = (long) botVindex; - top.vval = bot.vval; - bot.vval = botVval; - top.ustart = bot.ustart; - top.uend = bot.uend; -} -#endif /* __glutrimregion_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/trimvertex.h b/src/libs/mesa/glu/libnurbs/internals/trimvertex.h deleted file mode 100644 index 2780b764a5..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimvertex.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * trimvertex.h - * - */ - -#ifndef __glutrimvertex_h_ -#define __glutrimvertex_h_ - -#include "types.h" - -/*#define USE_OPTTT*/ - -class TrimVertex { /* a vertex on a trim curve */ -public: - REAL param[2]; /* parametric space coords */ -#ifdef USE_OPTTT - REAL cache_point[4]; //only when USE_OPTTT is on in slicer.c++ - REAL cache_normal[3]; -#endif - long nuid; -}; - -typedef class TrimVertex *TrimVertex_p; - -inline REAL -det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) -{ - return a->param[0] * (b->param[1]-c->param[1]) + - b->param[0] * (c->param[1]-a->param[1]) + - c->param[0] * (a->param[1]-b->param[1]); -} - -#endif /* __glutrimvertex_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/trimvertpool.cc b/src/libs/mesa/glu/libnurbs/internals/trimvertpool.cc deleted file mode 100644 index 3e5bd70380..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimvertpool.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * trimvertexpool.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "mystring.h" -#include "trimvertex.h" -#include "trimvertpool.h" -#include "bufpool.h" - -/*---------------------------------------------------------------------------- - * TrimVertexPool::TrimVertexPool - *---------------------------------------------------------------------------- - */ -TrimVertexPool::TrimVertexPool( void ) - : pool( sizeof(TrimVertex)*3, 32, "Threevertspool" ) -{ - // initialize array of pointers to vertex lists - nextvlistslot = 0; - vlistsize = INIT_VERTLISTSIZE; - vlist = new TrimVertex_p[vlistsize]; -} - -/*---------------------------------------------------------------------------- - * TrimVertexPool::~TrimVertexPool - *---------------------------------------------------------------------------- - */ -TrimVertexPool::~TrimVertexPool( void ) -{ - // free all arrays of TrimVertices vertices - while( nextvlistslot ) { - delete [] vlist[--nextvlistslot]; - } - - // reallocate space for array of pointers to vertex lists - if( vlist ) delete[] vlist; -} - -/*---------------------------------------------------------------------------- - * TrimVertexPool::clear - *---------------------------------------------------------------------------- - */ -void -TrimVertexPool::clear( void ) -{ - // reinitialize pool of 3 vertex arrays - pool.clear(); - - // free all arrays of TrimVertices vertices - while( nextvlistslot ) { - delete [] vlist[--nextvlistslot]; - vlist[nextvlistslot] = 0; - } - - // reallocate space for array of pointers to vertex lists - if( vlist ) delete[] vlist; - vlist = new TrimVertex_p[vlistsize]; -} - - -/*---------------------------------------------------------------------------- - * TrimVertexPool::get - allocate a vertex list - *---------------------------------------------------------------------------- - */ -TrimVertex * -TrimVertexPool::get( int n ) -{ - TrimVertex *v; - if( n == 3 ) { - v = (TrimVertex *) pool.new_buffer(); - } else { - if( nextvlistslot == vlistsize ) { - vlistsize *= 2; - TrimVertex_p *nvlist = new TrimVertex_p[vlistsize]; - memcpy( nvlist, vlist, nextvlistslot * sizeof(TrimVertex_p) ); - if( vlist ) delete[] vlist; - vlist = nvlist; - } - v = vlist[nextvlistslot++] = new TrimVertex[n]; - } - return v; -} diff --git a/src/libs/mesa/glu/libnurbs/internals/trimvertpool.h b/src/libs/mesa/glu/libnurbs/internals/trimvertpool.h deleted file mode 100644 index ebd3c04b1f..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/trimvertpool.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * trimvertexpool.h - * - */ - -#ifndef __glutrimvertpool_h_ -#define __glutrimvertpool_h_ - -#include "bufpool.h" - -class TrimVertex; - -#define INIT_VERTLISTSIZE 200 - -class TrimVertexPool { -public: - TrimVertexPool( void ); - ~TrimVertexPool( void ); - void clear( void ); - TrimVertex * get( int ); -private: - Pool pool; - TrimVertex ** vlist; - int nextvlistslot; - int vlistsize; -}; -#endif /* __glutrimvertpool_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/types.h b/src/libs/mesa/glu/libnurbs/internals/types.h deleted file mode 100644 index 8b59625cff..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/types.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * types.h - * - */ - -#ifndef __glutypes_h_ -#define __glutypes_h_ - -//typedef double INREAL; -#define INREAL float -typedef float REAL; -typedef void (*Pfvv)( void ); -typedef void (*Pfvf)( float * ); -typedef int (*cmpfunc)(const void *, const void *); -typedef REAL Knot, *Knot_ptr;/* knot values */ - -#endif /* __glutypes_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/uarray.cc b/src/libs/mesa/glu/libnurbs/internals/uarray.cc deleted file mode 100644 index f0e2364373..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/uarray.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * uarray.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "uarray.h" -#include "arc.h" - -Uarray::Uarray( void ) -{ - uarray = 0; - size = 0; -} - -Uarray::~Uarray( void ) -{ - if( uarray ) delete[] uarray; -} - -long -Uarray::init( REAL delta, Arc_ptr lo, Arc_ptr hi ) -{ - ulines = (long) ((hi->tail()[0] - lo->tail()[0])/delta) + 3; - if( size < ulines ) { - size = ulines * 2; - if( uarray ) delete[] uarray; - uarray = new REAL[size]; - assert( uarray != 0); - } - uarray[0] = lo->tail()[0] - delta/2.0; - for( long i = 1 ; i != ulines; i++ ) - uarray[i] = uarray[0] + i*delta; - return ulines; -} - diff --git a/src/libs/mesa/glu/libnurbs/internals/uarray.h b/src/libs/mesa/glu/libnurbs/internals/uarray.h deleted file mode 100644 index cc6fae1b75..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/uarray.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * uarray.h - * - */ - -#ifndef __gluuarray_h_ -#define __gluuarray_h_ - -#include "types.h" - -class Arc; -typedef class Arc *Arc_ptr; - -class Uarray { -private: - long size; - long ulines; -public: - Uarray(); - ~Uarray(); - long init( REAL, Arc_ptr, Arc_ptr ); - REAL * uarray; -}; - -#endif /* __gluuarray_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/internals/varray.cc b/src/libs/mesa/glu/libnurbs/internals/varray.cc deleted file mode 100644 index 31cc73a9d0..0000000000 --- a/src/libs/mesa/glu/libnurbs/internals/varray.cc +++ /dev/null @@ -1,144 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* - * varray.c++ - * - */ - -#include "glimports.h" -#include "myassert.h" -#include "mystdio.h" -#include "varray.h" -#include "arc.h" -#include "simplemath.h" // glu_abs() - -#define TINY 0.0001 -inline long sgn( REAL x ) -{ - return (x < -TINY) ? -1 : ((x > TINY) ? 1 : 0 ); -} - - -Varray::Varray( void ) -{ - varray = 0; - size = 0; -} - -Varray::~Varray( void ) -{ - if( varray ) delete[] varray; -} - -inline void -Varray::update( Arc_ptr arc, long dir[2], REAL val ) -{ - register long ds = sgn(arc->tail()[0] - arc->prev->tail()[0]); - register long dt = sgn(arc->tail()[1] - arc->prev->tail()[1]); - - if( dir[0] != ds || dir[1] != dt ) { - dir[0] = ds; - dir[1] = dt; - append( val ); - } -} - -void -Varray::grow( long guess ) -{ - if( size < guess ) { - size = guess * 2; - if( varray ) delete[] varray; - varray = new REAL[size]; - assert( varray != 0 ); - } -} - -long -Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc ) -{ - Arc_ptr left = toparc->next; - Arc_ptr right = toparc; - long ldir[2], rdir[2]; - - ldir[0] = sgn( left->tail()[0] - left->prev->tail()[0] ); - ldir[1] = sgn( left->tail()[1] - left->prev->tail()[1] ); - rdir[0] = sgn( right->tail()[0] - right->prev->tail()[0] ); - rdir[1] = sgn( right->tail()[1] - right->prev->tail()[1] ); - - vval[0] = toparc->tail()[1]; - numquads = 0; - - while( 1 ) { - switch( sgn( left->tail()[1] - right->prev->tail()[1] ) ) { - case 1: - left = left->next; - update( left, ldir, left->prev->tail()[1] ); - break; - case -1: - right = right->prev; - update( right, rdir, right->tail()[1] ); - break; - case 0: - if( glu_abs(left->tail()[1] - botarc->tail()[1]) < TINY) goto end; - if( glu_abs(left->tail()[0]-right->prev->tail()[0]) < TINY && - glu_abs(left->tail()[1]-right->prev->tail()[1]) < TINY) goto end; - left = left->next; - break; - } - } - -end: - append( botarc->tail()[1] ); - - grow( ((long) ((vval[0] - vval[numquads])/delta)) + numquads + 2 ); - - long i, index = 0; - for( i=0; i delta ) { - long steps = ((long) (dist/delta)) +1; - float deltav = - dist / (REAL) steps; - for( long j=1; j -#include -#include -#include "glimports.h" -#include "zlassert.h" - -#include "quicksort.h" -#include "directedLine.h" -#include "polyDBG.h" - -#ifdef __WATCOMC__ -#pragma warning 726 10 -#endif - -//we must return the newLine -directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end) -{ - if(begin->head()[0] == end->tail()[0] && - begin->head()[1] == end->tail()[1] - ) - { - directedLine *ret = begin->prev; - begin->prev->next = end->next; - end->next->prev = begin->prev; - delete begin->sline; - delete end->sline; - delete begin; - delete end; - - return ret; - } - - directedLine* newLine; - sampledLine* sline = new sampledLine(begin->head(), end->tail()); - newLine = new directedLine(INCREASING, sline); - directedLine *p = begin->prev; - directedLine *n = end->next; - p->next = newLine; - n->prev = newLine; - newLine->prev = p; - newLine->next = n; - - delete begin->sline; - delete end->sline; - delete begin; - delete end; - return newLine; -} - - -void directedLine::deleteSingleLine(directedLine* dline) -{ - //make sure that dline->prev->tail is the same as - //dline->next->head. This is for numerical erros. - //for example, if we delete a line which is almost degeneate - //within (epsilon), then we want to make that the polygon after deletion - //is still a valid polygon - - dline->next->head()[0] = dline->prev->tail()[0]; - dline->next->head()[1] = dline->prev->tail()[1]; - - dline->prev->next = dline->next; - dline->next->prev = dline->prev; - - delete dline; - -} - -static Int myequal(Real a[2], Real b[2]) -{ - /* - if(a[0]==b[0] && a[1] == b[1]) - return 1; - else - return 0; - */ - - - if(fabs(a[0]-b[0]) < 0.00001 && - fabs(a[1]-b[1]) < 0.00001) - return 1; - else - return 0; - -} - -directedLine* directedLine::deleteDegenerateLines() -{ - //if there is only one edge or two edges, don't do anything - if(this->next == this) - return this; - if(this->next == this->prev) - return this; - - //find a nondegenerate line - directedLine* temp; - directedLine* first = NULL; - if(! myequal(head(), tail())) - /* - if(head()[0] != tail()[0] || - head()[1] != tail()[1]) - */ - first = this; - else - { - for(temp = this->next; temp != this; temp = temp->next) - { - /* - if(temp->head()[0] != temp->tail()[0] || - temp->head()[1] != temp->tail()[1]) - */ - if(! myequal(temp->head(), temp->tail())) - { - first = temp; - break; - } - - } - } - - //if there are no non-degenerate lines, then we simply return NULL. - if(first == NULL) - { - deleteSinglePolygonWithSline(); - return NULL; - } - - directedLine* tempNext = NULL; - for(temp =first->next; temp != first; temp = tempNext) - { - tempNext = temp->getNext(); -/* - if(temp->head()[0] == temp->tail()[0] && - temp->head()[1] == temp->tail()[1]) -*/ - - if(myequal(temp->head(), temp->tail())) - deleteSingleLine(temp); - } - return first; -} - -directedLine* directedLine::deleteDegenerateLinesAllPolygons() -{ - directedLine* temp; - directedLine *tempNext = NULL; - directedLine* ret= NULL; - directedLine* retEnd = NULL; - for(temp=this; temp != NULL; temp = tempNext) - { - tempNext = temp->nextPolygon; - temp->nextPolygon = NULL; - if(ret == NULL) - { - ret = retEnd = temp->deleteDegenerateLines(); - - } - else - { - directedLine *newPolygon = temp->deleteDegenerateLines(); - if(newPolygon != NULL) - { - retEnd->nextPolygon = temp->deleteDegenerateLines(); - retEnd = retEnd->nextPolygon; - } - } - } - return ret; -} - -directedLine* directedLine::cutIntersectionAllPoly(int &cutOccur) -{ - directedLine* temp; - directedLine *tempNext = NULL; - directedLine* ret= NULL; - directedLine* retEnd = NULL; - cutOccur = 0; - for(temp=this; temp != NULL; temp = tempNext) - { - int eachCutOccur=0; - tempNext = temp->nextPolygon; - temp->nextPolygon = NULL; - if(ret == NULL) - { - - ret = retEnd = DBG_cutIntersectionPoly(temp, eachCutOccur); - if(eachCutOccur) - cutOccur = 1; - } - else - { - - retEnd->nextPolygon = DBG_cutIntersectionPoly(temp, eachCutOccur); - retEnd = retEnd->nextPolygon; - if(eachCutOccur) - cutOccur = 1; - } - } - return ret; -} - - -void directedLine::deleteSinglePolygonWithSline() -{ - directedLine *temp, *tempNext; - prev->next = NULL; - for(temp=this; temp != NULL; temp = tempNext) - { - tempNext = temp->next; - delete temp->sline; - delete temp; - } -} - -void directedLine::deletePolygonListWithSline() -{ - directedLine *temp, *tempNext; - for(temp=this; temp != NULL; temp=tempNext) - { - tempNext = temp->nextPolygon; - temp->deleteSinglePolygonWithSline(); - } -} - -void directedLine::deleteSinglePolygon() -{ - directedLine *temp, *tempNext; - prev->next = NULL; - for(temp=this; temp != NULL; temp = tempNext) - { - tempNext = temp->next; - delete temp; - } -} - -void directedLine::deletePolygonList() -{ - directedLine *temp, *tempNext; - for(temp=this; temp != NULL; temp=tempNext) - { - tempNext = temp->nextPolygon; - temp->deleteSinglePolygon(); - } -} - - -/*a loop by itself*/ -directedLine::directedLine(short dir, sampledLine* sl) -{ - direction = dir; - sline = sl; - next = this; - prev = this; - nextPolygon = NULL; -// prevPolygon = NULL; - rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ - - rootLink = NULL; - -} - -void directedLine::init(short dir, sampledLine* sl) -{ - direction = dir; - sline = sl; -} - -directedLine::directedLine() -{ - next = this; - prev = this; - nextPolygon = NULL; - rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ - rootLink = NULL; -} - -directedLine::~directedLine() -{ -} - -Real* directedLine::head() -{ - - return (direction==INCREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1]; -} - -/*inline*/ Real* directedLine::getVertex(Int i) -{ - return (direction==INCREASING)? (sline->get_points())[i] : (sline->get_points())[sline->get_npoints() - 1 -i]; -} - -Real* directedLine::tail() -{ - return (direction==DECREASING)? (sline->get_points())[0] : (sline->get_points())[sline->get_npoints()-1]; -} - - /*insert a new line between prev and this*/ -void directedLine::insert(directedLine* nl) -{ - nl->next = this; - nl->prev = prev; - prev->next = nl; - prev = nl; - nl->rootLink = this; /*assuming that 'this' is the root!!!*/ -} - -Int directedLine::numEdges() -{ - Int ret=0; - directedLine* temp; - if(next == this) return 1; - - ret = 1; - for(temp = next; temp != this; temp = temp->next) - ret++; - return ret; -} - -Int directedLine::numEdgesAllPolygons() -{ - Int ret=0; - directedLine* temp; - for(temp=this; temp!= NULL; temp=temp->nextPolygon) - { - ret += temp->numEdges(); - } - return ret; -} - -/*return 1 if the double linked list forms a polygon. - */ -short directedLine::isPolygon() -{ - directedLine* temp; - - /*a polygon contains at least 3 edges*/ - if(numEdges() <=2) return 0; - - /*check this edge*/ - if(! isConnected()) return 0; - - /*check all other edges*/ - for(temp=next; temp != this; temp = temp->next){ - if(!isConnected()) return 0; - } - return 1; -} - -/*check if the head of this edge is connected to - *the tail of the prev - */ -short directedLine::isConnected() -{ - if( (head()[0] == prev->tail()[0]) && (head()[1] == prev->tail()[1])) - return 1; - else - return 0; -} - -Int compV2InY(Real A[2], Real B[2]) -{ - if(A[1] < B[1]) return -1; - if(A[1] == B[1] && A[0] < B[0]) return -1; - if(A[1] == B[1] && A[0] == B[0]) return 0; - return 1; -} - -Int compV2InX(Real A[2], Real B[2]) -{ - if(A[0] < B[0]) return -1; - if(A[0] == B[0] && A[1] < B[1]) return -1; - if(A[0] == B[0] && A[1] == B[1]) return 0; - return 1; -} - -/*compare two vertices NOT lines! - *A vertex is the head of a directed line. - *(x_1, y_1) <= (x_2, y_2) if - *either y_1 < y_2 - *or y_1 == y_2 && x_1 < x_2. - *return -1 if this->head() <= nl->head(), - *return 1 otherwise - */ -Int directedLine::compInY(directedLine* nl) -{ - if(head()[1] < nl->head()[1]) return -1; - if(head()[1] == nl->head()[1] && head()[0] < nl->head()[0]) return -1; - return 1; -} - -/*compare two vertices NOT lines! - *A vertex is the head of a directed line. - *(x_1, y_1) <= (x_2, y_2) if - *either x_1 < x_2 - *or x_1 == x_2 && y_1 < y_2. - *return -1 if this->head() <= nl->head(), - *return 1 otherwise - */ -Int directedLine::compInX(directedLine* nl) -{ - if(head()[0] < nl->head()[0]) return -1; - if(head()[0] == nl->head()[0] && head()[1] < nl->head()[1]) return -1; - return 1; -} - -/*used by sort precedures - */ -static Int compInY2(directedLine* v1, directedLine* v2) -{ - return v1->compInY(v2); -} -#ifdef NOT_USED -static Int compInX(directedLine* v1, directedLine* v2) -{ - return v1->compInX(v2); -} -#endif - -/*sort all the vertices NOT the lines! - *a vertex is the head of a directed line - */ -directedLine** directedLine::sortAllPolygons() -{ - Int total_num_edges = 0; - directedLine** array = toArrayAllPolygons(total_num_edges); - quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void *, void *)) compInY2); - - return array; -} - -void directedLine::printSingle() -{ - if(direction == INCREASING) - printf("direction is INCREASING\n"); - else - printf("direction is DECREASING\n"); - printf("head=%f,%f)\n", head()[0], head()[1]); - sline->print(); -} - -/*print one polygon*/ -void directedLine::printList() -{ - directedLine* temp; - printSingle(); - for(temp = next; temp!=this; temp=temp->next) - temp->printSingle(); -} - -/*print all the polygons*/ -void directedLine::printAllPolygons() -{ - directedLine *temp; - for(temp = this; temp!=NULL; temp = temp->nextPolygon) - { - printf("polygon:\n"); - temp->printList(); - } -} - -/*insert this polygon into the head of the old polygon List*/ -directedLine* directedLine::insertPolygon(directedLine* oldList) -{ - /*this polygon is a root*/ - setRootBit(); - if(oldList == NULL) return this; - nextPolygon = oldList; -/* oldList->prevPolygon = this;*/ - return this; -} - -/*cutoff means delete. but we don't deallocate any space, - *so we use cutoff instead of delete - */ -directedLine* directedLine::cutoffPolygon(directedLine *p) -{ - directedLine* temp; - directedLine* prev_polygon = NULL; - if(p == NULL) return this; - - for(temp=this; temp != p; temp = temp->nextPolygon) - { - if(temp == NULL) - { - fprintf(stderr, "in cutoffPolygon, not found\n"); - exit(1); - } - prev_polygon = temp; - } - -/* prev_polygon = p->prevPolygon;*/ - - p->resetRootBit(); - if(prev_polygon == NULL) /*this is the one to cutoff*/ - return nextPolygon; - else { - prev_polygon->nextPolygon = p->nextPolygon; - return this; - } -} - -Int directedLine::numPolygons() -{ - if(nextPolygon == NULL) return 1; - else return 1+nextPolygon->numPolygons(); -} - - -/*let array[index ...] denote - *all the edges in this polygon - *return the next available index of array. - */ -Int directedLine::toArraySinglePolygon(directedLine** array, Int index) -{ - directedLine *temp; - array[index++] = this; - for(temp = next; temp != this; temp = temp->next) - { - array[index++] = temp; - } - return index; -} - -/*the space is allocated. The caller is responsible for - *deallocate the space. - *total_num_edges is set to be the total number of edges of all polygons - */ -directedLine** directedLine::toArrayAllPolygons(Int& total_num_edges) -{ - total_num_edges=numEdgesAllPolygons(); - directedLine** ret = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges); - assert(ret); - - directedLine *temp; - Int index = 0; - for(temp=this; temp != NULL; temp=temp->nextPolygon) { - index = temp->toArraySinglePolygon(ret, index); - } - return ret; -} - -/*assume the polygon is a simple polygon, return - *the area enclosed by it. - *if thee order is counterclock wise, the area is positive. - */ -Real directedLine::polyArea() -{ - directedLine* temp; - Real ret=0.0; - Real x1,y1,x2,y2; - x1 = this->head()[0]; - y1 = this->head()[1]; - x2 = this->next->head()[0]; - y2 = this->next->head()[1]; - ret = -(x2*y1-x1*y2); - for(temp=this->next; temp!=this; temp = temp->next) - { - x1 = temp->head()[0]; - y1 = temp->head()[1]; - x2 = temp->next->head()[0]; - y2 = temp->next->head()[1]; - ret += -( x2*y1-x1*y2); - } - return Real(0.5)*ret; -} - -/*******************split or combine polygons begin********************/ -/*conect a diagonal of a single simple polygon or two simple polygons. - *If the two vertices v1 (head) and v2 (head) are in the same simple polygon, - *then we actually split the simple polygon into two polygons. - *If instead two vertices velong to two difference polygons, - *then we combine the two polygons into one polygon. - *It is upto the caller to decide whether this is a split or a - *combination. - * - *Case Split: - *split a single simple polygon into two simple polygons by - *connecting a diagonal (two vertices). - *v1, v2: the two vertices are the head() of the two directedLines. - * this routine generates one new sampledLine which is returned in - *generatedLine, - *and it generates two directedLines returned in ret_p1 and ret_p2. - *ret_p1 and ret_p2 are used as the entry to the two new polygons. - *Notice the caller should not deallocate the space of v2 and v2 after - *calling this function, since all of the edges are connected to - *ret_p1 or ret_p2. - * - *combine: - *combine two simpolygons into one by connecting one diagonal. - *the returned polygon is returned in ret_p1. - */ -/*ARGSUSED*/ -void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, - directedLine** ret_p1, - directedLine** ret_p2, - sampledLine** generatedLine, - directedLine* polygonList ) -{ - sampledLine *nsline = new sampledLine(2); - - - - nsline->setPoint(0, v1->head()); - nsline->setPoint(1, v2->head()); - - - - /*the increasing line is from v1 head to v2 head*/ - directedLine* newLineInc = new directedLine(INCREASING, nsline); - - - - directedLine* newLineDec = new directedLine(DECREASING, nsline); - - - directedLine* v1Prev = v1->prev; - directedLine* v2Prev = v2->prev; - - v1 ->prev = newLineDec; - v2Prev ->next = newLineDec; - newLineDec->next = v1; - newLineDec->prev = v2Prev; - - v2 ->prev = newLineInc; - v1Prev ->next = newLineInc; - newLineInc->next = v2; - newLineInc->prev = v1Prev; - - *ret_p1 = newLineDec; - *ret_p2 = newLineInc; - *generatedLine = nsline; -} - -//see the function connectDiangle -/*ARGSUSED*/ -void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2, - directedLine** ret_p1, - directedLine** ret_p2, - directedLine* polygonList ) -{ - sampledLine *nsline = new sampledLine(2); - sampledLine *nsline2 = new sampledLine(2); - - nsline->setPoint(0, v1->head()); - nsline->setPoint(1, v2->head()); - nsline2->setPoint(0, v1->head()); - nsline2->setPoint(1, v2->head()); - - /*the increasing line is from v1 head to v2 head*/ - directedLine* newLineInc = new directedLine(INCREASING, nsline); - - directedLine* newLineDec = new directedLine(DECREASING, nsline2); - - directedLine* v1Prev = v1->prev; - directedLine* v2Prev = v2->prev; - - v1 ->prev = newLineDec; - v2Prev ->next = newLineDec; - newLineDec->next = v1; - newLineDec->prev = v2Prev; - - v2 ->prev = newLineInc; - v1Prev ->next = newLineInc; - newLineInc->next = v2; - newLineInc->prev = v1Prev; - - *ret_p1 = newLineDec; - *ret_p2 = newLineInc; - -} - -Int directedLine::samePolygon(directedLine* v1, directedLine* v2) -{ - if(v1 == v2) return 1; - directedLine *temp; - for(temp = v1->next; temp != v1; temp = temp->next) - { - if(temp == v2) return 1; - } - return 0; -} - -directedLine* directedLine::findRoot() -{ - if(rootBit) return this; - directedLine* temp; - for(temp = next; temp != this; temp = temp->next) - if(temp -> rootBit ) return temp; - return NULL; /*should not happen*/ -} - -directedLine* directedLine::rootLinkFindRoot() -{ - directedLine* tempRoot; - directedLine* tempLink; - tempRoot = this; - tempLink = rootLink; - while(tempLink != NULL){ - tempRoot = tempLink; - tempLink = tempRoot->rootLink; - } - return tempRoot; -} - -/*******************split or combine polygons end********************/ - -/*****************IO stuff begin*******************/ - -/*format: - *#polygons - * #vertices - * vertices - * #vertices - * vertices - *... - */ -void directedLine::writeAllPolygons(char* filename) -{ - FILE* fp = fopen(filename, "w"); - assert(fp); - Int nPolygons = numPolygons(); - directedLine *root; - fprintf(fp, "%i\n", nPolygons); - for(root = this; root != NULL; root = root->nextPolygon) - { - directedLine *temp; - Int npoints=0; - npoints = root->get_npoints()-1; - for(temp = root->next; temp != root; temp=temp->next) - npoints += temp->get_npoints()-1; - fprintf(fp, "%i\n", npoints/*root->numEdges()*/); - - - for(Int i=0; iget_npoints()-1; i++){ - fprintf(fp, "%f ", root->getVertex(i)[0]); - fprintf(fp, "%f ", root->getVertex(i)[1]); - } - - for(temp=root->next; temp != root; temp = temp->next) - { - for(Int i=0; iget_npoints()-1; i++){ - - fprintf(fp, "%f ", temp->getVertex(i)[0]); - fprintf(fp, "%f ", temp->getVertex(i)[1]); - } - fprintf(fp,"\n"); - } - fprintf(fp, "\n"); - } - fclose(fp); -} - -directedLine* readAllPolygons(char* filename) -{ - Int i,j; - FILE* fp = fopen(filename, "r"); - assert(fp); - Int nPolygons; - fscanf(fp, "%i", &nPolygons); - directedLine *ret = NULL; - - for(i=0; irootLinkSet(NULL); - - directedLine *dLine; - for(j=2; jrootLinkSet(thisPoly); - thisPoly->insert(dLine); - } - - VV[0][0]=vert[1][0]; - VV[0][1]=vert[1][1]; - sLine = new sampledLine(2,VV); - dLine = new directedLine(INCREASING, sLine); -dLine->rootLinkSet(thisPoly); - thisPoly->insert(dLine); - - ret = thisPoly->insertPolygon(ret); - } - fclose(fp); - return ret; -} - - - - - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/directedLine.h b/src/libs/mesa/glu/libnurbs/nurbtess/directedLine.h deleted file mode 100644 index 4ed0128ca6..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/directedLine.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _DIRECTEDLINE_H -#define _DIRECTEDLINE_H - -#include "definitions.h" -#include "sampledLine.h" - -enum {INCREASING, DECREASING}; - -class directedLine { - short direction; /*INCREASING or DECREASING*/ - sampledLine* sline; - directedLine* next; /*double linked list*/ - directedLine* prev; /*double linked list*/ - - /*in case we need a list of polygons each - *consisting of a double linked list - */ - directedLine* nextPolygon; - - /*optimization make cutoff polygon faster*/ -/* directedLine* prevPolygon;*/ - - Int rootBit; /*1 if this is a root of the polygon, set by setRootBit*/ - /*and reset by resetRootBit()*/ - - directedLine* rootLink; /*fast root-finding*/ - - - -public: - directedLine(short dir, sampledLine* sl); - directedLine(); - ~directedLine(); - - void init(short dir, sampledLine* sl); - - Real* head(); /*points[0] if INCREASING, points[n-1] otherwise*/ - Real* tail(); /*points[n-1] if INCREASING, points[0] otherwise*/ - Real* getVertex(Int i); /*points[i] if INCREASING, points[n-1-i] otherwise*/ - Int get_npoints() {return sline->get_npoints();} - directedLine* getPrev() {return prev;} - directedLine* getNext() {return next;} - directedLine* getNextPolygon() {return nextPolygon;} - sampledLine* getSampledLine() {return sline;} - - short getDirection(){return direction;} - void putDirection(short dir) {direction = dir;} - void putPrev(directedLine *p) {prev = p;} - void putNext(directedLine *p) {next = p;} - - /*insert a new line between prev and this*/ - void insert(directedLine* nl); - - /*delete all the polygons following the link: nextPolygon. - *notice that sampledLine is not deleted. The caller is - *responsible for that - */ - void deletePolygonList(); - void deleteSinglePolygon(); - - void deleteSinglePolygonWithSline(); //also delete sanmpled line - void deletePolygonListWithSline(); //also delete sanmpled line - - void deleteSingleLine(directedLine* dline); - directedLine* deleteDegenerateLines(); - directedLine* deleteDegenerateLinesAllPolygons(); - directedLine* cutIntersectionAllPoly(int& cutOccur); - - /*check to see if the list forms a closed polygon - *return 1 if yes - */ - short isPolygon(); - - Int compInY(directedLine* nl); - Int compInX(directedLine* nl); - - /*return an array of pointers. - *the - */ - directedLine** sortAllPolygons(); - - Int numEdges(); - Int numEdgesAllPolygons(); - Int numPolygons(); - - /*check if the head of this edge is connected to - *the tail of the prev - */ - short isConnected(); - - Real polyArea(); - - void printSingle(); - void printList(); - void printAllPolygons(); - void writeAllPolygons(char* filename); - - - /*insert a polygon: using nextPolygon*/ - directedLine* insertPolygon(directedLine* newpolygon); - directedLine* cutoffPolygon(directedLine *p); - - Int toArraySinglePolygon(directedLine** array, Int index); - directedLine** toArrayAllPolygons(Int& total_num_edges); - - void connectDiagonal(directedLine* v1, directedLine* v2, - directedLine** ret_p1, - directedLine** ret_p2, - sampledLine** generatedLine, directedLine* list); - - /*generate two slines - */ - void connectDiagonal_2slines(directedLine* v1, directedLine* v2, - directedLine** ret_p1, - directedLine** ret_p2, - directedLine* list); - - Int samePolygon(directedLine* v1, directedLine* v2); - void setRootBit() {rootBit = 1;} - void resetRootBit() {rootBit = 0;} - directedLine* findRoot(); - - void rootLinkSet(directedLine* r) {rootLink = r;} - directedLine* rootLinkFindRoot(); - - //the chain from begin to end is deleted (the space is deallocated) - //and a new edge(which connectes the head of begin and the tail of end) - // is inserted. The new polygon is returned. - //notice that "this" is arbitrary - directedLine* deleteChain(directedLine* begin, directedLine* end); -}; - -directedLine* readAllPolygons(char* filename); - -extern Int compV2InY(Real A[2], Real B[2]); -extern Int compV2InX(Real A[2], Real B[2]); - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/glimports.h b/src/libs/mesa/glu/libnurbs/nurbtess/glimports.h deleted file mode 100644 index 6e69feb405..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/glimports.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * glimports.h - * - */ - -#ifndef __gluimports_h_ -#define __gluimports_h_ - -#include "mystdlib.h" -#include "mystdio.h" - -#endif /* __gluimports_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.cc b/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.cc deleted file mode 100644 index 3c92039bae..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.cc +++ /dev/null @@ -1,293 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include "zlassert.h" -#include "gridWrap.h" - - -/*******************grid structure****************************/ -void gridWrap::print() -{ - printf("n_ulines = %i\n", n_ulines); - printf("n_vlines = %i\n", n_vlines); - printf("u_min=%f, umax=%f, vmin=%f, vmax=%f\n", u_min, u_max, v_min, v_max); -} - -gridWrap::gridWrap(Int nUlines, Real* uvals, - Int nVlines, Real* vvals) -{ - assert(nUlines>=2); - assert(nVlines>=2); - - is_uniform = 0; - n_ulines = nUlines; - n_vlines = nVlines; - u_min = uvals[0]; - u_max = uvals[nUlines-1]; - v_min = vvals[0]; - v_max = vvals[nVlines-1]; - u_values = (Real*) malloc(sizeof(Real) * n_ulines); - assert(u_values); - v_values = (Real*) malloc(sizeof(Real) * n_vlines); - assert(v_values); - - Int i; - for(i=0; i=2); - assert(nVlines>=2); - Real du = (uMax-uMin)/(nUlines-1); - Real dv = (vMax-vMin)/(nVlines-1); - - float tempu=uMin; - u_values[0] = tempu; - for(i=1; i= uright) - return; //no triangles to output. - - pStream->begin(); - pStream->insert(vert); - - assert(vert[1] != v_values[v]); //don't output degenerate triangles - - if(vert[1] > v_values[v]) //vertex is above this grid line: notice the orientation - { - for(i=uleft; i<=uright; i++) - pStream->insert(u_values[i], v_values[v]); - } - else //vertex is below the grid line - { - for(i=uright; i>= uleft; i--) - pStream->insert(u_values[i], v_values[v]); - } - - pStream->end(PRIMITIVE_STREAM_FAN); -} - - - -/*each chain stores a number of consecutive - *V-lines within a grid. - *There is one grid vertex on each V-line. - * The total number of V-lines is: - * nVlines. - * with respect to the grid, the index of the first V-line is - * firstVlineIndex. - * So with respect to the grid, the index of the ith V-line is - * firstVlineIndex-i. - * the grid-index of the uline at the ith vline (recall that each vline has one grid point) - * is ulineIndices[i]. The u_value is cached in ulineValues[i], that is, - * ulineValues[i] = grid->get_u_value(ulineIndices[i]) - */ -gridBoundaryChain::gridBoundaryChain( - gridWrap* gr, - Int first_vline_index, - Int n_vlines, - Int* uline_indices, - Int* inner_indices - ) -: grid(gr), firstVlineIndex(first_vline_index), nVlines(n_vlines) -{ - ulineIndices = (Int*) malloc(sizeof(Int) * n_vlines); - assert(ulineIndices); - - innerIndices = (Int*) malloc(sizeof(Int) * n_vlines); - assert(innerIndices); - - vertices = (Real2*) malloc(sizeof(Real2) * n_vlines); - assert(vertices); - - - - Int i; - for(i=0; iget_u_value(ulineIndices[i]); - vertices[i][1] = gr->get_v_value(first_vline_index-i); - } -} - -void gridBoundaryChain::draw() -{ - Int i; - glBegin(GL_LINE_STRIP); - for(i=0; iget_u_value(innerIndices[i]), get_v_value(i-1) ); - glVertex2f(grid->get_u_value(innerIndices[i]), get_v_value(i) ); - glEnd(); - } -} - -Int gridBoundaryChain::lookfor(Real v, Int i1, Int i2) -{ - Int mid; - while(i1 < i2-1) - { - mid = (i1+i2)/2; - if(v > vertices[mid][1]) - { - i2 = mid; - } - else - i1 = mid; - } - return i1; -} - -/*output the fan of the right end between grid line i-1 and grid line i*/ -void gridBoundaryChain::rightEndFan(Int i, primStream* pStream) -{ - Int j; - if(getUlineIndex(i) > getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(get_vertex(i-1)); - for(j=getUlineIndex(i-1); j<= getUlineIndex(i); j++) - pStream->insert(grid->get_u_value(j), get_v_value(i)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - else if(getUlineIndex(i) < getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(get_vertex(i)); - for(j=getUlineIndex(i-1); j>= getUlineIndex(i); j--) - pStream->insert(grid->get_u_value(j), get_v_value(i-1)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - //otherside, the two are equal, so there is no fan to output -} - - -/*output the fan of the left end between grid line i-1 and grid line i*/ -void gridBoundaryChain::leftEndFan(Int i, primStream* pStream) -{ - Int j; - if(getUlineIndex(i) < getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(get_vertex(i-1)); - for(j=getUlineIndex(i); j<= getUlineIndex(i-1); j++) - pStream->insert(grid->get_u_value(j), get_v_value(i)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - else if(getUlineIndex(i) > getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(get_vertex(i)); - for(j=getUlineIndex(i); j>= getUlineIndex(i-1); j--) - pStream->insert(grid->get_u_value(j), get_v_value(i-1)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - /*otherwisem, the two are equal, so there is no fan to outout*/ -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.h b/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.h deleted file mode 100644 index b6428484f0..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/gridWrap.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _GRIDWRAP_H -#define _GRIDWRAP_H - -#include -#include "definitions.h" - -#include "primitiveStream.h" -#include "zlassert.h" - -class gridWrap{ - Int n_ulines; - Int n_vlines; - Real u_min, u_max; - Real v_min, v_max; - - /*cache the coordinate values for efficiency. - *these are redundant information when - *the grid is uniform. - */ - Real* u_values; /*size is n_ulines*/ - Real* v_values; /*size is n_vlines*/ - - Int is_uniform; - -public: - //uniform grid constructor - gridWrap(Int nUlines, Int nVlines, - Real uMin, Real uMax, - Real vMin, Real vMax - ); - - //nonuniform grid constructor. - gridWrap(Int nUlines, Real *uvals, - Int nVlines, Real *vvlas - ); - ~gridWrap(); - - void print(); - Int get_n_ulines() {return n_ulines;} - Int get_n_vlines() {return n_vlines;} - Real get_u_min() {return u_min;} - Real get_u_max() {return u_max;} - Real get_v_min() {return v_min;} - Real get_v_max() {return v_max;} - - Real get_u_value(Int i) - { - assert(i=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ - return u_values[i];} - Real get_v_value(Int j) {return v_values[j];} - - Real* get_u_values() {return u_values;} - Real* get_v_values() {return v_values;} - - void outputFanWithPoint(Int v, Int uleft, Int uright, - Real vert[2], primStream* pStream); - - void draw(); - - Int isUniform() {return is_uniform;} -}; - -class gridBoundaryChain{ - gridWrap* grid; - Int firstVlineIndex; - Int nVlines; - Int* ulineIndices; /*each v line has a boundary*/ - Int* innerIndices; /*the segment of the vertical gridline from */ - /*(innerIndices[i], i) to (innerIndices[i+1], i-1) */ - /*is inside the polygon: i=1,...,nVlines-1*/ - - Real2* vertices; /*one grid point at each grid V-line, cached for efficiency*/ - -public: - gridBoundaryChain(gridWrap* gr, Int first_vline_index, Int n_vlines, Int* uline_indices, Int* inner_indices); - - ~gridBoundaryChain() - { - free(innerIndices); - free(ulineIndices); - free(vertices); - } - - /*i indexes the vlines in this chain. - */ - Int getVlineIndex(Int i) {return firstVlineIndex-i;} - Int getUlineIndex(Int i) {return ulineIndices[i];} - Real get_u_value(Int i) {return vertices[i][0];} - Real get_v_value(Int i) {return vertices[i][1];} - Int get_nVlines() {return nVlines;} - Int getInnerIndex(Int i) {return innerIndices[i];} - Real getInner_u_value(Int i) {return grid->get_u_value(innerIndices[i]);} - - Real* get_vertex(Int i) {return vertices[i];} - gridWrap* getGrid() {return grid;} - void leftEndFan(Int i, primStream* pStream); - void rightEndFan(Int i, primStream* pStream); - - Int lookfor(Real v, Int i1, Int i2); //find i in [i1,i2] so that vertices[i][1]>= v > vertices[i+1][1] - void draw(); - void drawInner(); -}; - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.cc b/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.cc deleted file mode 100644 index 814bf32fae..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.cc +++ /dev/null @@ -1,934 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include - -#include "glimports.h" -#include "zlassert.h" - -#include "monoChain.h" -#include "quicksort.h" -#include "searchTree.h" -#include "polyUtil.h" - -#ifndef max -#define max(a,b) ((a>b)? a:b) -#endif -#ifndef min -#define min(a,b) ((a>b)? b:a) -#endif - -extern Int isCusp(directedLine *v); -extern Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices); - -//for debug purpose only -#if 0 // UNUSED -static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices) -{ - Int i; - for(i=0; ihead()); - glVertex2fv(diagonal_vertices[2*i+1]->head()); - glEnd(); - } -} -#endif - -/*given (x_1, y_1) and (x_2, y_2), and y - *return x such that (x,y) is on the line - */ -inline Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y) -{ - return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1)); -} - -//compare the heads of the two chains -static int compChainHeadInY(monoChain* mc1, monoChain* mc2) -{ - return compV2InY(mc1->getHead()->head(), mc2->getHead()->head()); -} - -monoChain::monoChain(directedLine* cHead, directedLine* cTail) -{ - chainHead = cHead; - chainTail = cTail; - next = this; - prev = this; - - nextPolygon = NULL; - - //compute bounding box - directedLine* temp; - minX = maxX = chainTail->head()[0]; - minY = maxY = chainTail->head()[1]; - - for(temp=chainHead; temp!=cTail; temp = temp->getNext()) - { - if(temp->head()[0] < minX) - minX = temp->head()[0]; - if(temp->head()[0] > maxX) - maxX = temp->head()[0]; - - if(temp->head()[1] < minY) - minY = temp->head()[1]; - if(temp->head()[1] > maxY) - maxY = temp->head()[1]; - } - - //check whether the chain is increasing or decreasing - if(chainHead->compInY(chainTail) <0) - isIncrease = 1; - else - isIncrease = 0; - - //initilize currrent, this is used for accelerating search - if(isIncrease) - current = chainHead; - else - current = chainTail; - - isKey = 0; -} - -//insert a new line between prev and this -void monoChain::insert(monoChain* nc) -{ - nc->next = this; - nc->prev = prev; - prev->next = nc; - prev = nc; -} - -void monoChain::deleteLoop() -{ - monoChain *temp, *tempNext; - prev->next = NULL; - for(temp=this; temp != NULL; temp = tempNext) - { - tempNext = temp->next; - delete temp; - } -} - -void monoChain::deleteLoopList() -{ - monoChain *temp, *tempNext; - for(temp=this; temp != NULL; temp = tempNext) - { - tempNext = temp->nextPolygon; - temp->deleteLoop(); - } -} - -Int monoChain::toArraySingleLoop(monoChain** array, Int index) -{ - monoChain *temp; - array[index++] = this; - for(temp = next; temp != this; temp = temp->next) - { - array[index++] = temp; - } - return index; -} - -monoChain** monoChain::toArrayAllLoops(Int& num_chains) -{ - num_chains = numChainsAllLoops(); - monoChain **ret = (monoChain**) malloc(sizeof(monoChain*) * num_chains); - assert(ret); - monoChain *temp; - Int index = 0; - for(temp = this; temp != NULL; temp=temp->nextPolygon){ - index = temp->toArraySingleLoop(ret, index); - } - return ret; -} - -Int monoChain::numChainsSingleLoop() -{ - Int ret=0; - monoChain* temp; - if(next == this) return 1; - ret = 1; - for(temp=next; temp != this; temp = temp->next) - ret++; - return ret; -} - -Int monoChain::numChainsAllLoops() -{ - Int ret=0; - monoChain *temp; - for(temp =this; temp != NULL; temp = temp->nextPolygon) - ret += temp->numChainsSingleLoop(); - return ret; -} - -//update 'current' -Real monoChain::chainIntersectHoriz(Real y) -{ - directedLine* temp; - if(isIncrease) - { - for(temp= current; temp != chainTail; temp = temp->getNext()) - { - if(temp->head()[1] > y) - break; - } - current = temp->getPrev(); - } - else - { - for(temp = current; temp != chainHead; temp = temp->getPrev()) - { - if(temp->head()[1] > y) - break; - } - current = temp->getNext(); - } - return intersectHoriz(current->head()[0], current->head()[1], current->tail()[0], current->tail()[1], y); -} - -monoChain* directedLineLoopToMonoChainLoop(directedLine* loop) -{ - directedLine *temp; - monoChain *ret=NULL; - - //find the first cusp - directedLine *prevCusp=NULL; - directedLine *firstCusp; - - if(isCusp(loop)) - prevCusp = loop; - else - { - for(temp = loop->getNext(); temp != loop; temp = temp->getNext()) - if(isCusp(temp)) - break; - prevCusp = temp; - } - firstCusp = prevCusp; -//printf("first cusp is (%f,%f), (%f,%f), (%f,%f)\n", prevCusp->getPrev()->head()[0], prevCusp->getPrev()->head()[1], prevCusp->head()[0], prevCusp->head()[1], prevCusp->tail()[0], prevCusp->tail()[1]); - - for(temp = prevCusp->getNext(); temp != loop; temp = temp->getNext()) - { - if(isCusp(temp)) - { -//printf("the cusp is (%f,%f), (%f,%f), (%f,%f)\n", temp->getPrev()->head()[0], temp->getPrev()->head()[1], temp->head()[0], temp->head()[1], temp->tail()[0], temp->tail()[1]); - if(ret == NULL) - { - ret = new monoChain(prevCusp, temp); - } - else - ret->insert(new monoChain(prevCusp, temp)); - prevCusp = temp; - } - } - ret->insert(new monoChain(prevCusp, firstCusp)); - - return ret; -} - -monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list) -{ - directedLine* temp; - monoChain* mc; - monoChain* mcEnd; - mc = directedLineLoopToMonoChainLoop(list); - mcEnd = mc; - for(temp = list->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon()) - { - monoChain *newLoop = directedLineLoopToMonoChainLoop(temp); - mcEnd->setNextPolygon(newLoop); - mcEnd = newLoop; - } - return mc; -} - -/*compare two edges of a polygon. - *edge A < edge B if there is a horizontal line so that the intersection - *with A is to the left of the intersection with B. - *This function is used in sweepY for the dynamic search tree insertion to - *order the edges. - * Implementation: (x_1,y_1) and (x_2, y_2) - */ -static Int compEdges(directedLine *e1, directedLine *e2) -{ - Real* head1 = e1->head(); - Real* tail1 = e1->tail(); - Real* head2 = e2->head(); - Real* tail2 = e2->tail(); -/* - Real h10 = head1[0]; - Real h11 = head1[1]; - Real t10 = tail1[0]; - Real t11 = tail1[1]; - Real h20 = head2[0]; - Real h21 = head2[1]; - Real t20 = tail2[0]; - Real t21 = tail2[1]; -*/ - Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin; -/* - if(h11>t11) { - e1_Ymax= h11; - e1_Ymin= t11; - } - else{ - e1_Ymax = t11; - e1_Ymin = h11; - } - - if(h21>t21) { - e2_Ymax= h21; - e2_Ymin= t21; - } - else{ - e2_Ymax = t21; - e2_Ymin = h21; - } -*/ - - if(head1[1]>tail1[1]) { - e1_Ymax= head1[1]; - e1_Ymin= tail1[1]; - } - else{ - e1_Ymax = tail1[1]; - e1_Ymin = head1[1]; - } - - if(head2[1]>tail2[1]) { - e2_Ymax= head2[1]; - e2_Ymin= tail2[1]; - } - else{ - e2_Ymax = tail2[1]; - e2_Ymin = head2[1]; - } - - - /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ - /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ - /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ - /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/ - - Real Ymax = min(e1_Ymax, e2_Ymax); - Real Ymin = max(e1_Ymin, e2_Ymin); - - Real y = 0.5*(Ymax + Ymin); - -/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); - Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y); -*/ -/* - Real x1 = intersectHoriz(h10, h11, t10, t11, y); - Real x2 = intersectHoriz(h20, h21, t20, t21, y); -*/ - Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y); - Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y); - - if(x1<= x2) return -1; - else return 1; -} - -Int compChains(monoChain* mc1, monoChain* mc2) -{ - Real y; - assert(mc1->isKey || mc2->isKey); - if(mc1->isKey) - y = mc1->keyY; - else - y = mc2->keyY; - directedLine *d1 = mc1->find(y); - directedLine *d2 = mc2->find(y); - mc2->find(y); -// Real x1 = mc1->chainIntersectHoriz(y); -// Real x2 = mc2->chainIntersectHoriz(y); - return compEdges(d1, d2); -} - -//this function modifies current for efficiency -directedLine* monoChain::find(Real y) -{ - directedLine *ret; - directedLine *temp; - assert(current->head()[1] <= y); - if(isIncrease) - { - assert(chainTail->head()[1] >=y); - for(temp=current; temp!=chainTail; temp = temp->getNext()) - { - if(temp->head()[1] > y) - break; - } - current = temp->getPrev(); - ret = current; - } - else - { - for(temp=current; temp != chainHead; temp = temp->getPrev()) - { - if(temp->head()[1] > y) - break; - } - current = temp->getNext(); - ret = temp; - } - return ret; -} - -void monoChain::printOneChain() -{ - directedLine* temp; - for(temp = chainHead; temp != chainTail; temp = temp->getNext()) - { - printf("(%f,%f) ", temp->head()[0], temp->head()[1]); - } - printf("(%f,%f) \n", chainTail->head()[0], chainTail->head()[1]); -} - -void monoChain::printChainLoop() -{ - monoChain* temp; - this->printOneChain(); - for(temp = next; temp != this; temp = temp->next) - { - temp->printOneChain(); - } - printf("\n"); -} - -void monoChain::printAllLoops() -{ - monoChain* temp; - for(temp=this; temp != NULL; temp = temp->nextPolygon) - temp->printChainLoop(); -} - -//return 1 if error occures -Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges) -{ - Int i; - Real keyY; - Int errOccur=0; -//printf("enter MC_sweepY\n"); -//printf("nVertices=%i\n", nVertices); - /*for each vertex in the sorted list, update the binary search tree. - *and store the range information for each vertex. - */ - treeNode* searchTree = NULL; -//printf("nVertices=%i\n", nVertices); - for(i=0; igetHead()->head()[1]; //the sweep line - directedLine *dline = vert->getHead(); - directedLine *dlinePrev = dline->getPrev(); - if(isBelow(dline, dline) && isBelow(dline, dlinePrev)) - { -//printf("case 1\n"); - //thisisKey = 1; - vert->keyY = keyY; - treeNode* thisNode = TreeNodeFind(searchTree, vert, (Int (*) (void *, void *))compChains); - vert->isKey = 0; - - vert->getPrev()->isKey = 1; - vert->getPrev()->keyY = keyY; - treeNode* prevNode = TreeNodeFind(searchTree, vert->getPrev(), (Int (*) (void *, void *))compChains); - vert->getPrev()->isKey = 0; - - if(cuspType(dline) == 1)//interior cusp - { - - treeNode* leftEdge = TreeNodePredecessor(prevNode); - treeNode* rightEdge = TreeNodeSuccessor(thisNode); - if(leftEdge == NULL || rightEdge == NULL) - { - errOccur = 1; - goto JUMP_HERE; - } - - directedLine* leftEdgeDline = ((monoChain* ) leftEdge->key)->find(keyY); - - - - directedLine* rightEdgeDline = ((monoChain* ) rightEdge->key)->find(keyY); - - ret_ranges[i] = sweepRangeMake(leftEdgeDline, 1, rightEdgeDline, 1); - } - else /*exterior cusp*/ - { - ret_ranges[i] = sweepRangeMake( dline, 1, dlinePrev, 1); - } - - searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); - searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); - - } - else if(isAbove(dline, dline) && isAbove(dline, dlinePrev)) - { -//printf("case 2\n"); - //insert both edges - treeNode* thisNode = TreeNodeMake(vert); - treeNode* prevNode = TreeNodeMake(vert->getPrev()); - - vert->isKey = 1; - vert->keyY = keyY; - searchTree = TreeNodeInsert(searchTree, thisNode, (Int (*) (void *, void *))compChains); - vert->isKey = 0; - - vert->getPrev()->isKey = 1; - vert->getPrev()->keyY = keyY; - searchTree = TreeNodeInsert(searchTree, prevNode, (Int (*) (void *, void *))compChains); - vert->getPrev()->isKey = 0; - - if(cuspType(dline) == 1) //interior cusp - { -//printf("cuspType is 1\n"); - treeNode* leftEdge = TreeNodePredecessor(thisNode); - treeNode* rightEdge = TreeNodeSuccessor(prevNode); - if(leftEdge == NULL || rightEdge == NULL) - { - errOccur = 1; - goto JUMP_HERE; - } -//printf("leftEdge is %i, rightEdge is %i\n", leftEdge, rightEdge); - directedLine* leftEdgeDline = ((monoChain*) leftEdge->key)->find(keyY); - directedLine* rightEdgeDline = ((monoChain*) rightEdge->key)->find(keyY); - ret_ranges[i] = sweepRangeMake( leftEdgeDline, 1, rightEdgeDline, 1); - } - else //exterior cusp - { -//printf("cuspType is not 1\n"); - ret_ranges[i] = sweepRangeMake(dlinePrev, 1, dline, 1); - } - } - else - { -//printf("%i,%i\n", isAbove(dline, dline), isAbove(dline, dlinePrev)); - errOccur = 1; - goto JUMP_HERE; - - fprintf(stderr, "error in MC_sweepY\n"); - exit(1); - } - } - - JUMP_HERE: - //finally clean up space: delete the search tree - TreeNodeDeleteWholeTree(searchTree); - return errOccur; -} - -void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, - sweepRange** ranges, Int& num_diagonals, - directedLine** diagonal_vertices) -{ - Int i,j,k; - k=0; - //reset 'current' of all the monoChains - for(i=0; iresetCurrent(); - - for(i=0; igetHead(); - directedLine* thisEdge = vert; - directedLine* prevEdge = vert->getPrev(); - if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0) - { - //this is an upward interior cusp - diagonal_vertices[k++] = vert; - - directedLine* leftEdge = ranges[i]->left; - directedLine* rightEdge = ranges[i]->right; - - directedLine* leftVert = leftEdge; - directedLine* rightVert = rightEdge->getNext(); - assert(leftVert->head()[1] >= vert->head()[1]); - assert(rightVert->head()[1] >= vert->head()[1]); - directedLine* minVert = (leftVert->head()[1] <= rightVert->head()[1])?leftVert:rightVert; - Int found = 0; - for(j=i+1; jgetHead()->head()[1] > minVert->head()[1]) - break; - - if(sweepRangeEqual(ranges[i], ranges[j])) - { - found = 1; - break; - } - } - - if(found) - diagonal_vertices[k++] = sortedVertices[j]->getHead(); - else - diagonal_vertices[k++] = minVert; - } - else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge) && compEdges(prevEdge, thisEdge)>0) - { - //downward interior cusp - diagonal_vertices[k++] = vert; - directedLine* leftEdge = ranges[i]->left; - directedLine* rightEdge = ranges[i]->right; - directedLine* leftVert = leftEdge->getNext(); - directedLine* rightVert = rightEdge; - assert(leftVert->head()[1] <= vert->head()[1]); - assert(rightVert->head()[1] <= vert->head()[1]); - directedLine* maxVert = (leftVert->head()[1] > rightVert->head()[1])? leftVert:rightVert; - Int found=0; - for(j=i-1; j>=0; j--) - { - if(sortedVertices[j]->getHead()->head()[1] < maxVert->head()[1]) - break; - if(sweepRangeEqual(ranges[i], ranges[j])) - { - found = 1; - break; - } - } - if(found) - diagonal_vertices[k++] = sortedVertices[j]->getHead(); - else - diagonal_vertices[k++] = maxVert; - } - } - num_diagonals = k/2; -} - - - - -directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines) -{ -//printf("enter mc_partitionY\n"); - Int total_num_chains = 0; - monoChain* loopList = directedLineLoopListToMonoChainLoopList(polygons); - monoChain** array = loopList->toArrayAllLoops(total_num_chains); - - if(total_num_chains<=2) //there is just one single monotone polygon - { - loopList->deleteLoopList(); - free(array); - *retSampledLines = NULL; - return polygons; - } - -//loopList->printAllLoops(); -//printf("total_num_chains=%i\n", total_num_chains); - quicksort( (void**)array, 0, total_num_chains-1, (Int (*)(void*, void*))compChainHeadInY); -//printf("after quicksort\n"); - - sweepRange** ranges = (sweepRange**)malloc(sizeof(sweepRange*) * (total_num_chains)); - assert(ranges); - - if(MC_sweepY(total_num_chains, array, ranges)) - { - loopList->deleteLoopList(); - free(array); - *retSampledLines = NULL; - return NULL; - } -//printf("after MC_sweepY\n"); - - - Int num_diagonals; - /*number diagonals is < total_num_edges*total_num_edges*/ - directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_chains*2/*total_num_edges*/); - assert(diagonal_vertices); - -//printf("before call MC_findDiagonales\n"); - - MC_findDiagonals(total_num_chains, array, ranges, num_diagonals, diagonal_vertices); -//printf("after call MC_findDia, num_diagnla=%i\n", num_diagonals); - - directedLine* ret_polygons = polygons; - sampledLine* newSampledLines = NULL; - Int i,k; - - num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); - - - -//drawDiagonals(num_diagonals, diagonal_vertices); -//printf("diagoanls are \n"); -//for(i=0; ihead()[0], diagonal_vertices[2*i]->head()[1]); -// printf("**(%f,%f)\n", diagonal_vertices[2*i+1]->head()[0], diagonal_vertices[2*i+1]->head()[1]); -// } - - Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals); - for(i=0; ifindRoot(); - directedLine *root2 = v2->findRoot(); - assert(root1); - assert(root2); -*/ - -directedLine* root1 = v1->rootLinkFindRoot(); -directedLine* root2 = v2->rootLinkFindRoot(); - - if(root1 != root2) - { - - removedDiagonals[i] = 1; - sampledLine* generatedLine; - - - - v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); - - - - newSampledLines = generatedLine->insert(newSampledLines); -/* - ret_polygons = ret_polygons->cutoffPolygon(root1); - - ret_polygons = ret_polygons->cutoffPolygon(root2); - ret_polygons = ret_p1->insertPolygon(ret_polygons); -root1->rootLinkSet(ret_p1); -root2->rootLinkSet(ret_p1); -ret_p1->rootLinkSet(NULL); -ret_p2->rootLinkSet(ret_p1); -*/ - ret_polygons = ret_polygons->cutoffPolygon(root2); - - - -root2->rootLinkSet(root1); -ret_p1->rootLinkSet(root1); -ret_p2->rootLinkSet(root1); - - /*now that we have connected the diagonal v1 and v2, - *we have to check those unprocessed diagonals which - *have v1 or v2 as an end point. Notice that the head of v1 - *has the same coodinates as the head of v2->prev, and the head of - *v2 has the same coordinate as the head of v1->prev. - *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid - *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be - *replaced by (v2->prev, x), that is, x is on the left of - * v2->prev->prev->head, v2->prev->head, v2->prev->tail. - */ - Int ii, kk; - for(ii=0, kk=0; iiprev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), - v1->head(), v1->tail(), d2->head())) - { -/* - assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), - v2->getPrev()->tail(), d2->head())); -*/ - diagonal_vertices[kk] = v2->getPrev(); - } - } - if(d1 == v2) { - /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/ - if(! pointLeft2Lines(v2->getPrev()->head(), - v2->head(), v2->tail(), d2->head())) - { -/* - assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), - v1->getPrev()->head(), - v1->getPrev()->tail(), d2->head())); -*/ - diagonal_vertices[kk] = v1->getPrev(); - } - } - /*check d2 and replace diagonal_vertices[k+1] if necessary*/ - if(d2 == v1) { - /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), - v1->head(), v1->tail(), d1->head())) - { -/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), - v2->getPrev()->tail(), d1->head())); -*/ - diagonal_vertices[kk+1] = v2->getPrev(); - } - } - if(d2 == v2) { - /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/ - if(! pointLeft2Lines(v2->getPrev()->head(), - v2->head(), v2->tail(), d1->head())) - { -/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), - v1->getPrev()->head(), - v1->getPrev()->tail(), d1->head())); -*/ - diagonal_vertices[kk+1] = v1->getPrev(); - } - } - } -}/*end if (root1 not equal to root 2)*/ -} - - /*second pass, now all diagoals should belong to the same polygon*/ -//printf("second pass: \n"); - -// for(i=0; ifindRoot(); -/* - directedLine *root2 = v2->findRoot(); - - - - assert(root1); - assert(root2); - assert(root1 == root2); - */ - sampledLine* generatedLine; - - - - v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); - newSampledLines = generatedLine->insert(newSampledLines); - - ret_polygons = ret_polygons->cutoffPolygon(root1); - - ret_polygons = ret_p1->insertPolygon(ret_polygons); - - ret_polygons = ret_p2->insertPolygon(ret_polygons); - - - - for(Int j=i+1; jsamePolygon(temp1, temp2)) - { - /*if temp1 and temp2 are in different polygons, - *then one of them must be v1 or v2. - */ - - - - assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); - if(temp1==v1) - { - diagonal_vertices[2*j] = v2->getPrev(); - } - if(temp2==v1) - { - diagonal_vertices[2*j+1] = v2->getPrev(); - } - if(temp1==v2) - { - diagonal_vertices[2*j] = v1->getPrev(); - } - if(temp2==v2) - { - diagonal_vertices[2*j+1] = v1->getPrev(); - } - } - } - } - - } - - - //clean up - loopList->deleteLoopList(); - free(array); - free(ranges); - free(diagonal_vertices); - free(removedDiagonals); - - *retSampledLines = newSampledLines; - return ret_polygons; -} - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.h b/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.h deleted file mode 100644 index 999f163190..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/monoChain.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _MONO_CHAIN_H -#define _MONO_CHAIN_H - -#include "directedLine.h" -#include "partitionY.h" - -class monoChain; - -class monoChain{ - directedLine* chainHead; - directedLine* chainTail; - monoChain* next; - monoChain* prev; - monoChain* nextPolygon; //a list of polygons - - //cached informatin - //bounding box - Real minX, maxX, minY, maxY; - Int isIncrease; - - //for efficiently comparing two chains - - directedLine* current; - -public: - monoChain(directedLine* cHead, directedLine* cTail); - ~monoChain() {} - - inline void setNext(monoChain* n) {next = n;} - inline void setPrev(monoChain* p) {prev = p;} - inline void setNextPolygon(monoChain* np) {nextPolygon = np;} - inline monoChain* getNext() {return next;} - inline monoChain* getPrev() {return prev;} - inline directedLine* getHead() {return chainHead;} - inline directedLine* getTail() {return chainTail;} - - inline void resetCurrent() { current = ((isIncrease==1)? chainHead:chainTail);} - - void deleteLoop(); - void deleteLoopList(); - - //insert a new chain between prev and this - void insert(monoChain* nc); - - Int numChainsSingleLoop(); - Int numChainsAllLoops(); - monoChain** toArrayAllLoops(Int& num_chains); - Int toArraySingleLoop(monoChain** array, Int index); - - Int isKey; - Real keyY; //the current horizotal line - Real chainIntersectHoriz(Real y); //updates current incrementally for efficiency - directedLine* find(Real y);//find dline so that y intersects dline. - - void printOneChain(); - void printChainLoop(); - void printAllLoops(); - -}; - -monoChain* directedLineLoopToMonoChainLoop(directedLine* loop); -monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list); -Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges); - -void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, - sweepRange** ranges, Int& num_diagonals, - directedLine** diagonal_vertices); - -directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.cc b/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.cc deleted file mode 100644 index 8391205bf7..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.cc +++ /dev/null @@ -1,299 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* - *monoPolyPart.C - * - *To partition a v-monotone polygon into some uv-monotone polygons. - *The algorithm is different from the general monotone partition algorithm. - *while the general monotone partition algorithm works for this special case, - *but it is more expensive (O(nlogn)). The algorithm implemented here takes - *advantage of the fact that the input is a v-monotone polygon and it is - *conceptually simpler and computationally cheaper (a linear time algorithm). - *The algorithm is described in Zicheng Liu's paper - * "Quality-Oriented Linear Time Tessellation". - */ - -#include -#include -#include "directedLine.h" -#include "monoPolyPart.h" - -/*a vertex is u_maximal if both of its two neightbors are to the left of this - *vertex - */ -static Int is_u_maximal(directedLine* v) -{ - if (compV2InX(v->getPrev()->head(), v->head()) == -1 && - compV2InX(v->getNext()->head(), v->head()) == -1) - return 1; - else - return 0; -} - -/*a vertex is u_minimal if both of its two neightbors are to the right of this - *vertex - */ -static Int is_u_minimal(directedLine* v) -{ - if (compV2InX(v->getPrev()->head(), v->head()) == 1 && - compV2InX(v->getNext()->head(), v->head()) == 1) - return 1; - else - return 0; -} - -/*poly: a v-monotone polygon - *return: a linked list of uv-monotone polygons. - */ -directedLine* monoPolyPart(directedLine* polygon) -{ - //handle special cases: - if(polygon == NULL) - return NULL; - if(polygon->getPrev() == polygon) - return polygon; - if(polygon->getPrev() == polygon->getNext()) - return polygon; - if(polygon->getPrev()->getPrev() == polygon->getNext()) - return polygon; - - //find the top and bottom vertexes - directedLine *tempV, *topV, *botV; - topV = botV = polygon; - for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) - { - if(compV2InY(topV->head(), tempV->head())<0) { - topV = tempV; - } - if(compV2InY(botV->head(), tempV->head())>0) { - botV = tempV; - } - } - - //initilization - directedLine *A, *B, *C, *D, *G, *H; - //find A:the first u_maximal vertex on the left chain - //and C: the left most vertex between top and A - A = NULL; - C = topV; - for(tempV=topV->getNext(); tempV != botV; tempV = tempV->getNext()) - { - if(tempV->head()[0] < C->head()[0]) - C = tempV; - - if(is_u_maximal(tempV)) - { - A = tempV; - break; - } - } - if(A == NULL) - { - A = botV; - if(A->head()[0] < C->head()[0]) - C = A; - } - - //find B: the first u_minimal vertex on the right chain - //and D: the right most vertex between top and B - B = NULL; - D = topV; - for(tempV=topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - if(tempV->head()[0] > D->head()[0]) - D = tempV; - if(is_u_minimal(tempV)) - { - B = tempV; - break; - } - } - if(B == NULL) - { - B = botV; - if(B->head()[0] > D->head()[0]) - D = B; - } - - //error checking XXX - if(C->head()[0] >= D->head()[0]) - return polygon; - - //find G on the left chain that is right above B - for(tempV=topV; compV2InY(tempV->head(), B->head()) == 1; tempV=tempV->getNext()); - G = tempV->getPrev(); - //find H on the right chain that is right above A - for(tempV=topV; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev()); - H = tempV->getNext(); - - //Main Loop - directedLine* ret = NULL; - directedLine* currentPolygon = polygon; - while(1) - { - //if both B and D are equal to botV, then this polygon is already - //u-monotone - if(A == botV && B == botV) - { - ret = currentPolygon->insertPolygon(ret); - return ret; - } - else //not u-monotone - { - directedLine *ret_p1, *ret_p2; - if(compV2InY(A->head(),B->head()) == 1) //A is above B - { - directedLine* E = NULL; - for(tempV = C; tempV != D; tempV = tempV->getPrev()) - { - if(tempV->head()[0] >= A->head()[0]) - { - E = tempV; - break; - } - } - - if(E == NULL) - E = D; - if(E->head()[0]> H->head()[0]) - E = H; - //connect AE and output polygon ECA - polygon->connectDiagonal_2slines(A, E, - &ret_p1, - &ret_p2, - NULL); - ret = ret_p2->insertPolygon(ret); - currentPolygon = ret_p1; - - if(E == D) - D = ret_p1; - if(E == H) - H = ret_p1; - if(G->head()[1] >= A->head()[1]) - G = A; - //update A to be the next u-maxiaml vertex on left chain - //and C the leftmost vertex between the old A and the new A - C = A; - for(tempV = A->getNext(); tempV != botV; tempV = tempV->getNext()) - { - - if(tempV->head()[0] < C->head()[0]) - C = tempV; - if(is_u_maximal(tempV)) - { - A = tempV; - break; - } - } - - if(tempV == botV) - { - A = botV; - if(botV->head()[0] < C->head()[0]) - C = botV; - } - //update H - - if(A == botV) - H = botV; - else - { - for(tempV = H; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev()); - H = tempV->getNext(); - } - - } - else //A is below B - { - - directedLine* F = NULL; - for(tempV = D; tempV != C; tempV = tempV->getNext()) - { - if(tempV->head()[0] <= B->head()[0]) - { - F = tempV; - break; - } - } - if(F == NULL) - F = C; - if(F->head()[0] < G->head()[0]) - F = G; - - //connect FB - polygon->connectDiagonal_2slines(F, B, - &ret_p1, - &ret_p2, - NULL); - ret = ret_p2->insertPolygon(ret); - currentPolygon = ret_p1; - B = ret_p1; - if(H ->head()[1] >= B->head()[1]) - H = ret_p1; - - //update B to be the next u-minimal vertex on right chain - //and D the rightmost vertex between the old B and the new B - D = B; - for(tempV = B->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - if(tempV->head()[0] > D->head()[0]) - D = tempV; - if(is_u_minimal(tempV)) - { - B = tempV; - break; - } - } - if(tempV == botV) - { - B = botV; - if(botV->head()[0] > D->head()[0]) - D = botV; - } - //update G - if(B == botV) - G = botV; - else - { - for(tempV = G; compV2InY(tempV->head(), B->head()) == 1; tempV = tempV->getNext()); - G = tempV->getPrev(); - } - } //end of A is below B - } //end not u-monotone - } //end of main loop -} - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.h b/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.h deleted file mode 100644 index 6877a59c27..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/monoPolyPart.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* - *monoPolyPart.h - */ - -#ifndef _MONO_POLY_PART_H -#define _MONO_POLY_PART_H - -class directedLine; - -directedLine* monoPolyPart(directedLine* polygon); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/monoTriangulation.cc b/src/libs/mesa/glu/libnurbs/nurbtess/monoTriangulation.cc deleted file mode 100644 index 8e8d49dda7..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/monoTriangulation.cc +++ /dev/null @@ -1,1482 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "gluos.h" -#include "glimports.h" -#include "zlassert.h" - -#include "monoTriangulation.h" -#include "polyUtil.h" /*for area*/ -#include "partitionX.h" -#include "monoPolyPart.h" - - - -extern directedLine* polygonConvert(directedLine* polygon); - -/*poly is NOT deleted - */ -void monoTriangulationOpt(directedLine* poly, primStream* pStream) -{ - Int n_cusps; - Int n_edges = poly->numEdges(); - directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges); - assert(cusps); - findInteriorCuspsX(poly, n_cusps, cusps); - if(n_cusps ==0) //u monotine - { - monoTriangulationFun(poly, compV2InX, pStream); - } - else if(n_cusps == 1) // one interior cusp - { - directedLine* new_polygon = polygonConvert(cusps[0]); - directedLine* other = findDiagonal_singleCuspX(new_polygon); - // should NOT be null unless there are self-intersecting - //trim curves. In that case, we don't want to core dump, instead, - //we triangulate anyway, and print out error message. - if(other == NULL) - { - monoTriangulationFun(poly, compV2InX, pStream); - } - else - { - directedLine* ret_p1; - directedLine* ret_p2; - - new_polygon->connectDiagonal_2slines(new_polygon, other, - &ret_p1, - &ret_p2, - new_polygon); - - monoTriangulationFun(ret_p1, compV2InX, pStream); - monoTriangulationFun(ret_p2, compV2InX, pStream); - - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); - } - } - else - { - //we need a general partitionX funtion (supposed to be in partitionX.C, - //not implemented yet. XXX - monoTriangulationFun(poly, compV2InY, pStream); - } - - free(cusps); -} - -void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, - vertexArray* left_chain, Int left_current, - vertexArray* right_chain, Int right_current, - primStream* pStream) -{ - Int i,j; - Int n_left = left_chain->getNumElements(); - Int n_right = right_chain->getNumElements(); - if(left_current>= n_left-1 || - right_current>= n_right-1) - { - monoTriangulationRec(topVertex, botVertex, left_chain, left_current, - right_chain, right_current, pStream); - return; - } - //now both left and right have at least two vertices each. - Real left_v = left_chain->getVertex(left_current)[1]; - Real right_v = right_chain->getVertex(right_current)[1]; - - if(left_v <= right_v) //first left vertex is below right - { - //find the last vertex of right which is above or equal to left - for(j=right_current; j<=n_right-1; j++) - { - if(right_chain->getVertex(j)[1] < left_v) - break; - } - monoTriangulationRecGen(topVertex, left_chain->getVertex(left_current), - left_chain, left_current, left_current, - right_chain, right_current, j-1, - pStream); - monoTriangulationRecOpt(right_chain->getVertex(j-1), - botVertex, - left_chain, left_current, - right_chain, j, - pStream); - } - else //first right vertex is strictly below left - { - //find the last vertex of left which is strictly above right - for(i=left_current; i<=n_left-1; i++) - { - if(left_chain->getVertex(i)[1] <= right_v) - break; - } - monoTriangulationRecGen(topVertex, right_chain->getVertex(right_current), - left_chain, left_current, i-1, - right_chain, right_current, right_current, - pStream); - monoTriangulationRecOpt(left_chain->getVertex(i-1), - botVertex, - left_chain, i, - right_chain, right_current, - pStream); - } -} - - -void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream) -{ - pStream->triangle(topVertex, inc_chain->getVertex(inc_current), dec_chain->getVertex(dec_current)); - -/*printf("**(%f,%f)\n", inc_chain->getArray()[0][0],inc_chain->getArray()[0][1]);*/ - triangulateXYMonoTB(inc_end-inc_current+1, inc_chain->getArray()+inc_current, dec_end-dec_current+1, dec_chain->getArray()+dec_current, pStream); - - pStream->triangle(botVertex, dec_chain->getVertex(dec_end), inc_chain->getVertex(inc_end)); -} - - -/*n_left>=1 - *n_right>=1 - *the strip is going top to bottom. compared to the funtion - * triangulateXYmono() - */ -void triangulateXYMonoTB(Int n_left, Real** leftVerts, - Int n_right, Real** rightVerts, - primStream* pStream) -{ - - - Int i,j,k,l; - Real* topMostV; - - assert(n_left>=1 && n_right>=1); - if(leftVerts[0][1] >= rightVerts[0][1]) - { - i=1; - j=0; - topMostV = leftVerts[0]; - } - else - { - i=0; - j=1; - topMostV = rightVerts[0]; - } - - while(1) - { - if(i >= n_left) /*case1: no more in left*/ - { - - if(jbegin(); - pStream->insert(topMostV); - for(k=n_right-1; k>=j; k--) - pStream->insert(rightVerts[j]); - - pStream->end(PRIMITIVE_STREAM_FAN); - - } - - break; - } - else if(j>= n_right) /*case2: no more in right*/ - { - - if(ibegin(); - pStream->insert(topMostV); - - for(k=i; kinsert(leftVerts[k]); - - pStream->end(PRIMITIVE_STREAM_FAN); - } - - break; - } - else /* case3: neither is empty, plus the topMostV, there is at least one triangle to output*/ - { - - if(leftVerts[i][1] >= rightVerts[j][1]) - { - pStream->begin(); - pStream->insert(rightVerts[j]); /*the origin of this fan*/ - - pStream->insert(topMostV); - - /*find the last k>=i such that - *leftverts[k][1] >= rightverts[j][1] - */ - k=i; - while(kinsert(leftVerts[l]); - } - - pStream->end(PRIMITIVE_STREAM_FAN); - //update i for next loop - i = k+1; - topMostV = leftVerts[k]; - - } - else /*leftVerts[i][1] < rightVerts[j][1]*/ - { - pStream->begin(); - pStream->insert(leftVerts[i]);/*the origion of this fan*/ - - /*find the last k>=j such that - *rightverts[k][1] > leftverts[i][1]*/ - k=j; - while(k< n_right) - { - if(rightVerts[k][1] <= leftVerts[i][1]) - break; - k++; - } - k--; - - for(l=k; l>= j; l--) - pStream->insert(rightVerts[l]); - - pStream->insert(topMostV); - pStream->end(PRIMITIVE_STREAM_FAN); - j=k+1; - topMostV = rightVerts[j-1]; - } - } - } -} - -static int chainConvex(vertexArray* inc_chain, Int inc_current, Int inc_end) -{ - Int i; - //if there are no more than 2 vertices, return 1 - if(inc_current >= inc_end-1) return 1; - for(i=inc_current; i<= inc_end-2; i++) - { - if(area(inc_chain->getVertex(i), inc_chain->getVertex(i+1), inc_chain->getVertex(i+2)) <0) - return 0; - } - return 1; -} - -static int chainConcave(vertexArray* dec_chain, Int dec_current, Int dec_end) -{ - Int i; - //if there are no more than 2 vertices, return 1 - if(dec_current >= dec_end -1) return 1; - for(i=dec_current; i<=dec_end-2; i++) - { - if(area(dec_chain->getVertex(i), dec_chain->getVertex(i+1), dec_chain->getVertex(i+2)) >0) - return 0; - } - return 1; -} - -void monoTriangulationRecGenInU(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream) -{ - -} - -void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream) -{ - Int i; - //copy this to a polygon: directedLine Lioop - sampledLine* sline; - directedLine* dline; - directedLine* poly; - - if(inc_current <= inc_end) //at least one vertex in inc_chain - { - sline = new sampledLine(topVertex, inc_chain->getVertex(inc_current)); - poly = new directedLine(INCREASING, sline); - for(i=inc_current; i<=inc_end-1; i++) - { - sline = new sampledLine(inc_chain->getVertex(i), inc_chain->getVertex(i+1)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - sline = new sampledLine(inc_chain->getVertex(inc_end), botVertex); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - else //inc_chian is empty - { - sline = new sampledLine(topVertex, botVertex); - dline = new directedLine(INCREASING, sline); - poly = dline; - } - - assert(poly != NULL); - - if(dec_current <= dec_end) //at least on vertex in dec_Chain - { - sline = new sampledLine(botVertex, dec_chain->getVertex(dec_end)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - for(i=dec_end; i>dec_current; i--) - { - sline = new sampledLine(dec_chain->getVertex(i), dec_chain->getVertex(i-1)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - sline = new sampledLine(dec_chain->getVertex(dec_current), topVertex); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - else //dec_chain is empty - { - sline = new sampledLine(botVertex, topVertex); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - - { - Int n_cusps; - Int n_edges = poly->numEdges(); - directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*)*n_edges); - assert(cusps); - findInteriorCuspsX(poly, n_cusps, cusps); - - if(n_cusps ==0) //u monotine - { - monoTriangulationFun(poly, compV2InX, pStream); - } - else if(n_cusps == 1) // one interior cusp - { - directedLine* new_polygon = polygonConvert(cusps[0]); - directedLine* other = findDiagonal_singleCuspX(new_polygon); - // should NOT be null unless there are self-intersecting - //trim curves. In that case, we don't want to core dump, instead, - //we triangulate anyway, and print out error message. - if(other == NULL) - { - monoTriangulationFun(poly, compV2InX, pStream); - } - else - { - directedLine* ret_p1; - directedLine* ret_p2; - - new_polygon->connectDiagonal_2slines(new_polygon, other, - &ret_p1, - &ret_p2, - new_polygon); - - monoTriangulationFun(ret_p1, compV2InX, pStream); - monoTriangulationFun(ret_p2, compV2InX, pStream); - - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); - } - } - else - { - //we need a general partitionX funtion (supposed to be in partitionX.C, - //not implemented yet. XXX - //monoTriangulationFun(poly, compV2InY, pStream); - - directedLine* new_polygon = polygonConvert(poly); - directedLine* list = monoPolyPart(new_polygon); - for(directedLine* temp = list; temp != NULL; temp = temp->getNextPolygon()) - { - monoTriangulationFun(temp, compV2InX, pStream); - } - //clean up - list->deletePolygonListWithSline(); - - } - - free(cusps); - /* - if(numInteriorCuspsX(poly) == 0) //is u monotone - monoTriangulationFun(poly, compV2InX, pStream); - else //it is not u motone - monoTriangulationFun(poly, compV2InY, pStream); - */ - //clean up space - poly->deleteSinglePolygonWithSline(); - return; - } - - //apparently the following code is not reachable, - //it is for test purpose - if(inc_current > inc_end || dec_current>dec_end) - { - monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, - pStream); - return; - } - - - if( - area(dec_chain->getVertex(dec_current), - topVertex, - inc_chain->getVertex(inc_current)) >=0 - && chainConvex(inc_chain, inc_current, inc_end) - && chainConcave(dec_chain, dec_current, dec_end) - && area(inc_chain->getVertex(inc_end), botVertex, dec_chain->getVertex(dec_end)) >=0 - ) - { - monoTriangulationRecFunGen(topVertex, botVertex, - inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, - compV2InX, pStream); - } - else - { - monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, - pStream); - } -} - -/*if inc_current>inc_end, then inc_chain has no points to be considered - *same for dec_chain - */ -void monoTriangulationRecGen(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream) -{ - Real** inc_array ; - Real** dec_array ; - Int i; - - if(inc_current > inc_end && dec_current>dec_end) - return; - else if(inc_current>inc_end) /*no more vertices on inc_chain*/ - { - dec_array = dec_chain->getArray(); - reflexChain rChain(100,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i<=dec_end; i++){ - rChain.processNewVertex(dec_array[i], pStream); - } - /*process the bottom vertex*/ - rChain.processNewVertex(botVertex, pStream); - } - else if(dec_current> dec_end) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - - reflexChain rChain(100,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i<=inc_end; i++){ - rChain.processNewVertex(inc_array[i], pStream); - } - /*process the bottom vertex*/ - rChain.processNewVertex(botVertex, pStream); - } - else /*neither chain is empty*/ - { - inc_array = inc_chain -> getArray(); - dec_array = dec_chain -> getArray(); - - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(100, 0); - rChain.processNewVertex(topVertex, pStream); - for(i=dec_current; i<=dec_end; i++) - { - if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0) - rChain.processNewVertex(dec_array[i], pStream); - else - break; - } - rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRecGen(dec_array[i-1], botVertex, - inc_chain, inc_current, inc_end, - dec_chain, i, dec_end, - pStream); - } - else /*compV2InY(inc_array[inc_current], dec_array[dec_current]) > 0*/ - { - - reflexChain rChain(100, 1); - rChain.processNewVertex(topVertex, pStream); - for(i=inc_current; i<=inc_end; i++) - { - if(compV2InY(inc_array[i], dec_array[dec_current]) >0) - rChain.processNewVertex(inc_array[i], pStream); - else - break; - } - rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecGen(inc_array[i-1], botVertex, - inc_chain, i, inc_end, - dec_chain, dec_current,dec_end, - pStream); - } - }/*end case neither is empty*/ -} - -void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*), primStream* pStream) -{ - Int i; - /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, - *then call monoTriangulationRec - */ - directedLine* tempV; - directedLine* topV; - directedLine* botV; - topV = botV = monoPolygon; - for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext()) - { - if(compFun(topV->head(), tempV->head())<0) { - topV = tempV; - } - if(compFun(botV->head(), tempV->head())>0) { - botV = tempV; - } - } - - /*creat increase and decrease chains*/ - vertexArray inc_chain(20); /*this is a dynamic array*/ - for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ - inc_chain.appendVertex(topV->getVertex(i)); - } - for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) - { - for(i=0; i<=tempV->get_npoints()-2; i++){ - inc_chain.appendVertex(tempV->getVertex(i)); - } - } - - vertexArray dec_chain(20); - for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - for(i=tempV->get_npoints()-2; i>=0; i--){ - dec_chain.appendVertex(tempV->getVertex(i)); - } - } - for(i=botV->get_npoints()-2; i>=1; i--){ - dec_chain.appendVertex(tempV->getVertex(i)); - } - - if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) { - monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, - &dec_chain, 0, compFun, pStream); - } -} - -void monoTriangulation(directedLine* monoPolygon, primStream* pStream) -{ - Int i; - /*find the top vertex, bottom vertex, inccreasing chain, and decreasing chain, - *then call monoTriangulationRec - */ - directedLine* tempV; - directedLine* topV; - directedLine* botV; - topV = botV = monoPolygon; - for(tempV = monoPolygon->getNext(); tempV != monoPolygon; tempV = tempV->getNext()) - { - if(compV2InY(topV->head(), tempV->head())<0) { - topV = tempV; - } - if(compV2InY(botV->head(), tempV->head())>0) { - botV = tempV; - } - } - /*creat increase and decrease chains*/ - vertexArray inc_chain(20); /*this is a dynamic array*/ - for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ - inc_chain.appendVertex(topV->getVertex(i)); - } - for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) - { - for(i=0; i<=tempV->get_npoints()-2; i++){ - inc_chain.appendVertex(tempV->getVertex(i)); - } - } - - vertexArray dec_chain(20); - for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - for(i=tempV->get_npoints()-2; i>=0; i--){ - dec_chain.appendVertex(tempV->getVertex(i)); - } - } - for(i=botV->get_npoints()-2; i>=1; i--){ - dec_chain.appendVertex(tempV->getVertex(i)); - } - - monoTriangulationRec(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, pStream); - -} - -/*the chain could be increasing or decreasing, although we use the - * name inc_chain. - *the argument is_increase_chain indicates whether this chain - *is increasing (left chain in V-monotone case) or decreaing (right chain - *in V-monotone case). - */ -void monoTriangulation2(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_smallIndex, - Int inc_largeIndex, - Int is_increase_chain, - primStream* pStream) -{ - assert( inc_chain != NULL); - Real** inc_array ; - - if(inc_smallIndex > inc_largeIndex) - return; //no triangles - if(inc_smallIndex == inc_largeIndex) - { - if(is_increase_chain) - pStream->triangle(inc_chain->getVertex(inc_smallIndex), botVertex, topVertex); - else - pStream->triangle(inc_chain->getVertex(inc_smallIndex), topVertex, botVertex); - return; - } - Int i; - - if(is_increase_chain && botVertex[1] == inc_chain->getVertex(inc_largeIndex)[1]) - { - pStream->triangle(botVertex, inc_chain->getVertex(inc_largeIndex-1), - inc_chain->getVertex(inc_largeIndex)); - monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex, - inc_largeIndex-1, - is_increase_chain, - pStream); - return; - } - else if( (!is_increase_chain) && topVertex[1] == inc_chain->getVertex(inc_smallIndex)[1]) - { - pStream->triangle(topVertex, inc_chain->getVertex(inc_smallIndex+1), - inc_chain->getVertex(inc_smallIndex)); - monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex+1, - inc_largeIndex, is_increase_chain, pStream); - return ; - } - - inc_array = inc_chain->getArray(); - - reflexChain rChain(20,is_increase_chain); /*1 means the chain is increasing*/ - - rChain.processNewVertex(topVertex, pStream); - - for(i=inc_smallIndex; i<=inc_largeIndex; i++){ - rChain.processNewVertex(inc_array[i], pStream); - } - rChain.processNewVertex(botVertex, pStream); - -} - -/*if compFun == compV2InY, top to bottom: V-monotone - *if compFun == compV2InX, right to left: U-monotone - */ -void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - Int (*compFun)(Real*, Real*), - primStream* pStream) -{ - assert( inc_chain != NULL && dec_chain != NULL); - assert( ! (inc_current> inc_end && - dec_current> dec_end)); - /* - Int inc_nVertices; - Int dec_nVertices; - */ - Real** inc_array ; - Real** dec_array ; - Int i; - assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); - - if(inc_current> inc_end) /*no more vertices on inc_chain*/ - { - - dec_array = dec_chain->getArray(); - reflexChain rChain(20,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i<=dec_end; i++){ - rChain.processNewVertex(dec_array[i], pStream); - } - /*process the bottom vertex*/ - rChain.processNewVertex(botVertex, pStream); - - } - else if(dec_current> dec_end) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - reflexChain rChain(20,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i<=inc_end; i++){ - rChain.processNewVertex(inc_array[i], pStream); - } - /*process the bottom vertex*/ - rChain.processNewVertex(botVertex, pStream); - } - else /*neither chain is empty*/ - { - inc_array = inc_chain -> getArray(); - dec_array = dec_chain -> getArray(); - - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex, pStream); - for(i=dec_current; i<=dec_end; i++) - { - if(compFun(inc_array[inc_current], dec_array[i]) <= 0) - rChain.processNewVertex(dec_array[i], pStream); - else - break; - } - rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRecFunGen(dec_array[i-1], botVertex, - inc_chain, inc_current, inc_end, - dec_chain, i, dec_end, - compFun, - pStream); - } - else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/ - { - - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex, pStream); - for(i=inc_current; i<=inc_end; i++) - { - if(compFun(inc_array[i], dec_array[dec_current]) >0) - rChain.processNewVertex(inc_array[i], pStream); - else - break; - } - rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecFunGen(inc_array[i-1], botVertex, - inc_chain, i,inc_end, - dec_chain, dec_current,dec_end, - compFun, - pStream); - } - }/*end case neither is empty*/ -} - -/*if compFun == compV2InY, top to bottom: V-monotone - *if compFun == compV2InX, right to left: U-monotone - */ -void monoTriangulationRecFun(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, - vertexArray* dec_chain, Int dec_current, - Int (*compFun)(Real*, Real*), - primStream* pStream) -{ - assert( inc_chain != NULL && dec_chain != NULL); - assert( ! (inc_current>=inc_chain->getNumElements() && - dec_current>=dec_chain->getNumElements())); - Int inc_nVertices; - Int dec_nVertices; - Real** inc_array ; - Real** dec_array ; - Int i; - assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); - - if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ - { - - dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); - reflexChain rChain(20,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - inc_nVertices= inc_chain->getNumElements(); - reflexChain rChain(20,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i getArray(); - dec_array = dec_chain -> getArray(); - inc_nVertices= inc_chain->getNumElements(); - dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex, pStream); - for(i=dec_current; i 0*/ - { - - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex, pStream); - for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], pStream); - else - break; - } - rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecFun(inc_array[i-1], botVertex, - inc_chain, i, - dec_chain, dec_current, - compFun, - pStream); - } - }/*end case neither is empty*/ -} - - -void monoTriangulationRec(Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, - vertexArray* dec_chain, Int dec_current, - primStream* pStream) -{ - assert( inc_chain != NULL && dec_chain != NULL); - assert( ! (inc_current>=inc_chain->getNumElements() && - dec_current>=dec_chain->getNumElements())); - Int inc_nVertices; - Int dec_nVertices; - Real** inc_array ; - Real** dec_array ; - Int i; - assert( ! ( (inc_chain==NULL) && (dec_chain==NULL))); - - if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/ - { - - dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); - reflexChain rChain(20,0); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the dec_chain*/ - for(i=dec_current; i= dec_chain->getNumElements()) /*no more vertices on dec_chain*/ - { - inc_array = inc_chain->getArray(); - inc_nVertices= inc_chain->getNumElements(); - reflexChain rChain(20,1); - /*put the top vertex into the reflex chain*/ - rChain.processNewVertex(topVertex, pStream); - /*process all the vertices on the inc_chain*/ - for(i=inc_current; i getArray(); - dec_array = dec_chain -> getArray(); - inc_nVertices= inc_chain->getNumElements(); - dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the - *vertices on the dec_chain which are higher than top of inc_chain - */ - if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) - { - - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex, pStream); - for(i=dec_current; i 0*/ - { - - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex, pStream); - for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], pStream); - else - break; - } - rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRec(inc_array[i-1], botVertex, - inc_chain, i, - dec_chain, dec_current, - pStream); - } - }/*end case neither is empty*/ -} - - - -/* the name here assumes that the polygon is Y-monotone, but - *this function also works for X-monotone polygons. - * a monotne polygon consists of two extrem verteices: topVertex and botVertex, and - *two monotone chains: inc_chain, and dec_chain. The edges of the increasing chain (inc_chain) - *is ordered by following pointer: next, while the edges of the decreasing chain (dec_chain) - *is ordered by following pointer: prev - * inc_index index the vertex which is the toppest of the inc_chain which we are handling currently. - * dec_index index the vertex which is the toppest of the dec_chain which we are handling currently. - */ -void monoTriangulationRec(directedLine* inc_chain, Int inc_index, - directedLine* dec_chain, Int dec_index, - directedLine* topVertex, Int top_index, - directedLine* botVertex, - primStream* pStream) -{ - Int i; - directedLine *temp, *oldtemp = NULL; - Int tempIndex, oldtempIndex = 0; - - assert(inc_chain != NULL && dec_chain != NULL); - - if(inc_chain == botVertex) { - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex->getVertex(top_index), pStream); - for(i=dec_index; i< dec_chain->get_npoints(); i++){ - rChain.processNewVertex(dec_chain->getVertex(i), pStream); - } - for(temp = dec_chain->getPrev(); temp != botVertex; temp = temp->getPrev()) - { - for(i=0; iget_npoints(); i++){ - rChain.processNewVertex(temp->getVertex(i), pStream); - } - } - } - else if(dec_chain==botVertex) { - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex->getVertex(top_index), pStream); - for(i=inc_index; i< inc_chain->get_npoints(); i++){ - rChain.processNewVertex(inc_chain->getVertex(i), pStream); - } - for(temp = inc_chain->getPrev(); temp != botVertex; temp = temp->getNext()) - { - for(i=0; iget_npoints(); i++){ - rChain.processNewVertex(temp->getVertex(i), pStream); - } - } - } - else /*neither reached the bottom*/{ - if(compV2InY(inc_chain->getVertex(inc_index), dec_chain->getVertex(dec_index)) <=0) { - reflexChain rChain(20, 0); - rChain.processNewVertex(topVertex -> getVertex(top_index), pStream); - temp = dec_chain; - tempIndex = dec_index; - while( compV2InY(inc_chain->getVertex(inc_index), temp->getVertex(tempIndex))<=0) { - oldtemp = temp; - oldtempIndex = tempIndex; - rChain.processNewVertex(temp->getVertex(tempIndex), pStream); - - if(tempIndex == temp->get_npoints()-1){ - tempIndex = 0; - temp = temp->getPrev(); - } - else{ - tempIndex++; - } - } - rChain.outputFan(inc_chain->getVertex(inc_index), pStream); - monoTriangulationRec(inc_chain, inc_index, temp, tempIndex, oldtemp, oldtempIndex, botVertex, pStream); - } - else /* >0*/ { - reflexChain rChain(20, 1); - rChain.processNewVertex(topVertex -> getVertex(top_index), pStream); - temp = inc_chain; - tempIndex = inc_index; - while( compV2InY(temp->getVertex(tempIndex), dec_chain->getVertex(dec_index))>0){ - oldtemp = temp; - oldtempIndex = tempIndex; - rChain.processNewVertex(temp->getVertex(tempIndex), pStream); - - if(tempIndex == temp->get_npoints()-1){ - tempIndex = 0; - temp = temp->getNext(); - } - else{ - tempIndex++; - } - } - rChain.outputFan(dec_chain->getVertex(dec_index), pStream); - monoTriangulationRec(temp, tempIndex, dec_chain, dec_index, oldtemp, oldtempIndex, botVertex, pStream); - } - } /*end case neither reached the bottom*/ -} - -/***************************vertexArray begin here**********************************/ -vertexArray::vertexArray(Real2* vertices, Int nVertices) -{ - Int i; - size = index = nVertices; - array = (Real**) malloc(sizeof(Real*) * nVertices); - assert(array); - for(i=0; i= size){ - Real** temp = (Real**) malloc(sizeof(Real*) * (2*size +1)); - assert(temp); - for(i=0; i= v - * and array[i+1][1] v - *if sartIndex>endIndex, then return endIndex+1. - *otherwise, startIndex<=endIndex, it is assumed that - * 0<=startIndex<=endIndex endIndex) - return endIndex+1; - else if(array[endIndex][1] > v) - return endIndex+1; - else //now array[endIndex][1] <= v - { - for(i=endIndex-1; i>=startIndex; i--) - { - if(array[i][1] > v) - break; - } - return i+1; - } -} - -/*find the first i<=endIndex such that array[i-1][1] >= v - * and array[i][1] < v - *if sartIndex>endIndex, then return endIndex+1. - *otherwise, startIndex<=endIndex, it is assumed that - * 0<=startIndex<=endIndex endIndex) - return endIndex+1; - else if(array[endIndex][1] >= v) - return endIndex+1; - else //now array[endIndex][1] < v - { - for(i=endIndex-1; i>=startIndex; i--) - { - if(array[i][1] >= v) - break; - } - return i+1; - } -} - -/*find the first i>startIndex such that array[i-1][1] > v - * and array[i][1] >=v - *if sartIndex>endIndex, then return startIndex-1. - *otherwise, startIndex<=endIndex, it is assumed that - * 0<=startIndex<=endIndex endIndex) - return startIndex-1; - else if(array[startIndex][1] < v) - return startIndex-1; - else //now array[startIndex][1] >= v - { - - for(i=startIndex; i<=endIndex; i++) - { - if(array[i][1] <= v) - break; - } - if(i>endIndex) // v is strictly below all - return endIndex; - else if(array[i][1] == v) - return i; - else - return i-1; - } - -} - - -/*find the first i>=startIndex such that array[i][1] >= v - * and array[i+1][1] endIndex, then return startIndex-1. - *otherwise, startIndex<=endIndex, it is assumed that - * 0<=startIndex<=endIndex endIndex) - return startIndex-1; - else if(array[startIndex][1] < v) - return startIndex-1; - else //now array[startIndex][1] >= v - { - for(i=startIndex+1; i<=endIndex; i++) - { - if(array[i][1] < v) - break; - } - return i-1; - } -} - -Int vertexArray::findDecreaseChainFromEnd(Int begin, Int end) -{ - Int i = end; - Real prevU = array[i][0]; - Real thisU; - for(i=end-1; i>=begin; i--){ - thisU = array[i][0]; - if(thisU < prevU) - prevU = thisU; - else - break; - } - return i; -} - -//if(V(start) == v, return start, other wise return the -//last i so that V(i)==v -Int vertexArray::skipEqualityFromStart(Real v, Int start, Int end) -{ - Int i; - if(array[start][1] != v) - return start; - //now array[start][1] == v - for(i=start+1; i<= end; i++) - if(array[i][1] != v) - break; - return i-1; -} - - -/***************************vertexArray end****************************************/ - - - -/***************************relfex chain stuff begin here*****************************/ - -reflexChain::reflexChain(Int size, Int is_increasing) -{ - queue = (Real2*) malloc(sizeof(Real2) * size); - assert(queue); - index_queue = 0; - size_queue = size; - isIncreasing = is_increasing; -} - -reflexChain::~reflexChain() -{ - free(queue); -} - -/*put (u,v) at the end of the queue - *pay attention to space - */ -void reflexChain::insert(Real u, Real v) -{ - Int i; - if(index_queue >= size_queue) { - Real2 *temp = (Real2*) malloc(sizeof(Real2) * (2*size_queue+1)); - assert(temp); - - /*copy*/ - for(i=0; ibegin(); - pStream->insert(v); - if(isIncreasing) { - for(i=0; iinsert(queue[i]); - } - else { - for(i=index_queue-1; i>=0; i--) - pStream->insert(queue[i]); - } - pStream->end(PRIMITIVE_STREAM_FAN); -} - -void reflexChain::processNewVertex(Real v[2], primStream* pStream) -{ - Int i,j,k; - Int isReflex; - /*if there are at most one vertex in the queue, then simply insert - */ - if(index_queue <=1){ - insert(v); - return; - } - - /*there are at least two vertices in the queue*/ - j=index_queue-1; - - for(i=j; i>=1; i--) { - if(isIncreasing) { - isReflex = (area(queue[i-1], queue[i], v) <= 0.0); - } - else /*decreasing*/{ - isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); - } - if(isReflex) { - break; - } - } - - /* - *if ibegin(); - pStream->insert(v); - if(isIncreasing) { - for(k=i; k<=j; k++) - pStream->insert(queue[k]); - } - else { - for(k=j; k>=i; k--) - pStream->insert(queue[k]); - } - - pStream->end(PRIMITIVE_STREAM_FAN); - } - - /*delete vertices i+1--j from the queue*/ - index_queue = i+1; - /*finally insert v at the end of the queue*/ - insert(v); - -} - -void reflexChain::print() -{ - Int i; - printf("reflex chain: isIncreasing=%i\n", isIncreasing); - for(i=0; i -#define _glu_dprintf printf -#else -inline void _glu_dprintf( char *, ... ) { } -#endif -#endif - -#ifdef GLBUILD -inline void _glu_dprintf( char *, ... ) { } -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#endif /* __glumystdio_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/mystdlib.h b/src/libs/mesa/glu/libnurbs/nurbtess/mystdlib.h deleted file mode 100644 index ab7a3b273a..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/mystdlib.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -/* - * mystdlib.h - * - */ - -#ifndef __glumystdlib_h_ -#define __glumystdlib_h_ - -#ifdef STANDALONE -typedef unsigned int size_t; -extern "C" void abort( void ); -extern "C" void * malloc( size_t ); -extern "C" void free( void * ); -#endif - -#ifdef LIBRARYBUILD -#include -#endif - -#ifdef GLBUILD -typedef unsigned int size_t; -extern "C" void abort( void ); -extern "C" void * malloc( size_t ); -extern "C" void free( void * ); -#endif - -#endif /* __glumystdlib_h_ */ diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.cc b/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.cc deleted file mode 100644 index e25e30b0f3..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.cc +++ /dev/null @@ -1,162 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include - -#include "partitionX.h" - -#define CONCAVITY_ZERO 1.0e-6 //this number is used to test whether a vertex is concave (refelx) - //or not. The test needs to compute the area of the three adjacent - //vertices to see if the are is positive or negative. - -Int isCuspX(directedLine *v) -{ - //if v->prev <= v && v->next <= v - //|| v->prev >= v && v->next >= v - Real* T = v->head(); - Real* P = v->getPrev()->head(); - Real* N = v->getNext()->head(); - if( - (compV2InX(T,P) != -1 && - compV2InX(T,N) != -1 - ) || - (compV2InX(T,P) != 1 && - compV2InX(T,N) != 1 - ) - ) - return 1; - else - return 0; -} - -Int isReflexX(directedLine* v) -{ - Real* A = v->getPrev()->head(); - Real* B = v->head(); - Real* C = v->tail(); - Real Bx,By, Cx, Cy; - //scale them in case they are too small - Bx = 10*(B[0] - A[0]); - By = 10*(B[1] - A[1]); - Cx = 10*(C[0] - A[0]); - Cy = 10*(C[1] - A[1]); - - if(Bx*Cy - Cx*By < -CONCAVITY_ZERO) return 1; - else return 0; -} - - -/*return - *0: not-cusp - *1: interior cusp - *2: exterior cusp - */ -Int cuspTypeX(directedLine *v) -{ - if(! isCuspX(v)) return 0; - else - { -//printf("isCusp,%f,%f\n", v->head()[0], v->head()[1]); - if(isReflexX(v)) - { -// printf("isReflex\n"); - return 1; - } - else - { -// printf("not isReflex\n"); - return 2; - } - } -} - -Int numInteriorCuspsX(directedLine *polygon) -{ - directedLine *temp; - int ret = 0; - if(cuspTypeX(polygon) == 1) - ret++; - for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) - if(cuspTypeX(temp) == 1) - ret++; - return ret; -} - - -void findInteriorCuspsX(directedLine *polygon, Int& ret_n_interior_cusps, - directedLine** ret_interior_cusps) -{ - directedLine *temp; - ret_n_interior_cusps = 0; - if(cuspTypeX(polygon) == 1) - { - ret_interior_cusps[ret_n_interior_cusps++] = polygon; - } - for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) - if(cuspTypeX(temp) == 1) - { - ret_interior_cusps[ret_n_interior_cusps++] = temp; - } -} - -directedLine* findDiagonal_singleCuspX(directedLine* cusp) -{ - directedLine* temp; - Int is_minimal = ((compV2InX(cusp->head(), cusp->tail()) == -1)? 1:0); - - if(is_minimal) - for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) - { - if(compV2InX(cusp->head(), temp->head()) == 1) - { - return temp; - } - } - else //is maxmal - for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) - { - if(compV2InX(cusp->head(), temp->head()) == -1) - { - return temp; - } - } - return NULL; -} - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.h b/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.h deleted file mode 100644 index 69f2b2df21..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/partitionX.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _PARTITIONX_H -#define _PARTITIONX_H - -#include "directedLine.h" - -Int isCuspX(directedLine *v); -Int isReflexX(directedLine *v); -Int cuspTypeX(directedLine *v); - -//assuming the array of ret_interior_cusps has been allocated -void findInteriorCuspsX(directedLine* polygon, Int& ret_n_interior_cusps, - directedLine** ret_interior_cusps); - -Int numInteriorCuspsX(directedLine* polygon); - -/*a single polygon with a single cusp - *return the diagonal vertex corresponding to this cusp - */ -directedLine* findDiagonal_singleCuspX(directedLine* cusp); - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.cc b/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.cc deleted file mode 100644 index 297c629976..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.cc +++ /dev/null @@ -1,836 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include - -#include "zlassert.h" -#include "partitionY.h" -#include "searchTree.h" -#include "quicksort.h" -#include "polyUtil.h" - - -#define max(a,b) ((a>b)? a:b) -#define min(a,b) ((a>b)? b:a) - - -/*retrurn - *-1: if A < B (YaB - */ -static Int compVertInY(Real A[2], Real B[2]) -{ - if( (A[1] < B[1]) || (A[1]==B[1] && A[0]head(); - if( compVertInY(e->head(), vert) != 1 - && compVertInY(e->tail(), vert) != 1 - ) - return 1; - else - return 0; -} - -/*v is a vertex: the head of en edge, - *e is an edge, - *return 1 if e is below v: assume v1 and v2 are the two endpoints of e: - * v1>= v, v2>=v. - */ -Int isAbove(directedLine *v, directedLine *e) -{ - Real* vert = v->head(); - if( compVertInY(e->head(), vert) != -1 - && compVertInY(e->tail(), vert) != -1 - ) - return 1; - else - return 0; -} - -Int isCusp(directedLine *v) -{ - Real *A=v->getPrev()->head(); - Real *B=v->head(); - Real *C=v->tail(); - if(A[1] < B[1] && B[1] < C[1]) - return 0; - else if(A[1] > B[1] && B[1] > C[1]) - return 0; - else if(A[1] < B[1] && C[1] < B[1]) - return 1; - else if(A[1] > B[1] && C[1] > B[1]) - return 1; - - if(isAbove(v, v) && isAbove(v, v->getPrev()) || - isBelow(v, v) && isBelow(v, v->getPrev())) - return 1; - else - return 0; -} - -/*crossproduct is strictly less than 0*/ -Int isReflex(directedLine *v) -{ - Real* A = v->getPrev()->head(); - Real* B = v->head(); - Real* C = v->tail(); - Real Bx,By, Cx, Cy; - Bx = B[0] - A[0]; - By = B[1] - A[1]; - Cx = C[0] - A[0]; - Cy = C[1] - A[1]; - - if(Bx*Cy - Cx*By < 0) return 1; - else return 0; -} - - /*return - *0: not-cusp - *1: interior cusp - *2: exterior cusp - */ -Int cuspType(directedLine *v) -{ - if(! isCusp(v)) return 0; - else if(isReflex(v)) return 1; - else - return 2; -} - -sweepRange* sweepRangeMake(directedLine* left, Int leftType, - directedLine* right, Int rightType) -{ - sweepRange* ret = (sweepRange*)malloc(sizeof(sweepRange)); - assert(ret); - ret->left = left; - ret->leftType = leftType; - ret->right = right; - ret->rightType = rightType; - return ret; -} - -void sweepRangeDelete(sweepRange* range) -{ - free(range); -} - -Int sweepRangeEqual(sweepRange* src1, sweepRange* src2) -{ - Int leftEqual; - Int rightEqual; - - - /*The case when both are vertices should not happen*/ - assert(! (src1->leftType == 0 && src2->leftType == 0)); - if(src1->leftType == 0 && src2->leftType == 1){ - if(src1->left == src2->left || - src1->left->getPrev() == src2->left - ) - leftEqual = 1; - else - leftEqual = 0; - } - else if(src1->leftType == 1 && src2->leftType == 1){ - if(src1->left == src2->left) - leftEqual = 1; - else - leftEqual = 0; - } - else /*src1->leftType == 1 && src2->leftType == 0*/{ - if(src1->left == src2->left || - src1->left == src2->left->getPrev() - ) - leftEqual = 1; - else - leftEqual = 0; - } - - /*the same thing for right*/ - /*The case when both are vertices should not happen*/ - assert(! (src1->rightType == 0 && src2->rightType == 0)); - if(src1->rightType == 0 && src2->rightType == 1){ - if(src1->right == src2->right || - src1->right->getPrev() == src2->right - ) - rightEqual = 1; - else - rightEqual = 0; - } - else if(src1->rightType == 1 && src2->rightType == 1){ - if(src1->right == src2->right) - rightEqual = 1; - else - rightEqual = 0; - } - else /*src1->rightType == 1 && src2->rightType == 0*/{ - if(src1->right == src2->right || - src1->right == src2->right->getPrev() - ) - rightEqual = 1; - else - rightEqual = 0; - } - - return (leftEqual == 1 || rightEqual == 1); -} - -/*given (x_1, y_1) and (x_2, y_2), and y - *return x such that (x,y) is on the line - */ -inline/*static*/ Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y) -{ - return ((y2==y1)? (x1+x2)*Real(0.5) : x1 + ((y-y1)/(y2-y1)) * (x2-x1)); -/* - if(y2 == y1) return (x1+x2)*0.5; - else return x1 + ((y-y1)/(y2-y1)) * (x2-x1); -*/ -} - -/*compare two edges of a polygon. - *edge A < edge B if there is a horizontal line so that the intersection - *with A is to the left of the intersection with B. - *This function is used in sweepY for the dynamic search tree insertion to - *order the edges. - * Implementation: (x_1,y_1) and (x_2, y_2) - */ -static Int compEdges(directedLine *e1, directedLine *e2) -{ - Real* head1 = e1->head(); - Real* tail1 = e1->tail(); - Real* head2 = e2->head(); - Real* tail2 = e2->tail(); -/* - Real h10 = head1[0]; - Real h11 = head1[1]; - Real t10 = tail1[0]; - Real t11 = tail1[1]; - Real h20 = head2[0]; - Real h21 = head2[1]; - Real t20 = tail2[0]; - Real t21 = tail2[1]; -*/ - Real e1_Ymax, e1_Ymin, e2_Ymax, e2_Ymin; -/* - if(h11>t11) { - e1_Ymax= h11; - e1_Ymin= t11; - } - else{ - e1_Ymax = t11; - e1_Ymin = h11; - } - - if(h21>t21) { - e2_Ymax= h21; - e2_Ymin= t21; - } - else{ - e2_Ymax = t21; - e2_Ymin = h21; - } -*/ - - if(head1[1]>tail1[1]) { - e1_Ymax= head1[1]; - e1_Ymin= tail1[1]; - } - else{ - e1_Ymax = tail1[1]; - e1_Ymin = head1[1]; - } - - if(head2[1]>tail2[1]) { - e2_Ymax= head2[1]; - e2_Ymin= tail2[1]; - } - else{ - e2_Ymax = tail2[1]; - e2_Ymin = head2[1]; - } - - - /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ - /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ - /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ - /*Real e2_Ymin = min(head2[1], tail2[1]);*/ /*min(e2->head()[1], e2->tail()[1]);*/ - - Real Ymax = min(e1_Ymax, e2_Ymax); - Real Ymin = max(e1_Ymin, e2_Ymin); - - Real y = Real(0.5)*(Ymax + Ymin); - -/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); - Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y); -*/ -/* - Real x1 = intersectHoriz(h10, h11, t10, t11, y); - Real x2 = intersectHoriz(h20, h21, t20, t21, y); -*/ - Real x1 = intersectHoriz(head1[0], head1[1], tail1[0], tail1[1], y); - Real x2 = intersectHoriz(head2[0], head2[1], tail2[0], tail2[1], y); - - if(x1<= x2) return -1; - else return 1; -} - -/*used by sort precedures - */ -static Int compInY(directedLine* v1, directedLine* v2) -{ - return v1->compInY(v2); -} - -void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices) -{ - Int i,j,k; - - k=0; - - for(i=0; igetPrev(); -/* -printf("find i=%i\n", i); -printf("the vertex is\n"); -vert->printSingle(); -*/ - if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge) && compEdges(prevEdge, thisEdge)<0) - { - /*this is an upward interior cusp*/ - diagonal_vertices[k++] = vert; - - for(j=i+1; j0) - { - /*this is an downward interior cusp*/ - diagonal_vertices[k++] = vert; - for(j=i-1; j>=0; j--) - if(sweepRangeEqual(ranges[i], ranges[j])) - { - diagonal_vertices[k++] = sortedVertices[j]; - break; - } -/* printf("j=%i\n", j);*/ - assert(j>=0); - - - - } - } - num_diagonals = k/2; -} - -/*get rid of repeated diagonlas so that each diagonal appears only once in the array - */ -Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices) -{ - Int i,k; - Int j,l; - Int index; - index=0; - for(i=0,k=0; itoArrayAllPolygons(total_num_edges); - quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY); - sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * total_num_edges); - assert(ranges); - - sweepY(total_num_edges, array, ranges); - - directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges); - assert(diagonal_vertices); - findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices); - - num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); - return diagonal_vertices; - -} - - -/*partition into Y-monotone polygons*/ -directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines) -{ - Int total_num_edges = 0; - directedLine** array = polygons->toArrayAllPolygons(total_num_edges); - - quicksort( (void**)array, 0, total_num_edges-1, (Int (*)(void*, void*)) compInY); - - sweepRange** ranges = (sweepRange**) malloc(sizeof(sweepRange*) * (total_num_edges)); - assert(ranges); - - - - sweepY(total_num_edges, array, ranges); - - - - /*the diagonal vertices are stored as: - *v0-v1: 1st diagonal - *v2-v3: 2nd diagonal - *v5-v5: 3rd diagonal - *... - */ - - - Int num_diagonals; - /*number diagonals is < total_num_edges*total_num_edges*/ - directedLine** diagonal_vertices = (directedLine**) malloc(sizeof(directedLine*) * total_num_edges*2/*total_num_edges*/); - assert(diagonal_vertices); - - - - findDiagonals(total_num_edges, array, ranges, num_diagonals, diagonal_vertices); - - - - directedLine* ret_polygons = polygons; - sampledLine* newSampledLines = NULL; - Int i,k; - -num_diagonals=deleteRepeatDiagonals(num_diagonals, diagonal_vertices, diagonal_vertices); - - - - Int *removedDiagonals=(Int*)malloc(sizeof(Int) * num_diagonals); - for(i=0; ifindRoot(); - directedLine *root2 = v2->findRoot(); - assert(root1); - assert(root2); -*/ - -directedLine* root1 = v1->rootLinkFindRoot(); -directedLine* root2 = v2->rootLinkFindRoot(); - - if(root1 != root2) - { - - removedDiagonals[i] = 1; - sampledLine* generatedLine; - - - - v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); - - - - newSampledLines = generatedLine->insert(newSampledLines); -/* - ret_polygons = ret_polygons->cutoffPolygon(root1); - - ret_polygons = ret_polygons->cutoffPolygon(root2); - ret_polygons = ret_p1->insertPolygon(ret_polygons); -root1->rootLinkSet(ret_p1); -root2->rootLinkSet(ret_p1); -ret_p1->rootLinkSet(NULL); -ret_p2->rootLinkSet(ret_p1); -*/ - ret_polygons = ret_polygons->cutoffPolygon(root2); - - - -root2->rootLinkSet(root1); -ret_p1->rootLinkSet(root1); -ret_p2->rootLinkSet(root1); - - /*now that we have connected the diagonal v1 and v2, - *we have to check those unprocessed diagonals which - *have v1 or v2 as an end point. Notice that the head of v1 - *has the same coodinates as the head of v2->prev, and the head of - *v2 has the same coordinate as the head of v1->prev. - *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid - *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be - *replaced by (v2->prev, x), that is, x is on the left of - * v2->prev->prev->head, v2->prev->head, v2->prev->tail. - */ - Int ii, kk; - for(ii=0, kk=0; iiprev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), - v1->head(), v1->tail(), d2->head())) - { -/* - assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), - v2->getPrev()->tail(), d2->head())); -*/ - diagonal_vertices[kk] = v2->getPrev(); - } - } - if(d1 == v2) { - /*check if d2 is to left of v2->prev->head:v2->head:v2->tail*/ - if(! pointLeft2Lines(v2->getPrev()->head(), - v2->head(), v2->tail(), d2->head())) - { -/* - assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), - v1->getPrev()->head(), - v1->getPrev()->tail(), d2->head())); -*/ - diagonal_vertices[kk] = v1->getPrev(); - } - } - /*check d2 and replace diagonal_vertices[k+1] if necessary*/ - if(d2 == v1) { - /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), - v1->head(), v1->tail(), d1->head())) - { -/* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), - v2->getPrev()->tail(), d1->head())); -*/ - diagonal_vertices[kk+1] = v2->getPrev(); - } - } - if(d2 == v2) { - /*check if d1 is to left of v2->prev->head:v2->head:v2->tail*/ - if(! pointLeft2Lines(v2->getPrev()->head(), - v2->head(), v2->tail(), d1->head())) - { -/* assert(pointLeft2Lines(v1->getPrev()->getPrev()->head(), - v1->getPrev()->head(), - v1->getPrev()->tail(), d1->head())); -*/ - diagonal_vertices[kk+1] = v1->getPrev(); - } - } - } -}/*end if (root1 not equal to root 2)*/ -} - - /*second pass, now all diagoals should belong to the same polygon*/ - - - - for(i=0,k=0; ifindRoot(); -/* - directedLine *root2 = v2->findRoot(); - - - - assert(root1); - assert(root2); - assert(root1 == root2); - */ - sampledLine* generatedLine; - - - - v1->connectDiagonal(v1,v2, &ret_p1, &ret_p2, &generatedLine, ret_polygons); - newSampledLines = generatedLine->insert(newSampledLines); - - ret_polygons = ret_polygons->cutoffPolygon(root1); - - ret_polygons = ret_p1->insertPolygon(ret_polygons); - - ret_polygons = ret_p2->insertPolygon(ret_polygons); - - - - for(Int j=i+1; jsamePolygon(temp1, temp2)) - { - /*if temp1 and temp2 are in different polygons, - *then one of them must be v1 or v2. - */ - - - - assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); - if(temp1==v1) - { - diagonal_vertices[2*j] = v2->getPrev(); - } - if(temp2==v1) - { - diagonal_vertices[2*j+1] = v2->getPrev(); - } - if(temp1==v2) - { - diagonal_vertices[2*j] = v1->getPrev(); - } - if(temp2==v2) - { - diagonal_vertices[2*j+1] = v1->getPrev(); - } - } - } - } - - } - - /*clean up spaces*/ - free(array); - free(ranges); - free(diagonal_vertices); - free(removedDiagonals); - - *retSampledLines = newSampledLines; - return ret_polygons; -} - -/*given a set of simple polygons where the interior - *is decided by left-hand principle, - *return a range (sight) for each vertex. This is called - *Trapezoidalization. - */ -void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_ranges) -{ - Int i; - /*for each vertex in the sorted list, update the binary search tree. - *and store the range information for each vertex. - */ - treeNode* searchTree = NULL; - for(i=0; igetPrev(); - - if(isBelow(vert, thisEdge) && isAbove(vert, prevEdge)) - { - - /*case 1: this < v < prev - *the polygon is going down at v, the interior is to - *the right hand side. - * find the edge to the right of thisEdge for right range. - * delete thisEdge - * insert prevEdge - */ - treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges); - assert(thisNode); - - treeNode* succ = TreeNodeSuccessor(thisNode); - assert(succ); - searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); - searchTree = TreeNodeInsert(searchTree, TreeNodeMake(prevEdge), ( Int (*) (void *, void *))compEdges); - - - ret_ranges[i] = sweepRangeMake(vert, 0, (directedLine*) (succ->key), 1); - - } - else if(isAbove(vert, thisEdge) && isBelow(vert, prevEdge)) - { - - /*case 2: this > v > prev - *the polygon is going up at v, the interior is to - *the left hand side. - * find the edge to the left of thisEdge for left range. - * delete prevEdge - * insert thisEdge - */ - treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges); - assert(prevNode); - treeNode* pred = TreeNodePredecessor(prevNode); - searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); - searchTree = TreeNodeInsert(searchTree, TreeNodeMake(thisEdge), ( Int (*) (void *, void *))compEdges); - ret_ranges[i] = sweepRangeMake((directedLine*)(pred->key), 1, vert, 0); - } - else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge)) - { - - /*case 3: insert both edges*/ - treeNode* thisNode = TreeNodeMake(thisEdge); - treeNode* prevNode = TreeNodeMake(prevEdge); - searchTree = TreeNodeInsert(searchTree, thisNode, ( Int (*) (void *, void *))compEdges); - searchTree = TreeNodeInsert(searchTree, prevNode, ( Int (*) (void *, void *))compEdges); - if(compEdges(thisEdge, prevEdge)<0) /*interior cusp*/ - { - - treeNode* leftEdge = TreeNodePredecessor(thisNode); - treeNode* rightEdge = TreeNodeSuccessor(prevNode); - ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, - (directedLine*) rightEdge->key, 1 - ); - } - else /*exterior cusp*/ - { - - ret_ranges[i] = sweepRangeMake( prevEdge, 1, thisEdge, 1); - } - } - else if(isBelow(vert, thisEdge) && isBelow(vert, prevEdge)) - { - - /*case 4: delete both edges*/ - treeNode* thisNode = TreeNodeFind(searchTree, thisEdge, ( Int (*) (void *, void *))compEdges); - treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges); - if(compEdges(thisEdge, prevEdge)>0) /*interior cusp*/ - { - treeNode* leftEdge = TreeNodePredecessor(prevNode); - treeNode* rightEdge = TreeNodeSuccessor(thisNode); - ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, - (directedLine*) rightEdge->key, 1 - ); - } - else /*exterior cusp*/ - { - ret_ranges[i] = sweepRangeMake( thisEdge, 1, prevEdge, 1); - } - searchTree = TreeNodeDeleteSingleNode(searchTree, thisNode); - searchTree = TreeNodeDeleteSingleNode(searchTree, prevNode); - } - else - { - fprintf(stderr,"error in partitionY.C, invalid case\n"); - printf("vert is\n"); - vert->printSingle(); - printf("thisEdge is\n"); - thisEdge->printSingle(); - printf("prevEdge is\n"); - prevEdge->printSingle(); - - exit(1); - } - } - - /*finaly clean up space: delete the search tree*/ - TreeNodeDeleteWholeTree(searchTree); -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.h b/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.h deleted file mode 100644 index 8dda409de1..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/partitionY.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* - *partitionY.h: - *partition a polygon into a Y-monotone polygon: - * A polygon is Y-monotone if the boundary can be split into two polygon chains - *A and B such that each chain is Y-monotonic that is the intersection of any - *horizontal line intersects each chain has at most one connected componenets - * (empty, single point or a single line). - * - * A vertex is a cusp if both its ajacent vertices are either at or above v, - *or both at or below v. In addition, at least one of the ajacent verteces is - *strictly below or above v. - * A vertex is a relex vertex if the internals angle is strictly greater than - *180. In other words, if the the signed area is negative: - *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the - *order is such that left hand side is inside the polygon. Then (x2,y2) is - *reflex if: - * (x2-x1, y2-y1) cross (x3-x1, y3-y1) <0. - *A vertex is an interior cusp if it is a cusp and a reflex. - *A vertex is an exterior cusp if it is a cusp but not a reflex. - * - */ - -#ifndef _PARTITIONY_H -#define _PARTITIONY_H - -#include "directedLine.h" - -/*whether an edge is below a vertex*/ -Int isBelow(directedLine *v, directedLine *e); - -/*whether an edge is above a vertex*/ -Int isAbove(directedLine *v, directedLine *e); - -/*not-cusp, - *inerior cusp - *exterior cusp - */ -Int cuspType(directedLine *v); - -/*used in trapezoidalization*/ -typedef struct sweepRange{ - directedLine *left; - Int leftType; /*either a vertex (leftType=0) or an edge (leftType =1) */ - directedLine *right; - Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ -} sweepRange; - -sweepRange* sweepRangeMake(directedLine* left, Int leftType, - directedLine* right, Int rightType); - -void sweepRangeDelete(sweepRange* range); -Int sweepRangeEqual(sweepRange* sr1, sweepRange* sr2); - -/*given a set of simple polygons where the interior - *is decided by left-hand principle, - *return a range (sight) for each vertex. This is called - *Trapezoidalization. - */ -void sweepY(Int nVertices, directedLine **sortedVerteces, sweepRange** ret_ranges); - - -directedLine* partitionY(directedLine *polygons, sampledLine **retSampledLines); - -void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices); - -directedLine** DBGfindDiagonals(directedLine *polygons, Int& num_diagonals); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.cc b/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.cc deleted file mode 100644 index 4d04df73f6..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.cc +++ /dev/null @@ -1,734 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include -#include "zlassert.h" -#include "polyDBG.h" - -#ifdef __WATCOMC__ -#pragma warning 14 10 -#pragma warning 391 10 -#pragma warning 726 10 -#endif - -static Real area(Real A[2], Real B[2], Real C[2]) -{ - Real Bx, By, Cx, Cy; - Bx = B[0] - A[0]; - By = B[1] - A[1]; - Cx = C[0] - A[0]; - Cy = C[1] - A[1]; - return Bx*Cy - Cx*By; -} - -Int DBG_isConvex(directedLine *poly) -{ - directedLine* temp; - if(area(poly->head(), poly->tail(), poly->getNext()->tail()) < 0.00000) - return 0; - for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) - { - if(area(temp->head(), temp->tail(), temp->getNext()->tail()) < 0.00000) - return 0; - } - return 1; -} - -Int DBG_is_U_monotone(directedLine* poly) -{ - Int n_changes = 0; - Int prev_sign; - Int cur_sign; - directedLine* temp; - cur_sign = compV2InX(poly->tail(), poly->head()); - - n_changes = (compV2InX(poly->getPrev()->tail(), poly->getPrev()->head()) - != cur_sign); - - for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) - { - prev_sign = cur_sign; - cur_sign = compV2InX(temp->tail(), temp->head()); - - if(cur_sign != prev_sign) - n_changes++; - } - - if(n_changes ==2) return 1; - else return 0; -} - -/*if u-monotone, and there is a long horizontal edge*/ -Int DBG_is_U_direction(directedLine* poly) -{ -/* - if(! DBG_is_U_monotone(poly)) - return 0; -*/ - Int V_count = 0; - Int U_count = 0; - directedLine* temp; - if( fabs(poly->head()[0] - poly->tail()[0]) <= fabs(poly->head()[1]-poly->tail()[1])) - V_count += poly->get_npoints(); - else - U_count += poly->get_npoints(); - /* - else if(poly->head()[1] == poly->tail()[1]) - U_count += poly->get_npoints(); - */ - for(temp = poly->getNext(); temp != poly; temp = temp->getNext()) - { - if( fabs(temp->head()[0] - temp->tail()[0]) <= fabs(temp->head()[1]-temp->tail()[1])) - V_count += temp->get_npoints(); - else - U_count += temp->get_npoints(); - /* - if(temp->head()[0] == temp->tail()[0]) - V_count += temp->get_npoints(); - else if(temp->head()[1] == temp->tail()[1]) - U_count += temp->get_npoints(); - */ - } - - if(U_count > V_count) return 1; - else return 0; -} - -/*given two line segments, determine whether - *they intersect each other or not. - *return 1 if they do, - *return 0 otherwise - */ -Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) -{ - if(l1->getNext() == l2) - { - if(area(l1->head(), l1->tail(), l2->tail()) == 0) //colinear - { - if( (l1->tail()[0] - l1->head()[0])*(l2->tail()[0]-l2->head()[0]) + - (l1->tail()[1] - l1->head()[1])*(l2->tail()[1]-l2->head()[1]) >=0) - return 0; //not intersect - else - return 1; - } - //else we use the normal code - } - else if(l1->getPrev() == l2) - { - if(area(l2->head(), l2->tail(), l1->tail()) == 0) //colinear - { - if( (l2->tail()[0] - l2->head()[0])*(l1->tail()[0]-l1->head()[0]) + - (l2->tail()[1] - l2->head()[1])*(l1->tail()[1]-l1->head()[1]) >=0) - return 0; //not intersect - else - return 1; - } - //else we use the normal code - } - else //the two edges are not connected - { - if((l1->head()[0] == l2->head()[0] && - l1->head()[1] == l2->head()[1]) || - (l1->tail()[0] == l2->tail()[0] && - l1->tail()[1] == l2->tail()[1])) - return 1; - - } - - - if( - ( - area(l1->head(), l1->tail(), l2->head()) - * - area(l1->head(), l1->tail(), l2->tail()) - < 0 - ) - && - ( - area(l2->head(), l2->tail(), l1->head()) - *area(l2->head(), l2->tail(), l1->tail()) - < 0 - ) - ) - return 1; - else - return 0; -} - -/*whether AB and CD intersect - *return 1 if they do - *retur 0 otheriwse - */ -Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]) -{ - if( - ( - area(A, B, C) * area(A,B,D) <0 - ) - && - ( - area(C,D,A) * area(C,D,B) < 0 - ) - ) - return 1; - else - return 0; -} - -/*determien whether (A,B) interesect chain[start] to [end] - */ -Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]) -{ - Int i; - for(i=start; i<=end-2; i++) - if(DBG_edgesIntersectGen(chain->getVertex(i), chain->getVertex(i+1), A, B)) - return 1; - - return 0; -} - -/*determine whether a polygon intersect itself or not - *return 1 is it does, - * 0 otherwise - */ -Int DBG_polygonSelfIntersect(directedLine* poly) -{ - directedLine* temp1; - directedLine* temp2; - temp1=poly; - for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext()) - { - if(DBG_edgesIntersect(temp1, temp2)) - { - return 1; - } - - } - - for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext()) - for(temp2=temp1->getNext(); temp2 != temp1; temp2=temp2->getNext()) - { - if(DBG_edgesIntersect(temp1, temp2)) - { - return 1; - } - } - return 0; -} - -/*check whether a line segment intersects a polygon - */ -Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly) -{ - directedLine* temp; - if(DBG_edgesIntersect(edge, poly)) - return 1; - for(temp=poly->getNext(); temp != poly; temp=temp->getNext()) - if(DBG_edgesIntersect(edge, temp)) - return 1; - return 0; -} - -/*check whether two polygons intersect - */ -Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2) -{ - directedLine* temp; - if(DBG_edgeIntersectPoly(p1, p2)) - return 1; - for(temp=p1->getNext(); temp!= p1; temp = temp->getNext()) - if(DBG_edgeIntersectPoly(temp, p2)) - return 1; - return 0; -} - -/*check whether there are polygons intersecting each other in - *a list of polygons - */ -Int DBG_polygonListIntersect(directedLine* pList) -{ - directedLine *temp; - for(temp=pList; temp != NULL; temp = temp->getNextPolygon()) - if(DBG_polygonSelfIntersect(temp)) - return 1; - directedLine* temp2; - for(temp=pList; temp!=NULL; temp=temp->getNextPolygon()) - { - for(temp2=temp->getNextPolygon(); temp2 != NULL; temp2=temp2->getNextPolygon()) - if(DBG_polygonsIntersect(temp, temp2)) - return 1; - } - - return 0; -} - - -Int DBG_isCounterclockwise(directedLine* poly) -{ - return (poly->polyArea() > 0); -} - -/*ray: v0 with direction (dx,dy). - *edge: v1-v2. - * the extra point v10[2] is given for the information at - *v1. Basically this edge is connectd to edge - * v10-v1. If v1 is on the ray, - * then we need v10 to determine whether this ray intersects - * the edge or not (that is, return 1 or return 0). - * If v1 is on the ray, then if v2 and v10 are on the same side of the ray, - * we return 0, otherwise return 1. - *For v2, if v2 is on the ray, we always return 0. - *Notice that v1 and v2 are not symmetric. So the edge is directed!!! - * The purpose for this convention is such that: a point is inside a polygon - * if and only if it intersets with odd number of edges. - */ -Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]) -{ -/* -if( (v1[1] >= v0[1] && v2[1]<= v0[1] ) - ||(v2[1] >= v0[1] && v1[1]<= v0[1] ) - ) - printf("rayIntersectEdge, *********\n"); -*/ - - Real denom = (v2[0]-v1[0])*(-dy) - (v2[1]-v1[1]) * (-dx); - Real nomRay = (v2[0]-v1[0]) * (v0[1] - v1[1]) - (v2[1]-v1[1])*(v0[0]-v1[0]); - Real nomEdge = (v0[0]-v1[0]) * (-dy) - (v0[1]-v1[1])*(-dx); - - - /*if the ray is parallel to the edge, return 0: not intersect*/ - if(denom == 0.0) - return 0; - - /*if v0 is on the edge, return 0: not intersect*/ - if(nomRay == 0.0) - return 0; - - /*if v1 is on the positive ray, and the neighbor of v1 crosses the ray - *return 1: intersect - */ - if(nomEdge == 0) - { /*v1 is on the positive or negative ray*/ - -/* - printf("v1 is on the ray\n"); -*/ - - if(dx*(v1[0]-v0[0])>=0 && dy*(v1[1]-v0[1])>=0) /*v1 on positive ray*/ - { - if(area(v0, v1, v10) * area(v0, v1, v2) >0) - return 0; - else - return 1; - } - else /*v1 on negative ray*/ - return 0; - } - - /*if v2 is on the ray, always return 0: not intersect*/ - if(nomEdge == denom) { -/* printf("v2 is on the ray\n");*/ - return 0; - } - - /*finally */ - if(denom*nomRay>0 && denom*nomEdge>0 && nomEdge/denom <=1.0) - return 1; - return 0; -} - - -/*return the number of intersections*/ -Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine* poly) -{ - directedLine* temp; - Int count=0; - if(DBG_rayIntersectEdge(v0, dx, dy, poly->getPrev()->head(), poly->head(), poly->tail())) - count++; - - for(temp=poly->getNext(); temp != poly; temp = temp->getNext()) - if(DBG_rayIntersectEdge(v0, dx, dy, temp->getPrev()->head(), temp->head(), temp->tail())) - count++; -/*printf("ray intersect poly: count=%i\n", count);*/ - return count; -} - -Int DBG_pointInsidePoly(Real v[2], directedLine* poly) -{ -/* -printf("enter pointInsidePoly , v=(%f,%f)\n", v[0], v[1]); -printf("the polygon is\n"); -poly->printList(); -*/ - /*for debug purpose*/ - assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 ) - == (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 ) - ); - if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1) - return 1; - else - return 0; -} - -/*return the number of polygons which contain thie polygon - * as a subset - */ -Int DBG_enclosingPolygons(directedLine* poly, directedLine* list) -{ - directedLine* temp; - Int count=0; -/* -printf("%i\n", DBG_pointInsidePoly(poly->head(), - list->getNextPolygon() - ->getNextPolygon() - ->getNextPolygon() - ->getNextPolygon() -)); -*/ - - for(temp = list; temp != NULL; temp = temp->getNextPolygon()) - { - if(poly != temp) - if(DBG_pointInsidePoly(poly->head(), temp)) - count++; -/* printf("count=%i\n", count);*/ - } - return count; -} - -void DBG_reverse(directedLine* poly) -{ - if(poly->getDirection() == INCREASING) - poly->putDirection(DECREASING); - else - poly->putDirection(INCREASING); - - directedLine* oldNext = poly->getNext(); - poly->putNext(poly->getPrev()); - poly->putPrev(oldNext); - - directedLine* temp; - for(temp=oldNext; temp!=poly; temp = oldNext) - { - if(temp->getDirection() == INCREASING) - temp->putDirection(DECREASING); - else - temp->putDirection(INCREASING); - - oldNext = temp->getNext(); - temp->putNext(temp->getPrev()); - temp->putPrev(oldNext); - } - printf("reverse done\n"); -} - -Int DBG_checkConnectivity(directedLine *polygon) -{ - if(polygon == NULL) return 1; - directedLine* temp; - if(polygon->head()[0] != polygon->getPrev()->tail()[0] || - polygon->head()[1] != polygon->getPrev()->tail()[1]) - return 0; - for(temp=polygon->getNext(); temp != polygon; temp=temp->getNext()) - { - if(temp->head()[0] != temp->getPrev()->tail()[0] || - temp->head()[1] != temp->getPrev()->tail()[1]) - return 0; - } - return 1; -} - -/*print out error message. - *If it cannot modify the polygon list to make it satify the - *requirements, return 1. - *otherwise modify the polygon list, and return 0 - */ -Int DBG_check(directedLine *polyList) -{ - directedLine* temp; - if(polyList == NULL) return 0; - - /*if there are intersections, print out error message - */ - if(DBG_polygonListIntersect(polyList)) - { - fprintf(stderr, "DBG_check: there are self intersections, don't know to modify the polygons\n"); - return 1; - } - - /*check the connectivity of each polygon*/ - for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon()) - { - if(! DBG_checkConnectivity(temp)) - { - fprintf(stderr, "DBG_check, polygon not connected\n"); - return 1; - } - } - - /*check the orientation of each polygon*/ - for(temp = polyList; temp!= NULL; temp = temp ->getNextPolygon()) - { - - - Int correctDir; - - if( DBG_enclosingPolygons(temp, polyList) % 2 == 0) - correctDir = 1; /*counterclockwise*/ - else - correctDir = 0; /*clockwise*/ - - Int actualDir = DBG_isCounterclockwise(temp); - - if(correctDir != actualDir) - { - fprintf(stderr, "DBG_check: polygon with incorrect orientations. reversed\n"); - - DBG_reverse(temp); - } - - } - return 0; -} - -/**************handle self intersections*****************/ -//determine whether e interects [begin, end] or not -static directedLine* DBG_edgeIntersectChainD(directedLine *e, - directedLine *begin, directedLine *end) -{ - directedLine *temp; - for(temp=begin; temp != end; temp = temp->getNext()) - { - if(DBG_edgesIntersect(e, temp)) - return temp; - } - if(DBG_edgesIntersect(e, end)) - return end; - return NULL; -} - -//given a polygon, cut the edges off and finally obtain a -//a polygon without intersections. The cut-off edges are -//dealloated. The new polygon is returned. -directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur) -{ - directedLine *begin, *end, *next; - begin = polygon; - end = polygon; - cutOccur = 0; - while( (next = end->getNext()) != begin) - { - directedLine *interc = NULL; - if( (interc = DBG_edgeIntersectChainD(next, begin, end))) - { - int fixed = 0; - if(DBG_edgesIntersect(next, interc->getNext())) - { - //trying to fix it - Real buf[2]; - int i; - Int n=5; - buf[0] = interc->tail()[0]; - buf[1] = interc->tail()[1]; - - for(i=1; ihead()[0] + r * interc->tail()[0]; - Real v = (1-r) * interc->head()[1] + r * interc->tail()[1]; - interc->tail()[0] = interc->getNext()->head()[0] = u; - interc->tail()[1] = interc->getNext()->head()[1] = v; - if( (! DBG_edgesIntersect(next, interc)) && - (! DBG_edgesIntersect(next, interc->getNext()))) - break; //we fixed it - } - if(i==n) // we didn't fix it - { - fixed = 0; - //back to original - interc->tail()[0] = interc->getNext()->head()[0] = buf[0]; - interc->tail()[1] = interc->getNext()->head()[1] = buf[1]; - } - else - { - fixed = 1; - } - } - if(fixed == 0) - { - cutOccur = 1; - begin->deleteSingleLine(next); - - if(begin != end) - { - if(DBG_polygonSelfIntersect(begin)) - { - directedLine* newEnd = end->getPrev(); - begin->deleteSingleLine(end); - end = newEnd; - } - } - } - else - { - end = end->getNext(); - } - } - else - { - end = end->getNext(); - } - } - return begin; -} - -//given a polygon, cut the edges off and finally obtain a -//a polygon without intersections. The cut-off edges are -//dealloated. The new polygon is returned. -#if 0 // UNUSED -static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon) -{ - directedLine *crt;//current polygon - directedLine *begin; - directedLine *end; - directedLine *temp; - crt = polygon; - int find=0; - while(1) - { -//printf("loop\n"); - //if there are less than 3 edges, we should stop - if(crt->getPrev()->getPrev() == crt) - return NULL; - - if(DBG_edgesIntersect(crt, crt->getNext()) || - (crt->head()[0] == crt->getNext()->tail()[0] && - crt->head()[1] == crt->getNext()->tail()[1]) - ) - { - find = 1; - crt=crt->deleteChain(crt, crt->getNext()); - } - else - { - //now we know crt and crt->getNext do not intersect - begin = crt; - end = crt->getNext(); -//printf("begin=(%f,%f)\n", begin->head()[0], begin->head()[1]); -//printf("end=(%f,%f)\n", end->head()[0], end->head()[1]); - for(temp=end->getNext(); temp!=begin; temp= temp->getNext()) - { -//printf("temp=(%f,%f)\n", temp->head()[0], temp->head()[1]); - directedLine *intersect = DBG_edgeIntersectChainD(temp, begin, end); - if(intersect != NULL) - { - crt = crt->deleteChain(intersect, temp); - find=1; - break; //the for loop - } - else - { - end = temp; - } - } - } - if(find == 0) - return crt; - else - find = 0; //go to next loop -} -} -#endif - -directedLine* DBG_cutIntersectionAllPoly(directedLine* list) -{ - directedLine* temp; - directedLine* tempNext=NULL; - directedLine* ret = NULL; - int cutOccur=0; - for(temp=list; temp != NULL; temp = tempNext) - { - directedLine *left; - tempNext = temp->getNextPolygon(); - - left = DBG_cutIntersectionPoly(temp, cutOccur); - if(left != NULL) - ret=left->insertPolygon(ret); - } - return ret; -} - -sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList) -{ - directedLine *temp; - sampledLine* tempHead = NULL; - sampledLine* tempTail = NULL; - sampledLine* cHead = NULL; - sampledLine* cTail = NULL; - - if(polygonList == NULL) - return NULL; - - DBG_collectSampledLinesPoly(polygonList, cHead, cTail); - - assert(cHead); - assert(cTail); - for(temp = polygonList->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon()) - { - DBG_collectSampledLinesPoly(temp, tempHead, tempTail); - cTail->insert(tempHead); - cTail = tempTail; - } - return cHead; -} - -void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail) -{ - directedLine *temp; - retHead = NULL; - retTail = NULL; - if(polygon == NULL) - return; - - retHead = retTail = polygon->getSampledLine(); - for(temp = polygon->getNext(); temp != polygon; temp=temp->getNext()) - { - retHead = temp->getSampledLine()->insert(retHead); - } -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.h b/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.h deleted file mode 100644 index 74843d8887..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/polyDBG.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _POLYDBG_H -#define _POLYDBG_H - -#include "definitions.h" -#include "directedLine.h" -#include "monoTriangulation.h" - -Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]); -Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]); - - -Int DBG_edgesIntersect(directedLine* l1, directedLine* l2); -Int DBG_polygonSelfIntersect(directedLine* poly); -Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly); -Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2); -Int DBG_polygonListIntersect(directedLine* pList); - -Int DBG_isCounterclockwise(directedLine* poly); -Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]); -Int DBG_pointInsidePoly(Real v[2], directedLine* poly); -Int DBG_enclosingPolygons(directedLine* poly, directedLine* list); -void DBG_reverse(directedLine* poly); -Int DBG_check(directedLine *polyList); - -Int DBG_isConvex(directedLine *poly); -Int DBG_is_U_direction(directedLine *poly); -Int DBG_is_U_monotone(directedLine* poly); - -directedLine* DBG_cutIntersectionAllPoly(directedLine* list); -directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur); - -sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList); - -void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.cc b/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.cc deleted file mode 100644 index f9a27f402c..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include - -#include "polyUtil.h" - -Real area(Real A[2], Real B[2], Real C[2]) -{ - Real Bx, By, Cx, Cy; - Bx = B[0] - A[0]; - By = B[1] - A[1]; - Cx = C[0] - A[0]; - Cy = C[1] - A[1]; - return Bx*Cy - Cx*By; - -/* return (B[0]-A[0])*(C[1]-A[1]) - (C[0]-A[0])*(B[1]-A[1]);*/ -} - -/*given a directed line A->B, and a point P, - *determine whether P is to the left of AB. - *the line A->B (imagine it has beedn extended both - *end to the infinity) divides the plan into two - *half planes. When we walk from A to B, one - *half is to the left and the other half is to the right. - *return 1 if P is to the left. - *if P is on AB, 0 is returned. - */ -Int pointLeftLine(Real A[2], Real B[2], Real P[2]) -{ - if(area(A, B, P) >0) return 1; - else return 0; -} - -/*given two directed line: A -> B -> C, and another point P. - *determine whether P is to the left hand side of A->B->C. - *Think of BA and BC extended as two rays. So that the plane is - * divided into two parts. One part is to the left we walk from A - *to B and to C, the other part is to the right. - * In order for P to be the left, P must be either to the left - *of - */ -Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]) -{ - Int C_left_AB = (area(A, B, C)>0); - Int P_left_AB = (area(A, B, P)>0); - Int P_left_BC = (area(B, C, P)>0); - - if(C_left_AB) - { - return (P_left_AB && P_left_BC); - } - else - return (P_left_AB || P_left_BC); -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.h b/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.h deleted file mode 100644 index 1ca2ebcc07..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/polyUtil.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _POLYUTIL_H -#define _POLYUTIL_H - -#include "definitions.h" -#ifdef __cplusplus -extern "C" { -#endif -Real area(Real A[2], Real B[2], Real C[2]); - -Int pointLeftLine(Real A[2], Real B[2], Real P[2]); -Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]); -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/primitiveStream.cc b/src/libs/mesa/glu/libnurbs/nurbtess/primitiveStream.cc deleted file mode 100644 index 26d05342f9..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/primitiveStream.cc +++ /dev/null @@ -1,190 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include -#include - -#include "primitiveStream.h" - -Int primStream::num_triangles() -{ - Int i; - Int ret=0; - for(i=0; i= size_vertices) { - Real* temp = (Real*) malloc (sizeof(Real) * (2*size_vertices + 2)); - assert(temp); - - /*copy*/ - for(Int i=0; i= size_lengths){ - Int* temp = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2)); - assert(temp); - Int* tempTypes = (Int*) malloc(sizeof(Int) * (2*size_lengths + 2)); - assert(tempTypes); - - /*copy*/ - for(i=0; i - */ - -#ifndef _PRIMITIVE_STREAM_H -#define _PRIMITIVE_STREAM_H - -enum {PRIMITIVE_STREAM_FAN, PRIMITIVE_STREAM_STRIP}; - -#include "definitions.h" - -class primStream { - Int *lengths; /*length[i]=number of vertices of ith primitive*/ - Int *types; /*each primive has a type: FAN or STREAM*/ - Real *vertices; /*the size >= 2 * num_vertices, each vertex (u,v)*/ - - /*the following size information are used for dynamic arrays*/ - Int index_lengths; /*the current available entry*/ - Int size_lengths; /*the allocated size of the array: lengths*/ - Int index_vertices; - Int size_vertices; - - /*the vertex is inserted one by one. counter is used to - *count the number of vertices which have been inserted so far in - *the current primitive - */ - Int counter; - -public: - primStream(Int sizeLengths, Int sizeVertices); - ~primStream(); - - Int get_n_prims() //num of primitives - { - return index_lengths; - } - Int get_type(Int i) //the type of ith primitive - { - return types[i]; - } - Int get_length(Int i) //the length of the ith primitive - { - return lengths[i]; - } - Real* get_vertices() {return vertices;} - - /*the begining of inserting a new primitive. - *reset counter to be 0. - */ - void begin(); - void insert(Real u, Real v); - void insert(Real v[2]) {insert(v[0], v[1]);} - void end(Int type); - - Int num_triangles(); - - void triangle(Real A[2], Real B[2], Real C[2]) - { - begin(); - insert(A); - insert(B); - insert(C); - end(PRIMITIVE_STREAM_FAN); - } - void print(); - void draw(); /*using GL to draw the primitives*/ -}; - - - - - - - - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.cc b/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.cc deleted file mode 100644 index 9d0b290b39..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include - - -static void swap(void *v[], int i, int j) -{ - void *temp; - temp = v[i]; - v[i] = v[j]; - v[j] = temp; -} - -/*as an example to use this function to - *sort integers, you need to supply the function - *int comp(int *i1, int *i2) - *{ - * if( *i1 < * i2) return -1; - * else return 1; - *} - *and an array of pointers to integers: - * int *v[100] (allocate space for where each v[i] points to). - *then you can call: - * quicksort( (void**)v, left, right, (int (*)(void *, void *))comp) - */ -void quicksort(void *v[], int left, int right, - int (*comp) (void *, void *)) -{ - int i, last; - if(left >= right) /*do nothing if array contains */ - return; /*fewer than two elements*/ - - swap(v, left, (left+right)/2); - last = left; - for(i=left+1; i<=right; i++) - if((*comp)(v[i], v[left])<0) - swap(v, ++last, i); - swap(v, left, last); - quicksort(v, left, last-1, comp); - quicksort(v, last+1, right, comp); -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.h b/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.h deleted file mode 100644 index 3a8dcd6a2c..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/quicksort.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _QUICKSORT_H -#define _QUICKSORT_H - -#include -#include - -void quicksort(void *v[], int left, int right, - int (*comp) (void *, void *)); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.cc b/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.cc deleted file mode 100644 index f457b15733..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.cc +++ /dev/null @@ -1,196 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include "glimports.h" -#include "zlassert.h" -#include - -#include "rectBlock.h" - -rectBlock::rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline) -{ - Int i; - - - upGridLineIndex = left->getVlineIndex(beginVline); - - lowGridLineIndex = left->getVlineIndex(endVline); - - Int n = upGridLineIndex-lowGridLineIndex+1; //number of grid lines - leftIndices = (Int*) malloc(sizeof(Int) * n); - assert(leftIndices); - rightIndices = (Int*) malloc(sizeof(Int) * n); - assert(rightIndices); - for(i=0; igetInnerIndex(i+beginVline); - rightIndices[i] = right->getInnerIndex(i+beginVline); - } -} - - -rectBlock::~rectBlock() -{ - free(leftIndices); - free(rightIndices); -} - -void rectBlock::print() -{ - Int i; - printf("block:\n"); - for(i=upGridLineIndex; i >= lowGridLineIndex; i--) - { - printf("gridline %i, (%i,%i)\n", i, leftIndices[upGridLineIndex-i], rightIndices[upGridLineIndex-i]); - } -} - - - -void rectBlock::draw(Real* u_values, Real* v_values) -{ - Int i,j,k; - //upgrid line to bot grid line -#ifdef DEBUG -printf("upGridLineIndex=%i, lowGridLineIndex=%i\n", upGridLineIndex, lowGridLineIndex); -#endif - for(k=0, i=upGridLineIndex; i > lowGridLineIndex; i--, k++) - { - glBegin(GL_QUAD_STRIP); - - for(j=leftIndices[k+1]; j<= rightIndices[k+1]; j++) - { - glVertex2f(u_values[j], v_values[i]); - glVertex2f(u_values[j], v_values[i-1]); - } - glEnd(); - } -} - - -Int rectBlock::num_quads() -{ - Int ret=0; - Int k,i; - for(k=0, i=upGridLineIndex; i>lowGridLineIndex; i--, k++) - { - ret += (rightIndices[k+1]-leftIndices[k+1]); - } - return ret; -} - -Int rectBlockArray::num_quads() -{ - Int ret=0; - for(Int i=0; inum_quads(); - return ret; -} - -rectBlockArray::rectBlockArray(Int s) -{ - Int i; - n_elements = 0; - size = s; - array = (rectBlock**) malloc(sizeof(rectBlock*) * s); - assert(array); -//initialization - for(i=0; iprint(); -} - -void rectBlockArray::draw(Real* u_values, Real* v_values) -{ - Int i; - for(i=0; idraw(u_values, v_values); -} - - - - - - - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.h b/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.h deleted file mode 100644 index 8dbd7eb819..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/rectBlock.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _RECTBLOCK_H -#define _RECTBLOCK_H - -#include "definitions.h" -#include "gridWrap.h" - -class rectBlock{ - Int upGridLineIndex; - Int lowGridLineIndex; - Int* leftIndices; //up to bottome - Int* rightIndices; //up to bottom -public: - //the arrays are copies. - rectBlock(gridBoundaryChain* left, gridBoundaryChain* right, Int beginVline, Int endVline); - ~rectBlock(); //free the two arrays - - Int get_upGridLineIndex() {return upGridLineIndex;} - Int get_lowGridLineIndex() {return lowGridLineIndex;} - Int* get_leftIndices() {return leftIndices;} - Int* get_rightIndices() {return rightIndices;} - - Int num_quads(); - - void print(); - void draw(Real* u_values, Real* v_values); -}; - - -class rectBlockArray{ - rectBlock** array; - Int n_elements; - Int size; -public: - rectBlockArray(Int s); - ~rectBlockArray();//delete avarything including the blocks - - Int get_n_elements() {return n_elements;} - rectBlock* get_element(Int i) {return array[i];} - void insert(rectBlock* newBlock); //only take the pointer, not ther cotent - - Int num_quads(); - - void print(); - void draw(Real* u_values, Real* v_values); -}; - - - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.cc deleted file mode 100644 index 861c71bb38..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.cc +++ /dev/null @@ -1,371 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "glimports.h" -#include "sampleComp.h" -#include "sampleCompTop.h" -#include "sampleCompBot.h" -#include "sampleCompRight.h" - - - -#define max(a,b) ((a>b)? a:b) -#define min(a,b) ((a>b)? b:a) - -void sampleConnectedComp(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, Int rightEndIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, Int gridIndex2, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream, - rectBlockArray* rbArray - ) -{ - - sampleCompLeft(topVertex, botVertex, - leftChain, - leftStartIndex, leftEndIndex, - rightChain, - rightStartIndex, rightEndIndex, - leftGridChain, - gridIndex1, - gridIndex2, - up_leftCornerWhere, - up_leftCornerIndex, - down_leftCornerWhere, - down_leftCornerIndex, - pStream); - - - sampleCompRight(topVertex, botVertex, - leftChain, - leftStartIndex, leftEndIndex, - rightChain, - rightStartIndex, - rightEndIndex, - rightGridChain, - gridIndex1, gridIndex2, - up_rightCornerWhere, - up_rightCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream); - - - sampleCompTop(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - - sampleCompBot(botVertex, - leftChain, - leftEndIndex, - rightChain, - rightEndIndex, - leftGridChain, - rightGridChain, - gridIndex2, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream); - - - //the center - - rbArray->insert(new rectBlock(leftGridChain, rightGridChain, gridIndex1, gridIndex2)); - - -} - -/*notice that we need rightChain because the - *corners could be on the rightChain. - *here comp means component. - */ -void sampleCompLeft(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, Int rightEndIndex, - gridBoundaryChain* leftGridChain, - Int gridIndex1, Int gridIndex2, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - primStream* pStream) -{ - /*find out whether there is a trim vertex which is - *inbetween the top and bot grid lines or not. - */ - Int midIndex1; - Int midIndex2; - Int gridMidIndex1 = 0, gridMidIndex2 = 0; - //midIndex1: array[i] <= v, array[i-1] > v - //midIndex2: array[i] >= v, array[i+1] < v - // v(gridMidIndex1) >= v(midindex1) > v(gridMidIndex1+1) - // v(gridMidIndex2-1) >= v(midIndex2) > v(gridMidIndex2) ?? - midIndex1 = leftChain->findIndexBelowGen( - leftGridChain->get_v_value(gridIndex1), - leftStartIndex, - leftEndIndex); - - midIndex2 = -1; /*initilization*/ - if(midIndex1<= leftEndIndex && gridIndex1getVertex(midIndex1)[1] >= leftGridChain->get_v_value(gridIndex2)) - { - midIndex2 = leftChain->findIndexAboveGen( - leftGridChain->get_v_value(gridIndex2), - midIndex1, //midIndex1 <= midIndex2. - leftEndIndex); - gridMidIndex1 = leftGridChain->lookfor(leftChain->getVertex(midIndex1)[1], - gridIndex1, gridIndex2); - gridMidIndex2 = 1+leftGridChain->lookfor(leftChain->getVertex(midIndex2)[1], - gridMidIndex1, gridIndex2); - } - - - /*to interprete the corner information*/ - Real* cornerTop; - Real* cornerBot; - Int cornerLeftStart; - Int cornerLeftEnd; - Int cornerRightUpEnd; - Int cornerRightDownStart; - if(up_leftCornerWhere == 0) /*left corner is on left chain*/ - { - cornerTop = leftChain->getVertex(up_leftCornerIndex); - cornerLeftStart = up_leftCornerIndex+1; - cornerRightUpEnd = -1; /*no right*/ - } - else if(up_leftCornerWhere == 1) /*left corner is on top*/ - { - cornerTop = topVertex; - cornerLeftStart = leftStartIndex; - cornerRightUpEnd = -1; /*no right*/ - } - else /*left corner is on right chain*/ - { - cornerTop = topVertex; - cornerLeftStart = leftStartIndex; - cornerRightUpEnd = up_leftCornerIndex; - } - - if(down_leftCornerWhere == 0) /*left corner is on left chain*/ - { - cornerBot = leftChain->getVertex(down_leftCornerIndex); - cornerLeftEnd = down_leftCornerIndex-1; - cornerRightDownStart = rightEndIndex+1; /*no right*/ - } - else if(down_leftCornerWhere == 1) /*left corner is on bot*/ - { - cornerBot = botVertex; - cornerLeftEnd = leftEndIndex; - cornerRightDownStart = rightEndIndex+1; /*no right*/ - } - else /*left corner is on the right chian*/ - { - cornerBot = botVertex; - cornerLeftEnd = leftEndIndex; - cornerRightDownStart = down_leftCornerIndex; - } - - - - - /*sample*/ - if(midIndex2 >= 0) /*there is a trim point inbewteen grid lines*/ - { - - sampleLeftSingleTrimEdgeRegionGen(cornerTop, leftChain->getVertex(midIndex1), - leftChain, - cornerLeftStart, - midIndex1-1, - leftGridChain, - gridIndex1, - gridMidIndex1, - rightChain, - rightStartIndex, - cornerRightUpEnd, - 0, //no right down section - -1, - pStream); - - sampleLeftSingleTrimEdgeRegionGen(leftChain->getVertex(midIndex2), - cornerBot, - leftChain, - midIndex2+1, - cornerLeftEnd, - leftGridChain, - gridMidIndex2, - gridIndex2, - rightChain, - 0, //no right up section - -1, - cornerRightDownStart, - rightEndIndex, - pStream); - - - sampleLeftStripRecF(leftChain, - midIndex1, - midIndex2, - leftGridChain, - gridMidIndex1, - gridMidIndex2, - pStream); - } - else - { - sampleLeftSingleTrimEdgeRegionGen(cornerTop, cornerBot, - leftChain, - cornerLeftStart, - cornerLeftEnd, - leftGridChain, - gridIndex1, - gridIndex2, - rightChain, - rightStartIndex, - cornerRightUpEnd, - cornerRightDownStart, - rightEndIndex, - pStream); - } -} - -void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], - vertexArray* leftChain, - Int leftStart, - Int leftEnd, - gridBoundaryChain* gridChain, - Int gridBeginIndex, - Int gridEndIndex, - vertexArray* rightChain, - Int rightUpBegin, - Int rightUpEnd, - Int rightDownBegin, - Int rightDownEnd, - primStream* pStream) -{ - Int i,j,k; - - /*creat an array to store all the up and down secments of the right chain, - *and the left end grid points - * - *although vertex array is a dynamic array, but to gain efficiency, - *it is better to initiliza the exact array size - */ - vertexArray vArray(gridEndIndex-gridBeginIndex+1 + - max(0,rightUpEnd - rightUpBegin+1)+ - max(0,rightDownEnd - rightDownBegin+1)); - - /*append the vertices on the up section of thr right chain*/ - for(i=rightUpBegin; i<= rightUpEnd; i++) - vArray.appendVertex(rightChain->getVertex(i)); - - /*append the vertices of the left extremal grid points, - *and at the same time, perform triangulation for the stair cases - */ - vArray.appendVertex(gridChain->get_vertex(gridBeginIndex)); - - for(k=1, i=gridBeginIndex+1; i<=gridEndIndex; i++, k++) - { - vArray.appendVertex(gridChain->get_vertex(i)); - - /*output the fan of the grid points of the (i)th and (i-1)th grid line. - */ - if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(gridChain->get_vertex(i-1)); - for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) - pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(gridChain->get_vertex(i)); - for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--) - pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - /*otherwisem, the two are equal, so there is no fan to outout*/ - } - - /*then append all the vertices on the down section of the right chain*/ - for(i=rightDownBegin; i<= rightDownEnd; i++) - vArray.appendVertex(rightChain->getVertex(i)); - - monoTriangulationRecGen(topVert, botVert, - leftChain, leftStart, leftEnd, - &vArray, 0, vArray.getNumElements()-1, - pStream); - -} - - - - - - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.h deleted file mode 100644 index a3c1790254..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleComp.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLECOMP_H -#define _SAMPLECOMP_H - -#include "sampleMonoPoly.h" -#include "rectBlock.h" - -void sampleConnectedComp(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int botLeftIndex, - vertexArray* rightChain, - Int rightStartIndex, Int botRightIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, Int gridIndex2, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream, - rectBlockArray* rbArray - ); - -void sampleCompLeft(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, Int rightEndIndex, - gridBoundaryChain* leftGridChain, - Int gridIndex1, Int gridIndex2, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - primStream* pStream); - -void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], - vertexArray* leftChain, - Int leftStart, - Int leftEnd, - gridBoundaryChain* gridChain, - Int gridBegindex, - Int gridEndIndex, - vertexArray* rightChain, - Int rightUpBegin, - Int rightUpEnd, - Int rightDownBegin, - Int rightDownEnd, - primStream* pStream); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.cc deleted file mode 100644 index e12f88bab1..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.cc +++ /dev/null @@ -1,844 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "zlassert.h" -#include "sampleCompBot.h" -#include "sampleCompRight.h" - -#define max(a,b) ((a>b)? a:b) - -//return: index_mono, index_pass -//from [pass, mono] is strictly U-monotone -//from [corner, pass] is = u -//if everybost is getVertex(i)[0] >= u) - break; - ret_index_pass = i; - if(ret_index_pass <= leftEnd) - { - for(i=ret_index_pass; i< leftEnd; i++) - { - if(leftChain->getVertex(i+1)[0] <= leftChain->getVertex(i)[0]) - break; - } - ret_index_mono = i; - } - -} - -void findBotRightSegment(vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - Real u, - Int& ret_index_mono, - Int& ret_index_pass) -{ - Int i; - assert(rightCorner <= rightEnd); - for(i=rightCorner; i<= rightEnd; i++) - if(rightChain->getVertex(i)[0] <= u) - break; - - - - ret_index_pass = i; - - if(ret_index_pass <= rightEnd) - { - for(i=ret_index_pass; i< rightEnd; i++) - { - if(rightChain->getVertex(i+1)[0] >= rightChain->getVertex(i)[0]) - break; - } - ret_index_mono = i; - } -} - - -void sampleBotRightWithGridLinePost(Real* botVertex, - vertexArray* rightChain, - Int rightEnd, - Int segIndexMono, - Int segIndexPass, - Int rightCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - //the possible section which is to the right of rightU - if(segIndexPass > rightCorner) //from corner to pass-1 is > u. - { - Real *tempBot; - if(segIndexPass <= rightEnd) //there is a point to the left of u - tempBot = rightChain->getVertex(segIndexPass); - else //nothing is to the left of u. - tempBot = botVertex; - Real tempTop[2]; - tempTop[0] = grid->get_u_value(rightU); - tempTop[1] = grid->get_v_value(gridV); - - monoTriangulation2(tempTop, tempBot, - rightChain, - rightCorner, - segIndexPass-1, - 0, // a decrease chain - pStream); - } - - //the possible section which is strictly Umonotone - if(segIndexPass <= rightEnd) //segIndex pass and mono exist - { - //if there are grid points which are to the left of botVertex - //then we should use botVertex to form a fan with these points to - //optimize the triangulation - int do_optimize = 1; - if(botVertex[0] <= grid->get_u_value(leftU)) - do_optimize = 0; - else - { - //we also have to make sure that botVertex is the left most vertex on the chain - int i; - for(i=segIndexMono; i<=rightEnd; i++) - if(rightChain->getVertex(i)[0] <= botVertex[0]) - { - do_optimize = 0; - break; - } - } - - if(do_optimize) - { - //find midU so that grid->get_u_value(midU) <= botVertex[0] - //and grid->get_u_value(midU) > botVertex[0] - int midU = leftU; - while(grid->get_u_value(midU) <= botVertex[0]) - { - midU++; - if(midU > rightU) - break; - } - midU--; - - grid->outputFanWithPoint(gridV, leftU, midU, botVertex, pStream); - stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1); - Real tempTop[2]; - tempTop[0] = grid->get_u_value(midU); - tempTop[1] = grid->get_v_value(gridV); - monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream); - } - else //not optimize - { - stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1); - Real tempTop[2]; - tempTop[0] = grid->get_u_value(leftU); - tempTop[1] = grid->get_v_value(gridV); - monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream); - } - } - else //the botVertex forms a fan witht eh grid points - grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); -} - -void sampleBotRightWithGridLine(Real* botVertex, - vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - //if right chaain is empty, then there is only one bot vertex with - //one grid line - if(rightEndoutputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); - return; - } - - Int segIndexMono, segIndexPass; - findBotRightSegment(rightChain, - rightEnd, - rightCorner, - grid->get_u_value(rightU), - segIndexMono, - segIndexPass); - - sampleBotRightWithGridLinePost(botVertex, - rightChain, - rightEnd, - segIndexMono, - segIndexPass, - rightCorner, - grid, - gridV, - leftU, - rightU, - pStream); -} - - -void sampleBotLeftWithGridLinePost(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - Int segIndexMono, - Int segIndexPass, - Int leftCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - - //the possible section which is to the left of leftU - if(segIndexPass > leftCorner) //at least leftCorner is to the left of leftU - { - Real *tempBot; - if(segIndexPass <= leftEnd) //from corner to pass-1 is getVertex(segIndexPass); - else //nothing is to the rigth of u - tempBot = botVertex; - Real tempTop[2]; - tempTop[0] = grid->get_u_value(leftU); - tempTop[1] = grid->get_v_value(gridV); - monoTriangulation2(tempTop, tempBot, leftChain, leftCorner, segIndexPass-1, - 1, //a increase chain, - pStream); - } - //the possible section which is strictly Umonotone - if(segIndexPass <= leftEnd) //segIndexpass and mono exist - { - stripOfFanLeft(leftChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1); - Real tempTop[2]; - tempTop[0] = grid->get_u_value(rightU); - tempTop[1] = grid->get_v_value(gridV); - - monoTriangulation2(tempTop, botVertex, leftChain, segIndexMono, leftEnd, - 1, //increase chain - pStream); - } - else //the botVertex forms a fan with the grid points - { - grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); - } - -} - -void sampleBotLeftWithGridLine(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - Int leftCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - - //if leftChain is empty, then there is only one botVertex with one grid line - if(leftEnd< leftCorner){ - grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); - return; - } - - Int segIndexPass, segIndexMono; - findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass); - - sampleBotLeftWithGridLinePost(botVertex, - leftChain, - leftEnd, - segIndexMono, - segIndexPass, - leftCorner, - grid, - gridV, - leftU, rightU, pStream); -} - -//return 1 if separator exists, 0 otherwise -Int findBotSeparator(vertexArray* leftChain, - Int leftEnd, - Int leftCorner, - vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - Int& ret_sep_left, - Int& ret_sep_right) -{ - Int oldLeftI, oldRightI, newLeftI, newRightI; - Int i,j,k; - Real leftMax /*= leftChain->getVertex(leftCorner)[0]*/; - Real rightMin /*= rightChain->getVertex(rightCorner)[0]*/; - if(leftChain->getVertex(leftCorner)[1] < rightChain->getVertex(rightCorner)[1])//leftlower - { - oldLeftI = leftCorner-1; - oldRightI = rightCorner; - leftMax = leftChain->getVertex(leftCorner)[0] - Real(1.0) ; //initilize to be left of leftCorner - rightMin = rightChain->getVertex(rightCorner)[0]; - } - else //rightlower - { - oldLeftI = leftCorner; - oldRightI = rightCorner-1; - leftMax = leftChain->getVertex(leftCorner)[0]; - rightMin = rightChain->getVertex(rightCorner)[0] + Real(1.0); - } - - //i: the current working leftChain Index - //j: the curent working right chian index - //if(left(i) is lower than right(j), then the two chains above right(j) are separated. - //else the two chains below left(i) are separated. - i = leftCorner; - j = rightCorner; - while(1) - { - newLeftI = oldLeftI; - newRightI = oldRightI; - if(i> leftEnd) //left chain is doen , go through remaining right chain - { - for(k=j+1; k<= rightEnd; k++) - { - if(rightChain->getVertex(k)[0] > leftMax) //no conflict - { - //update oldRightI if necessary - if(rightChain->getVertex(k)[0] < rightMin) - { - rightMin = rightChain->getVertex(k)[0]; - oldRightI = k; - } - } - else //there is a conflict - break; //the for-loop, above right(k+1) is separated: oldLeftI, oldRightI - } - break; //the while loop - } - else if(j > rightEnd) //right Chain is doen - { - for(k=i+1; k<= leftEnd; k++) - { - if(leftChain->getVertex(k)[0] < rightMin) //no conflict - { - //update oldLeftI if necessary - if(leftChain->getVertex(k)[0] > leftMax) - { - leftMax = leftChain->getVertex(k)[0]; - oldLeftI = k; - } - } - else //there is a conflict - break; //the for-loop, above left(k+1) is separated: oldLeftI, oldRightI - } - break; //the while loop - } - else if(leftChain->getVertex(i)[1] < rightChain->getVertex(j)[1]) //left lower - { - - if(leftChain->getVertex(i)[0] > leftMax) //update leftMax amd newLeftI - { - leftMax = leftChain->getVertex(i)[0]; - newLeftI = i; - } - for(k=j+1; k<= rightEnd; k++) //update rightMin and newRightI; - { - if(rightChain->getVertex(k)[1] < leftChain->getVertex(i)[1]) //right gets lower - break; - if(rightChain->getVertex(k)[0] < rightMin) - { - rightMin = rightChain->getVertex(k)[0]; - newRightI = k; - } - } - j = k; //next working j, since j will he lower than i in next loop - if(leftMax >= rightMin) //there is a conflict - break; - else //still no conflict - { - oldLeftI = newLeftI; - oldRightI = newRightI; - - } - } - else //right lower - { - if(rightChain->getVertex(j)[0] < rightMin) - { - rightMin = rightChain->getVertex(j)[0]; - newRightI = j; - } - for(k=i+1; k<= leftEnd; k++) - { - if(leftChain->getVertex(k)[1] < rightChain->getVertex(j)[1]) - break; - if(leftChain->getVertex(k)[0] > leftMax) - { - leftMax = leftChain->getVertex(k)[0]; - newLeftI = k; - } - } - i=k; //nexct working i, since i will be lower than j next loop - if(leftMax >= rightMin) //there is conflict - break; - else //still no conflict - { - oldLeftI = newLeftI; - oldRightI = newRightI; - } - } - }//end of while loop - //now oldLeftI and oldRight I are the desired separator index notice that they are not - //necessarily valid - if(oldLeftI < leftCorner || oldRightI < rightCorner) - return 0; //no separator - else - { - ret_sep_left = oldLeftI; - ret_sep_right = oldRightI; - return 1; - } -} - -void sampleCompBot(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - vertexArray* rightChain, - Int rightEnd, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream) -{ - - if(down_leftCornerWhere == 1 && down_rightCornerWhere == 1) //the bot is botVertex with possible grid points - { - - leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - botVertex, - pStream); - return; - } - else if(down_leftCornerWhere != 0) - { - - Real* tempBot; - Int tempRightEnd; - if(down_leftCornerWhere == 1){ - tempRightEnd = rightEnd; - tempBot = botVertex; - } - else - { - tempRightEnd = down_leftCornerIndex-1; - tempBot = rightChain->getVertex(down_leftCornerIndex); - } - - sampleBotRightWithGridLine(tempBot, - rightChain, - tempRightEnd, - down_rightCornerIndex, - rightGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - pStream); - } - else if(down_rightCornerWhere != 2) - { - - Real* tempBot; - Int tempLeftEnd; - if(down_rightCornerWhere == 1){ - tempLeftEnd = leftEnd; - tempBot = botVertex; - } - else //right corner is on left chain - { - tempLeftEnd = down_rightCornerIndex-1; - tempBot = leftChain->getVertex(down_rightCornerIndex); - } - - - sampleBotLeftWithGridLine(tempBot, leftChain, tempLeftEnd, down_leftCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - pStream); - - } - else //down_leftCornereWhere == 0, down_rightCornerwhere == 2 - { - sampleCompBotSimple(botVertex, - leftChain, - leftEnd, - rightChain, - rightEnd, - leftGridChain, - rightGridChain, - gridIndex, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream); - - return; - -#ifdef NOT_REACHABLE - //the following code is trying to do some optimization, but not quite working. so it is not reachable, but leave it here for reference - Int sep_left, sep_right; - if(findBotSeparator(leftChain, leftEnd, down_leftCornerIndex, - rightChain, rightEnd, down_rightCornerIndex, - sep_left, sep_right) - )//separator exiosts - { - - if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex) && - rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex)) - { - Int gridSep; - Int segLeftMono, segLeftPass, segRightMono, segRightPass; - findBotLeftSegment(leftChain, - sep_left, - down_leftCornerIndex, - leftGridChain->get_u_value(gridIndex), - segLeftMono, - segLeftPass); - findBotRightSegment(rightChain, - sep_right, - down_rightCornerIndex, - rightGridChain->get_u_value(gridIndex), - segRightMono, - segRightPass); - if(leftChain->getVertex(segLeftMono)[1] <= rightChain->getVertex(segRightMono)[1]) - { - gridSep = rightGridChain->getUlineIndex(gridIndex); - while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftMono)[0]) - gridSep--; - } - else - { - gridSep = leftGridChain->getUlineIndex(gridIndex); - while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightMono)[0]) - gridSep++; - } - - sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono), - leftChain, - segLeftMono-1, - segLeftMono-1, - segLeftPass, - down_leftCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - gridSep, - pStream); - sampleBotRightWithGridLinePost(rightChain->getVertex(segRightMono), - rightChain, - segRightMono-1, - segRightMono-1, - segRightPass, - down_rightCornerIndex, - rightGridChain->getGrid(), - rightGridChain->getVlineIndex(gridIndex), - gridSep, - rightGridChain->getUlineIndex(gridIndex), - pStream); - Real tempTop[2]; - tempTop[0] = leftGridChain->getGrid()->get_u_value(gridSep); - tempTop[1] = leftGridChain->get_v_value(gridIndex); - monoTriangulationRecGen(tempTop, botVertex, - leftChain, segLeftMono, leftEnd, - rightChain, segRightMono, rightEnd, - pStream); - }//end if both sides have vertices inside the gridboundary points - else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex)) //left n right out - - { - Int segLeftMono, segLeftPass; - findBotLeftSegment(leftChain, - sep_left, - down_leftCornerIndex, - leftGridChain->get_u_value(gridIndex), - segLeftMono, - segLeftPass); - assert(segLeftPass <= sep_left); //make sure there is a point to the right of u. - monoTriangulation2(leftGridChain->get_vertex(gridIndex), - leftChain->getVertex(segLeftPass), - leftChain, - down_leftCornerIndex, - segLeftPass-1, - 1, //a increase chain - pStream); - stripOfFanLeft(leftChain, segLeftMono, segLeftPass, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - pStream,1 ); -/* - sampleBotLeftWithGridLinePost(leftChain->getVertex(segLeftMono), - leftChain, - segLeftMono-1, - segLeftMono-1, - segLeftPass, - down_leftCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - pStream); -*/ - - monoTriangulationRecGen(rightGridChain->get_vertex(gridIndex), - botVertex, - leftChain, segLeftMono, leftEnd, - rightChain, down_rightCornerIndex, rightEnd, - pStream); - }//end left in right out - else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex))//left out right in - { - Int segRightMono, segRightPass; - findBotRightSegment(rightChain, sep_right, down_rightCornerIndex, - rightGridChain->get_u_value(gridIndex), - segRightMono, - segRightPass); - - assert(segRightPass <= sep_right); //make sure there is a point to the left of u. - monoTriangulation2(rightGridChain->get_vertex(gridIndex), - rightChain->getVertex(segRightPass), - rightChain, - down_rightCornerIndex, - segRightPass-1, - 0, // a decrease chain - pStream); - - stripOfFanRight(rightChain, segRightMono, segRightPass, - rightGridChain->getGrid(), - rightGridChain->getVlineIndex(gridIndex), - leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), - pStream, 1); - - - monoTriangulationRecGen(leftGridChain->get_vertex(gridIndex), - botVertex, - leftChain, down_leftCornerIndex, leftEnd, - rightChain, segRightMono, rightEnd, - pStream); - - }//end left out right in - else //left out, right out - { - sampleCompBotSimple(botVertex, - leftChain, - leftEnd, - rightChain, - rightEnd, - leftGridChain, - rightGridChain, - gridIndex, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream); - - }//end leftout right out - }//end if separator exists - else //no separator - { - - sampleCompBotSimple(botVertex, - leftChain, - leftEnd, - rightChain, - rightEnd, - leftGridChain, - rightGridChain, - gridIndex, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream); - } -#endif - }//end id 0 2 -}//end if the functin - - -void sampleCompBotSimple(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - vertexArray* rightChain, - Int rightEnd, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream) -{ - //the plan is to use monotriangulation algorithm. - Int i,k; - Real* ActualTop; - Real* ActualBot; - Int ActualLeftStart, ActualLeftEnd; - Int ActualRightStart, ActualRightEnd; - - //creat an array to store the points on the grid line - gridWrap* grid = leftGridChain->getGrid(); - Int gridV = leftGridChain->getVlineIndex(gridIndex); - Int gridLeftU = leftGridChain->getUlineIndex(gridIndex); - Int gridRightU = rightGridChain->getUlineIndex(gridIndex); - Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1)); - assert(gridPoints); - - for(k=0, i=gridRightU; i>= gridLeftU; i--, k++) - { - gridPoints[k][0] = grid->get_u_value(i); - gridPoints[k][1] = grid->get_v_value(gridV); - } - - if(down_rightCornerWhere != 0) //rightCorner is not on lef - ActualLeftEnd = leftEnd; - else - ActualLeftEnd = down_rightCornerIndex-1; //down_rightCornerIndex will be th actualBot - - if(down_leftCornerWhere != 0) //left corner is not on let chian - ActualLeftStart = leftEnd+1; //meaning that there is no actual left section - else - ActualLeftStart = down_leftCornerIndex; - - vertexArray ActualLeftChain(max(0, ActualLeftEnd - ActualLeftStart +1) + gridRightU - gridLeftU +1); - - for(i=0; igetVertex(i)); - - //determine ActualRightStart - if(down_rightCornerWhere != 2) //right is not on right - ActualRightStart = rightEnd +1; //meaning no section on right - else - ActualRightStart = down_rightCornerIndex; - - //determine actualrightEnd - if(down_leftCornerWhere != 2) //left is not on right - { - - ActualRightEnd = rightEnd; - } - else //left corner is on right - { - ActualRightEnd = down_leftCornerIndex-1; //down_leftCornerIndex will be the bot - - } - - //actual bot - if(down_rightCornerWhere == 2) - { - if(down_leftCornerWhere == 2) - ActualBot = rightChain->getVertex(down_leftCornerIndex); - else - ActualBot = botVertex; - } - else if(down_rightCornerWhere == 1) //right corner bot - ActualBot = botVertex; - else //down_rightCornerWhere == 0 - ActualBot = leftChain->getVertex(down_rightCornerIndex); - - ActualTop = gridPoints[0]; -/* -printf("in bot simple, actual leftChain is \n"); -ActualLeftChain.print(); -printf("Actual Top = %f,%f\n", ActualTop[0],ActualTop[1]); -printf("Actual Bot = %f,%f\n", ActualBot[0],ActualBot[1]); -printf("Actual right start = %i, end=%i\n",ActualRightStart, ActualRightEnd); -*/ - if(rightChain->getVertex(ActualRightStart)[1] == ActualTop[1]) - monoTriangulationRecGenOpt(rightChain->getVertex(ActualRightStart), - ActualBot, - &ActualLeftChain, - 0, - ActualLeftChain.getNumElements()-1, - rightChain, - ActualRightStart+1, - ActualRightEnd, - pStream); - else - monoTriangulationRecGenOpt(ActualTop, ActualBot, - &ActualLeftChain, - 1, //the first one is the top vertex - ActualLeftChain.getNumElements()-1, - rightChain, - ActualRightStart, - ActualRightEnd, - pStream); - free(gridPoints); -} - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.h deleted file mode 100644 index 7b982794c0..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompBot.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLECOMPBOT_H -#define _SAMPLECOMPBOT_H - -#include "sampleMonoPoly.h" - -void findBotLeftSegment(vertexArray* leftChain, - Int leftEnd, - Int leftCorner, - Real u, - Int& ret_index_mono, - Int& ret_index_pass); - -void findBotRightSegment(vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - Real u, - Int& ret_index_mono, - Int& ret_index_pass); - - -void sampleBotRightWithGridLinePost(Real* botVertex, - vertexArray* rightChain, - Int rightEnd, - Int segIndexMono, - Int segIndexPass, - Int rightCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream); - - -void sampleBotRightWithGridLine(Real* botVertex, - vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream); - - -void sampleBotLeftWithGridLinePost(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - Int segIndexMono, - Int segIndexPass, - Int leftCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream); - - -void sampleBotLeftWithGridLine(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - Int leftCorner, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream); - - -Int findBotSeparator(vertexArray* leftChain, - Int leftEnd, - Int leftCorner, - vertexArray* rightChain, - Int rightEnd, - Int rightCorner, - Int& ret_sep_left, - Int& ret_sep_right); - -void sampleCompBot(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - vertexArray* rightChain, - Int rightEnd, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream); - -void sampleCompBotSimple(Real* botVertex, - vertexArray* leftChain, - Int leftEnd, - vertexArray* rightChain, - Int rightEnd, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream); - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.cc deleted file mode 100644 index d01e50018b..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.cc +++ /dev/null @@ -1,644 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "gluos.h" -#include "glimports.h" -#include "zlassert.h" -#include "sampleCompRight.h" - -#define max(a,b) ((a>b)? a:b) -#define min(a,b) ((a>b)? b:a) - - - -#ifdef NOT_TAKEOUT - -/*notice that we need leftChain because the - *corners could be on the leftChain. - */ -void sampleCompRight(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, Int rightEndIndex, - gridBoundaryChain* rightGridChain, - Int gridIndex1, Int gridIndex2, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - Int down_rightCornerWhere, - Int down_rightCornerIndex, - primStream* pStream) -{ - /*find out whether there is a trim vertex which is - *inbetween the top and bot grid lines or not. - */ - Int midIndex1; - Int midIndex2; - Int gridMidIndex1 = 0, gridMidIndex2 = 0; - //midIndex1: array[i] <= v, array[i+1] > v - //midIndex2: array[i] >= v, array[i+1] < v - midIndex1 = rightChain->findIndexBelowGen(rightGridChain->get_v_value(gridIndex1), - rightStartIndex, - rightEndIndex); - midIndex2 = -1; //initilization - if(midIndex1 <= rightEndIndex && gridIndex1 < gridIndex2) - if(rightChain->getVertex(midIndex1)[1] >= rightGridChain->get_v_value(gridIndex2)) - { - //midIndex2 must exist: - midIndex2 = rightChain->findIndexAboveGen(rightGridChain->get_v_value(gridIndex2), - midIndex1, //midIndex1<=midIndex2 - rightEndIndex); - //find gridMidIndex1 so that either it=gridIndex1 when the gridline is - // at the same height as trim vertex midIndex1, or it is the last one - //which is strictly above midIndex1. - { - Real temp = rightChain->getVertex(midIndex1)[1]; - if(rightGridChain->get_v_value(gridIndex1) == temp) - gridMidIndex1 = gridIndex1; - else - { - gridMidIndex1 = gridIndex1; - while(rightGridChain->get_v_value(gridMidIndex1) > temp) - gridMidIndex1++; - gridMidIndex1--; - } - }//end of find gridMindIndex1 - //find gridMidIndex2 so that it is the (first one below or equal - //midIndex) last one above or equal midIndex2 - { - Real temp = rightChain->getVertex(midIndex2)[1]; - for(gridMidIndex2 = gridMidIndex1+1; gridMidIndex2 <= gridIndex2; gridMidIndex2++) - if(rightGridChain->get_v_value(gridMidIndex2) <= temp) - break; - - assert(gridMidIndex2 <= gridIndex2); - }//end of find gridMidIndex2 - } - - - - //to interprete the corner information - Real* cornerTop; - Real* cornerBot; - Int cornerRightStart; - Int cornerRightEnd; - Int cornerLeftUpEnd; - Int cornerLeftDownStart; - if(up_rightCornerWhere == 2) //right corner is on right chain - { - cornerTop = rightChain->getVertex(up_rightCornerIndex); - cornerRightStart = up_rightCornerIndex+1; - cornerLeftUpEnd = -1; //no left - } - else if(up_rightCornerWhere == 1) //right corner is on top - { - cornerTop = topVertex; - cornerRightStart = rightStartIndex; - cornerLeftUpEnd = -1; //no left - } - else //right corner is on left chain - { - cornerTop = topVertex; - cornerRightStart = rightStartIndex; - cornerLeftUpEnd = up_rightCornerIndex; - } - - if(down_rightCornerWhere == 2) //right corner is on right chan - { - cornerBot = rightChain->getVertex(down_rightCornerIndex); - cornerRightEnd = down_rightCornerIndex-1; - cornerLeftDownStart = leftEndIndex+1; //no left - } - else if (down_rightCornerWhere == 1) //right corner is at bot - { - cornerBot = botVertex; - cornerRightEnd = rightEndIndex; - cornerLeftDownStart = leftEndIndex+1; //no left - } - else //right corner is on the left chain - { - cornerBot = botVertex; - cornerRightEnd = rightEndIndex; - cornerLeftDownStart = down_rightCornerIndex; - } - - //sample - if(midIndex2 >= 0) //there is a trm point between grid lines - { - - sampleRightSingleTrimEdgeRegionGen(cornerTop, rightChain->getVertex(midIndex1), - rightChain, - cornerRightStart, - midIndex1-1, - rightGridChain, - gridIndex1, - gridMidIndex1, - leftChain, - leftStartIndex, - cornerLeftUpEnd, - 0, //no left down section, - -1, - pStream); - - sampleRightSingleTrimEdgeRegionGen(rightChain->getVertex(midIndex2), - cornerBot, - rightChain, - midIndex2+1, - cornerRightEnd, - rightGridChain, - gridMidIndex2, - gridIndex2, - leftChain, - 0, //no left up section - -1, - cornerLeftDownStart, - leftEndIndex, - pStream); - - sampleRightStripRecF(rightChain, - midIndex1, - midIndex2, - rightGridChain, - gridMidIndex1, - gridMidIndex2, - pStream); - - } - else - { - sampleRightSingleTrimEdgeRegionGen(cornerTop, cornerBot, - rightChain, - cornerRightStart, - cornerRightEnd, - rightGridChain, - gridIndex1, - gridIndex2, - leftChain, - leftStartIndex, - cornerLeftUpEnd, - cornerLeftDownStart, - leftEndIndex, - pStream); - } -} - -void sampleRightSingleTrimEdgeRegionGen(Real topVertex[2], Real botVertex[2], - vertexArray* rightChain, - Int rightStart, - Int rightEnd, - gridBoundaryChain* gridChain, - Int gridBeginIndex, - Int gridEndIndex, - vertexArray* leftChain, - Int leftUpBegin, - Int leftUpEnd, - Int leftDownBegin, - Int leftDownEnd, - primStream* pStream) -{ - Int i,k; - /*creat an array to store all the up and down secments of the left chain, - *and the right end grid points - * - *although vertex array is a dynamic array, but to gain efficiency, - *it is better to initiliza the exact array size - */ - vertexArray vArray(gridEndIndex-gridBeginIndex+1 + - max(0,leftUpEnd - leftUpBegin+1)+ - max(0,leftDownEnd - leftDownBegin+1)); - //append the vertices on the up section of the left chain - for(i=leftUpBegin; i<= leftUpEnd; i++) - vArray.appendVertex(leftChain->getVertex(i)); - - //append the vertices of the right extremal grid points, - //and at the same time, perform triangulation for the stair cases - vArray.appendVertex(gridChain->get_vertex(gridBeginIndex)); - - for(k=1, i=gridBeginIndex+1; i<= gridEndIndex; i++, k++) - { - vArray.appendVertex(gridChain->get_vertex(i)); - - //output the fan of the grid points of the (i)th and (i-1)th grid line. - gridChain->rightEndFan(i, pStream); - } - - //append all the vertices on the down section of the left chain - for(i=leftDownBegin; i<= leftDownEnd; i++) - vArray.appendVertex(leftChain->getVertex(i)); - monoTriangulationRecGen(topVertex, botVertex, - &vArray, 0, vArray.getNumElements()-1, - rightChain, rightStart, rightEnd, - pStream); -} - -void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], - gridBoundaryChain* gridChain, - Int beginIndex, - Int endIndex, - primStream* pStream) -{ - Int i,k; - vertexArray vArray(endIndex-beginIndex+1); - vArray.appendVertex(gridChain->get_vertex(beginIndex)); - for(k=1, i=beginIndex+1; i<= endIndex; i++, k++) - { - vArray.appendVertex(gridChain->get_vertex(i)); - //output the fan of the grid points of the (i)_th and i-1th gridLine - gridChain->rightEndFan(i, pStream); - } - monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, - 1, //increase chain (to the left) - pStream); -} - - -/*the gridlines from rightGridChainStartIndex to - *rightGridChainEndIndex are assumed to form a - *connected componenet - *the trm vertex of topRightIndex is assumed to be below - *or equal the first gridLine, and the trm vertex of - *botRightIndex is assumed to be above or equal the last gridline - **there could be multipe trm vertices equal to the last gridline, but - **only one could be equal to top gridline. shape: ____| (recall that - **for left chain recF, we allow shape: |---- - *if botRightIndex= topRightIndex, there is at least one triangles to - *output - */ -void sampleRightStripRecF(vertexArray* rightChain, - Int topRightIndex, - Int botRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - Int rightGridChainEndIndex, - primStream* pStream - ) -{ - - //sstop conditionL: if topRightIndex > botRightIndex, then stop - if(topRightIndex > botRightIndex) - return; - - //if there is only one grid line, return - if(rightGridChainStartIndex >= rightGridChainEndIndex) - return; - - - assert(rightChain->getVertex(topRightIndex)[1] <= rightGridChain->get_v_value(rightGridChainStartIndex) && - rightChain->getVertex(botRightIndex)[1] >= rightGridChain->get_v_value(rightGridChainEndIndex)); - - //firstfind the first trim vertex which is strictly below the second top - //grid line: index1. - Real secondGridChainV = rightGridChain->get_v_value(rightGridChainStartIndex+1); - Int index1 = topRightIndex; - while(rightChain->getVertex(index1)[1] >= secondGridChainV){ - index1++; - if(index1 > botRightIndex) - break; - } - //now rightChain->getVertex(index1-1)[1] >= secondGridChainV and - //rightChain->getVertex(index1)[1] < secondGridChainV and - //we should include index1-1 to perform a gridStep - index1--; - - //now we have rightChain->getVertex(index1)[1] >= secondGridChainV, and - //rightChain->getVertex(index1+1)[1] < secondGridChainV - sampleRightOneGridStep(rightChain, topRightIndex, index1, rightGridChain, rightGridChainStartIndex, pStream); - - //if rightChain->getVertex(index1)[1] ==secondGridChainV then we can - //recurvesively to the rest - if(rightChain->getVertex(index1)[1] == secondGridChainV) - { - - - sampleRightStripRecF(rightChain, index1, botRightIndex, rightGridChain, rightGridChainStartIndex+1, rightGridChainEndIndex, pStream); - } - else if(index1 < botRightIndex) - { - //otherwise, we have rightChain->getVertex(index1)[1] > secondV - //let the next trim vertex be nextTrimVertex, (which should be strictly - //below the second grid line). Find the last grid line index2 which is STRICTLY ABOVE - //nextTrimVertex. - //sample one trm edge region. - Real *uppervert, *lowervert; - uppervert = rightChain->getVertex(index1); - lowervert = rightChain->getVertex(index1+1); //okay since index1get_v_value(index2) > lowervert[1]) - { - index2++; - if(index2 > rightGridChainEndIndex) - break; - } - index2--; - - sampleRightSingleTrimEdgeRegion(uppervert, lowervert, rightGridChain, rightGridChainStartIndex+1, index2, pStream); - - //recursion - sampleRightStripRecF(rightChain, index1+1, botRightIndex, rightGridChain, index2, rightGridChainEndIndex, pStream); - } -} - -//the degenerate case of sampleRightOneGridStep -void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, - Int beginRightIndex, - Int endRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - primStream* pStream) -{ - /*since there is no middle, there is at most one point which is on the - *second grid line, there could be multiple points on the first (top) - *grid line. - */ - rightGridChain->rightEndFan(rightGridChainStartIndex+1, pStream); - monoTriangulation2(rightGridChain->get_vertex(rightGridChainStartIndex), - rightGridChain->get_vertex(rightGridChainStartIndex+1), - rightChain, - beginRightIndex, - endRightIndex, - 0, //decrease chain - pStream); -} - -//sampling the right area in between two grid lines -//shape: _________| -void sampleRightOneGridStep(vertexArray* rightChain, - Int beginRightIndex, - Int endRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - primStream* pStream) -{ - if(checkMiddle(rightChain, beginRightIndex, endRightIndex, - rightGridChain->get_v_value(rightGridChainStartIndex), - rightGridChain->get_v_value(rightGridChainStartIndex+1))<0) - { - sampleRightOneGridStepNoMiddle(rightChain, beginRightIndex, endRightIndex, rightGridChain, rightGridChainStartIndex, pStream); - return; - } - - //copy into a polygn - { - directedLine* poly = NULL; - sampledLine* sline; - directedLine* dline; - gridWrap* grid = rightGridChain->getGrid(); - float vert1[2]; - float vert2[2]; - Int i; - - Int innerInd = rightGridChain->getInnerIndex(rightGridChainStartIndex+1); - Int upperInd = rightGridChain->getUlineIndex(rightGridChainStartIndex); - Int lowerInd = rightGridChain->getUlineIndex(rightGridChainStartIndex+1); - Real upperV = rightGridChain->get_v_value(rightGridChainStartIndex); - Real lowerV = rightGridChain->get_v_value(rightGridChainStartIndex+1); - - //the upper gridline - vert1[1]=vert2[1]=upperV; - for(i=upperInd; - i>innerInd; - i--) - { - vert1[0]=grid->get_u_value(i); - vert2[0]=grid->get_u_value(i-1); - sline = new sampledLine(vert1, vert2); - dline = new directedLine(INCREASING, sline); - if(poly == NULL) - poly = dline; - else - poly->insert(dline); - } - - //the vertical grid line segment - vert1[0]=vert2[0] = grid->get_u_value(innerInd); - vert1[1]=upperV; - vert2[1]=lowerV; - sline=new sampledLine(vert1, vert2); - dline=new directedLine(INCREASING, sline); - if(poly == NULL) - poly = dline; - else - poly->insert(dline); - - //the lower grid line - vert1[1]=vert2[1]=lowerV; - for(i=innerInd; iget_u_value(i); - vert2[0] = grid->get_u_value(i+1); - sline = new sampledLine(vert1, vert2); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - - //the edge connecting lower grid to right chain - vert1[0]=grid->get_u_value(lowerInd); - sline = new sampledLine(vert1, rightChain->getVertex(endRightIndex)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - - - //the right Chain - for(i=endRightIndex; i>beginRightIndex; i--) - { - sline = new sampledLine(rightChain->getVertex(i), rightChain->getVertex(i-1)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - - //the edge connecting right chain with upper grid - vert2[1]=upperV; - vert2[0]=grid->get_u_value(upperInd); - sline = new sampledLine(rightChain->getVertex(beginRightIndex), vert2); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - monoTriangulationOpt(poly, pStream); - //clean up - poly->deleteSinglePolygonWithSline(); - - return; - } - - //this following code cannot be reached, but leave it for debuggig purpose. - Int i; - //find the maximal U-monotone chain of beginRightIndex, beginRightIndex+1,... - i=beginRightIndex; - Real prevU = rightChain->getVertex(i)[0]; - for(i=beginRightIndex+1; i<= endRightIndex; i++){ - Real thisU = rightChain->getVertex(i)[0]; - if(thisU < prevU) - prevU = thisU; - else - break; - } - //from beginRightIndex to i-1 is strictly U-monotne - //if(i-1==beginRightIndex and the vertex of rightchain is on the first - //gridline, then we should use 2 vertices on the right chain. Of we only - //use one (begin), we would output degenrate triangles. - if(i-1 == beginRightIndex && rightChain->getVertex(beginRightIndex)[1] == rightGridChain->get_v_value(rightGridChainStartIndex)) - i++; - - Int j = endRightIndex -1; - if(rightGridChain->getInnerIndex(rightGridChainStartIndex+1) < rightGridChain->getUlineIndex(rightGridChainStartIndex+1)) - { - j = rightChain->findDecreaseChainFromEnd(i-1/*beginRightIndex*/, endRightIndex); - Int temp = endRightIndex; - //now from j+1 to end is strictly U-monotone. - //if j+1 is on the last grid line, then we wat to skip to the vertex - //whcih is strictly above the second grid line. This vertex must exist - //since there is a middle vertex - if(j+1 == endRightIndex) - { - while(rightChain->getVertex(j+1)[1] == rightGridChain->get_v_value(rightGridChainStartIndex+1)) - j--; - - monoTriangulation2(rightChain->getVertex(j+1), - rightGridChain->get_vertex(rightGridChainStartIndex+1), - rightChain, - j+2, - endRightIndex, - 0, //a decrease chain - pStream); - - temp = j+1; - } - - stripOfFanRight(rightChain, temp, j+1, rightGridChain->getGrid(), - rightGridChain->getVlineIndex(rightGridChainStartIndex+1), - rightGridChain->getInnerIndex(rightGridChainStartIndex+1), - rightGridChain->getUlineIndex(rightGridChainStartIndex+1), - pStream, - 0 //the grid line is below the trim line - ); - - } - - - stripOfFanRight(rightChain, i-1, beginRightIndex, rightGridChain->getGrid(), - rightGridChain->getVlineIndex(rightGridChainStartIndex), - rightGridChain->getInnerIndex(rightGridChainStartIndex+1), - rightGridChain->getUlineIndex(rightGridChainStartIndex), - pStream, - 1 //the grid line is above the trm lines - ); - - //monotone triangulate the remaining rightchain together with the - //two vertices on the two grid v-lines - Real vert[2][2]; - vert[0][0] = vert[1][0] = rightGridChain->getInner_u_value(rightGridChainStartIndex+1); - vert[0][1] = rightGridChain->get_v_value(rightGridChainStartIndex); - vert[1][1] = rightGridChain->get_v_value(rightGridChainStartIndex+1); - - monoTriangulation2(&vert[0][0], - &vert[1][0], - rightChain, - i-1, - j+1, - 0, ///a decreae chain - pStream); -} - -#endif - -void stripOfFanRight(vertexArray* rightChain, - Int largeIndex, - Int smallIndex, - gridWrap* grid, - Int vlineIndex, - Int ulineSmallIndex, - Int ulineLargeIndex, - primStream* pStream, - Int gridLineUp /*1 if the grid line is above the trim lines*/ - ) -{ - assert(largeIndex >= smallIndex); - - Real grid_v_value; - grid_v_value = grid->get_v_value(vlineIndex); - - Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1)); - assert(trimVerts); - - - Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1)); - assert(gridVerts); - - Int k,i; - if(! gridLineUp) /*trim line is above grid line, so trim vertices are going right when index increases*/ - for(k=0, i=smallIndex; i<=largeIndex; i++, k++) - { - trimVerts[k][0] = rightChain->getVertex(i)[0]; - trimVerts[k][1] = rightChain->getVertex(i)[1]; - } - else - for(k=0, i=largeIndex; i>=smallIndex; i--, k++) - { - trimVerts[k][0] = rightChain->getVertex(i)[0]; - trimVerts[k][1] = rightChain->getVertex(i)[1]; - } - - for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++) - { - gridVerts[k][0] = grid->get_u_value(i); - gridVerts[k][1] = grid_v_value; - } - - if(gridLineUp) - triangulateXYMono( - ulineLargeIndex-ulineSmallIndex+1, gridVerts, - largeIndex-smallIndex+1, trimVerts, - pStream); - else - triangulateXYMono(largeIndex-smallIndex+1, trimVerts, - ulineLargeIndex-ulineSmallIndex+1, gridVerts, - pStream); - free(trimVerts); - free(gridVerts); -} - - - - - - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.h deleted file mode 100644 index 4670b87ca8..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompRight.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLECOMPRIGHT_H -#define _SAMPLECOMPRIGHT_H - -#define NOT_TAKEOUT - -#include "sampleMonoPoly.h" -void stripOfFanRight(vertexArray* rightChain, - Int largeIndex, - Int smallIndex, - gridWrap* grid, - Int vlineIndex, - Int ulineSmallIndex, - Int ulineLargeIndex, - primStream* pStream, - Int gridLineUp /*1 if grid line is above the trim lines */ - ); - -#ifdef NOT_TAKEOUT -void sampleRightStripRecF(vertexArray* rightChain, - Int topRightIndex, - Int botRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - Int rightGridChainEndIndex, - primStream* pStream - ); -//the degenerate case of sampleRightOneGridStep -void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, - Int beginRightIndex, - Int endRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - primStream* pStream); -//sampling the right area in between two grid lines -//shape: _________| -void sampleRightOneGridStep(vertexArray* rightChain, - Int beginRightIndex, - Int endRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - primStream* pStream); -void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], - gridBoundaryChain* gridChain, - Int beginIndex, - Int endIndex, - primStream* pStream); -//the degenerate case of sampleRightOneGridStep -void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, - Int beginRightIndex, - Int endRightIndex, - gridBoundaryChain* rightGridChain, - Int rightGridChainStartIndex, - primStream* pStream); - -void sampleCompRight(Real* topVertex, Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, Int rightEndIndex, - gridBoundaryChain* rightGridChain, - Int gridIndex1, Int gridIndex2, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int down_leftCornerWhere, - Int down_leftCornerIndex, - primStream* pStream); - -void sampleRightSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], - vertexArray* rightChain, - Int rightStart, - Int rightEnd, - gridBoundaryChain* gridChain, - Int gridBegindex, - Int gridEndIndex, - vertexArray* leftChain, - Int leftUpBegin, - Int leftUpEnd, - Int leftDownBegin, - Int leftDownEnd, - primStream* pStream); -#endif - -#endif - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.cc deleted file mode 100644 index b7b929623a..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.cc +++ /dev/null @@ -1,1030 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include -#include "zlassert.h" -#include "sampleCompTop.h" -#include "sampleCompRight.h" - -#define max(a,b) ((a>b)? a:b) - -//return : index_small, and index_large, -//from [small, large] is strictly U-monotne, -//from [large+1, end] is = u -//if eveybody is = leftStart; i--) - { - if(leftChain->getVertex(i)[0] >= u) - break; - } - ret_index_large = i; - if(ret_index_large >= leftStart) - { - for(i=ret_index_large; i>leftStart; i--) - { - if(leftChain->getVertex(i-1)[0] <= leftChain->getVertex(i)[0]) - break; - } - ret_index_small = i; - } -} - -void findTopRightSegment(vertexArray* rightChain, - Int rightStart, - Int rightEnd, - Real u, - Int& ret_index_small, - Int& ret_index_large) -{ - Int i; - assert(rightStart<=rightEnd); - for(i=rightEnd; i>=rightStart; i--) - { - if(rightChain->getVertex(i)[0] <= u) - break; - } - ret_index_large = i; - if(ret_index_large >= rightStart) - { - for(i=ret_index_large; i>rightStart;i--) - { - if(rightChain->getVertex(i-1)[0] >= rightChain->getVertex(i)[0]) - break; - } - ret_index_small = i; - } -} - - -void sampleTopRightWithGridLinePost(Real* topVertex, - vertexArray* rightChain, - Int rightStart, - Int segIndexSmall, - Int segIndexLarge, - Int rightEnd, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - //the possible section which is to the right of rightU - if(segIndexLarge < rightEnd) - { - Real *tempTop; - if(segIndexLarge >= rightStart) - tempTop = rightChain->getVertex(segIndexLarge); - else - tempTop = topVertex; - Real tempBot[2]; - tempBot[0] = grid->get_u_value(rightU); - tempBot[1] = grid->get_v_value(gridV); -monoTriangulationRecGenOpt(tempTop, tempBot, - NULL, 1,0, - rightChain, segIndexLarge+1, rightEnd, - pStream); -/* - monoTriangulation2(tempTop, tempBot, - rightChain, - segIndexLarge+1, - rightEnd, - 0, //a decrease chian - pStream); -*/ - - } - - //the possible section which is strictly Umonotone - if(segIndexLarge >= rightStart) - { - stripOfFanRight(rightChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0); - Real tempBot[2]; - tempBot[0] = grid->get_u_value(leftU); - tempBot[1] = grid->get_v_value(gridV); - monoTriangulation2(topVertex, tempBot, rightChain, rightStart, segIndexSmall, 0, pStream); - } - else //the topVertex forms a fan with the grid points - grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); -} - -void sampleTopRightWithGridLine(Real* topVertex, - vertexArray* rightChain, - Int rightStart, - Int rightEnd, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream - ) -{ - //if right chian is empty, then there is only one topVertex with one grid line - if(rightEnd < rightStart){ - grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); - return; - } - - Int segIndexSmall, segIndexLarge; - findTopRightSegment(rightChain, - rightStart, - rightEnd, - grid->get_u_value(rightU), - segIndexSmall, - segIndexLarge - ); - sampleTopRightWithGridLinePost(topVertex, rightChain, - rightStart, - segIndexSmall, - segIndexLarge, - rightEnd, - grid, - gridV, - leftU, - rightU, - pStream); -} - - -void sampleTopLeftWithGridLinePost(Real* topVertex, - vertexArray* leftChain, - Int leftStart, - Int segIndexSmall, - Int segIndexLarge, - Int leftEnd, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream) -{ - //the possible section which is to the left of leftU - - if(segIndexLarge < leftEnd) - { - Real *tempTop; - if(segIndexLarge >= leftStart) - tempTop = leftChain->getVertex(segIndexLarge); - else - tempTop = topVertex; - Real tempBot[2]; - tempBot[0] = grid->get_u_value(leftU); - tempBot[1] = grid->get_v_value(gridV); - - monoTriangulation2(tempTop, tempBot, - leftChain, - segIndexLarge+1, - leftEnd, - 1, //a increase chian - pStream); - } - - //the possible section which is strictly Umonotone - if(segIndexLarge >= leftStart) - { - //if there are grid points which are to the right of topV, - //then we should use topVertex to form a fan with these points to - //optimize the triangualtion - int do_optimize=1; - if(topVertex[0] >= grid->get_u_value(rightU)) - do_optimize = 0; - else - { - //we also have to make sure that topVertex are the right most vertex - //on the chain. - int i; - for(i=leftStart; i<=segIndexSmall; i++) - if(leftChain->getVertex(i)[0] >= topVertex[0]) - { - do_optimize = 0; - break; - } - } - - if(do_optimize) - { - //find midU so that grid->get_u_value(midU) >= topVertex[0] - //and grid->get_u_value(midU-1) < topVertex[0] - int midU=rightU; - while(grid->get_u_value(midU) >= topVertex[0]) - { - midU--; - if(midU < leftU) - break; - } - midU++; - - grid->outputFanWithPoint(gridV, midU, rightU, topVertex, pStream); - stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, midU, pStream, 0); - Real tempBot[2]; - tempBot[0] = grid->get_u_value(midU); - tempBot[1] = grid->get_v_value(gridV); - monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); - } - else //not optimize - { - - stripOfFanLeft(leftChain, segIndexLarge, segIndexSmall, grid, gridV, leftU, rightU, pStream, 0); - Real tempBot[2]; - tempBot[0] = grid->get_u_value(rightU); - tempBot[1] = grid->get_v_value(gridV); - monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); - } - } - else //the topVertex forms a fan with the grid points - grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); -} - - -void sampleTopLeftWithGridLine(Real* topVertex, - vertexArray* leftChain, - Int leftStart, - Int leftEnd, - gridWrap* grid, - Int gridV, - Int leftU, - Int rightU, - primStream* pStream - ) -{ - Int segIndexSmall, segIndexLarge; - //if left chain is empty, then there is only one top vertex with one grid - // line - if(leftEnd < leftStart) { - grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); - return; - } - findTopLeftSegment(leftChain, - leftStart, - leftEnd, - grid->get_u_value(leftU), - segIndexSmall, - segIndexLarge - ); - sampleTopLeftWithGridLinePost(topVertex, - leftChain, - leftStart, - segIndexSmall, - segIndexLarge, - leftEnd, - grid, - gridV, - leftU, - rightU, - pStream); -} - - -//return 1 if saprator exits, 0 otherwise -Int findTopSeparator(vertexArray* leftChain, - Int leftStartIndex, - Int leftEndIndex, - vertexArray* rightChain, - Int rightStartIndex, - Int rightEndIndex, - Int& ret_sep_left, - Int& ret_sep_right) -{ - - Int oldLeftI, oldRightI, newLeftI, newRightI; - Int i,j,k; - Real leftMax /*= leftChain->getVertex(leftEndIndex)[0]*/; - Real rightMin /*= rightChain->getVertex(rightEndIndex)[0]*/; - if(leftChain->getVertex(leftEndIndex)[1] > rightChain->getVertex(rightEndIndex)[1]) //left higher - { - oldLeftI = leftEndIndex+1; - oldRightI = rightEndIndex; - leftMax = leftChain->getVertex(leftEndIndex)[0] - Real(1.0); //initilza to left of leftU - rightMin = rightChain->getVertex(rightEndIndex)[0]; - } - else - { - oldLeftI = leftEndIndex; - oldRightI = rightEndIndex+1; - leftMax = leftChain->getVertex(leftEndIndex)[0]; - rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0); - } - - //i: the current working leftChain index, - //j: the current working rightChain index, - //if left(i) is higher than right(j), then the two chains beloew right(j) are separated. - //else the two chains below left(i) are separeated. - i=leftEndIndex; - j=rightEndIndex; - while(1) - { - newLeftI = oldLeftI; - newRightI = oldRightI; - - if(i= rightStartIndex; k--) - { - if(rightChain->getVertex(k)[0] > leftMax) //no conflict - { - //update oldRightI if necessary - if(rightChain->getVertex(k)[0] < rightMin) - { - rightMin = rightChain->getVertex(k)[0]; - oldRightI = k; - } - } - else //there is a conflict - break; //the for-loop. below right(k-1) is seperated: oldLeftI, oldRightI. - } - break; //the while loop - } - else if(j= leftStartIndex; k--) - { - if(leftChain->getVertex(k)[0] < rightMin) //no conflict - { - //update oldLeftI if necessary - if(leftChain->getVertex(k)[0] > leftMax) - { - leftMax = leftChain->getVertex(k)[0]; - oldLeftI = k; - } - } - else //there is a conflict - break; //the for loop - } - break; //the while loop - } - else if(leftChain->getVertex(i)[1] > rightChain->getVertex(j)[1]) //left hgiher - { - if(leftChain->getVertex(i)[0] > leftMax) //update leftMax and newLeftI. - { - leftMax = leftChain->getVertex(i)[0]; - newLeftI = i; - } - for(k=j-1; k>= rightStartIndex; k--) //update rightMin and newRightI. - { - if(rightChain->getVertex(k)[1] > leftChain->getVertex(i)[1]) - break; - if(rightChain->getVertex(k)[0] < rightMin) - { - rightMin = rightChain->getVertex(k)[0]; - newRightI = k; - } - } - j = k; //next working j, since j will be higher than i in next loop - if(leftMax >= rightMin) //there is a conflict - break; - else //still no conflict - { - oldLeftI = newLeftI; - oldRightI = newRightI; - } - } - else //right higher - { - if(rightChain->getVertex(j)[0] < rightMin) - { - rightMin = rightChain->getVertex(j)[0]; - newRightI = j; - } - for(k=i-1; k>= leftStartIndex; k--) - { - if(leftChain->getVertex(k)[1] > rightChain->getVertex(j)[1]) - break; - if(leftChain->getVertex(k)[0] > leftMax) - { - leftMax = leftChain->getVertex(k)[0]; - newLeftI = k; - } - } - i = k; //next working i, since i will be higher than j next loop - - if(leftMax >= rightMin) //there is a conflict - break; - else //still no conflict - { - oldLeftI = newLeftI; - oldRightI = newRightI; - } - } - }//end of while loop - //now oldLeftI and oldRightI are the desired separeator index, notice that there are not necessarily valid - if(oldLeftI > leftEndIndex || oldRightI > rightEndIndex) - return 0; - else - { - ret_sep_left = oldLeftI; - ret_sep_right = oldRightI; - return 1; - } -} - - -void sampleCompTop(Real* topVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - primStream* pStream) -{ - if(up_leftCornerWhere == 1 && up_rightCornerWhere == 1) //the top is topVertex with possible grid points - { - leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - rightGridChain->getUlineIndex(gridIndex1), - topVertex, - pStream); - return; - } - - else if(up_leftCornerWhere != 0) - { - Real* tempTop; - Int tempRightStart; - if(up_leftCornerWhere == 1){ - tempRightStart = rightStartIndex; - tempTop = topVertex; - } - else - { - tempRightStart = up_leftCornerIndex+1; - tempTop = rightChain->getVertex(up_leftCornerIndex); - } - sampleTopRightWithGridLine(tempTop, rightChain, tempRightStart, up_rightCornerIndex, - rightGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - rightGridChain->getUlineIndex(gridIndex1), - pStream); - } - else if(up_rightCornerWhere != 2) - { - Real* tempTop; - Int tempLeftStart; - if(up_rightCornerWhere == 1) - { - tempLeftStart = leftStartIndex; - tempTop = topVertex; - } - else //0 - { - tempLeftStart = up_rightCornerIndex+1; - tempTop = leftChain->getVertex(up_rightCornerIndex); - } -/* - sampleTopLeftWithGridLine(tempTop, leftChain, tempLeftStart, up_leftCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - rightGridChain->getUlineIndex(gridIndex1), - pStream); -*/ - sampleCompTopSimple(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - } - else //up_leftCornerWhere == 0, up_rightCornerWhere == 2. - { - sampleCompTopSimple(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - return; -#ifdef NOT_REACHABLE //code is not reachable, for test purpose only - //the following code is trying to do some optimization, but not quite working, also see sampleCompBot.C: - Int sep_left, sep_right; - if(findTopSeparator(leftChain, - leftStartIndex, - up_leftCornerIndex, - rightChain, - rightStartIndex, - up_rightCornerIndex, - sep_left, - sep_right) - ) //separator exists - { - - if( leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1) && - rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1)) - { - Int gridSep; - Int segLeftSmall, segLeftLarge, segRightSmall, segRightLarge; - Int valid=1; //whether the gridStep is valid or not. - findTopLeftSegment(leftChain, - sep_left, - up_leftCornerIndex, - leftGridChain->get_u_value(gridIndex1), - segLeftSmall, - segLeftLarge); - findTopRightSegment(rightChain, - sep_right, - up_rightCornerIndex, - rightGridChain->get_u_value(gridIndex1), - segRightSmall, - segRightLarge); - if(leftChain->getVertex(segLeftSmall)[1] >= rightChain->getVertex(segRightSmall)[1]) - { - gridSep = rightGridChain->getUlineIndex(gridIndex1); - while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftSmall)[0]) - gridSep--; - if(segLeftSmallgetGrid()->get_u_value(gridSep) < leftChain->getVertex(segLeftSmall+1)[0]) - { - valid = 0; - } - } - else - { - gridSep = leftGridChain->getUlineIndex(gridIndex1); - while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightSmall)[0]) - gridSep++; - if(segRightSmallgetGrid()->get_u_value(gridSep) > rightChain->getVertex(segRightSmall+1)[0]) - { - valid = 0; - } - } - - if(! valid) - { - sampleCompTopSimple(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - } - else - { - sampleTopLeftWithGridLinePost(leftChain->getVertex(segLeftSmall), - leftChain, - segLeftSmall+1, - segLeftSmall+1, - segLeftLarge, - up_leftCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - gridSep, - pStream); - sampleTopRightWithGridLinePost(rightChain->getVertex(segRightSmall), - rightChain, - segRightSmall+1, - segRightSmall+1, - segRightLarge, - up_rightCornerIndex, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex1), - gridSep, - rightGridChain->getUlineIndex(gridIndex1), - pStream); - Real tempBot[2]; - tempBot[0] = leftGridChain->getGrid()->get_u_value(gridSep); - tempBot[1] = leftGridChain->get_v_value(gridIndex1); - monoTriangulationRecGen(topVertex, tempBot, - leftChain, leftStartIndex, segLeftSmall, - rightChain, rightStartIndex, segRightSmall, - pStream); - } - }//end if both sides have vetices inside the gridboundary points - else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1)) //left is in, right is nout - { - - Int segLeftSmall, segLeftLarge; - findTopLeftSegment(leftChain, - sep_left, - up_leftCornerIndex, - leftGridChain->get_u_value(gridIndex1), - segLeftSmall, - segLeftLarge); - assert(segLeftLarge >= sep_left); - monoTriangulation2(leftChain->getVertex(segLeftLarge), - leftGridChain->get_vertex(gridIndex1), - leftChain, - segLeftLarge+1, - up_leftCornerIndex, - 1, //a increase chain, - pStream); - - stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall, - leftGridChain->getGrid(), - leftGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - rightGridChain->getUlineIndex(gridIndex1), - pStream, 0); - - - monoTriangulationRecGen(topVertex, rightGridChain->get_vertex(gridIndex1), - leftChain, leftStartIndex, segLeftSmall, - rightChain, rightStartIndex, up_rightCornerIndex, - pStream); - }//end left in right out - else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1)) - { - Int segRightSmall, segRightLarge; - findTopRightSegment(rightChain, - sep_right, - up_rightCornerIndex, - rightGridChain->get_u_value(gridIndex1), - segRightSmall, - segRightLarge); - assert(segRightLarge>=sep_right); - monoTriangulation2(rightChain->getVertex(segRightLarge), - rightGridChain->get_vertex(gridIndex1), - rightChain, - segRightLarge+1, - up_rightCornerIndex, - 0, //a decrease chain - pStream); - stripOfFanRight(rightChain, segRightLarge, segRightSmall, - rightGridChain->getGrid(), - rightGridChain->getVlineIndex(gridIndex1), - leftGridChain->getUlineIndex(gridIndex1), - rightGridChain->getUlineIndex(gridIndex1), - pStream, 0); - - - monoTriangulationRecGen(topVertex, leftGridChain->get_vertex(gridIndex1), - leftChain, leftStartIndex, up_leftCornerIndex, - rightChain, rightStartIndex,segRightSmall, - pStream); - - }//end left out rigth in - else //left out , right out - { - - sampleCompTopSimple(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - }//end leftout, right out - }//end if separator exixts. - else //no separator - { - - sampleCompTopSimple(topVertex, - leftChain, - leftStartIndex, - rightChain, - rightStartIndex, - leftGridChain, - rightGridChain, - gridIndex1, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - pStream); - } -#endif - }//end if 0,2 -}//end if the function - - -static void sampleCompTopSimpleOpt(gridWrap* grid, - Int gridV, - Real* topVertex, Real* botVertex, - vertexArray* inc_chain, Int inc_current, Int inc_end, - vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream) -{ - if(gridV <= 0 || dec_endget_v_value(gridV+1) >= topVertex[1]) - { - monoTriangulationRecGenOpt(topVertex, botVertex, - inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, - pStream); - return; - } - Int i,j,k; - Real currentV = grid->get_v_value(gridV+1); - if(inc_chain->getVertex(inc_end)[1] <= currentV && - dec_chain->getVertex(dec_end)[1] < currentV) - { - //find i bottom up so that inc_chain[i]<= curentV and inc_chain[i-1] > currentV, - //find j botom up so that dec_chain[j] < currentV and dec_chain[j-1] >= currentV - for(i=inc_end; i >= inc_current; i--) - { - if(inc_chain->getVertex(i)[1] > currentV) - break; - } - i++; - for(j=dec_end; j >= dec_current; j--) - { - if(dec_chain->getVertex(j)[1] >= currentV) - break; - } - j++; - if(inc_chain->getVertex(i)[1] <= dec_chain->getVertex(j)[1]) - { - //find the k so that dec_chain[k][1] < inc_chain[i][1] - for(k=j; k<=dec_end; k++) - { - if(dec_chain->getVertex(k)[1] < inc_chain->getVertex(i)[1]) - break; - } - //we know that dec_chain[j][1] >= inc_chian[i][1] - //we know that dec_chain[k-1][1]>=inc_chain[i][1] - //we know that dec_chian[k][1] < inc_chain[i][1] - //find l in [j, k-1] so that dec_chain[l][0] 0 is closest to - // inc_chain[i] - int l; - Real tempI = Real(j); - Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]); - for(l=j+1; l<= k-1; l++) - { - if(fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]) - <= tempMin) - { - tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]); - tempI = (Real)l; - } - } - //inc_chain[i] and dec_chain[tempI] are connected. - monoTriangulationRecGenOpt(dec_chain->getVertex((int)tempI), - botVertex, - inc_chain, i, inc_end, - dec_chain, (int)(tempI+1), dec_end, - pStream); - //recursively do the rest - sampleCompTopSimpleOpt(grid, - gridV+1, - topVertex, inc_chain->getVertex(i), - inc_chain, inc_current, i-1, - dec_chain, dec_current, (int)tempI, - pStream); - } - else - { - //find the k so that inc_chain[k][1] <= dec_chain[j][1] - for(k=i; k<=inc_end; k++) - { - if(inc_chain->getVertex(k)[1] <= dec_chain->getVertex(j)[1]) - break; - } - //we know that inc_chain[i] > dec_chain[j] - //we know that inc_chain[k-1][1] > dec_chain[j][1] - //we know that inc_chain[k][1] <= dec_chain[j][1] - //so we find l between [i,k-1] so that - //inc_chain[l][0] is the closet to dec_chain[j][0] - int tempI = i; - int l; - Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]); - for(l=i+1; l<=k-1; l++) - { - if(fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]) <= tempMin) - { - tempMin = (Real)fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]); - tempI = l; - } - } - - //inc_chain[tempI] and dec_chain[j] are connected - - monoTriangulationRecGenOpt(inc_chain->getVertex(tempI), - botVertex, - inc_chain, tempI+1, inc_end, - dec_chain, j, dec_end, - pStream); - - //recurvesily do the rest - sampleCompTopSimpleOpt(grid, gridV+1, - topVertex, dec_chain->getVertex(j), - inc_chain, inc_current, tempI, - dec_chain, dec_current, j-1, - pStream); - } - } - else //go to the next higher gridV - { - sampleCompTopSimpleOpt(grid, - gridV+1, - topVertex, botVertex, - inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, - pStream); - } -} - -void sampleCompTopSimple(Real* topVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - primStream* pStream) -{ - //the plan is to use monotriangulation algortihm. - Int i,k; - Real* ActualTop; - Real* ActualBot; - Int ActualLeftStart, ActualLeftEnd; - Int ActualRightStart, ActualRightEnd; - - //creat an array to store the points on the grid line - gridWrap* grid = leftGridChain->getGrid(); - Int gridV = leftGridChain->getVlineIndex(gridIndex1); - Int gridLeftU = leftGridChain->getUlineIndex(gridIndex1); - Int gridRightU = rightGridChain->getUlineIndex(gridIndex1); - - Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1)); - assert(gridPoints); - - for(k=0, i=gridRightU; i>= gridLeftU; i--, k++) - { - gridPoints[k][0] = grid->get_u_value(i); - gridPoints[k][1] = grid->get_v_value(gridV); - } - - if(up_leftCornerWhere != 2) - ActualRightStart = rightStartIndex; - else - ActualRightStart = up_leftCornerIndex+1; //up_leftCornerIndex will be the ActualTop - - if(up_rightCornerWhere != 2) //right corner is not on right chain - ActualRightEnd = rightStartIndex-1; //meaning that there is no actual rigth section - else - ActualRightEnd = up_rightCornerIndex; - - vertexArray ActualRightChain(max(0, ActualRightEnd-ActualRightStart+1) + gridRightU-gridLeftU+1); - - for(i=ActualRightStart; i<= ActualRightEnd; i++) - ActualRightChain.appendVertex(rightChain->getVertex(i)); - for(i=0; igetVertex(up_rightCornerIndex); - else - ActualTop = topVertex; - } - else if(up_leftCornerWhere == 1) - ActualTop = topVertex; - else //up_leftCornerWhere == 2 - ActualTop = rightChain->getVertex(up_leftCornerIndex); - - ActualBot = gridPoints[gridRightU - gridLeftU]; - - - - - if(leftChain->getVertex(ActualLeftEnd)[1] == ActualBot[1]) - { -/* - monoTriangulationRecGenOpt(ActualTop, leftChain->getVertex(ActualLeftEnd), - leftChain, - ActualLeftStart, ActualLeftEnd-1, - &ActualRightChain, - 0, - ActualRightChain.getNumElements()-1, - pStream); -*/ - - sampleCompTopSimpleOpt(grid, gridV, - ActualTop, leftChain->getVertex(ActualLeftEnd), - leftChain, - ActualLeftStart, ActualLeftEnd-1, - &ActualRightChain, - 0, - ActualRightChain.getNumElements()-1, - pStream); - - } - else - { -/* - monoTriangulationRecGenOpt(ActualTop, ActualBot, leftChain, - ActualLeftStart, ActualLeftEnd, - &ActualRightChain, - 0, ActualRightChain.getNumElements()-2, //the last is the bot. - pStream); -*/ - - sampleCompTopSimpleOpt(grid, gridV, - ActualTop, ActualBot, leftChain, - ActualLeftStart, ActualLeftEnd, - &ActualRightChain, - 0, ActualRightChain.getNumElements()-2, //the last is the bot. - pStream); - - - } - - free(gridPoints); - -} - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.h deleted file mode 100644 index 95598d63a8..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleCompTop.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLECOMPTOP_H -#define _SAMPLECOMPTOP_H - -#include "sampleMonoPoly.h" - -void sampleCompTop(Real* topVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - primStream* pStream); - -void sampleCompTopSimple(Real* topVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int up_leftCornerWhere, - Int up_leftCornerIndex, - Int up_rightCornerWhere, - Int up_rightCornerIndex, - primStream* pStream); - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.cc deleted file mode 100644 index 051f241083..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.cc +++ /dev/null @@ -1,2427 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include "gluos.h" -#include -#include -#include - -#ifndef max -#define max(a,b) ((a>b)? a:b) -#endif -#ifndef min -#define min(a,b) ((a>b)? b:a) -#endif - -#include - -#include "glimports.h" -#include "zlassert.h" -#include "sampleMonoPoly.h" -#include "sampleComp.h" -#include "polyDBG.h" -#include "partitionX.h" - - -#define ZERO 0.00001 - -//#define MYDEBUG - -//#define SHORTEN_GRID_LINE -//see work/newtess/internal/test/problems - - -/*split a polygon so that each vertex correcpond to one edge - *the head of the first edge of the returned plygon must be the head of the first - *edge of the origianl polygon. This is crucial for the code in sampleMonoPoly function - */ - directedLine* polygonConvert(directedLine* polygon) -{ - int i; - directedLine* ret; - sampledLine* sline; - sline = new sampledLine(2); - sline->setPoint(0, polygon->getVertex(0)); - sline->setPoint(1, polygon->getVertex(1)); - ret=new directedLine(INCREASING, sline); - for(i=1; i<= polygon->get_npoints()-2; i++) - { - sline = new sampledLine(2); - sline->setPoint(0, polygon->getVertex(i)); - sline->setPoint(1, polygon->getVertex(i+1)); - ret->insert(new directedLine(INCREASING, sline)); - } - - for(directedLine *temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) - { - for(i=0; i<= temp->get_npoints()-2; i++) - { - sline = new sampledLine(2); - sline->setPoint(0, temp->getVertex(i)); - sline->setPoint(1, temp->getVertex(i+1)); - ret->insert(new directedLine(INCREASING, sline)); - } - } - return ret; -} - -void triangulateConvexPolyVertical(directedLine* topV, directedLine* botV, primStream *pStream) -{ - Int i,j; - Int n_leftVerts; - Int n_rightVerts; - Real** leftVerts; - Real** rightVerts; - directedLine* tempV; - n_leftVerts = 0; - for(tempV = topV; tempV != botV; tempV = tempV->getNext()) - { - n_leftVerts += tempV->get_npoints(); - } - n_rightVerts=0; - for(tempV = botV; tempV != topV; tempV = tempV->getNext()) - { - n_rightVerts += tempV->get_npoints(); - } - - Real2* temp_leftVerts = (Real2 *) malloc(sizeof(Real2) * n_leftVerts); - assert(temp_leftVerts); - Real2* temp_rightVerts = (Real2 *) malloc(sizeof(Real2) * n_rightVerts); - assert(temp_rightVerts); - - leftVerts = (Real**) malloc(sizeof(Real2*) * n_leftVerts); - assert(leftVerts); - rightVerts = (Real**) malloc(sizeof(Real2*) * n_rightVerts); - assert(rightVerts); - for(i=0; igetNext()) - { - for(j=1; jget_npoints(); j++) - { - leftVerts[i][0] = tempV->getVertex(j)[0]; - leftVerts[i][1] = tempV->getVertex(j)[1]; - i++; - } - } - n_leftVerts = i; - i=0; - for(tempV = topV->getPrev(); tempV != botV->getPrev(); tempV = tempV->getPrev()) - { - for(j=tempV->get_npoints()-1; j>=1; j--) - { - rightVerts[i][0] = tempV->getVertex(j)[0]; - rightVerts[i][1] = tempV->getVertex(j)[1]; - i++; - } - } - n_rightVerts = i; - triangulateXYMonoTB(n_leftVerts, leftVerts, n_rightVerts, rightVerts, pStream); - free(leftVerts); - free(rightVerts); - free(temp_leftVerts); - free(temp_rightVerts); -} - -void triangulateConvexPolyHoriz(directedLine* leftV, directedLine* rightV, primStream *pStream) -{ - Int i,j; - Int n_lowerVerts; - Int n_upperVerts; - Real2 *lowerVerts; - Real2 *upperVerts; - directedLine* tempV; - n_lowerVerts=0; - for(tempV = leftV; tempV != rightV; tempV = tempV->getNext()) - { - n_lowerVerts += tempV->get_npoints(); - } - n_upperVerts=0; - for(tempV = rightV; tempV != leftV; tempV = tempV->getNext()) - { - n_upperVerts += tempV->get_npoints(); - } - lowerVerts = (Real2 *) malloc(sizeof(Real2) * n_lowerVerts); - assert(n_lowerVerts); - upperVerts = (Real2 *) malloc(sizeof(Real2) * n_upperVerts); - assert(n_upperVerts); - i=0; - for(tempV = leftV; tempV != rightV; tempV = tempV->getNext()) - { - for(j=0; jget_npoints(); j++) - { - lowerVerts[i][0] = tempV->getVertex(j)[0]; - lowerVerts[i][1] = tempV->getVertex(j)[1]; - i++; - } - } - i=0; - for(tempV = leftV->getPrev(); tempV != rightV->getPrev(); tempV = tempV->getPrev()) - { - for(j=tempV->get_npoints()-1; j>=0; j--) - { - upperVerts[i][0] = tempV->getVertex(j)[0]; - upperVerts[i][1] = tempV->getVertex(j)[1]; - i++; - } - } - triangulateXYMono(n_upperVerts, upperVerts, n_lowerVerts, lowerVerts, pStream); - free(lowerVerts); - free(upperVerts); -} -void triangulateConvexPoly(directedLine* polygon, Int ulinear, Int vlinear, primStream* pStream) -{ - /*find left, right, top , bot - */ - directedLine* tempV; - directedLine* topV; - directedLine* botV; - directedLine* leftV; - directedLine* rightV; - topV = botV = polygon; - - for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) - { - if(compV2InY(topV->head(), tempV->head())<0) { - - topV = tempV; - } - if(compV2InY(botV->head(), tempV->head())>0) { - - botV = tempV; - } - } - //find leftV - for(tempV = topV; tempV != botV; tempV = tempV->getNext()) - { - if(tempV->tail()[0] >= tempV->head()[0]) - break; - } - leftV = tempV; - //find rightV - for(tempV = botV; tempV != topV; tempV = tempV->getNext()) - { - if(tempV->tail()[0] <= tempV->head()[0]) - break; - } - rightV = tempV; - if(vlinear) - { - triangulateConvexPolyHoriz( leftV, rightV, pStream); - } - else if(ulinear) - { - triangulateConvexPolyVertical(topV, botV, pStream); - } - else - { - if(DBG_is_U_direction(polygon)) - { - triangulateConvexPolyHoriz( leftV, rightV, pStream); - } - else - triangulateConvexPolyVertical(topV, botV, pStream); - } -} - -/*for debug purpose*/ -void drawCorners( - Real* topV, Real* botV, - vertexArray* leftChain, - vertexArray* rightChain, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int gridIndex2, - Int leftCornerWhere, - Int leftCornerIndex, - Int rightCornerWhere, - Int rightCornerIndex, - Int bot_leftCornerWhere, - Int bot_leftCornerIndex, - Int bot_rightCornerWhere, - Int bot_rightCornerIndex) -{ - Real* leftCornerV; - Real* rightCornerV; - Real* bot_leftCornerV; - Real* bot_rightCornerV; - - if(leftCornerWhere == 1) - leftCornerV = topV; - else if(leftCornerWhere == 0) - leftCornerV = leftChain->getVertex(leftCornerIndex); - else - leftCornerV = rightChain->getVertex(leftCornerIndex); - - if(rightCornerWhere == 1) - rightCornerV = topV; - else if(rightCornerWhere == 0) - rightCornerV = leftChain->getVertex(rightCornerIndex); - else - rightCornerV = rightChain->getVertex(rightCornerIndex); - - if(bot_leftCornerWhere == 1) - bot_leftCornerV = botV; - else if(bot_leftCornerWhere == 0) - bot_leftCornerV = leftChain->getVertex(bot_leftCornerIndex); - else - bot_leftCornerV = rightChain->getVertex(bot_leftCornerIndex); - - if(bot_rightCornerWhere == 1) - bot_rightCornerV = botV; - else if(bot_rightCornerWhere == 0) - bot_rightCornerV = leftChain->getVertex(bot_rightCornerIndex); - else - bot_rightCornerV = rightChain->getVertex(bot_rightCornerIndex); - - Real topGridV = leftGridChain->get_v_value(gridIndex1); - Real topGridU1 = leftGridChain->get_u_value(gridIndex1); - Real topGridU2 = rightGridChain->get_u_value(gridIndex1); - Real botGridV = leftGridChain->get_v_value(gridIndex2); - Real botGridU1 = leftGridChain->get_u_value(gridIndex2); - Real botGridU2 = rightGridChain->get_u_value(gridIndex2); - - glBegin(GL_LINE_STRIP); - glVertex2fv(leftCornerV); - glVertex2f(topGridU1, topGridV); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2fv(rightCornerV); - glVertex2f(topGridU2, topGridV); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2fv(bot_leftCornerV); - glVertex2f(botGridU1, botGridV); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2fv(bot_rightCornerV); - glVertex2f(botGridU2, botGridV); - glEnd(); - - -} - -void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain) -{ - Int i; - directedLine* tempV; - for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ - leftChain.appendVertex(topV->getVertex(i)); - } - for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) - { - for(i=0; i<=tempV->get_npoints()-2; i++){ - leftChain.appendVertex(tempV->getVertex(i)); - } - } - - for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - for(i=tempV->get_npoints()-2; i>=0; i--){ - rightChain.appendVertex(tempV->getVertex(i)); - } - } - for(i=botV->get_npoints()-2; i>=1; i--){ - rightChain.appendVertex(tempV->getVertex(i)); - } -} - - -void findTopAndBot(directedLine* polygon, directedLine*& topV, directedLine*& botV) -{ - assert(polygon); - directedLine* tempV; - topV = botV = polygon; - for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) - { - if(compV2InY(topV->head(), tempV->head())<0) { - topV = tempV; - } - if(compV2InY(botV->head(), tempV->head())>0) { - botV = tempV; - } - } -} - -void findGridChains(directedLine* topV, directedLine* botV, - gridWrap* grid, - gridBoundaryChain*& leftGridChain, - gridBoundaryChain*& rightGridChain) -{ - /*find the first(top) and the last (bottom) grid line which intersect the - *this polygon - */ - Int firstGridIndex; /*the index in the grid*/ - Int lastGridIndex; - - firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)); - - if(botV->head()[1] < grid->get_v_min()) - lastGridIndex = 0; - else - lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1; - - /*find the interval inside the polygon for each gridline*/ - Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(leftGridIndices); - Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(rightGridIndices); - Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(leftGridInnerIndices); - Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(rightGridInnerIndices); - - findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices); - - findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices); - - leftGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices); - - rightGridChain = new gridBoundaryChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices); - - free(leftGridIndices); - free(rightGridIndices); - free(leftGridInnerIndices); - free(rightGridInnerIndices); -} - -void findDownCorners(Real *botVertex, - vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, - Real v, - Real uleft, - Real uright, - Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ - Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/ - Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ - Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/ - ) -{ -#ifdef MYDEBUG -printf("*************enter find donw corner\n"); -printf("finddownCorner: v=%f, uleft=%f, uright=%f\n", v, uleft, uright); -printf("(%i,%i,%i,%i)\n", leftChainStartIndex, leftChainEndIndex,rightChainStartIndex, rightChainEndIndex); -printf("left chain is\n"); -leftChain->print(); -printf("right chain is\n"); -rightChain->print(); -#endif - - assert(v > botVertex[1]); - Real leftGridPoint[2]; - leftGridPoint[0] = uleft; - leftGridPoint[1] = v; - Real rightGridPoint[2]; - rightGridPoint[0] = uright; - rightGridPoint[1] = v; - - Int i; - Int index1, index2; - - index1 = leftChain->findIndexBelowGen(v, leftChainStartIndex, leftChainEndIndex); - index2 = rightChain->findIndexBelowGen(v, rightChainStartIndex, rightChainEndIndex); - - if(index2 <= rightChainEndIndex) //index2 was found above - index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex); - - if(index1>leftChainEndIndex && index2 > rightChainEndIndex) /*no point below v on left chain or right chain*/ - { - - /*the botVertex is the only vertex below v*/ - ret_leftCornerWhere = 1; - ret_rightCornerWhere = 1; - } - else if(index1>leftChainEndIndex ) /*index2 <= rightChainEndIndex*/ - { - - ret_rightCornerWhere = 2; /*on right chain*/ - ret_rightCornerIndex = index2; - - - Real tempMin = rightChain->getVertex(index2)[0]; - Int tempI = index2; - for(i=index2+1; i<= rightChainEndIndex; i++) - if(rightChain->getVertex(i)[0] < tempMin) - { - tempI = i; - tempMin = rightChain->getVertex(i)[0]; - } - - - //we consider whether we can use botVertex as left corner. First check - //if (leftGirdPoint, botVertex) interesects right chian or not. - if(DBG_intersectChain(rightChain, rightChainStartIndex,rightChainEndIndex, - leftGridPoint, botVertex)) - { - ret_leftCornerWhere = 2;//right - ret_leftCornerIndex = index2; //should use tempI??? - } - else if(botVertex[0] < tempMin) - ret_leftCornerWhere = 1; //bot - else - { - ret_leftCornerWhere = 2; //right - ret_leftCornerIndex = tempI; - } - } - else if(index2> rightChainEndIndex) /*index1<=leftChainEndIndex*/ - { - ret_leftCornerWhere = 0; /*left chain*/ - ret_leftCornerIndex = index1; - - /*find the vertex on the left chain with the maximum u, - *either this vertex or the botvertex can be used as the right corner - */ - - Int tempI; - //skip those points which are equal to v. (avoid degeneratcy) - for(tempI = index1; tempI <= leftChainEndIndex; tempI++) - if(leftChain->getVertex(tempI)[1] < v) - break; - if(tempI > leftChainEndIndex) - ret_rightCornerWhere = 1; - else - { - Real tempMax = leftChain->getVertex(tempI)[0]; - for(i=tempI; i<= leftChainEndIndex; i++) - if(leftChain->getVertex(i)[0] > tempMax) - { - tempI = i; - tempMax = leftChain->getVertex(i)[0]; - } - - - - //we consider whether we can use botVertex as a corner. So first we check - //whether (rightGridPoint, botVertex) interescts the left chain or not. - if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, - rightGridPoint, botVertex)) - { - ret_rightCornerWhere = 0; - ret_rightCornerIndex = index1; //should use tempI??? - } - else if(botVertex[0] > tempMax) - { - - ret_rightCornerWhere = 1; - } - else - { - ret_rightCornerWhere = 0; - ret_rightCornerIndex = tempI; - } - } - - } - else /*index1<=leftChainEndIndex and index2 <=rightChainEndIndex*/ - { - if(leftChain->getVertex(index1)[1] >= rightChain->getVertex(index2)[1]) /*left point above right point*/ - { - ret_leftCornerWhere = 0; /*on left chain*/ - ret_leftCornerIndex = index1; - - Real tempMax; - Int tempI; - - tempI = index1; - tempMax = leftChain->getVertex(index1)[0]; - - /*find the maximum u for all the points on the left above the right point index2*/ - for(i=index1+1; i<= leftChainEndIndex; i++) - { - if(leftChain->getVertex(i)[1] < rightChain->getVertex(index2)[1]) - break; - - if(leftChain->getVertex(i)[0]>tempMax) - { - tempI = i; - tempMax = leftChain->getVertex(i)[0]; - } - } - //we consider if we can use rightChain(index2) as right corner - //we check if (rightChain(index2), rightGidPoint) intersecs left chain or not. - if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2))) - { - ret_rightCornerWhere = 0; - ret_rightCornerIndex = index1; //should use tempI??? - } - else if(tempMax >= rightChain->getVertex(index2)[0] || - tempMax >= uright - ) - { - - ret_rightCornerWhere = 0; /*on left Chain*/ - ret_rightCornerIndex = tempI; - } - else - { - ret_rightCornerWhere = 2; /*on right chain*/ - ret_rightCornerIndex = index2; - } - } - else /*left below right*/ - { - ret_rightCornerWhere = 2; /*on the right*/ - ret_rightCornerIndex = index2; - - Real tempMin; - Int tempI; - - tempI = index2; - tempMin = rightChain->getVertex(index2)[0]; - - /*find the minimum u for all the points on the right above the left poitn index1*/ - for(i=index2+1; i<= rightChainEndIndex; i++) - { - if( rightChain->getVertex(i)[1] < leftChain->getVertex(index1)[1]) - break; - if(rightChain->getVertex(i)[0] < tempMin) - { - tempI = i; - tempMin = rightChain->getVertex(i)[0]; - } - } - - //we consider if we can use leftchain(index1) as left corner. - //we check if (leftChain(index1) intersects right chian or not - if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1))) - { - ret_leftCornerWhere = 2; - ret_leftCornerIndex = index2; //should use tempI??? - } - else if(tempMin <= leftChain->getVertex(index1)[0] || - tempMin <= uleft) - { - ret_leftCornerWhere = 2; /* on right chain*/ - ret_leftCornerIndex = tempI; - } - else - { - ret_leftCornerWhere = 0; /*on left chain*/ - ret_leftCornerIndex = index1; - } - } - } - -} - - -void findUpCorners(Real *topVertex, - vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, - Real v, - Real uleft, - Real uright, - Int& ret_leftCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ - Int& ret_leftCornerIndex, /*useful when ret_leftCornerWhere == 0 or 2*/ - Int& ret_rightCornerWhere, /*0: left chain, 1: topvertex, 2: rightchain*/ - Int& ret_rightCornerIndex /*useful when ret_leftCornerWhere == 0 or 2*/ - ) -{ -#ifdef MYDEBUG -printf("***********enter findUpCorners\n"); -#endif - - assert(v < topVertex[1]); - Real leftGridPoint[2]; - leftGridPoint[0] = uleft; - leftGridPoint[1] = v; - Real rightGridPoint[2]; - rightGridPoint[0] = uright; - rightGridPoint[1] = v; - - Int i; - Int index1, index2; - - index1 = leftChain->findIndexFirstAboveEqualGen(v, leftChainStartIndex, leftChainEndIndex); - - - index2 = rightChain->findIndexFirstAboveEqualGen(v, rightChainStartIndex, rightChainEndIndex); - - if(index2>= leftChainStartIndex) //index2 was found above - index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex); - - if(index1= rightChainStartIndex*/ - { - ret_rightCornerWhere = 2; /*on right chain*/ - ret_rightCornerIndex = index2; - - //find the minimum u on right top, either that, or top, or right[index2] is the left corner - Real tempMin = rightChain->getVertex(index2)[0]; - Int tempI = index2; - for(i=index2-1; i>=rightChainStartIndex; i--) - if(rightChain->getVertex(i)[0] < tempMin) - { - tempMin = rightChain->getVertex(i)[0]; - tempI = i; - } - //chech whether (leftGridPoint, top) intersects rightchai, - //if yes, use right corner as left corner - //if not, use top or right[tempI] as left corner - if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, - leftGridPoint, topVertex)) - { - ret_leftCornerWhere = 2; //rightChain - ret_leftCornerIndex = index2; - } - else if(topVertex[0] < tempMin) - ret_leftCornerWhere = 1; /*topvertex*/ - else - { - ret_leftCornerWhere = 2; //right chain - ret_leftCornerIndex = tempI; - } - - } - else if(index2< rightChainStartIndex) /*index1>=leftChainStartIndex*/ - { - ret_leftCornerWhere = 0; /*left chain*/ - ret_leftCornerIndex = index1; - - //find the maximum u on the left top section. either that or topvertex, or left[index1] is the right corner - Real tempMax = leftChain->getVertex(index1)[0]; - Int tempI = index1; - - for(i=index1-1; i>=leftChainStartIndex; i--){ - - if(leftChain->getVertex(i)[0] > tempMax) - { - - tempMax = leftChain->getVertex(i)[0]; - tempI = i; - } - } - //check whether (rightGridPoint, top) intersects leftChain or not - //if yes, we use leftCorner as the right corner - //if not, we use either top or left[tempI] as the right corner - if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, - rightGridPoint, topVertex)) - { - ret_rightCornerWhere = 0; //left chan - ret_rightCornerIndex = index1; - } - else if(topVertex[0] > tempMax) - ret_rightCornerWhere = 1;//topVertex - else - { - ret_rightCornerWhere = 0;//left chain - ret_rightCornerIndex = tempI; - } - } - else /*index1>=leftChainStartIndex and index2 >=rightChainStartIndex*/ - { - if(leftChain->getVertex(index1)[1] <= rightChain->getVertex(index2)[1]) /*left point below right point*/ - { - ret_leftCornerWhere = 0; /*on left chain*/ - ret_leftCornerIndex = index1; - - Real tempMax; - Int tempI; - - tempI = index1; - tempMax = leftChain->getVertex(index1)[0]; - - /*find the maximum u for all the points on the left below the right point index2*/ - for(i=index1-1; i>= leftChainStartIndex; i--) - { - if(leftChain->getVertex(i)[1] > rightChain->getVertex(index2)[1]) - break; - - if(leftChain->getVertex(i)[0]>tempMax) - { - tempI = i; - tempMax = leftChain->getVertex(i)[0]; - } - } - //chek whether (rightChain(index2), rightGridPoint) intersects leftchian or not - if(DBG_intersectChain(leftChain, leftChainStartIndex, leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2))) - { - ret_rightCornerWhere = 0; - ret_rightCornerIndex = index1; - } - else if(tempMax >= rightChain->getVertex(index2)[0] || - tempMax >= uright) - { - ret_rightCornerWhere = 0; /*on left Chain*/ - ret_rightCornerIndex = tempI; - } - else - { - ret_rightCornerWhere = 2; /*on right chain*/ - ret_rightCornerIndex = index2; - } - } - else /*left above right*/ - { - ret_rightCornerWhere = 2; /*on the right*/ - ret_rightCornerIndex = index2; - - Real tempMin; - Int tempI; - - tempI = index2; - tempMin = rightChain->getVertex(index2)[0]; - - /*find the minimum u for all the points on the right below the left poitn index1*/ - for(i=index2-1; i>= rightChainStartIndex; i--) - { - if( rightChain->getVertex(i)[1] > leftChain->getVertex(index1)[1]) - break; - if(rightChain->getVertex(i)[0] < tempMin) - { - tempI = i; - tempMin = rightChain->getVertex(i)[0]; - } - } - //check whether (leftGRidPoint,left(index1)) interesect right chain - if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, - leftGridPoint, leftChain->getVertex(index1))) - { - ret_leftCornerWhere = 2; //right - ret_leftCornerIndex = index2; - } - else if(tempMin <= leftChain->getVertex(index1)[0] || - tempMin <= uleft) - { - ret_leftCornerWhere = 2; /* on right chain*/ - ret_leftCornerIndex = tempI; - } - else - { - ret_leftCornerWhere = 0; /*on left chain*/ - ret_leftCornerIndex = index1; - } - } - } -#ifdef MYDEBUG -printf("***********leave findUpCorners\n"); -#endif -} - -//return 1 if neck exists, 0 othewise -Int findNeckF(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridStartIndex, - Int& neckLeft, - Int& neckRight) -{ -/* -printf("enter findNeckF, botleft, botright=%i,%i,gstartindex=%i\n",botLeftIndex,botRightIndex,gridStartIndex); -printf("leftChain is\n"); -leftChain->print(); -printf("rightChain is\n"); -rightChain->print(); -*/ - - Int lowerGridIndex; //the grid below leftChain and rightChian vertices - Int i; - Int n_vlines = leftGridChain->get_nVlines(); - Real v; - if(botLeftIndex >= leftChain->getNumElements() || - botRightIndex >= rightChain->getNumElements()) - return 0; //no neck exists - - v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]); - - - - - for(i=gridStartIndex; iget_v_value(i) <= v && - leftGridChain->getUlineIndex(i)<= rightGridChain->getUlineIndex(i)) - break; - - lowerGridIndex = i; - - if(lowerGridIndex == n_vlines) //the two trm vertex are higher than all gridlines - return 0; - else - { - Int botLeft2, botRight2; -/* -printf("leftGridChain->get_v_)value=%f\n",leftGridChain->get_v_value(lowerGridIndex), botLeftIndex); -printf("leftChain->get_vertex(0)=(%f,%f)\n", leftChain->getVertex(0)[0],leftChain->getVertex(0)[1]); -printf("leftChain->get_vertex(1)=(%f,%f)\n", leftChain->getVertex(1)[0],leftChain->getVertex(1)[1]); -printf("leftChain->get_vertex(2)=(%f,%f)\n", leftChain->getVertex(2)[0],leftChain->getVertex(2)[1]); -*/ - botLeft2 = leftChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botLeftIndex, leftChain->getNumElements()-1) -1 ; - -/* -printf("botLeft2=%i\n", botLeft2); -printf("leftChain->getNumElements=%i\n", leftChain->getNumElements()); -*/ - - botRight2 = rightChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botRightIndex, rightChain->getNumElements()-1) -1; - if(botRight2 < botRightIndex) botRight2=botRightIndex; - - if(botLeft2 < botLeftIndex) botLeft2 = botLeftIndex; - - assert(botLeft2 >= botLeftIndex); - assert(botRight2 >= botRightIndex); - //find nectLeft so that it is th erightmost vertex on letChain - - Int tempI = botLeftIndex; - Real temp = leftChain->getVertex(tempI)[0]; - for(i=botLeftIndex+1; i<= botLeft2; i++) - if(leftChain->getVertex(i)[0] > temp) - { - temp = leftChain->getVertex(i)[0]; - tempI = i; - } - neckLeft = tempI; - - tempI = botRightIndex; - temp = rightChain->getVertex(tempI)[0]; - for(i=botRightIndex+1; i<= botRight2; i++) - if(rightChain->getVertex(i)[0] < temp) - { - temp = rightChain->getVertex(i)[0]; - tempI = i; - } - neckRight = tempI; - return 1; - } -} - - - -/*find i>=botLeftIndex,j>=botRightIndex so that - *(leftChain[i], rightChain[j]) is a neck. - */ -void findNeck(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, - Int& leftLastIndex, /*left point of the neck*/ - Int& rightLastIndex /*right point of the neck*/ - ) -{ - assert(botLeftIndex < leftChain->getNumElements() && - botRightIndex < rightChain->getNumElements()); - - /*now the neck exists for sure*/ - - if(leftChain->getVertex(botLeftIndex)[1] <= rightChain->getVertex(botRightIndex)[1]) //left below right - { - - leftLastIndex = botLeftIndex; - - /*find i so that rightChain[i][1] >= leftchainbotverte[1], and i+1< - */ - rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1); - } - else //left above right - { - - rightLastIndex = botRightIndex; - - leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1], - botLeftIndex+1, - leftChain->getNumElements()-1); - } -} - - - -void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices) -{ - - Int i,k,isHoriz = 0; - Int n_ulines = grid->get_n_ulines(); - Real uMin = grid->get_u_min(); - Real uMax = grid->get_u_max(); - /* - Real vMin = grid->get_v_min(); - Real vMax = grid->get_v_max(); - */ - Real slop = 0.0, uinterc; - -#ifdef SHORTEN_GRID_LINE - //uintercBuf stores all the interction u value for each grid line - //notice that lastGridIndex<= firstGridIndex - Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1)); - assert(uintercBuf); -#endif - - /*initialization to make vtail bigger than grid->...*/ - directedLine* dLine = topEdge; - Real vtail = grid->get_v_value(firstGridIndex) + 1.0; - Real tempMaxU = grid->get_u_min(); - - - /*for each grid line*/ - for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) - { - - Real grid_v_value = grid->get_v_value(i); - - /*check whether this grid line is below the current trim edge.*/ - if(vtail > grid_v_value) - { - /*since the grid line is below the trim edge, we - *find the trim edge which will contain the trim line - */ - while( (vtail=dLine->tail()[1]) > grid_v_value){ - - tempMaxU = max(tempMaxU, dLine->tail()[0]); - dLine = dLine -> getNext(); - } - - if( fabs(dLine->head()[1] - vtail) < ZERO) - isHoriz = 1; - else - { - isHoriz = 0; - slop = (dLine->head()[0] - dLine->tail()[0]) / (dLine->head()[1]-vtail); - } - } - - if(isHoriz) - { - uinterc = max(dLine->head()[0], dLine->tail()[0]); - } - else - { - uinterc = slop * (grid_v_value - vtail) + dLine->tail()[0]; - } - - tempMaxU = max(tempMaxU, uinterc); - - if(uinterc < uMin && uinterc >= uMin - ZERO) - uinterc = uMin; - if(uinterc > uMax && uinterc <= uMax + ZERO) - uinterc = uMax; - -#ifdef SHORTEN_GRID_LINE - uintercBuf[k] = uinterc; -#endif - - assert(uinterc >= uMin && uinterc <= uMax); - if(uinterc == uMax) - ret_indices[k] = n_ulines-1; - else - ret_indices[k] = (Int)(((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1; - if(ret_indices[k] >= n_ulines) - ret_indices[k] = n_ulines-1; - - - ret_innerIndices[k] = (Int)(((tempMaxU-uMin)/(uMax - uMin)) * (n_ulines-1)) + 1; - - /*reinitialize tempMaxU for next grdiLine*/ - tempMaxU = uinterc; - } -#ifdef SHORTEN_GRID_LINE - //for each grid line, compare the left grid point with the - //intersection point. If the two points are too close, then - //we should move the grid point one grid to the right - //and accordingly we should update the inner index. - for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) - { - //check gridLine i - //check ret_indices[k] - Real a = grid->get_u_value(ret_indices[k]-1); - Real b = grid->get_u_value(ret_indices[k]); - assert(uintercBuf[k] >= a && uintercBuf < b); - if( (b-uintercBuf[k]) <= 0.2 * (b-a)) //interc is very close to b - { - ret_indices[k]++; - } - - //check ret_innerIndices[k] - if(k>0) - { - if(ret_innerIndices[k] < ret_indices[k-1]) - ret_innerIndices[k] = ret_indices[k-1]; - if(ret_innerIndices[k] < ret_indices[k]) - ret_innerIndices[k] = ret_indices[k]; - } - } - //clean up - free(uintercBuf); -#endif -} - -void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices) -{ - - Int i,k; - Int n_ulines = grid->get_n_ulines(); - Real uMin = grid->get_u_min(); - Real uMax = grid->get_u_max(); - /* - Real vMin = grid->get_v_min(); - Real vMax = grid->get_v_max(); - */ - Real slop = 0.0, uinterc; - -#ifdef SHORTEN_GRID_LINE - //uintercBuf stores all the interction u value for each grid line - //notice that firstGridIndex >= lastGridIndex - Real *uintercBuf = (Real *) malloc (sizeof(Real) * (firstGridIndex-lastGridIndex+1)); - assert(uintercBuf); -#endif - - /*initialization to make vhead bigger than grid->v_value...*/ - directedLine* dLine = topEdge->getPrev(); - Real vhead = dLine->tail()[1]; - Real tempMinU = grid->get_u_max(); - - /*for each grid line*/ - for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) - { - - Real grid_v_value = grid->get_v_value(i); - - - /*check whether this grid line is below the current trim edge.*/ - if(vhead >= grid_v_value) - { - /*since the grid line is below the tail of the trim edge, we - *find the trim edge which will contain the trim line - */ - while( (vhead=dLine->head()[1]) > grid_v_value){ - tempMinU = min(tempMinU, dLine->head()[0]); - dLine = dLine -> getPrev(); - } - - /*skip the equality in the case of degenerat case: horizontal */ - while(dLine->head()[1] == grid_v_value) - dLine = dLine->getPrev(); - - assert( dLine->tail()[1] != dLine->head()[1]); - slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-dLine->head()[1]); - /* - if(dLine->tail()[1] == vhead) - isHoriz = 1; - else - { - isHoriz = 0; - slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-vhead); - } - */ - } - uinterc = slop * (grid_v_value - dLine->head()[1]) + dLine->head()[0]; - - //in case unterc is outside of the grid due to floating point - if(uinterc < uMin) - uinterc = uMin; - else if(uinterc > uMax) - uinterc = uMax; - -#ifdef SHORTEN_GRID_LINE - uintercBuf[k] = uinterc; -#endif - - tempMinU = min(tempMinU, uinterc); - - assert(uinterc >= uMin && uinterc <= uMax); - - if(uinterc == uMin) - ret_indices[k] = 0; - else - ret_indices[k] = (int)ceil((((uinterc-uMin)/(uMax - uMin)) * (n_ulines-1))) -1; -/* -if(ret_indices[k] >= grid->get_n_ulines()) - { - printf("ERROR3\n"); - exit(0); -} -if(ret_indices[k] < 0) - { - printf("ERROR4\n"); - exit(0); -} -*/ - ret_innerIndices[k] = (int)ceil ((((tempMinU-uMin)/(uMax - uMin)) * (n_ulines-1))) -1; - - tempMinU = uinterc; - } -#ifdef SHORTEN_GRID_LINE - //for each grid line, compare the left grid point with the - //intersection point. If the two points are too close, then - //we should move the grid point one grid to the right - //and accordingly we should update the inner index. - for(k=0, i=firstGridIndex; i>=lastGridIndex; i--, k++) - { - //check gridLine i - //check ret_indices[k] - Real a = grid->get_u_value(ret_indices[k]); - Real b = grid->get_u_value(ret_indices[k]+1); - assert(uintercBuf[k] > a && uintercBuf <= b); - if( (uintercBuf[k]-a) <= 0.2 * (b-a)) //interc is very close to a - { - ret_indices[k]--; - } - - //check ret_innerIndices[k] - if(k>0) - { - if(ret_innerIndices[k] > ret_indices[k-1]) - ret_innerIndices[k] = ret_indices[k-1]; - if(ret_innerIndices[k] > ret_indices[k]) - ret_innerIndices[k] = ret_indices[k]; - } - } - //clean up - free(uintercBuf); -#endif -} - - -void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream* pStream, rectBlockArray* rbArray) -{ -/* -{ -grid->print(); -polygon->writeAllPolygons("zloutputFile"); -exit(0); -} -*/ - -if(grid->get_n_ulines() == 2 || - grid->get_n_vlines() == 2) -{ - if(ulinear && grid->get_n_ulines() == 2) - { - monoTriangulationFun(polygon, compV2InY, pStream); - return; - } - else if(DBG_isConvex(polygon) && polygon->numEdges() >=4) - { - triangulateConvexPoly(polygon, ulinear, vlinear, pStream); - return; - } - else if(vlinear || DBG_is_U_direction(polygon)) - { - Int n_cusps;//num interior cusps - Int n_edges = polygon->numEdges(); - directedLine** cusps = (directedLine**) malloc(sizeof(directedLine*) * n_edges); - assert(cusps); - findInteriorCuspsX(polygon, n_cusps, cusps); - - if(n_cusps == 0) //u_monotone - { - - monoTriangulationFun(polygon, compV2InX, pStream); - - free(cusps); - return; - } - else if(n_cusps == 1) //one interior cusp - { - - directedLine* new_polygon = polygonConvert(cusps[0]); - - directedLine* other = findDiagonal_singleCuspX( new_polygon); - - - - // should NOT be null unless there are self-intersecting - //trim curves. In that case, we don't want to core dump, instead, - //we triangulate anyway, and print out error message. - if(other == NULL) - { - monoTriangulationFun(polygon, compV2InX, pStream); - free(cusps); - return; - } - - directedLine* ret_p1; - directedLine* ret_p2; - - new_polygon->connectDiagonal_2slines(new_polygon, other, - &ret_p1, - &ret_p2, - new_polygon); - - monoTriangulationFun(ret_p1, compV2InX, pStream); - monoTriangulationFun(ret_p2, compV2InX, pStream); - - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); - - free(cusps); - return; - } - free(cusps); - } -} - - /*find the top and bottom of the polygon. It is supposed to be - *a V-monotone polygon - */ - - directedLine* tempV; - directedLine* topV; - directedLine* botV; - topV = botV = polygon; - - for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext()) - { - if(compV2InY(topV->head(), tempV->head())<0) { - - topV = tempV; - } - if(compV2InY(botV->head(), tempV->head())>0) { - - botV = tempV; - } - } - - /*find the first(top) and the last (bottom) grid line which intersect the - *this polygon - */ - Int firstGridIndex; /*the index in the grid*/ - Int lastGridIndex; - firstGridIndex = (Int) ((topV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)); - lastGridIndex = (Int) ((botV->head()[1] - grid->get_v_min()) / (grid->get_v_max() - grid->get_v_min()) * (grid->get_n_vlines()-1)) + 1; - - - /*find the interval inside the polygon for each gridline*/ - Int *leftGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(leftGridIndices); - Int *rightGridIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(rightGridIndices); - Int *leftGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(leftGridInnerIndices); - Int *rightGridInnerIndices = (Int*) malloc(sizeof(Int) * (firstGridIndex - lastGridIndex +1)); - assert(rightGridInnerIndices); - - findLeftGridIndices(topV, firstGridIndex, lastGridIndex, grid, leftGridIndices, leftGridInnerIndices); - - findRightGridIndices(topV, firstGridIndex, lastGridIndex, grid, rightGridIndices, rightGridInnerIndices); - - gridBoundaryChain leftGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, leftGridIndices, leftGridInnerIndices); - - gridBoundaryChain rightGridChain(grid, firstGridIndex, firstGridIndex-lastGridIndex+1, rightGridIndices, rightGridInnerIndices); - - - -// leftGridChain.draw(); -// leftGridChain.drawInner(); -// rightGridChain.draw(); -// rightGridChain.drawInner(); - /*(1) determine the grid boundaries (left and right). - *(2) process polygon into two monotone chaines: use vertexArray - *(3) call sampleMonoPolyRec - */ - - /*copy the two chains into vertexArray datastructure*/ - Int i; - vertexArray leftChain(20); /*this is a dynamic array*/ - for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ - leftChain.appendVertex(topV->getVertex(i)); - } - for(tempV = topV->getNext(); tempV != botV; tempV = tempV->getNext()) - { - for(i=0; i<=tempV->get_npoints()-2; i++){ - leftChain.appendVertex(tempV->getVertex(i)); - } - } - - vertexArray rightChain(20); - for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) - { - for(i=tempV->get_npoints()-2; i>=0; i--){ - rightChain.appendVertex(tempV->getVertex(i)); - } - } - for(i=botV->get_npoints()-2; i>=1; i--){ - rightChain.appendVertex(tempV->getVertex(i)); - } - - sampleMonoPolyRec(topV->head(), - botV->head(), - &leftChain, - 0, - &rightChain, - 0, - &leftGridChain, - &rightGridChain, - 0, - pStream, - rbArray); - - - /*cleanup space*/ - free(leftGridIndices); - free(rightGridIndices); - free(leftGridInnerIndices); - free(rightGridInnerIndices); -} - -void sampleMonoPolyRec( - Real* topVertex, - Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridStartIndex, - primStream* pStream, - rectBlockArray* rbArray) -{ - - /*find the first connected component, and the four corners. - */ - Int index1, index2; /*the first and last grid line of the first connected component*/ - - if(topVertex[1] <= botVertex[1]) - return; - - /*find i so that the grid line is below the top vertex*/ - Int i=gridStartIndex; - while (i < leftGridChain->get_nVlines()) - { - if(leftGridChain->get_v_value(i) < topVertex[1]) - break; - i++; - } - - /*find the first connected component starting with i*/ - /*find index1 so that left_uline_index <= right_uline_index, that is, this - *grid line contains at least one inner grid point - */ - index1=i; - int num_skipped_grid_lines=0; - while(index1 < leftGridChain->get_nVlines()) - { - if(leftGridChain->getUlineIndex(index1) <= rightGridChain->getUlineIndex(index1)) - break; - num_skipped_grid_lines++; - index1++; - } - - - - if(index1 >= leftGridChain->get_nVlines()) /*no grid line exists which has inner point*/ - { - /*stop recursion, ...*/ - /*monotone triangulate it...*/ -// printf("no grid line exists\n"); -/* - monoTriangulationRecOpt(topVertex, botVertex, leftChain, leftStartIndex, - rightChain, rightStartIndex, pStream); -*/ - -if(num_skipped_grid_lines <2) - { - monoTriangulationRecGenOpt(topVertex, botVertex, leftChain, leftStartIndex, - leftChain->getNumElements()-1, - rightChain, rightStartIndex, - rightChain->getNumElements()-1, - pStream); - } -else - { - //the optimum way to triangulate is top-down since this polygon - //is narrow-long. - monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex, - rightChain, rightStartIndex, pStream); - } - -/* - monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex, - rightChain, rightStartIndex, pStream); -*/ - -/* monoTriangulationRecGenTBOpt(topVertex, botVertex, - leftChain, leftStartIndex, leftChain->getNumElements()-1, - rightChain, rightStartIndex, rightChain->getNumElements()-1, - pStream);*/ - - - - } - else - { - - /*find index2 so that left_inner_index <= right_inner_index holds until index2*/ - index2=index1+1; - if(index2 < leftGridChain->get_nVlines()) - while(leftGridChain->getInnerIndex(index2) <= rightGridChain->getInnerIndex(index2)) - { - index2++; - if(index2 >= leftGridChain->get_nVlines()) - break; - } - - index2--; - - - - /*the neck*/ - Int neckLeftIndex; - Int neckRightIndex; - - /*the four corners*/ - Int up_leftCornerWhere; - Int up_leftCornerIndex; - Int up_rightCornerWhere; - Int up_rightCornerIndex; - Int down_leftCornerWhere; - Int down_leftCornerIndex; - Int down_rightCornerWhere; - Int down_rightCornerIndex; - - Real* tempBotVertex; /*the bottom vertex for this component*/ - Real* nextTopVertex=NULL; /*for the recursion*/ - Int nextLeftStartIndex=0; - Int nextRightStartIndex=0; - - /*find the points below the grid line index2 on both chains*/ - Int botLeftIndex = leftChain->findIndexStrictBelowGen( - leftGridChain->get_v_value(index2), - leftStartIndex, - leftChain->getNumElements()-1); - Int botRightIndex = rightChain->findIndexStrictBelowGen( - rightGridChain->get_v_value(index2), - rightStartIndex, - rightChain->getNumElements()-1); - /*if either botLeftIndex>= numelements, - * or botRightIndex >= numelemnet, - *then there is no neck exists. the bottom vertex is botVertex, - */ - if(! findNeckF(leftChain, botLeftIndex, rightChain, botRightIndex, - leftGridChain, rightGridChain, index2, neckLeftIndex, neckRightIndex)) - /* - if(botLeftIndex == leftChain->getNumElements() || - botRightIndex == rightChain->getNumElements()) - */ - { -#ifdef MYDEBUG - printf("neck NOT exists, botRightIndex=%i\n", botRightIndex); -#endif - - tempBotVertex = botVertex; - nextTopVertex = botVertex; - botLeftIndex = leftChain->getNumElements()-1; - botRightIndex = rightChain->getNumElements()-1; - } - else /*neck exists*/ - { -#ifdef MYDEBUG - printf("neck exists\n"); -#endif - - /* - findNeck(leftChain, botLeftIndex, - rightChain, botRightIndex, - neckLeftIndex, - neckRightIndex); - */ -#ifdef MYDEBUG -printf("neck is found, neckLeftIndex=%i, neckRightIndex=%i\n", neckLeftIndex, neckRightIndex); -glBegin(GL_LINES); -glVertex2fv(leftChain->getVertex(neckLeftIndex)); -glVertex2fv(rightChain->getVertex(neckRightIndex)); -glEnd(); -#endif - - if(leftChain->getVertex(neckLeftIndex)[1] <= rightChain->getVertex(neckRightIndex)[1]) - { - tempBotVertex = leftChain->getVertex(neckLeftIndex); - botLeftIndex = neckLeftIndex-1; - botRightIndex = neckRightIndex; - nextTopVertex = rightChain->getVertex(neckRightIndex); - nextLeftStartIndex = neckLeftIndex; - nextRightStartIndex = neckRightIndex+1; - } - else - { - tempBotVertex = rightChain->getVertex(neckRightIndex); - botLeftIndex = neckLeftIndex; - botRightIndex = neckRightIndex-1; - nextTopVertex = leftChain->getVertex(neckLeftIndex); - nextLeftStartIndex = neckLeftIndex+1; - nextRightStartIndex = neckRightIndex; - } - } - - findUpCorners(topVertex, - leftChain, - leftStartIndex, botLeftIndex, - rightChain, - rightStartIndex, botRightIndex, - leftGridChain->get_v_value(index1), - leftGridChain->get_u_value(index1), - rightGridChain->get_u_value(index1), - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex); - - findDownCorners(tempBotVertex, - leftChain, - leftStartIndex, botLeftIndex, - rightChain, - rightStartIndex, botRightIndex, - leftGridChain->get_v_value(index2), - leftGridChain->get_u_value(index2), - rightGridChain->get_u_value(index2), - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex); -#ifdef MYDEBUG - printf("find corners done, down_leftwhere=%i, down_righwhere=%i,\n",down_leftCornerWhere, down_rightCornerWhere ); - printf("find corners done, up_leftwhere=%i, up_righwhere=%i,\n",up_leftCornerWhere, up_rightCornerWhere ); - printf("find corners done, up_leftindex=%i, up_righindex=%i,\n",up_leftCornerIndex, up_rightCornerIndex ); - printf("find corners done, down_leftindex=%i, down_righindex=%i,\n",down_leftCornerIndex, down_rightCornerIndex ); -#endif - -/* - drawCorners(topVertex, - tempBotVertex, - leftChain, - rightChain, - leftGridChain, - rightGridChain, - index1, - index2, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex); -*/ - - - sampleConnectedComp(topVertex, tempBotVertex, - leftChain, - leftStartIndex, botLeftIndex, - rightChain, - rightStartIndex, botRightIndex, - leftGridChain, - rightGridChain, - index1, index2, - up_leftCornerWhere, - up_leftCornerIndex, - up_rightCornerWhere, - up_rightCornerIndex, - down_leftCornerWhere, - down_leftCornerIndex, - down_rightCornerWhere, - down_rightCornerIndex, - pStream, - rbArray - ); - - /*recursion*/ - - sampleMonoPolyRec( - nextTopVertex, - botVertex, - leftChain, - nextLeftStartIndex, - rightChain, - nextRightStartIndex, - leftGridChain, - rightGridChain, - index2+1, - pStream, rbArray); - - - } - -} - -void sampleLeftStrip(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ) -{ - assert(leftChain->getVertex(topLeftIndex)[1] > leftGridChain->get_v_value(leftGridChainStartIndex)); - assert(leftChain->getVertex(topLeftIndex+1)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex)); - assert(leftChain->getVertex(botLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainEndIndex)); - assert(leftChain->getVertex(botLeftIndex-1)[1] > leftGridChain->get_v_value(leftGridChainEndIndex)); - - /* - *(1)find the last grid line which doesn'; pass below - * this first edge, sample this region: one trim edge and - * possily multiple grid lines. - */ - Real *upperVert, *lowerVert; /*the end points of the first trim edge*/ - upperVert = leftChain->getVertex(topLeftIndex); - lowerVert = leftChain->getVertex(topLeftIndex+1); - - Int index = leftGridChainStartIndex; - while(leftGridChain->get_v_value(index) >= lowerVert[1]){ - index++; - if(index > leftGridChainEndIndex) - break; - } - index--; - - sampleLeftSingleTrimEdgeRegion(upperVert, lowerVert, - leftGridChain, - leftGridChainStartIndex, - index, - pStream); - sampleLeftStripRec(leftChain, topLeftIndex+1, botLeftIndex, - leftGridChain, index, leftGridChainEndIndex, - pStream); - -} - -void sampleLeftStripRec(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ) -{ - /*now top left trim vertex is below the top grid line. - */ - /*stop condition: if topLeftIndex >= botLeftIndex, then stop. - */ - if(topLeftIndex >= botLeftIndex) - return; - - /*find the last trim vertex which is above the second top grid line: - * index1. - *and sampleLeftOneGridStep(leftchain, topLeftIndex, index1, leftGridChain, - * leftGridChainStartIndex). - * index1 could be equal to topLeftIndex. - */ - Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1); - assert(leftGridChainStartIndex < leftGridChainEndIndex); - Int index1 = topLeftIndex; - while(leftChain->getVertex(index1)[1] > secondGridChainV) - index1++; - index1--; - - sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream); - - - /* - * Let the next trim vertex be nextTrimVertIndex (which should be - * below the second grid line). - * Find the last grid line index2 which is above nextTrimVert. - * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], - * leftGridChain, leftGridChainStartIndex+1, index2). - */ - Real *uppervert, *lowervert; - uppervert = leftChain->getVertex(index1); - lowervert = leftChain->getVertex(index1+1); - Int index2 = leftGridChainStartIndex+1; - - while(leftGridChain->get_v_value(index2) >= lowervert[1]) - { - index2++; - if(index2 > leftGridChainEndIndex) - break; - } - index2--; - sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); - - /* sampleLeftStripRec(leftChain, - nextTrimVertIndex, - botLeftIndex, - leftGridChain, - index2, - leftGridChainEndIndex - ) - * - */ - sampleLeftStripRec(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); - -} - - -/***************begin RecF***********************/ -/* the gridlines from leftGridChainStartIndex to - * leftGridChainEndIndex are assumed to form a - * connected component. - * the trim vertex of topLeftIndex is assumed to - * be below the first gridline, and the tim vertex - * of botLeftIndex is assumed to be above the last - * grid line. - * If botLeftIndex < topLeftIndex, then no connected componeent exists, and this funcion returns without - * outputing any triangles. - * Otherwise botLeftIndex >= topLeftIndex, there is at least one triangle to output. - */ -void sampleLeftStripRecF(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ) -{ - /*now top left trim vertex is below the top grid line. - */ - /*stop condition: if topLeftIndex > botLeftIndex, then stop. - */ - if(topLeftIndex > botLeftIndex) - return; - - /*if there is only one grid Line, return.*/ - - if(leftGridChainStartIndex>=leftGridChainEndIndex) - return; - - - assert(leftChain->getVertex(topLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex) && - leftChain->getVertex(botLeftIndex)[1] >= leftGridChain->get_v_value(leftGridChainEndIndex)); - - /*firs find the first trim vertex which is below or equal to the second top grid line: - * index1. - */ - Real secondGridChainV = leftGridChain->get_v_value(leftGridChainStartIndex+1); - - - Int index1 = topLeftIndex; - - while(leftChain->getVertex(index1)[1] > secondGridChainV){ - index1++; - if(index1>botLeftIndex) - break; - } - - /*now leftChain->getVertex(index-1)[1] > secondGridChainV and - * leftChain->getVertex(index)[1] <= secondGridChainV - *If equality holds, then we should include the vertex index1, otherwise we include only index1-1, to - *perform sampleOneGridStep. - */ - if(index1>botLeftIndex) - index1--; - else if(leftChain->getVertex(index1)[1] < secondGridChainV) - index1--; - - /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and - * leftChain->getVertex(index1+1)[1] <= secondGridChainV - */ - - - sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream); - - - /*if leftChain->getVertex(index1)[1] == secondGridChainV, then we can recursively do the rest. - */ - if(leftChain->getVertex(index1)[1] == secondGridChainV) - { - - sampleLeftStripRecF(leftChain, index1, botLeftIndex,leftGridChain, leftGridChainStartIndex+1, leftGridChainEndIndex, pStream); - } - else if(index1 < botLeftIndex) - { - - /* Otherwise, we have leftChain->getVertex(index1)[1] > secondGridChainV, - * let the next trim vertex be nextTrimVertIndex (which should be strictly - * below the second grid line). - * Find the last grid line index2 which is above nextTrimVert. - * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], - * leftGridChain, leftGridChainStartIndex+1, index2). - */ - Real *uppervert, *lowervert; - uppervert = leftChain->getVertex(index1); - lowervert = leftChain->getVertex(index1+1); //okay since index1get_v_value(index2) >= lowervert[1]) - { - index2++; - if(index2 > leftGridChainEndIndex) - break; - } - index2--; - - - sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); - - /*recursion*/ - - sampleLeftStripRecF(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); - } - -} - -/***************End RecF***********************/ - -/*sample the left area in between one trim edge and multiple grid lines. - * all the grid lines should be in between the two end poins of the - *trim edge. - */ -void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], - gridBoundaryChain* gridChain, - Int beginIndex, - Int endIndex, - primStream* pStream) -{ - Int i,j,k; - - vertexArray vArray(endIndex-beginIndex+1); - vArray.appendVertex(gridChain->get_vertex(beginIndex)); - - for(k=1, i=beginIndex+1; i<=endIndex; i++, k++) - { - vArray.appendVertex(gridChain->get_vertex(i)); - - /*output the fan of the grid points of the (i)th and (i-1)th grid line. - */ - if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(gridChain->get_vertex(i-1)); - for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) - pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - else if(gridChain->getUlineIndex(i) > gridChain->getUlineIndex(i-1)) - { - pStream->begin(); - pStream->insert(gridChain->get_vertex(i)); - for(j=gridChain->getUlineIndex(i); j>= gridChain->getUlineIndex(i-1); j--) - pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); - pStream->end(PRIMITIVE_STREAM_FAN); - } - /*otherwisem, the two are equal, so there is no fan to outout*/ - } - - monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, - 0, /*decreasing chain*/ - pStream); -} - -/*return i, such that from begin to i-1 the chain is strictly u-monotone. - */ -Int findIncreaseChainFromBegin(vertexArray* chain, Int begin ,Int end) -{ - Int i=begin; - Real prevU = chain->getVertex(i)[0]; - Real thisU; - for(i=begin+1; i<=end; i++){ - thisU = chain->getVertex(i)[0]; - - if(prevU < thisU){ - prevU = thisU; - } - else - break; - } - return i; -} - -/*check whether there is a vertex whose v value is strictly - *inbetween vup vbelow - *if no middle exists return -1, else return the idnex. - */ -Int checkMiddle(vertexArray* chain, Int begin, Int end, - Real vup, Real vbelow) -{ - Int i; - for(i=begin; i<=end; i++) - { - if(chain->getVertex(i)[1] < vup && chain->getVertex(i)[1]>vbelow) - return i; - } - return -1; -} - -/*the degenerat case of sampleLeftOneGridStep*/ -void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain, - Int beginLeftIndex, - Int endLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - primStream* pStream) -{ - /*since there is no middle, there is at most one point which is on the - *second grid line, there could be multiple points on the first (top) - *grid line. - */ - - leftGridChain->leftEndFan(leftGridChainStartIndex+1, pStream); - - monoTriangulation2(leftGridChain->get_vertex(leftGridChainStartIndex), - leftGridChain->get_vertex(leftGridChainStartIndex+1), - leftChain, - beginLeftIndex, - endLeftIndex, - 1, //is increase chain. - pStream); -} - - - -/*sampling the left area in between two grid lines. - */ -void sampleLeftOneGridStep(vertexArray* leftChain, - Int beginLeftIndex, - Int endLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - primStream* pStream - ) -{ - if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex, - leftGridChain->get_v_value(leftGridChainStartIndex), - leftGridChain->get_v_value(leftGridChainStartIndex+1))<0) - - { - - sampleLeftOneGridStepNoMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain, leftGridChainStartIndex, pStream); - return; - } - - //copy into a polygon - { - directedLine* poly = NULL; - sampledLine* sline; - directedLine* dline; - gridWrap* grid = leftGridChain->getGrid(); - Real vert1[2]; - Real vert2[2]; - Int i; - - Int innerInd = leftGridChain->getInnerIndex(leftGridChainStartIndex+1); - Int upperInd = leftGridChain->getUlineIndex(leftGridChainStartIndex); - Int lowerInd = leftGridChain->getUlineIndex(leftGridChainStartIndex+1); - Real upperV = leftGridChain->get_v_value(leftGridChainStartIndex); - Real lowerV = leftGridChain->get_v_value(leftGridChainStartIndex+1); - - //the upper gridline - vert1[1] = vert2[1] = upperV; - for(i=innerInd; i>upperInd; i--) - { - vert1[0]=grid->get_u_value(i); - vert2[0]=grid->get_u_value(i-1); - sline = new sampledLine(vert1, vert2); - dline = new directedLine(INCREASING, sline); - if(poly == NULL) - poly = dline; - else - poly->insert(dline); - } - - //the edge connecting upper grid with left chain - vert1[0] = grid->get_u_value(upperInd); - vert1[1] = upperV; - sline = new sampledLine(vert1, leftChain->getVertex(beginLeftIndex)); - dline = new directedLine(INCREASING, sline); - if(poly == NULL) - poly = dline; - else - poly->insert(dline); - - //the left chain - for(i=beginLeftIndex; igetVertex(i), leftChain->getVertex(i+1)); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - - //the edge connecting left chain with lower gridline - vert2[0] = grid->get_u_value(lowerInd); - vert2[1] = lowerV; - sline = new sampledLine(leftChain->getVertex(endLeftIndex), vert2); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - - //the lower grid line - vert1[1] = vert2[1] = lowerV; - for(i=lowerInd; iget_u_value(i); - vert2[0] = grid->get_u_value(i+1); - sline = new sampledLine(vert1, vert2); - dline = new directedLine(INCREASING, sline); - poly->insert(dline); - } - - //the vertical grid line segement - vert1[0]=vert2[0] = grid->get_u_value(innerInd); - vert2[1]=upperV; - vert1[1]=lowerV; - sline=new sampledLine(vert1, vert2); - dline=new directedLine(INCREASING, sline); - poly->insert(dline); - monoTriangulationOpt(poly, pStream); - //cleanup - poly->deleteSinglePolygonWithSline(); - return; - } - - - - - - Int i; - if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >= - leftGridChain->getUlineIndex(leftGridChainStartIndex+1)*/ - ) /*the second grid line is beyond the first one to the left*/ - { - /*find the maximal U-monotone chain - * of endLeftIndex, endLeftIndex-1, ..., - */ - i=endLeftIndex; - Real prevU = leftChain->getVertex(i)[0]; - for(i=endLeftIndex-1; i>=beginLeftIndex; i--){ - Real thisU = leftChain->getVertex(i)[0]; - if( prevU < thisU){ - prevU = thisU; - } - else - break; - } - /*from endLeftIndex to i+1 is strictly U- monotone */ - /*if i+1==endLeftIndex and the vertex and leftchain is on the second gridline, then - *we should use 2 vertices on the leftchain. If we only use one (endLeftIndex), then we - *we would output degenerate triangles - */ - if(i+1 == endLeftIndex && leftChain->getVertex(endLeftIndex)[1] == leftGridChain->get_v_value(1+leftGridChainStartIndex)) - i--; - - Int j = beginLeftIndex/*endLeftIndex*/+1; - - - if(leftGridChain->getInnerIndex(leftGridChainStartIndex+1) > leftGridChain->getUlineIndex(leftGridChainStartIndex)) - { - j = findIncreaseChainFromBegin(leftChain, beginLeftIndex, i+1/*endLeftIndex*/); - - Int temp = beginLeftIndex; - /*now from begin to j-1 is strictly u-monotone*/ - /*if j-1 is on the first grid line, then we want to skip to the vertex which is strictly - *below the grid line. This vertexmust exist since there is a 'corner turn' inbetween the two grid lines - */ - if(j-1 == beginLeftIndex) - { - while(leftChain->getVertex(j-1)[1] == leftGridChain->get_v_value(leftGridChainStartIndex)) - j++; - - Real vert[2]; - vert[0] = leftGridChain->get_u_value(leftGridChainStartIndex); - vert[1] = leftGridChain->get_v_value(leftGridChainStartIndex); - - monoTriangulation2( - vert/*leftChain->getVertex(beginLeftIndex)*/, - leftChain->getVertex(j-1), - leftChain, - beginLeftIndex, - j-2, - 1, - pStream //increase chain - ); - - temp = j-1; - } - - stripOfFanLeft(leftChain, j-1, temp/*beginLeftIndex*/, leftGridChain->getGrid(), - leftGridChain->getVlineIndex(leftGridChainStartIndex), - leftGridChain->getUlineIndex(leftGridChainStartIndex), - leftGridChain->getInnerIndex(leftGridChainStartIndex+1), - pStream, - 1 /*the grid line is above the trim line*/ - ); - } - - stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(), - leftGridChain->getVlineIndex(leftGridChainStartIndex+1), - leftGridChain->getUlineIndex(leftGridChainStartIndex+1), - leftGridChain->getInnerIndex(leftGridChainStartIndex+1), - pStream, - 0 /*the grid line is below the trim lines*/ - ); - - /*monotone triangulate the remaining left chain togther with the - *two vertices on the two grid v-lines. - */ - Real vert[2][2]; - vert[0][0]=vert[1][0] = leftGridChain->getInner_u_value(leftGridChainStartIndex+1); - vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); - vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); - -// vertexArray right(vert, 2); - - monoTriangulation2( - &vert[0][0], /*top vertex */ - &vert[1][0], /*bottom vertex*/ - leftChain, - /*beginLeftIndex*/j-1, - i+1, - 1, /*an increasing chain*/ - pStream); - } - else /*the second one is shorter than the first one to the left*/ - { - /*find the maximal U-monotone chain of beginLeftIndex, beginLeftIndex+1,..., - */ - i=beginLeftIndex; - Real prevU = leftChain->getVertex(i)[0]; - for(i=beginLeftIndex+1; i<=endLeftIndex; i++){ - Real thisU = leftChain->getVertex(i)[0]; - - if(prevU < thisU){ - prevU = thisU; - } - else - break; - } - /*from beginLeftIndex to i-1 is strictly U-monotone*/ - - - stripOfFanLeft(leftChain, i-1, beginLeftIndex, leftGridChain->getGrid(), - leftGridChain->getVlineIndex(leftGridChainStartIndex), - leftGridChain->getUlineIndex(leftGridChainStartIndex), - leftGridChain->getUlineIndex(leftGridChainStartIndex+1), - pStream, - 1 /*the grid line is above the trim lines*/ - ); - /*monotone triangulate the remaining left chain together with the - *two vertices on the two grid v-lines. - */ - Real vert[2][2]; - vert[0][0]=vert[1][0] = leftGridChain->get_u_value(leftGridChainStartIndex+1); - vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); - vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); - - vertexArray right(vert, 2); - - monoTriangulation2( - &vert[0][0], //top vertex - &vert[1][0], //bottom vertex - leftChain, - i-1, - endLeftIndex, - 1, /*an increase chain*/ - pStream); - - } -} - -/*n_upper>=1 - *n_lower>=1 - */ -void triangulateXYMono(Int n_upper, Real upperVerts[][2], - Int n_lower, Real lowerVerts[][2], - primStream* pStream) -{ - Int i,j,k,l; - Real* leftMostV; - - assert(n_upper>=1 && n_lower>=1); - if(upperVerts[0][0] <= lowerVerts[0][0]) - { - i=1; - j=0; - leftMostV = upperVerts[0]; - } - else - { - i=0; - j=1; - leftMostV = lowerVerts[0]; - } - - while(1) - { - if(i >= n_upper) /*case1: no more in upper*/ - { - - if(jbegin(); - pStream->insert(leftMostV); - while(jinsert(lowerVerts[j]); - j++; - } - pStream->end(PRIMITIVE_STREAM_FAN); - } - - break; - } - else if(j>= n_lower) /*case2: no more in lower*/ - { - - if(ibegin(); - pStream->insert(leftMostV); - - for(k=n_upper-1; k>=i; k--) - pStream->insert(upperVerts[k]); - - pStream->end(PRIMITIVE_STREAM_FAN); - } - - break; - } - else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ - { - - if(upperVerts[i][0] <= lowerVerts[j][0]) - { - pStream->begin(); - pStream->insert(lowerVerts[j]); /*the origin of this fan*/ - - /*find the last k>=i such that - *upperverts[k][0] <= lowerverts[j][0] - */ - k=i; - while(k lowerVerts[j][0]) - break; - k++; - } - k--; - for(l=k; l>=i; l--)/*the reverse is for two-face lighting*/ - { - pStream->insert(upperVerts[l]); - } - pStream->insert(leftMostV); - - pStream->end(PRIMITIVE_STREAM_FAN); - //update i for next loop - i = k+1; - leftMostV = upperVerts[k]; - - } - else /*upperVerts[i][0] > lowerVerts[j][0]*/ - { - pStream->begin(); - pStream->insert(upperVerts[i]);/*the origion of this fan*/ - pStream->insert(leftMostV); - /*find the last k>=j such that - *lowerverts[k][0] < upperverts[i][0]*/ - k=j; - while(k< n_lower) - { - if(lowerVerts[k][0] >= upperVerts[i][0]) - break; - pStream->insert(lowerVerts[k]); - k++; - } - pStream->end(PRIMITIVE_STREAM_FAN); - j=k; - leftMostV = lowerVerts[j-1]; - } - } - } -} - - -void stripOfFanLeft(vertexArray* leftChain, - Int largeIndex, - Int smallIndex, - gridWrap* grid, - Int vlineIndex, - Int ulineSmallIndex, - Int ulineLargeIndex, - primStream* pStream, - Int gridLineUp /*1 if the grid line is above the trim lines*/ - ) -{ - assert(largeIndex >= smallIndex); - - Real grid_v_value; - grid_v_value = grid->get_v_value(vlineIndex); - - Real2* trimVerts=(Real2*) malloc(sizeof(Real2)* (largeIndex-smallIndex+1)); - assert(trimVerts); - - - Real2* gridVerts=(Real2*) malloc(sizeof(Real2)* (ulineLargeIndex-ulineSmallIndex+1)); - assert(gridVerts); - - Int k,i; - if(gridLineUp) /*trim line is below grid line, so trim vertices are going right when index increases*/ - for(k=0, i=smallIndex; i<=largeIndex; i++, k++) - { - trimVerts[k][0] = leftChain->getVertex(i)[0]; - trimVerts[k][1] = leftChain->getVertex(i)[1]; - } - else - for(k=0, i=largeIndex; i>=smallIndex; i--, k++) - { - trimVerts[k][0] = leftChain->getVertex(i)[0]; - trimVerts[k][1] = leftChain->getVertex(i)[1]; - } - - for(k=0, i=ulineSmallIndex; i<= ulineLargeIndex; i++, k++) - { - gridVerts[k][0] = grid->get_u_value(i); - gridVerts[k][1] = grid_v_value; - } - - if(gridLineUp) - triangulateXYMono( - ulineLargeIndex-ulineSmallIndex+1, gridVerts, - largeIndex-smallIndex+1, trimVerts, - pStream); - else - triangulateXYMono(largeIndex-smallIndex+1, trimVerts, - ulineLargeIndex-ulineSmallIndex+1, gridVerts, - pStream); - free(trimVerts); - free(gridVerts); -} - - - - - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.h deleted file mode 100644 index 3a5fa6c91b..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampleMonoPoly.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLEMONOPOLY_H -#define _SAMPLEMONOPOLY_H - -#include "monoTriangulation.h" -#include "gridWrap.h" -#include "rectBlock.h" - - -void triangulateXYMono(Int n_upper, Real upperVerts[][2], - Int n_lower, Real lowerVerts[][2], - primStream* pStream); - -void stripOfFanLeft(vertexArray* leftChain, - Int largeIndex, - Int smallIndex, - gridWrap* grid, - Int vlineIndex, - Int ulineSmallIndex, - Int ulineLargeIndex, - primStream* pStream, - Int gridLineUp - ); -void sampleLeftOneGridStep(vertexArray* leftChain, - Int beginLeftIndex, - Int endLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - primStream* pStream - ); - -void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], - gridBoundaryChain* gridChain, - Int beginIndex, - Int endIndex, - primStream* pStream); - -void sampleLeftStripRec(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ); - -void sampleLeftStrip(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ); - -void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner); - -void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_inner); - -void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlinear, primStream *pStream, rectBlockArray* rbArray); - -void sampleMonoPolyRec( - Real* topVertex, - Real* botVertex, - vertexArray* leftChain, - Int leftStartIndex, - vertexArray* rightChain, - Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridStartIndex, - primStream* pStream, - rectBlockArray* rbArray - ); - -void sampleLeftStripRecF(vertexArray* leftChain, - Int topLeftIndex, - Int botLeftIndex, - gridBoundaryChain* leftGridChain, - Int leftGridChainStartIndex, - Int leftGridChainEndIndex, - primStream* pStream - ); - -void findUpCorners(Real *topVertex, - vertexArray *leftChain, - Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, - Int rightChainStartIndex, Int rightChainEndIndex, - Real v, - Real uleft, - Real uright, - Int& ret_leftCornerWhere, - Int& ret_leftCornerIndex, - Int& ret_rightCornerWhere, - Int& ret_rightCornerIndex - ); -void findDownCorners(Real *botVertex, - vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, - Real v, - Real uleft, - Real uright, - Int& ret_leftCornerWhere, - Int& ret_leftCornerIndex, - Int& ret_rightCornerWhere, - Int& ret_rightCornerIndex - ); -void findNeck(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, - Int& leftLastIndex, /*left point of the neck*/ - Int& rightLastIndex /*right point of the neck*/ - ); - -Int findNeckF(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridStartIndex, - Int& neckLeft, - Int& neckRight); - -void findTopAndBot(directedLine* polygon, - directedLine*& topV, - directedLine*& botV); -void findGridChains(directedLine* top, directedLine* bot, - gridWrap* grid, - gridBoundaryChain*& leftGridChain, - gridBoundaryChain*& rightGridChain); -void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain); - -void drawCorners( - Real* topV, Real* botV, - vertexArray* leftChain, - vertexArray* rightChain, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, - Int gridIndex1, - Int gridIndex2, - Int leftCornerWhere, - Int leftCornerIndex, - Int rightCornerWhere, - Int rightCornerIndex, - Int bot_leftCornerWhere, - Int bot_leftCornerIndex, - Int bot_rightCornerWhere, - Int bot_rightCornerIndex); - -Int checkMiddle(vertexArray* chain, Int begin, Int end, - Real vup, Real vbelow); - -#endif - diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.cc b/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.cc deleted file mode 100644 index 6253a7c09d..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.cc +++ /dev/null @@ -1,179 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include //for fabs() -#include "glimports.h" -#include "zlassert.h" -#include "sampledLine.h" - -void sampledLine::setPoint(Int i, Real p[2]) -{ - points[i][0]=p[0]; - points[i][1]=p[1]; -} - - -/*insert this single line in front of the oldList*/ -sampledLine* sampledLine::insert(sampledLine *oldList) -{ - next = oldList; - return this; -} - -void sampledLine::deleteList() -{ - sampledLine *temp, *tempNext; - for(temp = this; temp != NULL; temp = tempNext) - { - tempNext = temp->next; - delete temp; - } -} - - -/*space of points[][2] is allocated*/ -sampledLine::sampledLine(Int n_points) -{ - npoints = n_points; - points = (Real2*) malloc(sizeof(Real2) * n_points); - assert(points); - next = NULL; -} - -/*space of points[][2] is allocated and - *points are copied - */ -sampledLine::sampledLine(Int n_points, Real2 pts[]) -{ - int i; - npoints = n_points; - points = (Real2*) malloc(sizeof(Real2) * n_points); - assert(points); - for(i=0; i nv) n = nu; - else - n = nv; - if(n<1) - n = 1; - //du dv could be negative - Real du = (points[npoints-1][0] - points[0][0])/n; - Real dv = (points[npoints-1][1] - points[0][1])/n; - Real2 *temp = (Real2*) malloc(sizeof(Real2) * (n+1)); - assert(temp); - - Real u,v; - for(i=0, u=points[0][0], v=points[0][1]; inext) - { - temp->tessellate(u_reso, v_reso); - } -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.h b/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.h deleted file mode 100644 index 2cc726948e..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/sampledLine.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SAMPLEDLINE_H -#define _SAMPLEDLINE_H - -#include "definitions.h" - -class sampledLine{ - Int npoints; - Real2 *points; - -public: - sampledLine(Int n_points); - sampledLine(Int n_points, Real pts[][2]); - sampledLine(Real pt1[2], Real pt2[2]); - sampledLine(); //special, careful about memory - ~sampledLine(); - - void init(Int n_points, Real2 *pts);//special, careful about memory - - void setPoint(Int i, Real p[2]) ; - - sampledLine* insert(sampledLine *nline); - void deleteList(); - - Int get_npoints() {return npoints;} - Real2* get_points() {return points;} - - //u_reso is number of segments (may not be integer) per unit u - void tessellate(Real u_reso, Real v_reso);//n segments - void tessellateAll(Real u_reso, Real v_reso); - - void print(); - - sampledLine* next; -}; - - - - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.cc b/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.cc deleted file mode 100644 index 1865755a48..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.cc +++ /dev/null @@ -1,282 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ -/* -*/ - -#include -#include -#include "zlassert.h" - -#include "searchTree.h" - -#define max(a,b) ((a>b)? a:b) - -treeNode* TreeNodeMake(void *key) -{ - treeNode *ret = (treeNode*) malloc(sizeof(treeNode)); - assert(ret); - ret->key = key; - ret->parent = NULL; - ret->left = NULL; - ret->right = NULL; - return ret; -} - -void TreeNodeDeleteSingleNode(treeNode* node) -{ - free(node); -} - -void TreeNodeDeleteWholeTree(treeNode* node) -{ - if(node == NULL) return; - TreeNodeDeleteWholeTree(node->left); - TreeNodeDeleteWholeTree(node->right); - TreeNodeDeleteSingleNode(node); -} - -void TreeNodePrint(treeNode* node, - void (*keyPrint) (void*)) -{ - if(node ==NULL) return; - TreeNodePrint(node->left, keyPrint); - keyPrint(node->key); - TreeNodePrint(node->right, keyPrint); -} - -int TreeNodeDepth(treeNode* root) -{ - if(root == NULL) return 0; - else{ - int leftdepth = TreeNodeDepth(root->left); - int rightdepth = TreeNodeDepth(root->right); - return 1 + max(leftdepth, rightdepth); - } -} - -/*return the node with the key. - *NULL is returned if not found - */ -treeNode* TreeNodeFind(treeNode* tree, void* key, - int (*compkey) (void*, void*)) -{ - if(tree == NULL) - return NULL; - if(key == tree->key) - return tree; - else if(compkey(key, tree->key) < 0) - return TreeNodeFind(tree->left, key, compkey); - else - return TreeNodeFind(tree->right, key, compkey); -} - - -treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, - int (*compkey) (void *, void *)) -{ - treeNode *y = NULL; - treeNode *x = root; - /*going down the tree from the root. - *x traces the path, y is the parent of x. - */ - while (x != NULL){ - y = x; - if(compkey(newnode->key,x->key) < 0) /*if newnode < x*/ - x = x->left; - else - x = x->right; - } - - /*now y has the property that - * if newnode < y, then y->left is NULL - * if newnode > y, then y->right is NULL. - *So we want to isnert newnode to be the child of y - */ - newnode->parent = y; - if(y == NULL) - return newnode; - else if( compkey(newnode->key, y->key) <0) - { - y->left = newnode; - } - else - { - y->right = newnode; - } - - return root; -} - -treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) -{ - treeNode* y; - treeNode* x; - treeNode* ret; - if(node==NULL) return tree; - - if(node->left == NULL || node->right == NULL) { - - y = node; - if(y->left != NULL) - x = y->left; - else - x = y->right; - - if( x != NULL) - x->parent = y->parent; - - if(y->parent == NULL) /*y is the root which has at most one child x*/ - ret = x; - else /*y is not the root*/ - { - if(y == y->parent->left) - y->parent->left = x; - else - y->parent->right = x; - ret = tree; - } - } - else { /*node has two children*/ - - y = TreeNodeSuccessor(node); - assert(y->left == NULL); - - if(y == node->right) /*y is the right child if node*/ - { - y->parent = node->parent; - y->left = node->left; - node->left->parent = y; - - } - else /*y != node->right*/ - { - x = y->right; - if(x!= NULL) - x->parent = y->parent; - - assert(y->parent != NULL); - if(y == y->parent->left) - y->parent->left = x; - else - y->parent->right = x; - /*move y to the position of node*/ - y->parent = node->parent; - y->left = node->left; - y->right = node->right; - node->left->parent = y; - node->right->parent = y; - } - if(node->parent != NULL) { - if(node->parent->left == node) - node->parent->left = y; - else - node->parent->right = y; - ret = tree; /*the root if the tree doesn't change*/ - } - else /*node->parent is NULL: node is the root*/ - ret = y; - } - - /*finally free the node, and return the new root*/ - TreeNodeDeleteSingleNode(node); - return ret; -} - - -/*the minimum node in the tree rooted by node - */ -treeNode* TreeNodeMinimum(treeNode* node) -{ - treeNode* temp = node; - if(temp == NULL) return NULL; - while(temp->left != NULL) { - temp = temp->left; - } - return temp; -} - -/*the maximum node in the tree rooted by node - */ -treeNode* TreeNodeMaximum(treeNode* node) -{ - treeNode* temp = node; - if(temp == NULL) return NULL; - while(temp->right != NULL) { - temp = temp->right; - } - return temp; -} - -/*return the first node (in sorted order) which is to the right of this node - */ -treeNode* TreeNodeSuccessor(treeNode* node) -{ - if(node == NULL) return NULL; - if(node->right != NULL) - return TreeNodeMinimum(node->right); - else{ /*node->right is NULL*/ - - /*find the first right-ancestor*/ - treeNode *y = node->parent; - treeNode* x = node; - while(y != NULL && x == y->right) /*if y is a left parent of x*/ - { - - x = y; - y = y->parent; - } - return y; - } -} - -/*return the first node (in sorted order) which is to the left of this node - */ -treeNode* TreeNodePredecessor(treeNode* node) -{ - if(node == NULL) return NULL; - if(node->left != NULL) - return TreeNodeMaximum(node->left); - else{ /*node->left is NULL*/ - /*find the first left-ancestor*/ - treeNode *y = node->parent; - treeNode *x = node; - while(y != NULL && x == y->left) /*if y is a right parent of x*/ - { - x = y; - y = y->parent; - } - return y; - } -} diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.h b/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.h deleted file mode 100644 index d5e33314bb..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/searchTree.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -#ifndef _SEARCHTREE_H -#define _SEARCHTREE_H - -typedef struct treeNode{ - void *key; - struct treeNode* parent; - struct treeNode* left; /*children*/ - struct treeNode* right; -} treeNode; - -treeNode* TreeNodeMake(void *key); -void TreeNodeDeleteSingleNode(treeNode* node); -void TreeNodeDeleteWholeTree(treeNode* node); -void TreeNodePrint(treeNode* node, - void (*keyPrint) (void*)); -int TreeNodeDepth(treeNode* root); -treeNode* TreeNodeMinimum(treeNode* node); -treeNode* TreeNodeMaximum(treeNode* node); -treeNode* TreeNodePredecessor(treeNode* node); -treeNode* TreeNodeSuccessor(treeNode* node); -treeNode* TreeNodeFind(treeNode* tree, void* key, - int (*compkey) (void*, void*)); - -treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, - int (*comp) (void *, void *)); -treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node); - - -#endif diff --git a/src/libs/mesa/glu/libnurbs/nurbtess/zlassert.h b/src/libs/mesa/glu/libnurbs/nurbtess/zlassert.h deleted file mode 100644 index b9c0732576..0000000000 --- a/src/libs/mesa/glu/libnurbs/nurbtess/zlassert.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -*/ - -/*XXXblythe this file should be deleted*/ -#include diff --git a/src/libs/mesa/glu/libtess/README b/src/libs/mesa/glu/libtess/README deleted file mode 100644 index 66a6011e25..0000000000 --- a/src/libs/mesa/glu/libtess/README +++ /dev/null @@ -1,446 +0,0 @@ -/* -*/ - -General Polygon Tesselation ---------------------------- - - This note describes a tesselator for polygons consisting of one or - more closed contours. It is backward-compatible with the current - OpenGL Utilities tesselator, and is intended to replace it. Here is - a summary of the major differences: - - - input contours can be intersecting, self-intersecting, or degenerate. - - - supports a choice of several winding rules for determining which parts - of the polygon are on the "interior". This makes it possible to do - CSG operations on polygons. - - - boundary extraction: instead of tesselating the polygon, returns a - set of closed contours which separate the interior from the exterior. - - - returns the output as a small number of triangle fans and strips, - rather than a list of independent triangles (when possible). - - - output is available as an explicit mesh (a quad-edge structure), - in addition to the normal callback interface. - - - the algorithm used is extremely robust. - - -The interface -------------- - - The tesselator state is maintained in a "tesselator object". - These are allocated and destroyed using - - GLUtesselator *gluNewTess( void ); - void gluDeleteTess( GLUtesselator *tess ); - - Several tesselator objects may be used simultaneously. - - Inputs - ------ - - The input contours are specified with the following routines: - - void gluTessBeginPolygon( GLUtesselator *tess ); - void gluTessBeginContour( GLUtesselator *tess ); - void gluTessVertex( GLUtesselator *tess, GLUcoord coords[3], void *data ); - void gluTessEndContour( GLUtesselator *tess ); - void gluTessEndPolygon( GLUtesselator *tess ); - - Within each BeginPolygon/EndPolygon pair, there can be zero or more - calls to BeginContour/EndContour. Within each contour, there are zero - or more calls to gluTessVertex(). The vertices specify a closed - contour (the last vertex of each contour is automatically linked to - the first). - - "coords" give the coordinates of the vertex in 3-space. For useful - results, all vertices should lie in some plane, since the vertices - are projected onto a plane before tesselation. "data" is a pointer - to a user-defined vertex structure, which typically contains other - information such as color, texture coordinates, normal, etc. It is - used to refer to the vertex during rendering. - - The library can be compiled in single- or double-precision; the type - GLUcoord represents either "float" or "double" accordingly. The GLU - version will be available in double-precision only. Compile with - GLU_TESS_API_FLOAT defined to get the single-precision version. - - When EndPolygon is called, the tesselation algorithm determines - which regions are interior to the given contours, according to one - of several "winding rules" described below. The interior regions - are then tesselated, and the output is provided as callbacks. - - - Rendering Callbacks - ------------------- - - Callbacks are specified by the client using - - void gluTessCallback( GLUtesselator *tess, GLenum which, void (*fn)()); - - If "fn" is NULL, any previously defined callback is discarded. - - The callbacks used to provide output are: /* which == */ - - void begin( GLenum type ); /* GLU_TESS_BEGIN */ - void edgeFlag( GLboolean flag ); /* GLU_TESS_EDGE_FLAG */ - void vertex( void *data ); /* GLU_TESS_VERTEX */ - void end( void ); /* GLU_TESS_END */ - - Any of the callbacks may be left undefined; if so, the corresponding - information will not be supplied during rendering. - - The "begin" callback indicates the start of a primitive; type is one - of GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES (but see the - notes on "boundary extraction" below). - - It is followed by any number of "vertex" callbacks, which supply the - vertices in the same order as expected by the corresponding glBegin() - call. After the last vertex of a given primitive, there is a callback - to "end". - - If the "edgeFlag" callback is provided, no triangle fans or strips - will be used. When edgeFlag is called, if "flag" is GL_TRUE then each - vertex which follows begins an edge which lies on the polygon boundary - (ie. an edge which separates an interior region from an exterior one). - If "flag" is GL_FALSE, each vertex which follows begins an edge which lies - in the polygon interior. "edgeFlag" will be called before the first - call to "vertex". - - Other Callbacks - --------------- - - void mesh( GLUmesh *mesh ); /* GLU_TESS_MESH */ - - - Returns an explicit mesh, represented using the quad-edge structure - (Guibas/Stolfi '85). Other implementations of this interface might - use a different mesh structure, so this is available only only as an - SGI extension. When the mesh is no longer needed, it should be freed - using - - void gluDeleteMesh( GLUmesh *mesh ); - - There is a brief description of this data structure in the include - file "mesh.h". For the full details, see L. Guibas and J. Stolfi, - Primitives for the manipulation of general subdivisions and the - computation of Voronoi diagrams, ACM Transactions on Graphics, - 4(2):74-123, April 1985. For an introduction, see the course notes - for CS348a, "Mathematical Foundations of Computer Graphics", - available at the Stanford bookstore (and taught during the fall - quarter). - - void error( GLenum errno ); /* GLU_TESS_ERROR */ - - - errno is one of GLU_TESS_MISSING_BEGIN_POLYGON, - GLU_TESS_MISSING_END_POLYGON, - GLU_TESS_MISSING_BEGIN_CONTOUR, - GLU_TESS_MISSING_END_CONTOUR, - GLU_TESS_COORD_TOO_LARGE, - GLU_TESS_NEED_COMBINE_CALLBACK - - The first four are obvious. The interface recovers from these - errors by inserting the missing call(s). - - GLU_TESS_COORD_TOO_LARGE says that some vertex coordinate exceeded - the predefined constant GLU_TESS_MAX_COORD in absolute value, and - that the value has been clamped. (Coordinate values must be small - enough so that two can be multiplied together without overflow.) - - GLU_TESS_NEED_COMBINE_CALLBACK says that the algorithm detected an - intersection between two edges in the input data, and the "combine" - callback (below) was not provided. No output will be generated. - - - void combine( GLUcoord coords[3], void *data[4], /* GLU_TESS_COMBINE */ - GLUcoord weight[4], void **outData ); - - - When the algorithm detects an intersection, or wishes to merge - features, it needs to create a new vertex. The vertex is defined - as a linear combination of up to 4 existing vertices, referenced - by data[0..3]. The coefficients of the linear combination are - given by weight[0..3]; these weights always sum to 1.0. All vertex - pointers are valid even when some of the weights are zero. - "coords" gives the location of the new vertex. - - The user must allocate another vertex, interpolate parameters - using "data" and "weights", and return the new vertex pointer in - "outData". This handle is supplied during rendering callbacks. - For example, if the polygon lies in an arbitrary plane in 3-space, - and we associate a color with each vertex, the combine callback might - look like this: - - void myCombine( GLUcoord coords[3], VERTEX *d[4], - GLUcoord w[4], VERTEX **dataOut ) - { - VERTEX *new = new_vertex(); - - new->x = coords[0]; - new->y = coords[1]; - new->z = coords[2]; - new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r; - new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g; - new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b; - new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a; - *dataOut = new; - } - - If the algorithm detects an intersection, then the "combine" callback - must be defined, and must write a non-NULL pointer into "dataOut". - Otherwise the GLU_TESS_NEED_COMBINE_CALLBACK error occurs, and no - output is generated. This is the only error that can occur during - tesselation and rendering. - - - Control over Tesselation - ------------------------ - - void gluTessProperty( GLUtesselator *tess, GLenum which, GLUcoord value ); - - Properties defined: - - - GLU_TESS_WINDING_RULE. Possible values: - - GLU_TESS_WINDING_ODD - GLU_TESS_WINDING_NONZERO - GLU_TESS_WINDING_POSITIVE - GLU_TESS_WINDING_NEGATIVE - GLU_TESS_WINDING_ABS_GEQ_TWO - - The input contours parition the plane into regions. A winding - rule determines which of these regions are inside the polygon. - - For a single contour C, the winding number of a point x is simply - the signed number of revolutions we make around x as we travel - once around C (where CCW is positive). When there are several - contours, the individual winding numbers are summed. This - procedure associates a signed integer value with each point x in - the plane. Note that the winding number is the same for all - points in a single region. - - The winding rule classifies a region as "inside" if its winding - number belongs to the chosen category (odd, nonzero, positive, - negative, or absolute value of at least two). The current GLU - tesselator implements the "odd" rule. The "nonzero" rule is another - common way to define the interior. The other three rules are - useful for polygon CSG operations (see below). - - - GLU_TESS_BOUNDARY_ONLY. Values: TRUE (non-zero) or FALSE (zero). - - If TRUE, returns a set of closed contours which separate the - polygon interior and exterior (rather than a tesselation). - Exterior contours are oriented CCW with respect to the normal, - interior contours are oriented CW. The GLU_TESS_BEGIN callback - uses the type GL_LINE_LOOP for each contour. - - - GLU_TESS_TOLERANCE. Value: a real number between 0.0 and 1.0. - - This specifies a tolerance for merging features to reduce the size - of the output. For example, two vertices which are very close to - each other might be replaced by a single vertex. The tolerance - is multiplied by the largest coordinate magnitude of any input vertex; - this specifies the maximum distance that any feature can move as the - result of a single merge operation. If a single feature takes part - in several merge operations, the total distance moved could be larger. - - Feature merging is completely optional; the tolerance is only a hint. - The implementation is free to merge in some cases and not in others, - or to never merge features at all. The default tolerance is zero. - - The current implementation merges vertices only if they are exactly - coincident, regardless of the current tolerance. A vertex is - spliced into an edge only if the implementation is unable to - distinguish which side of the edge the vertex lies on. - Two edges are merged only when both endpoints are identical. - - - void gluTessNormal( GLUtesselator *tess, - GLUcoord x, GLUcoord y, GLUcoord z ) - - - Lets the user supply the polygon normal, if known. All input data - is projected into a plane perpendicular to the normal before - tesselation. All output triangles are oriented CCW with - respect to the normal (CW orientation can be obtained by - reversing the sign of the supplied normal). For example, if - you know that all polygons lie in the x-y plane, call - "gluTessNormal(tess, 0.0, 0.0, 1.0)" before rendering any polygons. - - - If the supplied normal is (0,0,0) (the default value), the - normal is determined as follows. The direction of the normal, - up to its sign, is found by fitting a plane to the vertices, - without regard to how the vertices are connected. It is - expected that the input data lies approximately in plane; - otherwise projection perpendicular to the computed normal may - substantially change the geometry. The sign of the normal is - chosen so that the sum of the signed areas of all input contours - is non-negative (where a CCW contour has positive area). - - - The supplied normal persists until it is changed by another - call to gluTessNormal. - - - Backward compatibility with the GLU tesselator - ---------------------------------------------- - - The preferred interface is the one described above. The following - routines are obsolete, and are provided only for backward compatibility: - - typedef GLUtesselator GLUtriangulatorObj; /* obsolete name */ - - void gluBeginPolygon( GLUtesselator *tess ); - void gluNextContour( GLUtesselator *tess, GLenum type ); - void gluEndPolygon( GLUtesselator *tess ); - - "type" is one of GLU_EXTERIOR, GLU_INTERIOR, GLU_CCW, GLU_CW, or - GLU_UNKNOWN. It is ignored by the current GLU tesselator. - - GLU_BEGIN, GLU_VERTEX, GLU_END, GLU_ERROR, and GLU_EDGE_FLAG are defined - as synonyms for GLU_TESS_BEGIN, GLU_TESS_VERTEX, GLU_TESS_END, - GLU_TESS_ERROR, and GLU_TESS_EDGE_FLAG. - - -Polygon CSG operations ----------------------- - - The features of the tesselator make it easy to find the union, difference, - or intersection of several polygons. - - First, assume that each polygon is defined so that the winding number - is 0 for each exterior region, and 1 for each interior region. Under - this model, CCW contours define the outer boundary of the polygon, and - CW contours define holes. Contours may be nested, but a nested - contour must be oriented oppositely from the contour that contains it. - - If the original polygons do not satisfy this description, they can be - converted to this form by first running the tesselator with the - GLU_TESS_BOUNDARY_ONLY property turned on. This returns a list of - contours satisfying the restriction above. By allocating two - tesselator objects, the callbacks from one tesselator can be fed - directly to the input of another. - - Given two or more polygons of the form above, CSG operations can be - implemented as follows: - - Union - Draw all the input contours as a single polygon. The winding number - of each resulting region is the number of original polygons - which cover it. The union can be extracted using the - GLU_TESS_WINDING_NONZERO or GLU_TESS_WINDING_POSITIVE winding rules. - Note that with the nonzero rule, we would get the same result if - all contour orientations were reversed. - - Intersection (two polygons at a time only) - Draw a single polygon using the contours from both input polygons. - Extract the result using GLU_TESS_WINDING_ABS_GEQ_TWO. (Since this - winding rule looks at the absolute value, reversing all contour - orientations does not change the result.) - - Difference - - Suppose we want to compute A \ (B union C union D). Draw a single - polygon consisting of the unmodified contours from A, followed by - the contours of B,C,D with the vertex order reversed (this changes - the winding number of the interior regions to -1). To extract the - result, use the GLU_TESS_WINDING_POSITIVE rule. - - If B,C,D are the result of a GLU_TESS_BOUNDARY_ONLY call, an - alternative to reversing the vertex order is to reverse the sign of - the supplied normal. For example in the x-y plane, call - gluTessNormal( tess, 0.0, 0.0, -1.0 ). - - -Performance ------------ - - The tesselator is not intended for immediate-mode rendering; when - possible the output should be cached in a user structure or display - list. General polygon tesselation is an inherently difficult problem, - especially given the goal of extreme robustness. - - The implementation makes an effort to output a small number of fans - and strips; this should improve the rendering performance when the - output is used in a display list. - - Single-contour input polygons are first tested to see whether they can - be rendered as a triangle fan with respect to the first vertex (to - avoid running the full decomposition algorithm on convex polygons). - Non-convex polygons may be rendered by this "fast path" as well, if - the algorithm gets lucky in its choice of a starting vertex. - - For best performance follow these guidelines: - - - supply the polygon normal, if available, using gluTessNormal(). - This represents about 10% of the computation time. For example, - if all polygons lie in the x-y plane, use gluTessNormal(tess,0,0,1). - - - render many polygons using the same tesselator object, rather than - allocating a new tesselator for each one. (In a multi-threaded, - multi-processor environment you may get better performance using - several tesselators.) - - -Comparison with the GLU tesselator ----------------------------------- - - On polygons which make it through the "fast path", the tesselator is - 3 to 5 times faster than the GLU tesselator. - - On polygons which don't make it through the fast path (but which don't - have self-intersections or degeneracies), it is about 2 times slower. - - On polygons with self-intersections or degeneraces, there is nothing - to compare against. - - The new tesselator generates many more fans and strips, reducing the - number of vertices that need to be sent to the hardware. - - Key to the statistics: - - vert number of input vertices on all contours - cntr number of input contours - tri number of triangles in all output primitives - strip number of triangle strips - fan number of triangle fans - ind number of independent triangles - ms number of milliseconds for tesselation - (on a 150MHz R4400 Indy) - - Convex polygon examples: - -New: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.0459 ms -Old: 3 vert, 1 cntr, 1 tri, 0 strip, 0 fan, 1 ind, 0.149 ms -New: 4 vert, 1 cntr, 2 tri, 0 strip, 1 fan, 0 ind, 0.0459 ms -Old: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.161 ms -New: 36 vert, 1 cntr, 34 tri, 0 strip, 1 fan, 0 ind, 0.153 ms -Old: 36 vert, 1 cntr, 34 tri, 0 strip, 0 fan, 34 ind, 0.621 ms - - Concave single-contour polygons: - -New: 5 vert, 1 cntr, 3 tri, 0 strip, 1 fan, 0 ind, 0.052 ms -Old: 5 vert, 1 cntr, 3 tri, 0 strip, 0 fan, 3 ind, 0.252 ms -New: 19 vert, 1 cntr, 17 tri, 2 strip, 2 fan, 1 ind, 0.911 ms -Old: 19 vert, 1 cntr, 17 tri, 0 strip, 0 fan, 17 ind, 0.529 ms -New: 151 vert, 1 cntr, 149 tri, 13 strip, 18 fan, 3 ind, 6.82 ms -Old: 151 vert, 1 cntr, 149 tri, 0 strip, 3 fan, 143 ind, 2.7 ms -New: 574 vert, 1 cntr, 572 tri, 59 strip, 54 fan, 11 ind, 26.6 ms -Old: 574 vert, 1 cntr, 572 tri, 0 strip, 31 fan, 499 ind, 12.4 ms - - Multiple contours, but no intersections: - -New: 7 vert, 2 cntr, 7 tri, 1 strip, 0 fan, 0 ind, 0.527 ms -Old: 7 vert, 2 cntr, 7 tri, 0 strip, 0 fan, 7 ind, 0.274 ms -New: 81 vert, 6 cntr, 89 tri, 9 strip, 7 fan, 6 ind, 3.88 ms -Old: 81 vert, 6 cntr, 89 tri, 0 strip, 13 fan, 61 ind, 2.2 ms -New: 391 vert, 19 cntr, 413 tri, 37 strip, 32 fan, 26 ind, 20.2 ms -Old: 391 vert, 19 cntr, 413 tri, 0 strip, 25 fan, 363 ind, 8.68 ms - - Self-intersecting and degenerate examples: - -Bowtie: 4 vert, 1 cntr, 2 tri, 0 strip, 0 fan, 2 ind, 0.483 ms -Star: 5 vert, 1 cntr, 5 tri, 0 strip, 0 fan, 5 ind, 0.91 ms -Random: 24 vert, 7 cntr, 46 tri, 2 strip, 12 fan, 7 ind, 5.32 ms -Font: 333 vert, 2 cntr, 331 tri, 32 strip, 16 fan, 3 ind, 14.1 ms -: 167 vert, 35 cntr, 254 tri, 8 strip, 56 fan, 52 ind, 46.3 ms -: 78 vert, 1 cntr, 2675 tri, 148 strip, 207 fan, 180 ind, 243 ms -: 12480 vert, 2 cntr, 12478 tri, 736 strip,1275 fan, 5 ind, 1010 ms diff --git a/src/libs/mesa/glu/libtess/alg-outline b/src/libs/mesa/glu/libtess/alg-outline deleted file mode 100644 index 33fd69728a..0000000000 --- a/src/libs/mesa/glu/libtess/alg-outline +++ /dev/null @@ -1,228 +0,0 @@ -/* -*/ - -This is only a very brief overview. There is quite a bit of -additional documentation in the source code itself. - - -Goals of robust tesselation ---------------------------- - -The tesselation algorithm is fundamentally a 2D algorithm. We -initially project all data into a plane; our goal is to robustly -tesselate the projected data. The same topological tesselation is -then applied to the input data. - -Topologically, the output should always be a tesselation. If the -input is even slightly non-planar, then some triangles will -necessarily be back-facing when viewed from some angles, but the goal -is to minimize this effect. - -The algorithm needs some capability of cleaning up the input data as -well as the numerical errors in its own calculations. One way to do -this is to specify a tolerance as defined above, and clean up the -input and output during the line sweep process. At the very least, -the algorithm must handle coincident vertices, vertices incident to an -edge, and coincident edges. - - -Phases of the algorithm ------------------------ - -1. Find the polygon normal N. -2. Project the vertex data onto a plane. It does not need to be - perpendicular to the normal, eg. we can project onto the plane - perpendicular to the coordinate axis whose dot product with N - is largest. -3. Using a line-sweep algorithm, partition the plane into x-monotone - regions. Any vertical line intersects an x-monotone region in - at most one interval. -4. Triangulate the x-monotone regions. -5. Group the triangles into strips and fans. - - -Finding the normal vector -------------------------- - -A common way to find a polygon normal is to compute the signed area -when the polygon is projected along the three coordinate axes. We -can't do this, since contours can have zero area without being -degenerate (eg. a bowtie). - -We fit a plane to the vertex data, ignoring how they are connected -into contours. Ideally this would be a least-squares fit; however for -our purpose the accuracy of the normal is not important. Instead we -find three vertices which are widely separated, and compute the normal -to the triangle they form. The vertices are chosen so that the -triangle has an area at least 1/sqrt(3) times the largest area of any -triangle formed using the input vertices. - -The contours do affect the orientation of the normal; after computing -the normal, we check that the sum of the signed contour areas is -non-negative, and reverse the normal if necessary. - - -Projecting the vertices ------------------------ - -We project the vertices onto a plane perpendicular to one of the three -coordinate axes. This helps numerical accuracy by removing a -transformation step between the original input data and the data -processed by the algorithm. The projection also compresses the input -data; the 2D distance between vertices after projection may be smaller -than the original 2D distance. However by choosing the coordinate -axis whose dot product with the normal is greatest, the compression -factor is at most 1/sqrt(3). - -Even though the *accuracy* of the normal is not that important (since -we are projecting perpendicular to a coordinate axis anyway), the -*robustness* of the computation is important. For example, if there -are many vertices which lie almost along a line, and one vertex V -which is well-separated from the line, then our normal computation -should involve V otherwise the results will be garbage. - -The advantage of projecting perpendicular to the polygon normal is -that computed intersection points will be as close as possible to -their ideal locations. To get this behavior, define TRUE_PROJECT. - - -The Line Sweep --------------- - -There are three data structures: the mesh, the event queue, and the -edge dictionary. - -The mesh is a "quad-edge" data structure which records the topology of -the current decomposition; for details see the include file "mesh.h". - -The event queue simply holds all vertices (both original and computed -ones), organized so that we can quickly extract the vertex with the -minimum x-coord (and among those, the one with the minimum y-coord). - -The edge dictionary describes the current intersection of the sweep -line with the regions of the polygon. This is just an ordering of the -edges which intersect the sweep line, sorted by their current order of -intersection. For each pair of edges, we store some information about -the monotone region between them -- these are call "active regions" -(since they are crossed by the current sweep line). - -The basic algorithm is to sweep from left to right, processing each -vertex. The processed portion of the mesh (left of the sweep line) is -a planar decomposition. As we cross each vertex, we update the mesh -and the edge dictionary, then we check any newly adjacent pairs of -edges to see if they intersect. - -A vertex can have any number of edges. Vertices with many edges can -be created as vertices are merged and intersection points are -computed. For unprocessed vertices (right of the sweep line), these -edges are in no particular order around the vertex; for processed -vertices, the topological ordering should match the geometric ordering. - -The vertex processing happens in two phases: first we process are the -left-going edges (all these edges are currently in the edge -dictionary). This involves: - - - deleting the left-going edges from the dictionary; - - relinking the mesh if necessary, so that the order of these edges around - the event vertex matches the order in the dictionary; - - marking any terminated regions (regions which lie between two left-going - edges) as either "inside" or "outside" according to their winding number. - -When there are no left-going edges, and the event vertex is in an -"interior" region, we need to add an edge (to split the region into -monotone pieces). To do this we simply join the event vertex to the -rightmost left endpoint of the upper or lower edge of the containing -region. - -Then we process the right-going edges. This involves: - - - inserting the edges in the edge dictionary; - - computing the winding number of any newly created active regions. - We can compute this incrementally using the winding of each edge - that we cross as we walk through the dictionary. - - relinking the mesh if necessary, so that the order of these edges around - the event vertex matches the order in the dictionary; - - checking any newly adjacent edges for intersection and/or merging. - -If there are no right-going edges, again we need to add one to split -the containing region into monotone pieces. In our case it is most -convenient to add an edge to the leftmost right endpoint of either -containing edge; however we may need to change this later (see the -code for details). - - -Invariants ----------- - -These are the most important invariants maintained during the sweep. -We define a function VertLeq(v1,v2) which defines the order in which -vertices cross the sweep line, and a function EdgeLeq(e1,e2; loc) -which says whether e1 is below e2 at the sweep event location "loc". -This function is defined only at sweep event locations which lie -between the rightmost left endpoint of {e1,e2}, and the leftmost right -endpoint of {e1,e2}. - -Invariants for the Edge Dictionary. - - - Each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2) - at any valid location of the sweep event. - - If EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2 - share a common endpoint. - - For each e in the dictionary, e->Dst has been processed but not e->Org. - - Each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org) - where "event" is the current sweep line event. - - No edge e has zero length. - - No two edges have identical left and right endpoints. - -Invariants for the Mesh (the processed portion). - - - The portion of the mesh left of the sweep line is a planar graph, - ie. there is *some* way to embed it in the plane. - - No processed edge has zero length. - - No two processed vertices have identical coordinates. - - Each "inside" region is monotone, ie. can be broken into two chains - of monotonically increasing vertices according to VertLeq(v1,v2) - - a non-invariant: these chains may intersect (slightly) due to - numerical errors, but this does not affect the algorithm's operation. - -Invariants for the Sweep. - - - If a vertex has any left-going edges, then these must be in the edge - dictionary at the time the vertex is processed. - - If an edge is marked "fixUpperEdge" (it is a temporary edge introduced - by ConnectRightVertex), then it is the only right-going edge from - its associated vertex. (This says that these edges exist only - when it is necessary.) - - -Robustness ----------- - -The key to the robustness of the algorithm is maintaining the -invariants above, especially the correct ordering of the edge -dictionary. We achieve this by: - - 1. Writing the numerical computations for maximum precision rather - than maximum speed. - - 2. Making no assumptions at all about the results of the edge - intersection calculations -- for sufficiently degenerate inputs, - the computed location is not much better than a random number. - - 3. When numerical errors violate the invariants, restore them - by making *topological* changes when necessary (ie. relinking - the mesh structure). - - -Triangulation and Grouping --------------------------- - -We finish the line sweep before doing any triangulation. This is -because even after a monotone region is complete, there can be further -changes to its vertex data because of further vertex merging. - -After triangulating all monotone regions, we want to group the -triangles into fans and strips. We do this using a greedy approach. -The triangulation itself is not optimized to reduce the number of -primitives; we just try to get a reasonable decomposition of the -computed triangulation. diff --git a/src/libs/mesa/glu/libtess/dict-list.h b/src/libs/mesa/glu/libtess/dict-list.h deleted file mode 100644 index 11331a76ed..0000000000 --- a/src/libs/mesa/glu/libtess/dict-list.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __dict_list_h_ -#define __dict_list_h_ - -/* Use #define's so that another heap implementation can use this one */ - -#define DictKey DictListKey -#define Dict DictList -#define DictNode DictListNode - -#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq) -#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict) - -#define dictSearch(dict,key) __gl_dictListSearch(dict,key) -#define dictInsert(dict,key) __gl_dictListInsert(dict,key) -#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key) -#define dictDelete(dict,node) __gl_dictListDelete(dict,node) - -#define dictKey(n) __gl_dictListKey(n) -#define dictSucc(n) __gl_dictListSucc(n) -#define dictPred(n) __gl_dictListPred(n) -#define dictMin(d) __gl_dictListMin(d) -#define dictMax(d) __gl_dictListMax(d) - - - -typedef void *DictKey; -typedef struct Dict Dict; -typedef struct DictNode DictNode; - -Dict *dictNewDict( - void *frame, - int (*leq)(void *frame, DictKey key1, DictKey key2) ); - -void dictDeleteDict( Dict *dict ); - -/* Search returns the node with the smallest key greater than or equal - * to the given key. If there is no such key, returns a node whose - * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc. - */ -DictNode *dictSearch( Dict *dict, DictKey key ); -DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ); -void dictDelete( Dict *dict, DictNode *node ); - -#define __gl_dictListKey(n) ((n)->key) -#define __gl_dictListSucc(n) ((n)->next) -#define __gl_dictListPred(n) ((n)->prev) -#define __gl_dictListMin(d) ((d)->head.next) -#define __gl_dictListMax(d) ((d)->head.prev) -#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k))) - - -/*** Private data structures ***/ - -struct DictNode { - DictKey key; - DictNode *next; - DictNode *prev; -}; - -struct Dict { - DictNode head; - void *frame; - int (*leq)(void *frame, DictKey key1, DictKey key2); -}; - -#endif diff --git a/src/libs/mesa/glu/libtess/dict.c b/src/libs/mesa/glu/libtess/dict.c deleted file mode 100644 index 49d4f759e7..0000000000 --- a/src/libs/mesa/glu/libtess/dict.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include -#include "dict-list.h" -#include "memalloc.h" - -/* really __gl_dictListNewDict */ -Dict *dictNewDict( void *frame, - int (*leq)(void *frame, DictKey key1, DictKey key2) ) -{ - Dict *dict = (Dict *) memAlloc( sizeof( Dict )); - DictNode *head; - - if (dict == NULL) return NULL; - - head = &dict->head; - - head->key = NULL; - head->next = head; - head->prev = head; - - dict->frame = frame; - dict->leq = leq; - - return dict; -} - -/* really __gl_dictListDeleteDict */ -void dictDeleteDict( Dict *dict ) -{ - DictNode *node, *next; - - for( node = dict->head.next; node != &dict->head; node = next ) { - next = node->next; - memFree( node ); - } - memFree( dict ); -} - -/* really __gl_dictListInsertBefore */ -DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ) -{ - DictNode *newNode; - - do { - node = node->prev; - } while( node->key != NULL && ! (*dict->leq)(dict->frame, node->key, key)); - - newNode = (DictNode *) memAlloc( sizeof( DictNode )); - if (newNode == NULL) return NULL; - - newNode->key = key; - newNode->next = node->next; - node->next->prev = newNode; - newNode->prev = node; - node->next = newNode; - - return newNode; -} - -/* really __gl_dictListDelete */ -void dictDelete( Dict *dict, DictNode *node ) /*ARGSUSED*/ -{ - node->next->prev = node->prev; - node->prev->next = node->next; - memFree( node ); -} - -/* really __gl_dictListSearch */ -DictNode *dictSearch( Dict *dict, DictKey key ) -{ - DictNode *node = &dict->head; - - do { - node = node->next; - } while( node->key != NULL && ! (*dict->leq)(dict->frame, key, node->key)); - - return node; -} diff --git a/src/libs/mesa/glu/libtess/dict.h b/src/libs/mesa/glu/libtess/dict.h deleted file mode 100644 index 11331a76ed..0000000000 --- a/src/libs/mesa/glu/libtess/dict.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __dict_list_h_ -#define __dict_list_h_ - -/* Use #define's so that another heap implementation can use this one */ - -#define DictKey DictListKey -#define Dict DictList -#define DictNode DictListNode - -#define dictNewDict(frame,leq) __gl_dictListNewDict(frame,leq) -#define dictDeleteDict(dict) __gl_dictListDeleteDict(dict) - -#define dictSearch(dict,key) __gl_dictListSearch(dict,key) -#define dictInsert(dict,key) __gl_dictListInsert(dict,key) -#define dictInsertBefore(dict,node,key) __gl_dictListInsertBefore(dict,node,key) -#define dictDelete(dict,node) __gl_dictListDelete(dict,node) - -#define dictKey(n) __gl_dictListKey(n) -#define dictSucc(n) __gl_dictListSucc(n) -#define dictPred(n) __gl_dictListPred(n) -#define dictMin(d) __gl_dictListMin(d) -#define dictMax(d) __gl_dictListMax(d) - - - -typedef void *DictKey; -typedef struct Dict Dict; -typedef struct DictNode DictNode; - -Dict *dictNewDict( - void *frame, - int (*leq)(void *frame, DictKey key1, DictKey key2) ); - -void dictDeleteDict( Dict *dict ); - -/* Search returns the node with the smallest key greater than or equal - * to the given key. If there is no such key, returns a node whose - * key is NULL. Similarly, Succ(Max(d)) has a NULL key, etc. - */ -DictNode *dictSearch( Dict *dict, DictKey key ); -DictNode *dictInsertBefore( Dict *dict, DictNode *node, DictKey key ); -void dictDelete( Dict *dict, DictNode *node ); - -#define __gl_dictListKey(n) ((n)->key) -#define __gl_dictListSucc(n) ((n)->next) -#define __gl_dictListPred(n) ((n)->prev) -#define __gl_dictListMin(d) ((d)->head.next) -#define __gl_dictListMax(d) ((d)->head.prev) -#define __gl_dictListInsert(d,k) (dictInsertBefore((d),&(d)->head,(k))) - - -/*** Private data structures ***/ - -struct DictNode { - DictKey key; - DictNode *next; - DictNode *prev; -}; - -struct Dict { - DictNode head; - void *frame; - int (*leq)(void *frame, DictKey key1, DictKey key2); -}; - -#endif diff --git a/src/libs/mesa/glu/libtess/geom.c b/src/libs/mesa/glu/libtess/geom.c deleted file mode 100644 index 7d3b8d8a6a..0000000000 --- a/src/libs/mesa/glu/libtess/geom.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include "mesh.h" -#include "geom.h" - -int __gl_vertLeq( GLUvertex *u, GLUvertex *v ) -{ - /* Returns TRUE if u is lexicographically <= v. */ - - return VertLeq( u, v ); -} - -GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) -{ - /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w), - * evaluates the t-coord of the edge uw at the s-coord of the vertex v. - * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v. - * If uw is vertical (and thus passes thru v), the result is zero. - * - * The calculation is extremely accurate and stable, even when v - * is very close to u or w. In particular if we set v->t = 0 and - * let r be the negated result (this evaluates (uw)(v->s)), then - * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t). - */ - GLdouble gapL, gapR; - - assert( VertLeq( u, v ) && VertLeq( v, w )); - - gapL = v->s - u->s; - gapR = w->s - v->s; - - if( gapL + gapR > 0 ) { - if( gapL < gapR ) { - return (v->t - u->t) + (u->t - w->t) * (gapL / (gapL + gapR)); - } else { - return (v->t - w->t) + (w->t - u->t) * (gapR / (gapL + gapR)); - } - } - /* vertical line */ - return 0; -} - -GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) -{ - /* Returns a number whose sign matches EdgeEval(u,v,w) but which - * is cheaper to evaluate. Returns > 0, == 0 , or < 0 - * as v is above, on, or below the edge uw. - */ - GLdouble gapL, gapR; - - assert( VertLeq( u, v ) && VertLeq( v, w )); - - gapL = v->s - u->s; - gapR = w->s - v->s; - - if( gapL + gapR > 0 ) { - return (v->t - w->t) * gapL + (v->t - u->t) * gapR; - } - /* vertical line */ - return 0; -} - - -/*********************************************************************** - * Define versions of EdgeSign, EdgeEval with s and t transposed. - */ - -GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) -{ - /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w), - * evaluates the t-coord of the edge uw at the s-coord of the vertex v. - * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v. - * If uw is vertical (and thus passes thru v), the result is zero. - * - * The calculation is extremely accurate and stable, even when v - * is very close to u or w. In particular if we set v->s = 0 and - * let r be the negated result (this evaluates (uw)(v->t)), then - * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s). - */ - GLdouble gapL, gapR; - - assert( TransLeq( u, v ) && TransLeq( v, w )); - - gapL = v->t - u->t; - gapR = w->t - v->t; - - if( gapL + gapR > 0 ) { - if( gapL < gapR ) { - return (v->s - u->s) + (u->s - w->s) * (gapL / (gapL + gapR)); - } else { - return (v->s - w->s) + (w->s - u->s) * (gapR / (gapL + gapR)); - } - } - /* vertical line */ - return 0; -} - -GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) -{ - /* Returns a number whose sign matches TransEval(u,v,w) but which - * is cheaper to evaluate. Returns > 0, == 0 , or < 0 - * as v is above, on, or below the edge uw. - */ - GLdouble gapL, gapR; - - assert( TransLeq( u, v ) && TransLeq( v, w )); - - gapL = v->t - u->t; - gapR = w->t - v->t; - - if( gapL + gapR > 0 ) { - return (v->s - w->s) * gapL + (v->s - u->s) * gapR; - } - /* vertical line */ - return 0; -} - - -int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w ) -{ - /* For almost-degenerate situations, the results are not reliable. - * Unless the floating-point arithmetic can be performed without - * rounding errors, *any* implementation will give incorrect results - * on some degenerate inputs, so the client must have some way to - * handle this situation. - */ - return (u->s*(v->t - w->t) + v->s*(w->t - u->t) + w->s*(u->t - v->t)) >= 0; -} - -/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b), - * or (x+y)/2 if a==b==0. It requires that a,b >= 0, and enforces - * this in the rare case that one argument is slightly negative. - * The implementation is extremely stable numerically. - * In particular it guarantees that the result r satisfies - * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate - * even when a and b differ greatly in magnitude. - */ -#define RealInterpolate(a,x,b,y) \ - (a = (a < 0) ? 0 : a, b = (b < 0) ? 0 : b, \ - ((a <= b) ? ((b == 0) ? ((x+y) / 2) \ - : (x + (y-x) * (a/(a+b)))) \ - : (y + (x-y) * (b/(a+b))))) - -#ifndef FOR_TRITE_TEST_PROGRAM -#define Interpolate(a,x,b,y) RealInterpolate(a,x,b,y) -#else - -/* Claim: the ONLY property the sweep algorithm relies on is that - * MIN(x,y) <= r <= MAX(x,y). This is a nasty way to test that. - */ -#include -extern int RandomInterpolate; - -GLdouble Interpolate( GLdouble a, GLdouble x, GLdouble b, GLdouble y) -{ -printf("*********************%d\n",RandomInterpolate); - if( RandomInterpolate ) { - a = 1.2 * drand48() - 0.1; - a = (a < 0) ? 0 : ((a > 1) ? 1 : a); - b = 1.0 - a; - } - return RealInterpolate(a,x,b,y); -} - -#endif - -#define Swap(a,b) if (1) { GLUvertex *t = a; a = b; b = t; } else - -void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1, - GLUvertex *o2, GLUvertex *d2, - GLUvertex *v ) -/* Given edges (o1,d1) and (o2,d2), compute their point of intersection. - * The computed point is guaranteed to lie in the intersection of the - * bounding rectangles defined by each edge. - */ -{ - GLdouble z1, z2; - - /* This is certainly not the most efficient way to find the intersection - * of two line segments, but it is very numerically stable. - * - * Strategy: find the two middle vertices in the VertLeq ordering, - * and interpolate the intersection s-value from these. Then repeat - * using the TransLeq ordering to find the intersection t-value. - */ - - if( ! VertLeq( o1, d1 )) { Swap( o1, d1 ); } - if( ! VertLeq( o2, d2 )) { Swap( o2, d2 ); } - if( ! VertLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); } - - if( ! VertLeq( o2, d1 )) { - /* Technically, no intersection -- do our best */ - v->s = (o2->s + d1->s) / 2; - } else if( VertLeq( d1, d2 )) { - /* Interpolate between o2 and d1 */ - z1 = EdgeEval( o1, o2, d1 ); - z2 = EdgeEval( o2, d1, d2 ); - if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } - v->s = Interpolate( z1, o2->s, z2, d1->s ); - } else { - /* Interpolate between o2 and d2 */ - z1 = EdgeSign( o1, o2, d1 ); - z2 = -EdgeSign( o1, d2, d1 ); - if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } - v->s = Interpolate( z1, o2->s, z2, d2->s ); - } - - /* Now repeat the process for t */ - - if( ! TransLeq( o1, d1 )) { Swap( o1, d1 ); } - if( ! TransLeq( o2, d2 )) { Swap( o2, d2 ); } - if( ! TransLeq( o1, o2 )) { Swap( o1, o2 ); Swap( d1, d2 ); } - - if( ! TransLeq( o2, d1 )) { - /* Technically, no intersection -- do our best */ - v->t = (o2->t + d1->t) / 2; - } else if( TransLeq( d1, d2 )) { - /* Interpolate between o2 and d1 */ - z1 = TransEval( o1, o2, d1 ); - z2 = TransEval( o2, d1, d2 ); - if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } - v->t = Interpolate( z1, o2->t, z2, d1->t ); - } else { - /* Interpolate between o2 and d2 */ - z1 = TransSign( o1, o2, d1 ); - z2 = -TransSign( o1, d2, d1 ); - if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; } - v->t = Interpolate( z1, o2->t, z2, d2->t ); - } -} diff --git a/src/libs/mesa/glu/libtess/geom.h b/src/libs/mesa/glu/libtess/geom.h deleted file mode 100644 index 5cb76c7d15..0000000000 --- a/src/libs/mesa/glu/libtess/geom.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __geom_h_ -#define __geom_h_ - -#include "mesh.h" - -#ifdef NO_BRANCH_CONDITIONS -/* MIPS architecture has special instructions to evaluate boolean - * conditions -- more efficient than branching, IF you can get the - * compiler to generate the right instructions (SGI compiler doesn't) - */ -#define VertEq(u,v) (((u)->s == (v)->s) & ((u)->t == (v)->t)) -#define VertLeq(u,v) (((u)->s < (v)->s) | \ - ((u)->s == (v)->s & (u)->t <= (v)->t)) -#else -#define VertEq(u,v) ((u)->s == (v)->s && (u)->t == (v)->t) -#define VertLeq(u,v) (((u)->s < (v)->s) || \ - ((u)->s == (v)->s && (u)->t <= (v)->t)) -#endif - -#define EdgeEval(u,v,w) __gl_edgeEval(u,v,w) -#define EdgeSign(u,v,w) __gl_edgeSign(u,v,w) - -/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */ - -#define TransLeq(u,v) (((u)->t < (v)->t) || \ - ((u)->t == (v)->t && (u)->s <= (v)->s)) -#define TransEval(u,v,w) __gl_transEval(u,v,w) -#define TransSign(u,v,w) __gl_transSign(u,v,w) - - -#define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org ) -#define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst ) - -#undef ABS -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t)) - -#define VertCCW(u,v,w) __gl_vertCCW(u,v,w) - -int __gl_vertLeq( GLUvertex *u, GLUvertex *v ); -GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ); -GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ); -GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ); -GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ); -int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w ); -void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1, - GLUvertex *o2, GLUvertex *d2, - GLUvertex *v ); - -#endif diff --git a/src/libs/mesa/glu/libtess/memalloc.c b/src/libs/mesa/glu/libtess/memalloc.c deleted file mode 100644 index 81879ef782..0000000000 --- a/src/libs/mesa/glu/libtess/memalloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "memalloc.h" -#include "string.h" - -int __gl_memInit( size_t maxFast ) -{ -#ifndef NO_MALLOPT -/* mallopt( M_MXFAST, maxFast );*/ -#ifdef MEMORY_DEBUG - mallopt( M_DEBUG, 1 ); -#endif -#endif - return 1; -} - -#ifdef MEMORY_DEBUG -void *__gl_memAlloc( size_t n ) -{ - return memset( malloc( n ), 0xa5, n ); -} -#endif - diff --git a/src/libs/mesa/glu/libtess/memalloc.h b/src/libs/mesa/glu/libtess/memalloc.h deleted file mode 100644 index c2f969b8be..0000000000 --- a/src/libs/mesa/glu/libtess/memalloc.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __memalloc_simple_h_ -#define __memalloc_simple_h_ - -#include - -#define memRealloc realloc -#define memFree free - -#define memInit __gl_memInit -/*extern void __gl_memInit( size_t );*/ -extern int __gl_memInit( size_t ); - -#ifndef MEMORY_DEBUG -#define memAlloc malloc -#else -#define memAlloc __gl_memAlloc -extern void * __gl_memAlloc( size_t ); -#endif - -#endif diff --git a/src/libs/mesa/glu/libtess/mesh.c b/src/libs/mesa/glu/libtess/mesh.c deleted file mode 100644 index ae861f8642..0000000000 --- a/src/libs/mesa/glu/libtess/mesh.c +++ /dev/null @@ -1,789 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include -#include "mesh.h" -#include "memalloc.h" - -#define TRUE 1 -#define FALSE 0 - -static GLUvertex *allocVertex() -{ - return (GLUvertex *)memAlloc( sizeof( GLUvertex )); -} - -static GLUface *allocFace() -{ - return (GLUface *)memAlloc( sizeof( GLUface )); -} - -/************************ Utility Routines ************************/ - -/* Allocate and free half-edges in pairs for efficiency. - * The *only* place that should use this fact is allocation/free. - */ -typedef struct { GLUhalfEdge e, eSym; } EdgePair; - -/* MakeEdge creates a new pair of half-edges which form their own loop. - * No vertex or face structures are allocated, but these must be assigned - * before the current edge operation is completed. - */ -static GLUhalfEdge *MakeEdge( GLUhalfEdge *eNext ) -{ - GLUhalfEdge *e; - GLUhalfEdge *eSym; - GLUhalfEdge *ePrev; - EdgePair *pair = (EdgePair *)memAlloc( sizeof( EdgePair )); - if (pair == NULL) return NULL; - - e = &pair->e; - eSym = &pair->eSym; - - /* Make sure eNext points to the first edge of the edge pair */ - if( eNext->Sym < eNext ) { eNext = eNext->Sym; } - - /* Insert in circular doubly-linked list before eNext. - * Note that the prev pointer is stored in Sym->next. - */ - ePrev = eNext->Sym->next; - eSym->next = ePrev; - ePrev->Sym->next = e; - e->next = eNext; - eNext->Sym->next = eSym; - - e->Sym = eSym; - e->Onext = e; - e->Lnext = eSym; - e->Org = NULL; - e->Lface = NULL; - e->winding = 0; - e->activeRegion = NULL; - - eSym->Sym = e; - eSym->Onext = eSym; - eSym->Lnext = e; - eSym->Org = NULL; - eSym->Lface = NULL; - eSym->winding = 0; - eSym->activeRegion = NULL; - - return e; -} - -/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the - * CS348a notes (see mesh.h). Basically it modifies the mesh so that - * a->Onext and b->Onext are exchanged. This can have various effects - * depending on whether a and b belong to different face or vertex rings. - * For more explanation see __gl_meshSplice() below. - */ -static void Splice( GLUhalfEdge *a, GLUhalfEdge *b ) -{ - GLUhalfEdge *aOnext = a->Onext; - GLUhalfEdge *bOnext = b->Onext; - - aOnext->Sym->Lnext = b; - bOnext->Sym->Lnext = a; - a->Onext = bOnext; - b->Onext = aOnext; -} - -/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the - * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives - * a place to insert the new vertex in the global vertex list. We insert - * the new vertex *before* vNext so that algorithms which walk the vertex - * list will not see the newly created vertices. - */ -static void MakeVertex( GLUvertex *newVertex, - GLUhalfEdge *eOrig, GLUvertex *vNext ) -{ - GLUhalfEdge *e; - GLUvertex *vPrev; - GLUvertex *vNew = newVertex; - - assert(vNew != NULL); - - /* insert in circular doubly-linked list before vNext */ - vPrev = vNext->prev; - vNew->prev = vPrev; - vPrev->next = vNew; - vNew->next = vNext; - vNext->prev = vNew; - - vNew->anEdge = eOrig; - vNew->data = NULL; - /* leave coords, s, t undefined */ - - /* fix other edges on this vertex loop */ - e = eOrig; - do { - e->Org = vNew; - e = e->Onext; - } while( e != eOrig ); -} - -/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left - * face of all edges in the face loop to which eOrig belongs. "fNext" gives - * a place to insert the new face in the global face list. We insert - * the new face *before* fNext so that algorithms which walk the face - * list will not see the newly created faces. - */ -static void MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLUface *fNext ) -{ - GLUhalfEdge *e; - GLUface *fPrev; - GLUface *fNew = newFace; - - assert(fNew != NULL); - - /* insert in circular doubly-linked list before fNext */ - fPrev = fNext->prev; - fNew->prev = fPrev; - fPrev->next = fNew; - fNew->next = fNext; - fNext->prev = fNew; - - fNew->anEdge = eOrig; - fNew->data = NULL; - fNew->trail = NULL; - fNew->marked = FALSE; - - /* The new face is marked "inside" if the old one was. This is a - * convenience for the common case where a face has been split in two. - */ - fNew->inside = fNext->inside; - - /* fix other edges on this face loop */ - e = eOrig; - do { - e->Lface = fNew; - e = e->Lnext; - } while( e != eOrig ); -} - -/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym), - * and removes from the global edge list. - */ -static void KillEdge( GLUhalfEdge *eDel ) -{ - GLUhalfEdge *ePrev, *eNext; - - /* Half-edges are allocated in pairs, see EdgePair above */ - if( eDel->Sym < eDel ) { eDel = eDel->Sym; } - - /* delete from circular doubly-linked list */ - eNext = eDel->next; - ePrev = eDel->Sym->next; - eNext->Sym->next = ePrev; - ePrev->Sym->next = eNext; - - memFree( eDel ); -} - - -/* KillVertex( vDel ) destroys a vertex and removes it from the global - * vertex list. It updates the vertex loop to point to a given new vertex. - */ -static void KillVertex( GLUvertex *vDel, GLUvertex *newOrg ) -{ - GLUhalfEdge *e, *eStart = vDel->anEdge; - GLUvertex *vPrev, *vNext; - - /* change the origin of all affected edges */ - e = eStart; - do { - e->Org = newOrg; - e = e->Onext; - } while( e != eStart ); - - /* delete from circular doubly-linked list */ - vPrev = vDel->prev; - vNext = vDel->next; - vNext->prev = vPrev; - vPrev->next = vNext; - - memFree( vDel ); -} - -/* KillFace( fDel ) destroys a face and removes it from the global face - * list. It updates the face loop to point to a given new face. - */ -static void KillFace( GLUface *fDel, GLUface *newLface ) -{ - GLUhalfEdge *e, *eStart = fDel->anEdge; - GLUface *fPrev, *fNext; - - /* change the left face of all affected edges */ - e = eStart; - do { - e->Lface = newLface; - e = e->Lnext; - } while( e != eStart ); - - /* delete from circular doubly-linked list */ - fPrev = fDel->prev; - fNext = fDel->next; - fNext->prev = fPrev; - fPrev->next = fNext; - - memFree( fDel ); -} - - -/****************** Basic Edge Operations **********************/ - -/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face). - * The loop consists of the two new half-edges. - */ -GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) -{ - GLUvertex *newVertex1= allocVertex(); - GLUvertex *newVertex2= allocVertex(); - GLUface *newFace= allocFace(); - GLUhalfEdge *e; - - /* if any one is null then all get freed */ - if (newVertex1 == NULL || newVertex2 == NULL || newFace == NULL) { - if (newVertex1 != NULL) memFree(newVertex1); - if (newVertex2 != NULL) memFree(newVertex2); - if (newFace != NULL) memFree(newFace); - return NULL; - } - - e = MakeEdge( &mesh->eHead ); - if (e == NULL) return NULL; - - MakeVertex( newVertex1, e, &mesh->vHead ); - MakeVertex( newVertex2, e->Sym, &mesh->vHead ); - MakeFace( newFace, e, &mesh->fHead ); - return e; -} - - -/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the - * mesh connectivity and topology. It changes the mesh so that - * eOrg->Onext <- OLD( eDst->Onext ) - * eDst->Onext <- OLD( eOrg->Onext ) - * where OLD(...) means the value before the meshSplice operation. - * - * This can have two effects on the vertex structure: - * - if eOrg->Org != eDst->Org, the two vertices are merged together - * - if eOrg->Org == eDst->Org, the origin is split into two vertices - * In both cases, eDst->Org is changed and eOrg->Org is untouched. - * - * Similarly (and independently) for the face structure, - * - if eOrg->Lface == eDst->Lface, one loop is split into two - * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one - * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected. - * - * Some special cases: - * If eDst == eOrg, the operation has no effect. - * If eDst == eOrg->Lnext, the new face will have a single edge. - * If eDst == eOrg->Lprev, the old face will have a single edge. - * If eDst == eOrg->Onext, the new vertex will have a single edge. - * If eDst == eOrg->Oprev, the old vertex will have a single edge. - */ -int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) -{ - int joiningLoops = FALSE; - int joiningVertices = FALSE; - - if( eOrg == eDst ) return 1; - - if( eDst->Org != eOrg->Org ) { - /* We are merging two disjoint vertices -- destroy eDst->Org */ - joiningVertices = TRUE; - KillVertex( eDst->Org, eOrg->Org ); - } - if( eDst->Lface != eOrg->Lface ) { - /* We are connecting two disjoint loops -- destroy eDst->Lface */ - joiningLoops = TRUE; - KillFace( eDst->Lface, eOrg->Lface ); - } - - /* Change the edge structure */ - Splice( eDst, eOrg ); - - if( ! joiningVertices ) { - GLUvertex *newVertex= allocVertex(); - if (newVertex == NULL) return 0; - - /* We split one vertex into two -- the new vertex is eDst->Org. - * Make sure the old vertex points to a valid half-edge. - */ - MakeVertex( newVertex, eDst, eOrg->Org ); - eOrg->Org->anEdge = eOrg; - } - if( ! joiningLoops ) { - GLUface *newFace= allocFace(); - if (newFace == NULL) return 0; - - /* We split one loop into two -- the new loop is eDst->Lface. - * Make sure the old face points to a valid half-edge. - */ - MakeFace( newFace, eDst, eOrg->Lface ); - eOrg->Lface->anEdge = eOrg; - } - - return 1; -} - - -/* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases: - * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop - * eDel->Lface is deleted. Otherwise, we are splitting one loop into two; - * the newly created loop will contain eDel->Dst. If the deletion of eDel - * would create isolated vertices, those are deleted as well. - * - * This function could be implemented as two calls to __gl_meshSplice - * plus a few calls to memFree, but this would allocate and delete - * unnecessary vertices and faces. - */ -int __gl_meshDelete( GLUhalfEdge *eDel ) -{ - GLUhalfEdge *eDelSym = eDel->Sym; - int joiningLoops = FALSE; - - /* First step: disconnect the origin vertex eDel->Org. We make all - * changes to get a consistent mesh in this "intermediate" state. - */ - if( eDel->Lface != eDel->Rface ) { - /* We are joining two loops into one -- remove the left face */ - joiningLoops = TRUE; - KillFace( eDel->Lface, eDel->Rface ); - } - - if( eDel->Onext == eDel ) { - KillVertex( eDel->Org, NULL ); - } else { - /* Make sure that eDel->Org and eDel->Rface point to valid half-edges */ - eDel->Rface->anEdge = eDel->Oprev; - eDel->Org->anEdge = eDel->Onext; - - Splice( eDel, eDel->Oprev ); - if( ! joiningLoops ) { - GLUface *newFace= allocFace(); - if (newFace == NULL) return 0; - - /* We are splitting one loop into two -- create a new loop for eDel. */ - MakeFace( newFace, eDel, eDel->Lface ); - } - } - - /* Claim: the mesh is now in a consistent state, except that eDel->Org - * may have been deleted. Now we disconnect eDel->Dst. - */ - if( eDelSym->Onext == eDelSym ) { - KillVertex( eDelSym->Org, NULL ); - KillFace( eDelSym->Lface, NULL ); - } else { - /* Make sure that eDel->Dst and eDel->Lface point to valid half-edges */ - eDel->Lface->anEdge = eDelSym->Oprev; - eDelSym->Org->anEdge = eDelSym->Onext; - Splice( eDelSym, eDelSym->Oprev ); - } - - /* Any isolated vertices or faces have already been freed. */ - KillEdge( eDel ); - - return 1; -} - - -/******************** Other Edge Operations **********************/ - -/* All these routines can be implemented with the basic edge - * operations above. They are provided for convenience and efficiency. - */ - - -/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that - * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex. - * eOrg and eNew will have the same left face. - */ -GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg ) -{ - GLUhalfEdge *eNewSym; - GLUhalfEdge *eNew = MakeEdge( eOrg ); - if (eNew == NULL) return NULL; - - eNewSym = eNew->Sym; - - /* Connect the new edge appropriately */ - Splice( eNew, eOrg->Lnext ); - - /* Set the vertex and face information */ - eNew->Org = eOrg->Dst; - { - GLUvertex *newVertex= allocVertex(); - if (newVertex == NULL) return NULL; - - MakeVertex( newVertex, eNewSym, eNew->Org ); - } - eNew->Lface = eNewSym->Lface = eOrg->Lface; - - return eNew; -} - - -/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew, - * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org. - * eOrg and eNew will have the same left face. - */ -GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ) -{ - GLUhalfEdge *eNew; - GLUhalfEdge *tempHalfEdge= __gl_meshAddEdgeVertex( eOrg ); - if (tempHalfEdge == NULL) return NULL; - - eNew = tempHalfEdge->Sym; - - /* Disconnect eOrg from eOrg->Dst and connect it to eNew->Org */ - Splice( eOrg->Sym, eOrg->Sym->Oprev ); - Splice( eOrg->Sym, eNew ); - - /* Set the vertex and face information */ - eOrg->Dst = eNew->Org; - eNew->Dst->anEdge = eNew->Sym; /* may have pointed to eOrg->Sym */ - eNew->Rface = eOrg->Rface; - eNew->winding = eOrg->winding; /* copy old winding information */ - eNew->Sym->winding = eOrg->Sym->winding; - - return eNew; -} - - -/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst - * to eDst->Org, and returns the corresponding half-edge eNew. - * If eOrg->Lface == eDst->Lface, this splits one loop into two, - * and the newly created loop is eNew->Lface. Otherwise, two disjoint - * loops are merged into one, and the loop eDst->Lface is destroyed. - * - * If (eOrg == eDst), the new face will have only two edges. - * If (eOrg->Lnext == eDst), the old face is reduced to a single edge. - * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges. - */ -GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) -{ - GLUhalfEdge *eNewSym; - int joiningLoops = FALSE; - GLUhalfEdge *eNew = MakeEdge( eOrg ); - if (eNew == NULL) return NULL; - - eNewSym = eNew->Sym; - - if( eDst->Lface != eOrg->Lface ) { - /* We are connecting two disjoint loops -- destroy eDst->Lface */ - joiningLoops = TRUE; - KillFace( eDst->Lface, eOrg->Lface ); - } - - /* Connect the new edge appropriately */ - Splice( eNew, eOrg->Lnext ); - Splice( eNewSym, eDst ); - - /* Set the vertex and face information */ - eNew->Org = eOrg->Dst; - eNewSym->Org = eDst->Org; - eNew->Lface = eNewSym->Lface = eOrg->Lface; - - /* Make sure the old face points to a valid half-edge */ - eOrg->Lface->anEdge = eNewSym; - - if( ! joiningLoops ) { - GLUface *newFace= allocFace(); - if (newFace == NULL) return NULL; - - /* We split one loop into two -- the new loop is eNew->Lface */ - MakeFace( newFace, eNew, eOrg->Lface ); - } - return eNew; -} - - -/******************** Other Operations **********************/ - -/* __gl_meshZapFace( fZap ) destroys a face and removes it from the - * global face list. All edges of fZap will have a NULL pointer as their - * left face. Any edges which also have a NULL pointer as their right face - * are deleted entirely (along with any isolated vertices this produces). - * An entire mesh can be deleted by zapping its faces, one at a time, - * in any order. Zapped faces cannot be used in further mesh operations! - */ -void __gl_meshZapFace( GLUface *fZap ) -{ - GLUhalfEdge *eStart = fZap->anEdge; - GLUhalfEdge *e, *eNext, *eSym; - GLUface *fPrev, *fNext; - - /* walk around face, deleting edges whose right face is also NULL */ - eNext = eStart->Lnext; - do { - e = eNext; - eNext = e->Lnext; - - e->Lface = NULL; - if( e->Rface == NULL ) { - /* delete the edge -- see __gl_MeshDelete above */ - - if( e->Onext == e ) { - KillVertex( e->Org, NULL ); - } else { - /* Make sure that e->Org points to a valid half-edge */ - e->Org->anEdge = e->Onext; - Splice( e, e->Oprev ); - } - eSym = e->Sym; - if( eSym->Onext == eSym ) { - KillVertex( eSym->Org, NULL ); - } else { - /* Make sure that eSym->Org points to a valid half-edge */ - eSym->Org->anEdge = eSym->Onext; - Splice( eSym, eSym->Oprev ); - } - KillEdge( e ); - } - } while( e != eStart ); - - /* delete from circular doubly-linked list */ - fPrev = fZap->prev; - fNext = fZap->next; - fNext->prev = fPrev; - fPrev->next = fNext; - - memFree( fZap ); -} - - -/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices, - * and no loops (what we usually call a "face"). - */ -GLUmesh *__gl_meshNewMesh( void ) -{ - GLUvertex *v; - GLUface *f; - GLUhalfEdge *e; - GLUhalfEdge *eSym; - GLUmesh *mesh = (GLUmesh *)memAlloc( sizeof( GLUmesh )); - if (mesh == NULL) { - return NULL; - } - - v = &mesh->vHead; - f = &mesh->fHead; - e = &mesh->eHead; - eSym = &mesh->eHeadSym; - - v->next = v->prev = v; - v->anEdge = NULL; - v->data = NULL; - - f->next = f->prev = f; - f->anEdge = NULL; - f->data = NULL; - f->trail = NULL; - f->marked = FALSE; - f->inside = FALSE; - - e->next = e; - e->Sym = eSym; - e->Onext = NULL; - e->Lnext = NULL; - e->Org = NULL; - e->Lface = NULL; - e->winding = 0; - e->activeRegion = NULL; - - eSym->next = eSym; - eSym->Sym = e; - eSym->Onext = NULL; - eSym->Lnext = NULL; - eSym->Org = NULL; - eSym->Lface = NULL; - eSym->winding = 0; - eSym->activeRegion = NULL; - - return mesh; -} - - -/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in - * both meshes, and returns the new mesh (the old meshes are destroyed). - */ -GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 ) -{ - GLUface *f1 = &mesh1->fHead; - GLUvertex *v1 = &mesh1->vHead; - GLUhalfEdge *e1 = &mesh1->eHead; - GLUface *f2 = &mesh2->fHead; - GLUvertex *v2 = &mesh2->vHead; - GLUhalfEdge *e2 = &mesh2->eHead; - - /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */ - if( f2->next != f2 ) { - f1->prev->next = f2->next; - f2->next->prev = f1->prev; - f2->prev->next = f1; - f1->prev = f2->prev; - } - - if( v2->next != v2 ) { - v1->prev->next = v2->next; - v2->next->prev = v1->prev; - v2->prev->next = v1; - v1->prev = v2->prev; - } - - if( e2->next != e2 ) { - e1->Sym->next->Sym->next = e2->next; - e2->next->Sym->next = e1->Sym->next; - e2->Sym->next->Sym->next = e1; - e1->Sym->next = e2->Sym->next; - } - - memFree( mesh2 ); - return mesh1; -} - - -#ifdef DELETE_BY_ZAPPING - -/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. - */ -void __gl_meshDeleteMesh( GLUmesh *mesh ) -{ - GLUface *fHead = &mesh->fHead; - - while( fHead->next != fHead ) { - __gl_meshZapFace( fHead->next ); - } - assert( mesh->vHead.next == &mesh->vHead ); - - memFree( mesh ); -} - -#else - -/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. - */ -void __gl_meshDeleteMesh( GLUmesh *mesh ) -{ - GLUface *f, *fNext; - GLUvertex *v, *vNext; - GLUhalfEdge *e, *eNext; - - for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) { - fNext = f->next; - memFree( f ); - } - - for( v = mesh->vHead.next; v != &mesh->vHead; v = vNext ) { - vNext = v->next; - memFree( v ); - } - - for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) { - /* One call frees both e and e->Sym (see EdgePair above) */ - eNext = e->next; - memFree( e ); - } - - memFree( mesh ); -} - -#endif - -#ifndef NDEBUG - -/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency. - */ -void __gl_meshCheckMesh( GLUmesh *mesh ) -{ - GLUface *fHead = &mesh->fHead; - GLUvertex *vHead = &mesh->vHead; - GLUhalfEdge *eHead = &mesh->eHead; - GLUface *f, *fPrev; - GLUvertex *v, *vPrev; - GLUhalfEdge *e, *ePrev; - - fPrev = fHead; - for( fPrev = fHead ; (f = fPrev->next) != fHead; fPrev = f) { - assert( f->prev == fPrev ); - e = f->anEdge; - do { - assert( e->Sym != e ); - assert( e->Sym->Sym == e ); - assert( e->Lnext->Onext->Sym == e ); - assert( e->Onext->Sym->Lnext == e ); - assert( e->Lface == f ); - e = e->Lnext; - } while( e != f->anEdge ); - } - assert( f->prev == fPrev && f->anEdge == NULL && f->data == NULL ); - - vPrev = vHead; - for( vPrev = vHead ; (v = vPrev->next) != vHead; vPrev = v) { - assert( v->prev == vPrev ); - e = v->anEdge; - do { - assert( e->Sym != e ); - assert( e->Sym->Sym == e ); - assert( e->Lnext->Onext->Sym == e ); - assert( e->Onext->Sym->Lnext == e ); - assert( e->Org == v ); - e = e->Onext; - } while( e != v->anEdge ); - } - assert( v->prev == vPrev && v->anEdge == NULL && v->data == NULL ); - - ePrev = eHead; - for( ePrev = eHead ; (e = ePrev->next) != eHead; ePrev = e) { - assert( e->Sym->next == ePrev->Sym ); - assert( e->Sym != e ); - assert( e->Sym->Sym == e ); - assert( e->Org != NULL ); - assert( e->Dst != NULL ); - assert( e->Lnext->Onext->Sym == e ); - assert( e->Onext->Sym->Lnext == e ); - } - assert( e->Sym->next == ePrev->Sym - && e->Sym == &mesh->eHeadSym - && e->Sym->Sym == e - && e->Org == NULL && e->Dst == NULL - && e->Lface == NULL && e->Rface == NULL ); -} - -#endif diff --git a/src/libs/mesa/glu/libtess/mesh.h b/src/libs/mesa/glu/libtess/mesh.h deleted file mode 100644 index 690c5f2f69..0000000000 --- a/src/libs/mesa/glu/libtess/mesh.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __mesh_h_ -#define __mesh_h_ - -#include - -typedef struct GLUmesh GLUmesh; - -typedef struct GLUvertex GLUvertex; -typedef struct GLUface GLUface; -typedef struct GLUhalfEdge GLUhalfEdge; - -typedef struct ActiveRegion ActiveRegion; /* Internal data */ - -/* The mesh structure is similar in spirit, notation, and operations - * to the "quad-edge" structure (see L. Guibas and J. Stolfi, Primitives - * for the manipulation of general subdivisions and the computation of - * Voronoi diagrams, ACM Transactions on Graphics, 4(2):74-123, April 1985). - * For a simplified description, see the course notes for CS348a, - * "Mathematical Foundations of Computer Graphics", available at the - * Stanford bookstore (and taught during the fall quarter). - * The implementation also borrows a tiny subset of the graph-based approach - * use in Mantyla's Geometric Work Bench (see M. Mantyla, An Introduction - * to Sold Modeling, Computer Science Press, Rockville, Maryland, 1988). - * - * The fundamental data structure is the "half-edge". Two half-edges - * go together to make an edge, but they point in opposite directions. - * Each half-edge has a pointer to its mate (the "symmetric" half-edge Sym), - * its origin vertex (Org), the face on its left side (Lface), and the - * adjacent half-edges in the CCW direction around the origin vertex - * (Onext) and around the left face (Lnext). There is also a "next" - * pointer for the global edge list (see below). - * - * The notation used for mesh navigation: - * Sym = the mate of a half-edge (same edge, but opposite direction) - * Onext = edge CCW around origin vertex (keep same origin) - * Dnext = edge CCW around destination vertex (keep same dest) - * Lnext = edge CCW around left face (dest becomes new origin) - * Rnext = edge CCW around right face (origin becomes new dest) - * - * "prev" means to substitute CW for CCW in the definitions above. - * - * The mesh keeps global lists of all vertices, faces, and edges, - * stored as doubly-linked circular lists with a dummy header node. - * The mesh stores pointers to these dummy headers (vHead, fHead, eHead). - * - * The circular edge list is special; since half-edges always occur - * in pairs (e and e->Sym), each half-edge stores a pointer in only - * one direction. Starting at eHead and following the e->next pointers - * will visit each *edge* once (ie. e or e->Sym, but not both). - * e->Sym stores a pointer in the opposite direction, thus it is - * always true that e->Sym->next->Sym->next == e. - * - * Each vertex has a pointer to next and previous vertices in the - * circular list, and a pointer to a half-edge with this vertex as - * the origin (NULL if this is the dummy header). There is also a - * field "data" for client data. - * - * Each face has a pointer to the next and previous faces in the - * circular list, and a pointer to a half-edge with this face as - * the left face (NULL if this is the dummy header). There is also - * a field "data" for client data. - * - * Note that what we call a "face" is really a loop; faces may consist - * of more than one loop (ie. not simply connected), but there is no - * record of this in the data structure. The mesh may consist of - * several disconnected regions, so it may not be possible to visit - * the entire mesh by starting at a half-edge and traversing the edge - * structure. - * - * The mesh does NOT support isolated vertices; a vertex is deleted along - * with its last edge. Similarly when two faces are merged, one of the - * faces is deleted (see __gl_meshDelete below). For mesh operations, - * all face (loop) and vertex pointers must not be NULL. However, once - * mesh manipulation is finished, __gl_MeshZapFace can be used to delete - * faces of the mesh, one at a time. All external faces can be "zapped" - * before the mesh is returned to the client; then a NULL face indicates - * a region which is not part of the output polygon. - */ - -struct GLUvertex { - GLUvertex *next; /* next vertex (never NULL) */ - GLUvertex *prev; /* previous vertex (never NULL) */ - GLUhalfEdge *anEdge; /* a half-edge with this origin */ - void *data; /* client's data */ - - /* Internal data (keep hidden) */ - GLdouble coords[3]; /* vertex location in 3D */ - GLdouble s, t; /* projection onto the sweep plane */ - long pqHandle; /* to allow deletion from priority queue */ -}; - -struct GLUface { - GLUface *next; /* next face (never NULL) */ - GLUface *prev; /* previous face (never NULL) */ - GLUhalfEdge *anEdge; /* a half edge with this left face */ - void *data; /* room for client's data */ - - /* Internal data (keep hidden) */ - GLUface *trail; /* "stack" for conversion to strips */ - GLboolean marked; /* flag for conversion to strips */ - GLboolean inside; /* this face is in the polygon interior */ -}; - -struct GLUhalfEdge { - GLUhalfEdge *next; /* doubly-linked list (prev==Sym->next) */ - GLUhalfEdge *Sym; /* same edge, opposite direction */ - GLUhalfEdge *Onext; /* next edge CCW around origin */ - GLUhalfEdge *Lnext; /* next edge CCW around left face */ - GLUvertex *Org; /* origin vertex (Overtex too long) */ - GLUface *Lface; /* left face */ - - /* Internal data (keep hidden) */ - ActiveRegion *activeRegion; /* a region with this upper edge (sweep.c) */ - int winding; /* change in winding number when crossing - from the right face to the left face */ -}; - -#define Rface Sym->Lface -#define Dst Sym->Org - -#define Oprev Sym->Lnext -#define Lprev Onext->Sym -#define Dprev Lnext->Sym -#define Rprev Sym->Onext -#define Dnext Rprev->Sym /* 3 pointers */ -#define Rnext Oprev->Sym /* 3 pointers */ - - -struct GLUmesh { - GLUvertex vHead; /* dummy header for vertex list */ - GLUface fHead; /* dummy header for face list */ - GLUhalfEdge eHead; /* dummy header for edge list */ - GLUhalfEdge eHeadSym; /* and its symmetric counterpart */ -}; - -/* The mesh operations below have three motivations: completeness, - * convenience, and efficiency. The basic mesh operations are MakeEdge, - * Splice, and Delete. All the other edge operations can be implemented - * in terms of these. The other operations are provided for convenience - * and/or efficiency. - * - * When a face is split or a vertex is added, they are inserted into the - * global list *before* the existing vertex or face (ie. e->Org or e->Lface). - * This makes it easier to process all vertices or faces in the global lists - * without worrying about processing the same data twice. As a convenience, - * when a face is split, the "inside" flag is copied from the old face. - * Other internal data (v->data, v->activeRegion, f->data, f->marked, - * f->trail, e->winding) is set to zero. - * - * ********************** Basic Edge Operations ************************** - * - * __gl_meshMakeEdge( mesh ) creates one edge, two vertices, and a loop. - * The loop (face) consists of the two new half-edges. - * - * __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the - * mesh connectivity and topology. It changes the mesh so that - * eOrg->Onext <- OLD( eDst->Onext ) - * eDst->Onext <- OLD( eOrg->Onext ) - * where OLD(...) means the value before the meshSplice operation. - * - * This can have two effects on the vertex structure: - * - if eOrg->Org != eDst->Org, the two vertices are merged together - * - if eOrg->Org == eDst->Org, the origin is split into two vertices - * In both cases, eDst->Org is changed and eOrg->Org is untouched. - * - * Similarly (and independently) for the face structure, - * - if eOrg->Lface == eDst->Lface, one loop is split into two - * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one - * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected. - * - * __gl_meshDelete( eDel ) removes the edge eDel. There are several cases: - * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop - * eDel->Lface is deleted. Otherwise, we are splitting one loop into two; - * the newly created loop will contain eDel->Dst. If the deletion of eDel - * would create isolated vertices, those are deleted as well. - * - * ********************** Other Edge Operations ************************** - * - * __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that - * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex. - * eOrg and eNew will have the same left face. - * - * __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew, - * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org. - * eOrg and eNew will have the same left face. - * - * __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst - * to eDst->Org, and returns the corresponding half-edge eNew. - * If eOrg->Lface == eDst->Lface, this splits one loop into two, - * and the newly created loop is eNew->Lface. Otherwise, two disjoint - * loops are merged into one, and the loop eDst->Lface is destroyed. - * - * ************************ Other Operations ***************************** - * - * __gl_meshNewMesh() creates a new mesh with no edges, no vertices, - * and no loops (what we usually call a "face"). - * - * __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in - * both meshes, and returns the new mesh (the old meshes are destroyed). - * - * __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. - * - * __gl_meshZapFace( fZap ) destroys a face and removes it from the - * global face list. All edges of fZap will have a NULL pointer as their - * left face. Any edges which also have a NULL pointer as their right face - * are deleted entirely (along with any isolated vertices this produces). - * An entire mesh can be deleted by zapping its faces, one at a time, - * in any order. Zapped faces cannot be used in further mesh operations! - * - * __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency. - */ - -GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ); -int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ); -int __gl_meshDelete( GLUhalfEdge *eDel ); - -GLUhalfEdge *__gl_meshAddEdgeVertex( GLUhalfEdge *eOrg ); -GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ); -GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ); - -GLUmesh *__gl_meshNewMesh( void ); -GLUmesh *__gl_meshUnion( GLUmesh *mesh1, GLUmesh *mesh2 ); -void __gl_meshDeleteMesh( GLUmesh *mesh ); -void __gl_meshZapFace( GLUface *fZap ); - -#ifdef NDEBUG -#define __gl_meshCheckMesh( mesh ) -#else -void __gl_meshCheckMesh( GLUmesh *mesh ); -#endif - -#endif diff --git a/src/libs/mesa/glu/libtess/normal.c b/src/libs/mesa/glu/libtess/normal.c deleted file mode 100644 index 0a2494be34..0000000000 --- a/src/libs/mesa/glu/libtess/normal.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include "mesh.h" -#include "tess.h" -#include "normal.h" -#include -#include - -#define TRUE 1 -#define FALSE 0 - -#define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]) - -#if 0 -static void Normalize( GLdouble v[3] ) -{ - GLdouble len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; - - assert( len > 0 ); - len = sqrt( len ); - v[0] /= len; - v[1] /= len; - v[2] /= len; -} -#endif - -#undef ABS -#define ABS(x) ((x) < 0 ? -(x) : (x)) - -static int LongAxis( GLdouble v[3] ) -{ - int i = 0; - - if( ABS(v[1]) > ABS(v[0]) ) { i = 1; } - if( ABS(v[2]) > ABS(v[i]) ) { i = 2; } - return i; -} - -static void ComputeNormal( GLUtesselator *tess, GLdouble norm[3] ) -{ - GLUvertex *v, *v1, *v2; - GLdouble c, tLen2, maxLen2; - GLdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3]; - GLUvertex *maxVert[3], *minVert[3]; - GLUvertex *vHead = &tess->mesh->vHead; - int i; - - maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU_TESS_MAX_COORD; - minVal[0] = minVal[1] = minVal[2] = 2 * GLU_TESS_MAX_COORD; - - for( v = vHead->next; v != vHead; v = v->next ) { - for( i = 0; i < 3; ++i ) { - c = v->coords[i]; - if( c < minVal[i] ) { minVal[i] = c; minVert[i] = v; } - if( c > maxVal[i] ) { maxVal[i] = c; maxVert[i] = v; } - } - } - - /* Find two vertices separated by at least 1/sqrt(3) of the maximum - * distance between any two vertices - */ - i = 0; - if( maxVal[1] - minVal[1] > maxVal[0] - minVal[0] ) { i = 1; } - if( maxVal[2] - minVal[2] > maxVal[i] - minVal[i] ) { i = 2; } - if( minVal[i] >= maxVal[i] ) { - /* All vertices are the same -- normal doesn't matter */ - norm[0] = 0; norm[1] = 0; norm[2] = 1; - return; - } - - /* Look for a third vertex which forms the triangle with maximum area - * (Length of normal == twice the triangle area) - */ - maxLen2 = 0; - v1 = minVert[i]; - v2 = maxVert[i]; - d1[0] = v1->coords[0] - v2->coords[0]; - d1[1] = v1->coords[1] - v2->coords[1]; - d1[2] = v1->coords[2] - v2->coords[2]; - for( v = vHead->next; v != vHead; v = v->next ) { - d2[0] = v->coords[0] - v2->coords[0]; - d2[1] = v->coords[1] - v2->coords[1]; - d2[2] = v->coords[2] - v2->coords[2]; - tNorm[0] = d1[1]*d2[2] - d1[2]*d2[1]; - tNorm[1] = d1[2]*d2[0] - d1[0]*d2[2]; - tNorm[2] = d1[0]*d2[1] - d1[1]*d2[0]; - tLen2 = tNorm[0]*tNorm[0] + tNorm[1]*tNorm[1] + tNorm[2]*tNorm[2]; - if( tLen2 > maxLen2 ) { - maxLen2 = tLen2; - norm[0] = tNorm[0]; - norm[1] = tNorm[1]; - norm[2] = tNorm[2]; - } - } - - if( maxLen2 <= 0 ) { - /* All points lie on a single line -- any decent normal will do */ - norm[0] = norm[1] = norm[2] = 0; - norm[LongAxis(d1)] = 1; - } -} - - -static void CheckOrientation( GLUtesselator *tess ) -{ - GLdouble area; - GLUface *f, *fHead = &tess->mesh->fHead; - GLUvertex *v, *vHead = &tess->mesh->vHead; - GLUhalfEdge *e; - - /* When we compute the normal automatically, we choose the orientation - * so that the the sum of the signed areas of all contours is non-negative. - */ - area = 0; - for( f = fHead->next; f != fHead; f = f->next ) { - e = f->anEdge; - if( e->winding <= 0 ) continue; - do { - area += (e->Org->s - e->Dst->s) * (e->Org->t + e->Dst->t); - e = e->Lnext; - } while( e != f->anEdge ); - } - if( area < 0 ) { - /* Reverse the orientation by flipping all the t-coordinates */ - for( v = vHead->next; v != vHead; v = v->next ) { - v->t = - v->t; - } - tess->tUnit[0] = - tess->tUnit[0]; - tess->tUnit[1] = - tess->tUnit[1]; - tess->tUnit[2] = - tess->tUnit[2]; - } -} - -#ifdef FOR_TRITE_TEST_PROGRAM -#include -extern int RandomSweep; -#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0) -#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0) -#else -#if defined(SLANTED_SWEEP) -/* The "feature merging" is not intended to be complete. There are - * special cases where edges are nearly parallel to the sweep line - * which are not implemented. The algorithm should still behave - * robustly (ie. produce a reasonable tesselation) in the presence - * of such edges, however it may miss features which could have been - * merged. We could minimize this effect by choosing the sweep line - * direction to be something unusual (ie. not parallel to one of the - * coordinate axes). - */ -#define S_UNIT_X 0.50941539564955385 /* Pre-normalized */ -#define S_UNIT_Y 0.86052074622010633 -#else -#define S_UNIT_X 1.0 -#define S_UNIT_Y 0.0 -#endif -#endif - -/* Determine the polygon normal and project vertices onto the plane - * of the polygon. - */ -void __gl_projectPolygon( GLUtesselator *tess ) -{ - GLUvertex *v, *vHead = &tess->mesh->vHead; - GLdouble norm[3]; - GLdouble *sUnit, *tUnit; - int i, computedNormal = FALSE; - - norm[0] = tess->normal[0]; - norm[1] = tess->normal[1]; - norm[2] = tess->normal[2]; - if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) { - ComputeNormal( tess, norm ); - computedNormal = TRUE; - } - sUnit = tess->sUnit; - tUnit = tess->tUnit; - i = LongAxis( norm ); - -#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT) - /* Choose the initial sUnit vector to be approximately perpendicular - * to the normal. - */ - Normalize( norm ); - - sUnit[i] = 0; - sUnit[(i+1)%3] = S_UNIT_X; - sUnit[(i+2)%3] = S_UNIT_Y; - - /* Now make it exactly perpendicular */ - w = Dot( sUnit, norm ); - sUnit[0] -= w * norm[0]; - sUnit[1] -= w * norm[1]; - sUnit[2] -= w * norm[2]; - Normalize( sUnit ); - - /* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */ - tUnit[0] = norm[1]*sUnit[2] - norm[2]*sUnit[1]; - tUnit[1] = norm[2]*sUnit[0] - norm[0]*sUnit[2]; - tUnit[2] = norm[0]*sUnit[1] - norm[1]*sUnit[0]; - Normalize( tUnit ); -#else - /* Project perpendicular to a coordinate axis -- better numerically */ - sUnit[i] = 0; - sUnit[(i+1)%3] = S_UNIT_X; - sUnit[(i+2)%3] = S_UNIT_Y; - - tUnit[i] = 0; - tUnit[(i+1)%3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y; - tUnit[(i+2)%3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X; -#endif - - /* Project the vertices onto the sweep plane */ - for( v = vHead->next; v != vHead; v = v->next ) { - v->s = Dot( v->coords, sUnit ); - v->t = Dot( v->coords, tUnit ); - } - if( computedNormal ) { - CheckOrientation( tess ); - } -} diff --git a/src/libs/mesa/glu/libtess/normal.h b/src/libs/mesa/glu/libtess/normal.h deleted file mode 100644 index c376ca4452..0000000000 --- a/src/libs/mesa/glu/libtess/normal.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __normal_h_ -#define __normal_h_ - -#include "tess.h" - -/* __gl_projectPolygon( tess ) determines the polygon normal - * and project vertices onto the plane of the polygon. - */ -void __gl_projectPolygon( GLUtesselator *tess ); - -#endif diff --git a/src/libs/mesa/glu/libtess/priorityq-heap.c b/src/libs/mesa/glu/libtess/priorityq-heap.c deleted file mode 100644 index e3a6c6068a..0000000000 --- a/src/libs/mesa/glu/libtess/priorityq-heap.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include -#include -#include "priorityq-heap.h" -#include "memalloc.h" - -#define INIT_SIZE 32 - -#define TRUE 1 -#define FALSE 0 - -#ifdef FOR_TRITE_TEST_PROGRAM -#define LEQ(x,y) (*pq->leq)(x,y) -#else -/* Violates modularity, but a little faster */ -#include "geom.h" -#define LEQ(x,y) VertLeq((GLUvertex *)x, (GLUvertex *)y) -#endif - -/* really __gl_pqHeapNewPriorityQ */ -PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) -{ - PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ )); - if (pq == NULL) return NULL; - - pq->size = 0; - pq->max = INIT_SIZE; - pq->nodes = (PQnode *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->nodes[0]) ); - if (pq->nodes == NULL) { - memFree(pq); - return NULL; - } - - pq->handles = (PQhandleElem *)memAlloc( (INIT_SIZE + 1) * sizeof(pq->handles[0]) ); - if (pq->handles == NULL) { - memFree(pq->nodes); - memFree(pq); - return NULL; - } - - pq->initialized = FALSE; - pq->freeList = 0; - pq->leq = leq; - - pq->nodes[1].handle = 1; /* so that Minimum() returns NULL */ - pq->handles[1].key = NULL; - return pq; -} - -/* really __gl_pqHeapDeletePriorityQ */ -void pqDeletePriorityQ( PriorityQ *pq ) -{ - memFree( pq->handles ); - memFree( pq->nodes ); - memFree( pq ); -} - - -static void FloatDown( PriorityQ *pq, long curr ) -{ - PQnode *n = pq->nodes; - PQhandleElem *h = pq->handles; - PQhandle hCurr, hChild; - long child; - - hCurr = n[curr].handle; - for( ;; ) { - child = curr << 1; - if( child < pq->size && LEQ( h[n[child+1].handle].key, - h[n[child].handle].key )) { - ++child; - } - - assert(child <= pq->max); - - hChild = n[child].handle; - if( child > pq->size || LEQ( h[hCurr].key, h[hChild].key )) { - n[curr].handle = hCurr; - h[hCurr].node = curr; - break; - } - n[curr].handle = hChild; - h[hChild].node = curr; - curr = child; - } -} - - -static void FloatUp( PriorityQ *pq, long curr ) -{ - PQnode *n = pq->nodes; - PQhandleElem *h = pq->handles; - PQhandle hCurr, hParent; - long parent; - - hCurr = n[curr].handle; - for( ;; ) { - parent = curr >> 1; - hParent = n[parent].handle; - if( parent == 0 || LEQ( h[hParent].key, h[hCurr].key )) { - n[curr].handle = hCurr; - h[hCurr].node = curr; - break; - } - n[curr].handle = hParent; - h[hParent].node = curr; - curr = parent; - } -} - -/* really __gl_pqHeapInit */ -void pqInit( PriorityQ *pq ) -{ - long i; - - /* This method of building a heap is O(n), rather than O(n lg n). */ - - for( i = pq->size; i >= 1; --i ) { - FloatDown( pq, i ); - } - pq->initialized = TRUE; -} - -/* really __gl_pqHeapInsert */ -/* returns LONG_MAX iff out of memory */ -PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) -{ - long curr; - PQhandle free; - - curr = ++ pq->size; - if( (curr*2) > pq->max ) { - PQnode *saveNodes= pq->nodes; - PQhandleElem *saveHandles= pq->handles; - - /* If the heap overflows, double its size. */ - pq->max <<= 1; - pq->nodes = (PQnode *)memRealloc( pq->nodes, - (size_t) - ((pq->max + 1) * sizeof( pq->nodes[0] ))); - if (pq->nodes == NULL) { - pq->nodes = saveNodes; /* restore ptr to free upon return */ - return LONG_MAX; - } - pq->handles = (PQhandleElem *)memRealloc( pq->handles, - (size_t) - ((pq->max + 1) * - sizeof( pq->handles[0] ))); - if (pq->handles == NULL) { - pq->handles = saveHandles; /* restore ptr to free upon return */ - return LONG_MAX; - } - } - - if( pq->freeList == 0 ) { - free = curr; - } else { - free = pq->freeList; - pq->freeList = pq->handles[free].node; - } - - pq->nodes[curr].handle = free; - pq->handles[free].node = curr; - pq->handles[free].key = keyNew; - - if( pq->initialized ) { - FloatUp( pq, curr ); - } - assert(free != LONG_MAX); - return free; -} - -/* really __gl_pqHeapExtractMin */ -PQkey pqExtractMin( PriorityQ *pq ) -{ - PQnode *n = pq->nodes; - PQhandleElem *h = pq->handles; - PQhandle hMin = n[1].handle; - PQkey min = h[hMin].key; - - if( pq->size > 0 ) { - n[1].handle = n[pq->size].handle; - h[n[1].handle].node = 1; - - h[hMin].key = NULL; - h[hMin].node = pq->freeList; - pq->freeList = hMin; - - if( -- pq->size > 0 ) { - FloatDown( pq, 1 ); - } - } - return min; -} - -/* really __gl_pqHeapDelete */ -void pqDelete( PriorityQ *pq, PQhandle hCurr ) -{ - PQnode *n = pq->nodes; - PQhandleElem *h = pq->handles; - long curr; - - assert( hCurr >= 1 && hCurr <= pq->max && h[hCurr].key != NULL ); - - curr = h[hCurr].node; - n[curr].handle = n[pq->size].handle; - h[n[curr].handle].node = curr; - - if( curr <= -- pq->size ) { - if( curr <= 1 || LEQ( h[n[curr>>1].handle].key, h[n[curr].handle].key )) { - FloatDown( pq, curr ); - } else { - FloatUp( pq, curr ); - } - } - h[hCurr].key = NULL; - h[hCurr].node = pq->freeList; - pq->freeList = hCurr; -} diff --git a/src/libs/mesa/glu/libtess/priorityq-heap.h b/src/libs/mesa/glu/libtess/priorityq-heap.h deleted file mode 100644 index dc9aaef87f..0000000000 --- a/src/libs/mesa/glu/libtess/priorityq-heap.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __priorityq_heap_h_ -#define __priorityq_heap_h_ - -/* Use #define's so that another heap implementation can use this one */ - -#define PQkey PQHeapKey -#define PQhandle PQHeapHandle -#define PriorityQ PriorityQHeap - -#define pqNewPriorityQ(leq) __gl_pqHeapNewPriorityQ(leq) -#define pqDeletePriorityQ(pq) __gl_pqHeapDeletePriorityQ(pq) - -/* The basic operations are insertion of a new key (pqInsert), - * and examination/extraction of a key whose value is minimum - * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); - * for this purpose pqInsert returns a "handle" which is supplied - * as the argument. - * - * An initial heap may be created efficiently by calling pqInsert - * repeatedly, then calling pqInit. In any case pqInit must be called - * before any operations other than pqInsert are used. - * - * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. - * This may also be tested with pqIsEmpty. - */ -#define pqInit(pq) __gl_pqHeapInit(pq) -#define pqInsert(pq,key) __gl_pqHeapInsert(pq,key) -#define pqMinimum(pq) __gl_pqHeapMinimum(pq) -#define pqExtractMin(pq) __gl_pqHeapExtractMin(pq) -#define pqDelete(pq,handle) __gl_pqHeapDelete(pq,handle) -#define pqIsEmpty(pq) __gl_pqHeapIsEmpty(pq) - - -/* Since we support deletion the data structure is a little more - * complicated than an ordinary heap. "nodes" is the heap itself; - * active nodes are stored in the range 1..pq->size. When the - * heap exceeds its allocated size (pq->max), its size doubles. - * The children of node i are nodes 2i and 2i+1. - * - * Each node stores an index into an array "handles". Each handle - * stores a key, plus a pointer back to the node which currently - * represents that key (ie. nodes[handles[i].node].handle == i). - */ - -typedef void *PQkey; -typedef long PQhandle; -typedef struct PriorityQ PriorityQ; - -typedef struct { PQhandle handle; } PQnode; -typedef struct { PQkey key; PQhandle node; } PQhandleElem; - -struct PriorityQ { - PQnode *nodes; - PQhandleElem *handles; - long size, max; - PQhandle freeList; - int initialized; - int (*leq)(PQkey key1, PQkey key2); -}; - -PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); -void pqDeletePriorityQ( PriorityQ *pq ); - -void pqInit( PriorityQ *pq ); -PQhandle pqInsert( PriorityQ *pq, PQkey key ); -PQkey pqExtractMin( PriorityQ *pq ); -void pqDelete( PriorityQ *pq, PQhandle handle ); - - -#define __gl_pqHeapMinimum(pq) ((pq)->handles[(pq)->nodes[1].handle].key) -#define __gl_pqHeapIsEmpty(pq) ((pq)->size == 0) - -#endif diff --git a/src/libs/mesa/glu/libtess/priorityq-sort.h b/src/libs/mesa/glu/libtess/priorityq-sort.h deleted file mode 100644 index 746cf5fa69..0000000000 --- a/src/libs/mesa/glu/libtess/priorityq-sort.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __priorityq_sort_h_ -#define __priorityq_sort_h_ - -#include "priorityq-heap.h" - -#undef PQkey -#undef PQhandle -#undef PriorityQ -#undef pqNewPriorityQ -#undef pqDeletePriorityQ -#undef pqInit -#undef pqInsert -#undef pqMinimum -#undef pqExtractMin -#undef pqDelete -#undef pqIsEmpty - -/* Use #define's so that another heap implementation can use this one */ - -#define PQkey PQSortKey -#define PQhandle PQSortHandle -#define PriorityQ PriorityQSort - -#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq) -#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq) - -/* The basic operations are insertion of a new key (pqInsert), - * and examination/extraction of a key whose value is minimum - * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); - * for this purpose pqInsert returns a "handle" which is supplied - * as the argument. - * - * An initial heap may be created efficiently by calling pqInsert - * repeatedly, then calling pqInit. In any case pqInit must be called - * before any operations other than pqInsert are used. - * - * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. - * This may also be tested with pqIsEmpty. - */ -#define pqInit(pq) __gl_pqSortInit(pq) -#define pqInsert(pq,key) __gl_pqSortInsert(pq,key) -#define pqMinimum(pq) __gl_pqSortMinimum(pq) -#define pqExtractMin(pq) __gl_pqSortExtractMin(pq) -#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle) -#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq) - - -/* Since we support deletion the data structure is a little more - * complicated than an ordinary heap. "nodes" is the heap itself; - * active nodes are stored in the range 1..pq->size. When the - * heap exceeds its allocated size (pq->max), its size doubles. - * The children of node i are nodes 2i and 2i+1. - * - * Each node stores an index into an array "handles". Each handle - * stores a key, plus a pointer back to the node which currently - * represents that key (ie. nodes[handles[i].node].handle == i). - */ - -typedef PQHeapKey PQkey; -typedef PQHeapHandle PQhandle; -typedef struct PriorityQ PriorityQ; - -struct PriorityQ { - PriorityQHeap *heap; - PQkey *keys; - PQkey **order; - PQhandle size, max; - int initialized; - int (*leq)(PQkey key1, PQkey key2); -}; - -PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); -void pqDeletePriorityQ( PriorityQ *pq ); - -int pqInit( PriorityQ *pq ); -PQhandle pqInsert( PriorityQ *pq, PQkey key ); -PQkey pqExtractMin( PriorityQ *pq ); -void pqDelete( PriorityQ *pq, PQhandle handle ); - -PQkey pqMinimum( PriorityQ *pq ); -int pqIsEmpty( PriorityQ *pq ); - -#endif diff --git a/src/libs/mesa/glu/libtess/priorityq.c b/src/libs/mesa/glu/libtess/priorityq.c deleted file mode 100644 index 11f0263ac9..0000000000 --- a/src/libs/mesa/glu/libtess/priorityq.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include -#include /* LONG_MAX */ -#include "memalloc.h" - -/* Include all the code for the regular heap-based queue here. */ - -#include "priorityq-heap.c" - -/* Now redefine all the function names to map to their "Sort" versions. */ - -#include "priorityq-sort.h" - -/* really __gl_pqSortNewPriorityQ */ -PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) -{ - PriorityQ *pq = (PriorityQ *)memAlloc( sizeof( PriorityQ )); - if (pq == NULL) return NULL; - - pq->heap = __gl_pqHeapNewPriorityQ( leq ); - if (pq->heap == NULL) { - memFree(pq); - return NULL; - } - - pq->keys = (PQHeapKey *)memAlloc( INIT_SIZE * sizeof(pq->keys[0]) ); - if (pq->keys == NULL) { - __gl_pqHeapDeletePriorityQ(pq->heap); - memFree(pq); - return NULL; - } - - pq->size = 0; - pq->max = INIT_SIZE; - pq->initialized = FALSE; - pq->leq = leq; - return pq; -} - -/* really __gl_pqSortDeletePriorityQ */ -void pqDeletePriorityQ( PriorityQ *pq ) -{ - assert(pq != NULL); - if (pq->heap != NULL) __gl_pqHeapDeletePriorityQ( pq->heap ); - if (pq->order != NULL) memFree( pq->order ); - if (pq->keys != NULL) memFree( pq->keys ); - memFree( pq ); -} - - -#define LT(x,y) (! LEQ(y,x)) -#define GT(x,y) (! LEQ(x,y)) -#define Swap(a,b) if(1){PQkey *tmp = *a; *a = *b; *b = tmp;}else - -/* really __gl_pqSortInit */ -int pqInit( PriorityQ *pq ) -{ - PQkey **p, **r, **i, **j, *piv; - struct { PQkey **p, **r; } Stack[50], *top = Stack; - unsigned long seed = 2016473283; - - /* Create an array of indirect pointers to the keys, so that we - * the handles we have returned are still valid. - */ -/* - pq->order = (PQHeapKey **)memAlloc( (size_t) - (pq->size * sizeof(pq->order[0])) ); -*/ - pq->order = (PQHeapKey **)memAlloc( (size_t) - ((pq->size+1) * sizeof(pq->order[0])) ); -/* the previous line is a patch to compensate for the fact that IBM */ -/* machines return a null on a malloc of zero bytes (unlike SGI), */ -/* so we have to put in this defense to guard against a memory */ -/* fault four lines down. from fossum@austin.ibm.com. */ - if (pq->order == NULL) return 0; - - p = pq->order; - r = p + pq->size - 1; - for( piv = pq->keys, i = p; i <= r; ++piv, ++i ) { - *i = piv; - } - - /* Sort the indirect pointers in descending order, - * using randomized Quicksort - */ - top->p = p; top->r = r; ++top; - while( --top >= Stack ) { - p = top->p; - r = top->r; - while( r > p + 10 ) { - seed = seed * 1539415821 + 1; - i = p + seed % (r - p + 1); - piv = *i; - *i = *p; - *p = piv; - i = p - 1; - j = r + 1; - do { - do { ++i; } while( GT( **i, *piv )); - do { --j; } while( LT( **j, *piv )); - Swap( i, j ); - } while( i < j ); - Swap( i, j ); /* Undo last swap */ - if( i - p < r - j ) { - top->p = j+1; top->r = r; ++top; - r = i-1; - } else { - top->p = p; top->r = i-1; ++top; - p = j+1; - } - } - /* Insertion sort small lists */ - for( i = p+1; i <= r; ++i ) { - piv = *i; - for( j = i; j > p && LT( **(j-1), *piv ); --j ) { - *j = *(j-1); - } - *j = piv; - } - } - pq->max = pq->size; - pq->initialized = TRUE; - __gl_pqHeapInit( pq->heap ); /* always succeeds */ - -#ifndef NDEBUG - p = pq->order; - r = p + pq->size - 1; - for( i = p; i < r; ++i ) { - assert( LEQ( **(i+1), **i )); - } -#endif - - return 1; -} - -/* really __gl_pqSortInsert */ -/* returns LONG_MAX iff out of memory */ -PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) -{ - long curr; - - if( pq->initialized ) { - return __gl_pqHeapInsert( pq->heap, keyNew ); - } - curr = pq->size; - if( ++ pq->size >= pq->max ) { - PQkey *saveKey= pq->keys; - - /* If the heap overflows, double its size. */ - pq->max <<= 1; - pq->keys = (PQHeapKey *)memRealloc( pq->keys, - (size_t) - (pq->max * sizeof( pq->keys[0] ))); - if (pq->keys == NULL) { - pq->keys = saveKey; /* restore ptr to free upon return */ - return LONG_MAX; - } - } - assert(curr != LONG_MAX); - pq->keys[curr] = keyNew; - - /* Negative handles index the sorted array. */ - return -(curr+1); -} - -/* really __gl_pqSortExtractMin */ -PQkey pqExtractMin( PriorityQ *pq ) -{ - PQkey sortMin, heapMin; - - if( pq->size == 0 ) { - return __gl_pqHeapExtractMin( pq->heap ); - } - sortMin = *(pq->order[pq->size-1]); - if( ! __gl_pqHeapIsEmpty( pq->heap )) { - heapMin = __gl_pqHeapMinimum( pq->heap ); - if( LEQ( heapMin, sortMin )) { - return __gl_pqHeapExtractMin( pq->heap ); - } - } - do { - -- pq->size; - } while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL ); - return sortMin; -} - -/* really __gl_pqSortMinimum */ -PQkey pqMinimum( PriorityQ *pq ) -{ - PQkey sortMin, heapMin; - - if( pq->size == 0 ) { - return __gl_pqHeapMinimum( pq->heap ); - } - sortMin = *(pq->order[pq->size-1]); - if( ! __gl_pqHeapIsEmpty( pq->heap )) { - heapMin = __gl_pqHeapMinimum( pq->heap ); - if( LEQ( heapMin, sortMin )) { - return heapMin; - } - } - return sortMin; -} - -/* really __gl_pqSortIsEmpty */ -int pqIsEmpty( PriorityQ *pq ) -{ - return (pq->size == 0) && __gl_pqHeapIsEmpty( pq->heap ); -} - -/* really __gl_pqSortDelete */ -void pqDelete( PriorityQ *pq, PQhandle curr ) -{ - if( curr >= 0 ) { - __gl_pqHeapDelete( pq->heap, curr ); - return; - } - curr = -(curr+1); - assert( curr < pq->max && pq->keys[curr] != NULL ); - - pq->keys[curr] = NULL; - while( pq->size > 0 && *(pq->order[pq->size-1]) == NULL ) { - -- pq->size; - } -} diff --git a/src/libs/mesa/glu/libtess/priorityq.h b/src/libs/mesa/glu/libtess/priorityq.h deleted file mode 100644 index 746cf5fa69..0000000000 --- a/src/libs/mesa/glu/libtess/priorityq.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __priorityq_sort_h_ -#define __priorityq_sort_h_ - -#include "priorityq-heap.h" - -#undef PQkey -#undef PQhandle -#undef PriorityQ -#undef pqNewPriorityQ -#undef pqDeletePriorityQ -#undef pqInit -#undef pqInsert -#undef pqMinimum -#undef pqExtractMin -#undef pqDelete -#undef pqIsEmpty - -/* Use #define's so that another heap implementation can use this one */ - -#define PQkey PQSortKey -#define PQhandle PQSortHandle -#define PriorityQ PriorityQSort - -#define pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq) -#define pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq) - -/* The basic operations are insertion of a new key (pqInsert), - * and examination/extraction of a key whose value is minimum - * (pqMinimum/pqExtractMin). Deletion is also allowed (pqDelete); - * for this purpose pqInsert returns a "handle" which is supplied - * as the argument. - * - * An initial heap may be created efficiently by calling pqInsert - * repeatedly, then calling pqInit. In any case pqInit must be called - * before any operations other than pqInsert are used. - * - * If the heap is empty, pqMinimum/pqExtractMin will return a NULL key. - * This may also be tested with pqIsEmpty. - */ -#define pqInit(pq) __gl_pqSortInit(pq) -#define pqInsert(pq,key) __gl_pqSortInsert(pq,key) -#define pqMinimum(pq) __gl_pqSortMinimum(pq) -#define pqExtractMin(pq) __gl_pqSortExtractMin(pq) -#define pqDelete(pq,handle) __gl_pqSortDelete(pq,handle) -#define pqIsEmpty(pq) __gl_pqSortIsEmpty(pq) - - -/* Since we support deletion the data structure is a little more - * complicated than an ordinary heap. "nodes" is the heap itself; - * active nodes are stored in the range 1..pq->size. When the - * heap exceeds its allocated size (pq->max), its size doubles. - * The children of node i are nodes 2i and 2i+1. - * - * Each node stores an index into an array "handles". Each handle - * stores a key, plus a pointer back to the node which currently - * represents that key (ie. nodes[handles[i].node].handle == i). - */ - -typedef PQHeapKey PQkey; -typedef PQHeapHandle PQhandle; -typedef struct PriorityQ PriorityQ; - -struct PriorityQ { - PriorityQHeap *heap; - PQkey *keys; - PQkey **order; - PQhandle size, max; - int initialized; - int (*leq)(PQkey key1, PQkey key2); -}; - -PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); -void pqDeletePriorityQ( PriorityQ *pq ); - -int pqInit( PriorityQ *pq ); -PQhandle pqInsert( PriorityQ *pq, PQkey key ); -PQkey pqExtractMin( PriorityQ *pq ); -void pqDelete( PriorityQ *pq, PQhandle handle ); - -PQkey pqMinimum( PriorityQ *pq ); -int pqIsEmpty( PriorityQ *pq ); - -#endif diff --git a/src/libs/mesa/glu/libtess/render.c b/src/libs/mesa/glu/libtess/render.c deleted file mode 100644 index 4f376f7f42..0000000000 --- a/src/libs/mesa/glu/libtess/render.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include -#include "mesh.h" -#include "tess.h" -#include "render.h" - -#define TRUE 1 -#define FALSE 0 - -/* This structure remembers the information we need about a primitive - * to be able to render it later, once we have determined which - * primitive is able to use the most triangles. - */ -struct FaceCount { - long size; /* number of triangles used */ - GLUhalfEdge *eStart; /* edge where this primitive starts */ - void (*render)(GLUtesselator *, GLUhalfEdge *, long); - /* routine to render this primitive */ -}; - -static struct FaceCount MaximumFan( GLUhalfEdge *eOrig ); -static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig ); - -static void RenderFan( GLUtesselator *tess, GLUhalfEdge *eStart, long size ); -static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *eStart, long size ); -static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *eStart, - long size ); - -static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig ); -static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *head ); - - - -/************************ Strips and Fans decomposition ******************/ - -/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle - * fans, strips, and separate triangles. A substantial effort is made - * to use as few rendering primitives as possible (ie. to make the fans - * and strips as large as possible). - * - * The rendering output is provided as callbacks (see the api). - */ -void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh ) -{ - GLUface *f; - - /* Make a list of separate triangles so we can render them all at once */ - tess->lonelyTriList = NULL; - - for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { - f->marked = FALSE; - } - for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { - - /* We examine all faces in an arbitrary order. Whenever we find - * an unprocessed face F, we output a group of faces including F - * whose size is maximum. - */ - if( f->inside && ! f->marked ) { - RenderMaximumFaceGroup( tess, f ); - assert( f->marked ); - } - } - if( tess->lonelyTriList != NULL ) { - RenderLonelyTriangles( tess, tess->lonelyTriList ); - tess->lonelyTriList = NULL; - } -} - - -static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig ) -{ - /* We want to find the largest triangle fan or strip of unmarked faces - * which includes the given face fOrig. There are 3 possible fans - * passing through fOrig (one centered at each vertex), and 3 possible - * strips (one for each CCW permutation of the vertices). Our strategy - * is to try all of these, and take the primitive which uses the most - * triangles (a greedy approach). - */ - GLUhalfEdge *e = fOrig->anEdge; - struct FaceCount max, newFace; - - max.size = 1; - max.eStart = e; - max.render = &RenderTriangle; - - if( ! tess->flagBoundary ) { - newFace = MaximumFan( e ); if( newFace.size > max.size ) { max = newFace; } - newFace = MaximumFan( e->Lnext ); if( newFace.size > max.size ) { max = newFace; } - newFace = MaximumFan( e->Lprev ); if( newFace.size > max.size ) { max = newFace; } - - newFace = MaximumStrip( e ); if( newFace.size > max.size ) { max = newFace; } - newFace = MaximumStrip( e->Lnext ); if( newFace.size > max.size ) { max = newFace; } - newFace = MaximumStrip( e->Lprev ); if( newFace.size > max.size ) { max = newFace; } - } - (*(max.render))( tess, max.eStart, max.size ); -} - - -/* Macros which keep track of faces we have marked temporarily, and allow - * us to backtrack when necessary. With triangle fans, this is not - * really necessary, since the only awkward case is a loop of triangles - * around a single origin vertex. However with strips the situation is - * more complicated, and we need a general tracking method like the - * one here. - */ -#define Marked(f) (! (f)->inside || (f)->marked) - -#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TRUE) - -#define FreeTrail(t) if( 1 ) { \ - while( (t) != NULL ) { \ - (t)->marked = FALSE; t = (t)->trail; \ - } \ - } else /* absorb trailing semicolon */ - - - -static struct FaceCount MaximumFan( GLUhalfEdge *eOrig ) -{ - /* eOrig->Lface is the face we want to render. We want to find the size - * of a maximal fan around eOrig->Org. To do this we just walk around - * the origin vertex as far as possible in both directions. - */ - struct FaceCount newFace = { 0, NULL, &RenderFan }; - GLUface *trail = NULL; - GLUhalfEdge *e; - - for( e = eOrig; ! Marked( e->Lface ); e = e->Onext ) { - AddToTrail( e->Lface, trail ); - ++newFace.size; - } - for( e = eOrig; ! Marked( e->Rface ); e = e->Oprev ) { - AddToTrail( e->Rface, trail ); - ++newFace.size; - } - newFace.eStart = e; - /*LINTED*/ - FreeTrail( trail ); - return newFace; -} - - -#define IsEven(n) (((n) & 1) == 0) - -static struct FaceCount MaximumStrip( GLUhalfEdge *eOrig ) -{ - /* Here we are looking for a maximal strip that contains the vertices - * eOrig->Org, eOrig->Dst, eOrig->Lnext->Dst (in that order or the - * reverse, such that all triangles are oriented CCW). - * - * Again we walk forward and backward as far as possible. However for - * strips there is a twist: to get CCW orientations, there must be - * an *even* number of triangles in the strip on one side of eOrig. - * We walk the strip starting on a side with an even number of triangles; - * if both side have an odd number, we are forced to shorten one side. - */ - struct FaceCount newFace = { 0, NULL, &RenderStrip }; - long headSize = 0, tailSize = 0; - GLUface *trail = NULL; - GLUhalfEdge *e, *eTail, *eHead; - - for( e = eOrig; ! Marked( e->Lface ); ++tailSize, e = e->Onext ) { - AddToTrail( e->Lface, trail ); - ++tailSize; - e = e->Dprev; - if( Marked( e->Lface )) break; - AddToTrail( e->Lface, trail ); - } - eTail = e; - - for( e = eOrig; ! Marked( e->Rface ); ++headSize, e = e->Dnext ) { - AddToTrail( e->Rface, trail ); - ++headSize; - e = e->Oprev; - if( Marked( e->Rface )) break; - AddToTrail( e->Rface, trail ); - } - eHead = e; - - newFace.size = tailSize + headSize; - if( IsEven( tailSize )) { - newFace.eStart = eTail->Sym; - } else if( IsEven( headSize )) { - newFace.eStart = eHead; - } else { - /* Both sides have odd length, we must shorten one of them. In fact, - * we must start from eHead to guarantee inclusion of eOrig->Lface. - */ - --newFace.size; - newFace.eStart = eHead->Onext; - } - /*LINTED*/ - FreeTrail( trail ); - return newFace; -} - - -static void RenderTriangle( GLUtesselator *tess, GLUhalfEdge *e, long size ) -{ - /* Just add the triangle to a triangle list, so we can render all - * the separate triangles at once. - */ - assert( size == 1 ); - AddToTrail( e->Lface, tess->lonelyTriList ); -} - - -static void RenderLonelyTriangles( GLUtesselator *tess, GLUface *f ) -{ - /* Now we render all the separate triangles which could not be - * grouped into a triangle fan or strip. - */ - GLUhalfEdge *e; - int newState; - int edgeState = -1; /* force edge state output for first vertex */ - - CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLES ); - - for( ; f != NULL; f = f->trail ) { - /* Loop once for each edge (there will always be 3 edges) */ - - e = f->anEdge; - do { - if( tess->flagBoundary ) { - /* Set the "edge state" to TRUE just before we output the - * first vertex of each edge on the polygon boundary. - */ - newState = ! e->Rface->inside; - if( edgeState != newState ) { - edgeState = newState; - CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA( edgeState ); - } - } - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - - e = e->Lnext; - } while( e != f->anEdge ); - } - CALL_END_OR_END_DATA(); -} - - -static void RenderFan( GLUtesselator *tess, GLUhalfEdge *e, long size ) -{ - /* Render as many CCW triangles as possible in a fan starting from - * edge "e". The fan *should* contain exactly "size" triangles - * (otherwise we've goofed up somewhere). - */ - CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); - - while( ! Marked( e->Lface )) { - e->Lface->marked = TRUE; - --size; - e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); - } - - assert( size == 0 ); - CALL_END_OR_END_DATA(); -} - - -static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, long size ) -{ - /* Render as many CCW triangles as possible in a strip starting from - * edge "e". The strip *should* contain exactly "size" triangles - * (otherwise we've goofed up somewhere). - */ - CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_STRIP ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); - - while( ! Marked( e->Lface )) { - e->Lface->marked = TRUE; - --size; - e = e->Dprev; - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - if( Marked( e->Lface )) break; - - e->Lface->marked = TRUE; - --size; - e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); - } - - assert( size == 0 ); - CALL_END_OR_END_DATA(); -} - - -/************************ Boundary contour decomposition ******************/ - -/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one - * contour for each face marked "inside". The rendering output is - * provided as callbacks (see the api). - */ -void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ) -{ - GLUface *f; - GLUhalfEdge *e; - - for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) { - if( f->inside ) { - CALL_BEGIN_OR_BEGIN_DATA( GL_LINE_LOOP ); - e = f->anEdge; - do { - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - e = e->Lnext; - } while( e != f->anEdge ); - CALL_END_OR_END_DATA(); - } - } -} - - -/************************ Quick-and-dirty decomposition ******************/ - -#define SIGN_INCONSISTENT 2 - -static int ComputeNormal( GLUtesselator *tess, GLdouble norm[3], int check ) -/* - * If check==FALSE, we compute the polygon normal and place it in norm[]. - * If check==TRUE, we check that each triangle in the fan from v0 has a - * consistent orientation with respect to norm[]. If triangles are - * consistently oriented CCW, return 1; if CW, return -1; if all triangles - * are degenerate return 0; otherwise (no consistent orientation) return - * SIGN_INCONSISTENT. - */ -{ - CachedVertex *v0 = tess->cache; - CachedVertex *vn = v0 + tess->cacheCount; - CachedVertex *vc; - GLdouble dot, xc, yc, zc, xp, yp, zp, n[3]; - int sign = 0; - - /* Find the polygon normal. It is important to get a reasonable - * normal even when the polygon is self-intersecting (eg. a bowtie). - * Otherwise, the computed normal could be very tiny, but perpendicular - * to the true plane of the polygon due to numerical noise. Then all - * the triangles would appear to be degenerate and we would incorrectly - * decompose the polygon as a fan (or simply not render it at all). - * - * We use a sum-of-triangles normal algorithm rather than the more - * efficient sum-of-trapezoids method (used in CheckOrientation() - * in normal.c). This lets us explicitly reverse the signed area - * of some triangles to get a reasonable normal in the self-intersecting - * case. - */ - if( ! check ) { - norm[0] = norm[1] = norm[2] = 0.0; - } - - vc = v0 + 1; - xc = vc->coords[0] - v0->coords[0]; - yc = vc->coords[1] - v0->coords[1]; - zc = vc->coords[2] - v0->coords[2]; - while( ++vc < vn ) { - xp = xc; yp = yc; zp = zc; - xc = vc->coords[0] - v0->coords[0]; - yc = vc->coords[1] - v0->coords[1]; - zc = vc->coords[2] - v0->coords[2]; - - /* Compute (vp - v0) cross (vc - v0) */ - n[0] = yp*zc - zp*yc; - n[1] = zp*xc - xp*zc; - n[2] = xp*yc - yp*xc; - - dot = n[0]*norm[0] + n[1]*norm[1] + n[2]*norm[2]; - if( ! check ) { - /* Reverse the contribution of back-facing triangles to get - * a reasonable normal for self-intersecting polygons (see above) - */ - if( dot >= 0 ) { - norm[0] += n[0]; norm[1] += n[1]; norm[2] += n[2]; - } else { - norm[0] -= n[0]; norm[1] -= n[1]; norm[2] -= n[2]; - } - } else if( dot != 0 ) { - /* Check the new orientation for consistency with previous triangles */ - if( dot > 0 ) { - if( sign < 0 ) return SIGN_INCONSISTENT; - sign = 1; - } else { - if( sign > 0 ) return SIGN_INCONSISTENT; - sign = -1; - } - } - } - return sign; -} - -/* __gl_renderCache( tess ) takes a single contour and tries to render it - * as a triangle fan. This handles convex polygons, as well as some - * non-convex polygons if we get lucky. - * - * Returns TRUE if the polygon was successfully rendered. The rendering - * output is provided as callbacks (see the api). - */ -GLboolean __gl_renderCache( GLUtesselator *tess ) -{ - CachedVertex *v0 = tess->cache; - CachedVertex *vn = v0 + tess->cacheCount; - CachedVertex *vc; - GLdouble norm[3]; - int sign; - - if( tess->cacheCount < 3 ) { - /* Degenerate contour -- no output */ - return TRUE; - } - - norm[0] = tess->normal[0]; - norm[1] = tess->normal[1]; - norm[2] = tess->normal[2]; - if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) { - ComputeNormal( tess, norm, FALSE ); - } - - sign = ComputeNormal( tess, norm, TRUE ); - if( sign == SIGN_INCONSISTENT ) { - /* Fan triangles did not have a consistent orientation */ - return FALSE; - } - if( sign == 0 ) { - /* All triangles were degenerate */ - return TRUE; - } - - /* Make sure we do the right thing for each winding rule */ - switch( tess->windingRule ) { - case GLU_TESS_WINDING_ODD: - case GLU_TESS_WINDING_NONZERO: - break; - case GLU_TESS_WINDING_POSITIVE: - if( sign < 0 ) return TRUE; - break; - case GLU_TESS_WINDING_NEGATIVE: - if( sign > 0 ) return TRUE; - break; - case GLU_TESS_WINDING_ABS_GEQ_TWO: - return TRUE; - } - - CALL_BEGIN_OR_BEGIN_DATA( tess->boundaryOnly ? GL_LINE_LOOP - : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN - : GL_TRIANGLES ); - - CALL_VERTEX_OR_VERTEX_DATA( v0->data ); - if( sign > 0 ) { - for( vc = v0+1; vc < vn; ++vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); - } - } else { - for( vc = vn-1; vc > v0; --vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); - } - } - CALL_END_OR_END_DATA(); - return TRUE; -} diff --git a/src/libs/mesa/glu/libtess/render.h b/src/libs/mesa/glu/libtess/render.h deleted file mode 100644 index a298c9a948..0000000000 --- a/src/libs/mesa/glu/libtess/render.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __render_h_ -#define __render_h_ - -#include "mesh.h" - -/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle - * fans, strips, and separate triangles. A substantial effort is made - * to use as few rendering primitives as possible (ie. to make the fans - * and strips as large as possible). - * - * The rendering output is provided as callbacks (see the api). - */ -void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh ); -void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ); - -GLboolean __gl_renderCache( GLUtesselator *tess ); - -#endif diff --git a/src/libs/mesa/glu/libtess/sweep.c b/src/libs/mesa/glu/libtess/sweep.c deleted file mode 100644 index 744be6b47d..0000000000 --- a/src/libs/mesa/glu/libtess/sweep.c +++ /dev/null @@ -1,1357 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include -#include /* longjmp */ -#include /* LONG_MAX */ - -#include "mesh.h" -#include "geom.h" -#include "tess.h" -#include "dict.h" -#include "priorityq.h" -#include "memalloc.h" -#include "sweep.h" - -#define TRUE 1 -#define FALSE 0 - -#ifdef FOR_TRITE_TEST_PROGRAM -extern void DebugEvent( GLUtesselator *tess ); -#else -#define DebugEvent( tess ) -#endif - -/* - * Invariants for the Edge Dictionary. - * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2) - * at any valid location of the sweep event - * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2 - * share a common endpoint - * - for each e, e->Dst has been processed, but not e->Org - * - each edge e satisfies VertLeq(e->Dst,event) && VertLeq(event,e->Org) - * where "event" is the current sweep line event. - * - no edge e has zero length - * - * Invariants for the Mesh (the processed portion). - * - the portion of the mesh left of the sweep line is a planar graph, - * ie. there is *some* way to embed it in the plane - * - no processed edge has zero length - * - no two processed vertices have identical coordinates - * - each "inside" region is monotone, ie. can be broken into two chains - * of monotonically increasing vertices according to VertLeq(v1,v2) - * - a non-invariant: these chains may intersect (very slightly) - * - * Invariants for the Sweep. - * - if none of the edges incident to the event vertex have an activeRegion - * (ie. none of these edges are in the edge dictionary), then the vertex - * has only right-going edges. - * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced - * by ConnectRightVertex), then it is the only right-going edge from - * its associated vertex. (This says that these edges exist only - * when it is necessary.) - */ - -#undef MAX -#undef MIN -#define MAX(x,y) ((x) >= (y) ? (x) : (y)) -#define MIN(x,y) ((x) <= (y) ? (x) : (y)) - -/* When we merge two edges into one, we need to compute the combined - * winding of the new edge. - */ -#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \ - eDst->Sym->winding += eSrc->Sym->winding) - -static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ); -static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ); -static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp ); - -static int EdgeLeq( GLUtesselator *tess, ActiveRegion *reg1, - ActiveRegion *reg2 ) -/* - * Both edges must be directed from right to left (this is the canonical - * direction for the upper edge of each region). - * - * The strategy is to evaluate a "t" value for each edge at the - * current sweep line position, given by tess->event. The calculations - * are designed to be very stable, but of course they are not perfect. - * - * Special case: if both edge destinations are at the sweep event, - * we sort the edges by slope (they would otherwise compare equally). - */ -{ - GLUvertex *event = tess->event; - GLUhalfEdge *e1, *e2; - GLdouble t1, t2; - - e1 = reg1->eUp; - e2 = reg2->eUp; - - if( e1->Dst == event ) { - if( e2->Dst == event ) { - /* Two edges right of the sweep line which meet at the sweep event. - * Sort them by slope. - */ - if( VertLeq( e1->Org, e2->Org )) { - return EdgeSign( e2->Dst, e1->Org, e2->Org ) <= 0; - } - return EdgeSign( e1->Dst, e2->Org, e1->Org ) >= 0; - } - return EdgeSign( e2->Dst, event, e2->Org ) <= 0; - } - if( e2->Dst == event ) { - return EdgeSign( e1->Dst, event, e1->Org ) >= 0; - } - - /* General case - compute signed distance *from* e1, e2 to event */ - t1 = EdgeEval( e1->Dst, event, e1->Org ); - t2 = EdgeEval( e2->Dst, event, e2->Org ); - return (t1 >= t2); -} - - -static void DeleteRegion( GLUtesselator *tess, ActiveRegion *reg ) -{ - if( reg->fixUpperEdge ) { - /* It was created with zero winding number, so it better be - * deleted with zero winding number (ie. it better not get merged - * with a real edge). - */ - assert( reg->eUp->winding == 0 ); - } - reg->eUp->activeRegion = NULL; - dictDelete( tess->dict, reg->nodeUp ); /* __gl_dictListDelete */ - memFree( reg ); -} - - -static int FixUpperEdge( ActiveRegion *reg, GLUhalfEdge *newEdge ) -/* - * Replace an upper edge which needs fixing (see ConnectRightVertex). - */ -{ - assert( reg->fixUpperEdge ); - if ( !__gl_meshDelete( reg->eUp ) ) return 0; - reg->fixUpperEdge = FALSE; - reg->eUp = newEdge; - newEdge->activeRegion = reg; - - return 1; -} - -static ActiveRegion *TopLeftRegion( ActiveRegion *reg ) -{ - GLUvertex *org = reg->eUp->Org; - GLUhalfEdge *e; - - /* Find the region above the uppermost edge with the same origin */ - do { - reg = RegionAbove( reg ); - } while( reg->eUp->Org == org ); - - /* If the edge above was a temporary edge introduced by ConnectRightVertex, - * now is the time to fix it. - */ - if( reg->fixUpperEdge ) { - e = __gl_meshConnect( RegionBelow(reg)->eUp->Sym, reg->eUp->Lnext ); - if (e == NULL) return NULL; - if ( !FixUpperEdge( reg, e ) ) return NULL; - reg = RegionAbove( reg ); - } - return reg; -} - -static ActiveRegion *TopRightRegion( ActiveRegion *reg ) -{ - GLUvertex *dst = reg->eUp->Dst; - - /* Find the region above the uppermost edge with the same destination */ - do { - reg = RegionAbove( reg ); - } while( reg->eUp->Dst == dst ); - return reg; -} - -static ActiveRegion *AddRegionBelow( GLUtesselator *tess, - ActiveRegion *regAbove, - GLUhalfEdge *eNewUp ) -/* - * Add a new active region to the sweep line, *somewhere* below "regAbove" - * (according to where the new edge belongs in the sweep-line dictionary). - * The upper edge of the new region will be "eNewUp". - * Winding number and "inside" flag are not updated. - */ -{ - ActiveRegion *regNew = (ActiveRegion *)memAlloc( sizeof( ActiveRegion )); - if (regNew == NULL) longjmp(tess->env,1); - - regNew->eUp = eNewUp; - /* __gl_dictListInsertBefore */ - regNew->nodeUp = dictInsertBefore( tess->dict, regAbove->nodeUp, regNew ); - if (regNew->nodeUp == NULL) longjmp(tess->env,1); - regNew->fixUpperEdge = FALSE; - regNew->sentinel = FALSE; - regNew->dirty = FALSE; - - eNewUp->activeRegion = regNew; - return regNew; -} - -static GLboolean IsWindingInside( GLUtesselator *tess, int n ) -{ - switch( tess->windingRule ) { - case GLU_TESS_WINDING_ODD: - return (n & 1); - case GLU_TESS_WINDING_NONZERO: - return (n != 0); - case GLU_TESS_WINDING_POSITIVE: - return (n > 0); - case GLU_TESS_WINDING_NEGATIVE: - return (n < 0); - case GLU_TESS_WINDING_ABS_GEQ_TWO: - return (n >= 2) || (n <= -2); - } - /*LINTED*/ - assert( FALSE ); - /*NOTREACHED*/ - return GL_FALSE; /* avoid compiler complaints */ -} - - -static void ComputeWinding( GLUtesselator *tess, ActiveRegion *reg ) -{ - reg->windingNumber = RegionAbove(reg)->windingNumber + reg->eUp->winding; - reg->inside = IsWindingInside( tess, reg->windingNumber ); -} - - -static void FinishRegion( GLUtesselator *tess, ActiveRegion *reg ) -/* - * Delete a region from the sweep line. This happens when the upper - * and lower chains of a region meet (at a vertex on the sweep line). - * The "inside" flag is copied to the appropriate mesh face (we could - * not do this before -- since the structure of the mesh is always - * changing, this face may not have even existed until now). - */ -{ - GLUhalfEdge *e = reg->eUp; - GLUface *f = e->Lface; - - f->inside = reg->inside; - f->anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */ - DeleteRegion( tess, reg ); -} - - -static GLUhalfEdge *FinishLeftRegions( GLUtesselator *tess, - ActiveRegion *regFirst, ActiveRegion *regLast ) -/* - * We are given a vertex with one or more left-going edges. All affected - * edges should be in the edge dictionary. Starting at regFirst->eUp, - * we walk down deleting all regions where both edges have the same - * origin vOrg. At the same time we copy the "inside" flag from the - * active region to the face, since at this point each face will belong - * to at most one region (this was not necessarily true until this point - * in the sweep). The walk stops at the region above regLast; if regLast - * is NULL we walk as far as possible. At the same time we relink the - * mesh if necessary, so that the ordering of edges around vOrg is the - * same as in the dictionary. - */ -{ - ActiveRegion *reg, *regPrev; - GLUhalfEdge *e, *ePrev; - - regPrev = regFirst; - ePrev = regFirst->eUp; - while( regPrev != regLast ) { - regPrev->fixUpperEdge = FALSE; /* placement was OK */ - reg = RegionBelow( regPrev ); - e = reg->eUp; - if( e->Org != ePrev->Org ) { - if( ! reg->fixUpperEdge ) { - /* Remove the last left-going edge. Even though there are no further - * edges in the dictionary with this origin, there may be further - * such edges in the mesh (if we are adding left edges to a vertex - * that has already been processed). Thus it is important to call - * FinishRegion rather than just DeleteRegion. - */ - FinishRegion( tess, regPrev ); - break; - } - /* If the edge below was a temporary edge introduced by - * ConnectRightVertex, now is the time to fix it. - */ - e = __gl_meshConnect( ePrev->Lprev, e->Sym ); - if (e == NULL) longjmp(tess->env,1); - if ( !FixUpperEdge( reg, e ) ) longjmp(tess->env,1); - } - - /* Relink edges so that ePrev->Onext == e */ - if( ePrev->Onext != e ) { - if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1); - if ( !__gl_meshSplice( ePrev, e ) ) longjmp(tess->env,1); - } - FinishRegion( tess, regPrev ); /* may change reg->eUp */ - ePrev = reg->eUp; - regPrev = reg; - } - return ePrev; -} - - -static void AddRightEdges( GLUtesselator *tess, ActiveRegion *regUp, - GLUhalfEdge *eFirst, GLUhalfEdge *eLast, GLUhalfEdge *eTopLeft, - GLboolean cleanUp ) -/* - * Purpose: insert right-going edges into the edge dictionary, and update - * winding numbers and mesh connectivity appropriately. All right-going - * edges share a common origin vOrg. Edges are inserted CCW starting at - * eFirst; the last edge inserted is eLast->Oprev. If vOrg has any - * left-going edges already processed, then eTopLeft must be the edge - * such that an imaginary upward vertical segment from vOrg would be - * contained between eTopLeft->Oprev and eTopLeft; otherwise eTopLeft - * should be NULL. - */ -{ - ActiveRegion *reg, *regPrev; - GLUhalfEdge *e, *ePrev; - int firstTime = TRUE; - - /* Insert the new right-going edges in the dictionary */ - e = eFirst; - do { - assert( VertLeq( e->Org, e->Dst )); - AddRegionBelow( tess, regUp, e->Sym ); - e = e->Onext; - } while ( e != eLast ); - - /* Walk *all* right-going edges from e->Org, in the dictionary order, - * updating the winding numbers of each region, and re-linking the mesh - * edges to match the dictionary ordering (if necessary). - */ - if( eTopLeft == NULL ) { - eTopLeft = RegionBelow( regUp )->eUp->Rprev; - } - regPrev = regUp; - ePrev = eTopLeft; - for( ;; ) { - reg = RegionBelow( regPrev ); - e = reg->eUp->Sym; - if( e->Org != ePrev->Org ) break; - - if( e->Onext != ePrev ) { - /* Unlink e from its current position, and relink below ePrev */ - if ( !__gl_meshSplice( e->Oprev, e ) ) longjmp(tess->env,1); - if ( !__gl_meshSplice( ePrev->Oprev, e ) ) longjmp(tess->env,1); - } - /* Compute the winding number and "inside" flag for the new regions */ - reg->windingNumber = regPrev->windingNumber - e->winding; - reg->inside = IsWindingInside( tess, reg->windingNumber ); - - /* Check for two outgoing edges with same slope -- process these - * before any intersection tests (see example in __gl_computeInterior). - */ - regPrev->dirty = TRUE; - if( ! firstTime && CheckForRightSplice( tess, regPrev )) { - AddWinding( e, ePrev ); - DeleteRegion( tess, regPrev ); - if ( !__gl_meshDelete( ePrev ) ) longjmp(tess->env,1); - } - firstTime = FALSE; - regPrev = reg; - ePrev = e; - } - regPrev->dirty = TRUE; - assert( regPrev->windingNumber - e->winding == reg->windingNumber ); - - if( cleanUp ) { - /* Check for intersections between newly adjacent edges. */ - WalkDirtyRegions( tess, regPrev ); - } -} - - -static void CallCombine( GLUtesselator *tess, GLUvertex *isect, - void *data[4], GLfloat weights[4], int needed ) -{ - GLdouble coords[3]; - - /* Copy coord data in case the callback changes it. */ - coords[0] = isect->coords[0]; - coords[1] = isect->coords[1]; - coords[2] = isect->coords[2]; - - isect->data = NULL; - CALL_COMBINE_OR_COMBINE_DATA( coords, data, weights, &isect->data ); - if( isect->data == NULL ) { - if( ! needed ) { - isect->data = data[0]; - } else if( ! tess->fatalError ) { - /* The only way fatal error is when two edges are found to intersect, - * but the user has not provided the callback necessary to handle - * generated intersection points. - */ - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_NEED_COMBINE_CALLBACK ); - tess->fatalError = TRUE; - } - } -} - -static void SpliceMergeVertices( GLUtesselator *tess, GLUhalfEdge *e1, - GLUhalfEdge *e2 ) -/* - * Two vertices with idential coordinates are combined into one. - * e1->Org is kept, while e2->Org is discarded. - */ -{ - void *data[4] = { NULL, NULL, NULL, NULL }; - GLfloat weights[4] = { 0.5, 0.5, 0.0, 0.0 }; - - data[0] = e1->Org->data; - data[1] = e2->Org->data; - CallCombine( tess, e1->Org, data, weights, FALSE ); - if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1); -} - -static void VertexWeights( GLUvertex *isect, GLUvertex *org, GLUvertex *dst, - GLfloat *weights ) -/* - * Find some weights which describe how the intersection vertex is - * a linear combination of "org" and "dest". Each of the two edges - * which generated "isect" is allocated 50% of the weight; each edge - * splits the weight between its org and dst according to the - * relative distance to "isect". - */ -{ - GLdouble t1 = VertL1dist( org, isect ); - GLdouble t2 = VertL1dist( dst, isect ); - - weights[0] = 0.5 * t2 / (t1 + t2); - weights[1] = 0.5 * t1 / (t1 + t2); - isect->coords[0] += weights[0]*org->coords[0] + weights[1]*dst->coords[0]; - isect->coords[1] += weights[0]*org->coords[1] + weights[1]*dst->coords[1]; - isect->coords[2] += weights[0]*org->coords[2] + weights[1]*dst->coords[2]; -} - - -static void GetIntersectData( GLUtesselator *tess, GLUvertex *isect, - GLUvertex *orgUp, GLUvertex *dstUp, - GLUvertex *orgLo, GLUvertex *dstLo ) -/* - * We've computed a new intersection point, now we need a "data" pointer - * from the user so that we can refer to this new vertex in the - * rendering callbacks. - */ -{ - void *data[4]; - GLfloat weights[4]; - - data[0] = orgUp->data; - data[1] = dstUp->data; - data[2] = orgLo->data; - data[3] = dstLo->data; - - isect->coords[0] = isect->coords[1] = isect->coords[2] = 0; - VertexWeights( isect, orgUp, dstUp, &weights[0] ); - VertexWeights( isect, orgLo, dstLo, &weights[2] ); - - CallCombine( tess, isect, data, weights, TRUE ); -} - -static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp ) -/* - * Check the upper and lower edge of "regUp", to make sure that the - * eUp->Org is above eLo, or eLo->Org is below eUp (depending on which - * origin is leftmost). - * - * The main purpose is to splice right-going edges with the same - * dest vertex and nearly identical slopes (ie. we can't distinguish - * the slopes numerically). However the splicing can also help us - * to recover from numerical errors. For example, suppose at one - * point we checked eUp and eLo, and decided that eUp->Org is barely - * above eLo. Then later, we split eLo into two edges (eg. from - * a splice operation like this one). This can change the result of - * our test so that now eUp->Org is incident to eLo, or barely below it. - * We must correct this condition to maintain the dictionary invariants. - * - * One possibility is to check these edges for intersection again - * (ie. CheckForIntersect). This is what we do if possible. However - * CheckForIntersect requires that tess->event lies between eUp and eLo, - * so that it has something to fall back on when the intersection - * calculation gives us an unusable answer. So, for those cases where - * we can't check for intersection, this routine fixes the problem - * by just splicing the offending vertex into the other edge. - * This is a guaranteed solution, no matter how degenerate things get. - * Basically this is a combinatorial solution to a numerical problem. - */ -{ - ActiveRegion *regLo = RegionBelow(regUp); - GLUhalfEdge *eUp = regUp->eUp; - GLUhalfEdge *eLo = regLo->eUp; - - if( VertLeq( eUp->Org, eLo->Org )) { - if( EdgeSign( eLo->Dst, eUp->Org, eLo->Org ) > 0 ) return FALSE; - - /* eUp->Org appears to be below eLo */ - if( ! VertEq( eUp->Org, eLo->Org )) { - /* Splice eUp->Org into eLo */ - if ( __gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eUp, eLo->Oprev ) ) longjmp(tess->env,1); - regUp->dirty = regLo->dirty = TRUE; - - } else if( eUp->Org != eLo->Org ) { - /* merge the two vertices, discarding eUp->Org */ - pqDelete( tess->pq, eUp->Org->pqHandle ); /* __gl_pqSortDelete */ - SpliceMergeVertices( tess, eLo->Oprev, eUp ); - } - } else { - if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return FALSE; - - /* eLo->Org appears to be above eUp, so splice eLo->Org into eUp */ - RegionAbove(regUp)->dirty = regUp->dirty = TRUE; - if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1); - } - return TRUE; -} - -static int CheckForLeftSplice( GLUtesselator *tess, ActiveRegion *regUp ) -/* - * Check the upper and lower edge of "regUp", to make sure that the - * eUp->Dst is above eLo, or eLo->Dst is below eUp (depending on which - * destination is rightmost). - * - * Theoretically, this should always be true. However, splitting an edge - * into two pieces can change the results of previous tests. For example, - * suppose at one point we checked eUp and eLo, and decided that eUp->Dst - * is barely above eLo. Then later, we split eLo into two edges (eg. from - * a splice operation like this one). This can change the result of - * the test so that now eUp->Dst is incident to eLo, or barely below it. - * We must correct this condition to maintain the dictionary invariants - * (otherwise new edges might get inserted in the wrong place in the - * dictionary, and bad stuff will happen). - * - * We fix the problem by just splicing the offending vertex into the - * other edge. - */ -{ - ActiveRegion *regLo = RegionBelow(regUp); - GLUhalfEdge *eUp = regUp->eUp; - GLUhalfEdge *eLo = regLo->eUp; - GLUhalfEdge *e; - - assert( ! VertEq( eUp->Dst, eLo->Dst )); - - if( VertLeq( eUp->Dst, eLo->Dst )) { - if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return FALSE; - - /* eLo->Dst is above eUp, so splice eLo->Dst into eUp */ - RegionAbove(regUp)->dirty = regUp->dirty = TRUE; - e = __gl_meshSplitEdge( eUp ); - if (e == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eLo->Sym, e ) ) longjmp(tess->env,1); - e->Lface->inside = regUp->inside; - } else { - if( EdgeSign( eLo->Dst, eUp->Dst, eLo->Org ) > 0 ) return FALSE; - - /* eUp->Dst is below eLo, so splice eUp->Dst into eLo */ - regUp->dirty = regLo->dirty = TRUE; - e = __gl_meshSplitEdge( eLo ); - if (e == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eUp->Lnext, eLo->Sym ) ) longjmp(tess->env,1); - e->Rface->inside = regUp->inside; - } - return TRUE; -} - - -static int CheckForIntersect( GLUtesselator *tess, ActiveRegion *regUp ) -/* - * Check the upper and lower edges of the given region to see if - * they intersect. If so, create the intersection and add it - * to the data structures. - * - * Returns TRUE if adding the new intersection resulted in a recursive - * call to AddRightEdges(); in this case all "dirty" regions have been - * checked for intersections, and possibly regUp has been deleted. - */ -{ - ActiveRegion *regLo = RegionBelow(regUp); - GLUhalfEdge *eUp = regUp->eUp; - GLUhalfEdge *eLo = regLo->eUp; - GLUvertex *orgUp = eUp->Org; - GLUvertex *orgLo = eLo->Org; - GLUvertex *dstUp = eUp->Dst; - GLUvertex *dstLo = eLo->Dst; - GLdouble tMinUp, tMaxLo; - GLUvertex isect, *orgMin; - GLUhalfEdge *e; - - assert( ! VertEq( dstLo, dstUp )); - assert( EdgeSign( dstUp, tess->event, orgUp ) <= 0 ); - assert( EdgeSign( dstLo, tess->event, orgLo ) >= 0 ); - assert( orgUp != tess->event && orgLo != tess->event ); - assert( ! regUp->fixUpperEdge && ! regLo->fixUpperEdge ); - - if( orgUp == orgLo ) return FALSE; /* right endpoints are the same */ - - tMinUp = MIN( orgUp->t, dstUp->t ); - tMaxLo = MAX( orgLo->t, dstLo->t ); - if( tMinUp > tMaxLo ) return FALSE; /* t ranges do not overlap */ - - if( VertLeq( orgUp, orgLo )) { - if( EdgeSign( dstLo, orgUp, orgLo ) > 0 ) return FALSE; - } else { - if( EdgeSign( dstUp, orgLo, orgUp ) < 0 ) return FALSE; - } - - /* At this point the edges intersect, at least marginally */ - DebugEvent( tess ); - - __gl_edgeIntersect( dstUp, orgUp, dstLo, orgLo, &isect ); - /* The following properties are guaranteed: */ - assert( MIN( orgUp->t, dstUp->t ) <= isect.t ); - assert( isect.t <= MAX( orgLo->t, dstLo->t )); - assert( MIN( dstLo->s, dstUp->s ) <= isect.s ); - assert( isect.s <= MAX( orgLo->s, orgUp->s )); - - if( VertLeq( &isect, tess->event )) { - /* The intersection point lies slightly to the left of the sweep line, - * so move it until it''s slightly to the right of the sweep line. - * (If we had perfect numerical precision, this would never happen - * in the first place). The easiest and safest thing to do is - * replace the intersection by tess->event. - */ - isect.s = tess->event->s; - isect.t = tess->event->t; - } - /* Similarly, if the computed intersection lies to the right of the - * rightmost origin (which should rarely happen), it can cause - * unbelievable inefficiency on sufficiently degenerate inputs. - * (If you have the test program, try running test54.d with the - * "X zoom" option turned on). - */ - orgMin = VertLeq( orgUp, orgLo ) ? orgUp : orgLo; - if( VertLeq( orgMin, &isect )) { - isect.s = orgMin->s; - isect.t = orgMin->t; - } - - if( VertEq( &isect, orgUp ) || VertEq( &isect, orgLo )) { - /* Easy case -- intersection at one of the right endpoints */ - (void) CheckForRightSplice( tess, regUp ); - return FALSE; - } - - if( (! VertEq( dstUp, tess->event ) - && EdgeSign( dstUp, tess->event, &isect ) >= 0) - || (! VertEq( dstLo, tess->event ) - && EdgeSign( dstLo, tess->event, &isect ) <= 0 )) - { - /* Very unusual -- the new upper or lower edge would pass on the - * wrong side of the sweep event, or through it. This can happen - * due to very small numerical errors in the intersection calculation. - */ - if( dstLo == tess->event ) { - /* Splice dstLo into eUp, and process the new region(s) */ - if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eLo->Sym, eUp ) ) longjmp(tess->env,1); - regUp = TopLeftRegion( regUp ); - if (regUp == NULL) longjmp(tess->env,1); - eUp = RegionBelow(regUp)->eUp; - FinishLeftRegions( tess, RegionBelow(regUp), regLo ); - AddRightEdges( tess, regUp, eUp->Oprev, eUp, eUp, TRUE ); - return TRUE; - } - if( dstUp == tess->event ) { - /* Splice dstUp into eLo, and process the new region(s) */ - if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eUp->Lnext, eLo->Oprev ) ) longjmp(tess->env,1); - regLo = regUp; - regUp = TopRightRegion( regUp ); - e = RegionBelow(regUp)->eUp->Rprev; - regLo->eUp = eLo->Oprev; - eLo = FinishLeftRegions( tess, regLo, NULL ); - AddRightEdges( tess, regUp, eLo->Onext, eUp->Rprev, e, TRUE ); - return TRUE; - } - /* Special case: called from ConnectRightVertex. If either - * edge passes on the wrong side of tess->event, split it - * (and wait for ConnectRightVertex to splice it appropriately). - */ - if( EdgeSign( dstUp, tess->event, &isect ) >= 0 ) { - RegionAbove(regUp)->dirty = regUp->dirty = TRUE; - if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); - eUp->Org->s = tess->event->s; - eUp->Org->t = tess->event->t; - } - if( EdgeSign( dstLo, tess->event, &isect ) <= 0 ) { - regUp->dirty = regLo->dirty = TRUE; - if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); - eLo->Org->s = tess->event->s; - eLo->Org->t = tess->event->t; - } - /* leave the rest for ConnectRightVertex */ - return FALSE; - } - - /* General case -- split both edges, splice into new vertex. - * When we do the splice operation, the order of the arguments is - * arbitrary as far as correctness goes. However, when the operation - * creates a new face, the work done is proportional to the size of - * the new face. We expect the faces in the processed part of - * the mesh (ie. eUp->Lface) to be smaller than the faces in the - * unprocessed original contours (which will be eLo->Oprev->Lface). - */ - if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1); - if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1); - eUp->Org->s = isect.s; - eUp->Org->t = isect.t; - eUp->Org->pqHandle = pqInsert( tess->pq, eUp->Org ); /* __gl_pqSortInsert */ - if (eUp->Org->pqHandle == LONG_MAX) { - pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */ - tess->pq = NULL; - longjmp(tess->env,1); - } - GetIntersectData( tess, eUp->Org, orgUp, dstUp, orgLo, dstLo ); - RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = TRUE; - return FALSE; -} - -static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ) -/* - * When the upper or lower edge of any region changes, the region is - * marked "dirty". This routine walks through all the dirty regions - * and makes sure that the dictionary invariants are satisfied - * (see the comments at the beginning of this file). Of course - * new dirty regions can be created as we make changes to restore - * the invariants. - */ -{ - ActiveRegion *regLo = RegionBelow(regUp); - GLUhalfEdge *eUp, *eLo; - - for( ;; ) { - /* Find the lowest dirty region (we walk from the bottom up). */ - while( regLo->dirty ) { - regUp = regLo; - regLo = RegionBelow(regLo); - } - if( ! regUp->dirty ) { - regLo = regUp; - regUp = RegionAbove( regUp ); - if( regUp == NULL || ! regUp->dirty ) { - /* We've walked all the dirty regions */ - return; - } - } - regUp->dirty = FALSE; - eUp = regUp->eUp; - eLo = regLo->eUp; - - if( eUp->Dst != eLo->Dst ) { - /* Check that the edge ordering is obeyed at the Dst vertices. */ - if( CheckForLeftSplice( tess, regUp )) { - - /* If the upper or lower edge was marked fixUpperEdge, then - * we no longer need it (since these edges are needed only for - * vertices which otherwise have no right-going edges). - */ - if( regLo->fixUpperEdge ) { - DeleteRegion( tess, regLo ); - if ( !__gl_meshDelete( eLo ) ) longjmp(tess->env,1); - regLo = RegionBelow( regUp ); - eLo = regLo->eUp; - } else if( regUp->fixUpperEdge ) { - DeleteRegion( tess, regUp ); - if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1); - regUp = RegionAbove( regLo ); - eUp = regUp->eUp; - } - } - } - if( eUp->Org != eLo->Org ) { - if( eUp->Dst != eLo->Dst - && ! regUp->fixUpperEdge && ! regLo->fixUpperEdge - && (eUp->Dst == tess->event || eLo->Dst == tess->event) ) - { - /* When all else fails in CheckForIntersect(), it uses tess->event - * as the intersection location. To make this possible, it requires - * that tess->event lie between the upper and lower edges, and also - * that neither of these is marked fixUpperEdge (since in the worst - * case it might splice one of these edges into tess->event, and - * violate the invariant that fixable edges are the only right-going - * edge from their associated vertex). - */ - if( CheckForIntersect( tess, regUp )) { - /* WalkDirtyRegions() was called recursively; we're done */ - return; - } - } else { - /* Even though we can't use CheckForIntersect(), the Org vertices - * may violate the dictionary edge ordering. Check and correct this. - */ - (void) CheckForRightSplice( tess, regUp ); - } - } - if( eUp->Org == eLo->Org && eUp->Dst == eLo->Dst ) { - /* A degenerate loop consisting of only two edges -- delete it. */ - AddWinding( eLo, eUp ); - DeleteRegion( tess, regUp ); - if ( !__gl_meshDelete( eUp ) ) longjmp(tess->env,1); - regUp = RegionAbove( regLo ); - } - } -} - - -static void ConnectRightVertex( GLUtesselator *tess, ActiveRegion *regUp, - GLUhalfEdge *eBottomLeft ) -/* - * Purpose: connect a "right" vertex vEvent (one where all edges go left) - * to the unprocessed portion of the mesh. Since there are no right-going - * edges, two regions (one above vEvent and one below) are being merged - * into one. "regUp" is the upper of these two regions. - * - * There are two reasons for doing this (adding a right-going edge): - * - if the two regions being merged are "inside", we must add an edge - * to keep them separated (the combined region would not be monotone). - * - in any case, we must leave some record of vEvent in the dictionary, - * so that we can merge vEvent with features that we have not seen yet. - * For example, maybe there is a vertical edge which passes just to - * the right of vEvent; we would like to splice vEvent into this edge. - * - * However, we don't want to connect vEvent to just any vertex. We don''t - * want the new edge to cross any other edges; otherwise we will create - * intersection vertices even when the input data had no self-intersections. - * (This is a bad thing; if the user's input data has no intersections, - * we don't want to generate any false intersections ourselves.) - * - * Our eventual goal is to connect vEvent to the leftmost unprocessed - * vertex of the combined region (the union of regUp and regLo). - * But because of unseen vertices with all right-going edges, and also - * new vertices which may be created by edge intersections, we don''t - * know where that leftmost unprocessed vertex is. In the meantime, we - * connect vEvent to the closest vertex of either chain, and mark the region - * as "fixUpperEdge". This flag says to delete and reconnect this edge - * to the next processed vertex on the boundary of the combined region. - * Quite possibly the vertex we connected to will turn out to be the - * closest one, in which case we won''t need to make any changes. - */ -{ - GLUhalfEdge *eNew; - GLUhalfEdge *eTopLeft = eBottomLeft->Onext; - ActiveRegion *regLo = RegionBelow(regUp); - GLUhalfEdge *eUp = regUp->eUp; - GLUhalfEdge *eLo = regLo->eUp; - int degenerate = FALSE; - - if( eUp->Dst != eLo->Dst ) { - (void) CheckForIntersect( tess, regUp ); - } - - /* Possible new degeneracies: upper or lower edge of regUp may pass - * through vEvent, or may coincide with new intersection vertex - */ - if( VertEq( eUp->Org, tess->event )) { - if ( !__gl_meshSplice( eTopLeft->Oprev, eUp ) ) longjmp(tess->env,1); - regUp = TopLeftRegion( regUp ); - if (regUp == NULL) longjmp(tess->env,1); - eTopLeft = RegionBelow( regUp )->eUp; - FinishLeftRegions( tess, RegionBelow(regUp), regLo ); - degenerate = TRUE; - } - if( VertEq( eLo->Org, tess->event )) { - if ( !__gl_meshSplice( eBottomLeft, eLo->Oprev ) ) longjmp(tess->env,1); - eBottomLeft = FinishLeftRegions( tess, regLo, NULL ); - degenerate = TRUE; - } - if( degenerate ) { - AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE ); - return; - } - - /* Non-degenerate situation -- need to add a temporary, fixable edge. - * Connect to the closer of eLo->Org, eUp->Org. - */ - if( VertLeq( eLo->Org, eUp->Org )) { - eNew = eLo->Oprev; - } else { - eNew = eUp; - } - eNew = __gl_meshConnect( eBottomLeft->Lprev, eNew ); - if (eNew == NULL) longjmp(tess->env,1); - - /* Prevent cleanup, otherwise eNew might disappear before we've even - * had a chance to mark it as a temporary edge. - */ - AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, FALSE ); - eNew->Sym->activeRegion->fixUpperEdge = TRUE; - WalkDirtyRegions( tess, regUp ); -} - -/* Because vertices at exactly the same location are merged together - * before we process the sweep event, some degenerate cases can't occur. - * However if someone eventually makes the modifications required to - * merge features which are close together, the cases below marked - * TOLERANCE_NONZERO will be useful. They were debugged before the - * code to merge identical vertices in the main loop was added. - */ -#define TOLERANCE_NONZERO FALSE - -static void ConnectLeftDegenerate( GLUtesselator *tess, - ActiveRegion *regUp, GLUvertex *vEvent ) -/* - * The event vertex lies exacty on an already-processed edge or vertex. - * Adding the new vertex involves splicing it into the already-processed - * part of the mesh. - */ -{ - GLUhalfEdge *e, *eTopLeft, *eTopRight, *eLast; - ActiveRegion *reg; - - e = regUp->eUp; - if( VertEq( e->Org, vEvent )) { - /* e->Org is an unprocessed vertex - just combine them, and wait - * for e->Org to be pulled from the queue - */ - assert( TOLERANCE_NONZERO ); - SpliceMergeVertices( tess, e, vEvent->anEdge ); - return; - } - - if( ! VertEq( e->Dst, vEvent )) { - /* General case -- splice vEvent into edge e which passes through it */ - if (__gl_meshSplitEdge( e->Sym ) == NULL) longjmp(tess->env,1); - if( regUp->fixUpperEdge ) { - /* This edge was fixable -- delete unused portion of original edge */ - if ( !__gl_meshDelete( e->Onext ) ) longjmp(tess->env,1); - regUp->fixUpperEdge = FALSE; - } - if ( !__gl_meshSplice( vEvent->anEdge, e ) ) longjmp(tess->env,1); - SweepEvent( tess, vEvent ); /* recurse */ - return; - } - - /* vEvent coincides with e->Dst, which has already been processed. - * Splice in the additional right-going edges. - */ - assert( TOLERANCE_NONZERO ); - regUp = TopRightRegion( regUp ); - reg = RegionBelow( regUp ); - eTopRight = reg->eUp->Sym; - eTopLeft = eLast = eTopRight->Onext; - if( reg->fixUpperEdge ) { - /* Here e->Dst has only a single fixable edge going right. - * We can delete it since now we have some real right-going edges. - */ - assert( eTopLeft != eTopRight ); /* there are some left edges too */ - DeleteRegion( tess, reg ); - if ( !__gl_meshDelete( eTopRight ) ) longjmp(tess->env,1); - eTopRight = eTopLeft->Oprev; - } - if ( !__gl_meshSplice( vEvent->anEdge, eTopRight ) ) longjmp(tess->env,1); - if( ! EdgeGoesLeft( eTopLeft )) { - /* e->Dst had no left-going edges -- indicate this to AddRightEdges() */ - eTopLeft = NULL; - } - AddRightEdges( tess, regUp, eTopRight->Onext, eLast, eTopLeft, TRUE ); -} - - -static void ConnectLeftVertex( GLUtesselator *tess, GLUvertex *vEvent ) -/* - * Purpose: connect a "left" vertex (one where both edges go right) - * to the processed portion of the mesh. Let R be the active region - * containing vEvent, and let U and L be the upper and lower edge - * chains of R. There are two possibilities: - * - * - the normal case: split R into two regions, by connecting vEvent to - * the rightmost vertex of U or L lying to the left of the sweep line - * - * - the degenerate case: if vEvent is close enough to U or L, we - * merge vEvent into that edge chain. The subcases are: - * - merging with the rightmost vertex of U or L - * - merging with the active edge of U or L - * - merging with an already-processed portion of U or L - */ -{ - ActiveRegion *regUp, *regLo, *reg; - GLUhalfEdge *eUp, *eLo, *eNew; - ActiveRegion tmp; - - /* assert( vEvent->anEdge->Onext->Onext == vEvent->anEdge ); */ - - /* Get a pointer to the active region containing vEvent */ - tmp.eUp = vEvent->anEdge->Sym; - /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */ - regUp = (ActiveRegion *)dictKey( dictSearch( tess->dict, &tmp )); - regLo = RegionBelow( regUp ); - eUp = regUp->eUp; - eLo = regLo->eUp; - - /* Try merging with U or L first */ - if( EdgeSign( eUp->Dst, vEvent, eUp->Org ) == 0 ) { - ConnectLeftDegenerate( tess, regUp, vEvent ); - return; - } - - /* Connect vEvent to rightmost processed vertex of either chain. - * e->Dst is the vertex that we will connect to vEvent. - */ - reg = VertLeq( eLo->Dst, eUp->Dst ) ? regUp : regLo; - - if( regUp->inside || reg->fixUpperEdge) { - if( reg == regUp ) { - eNew = __gl_meshConnect( vEvent->anEdge->Sym, eUp->Lnext ); - if (eNew == NULL) longjmp(tess->env,1); - } else { - GLUhalfEdge *tempHalfEdge= __gl_meshConnect( eLo->Dnext, vEvent->anEdge); - if (tempHalfEdge == NULL) longjmp(tess->env,1); - - eNew = tempHalfEdge->Sym; - } - if( reg->fixUpperEdge ) { - if ( !FixUpperEdge( reg, eNew ) ) longjmp(tess->env,1); - } else { - ComputeWinding( tess, AddRegionBelow( tess, regUp, eNew )); - } - SweepEvent( tess, vEvent ); - } else { - /* The new vertex is in a region which does not belong to the polygon. - * We don''t need to connect this vertex to the rest of the mesh. - */ - AddRightEdges( tess, regUp, vEvent->anEdge, vEvent->anEdge, NULL, TRUE ); - } -} - - -static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ) -/* - * Does everything necessary when the sweep line crosses a vertex. - * Updates the mesh and the edge dictionary. - */ -{ - ActiveRegion *regUp, *reg; - GLUhalfEdge *e, *eTopLeft, *eBottomLeft; - - tess->event = vEvent; /* for access in EdgeLeq() */ - DebugEvent( tess ); - - /* Check if this vertex is the right endpoint of an edge that is - * already in the dictionary. In this case we don't need to waste - * time searching for the location to insert new edges. - */ - e = vEvent->anEdge; - while( e->activeRegion == NULL ) { - e = e->Onext; - if( e == vEvent->anEdge ) { - /* All edges go right -- not incident to any processed edges */ - ConnectLeftVertex( tess, vEvent ); - return; - } - } - - /* Processing consists of two phases: first we "finish" all the - * active regions where both the upper and lower edges terminate - * at vEvent (ie. vEvent is closing off these regions). - * We mark these faces "inside" or "outside" the polygon according - * to their winding number, and delete the edges from the dictionary. - * This takes care of all the left-going edges from vEvent. - */ - regUp = TopLeftRegion( e->activeRegion ); - if (regUp == NULL) longjmp(tess->env,1); - reg = RegionBelow( regUp ); - eTopLeft = reg->eUp; - eBottomLeft = FinishLeftRegions( tess, reg, NULL ); - - /* Next we process all the right-going edges from vEvent. This - * involves adding the edges to the dictionary, and creating the - * associated "active regions" which record information about the - * regions between adjacent dictionary edges. - */ - if( eBottomLeft->Onext == eTopLeft ) { - /* No right-going edges -- add a temporary "fixable" edge */ - ConnectRightVertex( tess, regUp, eBottomLeft ); - } else { - AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE ); - } -} - - -/* Make the sentinel coordinates big enough that they will never be - * merged with real input features. (Even with the largest possible - * input contour and the maximum tolerance of 1.0, no merging will be - * done with coordinates larger than 3 * GLU_TESS_MAX_COORD). - */ -#define SENTINEL_COORD (4 * GLU_TESS_MAX_COORD) - -static void AddSentinel( GLUtesselator *tess, GLdouble t ) -/* - * We add two sentinel edges above and below all other edges, - * to avoid special cases at the top and bottom. - */ -{ - GLUhalfEdge *e; - ActiveRegion *reg = (ActiveRegion *)memAlloc( sizeof( ActiveRegion )); - if (reg == NULL) longjmp(tess->env,1); - - e = __gl_meshMakeEdge( tess->mesh ); - if (e == NULL) longjmp(tess->env,1); - - e->Org->s = SENTINEL_COORD; - e->Org->t = t; - e->Dst->s = -SENTINEL_COORD; - e->Dst->t = t; - tess->event = e->Dst; /* initialize it */ - - reg->eUp = e; - reg->windingNumber = 0; - reg->inside = FALSE; - reg->fixUpperEdge = FALSE; - reg->sentinel = TRUE; - reg->dirty = FALSE; - reg->nodeUp = dictInsert( tess->dict, reg ); /* __gl_dictListInsertBefore */ - if (reg->nodeUp == NULL) longjmp(tess->env,1); -} - - -static void InitEdgeDict( GLUtesselator *tess ) -/* - * We maintain an ordering of edge intersections with the sweep line. - * This order is maintained in a dynamic dictionary. - */ -{ - /* __gl_dictListNewDict */ - tess->dict = dictNewDict( tess, (int (*)(void *, DictKey, DictKey)) EdgeLeq ); - if (tess->dict == NULL) longjmp(tess->env,1); - - AddSentinel( tess, -SENTINEL_COORD ); - AddSentinel( tess, SENTINEL_COORD ); -} - - -static void DoneEdgeDict( GLUtesselator *tess ) -{ - ActiveRegion *reg; -#ifndef NDEBUG - int fixedEdges = 0; -#endif - - /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ - while( (reg = (ActiveRegion *)dictKey( dictMin( tess->dict ))) != NULL ) { - /* - * At the end of all processing, the dictionary should contain - * only the two sentinel edges, plus at most one "fixable" edge - * created by ConnectRightVertex(). - */ - if( ! reg->sentinel ) { - assert( reg->fixUpperEdge ); - assert( ++fixedEdges == 1 ); - } - assert( reg->windingNumber == 0 ); - DeleteRegion( tess, reg ); -/* __gl_meshDelete( reg->eUp );*/ - } - dictDeleteDict( tess->dict ); /* __gl_dictListDeleteDict */ -} - - -static void RemoveDegenerateEdges( GLUtesselator *tess ) -/* - * Remove zero-length edges, and contours with fewer than 3 vertices. - */ -{ - GLUhalfEdge *e, *eNext, *eLnext; - GLUhalfEdge *eHead = &tess->mesh->eHead; - - /*LINTED*/ - for( e = eHead->next; e != eHead; e = eNext ) { - eNext = e->next; - eLnext = e->Lnext; - - if( VertEq( e->Org, e->Dst ) && e->Lnext->Lnext != e ) { - /* Zero-length edge, contour has at least 3 edges */ - - SpliceMergeVertices( tess, eLnext, e ); /* deletes e->Org */ - if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); /* e is a self-loop */ - e = eLnext; - eLnext = e->Lnext; - } - if( eLnext->Lnext == e ) { - /* Degenerate contour (one or two edges) */ - - if( eLnext != e ) { - if( eLnext == eNext || eLnext == eNext->Sym ) { eNext = eNext->next; } - if ( !__gl_meshDelete( eLnext ) ) longjmp(tess->env,1); - } - if( e == eNext || e == eNext->Sym ) { eNext = eNext->next; } - if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); - } - } -} - -static int InitPriorityQ( GLUtesselator *tess ) -/* - * Insert all vertices into the priority queue which determines the - * order in which vertices cross the sweep line. - */ -{ - PriorityQ *pq; - GLUvertex *v, *vHead; - - /* __gl_pqSortNewPriorityQ */ - pq = tess->pq = pqNewPriorityQ( (int (*)(PQkey, PQkey)) __gl_vertLeq ); - if (pq == NULL) return 0; - - vHead = &tess->mesh->vHead; - for( v = vHead->next; v != vHead; v = v->next ) { - v->pqHandle = pqInsert( pq, v ); /* __gl_pqSortInsert */ - if (v->pqHandle == LONG_MAX) break; - } - if (v != vHead || !pqInit( pq ) ) { /* __gl_pqSortInit */ - pqDeletePriorityQ(tess->pq); /* __gl_pqSortDeletePriorityQ */ - tess->pq = NULL; - return 0; - } - - return 1; -} - - -static void DonePriorityQ( GLUtesselator *tess ) -{ - pqDeletePriorityQ( tess->pq ); /* __gl_pqSortDeletePriorityQ */ -} - - -static int RemoveDegenerateFaces( GLUmesh *mesh ) -/* - * Delete any degenerate faces with only two edges. WalkDirtyRegions() - * will catch almost all of these, but it won't catch degenerate faces - * produced by splice operations on already-processed edges. - * The two places this can happen are in FinishLeftRegions(), when - * we splice in a "temporary" edge produced by ConnectRightVertex(), - * and in CheckForLeftSplice(), where we splice already-processed - * edges to ensure that our dictionary invariants are not violated - * by numerical errors. - * - * In both these cases it is *very* dangerous to delete the offending - * edge at the time, since one of the routines further up the stack - * will sometimes be keeping a pointer to that edge. - */ -{ - GLUface *f, *fNext; - GLUhalfEdge *e; - - /*LINTED*/ - for( f = mesh->fHead.next; f != &mesh->fHead; f = fNext ) { - fNext = f->next; - e = f->anEdge; - assert( e->Lnext != e ); - - if( e->Lnext->Lnext == e ) { - /* A face with only two edges */ - AddWinding( e->Onext, e ); - if ( !__gl_meshDelete( e ) ) return 0; - } - } - return 1; -} - -int __gl_computeInterior( GLUtesselator *tess ) -/* - * __gl_computeInterior( tess ) computes the planar arrangement specified - * by the given contours, and further subdivides this arrangement - * into regions. Each region is marked "inside" if it belongs - * to the polygon, according to the rule given by tess->windingRule. - * Each interior region is guaranteed be monotone. - */ -{ - GLUvertex *v, *vNext; - - tess->fatalError = FALSE; - - /* Each vertex defines an event for our sweep line. Start by inserting - * all the vertices in a priority queue. Events are processed in - * lexicographic order, ie. - * - * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y) - */ - RemoveDegenerateEdges( tess ); - if ( !InitPriorityQ( tess ) ) return 0; /* if error */ - InitEdgeDict( tess ); - - /* __gl_pqSortExtractMin */ - while( (v = (GLUvertex *)pqExtractMin( tess->pq )) != NULL ) { - for( ;; ) { - vNext = (GLUvertex *)pqMinimum( tess->pq ); /* __gl_pqSortMinimum */ - if( vNext == NULL || ! VertEq( vNext, v )) break; - - /* Merge together all vertices at exactly the same location. - * This is more efficient than processing them one at a time, - * simplifies the code (see ConnectLeftDegenerate), and is also - * important for correct handling of certain degenerate cases. - * For example, suppose there are two identical edges A and B - * that belong to different contours (so without this code they would - * be processed by separate sweep events). Suppose another edge C - * crosses A and B from above. When A is processed, we split it - * at its intersection point with C. However this also splits C, - * so when we insert B we may compute a slightly different - * intersection point. This might leave two edges with a small - * gap between them. This kind of error is especially obvious - * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY). - */ - vNext = (GLUvertex *)pqExtractMin( tess->pq ); /* __gl_pqSortExtractMin*/ - SpliceMergeVertices( tess, v->anEdge, vNext->anEdge ); - } - SweepEvent( tess, v ); - } - - /* Set tess->event for debugging purposes */ - /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ - tess->event = ((ActiveRegion *) dictKey( dictMin( tess->dict )))->eUp->Org; - DebugEvent( tess ); - DoneEdgeDict( tess ); - DonePriorityQ( tess ); - - if ( !RemoveDegenerateFaces( tess->mesh ) ) return 0; - __gl_meshCheckMesh( tess->mesh ); - - return 1; -} diff --git a/src/libs/mesa/glu/libtess/sweep.h b/src/libs/mesa/glu/libtess/sweep.h deleted file mode 100644 index feb68b0ffe..0000000000 --- a/src/libs/mesa/glu/libtess/sweep.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __sweep_h_ -#define __sweep_h_ - -#include "mesh.h" - -/* __gl_computeInterior( tess ) computes the planar arrangement specified - * by the given contours, and further subdivides this arrangement - * into regions. Each region is marked "inside" if it belongs - * to the polygon, according to the rule given by tess->windingRule. - * Each interior region is guaranteed be monotone. - */ -int __gl_computeInterior( GLUtesselator *tess ); - - -/* The following is here *only* for access by debugging routines */ - -#include "dict.h" - -/* For each pair of adjacent edges crossing the sweep line, there is - * an ActiveRegion to represent the region between them. The active - * regions are kept in sorted order in a dynamic dictionary. As the - * sweep line crosses each vertex, we update the affected regions. - */ - -struct ActiveRegion { - GLUhalfEdge *eUp; /* upper edge, directed right to left */ - DictNode *nodeUp; /* dictionary node corresponding to eUp */ - int windingNumber; /* used to determine which regions are - * inside the polygon */ - GLboolean inside; /* is this region inside the polygon? */ - GLboolean sentinel; /* marks fake edges at t = +/-infinity */ - GLboolean dirty; /* marks regions where the upper or lower - * edge has changed, but we haven't checked - * whether they intersect yet */ - GLboolean fixUpperEdge; /* marks temporary edges introduced when - * we process a "right vertex" (one without - * any edges leaving to the right) */ -}; - -#define RegionBelow(r) ((ActiveRegion *) dictKey(dictPred((r)->nodeUp))) -#define RegionAbove(r) ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp))) - -#endif diff --git a/src/libs/mesa/glu/libtess/tess.c b/src/libs/mesa/glu/libtess/tess.c deleted file mode 100644 index 029a02c3ae..0000000000 --- a/src/libs/mesa/glu/libtess/tess.c +++ /dev/null @@ -1,628 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include -#include -#include "memalloc.h" -#include "tess.h" -#include "mesh.h" -#include "normal.h" -#include "sweep.h" -#include "tessmono.h" -#include "render.h" - -#define GLU_TESS_DEFAULT_TOLERANCE 0.0 -#define GLU_TESS_MESH 100112 /* void (*)(GLUmesh *mesh) */ - -#define TRUE 1 -#define FALSE 0 - -/*ARGSUSED*/ static void GLAPIENTRY noBegin( GLenum type ) {} -/*ARGSUSED*/ static void GLAPIENTRY noEdgeFlag( GLboolean boundaryEdge ) {} -/*ARGSUSED*/ static void GLAPIENTRY noVertex( void *data ) {} -/*ARGSUSED*/ static void GLAPIENTRY noEnd( void ) {} -/*ARGSUSED*/ static void GLAPIENTRY noError( GLenum errnum ) {} -/*ARGSUSED*/ static void GLAPIENTRY noCombine( GLdouble coords[3], void *data[4], - GLfloat weight[4], void **dataOut ) {} -/*ARGSUSED*/ static void GLAPIENTRY noMesh( GLUmesh *mesh ) {} - - -/*ARGSUSED*/ void GLAPIENTRY __gl_noBeginData( GLenum type, - void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, - void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noVertexData( void *data, - void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noEndData( void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noErrorData( GLenum errnum, - void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], - void *data[4], - GLfloat weight[4], - void **outData, - void *polygonData ) {} - -/* Half-edges are allocated in pairs (see mesh.c) */ -typedef struct { GLUhalfEdge e, eSym; } EdgePair; - -#undef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \ - MAX(sizeof(GLUvertex),sizeof(GLUface)))) - - -GLUtesselator * GLAPIENTRY -gluNewTess( void ) -{ - GLUtesselator *tess; - - /* Only initialize fields which can be changed by the api. Other fields - * are initialized where they are used. - */ - - if (memInit( MAX_FAST_ALLOC ) == 0) { - return 0; /* out of memory */ - } - tess = (GLUtesselator *)memAlloc( sizeof( GLUtesselator )); - if (tess == NULL) { - return 0; /* out of memory */ - } - - tess->state = T_DORMANT; - - tess->normal[0] = 0; - tess->normal[1] = 0; - tess->normal[2] = 0; - - tess->relTolerance = GLU_TESS_DEFAULT_TOLERANCE; - tess->windingRule = GLU_TESS_WINDING_ODD; - tess->flagBoundary = FALSE; - tess->boundaryOnly = FALSE; - - tess->callBegin = &noBegin; - tess->callEdgeFlag = &noEdgeFlag; - tess->callVertex = &noVertex; - tess->callEnd = &noEnd; - - tess->callError = &noError; - tess->callCombine = &noCombine; - tess->callMesh = &noMesh; - - tess->callBeginData= &__gl_noBeginData; - tess->callEdgeFlagData= &__gl_noEdgeFlagData; - tess->callVertexData= &__gl_noVertexData; - tess->callEndData= &__gl_noEndData; - tess->callErrorData= &__gl_noErrorData; - tess->callCombineData= &__gl_noCombineData; - - tess->polygonData= NULL; - - return tess; -} - -static void MakeDormant( GLUtesselator *tess ) -{ - /* Return the tessellator to its original dormant state. */ - - if( tess->mesh != NULL ) { - __gl_meshDeleteMesh( tess->mesh ); - } - tess->state = T_DORMANT; - tess->lastEdge = NULL; - tess->mesh = NULL; -} - -#define RequireState( tess, s ) if( tess->state != s ) GotoState(tess,s) - -static void GotoState( GLUtesselator *tess, enum TessState newState ) -{ - while( tess->state != newState ) { - /* We change the current state one level at a time, to get to - * the desired state. - */ - if( tess->state < newState ) { - switch( tess->state ) { - case T_DORMANT: - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_POLYGON ); - gluTessBeginPolygon( tess, NULL ); - break; - case T_IN_POLYGON: - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_CONTOUR ); - gluTessBeginContour( tess ); - break; - default: - ; - } - } else { - switch( tess->state ) { - case T_IN_CONTOUR: - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_CONTOUR ); - gluTessEndContour( tess ); - break; - case T_IN_POLYGON: - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_POLYGON ); - /* gluTessEndPolygon( tess ) is too much work! */ - MakeDormant( tess ); - break; - default: - ; - } - } - } -} - - -void GLAPIENTRY -gluDeleteTess( GLUtesselator *tess ) -{ - RequireState( tess, T_DORMANT ); - memFree( tess ); -} - - -void GLAPIENTRY -gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value ) -{ - GLenum windingRule; - - switch( which ) { - case GLU_TESS_TOLERANCE: - if( value < 0.0 || value > 1.0 ) break; - tess->relTolerance = value; - return; - - case GLU_TESS_WINDING_RULE: - windingRule = (GLenum) value; - if( windingRule != value ) break; /* not an integer */ - - switch( windingRule ) { - case GLU_TESS_WINDING_ODD: - case GLU_TESS_WINDING_NONZERO: - case GLU_TESS_WINDING_POSITIVE: - case GLU_TESS_WINDING_NEGATIVE: - case GLU_TESS_WINDING_ABS_GEQ_TWO: - tess->windingRule = windingRule; - return; - default: - break; - } - - case GLU_TESS_BOUNDARY_ONLY: - tess->boundaryOnly = (value != 0); - return; - - default: - CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); - return; - } - CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_VALUE ); -} - -/* Returns tessellator property */ -void GLAPIENTRY -gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ) -{ - switch (which) { - case GLU_TESS_TOLERANCE: - /* tolerance should be in range [0..1] */ - assert(0.0 <= tess->relTolerance && tess->relTolerance <= 1.0); - *value= tess->relTolerance; - break; - case GLU_TESS_WINDING_RULE: - assert(tess->windingRule == GLU_TESS_WINDING_ODD || - tess->windingRule == GLU_TESS_WINDING_NONZERO || - tess->windingRule == GLU_TESS_WINDING_POSITIVE || - tess->windingRule == GLU_TESS_WINDING_NEGATIVE || - tess->windingRule == GLU_TESS_WINDING_ABS_GEQ_TWO); - *value= tess->windingRule; - break; - case GLU_TESS_BOUNDARY_ONLY: - assert(tess->boundaryOnly == TRUE || tess->boundaryOnly == FALSE); - *value= tess->boundaryOnly; - break; - default: - *value= 0.0; - CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); - break; - } -} /* gluGetTessProperty() */ - -void GLAPIENTRY -gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z ) -{ - tess->normal[0] = x; - tess->normal[1] = y; - tess->normal[2] = z; -} - -void GLAPIENTRY -gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) -{ - switch( which ) { - case GLU_TESS_BEGIN: - tess->callBegin = (fn == NULL) ? &noBegin : (void (GLAPIENTRY *)(GLenum)) fn; - return; - case GLU_TESS_BEGIN_DATA: - tess->callBeginData = (fn == NULL) ? - &__gl_noBeginData : (void (GLAPIENTRY *)(GLenum, void *)) fn; - return; - case GLU_TESS_EDGE_FLAG: - tess->callEdgeFlag = (fn == NULL) ? &noEdgeFlag : - (void (GLAPIENTRY *)(GLboolean)) fn; - /* If the client wants boundary edges to be flagged, - * we render everything as separate triangles (no strips or fans). - */ - tess->flagBoundary = (fn != NULL); - return; - case GLU_TESS_EDGE_FLAG_DATA: - tess->callEdgeFlagData= (fn == NULL) ? - &__gl_noEdgeFlagData : (void (GLAPIENTRY *)(GLboolean, void *)) fn; - /* If the client wants boundary edges to be flagged, - * we render everything as separate triangles (no strips or fans). - */ - tess->flagBoundary = (fn != NULL); - return; - case GLU_TESS_VERTEX: - tess->callVertex = (fn == NULL) ? &noVertex : - (void (GLAPIENTRY *)(void *)) fn; - return; - case GLU_TESS_VERTEX_DATA: - tess->callVertexData = (fn == NULL) ? - &__gl_noVertexData : (void (GLAPIENTRY *)(void *, void *)) fn; - return; - case GLU_TESS_END: - tess->callEnd = (fn == NULL) ? &noEnd : (void (GLAPIENTRY *)(void)) fn; - return; - case GLU_TESS_END_DATA: - tess->callEndData = (fn == NULL) ? &__gl_noEndData : - (void (GLAPIENTRY *)(void *)) fn; - return; - case GLU_TESS_ERROR: - tess->callError = (fn == NULL) ? &noError : (void (GLAPIENTRY *)(GLenum)) fn; - return; - case GLU_TESS_ERROR_DATA: - tess->callErrorData = (fn == NULL) ? - &__gl_noErrorData : (void (GLAPIENTRY *)(GLenum, void *)) fn; - return; - case GLU_TESS_COMBINE: - tess->callCombine = (fn == NULL) ? &noCombine : - (void (GLAPIENTRY *)(GLdouble [3],void *[4], GLfloat [4], void ** )) fn; - return; - case GLU_TESS_COMBINE_DATA: - tess->callCombineData = (fn == NULL) ? &__gl_noCombineData : - (void (GLAPIENTRY *)(GLdouble [3], - void *[4], - GLfloat [4], - void **, - void *)) fn; - return; - case GLU_TESS_MESH: - tess->callMesh = (fn == NULL) ? &noMesh : (void (GLAPIENTRY *)(GLUmesh *)) fn; - return; - default: - CALL_ERROR_OR_ERROR_DATA( GLU_INVALID_ENUM ); - return; - } -} - -static int AddVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) -{ - GLUhalfEdge *e; - - e = tess->lastEdge; - if( e == NULL ) { - /* Make a self-loop (one vertex, one edge). */ - - e = __gl_meshMakeEdge( tess->mesh ); - if (e == NULL) return 0; - if ( !__gl_meshSplice( e, e->Sym ) ) return 0; - } else { - /* Create a new vertex and edge which immediately follow e - * in the ordering around the left face. - */ - if (__gl_meshSplitEdge( e ) == NULL) return 0; - e = e->Lnext; - } - - /* The new vertex is now e->Org. */ - e->Org->data = data; - e->Org->coords[0] = coords[0]; - e->Org->coords[1] = coords[1]; - e->Org->coords[2] = coords[2]; - - /* The winding of an edge says how the winding number changes as we - * cross from the edge''s right face to its left face. We add the - * vertices in such an order that a CCW contour will add +1 to - * the winding number of the region inside the contour. - */ - e->winding = 1; - e->Sym->winding = -1; - - tess->lastEdge = e; - - return 1; -} - - -static void CacheVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) -{ - CachedVertex *v = &tess->cache[tess->cacheCount]; - - v->data = data; - v->coords[0] = coords[0]; - v->coords[1] = coords[1]; - v->coords[2] = coords[2]; - ++tess->cacheCount; -} - - -static int EmptyCache( GLUtesselator *tess ) -{ - CachedVertex *v = tess->cache; - CachedVertex *vLast; - - tess->mesh = __gl_meshNewMesh(); - if (tess->mesh == NULL) return 0; - - for( vLast = v + tess->cacheCount; v < vLast; ++v ) { - if ( !AddVertex( tess, v->coords, v->data ) ) return 0; - } - tess->cacheCount = 0; - tess->emptyCache = FALSE; - - return 1; -} - - -void GLAPIENTRY -gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) -{ - int i, tooLarge = FALSE; - GLdouble x, clamped[3]; - - RequireState( tess, T_IN_CONTOUR ); - - if( tess->emptyCache ) { - if ( !EmptyCache( tess ) ) { - CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); - return; - } - tess->lastEdge = NULL; - } - for( i = 0; i < 3; ++i ) { - x = coords[i]; - if( x < - GLU_TESS_MAX_COORD ) { - x = - GLU_TESS_MAX_COORD; - tooLarge = TRUE; - } - if( x > GLU_TESS_MAX_COORD ) { - x = GLU_TESS_MAX_COORD; - tooLarge = TRUE; - } - clamped[i] = x; - } - if( tooLarge ) { - CALL_ERROR_OR_ERROR_DATA( GLU_TESS_COORD_TOO_LARGE ); - } - - if( tess->mesh == NULL ) { - if( tess->cacheCount < TESS_MAX_CACHE ) { - CacheVertex( tess, clamped, data ); - return; - } - if ( !EmptyCache( tess ) ) { - CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); - return; - } - } - if ( !AddVertex( tess, clamped, data ) ) { - CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); - } -} - - -void GLAPIENTRY -gluTessBeginPolygon( GLUtesselator *tess, void *data ) -{ - RequireState( tess, T_DORMANT ); - - tess->state = T_IN_POLYGON; - tess->cacheCount = 0; - tess->emptyCache = FALSE; - tess->mesh = NULL; - - tess->polygonData= data; -} - - -void GLAPIENTRY -gluTessBeginContour( GLUtesselator *tess ) -{ - RequireState( tess, T_IN_POLYGON ); - - tess->state = T_IN_CONTOUR; - tess->lastEdge = NULL; - if( tess->cacheCount > 0 ) { - /* Just set a flag so we don't get confused by empty contours - * -- these can be generated accidentally with the obsolete - * NextContour() interface. - */ - tess->emptyCache = TRUE; - } -} - - -void GLAPIENTRY -gluTessEndContour( GLUtesselator *tess ) -{ - RequireState( tess, T_IN_CONTOUR ); - tess->state = T_IN_POLYGON; -} - -void GLAPIENTRY -gluTessEndPolygon( GLUtesselator *tess ) -{ - GLUmesh *mesh; - - if (setjmp(tess->env) != 0) { - /* come back here if out of memory */ - CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); - return; - } - - RequireState( tess, T_IN_POLYGON ); - tess->state = T_DORMANT; - - if( tess->mesh == NULL ) { - if( ! tess->flagBoundary && tess->callMesh == &noMesh ) { - - /* Try some special code to make the easy cases go quickly - * (eg. convex polygons). This code does NOT handle multiple contours, - * intersections, edge flags, and of course it does not generate - * an explicit mesh either. - */ - if( __gl_renderCache( tess )) { - tess->polygonData= NULL; - return; - } - } - if ( !EmptyCache( tess ) ) longjmp(tess->env,1); /* could've used a label*/ - } - - /* Determine the polygon normal and project vertices onto the plane - * of the polygon. - */ - __gl_projectPolygon( tess ); - - /* __gl_computeInterior( tess ) computes the planar arrangement specified - * by the given contours, and further subdivides this arrangement - * into regions. Each region is marked "inside" if it belongs - * to the polygon, according to the rule given by tess->windingRule. - * Each interior region is guaranteed be monotone. - */ - if ( !__gl_computeInterior( tess ) ) { - longjmp(tess->env,1); /* could've used a label */ - } - - mesh = tess->mesh; - if( ! tess->fatalError ) { - int rc = 1; - - /* If the user wants only the boundary contours, we throw away all edges - * except those which separate the interior from the exterior. - * Otherwise we tessellate all the regions marked "inside". - */ - if( tess->boundaryOnly ) { - rc = __gl_meshSetWindingNumber( mesh, 1, TRUE ); - } else { - rc = __gl_meshTessellateInterior( mesh ); - } - if (rc == 0) longjmp(tess->env,1); /* could've used a label */ - - __gl_meshCheckMesh( mesh ); - - if( tess->callBegin != &noBegin || tess->callEnd != &noEnd - || tess->callVertex != &noVertex || tess->callEdgeFlag != &noEdgeFlag - || tess->callBeginData != &__gl_noBeginData - || tess->callEndData != &__gl_noEndData - || tess->callVertexData != &__gl_noVertexData - || tess->callEdgeFlagData != &__gl_noEdgeFlagData ) - { - if( tess->boundaryOnly ) { - __gl_renderBoundary( tess, mesh ); /* output boundary contours */ - } else { - __gl_renderMesh( tess, mesh ); /* output strips and fans */ - } - } - if( tess->callMesh != &noMesh ) { - - /* Throw away the exterior faces, so that all faces are interior. - * This way the user doesn't have to check the "inside" flag, - * and we don't need to even reveal its existence. It also leaves - * the freedom for an implementation to not generate the exterior - * faces in the first place. - */ - __gl_meshDiscardExterior( mesh ); - (*tess->callMesh)( mesh ); /* user wants the mesh itself */ - tess->mesh = NULL; - tess->polygonData= NULL; - return; - } - } - __gl_meshDeleteMesh( mesh ); - tess->polygonData= NULL; - tess->mesh = NULL; -} - - -/*XXXblythe unused function*/ -#if 0 -void GLAPIENTRY -gluDeleteMesh( GLUmesh *mesh ) -{ - __gl_meshDeleteMesh( mesh ); -} -#endif - - - -/*******************************************************/ - -/* Obsolete calls -- for backward compatibility */ - -void GLAPIENTRY -gluBeginPolygon( GLUtesselator *tess ) -{ - gluTessBeginPolygon( tess, NULL ); - gluTessBeginContour( tess ); -} - - -/*ARGSUSED*/ -void GLAPIENTRY -gluNextContour( GLUtesselator *tess, GLenum type ) -{ - gluTessEndContour( tess ); - gluTessBeginContour( tess ); -} - - -void GLAPIENTRY -gluEndPolygon( GLUtesselator *tess ) -{ - gluTessEndContour( tess ); - gluTessEndPolygon( tess ); -} diff --git a/src/libs/mesa/glu/libtess/tess.h b/src/libs/mesa/glu/libtess/tess.h deleted file mode 100644 index 1624960881..0000000000 --- a/src/libs/mesa/glu/libtess/tess.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __tess_h_ -#define __tess_h_ - -#include -#include -#include "mesh.h" -#include "dict.h" -#include "priorityq.h" - -/* The begin/end calls must be properly nested. We keep track of - * the current state to enforce the ordering. - */ -enum TessState { T_DORMANT, T_IN_POLYGON, T_IN_CONTOUR }; - -/* We cache vertex data for single-contour polygons so that we can - * try a quick-and-dirty decomposition first. - */ -#define TESS_MAX_CACHE 100 - -typedef struct CachedVertex { - GLdouble coords[3]; - void *data; -} CachedVertex; - -struct GLUtesselator { - - /*** state needed for collecting the input data ***/ - - enum TessState state; /* what begin/end calls have we seen? */ - - GLUhalfEdge *lastEdge; /* lastEdge->Org is the most recent vertex */ - GLUmesh *mesh; /* stores the input contours, and eventually - the tessellation itself */ - - void (GLAPIENTRY *callError)( GLenum errnum ); - - /*** state needed for projecting onto the sweep plane ***/ - - GLdouble normal[3]; /* user-specified normal (if provided) */ - GLdouble sUnit[3]; /* unit vector in s-direction (debugging) */ - GLdouble tUnit[3]; /* unit vector in t-direction (debugging) */ - - /*** state needed for the line sweep ***/ - - GLdouble relTolerance; /* tolerance for merging features */ - GLenum windingRule; /* rule for determining polygon interior */ - GLboolean fatalError; /* fatal error: needed combine callback */ - - Dict *dict; /* edge dictionary for sweep line */ - PriorityQ *pq; /* priority queue of vertex events */ - GLUvertex *event; /* current sweep event being processed */ - - void (GLAPIENTRY *callCombine)( GLdouble coords[3], void *data[4], - GLfloat weight[4], void **outData ); - - /*** state needed for rendering callbacks (see render.c) ***/ - - GLboolean flagBoundary; /* mark boundary edges (use EdgeFlag) */ - GLboolean boundaryOnly; /* Extract contours, not triangles */ - GLUface *lonelyTriList; - /* list of triangles which could not be rendered as strips or fans */ - - void (GLAPIENTRY *callBegin)( GLenum type ); - void (GLAPIENTRY *callEdgeFlag)( GLboolean boundaryEdge ); - void (GLAPIENTRY *callVertex)( void *data ); - void (GLAPIENTRY *callEnd)( void ); - void (GLAPIENTRY *callMesh)( GLUmesh *mesh ); - - - /*** state needed to cache single-contour polygons for renderCache() */ - - GLboolean emptyCache; /* empty cache on next vertex() call */ - int cacheCount; /* number of cached vertices */ - CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */ - - /*** rendering callbacks that also pass polygon data ***/ - void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData ); - void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, - void *polygonData ); - void (GLAPIENTRY *callVertexData)( void *data, void *polygonData ); - void (GLAPIENTRY *callEndData)( void *polygonData ); - void (GLAPIENTRY *callErrorData)( GLenum errnum, void *polygonData ); - void (GLAPIENTRY *callCombineData)( GLdouble coords[3], void *data[4], - GLfloat weight[4], void **outData, - void *polygonData ); - - jmp_buf env; /* place to jump to when memAllocs fail */ - - void *polygonData; /* client data for current polygon */ -}; - -void GLAPIENTRY __gl_noBeginData( GLenum type, void *polygonData ); -void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, void *polygonData ); -void GLAPIENTRY __gl_noVertexData( void *data, void *polygonData ); -void GLAPIENTRY __gl_noEndData( void *polygonData ); -void GLAPIENTRY __gl_noErrorData( GLenum errnum, void *polygonData ); -void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], void *data[4], - GLfloat weight[4], void **outData, - void *polygonData ); - -#define CALL_BEGIN_OR_BEGIN_DATA(a) \ - if (tess->callBeginData != &__gl_noBeginData) \ - (*tess->callBeginData)((a),tess->polygonData); \ - else (*tess->callBegin)((a)); - -#define CALL_VERTEX_OR_VERTEX_DATA(a) \ - if (tess->callVertexData != &__gl_noVertexData) \ - (*tess->callVertexData)((a),tess->polygonData); \ - else (*tess->callVertex)((a)); - -#define CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA(a) \ - if (tess->callEdgeFlagData != &__gl_noEdgeFlagData) \ - (*tess->callEdgeFlagData)((a),tess->polygonData); \ - else (*tess->callEdgeFlag)((a)); - -#define CALL_END_OR_END_DATA() \ - if (tess->callEndData != &__gl_noEndData) \ - (*tess->callEndData)(tess->polygonData); \ - else (*tess->callEnd)(); - -#define CALL_COMBINE_OR_COMBINE_DATA(a,b,c,d) \ - if (tess->callCombineData != &__gl_noCombineData) \ - (*tess->callCombineData)((a),(b),(c),(d),tess->polygonData); \ - else (*tess->callCombine)((a),(b),(c),(d)); - -#define CALL_ERROR_OR_ERROR_DATA(a) \ - if (tess->callErrorData != &__gl_noErrorData) \ - (*tess->callErrorData)((a),tess->polygonData); \ - else (*tess->callError)((a)); - -#endif diff --git a/src/libs/mesa/glu/libtess/tessmono.c b/src/libs/mesa/glu/libtess/tessmono.c deleted file mode 100644 index 4d08440059..0000000000 --- a/src/libs/mesa/glu/libtess/tessmono.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#include "gluos.h" -#include -#include "geom.h" -#include "mesh.h" -#include "tessmono.h" -#include - -#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \ - eDst->Sym->winding += eSrc->Sym->winding) - -/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region - * (what else would it do??) The region must consist of a single - * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this - * case means that any vertical line intersects the interior of the - * region in a single interval. - * - * Tessellation consists of adding interior edges (actually pairs of - * half-edges), to split the region into non-overlapping triangles. - * - * The basic idea is explained in Preparata and Shamos (which I don''t - * have handy right now), although their implementation is more - * complicated than this one. The are two edge chains, an upper chain - * and a lower chain. We process all vertices from both chains in order, - * from right to left. - * - * The algorithm ensures that the following invariant holds after each - * vertex is processed: the untessellated region consists of two - * chains, where one chain (say the upper) is a single edge, and - * the other chain is concave. The left vertex of the single edge - * is always to the left of all vertices in the concave chain. - * - * Each step consists of adding the rightmost unprocessed vertex to one - * of the two chains, and forming a fan of triangles from the rightmost - * of two chain endpoints. Determining whether we can add each triangle - * to the fan is a simple orientation test. By making the fan as large - * as possible, we restore the invariant (check it yourself). - */ -int __gl_meshTessellateMonoRegion( GLUface *face ) -{ - GLUhalfEdge *up, *lo; - - /* All edges are oriented CCW around the boundary of the region. - * First, find the half-edge whose origin vertex is rightmost. - * Since the sweep goes from left to right, face->anEdge should - * be close to the edge we want. - */ - up = face->anEdge; - assert( up->Lnext != up && up->Lnext->Lnext != up ); - - for( ; VertLeq( up->Dst, up->Org ); up = up->Lprev ) - ; - for( ; VertLeq( up->Org, up->Dst ); up = up->Lnext ) - ; - lo = up->Lprev; - - while( up->Lnext != lo ) { - if( VertLeq( up->Dst, lo->Org )) { - /* up->Dst is on the left. It is safe to form triangles from lo->Org. - * The EdgeGoesLeft test guarantees progress even when some triangles - * are CW, given that the upper and lower chains are truly monotone. - */ - while( lo->Lnext != up && (EdgeGoesLeft( lo->Lnext ) - || EdgeSign( lo->Org, lo->Dst, lo->Lnext->Dst ) <= 0 )) { - GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo ); - if (tempHalfEdge == NULL) return 0; - lo = tempHalfEdge->Sym; - } - lo = lo->Lprev; - } else { - /* lo->Org is on the left. We can make CCW triangles from up->Dst. */ - while( lo->Lnext != up && (EdgeGoesRight( up->Lprev ) - || EdgeSign( up->Dst, up->Org, up->Lprev->Org ) >= 0 )) { - GLUhalfEdge *tempHalfEdge= __gl_meshConnect( up, up->Lprev ); - if (tempHalfEdge == NULL) return 0; - up = tempHalfEdge->Sym; - } - up = up->Lnext; - } - } - - /* Now lo->Org == up->Dst == the leftmost vertex. The remaining region - * can be tessellated in a fan from this leftmost vertex. - */ - assert( lo->Lnext != up ); - while( lo->Lnext->Lnext != up ) { - GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo ); - if (tempHalfEdge == NULL) return 0; - lo = tempHalfEdge->Sym; - } - - return 1; -} - - -/* __gl_meshTessellateInterior( mesh ) tessellates each region of - * the mesh which is marked "inside" the polygon. Each such region - * must be monotone. - */ -int __gl_meshTessellateInterior( GLUmesh *mesh ) -{ - GLUface *f, *next; - - /*LINTED*/ - for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) { - /* Make sure we don''t try to tessellate the new triangles. */ - next = f->next; - if( f->inside ) { - if ( !__gl_meshTessellateMonoRegion( f ) ) return 0; - } - } - - return 1; -} - - -/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces - * which are not marked "inside" the polygon. Since further mesh operations - * on NULL faces are not allowed, the main purpose is to clean up the - * mesh so that exterior loops are not represented in the data structure. - */ -void __gl_meshDiscardExterior( GLUmesh *mesh ) -{ - GLUface *f, *next; - - /*LINTED*/ - for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) { - /* Since f will be destroyed, save its next pointer. */ - next = f->next; - if( ! f->inside ) { - __gl_meshZapFace( f ); - } - } -} - -#define MARKED_FOR_DELETION 0x7fffffff - -/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the - * winding numbers on all edges so that regions marked "inside" the - * polygon have a winding number of "value", and regions outside - * have a winding number of 0. - * - * If keepOnlyBoundary is TRUE, it also deletes all edges which do not - * separate an interior region from an exterior one. - */ -int __gl_meshSetWindingNumber( GLUmesh *mesh, int value, - GLboolean keepOnlyBoundary ) -{ - GLUhalfEdge *e, *eNext; - - for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) { - eNext = e->next; - if( e->Rface->inside != e->Lface->inside ) { - - /* This is a boundary edge (one side is interior, one is exterior). */ - e->winding = (e->Lface->inside) ? value : -value; - } else { - - /* Both regions are interior, or both are exterior. */ - if( ! keepOnlyBoundary ) { - e->winding = 0; - } else { - if ( !__gl_meshDelete( e ) ) return 0; - } - } - } - return 1; -} diff --git a/src/libs/mesa/glu/libtess/tessmono.h b/src/libs/mesa/glu/libtess/tessmono.h deleted file mode 100644 index 8ee1b2fe34..0000000000 --- a/src/libs/mesa/glu/libtess/tessmono.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ -/* -** Author: Eric Veach, July 1994. -** -*/ - -#ifndef __tessmono_h_ -#define __tessmono_h_ - -/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region - * (what else would it do??) The region must consist of a single - * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this - * case means that any vertical line intersects the interior of the - * region in a single interval. - * - * Tessellation consists of adding interior edges (actually pairs of - * half-edges), to split the region into non-overlapping triangles. - * - * __gl_meshTessellateInterior( mesh ) tessellates each region of - * the mesh which is marked "inside" the polygon. Each such region - * must be monotone. - * - * __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces - * which are not marked "inside" the polygon. Since further mesh operations - * on NULL faces are not allowed, the main purpose is to clean up the - * mesh so that exterior loops are not represented in the data structure. - * - * __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the - * winding numbers on all edges so that regions marked "inside" the - * polygon have a winding number of "value", and regions outside - * have a winding number of 0. - * - * If keepOnlyBoundary is TRUE, it also deletes all edges which do not - * separate an interior region from an exterior one. - */ - -int __gl_meshTessellateMonoRegion( GLUface *face ); -int __gl_meshTessellateInterior( GLUmesh *mesh ); -void __gl_meshDiscardExterior( GLUmesh *mesh ); -int __gl_meshSetWindingNumber( GLUmesh *mesh, int value, - GLboolean keepOnlyBoundary ); - -#endif diff --git a/src/libs/mesa/glu/libutil/error.c b/src/libs/mesa/glu/libutil/error.c deleted file mode 100644 index e734818ed6..0000000000 --- a/src/libs/mesa/glu/libutil/error.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "gluos.h" -#include "gluint.h" -#include -#include -#include - - -struct token_string -{ - GLuint Token; - const char *String; -}; - -static const struct token_string Errors[] = { - { GL_NO_ERROR, "no error" }, - { GL_INVALID_ENUM, "invalid enumerant" }, - { GL_INVALID_VALUE, "invalid value" }, - { GL_INVALID_OPERATION, "invalid operation" }, - { GL_STACK_OVERFLOW, "stack overflow" }, - { GL_STACK_UNDERFLOW, "stack underflow" }, - { GL_OUT_OF_MEMORY, "out of memory" }, - { GL_TABLE_TOO_LARGE, "table too large" }, -#ifdef GL_EXT_framebuffer_object - { GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "invalid framebuffer operation" }, -#endif - /* GLU */ - { GLU_INVALID_ENUM, "invalid enumerant" }, - { GLU_INVALID_VALUE, "invalid value" }, - { GLU_OUT_OF_MEMORY, "out of memory" }, - { GLU_INCOMPATIBLE_GL_VERSION, "incompatible gl version" }, - { GLU_INVALID_OPERATION, "invalid operation" }, - { ~0, NULL } /* end of list indicator */ -}; - - - -const GLubyte* GLAPIENTRY -gluErrorString(GLenum errorCode) -{ - int i; - for (i = 0; Errors[i].String; i++) { - if (Errors[i].Token == errorCode) - return (const GLubyte *) Errors[i].String; - } - if ((errorCode >= GLU_NURBS_ERROR1) && (errorCode <= GLU_NURBS_ERROR37)) { - return (const GLubyte *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1)); - } - if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR6)) { - return (const GLubyte *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1)); - } - return (const GLubyte *) 0; -} - diff --git a/src/libs/mesa/glu/libutil/glue.c b/src/libs/mesa/glu/libutil/glue.c deleted file mode 100644 index cd65d65ad2..0000000000 --- a/src/libs/mesa/glu/libutil/glue.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include -#include "gluint.h" - -static unsigned char *__gluNurbsErrors[] = { - (unsigned char*) " ", - (unsigned char*) "spline order un-supported", - (unsigned char*) "too few knots", - (unsigned char*) "valid knot range is empty", - (unsigned char*) "decreasing knot sequence knot", - (unsigned char*) "knot multiplicity greater than order of spline", - (unsigned char*) "gluEndCurve() must follow gluBeginCurve()", - (unsigned char*) "gluBeginCurve() must precede gluEndCurve()", - (unsigned char*) "missing or extra geometric data", - (unsigned char*) "can't draw piecewise linear trimming curves", - (unsigned char*) "missing or extra domain data", - (unsigned char*) "missing or extra domain data", - (unsigned char*) "gluEndTrim() must precede gluEndSurface()", - (unsigned char*) "gluBeginSurface() must precede gluEndSurface()", - (unsigned char*) "curve of improper type passed as trim curve", - (unsigned char*) "gluBeginSurface() must precede gluBeginTrim()", - (unsigned char*) "gluEndTrim() must follow gluBeginTrim()", - (unsigned char*) "gluBeginTrim() must precede gluEndTrim()", - (unsigned char*) "invalid or missing trim curve", - (unsigned char*) "gluBeginTrim() must precede gluPwlCurve()", - (unsigned char*) "piecewise linear trimming curve referenced twice", - (unsigned char*) "piecewise linear trimming curve and nurbs curve mixed", - (unsigned char*) "improper usage of trim data type", - (unsigned char*) "nurbs curve referenced twice", - (unsigned char*) "nurbs curve and piecewise linear trimming curve mixed", - (unsigned char*) "nurbs surface referenced twice", - (unsigned char*) "invalid property", - (unsigned char*) "gluEndSurface() must follow gluBeginSurface()", - (unsigned char*) "intersecting or misoriented trim curves", - (unsigned char*) "intersecting trim curves", - (unsigned char*) "UNUSED", - (unsigned char*) "unconnected trim curves", - (unsigned char*) "unknown knot error", - (unsigned char*) "negative vertex count encountered", - (unsigned char*) "negative byte-stride encounteed", - (unsigned char*) "unknown type descriptor", - (unsigned char*) "null control point reference", - (unsigned char*) "duplicate point on piecewise linear trimming curve", -}; - -const unsigned char *__gluNURBSErrorString( int errnum ) -{ - return __gluNurbsErrors[errnum]; -} - -static unsigned char *__gluTessErrors[] = { - (unsigned char*) " ", - (unsigned char*) "gluTessBeginPolygon() must precede a gluTessEndPolygon()", - (unsigned char*) "gluTessBeginContour() must precede a gluTessEndContour()", - (unsigned char*) "gluTessEndPolygon() must follow a gluTessBeginPolygon()", - (unsigned char*) "gluTessEndContour() must follow a gluTessBeginContour()", - (unsigned char*) "a coordinate is too large", - (unsigned char*) "need combine callback", -}; - -const unsigned char *__gluTessErrorString( int errnum ) -{ - return __gluTessErrors[errnum]; -} /* __glTessErrorString() */ diff --git a/src/libs/mesa/glu/libutil/gluint.h b/src/libs/mesa/glu/libutil/gluint.h deleted file mode 100644 index fd513caa69..0000000000 --- a/src/libs/mesa/glu/libutil/gluint.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#ifndef __gluint_h__ -#define __gluint_h__ - -extern const unsigned char *__gluNURBSErrorString( int errnum ); - -extern const unsigned char *__gluTessErrorString( int errnum ); - -#ifdef _EXTENSIONS_ -#define COS cosf -#define SIN sinf -#define SQRT sqrtf -#else -#define COS cos -#define SIN sin -#define SQRT sqrt -#endif - -#endif /* __gluint_h__ */ diff --git a/src/libs/mesa/glu/libutil/mipmap.c b/src/libs/mesa/glu/libutil/mipmap.c deleted file mode 100644 index af647af73c..0000000000 --- a/src/libs/mesa/glu/libutil/mipmap.c +++ /dev/null @@ -1,8931 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "gluos.h" -#include -#include -#include -#include -#include -#include /* UINT_MAX */ -#include -#include "gluint.h" - -typedef union { - unsigned char ub[4]; - unsigned short us[2]; - unsigned int ui; - char b[4]; - short s[2]; - int i; - float f; -} Type_Widget; - -/* Pixel storage modes */ -typedef struct { - GLint pack_alignment; - GLint pack_row_length; - GLint pack_skip_rows; - GLint pack_skip_pixels; - GLint pack_lsb_first; - GLint pack_swap_bytes; - GLint pack_skip_images; - GLint pack_image_height; - - GLint unpack_alignment; - GLint unpack_row_length; - GLint unpack_skip_rows; - GLint unpack_skip_pixels; - GLint unpack_lsb_first; - GLint unpack_swap_bytes; - GLint unpack_skip_images; - GLint unpack_image_height; -} PixelStorageModes; - -static int gluBuild1DMipmapLevelsCore(GLenum, GLint, - GLsizei, - GLsizei, - GLenum, GLenum, GLint, GLint, GLint, - const void *); -static int gluBuild2DMipmapLevelsCore(GLenum, GLint, - GLsizei, GLsizei, - GLsizei, GLsizei, - GLenum, GLenum, GLint, GLint, GLint, - const void *); -static int gluBuild3DMipmapLevelsCore(GLenum, GLint, - GLsizei, GLsizei, GLsizei, - GLsizei, GLsizei, GLsizei, - GLenum, GLenum, GLint, GLint, GLint, - const void *); - -/* - * internal function declarations - */ -static GLfloat bytes_per_element(GLenum type); -static GLint elements_per_group(GLenum format, GLenum type); -static GLint is_index(GLenum format); -static GLint image_size(GLint width, GLint height, GLenum format, GLenum type); -static void fill_image(const PixelStorageModes *, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, - const void *userdata, GLushort *newimage); -static void empty_image(const PixelStorageModes *, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, - const GLushort *oldimage, void *userdata); -static void scale_internal(GLint components, GLint widthin, GLint heightin, - const GLushort *datain, - GLint widthout, GLint heightout, - GLushort *dataout); - -static void scale_internal_ubyte(GLint components, GLint widthin, - GLint heightin, const GLubyte *datain, - GLint widthout, GLint heightout, - GLubyte *dataout, GLint element_size, - GLint ysize, GLint group_size); -static void scale_internal_byte(GLint components, GLint widthin, - GLint heightin, const GLbyte *datain, - GLint widthout, GLint heightout, - GLbyte *dataout, GLint element_size, - GLint ysize, GLint group_size); -static void scale_internal_ushort(GLint components, GLint widthin, - GLint heightin, const GLushort *datain, - GLint widthout, GLint heightout, - GLushort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); -static void scale_internal_short(GLint components, GLint widthin, - GLint heightin, const GLshort *datain, - GLint widthout, GLint heightout, - GLshort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); -static void scale_internal_uint(GLint components, GLint widthin, - GLint heightin, const GLuint *datain, - GLint widthout, GLint heightout, - GLuint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); -static void scale_internal_int(GLint components, GLint widthin, - GLint heightin, const GLint *datain, - GLint widthout, GLint heightout, - GLint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); -static void scale_internal_float(GLint components, GLint widthin, - GLint heightin, const GLfloat *datain, - GLint widthout, GLint heightout, - GLfloat *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); - -static int checkMipmapArgs(GLenum, GLenum, GLenum); -static GLboolean legalFormat(GLenum); -static GLboolean legalType(GLenum); -static GLboolean isTypePackedPixel(GLenum); -static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum); -static GLboolean isLegalLevels(GLint, GLint, GLint, GLint); -static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum, - GLint *, GLint *); - -/* all extract/shove routines must return double to handle unsigned ints */ -static GLdouble extractUbyte(int, const void *); -static void shoveUbyte(GLdouble, int, void *); -static GLdouble extractSbyte(int, const void *); -static void shoveSbyte(GLdouble, int, void *); -static GLdouble extractUshort(int, const void *); -static void shoveUshort(GLdouble, int, void *); -static GLdouble extractSshort(int, const void *); -static void shoveSshort(GLdouble, int, void *); -static GLdouble extractUint(int, const void *); -static void shoveUint(GLdouble, int, void *); -static GLdouble extractSint(int, const void *); -static void shoveSint(GLdouble, int, void *); -static GLdouble extractFloat(int, const void *); -static void shoveFloat(GLdouble, int, void *); -static void halveImageSlice(int, GLdouble (*)(int, const void *), - void (*)(GLdouble, int, void *), - GLint, GLint, GLint, - const void *, void *, - GLint, GLint, GLint, GLint, GLint); -static void halveImage3D(int, GLdouble (*)(int, const void *), - void (*)(GLdouble, int, void *), - GLint, GLint, GLint, - const void *, void *, - GLint, GLint, GLint, GLint, GLint); - -/* packedpixel type scale routines */ -static void extract332(int,const void *, GLfloat []); -static void shove332(const GLfloat [],int ,void *); -static void extract233rev(int,const void *, GLfloat []); -static void shove233rev(const GLfloat [],int ,void *); -static void extract565(int,const void *, GLfloat []); -static void shove565(const GLfloat [],int ,void *); -static void extract565rev(int,const void *, GLfloat []); -static void shove565rev(const GLfloat [],int ,void *); -static void extract4444(int,const void *, GLfloat []); -static void shove4444(const GLfloat [],int ,void *); -static void extract4444rev(int,const void *, GLfloat []); -static void shove4444rev(const GLfloat [],int ,void *); -static void extract5551(int,const void *, GLfloat []); -static void shove5551(const GLfloat [],int ,void *); -static void extract1555rev(int,const void *, GLfloat []); -static void shove1555rev(const GLfloat [],int ,void *); -static void extract8888(int,const void *, GLfloat []); -static void shove8888(const GLfloat [],int ,void *); -static void extract8888rev(int,const void *, GLfloat []); -static void shove8888rev(const GLfloat [],int ,void *); -static void extract1010102(int,const void *, GLfloat []); -static void shove1010102(const GLfloat [],int ,void *); -static void extract2101010rev(int,const void *, GLfloat []); -static void shove2101010rev(const GLfloat [],int ,void *); -static void scaleInternalPackedPixel(int, - void (*)(int, const void *,GLfloat []), - void (*)(const GLfloat [],int, void *), - GLint,GLint, const void *, - GLint,GLint,void *,GLint,GLint,GLint); -static void halveImagePackedPixel(int, - void (*)(int, const void *,GLfloat []), - void (*)(const GLfloat [],int, void *), - GLint, GLint, const void *, - void *, GLint, GLint, GLint); -static void halve1DimagePackedPixel(int, - void (*)(int, const void *,GLfloat []), - void (*)(const GLfloat [],int, void *), - GLint, GLint, const void *, - void *, GLint, GLint, GLint); - -static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *, - GLubyte *, GLint, GLint, GLint); -static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *, - GLint, GLint, GLint); -static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *, - GLushort *, GLint, GLint, GLint, GLint); -static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *, - GLint, GLint, GLint, GLint); -static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *, - GLint, GLint, GLint, GLint); -static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *, - GLint, GLint, GLint, GLint); -static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *, - GLint, GLint, GLint, GLint); - -static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum); -static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum, - GLenum, GLboolean, const void *, GLushort *); -static void emptyImage3D(const PixelStorageModes *, - GLint, GLint, GLint, GLenum, - GLenum, GLboolean, - const GLushort *, void *); -static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *, - GLint, GLint, GLint, GLushort *); - -static void retrieveStoreModes(PixelStorageModes *psm) -{ - glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment); - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels); - glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first); - glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes); - - glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment); - glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length); - glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows); - glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels); - glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first); - glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes); -} - -static void retrieveStoreModes3D(PixelStorageModes *psm) -{ - glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment); - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels); - glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first); - glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes); - glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &psm->unpack_skip_images); - glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &psm->unpack_image_height); - - glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment); - glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length); - glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows); - glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels); - glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first); - glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes); - glGetIntegerv(GL_PACK_SKIP_IMAGES, &psm->pack_skip_images); - glGetIntegerv(GL_PACK_IMAGE_HEIGHT, &psm->pack_image_height); -} - -static int computeLog(GLuint value) -{ - int i; - - i = 0; - - /* Error! */ - if (value == 0) return -1; - - for (;;) { - if (value & 1) { - /* Error ! */ - if (value != 1) return -1; - return i; - } - value = value >> 1; - i++; - } -} - -/* -** Compute the nearest power of 2 number. This algorithm is a little -** strange, but it works quite well. -*/ -static int nearestPower(GLuint value) -{ - int i; - - i = 1; - - /* Error! */ - if (value == 0) return -1; - - for (;;) { - if (value == 1) { - return i; - } else if (value == 3) { - return i*4; - } - value = value >> 1; - i *= 2; - } -} - -#define __GLU_SWAP_2_BYTES(s)\ -(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) - -#define __GLU_SWAP_4_BYTES(s)\ -(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \ - ((GLuint)((const GLubyte*)(s))[2])<<16 | \ - ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) - -static void halveImage(GLint components, GLuint width, GLuint height, - const GLushort *datain, GLushort *dataout) -{ - int i, j, k; - int newwidth, newheight; - int delta; - GLushort *s; - const GLushort *t; - - newwidth = width / 2; - newheight = height / 2; - delta = width * components; - s = dataout; - t = datain; - - /* Piece o' cake! */ - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (t[0] + t[components] + t[delta] + - t[delta+components] + 2) / 4; - s++; t++; - } - t += components; - } - t += delta; - } -} - -static void halveImage_ubyte(GLint components, GLuint width, GLuint height, - const GLubyte *datain, GLubyte *dataout, - GLint element_size, GLint ysize, GLint group_size) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLubyte *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_ubyte(components,width,height,datain,dataout, - element_size,ysize,group_size); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (*(const GLubyte*)t + - *(const GLubyte*)(t+group_size) + - *(const GLubyte*)(t+ysize) + - *(const GLubyte*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -/* */ -static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, - const GLubyte *dataIn, GLubyte *dataOut, - GLint element_size, GLint ysize, - GLint group_size) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLubyte *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { - *dest= (*(const GLubyte*)src + - *(const GLubyte*)(src+group_size)) / 2; - - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { - *dest= (*(const GLubyte*)src + *(const GLubyte*)(src+ysize)) / 2; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - } - - assert(src == &((const char *)dataIn)[ysize*height]); - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); -} /* halve1Dimage_ubyte() */ - -static void halveImage_byte(GLint components, GLuint width, GLuint height, - const GLbyte *datain, GLbyte *dataout, - GLint element_size, - GLint ysize, GLint group_size) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLbyte *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_byte(components,width,height,datain,dataout, - element_size,ysize,group_size); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (*(const GLbyte*)t + - *(const GLbyte*)(t+group_size) + - *(const GLbyte*)(t+ysize) + - *(const GLbyte*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, - const GLbyte *dataIn, GLbyte *dataOut, - GLint element_size,GLint ysize, GLint group_size) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLbyte *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { - *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2; - - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { - *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+ysize)) / 2; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - - assert(src == &((const char *)dataIn)[ysize*height]); - } - - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); -} /* halve1Dimage_byte() */ - -static void halveImage_ushort(GLint components, GLuint width, GLuint height, - const GLushort *datain, GLushort *dataout, - GLint element_size, GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLushort *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_ushort(components,width,height,datain,dataout, - element_size,ysize,group_size, myswap_bytes); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - if (!myswap_bytes) - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (*(const GLushort*)t + - *(const GLushort*)(t+group_size) + - *(const GLushort*)(t+ysize) + - *(const GLushort*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } - else - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (__GLU_SWAP_2_BYTES(t) + - __GLU_SWAP_2_BYTES(t+group_size) + - __GLU_SWAP_2_BYTES(t+ysize) + - __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, - const GLushort *dataIn, GLushort *dataOut, - GLint element_size, GLint ysize, - GLint group_size, GLint myswap_bytes) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLushort *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLushort ushort[BOX2]; - if (myswap_bytes) { - ushort[0]= __GLU_SWAP_2_BYTES(src); - ushort[1]= __GLU_SWAP_2_BYTES(src+group_size); - } - else { - ushort[0]= *(const GLushort*)src; - ushort[1]= *(const GLushort*)(src+group_size); - } - - *dest= (ushort[0] + ushort[1]) / 2; - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLushort ushort[BOX2]; - if (myswap_bytes) { - ushort[0]= __GLU_SWAP_2_BYTES(src); - ushort[1]= __GLU_SWAP_2_BYTES(src+ysize); - } - else { - ushort[0]= *(const GLushort*)src; - ushort[1]= *(const GLushort*)(src+ysize); - } - *dest= (ushort[0] + ushort[1]) / 2; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - - assert(src == &((const char *)dataIn)[ysize*height]); - } - - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); - -} /* halve1Dimage_ushort() */ - - -static void halveImage_short(GLint components, GLuint width, GLuint height, - const GLshort *datain, GLshort *dataout, - GLint element_size, GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLshort *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_short(components,width,height,datain,dataout, - element_size,ysize,group_size, myswap_bytes); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - if (!myswap_bytes) - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (*(const GLshort*)t + - *(const GLshort*)(t+group_size) + - *(const GLshort*)(t+ysize) + - *(const GLshort*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } - else - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - GLushort b; - GLint buf; - b = __GLU_SWAP_2_BYTES(t); - buf = *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+group_size); - buf += *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+ysize); - buf += *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+ysize+group_size); - buf += *(const GLshort*)&b; - s[0] = (GLshort)((buf+2)/4); - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -static void halve1Dimage_short(GLint components, GLuint width, GLuint height, - const GLshort *dataIn, GLshort *dataOut, - GLint element_size, GLint ysize, - GLint group_size, GLint myswap_bytes) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLshort *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLshort sshort[BOX2]; - if (myswap_bytes) { - sshort[0]= __GLU_SWAP_2_BYTES(src); - sshort[1]= __GLU_SWAP_2_BYTES(src+group_size); - } - else { - sshort[0]= *(const GLshort*)src; - sshort[1]= *(const GLshort*)(src+group_size); - } - - *dest= (sshort[0] + sshort[1]) / 2; - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLshort sshort[BOX2]; - if (myswap_bytes) { - sshort[0]= __GLU_SWAP_2_BYTES(src); - sshort[1]= __GLU_SWAP_2_BYTES(src+ysize); - } - else { - sshort[0]= *(const GLshort*)src; - sshort[1]= *(const GLshort*)(src+ysize); - } - *dest= (sshort[0] + sshort[1]) / 2; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - - assert(src == &((const char *)dataIn)[ysize*height]); - } - - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); - -} /* halve1Dimage_short() */ - - -static void halveImage_uint(GLint components, GLuint width, GLuint height, - const GLuint *datain, GLuint *dataout, - GLint element_size, GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLuint *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_uint(components,width,height,datain,dataout, - element_size,ysize,group_size, myswap_bytes); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - if (!myswap_bytes) - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - /* need to cast to double to hold large unsigned ints */ - s[0] = ((double)*(const GLuint*)t + - (double)*(const GLuint*)(t+group_size) + - (double)*(const GLuint*)(t+ysize) + - (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5; - s++; t += element_size; - - } - t += group_size; - } - t += padBytes; - t += ysize; - } - else - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - /* need to cast to double to hold large unsigned ints */ - GLdouble buf; - buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + - (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); - s[0] = (GLuint)(buf/4 + 0.5); - - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -/* */ -static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, - const GLuint *dataIn, GLuint *dataOut, - GLint element_size, GLint ysize, - GLint group_size, GLint myswap_bytes) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLuint *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLuint uint[BOX2]; - if (myswap_bytes) { - uint[0]= __GLU_SWAP_4_BYTES(src); - uint[1]= __GLU_SWAP_4_BYTES(src+group_size); - } - else { - uint[0]= *(const GLuint*)src; - uint[1]= *(const GLuint*)(src+group_size); - } - *dest= ((double)uint[0]+(double)uint[1])/2.0; - - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLuint uint[BOX2]; - if (myswap_bytes) { - uint[0]= __GLU_SWAP_4_BYTES(src); - uint[1]= __GLU_SWAP_4_BYTES(src+ysize); - } - else { - uint[0]= *(const GLuint*)src; - uint[1]= *(const GLuint*)(src+ysize); - } - *dest= ((double)uint[0]+(double)uint[1])/2.0; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - - assert(src == &((const char *)dataIn)[ysize*height]); - } - - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); - -} /* halve1Dimage_uint() */ - -static void halveImage_int(GLint components, GLuint width, GLuint height, - const GLint *datain, GLint *dataout, GLint element_size, - GLint ysize, GLint group_size, GLint myswap_bytes) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLint *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_int(components,width,height,datain,dataout, - element_size,ysize,group_size, myswap_bytes); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - if (!myswap_bytes) - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = ((float)*(const GLint*)t + - (float)*(const GLint*)(t+group_size) + - (float)*(const GLint*)(t+ysize) + - (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } - else - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - GLuint b; - GLfloat buf; - b = __GLU_SWAP_4_BYTES(t); - buf = *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+group_size); - buf += *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize); - buf += *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize+group_size); - buf += *(GLint*)&b; - s[0] = (GLint)(buf/4 + 0.5); - - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -/* */ -static void halve1Dimage_int(GLint components, GLuint width, GLuint height, - const GLint *dataIn, GLint *dataOut, - GLint element_size, GLint ysize, - GLint group_size, GLint myswap_bytes) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLint *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLuint uint[BOX2]; - if (myswap_bytes) { - uint[0]= __GLU_SWAP_4_BYTES(src); - uint[1]= __GLU_SWAP_4_BYTES(src+group_size); - } - else { - uint[0]= *(const GLuint*)src; - uint[1]= *(const GLuint*)(src+group_size); - } - *dest= ((float)uint[0]+(float)uint[1])/2.0; - - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLuint uint[BOX2]; - if (myswap_bytes) { - uint[0]= __GLU_SWAP_4_BYTES(src); - uint[1]= __GLU_SWAP_4_BYTES(src+ysize); - } - else { - uint[0]= *(const GLuint*)src; - uint[1]= *(const GLuint*)(src+ysize); - } - *dest= ((float)uint[0]+(float)uint[1])/2.0; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; - } - - assert(src == &((const char *)dataIn)[ysize*height]); - } - - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); - -} /* halve1Dimage_int() */ - - -static void halveImage_float(GLint components, GLuint width, GLuint height, - const GLfloat *datain, GLfloat *dataout, - GLint element_size, GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - int i, j, k; - int newwidth, newheight; - int padBytes; - GLfloat *s; - const char *t; - - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert( !(width == 1 && height == 1) ); /* can't be 1x1 */ - halve1Dimage_float(components,width,height,datain,dataout, - element_size,ysize,group_size, myswap_bytes); - return; - } - - newwidth = width / 2; - newheight = height / 2; - padBytes = ysize - (width*group_size); - s = dataout; - t = (const char *)datain; - - /* Piece o' cake! */ - if (!myswap_bytes) - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - s[0] = (*(const GLfloat*)t + - *(const GLfloat*)(t+group_size) + - *(const GLfloat*)(t+ysize) + - *(const GLfloat*)(t+ysize+group_size)) / 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } - else - for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - union { GLuint b; GLfloat f; } swapbuf; - swapbuf.b = __GLU_SWAP_4_BYTES(t); - s[0] = swapbuf.f; - swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size); - s[0] += swapbuf.f; - swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize); - s[0] += swapbuf.f; - swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size); - s[0] += swapbuf.f; - s[0] /= 4; - s++; t += element_size; - } - t += group_size; - } - t += padBytes; - t += ysize; - } -} - -/* */ -static void halve1Dimage_float(GLint components, GLuint width, GLuint height, - const GLfloat *dataIn, GLfloat *dataOut, - GLint element_size, GLint ysize, - GLint group_size, GLint myswap_bytes) -{ - GLint halfWidth= width / 2; - GLint halfHeight= height / 2; - const char *src= (const char *) dataIn; - GLfloat *dest= dataOut; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - for (jj= 0; jj< halfWidth; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLfloat sfloat[BOX2]; - if (myswap_bytes) { - sfloat[0]= __GLU_SWAP_4_BYTES(src); - sfloat[1]= __GLU_SWAP_4_BYTES(src+group_size); - } - else { - sfloat[0]= *(const GLfloat*)src; - sfloat[1]= *(const GLfloat*)(src+group_size); - } - - *dest= (sfloat[0] + sfloat[1]) / 2.0; - src+= element_size; - dest++; - } - src+= group_size; /* skip to next 2 */ - } - { - int padBytes= ysize - (width*group_size); - src+= padBytes; /* for assertion only */ - } - } - else if (width == 1) { /* 1 column */ - int padBytes= ysize - (width * group_size); - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { - int kk; - for (kk= 0; kk< components; kk++) { -#define BOX2 2 - GLfloat sfloat[BOX2]; - if (myswap_bytes) { - sfloat[0]= __GLU_SWAP_4_BYTES(src); - sfloat[1]= __GLU_SWAP_4_BYTES(src+ysize); - } - else { - sfloat[0]= *(const GLfloat*)src; - sfloat[1]= *(const GLfloat*)(src+ysize); - } - *dest= (sfloat[0] + sfloat[1]) / 2.0; - - src+= element_size; - dest++; - } - src+= padBytes; /* add pad bytes, if any, to get to end to row */ - src+= ysize; /* skip to odd row */ - } - } - - assert(src == &((const char *)dataIn)[ysize*height]); - assert((char *)dest == &((char *)dataOut) - [components * element_size * halfWidth * halfHeight]); -} /* halve1Dimage_float() */ - -static void scale_internal(GLint components, GLint widthin, GLint heightin, - const GLushort *datain, - GLint widthout, GLint heightout, - GLushort *dataout) -{ - float x, lowx, highx, convx, halfconvx; - float y, lowy, highy, convy, halfconvy; - float xpercent,ypercent; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,yint,xint,xindex,yindex; - int temp; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage(components, widthin, heightin, datain, dataout); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - halfconvx = convx/2; - halfconvy = convy/2; - for (i = 0; i < heightout; i++) { - y = convy * (i+0.5); - if (heightin > heightout) { - highy = y + halfconvy; - lowy = y - halfconvy; - } else { - highy = y + 0.5; - lowy = y - 0.5; - } - for (j = 0; j < widthout; j++) { - x = convx * (j+0.5); - if (widthin > widthout) { - highx = x + halfconvx; - lowx = x - halfconvx; - } else { - highx = x + 0.5; - lowx = x - 0.5; - } - - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - area = 0.0; - - y = lowy; - yint = floor(y); - while (y < highy) { - yindex = (yint + heightin) % heightin; - if (highy < yint+1) { - ypercent = highy - y; - } else { - ypercent = yint+1 - y; - } - - x = lowx; - xint = floor(x); - - while (x < highx) { - xindex = (xint + widthin) % widthin; - if (highx < xint+1) { - xpercent = highx - x; - } else { - xpercent = xint+1 - x; - } - - percent = xpercent * ypercent; - area += percent; - temp = (xindex + (yindex * widthin)) * components; - for (k = 0; k < components; k++) { - totals[k] += datain[temp + k] * percent; - } - - xint++; - x = xint; - } - yint++; - y = yint; - } - - temp = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - /* totals[] should be rounded in the case of enlarging an RGB - * ramp when the type is 332 or 4444 - */ - dataout[temp + k] = (totals[k]+0.5)/area; - } - } - } -} - -static void scale_internal_ubyte(GLint components, GLint widthin, - GLint heightin, const GLubyte *datain, - GLint widthout, GLint heightout, - GLubyte *dataout, GLint element_size, - GLint ysize, GLint group_size) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_ubyte(components, widthin, heightin, - (const GLubyte *)datain, (GLubyte *)dataout, - element_size, ysize, group_size); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - totals[k] += (GLubyte)(*(left))*(1-lowx_float) - +(GLubyte)(*(right))*highx_float; - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * x_percent; - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } - } - - - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)); - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - -static void scale_internal_byte(GLint components, GLint widthin, - GLint heightin, const GLbyte *datain, - GLint widthout, GLint heightout, - GLbyte *dataout, GLint element_size, - GLint ysize, GLint group_size) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_byte(components, widthin, heightin, - (const GLbyte *)datain, (GLbyte *)dataout, - element_size, ysize, group_size); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - totals[k] += (GLbyte)(*(left))*(1-lowx_float) - +(GLbyte)(*(right))*highx_float; - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * x_percent; - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } - } - - - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)); - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - -static void scale_internal_ushort(GLint components, GLint widthin, - GLint heightin, const GLushort *datain, - GLint widthout, GLint heightout, - GLushort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_ushort(components, widthin, heightin, - (const GLushort *)datain, (GLushort *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + - __GLU_SWAP_2_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLushort*)left * (1-lowx_float) - + *(const GLushort*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLushort*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index); - } else { - totals[k] += *(const GLushort*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - -static void scale_internal_short(GLint components, GLint widthin, - GLint heightin, const GLshort *datain, - GLint widthout, GLint heightout, - GLshort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - GLushort swapbuf; /* unsigned buffer */ - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_short(components, widthin, heightin, - (const GLshort *)datain, (GLshort *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(left); - totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float); - swapbuf = __GLU_SWAP_2_BYTES(right); - totals[k] += *(const GLshort*)&swapbuf * highx_float; - } else { - totals[k] += *(const GLshort*)left * (1-lowx_float) - + *(const GLshort*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * x_percent; - } else { - totals[k] += *(const GLshort*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf; - } else { - totals[k] += *(const GLshort*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - -static void scale_internal_uint(GLint components, GLint widthin, - GLint heightin, const GLuint *datain, - GLint widthout, GLint heightout, - GLuint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_uint(components, widthin, heightin, - (const GLuint *)datain, (GLuint *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(left) * (1-lowx_float) - + __GLU_SWAP_4_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLuint*)left * (1-lowx_float) - + *(const GLuint*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLuint*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index); - } else { - totals[k] += *(const GLuint*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - /* clamp at UINT_MAX */ - float value= totals[k]/area; - if (value >= (float) UINT_MAX) { /* need '=' */ - dataout[outindex + k] = UINT_MAX; - } - else dataout[outindex + k] = value; - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - - - -static void scale_internal_int(GLint components, GLint widthin, - GLint heightin, const GLint *datain, - GLint widthout, GLint heightout, - GLint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - GLuint swapbuf; /* unsigned buffer */ - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_int(components, widthin, heightin, - (const GLint *)datain, (GLint *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(left); - totals[k] += *(const GLint*)&swapbuf * (1-lowx_float); - swapbuf = __GLU_SWAP_4_BYTES(right); - totals[k] += *(const GLint*)&swapbuf * highx_float; - } else { - totals[k] += *(const GLint*)left * (1-lowx_float) - + *(const GLint*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * x_percent; - } else { - totals[k] += *(const GLint*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf; - } else { - totals[k] += *(const GLint*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - - - -static void scale_internal_float(GLint components, GLint widthin, - GLint heightin, const GLfloat *datain, - GLint widthout, GLint heightout, - GLfloat *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - union { GLuint b; GLfloat f; } swapbuf; - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_float(components, widthin, heightin, - (const GLfloat *)datain, (GLfloat *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightout; i++) { - /* Clamp here to be sure we don't read beyond input buffer. */ - if (highy_int >= heightin) - highy_int = heightin - 1; - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(left); - totals[k] += swapbuf.f * (1-lowx_float); - swapbuf.b = __GLU_SWAP_4_BYTES(right); - totals[k] += swapbuf.f * highx_float; - } else { - totals[k] += *(const GLfloat*)left * (1-lowx_float) - + *(const GLfloat*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * x_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf.b = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += swapbuf.f; - } else { - totals[k] += *(const GLfloat*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - -static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type) -{ - if (!legalFormat(format) || !legalType(type)) { - return GLU_INVALID_ENUM; - } - if (format == GL_STENCIL_INDEX) { - return GLU_INVALID_ENUM; - } - - if (!isLegalFormatForPackedPixelType(format, type)) { - return GLU_INVALID_OPERATION; - } - - return 0; -} /* checkMipmapArgs() */ - -static GLboolean legalFormat(GLenum format) -{ - switch(format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_RGB: - case GL_RGBA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_BGR: - case GL_BGRA: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean legalType(GLenum type) -{ - switch(type) { - case GL_BITMAP: - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return GL_TRUE; - default: - return GL_FALSE; - } -} - -/* */ -static GLboolean isTypePackedPixel(GLenum type) -{ - assert(legalType(type)); - - if (type == GL_UNSIGNED_BYTE_3_3_2 || - type == GL_UNSIGNED_BYTE_2_3_3_REV || - type == GL_UNSIGNED_SHORT_5_6_5 || - type == GL_UNSIGNED_SHORT_5_6_5_REV || - type == GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL_UNSIGNED_INT_8_8_8_8 || - type == GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL_UNSIGNED_INT_10_10_10_2 || - type == GL_UNSIGNED_INT_2_10_10_10_REV) { - return 1; - } - else return 0; -} /* isTypePackedPixel() */ - -/* Determines if the packed pixel type is compatible with the format */ -static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type) -{ - /* if not a packed pixel type then return true */ - if (!isTypePackedPixel(type)) { - return GL_TRUE; - } - - /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */ - if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV|| - type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV) - && format != GL_RGB) - return GL_FALSE; - - /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV & - * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT. - */ - if ((type == GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL_UNSIGNED_INT_8_8_8_8 || - type == GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL_UNSIGNED_INT_10_10_10_2 || - type == GL_UNSIGNED_INT_2_10_10_10_REV) && - (format != GL_RGBA && - format != GL_BGRA)) { - return GL_FALSE; - } - - return GL_TRUE; -} /* isLegalFormatForPackedPixelType() */ - -static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel, - GLint totalLevels) -{ - if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel || - totalLevels < maxLevel) - return GL_FALSE; - else return GL_TRUE; -} /* isLegalLevels() */ - -/* Given user requested texture size, determine if it fits. If it - * doesn't then halve both sides and make the determination again - * until it does fit (for IR only). - * Note that proxy textures are not implemented in RE* even though - * they advertise the texture extension. - * Note that proxy textures are implemented but not according to spec in - * IMPACT*. - */ -static void closestFit(GLenum target, GLint width, GLint height, - GLint internalFormat, GLenum format, GLenum type, - GLint *newWidth, GLint *newHeight) -{ - /* Use proxy textures if OpenGL version is >= 1.1 */ - if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) - ) { - GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); - GLint proxyWidth; - - do { - /* compute level 1 width & height, clamping each at 1 */ - GLint widthAtLevelOne= (widthPowerOf2 > 1) ? - widthPowerOf2 >> 1 : - widthPowerOf2; - GLint heightAtLevelOne= (heightPowerOf2 > 1) ? - heightPowerOf2 >> 1 : - heightPowerOf2; - GLenum proxyTarget; - assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0); - - /* does width x height at level 1 & all their mipmaps fit? */ - if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) { - proxyTarget = GL_PROXY_TEXTURE_2D; - glTexImage2D(proxyTarget, 1, /* must be non-zero */ - internalFormat, - widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); - } else -#if defined(GL_ARB_texture_cube_map) - if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) || - (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) || - (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { - proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB; - glTexImage2D(proxyTarget, 1, /* must be non-zero */ - internalFormat, - widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); - } else -#endif /* GL_ARB_texture_cube_map */ - { - assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D); - proxyTarget = GL_PROXY_TEXTURE_1D; - glTexImage1D(proxyTarget, 1, /* must be non-zero */ - internalFormat,widthAtLevelOne,0,format,type,NULL); - } - glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth); - /* does it fit??? */ - if (proxyWidth == 0) { /* nope, so try again with these sizes */ - if (widthPowerOf2 == 1 && heightPowerOf2 == 1) { - /* An 1x1 texture couldn't fit for some reason, so - * break out. This should never happen. But things - * happen. The disadvantage with this if-statement is - * that we will never be aware of when this happens - * since it will silently branch out. - */ - goto noProxyTextures; - } - widthPowerOf2= widthAtLevelOne; - heightPowerOf2= heightAtLevelOne; - } - /* else it does fit */ - } while (proxyWidth == 0); - /* loop must terminate! */ - - /* return the width & height at level 0 that fits */ - *newWidth= widthPowerOf2; - *newHeight= heightPowerOf2; -/*printf("Proxy Textures\n");*/ - } /* if gluCheckExtension() */ - else { /* no texture extension, so do this instead */ - GLint maxsize; - -noProxyTextures: - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); - /* clamp user's texture sizes to maximum sizes, if necessary */ - *newWidth = nearestPower(width); - if (*newWidth > maxsize) *newWidth = maxsize; - *newHeight = nearestPower(height); - if (*newHeight > maxsize) *newHeight = maxsize; -/*printf("NO proxy textures\n");*/ - } -} /* closestFit() */ - -GLint GLAPIENTRY -gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, GLenum typeout, - void *dataout) -{ - int components; - GLushort *beforeImage; - GLushort *afterImage; - PixelStorageModes psm; - - if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) { - return 0; - } - if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) { - return GLU_INVALID_VALUE; - } - if (!legalFormat(format) || !legalType(typein) || !legalType(typeout)) { - return GLU_INVALID_ENUM; - } - if (!isLegalFormatForPackedPixelType(format, typein)) { - return GLU_INVALID_OPERATION; - } - if (!isLegalFormatForPackedPixelType(format, typeout)) { - return GLU_INVALID_OPERATION; - } - beforeImage = - malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT)); - afterImage = - malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); - if (beforeImage == NULL || afterImage == NULL) { - return GLU_OUT_OF_MEMORY; - } - - retrieveStoreModes(&psm); - fill_image(&psm,widthin, heightin, format, typein, is_index(format), - datain, beforeImage); - components = elements_per_group(format, 0); - scale_internal(components, widthin, heightin, beforeImage, - widthout, heightout, afterImage); - empty_image(&psm,widthout, heightout, format, typeout, - is_index(format), afterImage, dataout); - free((GLbyte *) beforeImage); - free((GLbyte *) afterImage); - - return 0; -} - -int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, - GLsizei width, - GLsizei widthPowerOf2, - GLenum format, GLenum type, - GLint userLevel, GLint baseLevel,GLint maxLevel, - const void *data) -{ - GLint newwidth; - GLint level, levels; - GLushort *newImage; - GLint newImage_width; - GLushort *otherImage; - GLushort *imageTemp; - GLint memreq; - GLint cmpts; - PixelStorageModes psm; - - assert(checkMipmapArgs(internalFormat,format,type) == 0); - assert(width >= 1); - - otherImage = NULL; - - newwidth= widthPowerOf2; - levels = computeLog(newwidth); - - levels+= userLevel; - - retrieveStoreModes(&psm); - newImage = (GLushort *) - malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT)); - newImage_width = width; - if (newImage == NULL) { - return GLU_OUT_OF_MEMORY; - } - fill_image(&psm,width, 1, format, type, is_index(format), - data, newImage); - cmpts = elements_per_group(format,type); - glPixelStorei(GL_UNPACK_ALIGNMENT, 2); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - /* - ** If swap_bytes was set, swapping occurred in fill_image. - */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - - for (level = userLevel; level <= levels; level++) { - if (newImage_width == newwidth) { - /* Use newImage for this level */ - if (baseLevel <= level && level <= maxLevel) { - glTexImage1D(target, level, internalFormat, newImage_width, - 0, format, GL_UNSIGNED_SHORT, (void *) newImage); - } - } else { - if (otherImage == NULL) { - memreq = image_size(newwidth, 1, format, GL_UNSIGNED_SHORT); - otherImage = (GLushort *) malloc(memreq); - if (otherImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - } - scale_internal(cmpts, newImage_width, 1, newImage, - newwidth, 1, otherImage); - /* Swap newImage and otherImage */ - imageTemp = otherImage; - otherImage = newImage; - newImage = imageTemp; - - newImage_width = newwidth; - if (baseLevel <= level && level <= maxLevel) { - glTexImage1D(target, level, internalFormat, newImage_width, - 0, format, GL_UNSIGNED_SHORT, (void *) newImage); - } - } - if (newwidth > 1) newwidth /= 2; - } - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - - free((GLbyte *) newImage); - if (otherImage) { - free((GLbyte *) otherImage); - } - return 0; -} - -GLint GLAPIENTRY -gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, - GLsizei width, - GLenum format, GLenum type, - GLint userLevel, GLint baseLevel, GLint maxLevel, - const void *data) -{ - int levels; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1) { - return GLU_INVALID_VALUE; - } - - levels = computeLog(width); - - levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) - return GLU_INVALID_VALUE; - - return gluBuild1DMipmapLevelsCore(target, internalFormat, - width, - width,format, type, - userLevel, baseLevel, maxLevel, - data); -} /* gluBuild1DMipmapLevels() */ - -GLint GLAPIENTRY -gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, - GLenum format, GLenum type, - const void *data) -{ - GLint widthPowerOf2; - int levels; - GLint dummy; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1) { - return GLU_INVALID_VALUE; - } - - closestFit(target,width,1,internalFormat,format,type,&widthPowerOf2,&dummy); - levels = computeLog(widthPowerOf2); - - return gluBuild1DMipmapLevelsCore(target,internalFormat, - width, - widthPowerOf2, - format,type,0,0,levels,data); -} - -static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, - GLint width, GLint height, GLenum format, - GLenum type, const void *data) -{ - GLint newwidth, newheight; - GLint level, levels; - GLushort *newImage; - GLint newImage_width; - GLint newImage_height; - GLushort *otherImage; - GLushort *imageTemp; - GLint memreq; - GLint cmpts; - PixelStorageModes psm; - - retrieveStoreModes(&psm); - -#if 0 - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); - newwidth = nearestPower(width); - if (newwidth > maxsize) newwidth = maxsize; - newheight = nearestPower(height); - if (newheight > maxsize) newheight = maxsize; -#else - closestFit(target,width,height,internalFormat,format,type, - &newwidth,&newheight); -#endif - levels = computeLog(newwidth); - level = computeLog(newheight); - if (level > levels) levels=level; - - otherImage = NULL; - newImage = (GLushort *) - malloc(image_size(width, height, format, GL_UNSIGNED_SHORT)); - newImage_width = width; - newImage_height = height; - if (newImage == NULL) { - return GLU_OUT_OF_MEMORY; - } - - fill_image(&psm,width, height, format, type, is_index(format), - data, newImage); - - cmpts = elements_per_group(format,type); - glPixelStorei(GL_UNPACK_ALIGNMENT, 2); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - /* - ** If swap_bytes was set, swapping occurred in fill_image. - */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - - for (level = 0; level <= levels; level++) { - if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */ - glTexImage2D(target, level, internalFormat, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_SHORT, - (void *) newImage); - } else { - if (otherImage == NULL) { - memreq = - image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT); - otherImage = (GLushort *) malloc(memreq); - if (otherImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - } - scale_internal(cmpts, newImage_width, newImage_height, newImage, - newwidth, newheight, otherImage); - /* Swap newImage and otherImage */ - imageTemp = otherImage; - otherImage = newImage; - newImage = imageTemp; - - newImage_width = newwidth; - newImage_height = newheight; - glTexImage2D(target, level, internalFormat, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_SHORT, - (void *) newImage); - } - if (newwidth > 1) newwidth /= 2; - if (newheight > 1) newheight /= 2; - } - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - - free((GLbyte *) newImage); - if (otherImage) { - free((GLbyte *) otherImage); - } - return 0; -} - -/* To make swapping images less error prone */ -#define __GLU_INIT_SWAP_IMAGE void *tmpImage -#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage; - -static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei widthPowerOf2, - GLsizei heightPowerOf2, - GLenum format, GLenum type, - GLint userLevel, - GLint baseLevel,GLint maxLevel, - const void *data) -{ - GLint newwidth, newheight; - GLint level, levels; - const void *usersImage; /* passed from user. Don't touch! */ - void *srcImage, *dstImage; /* scratch area to build mipmapped images */ - __GLU_INIT_SWAP_IMAGE; - GLint memreq; - GLint cmpts; - - GLint myswap_bytes, groups_per_line, element_size, group_size; - GLint rowsize, padding; - PixelStorageModes psm; - - assert(checkMipmapArgs(internalFormat,format,type) == 0); - assert(width >= 1 && height >= 1); - - if(type == GL_BITMAP) { - return bitmapBuild2DMipmaps(target, internalFormat, width, height, - format, type, data); - } - - srcImage = dstImage = NULL; - - newwidth= widthPowerOf2; - newheight= heightPowerOf2; - levels = computeLog(newwidth); - level = computeLog(newheight); - if (level > levels) levels=level; - - levels+= userLevel; - - retrieveStoreModes(&psm); - myswap_bytes = psm.unpack_swap_bytes; - cmpts = elements_per_group(format,type); - if (psm.unpack_row_length > 0) { - groups_per_line = psm.unpack_row_length; - } else { - groups_per_line = width; - } - - element_size = bytes_per_element(type); - group_size = element_size * cmpts; - if (element_size == 1) myswap_bytes = 0; - - rowsize = groups_per_line * group_size; - padding = (rowsize % psm.unpack_alignment); - if (padding) { - rowsize += psm.unpack_alignment - padding; - } - usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize + - psm.unpack_skip_pixels * group_size; - - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - - level = userLevel; - - /* already power-of-two square */ - if (width == newwidth && height == newheight) { - /* Use usersImage for level userLevel */ - if (baseLevel <= level && level <= maxLevel) { - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glTexImage2D(target, level, internalFormat, width, - height, 0, format, type, - usersImage); - } - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - if(levels == 0) { /* we're done. clean up and return */ - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return 0; - } - { - int nextWidth= newwidth/2; - int nextHeight= newheight/2; - - /* clamp to 1 */ - if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - memreq = image_size(nextWidth, nextHeight, format, type); - } - - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memreq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memreq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memreq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memreq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); - break; - default: - return GLU_INVALID_ENUM; - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - else - switch(type) { - case GL_UNSIGNED_BYTE: - halveImage_ubyte(cmpts, width, height, - (const GLubyte *)usersImage, (GLubyte *)dstImage, - element_size, rowsize, group_size); - break; - case GL_BYTE: - halveImage_byte(cmpts, width, height, - (const GLbyte *)usersImage, (GLbyte *)dstImage, - element_size, rowsize, group_size); - break; - case GL_UNSIGNED_SHORT: - halveImage_ushort(cmpts, width, height, - (const GLushort *)usersImage, (GLushort *)dstImage, - element_size, rowsize, group_size, myswap_bytes); - break; - case GL_SHORT: - halveImage_short(cmpts, width, height, - (const GLshort *)usersImage, (GLshort *)dstImage, - element_size, rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_INT: - halveImage_uint(cmpts, width, height, - (const GLuint *)usersImage, (GLuint *)dstImage, - element_size, rowsize, group_size, myswap_bytes); - break; - case GL_INT: - halveImage_int(cmpts, width, height, - (const GLint *)usersImage, (GLint *)dstImage, - element_size, rowsize, group_size, myswap_bytes); - break; - case GL_FLOAT: - halveImage_float(cmpts, width, height, - (const GLfloat *)usersImage, (GLfloat *)dstImage, - element_size, rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_BYTE_3_3_2: - assert(format == GL_RGB); - halveImagePackedPixel(3,extract332,shove332, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - assert(format == GL_RGB); - halveImagePackedPixel(3,extract233rev,shove233rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5: - halveImagePackedPixel(3,extract565,shove565, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - halveImagePackedPixel(3,extract565rev,shove565rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - halveImagePackedPixel(4,extract4444,shove4444, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - halveImagePackedPixel(4,extract4444rev,shove4444rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - halveImagePackedPixel(4,extract5551,shove5551, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - halveImagePackedPixel(4,extract1555rev,shove1555rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: - halveImagePackedPixel(4,extract8888,shove8888, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - halveImagePackedPixel(4,extract8888rev,shove8888rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: - halveImagePackedPixel(4,extract1010102,shove1010102, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - halveImagePackedPixel(4,extract2101010rev,shove2101010rev, - width,height,usersImage,dstImage, - element_size,rowsize,myswap_bytes); - break; - default: - assert(0); - break; - } - newwidth = width/2; - newheight = height/2; - /* clamp to 1 */ - if (newwidth < 1) newwidth= 1; - if (newheight < 1) newheight= 1; - - myswap_bytes = 0; - rowsize = newwidth * group_size; - memreq = image_size(newwidth, newheight, format, type); - /* Swap srcImage and dstImage */ - __GLU_SWAP_IMAGE(srcImage,dstImage); - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memreq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memreq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memreq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memreq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); - break; - default: - return GLU_INVALID_ENUM; - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - /* level userLevel+1 is in srcImage; level userLevel already saved */ - level = userLevel+1; - } else { /* user's image is *not* nice power-of-2 sized square */ - memreq = image_size(newwidth, newheight, format, type); - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memreq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memreq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memreq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memreq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); - break; - default: - return GLU_INVALID_ENUM; - } - - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - - switch(type) { - case GL_UNSIGNED_BYTE: - scale_internal_ubyte(cmpts, width, height, - (const GLubyte *)usersImage, newwidth, newheight, - (GLubyte *)dstImage, element_size, - rowsize, group_size); - break; - case GL_BYTE: - scale_internal_byte(cmpts, width, height, - (const GLbyte *)usersImage, newwidth, newheight, - (GLbyte *)dstImage, element_size, - rowsize, group_size); - break; - case GL_UNSIGNED_SHORT: - scale_internal_ushort(cmpts, width, height, - (const GLushort *)usersImage, newwidth, newheight, - (GLushort *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_SHORT: - scale_internal_short(cmpts, width, height, - (const GLshort *)usersImage, newwidth, newheight, - (GLshort *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_INT: - scale_internal_uint(cmpts, width, height, - (const GLuint *)usersImage, newwidth, newheight, - (GLuint *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_INT: - scale_internal_int(cmpts, width, height, - (const GLint *)usersImage, newwidth, newheight, - (GLint *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_FLOAT: - scale_internal_float(cmpts, width, height, - (const GLfloat *)usersImage, newwidth, newheight, - (GLfloat *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_BYTE_3_3_2: - scaleInternalPackedPixel(3,extract332,shove332, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - scaleInternalPackedPixel(3,extract233rev,shove233rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5: - scaleInternalPackedPixel(3,extract565,shove565, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - scaleInternalPackedPixel(3,extract565rev,shove565rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - scaleInternalPackedPixel(4,extract4444,shove4444, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - scaleInternalPackedPixel(4,extract4444rev,shove4444rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - scaleInternalPackedPixel(4,extract5551,shove5551, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - scaleInternalPackedPixel(4,extract1555rev,shove1555rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: - scaleInternalPackedPixel(4,extract8888,shove8888, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - scaleInternalPackedPixel(4,extract8888rev,shove8888rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: - scaleInternalPackedPixel(4,extract1010102,shove1010102, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev, - width, height,usersImage, - newwidth,newheight,(void *)dstImage, - element_size,rowsize,myswap_bytes); - break; - default: - assert(0); - break; - } - myswap_bytes = 0; - rowsize = newwidth * group_size; - /* Swap dstImage and srcImage */ - __GLU_SWAP_IMAGE(srcImage,dstImage); - - if(levels != 0) { /* use as little memory as possible */ - { - int nextWidth= newwidth/2; - int nextHeight= newheight/2; - if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - - memreq = image_size(nextWidth, nextHeight, format, type); - } - - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memreq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memreq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memreq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memreq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); - break; - default: - return GLU_INVALID_ENUM; - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - } - /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; - } - - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, - format, type, (void *)srcImage); - } - - level++; /* update current level for the loop */ - for (; level <= levels; level++) { - switch(type) { - case GL_UNSIGNED_BYTE: - halveImage_ubyte(cmpts, newwidth, newheight, - (GLubyte *)srcImage, (GLubyte *)dstImage, element_size, - rowsize, group_size); - break; - case GL_BYTE: - halveImage_byte(cmpts, newwidth, newheight, - (GLbyte *)srcImage, (GLbyte *)dstImage, element_size, - rowsize, group_size); - break; - case GL_UNSIGNED_SHORT: - halveImage_ushort(cmpts, newwidth, newheight, - (GLushort *)srcImage, (GLushort *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_SHORT: - halveImage_short(cmpts, newwidth, newheight, - (GLshort *)srcImage, (GLshort *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_INT: - halveImage_uint(cmpts, newwidth, newheight, - (GLuint *)srcImage, (GLuint *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_INT: - halveImage_int(cmpts, newwidth, newheight, - (GLint *)srcImage, (GLint *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_FLOAT: - halveImage_float(cmpts, newwidth, newheight, - (GLfloat *)srcImage, (GLfloat *)dstImage, element_size, - rowsize, group_size, myswap_bytes); - break; - case GL_UNSIGNED_BYTE_3_3_2: - halveImagePackedPixel(3,extract332,shove332, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - halveImagePackedPixel(3,extract233rev,shove233rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5: - halveImagePackedPixel(3,extract565,shove565, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - halveImagePackedPixel(3,extract565rev,shove565rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - halveImagePackedPixel(4,extract4444,shove4444, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - halveImagePackedPixel(4,extract4444rev,shove4444rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - halveImagePackedPixel(4,extract5551,shove5551, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - halveImagePackedPixel(4,extract1555rev,shove1555rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: - halveImagePackedPixel(4,extract8888,shove8888, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - halveImagePackedPixel(4,extract8888rev,shove8888rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: - halveImagePackedPixel(4,extract1010102,shove1010102, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - halveImagePackedPixel(4,extract2101010rev,shove2101010rev, - newwidth,newheight, - srcImage,dstImage,element_size,rowsize, - myswap_bytes); - break; - default: - assert(0); - break; - } - - __GLU_SWAP_IMAGE(srcImage,dstImage); - - if (newwidth > 1) { newwidth /= 2; rowsize /= 2;} - if (newheight > 1) newheight /= 2; - { - /* compute amount to pad per row, if any */ - int rowPad= rowsize % psm.unpack_alignment; - - /* should row be padded? */ - if (rowPad == 0) { /* nope, row should not be padded */ - /* call tex image with srcImage untouched since it's not padded */ - if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, - format, type, (void *) srcImage); - } - } - else { /* yes, row should be padded */ - /* compute length of new row in bytes, including padding */ - int newRowLength= rowsize + psm.unpack_alignment - rowPad; - int ii; unsigned char *dstTrav, *srcTrav; /* indices for copying */ - - /* allocate new image for mipmap of size newRowLength x newheight */ - void *newMipmapImage= malloc((size_t) (newRowLength*newheight)); - if (newMipmapImage == NULL) { - /* out of memory so return */ - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - - /* copy image from srcImage into newMipmapImage by rows */ - for (ii= 0, - dstTrav= (unsigned char *) newMipmapImage, - srcTrav= (unsigned char *) srcImage; - ii< newheight; - ii++, - dstTrav+= newRowLength, /* make sure the correct distance... */ - srcTrav+= rowsize) { /* ...is skipped */ - memcpy(dstTrav,srcTrav,rowsize); - /* note that the pad bytes are not visited and will contain - * garbage, which is ok. - */ - } - - /* ...and use this new image for mipmapping instead */ - if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, - format, type, newMipmapImage); - } - free(newMipmapImage); /* don't forget to free it! */ - } /* else */ - } - } /* for level */ - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - - free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/ - if (dstImage) { /* if it's non-rectangular and only 1 level */ - free(dstImage); - } - return 0; -} /* gluBuild2DMipmapLevelsCore() */ - -GLint GLAPIENTRY -gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint userLevel, GLint baseLevel, GLint maxLevel, - const void *data) -{ - int level, levels; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1 || height < 1) { - return GLU_INVALID_VALUE; - } - - levels = computeLog(width); - level = computeLog(height); - if (level > levels) levels=level; - - levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) - return GLU_INVALID_VALUE; - - return gluBuild2DMipmapLevelsCore(target, internalFormat, - width, height, - width, height, - format, type, - userLevel, baseLevel, maxLevel, - data); -} /* gluBuild2DMipmapLevels() */ - -GLint GLAPIENTRY -gluBuild2DMipmaps(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const void *data) -{ - GLint widthPowerOf2, heightPowerOf2; - int level, levels; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1 || height < 1) { - return GLU_INVALID_VALUE; - } - - closestFit(target,width,height,internalFormat,format,type, - &widthPowerOf2,&heightPowerOf2); - - levels = computeLog(widthPowerOf2); - level = computeLog(heightPowerOf2); - if (level > levels) levels=level; - - return gluBuild2DMipmapLevelsCore(target,internalFormat, - width, height, - widthPowerOf2,heightPowerOf2, - format,type, - 0,0,levels,data); -} /* gluBuild2DMipmaps() */ - -#if 0 -/* -** This routine is for the limited case in which -** type == GL_UNSIGNED_BYTE && format != index && -** unpack_alignment = 1 && unpack_swap_bytes == false -** -** so all of the work data can be kept as ubytes instead of shorts. -*/ -static int fastBuild2DMipmaps(const PixelStorageModes *psm, - GLenum target, GLint components, GLint width, - GLint height, GLenum format, - GLenum type, void *data) -{ - GLint newwidth, newheight; - GLint level, levels; - GLubyte *newImage; - GLint newImage_width; - GLint newImage_height; - GLubyte *otherImage; - GLubyte *imageTemp; - GLint memreq; - GLint cmpts; - - -#if 0 - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); - newwidth = nearestPower(width); - if (newwidth > maxsize) newwidth = maxsize; - newheight = nearestPower(height); - if (newheight > maxsize) newheight = maxsize; -#else - closestFit(target,width,height,components,format,type, - &newwidth,&newheight); -#endif - levels = computeLog(newwidth); - level = computeLog(newheight); - if (level > levels) levels=level; - - cmpts = elements_per_group(format,type); - - otherImage = NULL; - /** - ** No need to copy the user data if its in the packed correctly. - ** Make sure that later routines don't change that data. - */ - if (psm->unpack_skip_rows == 0 && psm->unpack_skip_pixels == 0) { - newImage = (GLubyte *)data; - newImage_width = width; - newImage_height = height; - } else { - GLint rowsize; - GLint groups_per_line; - GLint elements_per_line; - const GLubyte *start; - const GLubyte *iter; - GLubyte *iter2; - GLint i, j; - - newImage = (GLubyte *) - malloc(image_size(width, height, format, GL_UNSIGNED_BYTE)); - newImage_width = width; - newImage_height = height; - if (newImage == NULL) { - return GLU_OUT_OF_MEMORY; - } - - /* - ** Abbreviated version of fill_image for this restricted case. - */ - if (psm->unpack_row_length > 0) { - groups_per_line = psm->unpack_row_length; - } else { - groups_per_line = width; - } - rowsize = groups_per_line * cmpts; - elements_per_line = width * cmpts; - start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize + - psm->unpack_skip_pixels * cmpts; - iter2 = newImage; - - for (i = 0; i < height; i++) { - iter = start; - for (j = 0; j < elements_per_line; j++) { - *iter2 = *iter; - iter++; - iter2++; - } - start += rowsize; - } - } - - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - - for (level = 0; level <= levels; level++) { - if (newImage_width == newwidth && newImage_height == newheight) { - /* Use newImage for this level */ - glTexImage2D(target, level, components, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_BYTE, - (void *) newImage); - } else { - if (otherImage == NULL) { - memreq = - image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE); - otherImage = (GLubyte *) malloc(memreq); - if (otherImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH,psm->unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES,psm->unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - } -/* - scale_internal_ubyte(cmpts, newImage_width, newImage_height, - newImage, newwidth, newheight, otherImage); -*/ - /* Swap newImage and otherImage */ - imageTemp = otherImage; - otherImage = newImage; - newImage = imageTemp; - - newImage_width = newwidth; - newImage_height = newheight; - glTexImage2D(target, level, components, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_BYTE, - (void *) newImage); - } - if (newwidth > 1) newwidth /= 2; - if (newheight > 1) newheight /= 2; - } - glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm->unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm->unpack_swap_bytes); - - if (newImage != (const GLubyte *)data) { - free((GLbyte *) newImage); - } - if (otherImage && otherImage != (const GLubyte *)data) { - free((GLbyte *) otherImage); - } - return 0; -} -#endif - -/* - * Utility Routines - */ -static GLint elements_per_group(GLenum format, GLenum type) -{ - /* - * Return the number of elements per group of a specified format - */ - - /* If the type is packedpixels then answer is 1 (ignore format) */ - if (type == GL_UNSIGNED_BYTE_3_3_2 || - type == GL_UNSIGNED_BYTE_2_3_3_REV || - type == GL_UNSIGNED_SHORT_5_6_5 || - type == GL_UNSIGNED_SHORT_5_6_5_REV || - type == GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL_UNSIGNED_INT_8_8_8_8 || - type == GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL_UNSIGNED_INT_10_10_10_2 || - type == GL_UNSIGNED_INT_2_10_10_10_REV) { - return 1; - } - - /* Types are not packed pixels, so get elements per group */ - switch(format) { - case GL_RGB: - case GL_BGR: - return 3; - case GL_LUMINANCE_ALPHA: - return 2; - case GL_RGBA: - case GL_BGRA: - return 4; - default: - return 1; - } -} - -static GLfloat bytes_per_element(GLenum type) -{ - /* - * Return the number of bytes per element, based on the element type - */ - switch(type) { - case GL_BITMAP: - return 1.0 / 8.0; - case GL_UNSIGNED_SHORT: - return(sizeof(GLushort)); - case GL_SHORT: - return(sizeof(GLshort)); - case GL_UNSIGNED_BYTE: - return(sizeof(GLubyte)); - case GL_BYTE: - return(sizeof(GLbyte)); - case GL_INT: - return(sizeof(GLint)); - case GL_UNSIGNED_INT: - return(sizeof(GLuint)); - case GL_FLOAT: - return(sizeof(GLfloat)); - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - return(sizeof(GLubyte)); - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return(sizeof(GLushort)); - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return(sizeof(GLuint)); - default: - return 4; - } -} - -static GLint is_index(GLenum format) -{ - return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX; -} - -/* -** Compute memory required for internal packed array of data of given type -** and format. -*/ -static GLint image_size(GLint width, GLint height, GLenum format, GLenum type) -{ - int bytes_per_row; - int components; - -assert(width > 0); -assert(height > 0); - components = elements_per_group(format,type); - if (type == GL_BITMAP) { - bytes_per_row = (width + 7) / 8; - } else { - bytes_per_row = bytes_per_element(type) * width; - } - return bytes_per_row * height * components; -} - -/* -** Extract array from user's data applying all pixel store modes. -** The internal format used is an array of unsigned shorts. -*/ -static void fill_image(const PixelStorageModes *psm, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, - const void *userdata, GLushort *newimage) -{ - GLint components; - GLint element_size; - GLint rowsize; - GLint padding; - GLint groups_per_line; - GLint group_size; - GLint elements_per_line; - const GLubyte *start; - const GLubyte *iter; - GLushort *iter2; - GLint i, j, k; - GLint myswap_bytes; - - myswap_bytes = psm->unpack_swap_bytes; - components = elements_per_group(format,type); - if (psm->unpack_row_length > 0) { - groups_per_line = psm->unpack_row_length; - } else { - groups_per_line = width; - } - - /* All formats except GL_BITMAP fall out trivially */ - if (type == GL_BITMAP) { - GLint bit_offset; - GLint current_bit; - - rowsize = (groups_per_line * components + 7) / 8; - padding = (rowsize % psm->unpack_alignment); - if (padding) { - rowsize += psm->unpack_alignment - padding; - } - start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + - (psm->unpack_skip_pixels * components / 8); - elements_per_line = width * components; - iter2 = newimage; - for (i = 0; i < height; i++) { - iter = start; - bit_offset = (psm->unpack_skip_pixels * components) % 8; - for (j = 0; j < elements_per_line; j++) { - /* Retrieve bit */ - if (psm->unpack_lsb_first) { - current_bit = iter[0] & (1 << bit_offset); - } else { - current_bit = iter[0] & (1 << (7 - bit_offset)); - } - if (current_bit) { - if (index_format) { - *iter2 = 1; - } else { - *iter2 = 65535; - } - } else { - *iter2 = 0; - } - bit_offset++; - if (bit_offset == 8) { - bit_offset = 0; - iter++; - } - iter2++; - } - start += rowsize; - } - } else { - element_size = bytes_per_element(type); - group_size = element_size * components; - if (element_size == 1) myswap_bytes = 0; - - rowsize = groups_per_line * group_size; - padding = (rowsize % psm->unpack_alignment); - if (padding) { - rowsize += psm->unpack_alignment - padding; - } - start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + - psm->unpack_skip_pixels * group_size; - elements_per_line = width * components; - - iter2 = newimage; - for (i = 0; i < height; i++) { - iter = start; - for (j = 0; j < elements_per_line; j++) { - Type_Widget widget; - float extractComponents[4]; - - switch(type) { - case GL_UNSIGNED_BYTE_3_3_2: - extract332(0,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - extract233rev(0,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_BYTE: - if (index_format) { - *iter2++ = *iter; - } else { - *iter2++ = (*iter) * 257; - } - break; - case GL_BYTE: - if (index_format) { - *iter2++ = *((const GLbyte *) iter); - } else { - /* rough approx */ - *iter2++ = (*((const GLbyte *) iter)) * 516; - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - extract565(myswap_bytes,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - extract565rev(myswap_bytes,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - extract4444(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - extract4444rev(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - extract5551(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - extract1555rev(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT: - case GL_SHORT: - if (myswap_bytes) { - widget.ub[0] = iter[1]; - widget.ub[1] = iter[0]; - } else { - widget.ub[0] = iter[0]; - widget.ub[1] = iter[1]; - } - if (type == GL_SHORT) { - if (index_format) { - *iter2++ = widget.s[0]; - } else { - /* rough approx */ - *iter2++ = widget.s[0]*2; - } - } else { - *iter2++ = widget.us[0]; - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - extract8888(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - extract8888rev(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - extract1010102(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - extract2101010rev(myswap_bytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - if (myswap_bytes) { - widget.ub[0] = iter[3]; - widget.ub[1] = iter[2]; - widget.ub[2] = iter[1]; - widget.ub[3] = iter[0]; - } else { - widget.ub[0] = iter[0]; - widget.ub[1] = iter[1]; - widget.ub[2] = iter[2]; - widget.ub[3] = iter[3]; - } - if (type == GL_FLOAT) { - if (index_format) { - *iter2++ = widget.f; - } else { - *iter2++ = 65535 * widget.f; - } - } else if (type == GL_UNSIGNED_INT) { - if (index_format) { - *iter2++ = widget.ui; - } else { - *iter2++ = widget.ui >> 16; - } - } else { - if (index_format) { - *iter2++ = widget.i; - } else { - *iter2++ = widget.i >> 15; - } - } - break; - } - iter += element_size; - } /* for j */ - start += rowsize; -#if 1 - /* want 'iter' pointing at start, not within, row for assertion - * purposes - */ - iter= start; -#endif - } /* for i */ - - /* iterators should be one byte past end */ - if (!isTypePackedPixel(type)) { - assert(iter2 == &newimage[width*height*components]); - } - else { - assert(iter2 == &newimage[width*height* - elements_per_group(format,0)]); - } - assert( iter == &((const GLubyte *)userdata)[rowsize*height + - psm->unpack_skip_rows * rowsize + - psm->unpack_skip_pixels * group_size] ); - - } /* else */ -} /* fill_image() */ - -/* -** Insert array into user's data applying all pixel store modes. -** The internal format is an array of unsigned shorts. -** empty_image() because it is the opposite of fill_image(). -*/ -static void empty_image(const PixelStorageModes *psm, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, - const GLushort *oldimage, void *userdata) -{ - GLint components; - GLint element_size; - GLint rowsize; - GLint padding; - GLint groups_per_line; - GLint group_size; - GLint elements_per_line; - GLubyte *start; - GLubyte *iter; - const GLushort *iter2; - GLint i, j, k; - GLint myswap_bytes; - - myswap_bytes = psm->pack_swap_bytes; - components = elements_per_group(format,type); - if (psm->pack_row_length > 0) { - groups_per_line = psm->pack_row_length; - } else { - groups_per_line = width; - } - - /* All formats except GL_BITMAP fall out trivially */ - if (type == GL_BITMAP) { - GLint bit_offset; - GLint current_bit; - - rowsize = (groups_per_line * components + 7) / 8; - padding = (rowsize % psm->pack_alignment); - if (padding) { - rowsize += psm->pack_alignment - padding; - } - start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + - (psm->pack_skip_pixels * components / 8); - elements_per_line = width * components; - iter2 = oldimage; - for (i = 0; i < height; i++) { - iter = start; - bit_offset = (psm->pack_skip_pixels * components) % 8; - for (j = 0; j < elements_per_line; j++) { - if (index_format) { - current_bit = iter2[0] & 1; - } else { - if (iter2[0] > 32767) { - current_bit = 1; - } else { - current_bit = 0; - } - } - - if (current_bit) { - if (psm->pack_lsb_first) { - *iter |= (1 << bit_offset); - } else { - *iter |= (1 << (7 - bit_offset)); - } - } else { - if (psm->pack_lsb_first) { - *iter &= ~(1 << bit_offset); - } else { - *iter &= ~(1 << (7 - bit_offset)); - } - } - - bit_offset++; - if (bit_offset == 8) { - bit_offset = 0; - iter++; - } - iter2++; - } - start += rowsize; - } - } else { - float shoveComponents[4]; - - element_size = bytes_per_element(type); - group_size = element_size * components; - if (element_size == 1) myswap_bytes = 0; - - rowsize = groups_per_line * group_size; - padding = (rowsize % psm->pack_alignment); - if (padding) { - rowsize += psm->pack_alignment - padding; - } - start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + - psm->pack_skip_pixels * group_size; - elements_per_line = width * components; - - iter2 = oldimage; - for (i = 0; i < height; i++) { - iter = start; - for (j = 0; j < elements_per_line; j++) { - Type_Widget widget; - - switch(type) { - case GL_UNSIGNED_BYTE_3_3_2: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove332(shoveComponents,0,(void *)iter); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove233rev(shoveComponents,0,(void *)iter); - break; - case GL_UNSIGNED_BYTE: - if (index_format) { - *iter = *iter2++; - } else { - *iter = *iter2++ >> 8; - } - break; - case GL_BYTE: - if (index_format) { - *((GLbyte *) iter) = *iter2++; - } else { - *((GLbyte *) iter) = *iter2++ >> 9; - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove565(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } - else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove565rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } - else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove4444(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove4444rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove5551(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove1555rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT: - case GL_SHORT: - if (type == GL_SHORT) { - if (index_format) { - widget.s[0] = *iter2++; - } else { - widget.s[0] = *iter2++ >> 1; - } - } else { - widget.us[0] = *iter2++; - } - if (myswap_bytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - iter[0] = widget.ub[0]; - iter[1] = widget.ub[1]; - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove8888(shoveComponents,0,(void *)&widget.ui); - if (myswap_bytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove8888rev(shoveComponents,0,(void *)&widget.ui); - if (myswap_bytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove1010102(shoveComponents,0,(void *)&widget.ui); - if (myswap_bytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove2101010rev(shoveComponents,0,(void *)&widget.ui); - if (myswap_bytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - if (type == GL_FLOAT) { - if (index_format) { - widget.f = *iter2++; - } else { - widget.f = *iter2++ / (float) 65535.0; - } - } else if (type == GL_UNSIGNED_INT) { - if (index_format) { - widget.ui = *iter2++; - } else { - widget.ui = (unsigned int) *iter2++ * 65537; - } - } else { - if (index_format) { - widget.i = *iter2++; - } else { - widget.i = ((unsigned int) *iter2++ * 65537)/2; - } - } - if (myswap_bytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - iter[0] = widget.ub[0]; - iter[1] = widget.ub[1]; - iter[2] = widget.ub[2]; - iter[3] = widget.ub[3]; - } - break; - } - iter += element_size; - } /* for j */ - start += rowsize; -#if 1 - /* want 'iter' pointing at start, not within, row for assertion - * purposes - */ - iter= start; -#endif - } /* for i */ - - /* iterators should be one byte past end */ - if (!isTypePackedPixel(type)) { - assert(iter2 == &oldimage[width*height*components]); - } - else { - assert(iter2 == &oldimage[width*height* - elements_per_group(format,0)]); - } - assert( iter == &((GLubyte *)userdata)[rowsize*height + - psm->pack_skip_rows * rowsize + - psm->pack_skip_pixels * group_size] ); - - } /* else */ -} /* empty_image() */ - -/*-------------------------------------------------------------------------- - * Decimation of packed pixel types - *-------------------------------------------------------------------------- - */ -static void extract332(int isSwap, - const void *packedPixel, GLfloat extractComponents[]) -{ - GLubyte ubyte= *(const GLubyte *)packedPixel; - - isSwap= isSwap; /* turn off warnings */ - - /* 11100000 == 0xe0 */ - /* 00011100 == 0x1c */ - /* 00000011 == 0x03 */ - - extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0; - extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */ - extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */ -} /* extract332() */ - -static void shove332(const GLfloat shoveComponents[], - int index, void *packedPixel) -{ - /* 11100000 == 0xe0 */ - /* 00011100 == 0x1c */ - /* 00000011 == 0x03 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLubyte *)packedPixel)[index] = - ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0; - ((GLubyte *)packedPixel)[index] |= - ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c; - ((GLubyte *)packedPixel)[index] |= - ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03; -} /* shove332() */ - -static void extract233rev(int isSwap, - const void *packedPixel, GLfloat extractComponents[]) -{ - GLubyte ubyte= *(const GLubyte *)packedPixel; - - isSwap= isSwap; /* turn off warnings */ - - /* 0000,0111 == 0x07 */ - /* 0011,1000 == 0x38 */ - /* 1100,0000 == 0xC0 */ - - extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0; - extractComponents[1]= (float)((ubyte & 0x38) >> 3) / 7.0; - extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0; -} /* extract233rev() */ - -static void shove233rev(const GLfloat shoveComponents[], - int index, void *packedPixel) -{ - /* 0000,0111 == 0x07 */ - /* 0011,1000 == 0x38 */ - /* 1100,0000 == 0xC0 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLubyte *)packedPixel)[index] = - ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07; - ((GLubyte *)packedPixel)[index]|= - ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38; - ((GLubyte *)packedPixel)[index]|= - ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0; -} /* shove233rev() */ - -static void extract565(int isSwap, - const void *packedPixel, GLfloat extractComponents[]) -{ - GLushort ushort= *(const GLushort *)packedPixel; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11100000 == 0x07e0 */ - /* 00000000,00011111 == 0x001f */ - - extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/ - extractComponents[1]=(float)((ushort & 0x07e0) >> 5) / 63.0;/* 63 = 2^6-1*/ - extractComponents[2]=(float)((ushort & 0x001f) ) / 31.0; -} /* extract565() */ - -static void shove565(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11100000 == 0x07e0 */ - /* 00000000,00011111 == 0x001f */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f; -} /* shove565() */ - -static void extract565rev(int isSwap, - const void *packedPixel, GLfloat extractComponents[]) -{ - GLushort ushort= *(const GLushort *)packedPixel; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 00000000,00011111 == 0x001f */ - /* 00000111,11100000 == 0x07e0 */ - /* 11111000,00000000 == 0xf800 */ - - extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; - extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0; - extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0; -} /* extract565rev() */ - -static void shove565rev(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 00000000,00011111 == 0x001f */ - /* 00000111,11100000 == 0x07e0 */ - /* 11111000,00000000 == 0xf800 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800; -} /* shove565rev() */ - -static void extract4444(int isSwap,const void *packedPixel, - GLfloat extractComponents[]) -{ - GLushort ushort; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 11110000,00000000 == 0xf000 */ - /* 00001111,00000000 == 0x0f00 */ - /* 00000000,11110000 == 0x00f0 */ - /* 00000000,00001111 == 0x000f */ - - extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */ - extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0; - extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0; - extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0; -} /* extract4444() */ - -static void shove4444(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f; -} /* shove4444() */ - -static void extract4444rev(int isSwap,const void *packedPixel, - GLfloat extractComponents[]) -{ - GLushort ushort; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 00000000,00001111 == 0x000f */ - /* 00000000,11110000 == 0x00f0 */ - /* 00001111,00000000 == 0x0f00 */ - /* 11110000,00000000 == 0xf000 */ - - /* 15 = 2^4-1 */ - extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0; - extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0; - extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0; - extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0; -} /* extract4444rev() */ - -static void shove4444rev(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 00000000,00001111 == 0x000f */ - /* 00000000,11110000 == 0x00f0 */ - /* 00001111,00000000 == 0x0f00 */ - /* 11110000,00000000 == 0xf000 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000; -} /* shove4444rev() */ - -static void extract5551(int isSwap,const void *packedPixel, - GLfloat extractComponents[]) -{ - GLushort ushort; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11000000 == 0x07c0 */ - /* 00000000,00111110 == 0x003e */ - /* 00000000,00000001 == 0x0001 */ - - extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/ - extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0; - extractComponents[2]=(float)((ushort & 0x003e) >> 1) / 31.0; - extractComponents[3]=(float)((ushort & 0x0001) ); -} /* extract5551() */ - -static void shove5551(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11000000 == 0x07c0 */ - /* 00000000,00111110 == 0x003e */ - /* 00000000,00000001 == 0x0001 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001; -} /* shove5551() */ - -static void extract1555rev(int isSwap,const void *packedPixel, - GLfloat extractComponents[]) -{ - GLushort ushort; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(packedPixel); - } - else { - ushort= *(const GLushort *)packedPixel; - } - - /* 00000000,00011111 == 0x001F */ - /* 00000011,11100000 == 0x03E0 */ - /* 01111100,00000000 == 0x7C00 */ - /* 10000000,00000000 == 0x8000 */ - - /* 31 = 2^5-1 */ - extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; - extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0; - extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0; - extractComponents[3]= (float)((ushort & 0x8000) >> 15); -} /* extract1555rev() */ - -static void shove1555rev(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 00000000,00011111 == 0x001F */ - /* 00000011,11100000 == 0x03E0 */ - /* 01111100,00000000 == 0x7C00 */ - /* 10000000,00000000 == 0x8000 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = - ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000; -} /* shove1555rev() */ - -static void extract8888(int isSwap, - const void *packedPixel, GLfloat extractComponents[]) -{ - GLuint uint; - - if (isSwap) { - uint= __GLU_SWAP_4_BYTES(packedPixel); - } - else { - uint= *(const GLuint *)packedPixel; - } - - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - - /* 255 = 2^8-1 */ - extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0; - extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0; - extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0; - extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0; -} /* extract8888() */ - -static void shove8888(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = - ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff; -} /* shove8888() */ - -static void extract8888rev(int isSwap, - const void *packedPixel,GLfloat extractComponents[]) -{ - GLuint uint; - - if (isSwap) { - uint= __GLU_SWAP_4_BYTES(packedPixel); - } - else { - uint= *(const GLuint *)packedPixel; - } - - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - - /* 255 = 2^8-1 */ - extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0; - extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0; - extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0; - extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0; -} /* extract8888rev() */ - -static void shove8888rev(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = - ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000; -} /* shove8888rev() */ - -static void extract1010102(int isSwap, - const void *packedPixel,GLfloat extractComponents[]) -{ - GLuint uint; - - if (isSwap) { - uint= __GLU_SWAP_4_BYTES(packedPixel); - } - else { - uint= *(const GLuint *)packedPixel; - } - - /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ - /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ - /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ - /* 00000000,00000000,00000000,00000011 == 0x00000003 */ - - /* 1023 = 2^10-1 */ - extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0; - extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0; - extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0; - extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0; -} /* extract1010102() */ - -static void shove1010102(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ - /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ - /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ - /* 00000000,00000000,00000000,00000011 == 0x00000003 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = - ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003; -} /* shove1010102() */ - -static void extract2101010rev(int isSwap, - const void *packedPixel, - GLfloat extractComponents[]) -{ - GLuint uint; - - if (isSwap) { - uint= __GLU_SWAP_4_BYTES(packedPixel); - } - else { - uint= *(const GLuint *)packedPixel; - } - - /* 00000000,00000000,00000011,11111111 == 0x000003FF */ - /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ - /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ - /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ - - /* 1023 = 2^10-1 */ - extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0; - extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0; - extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0; - extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0; - /* 3 = 2^2-1 */ -} /* extract2101010rev() */ - -static void shove2101010rev(const GLfloat shoveComponents[], - int index,void *packedPixel) -{ - /* 00000000,00000000,00000011,11111111 == 0x000003FF */ - /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ - /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ - /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ - - assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); - assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); - assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); - assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); - - /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = - ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000; -} /* shove2101010rev() */ - -static void scaleInternalPackedPixel(int components, - void (*extractPackedPixel) - (int, const void *,GLfloat []), - void (*shovePackedPixel) - (const GLfloat [], int, void *), - GLint widthIn,GLint heightIn, - const void *dataIn, - GLint widthOut,GLint heightOut, - void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes,GLint isSwap) -{ - float convx; - float convy; - float percent; - - /* Max components in a format is 4, so... */ - float totals[4]; - float extractTotals[4], extractMoreTotals[4], shoveTotals[4]; - - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - if (widthIn == widthOut*2 && heightIn == heightOut*2) { - halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel, - widthIn, heightIn, dataIn, dataOut, - pixelSizeInBytes,rowSizeInBytes,isSwap); - return; - } - convy = (float) heightIn/heightOut; - convx = (float) widthIn/widthOut; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; - - area = convx * convy; - - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; - - for (i = 0; i < heightOut; i++) { - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthOut; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*pixelSizeInBytes; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; - percent = y_percent * (1-lowx_float); -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += pixelSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * y_percent; - } -#endif - } - temp += pixelSizeInBytes; - right = temp; - percent = y_percent * highx_float; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - - /* calculate the value for pixels in the last row */ - - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - for(l = lowx_int+1; l < highx_int; l++) { - temp += pixelSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * y_percent; - } -#endif - - } - temp += pixelSizeInBytes; - percent = y_percent * highx_float; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += rowSizeInBytes; - right += rowSizeInBytes; -#if 0 - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + - __GLU_SWAP_2_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLushort*)left * (1-lowx_float) - + *(const GLushort*)right * highx_float; - } - } -#else - (*extractPackedPixel)(isSwap,left,extractTotals); - (*extractPackedPixel)(isSwap,right,extractMoreTotals); - for (k = 0; k < components; k++) { - totals[k]+= (extractTotals[k]*(1-lowx_float) + - extractMoreTotals[k]*highx_float); - } -#endif - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - for(m = lowy_int+1; m < highy_int; m++) { - temp += rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLushort*)temp_index * x_percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * x_percent; - } -#endif - } - percent = x_percent * highy_float; - temp += rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - for (l = lowx_int+1; l < highx_int; l++) { - temp += pixelSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * y_percent; - } -#endif - } - temp += pixelSizeInBytes; - percent = y_percent * highx_float; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k] * percent; - } -#endif - } - - /* this is for the pixels in the body */ - temp0 = (const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { -#if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index); - } else { - totals[k] += *(const GLushort*)temp_index; - } - } -#else - (*extractPackedPixel)(isSwap,temp,extractTotals); - for (k = 0; k < components; k++) { - totals[k]+= extractTotals[k]; - } -#endif - temp += pixelSizeInBytes; - } - temp0 += rowSizeInBytes; - } - - outindex = (j + (i * widthOut)); /* * (components == 1) */ -#if 0 - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } -#else - for (k = 0; k < components; k++) { - shoveTotals[k]= totals[k]/area; - } - (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut); -#endif - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } - - assert(outindex == (widthOut*heightOut - 1)); -} /* scaleInternalPackedPixel() */ - -/* rowSizeInBytes is at least the width (in bytes) due to padding on - * inputs; not always equal. Output NEVER has row padding. - */ -static void halveImagePackedPixel(int components, - void (*extractPackedPixel) - (int, const void *,GLfloat []), - void (*shovePackedPixel) - (const GLfloat [],int, void *), - GLint width, GLint height, - const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, GLint isSwap) -{ - /* handle case where there is only 1 column/row */ - if (width == 1 || height == 1) { - assert(!(width == 1 && height == 1)); /* can't be 1x1 */ - halve1DimagePackedPixel(components,extractPackedPixel,shovePackedPixel, - width,height,dataIn,dataOut,pixelSizeInBytes, - rowSizeInBytes,isSwap); - return; - } - - { - int ii, jj; - - int halfWidth= width / 2; - int halfHeight= height / 2; - const char *src= (const char *) dataIn; - int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); - int outIndex= 0; - - for (ii= 0; ii< halfHeight; ii++) { - for (jj= 0; jj< halfWidth; jj++) { -#define BOX4 4 - float totals[4]; /* 4 is maximum components */ - float extractTotals[BOX4][4]; /* 4 is maximum components */ - int cc; - - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); - (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[2][0]); - (*extractPackedPixel)(isSwap, - (src+rowSizeInBytes+pixelSizeInBytes), - &extractTotals[3][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 4 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; - * totals[RED]/= 4.0; - */ - for (kk = 0; kk < BOX4; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX4; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - /* skip over to next square of 4 */ - src+= pixelSizeInBytes + pixelSizeInBytes; - } - /* skip past pad bytes, if any, to get to next row */ - src+= padBytes; - - /* src is at beginning of a row here, but it's the second row of - * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... - */ - src+= rowSizeInBytes; - } - - /* both pointers must reach one byte after the end */ - assert(src == &((const char *)dataIn)[rowSizeInBytes*height]); - assert(outIndex == halfWidth * halfHeight); - } -} /* halveImagePackedPixel() */ - -static void halve1DimagePackedPixel(int components, - void (*extractPackedPixel) - (int, const void *,GLfloat []), - void (*shovePackedPixel) - (const GLfloat [],int, void *), - GLint width, GLint height, - const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, GLint isSwap) -{ - int halfWidth= width / 2; - int halfHeight= height / 2; - const char *src= (const char *) dataIn; - int jj; - - assert(width == 1 || height == 1); /* must be 1D */ - assert(width != height); /* can't be square */ - - if (height == 1) { /* 1 row */ - int outIndex= 0; - - assert(width != 1); /* widthxheight can't be 1x1 */ - halfHeight= 1; - - /* one horizontal row with possible pad bytes */ - - for (jj= 0; jj< halfWidth; jj++) { -#define BOX2 2 - float totals[4]; /* 4 is maximum components */ - float extractTotals[BOX2][4]; /* 4 is maximum components */ - int cc; - - /* average two at a time, instead of four */ - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 2 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; - * totals[RED]/= 2.0; - */ - for (kk = 0; kk < BOX2; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX2; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - /* skip over to next group of 2 */ - src+= pixelSizeInBytes + pixelSizeInBytes; - } - - { - int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); - src+= padBytes; /* for assertion only */ - } - assert(src == &((const char *)dataIn)[rowSizeInBytes]); - assert(outIndex == halfWidth * halfHeight); - } - else if (width == 1) { /* 1 column */ - int outIndex= 0; - - assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; - /* one vertical column with possible pad bytes per row */ - /* average two at a time */ - - for (jj= 0; jj< halfHeight; jj++) { -#define BOX2 2 - float totals[4]; /* 4 is maximum components */ - float extractTotals[BOX2][4]; /* 4 is maximum components */ - int cc; - - /* average two at a time, instead of four */ - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[1][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 2 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; - * totals[RED]/= 2.0; - */ - for (kk = 0; kk < BOX2; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX2; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - src+= rowSizeInBytes + rowSizeInBytes; /* go to row after next */ - } - - assert(src == &((const char *)dataIn)[rowSizeInBytes*height]); - assert(outIndex == halfWidth * halfHeight); - } -} /* halve1DimagePackedPixel() */ - -/*===========================================================================*/ - -#ifdef RESOLVE_3D_TEXTURE_SUPPORT -/* - * This section ensures that GLU 1.3 will load and run on - * a GL 1.1 implementation. It dynamically resolves the - * call to glTexImage3D() which might not be available. - * Or is it might be supported as an extension. - * Contributed by Gerk Huisma . - */ - -typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level, - GLenum internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -static TexImage3Dproc pTexImage3D = 0; - -#if !defined(_WIN32) && !defined(__WIN32__) -# include -# include -#else - WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR); -#endif - -static void gluTexImage3D( GLenum target, GLint level, - GLenum internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - if (!pTexImage3D) { -#if defined(_WIN32) || defined(__WIN32__) - pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D"); - if (!pTexImage3D) - pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT"); -#else - void *libHandle = dlopen("libgl.so", RTLD_LAZY); - pTexImage3D = TexImage3Dproc) dlsym(libHandle, "glTexImage3D" ); - if (!pTexImage3D) - pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT"); - dlclose(libHandle); -#endif - } - - /* Now call glTexImage3D */ - if (pTexImage3D) - pTexImage3D(target, level, internalFormat, width, height, - depth, border, format, type, pixels); -} - -#else - -/* Only bind to a GL 1.2 implementation: */ -#define gluTexImage3D glTexImage3D - -#endif - -static GLint imageSize3D(GLint width, GLint height, GLint depth, - GLenum format, GLenum type) -{ - int components= elements_per_group(format,type); - int bytes_per_row= bytes_per_element(type) * width; - -assert(width > 0 && height > 0 && depth > 0); -assert(type != GL_BITMAP); - - return bytes_per_row * height * depth * components; -} /* imageSize3D() */ - -static void fillImage3D(const PixelStorageModes *psm, - GLint width, GLint height, GLint depth, GLenum format, - GLenum type, GLboolean indexFormat, - const void *userImage, GLushort *newImage) -{ - int myswapBytes; - int components; - int groupsPerLine; - int elementSize; - int groupSize; - int rowSize; - int padding; - int elementsPerLine; - int rowsPerImage; - int imageSize; - const GLubyte *start, *rowStart, *iter; - GLushort *iter2; - int ww, hh, dd, k; - - myswapBytes= psm->unpack_swap_bytes; - components= elements_per_group(format,type); - if (psm->unpack_row_length > 0) { - groupsPerLine= psm->unpack_row_length; - } - else { - groupsPerLine= width; - } - elementSize= bytes_per_element(type); - groupSize= elementSize * components; - if (elementSize == 1) myswapBytes= 0; - - /* 3dstuff begin */ - if (psm->unpack_image_height > 0) { - rowsPerImage= psm->unpack_image_height; - } - else { - rowsPerImage= height; - } - /* 3dstuff end */ - - rowSize= groupsPerLine * groupSize; - padding= rowSize % psm->unpack_alignment; - if (padding) { - rowSize+= psm->unpack_alignment - padding; - } - - imageSize= rowsPerImage * rowSize; /* 3dstuff */ - - start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize + - psm->unpack_skip_pixels * groupSize + - /*3dstuff*/ - psm->unpack_skip_images * imageSize; - elementsPerLine = width * components; - - iter2= newImage; - for (dd= 0; dd < depth; dd++) { - rowStart= start; - - for (hh= 0; hh < height; hh++) { - iter= rowStart; - - for (ww= 0; ww < elementsPerLine; ww++) { - Type_Widget widget; - float extractComponents[4]; - - switch(type) { - case GL_UNSIGNED_BYTE: - if (indexFormat) { - *iter2++ = *iter; - } else { - *iter2++ = (*iter) * 257; - } - break; - case GL_BYTE: - if (indexFormat) { - *iter2++ = *((const GLbyte *) iter); - } else { - /* rough approx */ - *iter2++ = (*((const GLbyte *) iter)) * 516; - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - extract332(0,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - extract233rev(0,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - extract565(myswapBytes,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - extract565rev(myswapBytes,iter,extractComponents); - for (k = 0; k < 3; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - extract4444(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - extract4444rev(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - extract5551(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - extract1555rev(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_SHORT: - case GL_SHORT: - if (myswapBytes) { - widget.ub[0] = iter[1]; - widget.ub[1] = iter[0]; - } else { - widget.ub[0] = iter[0]; - widget.ub[1] = iter[1]; - } - if (type == GL_SHORT) { - if (indexFormat) { - *iter2++ = widget.s[0]; - } else { - /* rough approx */ - *iter2++ = widget.s[0]*2; - } - } else { - *iter2++ = widget.us[0]; - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - extract8888(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - extract8888rev(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - extract1010102(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - extract2101010rev(myswapBytes,iter,extractComponents); - for (k = 0; k < 4; k++) { - *iter2++ = (GLushort)(extractComponents[k]*65535); - } - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - if (myswapBytes) { - widget.ub[0] = iter[3]; - widget.ub[1] = iter[2]; - widget.ub[2] = iter[1]; - widget.ub[3] = iter[0]; - } else { - widget.ub[0] = iter[0]; - widget.ub[1] = iter[1]; - widget.ub[2] = iter[2]; - widget.ub[3] = iter[3]; - } - if (type == GL_FLOAT) { - if (indexFormat) { - *iter2++ = widget.f; - } else { - *iter2++ = 65535 * widget.f; - } - } else if (type == GL_UNSIGNED_INT) { - if (indexFormat) { - *iter2++ = widget.ui; - } else { - *iter2++ = widget.ui >> 16; - } - } else { - if (indexFormat) { - *iter2++ = widget.i; - } else { - *iter2++ = widget.i >> 15; - } - } - break; - default: - assert(0); - } - - iter+= elementSize; - } /* for ww */ - rowStart+= rowSize; - - iter= rowStart; /* for assertion purposes */ - } /* for hh */ - - start+= imageSize; - } /* for dd */ - - /* iterators should be one byte past end */ - if (!isTypePackedPixel(type)) { - assert(iter2 == &newImage[width*height*depth*components]); - } - else { - assert(iter2 == &newImage[width*height*depth* - elements_per_group(format,0)]); - } - assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth + - psm->unpack_skip_rows * rowSize + - psm->unpack_skip_pixels * groupSize + - /*3dstuff*/ - psm->unpack_skip_images * imageSize] ); -} /* fillImage3D () */ - -static void scaleInternal3D(GLint components, - GLint widthIn, GLint heightIn, GLint depthIn, - const GLushort *dataIn, - GLint widthOut, GLint heightOut, GLint depthOut, - GLushort *dataOut) -{ - float x, lowx, highx, convx, halfconvx; - float y, lowy, highy, convy, halfconvy; - float z, lowz, highz, convz, halfconvz; - float xpercent,ypercent,zpercent; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float volume; - int i,j,d,k,zint,yint,xint,xindex,yindex,zindex; - int temp; - - convz = (float) depthIn/depthOut; - convy = (float) heightIn/heightOut; - convx = (float) widthIn/widthOut; - halfconvx = convx/2; - halfconvy = convy/2; - halfconvz = convz/2; - for (d = 0; d < depthOut; d++) { - z = convz * (d+0.5); - if (depthIn > depthOut) { - highz = z + halfconvz; - lowz = z - halfconvz; - } else { - highz = z + 0.5; - lowz = z - 0.5; - } - for (i = 0; i < heightOut; i++) { - y = convy * (i+0.5); - if (heightIn > heightOut) { - highy = y + halfconvy; - lowy = y - halfconvy; - } else { - highy = y + 0.5; - lowy = y - 0.5; - } - for (j = 0; j < widthOut; j++) { - x = convx * (j+0.5); - if (widthIn > widthOut) { - highx = x + halfconvx; - lowx = x - halfconvx; - } else { - highx = x + 0.5; - lowx = x - 0.5; - } - - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy, - ** lowz) to (highx, highy, highz) on input data into this pixel - ** on output data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - volume = 0.0; - - z = lowz; - zint = floor(z); - while (z < highz) { - zindex = (zint + depthIn) % depthIn; - if (highz < zint+1) { - zpercent = highz - z; - } else { - zpercent = zint+1 - z; - } - - y = lowy; - yint = floor(y); - while (y < highy) { - yindex = (yint + heightIn) % heightIn; - if (highy < yint+1) { - ypercent = highy - y; - } else { - ypercent = yint+1 - y; - } - - x = lowx; - xint = floor(x); - - while (x < highx) { - xindex = (xint + widthIn) % widthIn; - if (highx < xint+1) { - xpercent = highx - x; - } else { - xpercent = xint+1 - x; - } - - percent = xpercent * ypercent * zpercent; - volume += percent; - - temp = (xindex + (yindex*widthIn) + - (zindex*widthIn*heightIn)) * components; - for (k = 0; k < components; k++) { - assert(0 <= (temp+k) && - (temp+k) < - (widthIn*heightIn*depthIn*components)); - totals[k] += dataIn[temp + k] * percent; - } - - xint++; - x = xint; - } /* while x */ - - yint++; - y = yint; - } /* while y */ - - zint++; - z = zint; - } /* while z */ - - temp = (j + (i * widthOut) + - (d*widthOut*heightOut)) * components; - for (k = 0; k < components; k++) { - /* totals[] should be rounded in the case of enlarging an - * RGB ramp when the type is 332 or 4444 - */ - assert(0 <= (temp+k) && - (temp+k) < (widthOut*heightOut*depthOut*components)); - dataOut[temp + k] = (totals[k]+0.5)/volume; - } - } /* for j */ - } /* for i */ - } /* for d */ -} /* scaleInternal3D() */ - -static void emptyImage3D(const PixelStorageModes *psm, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, GLboolean indexFormat, - const GLushort *oldImage, void *userImage) -{ - int myswapBytes; - int components; - int groupsPerLine; - int elementSize; - int groupSize; - int rowSize; - int padding; - GLubyte *start, *rowStart, *iter; - int elementsPerLine; - const GLushort *iter2; - int ii, jj, dd, k; - int rowsPerImage; - int imageSize; - - myswapBytes= psm->pack_swap_bytes; - components = elements_per_group(format,type); - if (psm->pack_row_length > 0) { - groupsPerLine = psm->pack_row_length; - } - else { - groupsPerLine = width; - } - - elementSize= bytes_per_element(type); - groupSize= elementSize * components; - if (elementSize == 1) myswapBytes= 0; - - /* 3dstuff begin */ - if (psm->pack_image_height > 0) { - rowsPerImage= psm->pack_image_height; - } - else { - rowsPerImage= height; - } - - /* 3dstuff end */ - - rowSize = groupsPerLine * groupSize; - padding = rowSize % psm->pack_alignment; - if (padding) { - rowSize+= psm->pack_alignment - padding; - } - - imageSize= rowsPerImage * rowSize; /* 3dstuff */ - - start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize + - psm->pack_skip_pixels * groupSize + - /*3dstuff*/ - psm->pack_skip_images * imageSize; - elementsPerLine= width * components; - - iter2 = oldImage; - for (dd= 0; dd < depth; dd++) { - rowStart= start; - - for (ii= 0; ii< height; ii++) { - iter = rowStart; - - for (jj = 0; jj < elementsPerLine; jj++) { - Type_Widget widget; - float shoveComponents[4]; - - switch(type){ - case GL_UNSIGNED_BYTE: - if (indexFormat) { - *iter = *iter2++; - } else { - *iter = *iter2++ >> 8; - } - break; - case GL_BYTE: - if (indexFormat) { - *((GLbyte *) iter) = *iter2++; - } else { - *((GLbyte *) iter) = *iter2++ >> 9; - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove332(shoveComponents,0,(void *)iter); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove233rev(shoveComponents,0,(void *)iter); - break; - case GL_UNSIGNED_SHORT_5_6_5: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove565(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } - else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - for (k = 0; k < 3; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove565rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } - else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove4444(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove4444rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove5551(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove1555rev(shoveComponents,0,(void *)&widget.us[0]); - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - *(GLushort *)iter = widget.us[0]; - } - break; - case GL_UNSIGNED_SHORT: - case GL_SHORT: - if (type == GL_SHORT) { - if (indexFormat) { - widget.s[0] = *iter2++; - } else { - widget.s[0] = *iter2++ >> 1; - } - } else { - widget.us[0] = *iter2++; - } - if (myswapBytes) { - iter[0] = widget.ub[1]; - iter[1] = widget.ub[0]; - } else { - iter[0] = widget.ub[0]; - iter[1] = widget.ub[1]; - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove8888(shoveComponents,0,(void *)&widget.ui); - if (myswapBytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove8888rev(shoveComponents,0,(void *)&widget.ui); - if (myswapBytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove1010102(shoveComponents,0,(void *)&widget.ui); - if (myswapBytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - for (k = 0; k < 4; k++) { - shoveComponents[k]= *iter2++ / 65535.0; - } - shove2101010rev(shoveComponents,0,(void *)&widget.ui); - if (myswapBytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - *(GLuint *)iter= widget.ui; - } - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - if (type == GL_FLOAT) { - if (indexFormat) { - widget.f = *iter2++; - } else { - widget.f = *iter2++ / (float) 65535.0; - } - } else if (type == GL_UNSIGNED_INT) { - if (indexFormat) { - widget.ui = *iter2++; - } else { - widget.ui = (unsigned int) *iter2++ * 65537; - } - } else { - if (indexFormat) { - widget.i = *iter2++; - } else { - widget.i = ((unsigned int) *iter2++ * 65537)/2; - } - } - if (myswapBytes) { - iter[3] = widget.ub[0]; - iter[2] = widget.ub[1]; - iter[1] = widget.ub[2]; - iter[0] = widget.ub[3]; - } else { - iter[0] = widget.ub[0]; - iter[1] = widget.ub[1]; - iter[2] = widget.ub[2]; - iter[3] = widget.ub[3]; - } - break; - default: - assert(0); - } - - iter+= elementSize; - } /* for jj */ - - rowStart+= rowSize; - } /* for ii */ - - start+= imageSize; - } /* for dd */ - - /* iterators should be one byte past end */ - if (!isTypePackedPixel(type)) { - assert(iter2 == &oldImage[width*height*depth*components]); - } - else { - assert(iter2 == &oldImage[width*height*depth* - elements_per_group(format,0)]); - } - assert( iter == &((GLubyte *)userImage)[rowSize*height*depth + - psm->unpack_skip_rows * rowSize + - psm->unpack_skip_pixels * groupSize + - /*3dstuff*/ - psm->unpack_skip_images * imageSize] ); -} /* emptyImage3D() */ - -static -int gluScaleImage3D(GLenum format, - GLint widthIn, GLint heightIn, GLint depthIn, - GLenum typeIn, const void *dataIn, - GLint widthOut, GLint heightOut, GLint depthOut, - GLenum typeOut, void *dataOut) -{ - int components; - GLushort *beforeImage, *afterImage; - PixelStorageModes psm; - - if (widthIn == 0 || heightIn == 0 || depthIn == 0 || - widthOut == 0 || heightOut == 0 || depthOut == 0) { - return 0; - } - - if (widthIn < 0 || heightIn < 0 || depthIn < 0 || - widthOut < 0 || heightOut < 0 || depthOut < 0) { - return GLU_INVALID_VALUE; - } - - if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) || - typeIn == GL_BITMAP || typeOut == GL_BITMAP) { - return GLU_INVALID_ENUM; - } - if (!isLegalFormatForPackedPixelType(format, typeIn)) { - return GLU_INVALID_OPERATION; - } - if (!isLegalFormatForPackedPixelType(format, typeOut)) { - return GLU_INVALID_OPERATION; - } - - beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format, - GL_UNSIGNED_SHORT)); - afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, - GL_UNSIGNED_SHORT)); - if (beforeImage == NULL || afterImage == NULL) { - return GLU_OUT_OF_MEMORY; - } - retrieveStoreModes3D(&psm); - - fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format), - dataIn, beforeImage); - components = elements_per_group(format,0); - scaleInternal3D(components,widthIn,heightIn,depthIn,beforeImage, - widthOut,heightOut,depthOut,afterImage); - emptyImage3D(&psm,widthOut,heightOut,depthOut,format,typeOut, - is_index(format),afterImage, dataOut); - free((void *) beforeImage); - free((void *) afterImage); - - return 0; -} /* gluScaleImage3D() */ - - -static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, - GLint internalFormat, GLenum format, GLenum type, - GLint *newWidth, GLint *newHeight, GLint *newDepth) -{ - GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); - GLint depthPowerOf2= nearestPower(depth); - GLint proxyWidth; - - do { - /* compute level 1 width & height & depth, clamping each at 1 */ - GLint widthAtLevelOne= (widthPowerOf2 > 1) ? - widthPowerOf2 >> 1 : - widthPowerOf2; - GLint heightAtLevelOne= (heightPowerOf2 > 1) ? - heightPowerOf2 >> 1 : - heightPowerOf2; - GLint depthAtLevelOne= (depthPowerOf2 > 1) ? - depthPowerOf2 >> 1 : - depthPowerOf2; - GLenum proxyTarget = GL_PROXY_TEXTURE_3D; - assert(widthAtLevelOne > 0); - assert(heightAtLevelOne > 0); - assert(depthAtLevelOne > 0); - - /* does width x height x depth at level 1 & all their mipmaps fit? */ - assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D); - gluTexImage3D(proxyTarget, 1, /* must be non-zero */ - internalFormat, - widthAtLevelOne,heightAtLevelOne,depthAtLevelOne, - 0,format,type,NULL); - glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth); - /* does it fit??? */ - if (proxyWidth == 0) { /* nope, so try again with these sizes */ - if (widthPowerOf2 == 1 && heightPowerOf2 == 1 && - depthPowerOf2 == 1) { - *newWidth= *newHeight= *newDepth= 1; /* must fit 1x1x1 texture */ - return; - } - widthPowerOf2= widthAtLevelOne; - heightPowerOf2= heightAtLevelOne; - depthPowerOf2= depthAtLevelOne; - } - /* else it does fit */ - } while (proxyWidth == 0); - /* loop must terminate! */ - - /* return the width & height at level 0 that fits */ - *newWidth= widthPowerOf2; - *newHeight= heightPowerOf2; - *newDepth= depthPowerOf2; -/*printf("Proxy Textures\n");*/ -} /* closestFit3D() */ - -static void halveImagePackedPixelSlice(int components, - void (*extractPackedPixel) - (int, const void *,GLfloat []), - void (*shovePackedPixel) - (const GLfloat [],int, void *), - GLint width, GLint height, GLint depth, - const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, - GLint imageSizeInBytes, - GLint isSwap) -{ - int ii, jj; - int halfWidth= width / 2; - int halfHeight= height / 2; - int halfDepth= depth / 2; - const char *src= (const char *)dataIn; - int outIndex= 0; - - assert((width == 1 || height == 1) && depth >= 2); - - if (width == height) { /* a 1-pixel column viewed from top */ - assert(width == 1 && height == 1); - assert(depth >= 2); - - for (ii= 0; ii< halfDepth; ii++) { - float totals[4]; - float extractTotals[BOX2][4]; - int cc; - - (*extractPackedPixel)(isSwap,src,&extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), - &extractTotals[1][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* average 2 pixels since only a column */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; - * totals[RED]/= 2.0; - */ - for (kk = 0; kk < BOX2; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX2; - } /* for cc */ - - (*shovePackedPixel)(totals,outIndex,dataOut); - outIndex++; - /* skip over to next group of 2 */ - src+= imageSizeInBytes + imageSizeInBytes; - } /* for ii */ - } - else if (height == 1) { /* horizontal slice viewed from top */ - assert(width != 1); - - for (ii= 0; ii< halfDepth; ii++) { - for (jj= 0; jj< halfWidth; jj++) { - float totals[4]; - float extractTotals[BOX4][4]; - int cc; - - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); - (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), - &extractTotals[2][0]); - (*extractPackedPixel)(isSwap, - (src+imageSizeInBytes+pixelSizeInBytes), - &extractTotals[3][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 4 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; - * totals[RED]/= 4.0; - */ - for (kk = 0; kk < BOX4; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX4; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - /* skip over to next horizontal square of 4 */ - src+= imageSizeInBytes + imageSizeInBytes; - } - } - - /* assert() */ - } - else if (width == 1) { /* vertical slice viewed from top */ - assert(height != 1); - - for (ii= 0; ii< halfDepth; ii++) { - for (jj= 0; jj< halfHeight; jj++) { - float totals[4]; - float extractTotals[BOX4][4]; - int cc; - - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[1][0]); - (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), - &extractTotals[2][0]); - (*extractPackedPixel)(isSwap, - (src+imageSizeInBytes+rowSizeInBytes), - &extractTotals[3][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 4 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; - * totals[RED]/= 4.0; - */ - for (kk = 0; kk < BOX4; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX4; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - - /* skip over to next vertical square of 4 */ - src+= imageSizeInBytes + imageSizeInBytes; - } - } - /* assert() */ - } - -} /* halveImagePackedPixelSlice() */ - -static void halveImagePackedPixel3D(int components, - void (*extractPackedPixel) - (int, const void *,GLfloat []), - void (*shovePackedPixel) - (const GLfloat [],int, void *), - GLint width, GLint height, GLint depth, - const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, - GLint imageSizeInBytes, - GLint isSwap) -{ - if (depth == 1) { - assert(1 <= width && 1 <= height); - - halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel, - width,height,dataIn,dataOut,pixelSizeInBytes, - rowSizeInBytes,isSwap); - return; - } - /* a horizontal or vertical slice viewed from top */ - else if (width == 1 || height == 1) { - assert(1 <= depth); - - halveImagePackedPixelSlice(components, - extractPackedPixel,shovePackedPixel, - width, height, depth, dataIn, dataOut, - pixelSizeInBytes, rowSizeInBytes, - imageSizeInBytes, isSwap); - return; - } - { - int ii, jj, dd; - - int halfWidth= width / 2; - int halfHeight= height / 2; - int halfDepth= depth / 2; - const char *src= (const char *) dataIn; - int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); - int outIndex= 0; - - for (dd= 0; dd < halfDepth; dd++) { - for (ii= 0; ii< halfHeight; ii++) { - for (jj= 0; jj< halfWidth; jj++) { -#define BOX8 8 - float totals[4]; /* 4 is maximum components */ - float extractTotals[BOX8][4]; /* 4 is maximum components */ - int cc; - - (*extractPackedPixel)(isSwap,src, - &extractTotals[0][0]); - (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); - (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[2][0]); - (*extractPackedPixel)(isSwap, - (src+rowSizeInBytes+pixelSizeInBytes), - &extractTotals[3][0]); - - (*extractPackedPixel)(isSwap,(src+imageSizeInBytes), - &extractTotals[4][0]); - (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes+imageSizeInBytes), - &extractTotals[5][0]); - (*extractPackedPixel)(isSwap,(src+rowSizeInBytes+imageSizeInBytes), - &extractTotals[6][0]); - (*extractPackedPixel)(isSwap, - (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes), - &extractTotals[7][0]); - for (cc = 0; cc < components; cc++) { - int kk; - - /* grab 8 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]+ - * extractTotals[4][RED]+extractTotals[5][RED]+ - * extractTotals[6][RED]+extractTotals[7][RED]; - * totals[RED]/= 8.0; - */ - for (kk = 0; kk < BOX8; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (float)BOX8; - } - (*shovePackedPixel)(totals,outIndex,dataOut); - - outIndex++; - /* skip over to next square of 4 */ - src+= pixelSizeInBytes + pixelSizeInBytes; - } - /* skip past pad bytes, if any, to get to next row */ - src+= padBytes; - - /* src is at beginning of a row here, but it's the second row of - * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... - */ - src+= rowSizeInBytes; - } - - src+= imageSizeInBytes; - } /* for dd */ - - /* both pointers must reach one byte after the end */ - assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); - assert(outIndex == halfWidth * halfHeight * halfDepth); - } /* for dd */ - -} /* halveImagePackedPixel3D() */ - -static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, - GLsizei width, - GLsizei height, - GLsizei depth, - GLsizei widthPowerOf2, - GLsizei heightPowerOf2, - GLsizei depthPowerOf2, - GLenum format, GLenum type, - GLint userLevel, - GLint baseLevel,GLint maxLevel, - const void *data) -{ - GLint newWidth, newHeight, newDepth; - GLint level, levels; - const void *usersImage; - void *srcImage, *dstImage; - __GLU_INIT_SWAP_IMAGE; - GLint memReq; - GLint cmpts; - - GLint myswapBytes, groupsPerLine, elementSize, groupSize; - GLint rowsPerImage, imageSize; - GLint rowSize, padding; - PixelStorageModes psm; - - assert(checkMipmapArgs(internalFormat,format,type) == 0); - assert(width >= 1 && height >= 1 && depth >= 1); - assert(type != GL_BITMAP); - - srcImage = dstImage = NULL; - - newWidth= widthPowerOf2; - newHeight= heightPowerOf2; - newDepth= depthPowerOf2; - levels = computeLog(newWidth); - level = computeLog(newHeight); - if (level > levels) levels=level; - level = computeLog(newDepth); - if (level > levels) levels=level; - - levels+= userLevel; - - retrieveStoreModes3D(&psm); - myswapBytes = psm.unpack_swap_bytes; - cmpts = elements_per_group(format,type); - if (psm.unpack_row_length > 0) { - groupsPerLine = psm.unpack_row_length; - } else { - groupsPerLine = width; - } - - elementSize = bytes_per_element(type); - groupSize = elementSize * cmpts; - if (elementSize == 1) myswapBytes = 0; - - /* 3dstuff begin */ - if (psm.unpack_image_height > 0) { - rowsPerImage= psm.unpack_image_height; - } - else { - rowsPerImage= height; - } - - /* 3dstuff end */ - rowSize = groupsPerLine * groupSize; - padding = (rowSize % psm.unpack_alignment); - if (padding) { - rowSize += psm.unpack_alignment - padding; - } - - imageSize= rowsPerImage * rowSize; /* 3dstuff */ - - usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize + - psm.unpack_skip_pixels * groupSize + - /* 3dstuff */ - psm.unpack_skip_images * imageSize; - - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); - - level = userLevel; - - if (width == newWidth && height == newHeight && depth == newDepth) { - /* Use usersImage for level userLevel */ - if (baseLevel <= level && level <= maxLevel) { - gluTexImage3D(target, level, internalFormat, width, - height, depth, 0, format, type, - usersImage); - } - if(levels == 0) { /* we're done. clean up and return */ - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - return 0; - } - { - int nextWidth= newWidth/2; - int nextHeight= newHeight/2; - int nextDepth= newDepth/2; - - /* clamp to 1 */ - if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; - memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); - } - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memReq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memReq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memReq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memReq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); - break; - default: - return GLU_INVALID_ENUM; /* assertion */ - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - return GLU_OUT_OF_MEMORY; - } - else - switch(type) { - case GL_UNSIGNED_BYTE: - if (depth > 1) { - halveImage3D(cmpts,extractUbyte,shoveUbyte, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_ubyte(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize); - } - break; - case GL_BYTE: - if (depth > 1) { - halveImage3D(cmpts,extractSbyte,shoveSbyte, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_byte(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize); - } - break; - case GL_UNSIGNED_SHORT: - if (depth > 1) { - halveImage3D(cmpts,extractUshort,shoveUshort, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_ushort(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_SHORT: - if (depth > 1) { - halveImage3D(cmpts,extractSshort,shoveSshort, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_short(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_UNSIGNED_INT: - if (depth > 1) { - halveImage3D(cmpts,extractUint,shoveUint, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_uint(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_INT: - if (depth > 1) { - halveImage3D(cmpts,extractSint,shoveSint, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_int(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_FLOAT: - if (depth > 1 ) { - halveImage3D(cmpts,extractFloat,shoveFloat, - width,height,depth, - usersImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_float(cmpts,width,height,usersImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - assert(format == GL_RGB); - halveImagePackedPixel3D(3,extract332,shove332, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - assert(format == GL_RGB); - halveImagePackedPixel3D(3,extract233rev,shove233rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_6_5: - halveImagePackedPixel3D(3,extract565,shove565, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - halveImagePackedPixel3D(3,extract565rev,shove565rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - halveImagePackedPixel3D(4,extract4444,shove4444, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - halveImagePackedPixel3D(4,extract4444rev,shove4444rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - halveImagePackedPixel3D(4,extract5551,shove5551, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - halveImagePackedPixel3D(4,extract1555rev,shove1555rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: - halveImagePackedPixel3D(4,extract8888,shove8888, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - halveImagePackedPixel3D(4,extract8888rev,shove8888rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: - halveImagePackedPixel3D(4,extract1010102,shove1010102, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev, - width,height,depth,usersImage,dstImage, - elementSize,rowSize,imageSize,myswapBytes); - break; - default: - assert(0); - break; - } - newWidth = width/2; - newHeight = height/2; - newDepth = depth/2; - /* clamp to 1 */ - if (newWidth < 1) newWidth= 1; - if (newHeight < 1) newHeight= 1; - if (newDepth < 1) newDepth= 1; - - myswapBytes = 0; - rowSize = newWidth * groupSize; - imageSize= rowSize * newHeight; /* 3dstuff */ - memReq = imageSize3D(newWidth, newHeight, newDepth, format, type); - /* Swap srcImage and dstImage */ - __GLU_SWAP_IMAGE(srcImage,dstImage); - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memReq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memReq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memReq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memReq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); - break; - default: - return GLU_INVALID_ENUM; /* assertion */ - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - return GLU_OUT_OF_MEMORY; - } - /* level userLevel+1 is in srcImage; level userLevel already saved */ - level = userLevel+1; - } else {/* user's image is *not* nice power-of-2 sized square */ - memReq = imageSize3D(newWidth, newHeight, newDepth, format, type); - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memReq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memReq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memReq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memReq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); - break; - default: - return GLU_INVALID_ENUM; /* assertion */ - } - - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - return GLU_OUT_OF_MEMORY; - } - /*printf("Build3DMipmaps(): ScaleImage3D %d %d %d->%d %d %d\n", - width,height,depth,newWidth,newHeight,newDepth);*/ - - gluScaleImage3D(format, width, height, depth, type, usersImage, - newWidth, newHeight, newDepth, type, dstImage); - - myswapBytes = 0; - rowSize = newWidth * groupSize; - imageSize = rowSize * newHeight; /* 3dstuff */ - /* Swap dstImage and srcImage */ - __GLU_SWAP_IMAGE(srcImage,dstImage); - - if(levels != 0) { /* use as little memory as possible */ - { - int nextWidth= newWidth/2; - int nextHeight= newHeight/2; - int nextDepth= newDepth/2; - if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; - - memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); - } - switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memReq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memReq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memReq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memReq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memReq); - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - dstImage = (GLushort *)malloc(memReq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); - break; - default: - return GLU_INVALID_ENUM; /* assertion */ - } - if (dstImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - return GLU_OUT_OF_MEMORY; - } - } - /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; - } - - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - if (baseLevel <= level && level <= maxLevel) { - gluTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth, - 0,format, type, (void *)srcImage); - } - level++; /* update current level for the loop */ - for (; level <= levels; level++) { - switch(type) { - case GL_UNSIGNED_BYTE: - if (newDepth > 1) { - halveImage3D(cmpts,extractUbyte,shoveUbyte, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_ubyte(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize); - } - break; - case GL_BYTE: - if (newDepth > 1) { - halveImage3D(cmpts,extractSbyte,shoveSbyte, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_byte(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize); - } - break; - case GL_UNSIGNED_SHORT: - if (newDepth > 1) { - halveImage3D(cmpts,extractUshort,shoveUshort, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_ushort(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_SHORT: - if (newDepth > 1) { - halveImage3D(cmpts,extractSshort,shoveSshort, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_short(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_UNSIGNED_INT: - if (newDepth > 1) { - halveImage3D(cmpts,extractUint,shoveUint, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_uint(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_INT: - if (newDepth > 1) { - halveImage3D(cmpts,extractSint,shoveSint, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_int(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_FLOAT: - if (newDepth > 1) { - halveImage3D(cmpts,extractFloat,shoveFloat, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,groupSize,rowSize, - imageSize,myswapBytes); - } - else { - halveImage_float(cmpts,newWidth,newHeight,srcImage,dstImage, - elementSize,rowSize,groupSize,myswapBytes); - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - halveImagePackedPixel3D(3,extract332,shove332, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - halveImagePackedPixel3D(3,extract233rev,shove233rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_6_5: - halveImagePackedPixel3D(3,extract565,shove565, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - halveImagePackedPixel3D(3,extract565rev,shove565rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - halveImagePackedPixel3D(4,extract4444,shove4444, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - halveImagePackedPixel3D(4,extract4444rev,shove4444rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - halveImagePackedPixel3D(4,extract5551,shove5551, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - halveImagePackedPixel3D(4,extract1555rev,shove1555rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: - halveImagePackedPixel3D(4,extract8888,shove8888, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - halveImagePackedPixel3D(4,extract8888rev,shove8888rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: - halveImagePackedPixel3D(4,extract1010102,shove1010102, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev, - newWidth,newHeight,newDepth, - srcImage,dstImage,elementSize,rowSize, - imageSize,myswapBytes); - break; - default: - assert(0); - break; - } - - __GLU_SWAP_IMAGE(srcImage,dstImage); - - if (newWidth > 1) { newWidth /= 2; rowSize /= 2;} - if (newHeight > 1) { newHeight /= 2; imageSize = rowSize * newHeight; } - if (newDepth > 1) newDepth /= 2; - { - /* call tex image with srcImage untouched since it's not padded */ - if (baseLevel <= level && level <= maxLevel) { - gluTexImage3D(target, level, internalFormat, newWidth, newHeight, - newDepth,0, format, type, (void *) srcImage); - } - } - } /* for level */ - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); - - free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/ - if (dstImage) { /* if it's non-rectangular and only 1 level */ - free(dstImage); - } - return 0; -} /* gluBuild3DMipmapLevelsCore() */ - -GLint GLAPIENTRY -gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, - GLint userLevel, GLint baseLevel, GLint maxLevel, - const void *data) -{ - int level, levels; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1 || height < 1 || depth < 1) { - return GLU_INVALID_VALUE; - } - - if(type == GL_BITMAP) { - return GLU_INVALID_ENUM; - } - - levels = computeLog(width); - level = computeLog(height); - if (level > levels) levels=level; - level = computeLog(depth); - if (level > levels) levels=level; - - levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) - return GLU_INVALID_VALUE; - - return gluBuild3DMipmapLevelsCore(target, internalFormat, - width, height, depth, - width, height, depth, - format, type, - userLevel, baseLevel, maxLevel, - data); -} /* gluBuild3DMipmapLevels() */ - -GLint GLAPIENTRY -gluBuild3DMipmaps(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const void *data) -{ - GLint widthPowerOf2, heightPowerOf2, depthPowerOf2; - int level, levels; - - int rc= checkMipmapArgs(internalFormat,format,type); - if (rc != 0) return rc; - - if (width < 1 || height < 1 || depth < 1) { - return GLU_INVALID_VALUE; - } - - if(type == GL_BITMAP) { - return GLU_INVALID_ENUM; - } - - closestFit3D(target,width,height,depth,internalFormat,format,type, - &widthPowerOf2,&heightPowerOf2,&depthPowerOf2); - - levels = computeLog(widthPowerOf2); - level = computeLog(heightPowerOf2); - if (level > levels) levels=level; - level = computeLog(depthPowerOf2); - if (level > levels) levels=level; - - return gluBuild3DMipmapLevelsCore(target, internalFormat, - width, height, depth, - widthPowerOf2, heightPowerOf2, - depthPowerOf2, - format, type, 0, 0, levels, - data); -} /* gluBuild3DMipmaps() */ - -static GLdouble extractUbyte(int isSwap, const void *ubyte) -{ - isSwap= isSwap; /* turn off warnings */ - - assert(*((const GLubyte *)ubyte) <= 255); - - return (GLdouble)(*((const GLubyte *)ubyte)); -} /* extractUbyte() */ - -static void shoveUbyte(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value < 256.0); - - ((GLubyte *)data)[index]= (GLubyte)value; -} /* shoveUbyte() */ - -static GLdouble extractSbyte(int isSwap, const void *sbyte) -{ - isSwap= isSwap; /* turn off warnings */ - - assert(*((const GLbyte *)sbyte) <= 127); - - return (GLdouble)(*((const GLbyte *)sbyte)); -} /* extractSbyte() */ - -static void shoveSbyte(GLdouble value, int index, void *data) -{ - ((GLbyte *)data)[index]= (GLbyte)value; -} /* shoveSbyte() */ - -static GLdouble extractUshort(int isSwap, const void *uitem) -{ - GLushort ushort; - - if (isSwap) { - ushort= __GLU_SWAP_2_BYTES(uitem); - } - else { - ushort= *(const GLushort *)uitem; - } - - assert(ushort <= 65535); - - return (GLdouble)ushort; -} /* extractUshort() */ - -static void shoveUshort(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value < 65536.0); - - ((GLushort *)data)[index]= (GLushort)value; -} /* shoveUshort() */ - -static GLdouble extractSshort(int isSwap, const void *sitem) -{ - GLshort sshort; - - if (isSwap) { - sshort= __GLU_SWAP_2_BYTES(sitem); - } - else { - sshort= *(const GLshort *)sitem; - } - - assert(sshort <= 32767); - - return (GLdouble)sshort; -} /* extractSshort() */ - -static void shoveSshort(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value < 32768.0); - - ((GLshort *)data)[index]= (GLshort)value; -} /* shoveSshort() */ - -static GLdouble extractUint(int isSwap, const void *uitem) -{ - GLuint uint; - - if (isSwap) { - uint= __GLU_SWAP_4_BYTES(uitem); - } - else { - uint= *(const GLuint *)uitem; - } - - assert(uint <= 0xffffffff); - - return (GLdouble)uint; -} /* extractUint() */ - -static void shoveUint(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value <= (GLdouble) UINT_MAX); - - ((GLuint *)data)[index]= (GLuint)value; -} /* shoveUint() */ - -static GLdouble extractSint(int isSwap, const void *sitem) -{ - GLint sint; - - if (isSwap) { - sint= __GLU_SWAP_4_BYTES(sitem); - } - else { - sint= *(const GLint *)sitem; - } - - assert(sint <= 0x7fffffff); - - return (GLdouble)sint; -} /* extractSint() */ - -static void shoveSint(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value <= (GLdouble) INT_MAX); - - ((GLint *)data)[index]= (GLint)value; -} /* shoveSint() */ - -static GLdouble extractFloat(int isSwap, const void *item) -{ - GLfloat ffloat; - - if (isSwap) { - ffloat= __GLU_SWAP_4_BYTES(item); - } - else { - ffloat= *(const GLfloat *)item; - } - - assert(ffloat <= 1.0); - - return (GLdouble)ffloat; -} /* extractFloat() */ - -static void shoveFloat(GLdouble value, int index, void *data) -{ - assert(0.0 <= value && value <= 1.0); - - ((GLfloat *)data)[index]= value; -} /* shoveFloat() */ - -static void halveImageSlice(int components, - GLdouble (*extract)(int, const void *), - void (*shove)(GLdouble, int, void *), - GLint width, GLint height, GLint depth, - const void *dataIn, void *dataOut, - GLint elementSizeInBytes, - GLint groupSizeInBytes, - GLint rowSizeInBytes, - GLint imageSizeInBytes, - GLint isSwap) -{ - int ii, jj; - int halfWidth= width / 2; - int halfHeight= height / 2; - int halfDepth= depth / 2; - const char *src= (const char *)dataIn; - int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes); - int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); - int outIndex= 0; - - assert((width == 1 || height == 1) && depth >= 2); - - if (width == height) { /* a 1-pixel column viewed from top */ - /* printf("1-column\n");*/ - assert(width == 1 && height == 1); - assert(depth >= 2); - - for (ii= 0; ii< halfDepth; ii++) { - int cc; - - for (cc = 0; cc < components; cc++) { - double totals[4]; - double extractTotals[BOX2][4]; - int kk; - - extractTotals[0][cc]= (*extract)(isSwap,src); - extractTotals[1][cc]= (*extract)(isSwap,(src+imageSizeInBytes)); - - /* average 2 pixels since only a column */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]; - * totals[RED]/= 2.0; - */ - for (kk = 0; kk < BOX2; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (double)BOX2; - - (*shove)(totals[cc],outIndex,dataOut); - outIndex++; - src+= elementSizeInBytes; - } /* for cc */ - - /* skip over to next group of 2 */ - src+= rowSizeInBytes; - } /* for ii */ - - assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); - assert(outIndex == halfDepth * components); - } - else if (height == 1) { /* horizontal slice viewed from top */ - /* printf("horizontal slice\n"); */ - assert(width != 1); - - for (ii= 0; ii< halfDepth; ii++) { - for (jj= 0; jj< halfWidth; jj++) { - int cc; - - for (cc = 0; cc < components; cc++) { - int kk; - double totals[4]; - double extractTotals[BOX4][4]; - - extractTotals[0][cc]=(*extract)(isSwap,src); - extractTotals[1][cc]=(*extract)(isSwap, - (src+groupSizeInBytes)); - extractTotals[2][cc]=(*extract)(isSwap, - (src+imageSizeInBytes)); - extractTotals[3][cc]=(*extract)(isSwap, - (src+imageSizeInBytes+groupSizeInBytes)); - - /* grab 4 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; - * totals[RED]/= 4.0; - */ - for (kk = 0; kk < BOX4; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (double)BOX4; - - (*shove)(totals[cc],outIndex,dataOut); - outIndex++; - - src+= elementSizeInBytes; - } /* for cc */ - - /* skip over to next horizontal square of 4 */ - src+= groupSizeInBytes; - } /* for jj */ - src+= rowPadBytes; - - src+= rowSizeInBytes; - } /* for ii */ - - assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); - assert(outIndex == halfWidth * halfDepth * components); - } - else if (width == 1) { /* vertical slice viewed from top */ - /* printf("vertical slice\n"); */ - assert(height != 1); - - for (ii= 0; ii< halfDepth; ii++) { - for (jj= 0; jj< halfHeight; jj++) { - int cc; - - for (cc = 0; cc < components; cc++) { - int kk; - double totals[4]; - double extractTotals[BOX4][4]; - - extractTotals[0][cc]=(*extract)(isSwap,src); - extractTotals[1][cc]=(*extract)(isSwap, - (src+rowSizeInBytes)); - extractTotals[2][cc]=(*extract)(isSwap, - (src+imageSizeInBytes)); - extractTotals[3][cc]=(*extract)(isSwap, - (src+imageSizeInBytes+rowSizeInBytes)); - - /* grab 4 pixels to average */ - totals[cc]= 0.0; - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; - * totals[RED]/= 4.0; - */ - for (kk = 0; kk < BOX4; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (double)BOX4; - - (*shove)(totals[cc],outIndex,dataOut); - outIndex++; - - src+= elementSizeInBytes; - } /* for cc */ - src+= rowPadBytes; - - /* skip over to next vertical square of 4 */ - src+= rowSizeInBytes; - } /* for jj */ - src+= imagePadBytes; - - src+= imageSizeInBytes; - } /* for ii */ - - assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); - assert(outIndex == halfHeight * halfDepth * components); - } - -} /* halveImageSlice() */ - -static void halveImage3D(int components, - GLdouble (*extract)(int, const void *), - void (*shove)(GLdouble, int, void *), - GLint width, GLint height, GLint depth, - const void *dataIn, void *dataOut, - GLint elementSizeInBytes, - GLint groupSizeInBytes, - GLint rowSizeInBytes, - GLint imageSizeInBytes, - GLint isSwap) -{ - assert(depth > 1); - - /* a horizontal/vertical/one-column slice viewed from top */ - if (width == 1 || height == 1) { - assert(1 <= depth); - - halveImageSlice(components,extract,shove, width, height, depth, - dataIn, dataOut, elementSizeInBytes, groupSizeInBytes, - rowSizeInBytes, imageSizeInBytes, isSwap); - return; - } - { - int ii, jj, dd; - - int halfWidth= width / 2; - int halfHeight= height / 2; - int halfDepth= depth / 2; - const char *src= (const char *) dataIn; - int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes); - int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); - int outIndex= 0; - - for (dd= 0; dd < halfDepth; dd++) { - for (ii= 0; ii< halfHeight; ii++) { - for (jj= 0; jj< halfWidth; jj++) { - int cc; - - for (cc= 0; cc < components; cc++) { - int kk; -#define BOX8 8 - double totals[4]; /* 4 is maximum components */ - double extractTotals[BOX8][4]; /* 4 is maximum components */ - - extractTotals[0][cc]= (*extract)(isSwap,src); - extractTotals[1][cc]= (*extract)(isSwap, - (src+groupSizeInBytes)); - extractTotals[2][cc]= (*extract)(isSwap, - (src+rowSizeInBytes)); - extractTotals[3][cc]= (*extract)(isSwap, - (src+rowSizeInBytes+groupSizeInBytes)); - - extractTotals[4][cc]= (*extract)(isSwap, - (src+imageSizeInBytes)); - - extractTotals[5][cc]= (*extract)(isSwap, - (src+groupSizeInBytes+imageSizeInBytes)); - extractTotals[6][cc]= (*extract)(isSwap, - (src+rowSizeInBytes+imageSizeInBytes)); - extractTotals[7][cc]= (*extract)(isSwap, - (src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes)); - - totals[cc]= 0.0; - - /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]+ - * extractTotals[4][RED]+extractTotals[5][RED]+ - * extractTotals[6][RED]+extractTotals[7][RED]; - * totals[RED]/= 8.0; - */ - for (kk = 0; kk < BOX8; kk++) { - totals[cc]+= extractTotals[kk][cc]; - } - totals[cc]/= (double)BOX8; - - (*shove)(totals[cc],outIndex,dataOut); - - outIndex++; - - src+= elementSizeInBytes; /* go to next component */ - } /* for cc */ - - /* skip over to next square of 4 */ - src+= groupSizeInBytes; - } /* for jj */ - /* skip past pad bytes, if any, to get to next row */ - src+= rowPadBytes; - - /* src is at beginning of a row here, but it's the second row of - * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... - */ - src+= rowSizeInBytes; - } /* for ii */ - - /* skip past pad bytes, if any, to get to next image */ - src+= imagePadBytes; - - src+= imageSizeInBytes; - } /* for dd */ - - /* both pointers must reach one byte after the end */ - assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); - assert(outIndex == halfWidth * halfHeight * halfDepth * components); - } -} /* halveImage3D() */ - - - -/*** mipmap.c ***/ - diff --git a/src/libs/mesa/glu/libutil/project.c b/src/libs/mesa/glu/libutil/project.c deleted file mode 100644 index f4bf8839b6..0000000000 --- a/src/libs/mesa/glu/libutil/project.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "gluos.h" -#include -#include -#include -#include "gluint.h" - -/* -** Make m an identity matrix -*/ -static void __gluMakeIdentityd(GLdouble m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -static void __gluMakeIdentityf(GLfloat m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -void GLAPIENTRY -gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) -{ - glOrtho(left, right, bottom, top, -1, 1); -} - -#define __glPi 3.14159265358979323846 - -void GLAPIENTRY -gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) -{ - GLdouble m[4][4]; - double sine, cotangent, deltaZ; - double radians = fovy / 2 * __glPi / 180; - - deltaZ = zFar - zNear; - sine = sin(radians); - if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { - return; - } - cotangent = COS(radians) / sine; - - __gluMakeIdentityd(&m[0][0]); - m[0][0] = cotangent / aspect; - m[1][1] = cotangent; - m[2][2] = -(zFar + zNear) / deltaZ; - m[2][3] = -1; - m[3][2] = -2 * zNear * zFar / deltaZ; - m[3][3] = 0; - glMultMatrixd(&m[0][0]); -} - -static void normalize(float v[3]) -{ - float r; - - r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); - if (r == 0.0) return; - - v[0] /= r; - v[1] /= r; - v[2] /= r; -} - -static void cross(float v1[3], float v2[3], float result[3]) -{ - result[0] = v1[1]*v2[2] - v1[2]*v2[1]; - result[1] = v1[2]*v2[0] - v1[0]*v2[2]; - result[2] = v1[0]*v2[1] - v1[1]*v2[0]; -} - -void GLAPIENTRY -gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, - GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, - GLdouble upz) -{ - float forward[3], side[3], up[3]; - GLfloat m[4][4]; - - forward[0] = centerx - eyex; - forward[1] = centery - eyey; - forward[2] = centerz - eyez; - - up[0] = upx; - up[1] = upy; - up[2] = upz; - - normalize(forward); - - /* Side = forward x up */ - cross(forward, up, side); - normalize(side); - - /* Recompute up as: up = side x forward */ - cross(side, forward, up); - - __gluMakeIdentityf(&m[0][0]); - m[0][0] = side[0]; - m[1][0] = side[1]; - m[2][0] = side[2]; - - m[0][1] = up[0]; - m[1][1] = up[1]; - m[2][1] = up[2]; - - m[0][2] = -forward[0]; - m[1][2] = -forward[1]; - m[2][2] = -forward[2]; - - glMultMatrixf(&m[0][0]); - glTranslated(-eyex, -eyey, -eyez); -} - -static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], - GLdouble out[4]) -{ - int i; - - for (i=0; i<4; i++) { - out[i] = - in[0] * matrix[0*4+i] + - in[1] * matrix[1*4+i] + - in[2] * matrix[2*4+i] + - in[3] * matrix[3*4+i]; - } -} - -/* -** Invert 4x4 matrix. -** Contributed by David Moore (See Mesa bug #6748) -*/ -static int __gluInvertMatrixd(const GLdouble m[16], GLdouble invOut[16]) -{ - double inv[16], det; - int i; - - inv[0] = m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15] - + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10]; - inv[4] = -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15] - - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10]; - inv[8] = m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15] - + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9]; - inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14] - - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9]; - inv[1] = -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15] - - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10]; - inv[5] = m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15] - + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10]; - inv[9] = -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15] - - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9]; - inv[13] = m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14] - + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9]; - inv[2] = m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15] - + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6]; - inv[6] = -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15] - - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6]; - inv[10] = m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15] - + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5]; - inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14] - - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5]; - inv[3] = -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11] - - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6]; - inv[7] = m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11] - + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6]; - inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11] - - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5]; - inv[15] = m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10] - + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5]; - - det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12]; - if (det == 0) - return GL_FALSE; - - det = 1.0 / det; - - for (i = 0; i < 16; i++) - invOut[i] = inv[i] * det; - - return GL_TRUE; -} - -static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], - GLdouble r[16]) -{ - int i, j; - - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - r[i*4+j] = - a[i*4+0]*b[0*4+j] + - a[i*4+1]*b[1*4+j] + - a[i*4+2]*b[2*4+j] + - a[i*4+3]*b[3*4+j]; - } - } -} - -GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *winx, GLdouble *winy, GLdouble *winz) -{ - double in[4]; - double out[4]; - - in[0]=objx; - in[1]=objy; - in[2]=objz; - in[3]=1.0; - __gluMultMatrixVecd(modelMatrix, in, out); - __gluMultMatrixVecd(projMatrix, out, in); - if (in[3] == 0.0) return(GL_FALSE); - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - /* Map x, y and z to range 0-1 */ - in[0] = in[0] * 0.5 + 0.5; - in[1] = in[1] * 0.5 + 0.5; - in[2] = in[2] * 0.5 + 0.5; - - /* Map x,y to viewport */ - in[0] = in[0] * viewport[2] + viewport[0]; - in[1] = in[1] * viewport[3] + viewport[1]; - - *winx=in[0]; - *winy=in[1]; - *winz=in[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *objx, GLdouble *objy, GLdouble *objz) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=1.0; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - out[0] /= out[3]; - out[1] /= out[3]; - out[2] /= out[3]; - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd nearVal, GLclampd farVal, - GLdouble *objx, GLdouble *objy, GLdouble *objz, - GLdouble *objw) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=clipw; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - in[2] = (in[2] - nearVal) / (farVal - nearVal); - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - *objw = out[3]; - return(GL_TRUE); -} - -void GLAPIENTRY -gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, - GLint viewport[4]) -{ - if (deltax <= 0 || deltay <= 0) { - return; - } - - /* Translate and scale the picked region to the entire window */ - glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, - (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); - glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); -} diff --git a/src/libs/mesa/glu/libutil/quad.c b/src/libs/mesa/glu/libutil/quad.c deleted file mode 100644 index d88b20f556..0000000000 --- a/src/libs/mesa/glu/libutil/quad.c +++ /dev/null @@ -1,1155 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "gluos.h" -#include "gluint.h" -#include -#include -#include -#include -#include - -/* Make it not a power of two to avoid cache thrashing on the chip */ -#define CACHE_SIZE 240 - -#undef PI -#define PI 3.14159265358979323846 - -struct GLUquadric { - GLint normals; - GLboolean textureCoords; - GLint orientation; - GLint drawStyle; - void (GLAPIENTRY *errorCallback)( GLint ); -}; - -GLUquadric * GLAPIENTRY -gluNewQuadric(void) -{ - GLUquadric *newstate; - - newstate = (GLUquadric *) malloc(sizeof(GLUquadric)); - if (newstate == NULL) { - /* Can't report an error at this point... */ - return NULL; - } - newstate->normals = GLU_SMOOTH; - newstate->textureCoords = GL_FALSE; - newstate->orientation = GLU_OUTSIDE; - newstate->drawStyle = GLU_FILL; - newstate->errorCallback = NULL; - return newstate; -} - - -void GLAPIENTRY -gluDeleteQuadric(GLUquadric *state) -{ - free(state); -} - -static void gluQuadricError(GLUquadric *qobj, GLenum which) -{ - if (qobj->errorCallback) { - qobj->errorCallback(which); - } -} - -void GLAPIENTRY -gluQuadricCallback(GLUquadric *qobj, GLenum which, _GLUfuncptr fn) -{ - switch (which) { - case GLU_ERROR: - qobj->errorCallback = (void (GLAPIENTRY *)(GLint)) fn; - break; - default: - gluQuadricError(qobj, GLU_INVALID_ENUM); - return; - } -} - -void GLAPIENTRY -gluQuadricNormals(GLUquadric *qobj, GLenum normals) -{ - switch (normals) { - case GLU_SMOOTH: - case GLU_FLAT: - case GLU_NONE: - break; - default: - gluQuadricError(qobj, GLU_INVALID_ENUM); - return; - } - qobj->normals = normals; -} - -void GLAPIENTRY -gluQuadricTexture(GLUquadric *qobj, GLboolean textureCoords) -{ - qobj->textureCoords = textureCoords; -} - -void GLAPIENTRY -gluQuadricOrientation(GLUquadric *qobj, GLenum orientation) -{ - switch(orientation) { - case GLU_OUTSIDE: - case GLU_INSIDE: - break; - default: - gluQuadricError(qobj, GLU_INVALID_ENUM); - return; - } - qobj->orientation = orientation; -} - -void GLAPIENTRY -gluQuadricDrawStyle(GLUquadric *qobj, GLenum drawStyle) -{ - switch(drawStyle) { - case GLU_POINT: - case GLU_LINE: - case GLU_FILL: - case GLU_SILHOUETTE: - break; - default: - gluQuadricError(qobj, GLU_INVALID_ENUM); - return; - } - qobj->drawStyle = drawStyle; -} - -void GLAPIENTRY -gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, - GLdouble height, GLint slices, GLint stacks) -{ - GLint i,j; - GLfloat sinCache[CACHE_SIZE]; - GLfloat cosCache[CACHE_SIZE]; - GLfloat sinCache2[CACHE_SIZE]; - GLfloat cosCache2[CACHE_SIZE]; - GLfloat sinCache3[CACHE_SIZE]; - GLfloat cosCache3[CACHE_SIZE]; - GLfloat angle; - GLfloat zLow, zHigh; - GLfloat sintemp, costemp; - GLfloat length; - GLfloat deltaRadius; - GLfloat zNormal; - GLfloat xyNormalRatio; - GLfloat radiusLow, radiusHigh; - int needCache2, needCache3; - - if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; - - if (slices < 2 || stacks < 1 || baseRadius < 0.0 || topRadius < 0.0 || - height < 0.0) { - gluQuadricError(qobj, GLU_INVALID_VALUE); - return; - } - - /* Compute length (needed for normal calculations) */ - deltaRadius = baseRadius - topRadius; - length = SQRT(deltaRadius*deltaRadius + height*height); - if (length == 0.0) { - gluQuadricError(qobj, GLU_INVALID_VALUE); - return; - } - - /* Cache is the vertex locations cache */ - /* Cache2 is the various normals at the vertices themselves */ - /* Cache3 is the various normals for the faces */ - needCache2 = needCache3 = 0; - if (qobj->normals == GLU_SMOOTH) { - needCache2 = 1; - } - - if (qobj->normals == GLU_FLAT) { - if (qobj->drawStyle != GLU_POINT) { - needCache3 = 1; - } - if (qobj->drawStyle == GLU_LINE) { - needCache2 = 1; - } - } - - zNormal = deltaRadius / length; - xyNormalRatio = height / length; - - for (i = 0; i < slices; i++) { - angle = 2 * PI * i / slices; - if (needCache2) { - if (qobj->orientation == GLU_OUTSIDE) { - sinCache2[i] = xyNormalRatio * SIN(angle); - cosCache2[i] = xyNormalRatio * COS(angle); - } else { - sinCache2[i] = -xyNormalRatio * SIN(angle); - cosCache2[i] = -xyNormalRatio * COS(angle); - } - } - sinCache[i] = SIN(angle); - cosCache[i] = COS(angle); - } - - if (needCache3) { - for (i = 0; i < slices; i++) { - angle = 2 * PI * (i-0.5) / slices; - if (qobj->orientation == GLU_OUTSIDE) { - sinCache3[i] = xyNormalRatio * SIN(angle); - cosCache3[i] = xyNormalRatio * COS(angle); - } else { - sinCache3[i] = -xyNormalRatio * SIN(angle); - cosCache3[i] = -xyNormalRatio * COS(angle); - } - } - } - - sinCache[slices] = sinCache[0]; - cosCache[slices] = cosCache[0]; - if (needCache2) { - sinCache2[slices] = sinCache2[0]; - cosCache2[slices] = cosCache2[0]; - } - if (needCache3) { - sinCache3[slices] = sinCache3[0]; - cosCache3[slices] = cosCache3[0]; - } - - switch (qobj->drawStyle) { - case GLU_FILL: - /* Note: - ** An argument could be made for using a TRIANGLE_FAN for the end - ** of the cylinder of either radii is 0.0 (a cone). However, a - ** TRIANGLE_FAN would not work in smooth shading mode (the common - ** case) because the normal for the apex is different for every - ** triangle (and TRIANGLE_FAN doesn't let me respecify that normal). - ** Now, my choice is GL_TRIANGLES, or leave the GL_QUAD_STRIP and - ** just let the GL trivially reject one of the two triangles of the - ** QUAD. GL_QUAD_STRIP is probably faster, so I will leave this code - ** alone. - */ - for (j = 0; j < stacks; j++) { - zLow = j * height / stacks; - zHigh = (j + 1) * height / stacks; - radiusLow = baseRadius - deltaRadius * ((float) j / stacks); - radiusHigh = baseRadius - deltaRadius * ((float) (j + 1) / stacks); - - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - glNormal3f(sinCache3[i], cosCache3[i], zNormal); - break; - case GLU_SMOOTH: - glNormal3f(sinCache2[i], cosCache2[i], zNormal); - break; - case GLU_NONE: - default: - break; - } - if (qobj->orientation == GLU_OUTSIDE) { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], zLow); - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) (j+1) / stacks); - } - glVertex3f(radiusHigh * sinCache[i], - radiusHigh * cosCache[i], zHigh); - } else { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) (j+1) / stacks); - } - glVertex3f(radiusHigh * sinCache[i], - radiusHigh * cosCache[i], zHigh); - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], zLow); - } - } - glEnd(); - } - break; - case GLU_POINT: - glBegin(GL_POINTS); - for (i = 0; i < slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - glNormal3f(sinCache2[i], cosCache2[i], zNormal); - break; - case GLU_NONE: - default: - break; - } - sintemp = sinCache[i]; - costemp = cosCache[i]; - for (j = 0; j <= stacks; j++) { - zLow = j * height / stacks; - radiusLow = baseRadius - deltaRadius * ((float) j / stacks); - - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sintemp, - radiusLow * costemp, zLow); - } - } - glEnd(); - break; - case GLU_LINE: - for (j = 1; j < stacks; j++) { - zLow = j * height / stacks; - radiusLow = baseRadius - deltaRadius * ((float) j / stacks); - - glBegin(GL_LINE_STRIP); - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - glNormal3f(sinCache3[i], cosCache3[i], zNormal); - break; - case GLU_SMOOTH: - glNormal3f(sinCache2[i], cosCache2[i], zNormal); - break; - case GLU_NONE: - default: - break; - } - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], zLow); - } - glEnd(); - } - /* Intentionally fall through here... */ - case GLU_SILHOUETTE: - for (j = 0; j <= stacks; j += stacks) { - zLow = j * height / stacks; - radiusLow = baseRadius - deltaRadius * ((float) j / stacks); - - glBegin(GL_LINE_STRIP); - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - glNormal3f(sinCache3[i], cosCache3[i], zNormal); - break; - case GLU_SMOOTH: - glNormal3f(sinCache2[i], cosCache2[i], zNormal); - break; - case GLU_NONE: - default: - break; - } - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], - zLow); - } - glEnd(); - } - for (i = 0; i < slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - glNormal3f(sinCache2[i], cosCache2[i], 0.0); - break; - case GLU_NONE: - default: - break; - } - sintemp = sinCache[i]; - costemp = cosCache[i]; - glBegin(GL_LINE_STRIP); - for (j = 0; j <= stacks; j++) { - zLow = j * height / stacks; - radiusLow = baseRadius - deltaRadius * ((float) j / stacks); - - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - (float) j / stacks); - } - glVertex3f(radiusLow * sintemp, - radiusLow * costemp, zLow); - } - glEnd(); - } - break; - default: - break; - } -} - -void GLAPIENTRY -gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, - GLint slices, GLint loops) -{ - gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, 0.0, 360.0); -} - -void GLAPIENTRY -gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, - GLdouble outerRadius, GLint slices, GLint loops, - GLdouble startAngle, GLdouble sweepAngle) -{ - GLint i,j; - GLfloat sinCache[CACHE_SIZE]; - GLfloat cosCache[CACHE_SIZE]; - GLfloat angle; - GLfloat sintemp, costemp; - GLfloat deltaRadius; - GLfloat radiusLow, radiusHigh; - GLfloat texLow = 0.0, texHigh = 0.0; - GLfloat angleOffset; - GLint slices2; - GLint finish; - - if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; - if (slices < 2 || loops < 1 || outerRadius <= 0.0 || innerRadius < 0.0 || - innerRadius > outerRadius) { - gluQuadricError(qobj, GLU_INVALID_VALUE); - return; - } - - if (sweepAngle < -360.0) sweepAngle = 360.0; - if (sweepAngle > 360.0) sweepAngle = 360.0; - if (sweepAngle < 0) { - startAngle += sweepAngle; - sweepAngle = -sweepAngle; - } - - if (sweepAngle == 360.0) { - slices2 = slices; - } else { - slices2 = slices + 1; - } - - /* Compute length (needed for normal calculations) */ - deltaRadius = outerRadius - innerRadius; - - /* Cache is the vertex locations cache */ - - angleOffset = startAngle / 180.0 * PI; - for (i = 0; i <= slices; i++) { - angle = angleOffset + ((PI * sweepAngle) / 180.0) * i / slices; - sinCache[i] = SIN(angle); - cosCache[i] = COS(angle); - } - - if (sweepAngle == 360.0) { - sinCache[slices] = sinCache[0]; - cosCache[slices] = cosCache[0]; - } - - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - if (qobj->orientation == GLU_OUTSIDE) { - glNormal3f(0.0, 0.0, 1.0); - } else { - glNormal3f(0.0, 0.0, -1.0); - } - break; - default: - case GLU_NONE: - break; - } - - switch (qobj->drawStyle) { - case GLU_FILL: - if (innerRadius == 0.0) { - finish = loops - 1; - /* Triangle strip for inner polygons */ - glBegin(GL_TRIANGLE_FAN); - if (qobj->textureCoords) { - glTexCoord2f(0.5, 0.5); - } - glVertex3f(0.0, 0.0, 0.0); - radiusLow = outerRadius - - deltaRadius * ((float) (loops-1) / loops); - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - } - - if (qobj->orientation == GLU_OUTSIDE) { - for (i = slices; i >= 0; i--) { - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - } - } else { - for (i = 0; i <= slices; i++) { - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - } - } - glEnd(); - } else { - finish = loops; - } - for (j = 0; j < finish; j++) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops); - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - texHigh = radiusHigh / outerRadius / 2; - } - - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - if (qobj->orientation == GLU_OUTSIDE) { - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - - if (qobj->textureCoords) { - glTexCoord2f(texHigh * sinCache[i] + 0.5, - texHigh * cosCache[i] + 0.5); - } - glVertex3f(radiusHigh * sinCache[i], - radiusHigh * cosCache[i], 0.0); - } else { - if (qobj->textureCoords) { - glTexCoord2f(texHigh * sinCache[i] + 0.5, - texHigh * cosCache[i] + 0.5); - } - glVertex3f(radiusHigh * sinCache[i], - radiusHigh * cosCache[i], 0.0); - - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - } - } - glEnd(); - } - break; - case GLU_POINT: - glBegin(GL_POINTS); - for (i = 0; i < slices2; i++) { - sintemp = sinCache[i]; - costemp = cosCache[i]; - for (j = 0; j <= loops; j++) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); - } - } - glEnd(); - break; - case GLU_LINE: - if (innerRadius == outerRadius) { - glBegin(GL_LINE_STRIP); - - for (i = 0; i <= slices; i++) { - if (qobj->textureCoords) { - glTexCoord2f(sinCache[i] / 2 + 0.5, - cosCache[i] / 2 + 0.5); - } - glVertex3f(innerRadius * sinCache[i], - innerRadius * cosCache[i], 0.0); - } - glEnd(); - break; - } - for (j = 0; j <= loops; j++) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - } - - glBegin(GL_LINE_STRIP); - for (i = 0; i <= slices; i++) { - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - } - glEnd(); - } - for (i=0; i < slices2; i++) { - sintemp = sinCache[i]; - costemp = cosCache[i]; - glBegin(GL_LINE_STRIP); - for (j = 0; j <= loops; j++) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - } - - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); - } - glEnd(); - } - break; - case GLU_SILHOUETTE: - if (sweepAngle < 360.0) { - for (i = 0; i <= slices; i+= slices) { - sintemp = sinCache[i]; - costemp = cosCache[i]; - glBegin(GL_LINE_STRIP); - for (j = 0; j <= loops; j++) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0); - } - glEnd(); - } - } - for (j = 0; j <= loops; j += loops) { - radiusLow = outerRadius - deltaRadius * ((float) j / loops); - if (qobj->textureCoords) { - texLow = radiusLow / outerRadius / 2; - } - - glBegin(GL_LINE_STRIP); - for (i = 0; i <= slices; i++) { - if (qobj->textureCoords) { - glTexCoord2f(texLow * sinCache[i] + 0.5, - texLow * cosCache[i] + 0.5); - } - glVertex3f(radiusLow * sinCache[i], - radiusLow * cosCache[i], 0.0); - } - glEnd(); - if (innerRadius == outerRadius) break; - } - break; - default: - break; - } -} - -void GLAPIENTRY -gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) -{ - GLint i,j; - GLfloat sinCache1a[CACHE_SIZE]; - GLfloat cosCache1a[CACHE_SIZE]; - GLfloat sinCache2a[CACHE_SIZE]; - GLfloat cosCache2a[CACHE_SIZE]; - GLfloat sinCache3a[CACHE_SIZE]; - GLfloat cosCache3a[CACHE_SIZE]; - GLfloat sinCache1b[CACHE_SIZE]; - GLfloat cosCache1b[CACHE_SIZE]; - GLfloat sinCache2b[CACHE_SIZE]; - GLfloat cosCache2b[CACHE_SIZE]; - GLfloat sinCache3b[CACHE_SIZE]; - GLfloat cosCache3b[CACHE_SIZE]; - GLfloat angle; - GLfloat zLow, zHigh; - GLfloat sintemp1 = 0.0, sintemp2 = 0.0, sintemp3 = 0.0, sintemp4 = 0.0; - GLfloat costemp1 = 0.0, costemp2 = 0.0, costemp3 = 0.0, costemp4 = 0.0; - GLboolean needCache2, needCache3; - GLint start, finish; - - if (slices >= CACHE_SIZE) slices = CACHE_SIZE-1; - if (stacks >= CACHE_SIZE) stacks = CACHE_SIZE-1; - if (slices < 2 || stacks < 1 || radius < 0.0) { - gluQuadricError(qobj, GLU_INVALID_VALUE); - return; - } - - /* Cache is the vertex locations cache */ - /* Cache2 is the various normals at the vertices themselves */ - /* Cache3 is the various normals for the faces */ - needCache2 = needCache3 = GL_FALSE; - - if (qobj->normals == GLU_SMOOTH) { - needCache2 = GL_TRUE; - } - - if (qobj->normals == GLU_FLAT) { - if (qobj->drawStyle != GLU_POINT) { - needCache3 = GL_TRUE; - } - if (qobj->drawStyle == GLU_LINE) { - needCache2 = GL_TRUE; - } - } - - for (i = 0; i < slices; i++) { - angle = 2 * PI * i / slices; - sinCache1a[i] = SIN(angle); - cosCache1a[i] = COS(angle); - if (needCache2) { - sinCache2a[i] = sinCache1a[i]; - cosCache2a[i] = cosCache1a[i]; - } - } - - for (j = 0; j <= stacks; j++) { - angle = PI * j / stacks; - if (needCache2) { - if (qobj->orientation == GLU_OUTSIDE) { - sinCache2b[j] = SIN(angle); - cosCache2b[j] = COS(angle); - } else { - sinCache2b[j] = -SIN(angle); - cosCache2b[j] = -COS(angle); - } - } - sinCache1b[j] = radius * SIN(angle); - cosCache1b[j] = radius * COS(angle); - } - /* Make sure it comes to a point */ - sinCache1b[0] = 0; - sinCache1b[stacks] = 0; - - if (needCache3) { - for (i = 0; i < slices; i++) { - angle = 2 * PI * (i-0.5) / slices; - sinCache3a[i] = SIN(angle); - cosCache3a[i] = COS(angle); - } - for (j = 0; j <= stacks; j++) { - angle = PI * (j - 0.5) / stacks; - if (qobj->orientation == GLU_OUTSIDE) { - sinCache3b[j] = SIN(angle); - cosCache3b[j] = COS(angle); - } else { - sinCache3b[j] = -SIN(angle); - cosCache3b[j] = -COS(angle); - } - } - } - - sinCache1a[slices] = sinCache1a[0]; - cosCache1a[slices] = cosCache1a[0]; - if (needCache2) { - sinCache2a[slices] = sinCache2a[0]; - cosCache2a[slices] = cosCache2a[0]; - } - if (needCache3) { - sinCache3a[slices] = sinCache3a[0]; - cosCache3a[slices] = cosCache3a[0]; - } - - switch (qobj->drawStyle) { - case GLU_FILL: - /* Do ends of sphere as TRIANGLE_FAN's (if not texturing) - ** We don't do it when texturing because we need to respecify the - ** texture coordinates of the apex for every adjacent vertex (because - ** it isn't a constant for that point) - */ - if (!(qobj->textureCoords)) { - start = 1; - finish = stacks - 1; - - /* Low end first (j == 0 iteration) */ - sintemp2 = sinCache1b[1]; - zHigh = cosCache1b[1]; - switch(qobj->normals) { - case GLU_FLAT: - sintemp3 = sinCache3b[1]; - costemp3 = cosCache3b[1]; - break; - case GLU_SMOOTH: - sintemp3 = sinCache2b[1]; - costemp3 = cosCache2b[1]; - glNormal3f(sinCache2a[0] * sinCache2b[0], - cosCache2a[0] * sinCache2b[0], - cosCache2b[0]); - break; - default: - break; - } - glBegin(GL_TRIANGLE_FAN); - glVertex3f(0.0, 0.0, radius); - if (qobj->orientation == GLU_OUTSIDE) { - for (i = slices; i >= 0; i--) { - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp3, - cosCache2a[i] * sintemp3, - costemp3); - break; - case GLU_FLAT: - if (i != slices) { - glNormal3f(sinCache3a[i+1] * sintemp3, - cosCache3a[i+1] * sintemp3, - costemp3); - } - break; - case GLU_NONE: - default: - break; - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } - } else { - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp3, - cosCache2a[i] * sintemp3, - costemp3); - break; - case GLU_FLAT: - glNormal3f(sinCache3a[i] * sintemp3, - cosCache3a[i] * sintemp3, - costemp3); - break; - case GLU_NONE: - default: - break; - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } - } - glEnd(); - - /* High end next (j == stacks-1 iteration) */ - sintemp2 = sinCache1b[stacks-1]; - zHigh = cosCache1b[stacks-1]; - switch(qobj->normals) { - case GLU_FLAT: - sintemp3 = sinCache3b[stacks]; - costemp3 = cosCache3b[stacks]; - break; - case GLU_SMOOTH: - sintemp3 = sinCache2b[stacks-1]; - costemp3 = cosCache2b[stacks-1]; - glNormal3f(sinCache2a[stacks] * sinCache2b[stacks], - cosCache2a[stacks] * sinCache2b[stacks], - cosCache2b[stacks]); - break; - default: - break; - } - glBegin(GL_TRIANGLE_FAN); - glVertex3f(0.0, 0.0, -radius); - if (qobj->orientation == GLU_OUTSIDE) { - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp3, - cosCache2a[i] * sintemp3, - costemp3); - break; - case GLU_FLAT: - glNormal3f(sinCache3a[i] * sintemp3, - cosCache3a[i] * sintemp3, - costemp3); - break; - case GLU_NONE: - default: - break; - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } - } else { - for (i = slices; i >= 0; i--) { - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp3, - cosCache2a[i] * sintemp3, - costemp3); - break; - case GLU_FLAT: - if (i != slices) { - glNormal3f(sinCache3a[i+1] * sintemp3, - cosCache3a[i+1] * sintemp3, - costemp3); - } - break; - case GLU_NONE: - default: - break; - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } - } - glEnd(); - } else { - start = 0; - finish = stacks; - } - for (j = start; j < finish; j++) { - zLow = cosCache1b[j]; - zHigh = cosCache1b[j+1]; - sintemp1 = sinCache1b[j]; - sintemp2 = sinCache1b[j+1]; - switch(qobj->normals) { - case GLU_FLAT: - sintemp4 = sinCache3b[j+1]; - costemp4 = cosCache3b[j+1]; - break; - case GLU_SMOOTH: - if (qobj->orientation == GLU_OUTSIDE) { - sintemp3 = sinCache2b[j+1]; - costemp3 = cosCache2b[j+1]; - sintemp4 = sinCache2b[j]; - costemp4 = cosCache2b[j]; - } else { - sintemp3 = sinCache2b[j]; - costemp3 = cosCache2b[j]; - sintemp4 = sinCache2b[j+1]; - costemp4 = cosCache2b[j+1]; - } - break; - default: - break; - } - - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp3, - cosCache2a[i] * sintemp3, - costemp3); - break; - case GLU_FLAT: - case GLU_NONE: - default: - break; - } - if (qobj->orientation == GLU_OUTSIDE) { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) (j+1) / stacks); - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } else { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) j / stacks); - } - glVertex3f(sintemp1 * sinCache1a[i], - sintemp1 * cosCache1a[i], zLow); - } - switch(qobj->normals) { - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp4, - cosCache2a[i] * sintemp4, - costemp4); - break; - case GLU_FLAT: - glNormal3f(sinCache3a[i] * sintemp4, - cosCache3a[i] * sintemp4, - costemp4); - break; - case GLU_NONE: - default: - break; - } - if (qobj->orientation == GLU_OUTSIDE) { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) j / stacks); - } - glVertex3f(sintemp1 * sinCache1a[i], - sintemp1 * cosCache1a[i], zLow); - } else { - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) (j+1) / stacks); - } - glVertex3f(sintemp2 * sinCache1a[i], - sintemp2 * cosCache1a[i], zHigh); - } - } - glEnd(); - } - break; - case GLU_POINT: - glBegin(GL_POINTS); - for (j = 0; j <= stacks; j++) { - sintemp1 = sinCache1b[j]; - costemp1 = cosCache1b[j]; - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - sintemp2 = sinCache2b[j]; - costemp2 = cosCache2b[j]; - break; - default: - break; - } - for (i = 0; i < slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp2, - cosCache2a[i] * sintemp2, - costemp2); - break; - case GLU_NONE: - default: - break; - } - - zLow = j * radius / stacks; - - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) j / stacks); - } - glVertex3f(sintemp1 * sinCache1a[i], - sintemp1 * cosCache1a[i], costemp1); - } - } - glEnd(); - break; - case GLU_LINE: - case GLU_SILHOUETTE: - for (j = 1; j < stacks; j++) { - sintemp1 = sinCache1b[j]; - costemp1 = cosCache1b[j]; - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - sintemp2 = sinCache2b[j]; - costemp2 = cosCache2b[j]; - break; - default: - break; - } - - glBegin(GL_LINE_STRIP); - for (i = 0; i <= slices; i++) { - switch(qobj->normals) { - case GLU_FLAT: - glNormal3f(sinCache3a[i] * sintemp2, - cosCache3a[i] * sintemp2, - costemp2); - break; - case GLU_SMOOTH: - glNormal3f(sinCache2a[i] * sintemp2, - cosCache2a[i] * sintemp2, - costemp2); - break; - case GLU_NONE: - default: - break; - } - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) j / stacks); - } - glVertex3f(sintemp1 * sinCache1a[i], - sintemp1 * cosCache1a[i], costemp1); - } - glEnd(); - } - for (i = 0; i < slices; i++) { - sintemp1 = sinCache1a[i]; - costemp1 = cosCache1a[i]; - switch(qobj->normals) { - case GLU_FLAT: - case GLU_SMOOTH: - sintemp2 = sinCache2a[i]; - costemp2 = cosCache2a[i]; - break; - default: - break; - } - - glBegin(GL_LINE_STRIP); - for (j = 0; j <= stacks; j++) { - switch(qobj->normals) { - case GLU_FLAT: - glNormal3f(sintemp2 * sinCache3b[j], - costemp2 * sinCache3b[j], - cosCache3b[j]); - break; - case GLU_SMOOTH: - glNormal3f(sintemp2 * sinCache2b[j], - costemp2 * sinCache2b[j], - cosCache2b[j]); - break; - case GLU_NONE: - default: - break; - } - - if (qobj->textureCoords) { - glTexCoord2f(1 - (float) i / slices, - 1 - (float) j / stacks); - } - glVertex3f(sintemp1 * sinCache1b[j], - costemp1 * sinCache1b[j], cosCache1b[j]); - } - glEnd(); - } - break; - default: - break; - } -} diff --git a/src/libs/mesa/glu/libutil/registry.c b/src/libs/mesa/glu/libutil/registry.c deleted file mode 100644 index 2e3b574fb0..0000000000 --- a/src/libs/mesa/glu/libutil/registry.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. 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 including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * 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 - * SILICON GRAPHICS, INC. 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. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "gluos.h" -#include -#include -#include -#include - -static const GLubyte versionString[] = "1.3"; -static const GLubyte extensionString[] = - "GLU_EXT_nurbs_tessellator " - "GLU_EXT_object_space_tess " - ; - -const GLubyte * GLAPIENTRY -gluGetString(GLenum name) -{ - - if (name == GLU_VERSION) { - return versionString; - } else if (name == GLU_EXTENSIONS) { - return extensionString; - } - return NULL; -} - -/* extName is an extension name. - * extString is a string of extensions separated by blank(s). There may or - * may not be leading or trailing blank(s) in extString. - * This works in cases of extensions being prefixes of another like - * GL_EXT_texture and GL_EXT_texture3D. - * Returns GL_TRUE if extName is found otherwise it returns GL_FALSE. - */ -GLboolean GLAPIENTRY -gluCheckExtension(const GLubyte *extName, const GLubyte *extString) -{ - GLboolean flag = GL_FALSE; - char *word; - char *lookHere; - char *deleteThis; - - if (extString == NULL) return GL_FALSE; - - deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); - if (lookHere == NULL) - return GL_FALSE; - /* strtok() will modify string, so copy it somewhere */ - strcpy(lookHere,(const char *)extString); - - while ((word= strtok(lookHere," ")) != NULL) { - if (strcmp(word,(const char *)extName) == 0) { - flag = GL_TRUE; - break; - } - lookHere = NULL; /* get next token */ - } - free((void *)deleteThis); - return flag; -} /* gluCheckExtension() */ - - - -/*** registry.c ***/ diff --git a/src/libs/mesa/mesa/Jamfile b/src/libs/mesa/mesa/Jamfile deleted file mode 100644 index f211170b48..0000000000 --- a/src/libs/mesa/mesa/Jamfile +++ /dev/null @@ -1,370 +0,0 @@ -SubDir HAIKU_TOP src libs mesa mesa ; - -SetSubDirSupportedPlatformsBeOSCompatible ; - -if $(TARGET_PLATFORM) != haiku { - UseHeaders [ FDirName $(HAIKU_TOP) headers os opengl ] : true ; - # We need our not platform one, public GL headers also when not compiling for Haiku. -} - -# Don't compile libmesa.a with debugging. -DEBUG = 0 ; - -UseLibraryHeaders mesa ; - -UseHeaders [ FDirName $(SUBDIR) main ] ; -UseHeaders [ FDirName $(SUBDIR) glapi ] ; -UseHeaders [ FDirName $(SUBDIR) math ] ; -UseHeaders [ FDirName $(SUBDIR) tnl ] ; -UseHeaders [ FDirName $(SUBDIR) shader ] ; -UseHeaders [ FDirName $(SUBDIR) shader grammar ] ; -UseHeaders [ FDirName $(SUBDIR) shader slang ] ; -UseHeaders [ FDirName $(SUBDIR) swrast ] ; -UseHeaders [ FDirName $(SUBDIR) swrast_setup ] ; -UseHeaders [ FDirName $(SUBDIR) vbo ] ; - -SEARCH_SOURCE += [ FDirName $(SUBDIR) drivers common ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) glapi ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) main ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) math ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) shader ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) shader grammar ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) shader slang ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) swrast ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) swrast_setup ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) tnl ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) vbo ] ; -SEARCH_SOURCE += [ FDirName $(SUBDIR) $(TARGET_ARCH) ] ; - -UsePublicObjectHeaders gen_matypes : opengl ; - -BuildPlatformMain gen_matypes : - gen_matypes.c ; - -rule MkMaTypes header -{ - header = [ FGristFiles $(header) ] ; - - # generate the intermediate header - local intermediateHeader = $(header:S=.h.cpp) ; - MakeLocateArch $(intermediateHeader) ; - Depends $(intermediateHeader) : gen_matypes ; - MkMaTypes1 $(intermediateHeader) : gen_matypes ; - LocalClean clean : $(intermediateHeader) ; - - # generate the final header - TARGET_HDRS on $(header) = [ on $(header) return $(TARGET_HDRS) ] - $(TARGET_PRIVATE_SYSTEM_HEADERS) ; - CreateAsmStructOffsetsHeader $(header) : $(intermediateHeader) ; -} - -actions MkMaTypes1 -{ - $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR); - $(2) > $(1) ; -} - - -{ - local defines ; - defines = BEOS_THREADS GNU_ASSEMBLER ; - - if $(TARGET_ARCH) = x86 { - defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; - } else if $(TARGET_ARCH) = ppc { - # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! - # defines += USE_PPC_ASM ; - } else if $(TARGET_ARCH) = sparc { - defines += USE_SPARC_ASM ; - } - - defines = [ FDefines $(defines) ] ; - SubDirCcFlags $(defines) ; - SubDirC++Flags $(defines) ; - SubDirAsFlags $(defines) ; -} - -local arch_sources ; -if $(TARGET_ARCH) = x86 { - - MkMaTypes matypes.h ; - - arch_sources = - common_x86.c - common_x86_asm.S - - x86.c - x86_xform2.S - x86_xform3.S - x86_xform4.S - x86_cliptest.S - mmx_blend.S - 3dnow.c - 3dnow_xform1.S - 3dnow_xform2.S - 3dnow_xform3.S - 3dnow_xform4.S - 3dnow_normal.S - sse.c - sse_xform1.S - sse_xform2.S - sse_xform3.S - sse_xform4.S - sse_normal.S - read_rgba_span_x86.S - - t_vertex_sse.c - - x86sse.c - ; - - Includes [ FGristFiles $(arch_sources) ] : [ FGristFiles matypes.h ] ; - - SEARCH_SOURCE += [ FDirName $(SUBDIR) x86 rtasm ] ; - -} else if $(TARGET_ARCH) = ppc { - - arch_sources = - common_ppc.c - ; - - SEARCH_SOURCE += [ FDirName $(SUBDIR) ppc ] ; - -} else if $(TARGET_ARCH) = sparc { - - arch_sources = - sparc.c - clip.S - norm.S - xform.S - ; - - SEARCH_SOURCE += [ FDirName $(SUBDIR) sparc ] ; - -} - - -StaticLibrary libmesa.a : - - # main - api_arrayelt.c - api_exec.c - api_loopback.c - api_noop.c - api_validate.c - accum.c - arrayobj.c - attrib.c - blend.c - bufferobj.c - buffers.c - clear.c - clip.c - colortab.c - context.c - convolve.c - debug.c - depth.c - depthstencil.c - dlist.c - dlopen.c - drawpix.c - driverfuncs.c - enable.c - enums.c - eval.c - execmem.c - extensions.c - fbobject.c - feedback.c - ffvertex_prog.c - fog.c - framebuffer.c - get.c - getstring.c - hash.c - hint.c - histogram.c - image.c - imports.c - light.c - lines.c - matrix.c - mipmap.c - multisample.c - pixel.c - pixelstore.c - points.c - polygon.c - queryobj.c - rastpos.c - readpix.c - renderbuffer.c - scissor.c - shaders.c - state.c - stencil.c - texcompress.c - texcompress_s3tc.c - texcompress_fxt1.c - texenv.c - texenvprogram.c - texgen.c - texformat.c - teximage.c - texobj.c - texparam.c - texrender.c - texstate.c - texstore.c - varray.c - vtxfmt.c - - # math - m_debug_clip.c - m_debug_norm.c - m_debug_xform.c - m_eval.c - m_matrix.c - m_translate.c - m_vector.c - m_xform.c - - # tnl - t_context.c - t_draw.c - t_pipeline.c - t_rasterpos.c - t_vb_cull.c - t_vb_fog.c - t_vb_light.c - t_vb_normals.c - t_vb_points.c - t_vb_program.c - t_vb_render.c - t_vb_texgen.c - t_vb_texmat.c - t_vb_vertex.c - t_vp_build.c - t_vertex.c - t_vertex_generic.c - - # swrast - s_aaline.c - s_aatriangle.c - s_accum.c - s_alpha.c - s_atifragshader.c - s_bitmap.c - s_blend.c - s_blit.c - s_buffers.c - s_copypix.c - s_context.c - s_depth.c - s_drawpix.c - s_feedback.c - s_fog.c - s_fragprog.c - s_imaging.c - s_lines.c - s_logic.c - s_masking.c - s_points.c - s_readpix.c - s_span.c - s_stencil.c - s_texcombine.c - s_texfilter.c - s_texstore.c - s_triangle.c - s_zoom.c - - # swrast_setup - ss_context.c - ss_triangle.c - - # shader - arbprogparse.c - arbprogram.c - atifragshader.c - nvfragparse.c - nvprogram.c - nvvertparse.c - prog_cache.c - prog_execute.c - prog_instruction.c - prog_noise.c - prog_parameter.c - prog_print.c - prog_statevars.c - prog_uniform.c - program.c - programopt.c - shader_api.c - - # shader/grammar - grammar_mesa.c - - # shader/slang - slang_builtin.c - slang_codegen.c - slang_compile.c - slang_compile_function.c - slang_compile_operation.c - slang_compile_struct.c - slang_compile_variable.c - slang_emit.c - slang_ir.c - slang_label.c - slang_link.c - slang_log.c - slang_mem.c - slang_preprocess.c - slang_print.c - slang_simplify.c - slang_storage.c - slang_typeinfo.c - slang_utility.c - slang_vartable.c - - # vbo - vbo_context.c - vbo_exec.c - vbo_exec_api.c - vbo_exec_array.c - vbo_exec_draw.c - vbo_exec_eval.c - vbo_rebase.c - vbo_save.c - vbo_save_api.c - vbo_save_draw.c - vbo_save_loopback.c - vbo_split.c - vbo_split_copy.c - vbo_split_inplace.c - - # arch specific assembly optimization - $(arch_sources) -; - - -local arch_sources ; -# Use the faster GL API dispatching assembly code for the platform, if any! -if $(TARGET_ARCH) = x86 { - arch_sources = glapi_x86.S ; -} else if $(TARGET_ARCH) = sparc { - arch_sources = glapi_sparc.S ; -} else { - arch_sources = ; -} - -MergeObject glapi-dispatching.o : - - glapi.c - glapi_getproc.c - glthread.c - - $(arch_sources) -; - diff --git a/src/libs/mesa/mesa/drivers/common/driverfuncs.c b/src/libs/mesa/mesa/drivers/common/driverfuncs.c deleted file mode 100644 index 986f751bdc..0000000000 --- a/src/libs/mesa/mesa/drivers/common/driverfuncs.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/arrayobj.h" -#include "main/buffers.h" -#include "main/context.h" -#include "main/framebuffer.h" -#include "main/mipmap.h" -#include "main/queryobj.h" -#include "main/renderbuffer.h" -#include "main/texcompress.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texobj.h" -#include "main/texstore.h" -#if FEATURE_ARB_vertex_buffer_object -#include "main/bufferobj.h" -#endif -#if FEATURE_EXT_framebuffer_object -#include "main/fbobject.h" -#include "main/texrender.h" -#endif - -#include "shader/program.h" -#include "shader/prog_execute.h" -#include "shader/shader_api.h" -#include "tnl/tnl.h" -#include "swrast/swrast.h" - -#include "driverfuncs.h" - - - -/** - * Plug in default functions for all pointers in the dd_function_table - * structure. - * Device drivers should call this function and then plug in any - * functions which it wants to override. - * Some functions (pointers) MUST be implemented by all drivers (REQUIRED). - * - * \param table the dd_function_table to initialize - */ -void -_mesa_init_driver_functions(struct dd_function_table *driver) -{ - _mesa_bzero(driver, sizeof(*driver)); - - driver->GetString = NULL; /* REQUIRED! */ - driver->UpdateState = NULL; /* REQUIRED! */ - driver->GetBufferSize = NULL; /* REQUIRED! */ - driver->ResizeBuffers = _mesa_resize_framebuffer; - driver->Error = NULL; - - driver->Finish = NULL; - driver->Flush = NULL; - - /* framebuffer/image functions */ - driver->Clear = _swrast_Clear; - driver->Accum = _swrast_Accum; - driver->RasterPos = _tnl_RasterPos; - driver->DrawPixels = _swrast_DrawPixels; - driver->ReadPixels = _swrast_ReadPixels; - driver->CopyPixels = _swrast_CopyPixels; - driver->Bitmap = _swrast_Bitmap; - - /* Texture functions */ - driver->ChooseTextureFormat = _mesa_choose_tex_format; - driver->TexImage1D = _mesa_store_teximage1d; - driver->TexImage2D = _mesa_store_teximage2d; - driver->TexImage3D = _mesa_store_teximage3d; - driver->TexSubImage1D = _mesa_store_texsubimage1d; - driver->TexSubImage2D = _mesa_store_texsubimage2d; - driver->TexSubImage3D = _mesa_store_texsubimage3d; - driver->GetTexImage = _mesa_get_teximage; - driver->CopyTexImage1D = _swrast_copy_teximage1d; - driver->CopyTexImage2D = _swrast_copy_teximage2d; - driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; - driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; - driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; - driver->GenerateMipmap = _mesa_generate_mipmap; - driver->TestProxyTexImage = _mesa_test_proxy_teximage; - driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; - driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; - driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d; - driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; - driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; - driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; - driver->GetCompressedTexImage = _mesa_get_compressed_teximage; - driver->CompressedTextureSize = _mesa_compressed_texture_size; - driver->BindTexture = NULL; - driver->NewTextureObject = _mesa_new_texture_object; - driver->DeleteTexture = _mesa_delete_texture_object; - driver->NewTextureImage = _mesa_new_texture_image; - driver->FreeTexImageData = _mesa_free_texture_image_data; - driver->MapTexture = NULL; - driver->UnmapTexture = NULL; - driver->TextureMemCpy = _mesa_memcpy; - driver->IsTextureResident = NULL; - driver->PrioritizeTexture = NULL; - driver->ActiveTexture = NULL; - driver->UpdateTexturePalette = NULL; - - /* imaging */ - driver->CopyColorTable = _swrast_CopyColorTable; - driver->CopyColorSubTable = _swrast_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - - /* Vertex/fragment programs */ - driver->BindProgram = NULL; - driver->NewProgram = _mesa_new_program; - driver->DeleteProgram = _mesa_delete_program; -#if FEATURE_MESA_program_debug - driver->GetProgramRegister = _mesa_get_program_register; -#endif /* FEATURE_MESA_program_debug */ - - /* simple state commands */ - driver->AlphaFunc = NULL; - driver->BlendColor = NULL; - driver->BlendEquationSeparate = NULL; - driver->BlendFuncSeparate = NULL; - driver->ClearColor = NULL; - driver->ClearDepth = NULL; - driver->ClearIndex = NULL; - driver->ClearStencil = NULL; - driver->ClipPlane = NULL; - driver->ColorMask = NULL; - driver->ColorMaterial = NULL; - driver->CullFace = NULL; - driver->DrawBuffer = NULL; - driver->DrawBuffers = NULL; - driver->FrontFace = NULL; - driver->DepthFunc = NULL; - driver->DepthMask = NULL; - driver->DepthRange = NULL; - driver->Enable = NULL; - driver->Fogfv = NULL; - driver->Hint = NULL; - driver->IndexMask = NULL; - driver->Lightfv = NULL; - driver->LightModelfv = NULL; - driver->LineStipple = NULL; - driver->LineWidth = NULL; - driver->LogicOpcode = NULL; - driver->PointParameterfv = NULL; - driver->PointSize = NULL; - driver->PolygonMode = NULL; - driver->PolygonOffset = NULL; - driver->PolygonStipple = NULL; - driver->ReadBuffer = NULL; - driver->RenderMode = NULL; - driver->Scissor = NULL; - driver->ShadeModel = NULL; - driver->StencilFuncSeparate = NULL; - driver->StencilOpSeparate = NULL; - driver->StencilMaskSeparate = NULL; - driver->TexGen = NULL; - driver->TexEnv = NULL; - driver->TexParameter = NULL; - driver->TextureMatrix = NULL; - driver->Viewport = NULL; - - /* vertex arrays */ - driver->VertexPointer = NULL; - driver->NormalPointer = NULL; - driver->ColorPointer = NULL; - driver->FogCoordPointer = NULL; - driver->IndexPointer = NULL; - driver->SecondaryColorPointer = NULL; - driver->TexCoordPointer = NULL; - driver->EdgeFlagPointer = NULL; - driver->VertexAttribPointer = NULL; - driver->LockArraysEXT = NULL; - driver->UnlockArraysEXT = NULL; - - /* state queries */ - driver->GetBooleanv = NULL; - driver->GetDoublev = NULL; - driver->GetFloatv = NULL; - driver->GetIntegerv = NULL; - driver->GetPointerv = NULL; - -#if FEATURE_ARB_vertex_buffer_object - driver->NewBufferObject = _mesa_new_buffer_object; - driver->DeleteBuffer = _mesa_delete_buffer_object; - driver->BindBuffer = NULL; - driver->BufferData = _mesa_buffer_data; - driver->BufferSubData = _mesa_buffer_subdata; - driver->GetBufferSubData = _mesa_buffer_get_subdata; - driver->MapBuffer = _mesa_buffer_map; - driver->UnmapBuffer = _mesa_buffer_unmap; -#endif - -#if FEATURE_EXT_framebuffer_object - driver->NewFramebuffer = _mesa_new_framebuffer; - driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; - driver->RenderTexture = _mesa_render_texture; - driver->FinishRenderTexture = _mesa_finish_render_texture; - driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer; -#endif - -#if FEATURE_EXT_framebuffer_blit - driver->BlitFramebuffer = _swrast_BlitFramebuffer; -#endif - - /* query objects */ - driver->NewQueryObject = _mesa_new_query_object; - driver->DeleteQuery = _mesa_delete_query; - driver->BeginQuery = _mesa_begin_query; - driver->EndQuery = _mesa_end_query; - driver->WaitQuery = _mesa_wait_query; - - /* APPLE_vertex_array_object */ - driver->NewArrayObject = _mesa_new_array_object; - driver->DeleteArrayObject = _mesa_delete_array_object; - driver->BindArrayObject = NULL; - - /* T&L stuff */ - driver->NeedValidate = GL_FALSE; - driver->ValidateTnlModule = NULL; - driver->CurrentExecPrimitive = 0; - driver->CurrentSavePrimitive = 0; - driver->NeedFlush = 0; - driver->SaveNeedFlush = 0; - - driver->ProgramStringNotify = _tnl_program_string; - driver->FlushVertices = NULL; - driver->SaveFlushVertices = NULL; - driver->NotifySaveBegin = NULL; - driver->LightingSpaceChange = NULL; - - /* display list */ - driver->NewList = NULL; - driver->EndList = NULL; - driver->BeginCallList = NULL; - driver->EndCallList = NULL; - - - /* XXX temporary here */ - _mesa_init_glsl_driver_functions(driver); -} - - -/** - * Call the ctx->Driver.* state functions with current values to initialize - * driver state. - * Only the Intel drivers use this so far. - */ -void -_mesa_init_driver_state(GLcontext *ctx) -{ - ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); - - ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); - - ctx->Driver.BlendEquationSeparate(ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); - - ctx->Driver.BlendFuncSeparate(ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, ctx->Color.BlendDstA); - - ctx->Driver.ColorMask(ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); - - ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); - ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); - ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); - - ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); - ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); - ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); - ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); - ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); - ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); - ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); - ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); - ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); - ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); - ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); - ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); - ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); - ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); - ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); - - ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); - ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); - ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); - ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); - ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); - - ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); - - { - GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; - ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); - } - - ctx->Driver.LineWidth(ctx, ctx->Line.Width); - ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); - ctx->Driver.PointSize(ctx, ctx->Point.Size); - ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); - ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); - ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, - ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0]); - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, - ctx->Stencil.Function[1], - ctx->Stencil.Ref[1], - ctx->Stencil.ValueMask[1]); - ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); - ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); - ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, - ctx->Stencil.FailFunc[0], - ctx->Stencil.ZFailFunc[0], - ctx->Stencil.ZPassFunc[0]); - ctx->Driver.StencilOpSeparate(ctx, GL_BACK, - ctx->Stencil.FailFunc[1], - ctx->Stencil.ZFailFunc[1], - ctx->Stencil.ZPassFunc[1]); - - - ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); -} diff --git a/src/libs/mesa/mesa/drivers/common/driverfuncs.h b/src/libs/mesa/mesa/drivers/common/driverfuncs.h deleted file mode 100644 index 4c90ed12f6..0000000000 --- a/src/libs/mesa/mesa/drivers/common/driverfuncs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 DRIVERFUNCS_H -#define DRIVERFUNCS_H - -extern void -_mesa_init_driver_functions(struct dd_function_table *driver); - - -extern void -_mesa_init_driver_state(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/glapi/dispatch.h b/src/libs/mesa/mesa/glapi/dispatch.h deleted file mode 100644 index f019aa6aaf..0000000000 --- a/src/libs/mesa/mesa/glapi/dispatch.h +++ /dev/null @@ -1,3831 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * IBM, - * AND/OR THEIR 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. - */ - -#if !defined( _DISPATCH_H_ ) -# define _DISPATCH_H_ - - -#include "glapitable.h" -/** - * \file dispatch.h - * Macros for handling GL dispatch tables. - * - * For each known GL function, there are 3 macros in this file. The first - * macro is named CALL_FuncName and is used to call that GL function using - * the specified dispatch table. The other 2 macros, called GET_FuncName - * can SET_FuncName, are used to get and set the dispatch pointer for the - * named function in the specified dispatch table. - */ - -#define CALL_by_offset(disp, cast, offset, parameters) \ - (*(cast (GET_by_offset(disp, offset)))) parameters -#define GET_by_offset(disp, offset) \ - (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL -#define SET_by_offset(disp, offset, fn) \ - do { \ - if ( (offset) < 0 ) { \ - /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\n", */ \ - /* __func__, __LINE__, disp, offset, # fn); */ \ - /* abort(); */ \ - } \ - else { \ - ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \ - } \ - } while(0) - -#define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters -#define GET_NewList(disp) ((disp)->NewList) -#define SET_NewList(disp, fn) ((disp)->NewList = fn) -#define CALL_EndList(disp, parameters) (*((disp)->EndList)) parameters -#define GET_EndList(disp) ((disp)->EndList) -#define SET_EndList(disp, fn) ((disp)->EndList = fn) -#define CALL_CallList(disp, parameters) (*((disp)->CallList)) parameters -#define GET_CallList(disp) ((disp)->CallList) -#define SET_CallList(disp, fn) ((disp)->CallList = fn) -#define CALL_CallLists(disp, parameters) (*((disp)->CallLists)) parameters -#define GET_CallLists(disp) ((disp)->CallLists) -#define SET_CallLists(disp, fn) ((disp)->CallLists = fn) -#define CALL_DeleteLists(disp, parameters) (*((disp)->DeleteLists)) parameters -#define GET_DeleteLists(disp) ((disp)->DeleteLists) -#define SET_DeleteLists(disp, fn) ((disp)->DeleteLists = fn) -#define CALL_GenLists(disp, parameters) (*((disp)->GenLists)) parameters -#define GET_GenLists(disp) ((disp)->GenLists) -#define SET_GenLists(disp, fn) ((disp)->GenLists = fn) -#define CALL_ListBase(disp, parameters) (*((disp)->ListBase)) parameters -#define GET_ListBase(disp) ((disp)->ListBase) -#define SET_ListBase(disp, fn) ((disp)->ListBase = fn) -#define CALL_Begin(disp, parameters) (*((disp)->Begin)) parameters -#define GET_Begin(disp) ((disp)->Begin) -#define SET_Begin(disp, fn) ((disp)->Begin = fn) -#define CALL_Bitmap(disp, parameters) (*((disp)->Bitmap)) parameters -#define GET_Bitmap(disp) ((disp)->Bitmap) -#define SET_Bitmap(disp, fn) ((disp)->Bitmap = fn) -#define CALL_Color3b(disp, parameters) (*((disp)->Color3b)) parameters -#define GET_Color3b(disp) ((disp)->Color3b) -#define SET_Color3b(disp, fn) ((disp)->Color3b = fn) -#define CALL_Color3bv(disp, parameters) (*((disp)->Color3bv)) parameters -#define GET_Color3bv(disp) ((disp)->Color3bv) -#define SET_Color3bv(disp, fn) ((disp)->Color3bv = fn) -#define CALL_Color3d(disp, parameters) (*((disp)->Color3d)) parameters -#define GET_Color3d(disp) ((disp)->Color3d) -#define SET_Color3d(disp, fn) ((disp)->Color3d = fn) -#define CALL_Color3dv(disp, parameters) (*((disp)->Color3dv)) parameters -#define GET_Color3dv(disp) ((disp)->Color3dv) -#define SET_Color3dv(disp, fn) ((disp)->Color3dv = fn) -#define CALL_Color3f(disp, parameters) (*((disp)->Color3f)) parameters -#define GET_Color3f(disp) ((disp)->Color3f) -#define SET_Color3f(disp, fn) ((disp)->Color3f = fn) -#define CALL_Color3fv(disp, parameters) (*((disp)->Color3fv)) parameters -#define GET_Color3fv(disp) ((disp)->Color3fv) -#define SET_Color3fv(disp, fn) ((disp)->Color3fv = fn) -#define CALL_Color3i(disp, parameters) (*((disp)->Color3i)) parameters -#define GET_Color3i(disp) ((disp)->Color3i) -#define SET_Color3i(disp, fn) ((disp)->Color3i = fn) -#define CALL_Color3iv(disp, parameters) (*((disp)->Color3iv)) parameters -#define GET_Color3iv(disp) ((disp)->Color3iv) -#define SET_Color3iv(disp, fn) ((disp)->Color3iv = fn) -#define CALL_Color3s(disp, parameters) (*((disp)->Color3s)) parameters -#define GET_Color3s(disp) ((disp)->Color3s) -#define SET_Color3s(disp, fn) ((disp)->Color3s = fn) -#define CALL_Color3sv(disp, parameters) (*((disp)->Color3sv)) parameters -#define GET_Color3sv(disp) ((disp)->Color3sv) -#define SET_Color3sv(disp, fn) ((disp)->Color3sv = fn) -#define CALL_Color3ub(disp, parameters) (*((disp)->Color3ub)) parameters -#define GET_Color3ub(disp) ((disp)->Color3ub) -#define SET_Color3ub(disp, fn) ((disp)->Color3ub = fn) -#define CALL_Color3ubv(disp, parameters) (*((disp)->Color3ubv)) parameters -#define GET_Color3ubv(disp) ((disp)->Color3ubv) -#define SET_Color3ubv(disp, fn) ((disp)->Color3ubv = fn) -#define CALL_Color3ui(disp, parameters) (*((disp)->Color3ui)) parameters -#define GET_Color3ui(disp) ((disp)->Color3ui) -#define SET_Color3ui(disp, fn) ((disp)->Color3ui = fn) -#define CALL_Color3uiv(disp, parameters) (*((disp)->Color3uiv)) parameters -#define GET_Color3uiv(disp) ((disp)->Color3uiv) -#define SET_Color3uiv(disp, fn) ((disp)->Color3uiv = fn) -#define CALL_Color3us(disp, parameters) (*((disp)->Color3us)) parameters -#define GET_Color3us(disp) ((disp)->Color3us) -#define SET_Color3us(disp, fn) ((disp)->Color3us = fn) -#define CALL_Color3usv(disp, parameters) (*((disp)->Color3usv)) parameters -#define GET_Color3usv(disp) ((disp)->Color3usv) -#define SET_Color3usv(disp, fn) ((disp)->Color3usv = fn) -#define CALL_Color4b(disp, parameters) (*((disp)->Color4b)) parameters -#define GET_Color4b(disp) ((disp)->Color4b) -#define SET_Color4b(disp, fn) ((disp)->Color4b = fn) -#define CALL_Color4bv(disp, parameters) (*((disp)->Color4bv)) parameters -#define GET_Color4bv(disp) ((disp)->Color4bv) -#define SET_Color4bv(disp, fn) ((disp)->Color4bv = fn) -#define CALL_Color4d(disp, parameters) (*((disp)->Color4d)) parameters -#define GET_Color4d(disp) ((disp)->Color4d) -#define SET_Color4d(disp, fn) ((disp)->Color4d = fn) -#define CALL_Color4dv(disp, parameters) (*((disp)->Color4dv)) parameters -#define GET_Color4dv(disp) ((disp)->Color4dv) -#define SET_Color4dv(disp, fn) ((disp)->Color4dv = fn) -#define CALL_Color4f(disp, parameters) (*((disp)->Color4f)) parameters -#define GET_Color4f(disp) ((disp)->Color4f) -#define SET_Color4f(disp, fn) ((disp)->Color4f = fn) -#define CALL_Color4fv(disp, parameters) (*((disp)->Color4fv)) parameters -#define GET_Color4fv(disp) ((disp)->Color4fv) -#define SET_Color4fv(disp, fn) ((disp)->Color4fv = fn) -#define CALL_Color4i(disp, parameters) (*((disp)->Color4i)) parameters -#define GET_Color4i(disp) ((disp)->Color4i) -#define SET_Color4i(disp, fn) ((disp)->Color4i = fn) -#define CALL_Color4iv(disp, parameters) (*((disp)->Color4iv)) parameters -#define GET_Color4iv(disp) ((disp)->Color4iv) -#define SET_Color4iv(disp, fn) ((disp)->Color4iv = fn) -#define CALL_Color4s(disp, parameters) (*((disp)->Color4s)) parameters -#define GET_Color4s(disp) ((disp)->Color4s) -#define SET_Color4s(disp, fn) ((disp)->Color4s = fn) -#define CALL_Color4sv(disp, parameters) (*((disp)->Color4sv)) parameters -#define GET_Color4sv(disp) ((disp)->Color4sv) -#define SET_Color4sv(disp, fn) ((disp)->Color4sv = fn) -#define CALL_Color4ub(disp, parameters) (*((disp)->Color4ub)) parameters -#define GET_Color4ub(disp) ((disp)->Color4ub) -#define SET_Color4ub(disp, fn) ((disp)->Color4ub = fn) -#define CALL_Color4ubv(disp, parameters) (*((disp)->Color4ubv)) parameters -#define GET_Color4ubv(disp) ((disp)->Color4ubv) -#define SET_Color4ubv(disp, fn) ((disp)->Color4ubv = fn) -#define CALL_Color4ui(disp, parameters) (*((disp)->Color4ui)) parameters -#define GET_Color4ui(disp) ((disp)->Color4ui) -#define SET_Color4ui(disp, fn) ((disp)->Color4ui = fn) -#define CALL_Color4uiv(disp, parameters) (*((disp)->Color4uiv)) parameters -#define GET_Color4uiv(disp) ((disp)->Color4uiv) -#define SET_Color4uiv(disp, fn) ((disp)->Color4uiv = fn) -#define CALL_Color4us(disp, parameters) (*((disp)->Color4us)) parameters -#define GET_Color4us(disp) ((disp)->Color4us) -#define SET_Color4us(disp, fn) ((disp)->Color4us = fn) -#define CALL_Color4usv(disp, parameters) (*((disp)->Color4usv)) parameters -#define GET_Color4usv(disp) ((disp)->Color4usv) -#define SET_Color4usv(disp, fn) ((disp)->Color4usv = fn) -#define CALL_EdgeFlag(disp, parameters) (*((disp)->EdgeFlag)) parameters -#define GET_EdgeFlag(disp) ((disp)->EdgeFlag) -#define SET_EdgeFlag(disp, fn) ((disp)->EdgeFlag = fn) -#define CALL_EdgeFlagv(disp, parameters) (*((disp)->EdgeFlagv)) parameters -#define GET_EdgeFlagv(disp) ((disp)->EdgeFlagv) -#define SET_EdgeFlagv(disp, fn) ((disp)->EdgeFlagv = fn) -#define CALL_End(disp, parameters) (*((disp)->End)) parameters -#define GET_End(disp) ((disp)->End) -#define SET_End(disp, fn) ((disp)->End = fn) -#define CALL_Indexd(disp, parameters) (*((disp)->Indexd)) parameters -#define GET_Indexd(disp) ((disp)->Indexd) -#define SET_Indexd(disp, fn) ((disp)->Indexd = fn) -#define CALL_Indexdv(disp, parameters) (*((disp)->Indexdv)) parameters -#define GET_Indexdv(disp) ((disp)->Indexdv) -#define SET_Indexdv(disp, fn) ((disp)->Indexdv = fn) -#define CALL_Indexf(disp, parameters) (*((disp)->Indexf)) parameters -#define GET_Indexf(disp) ((disp)->Indexf) -#define SET_Indexf(disp, fn) ((disp)->Indexf = fn) -#define CALL_Indexfv(disp, parameters) (*((disp)->Indexfv)) parameters -#define GET_Indexfv(disp) ((disp)->Indexfv) -#define SET_Indexfv(disp, fn) ((disp)->Indexfv = fn) -#define CALL_Indexi(disp, parameters) (*((disp)->Indexi)) parameters -#define GET_Indexi(disp) ((disp)->Indexi) -#define SET_Indexi(disp, fn) ((disp)->Indexi = fn) -#define CALL_Indexiv(disp, parameters) (*((disp)->Indexiv)) parameters -#define GET_Indexiv(disp) ((disp)->Indexiv) -#define SET_Indexiv(disp, fn) ((disp)->Indexiv = fn) -#define CALL_Indexs(disp, parameters) (*((disp)->Indexs)) parameters -#define GET_Indexs(disp) ((disp)->Indexs) -#define SET_Indexs(disp, fn) ((disp)->Indexs = fn) -#define CALL_Indexsv(disp, parameters) (*((disp)->Indexsv)) parameters -#define GET_Indexsv(disp) ((disp)->Indexsv) -#define SET_Indexsv(disp, fn) ((disp)->Indexsv = fn) -#define CALL_Normal3b(disp, parameters) (*((disp)->Normal3b)) parameters -#define GET_Normal3b(disp) ((disp)->Normal3b) -#define SET_Normal3b(disp, fn) ((disp)->Normal3b = fn) -#define CALL_Normal3bv(disp, parameters) (*((disp)->Normal3bv)) parameters -#define GET_Normal3bv(disp) ((disp)->Normal3bv) -#define SET_Normal3bv(disp, fn) ((disp)->Normal3bv = fn) -#define CALL_Normal3d(disp, parameters) (*((disp)->Normal3d)) parameters -#define GET_Normal3d(disp) ((disp)->Normal3d) -#define SET_Normal3d(disp, fn) ((disp)->Normal3d = fn) -#define CALL_Normal3dv(disp, parameters) (*((disp)->Normal3dv)) parameters -#define GET_Normal3dv(disp) ((disp)->Normal3dv) -#define SET_Normal3dv(disp, fn) ((disp)->Normal3dv = fn) -#define CALL_Normal3f(disp, parameters) (*((disp)->Normal3f)) parameters -#define GET_Normal3f(disp) ((disp)->Normal3f) -#define SET_Normal3f(disp, fn) ((disp)->Normal3f = fn) -#define CALL_Normal3fv(disp, parameters) (*((disp)->Normal3fv)) parameters -#define GET_Normal3fv(disp) ((disp)->Normal3fv) -#define SET_Normal3fv(disp, fn) ((disp)->Normal3fv = fn) -#define CALL_Normal3i(disp, parameters) (*((disp)->Normal3i)) parameters -#define GET_Normal3i(disp) ((disp)->Normal3i) -#define SET_Normal3i(disp, fn) ((disp)->Normal3i = fn) -#define CALL_Normal3iv(disp, parameters) (*((disp)->Normal3iv)) parameters -#define GET_Normal3iv(disp) ((disp)->Normal3iv) -#define SET_Normal3iv(disp, fn) ((disp)->Normal3iv = fn) -#define CALL_Normal3s(disp, parameters) (*((disp)->Normal3s)) parameters -#define GET_Normal3s(disp) ((disp)->Normal3s) -#define SET_Normal3s(disp, fn) ((disp)->Normal3s = fn) -#define CALL_Normal3sv(disp, parameters) (*((disp)->Normal3sv)) parameters -#define GET_Normal3sv(disp) ((disp)->Normal3sv) -#define SET_Normal3sv(disp, fn) ((disp)->Normal3sv = fn) -#define CALL_RasterPos2d(disp, parameters) (*((disp)->RasterPos2d)) parameters -#define GET_RasterPos2d(disp) ((disp)->RasterPos2d) -#define SET_RasterPos2d(disp, fn) ((disp)->RasterPos2d = fn) -#define CALL_RasterPos2dv(disp, parameters) (*((disp)->RasterPos2dv)) parameters -#define GET_RasterPos2dv(disp) ((disp)->RasterPos2dv) -#define SET_RasterPos2dv(disp, fn) ((disp)->RasterPos2dv = fn) -#define CALL_RasterPos2f(disp, parameters) (*((disp)->RasterPos2f)) parameters -#define GET_RasterPos2f(disp) ((disp)->RasterPos2f) -#define SET_RasterPos2f(disp, fn) ((disp)->RasterPos2f = fn) -#define CALL_RasterPos2fv(disp, parameters) (*((disp)->RasterPos2fv)) parameters -#define GET_RasterPos2fv(disp) ((disp)->RasterPos2fv) -#define SET_RasterPos2fv(disp, fn) ((disp)->RasterPos2fv = fn) -#define CALL_RasterPos2i(disp, parameters) (*((disp)->RasterPos2i)) parameters -#define GET_RasterPos2i(disp) ((disp)->RasterPos2i) -#define SET_RasterPos2i(disp, fn) ((disp)->RasterPos2i = fn) -#define CALL_RasterPos2iv(disp, parameters) (*((disp)->RasterPos2iv)) parameters -#define GET_RasterPos2iv(disp) ((disp)->RasterPos2iv) -#define SET_RasterPos2iv(disp, fn) ((disp)->RasterPos2iv = fn) -#define CALL_RasterPos2s(disp, parameters) (*((disp)->RasterPos2s)) parameters -#define GET_RasterPos2s(disp) ((disp)->RasterPos2s) -#define SET_RasterPos2s(disp, fn) ((disp)->RasterPos2s = fn) -#define CALL_RasterPos2sv(disp, parameters) (*((disp)->RasterPos2sv)) parameters -#define GET_RasterPos2sv(disp) ((disp)->RasterPos2sv) -#define SET_RasterPos2sv(disp, fn) ((disp)->RasterPos2sv = fn) -#define CALL_RasterPos3d(disp, parameters) (*((disp)->RasterPos3d)) parameters -#define GET_RasterPos3d(disp) ((disp)->RasterPos3d) -#define SET_RasterPos3d(disp, fn) ((disp)->RasterPos3d = fn) -#define CALL_RasterPos3dv(disp, parameters) (*((disp)->RasterPos3dv)) parameters -#define GET_RasterPos3dv(disp) ((disp)->RasterPos3dv) -#define SET_RasterPos3dv(disp, fn) ((disp)->RasterPos3dv = fn) -#define CALL_RasterPos3f(disp, parameters) (*((disp)->RasterPos3f)) parameters -#define GET_RasterPos3f(disp) ((disp)->RasterPos3f) -#define SET_RasterPos3f(disp, fn) ((disp)->RasterPos3f = fn) -#define CALL_RasterPos3fv(disp, parameters) (*((disp)->RasterPos3fv)) parameters -#define GET_RasterPos3fv(disp) ((disp)->RasterPos3fv) -#define SET_RasterPos3fv(disp, fn) ((disp)->RasterPos3fv = fn) -#define CALL_RasterPos3i(disp, parameters) (*((disp)->RasterPos3i)) parameters -#define GET_RasterPos3i(disp) ((disp)->RasterPos3i) -#define SET_RasterPos3i(disp, fn) ((disp)->RasterPos3i = fn) -#define CALL_RasterPos3iv(disp, parameters) (*((disp)->RasterPos3iv)) parameters -#define GET_RasterPos3iv(disp) ((disp)->RasterPos3iv) -#define SET_RasterPos3iv(disp, fn) ((disp)->RasterPos3iv = fn) -#define CALL_RasterPos3s(disp, parameters) (*((disp)->RasterPos3s)) parameters -#define GET_RasterPos3s(disp) ((disp)->RasterPos3s) -#define SET_RasterPos3s(disp, fn) ((disp)->RasterPos3s = fn) -#define CALL_RasterPos3sv(disp, parameters) (*((disp)->RasterPos3sv)) parameters -#define GET_RasterPos3sv(disp) ((disp)->RasterPos3sv) -#define SET_RasterPos3sv(disp, fn) ((disp)->RasterPos3sv = fn) -#define CALL_RasterPos4d(disp, parameters) (*((disp)->RasterPos4d)) parameters -#define GET_RasterPos4d(disp) ((disp)->RasterPos4d) -#define SET_RasterPos4d(disp, fn) ((disp)->RasterPos4d = fn) -#define CALL_RasterPos4dv(disp, parameters) (*((disp)->RasterPos4dv)) parameters -#define GET_RasterPos4dv(disp) ((disp)->RasterPos4dv) -#define SET_RasterPos4dv(disp, fn) ((disp)->RasterPos4dv = fn) -#define CALL_RasterPos4f(disp, parameters) (*((disp)->RasterPos4f)) parameters -#define GET_RasterPos4f(disp) ((disp)->RasterPos4f) -#define SET_RasterPos4f(disp, fn) ((disp)->RasterPos4f = fn) -#define CALL_RasterPos4fv(disp, parameters) (*((disp)->RasterPos4fv)) parameters -#define GET_RasterPos4fv(disp) ((disp)->RasterPos4fv) -#define SET_RasterPos4fv(disp, fn) ((disp)->RasterPos4fv = fn) -#define CALL_RasterPos4i(disp, parameters) (*((disp)->RasterPos4i)) parameters -#define GET_RasterPos4i(disp) ((disp)->RasterPos4i) -#define SET_RasterPos4i(disp, fn) ((disp)->RasterPos4i = fn) -#define CALL_RasterPos4iv(disp, parameters) (*((disp)->RasterPos4iv)) parameters -#define GET_RasterPos4iv(disp) ((disp)->RasterPos4iv) -#define SET_RasterPos4iv(disp, fn) ((disp)->RasterPos4iv = fn) -#define CALL_RasterPos4s(disp, parameters) (*((disp)->RasterPos4s)) parameters -#define GET_RasterPos4s(disp) ((disp)->RasterPos4s) -#define SET_RasterPos4s(disp, fn) ((disp)->RasterPos4s = fn) -#define CALL_RasterPos4sv(disp, parameters) (*((disp)->RasterPos4sv)) parameters -#define GET_RasterPos4sv(disp) ((disp)->RasterPos4sv) -#define SET_RasterPos4sv(disp, fn) ((disp)->RasterPos4sv = fn) -#define CALL_Rectd(disp, parameters) (*((disp)->Rectd)) parameters -#define GET_Rectd(disp) ((disp)->Rectd) -#define SET_Rectd(disp, fn) ((disp)->Rectd = fn) -#define CALL_Rectdv(disp, parameters) (*((disp)->Rectdv)) parameters -#define GET_Rectdv(disp) ((disp)->Rectdv) -#define SET_Rectdv(disp, fn) ((disp)->Rectdv = fn) -#define CALL_Rectf(disp, parameters) (*((disp)->Rectf)) parameters -#define GET_Rectf(disp) ((disp)->Rectf) -#define SET_Rectf(disp, fn) ((disp)->Rectf = fn) -#define CALL_Rectfv(disp, parameters) (*((disp)->Rectfv)) parameters -#define GET_Rectfv(disp) ((disp)->Rectfv) -#define SET_Rectfv(disp, fn) ((disp)->Rectfv = fn) -#define CALL_Recti(disp, parameters) (*((disp)->Recti)) parameters -#define GET_Recti(disp) ((disp)->Recti) -#define SET_Recti(disp, fn) ((disp)->Recti = fn) -#define CALL_Rectiv(disp, parameters) (*((disp)->Rectiv)) parameters -#define GET_Rectiv(disp) ((disp)->Rectiv) -#define SET_Rectiv(disp, fn) ((disp)->Rectiv = fn) -#define CALL_Rects(disp, parameters) (*((disp)->Rects)) parameters -#define GET_Rects(disp) ((disp)->Rects) -#define SET_Rects(disp, fn) ((disp)->Rects = fn) -#define CALL_Rectsv(disp, parameters) (*((disp)->Rectsv)) parameters -#define GET_Rectsv(disp) ((disp)->Rectsv) -#define SET_Rectsv(disp, fn) ((disp)->Rectsv = fn) -#define CALL_TexCoord1d(disp, parameters) (*((disp)->TexCoord1d)) parameters -#define GET_TexCoord1d(disp) ((disp)->TexCoord1d) -#define SET_TexCoord1d(disp, fn) ((disp)->TexCoord1d = fn) -#define CALL_TexCoord1dv(disp, parameters) (*((disp)->TexCoord1dv)) parameters -#define GET_TexCoord1dv(disp) ((disp)->TexCoord1dv) -#define SET_TexCoord1dv(disp, fn) ((disp)->TexCoord1dv = fn) -#define CALL_TexCoord1f(disp, parameters) (*((disp)->TexCoord1f)) parameters -#define GET_TexCoord1f(disp) ((disp)->TexCoord1f) -#define SET_TexCoord1f(disp, fn) ((disp)->TexCoord1f = fn) -#define CALL_TexCoord1fv(disp, parameters) (*((disp)->TexCoord1fv)) parameters -#define GET_TexCoord1fv(disp) ((disp)->TexCoord1fv) -#define SET_TexCoord1fv(disp, fn) ((disp)->TexCoord1fv = fn) -#define CALL_TexCoord1i(disp, parameters) (*((disp)->TexCoord1i)) parameters -#define GET_TexCoord1i(disp) ((disp)->TexCoord1i) -#define SET_TexCoord1i(disp, fn) ((disp)->TexCoord1i = fn) -#define CALL_TexCoord1iv(disp, parameters) (*((disp)->TexCoord1iv)) parameters -#define GET_TexCoord1iv(disp) ((disp)->TexCoord1iv) -#define SET_TexCoord1iv(disp, fn) ((disp)->TexCoord1iv = fn) -#define CALL_TexCoord1s(disp, parameters) (*((disp)->TexCoord1s)) parameters -#define GET_TexCoord1s(disp) ((disp)->TexCoord1s) -#define SET_TexCoord1s(disp, fn) ((disp)->TexCoord1s = fn) -#define CALL_TexCoord1sv(disp, parameters) (*((disp)->TexCoord1sv)) parameters -#define GET_TexCoord1sv(disp) ((disp)->TexCoord1sv) -#define SET_TexCoord1sv(disp, fn) ((disp)->TexCoord1sv = fn) -#define CALL_TexCoord2d(disp, parameters) (*((disp)->TexCoord2d)) parameters -#define GET_TexCoord2d(disp) ((disp)->TexCoord2d) -#define SET_TexCoord2d(disp, fn) ((disp)->TexCoord2d = fn) -#define CALL_TexCoord2dv(disp, parameters) (*((disp)->TexCoord2dv)) parameters -#define GET_TexCoord2dv(disp) ((disp)->TexCoord2dv) -#define SET_TexCoord2dv(disp, fn) ((disp)->TexCoord2dv = fn) -#define CALL_TexCoord2f(disp, parameters) (*((disp)->TexCoord2f)) parameters -#define GET_TexCoord2f(disp) ((disp)->TexCoord2f) -#define SET_TexCoord2f(disp, fn) ((disp)->TexCoord2f = fn) -#define CALL_TexCoord2fv(disp, parameters) (*((disp)->TexCoord2fv)) parameters -#define GET_TexCoord2fv(disp) ((disp)->TexCoord2fv) -#define SET_TexCoord2fv(disp, fn) ((disp)->TexCoord2fv = fn) -#define CALL_TexCoord2i(disp, parameters) (*((disp)->TexCoord2i)) parameters -#define GET_TexCoord2i(disp) ((disp)->TexCoord2i) -#define SET_TexCoord2i(disp, fn) ((disp)->TexCoord2i = fn) -#define CALL_TexCoord2iv(disp, parameters) (*((disp)->TexCoord2iv)) parameters -#define GET_TexCoord2iv(disp) ((disp)->TexCoord2iv) -#define SET_TexCoord2iv(disp, fn) ((disp)->TexCoord2iv = fn) -#define CALL_TexCoord2s(disp, parameters) (*((disp)->TexCoord2s)) parameters -#define GET_TexCoord2s(disp) ((disp)->TexCoord2s) -#define SET_TexCoord2s(disp, fn) ((disp)->TexCoord2s = fn) -#define CALL_TexCoord2sv(disp, parameters) (*((disp)->TexCoord2sv)) parameters -#define GET_TexCoord2sv(disp) ((disp)->TexCoord2sv) -#define SET_TexCoord2sv(disp, fn) ((disp)->TexCoord2sv = fn) -#define CALL_TexCoord3d(disp, parameters) (*((disp)->TexCoord3d)) parameters -#define GET_TexCoord3d(disp) ((disp)->TexCoord3d) -#define SET_TexCoord3d(disp, fn) ((disp)->TexCoord3d = fn) -#define CALL_TexCoord3dv(disp, parameters) (*((disp)->TexCoord3dv)) parameters -#define GET_TexCoord3dv(disp) ((disp)->TexCoord3dv) -#define SET_TexCoord3dv(disp, fn) ((disp)->TexCoord3dv = fn) -#define CALL_TexCoord3f(disp, parameters) (*((disp)->TexCoord3f)) parameters -#define GET_TexCoord3f(disp) ((disp)->TexCoord3f) -#define SET_TexCoord3f(disp, fn) ((disp)->TexCoord3f = fn) -#define CALL_TexCoord3fv(disp, parameters) (*((disp)->TexCoord3fv)) parameters -#define GET_TexCoord3fv(disp) ((disp)->TexCoord3fv) -#define SET_TexCoord3fv(disp, fn) ((disp)->TexCoord3fv = fn) -#define CALL_TexCoord3i(disp, parameters) (*((disp)->TexCoord3i)) parameters -#define GET_TexCoord3i(disp) ((disp)->TexCoord3i) -#define SET_TexCoord3i(disp, fn) ((disp)->TexCoord3i = fn) -#define CALL_TexCoord3iv(disp, parameters) (*((disp)->TexCoord3iv)) parameters -#define GET_TexCoord3iv(disp) ((disp)->TexCoord3iv) -#define SET_TexCoord3iv(disp, fn) ((disp)->TexCoord3iv = fn) -#define CALL_TexCoord3s(disp, parameters) (*((disp)->TexCoord3s)) parameters -#define GET_TexCoord3s(disp) ((disp)->TexCoord3s) -#define SET_TexCoord3s(disp, fn) ((disp)->TexCoord3s = fn) -#define CALL_TexCoord3sv(disp, parameters) (*((disp)->TexCoord3sv)) parameters -#define GET_TexCoord3sv(disp) ((disp)->TexCoord3sv) -#define SET_TexCoord3sv(disp, fn) ((disp)->TexCoord3sv = fn) -#define CALL_TexCoord4d(disp, parameters) (*((disp)->TexCoord4d)) parameters -#define GET_TexCoord4d(disp) ((disp)->TexCoord4d) -#define SET_TexCoord4d(disp, fn) ((disp)->TexCoord4d = fn) -#define CALL_TexCoord4dv(disp, parameters) (*((disp)->TexCoord4dv)) parameters -#define GET_TexCoord4dv(disp) ((disp)->TexCoord4dv) -#define SET_TexCoord4dv(disp, fn) ((disp)->TexCoord4dv = fn) -#define CALL_TexCoord4f(disp, parameters) (*((disp)->TexCoord4f)) parameters -#define GET_TexCoord4f(disp) ((disp)->TexCoord4f) -#define SET_TexCoord4f(disp, fn) ((disp)->TexCoord4f = fn) -#define CALL_TexCoord4fv(disp, parameters) (*((disp)->TexCoord4fv)) parameters -#define GET_TexCoord4fv(disp) ((disp)->TexCoord4fv) -#define SET_TexCoord4fv(disp, fn) ((disp)->TexCoord4fv = fn) -#define CALL_TexCoord4i(disp, parameters) (*((disp)->TexCoord4i)) parameters -#define GET_TexCoord4i(disp) ((disp)->TexCoord4i) -#define SET_TexCoord4i(disp, fn) ((disp)->TexCoord4i = fn) -#define CALL_TexCoord4iv(disp, parameters) (*((disp)->TexCoord4iv)) parameters -#define GET_TexCoord4iv(disp) ((disp)->TexCoord4iv) -#define SET_TexCoord4iv(disp, fn) ((disp)->TexCoord4iv = fn) -#define CALL_TexCoord4s(disp, parameters) (*((disp)->TexCoord4s)) parameters -#define GET_TexCoord4s(disp) ((disp)->TexCoord4s) -#define SET_TexCoord4s(disp, fn) ((disp)->TexCoord4s = fn) -#define CALL_TexCoord4sv(disp, parameters) (*((disp)->TexCoord4sv)) parameters -#define GET_TexCoord4sv(disp) ((disp)->TexCoord4sv) -#define SET_TexCoord4sv(disp, fn) ((disp)->TexCoord4sv = fn) -#define CALL_Vertex2d(disp, parameters) (*((disp)->Vertex2d)) parameters -#define GET_Vertex2d(disp) ((disp)->Vertex2d) -#define SET_Vertex2d(disp, fn) ((disp)->Vertex2d = fn) -#define CALL_Vertex2dv(disp, parameters) (*((disp)->Vertex2dv)) parameters -#define GET_Vertex2dv(disp) ((disp)->Vertex2dv) -#define SET_Vertex2dv(disp, fn) ((disp)->Vertex2dv = fn) -#define CALL_Vertex2f(disp, parameters) (*((disp)->Vertex2f)) parameters -#define GET_Vertex2f(disp) ((disp)->Vertex2f) -#define SET_Vertex2f(disp, fn) ((disp)->Vertex2f = fn) -#define CALL_Vertex2fv(disp, parameters) (*((disp)->Vertex2fv)) parameters -#define GET_Vertex2fv(disp) ((disp)->Vertex2fv) -#define SET_Vertex2fv(disp, fn) ((disp)->Vertex2fv = fn) -#define CALL_Vertex2i(disp, parameters) (*((disp)->Vertex2i)) parameters -#define GET_Vertex2i(disp) ((disp)->Vertex2i) -#define SET_Vertex2i(disp, fn) ((disp)->Vertex2i = fn) -#define CALL_Vertex2iv(disp, parameters) (*((disp)->Vertex2iv)) parameters -#define GET_Vertex2iv(disp) ((disp)->Vertex2iv) -#define SET_Vertex2iv(disp, fn) ((disp)->Vertex2iv = fn) -#define CALL_Vertex2s(disp, parameters) (*((disp)->Vertex2s)) parameters -#define GET_Vertex2s(disp) ((disp)->Vertex2s) -#define SET_Vertex2s(disp, fn) ((disp)->Vertex2s = fn) -#define CALL_Vertex2sv(disp, parameters) (*((disp)->Vertex2sv)) parameters -#define GET_Vertex2sv(disp) ((disp)->Vertex2sv) -#define SET_Vertex2sv(disp, fn) ((disp)->Vertex2sv = fn) -#define CALL_Vertex3d(disp, parameters) (*((disp)->Vertex3d)) parameters -#define GET_Vertex3d(disp) ((disp)->Vertex3d) -#define SET_Vertex3d(disp, fn) ((disp)->Vertex3d = fn) -#define CALL_Vertex3dv(disp, parameters) (*((disp)->Vertex3dv)) parameters -#define GET_Vertex3dv(disp) ((disp)->Vertex3dv) -#define SET_Vertex3dv(disp, fn) ((disp)->Vertex3dv = fn) -#define CALL_Vertex3f(disp, parameters) (*((disp)->Vertex3f)) parameters -#define GET_Vertex3f(disp) ((disp)->Vertex3f) -#define SET_Vertex3f(disp, fn) ((disp)->Vertex3f = fn) -#define CALL_Vertex3fv(disp, parameters) (*((disp)->Vertex3fv)) parameters -#define GET_Vertex3fv(disp) ((disp)->Vertex3fv) -#define SET_Vertex3fv(disp, fn) ((disp)->Vertex3fv = fn) -#define CALL_Vertex3i(disp, parameters) (*((disp)->Vertex3i)) parameters -#define GET_Vertex3i(disp) ((disp)->Vertex3i) -#define SET_Vertex3i(disp, fn) ((disp)->Vertex3i = fn) -#define CALL_Vertex3iv(disp, parameters) (*((disp)->Vertex3iv)) parameters -#define GET_Vertex3iv(disp) ((disp)->Vertex3iv) -#define SET_Vertex3iv(disp, fn) ((disp)->Vertex3iv = fn) -#define CALL_Vertex3s(disp, parameters) (*((disp)->Vertex3s)) parameters -#define GET_Vertex3s(disp) ((disp)->Vertex3s) -#define SET_Vertex3s(disp, fn) ((disp)->Vertex3s = fn) -#define CALL_Vertex3sv(disp, parameters) (*((disp)->Vertex3sv)) parameters -#define GET_Vertex3sv(disp) ((disp)->Vertex3sv) -#define SET_Vertex3sv(disp, fn) ((disp)->Vertex3sv = fn) -#define CALL_Vertex4d(disp, parameters) (*((disp)->Vertex4d)) parameters -#define GET_Vertex4d(disp) ((disp)->Vertex4d) -#define SET_Vertex4d(disp, fn) ((disp)->Vertex4d = fn) -#define CALL_Vertex4dv(disp, parameters) (*((disp)->Vertex4dv)) parameters -#define GET_Vertex4dv(disp) ((disp)->Vertex4dv) -#define SET_Vertex4dv(disp, fn) ((disp)->Vertex4dv = fn) -#define CALL_Vertex4f(disp, parameters) (*((disp)->Vertex4f)) parameters -#define GET_Vertex4f(disp) ((disp)->Vertex4f) -#define SET_Vertex4f(disp, fn) ((disp)->Vertex4f = fn) -#define CALL_Vertex4fv(disp, parameters) (*((disp)->Vertex4fv)) parameters -#define GET_Vertex4fv(disp) ((disp)->Vertex4fv) -#define SET_Vertex4fv(disp, fn) ((disp)->Vertex4fv = fn) -#define CALL_Vertex4i(disp, parameters) (*((disp)->Vertex4i)) parameters -#define GET_Vertex4i(disp) ((disp)->Vertex4i) -#define SET_Vertex4i(disp, fn) ((disp)->Vertex4i = fn) -#define CALL_Vertex4iv(disp, parameters) (*((disp)->Vertex4iv)) parameters -#define GET_Vertex4iv(disp) ((disp)->Vertex4iv) -#define SET_Vertex4iv(disp, fn) ((disp)->Vertex4iv = fn) -#define CALL_Vertex4s(disp, parameters) (*((disp)->Vertex4s)) parameters -#define GET_Vertex4s(disp) ((disp)->Vertex4s) -#define SET_Vertex4s(disp, fn) ((disp)->Vertex4s = fn) -#define CALL_Vertex4sv(disp, parameters) (*((disp)->Vertex4sv)) parameters -#define GET_Vertex4sv(disp) ((disp)->Vertex4sv) -#define SET_Vertex4sv(disp, fn) ((disp)->Vertex4sv = fn) -#define CALL_ClipPlane(disp, parameters) (*((disp)->ClipPlane)) parameters -#define GET_ClipPlane(disp) ((disp)->ClipPlane) -#define SET_ClipPlane(disp, fn) ((disp)->ClipPlane = fn) -#define CALL_ColorMaterial(disp, parameters) (*((disp)->ColorMaterial)) parameters -#define GET_ColorMaterial(disp) ((disp)->ColorMaterial) -#define SET_ColorMaterial(disp, fn) ((disp)->ColorMaterial = fn) -#define CALL_CullFace(disp, parameters) (*((disp)->CullFace)) parameters -#define GET_CullFace(disp) ((disp)->CullFace) -#define SET_CullFace(disp, fn) ((disp)->CullFace = fn) -#define CALL_Fogf(disp, parameters) (*((disp)->Fogf)) parameters -#define GET_Fogf(disp) ((disp)->Fogf) -#define SET_Fogf(disp, fn) ((disp)->Fogf = fn) -#define CALL_Fogfv(disp, parameters) (*((disp)->Fogfv)) parameters -#define GET_Fogfv(disp) ((disp)->Fogfv) -#define SET_Fogfv(disp, fn) ((disp)->Fogfv = fn) -#define CALL_Fogi(disp, parameters) (*((disp)->Fogi)) parameters -#define GET_Fogi(disp) ((disp)->Fogi) -#define SET_Fogi(disp, fn) ((disp)->Fogi = fn) -#define CALL_Fogiv(disp, parameters) (*((disp)->Fogiv)) parameters -#define GET_Fogiv(disp) ((disp)->Fogiv) -#define SET_Fogiv(disp, fn) ((disp)->Fogiv = fn) -#define CALL_FrontFace(disp, parameters) (*((disp)->FrontFace)) parameters -#define GET_FrontFace(disp) ((disp)->FrontFace) -#define SET_FrontFace(disp, fn) ((disp)->FrontFace = fn) -#define CALL_Hint(disp, parameters) (*((disp)->Hint)) parameters -#define GET_Hint(disp) ((disp)->Hint) -#define SET_Hint(disp, fn) ((disp)->Hint = fn) -#define CALL_Lightf(disp, parameters) (*((disp)->Lightf)) parameters -#define GET_Lightf(disp) ((disp)->Lightf) -#define SET_Lightf(disp, fn) ((disp)->Lightf = fn) -#define CALL_Lightfv(disp, parameters) (*((disp)->Lightfv)) parameters -#define GET_Lightfv(disp) ((disp)->Lightfv) -#define SET_Lightfv(disp, fn) ((disp)->Lightfv = fn) -#define CALL_Lighti(disp, parameters) (*((disp)->Lighti)) parameters -#define GET_Lighti(disp) ((disp)->Lighti) -#define SET_Lighti(disp, fn) ((disp)->Lighti = fn) -#define CALL_Lightiv(disp, parameters) (*((disp)->Lightiv)) parameters -#define GET_Lightiv(disp) ((disp)->Lightiv) -#define SET_Lightiv(disp, fn) ((disp)->Lightiv = fn) -#define CALL_LightModelf(disp, parameters) (*((disp)->LightModelf)) parameters -#define GET_LightModelf(disp) ((disp)->LightModelf) -#define SET_LightModelf(disp, fn) ((disp)->LightModelf = fn) -#define CALL_LightModelfv(disp, parameters) (*((disp)->LightModelfv)) parameters -#define GET_LightModelfv(disp) ((disp)->LightModelfv) -#define SET_LightModelfv(disp, fn) ((disp)->LightModelfv = fn) -#define CALL_LightModeli(disp, parameters) (*((disp)->LightModeli)) parameters -#define GET_LightModeli(disp) ((disp)->LightModeli) -#define SET_LightModeli(disp, fn) ((disp)->LightModeli = fn) -#define CALL_LightModeliv(disp, parameters) (*((disp)->LightModeliv)) parameters -#define GET_LightModeliv(disp) ((disp)->LightModeliv) -#define SET_LightModeliv(disp, fn) ((disp)->LightModeliv = fn) -#define CALL_LineStipple(disp, parameters) (*((disp)->LineStipple)) parameters -#define GET_LineStipple(disp) ((disp)->LineStipple) -#define SET_LineStipple(disp, fn) ((disp)->LineStipple = fn) -#define CALL_LineWidth(disp, parameters) (*((disp)->LineWidth)) parameters -#define GET_LineWidth(disp) ((disp)->LineWidth) -#define SET_LineWidth(disp, fn) ((disp)->LineWidth = fn) -#define CALL_Materialf(disp, parameters) (*((disp)->Materialf)) parameters -#define GET_Materialf(disp) ((disp)->Materialf) -#define SET_Materialf(disp, fn) ((disp)->Materialf = fn) -#define CALL_Materialfv(disp, parameters) (*((disp)->Materialfv)) parameters -#define GET_Materialfv(disp) ((disp)->Materialfv) -#define SET_Materialfv(disp, fn) ((disp)->Materialfv = fn) -#define CALL_Materiali(disp, parameters) (*((disp)->Materiali)) parameters -#define GET_Materiali(disp) ((disp)->Materiali) -#define SET_Materiali(disp, fn) ((disp)->Materiali = fn) -#define CALL_Materialiv(disp, parameters) (*((disp)->Materialiv)) parameters -#define GET_Materialiv(disp) ((disp)->Materialiv) -#define SET_Materialiv(disp, fn) ((disp)->Materialiv = fn) -#define CALL_PointSize(disp, parameters) (*((disp)->PointSize)) parameters -#define GET_PointSize(disp) ((disp)->PointSize) -#define SET_PointSize(disp, fn) ((disp)->PointSize = fn) -#define CALL_PolygonMode(disp, parameters) (*((disp)->PolygonMode)) parameters -#define GET_PolygonMode(disp) ((disp)->PolygonMode) -#define SET_PolygonMode(disp, fn) ((disp)->PolygonMode = fn) -#define CALL_PolygonStipple(disp, parameters) (*((disp)->PolygonStipple)) parameters -#define GET_PolygonStipple(disp) ((disp)->PolygonStipple) -#define SET_PolygonStipple(disp, fn) ((disp)->PolygonStipple = fn) -#define CALL_Scissor(disp, parameters) (*((disp)->Scissor)) parameters -#define GET_Scissor(disp) ((disp)->Scissor) -#define SET_Scissor(disp, fn) ((disp)->Scissor = fn) -#define CALL_ShadeModel(disp, parameters) (*((disp)->ShadeModel)) parameters -#define GET_ShadeModel(disp) ((disp)->ShadeModel) -#define SET_ShadeModel(disp, fn) ((disp)->ShadeModel = fn) -#define CALL_TexParameterf(disp, parameters) (*((disp)->TexParameterf)) parameters -#define GET_TexParameterf(disp) ((disp)->TexParameterf) -#define SET_TexParameterf(disp, fn) ((disp)->TexParameterf = fn) -#define CALL_TexParameterfv(disp, parameters) (*((disp)->TexParameterfv)) parameters -#define GET_TexParameterfv(disp) ((disp)->TexParameterfv) -#define SET_TexParameterfv(disp, fn) ((disp)->TexParameterfv = fn) -#define CALL_TexParameteri(disp, parameters) (*((disp)->TexParameteri)) parameters -#define GET_TexParameteri(disp) ((disp)->TexParameteri) -#define SET_TexParameteri(disp, fn) ((disp)->TexParameteri = fn) -#define CALL_TexParameteriv(disp, parameters) (*((disp)->TexParameteriv)) parameters -#define GET_TexParameteriv(disp) ((disp)->TexParameteriv) -#define SET_TexParameteriv(disp, fn) ((disp)->TexParameteriv = fn) -#define CALL_TexImage1D(disp, parameters) (*((disp)->TexImage1D)) parameters -#define GET_TexImage1D(disp) ((disp)->TexImage1D) -#define SET_TexImage1D(disp, fn) ((disp)->TexImage1D = fn) -#define CALL_TexImage2D(disp, parameters) (*((disp)->TexImage2D)) parameters -#define GET_TexImage2D(disp) ((disp)->TexImage2D) -#define SET_TexImage2D(disp, fn) ((disp)->TexImage2D = fn) -#define CALL_TexEnvf(disp, parameters) (*((disp)->TexEnvf)) parameters -#define GET_TexEnvf(disp) ((disp)->TexEnvf) -#define SET_TexEnvf(disp, fn) ((disp)->TexEnvf = fn) -#define CALL_TexEnvfv(disp, parameters) (*((disp)->TexEnvfv)) parameters -#define GET_TexEnvfv(disp) ((disp)->TexEnvfv) -#define SET_TexEnvfv(disp, fn) ((disp)->TexEnvfv = fn) -#define CALL_TexEnvi(disp, parameters) (*((disp)->TexEnvi)) parameters -#define GET_TexEnvi(disp) ((disp)->TexEnvi) -#define SET_TexEnvi(disp, fn) ((disp)->TexEnvi = fn) -#define CALL_TexEnviv(disp, parameters) (*((disp)->TexEnviv)) parameters -#define GET_TexEnviv(disp) ((disp)->TexEnviv) -#define SET_TexEnviv(disp, fn) ((disp)->TexEnviv = fn) -#define CALL_TexGend(disp, parameters) (*((disp)->TexGend)) parameters -#define GET_TexGend(disp) ((disp)->TexGend) -#define SET_TexGend(disp, fn) ((disp)->TexGend = fn) -#define CALL_TexGendv(disp, parameters) (*((disp)->TexGendv)) parameters -#define GET_TexGendv(disp) ((disp)->TexGendv) -#define SET_TexGendv(disp, fn) ((disp)->TexGendv = fn) -#define CALL_TexGenf(disp, parameters) (*((disp)->TexGenf)) parameters -#define GET_TexGenf(disp) ((disp)->TexGenf) -#define SET_TexGenf(disp, fn) ((disp)->TexGenf = fn) -#define CALL_TexGenfv(disp, parameters) (*((disp)->TexGenfv)) parameters -#define GET_TexGenfv(disp) ((disp)->TexGenfv) -#define SET_TexGenfv(disp, fn) ((disp)->TexGenfv = fn) -#define CALL_TexGeni(disp, parameters) (*((disp)->TexGeni)) parameters -#define GET_TexGeni(disp) ((disp)->TexGeni) -#define SET_TexGeni(disp, fn) ((disp)->TexGeni = fn) -#define CALL_TexGeniv(disp, parameters) (*((disp)->TexGeniv)) parameters -#define GET_TexGeniv(disp) ((disp)->TexGeniv) -#define SET_TexGeniv(disp, fn) ((disp)->TexGeniv = fn) -#define CALL_FeedbackBuffer(disp, parameters) (*((disp)->FeedbackBuffer)) parameters -#define GET_FeedbackBuffer(disp) ((disp)->FeedbackBuffer) -#define SET_FeedbackBuffer(disp, fn) ((disp)->FeedbackBuffer = fn) -#define CALL_SelectBuffer(disp, parameters) (*((disp)->SelectBuffer)) parameters -#define GET_SelectBuffer(disp) ((disp)->SelectBuffer) -#define SET_SelectBuffer(disp, fn) ((disp)->SelectBuffer = fn) -#define CALL_RenderMode(disp, parameters) (*((disp)->RenderMode)) parameters -#define GET_RenderMode(disp) ((disp)->RenderMode) -#define SET_RenderMode(disp, fn) ((disp)->RenderMode = fn) -#define CALL_InitNames(disp, parameters) (*((disp)->InitNames)) parameters -#define GET_InitNames(disp) ((disp)->InitNames) -#define SET_InitNames(disp, fn) ((disp)->InitNames = fn) -#define CALL_LoadName(disp, parameters) (*((disp)->LoadName)) parameters -#define GET_LoadName(disp) ((disp)->LoadName) -#define SET_LoadName(disp, fn) ((disp)->LoadName = fn) -#define CALL_PassThrough(disp, parameters) (*((disp)->PassThrough)) parameters -#define GET_PassThrough(disp) ((disp)->PassThrough) -#define SET_PassThrough(disp, fn) ((disp)->PassThrough = fn) -#define CALL_PopName(disp, parameters) (*((disp)->PopName)) parameters -#define GET_PopName(disp) ((disp)->PopName) -#define SET_PopName(disp, fn) ((disp)->PopName = fn) -#define CALL_PushName(disp, parameters) (*((disp)->PushName)) parameters -#define GET_PushName(disp) ((disp)->PushName) -#define SET_PushName(disp, fn) ((disp)->PushName = fn) -#define CALL_DrawBuffer(disp, parameters) (*((disp)->DrawBuffer)) parameters -#define GET_DrawBuffer(disp) ((disp)->DrawBuffer) -#define SET_DrawBuffer(disp, fn) ((disp)->DrawBuffer = fn) -#define CALL_Clear(disp, parameters) (*((disp)->Clear)) parameters -#define GET_Clear(disp) ((disp)->Clear) -#define SET_Clear(disp, fn) ((disp)->Clear = fn) -#define CALL_ClearAccum(disp, parameters) (*((disp)->ClearAccum)) parameters -#define GET_ClearAccum(disp) ((disp)->ClearAccum) -#define SET_ClearAccum(disp, fn) ((disp)->ClearAccum = fn) -#define CALL_ClearIndex(disp, parameters) (*((disp)->ClearIndex)) parameters -#define GET_ClearIndex(disp) ((disp)->ClearIndex) -#define SET_ClearIndex(disp, fn) ((disp)->ClearIndex = fn) -#define CALL_ClearColor(disp, parameters) (*((disp)->ClearColor)) parameters -#define GET_ClearColor(disp) ((disp)->ClearColor) -#define SET_ClearColor(disp, fn) ((disp)->ClearColor = fn) -#define CALL_ClearStencil(disp, parameters) (*((disp)->ClearStencil)) parameters -#define GET_ClearStencil(disp) ((disp)->ClearStencil) -#define SET_ClearStencil(disp, fn) ((disp)->ClearStencil = fn) -#define CALL_ClearDepth(disp, parameters) (*((disp)->ClearDepth)) parameters -#define GET_ClearDepth(disp) ((disp)->ClearDepth) -#define SET_ClearDepth(disp, fn) ((disp)->ClearDepth = fn) -#define CALL_StencilMask(disp, parameters) (*((disp)->StencilMask)) parameters -#define GET_StencilMask(disp) ((disp)->StencilMask) -#define SET_StencilMask(disp, fn) ((disp)->StencilMask = fn) -#define CALL_ColorMask(disp, parameters) (*((disp)->ColorMask)) parameters -#define GET_ColorMask(disp) ((disp)->ColorMask) -#define SET_ColorMask(disp, fn) ((disp)->ColorMask = fn) -#define CALL_DepthMask(disp, parameters) (*((disp)->DepthMask)) parameters -#define GET_DepthMask(disp) ((disp)->DepthMask) -#define SET_DepthMask(disp, fn) ((disp)->DepthMask = fn) -#define CALL_IndexMask(disp, parameters) (*((disp)->IndexMask)) parameters -#define GET_IndexMask(disp) ((disp)->IndexMask) -#define SET_IndexMask(disp, fn) ((disp)->IndexMask = fn) -#define CALL_Accum(disp, parameters) (*((disp)->Accum)) parameters -#define GET_Accum(disp) ((disp)->Accum) -#define SET_Accum(disp, fn) ((disp)->Accum = fn) -#define CALL_Disable(disp, parameters) (*((disp)->Disable)) parameters -#define GET_Disable(disp) ((disp)->Disable) -#define SET_Disable(disp, fn) ((disp)->Disable = fn) -#define CALL_Enable(disp, parameters) (*((disp)->Enable)) parameters -#define GET_Enable(disp) ((disp)->Enable) -#define SET_Enable(disp, fn) ((disp)->Enable = fn) -#define CALL_Finish(disp, parameters) (*((disp)->Finish)) parameters -#define GET_Finish(disp) ((disp)->Finish) -#define SET_Finish(disp, fn) ((disp)->Finish = fn) -#define CALL_Flush(disp, parameters) (*((disp)->Flush)) parameters -#define GET_Flush(disp) ((disp)->Flush) -#define SET_Flush(disp, fn) ((disp)->Flush = fn) -#define CALL_PopAttrib(disp, parameters) (*((disp)->PopAttrib)) parameters -#define GET_PopAttrib(disp) ((disp)->PopAttrib) -#define SET_PopAttrib(disp, fn) ((disp)->PopAttrib = fn) -#define CALL_PushAttrib(disp, parameters) (*((disp)->PushAttrib)) parameters -#define GET_PushAttrib(disp) ((disp)->PushAttrib) -#define SET_PushAttrib(disp, fn) ((disp)->PushAttrib = fn) -#define CALL_Map1d(disp, parameters) (*((disp)->Map1d)) parameters -#define GET_Map1d(disp) ((disp)->Map1d) -#define SET_Map1d(disp, fn) ((disp)->Map1d = fn) -#define CALL_Map1f(disp, parameters) (*((disp)->Map1f)) parameters -#define GET_Map1f(disp) ((disp)->Map1f) -#define SET_Map1f(disp, fn) ((disp)->Map1f = fn) -#define CALL_Map2d(disp, parameters) (*((disp)->Map2d)) parameters -#define GET_Map2d(disp) ((disp)->Map2d) -#define SET_Map2d(disp, fn) ((disp)->Map2d = fn) -#define CALL_Map2f(disp, parameters) (*((disp)->Map2f)) parameters -#define GET_Map2f(disp) ((disp)->Map2f) -#define SET_Map2f(disp, fn) ((disp)->Map2f = fn) -#define CALL_MapGrid1d(disp, parameters) (*((disp)->MapGrid1d)) parameters -#define GET_MapGrid1d(disp) ((disp)->MapGrid1d) -#define SET_MapGrid1d(disp, fn) ((disp)->MapGrid1d = fn) -#define CALL_MapGrid1f(disp, parameters) (*((disp)->MapGrid1f)) parameters -#define GET_MapGrid1f(disp) ((disp)->MapGrid1f) -#define SET_MapGrid1f(disp, fn) ((disp)->MapGrid1f = fn) -#define CALL_MapGrid2d(disp, parameters) (*((disp)->MapGrid2d)) parameters -#define GET_MapGrid2d(disp) ((disp)->MapGrid2d) -#define SET_MapGrid2d(disp, fn) ((disp)->MapGrid2d = fn) -#define CALL_MapGrid2f(disp, parameters) (*((disp)->MapGrid2f)) parameters -#define GET_MapGrid2f(disp) ((disp)->MapGrid2f) -#define SET_MapGrid2f(disp, fn) ((disp)->MapGrid2f = fn) -#define CALL_EvalCoord1d(disp, parameters) (*((disp)->EvalCoord1d)) parameters -#define GET_EvalCoord1d(disp) ((disp)->EvalCoord1d) -#define SET_EvalCoord1d(disp, fn) ((disp)->EvalCoord1d = fn) -#define CALL_EvalCoord1dv(disp, parameters) (*((disp)->EvalCoord1dv)) parameters -#define GET_EvalCoord1dv(disp) ((disp)->EvalCoord1dv) -#define SET_EvalCoord1dv(disp, fn) ((disp)->EvalCoord1dv = fn) -#define CALL_EvalCoord1f(disp, parameters) (*((disp)->EvalCoord1f)) parameters -#define GET_EvalCoord1f(disp) ((disp)->EvalCoord1f) -#define SET_EvalCoord1f(disp, fn) ((disp)->EvalCoord1f = fn) -#define CALL_EvalCoord1fv(disp, parameters) (*((disp)->EvalCoord1fv)) parameters -#define GET_EvalCoord1fv(disp) ((disp)->EvalCoord1fv) -#define SET_EvalCoord1fv(disp, fn) ((disp)->EvalCoord1fv = fn) -#define CALL_EvalCoord2d(disp, parameters) (*((disp)->EvalCoord2d)) parameters -#define GET_EvalCoord2d(disp) ((disp)->EvalCoord2d) -#define SET_EvalCoord2d(disp, fn) ((disp)->EvalCoord2d = fn) -#define CALL_EvalCoord2dv(disp, parameters) (*((disp)->EvalCoord2dv)) parameters -#define GET_EvalCoord2dv(disp) ((disp)->EvalCoord2dv) -#define SET_EvalCoord2dv(disp, fn) ((disp)->EvalCoord2dv = fn) -#define CALL_EvalCoord2f(disp, parameters) (*((disp)->EvalCoord2f)) parameters -#define GET_EvalCoord2f(disp) ((disp)->EvalCoord2f) -#define SET_EvalCoord2f(disp, fn) ((disp)->EvalCoord2f = fn) -#define CALL_EvalCoord2fv(disp, parameters) (*((disp)->EvalCoord2fv)) parameters -#define GET_EvalCoord2fv(disp) ((disp)->EvalCoord2fv) -#define SET_EvalCoord2fv(disp, fn) ((disp)->EvalCoord2fv = fn) -#define CALL_EvalMesh1(disp, parameters) (*((disp)->EvalMesh1)) parameters -#define GET_EvalMesh1(disp) ((disp)->EvalMesh1) -#define SET_EvalMesh1(disp, fn) ((disp)->EvalMesh1 = fn) -#define CALL_EvalPoint1(disp, parameters) (*((disp)->EvalPoint1)) parameters -#define GET_EvalPoint1(disp) ((disp)->EvalPoint1) -#define SET_EvalPoint1(disp, fn) ((disp)->EvalPoint1 = fn) -#define CALL_EvalMesh2(disp, parameters) (*((disp)->EvalMesh2)) parameters -#define GET_EvalMesh2(disp) ((disp)->EvalMesh2) -#define SET_EvalMesh2(disp, fn) ((disp)->EvalMesh2 = fn) -#define CALL_EvalPoint2(disp, parameters) (*((disp)->EvalPoint2)) parameters -#define GET_EvalPoint2(disp) ((disp)->EvalPoint2) -#define SET_EvalPoint2(disp, fn) ((disp)->EvalPoint2 = fn) -#define CALL_AlphaFunc(disp, parameters) (*((disp)->AlphaFunc)) parameters -#define GET_AlphaFunc(disp) ((disp)->AlphaFunc) -#define SET_AlphaFunc(disp, fn) ((disp)->AlphaFunc = fn) -#define CALL_BlendFunc(disp, parameters) (*((disp)->BlendFunc)) parameters -#define GET_BlendFunc(disp) ((disp)->BlendFunc) -#define SET_BlendFunc(disp, fn) ((disp)->BlendFunc = fn) -#define CALL_LogicOp(disp, parameters) (*((disp)->LogicOp)) parameters -#define GET_LogicOp(disp) ((disp)->LogicOp) -#define SET_LogicOp(disp, fn) ((disp)->LogicOp = fn) -#define CALL_StencilFunc(disp, parameters) (*((disp)->StencilFunc)) parameters -#define GET_StencilFunc(disp) ((disp)->StencilFunc) -#define SET_StencilFunc(disp, fn) ((disp)->StencilFunc = fn) -#define CALL_StencilOp(disp, parameters) (*((disp)->StencilOp)) parameters -#define GET_StencilOp(disp) ((disp)->StencilOp) -#define SET_StencilOp(disp, fn) ((disp)->StencilOp = fn) -#define CALL_DepthFunc(disp, parameters) (*((disp)->DepthFunc)) parameters -#define GET_DepthFunc(disp) ((disp)->DepthFunc) -#define SET_DepthFunc(disp, fn) ((disp)->DepthFunc = fn) -#define CALL_PixelZoom(disp, parameters) (*((disp)->PixelZoom)) parameters -#define GET_PixelZoom(disp) ((disp)->PixelZoom) -#define SET_PixelZoom(disp, fn) ((disp)->PixelZoom = fn) -#define CALL_PixelTransferf(disp, parameters) (*((disp)->PixelTransferf)) parameters -#define GET_PixelTransferf(disp) ((disp)->PixelTransferf) -#define SET_PixelTransferf(disp, fn) ((disp)->PixelTransferf = fn) -#define CALL_PixelTransferi(disp, parameters) (*((disp)->PixelTransferi)) parameters -#define GET_PixelTransferi(disp) ((disp)->PixelTransferi) -#define SET_PixelTransferi(disp, fn) ((disp)->PixelTransferi = fn) -#define CALL_PixelStoref(disp, parameters) (*((disp)->PixelStoref)) parameters -#define GET_PixelStoref(disp) ((disp)->PixelStoref) -#define SET_PixelStoref(disp, fn) ((disp)->PixelStoref = fn) -#define CALL_PixelStorei(disp, parameters) (*((disp)->PixelStorei)) parameters -#define GET_PixelStorei(disp) ((disp)->PixelStorei) -#define SET_PixelStorei(disp, fn) ((disp)->PixelStorei = fn) -#define CALL_PixelMapfv(disp, parameters) (*((disp)->PixelMapfv)) parameters -#define GET_PixelMapfv(disp) ((disp)->PixelMapfv) -#define SET_PixelMapfv(disp, fn) ((disp)->PixelMapfv = fn) -#define CALL_PixelMapuiv(disp, parameters) (*((disp)->PixelMapuiv)) parameters -#define GET_PixelMapuiv(disp) ((disp)->PixelMapuiv) -#define SET_PixelMapuiv(disp, fn) ((disp)->PixelMapuiv = fn) -#define CALL_PixelMapusv(disp, parameters) (*((disp)->PixelMapusv)) parameters -#define GET_PixelMapusv(disp) ((disp)->PixelMapusv) -#define SET_PixelMapusv(disp, fn) ((disp)->PixelMapusv = fn) -#define CALL_ReadBuffer(disp, parameters) (*((disp)->ReadBuffer)) parameters -#define GET_ReadBuffer(disp) ((disp)->ReadBuffer) -#define SET_ReadBuffer(disp, fn) ((disp)->ReadBuffer = fn) -#define CALL_CopyPixels(disp, parameters) (*((disp)->CopyPixels)) parameters -#define GET_CopyPixels(disp) ((disp)->CopyPixels) -#define SET_CopyPixels(disp, fn) ((disp)->CopyPixels = fn) -#define CALL_ReadPixels(disp, parameters) (*((disp)->ReadPixels)) parameters -#define GET_ReadPixels(disp) ((disp)->ReadPixels) -#define SET_ReadPixels(disp, fn) ((disp)->ReadPixels = fn) -#define CALL_DrawPixels(disp, parameters) (*((disp)->DrawPixels)) parameters -#define GET_DrawPixels(disp) ((disp)->DrawPixels) -#define SET_DrawPixels(disp, fn) ((disp)->DrawPixels = fn) -#define CALL_GetBooleanv(disp, parameters) (*((disp)->GetBooleanv)) parameters -#define GET_GetBooleanv(disp) ((disp)->GetBooleanv) -#define SET_GetBooleanv(disp, fn) ((disp)->GetBooleanv = fn) -#define CALL_GetClipPlane(disp, parameters) (*((disp)->GetClipPlane)) parameters -#define GET_GetClipPlane(disp) ((disp)->GetClipPlane) -#define SET_GetClipPlane(disp, fn) ((disp)->GetClipPlane = fn) -#define CALL_GetDoublev(disp, parameters) (*((disp)->GetDoublev)) parameters -#define GET_GetDoublev(disp) ((disp)->GetDoublev) -#define SET_GetDoublev(disp, fn) ((disp)->GetDoublev = fn) -#define CALL_GetError(disp, parameters) (*((disp)->GetError)) parameters -#define GET_GetError(disp) ((disp)->GetError) -#define SET_GetError(disp, fn) ((disp)->GetError = fn) -#define CALL_GetFloatv(disp, parameters) (*((disp)->GetFloatv)) parameters -#define GET_GetFloatv(disp) ((disp)->GetFloatv) -#define SET_GetFloatv(disp, fn) ((disp)->GetFloatv = fn) -#define CALL_GetIntegerv(disp, parameters) (*((disp)->GetIntegerv)) parameters -#define GET_GetIntegerv(disp) ((disp)->GetIntegerv) -#define SET_GetIntegerv(disp, fn) ((disp)->GetIntegerv = fn) -#define CALL_GetLightfv(disp, parameters) (*((disp)->GetLightfv)) parameters -#define GET_GetLightfv(disp) ((disp)->GetLightfv) -#define SET_GetLightfv(disp, fn) ((disp)->GetLightfv = fn) -#define CALL_GetLightiv(disp, parameters) (*((disp)->GetLightiv)) parameters -#define GET_GetLightiv(disp) ((disp)->GetLightiv) -#define SET_GetLightiv(disp, fn) ((disp)->GetLightiv = fn) -#define CALL_GetMapdv(disp, parameters) (*((disp)->GetMapdv)) parameters -#define GET_GetMapdv(disp) ((disp)->GetMapdv) -#define SET_GetMapdv(disp, fn) ((disp)->GetMapdv = fn) -#define CALL_GetMapfv(disp, parameters) (*((disp)->GetMapfv)) parameters -#define GET_GetMapfv(disp) ((disp)->GetMapfv) -#define SET_GetMapfv(disp, fn) ((disp)->GetMapfv = fn) -#define CALL_GetMapiv(disp, parameters) (*((disp)->GetMapiv)) parameters -#define GET_GetMapiv(disp) ((disp)->GetMapiv) -#define SET_GetMapiv(disp, fn) ((disp)->GetMapiv = fn) -#define CALL_GetMaterialfv(disp, parameters) (*((disp)->GetMaterialfv)) parameters -#define GET_GetMaterialfv(disp) ((disp)->GetMaterialfv) -#define SET_GetMaterialfv(disp, fn) ((disp)->GetMaterialfv = fn) -#define CALL_GetMaterialiv(disp, parameters) (*((disp)->GetMaterialiv)) parameters -#define GET_GetMaterialiv(disp) ((disp)->GetMaterialiv) -#define SET_GetMaterialiv(disp, fn) ((disp)->GetMaterialiv = fn) -#define CALL_GetPixelMapfv(disp, parameters) (*((disp)->GetPixelMapfv)) parameters -#define GET_GetPixelMapfv(disp) ((disp)->GetPixelMapfv) -#define SET_GetPixelMapfv(disp, fn) ((disp)->GetPixelMapfv = fn) -#define CALL_GetPixelMapuiv(disp, parameters) (*((disp)->GetPixelMapuiv)) parameters -#define GET_GetPixelMapuiv(disp) ((disp)->GetPixelMapuiv) -#define SET_GetPixelMapuiv(disp, fn) ((disp)->GetPixelMapuiv = fn) -#define CALL_GetPixelMapusv(disp, parameters) (*((disp)->GetPixelMapusv)) parameters -#define GET_GetPixelMapusv(disp) ((disp)->GetPixelMapusv) -#define SET_GetPixelMapusv(disp, fn) ((disp)->GetPixelMapusv = fn) -#define CALL_GetPolygonStipple(disp, parameters) (*((disp)->GetPolygonStipple)) parameters -#define GET_GetPolygonStipple(disp) ((disp)->GetPolygonStipple) -#define SET_GetPolygonStipple(disp, fn) ((disp)->GetPolygonStipple = fn) -#define CALL_GetString(disp, parameters) (*((disp)->GetString)) parameters -#define GET_GetString(disp) ((disp)->GetString) -#define SET_GetString(disp, fn) ((disp)->GetString = fn) -#define CALL_GetTexEnvfv(disp, parameters) (*((disp)->GetTexEnvfv)) parameters -#define GET_GetTexEnvfv(disp) ((disp)->GetTexEnvfv) -#define SET_GetTexEnvfv(disp, fn) ((disp)->GetTexEnvfv = fn) -#define CALL_GetTexEnviv(disp, parameters) (*((disp)->GetTexEnviv)) parameters -#define GET_GetTexEnviv(disp) ((disp)->GetTexEnviv) -#define SET_GetTexEnviv(disp, fn) ((disp)->GetTexEnviv = fn) -#define CALL_GetTexGendv(disp, parameters) (*((disp)->GetTexGendv)) parameters -#define GET_GetTexGendv(disp) ((disp)->GetTexGendv) -#define SET_GetTexGendv(disp, fn) ((disp)->GetTexGendv = fn) -#define CALL_GetTexGenfv(disp, parameters) (*((disp)->GetTexGenfv)) parameters -#define GET_GetTexGenfv(disp) ((disp)->GetTexGenfv) -#define SET_GetTexGenfv(disp, fn) ((disp)->GetTexGenfv = fn) -#define CALL_GetTexGeniv(disp, parameters) (*((disp)->GetTexGeniv)) parameters -#define GET_GetTexGeniv(disp) ((disp)->GetTexGeniv) -#define SET_GetTexGeniv(disp, fn) ((disp)->GetTexGeniv = fn) -#define CALL_GetTexImage(disp, parameters) (*((disp)->GetTexImage)) parameters -#define GET_GetTexImage(disp) ((disp)->GetTexImage) -#define SET_GetTexImage(disp, fn) ((disp)->GetTexImage = fn) -#define CALL_GetTexParameterfv(disp, parameters) (*((disp)->GetTexParameterfv)) parameters -#define GET_GetTexParameterfv(disp) ((disp)->GetTexParameterfv) -#define SET_GetTexParameterfv(disp, fn) ((disp)->GetTexParameterfv = fn) -#define CALL_GetTexParameteriv(disp, parameters) (*((disp)->GetTexParameteriv)) parameters -#define GET_GetTexParameteriv(disp) ((disp)->GetTexParameteriv) -#define SET_GetTexParameteriv(disp, fn) ((disp)->GetTexParameteriv = fn) -#define CALL_GetTexLevelParameterfv(disp, parameters) (*((disp)->GetTexLevelParameterfv)) parameters -#define GET_GetTexLevelParameterfv(disp) ((disp)->GetTexLevelParameterfv) -#define SET_GetTexLevelParameterfv(disp, fn) ((disp)->GetTexLevelParameterfv = fn) -#define CALL_GetTexLevelParameteriv(disp, parameters) (*((disp)->GetTexLevelParameteriv)) parameters -#define GET_GetTexLevelParameteriv(disp) ((disp)->GetTexLevelParameteriv) -#define SET_GetTexLevelParameteriv(disp, fn) ((disp)->GetTexLevelParameteriv = fn) -#define CALL_IsEnabled(disp, parameters) (*((disp)->IsEnabled)) parameters -#define GET_IsEnabled(disp) ((disp)->IsEnabled) -#define SET_IsEnabled(disp, fn) ((disp)->IsEnabled = fn) -#define CALL_IsList(disp, parameters) (*((disp)->IsList)) parameters -#define GET_IsList(disp) ((disp)->IsList) -#define SET_IsList(disp, fn) ((disp)->IsList = fn) -#define CALL_DepthRange(disp, parameters) (*((disp)->DepthRange)) parameters -#define GET_DepthRange(disp) ((disp)->DepthRange) -#define SET_DepthRange(disp, fn) ((disp)->DepthRange = fn) -#define CALL_Frustum(disp, parameters) (*((disp)->Frustum)) parameters -#define GET_Frustum(disp) ((disp)->Frustum) -#define SET_Frustum(disp, fn) ((disp)->Frustum = fn) -#define CALL_LoadIdentity(disp, parameters) (*((disp)->LoadIdentity)) parameters -#define GET_LoadIdentity(disp) ((disp)->LoadIdentity) -#define SET_LoadIdentity(disp, fn) ((disp)->LoadIdentity = fn) -#define CALL_LoadMatrixf(disp, parameters) (*((disp)->LoadMatrixf)) parameters -#define GET_LoadMatrixf(disp) ((disp)->LoadMatrixf) -#define SET_LoadMatrixf(disp, fn) ((disp)->LoadMatrixf = fn) -#define CALL_LoadMatrixd(disp, parameters) (*((disp)->LoadMatrixd)) parameters -#define GET_LoadMatrixd(disp) ((disp)->LoadMatrixd) -#define SET_LoadMatrixd(disp, fn) ((disp)->LoadMatrixd = fn) -#define CALL_MatrixMode(disp, parameters) (*((disp)->MatrixMode)) parameters -#define GET_MatrixMode(disp) ((disp)->MatrixMode) -#define SET_MatrixMode(disp, fn) ((disp)->MatrixMode = fn) -#define CALL_MultMatrixf(disp, parameters) (*((disp)->MultMatrixf)) parameters -#define GET_MultMatrixf(disp) ((disp)->MultMatrixf) -#define SET_MultMatrixf(disp, fn) ((disp)->MultMatrixf = fn) -#define CALL_MultMatrixd(disp, parameters) (*((disp)->MultMatrixd)) parameters -#define GET_MultMatrixd(disp) ((disp)->MultMatrixd) -#define SET_MultMatrixd(disp, fn) ((disp)->MultMatrixd = fn) -#define CALL_Ortho(disp, parameters) (*((disp)->Ortho)) parameters -#define GET_Ortho(disp) ((disp)->Ortho) -#define SET_Ortho(disp, fn) ((disp)->Ortho = fn) -#define CALL_PopMatrix(disp, parameters) (*((disp)->PopMatrix)) parameters -#define GET_PopMatrix(disp) ((disp)->PopMatrix) -#define SET_PopMatrix(disp, fn) ((disp)->PopMatrix = fn) -#define CALL_PushMatrix(disp, parameters) (*((disp)->PushMatrix)) parameters -#define GET_PushMatrix(disp) ((disp)->PushMatrix) -#define SET_PushMatrix(disp, fn) ((disp)->PushMatrix = fn) -#define CALL_Rotated(disp, parameters) (*((disp)->Rotated)) parameters -#define GET_Rotated(disp) ((disp)->Rotated) -#define SET_Rotated(disp, fn) ((disp)->Rotated = fn) -#define CALL_Rotatef(disp, parameters) (*((disp)->Rotatef)) parameters -#define GET_Rotatef(disp) ((disp)->Rotatef) -#define SET_Rotatef(disp, fn) ((disp)->Rotatef = fn) -#define CALL_Scaled(disp, parameters) (*((disp)->Scaled)) parameters -#define GET_Scaled(disp) ((disp)->Scaled) -#define SET_Scaled(disp, fn) ((disp)->Scaled = fn) -#define CALL_Scalef(disp, parameters) (*((disp)->Scalef)) parameters -#define GET_Scalef(disp) ((disp)->Scalef) -#define SET_Scalef(disp, fn) ((disp)->Scalef = fn) -#define CALL_Translated(disp, parameters) (*((disp)->Translated)) parameters -#define GET_Translated(disp) ((disp)->Translated) -#define SET_Translated(disp, fn) ((disp)->Translated = fn) -#define CALL_Translatef(disp, parameters) (*((disp)->Translatef)) parameters -#define GET_Translatef(disp) ((disp)->Translatef) -#define SET_Translatef(disp, fn) ((disp)->Translatef = fn) -#define CALL_Viewport(disp, parameters) (*((disp)->Viewport)) parameters -#define GET_Viewport(disp) ((disp)->Viewport) -#define SET_Viewport(disp, fn) ((disp)->Viewport = fn) -#define CALL_ArrayElement(disp, parameters) (*((disp)->ArrayElement)) parameters -#define GET_ArrayElement(disp) ((disp)->ArrayElement) -#define SET_ArrayElement(disp, fn) ((disp)->ArrayElement = fn) -#define CALL_BindTexture(disp, parameters) (*((disp)->BindTexture)) parameters -#define GET_BindTexture(disp) ((disp)->BindTexture) -#define SET_BindTexture(disp, fn) ((disp)->BindTexture = fn) -#define CALL_ColorPointer(disp, parameters) (*((disp)->ColorPointer)) parameters -#define GET_ColorPointer(disp) ((disp)->ColorPointer) -#define SET_ColorPointer(disp, fn) ((disp)->ColorPointer = fn) -#define CALL_DisableClientState(disp, parameters) (*((disp)->DisableClientState)) parameters -#define GET_DisableClientState(disp) ((disp)->DisableClientState) -#define SET_DisableClientState(disp, fn) ((disp)->DisableClientState = fn) -#define CALL_DrawArrays(disp, parameters) (*((disp)->DrawArrays)) parameters -#define GET_DrawArrays(disp) ((disp)->DrawArrays) -#define SET_DrawArrays(disp, fn) ((disp)->DrawArrays = fn) -#define CALL_DrawElements(disp, parameters) (*((disp)->DrawElements)) parameters -#define GET_DrawElements(disp) ((disp)->DrawElements) -#define SET_DrawElements(disp, fn) ((disp)->DrawElements = fn) -#define CALL_EdgeFlagPointer(disp, parameters) (*((disp)->EdgeFlagPointer)) parameters -#define GET_EdgeFlagPointer(disp) ((disp)->EdgeFlagPointer) -#define SET_EdgeFlagPointer(disp, fn) ((disp)->EdgeFlagPointer = fn) -#define CALL_EnableClientState(disp, parameters) (*((disp)->EnableClientState)) parameters -#define GET_EnableClientState(disp) ((disp)->EnableClientState) -#define SET_EnableClientState(disp, fn) ((disp)->EnableClientState = fn) -#define CALL_IndexPointer(disp, parameters) (*((disp)->IndexPointer)) parameters -#define GET_IndexPointer(disp) ((disp)->IndexPointer) -#define SET_IndexPointer(disp, fn) ((disp)->IndexPointer = fn) -#define CALL_Indexub(disp, parameters) (*((disp)->Indexub)) parameters -#define GET_Indexub(disp) ((disp)->Indexub) -#define SET_Indexub(disp, fn) ((disp)->Indexub = fn) -#define CALL_Indexubv(disp, parameters) (*((disp)->Indexubv)) parameters -#define GET_Indexubv(disp) ((disp)->Indexubv) -#define SET_Indexubv(disp, fn) ((disp)->Indexubv = fn) -#define CALL_InterleavedArrays(disp, parameters) (*((disp)->InterleavedArrays)) parameters -#define GET_InterleavedArrays(disp) ((disp)->InterleavedArrays) -#define SET_InterleavedArrays(disp, fn) ((disp)->InterleavedArrays = fn) -#define CALL_NormalPointer(disp, parameters) (*((disp)->NormalPointer)) parameters -#define GET_NormalPointer(disp) ((disp)->NormalPointer) -#define SET_NormalPointer(disp, fn) ((disp)->NormalPointer = fn) -#define CALL_PolygonOffset(disp, parameters) (*((disp)->PolygonOffset)) parameters -#define GET_PolygonOffset(disp) ((disp)->PolygonOffset) -#define SET_PolygonOffset(disp, fn) ((disp)->PolygonOffset = fn) -#define CALL_TexCoordPointer(disp, parameters) (*((disp)->TexCoordPointer)) parameters -#define GET_TexCoordPointer(disp) ((disp)->TexCoordPointer) -#define SET_TexCoordPointer(disp, fn) ((disp)->TexCoordPointer = fn) -#define CALL_VertexPointer(disp, parameters) (*((disp)->VertexPointer)) parameters -#define GET_VertexPointer(disp) ((disp)->VertexPointer) -#define SET_VertexPointer(disp, fn) ((disp)->VertexPointer = fn) -#define CALL_AreTexturesResident(disp, parameters) (*((disp)->AreTexturesResident)) parameters -#define GET_AreTexturesResident(disp) ((disp)->AreTexturesResident) -#define SET_AreTexturesResident(disp, fn) ((disp)->AreTexturesResident = fn) -#define CALL_CopyTexImage1D(disp, parameters) (*((disp)->CopyTexImage1D)) parameters -#define GET_CopyTexImage1D(disp) ((disp)->CopyTexImage1D) -#define SET_CopyTexImage1D(disp, fn) ((disp)->CopyTexImage1D = fn) -#define CALL_CopyTexImage2D(disp, parameters) (*((disp)->CopyTexImage2D)) parameters -#define GET_CopyTexImage2D(disp) ((disp)->CopyTexImage2D) -#define SET_CopyTexImage2D(disp, fn) ((disp)->CopyTexImage2D = fn) -#define CALL_CopyTexSubImage1D(disp, parameters) (*((disp)->CopyTexSubImage1D)) parameters -#define GET_CopyTexSubImage1D(disp) ((disp)->CopyTexSubImage1D) -#define SET_CopyTexSubImage1D(disp, fn) ((disp)->CopyTexSubImage1D = fn) -#define CALL_CopyTexSubImage2D(disp, parameters) (*((disp)->CopyTexSubImage2D)) parameters -#define GET_CopyTexSubImage2D(disp) ((disp)->CopyTexSubImage2D) -#define SET_CopyTexSubImage2D(disp, fn) ((disp)->CopyTexSubImage2D = fn) -#define CALL_DeleteTextures(disp, parameters) (*((disp)->DeleteTextures)) parameters -#define GET_DeleteTextures(disp) ((disp)->DeleteTextures) -#define SET_DeleteTextures(disp, fn) ((disp)->DeleteTextures = fn) -#define CALL_GenTextures(disp, parameters) (*((disp)->GenTextures)) parameters -#define GET_GenTextures(disp) ((disp)->GenTextures) -#define SET_GenTextures(disp, fn) ((disp)->GenTextures = fn) -#define CALL_GetPointerv(disp, parameters) (*((disp)->GetPointerv)) parameters -#define GET_GetPointerv(disp) ((disp)->GetPointerv) -#define SET_GetPointerv(disp, fn) ((disp)->GetPointerv = fn) -#define CALL_IsTexture(disp, parameters) (*((disp)->IsTexture)) parameters -#define GET_IsTexture(disp) ((disp)->IsTexture) -#define SET_IsTexture(disp, fn) ((disp)->IsTexture = fn) -#define CALL_PrioritizeTextures(disp, parameters) (*((disp)->PrioritizeTextures)) parameters -#define GET_PrioritizeTextures(disp) ((disp)->PrioritizeTextures) -#define SET_PrioritizeTextures(disp, fn) ((disp)->PrioritizeTextures = fn) -#define CALL_TexSubImage1D(disp, parameters) (*((disp)->TexSubImage1D)) parameters -#define GET_TexSubImage1D(disp) ((disp)->TexSubImage1D) -#define SET_TexSubImage1D(disp, fn) ((disp)->TexSubImage1D = fn) -#define CALL_TexSubImage2D(disp, parameters) (*((disp)->TexSubImage2D)) parameters -#define GET_TexSubImage2D(disp) ((disp)->TexSubImage2D) -#define SET_TexSubImage2D(disp, fn) ((disp)->TexSubImage2D = fn) -#define CALL_PopClientAttrib(disp, parameters) (*((disp)->PopClientAttrib)) parameters -#define GET_PopClientAttrib(disp) ((disp)->PopClientAttrib) -#define SET_PopClientAttrib(disp, fn) ((disp)->PopClientAttrib = fn) -#define CALL_PushClientAttrib(disp, parameters) (*((disp)->PushClientAttrib)) parameters -#define GET_PushClientAttrib(disp) ((disp)->PushClientAttrib) -#define SET_PushClientAttrib(disp, fn) ((disp)->PushClientAttrib = fn) -#define CALL_BlendColor(disp, parameters) (*((disp)->BlendColor)) parameters -#define GET_BlendColor(disp) ((disp)->BlendColor) -#define SET_BlendColor(disp, fn) ((disp)->BlendColor = fn) -#define CALL_BlendEquation(disp, parameters) (*((disp)->BlendEquation)) parameters -#define GET_BlendEquation(disp) ((disp)->BlendEquation) -#define SET_BlendEquation(disp, fn) ((disp)->BlendEquation = fn) -#define CALL_DrawRangeElements(disp, parameters) (*((disp)->DrawRangeElements)) parameters -#define GET_DrawRangeElements(disp) ((disp)->DrawRangeElements) -#define SET_DrawRangeElements(disp, fn) ((disp)->DrawRangeElements = fn) -#define CALL_ColorTable(disp, parameters) (*((disp)->ColorTable)) parameters -#define GET_ColorTable(disp) ((disp)->ColorTable) -#define SET_ColorTable(disp, fn) ((disp)->ColorTable = fn) -#define CALL_ColorTableParameterfv(disp, parameters) (*((disp)->ColorTableParameterfv)) parameters -#define GET_ColorTableParameterfv(disp) ((disp)->ColorTableParameterfv) -#define SET_ColorTableParameterfv(disp, fn) ((disp)->ColorTableParameterfv = fn) -#define CALL_ColorTableParameteriv(disp, parameters) (*((disp)->ColorTableParameteriv)) parameters -#define GET_ColorTableParameteriv(disp) ((disp)->ColorTableParameteriv) -#define SET_ColorTableParameteriv(disp, fn) ((disp)->ColorTableParameteriv = fn) -#define CALL_CopyColorTable(disp, parameters) (*((disp)->CopyColorTable)) parameters -#define GET_CopyColorTable(disp) ((disp)->CopyColorTable) -#define SET_CopyColorTable(disp, fn) ((disp)->CopyColorTable = fn) -#define CALL_GetColorTable(disp, parameters) (*((disp)->GetColorTable)) parameters -#define GET_GetColorTable(disp) ((disp)->GetColorTable) -#define SET_GetColorTable(disp, fn) ((disp)->GetColorTable = fn) -#define CALL_GetColorTableParameterfv(disp, parameters) (*((disp)->GetColorTableParameterfv)) parameters -#define GET_GetColorTableParameterfv(disp) ((disp)->GetColorTableParameterfv) -#define SET_GetColorTableParameterfv(disp, fn) ((disp)->GetColorTableParameterfv = fn) -#define CALL_GetColorTableParameteriv(disp, parameters) (*((disp)->GetColorTableParameteriv)) parameters -#define GET_GetColorTableParameteriv(disp) ((disp)->GetColorTableParameteriv) -#define SET_GetColorTableParameteriv(disp, fn) ((disp)->GetColorTableParameteriv = fn) -#define CALL_ColorSubTable(disp, parameters) (*((disp)->ColorSubTable)) parameters -#define GET_ColorSubTable(disp) ((disp)->ColorSubTable) -#define SET_ColorSubTable(disp, fn) ((disp)->ColorSubTable = fn) -#define CALL_CopyColorSubTable(disp, parameters) (*((disp)->CopyColorSubTable)) parameters -#define GET_CopyColorSubTable(disp) ((disp)->CopyColorSubTable) -#define SET_CopyColorSubTable(disp, fn) ((disp)->CopyColorSubTable = fn) -#define CALL_ConvolutionFilter1D(disp, parameters) (*((disp)->ConvolutionFilter1D)) parameters -#define GET_ConvolutionFilter1D(disp) ((disp)->ConvolutionFilter1D) -#define SET_ConvolutionFilter1D(disp, fn) ((disp)->ConvolutionFilter1D = fn) -#define CALL_ConvolutionFilter2D(disp, parameters) (*((disp)->ConvolutionFilter2D)) parameters -#define GET_ConvolutionFilter2D(disp) ((disp)->ConvolutionFilter2D) -#define SET_ConvolutionFilter2D(disp, fn) ((disp)->ConvolutionFilter2D = fn) -#define CALL_ConvolutionParameterf(disp, parameters) (*((disp)->ConvolutionParameterf)) parameters -#define GET_ConvolutionParameterf(disp) ((disp)->ConvolutionParameterf) -#define SET_ConvolutionParameterf(disp, fn) ((disp)->ConvolutionParameterf = fn) -#define CALL_ConvolutionParameterfv(disp, parameters) (*((disp)->ConvolutionParameterfv)) parameters -#define GET_ConvolutionParameterfv(disp) ((disp)->ConvolutionParameterfv) -#define SET_ConvolutionParameterfv(disp, fn) ((disp)->ConvolutionParameterfv = fn) -#define CALL_ConvolutionParameteri(disp, parameters) (*((disp)->ConvolutionParameteri)) parameters -#define GET_ConvolutionParameteri(disp) ((disp)->ConvolutionParameteri) -#define SET_ConvolutionParameteri(disp, fn) ((disp)->ConvolutionParameteri = fn) -#define CALL_ConvolutionParameteriv(disp, parameters) (*((disp)->ConvolutionParameteriv)) parameters -#define GET_ConvolutionParameteriv(disp) ((disp)->ConvolutionParameteriv) -#define SET_ConvolutionParameteriv(disp, fn) ((disp)->ConvolutionParameteriv = fn) -#define CALL_CopyConvolutionFilter1D(disp, parameters) (*((disp)->CopyConvolutionFilter1D)) parameters -#define GET_CopyConvolutionFilter1D(disp) ((disp)->CopyConvolutionFilter1D) -#define SET_CopyConvolutionFilter1D(disp, fn) ((disp)->CopyConvolutionFilter1D = fn) -#define CALL_CopyConvolutionFilter2D(disp, parameters) (*((disp)->CopyConvolutionFilter2D)) parameters -#define GET_CopyConvolutionFilter2D(disp) ((disp)->CopyConvolutionFilter2D) -#define SET_CopyConvolutionFilter2D(disp, fn) ((disp)->CopyConvolutionFilter2D = fn) -#define CALL_GetConvolutionFilter(disp, parameters) (*((disp)->GetConvolutionFilter)) parameters -#define GET_GetConvolutionFilter(disp) ((disp)->GetConvolutionFilter) -#define SET_GetConvolutionFilter(disp, fn) ((disp)->GetConvolutionFilter = fn) -#define CALL_GetConvolutionParameterfv(disp, parameters) (*((disp)->GetConvolutionParameterfv)) parameters -#define GET_GetConvolutionParameterfv(disp) ((disp)->GetConvolutionParameterfv) -#define SET_GetConvolutionParameterfv(disp, fn) ((disp)->GetConvolutionParameterfv = fn) -#define CALL_GetConvolutionParameteriv(disp, parameters) (*((disp)->GetConvolutionParameteriv)) parameters -#define GET_GetConvolutionParameteriv(disp) ((disp)->GetConvolutionParameteriv) -#define SET_GetConvolutionParameteriv(disp, fn) ((disp)->GetConvolutionParameteriv = fn) -#define CALL_GetSeparableFilter(disp, parameters) (*((disp)->GetSeparableFilter)) parameters -#define GET_GetSeparableFilter(disp) ((disp)->GetSeparableFilter) -#define SET_GetSeparableFilter(disp, fn) ((disp)->GetSeparableFilter = fn) -#define CALL_SeparableFilter2D(disp, parameters) (*((disp)->SeparableFilter2D)) parameters -#define GET_SeparableFilter2D(disp) ((disp)->SeparableFilter2D) -#define SET_SeparableFilter2D(disp, fn) ((disp)->SeparableFilter2D = fn) -#define CALL_GetHistogram(disp, parameters) (*((disp)->GetHistogram)) parameters -#define GET_GetHistogram(disp) ((disp)->GetHistogram) -#define SET_GetHistogram(disp, fn) ((disp)->GetHistogram = fn) -#define CALL_GetHistogramParameterfv(disp, parameters) (*((disp)->GetHistogramParameterfv)) parameters -#define GET_GetHistogramParameterfv(disp) ((disp)->GetHistogramParameterfv) -#define SET_GetHistogramParameterfv(disp, fn) ((disp)->GetHistogramParameterfv = fn) -#define CALL_GetHistogramParameteriv(disp, parameters) (*((disp)->GetHistogramParameteriv)) parameters -#define GET_GetHistogramParameteriv(disp) ((disp)->GetHistogramParameteriv) -#define SET_GetHistogramParameteriv(disp, fn) ((disp)->GetHistogramParameteriv = fn) -#define CALL_GetMinmax(disp, parameters) (*((disp)->GetMinmax)) parameters -#define GET_GetMinmax(disp) ((disp)->GetMinmax) -#define SET_GetMinmax(disp, fn) ((disp)->GetMinmax = fn) -#define CALL_GetMinmaxParameterfv(disp, parameters) (*((disp)->GetMinmaxParameterfv)) parameters -#define GET_GetMinmaxParameterfv(disp) ((disp)->GetMinmaxParameterfv) -#define SET_GetMinmaxParameterfv(disp, fn) ((disp)->GetMinmaxParameterfv = fn) -#define CALL_GetMinmaxParameteriv(disp, parameters) (*((disp)->GetMinmaxParameteriv)) parameters -#define GET_GetMinmaxParameteriv(disp) ((disp)->GetMinmaxParameteriv) -#define SET_GetMinmaxParameteriv(disp, fn) ((disp)->GetMinmaxParameteriv = fn) -#define CALL_Histogram(disp, parameters) (*((disp)->Histogram)) parameters -#define GET_Histogram(disp) ((disp)->Histogram) -#define SET_Histogram(disp, fn) ((disp)->Histogram = fn) -#define CALL_Minmax(disp, parameters) (*((disp)->Minmax)) parameters -#define GET_Minmax(disp) ((disp)->Minmax) -#define SET_Minmax(disp, fn) ((disp)->Minmax = fn) -#define CALL_ResetHistogram(disp, parameters) (*((disp)->ResetHistogram)) parameters -#define GET_ResetHistogram(disp) ((disp)->ResetHistogram) -#define SET_ResetHistogram(disp, fn) ((disp)->ResetHistogram = fn) -#define CALL_ResetMinmax(disp, parameters) (*((disp)->ResetMinmax)) parameters -#define GET_ResetMinmax(disp) ((disp)->ResetMinmax) -#define SET_ResetMinmax(disp, fn) ((disp)->ResetMinmax = fn) -#define CALL_TexImage3D(disp, parameters) (*((disp)->TexImage3D)) parameters -#define GET_TexImage3D(disp) ((disp)->TexImage3D) -#define SET_TexImage3D(disp, fn) ((disp)->TexImage3D = fn) -#define CALL_TexSubImage3D(disp, parameters) (*((disp)->TexSubImage3D)) parameters -#define GET_TexSubImage3D(disp) ((disp)->TexSubImage3D) -#define SET_TexSubImage3D(disp, fn) ((disp)->TexSubImage3D = fn) -#define CALL_CopyTexSubImage3D(disp, parameters) (*((disp)->CopyTexSubImage3D)) parameters -#define GET_CopyTexSubImage3D(disp) ((disp)->CopyTexSubImage3D) -#define SET_CopyTexSubImage3D(disp, fn) ((disp)->CopyTexSubImage3D = fn) -#define CALL_ActiveTextureARB(disp, parameters) (*((disp)->ActiveTextureARB)) parameters -#define GET_ActiveTextureARB(disp) ((disp)->ActiveTextureARB) -#define SET_ActiveTextureARB(disp, fn) ((disp)->ActiveTextureARB = fn) -#define CALL_ClientActiveTextureARB(disp, parameters) (*((disp)->ClientActiveTextureARB)) parameters -#define GET_ClientActiveTextureARB(disp) ((disp)->ClientActiveTextureARB) -#define SET_ClientActiveTextureARB(disp, fn) ((disp)->ClientActiveTextureARB = fn) -#define CALL_MultiTexCoord1dARB(disp, parameters) (*((disp)->MultiTexCoord1dARB)) parameters -#define GET_MultiTexCoord1dARB(disp) ((disp)->MultiTexCoord1dARB) -#define SET_MultiTexCoord1dARB(disp, fn) ((disp)->MultiTexCoord1dARB = fn) -#define CALL_MultiTexCoord1dvARB(disp, parameters) (*((disp)->MultiTexCoord1dvARB)) parameters -#define GET_MultiTexCoord1dvARB(disp) ((disp)->MultiTexCoord1dvARB) -#define SET_MultiTexCoord1dvARB(disp, fn) ((disp)->MultiTexCoord1dvARB = fn) -#define CALL_MultiTexCoord1fARB(disp, parameters) (*((disp)->MultiTexCoord1fARB)) parameters -#define GET_MultiTexCoord1fARB(disp) ((disp)->MultiTexCoord1fARB) -#define SET_MultiTexCoord1fARB(disp, fn) ((disp)->MultiTexCoord1fARB = fn) -#define CALL_MultiTexCoord1fvARB(disp, parameters) (*((disp)->MultiTexCoord1fvARB)) parameters -#define GET_MultiTexCoord1fvARB(disp) ((disp)->MultiTexCoord1fvARB) -#define SET_MultiTexCoord1fvARB(disp, fn) ((disp)->MultiTexCoord1fvARB = fn) -#define CALL_MultiTexCoord1iARB(disp, parameters) (*((disp)->MultiTexCoord1iARB)) parameters -#define GET_MultiTexCoord1iARB(disp) ((disp)->MultiTexCoord1iARB) -#define SET_MultiTexCoord1iARB(disp, fn) ((disp)->MultiTexCoord1iARB = fn) -#define CALL_MultiTexCoord1ivARB(disp, parameters) (*((disp)->MultiTexCoord1ivARB)) parameters -#define GET_MultiTexCoord1ivARB(disp) ((disp)->MultiTexCoord1ivARB) -#define SET_MultiTexCoord1ivARB(disp, fn) ((disp)->MultiTexCoord1ivARB = fn) -#define CALL_MultiTexCoord1sARB(disp, parameters) (*((disp)->MultiTexCoord1sARB)) parameters -#define GET_MultiTexCoord1sARB(disp) ((disp)->MultiTexCoord1sARB) -#define SET_MultiTexCoord1sARB(disp, fn) ((disp)->MultiTexCoord1sARB = fn) -#define CALL_MultiTexCoord1svARB(disp, parameters) (*((disp)->MultiTexCoord1svARB)) parameters -#define GET_MultiTexCoord1svARB(disp) ((disp)->MultiTexCoord1svARB) -#define SET_MultiTexCoord1svARB(disp, fn) ((disp)->MultiTexCoord1svARB = fn) -#define CALL_MultiTexCoord2dARB(disp, parameters) (*((disp)->MultiTexCoord2dARB)) parameters -#define GET_MultiTexCoord2dARB(disp) ((disp)->MultiTexCoord2dARB) -#define SET_MultiTexCoord2dARB(disp, fn) ((disp)->MultiTexCoord2dARB = fn) -#define CALL_MultiTexCoord2dvARB(disp, parameters) (*((disp)->MultiTexCoord2dvARB)) parameters -#define GET_MultiTexCoord2dvARB(disp) ((disp)->MultiTexCoord2dvARB) -#define SET_MultiTexCoord2dvARB(disp, fn) ((disp)->MultiTexCoord2dvARB = fn) -#define CALL_MultiTexCoord2fARB(disp, parameters) (*((disp)->MultiTexCoord2fARB)) parameters -#define GET_MultiTexCoord2fARB(disp) ((disp)->MultiTexCoord2fARB) -#define SET_MultiTexCoord2fARB(disp, fn) ((disp)->MultiTexCoord2fARB = fn) -#define CALL_MultiTexCoord2fvARB(disp, parameters) (*((disp)->MultiTexCoord2fvARB)) parameters -#define GET_MultiTexCoord2fvARB(disp) ((disp)->MultiTexCoord2fvARB) -#define SET_MultiTexCoord2fvARB(disp, fn) ((disp)->MultiTexCoord2fvARB = fn) -#define CALL_MultiTexCoord2iARB(disp, parameters) (*((disp)->MultiTexCoord2iARB)) parameters -#define GET_MultiTexCoord2iARB(disp) ((disp)->MultiTexCoord2iARB) -#define SET_MultiTexCoord2iARB(disp, fn) ((disp)->MultiTexCoord2iARB = fn) -#define CALL_MultiTexCoord2ivARB(disp, parameters) (*((disp)->MultiTexCoord2ivARB)) parameters -#define GET_MultiTexCoord2ivARB(disp) ((disp)->MultiTexCoord2ivARB) -#define SET_MultiTexCoord2ivARB(disp, fn) ((disp)->MultiTexCoord2ivARB = fn) -#define CALL_MultiTexCoord2sARB(disp, parameters) (*((disp)->MultiTexCoord2sARB)) parameters -#define GET_MultiTexCoord2sARB(disp) ((disp)->MultiTexCoord2sARB) -#define SET_MultiTexCoord2sARB(disp, fn) ((disp)->MultiTexCoord2sARB = fn) -#define CALL_MultiTexCoord2svARB(disp, parameters) (*((disp)->MultiTexCoord2svARB)) parameters -#define GET_MultiTexCoord2svARB(disp) ((disp)->MultiTexCoord2svARB) -#define SET_MultiTexCoord2svARB(disp, fn) ((disp)->MultiTexCoord2svARB = fn) -#define CALL_MultiTexCoord3dARB(disp, parameters) (*((disp)->MultiTexCoord3dARB)) parameters -#define GET_MultiTexCoord3dARB(disp) ((disp)->MultiTexCoord3dARB) -#define SET_MultiTexCoord3dARB(disp, fn) ((disp)->MultiTexCoord3dARB = fn) -#define CALL_MultiTexCoord3dvARB(disp, parameters) (*((disp)->MultiTexCoord3dvARB)) parameters -#define GET_MultiTexCoord3dvARB(disp) ((disp)->MultiTexCoord3dvARB) -#define SET_MultiTexCoord3dvARB(disp, fn) ((disp)->MultiTexCoord3dvARB = fn) -#define CALL_MultiTexCoord3fARB(disp, parameters) (*((disp)->MultiTexCoord3fARB)) parameters -#define GET_MultiTexCoord3fARB(disp) ((disp)->MultiTexCoord3fARB) -#define SET_MultiTexCoord3fARB(disp, fn) ((disp)->MultiTexCoord3fARB = fn) -#define CALL_MultiTexCoord3fvARB(disp, parameters) (*((disp)->MultiTexCoord3fvARB)) parameters -#define GET_MultiTexCoord3fvARB(disp) ((disp)->MultiTexCoord3fvARB) -#define SET_MultiTexCoord3fvARB(disp, fn) ((disp)->MultiTexCoord3fvARB = fn) -#define CALL_MultiTexCoord3iARB(disp, parameters) (*((disp)->MultiTexCoord3iARB)) parameters -#define GET_MultiTexCoord3iARB(disp) ((disp)->MultiTexCoord3iARB) -#define SET_MultiTexCoord3iARB(disp, fn) ((disp)->MultiTexCoord3iARB = fn) -#define CALL_MultiTexCoord3ivARB(disp, parameters) (*((disp)->MultiTexCoord3ivARB)) parameters -#define GET_MultiTexCoord3ivARB(disp) ((disp)->MultiTexCoord3ivARB) -#define SET_MultiTexCoord3ivARB(disp, fn) ((disp)->MultiTexCoord3ivARB = fn) -#define CALL_MultiTexCoord3sARB(disp, parameters) (*((disp)->MultiTexCoord3sARB)) parameters -#define GET_MultiTexCoord3sARB(disp) ((disp)->MultiTexCoord3sARB) -#define SET_MultiTexCoord3sARB(disp, fn) ((disp)->MultiTexCoord3sARB = fn) -#define CALL_MultiTexCoord3svARB(disp, parameters) (*((disp)->MultiTexCoord3svARB)) parameters -#define GET_MultiTexCoord3svARB(disp) ((disp)->MultiTexCoord3svARB) -#define SET_MultiTexCoord3svARB(disp, fn) ((disp)->MultiTexCoord3svARB = fn) -#define CALL_MultiTexCoord4dARB(disp, parameters) (*((disp)->MultiTexCoord4dARB)) parameters -#define GET_MultiTexCoord4dARB(disp) ((disp)->MultiTexCoord4dARB) -#define SET_MultiTexCoord4dARB(disp, fn) ((disp)->MultiTexCoord4dARB = fn) -#define CALL_MultiTexCoord4dvARB(disp, parameters) (*((disp)->MultiTexCoord4dvARB)) parameters -#define GET_MultiTexCoord4dvARB(disp) ((disp)->MultiTexCoord4dvARB) -#define SET_MultiTexCoord4dvARB(disp, fn) ((disp)->MultiTexCoord4dvARB = fn) -#define CALL_MultiTexCoord4fARB(disp, parameters) (*((disp)->MultiTexCoord4fARB)) parameters -#define GET_MultiTexCoord4fARB(disp) ((disp)->MultiTexCoord4fARB) -#define SET_MultiTexCoord4fARB(disp, fn) ((disp)->MultiTexCoord4fARB = fn) -#define CALL_MultiTexCoord4fvARB(disp, parameters) (*((disp)->MultiTexCoord4fvARB)) parameters -#define GET_MultiTexCoord4fvARB(disp) ((disp)->MultiTexCoord4fvARB) -#define SET_MultiTexCoord4fvARB(disp, fn) ((disp)->MultiTexCoord4fvARB = fn) -#define CALL_MultiTexCoord4iARB(disp, parameters) (*((disp)->MultiTexCoord4iARB)) parameters -#define GET_MultiTexCoord4iARB(disp) ((disp)->MultiTexCoord4iARB) -#define SET_MultiTexCoord4iARB(disp, fn) ((disp)->MultiTexCoord4iARB = fn) -#define CALL_MultiTexCoord4ivARB(disp, parameters) (*((disp)->MultiTexCoord4ivARB)) parameters -#define GET_MultiTexCoord4ivARB(disp) ((disp)->MultiTexCoord4ivARB) -#define SET_MultiTexCoord4ivARB(disp, fn) ((disp)->MultiTexCoord4ivARB = fn) -#define CALL_MultiTexCoord4sARB(disp, parameters) (*((disp)->MultiTexCoord4sARB)) parameters -#define GET_MultiTexCoord4sARB(disp) ((disp)->MultiTexCoord4sARB) -#define SET_MultiTexCoord4sARB(disp, fn) ((disp)->MultiTexCoord4sARB = fn) -#define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters -#define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) -#define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) - -#if !defined(IN_DRI_DRIVER) - -#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters -#define GET_AttachShader(disp) ((disp)->AttachShader) -#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) -#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters -#define GET_CreateProgram(disp) ((disp)->CreateProgram) -#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) -#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters -#define GET_CreateShader(disp) ((disp)->CreateShader) -#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) -#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters -#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) -#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) -#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters -#define GET_DeleteShader(disp) ((disp)->DeleteShader) -#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) -#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters -#define GET_DetachShader(disp) ((disp)->DetachShader) -#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) -#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters -#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) -#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) -#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters -#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) -#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) -#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters -#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) -#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) -#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters -#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) -#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) -#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters -#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) -#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) -#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters -#define GET_IsProgram(disp) ((disp)->IsProgram) -#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) -#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters -#define GET_IsShader(disp) ((disp)->IsShader) -#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) -#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters -#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) -#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) -#define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters -#define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) -#define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) -#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters -#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) -#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters -#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) -#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters -#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) -#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters -#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) -#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters -#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) -#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters -#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) -#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters -#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) -#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters -#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) -#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters -#define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) -#define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) (*((disp)->MultTransposeMatrixdARB)) parameters -#define GET_MultTransposeMatrixdARB(disp) ((disp)->MultTransposeMatrixdARB) -#define SET_MultTransposeMatrixdARB(disp, fn) ((disp)->MultTransposeMatrixdARB = fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) (*((disp)->MultTransposeMatrixfARB)) parameters -#define GET_MultTransposeMatrixfARB(disp) ((disp)->MultTransposeMatrixfARB) -#define SET_MultTransposeMatrixfARB(disp, fn) ((disp)->MultTransposeMatrixfARB = fn) -#define CALL_SampleCoverageARB(disp, parameters) (*((disp)->SampleCoverageARB)) parameters -#define GET_SampleCoverageARB(disp) ((disp)->SampleCoverageARB) -#define SET_SampleCoverageARB(disp, fn) ((disp)->SampleCoverageARB = fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) (*((disp)->CompressedTexImage1DARB)) parameters -#define GET_CompressedTexImage1DARB(disp) ((disp)->CompressedTexImage1DARB) -#define SET_CompressedTexImage1DARB(disp, fn) ((disp)->CompressedTexImage1DARB = fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) (*((disp)->CompressedTexImage2DARB)) parameters -#define GET_CompressedTexImage2DARB(disp) ((disp)->CompressedTexImage2DARB) -#define SET_CompressedTexImage2DARB(disp, fn) ((disp)->CompressedTexImage2DARB = fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) (*((disp)->CompressedTexImage3DARB)) parameters -#define GET_CompressedTexImage3DARB(disp) ((disp)->CompressedTexImage3DARB) -#define SET_CompressedTexImage3DARB(disp, fn) ((disp)->CompressedTexImage3DARB = fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) (*((disp)->CompressedTexSubImage1DARB)) parameters -#define GET_CompressedTexSubImage1DARB(disp) ((disp)->CompressedTexSubImage1DARB) -#define SET_CompressedTexSubImage1DARB(disp, fn) ((disp)->CompressedTexSubImage1DARB = fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) (*((disp)->CompressedTexSubImage2DARB)) parameters -#define GET_CompressedTexSubImage2DARB(disp) ((disp)->CompressedTexSubImage2DARB) -#define SET_CompressedTexSubImage2DARB(disp, fn) ((disp)->CompressedTexSubImage2DARB = fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) (*((disp)->CompressedTexSubImage3DARB)) parameters -#define GET_CompressedTexSubImage3DARB(disp) ((disp)->CompressedTexSubImage3DARB) -#define SET_CompressedTexSubImage3DARB(disp, fn) ((disp)->CompressedTexSubImage3DARB = fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) (*((disp)->GetCompressedTexImageARB)) parameters -#define GET_GetCompressedTexImageARB(disp) ((disp)->GetCompressedTexImageARB) -#define SET_GetCompressedTexImageARB(disp, fn) ((disp)->GetCompressedTexImageARB = fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) (*((disp)->DisableVertexAttribArrayARB)) parameters -#define GET_DisableVertexAttribArrayARB(disp) ((disp)->DisableVertexAttribArrayARB) -#define SET_DisableVertexAttribArrayARB(disp, fn) ((disp)->DisableVertexAttribArrayARB = fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) (*((disp)->EnableVertexAttribArrayARB)) parameters -#define GET_EnableVertexAttribArrayARB(disp) ((disp)->EnableVertexAttribArrayARB) -#define SET_EnableVertexAttribArrayARB(disp, fn) ((disp)->EnableVertexAttribArrayARB = fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) (*((disp)->GetProgramEnvParameterdvARB)) parameters -#define GET_GetProgramEnvParameterdvARB(disp) ((disp)->GetProgramEnvParameterdvARB) -#define SET_GetProgramEnvParameterdvARB(disp, fn) ((disp)->GetProgramEnvParameterdvARB = fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) (*((disp)->GetProgramEnvParameterfvARB)) parameters -#define GET_GetProgramEnvParameterfvARB(disp) ((disp)->GetProgramEnvParameterfvARB) -#define SET_GetProgramEnvParameterfvARB(disp, fn) ((disp)->GetProgramEnvParameterfvARB = fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) (*((disp)->GetProgramLocalParameterdvARB)) parameters -#define GET_GetProgramLocalParameterdvARB(disp) ((disp)->GetProgramLocalParameterdvARB) -#define SET_GetProgramLocalParameterdvARB(disp, fn) ((disp)->GetProgramLocalParameterdvARB = fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) (*((disp)->GetProgramLocalParameterfvARB)) parameters -#define GET_GetProgramLocalParameterfvARB(disp) ((disp)->GetProgramLocalParameterfvARB) -#define SET_GetProgramLocalParameterfvARB(disp, fn) ((disp)->GetProgramLocalParameterfvARB = fn) -#define CALL_GetProgramStringARB(disp, parameters) (*((disp)->GetProgramStringARB)) parameters -#define GET_GetProgramStringARB(disp) ((disp)->GetProgramStringARB) -#define SET_GetProgramStringARB(disp, fn) ((disp)->GetProgramStringARB = fn) -#define CALL_GetProgramivARB(disp, parameters) (*((disp)->GetProgramivARB)) parameters -#define GET_GetProgramivARB(disp) ((disp)->GetProgramivARB) -#define SET_GetProgramivARB(disp, fn) ((disp)->GetProgramivARB = fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) (*((disp)->GetVertexAttribdvARB)) parameters -#define GET_GetVertexAttribdvARB(disp) ((disp)->GetVertexAttribdvARB) -#define SET_GetVertexAttribdvARB(disp, fn) ((disp)->GetVertexAttribdvARB = fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) (*((disp)->GetVertexAttribfvARB)) parameters -#define GET_GetVertexAttribfvARB(disp) ((disp)->GetVertexAttribfvARB) -#define SET_GetVertexAttribfvARB(disp, fn) ((disp)->GetVertexAttribfvARB = fn) -#define CALL_GetVertexAttribivARB(disp, parameters) (*((disp)->GetVertexAttribivARB)) parameters -#define GET_GetVertexAttribivARB(disp) ((disp)->GetVertexAttribivARB) -#define SET_GetVertexAttribivARB(disp, fn) ((disp)->GetVertexAttribivARB = fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) (*((disp)->ProgramEnvParameter4dARB)) parameters -#define GET_ProgramEnvParameter4dARB(disp) ((disp)->ProgramEnvParameter4dARB) -#define SET_ProgramEnvParameter4dARB(disp, fn) ((disp)->ProgramEnvParameter4dARB = fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) (*((disp)->ProgramEnvParameter4dvARB)) parameters -#define GET_ProgramEnvParameter4dvARB(disp) ((disp)->ProgramEnvParameter4dvARB) -#define SET_ProgramEnvParameter4dvARB(disp, fn) ((disp)->ProgramEnvParameter4dvARB = fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) (*((disp)->ProgramEnvParameter4fARB)) parameters -#define GET_ProgramEnvParameter4fARB(disp) ((disp)->ProgramEnvParameter4fARB) -#define SET_ProgramEnvParameter4fARB(disp, fn) ((disp)->ProgramEnvParameter4fARB = fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) (*((disp)->ProgramEnvParameter4fvARB)) parameters -#define GET_ProgramEnvParameter4fvARB(disp) ((disp)->ProgramEnvParameter4fvARB) -#define SET_ProgramEnvParameter4fvARB(disp, fn) ((disp)->ProgramEnvParameter4fvARB = fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) (*((disp)->ProgramLocalParameter4dARB)) parameters -#define GET_ProgramLocalParameter4dARB(disp) ((disp)->ProgramLocalParameter4dARB) -#define SET_ProgramLocalParameter4dARB(disp, fn) ((disp)->ProgramLocalParameter4dARB = fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) (*((disp)->ProgramLocalParameter4dvARB)) parameters -#define GET_ProgramLocalParameter4dvARB(disp) ((disp)->ProgramLocalParameter4dvARB) -#define SET_ProgramLocalParameter4dvARB(disp, fn) ((disp)->ProgramLocalParameter4dvARB = fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) (*((disp)->ProgramLocalParameter4fARB)) parameters -#define GET_ProgramLocalParameter4fARB(disp) ((disp)->ProgramLocalParameter4fARB) -#define SET_ProgramLocalParameter4fARB(disp, fn) ((disp)->ProgramLocalParameter4fARB = fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) (*((disp)->ProgramLocalParameter4fvARB)) parameters -#define GET_ProgramLocalParameter4fvARB(disp) ((disp)->ProgramLocalParameter4fvARB) -#define SET_ProgramLocalParameter4fvARB(disp, fn) ((disp)->ProgramLocalParameter4fvARB = fn) -#define CALL_ProgramStringARB(disp, parameters) (*((disp)->ProgramStringARB)) parameters -#define GET_ProgramStringARB(disp) ((disp)->ProgramStringARB) -#define SET_ProgramStringARB(disp, fn) ((disp)->ProgramStringARB = fn) -#define CALL_VertexAttrib1dARB(disp, parameters) (*((disp)->VertexAttrib1dARB)) parameters -#define GET_VertexAttrib1dARB(disp) ((disp)->VertexAttrib1dARB) -#define SET_VertexAttrib1dARB(disp, fn) ((disp)->VertexAttrib1dARB = fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) (*((disp)->VertexAttrib1dvARB)) parameters -#define GET_VertexAttrib1dvARB(disp) ((disp)->VertexAttrib1dvARB) -#define SET_VertexAttrib1dvARB(disp, fn) ((disp)->VertexAttrib1dvARB = fn) -#define CALL_VertexAttrib1fARB(disp, parameters) (*((disp)->VertexAttrib1fARB)) parameters -#define GET_VertexAttrib1fARB(disp) ((disp)->VertexAttrib1fARB) -#define SET_VertexAttrib1fARB(disp, fn) ((disp)->VertexAttrib1fARB = fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) (*((disp)->VertexAttrib1fvARB)) parameters -#define GET_VertexAttrib1fvARB(disp) ((disp)->VertexAttrib1fvARB) -#define SET_VertexAttrib1fvARB(disp, fn) ((disp)->VertexAttrib1fvARB = fn) -#define CALL_VertexAttrib1sARB(disp, parameters) (*((disp)->VertexAttrib1sARB)) parameters -#define GET_VertexAttrib1sARB(disp) ((disp)->VertexAttrib1sARB) -#define SET_VertexAttrib1sARB(disp, fn) ((disp)->VertexAttrib1sARB = fn) -#define CALL_VertexAttrib1svARB(disp, parameters) (*((disp)->VertexAttrib1svARB)) parameters -#define GET_VertexAttrib1svARB(disp) ((disp)->VertexAttrib1svARB) -#define SET_VertexAttrib1svARB(disp, fn) ((disp)->VertexAttrib1svARB = fn) -#define CALL_VertexAttrib2dARB(disp, parameters) (*((disp)->VertexAttrib2dARB)) parameters -#define GET_VertexAttrib2dARB(disp) ((disp)->VertexAttrib2dARB) -#define SET_VertexAttrib2dARB(disp, fn) ((disp)->VertexAttrib2dARB = fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) (*((disp)->VertexAttrib2dvARB)) parameters -#define GET_VertexAttrib2dvARB(disp) ((disp)->VertexAttrib2dvARB) -#define SET_VertexAttrib2dvARB(disp, fn) ((disp)->VertexAttrib2dvARB = fn) -#define CALL_VertexAttrib2fARB(disp, parameters) (*((disp)->VertexAttrib2fARB)) parameters -#define GET_VertexAttrib2fARB(disp) ((disp)->VertexAttrib2fARB) -#define SET_VertexAttrib2fARB(disp, fn) ((disp)->VertexAttrib2fARB = fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) (*((disp)->VertexAttrib2fvARB)) parameters -#define GET_VertexAttrib2fvARB(disp) ((disp)->VertexAttrib2fvARB) -#define SET_VertexAttrib2fvARB(disp, fn) ((disp)->VertexAttrib2fvARB = fn) -#define CALL_VertexAttrib2sARB(disp, parameters) (*((disp)->VertexAttrib2sARB)) parameters -#define GET_VertexAttrib2sARB(disp) ((disp)->VertexAttrib2sARB) -#define SET_VertexAttrib2sARB(disp, fn) ((disp)->VertexAttrib2sARB = fn) -#define CALL_VertexAttrib2svARB(disp, parameters) (*((disp)->VertexAttrib2svARB)) parameters -#define GET_VertexAttrib2svARB(disp) ((disp)->VertexAttrib2svARB) -#define SET_VertexAttrib2svARB(disp, fn) ((disp)->VertexAttrib2svARB = fn) -#define CALL_VertexAttrib3dARB(disp, parameters) (*((disp)->VertexAttrib3dARB)) parameters -#define GET_VertexAttrib3dARB(disp) ((disp)->VertexAttrib3dARB) -#define SET_VertexAttrib3dARB(disp, fn) ((disp)->VertexAttrib3dARB = fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) (*((disp)->VertexAttrib3dvARB)) parameters -#define GET_VertexAttrib3dvARB(disp) ((disp)->VertexAttrib3dvARB) -#define SET_VertexAttrib3dvARB(disp, fn) ((disp)->VertexAttrib3dvARB = fn) -#define CALL_VertexAttrib3fARB(disp, parameters) (*((disp)->VertexAttrib3fARB)) parameters -#define GET_VertexAttrib3fARB(disp) ((disp)->VertexAttrib3fARB) -#define SET_VertexAttrib3fARB(disp, fn) ((disp)->VertexAttrib3fARB = fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) (*((disp)->VertexAttrib3fvARB)) parameters -#define GET_VertexAttrib3fvARB(disp) ((disp)->VertexAttrib3fvARB) -#define SET_VertexAttrib3fvARB(disp, fn) ((disp)->VertexAttrib3fvARB = fn) -#define CALL_VertexAttrib3sARB(disp, parameters) (*((disp)->VertexAttrib3sARB)) parameters -#define GET_VertexAttrib3sARB(disp) ((disp)->VertexAttrib3sARB) -#define SET_VertexAttrib3sARB(disp, fn) ((disp)->VertexAttrib3sARB = fn) -#define CALL_VertexAttrib3svARB(disp, parameters) (*((disp)->VertexAttrib3svARB)) parameters -#define GET_VertexAttrib3svARB(disp) ((disp)->VertexAttrib3svARB) -#define SET_VertexAttrib3svARB(disp, fn) ((disp)->VertexAttrib3svARB = fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) (*((disp)->VertexAttrib4NbvARB)) parameters -#define GET_VertexAttrib4NbvARB(disp) ((disp)->VertexAttrib4NbvARB) -#define SET_VertexAttrib4NbvARB(disp, fn) ((disp)->VertexAttrib4NbvARB = fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) (*((disp)->VertexAttrib4NivARB)) parameters -#define GET_VertexAttrib4NivARB(disp) ((disp)->VertexAttrib4NivARB) -#define SET_VertexAttrib4NivARB(disp, fn) ((disp)->VertexAttrib4NivARB = fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) (*((disp)->VertexAttrib4NsvARB)) parameters -#define GET_VertexAttrib4NsvARB(disp) ((disp)->VertexAttrib4NsvARB) -#define SET_VertexAttrib4NsvARB(disp, fn) ((disp)->VertexAttrib4NsvARB = fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) (*((disp)->VertexAttrib4NubARB)) parameters -#define GET_VertexAttrib4NubARB(disp) ((disp)->VertexAttrib4NubARB) -#define SET_VertexAttrib4NubARB(disp, fn) ((disp)->VertexAttrib4NubARB = fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) (*((disp)->VertexAttrib4NubvARB)) parameters -#define GET_VertexAttrib4NubvARB(disp) ((disp)->VertexAttrib4NubvARB) -#define SET_VertexAttrib4NubvARB(disp, fn) ((disp)->VertexAttrib4NubvARB = fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) (*((disp)->VertexAttrib4NuivARB)) parameters -#define GET_VertexAttrib4NuivARB(disp) ((disp)->VertexAttrib4NuivARB) -#define SET_VertexAttrib4NuivARB(disp, fn) ((disp)->VertexAttrib4NuivARB = fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) (*((disp)->VertexAttrib4NusvARB)) parameters -#define GET_VertexAttrib4NusvARB(disp) ((disp)->VertexAttrib4NusvARB) -#define SET_VertexAttrib4NusvARB(disp, fn) ((disp)->VertexAttrib4NusvARB = fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) (*((disp)->VertexAttrib4bvARB)) parameters -#define GET_VertexAttrib4bvARB(disp) ((disp)->VertexAttrib4bvARB) -#define SET_VertexAttrib4bvARB(disp, fn) ((disp)->VertexAttrib4bvARB = fn) -#define CALL_VertexAttrib4dARB(disp, parameters) (*((disp)->VertexAttrib4dARB)) parameters -#define GET_VertexAttrib4dARB(disp) ((disp)->VertexAttrib4dARB) -#define SET_VertexAttrib4dARB(disp, fn) ((disp)->VertexAttrib4dARB = fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) (*((disp)->VertexAttrib4dvARB)) parameters -#define GET_VertexAttrib4dvARB(disp) ((disp)->VertexAttrib4dvARB) -#define SET_VertexAttrib4dvARB(disp, fn) ((disp)->VertexAttrib4dvARB = fn) -#define CALL_VertexAttrib4fARB(disp, parameters) (*((disp)->VertexAttrib4fARB)) parameters -#define GET_VertexAttrib4fARB(disp) ((disp)->VertexAttrib4fARB) -#define SET_VertexAttrib4fARB(disp, fn) ((disp)->VertexAttrib4fARB = fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) (*((disp)->VertexAttrib4fvARB)) parameters -#define GET_VertexAttrib4fvARB(disp) ((disp)->VertexAttrib4fvARB) -#define SET_VertexAttrib4fvARB(disp, fn) ((disp)->VertexAttrib4fvARB = fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) (*((disp)->VertexAttrib4ivARB)) parameters -#define GET_VertexAttrib4ivARB(disp) ((disp)->VertexAttrib4ivARB) -#define SET_VertexAttrib4ivARB(disp, fn) ((disp)->VertexAttrib4ivARB = fn) -#define CALL_VertexAttrib4sARB(disp, parameters) (*((disp)->VertexAttrib4sARB)) parameters -#define GET_VertexAttrib4sARB(disp) ((disp)->VertexAttrib4sARB) -#define SET_VertexAttrib4sARB(disp, fn) ((disp)->VertexAttrib4sARB = fn) -#define CALL_VertexAttrib4svARB(disp, parameters) (*((disp)->VertexAttrib4svARB)) parameters -#define GET_VertexAttrib4svARB(disp) ((disp)->VertexAttrib4svARB) -#define SET_VertexAttrib4svARB(disp, fn) ((disp)->VertexAttrib4svARB = fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) (*((disp)->VertexAttrib4ubvARB)) parameters -#define GET_VertexAttrib4ubvARB(disp) ((disp)->VertexAttrib4ubvARB) -#define SET_VertexAttrib4ubvARB(disp, fn) ((disp)->VertexAttrib4ubvARB = fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) (*((disp)->VertexAttrib4uivARB)) parameters -#define GET_VertexAttrib4uivARB(disp) ((disp)->VertexAttrib4uivARB) -#define SET_VertexAttrib4uivARB(disp, fn) ((disp)->VertexAttrib4uivARB = fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) (*((disp)->VertexAttrib4usvARB)) parameters -#define GET_VertexAttrib4usvARB(disp) ((disp)->VertexAttrib4usvARB) -#define SET_VertexAttrib4usvARB(disp, fn) ((disp)->VertexAttrib4usvARB = fn) -#define CALL_VertexAttribPointerARB(disp, parameters) (*((disp)->VertexAttribPointerARB)) parameters -#define GET_VertexAttribPointerARB(disp) ((disp)->VertexAttribPointerARB) -#define SET_VertexAttribPointerARB(disp, fn) ((disp)->VertexAttribPointerARB = fn) -#define CALL_BindBufferARB(disp, parameters) (*((disp)->BindBufferARB)) parameters -#define GET_BindBufferARB(disp) ((disp)->BindBufferARB) -#define SET_BindBufferARB(disp, fn) ((disp)->BindBufferARB = fn) -#define CALL_BufferDataARB(disp, parameters) (*((disp)->BufferDataARB)) parameters -#define GET_BufferDataARB(disp) ((disp)->BufferDataARB) -#define SET_BufferDataARB(disp, fn) ((disp)->BufferDataARB = fn) -#define CALL_BufferSubDataARB(disp, parameters) (*((disp)->BufferSubDataARB)) parameters -#define GET_BufferSubDataARB(disp) ((disp)->BufferSubDataARB) -#define SET_BufferSubDataARB(disp, fn) ((disp)->BufferSubDataARB = fn) -#define CALL_DeleteBuffersARB(disp, parameters) (*((disp)->DeleteBuffersARB)) parameters -#define GET_DeleteBuffersARB(disp) ((disp)->DeleteBuffersARB) -#define SET_DeleteBuffersARB(disp, fn) ((disp)->DeleteBuffersARB = fn) -#define CALL_GenBuffersARB(disp, parameters) (*((disp)->GenBuffersARB)) parameters -#define GET_GenBuffersARB(disp) ((disp)->GenBuffersARB) -#define SET_GenBuffersARB(disp, fn) ((disp)->GenBuffersARB = fn) -#define CALL_GetBufferParameterivARB(disp, parameters) (*((disp)->GetBufferParameterivARB)) parameters -#define GET_GetBufferParameterivARB(disp) ((disp)->GetBufferParameterivARB) -#define SET_GetBufferParameterivARB(disp, fn) ((disp)->GetBufferParameterivARB = fn) -#define CALL_GetBufferPointervARB(disp, parameters) (*((disp)->GetBufferPointervARB)) parameters -#define GET_GetBufferPointervARB(disp) ((disp)->GetBufferPointervARB) -#define SET_GetBufferPointervARB(disp, fn) ((disp)->GetBufferPointervARB = fn) -#define CALL_GetBufferSubDataARB(disp, parameters) (*((disp)->GetBufferSubDataARB)) parameters -#define GET_GetBufferSubDataARB(disp) ((disp)->GetBufferSubDataARB) -#define SET_GetBufferSubDataARB(disp, fn) ((disp)->GetBufferSubDataARB = fn) -#define CALL_IsBufferARB(disp, parameters) (*((disp)->IsBufferARB)) parameters -#define GET_IsBufferARB(disp) ((disp)->IsBufferARB) -#define SET_IsBufferARB(disp, fn) ((disp)->IsBufferARB = fn) -#define CALL_MapBufferARB(disp, parameters) (*((disp)->MapBufferARB)) parameters -#define GET_MapBufferARB(disp) ((disp)->MapBufferARB) -#define SET_MapBufferARB(disp, fn) ((disp)->MapBufferARB = fn) -#define CALL_UnmapBufferARB(disp, parameters) (*((disp)->UnmapBufferARB)) parameters -#define GET_UnmapBufferARB(disp) ((disp)->UnmapBufferARB) -#define SET_UnmapBufferARB(disp, fn) ((disp)->UnmapBufferARB = fn) -#define CALL_BeginQueryARB(disp, parameters) (*((disp)->BeginQueryARB)) parameters -#define GET_BeginQueryARB(disp) ((disp)->BeginQueryARB) -#define SET_BeginQueryARB(disp, fn) ((disp)->BeginQueryARB = fn) -#define CALL_DeleteQueriesARB(disp, parameters) (*((disp)->DeleteQueriesARB)) parameters -#define GET_DeleteQueriesARB(disp) ((disp)->DeleteQueriesARB) -#define SET_DeleteQueriesARB(disp, fn) ((disp)->DeleteQueriesARB = fn) -#define CALL_EndQueryARB(disp, parameters) (*((disp)->EndQueryARB)) parameters -#define GET_EndQueryARB(disp) ((disp)->EndQueryARB) -#define SET_EndQueryARB(disp, fn) ((disp)->EndQueryARB = fn) -#define CALL_GenQueriesARB(disp, parameters) (*((disp)->GenQueriesARB)) parameters -#define GET_GenQueriesARB(disp) ((disp)->GenQueriesARB) -#define SET_GenQueriesARB(disp, fn) ((disp)->GenQueriesARB = fn) -#define CALL_GetQueryObjectivARB(disp, parameters) (*((disp)->GetQueryObjectivARB)) parameters -#define GET_GetQueryObjectivARB(disp) ((disp)->GetQueryObjectivARB) -#define SET_GetQueryObjectivARB(disp, fn) ((disp)->GetQueryObjectivARB = fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) (*((disp)->GetQueryObjectuivARB)) parameters -#define GET_GetQueryObjectuivARB(disp) ((disp)->GetQueryObjectuivARB) -#define SET_GetQueryObjectuivARB(disp, fn) ((disp)->GetQueryObjectuivARB = fn) -#define CALL_GetQueryivARB(disp, parameters) (*((disp)->GetQueryivARB)) parameters -#define GET_GetQueryivARB(disp) ((disp)->GetQueryivARB) -#define SET_GetQueryivARB(disp, fn) ((disp)->GetQueryivARB = fn) -#define CALL_IsQueryARB(disp, parameters) (*((disp)->IsQueryARB)) parameters -#define GET_IsQueryARB(disp) ((disp)->IsQueryARB) -#define SET_IsQueryARB(disp, fn) ((disp)->IsQueryARB = fn) -#define CALL_AttachObjectARB(disp, parameters) (*((disp)->AttachObjectARB)) parameters -#define GET_AttachObjectARB(disp) ((disp)->AttachObjectARB) -#define SET_AttachObjectARB(disp, fn) ((disp)->AttachObjectARB = fn) -#define CALL_CompileShaderARB(disp, parameters) (*((disp)->CompileShaderARB)) parameters -#define GET_CompileShaderARB(disp) ((disp)->CompileShaderARB) -#define SET_CompileShaderARB(disp, fn) ((disp)->CompileShaderARB = fn) -#define CALL_CreateProgramObjectARB(disp, parameters) (*((disp)->CreateProgramObjectARB)) parameters -#define GET_CreateProgramObjectARB(disp) ((disp)->CreateProgramObjectARB) -#define SET_CreateProgramObjectARB(disp, fn) ((disp)->CreateProgramObjectARB = fn) -#define CALL_CreateShaderObjectARB(disp, parameters) (*((disp)->CreateShaderObjectARB)) parameters -#define GET_CreateShaderObjectARB(disp) ((disp)->CreateShaderObjectARB) -#define SET_CreateShaderObjectARB(disp, fn) ((disp)->CreateShaderObjectARB = fn) -#define CALL_DeleteObjectARB(disp, parameters) (*((disp)->DeleteObjectARB)) parameters -#define GET_DeleteObjectARB(disp) ((disp)->DeleteObjectARB) -#define SET_DeleteObjectARB(disp, fn) ((disp)->DeleteObjectARB = fn) -#define CALL_DetachObjectARB(disp, parameters) (*((disp)->DetachObjectARB)) parameters -#define GET_DetachObjectARB(disp) ((disp)->DetachObjectARB) -#define SET_DetachObjectARB(disp, fn) ((disp)->DetachObjectARB = fn) -#define CALL_GetActiveUniformARB(disp, parameters) (*((disp)->GetActiveUniformARB)) parameters -#define GET_GetActiveUniformARB(disp) ((disp)->GetActiveUniformARB) -#define SET_GetActiveUniformARB(disp, fn) ((disp)->GetActiveUniformARB = fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) (*((disp)->GetAttachedObjectsARB)) parameters -#define GET_GetAttachedObjectsARB(disp) ((disp)->GetAttachedObjectsARB) -#define SET_GetAttachedObjectsARB(disp, fn) ((disp)->GetAttachedObjectsARB = fn) -#define CALL_GetHandleARB(disp, parameters) (*((disp)->GetHandleARB)) parameters -#define GET_GetHandleARB(disp) ((disp)->GetHandleARB) -#define SET_GetHandleARB(disp, fn) ((disp)->GetHandleARB = fn) -#define CALL_GetInfoLogARB(disp, parameters) (*((disp)->GetInfoLogARB)) parameters -#define GET_GetInfoLogARB(disp) ((disp)->GetInfoLogARB) -#define SET_GetInfoLogARB(disp, fn) ((disp)->GetInfoLogARB = fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) (*((disp)->GetObjectParameterfvARB)) parameters -#define GET_GetObjectParameterfvARB(disp) ((disp)->GetObjectParameterfvARB) -#define SET_GetObjectParameterfvARB(disp, fn) ((disp)->GetObjectParameterfvARB = fn) -#define CALL_GetObjectParameterivARB(disp, parameters) (*((disp)->GetObjectParameterivARB)) parameters -#define GET_GetObjectParameterivARB(disp) ((disp)->GetObjectParameterivARB) -#define SET_GetObjectParameterivARB(disp, fn) ((disp)->GetObjectParameterivARB = fn) -#define CALL_GetShaderSourceARB(disp, parameters) (*((disp)->GetShaderSourceARB)) parameters -#define GET_GetShaderSourceARB(disp) ((disp)->GetShaderSourceARB) -#define SET_GetShaderSourceARB(disp, fn) ((disp)->GetShaderSourceARB = fn) -#define CALL_GetUniformLocationARB(disp, parameters) (*((disp)->GetUniformLocationARB)) parameters -#define GET_GetUniformLocationARB(disp) ((disp)->GetUniformLocationARB) -#define SET_GetUniformLocationARB(disp, fn) ((disp)->GetUniformLocationARB = fn) -#define CALL_GetUniformfvARB(disp, parameters) (*((disp)->GetUniformfvARB)) parameters -#define GET_GetUniformfvARB(disp) ((disp)->GetUniformfvARB) -#define SET_GetUniformfvARB(disp, fn) ((disp)->GetUniformfvARB = fn) -#define CALL_GetUniformivARB(disp, parameters) (*((disp)->GetUniformivARB)) parameters -#define GET_GetUniformivARB(disp) ((disp)->GetUniformivARB) -#define SET_GetUniformivARB(disp, fn) ((disp)->GetUniformivARB = fn) -#define CALL_LinkProgramARB(disp, parameters) (*((disp)->LinkProgramARB)) parameters -#define GET_LinkProgramARB(disp) ((disp)->LinkProgramARB) -#define SET_LinkProgramARB(disp, fn) ((disp)->LinkProgramARB = fn) -#define CALL_ShaderSourceARB(disp, parameters) (*((disp)->ShaderSourceARB)) parameters -#define GET_ShaderSourceARB(disp) ((disp)->ShaderSourceARB) -#define SET_ShaderSourceARB(disp, fn) ((disp)->ShaderSourceARB = fn) -#define CALL_Uniform1fARB(disp, parameters) (*((disp)->Uniform1fARB)) parameters -#define GET_Uniform1fARB(disp) ((disp)->Uniform1fARB) -#define SET_Uniform1fARB(disp, fn) ((disp)->Uniform1fARB = fn) -#define CALL_Uniform1fvARB(disp, parameters) (*((disp)->Uniform1fvARB)) parameters -#define GET_Uniform1fvARB(disp) ((disp)->Uniform1fvARB) -#define SET_Uniform1fvARB(disp, fn) ((disp)->Uniform1fvARB = fn) -#define CALL_Uniform1iARB(disp, parameters) (*((disp)->Uniform1iARB)) parameters -#define GET_Uniform1iARB(disp) ((disp)->Uniform1iARB) -#define SET_Uniform1iARB(disp, fn) ((disp)->Uniform1iARB = fn) -#define CALL_Uniform1ivARB(disp, parameters) (*((disp)->Uniform1ivARB)) parameters -#define GET_Uniform1ivARB(disp) ((disp)->Uniform1ivARB) -#define SET_Uniform1ivARB(disp, fn) ((disp)->Uniform1ivARB = fn) -#define CALL_Uniform2fARB(disp, parameters) (*((disp)->Uniform2fARB)) parameters -#define GET_Uniform2fARB(disp) ((disp)->Uniform2fARB) -#define SET_Uniform2fARB(disp, fn) ((disp)->Uniform2fARB = fn) -#define CALL_Uniform2fvARB(disp, parameters) (*((disp)->Uniform2fvARB)) parameters -#define GET_Uniform2fvARB(disp) ((disp)->Uniform2fvARB) -#define SET_Uniform2fvARB(disp, fn) ((disp)->Uniform2fvARB = fn) -#define CALL_Uniform2iARB(disp, parameters) (*((disp)->Uniform2iARB)) parameters -#define GET_Uniform2iARB(disp) ((disp)->Uniform2iARB) -#define SET_Uniform2iARB(disp, fn) ((disp)->Uniform2iARB = fn) -#define CALL_Uniform2ivARB(disp, parameters) (*((disp)->Uniform2ivARB)) parameters -#define GET_Uniform2ivARB(disp) ((disp)->Uniform2ivARB) -#define SET_Uniform2ivARB(disp, fn) ((disp)->Uniform2ivARB = fn) -#define CALL_Uniform3fARB(disp, parameters) (*((disp)->Uniform3fARB)) parameters -#define GET_Uniform3fARB(disp) ((disp)->Uniform3fARB) -#define SET_Uniform3fARB(disp, fn) ((disp)->Uniform3fARB = fn) -#define CALL_Uniform3fvARB(disp, parameters) (*((disp)->Uniform3fvARB)) parameters -#define GET_Uniform3fvARB(disp) ((disp)->Uniform3fvARB) -#define SET_Uniform3fvARB(disp, fn) ((disp)->Uniform3fvARB = fn) -#define CALL_Uniform3iARB(disp, parameters) (*((disp)->Uniform3iARB)) parameters -#define GET_Uniform3iARB(disp) ((disp)->Uniform3iARB) -#define SET_Uniform3iARB(disp, fn) ((disp)->Uniform3iARB = fn) -#define CALL_Uniform3ivARB(disp, parameters) (*((disp)->Uniform3ivARB)) parameters -#define GET_Uniform3ivARB(disp) ((disp)->Uniform3ivARB) -#define SET_Uniform3ivARB(disp, fn) ((disp)->Uniform3ivARB = fn) -#define CALL_Uniform4fARB(disp, parameters) (*((disp)->Uniform4fARB)) parameters -#define GET_Uniform4fARB(disp) ((disp)->Uniform4fARB) -#define SET_Uniform4fARB(disp, fn) ((disp)->Uniform4fARB = fn) -#define CALL_Uniform4fvARB(disp, parameters) (*((disp)->Uniform4fvARB)) parameters -#define GET_Uniform4fvARB(disp) ((disp)->Uniform4fvARB) -#define SET_Uniform4fvARB(disp, fn) ((disp)->Uniform4fvARB = fn) -#define CALL_Uniform4iARB(disp, parameters) (*((disp)->Uniform4iARB)) parameters -#define GET_Uniform4iARB(disp) ((disp)->Uniform4iARB) -#define SET_Uniform4iARB(disp, fn) ((disp)->Uniform4iARB = fn) -#define CALL_Uniform4ivARB(disp, parameters) (*((disp)->Uniform4ivARB)) parameters -#define GET_Uniform4ivARB(disp) ((disp)->Uniform4ivARB) -#define SET_Uniform4ivARB(disp, fn) ((disp)->Uniform4ivARB = fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) (*((disp)->UniformMatrix2fvARB)) parameters -#define GET_UniformMatrix2fvARB(disp) ((disp)->UniformMatrix2fvARB) -#define SET_UniformMatrix2fvARB(disp, fn) ((disp)->UniformMatrix2fvARB = fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) (*((disp)->UniformMatrix3fvARB)) parameters -#define GET_UniformMatrix3fvARB(disp) ((disp)->UniformMatrix3fvARB) -#define SET_UniformMatrix3fvARB(disp, fn) ((disp)->UniformMatrix3fvARB = fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) (*((disp)->UniformMatrix4fvARB)) parameters -#define GET_UniformMatrix4fvARB(disp) ((disp)->UniformMatrix4fvARB) -#define SET_UniformMatrix4fvARB(disp, fn) ((disp)->UniformMatrix4fvARB = fn) -#define CALL_UseProgramObjectARB(disp, parameters) (*((disp)->UseProgramObjectARB)) parameters -#define GET_UseProgramObjectARB(disp) ((disp)->UseProgramObjectARB) -#define SET_UseProgramObjectARB(disp, fn) ((disp)->UseProgramObjectARB = fn) -#define CALL_ValidateProgramARB(disp, parameters) (*((disp)->ValidateProgramARB)) parameters -#define GET_ValidateProgramARB(disp) ((disp)->ValidateProgramARB) -#define SET_ValidateProgramARB(disp, fn) ((disp)->ValidateProgramARB = fn) -#define CALL_BindAttribLocationARB(disp, parameters) (*((disp)->BindAttribLocationARB)) parameters -#define GET_BindAttribLocationARB(disp) ((disp)->BindAttribLocationARB) -#define SET_BindAttribLocationARB(disp, fn) ((disp)->BindAttribLocationARB = fn) -#define CALL_GetActiveAttribARB(disp, parameters) (*((disp)->GetActiveAttribARB)) parameters -#define GET_GetActiveAttribARB(disp) ((disp)->GetActiveAttribARB) -#define SET_GetActiveAttribARB(disp, fn) ((disp)->GetActiveAttribARB = fn) -#define CALL_GetAttribLocationARB(disp, parameters) (*((disp)->GetAttribLocationARB)) parameters -#define GET_GetAttribLocationARB(disp) ((disp)->GetAttribLocationARB) -#define SET_GetAttribLocationARB(disp, fn) ((disp)->GetAttribLocationARB = fn) -#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters -#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB) -#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn) -#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters -#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) -#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters -#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterivSGIS)) parameters -#define GET_GetPixelTexGenParameterivSGIS(disp) ((disp)->GetPixelTexGenParameterivSGIS) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) ((disp)->GetPixelTexGenParameterivSGIS = fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfSGIS)) parameters -#define GET_PixelTexGenParameterfSGIS(disp) ((disp)->PixelTexGenParameterfSGIS) -#define SET_PixelTexGenParameterfSGIS(disp, fn) ((disp)->PixelTexGenParameterfSGIS = fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfvSGIS)) parameters -#define GET_PixelTexGenParameterfvSGIS(disp) ((disp)->PixelTexGenParameterfvSGIS) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) ((disp)->PixelTexGenParameterfvSGIS = fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) (*((disp)->PixelTexGenParameteriSGIS)) parameters -#define GET_PixelTexGenParameteriSGIS(disp) ((disp)->PixelTexGenParameteriSGIS) -#define SET_PixelTexGenParameteriSGIS(disp, fn) ((disp)->PixelTexGenParameteriSGIS = fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters -#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) -#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) -#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters -#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) -#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) -#define CALL_SamplePatternSGIS(disp, parameters) (*((disp)->SamplePatternSGIS)) parameters -#define GET_SamplePatternSGIS(disp) ((disp)->SamplePatternSGIS) -#define SET_SamplePatternSGIS(disp, fn) ((disp)->SamplePatternSGIS = fn) -#define CALL_ColorPointerEXT(disp, parameters) (*((disp)->ColorPointerEXT)) parameters -#define GET_ColorPointerEXT(disp) ((disp)->ColorPointerEXT) -#define SET_ColorPointerEXT(disp, fn) ((disp)->ColorPointerEXT = fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) (*((disp)->EdgeFlagPointerEXT)) parameters -#define GET_EdgeFlagPointerEXT(disp) ((disp)->EdgeFlagPointerEXT) -#define SET_EdgeFlagPointerEXT(disp, fn) ((disp)->EdgeFlagPointerEXT = fn) -#define CALL_IndexPointerEXT(disp, parameters) (*((disp)->IndexPointerEXT)) parameters -#define GET_IndexPointerEXT(disp) ((disp)->IndexPointerEXT) -#define SET_IndexPointerEXT(disp, fn) ((disp)->IndexPointerEXT = fn) -#define CALL_NormalPointerEXT(disp, parameters) (*((disp)->NormalPointerEXT)) parameters -#define GET_NormalPointerEXT(disp) ((disp)->NormalPointerEXT) -#define SET_NormalPointerEXT(disp, fn) ((disp)->NormalPointerEXT = fn) -#define CALL_TexCoordPointerEXT(disp, parameters) (*((disp)->TexCoordPointerEXT)) parameters -#define GET_TexCoordPointerEXT(disp) ((disp)->TexCoordPointerEXT) -#define SET_TexCoordPointerEXT(disp, fn) ((disp)->TexCoordPointerEXT = fn) -#define CALL_VertexPointerEXT(disp, parameters) (*((disp)->VertexPointerEXT)) parameters -#define GET_VertexPointerEXT(disp) ((disp)->VertexPointerEXT) -#define SET_VertexPointerEXT(disp, fn) ((disp)->VertexPointerEXT = fn) -#define CALL_PointParameterfEXT(disp, parameters) (*((disp)->PointParameterfEXT)) parameters -#define GET_PointParameterfEXT(disp) ((disp)->PointParameterfEXT) -#define SET_PointParameterfEXT(disp, fn) ((disp)->PointParameterfEXT = fn) -#define CALL_PointParameterfvEXT(disp, parameters) (*((disp)->PointParameterfvEXT)) parameters -#define GET_PointParameterfvEXT(disp) ((disp)->PointParameterfvEXT) -#define SET_PointParameterfvEXT(disp, fn) ((disp)->PointParameterfvEXT = fn) -#define CALL_LockArraysEXT(disp, parameters) (*((disp)->LockArraysEXT)) parameters -#define GET_LockArraysEXT(disp) ((disp)->LockArraysEXT) -#define SET_LockArraysEXT(disp, fn) ((disp)->LockArraysEXT = fn) -#define CALL_UnlockArraysEXT(disp, parameters) (*((disp)->UnlockArraysEXT)) parameters -#define GET_UnlockArraysEXT(disp) ((disp)->UnlockArraysEXT) -#define SET_UnlockArraysEXT(disp, fn) ((disp)->UnlockArraysEXT = fn) -#define CALL_CullParameterdvEXT(disp, parameters) (*((disp)->CullParameterdvEXT)) parameters -#define GET_CullParameterdvEXT(disp) ((disp)->CullParameterdvEXT) -#define SET_CullParameterdvEXT(disp, fn) ((disp)->CullParameterdvEXT = fn) -#define CALL_CullParameterfvEXT(disp, parameters) (*((disp)->CullParameterfvEXT)) parameters -#define GET_CullParameterfvEXT(disp) ((disp)->CullParameterfvEXT) -#define SET_CullParameterfvEXT(disp, fn) ((disp)->CullParameterfvEXT = fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) (*((disp)->SecondaryColor3bEXT)) parameters -#define GET_SecondaryColor3bEXT(disp) ((disp)->SecondaryColor3bEXT) -#define SET_SecondaryColor3bEXT(disp, fn) ((disp)->SecondaryColor3bEXT = fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) (*((disp)->SecondaryColor3bvEXT)) parameters -#define GET_SecondaryColor3bvEXT(disp) ((disp)->SecondaryColor3bvEXT) -#define SET_SecondaryColor3bvEXT(disp, fn) ((disp)->SecondaryColor3bvEXT = fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) (*((disp)->SecondaryColor3dEXT)) parameters -#define GET_SecondaryColor3dEXT(disp) ((disp)->SecondaryColor3dEXT) -#define SET_SecondaryColor3dEXT(disp, fn) ((disp)->SecondaryColor3dEXT = fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) (*((disp)->SecondaryColor3dvEXT)) parameters -#define GET_SecondaryColor3dvEXT(disp) ((disp)->SecondaryColor3dvEXT) -#define SET_SecondaryColor3dvEXT(disp, fn) ((disp)->SecondaryColor3dvEXT = fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) (*((disp)->SecondaryColor3fEXT)) parameters -#define GET_SecondaryColor3fEXT(disp) ((disp)->SecondaryColor3fEXT) -#define SET_SecondaryColor3fEXT(disp, fn) ((disp)->SecondaryColor3fEXT = fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) (*((disp)->SecondaryColor3fvEXT)) parameters -#define GET_SecondaryColor3fvEXT(disp) ((disp)->SecondaryColor3fvEXT) -#define SET_SecondaryColor3fvEXT(disp, fn) ((disp)->SecondaryColor3fvEXT = fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) (*((disp)->SecondaryColor3iEXT)) parameters -#define GET_SecondaryColor3iEXT(disp) ((disp)->SecondaryColor3iEXT) -#define SET_SecondaryColor3iEXT(disp, fn) ((disp)->SecondaryColor3iEXT = fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) (*((disp)->SecondaryColor3ivEXT)) parameters -#define GET_SecondaryColor3ivEXT(disp) ((disp)->SecondaryColor3ivEXT) -#define SET_SecondaryColor3ivEXT(disp, fn) ((disp)->SecondaryColor3ivEXT = fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) (*((disp)->SecondaryColor3sEXT)) parameters -#define GET_SecondaryColor3sEXT(disp) ((disp)->SecondaryColor3sEXT) -#define SET_SecondaryColor3sEXT(disp, fn) ((disp)->SecondaryColor3sEXT = fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) (*((disp)->SecondaryColor3svEXT)) parameters -#define GET_SecondaryColor3svEXT(disp) ((disp)->SecondaryColor3svEXT) -#define SET_SecondaryColor3svEXT(disp, fn) ((disp)->SecondaryColor3svEXT = fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) (*((disp)->SecondaryColor3ubEXT)) parameters -#define GET_SecondaryColor3ubEXT(disp) ((disp)->SecondaryColor3ubEXT) -#define SET_SecondaryColor3ubEXT(disp, fn) ((disp)->SecondaryColor3ubEXT = fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) (*((disp)->SecondaryColor3ubvEXT)) parameters -#define GET_SecondaryColor3ubvEXT(disp) ((disp)->SecondaryColor3ubvEXT) -#define SET_SecondaryColor3ubvEXT(disp, fn) ((disp)->SecondaryColor3ubvEXT = fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) (*((disp)->SecondaryColor3uiEXT)) parameters -#define GET_SecondaryColor3uiEXT(disp) ((disp)->SecondaryColor3uiEXT) -#define SET_SecondaryColor3uiEXT(disp, fn) ((disp)->SecondaryColor3uiEXT = fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) (*((disp)->SecondaryColor3uivEXT)) parameters -#define GET_SecondaryColor3uivEXT(disp) ((disp)->SecondaryColor3uivEXT) -#define SET_SecondaryColor3uivEXT(disp, fn) ((disp)->SecondaryColor3uivEXT = fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) (*((disp)->SecondaryColor3usEXT)) parameters -#define GET_SecondaryColor3usEXT(disp) ((disp)->SecondaryColor3usEXT) -#define SET_SecondaryColor3usEXT(disp, fn) ((disp)->SecondaryColor3usEXT = fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) (*((disp)->SecondaryColor3usvEXT)) parameters -#define GET_SecondaryColor3usvEXT(disp) ((disp)->SecondaryColor3usvEXT) -#define SET_SecondaryColor3usvEXT(disp, fn) ((disp)->SecondaryColor3usvEXT = fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) (*((disp)->SecondaryColorPointerEXT)) parameters -#define GET_SecondaryColorPointerEXT(disp) ((disp)->SecondaryColorPointerEXT) -#define SET_SecondaryColorPointerEXT(disp, fn) ((disp)->SecondaryColorPointerEXT = fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) (*((disp)->MultiDrawArraysEXT)) parameters -#define GET_MultiDrawArraysEXT(disp) ((disp)->MultiDrawArraysEXT) -#define SET_MultiDrawArraysEXT(disp, fn) ((disp)->MultiDrawArraysEXT = fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) (*((disp)->MultiDrawElementsEXT)) parameters -#define GET_MultiDrawElementsEXT(disp) ((disp)->MultiDrawElementsEXT) -#define SET_MultiDrawElementsEXT(disp, fn) ((disp)->MultiDrawElementsEXT = fn) -#define CALL_FogCoordPointerEXT(disp, parameters) (*((disp)->FogCoordPointerEXT)) parameters -#define GET_FogCoordPointerEXT(disp) ((disp)->FogCoordPointerEXT) -#define SET_FogCoordPointerEXT(disp, fn) ((disp)->FogCoordPointerEXT = fn) -#define CALL_FogCoorddEXT(disp, parameters) (*((disp)->FogCoorddEXT)) parameters -#define GET_FogCoorddEXT(disp) ((disp)->FogCoorddEXT) -#define SET_FogCoorddEXT(disp, fn) ((disp)->FogCoorddEXT = fn) -#define CALL_FogCoorddvEXT(disp, parameters) (*((disp)->FogCoorddvEXT)) parameters -#define GET_FogCoorddvEXT(disp) ((disp)->FogCoorddvEXT) -#define SET_FogCoorddvEXT(disp, fn) ((disp)->FogCoorddvEXT = fn) -#define CALL_FogCoordfEXT(disp, parameters) (*((disp)->FogCoordfEXT)) parameters -#define GET_FogCoordfEXT(disp) ((disp)->FogCoordfEXT) -#define SET_FogCoordfEXT(disp, fn) ((disp)->FogCoordfEXT = fn) -#define CALL_FogCoordfvEXT(disp, parameters) (*((disp)->FogCoordfvEXT)) parameters -#define GET_FogCoordfvEXT(disp) ((disp)->FogCoordfvEXT) -#define SET_FogCoordfvEXT(disp, fn) ((disp)->FogCoordfvEXT = fn) -#define CALL_PixelTexGenSGIX(disp, parameters) (*((disp)->PixelTexGenSGIX)) parameters -#define GET_PixelTexGenSGIX(disp) ((disp)->PixelTexGenSGIX) -#define SET_PixelTexGenSGIX(disp, fn) ((disp)->PixelTexGenSGIX = fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) (*((disp)->BlendFuncSeparateEXT)) parameters -#define GET_BlendFuncSeparateEXT(disp) ((disp)->BlendFuncSeparateEXT) -#define SET_BlendFuncSeparateEXT(disp, fn) ((disp)->BlendFuncSeparateEXT = fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) (*((disp)->FlushVertexArrayRangeNV)) parameters -#define GET_FlushVertexArrayRangeNV(disp) ((disp)->FlushVertexArrayRangeNV) -#define SET_FlushVertexArrayRangeNV(disp, fn) ((disp)->FlushVertexArrayRangeNV = fn) -#define CALL_VertexArrayRangeNV(disp, parameters) (*((disp)->VertexArrayRangeNV)) parameters -#define GET_VertexArrayRangeNV(disp) ((disp)->VertexArrayRangeNV) -#define SET_VertexArrayRangeNV(disp, fn) ((disp)->VertexArrayRangeNV = fn) -#define CALL_CombinerInputNV(disp, parameters) (*((disp)->CombinerInputNV)) parameters -#define GET_CombinerInputNV(disp) ((disp)->CombinerInputNV) -#define SET_CombinerInputNV(disp, fn) ((disp)->CombinerInputNV = fn) -#define CALL_CombinerOutputNV(disp, parameters) (*((disp)->CombinerOutputNV)) parameters -#define GET_CombinerOutputNV(disp) ((disp)->CombinerOutputNV) -#define SET_CombinerOutputNV(disp, fn) ((disp)->CombinerOutputNV = fn) -#define CALL_CombinerParameterfNV(disp, parameters) (*((disp)->CombinerParameterfNV)) parameters -#define GET_CombinerParameterfNV(disp) ((disp)->CombinerParameterfNV) -#define SET_CombinerParameterfNV(disp, fn) ((disp)->CombinerParameterfNV = fn) -#define CALL_CombinerParameterfvNV(disp, parameters) (*((disp)->CombinerParameterfvNV)) parameters -#define GET_CombinerParameterfvNV(disp) ((disp)->CombinerParameterfvNV) -#define SET_CombinerParameterfvNV(disp, fn) ((disp)->CombinerParameterfvNV = fn) -#define CALL_CombinerParameteriNV(disp, parameters) (*((disp)->CombinerParameteriNV)) parameters -#define GET_CombinerParameteriNV(disp) ((disp)->CombinerParameteriNV) -#define SET_CombinerParameteriNV(disp, fn) ((disp)->CombinerParameteriNV = fn) -#define CALL_CombinerParameterivNV(disp, parameters) (*((disp)->CombinerParameterivNV)) parameters -#define GET_CombinerParameterivNV(disp) ((disp)->CombinerParameterivNV) -#define SET_CombinerParameterivNV(disp, fn) ((disp)->CombinerParameterivNV = fn) -#define CALL_FinalCombinerInputNV(disp, parameters) (*((disp)->FinalCombinerInputNV)) parameters -#define GET_FinalCombinerInputNV(disp) ((disp)->FinalCombinerInputNV) -#define SET_FinalCombinerInputNV(disp, fn) ((disp)->FinalCombinerInputNV = fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetCombinerInputParameterfvNV)) parameters -#define GET_GetCombinerInputParameterfvNV(disp) ((disp)->GetCombinerInputParameterfvNV) -#define SET_GetCombinerInputParameterfvNV(disp, fn) ((disp)->GetCombinerInputParameterfvNV = fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) (*((disp)->GetCombinerInputParameterivNV)) parameters -#define GET_GetCombinerInputParameterivNV(disp) ((disp)->GetCombinerInputParameterivNV) -#define SET_GetCombinerInputParameterivNV(disp, fn) ((disp)->GetCombinerInputParameterivNV = fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) (*((disp)->GetCombinerOutputParameterfvNV)) parameters -#define GET_GetCombinerOutputParameterfvNV(disp) ((disp)->GetCombinerOutputParameterfvNV) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) ((disp)->GetCombinerOutputParameterfvNV = fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) (*((disp)->GetCombinerOutputParameterivNV)) parameters -#define GET_GetCombinerOutputParameterivNV(disp) ((disp)->GetCombinerOutputParameterivNV) -#define SET_GetCombinerOutputParameterivNV(disp, fn) ((disp)->GetCombinerOutputParameterivNV = fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterfvNV)) parameters -#define GET_GetFinalCombinerInputParameterfvNV(disp) ((disp)->GetFinalCombinerInputParameterfvNV) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) ((disp)->GetFinalCombinerInputParameterfvNV = fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterivNV)) parameters -#define GET_GetFinalCombinerInputParameterivNV(disp) ((disp)->GetFinalCombinerInputParameterivNV) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) ((disp)->GetFinalCombinerInputParameterivNV = fn) -#define CALL_ResizeBuffersMESA(disp, parameters) (*((disp)->ResizeBuffersMESA)) parameters -#define GET_ResizeBuffersMESA(disp) ((disp)->ResizeBuffersMESA) -#define SET_ResizeBuffersMESA(disp, fn) ((disp)->ResizeBuffersMESA = fn) -#define CALL_WindowPos2dMESA(disp, parameters) (*((disp)->WindowPos2dMESA)) parameters -#define GET_WindowPos2dMESA(disp) ((disp)->WindowPos2dMESA) -#define SET_WindowPos2dMESA(disp, fn) ((disp)->WindowPos2dMESA = fn) -#define CALL_WindowPos2dvMESA(disp, parameters) (*((disp)->WindowPos2dvMESA)) parameters -#define GET_WindowPos2dvMESA(disp) ((disp)->WindowPos2dvMESA) -#define SET_WindowPos2dvMESA(disp, fn) ((disp)->WindowPos2dvMESA = fn) -#define CALL_WindowPos2fMESA(disp, parameters) (*((disp)->WindowPos2fMESA)) parameters -#define GET_WindowPos2fMESA(disp) ((disp)->WindowPos2fMESA) -#define SET_WindowPos2fMESA(disp, fn) ((disp)->WindowPos2fMESA = fn) -#define CALL_WindowPos2fvMESA(disp, parameters) (*((disp)->WindowPos2fvMESA)) parameters -#define GET_WindowPos2fvMESA(disp) ((disp)->WindowPos2fvMESA) -#define SET_WindowPos2fvMESA(disp, fn) ((disp)->WindowPos2fvMESA = fn) -#define CALL_WindowPos2iMESA(disp, parameters) (*((disp)->WindowPos2iMESA)) parameters -#define GET_WindowPos2iMESA(disp) ((disp)->WindowPos2iMESA) -#define SET_WindowPos2iMESA(disp, fn) ((disp)->WindowPos2iMESA = fn) -#define CALL_WindowPos2ivMESA(disp, parameters) (*((disp)->WindowPos2ivMESA)) parameters -#define GET_WindowPos2ivMESA(disp) ((disp)->WindowPos2ivMESA) -#define SET_WindowPos2ivMESA(disp, fn) ((disp)->WindowPos2ivMESA = fn) -#define CALL_WindowPos2sMESA(disp, parameters) (*((disp)->WindowPos2sMESA)) parameters -#define GET_WindowPos2sMESA(disp) ((disp)->WindowPos2sMESA) -#define SET_WindowPos2sMESA(disp, fn) ((disp)->WindowPos2sMESA = fn) -#define CALL_WindowPos2svMESA(disp, parameters) (*((disp)->WindowPos2svMESA)) parameters -#define GET_WindowPos2svMESA(disp) ((disp)->WindowPos2svMESA) -#define SET_WindowPos2svMESA(disp, fn) ((disp)->WindowPos2svMESA = fn) -#define CALL_WindowPos3dMESA(disp, parameters) (*((disp)->WindowPos3dMESA)) parameters -#define GET_WindowPos3dMESA(disp) ((disp)->WindowPos3dMESA) -#define SET_WindowPos3dMESA(disp, fn) ((disp)->WindowPos3dMESA = fn) -#define CALL_WindowPos3dvMESA(disp, parameters) (*((disp)->WindowPos3dvMESA)) parameters -#define GET_WindowPos3dvMESA(disp) ((disp)->WindowPos3dvMESA) -#define SET_WindowPos3dvMESA(disp, fn) ((disp)->WindowPos3dvMESA = fn) -#define CALL_WindowPos3fMESA(disp, parameters) (*((disp)->WindowPos3fMESA)) parameters -#define GET_WindowPos3fMESA(disp) ((disp)->WindowPos3fMESA) -#define SET_WindowPos3fMESA(disp, fn) ((disp)->WindowPos3fMESA = fn) -#define CALL_WindowPos3fvMESA(disp, parameters) (*((disp)->WindowPos3fvMESA)) parameters -#define GET_WindowPos3fvMESA(disp) ((disp)->WindowPos3fvMESA) -#define SET_WindowPos3fvMESA(disp, fn) ((disp)->WindowPos3fvMESA = fn) -#define CALL_WindowPos3iMESA(disp, parameters) (*((disp)->WindowPos3iMESA)) parameters -#define GET_WindowPos3iMESA(disp) ((disp)->WindowPos3iMESA) -#define SET_WindowPos3iMESA(disp, fn) ((disp)->WindowPos3iMESA = fn) -#define CALL_WindowPos3ivMESA(disp, parameters) (*((disp)->WindowPos3ivMESA)) parameters -#define GET_WindowPos3ivMESA(disp) ((disp)->WindowPos3ivMESA) -#define SET_WindowPos3ivMESA(disp, fn) ((disp)->WindowPos3ivMESA = fn) -#define CALL_WindowPos3sMESA(disp, parameters) (*((disp)->WindowPos3sMESA)) parameters -#define GET_WindowPos3sMESA(disp) ((disp)->WindowPos3sMESA) -#define SET_WindowPos3sMESA(disp, fn) ((disp)->WindowPos3sMESA = fn) -#define CALL_WindowPos3svMESA(disp, parameters) (*((disp)->WindowPos3svMESA)) parameters -#define GET_WindowPos3svMESA(disp) ((disp)->WindowPos3svMESA) -#define SET_WindowPos3svMESA(disp, fn) ((disp)->WindowPos3svMESA = fn) -#define CALL_WindowPos4dMESA(disp, parameters) (*((disp)->WindowPos4dMESA)) parameters -#define GET_WindowPos4dMESA(disp) ((disp)->WindowPos4dMESA) -#define SET_WindowPos4dMESA(disp, fn) ((disp)->WindowPos4dMESA = fn) -#define CALL_WindowPos4dvMESA(disp, parameters) (*((disp)->WindowPos4dvMESA)) parameters -#define GET_WindowPos4dvMESA(disp) ((disp)->WindowPos4dvMESA) -#define SET_WindowPos4dvMESA(disp, fn) ((disp)->WindowPos4dvMESA = fn) -#define CALL_WindowPos4fMESA(disp, parameters) (*((disp)->WindowPos4fMESA)) parameters -#define GET_WindowPos4fMESA(disp) ((disp)->WindowPos4fMESA) -#define SET_WindowPos4fMESA(disp, fn) ((disp)->WindowPos4fMESA = fn) -#define CALL_WindowPos4fvMESA(disp, parameters) (*((disp)->WindowPos4fvMESA)) parameters -#define GET_WindowPos4fvMESA(disp) ((disp)->WindowPos4fvMESA) -#define SET_WindowPos4fvMESA(disp, fn) ((disp)->WindowPos4fvMESA = fn) -#define CALL_WindowPos4iMESA(disp, parameters) (*((disp)->WindowPos4iMESA)) parameters -#define GET_WindowPos4iMESA(disp) ((disp)->WindowPos4iMESA) -#define SET_WindowPos4iMESA(disp, fn) ((disp)->WindowPos4iMESA = fn) -#define CALL_WindowPos4ivMESA(disp, parameters) (*((disp)->WindowPos4ivMESA)) parameters -#define GET_WindowPos4ivMESA(disp) ((disp)->WindowPos4ivMESA) -#define SET_WindowPos4ivMESA(disp, fn) ((disp)->WindowPos4ivMESA = fn) -#define CALL_WindowPos4sMESA(disp, parameters) (*((disp)->WindowPos4sMESA)) parameters -#define GET_WindowPos4sMESA(disp) ((disp)->WindowPos4sMESA) -#define SET_WindowPos4sMESA(disp, fn) ((disp)->WindowPos4sMESA = fn) -#define CALL_WindowPos4svMESA(disp, parameters) (*((disp)->WindowPos4svMESA)) parameters -#define GET_WindowPos4svMESA(disp) ((disp)->WindowPos4svMESA) -#define SET_WindowPos4svMESA(disp, fn) ((disp)->WindowPos4svMESA = fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) (*((disp)->MultiModeDrawArraysIBM)) parameters -#define GET_MultiModeDrawArraysIBM(disp) ((disp)->MultiModeDrawArraysIBM) -#define SET_MultiModeDrawArraysIBM(disp, fn) ((disp)->MultiModeDrawArraysIBM = fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) (*((disp)->MultiModeDrawElementsIBM)) parameters -#define GET_MultiModeDrawElementsIBM(disp) ((disp)->MultiModeDrawElementsIBM) -#define SET_MultiModeDrawElementsIBM(disp, fn) ((disp)->MultiModeDrawElementsIBM = fn) -#define CALL_DeleteFencesNV(disp, parameters) (*((disp)->DeleteFencesNV)) parameters -#define GET_DeleteFencesNV(disp) ((disp)->DeleteFencesNV) -#define SET_DeleteFencesNV(disp, fn) ((disp)->DeleteFencesNV = fn) -#define CALL_FinishFenceNV(disp, parameters) (*((disp)->FinishFenceNV)) parameters -#define GET_FinishFenceNV(disp) ((disp)->FinishFenceNV) -#define SET_FinishFenceNV(disp, fn) ((disp)->FinishFenceNV = fn) -#define CALL_GenFencesNV(disp, parameters) (*((disp)->GenFencesNV)) parameters -#define GET_GenFencesNV(disp) ((disp)->GenFencesNV) -#define SET_GenFencesNV(disp, fn) ((disp)->GenFencesNV = fn) -#define CALL_GetFenceivNV(disp, parameters) (*((disp)->GetFenceivNV)) parameters -#define GET_GetFenceivNV(disp) ((disp)->GetFenceivNV) -#define SET_GetFenceivNV(disp, fn) ((disp)->GetFenceivNV = fn) -#define CALL_IsFenceNV(disp, parameters) (*((disp)->IsFenceNV)) parameters -#define GET_IsFenceNV(disp) ((disp)->IsFenceNV) -#define SET_IsFenceNV(disp, fn) ((disp)->IsFenceNV = fn) -#define CALL_SetFenceNV(disp, parameters) (*((disp)->SetFenceNV)) parameters -#define GET_SetFenceNV(disp) ((disp)->SetFenceNV) -#define SET_SetFenceNV(disp, fn) ((disp)->SetFenceNV = fn) -#define CALL_TestFenceNV(disp, parameters) (*((disp)->TestFenceNV)) parameters -#define GET_TestFenceNV(disp) ((disp)->TestFenceNV) -#define SET_TestFenceNV(disp, fn) ((disp)->TestFenceNV = fn) -#define CALL_AreProgramsResidentNV(disp, parameters) (*((disp)->AreProgramsResidentNV)) parameters -#define GET_AreProgramsResidentNV(disp) ((disp)->AreProgramsResidentNV) -#define SET_AreProgramsResidentNV(disp, fn) ((disp)->AreProgramsResidentNV = fn) -#define CALL_BindProgramNV(disp, parameters) (*((disp)->BindProgramNV)) parameters -#define GET_BindProgramNV(disp) ((disp)->BindProgramNV) -#define SET_BindProgramNV(disp, fn) ((disp)->BindProgramNV = fn) -#define CALL_DeleteProgramsNV(disp, parameters) (*((disp)->DeleteProgramsNV)) parameters -#define GET_DeleteProgramsNV(disp) ((disp)->DeleteProgramsNV) -#define SET_DeleteProgramsNV(disp, fn) ((disp)->DeleteProgramsNV = fn) -#define CALL_ExecuteProgramNV(disp, parameters) (*((disp)->ExecuteProgramNV)) parameters -#define GET_ExecuteProgramNV(disp) ((disp)->ExecuteProgramNV) -#define SET_ExecuteProgramNV(disp, fn) ((disp)->ExecuteProgramNV = fn) -#define CALL_GenProgramsNV(disp, parameters) (*((disp)->GenProgramsNV)) parameters -#define GET_GenProgramsNV(disp) ((disp)->GenProgramsNV) -#define SET_GenProgramsNV(disp, fn) ((disp)->GenProgramsNV = fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) (*((disp)->GetProgramParameterdvNV)) parameters -#define GET_GetProgramParameterdvNV(disp) ((disp)->GetProgramParameterdvNV) -#define SET_GetProgramParameterdvNV(disp, fn) ((disp)->GetProgramParameterdvNV = fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) (*((disp)->GetProgramParameterfvNV)) parameters -#define GET_GetProgramParameterfvNV(disp) ((disp)->GetProgramParameterfvNV) -#define SET_GetProgramParameterfvNV(disp, fn) ((disp)->GetProgramParameterfvNV = fn) -#define CALL_GetProgramStringNV(disp, parameters) (*((disp)->GetProgramStringNV)) parameters -#define GET_GetProgramStringNV(disp) ((disp)->GetProgramStringNV) -#define SET_GetProgramStringNV(disp, fn) ((disp)->GetProgramStringNV = fn) -#define CALL_GetProgramivNV(disp, parameters) (*((disp)->GetProgramivNV)) parameters -#define GET_GetProgramivNV(disp) ((disp)->GetProgramivNV) -#define SET_GetProgramivNV(disp, fn) ((disp)->GetProgramivNV = fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) (*((disp)->GetTrackMatrixivNV)) parameters -#define GET_GetTrackMatrixivNV(disp) ((disp)->GetTrackMatrixivNV) -#define SET_GetTrackMatrixivNV(disp, fn) ((disp)->GetTrackMatrixivNV = fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) (*((disp)->GetVertexAttribPointervNV)) parameters -#define GET_GetVertexAttribPointervNV(disp) ((disp)->GetVertexAttribPointervNV) -#define SET_GetVertexAttribPointervNV(disp, fn) ((disp)->GetVertexAttribPointervNV = fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) (*((disp)->GetVertexAttribdvNV)) parameters -#define GET_GetVertexAttribdvNV(disp) ((disp)->GetVertexAttribdvNV) -#define SET_GetVertexAttribdvNV(disp, fn) ((disp)->GetVertexAttribdvNV = fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) (*((disp)->GetVertexAttribfvNV)) parameters -#define GET_GetVertexAttribfvNV(disp) ((disp)->GetVertexAttribfvNV) -#define SET_GetVertexAttribfvNV(disp, fn) ((disp)->GetVertexAttribfvNV = fn) -#define CALL_GetVertexAttribivNV(disp, parameters) (*((disp)->GetVertexAttribivNV)) parameters -#define GET_GetVertexAttribivNV(disp) ((disp)->GetVertexAttribivNV) -#define SET_GetVertexAttribivNV(disp, fn) ((disp)->GetVertexAttribivNV = fn) -#define CALL_IsProgramNV(disp, parameters) (*((disp)->IsProgramNV)) parameters -#define GET_IsProgramNV(disp) ((disp)->IsProgramNV) -#define SET_IsProgramNV(disp, fn) ((disp)->IsProgramNV = fn) -#define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters -#define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV) -#define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters -#define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV) -#define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) (*((disp)->ProgramParameters4fvNV)) parameters -#define GET_ProgramParameters4fvNV(disp) ((disp)->ProgramParameters4fvNV) -#define SET_ProgramParameters4fvNV(disp, fn) ((disp)->ProgramParameters4fvNV = fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) (*((disp)->RequestResidentProgramsNV)) parameters -#define GET_RequestResidentProgramsNV(disp) ((disp)->RequestResidentProgramsNV) -#define SET_RequestResidentProgramsNV(disp, fn) ((disp)->RequestResidentProgramsNV = fn) -#define CALL_TrackMatrixNV(disp, parameters) (*((disp)->TrackMatrixNV)) parameters -#define GET_TrackMatrixNV(disp) ((disp)->TrackMatrixNV) -#define SET_TrackMatrixNV(disp, fn) ((disp)->TrackMatrixNV = fn) -#define CALL_VertexAttrib1dNV(disp, parameters) (*((disp)->VertexAttrib1dNV)) parameters -#define GET_VertexAttrib1dNV(disp) ((disp)->VertexAttrib1dNV) -#define SET_VertexAttrib1dNV(disp, fn) ((disp)->VertexAttrib1dNV = fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) (*((disp)->VertexAttrib1dvNV)) parameters -#define GET_VertexAttrib1dvNV(disp) ((disp)->VertexAttrib1dvNV) -#define SET_VertexAttrib1dvNV(disp, fn) ((disp)->VertexAttrib1dvNV = fn) -#define CALL_VertexAttrib1fNV(disp, parameters) (*((disp)->VertexAttrib1fNV)) parameters -#define GET_VertexAttrib1fNV(disp) ((disp)->VertexAttrib1fNV) -#define SET_VertexAttrib1fNV(disp, fn) ((disp)->VertexAttrib1fNV = fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) (*((disp)->VertexAttrib1fvNV)) parameters -#define GET_VertexAttrib1fvNV(disp) ((disp)->VertexAttrib1fvNV) -#define SET_VertexAttrib1fvNV(disp, fn) ((disp)->VertexAttrib1fvNV = fn) -#define CALL_VertexAttrib1sNV(disp, parameters) (*((disp)->VertexAttrib1sNV)) parameters -#define GET_VertexAttrib1sNV(disp) ((disp)->VertexAttrib1sNV) -#define SET_VertexAttrib1sNV(disp, fn) ((disp)->VertexAttrib1sNV = fn) -#define CALL_VertexAttrib1svNV(disp, parameters) (*((disp)->VertexAttrib1svNV)) parameters -#define GET_VertexAttrib1svNV(disp) ((disp)->VertexAttrib1svNV) -#define SET_VertexAttrib1svNV(disp, fn) ((disp)->VertexAttrib1svNV = fn) -#define CALL_VertexAttrib2dNV(disp, parameters) (*((disp)->VertexAttrib2dNV)) parameters -#define GET_VertexAttrib2dNV(disp) ((disp)->VertexAttrib2dNV) -#define SET_VertexAttrib2dNV(disp, fn) ((disp)->VertexAttrib2dNV = fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) (*((disp)->VertexAttrib2dvNV)) parameters -#define GET_VertexAttrib2dvNV(disp) ((disp)->VertexAttrib2dvNV) -#define SET_VertexAttrib2dvNV(disp, fn) ((disp)->VertexAttrib2dvNV = fn) -#define CALL_VertexAttrib2fNV(disp, parameters) (*((disp)->VertexAttrib2fNV)) parameters -#define GET_VertexAttrib2fNV(disp) ((disp)->VertexAttrib2fNV) -#define SET_VertexAttrib2fNV(disp, fn) ((disp)->VertexAttrib2fNV = fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) (*((disp)->VertexAttrib2fvNV)) parameters -#define GET_VertexAttrib2fvNV(disp) ((disp)->VertexAttrib2fvNV) -#define SET_VertexAttrib2fvNV(disp, fn) ((disp)->VertexAttrib2fvNV = fn) -#define CALL_VertexAttrib2sNV(disp, parameters) (*((disp)->VertexAttrib2sNV)) parameters -#define GET_VertexAttrib2sNV(disp) ((disp)->VertexAttrib2sNV) -#define SET_VertexAttrib2sNV(disp, fn) ((disp)->VertexAttrib2sNV = fn) -#define CALL_VertexAttrib2svNV(disp, parameters) (*((disp)->VertexAttrib2svNV)) parameters -#define GET_VertexAttrib2svNV(disp) ((disp)->VertexAttrib2svNV) -#define SET_VertexAttrib2svNV(disp, fn) ((disp)->VertexAttrib2svNV = fn) -#define CALL_VertexAttrib3dNV(disp, parameters) (*((disp)->VertexAttrib3dNV)) parameters -#define GET_VertexAttrib3dNV(disp) ((disp)->VertexAttrib3dNV) -#define SET_VertexAttrib3dNV(disp, fn) ((disp)->VertexAttrib3dNV = fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) (*((disp)->VertexAttrib3dvNV)) parameters -#define GET_VertexAttrib3dvNV(disp) ((disp)->VertexAttrib3dvNV) -#define SET_VertexAttrib3dvNV(disp, fn) ((disp)->VertexAttrib3dvNV = fn) -#define CALL_VertexAttrib3fNV(disp, parameters) (*((disp)->VertexAttrib3fNV)) parameters -#define GET_VertexAttrib3fNV(disp) ((disp)->VertexAttrib3fNV) -#define SET_VertexAttrib3fNV(disp, fn) ((disp)->VertexAttrib3fNV = fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) (*((disp)->VertexAttrib3fvNV)) parameters -#define GET_VertexAttrib3fvNV(disp) ((disp)->VertexAttrib3fvNV) -#define SET_VertexAttrib3fvNV(disp, fn) ((disp)->VertexAttrib3fvNV = fn) -#define CALL_VertexAttrib3sNV(disp, parameters) (*((disp)->VertexAttrib3sNV)) parameters -#define GET_VertexAttrib3sNV(disp) ((disp)->VertexAttrib3sNV) -#define SET_VertexAttrib3sNV(disp, fn) ((disp)->VertexAttrib3sNV = fn) -#define CALL_VertexAttrib3svNV(disp, parameters) (*((disp)->VertexAttrib3svNV)) parameters -#define GET_VertexAttrib3svNV(disp) ((disp)->VertexAttrib3svNV) -#define SET_VertexAttrib3svNV(disp, fn) ((disp)->VertexAttrib3svNV = fn) -#define CALL_VertexAttrib4dNV(disp, parameters) (*((disp)->VertexAttrib4dNV)) parameters -#define GET_VertexAttrib4dNV(disp) ((disp)->VertexAttrib4dNV) -#define SET_VertexAttrib4dNV(disp, fn) ((disp)->VertexAttrib4dNV = fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) (*((disp)->VertexAttrib4dvNV)) parameters -#define GET_VertexAttrib4dvNV(disp) ((disp)->VertexAttrib4dvNV) -#define SET_VertexAttrib4dvNV(disp, fn) ((disp)->VertexAttrib4dvNV = fn) -#define CALL_VertexAttrib4fNV(disp, parameters) (*((disp)->VertexAttrib4fNV)) parameters -#define GET_VertexAttrib4fNV(disp) ((disp)->VertexAttrib4fNV) -#define SET_VertexAttrib4fNV(disp, fn) ((disp)->VertexAttrib4fNV = fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) (*((disp)->VertexAttrib4fvNV)) parameters -#define GET_VertexAttrib4fvNV(disp) ((disp)->VertexAttrib4fvNV) -#define SET_VertexAttrib4fvNV(disp, fn) ((disp)->VertexAttrib4fvNV = fn) -#define CALL_VertexAttrib4sNV(disp, parameters) (*((disp)->VertexAttrib4sNV)) parameters -#define GET_VertexAttrib4sNV(disp) ((disp)->VertexAttrib4sNV) -#define SET_VertexAttrib4sNV(disp, fn) ((disp)->VertexAttrib4sNV = fn) -#define CALL_VertexAttrib4svNV(disp, parameters) (*((disp)->VertexAttrib4svNV)) parameters -#define GET_VertexAttrib4svNV(disp) ((disp)->VertexAttrib4svNV) -#define SET_VertexAttrib4svNV(disp, fn) ((disp)->VertexAttrib4svNV = fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) (*((disp)->VertexAttrib4ubNV)) parameters -#define GET_VertexAttrib4ubNV(disp) ((disp)->VertexAttrib4ubNV) -#define SET_VertexAttrib4ubNV(disp, fn) ((disp)->VertexAttrib4ubNV = fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) (*((disp)->VertexAttrib4ubvNV)) parameters -#define GET_VertexAttrib4ubvNV(disp) ((disp)->VertexAttrib4ubvNV) -#define SET_VertexAttrib4ubvNV(disp, fn) ((disp)->VertexAttrib4ubvNV = fn) -#define CALL_VertexAttribPointerNV(disp, parameters) (*((disp)->VertexAttribPointerNV)) parameters -#define GET_VertexAttribPointerNV(disp) ((disp)->VertexAttribPointerNV) -#define SET_VertexAttribPointerNV(disp, fn) ((disp)->VertexAttribPointerNV = fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) (*((disp)->VertexAttribs1dvNV)) parameters -#define GET_VertexAttribs1dvNV(disp) ((disp)->VertexAttribs1dvNV) -#define SET_VertexAttribs1dvNV(disp, fn) ((disp)->VertexAttribs1dvNV = fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) (*((disp)->VertexAttribs1fvNV)) parameters -#define GET_VertexAttribs1fvNV(disp) ((disp)->VertexAttribs1fvNV) -#define SET_VertexAttribs1fvNV(disp, fn) ((disp)->VertexAttribs1fvNV = fn) -#define CALL_VertexAttribs1svNV(disp, parameters) (*((disp)->VertexAttribs1svNV)) parameters -#define GET_VertexAttribs1svNV(disp) ((disp)->VertexAttribs1svNV) -#define SET_VertexAttribs1svNV(disp, fn) ((disp)->VertexAttribs1svNV = fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) (*((disp)->VertexAttribs2dvNV)) parameters -#define GET_VertexAttribs2dvNV(disp) ((disp)->VertexAttribs2dvNV) -#define SET_VertexAttribs2dvNV(disp, fn) ((disp)->VertexAttribs2dvNV = fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) (*((disp)->VertexAttribs2fvNV)) parameters -#define GET_VertexAttribs2fvNV(disp) ((disp)->VertexAttribs2fvNV) -#define SET_VertexAttribs2fvNV(disp, fn) ((disp)->VertexAttribs2fvNV = fn) -#define CALL_VertexAttribs2svNV(disp, parameters) (*((disp)->VertexAttribs2svNV)) parameters -#define GET_VertexAttribs2svNV(disp) ((disp)->VertexAttribs2svNV) -#define SET_VertexAttribs2svNV(disp, fn) ((disp)->VertexAttribs2svNV = fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) (*((disp)->VertexAttribs3dvNV)) parameters -#define GET_VertexAttribs3dvNV(disp) ((disp)->VertexAttribs3dvNV) -#define SET_VertexAttribs3dvNV(disp, fn) ((disp)->VertexAttribs3dvNV = fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) (*((disp)->VertexAttribs3fvNV)) parameters -#define GET_VertexAttribs3fvNV(disp) ((disp)->VertexAttribs3fvNV) -#define SET_VertexAttribs3fvNV(disp, fn) ((disp)->VertexAttribs3fvNV = fn) -#define CALL_VertexAttribs3svNV(disp, parameters) (*((disp)->VertexAttribs3svNV)) parameters -#define GET_VertexAttribs3svNV(disp) ((disp)->VertexAttribs3svNV) -#define SET_VertexAttribs3svNV(disp, fn) ((disp)->VertexAttribs3svNV = fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) (*((disp)->VertexAttribs4dvNV)) parameters -#define GET_VertexAttribs4dvNV(disp) ((disp)->VertexAttribs4dvNV) -#define SET_VertexAttribs4dvNV(disp, fn) ((disp)->VertexAttribs4dvNV = fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) (*((disp)->VertexAttribs4fvNV)) parameters -#define GET_VertexAttribs4fvNV(disp) ((disp)->VertexAttribs4fvNV) -#define SET_VertexAttribs4fvNV(disp, fn) ((disp)->VertexAttribs4fvNV = fn) -#define CALL_VertexAttribs4svNV(disp, parameters) (*((disp)->VertexAttribs4svNV)) parameters -#define GET_VertexAttribs4svNV(disp) ((disp)->VertexAttribs4svNV) -#define SET_VertexAttribs4svNV(disp, fn) ((disp)->VertexAttribs4svNV = fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) (*((disp)->VertexAttribs4ubvNV)) parameters -#define GET_VertexAttribs4ubvNV(disp) ((disp)->VertexAttribs4ubvNV) -#define SET_VertexAttribs4ubvNV(disp, fn) ((disp)->VertexAttribs4ubvNV = fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) (*((disp)->AlphaFragmentOp1ATI)) parameters -#define GET_AlphaFragmentOp1ATI(disp) ((disp)->AlphaFragmentOp1ATI) -#define SET_AlphaFragmentOp1ATI(disp, fn) ((disp)->AlphaFragmentOp1ATI = fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) (*((disp)->AlphaFragmentOp2ATI)) parameters -#define GET_AlphaFragmentOp2ATI(disp) ((disp)->AlphaFragmentOp2ATI) -#define SET_AlphaFragmentOp2ATI(disp, fn) ((disp)->AlphaFragmentOp2ATI = fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) (*((disp)->AlphaFragmentOp3ATI)) parameters -#define GET_AlphaFragmentOp3ATI(disp) ((disp)->AlphaFragmentOp3ATI) -#define SET_AlphaFragmentOp3ATI(disp, fn) ((disp)->AlphaFragmentOp3ATI = fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) (*((disp)->BeginFragmentShaderATI)) parameters -#define GET_BeginFragmentShaderATI(disp) ((disp)->BeginFragmentShaderATI) -#define SET_BeginFragmentShaderATI(disp, fn) ((disp)->BeginFragmentShaderATI = fn) -#define CALL_BindFragmentShaderATI(disp, parameters) (*((disp)->BindFragmentShaderATI)) parameters -#define GET_BindFragmentShaderATI(disp) ((disp)->BindFragmentShaderATI) -#define SET_BindFragmentShaderATI(disp, fn) ((disp)->BindFragmentShaderATI = fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) (*((disp)->ColorFragmentOp1ATI)) parameters -#define GET_ColorFragmentOp1ATI(disp) ((disp)->ColorFragmentOp1ATI) -#define SET_ColorFragmentOp1ATI(disp, fn) ((disp)->ColorFragmentOp1ATI = fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) (*((disp)->ColorFragmentOp2ATI)) parameters -#define GET_ColorFragmentOp2ATI(disp) ((disp)->ColorFragmentOp2ATI) -#define SET_ColorFragmentOp2ATI(disp, fn) ((disp)->ColorFragmentOp2ATI = fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) (*((disp)->ColorFragmentOp3ATI)) parameters -#define GET_ColorFragmentOp3ATI(disp) ((disp)->ColorFragmentOp3ATI) -#define SET_ColorFragmentOp3ATI(disp, fn) ((disp)->ColorFragmentOp3ATI = fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) (*((disp)->DeleteFragmentShaderATI)) parameters -#define GET_DeleteFragmentShaderATI(disp) ((disp)->DeleteFragmentShaderATI) -#define SET_DeleteFragmentShaderATI(disp, fn) ((disp)->DeleteFragmentShaderATI = fn) -#define CALL_EndFragmentShaderATI(disp, parameters) (*((disp)->EndFragmentShaderATI)) parameters -#define GET_EndFragmentShaderATI(disp) ((disp)->EndFragmentShaderATI) -#define SET_EndFragmentShaderATI(disp, fn) ((disp)->EndFragmentShaderATI = fn) -#define CALL_GenFragmentShadersATI(disp, parameters) (*((disp)->GenFragmentShadersATI)) parameters -#define GET_GenFragmentShadersATI(disp) ((disp)->GenFragmentShadersATI) -#define SET_GenFragmentShadersATI(disp, fn) ((disp)->GenFragmentShadersATI = fn) -#define CALL_PassTexCoordATI(disp, parameters) (*((disp)->PassTexCoordATI)) parameters -#define GET_PassTexCoordATI(disp) ((disp)->PassTexCoordATI) -#define SET_PassTexCoordATI(disp, fn) ((disp)->PassTexCoordATI = fn) -#define CALL_SampleMapATI(disp, parameters) (*((disp)->SampleMapATI)) parameters -#define GET_SampleMapATI(disp) ((disp)->SampleMapATI) -#define SET_SampleMapATI(disp, fn) ((disp)->SampleMapATI = fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) (*((disp)->SetFragmentShaderConstantATI)) parameters -#define GET_SetFragmentShaderConstantATI(disp) ((disp)->SetFragmentShaderConstantATI) -#define SET_SetFragmentShaderConstantATI(disp, fn) ((disp)->SetFragmentShaderConstantATI = fn) -#define CALL_PointParameteriNV(disp, parameters) (*((disp)->PointParameteriNV)) parameters -#define GET_PointParameteriNV(disp) ((disp)->PointParameteriNV) -#define SET_PointParameteriNV(disp, fn) ((disp)->PointParameteriNV = fn) -#define CALL_PointParameterivNV(disp, parameters) (*((disp)->PointParameterivNV)) parameters -#define GET_PointParameterivNV(disp) ((disp)->PointParameterivNV) -#define SET_PointParameterivNV(disp, fn) ((disp)->PointParameterivNV = fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) (*((disp)->ActiveStencilFaceEXT)) parameters -#define GET_ActiveStencilFaceEXT(disp) ((disp)->ActiveStencilFaceEXT) -#define SET_ActiveStencilFaceEXT(disp, fn) ((disp)->ActiveStencilFaceEXT = fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) (*((disp)->BindVertexArrayAPPLE)) parameters -#define GET_BindVertexArrayAPPLE(disp) ((disp)->BindVertexArrayAPPLE) -#define SET_BindVertexArrayAPPLE(disp, fn) ((disp)->BindVertexArrayAPPLE = fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) (*((disp)->DeleteVertexArraysAPPLE)) parameters -#define GET_DeleteVertexArraysAPPLE(disp) ((disp)->DeleteVertexArraysAPPLE) -#define SET_DeleteVertexArraysAPPLE(disp, fn) ((disp)->DeleteVertexArraysAPPLE = fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) (*((disp)->GenVertexArraysAPPLE)) parameters -#define GET_GenVertexArraysAPPLE(disp) ((disp)->GenVertexArraysAPPLE) -#define SET_GenVertexArraysAPPLE(disp, fn) ((disp)->GenVertexArraysAPPLE = fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters -#define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE) -#define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) (*((disp)->GetProgramNamedParameterdvNV)) parameters -#define GET_GetProgramNamedParameterdvNV(disp) ((disp)->GetProgramNamedParameterdvNV) -#define SET_GetProgramNamedParameterdvNV(disp, fn) ((disp)->GetProgramNamedParameterdvNV = fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) (*((disp)->GetProgramNamedParameterfvNV)) parameters -#define GET_GetProgramNamedParameterfvNV(disp) ((disp)->GetProgramNamedParameterfvNV) -#define SET_GetProgramNamedParameterfvNV(disp, fn) ((disp)->GetProgramNamedParameterfvNV = fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) (*((disp)->ProgramNamedParameter4dNV)) parameters -#define GET_ProgramNamedParameter4dNV(disp) ((disp)->ProgramNamedParameter4dNV) -#define SET_ProgramNamedParameter4dNV(disp, fn) ((disp)->ProgramNamedParameter4dNV = fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) (*((disp)->ProgramNamedParameter4dvNV)) parameters -#define GET_ProgramNamedParameter4dvNV(disp) ((disp)->ProgramNamedParameter4dvNV) -#define SET_ProgramNamedParameter4dvNV(disp, fn) ((disp)->ProgramNamedParameter4dvNV = fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) (*((disp)->ProgramNamedParameter4fNV)) parameters -#define GET_ProgramNamedParameter4fNV(disp) ((disp)->ProgramNamedParameter4fNV) -#define SET_ProgramNamedParameter4fNV(disp, fn) ((disp)->ProgramNamedParameter4fNV = fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) (*((disp)->ProgramNamedParameter4fvNV)) parameters -#define GET_ProgramNamedParameter4fvNV(disp) ((disp)->ProgramNamedParameter4fvNV) -#define SET_ProgramNamedParameter4fvNV(disp, fn) ((disp)->ProgramNamedParameter4fvNV = fn) -#define CALL_DepthBoundsEXT(disp, parameters) (*((disp)->DepthBoundsEXT)) parameters -#define GET_DepthBoundsEXT(disp) ((disp)->DepthBoundsEXT) -#define SET_DepthBoundsEXT(disp, fn) ((disp)->DepthBoundsEXT = fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) (*((disp)->BlendEquationSeparateEXT)) parameters -#define GET_BlendEquationSeparateEXT(disp) ((disp)->BlendEquationSeparateEXT) -#define SET_BlendEquationSeparateEXT(disp, fn) ((disp)->BlendEquationSeparateEXT = fn) -#define CALL_BindFramebufferEXT(disp, parameters) (*((disp)->BindFramebufferEXT)) parameters -#define GET_BindFramebufferEXT(disp) ((disp)->BindFramebufferEXT) -#define SET_BindFramebufferEXT(disp, fn) ((disp)->BindFramebufferEXT = fn) -#define CALL_BindRenderbufferEXT(disp, parameters) (*((disp)->BindRenderbufferEXT)) parameters -#define GET_BindRenderbufferEXT(disp) ((disp)->BindRenderbufferEXT) -#define SET_BindRenderbufferEXT(disp, fn) ((disp)->BindRenderbufferEXT = fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) (*((disp)->CheckFramebufferStatusEXT)) parameters -#define GET_CheckFramebufferStatusEXT(disp) ((disp)->CheckFramebufferStatusEXT) -#define SET_CheckFramebufferStatusEXT(disp, fn) ((disp)->CheckFramebufferStatusEXT = fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) (*((disp)->DeleteFramebuffersEXT)) parameters -#define GET_DeleteFramebuffersEXT(disp) ((disp)->DeleteFramebuffersEXT) -#define SET_DeleteFramebuffersEXT(disp, fn) ((disp)->DeleteFramebuffersEXT = fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) (*((disp)->DeleteRenderbuffersEXT)) parameters -#define GET_DeleteRenderbuffersEXT(disp) ((disp)->DeleteRenderbuffersEXT) -#define SET_DeleteRenderbuffersEXT(disp, fn) ((disp)->DeleteRenderbuffersEXT = fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) (*((disp)->FramebufferRenderbufferEXT)) parameters -#define GET_FramebufferRenderbufferEXT(disp) ((disp)->FramebufferRenderbufferEXT) -#define SET_FramebufferRenderbufferEXT(disp, fn) ((disp)->FramebufferRenderbufferEXT = fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) (*((disp)->FramebufferTexture1DEXT)) parameters -#define GET_FramebufferTexture1DEXT(disp) ((disp)->FramebufferTexture1DEXT) -#define SET_FramebufferTexture1DEXT(disp, fn) ((disp)->FramebufferTexture1DEXT = fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) (*((disp)->FramebufferTexture2DEXT)) parameters -#define GET_FramebufferTexture2DEXT(disp) ((disp)->FramebufferTexture2DEXT) -#define SET_FramebufferTexture2DEXT(disp, fn) ((disp)->FramebufferTexture2DEXT = fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) (*((disp)->FramebufferTexture3DEXT)) parameters -#define GET_FramebufferTexture3DEXT(disp) ((disp)->FramebufferTexture3DEXT) -#define SET_FramebufferTexture3DEXT(disp, fn) ((disp)->FramebufferTexture3DEXT = fn) -#define CALL_GenFramebuffersEXT(disp, parameters) (*((disp)->GenFramebuffersEXT)) parameters -#define GET_GenFramebuffersEXT(disp) ((disp)->GenFramebuffersEXT) -#define SET_GenFramebuffersEXT(disp, fn) ((disp)->GenFramebuffersEXT = fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) (*((disp)->GenRenderbuffersEXT)) parameters -#define GET_GenRenderbuffersEXT(disp) ((disp)->GenRenderbuffersEXT) -#define SET_GenRenderbuffersEXT(disp, fn) ((disp)->GenRenderbuffersEXT = fn) -#define CALL_GenerateMipmapEXT(disp, parameters) (*((disp)->GenerateMipmapEXT)) parameters -#define GET_GenerateMipmapEXT(disp) ((disp)->GenerateMipmapEXT) -#define SET_GenerateMipmapEXT(disp, fn) ((disp)->GenerateMipmapEXT = fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters -#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters -#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) -#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) -#define CALL_IsFramebufferEXT(disp, parameters) (*((disp)->IsFramebufferEXT)) parameters -#define GET_IsFramebufferEXT(disp) ((disp)->IsFramebufferEXT) -#define SET_IsFramebufferEXT(disp, fn) ((disp)->IsFramebufferEXT = fn) -#define CALL_IsRenderbufferEXT(disp, parameters) (*((disp)->IsRenderbufferEXT)) parameters -#define GET_IsRenderbufferEXT(disp) ((disp)->IsRenderbufferEXT) -#define SET_IsRenderbufferEXT(disp, fn) ((disp)->IsRenderbufferEXT = fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) (*((disp)->RenderbufferStorageEXT)) parameters -#define GET_RenderbufferStorageEXT(disp) ((disp)->RenderbufferStorageEXT) -#define SET_RenderbufferStorageEXT(disp, fn) ((disp)->RenderbufferStorageEXT = fn) -#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters -#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) -#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters -#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) -#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters -#define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) -#define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters -#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters -#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters -#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) -#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters -#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) -#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) - -#else - -#define driDispatchRemapTable_size 362 -extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; - -#define AttachShader_remap_index 0 -#define CreateProgram_remap_index 1 -#define CreateShader_remap_index 2 -#define DeleteProgram_remap_index 3 -#define DeleteShader_remap_index 4 -#define DetachShader_remap_index 5 -#define GetAttachedShaders_remap_index 6 -#define GetProgramInfoLog_remap_index 7 -#define GetProgramiv_remap_index 8 -#define GetShaderInfoLog_remap_index 9 -#define GetShaderiv_remap_index 10 -#define IsProgram_remap_index 11 -#define IsShader_remap_index 12 -#define StencilFuncSeparate_remap_index 13 -#define StencilMaskSeparate_remap_index 14 -#define StencilOpSeparate_remap_index 15 -#define UniformMatrix2x3fv_remap_index 16 -#define UniformMatrix2x4fv_remap_index 17 -#define UniformMatrix3x2fv_remap_index 18 -#define UniformMatrix3x4fv_remap_index 19 -#define UniformMatrix4x2fv_remap_index 20 -#define UniformMatrix4x3fv_remap_index 21 -#define LoadTransposeMatrixdARB_remap_index 22 -#define LoadTransposeMatrixfARB_remap_index 23 -#define MultTransposeMatrixdARB_remap_index 24 -#define MultTransposeMatrixfARB_remap_index 25 -#define SampleCoverageARB_remap_index 26 -#define CompressedTexImage1DARB_remap_index 27 -#define CompressedTexImage2DARB_remap_index 28 -#define CompressedTexImage3DARB_remap_index 29 -#define CompressedTexSubImage1DARB_remap_index 30 -#define CompressedTexSubImage2DARB_remap_index 31 -#define CompressedTexSubImage3DARB_remap_index 32 -#define GetCompressedTexImageARB_remap_index 33 -#define DisableVertexAttribArrayARB_remap_index 34 -#define EnableVertexAttribArrayARB_remap_index 35 -#define GetProgramEnvParameterdvARB_remap_index 36 -#define GetProgramEnvParameterfvARB_remap_index 37 -#define GetProgramLocalParameterdvARB_remap_index 38 -#define GetProgramLocalParameterfvARB_remap_index 39 -#define GetProgramStringARB_remap_index 40 -#define GetProgramivARB_remap_index 41 -#define GetVertexAttribdvARB_remap_index 42 -#define GetVertexAttribfvARB_remap_index 43 -#define GetVertexAttribivARB_remap_index 44 -#define ProgramEnvParameter4dARB_remap_index 45 -#define ProgramEnvParameter4dvARB_remap_index 46 -#define ProgramEnvParameter4fARB_remap_index 47 -#define ProgramEnvParameter4fvARB_remap_index 48 -#define ProgramLocalParameter4dARB_remap_index 49 -#define ProgramLocalParameter4dvARB_remap_index 50 -#define ProgramLocalParameter4fARB_remap_index 51 -#define ProgramLocalParameter4fvARB_remap_index 52 -#define ProgramStringARB_remap_index 53 -#define VertexAttrib1dARB_remap_index 54 -#define VertexAttrib1dvARB_remap_index 55 -#define VertexAttrib1fARB_remap_index 56 -#define VertexAttrib1fvARB_remap_index 57 -#define VertexAttrib1sARB_remap_index 58 -#define VertexAttrib1svARB_remap_index 59 -#define VertexAttrib2dARB_remap_index 60 -#define VertexAttrib2dvARB_remap_index 61 -#define VertexAttrib2fARB_remap_index 62 -#define VertexAttrib2fvARB_remap_index 63 -#define VertexAttrib2sARB_remap_index 64 -#define VertexAttrib2svARB_remap_index 65 -#define VertexAttrib3dARB_remap_index 66 -#define VertexAttrib3dvARB_remap_index 67 -#define VertexAttrib3fARB_remap_index 68 -#define VertexAttrib3fvARB_remap_index 69 -#define VertexAttrib3sARB_remap_index 70 -#define VertexAttrib3svARB_remap_index 71 -#define VertexAttrib4NbvARB_remap_index 72 -#define VertexAttrib4NivARB_remap_index 73 -#define VertexAttrib4NsvARB_remap_index 74 -#define VertexAttrib4NubARB_remap_index 75 -#define VertexAttrib4NubvARB_remap_index 76 -#define VertexAttrib4NuivARB_remap_index 77 -#define VertexAttrib4NusvARB_remap_index 78 -#define VertexAttrib4bvARB_remap_index 79 -#define VertexAttrib4dARB_remap_index 80 -#define VertexAttrib4dvARB_remap_index 81 -#define VertexAttrib4fARB_remap_index 82 -#define VertexAttrib4fvARB_remap_index 83 -#define VertexAttrib4ivARB_remap_index 84 -#define VertexAttrib4sARB_remap_index 85 -#define VertexAttrib4svARB_remap_index 86 -#define VertexAttrib4ubvARB_remap_index 87 -#define VertexAttrib4uivARB_remap_index 88 -#define VertexAttrib4usvARB_remap_index 89 -#define VertexAttribPointerARB_remap_index 90 -#define BindBufferARB_remap_index 91 -#define BufferDataARB_remap_index 92 -#define BufferSubDataARB_remap_index 93 -#define DeleteBuffersARB_remap_index 94 -#define GenBuffersARB_remap_index 95 -#define GetBufferParameterivARB_remap_index 96 -#define GetBufferPointervARB_remap_index 97 -#define GetBufferSubDataARB_remap_index 98 -#define IsBufferARB_remap_index 99 -#define MapBufferARB_remap_index 100 -#define UnmapBufferARB_remap_index 101 -#define BeginQueryARB_remap_index 102 -#define DeleteQueriesARB_remap_index 103 -#define EndQueryARB_remap_index 104 -#define GenQueriesARB_remap_index 105 -#define GetQueryObjectivARB_remap_index 106 -#define GetQueryObjectuivARB_remap_index 107 -#define GetQueryivARB_remap_index 108 -#define IsQueryARB_remap_index 109 -#define AttachObjectARB_remap_index 110 -#define CompileShaderARB_remap_index 111 -#define CreateProgramObjectARB_remap_index 112 -#define CreateShaderObjectARB_remap_index 113 -#define DeleteObjectARB_remap_index 114 -#define DetachObjectARB_remap_index 115 -#define GetActiveUniformARB_remap_index 116 -#define GetAttachedObjectsARB_remap_index 117 -#define GetHandleARB_remap_index 118 -#define GetInfoLogARB_remap_index 119 -#define GetObjectParameterfvARB_remap_index 120 -#define GetObjectParameterivARB_remap_index 121 -#define GetShaderSourceARB_remap_index 122 -#define GetUniformLocationARB_remap_index 123 -#define GetUniformfvARB_remap_index 124 -#define GetUniformivARB_remap_index 125 -#define LinkProgramARB_remap_index 126 -#define ShaderSourceARB_remap_index 127 -#define Uniform1fARB_remap_index 128 -#define Uniform1fvARB_remap_index 129 -#define Uniform1iARB_remap_index 130 -#define Uniform1ivARB_remap_index 131 -#define Uniform2fARB_remap_index 132 -#define Uniform2fvARB_remap_index 133 -#define Uniform2iARB_remap_index 134 -#define Uniform2ivARB_remap_index 135 -#define Uniform3fARB_remap_index 136 -#define Uniform3fvARB_remap_index 137 -#define Uniform3iARB_remap_index 138 -#define Uniform3ivARB_remap_index 139 -#define Uniform4fARB_remap_index 140 -#define Uniform4fvARB_remap_index 141 -#define Uniform4iARB_remap_index 142 -#define Uniform4ivARB_remap_index 143 -#define UniformMatrix2fvARB_remap_index 144 -#define UniformMatrix3fvARB_remap_index 145 -#define UniformMatrix4fvARB_remap_index 146 -#define UseProgramObjectARB_remap_index 147 -#define ValidateProgramARB_remap_index 148 -#define BindAttribLocationARB_remap_index 149 -#define GetActiveAttribARB_remap_index 150 -#define GetAttribLocationARB_remap_index 151 -#define DrawBuffersARB_remap_index 152 -#define PolygonOffsetEXT_remap_index 153 -#define GetPixelTexGenParameterfvSGIS_remap_index 154 -#define GetPixelTexGenParameterivSGIS_remap_index 155 -#define PixelTexGenParameterfSGIS_remap_index 156 -#define PixelTexGenParameterfvSGIS_remap_index 157 -#define PixelTexGenParameteriSGIS_remap_index 158 -#define PixelTexGenParameterivSGIS_remap_index 159 -#define SampleMaskSGIS_remap_index 160 -#define SamplePatternSGIS_remap_index 161 -#define ColorPointerEXT_remap_index 162 -#define EdgeFlagPointerEXT_remap_index 163 -#define IndexPointerEXT_remap_index 164 -#define NormalPointerEXT_remap_index 165 -#define TexCoordPointerEXT_remap_index 166 -#define VertexPointerEXT_remap_index 167 -#define PointParameterfEXT_remap_index 168 -#define PointParameterfvEXT_remap_index 169 -#define LockArraysEXT_remap_index 170 -#define UnlockArraysEXT_remap_index 171 -#define CullParameterdvEXT_remap_index 172 -#define CullParameterfvEXT_remap_index 173 -#define SecondaryColor3bEXT_remap_index 174 -#define SecondaryColor3bvEXT_remap_index 175 -#define SecondaryColor3dEXT_remap_index 176 -#define SecondaryColor3dvEXT_remap_index 177 -#define SecondaryColor3fEXT_remap_index 178 -#define SecondaryColor3fvEXT_remap_index 179 -#define SecondaryColor3iEXT_remap_index 180 -#define SecondaryColor3ivEXT_remap_index 181 -#define SecondaryColor3sEXT_remap_index 182 -#define SecondaryColor3svEXT_remap_index 183 -#define SecondaryColor3ubEXT_remap_index 184 -#define SecondaryColor3ubvEXT_remap_index 185 -#define SecondaryColor3uiEXT_remap_index 186 -#define SecondaryColor3uivEXT_remap_index 187 -#define SecondaryColor3usEXT_remap_index 188 -#define SecondaryColor3usvEXT_remap_index 189 -#define SecondaryColorPointerEXT_remap_index 190 -#define MultiDrawArraysEXT_remap_index 191 -#define MultiDrawElementsEXT_remap_index 192 -#define FogCoordPointerEXT_remap_index 193 -#define FogCoorddEXT_remap_index 194 -#define FogCoorddvEXT_remap_index 195 -#define FogCoordfEXT_remap_index 196 -#define FogCoordfvEXT_remap_index 197 -#define PixelTexGenSGIX_remap_index 198 -#define BlendFuncSeparateEXT_remap_index 199 -#define FlushVertexArrayRangeNV_remap_index 200 -#define VertexArrayRangeNV_remap_index 201 -#define CombinerInputNV_remap_index 202 -#define CombinerOutputNV_remap_index 203 -#define CombinerParameterfNV_remap_index 204 -#define CombinerParameterfvNV_remap_index 205 -#define CombinerParameteriNV_remap_index 206 -#define CombinerParameterivNV_remap_index 207 -#define FinalCombinerInputNV_remap_index 208 -#define GetCombinerInputParameterfvNV_remap_index 209 -#define GetCombinerInputParameterivNV_remap_index 210 -#define GetCombinerOutputParameterfvNV_remap_index 211 -#define GetCombinerOutputParameterivNV_remap_index 212 -#define GetFinalCombinerInputParameterfvNV_remap_index 213 -#define GetFinalCombinerInputParameterivNV_remap_index 214 -#define ResizeBuffersMESA_remap_index 215 -#define WindowPos2dMESA_remap_index 216 -#define WindowPos2dvMESA_remap_index 217 -#define WindowPos2fMESA_remap_index 218 -#define WindowPos2fvMESA_remap_index 219 -#define WindowPos2iMESA_remap_index 220 -#define WindowPos2ivMESA_remap_index 221 -#define WindowPos2sMESA_remap_index 222 -#define WindowPos2svMESA_remap_index 223 -#define WindowPos3dMESA_remap_index 224 -#define WindowPos3dvMESA_remap_index 225 -#define WindowPos3fMESA_remap_index 226 -#define WindowPos3fvMESA_remap_index 227 -#define WindowPos3iMESA_remap_index 228 -#define WindowPos3ivMESA_remap_index 229 -#define WindowPos3sMESA_remap_index 230 -#define WindowPos3svMESA_remap_index 231 -#define WindowPos4dMESA_remap_index 232 -#define WindowPos4dvMESA_remap_index 233 -#define WindowPos4fMESA_remap_index 234 -#define WindowPos4fvMESA_remap_index 235 -#define WindowPos4iMESA_remap_index 236 -#define WindowPos4ivMESA_remap_index 237 -#define WindowPos4sMESA_remap_index 238 -#define WindowPos4svMESA_remap_index 239 -#define MultiModeDrawArraysIBM_remap_index 240 -#define MultiModeDrawElementsIBM_remap_index 241 -#define DeleteFencesNV_remap_index 242 -#define FinishFenceNV_remap_index 243 -#define GenFencesNV_remap_index 244 -#define GetFenceivNV_remap_index 245 -#define IsFenceNV_remap_index 246 -#define SetFenceNV_remap_index 247 -#define TestFenceNV_remap_index 248 -#define AreProgramsResidentNV_remap_index 249 -#define BindProgramNV_remap_index 250 -#define DeleteProgramsNV_remap_index 251 -#define ExecuteProgramNV_remap_index 252 -#define GenProgramsNV_remap_index 253 -#define GetProgramParameterdvNV_remap_index 254 -#define GetProgramParameterfvNV_remap_index 255 -#define GetProgramStringNV_remap_index 256 -#define GetProgramivNV_remap_index 257 -#define GetTrackMatrixivNV_remap_index 258 -#define GetVertexAttribPointervNV_remap_index 259 -#define GetVertexAttribdvNV_remap_index 260 -#define GetVertexAttribfvNV_remap_index 261 -#define GetVertexAttribivNV_remap_index 262 -#define IsProgramNV_remap_index 263 -#define LoadProgramNV_remap_index 264 -#define ProgramParameters4dvNV_remap_index 265 -#define ProgramParameters4fvNV_remap_index 266 -#define RequestResidentProgramsNV_remap_index 267 -#define TrackMatrixNV_remap_index 268 -#define VertexAttrib1dNV_remap_index 269 -#define VertexAttrib1dvNV_remap_index 270 -#define VertexAttrib1fNV_remap_index 271 -#define VertexAttrib1fvNV_remap_index 272 -#define VertexAttrib1sNV_remap_index 273 -#define VertexAttrib1svNV_remap_index 274 -#define VertexAttrib2dNV_remap_index 275 -#define VertexAttrib2dvNV_remap_index 276 -#define VertexAttrib2fNV_remap_index 277 -#define VertexAttrib2fvNV_remap_index 278 -#define VertexAttrib2sNV_remap_index 279 -#define VertexAttrib2svNV_remap_index 280 -#define VertexAttrib3dNV_remap_index 281 -#define VertexAttrib3dvNV_remap_index 282 -#define VertexAttrib3fNV_remap_index 283 -#define VertexAttrib3fvNV_remap_index 284 -#define VertexAttrib3sNV_remap_index 285 -#define VertexAttrib3svNV_remap_index 286 -#define VertexAttrib4dNV_remap_index 287 -#define VertexAttrib4dvNV_remap_index 288 -#define VertexAttrib4fNV_remap_index 289 -#define VertexAttrib4fvNV_remap_index 290 -#define VertexAttrib4sNV_remap_index 291 -#define VertexAttrib4svNV_remap_index 292 -#define VertexAttrib4ubNV_remap_index 293 -#define VertexAttrib4ubvNV_remap_index 294 -#define VertexAttribPointerNV_remap_index 295 -#define VertexAttribs1dvNV_remap_index 296 -#define VertexAttribs1fvNV_remap_index 297 -#define VertexAttribs1svNV_remap_index 298 -#define VertexAttribs2dvNV_remap_index 299 -#define VertexAttribs2fvNV_remap_index 300 -#define VertexAttribs2svNV_remap_index 301 -#define VertexAttribs3dvNV_remap_index 302 -#define VertexAttribs3fvNV_remap_index 303 -#define VertexAttribs3svNV_remap_index 304 -#define VertexAttribs4dvNV_remap_index 305 -#define VertexAttribs4fvNV_remap_index 306 -#define VertexAttribs4svNV_remap_index 307 -#define VertexAttribs4ubvNV_remap_index 308 -#define AlphaFragmentOp1ATI_remap_index 309 -#define AlphaFragmentOp2ATI_remap_index 310 -#define AlphaFragmentOp3ATI_remap_index 311 -#define BeginFragmentShaderATI_remap_index 312 -#define BindFragmentShaderATI_remap_index 313 -#define ColorFragmentOp1ATI_remap_index 314 -#define ColorFragmentOp2ATI_remap_index 315 -#define ColorFragmentOp3ATI_remap_index 316 -#define DeleteFragmentShaderATI_remap_index 317 -#define EndFragmentShaderATI_remap_index 318 -#define GenFragmentShadersATI_remap_index 319 -#define PassTexCoordATI_remap_index 320 -#define SampleMapATI_remap_index 321 -#define SetFragmentShaderConstantATI_remap_index 322 -#define PointParameteriNV_remap_index 323 -#define PointParameterivNV_remap_index 324 -#define ActiveStencilFaceEXT_remap_index 325 -#define BindVertexArrayAPPLE_remap_index 326 -#define DeleteVertexArraysAPPLE_remap_index 327 -#define GenVertexArraysAPPLE_remap_index 328 -#define IsVertexArrayAPPLE_remap_index 329 -#define GetProgramNamedParameterdvNV_remap_index 330 -#define GetProgramNamedParameterfvNV_remap_index 331 -#define ProgramNamedParameter4dNV_remap_index 332 -#define ProgramNamedParameter4dvNV_remap_index 333 -#define ProgramNamedParameter4fNV_remap_index 334 -#define ProgramNamedParameter4fvNV_remap_index 335 -#define DepthBoundsEXT_remap_index 336 -#define BlendEquationSeparateEXT_remap_index 337 -#define BindFramebufferEXT_remap_index 338 -#define BindRenderbufferEXT_remap_index 339 -#define CheckFramebufferStatusEXT_remap_index 340 -#define DeleteFramebuffersEXT_remap_index 341 -#define DeleteRenderbuffersEXT_remap_index 342 -#define FramebufferRenderbufferEXT_remap_index 343 -#define FramebufferTexture1DEXT_remap_index 344 -#define FramebufferTexture2DEXT_remap_index 345 -#define FramebufferTexture3DEXT_remap_index 346 -#define GenFramebuffersEXT_remap_index 347 -#define GenRenderbuffersEXT_remap_index 348 -#define GenerateMipmapEXT_remap_index 349 -#define GetFramebufferAttachmentParameterivEXT_remap_index 350 -#define GetRenderbufferParameterivEXT_remap_index 351 -#define IsFramebufferEXT_remap_index 352 -#define IsRenderbufferEXT_remap_index 353 -#define RenderbufferStorageEXT_remap_index 354 -#define BlitFramebufferEXT_remap_index 355 -#define FramebufferTextureLayerEXT_remap_index 356 -#define StencilFuncSeparateATI_remap_index 357 -#define ProgramEnvParameters4fvEXT_remap_index 358 -#define ProgramLocalParameters4fvEXT_remap_index 359 -#define GetQueryObjecti64vEXT_remap_index 360 -#define GetQueryObjectui64vEXT_remap_index 361 - -#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) -#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) -#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) -#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) -#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) -#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) -#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) -#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) -#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) -#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) -#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) -#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) -#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) -#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) -#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) -#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) -#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) -#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) -#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) -#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) -#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) -#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) -#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) -#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) -#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) -#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) -#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) -#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) -#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) -#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) -#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) -#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) -#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) -#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) -#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) -#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) -#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) -#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) -#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) -#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) -#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) -#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) -#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) -#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) -#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) -#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) -#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) -#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) -#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) -#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) -#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) -#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) -#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) -#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) -#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) -#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) -#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) -#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) -#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) -#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) -#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) -#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) -#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) -#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) -#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) -#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) -#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) -#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) -#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) -#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) -#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) -#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) -#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) -#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) -#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) -#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) -#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) -#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) -#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) -#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) -#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) -#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) -#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) -#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) -#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) -#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) -#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) -#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) -#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) -#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) -#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) -#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) -#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) -#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) -#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) -#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) -#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) -#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) -#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) -#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) -#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) -#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) -#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) -#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) -#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) -#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) -#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) -#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) -#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) -#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) -#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) -#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) -#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) -#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) -#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) -#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) -#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) -#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) -#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) -#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) -#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) -#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) -#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) -#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) -#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) -#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) -#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) -#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) -#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) -#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) -#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) -#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) -#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) -#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) -#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) -#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) -#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) -#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) -#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) -#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) -#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) -#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) -#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) -#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) -#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) -#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) -#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) -#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) -#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) -#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) -#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) -#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) -#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) -#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) -#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) -#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) -#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) -#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) -#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) -#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) -#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) -#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) -#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) -#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) -#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) -#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) -#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) -#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) -#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) -#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) -#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) -#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) -#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) -#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) -#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) -#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) -#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) -#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) -#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) -#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) -#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) -#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) -#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) -#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) -#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) -#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) -#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) -#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) -#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) -#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) -#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) -#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) -#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) -#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) -#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) -#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) -#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) -#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) -#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) -#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) -#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) -#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) -#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) -#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) -#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) -#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) -#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) -#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) -#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) -#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) -#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) -#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) -#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) -#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) -#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) -#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) -#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) -#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) -#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) -#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) -#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) -#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) -#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) -#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) -#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) -#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) -#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) -#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) -#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) -#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) -#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) -#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) -#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) -#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) -#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) -#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) -#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) -#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) -#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) -#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) -#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) -#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) -#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) -#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) -#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) -#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) -#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) -#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) -#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) -#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) -#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) -#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) -#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) -#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) -#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) -#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) -#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) -#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) -#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) -#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) -#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) -#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) -#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) -#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) -#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) -#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) -#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) -#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) -#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) -#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) -#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) -#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) -#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) -#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) -#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) -#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) -#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) -#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) -#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) -#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) -#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) -#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) -#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) -#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) -#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) -#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) -#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) -#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) -#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) -#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) -#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) -#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) -#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) -#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) -#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) -#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) -#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) -#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) -#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) -#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) -#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) -#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) -#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) -#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) -#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) -#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) -#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) -#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) -#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) -#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) -#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) -#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) -#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) -#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) -#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) -#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) -#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) -#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) -#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) -#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) -#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) -#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) -#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) -#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) -#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) -#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) -#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) -#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) -#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) -#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) -#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) -#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) -#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) -#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) -#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) -#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) -#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) -#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) -#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) -#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) -#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) -#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) -#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) -#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) -#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) -#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) -#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) -#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) -#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) -#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) -#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) -#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) -#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) -#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) -#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) -#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) -#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) -#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) -#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) -#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) -#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) -#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) -#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) -#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) -#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) -#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) -#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) -#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) -#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) -#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) -#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) -#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) -#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) -#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) -#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) -#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) -#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) -#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) -#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) -#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) -#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) -#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) -#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) -#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) -#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) -#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) -#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) -#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) -#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) -#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) -#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) -#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) -#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) -#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) -#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) -#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) -#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) -#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) -#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) -#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) -#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) -#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) -#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) -#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) -#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) -#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) -#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) -#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) -#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) -#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) -#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) -#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) -#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) -#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) -#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) -#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) -#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) -#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) -#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) -#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) -#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) -#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) -#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) -#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) -#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) -#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) -#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) -#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) -#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) -#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) -#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) -#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) -#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) -#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) -#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) -#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) -#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) -#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) -#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) -#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) -#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) -#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) -#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) -#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) -#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) -#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) -#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) -#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) -#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) -#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) -#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) -#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) -#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) -#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) -#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) -#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) -#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) -#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) -#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) -#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) -#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) -#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) -#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) -#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) -#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) -#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) -#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) -#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) -#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) -#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) -#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) -#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) -#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) -#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) -#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) -#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) -#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) -#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) -#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) -#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) -#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) -#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) -#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) -#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) -#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) -#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) -#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) -#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) -#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) -#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) -#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) -#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) -#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) -#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) -#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) -#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) -#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) -#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) -#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) -#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) -#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) -#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) -#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) -#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) -#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) -#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) -#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) -#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) -#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) -#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) -#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) -#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) -#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) -#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) -#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) -#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) -#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) -#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) -#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) -#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) -#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) -#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) -#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) -#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) -#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) -#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) -#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) -#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) -#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) -#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) -#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) -#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) -#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) -#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) -#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) -#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) -#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) -#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) -#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) -#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) -#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) -#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) -#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) -#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) -#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) -#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) -#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) -#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) -#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) -#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) -#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) -#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) -#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) -#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) -#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) -#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) -#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) -#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) -#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) -#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) -#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) -#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) -#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) -#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) -#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) -#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) -#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) -#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) -#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) -#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) -#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) -#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) -#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) -#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) -#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) -#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) -#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) -#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) -#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) -#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) -#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) -#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) -#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) -#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) -#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) -#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) -#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) -#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) -#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) -#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) -#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) -#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) -#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) -#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) -#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) -#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) -#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) -#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) -#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) -#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) -#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) -#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) -#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) -#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) -#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) -#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) -#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) -#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) -#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) -#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) -#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) -#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) -#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) -#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) -#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) -#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) -#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) -#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) -#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) -#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) -#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) -#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) -#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) -#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) -#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) -#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) -#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) -#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) -#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) -#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) -#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) -#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) -#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) -#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) -#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) -#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) -#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) -#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) -#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) -#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) -#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) -#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) -#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) -#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) -#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) -#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) -#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) -#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) -#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) -#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) -#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) -#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) -#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) -#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) -#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) -#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) -#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) -#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) -#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) -#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) -#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) -#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) -#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) -#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) -#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) -#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) -#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) -#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) -#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) -#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) -#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) -#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) -#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) -#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) -#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) -#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) -#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) -#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) -#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) -#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) -#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) -#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) -#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) -#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) -#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) -#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) -#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) -#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) -#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) -#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) -#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) -#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) -#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) -#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) -#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) -#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) -#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) -#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) -#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) -#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) -#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) -#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) -#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) -#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) -#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) -#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) -#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) -#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) -#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) -#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) -#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) -#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) -#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) -#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) -#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) -#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) -#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) -#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) -#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) -#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) -#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) -#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) -#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) -#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) -#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) -#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) -#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) -#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) -#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) -#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) -#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) -#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) -#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) -#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) -#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) -#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) -#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) -#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) -#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) -#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) -#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) -#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) -#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) -#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) -#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) -#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) -#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) -#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) -#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) -#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) -#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) -#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) -#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) -#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) -#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) -#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) -#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) -#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) -#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) -#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) -#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) -#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) -#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) -#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) -#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) -#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) -#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) -#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) -#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) -#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) -#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) -#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) -#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) -#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) -#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) -#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) -#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) -#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) -#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) -#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) -#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) -#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) -#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) -#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) -#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) -#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) -#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) -#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) -#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) -#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) -#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) -#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) -#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) -#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) -#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) -#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) -#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) -#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) -#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) -#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) -#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) -#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) -#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) -#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) -#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) -#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) -#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) -#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) -#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) -#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) -#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) -#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) -#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) -#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) -#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], parameters) -#define GET_BindVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index]) -#define SET_BindVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], parameters) -#define GET_DeleteVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]) -#define SET_DeleteVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], parameters) -#define GET_GenVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]) -#define SET_GenVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters) -#define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]) -#define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) -#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) -#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) -#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) -#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) -#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) -#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) -#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) -#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) -#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) -#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) -#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) -#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) -#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) -#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) -#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) -#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) -#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) -#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) -#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) -#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) -#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) -#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) -#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) -#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) -#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) -#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) -#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) -#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) -#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) -#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) -#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) -#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) -#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) -#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) -#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) -#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) -#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) -#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) -#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) -#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) -#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) -#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) -#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) -#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) -#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) -#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) -#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) -#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) -#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) -#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) -#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) -#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) -#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) -#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) -#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) -#define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) -#define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) -#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) -#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) -#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) -#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) -#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) -#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) - -#endif /* !defined(IN_DRI_DRIVER) */ - -#endif /* !defined( _DISPATCH_H_ ) */ diff --git a/src/libs/mesa/mesa/glapi/glapi.c b/src/libs/mesa/mesa/glapi/glapi.c deleted file mode 100644 index c3ebf60719..0000000000 --- a/src/libs/mesa/mesa/glapi/glapi.c +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - * - * NOTE: There are no dependencies on Mesa in this code. - * - * Versions (API changes): - * 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0 - * 2001/01/16 - added dispatch override feature for Mesa 3.5 - * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1. - * 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints - * itself (using offset ~0). _glapi_add_entrypoint() can be - * called afterward and it'll fill in the correct dispatch - * offset. This allows DRI libGL to avoid probing for DRI - * drivers! No changes to the public glapi interface. - */ - - - -#ifdef HAVE_DIX_CONFIG_H - -#include -#define PUBLIC - -#else - -#include "main/glheader.h" - -#endif - -#include -#include -#ifdef DEBUG -#include -#endif - -#include "glapi.h" -#include "glapioffsets.h" -#include "glapitable.h" - - -/***** BEGIN NO-OP DISPATCH *****/ - -static GLboolean WarnFlag = GL_FALSE; -static _glapi_warning_func warning_func; - -/* - * Enable/disable printing of warning messages. - */ -PUBLIC void -_glapi_noop_enable_warnings(GLboolean enable) -{ - WarnFlag = enable; -} - -/* - * Register a callback function for reporting errors. - */ -PUBLIC void -_glapi_set_warning_func( _glapi_warning_func func ) -{ - warning_func = func; -} - -static GLboolean -warn(void) -{ - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - -#define KEYWORD1 static -#define KEYWORD1_ALT static -#define KEYWORD2 GLAPIENTRY -#define NAME(func) NoOp##func - -#define F NULL - -#define DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } - -#define RETURN_DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } \ - return 0 - -#define DISPATCH_TABLE_NAME __glapi_noop_table -#define UNUSED_TABLE_NAME __unused_noop_functions - -#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name - -static GLint NoOpUnused(void) -{ - if (warn()) { - warning_func(NULL, "GL User Error: calling extension function without a current context\n"); - } - return 0; -} - -#include "glapitemp.h" - -/***** END NO-OP DISPATCH *****/ - - - -/** - * \name Current dispatch and current context control variables - * - * Depending on whether or not multithreading is support, and the type of - * support available, several variables are used to store the current context - * pointer and the current dispatch table pointer. In the non-threaded case, - * the variables \c _glapi_Dispatch and \c _glapi_Context are used for this - * purpose. - * - * In the "normal" threaded case, the variables \c _glapi_Dispatch and - * \c _glapi_Context will be \c NULL if an application is detected as being - * multithreaded. Single-threaded applications will use \c _glapi_Dispatch - * and \c _glapi_Context just like the case without any threading support. - * When \c _glapi_Dispatch and \c _glapi_Context are \c NULL, the thread state - * data \c _gl_DispatchTSD and \c ContextTSD are used. Drivers and the - * static dispatch functions access these variables via \c _glapi_get_dispatch - * and \c _glapi_get_context. - * - * There is a race condition in setting \c _glapi_Dispatch to \c NULL. It is - * possible for the original thread to be setting it at the same instant a new - * thread, perhaps running on a different processor, is clearing it. Because - * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is - * used to determine whether or not the application is multithreaded. - * - * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are - * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and - * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and - * \c _glapi_Context be hardcoded to \c NULL maintains binary compatability - * between TLS enabled loaders and non-TLS DRI drivers. - */ -/*@{*/ -#if defined(GLX_USE_TLS) - -PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))) - = (struct _glapi_table *) __glapi_noop_table; - -PUBLIC __thread void * _glapi_tls_Context - __attribute__((tls_model("initial-exec"))); - -PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL; -PUBLIC const void *_glapi_Context = NULL; - -#else - -#if defined(THREADS) - -static GLboolean ThreadSafe = GL_FALSE; /**< In thread-safe mode? */ -_glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ -static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ - -#if defined(WIN32_THREADS) -void FreeTSD(_glthread_TSD *p); -void FreeAllTSD(void) -{ - FreeTSD(&_gl_DispatchTSD); - FreeTSD(&ContextTSD); -} -#endif /* defined(WIN32_THREADS) */ - -#endif /* defined(THREADS) */ - -PUBLIC struct _glapi_table *_glapi_Dispatch = - (struct _glapi_table *) __glapi_noop_table; -PUBLIC void *_glapi_Context = NULL; - -#endif /* defined(GLX_USE_TLS) */ -/*@}*/ - - - - -/** - * We should call this periodically from a function such as glXMakeCurrent - * in order to test if multiple threads are being used. - */ -void -_glapi_check_multithread(void) -{ -#if defined(THREADS) && !defined(GLX_USE_TLS) - 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; - _glapi_set_dispatch(NULL); - _glapi_set_context(NULL); - } - } - else if (!_glapi_get_dispatch()) { - /* make sure that this thread's dispatch pointer isn't null */ - _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. - */ -PUBLIC void -_glapi_set_context(void *context) -{ - (void) __unused_noop_functions; /* silence a warning */ -#if defined(GLX_USE_TLS) - _glapi_tls_Context = context; -#elif defined(THREADS) - _glthread_SetTSD(&ContextTSD, context); - _glapi_Context = (ThreadSafe) ? NULL : 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. - */ -PUBLIC void * -_glapi_get_context(void) -{ -#if defined(GLX_USE_TLS) - return _glapi_tls_Context; -#elif defined(THREADS) - if (ThreadSafe) { - return _glthread_GetTSD(&ContextTSD); - } - else { - return _glapi_Context; - } -#else - return _glapi_Context; -#endif -} - -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -# if defined(THREADS) && !defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 32 -# else -# define DISPATCH_FUNCTION_SIZE 16 -# endif -#endif - -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) -# define NEED_FUNCTION_POINTER -#endif - -#if defined(PTHREADS) || defined(GLX_USE_TLS) -/** - * Perform platform-specific GL API entry-point fixups. - */ -static void -init_glapi_relocs( void ) -{ -#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) - extern unsigned long _x86_get_dispatch(void); - char run_time_patch[] = { - 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ - }; - GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ - const GLubyte * const get_disp = (const GLubyte *) run_time_patch; - GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - - *offset = _x86_get_dispatch(); - while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); - curr_func += DISPATCH_FUNCTION_SIZE; - } -#endif -} -#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ - - -/** - * Set the global or per-thread dispatch table pointer. - * If the dispatch parameter is NULL we'll plug in the no-op dispatch - * table (__glapi_noop_table). - */ -PUBLIC void -_glapi_set_dispatch(struct _glapi_table *dispatch) -{ -#if defined(PTHREADS) || defined(GLX_USE_TLS) - static pthread_once_t once_control = PTHREAD_ONCE_INIT; - pthread_once( & once_control, init_glapi_relocs ); -#endif - - if (!dispatch) { - /* use the no-op functions */ - dispatch = (struct _glapi_table *) __glapi_noop_table; - } -#ifdef DEBUG - else { - _glapi_check_table(dispatch); - } -#endif - -#if defined(GLX_USE_TLS) - _glapi_tls_Dispatch = dispatch; -#elif defined(THREADS) - _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); - _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch; -#else /*THREADS*/ - _glapi_Dispatch = dispatch; -#endif /*THREADS*/ -} - - - -/** - * Return pointer to current dispatch table for calling thread. - */ -PUBLIC struct _glapi_table * -_glapi_get_dispatch(void) -{ - struct _glapi_table * api; -#if defined(GLX_USE_TLS) - api = _glapi_tls_Dispatch; -#elif defined(THREADS) - api = (ThreadSafe) - ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD) - : _glapi_Dispatch; -#else - api = _glapi_Dispatch; -#endif - return api; -} - - - - -/* - * The dispatch table size (number of entries) is the size of the - * _glapi_table struct plus the number of dynamic entries we can add. - * The extra slots can be filled in by DRI drivers that register new extension - * functions. - */ -#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) - - -/** - * Return size of dispatch table struct as number of functions (or - * slots). - */ -PUBLIC GLuint -_glapi_get_dispatch_table_size(void) -{ - return DISPATCH_TABLE_SIZE; -} - - -/** - * Make sure there are no NULL pointers in the given dispatch table. - * Intended for debugging purposes. - */ -void -_glapi_check_table(const struct _glapi_table *table) -{ -#ifdef EXTRA_DEBUG - 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]); - } - - /* 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("glBlendColor"); - char *blendColorFunc = (char*) &table->BlendColor; - GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *); - assert(blendColorOffset == _gloffset_BlendColor); - assert(blendColorOffset == offset); - } - { - GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); - char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; - GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *); - assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT); - assert(secondaryColor3fOffset == offset); - } - { - GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV"); - char *pointParameterivFunc = (char*) &table->PointParameterivNV; - GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *); - assert(pointParameterivOffset == _gloffset_PointParameterivNV); - assert(pointParameterivOffset == offset); - } - { - GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV"); - char *setFenceFunc = (char*) &table->SetFenceNV; - GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *); - assert(setFenceOffset == _gloffset_SetFenceNV); - assert(setFenceOffset == offset); - } -#else - (void) table; -#endif -} diff --git a/src/libs/mesa/mesa/glapi/glapi.h b/src/libs/mesa/mesa/glapi/glapi.h deleted file mode 100644 index 8f2cf66218..0000000000 --- a/src/libs/mesa/mesa/glapi/glapi.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \mainpage Mesa GL API Module - * - * \section GLAPIIntroduction Introduction - * - * The Mesa GL API module is responsible for dispatching all the - * gl*() functions. All GL functions are dispatched by jumping through - * the current dispatch table (basically a struct full of function - * pointers.) - * - * A per-thread current dispatch table and per-thread current context - * pointer are managed by this module too. - * - * This module is intended to be non-Mesa-specific so it can be used - * with the X/DRI libGL also. - */ - - -#ifndef _GLAPI_H -#define _GLAPI_H - -#define GL_GLEXT_PROTOTYPES - -#include "GL/gl.h" -#include "GL/glext.h" -#include "glthread.h" - - -struct _glapi_table; - -typedef void (*_glapi_proc)(void); /* generic function pointer */ - -typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); - - -#if defined(USE_MGL_NAMESPACE) -#define _glapi_set_dispatch _mglapi_set_dispatch -#define _glapi_get_dispatch _mglapi_get_dispatch -#define _glapi_set_context _mglapi_set_context -#define _glapi_get_context _mglapi_get_context -#define _glapi_Context _mglapi_Context -#define _glapi_Dispatch _mglapi_Dispatch -#endif - - -/* - * Number of extension functions which we can dynamically add at runtime. - */ -#define MAX_EXTENSION_FUNCS 300 - - -/** - ** Define the GET_CURRENT_CONTEXT() macro. - ** \param C local variable which will hold the current context. - **/ -#if defined (GLX_USE_TLS) - -const extern void *_glapi_Context; -const extern struct _glapi_table *_glapi_Dispatch; - -extern __thread void * _glapi_tls_Context - __attribute__((tls_model("initial-exec"))); - -# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context - -#else - -extern void *_glapi_Context; -extern struct _glapi_table *_glapi_Dispatch; - -# ifdef THREADS -# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()) -# else -# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context -# endif - -#endif /* defined (GLX_USE_TLS) */ - - -/** - ** GL API public functions - **/ - -extern void -_glapi_noop_enable_warnings(GLboolean enable); - -extern void -_glapi_set_warning_func(_glapi_warning_func func); - -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 int -_glapi_begin_dispatch_override(struct _glapi_table *override); - - -extern void -_glapi_end_dispatch_override(int layer); - - -struct _glapi_table * -_glapi_get_override_dispatch(int layer); - - -extern GLuint -_glapi_get_dispatch_table_size(void); - - -extern void -_glapi_check_table(const struct _glapi_table *table); - - -extern int -_glapi_add_dispatch( const char * const * function_names, - const char * parameter_signature ); - -extern GLint -_glapi_get_proc_offset(const char *funcName); - - -extern _glapi_proc -_glapi_get_proc_address(const char *funcName); - - -extern const char * -_glapi_get_proc_name(GLuint offset); - - -#endif diff --git a/src/libs/mesa/mesa/glapi/glapi_getproc.c b/src/libs/mesa/mesa/glapi/glapi_getproc.c deleted file mode 100644 index 1238c4cf93..0000000000 --- a/src/libs/mesa/mesa/glapi/glapi_getproc.c +++ /dev/null @@ -1,625 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file glapi_getproc. - * - * Code for implementing glXGetProcAddress(), etc. - * This was originally in glapi.c but refactored out. - */ - - -#include -#include -#include "main/glheader.h" -#include "glapi.h" -#include "glapioffsets.h" -#include "glapitable.h" - - -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); - - -/** - * strdup() is actually not a standard ANSI C or POSIX routine. - * Irix will not define it if ANSI mode is in effect. - */ -static char * -str_dup(const char *str) -{ - char *copy; - copy = (char*) malloc(strlen(str) + 1); - if (!copy) - return NULL; - strcpy(copy, str); - return copy; -} - - - -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -# if defined(THREADS) && !defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 32 -# else -# define DISPATCH_FUNCTION_SIZE 16 -# endif -#endif - -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) -# define NEED_FUNCTION_POINTER -#endif - -/* The code in this file is auto-generated with Python */ -#include "glprocs.h" - - -/** - * Search the table of static entrypoint functions for the named function - * and return the corresponding glprocs_table_t entry. - */ -static const glprocs_table_t * -find_entry( const char * n ) -{ - GLuint i; - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - const char *testName = gl_string_table + static_functions[i].Name_offset; -#ifdef MANGLE - /* skip the "m" prefix on the name */ - if (strcmp(testName, n + 1) == 0) -#else - if (strcmp(testName, n) == 0) -#endif - { - return &static_functions[i]; - } - } - return NULL; -} - - -/** - * 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) -{ - const glprocs_table_t * const f = find_entry( funcName ); - if (f) { - return f->Offset; - } - return -1; -} - - -#if !defined(XFree86Server) && !defined(XGLServer) -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - -/** - * Return dispatch function address for the named static (built-in) function. - * Return NULL if function not found. - */ -static _glapi_proc -get_static_proc_address(const char *funcName) -{ - const glprocs_table_t * const f = find_entry( funcName ); - if (f) { -#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) - return (f->Address == NULL) - ? (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)) - : f->Address; -#elif defined(DISPATCH_FUNCTION_SIZE) - return (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)); -#else - return f->Address; -#endif - } - else { - return NULL; - } -} - -#endif /* !defined(XFree86Server) && !defined(XGLServer) */ - - - -/** - * Return the name of the function at the given offset in the dispatch - * table. For debugging only. - */ -static const char * -get_static_proc_name( GLuint offset ) -{ - GLuint i; - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - if (static_functions[i].Offset == offset) { - return gl_string_table + static_functions[i].Name_offset; - } - } - return NULL; -} - - - -/********************************************************************** - * Extension function management. - */ - - -/** - * Track information about a function added to the GL API. - */ -struct _glapi_function { - /** - * Name of the function. - */ - const char * name; - - - /** - * Text string that describes the types of the parameters passed to the - * named function. Parameter types are converted to characters using the - * following rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - */ - const char * parameter_signature; - - - /** - * Offset in the dispatch table where the pointer to the real function is - * located. If the driver has not requested that the named function be - * added to the dispatch table, this will have the value ~0. - */ - unsigned dispatch_offset; - - - /** - * Pointer to the dispatch stub for the named function. - * - * \todo - * The semantic of this field should be changed slightly. Currently, it - * is always expected to be non-\c NULL. However, it would be better to - * only allocate the entry-point stub when the application requests the - * function via \c glXGetProcAddress. This would save memory for all the - * functions that the driver exports but that the application never wants - * to call. - */ - _glapi_proc dispatch_stub; -}; - - -static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; -static GLuint NumExtEntryPoints = 0; - -#ifdef USE_SPARC_ASM -extern void __glapi_sparc_icache_flush(unsigned int *); -#endif - -/** - * Generate a dispatch function (entrypoint) which jumps through - * the given slot number (offset) in the current dispatch table. - * We need assembly language in order to accomplish this. - */ -static _glapi_proc -generate_entrypoint(GLuint functionOffset) -{ -#if defined(USE_X86_ASM) - /* 32 is chosen as something of a magic offset. For x86, the dispatch - * at offset 32 is the first one where the offset in the - * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. - */ - const GLubyte * const template_func = gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * 32); - GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); - - - if ( code != NULL ) { - (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); - fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); - } - - return (_glapi_proc) code; -#elif defined(USE_SPARC_ASM) - -#ifdef __arch64__ - static const unsigned int insn_template[] = { - 0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */ - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0x8410a000, /* or %g2, %ulo(_glapi_Dispatch), %g2 */ - 0x82106000, /* or %g1, %lo(_glapi_Dispatch), %g1 */ - 0x8528b020, /* sllx %g2, 32, %g2 */ - 0xc2584002, /* ldx [%g1 + %g2], %g1 */ - 0x05000000, /* sethi %hi(8 * glapioffset), %g2 */ - 0x8410a000, /* or %g2, %lo(8 * glapioffset), %g2 */ - 0xc6584002, /* ldx [%g1 + %g2], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#else - static const unsigned int insn_template[] = { - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0xc2006000, /* ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ - 0xc6006000, /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#endif /* __arch64__ */ - unsigned int *code = (unsigned int *) malloc(sizeof(insn_template)); - unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch; - if (code) { - memcpy(code, insn_template, sizeof(insn_template)); - -#ifdef __arch64__ - code[0] |= (glapi_addr >> (32 + 10)); - code[1] |= ((glapi_addr & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1)); - code[3] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[2]); - code[6] |= ((functionOffset * 8) >> 10); - code[7] |= ((functionOffset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else - code[0] |= (glapi_addr >> 10); - code[1] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= (functionOffset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - } - return (_glapi_proc) code; -#else - (void) functionOffset; - return NULL; -#endif /* USE_*_ASM */ -} - - -/** - * This function inserts a new dispatch offset into the assembly language - * stub that was generated with the preceeding function. - */ -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) -{ -#if defined(USE_X86_ASM) - GLubyte * const code = (GLubyte *) entrypoint; - -#if DISPATCH_FUNCTION_SIZE == 32 - *((unsigned int *)(code + 11)) = 4 * offset; - *((unsigned int *)(code + 22)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) - *((unsigned int *)(code + 8)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 - *((unsigned int *)(code + 7)) = 4 * offset; -#else -# error Invalid DISPATCH_FUNCTION_SIZE! -#endif - -#elif defined(USE_SPARC_ASM) - - /* XXX this hasn't been tested! */ - unsigned int *code = (unsigned int *) entrypoint; -#ifdef __arch64__ - code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */ - code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */ - code[6] |= ((offset * 8) >> 10); - code[7] |= ((offset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else /* __arch64__ */ - code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - code[2] |= (offset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - -#else - - /* an unimplemented architecture */ - (void) entrypoint; - (void) offset; - -#endif /* USE_*_ASM */ -} - - -/** - * Generate new entrypoint - * - * Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver - * calls \c _glapi_add_dispatch we'll put in the proper offset. If that - * never happens, and the user calls this function, he'll segfault. That's - * what you get when you try calling a GL function that doesn't really exist. - * - * \param funcName Name of the function to create an entry-point for. - * - * \sa _glapi_add_entrypoint - */ - -static struct _glapi_function * -add_function_name( const char * funcName ) -{ - struct _glapi_function * entry = NULL; - - if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { - _glapi_proc entrypoint = generate_entrypoint(~0); - if (entrypoint != NULL) { - entry = & ExtEntryTable[NumExtEntryPoints]; - - ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); - ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; - ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; - ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; - NumExtEntryPoints++; - } - } - - return entry; -} - - -/** - * Fill-in the dispatch stub for the named function. - * - * This function is intended to be called by a hardware driver. When called, - * a dispatch stub may be created created for the function. A pointer to this - * dispatch function will be returned by glXGetProcAddress. - * - * \param function_names Array of pointers to function names that should - * share a common dispatch offset. - * \param parameter_signature String representing the types of the parameters - * passed to the named function. Parameter types - * are converted to characters using the following - * rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - * - * \returns - * The offset in the dispatch table of the named function. A pointer to the - * driver's implementation of the named function should be stored at - * \c dispatch_table[\c offset]. Return -1 if error/problem. - * - * \sa glXGetProcAddress - * - * \warning - * This function can only handle up to 8 names at a time. As far as I know, - * the maximum number of names ever associated with an existing GL function is - * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, - * \c glPointParameterfARB, and \c glPointParameterf), so this should not be - * too painful of a limitation. - * - * \todo - * Determine whether or not \c parameter_signature should be allowed to be - * \c NULL. It doesn't seem like much of a hardship for drivers to have to - * pass in an empty string. - * - * \todo - * Determine if code should be added to reject function names that start with - * 'glX'. - * - * \bug - * Add code to compare \c parameter_signature with the parameter signature of - * a static function. In order to do that, we need to find a way to \b get - * the parameter signature of a static function. - */ - -PUBLIC int -_glapi_add_dispatch( const char * const * function_names, - const char * parameter_signature ) -{ - static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC; - const char * const real_sig = (parameter_signature != NULL) - ? parameter_signature : ""; - struct _glapi_function * entry[8]; - GLboolean is_static[8]; - unsigned i; - unsigned j; - int offset = ~0; - int new_offset; - - - (void) memset( is_static, 0, sizeof( is_static ) ); - (void) memset( entry, 0, sizeof( entry ) ); - - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - /* Do some trivial validation on the name of the function. - */ - - if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') - return -1; - - /* Determine if the named function already exists. If the function does - * exist, it must have the same parameter signature as the function - * being added. - */ - - new_offset = get_static_proc_offset(function_names[i]); - if (new_offset >= 0) { - /* FIXME: Make sure the parameter signatures match! How do we get - * FIXME: the parameter signature for static functions? - */ - - if ( (offset != ~0) && (new_offset != offset) ) { - return -1; - } - - is_static[i] = GL_TRUE; - offset = new_offset; - } - - - for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { - if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { - /* The offset may be ~0 if the function name was added by - * glXGetProcAddress but never filled in by the driver. - */ - - if (ExtEntryTable[j].dispatch_offset != ~0) { - if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) - != 0) { - return -1; - } - - if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { - return -1; - } - - offset = ExtEntryTable[j].dispatch_offset; - } - - entry[i] = & ExtEntryTable[j]; - break; - } - } - } - - if (offset == ~0) { - offset = next_dynamic_offset; - next_dynamic_offset++; - } - - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - if (! is_static[i] ) { - if (entry[i] == NULL) { - entry[i] = add_function_name( function_names[i] ); - if (entry[i] == NULL) { - /* FIXME: Possible memory leak here. - */ - return -1; - } - } - - entry[i]->parameter_signature = str_dup(real_sig); - fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset); - entry[i]->dispatch_offset = offset; - } - } - - return offset; -} - - -/** - * Return offset of entrypoint for named function within dispatch table. - */ -PUBLIC GLint -_glapi_get_proc_offset(const char *funcName) -{ - /* search extension functions first */ - GLuint i; - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_offset; - } - } - /* search static functions */ - return get_static_proc_offset(funcName); -} - - - -/** - * Return pointer to the named function. If the function name isn't found - * in the name of static functions, try generating a new API entrypoint on - * the fly with assembly language. - */ -_glapi_proc -_glapi_get_proc_address(const char *funcName) -{ - struct _glapi_function * entry; - GLuint i; - -#ifdef MANGLE - if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return NULL; -#else - if (funcName[0] != 'g' || funcName[1] != 'l') - return NULL; -#endif - - /* search extension functions first */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_stub; - } - } - -#if !defined( XFree86Server ) && !defined( XGLServer ) - /* search static functions */ - { - const _glapi_proc func = get_static_proc_address(funcName); - if (func) - return func; - } -#endif /* !defined( XFree86Server ) */ - - entry = add_function_name(funcName); - return (entry == NULL) ? NULL : entry->dispatch_stub; -} - - - -/** - * 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 i; - const char * n; - - /* search built-in functions */ - n = get_static_proc_name(offset); - if ( n != NULL ) { - return n; - } - - /* search added extension functions */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (ExtEntryTable[i].dispatch_offset == offset) { - return ExtEntryTable[i].name; - } - } - return NULL; -} diff --git a/src/libs/mesa/mesa/glapi/glapioffsets.h b/src/libs/mesa/mesa/glapi/glapioffsets.h deleted file mode 100644 index 43c265924b..0000000000 --- a/src/libs/mesa/mesa/glapi/glapioffsets.h +++ /dev/null @@ -1,1174 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_offsets.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR 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. - */ - -#if !defined( _GLAPI_OFFSETS_H_ ) -# define _GLAPI_OFFSETS_H_ - -#define _gloffset_NewList 0 -#define _gloffset_EndList 1 -#define _gloffset_CallList 2 -#define _gloffset_CallLists 3 -#define _gloffset_DeleteLists 4 -#define _gloffset_GenLists 5 -#define _gloffset_ListBase 6 -#define _gloffset_Begin 7 -#define _gloffset_Bitmap 8 -#define _gloffset_Color3b 9 -#define _gloffset_Color3bv 10 -#define _gloffset_Color3d 11 -#define _gloffset_Color3dv 12 -#define _gloffset_Color3f 13 -#define _gloffset_Color3fv 14 -#define _gloffset_Color3i 15 -#define _gloffset_Color3iv 16 -#define _gloffset_Color3s 17 -#define _gloffset_Color3sv 18 -#define _gloffset_Color3ub 19 -#define _gloffset_Color3ubv 20 -#define _gloffset_Color3ui 21 -#define _gloffset_Color3uiv 22 -#define _gloffset_Color3us 23 -#define _gloffset_Color3usv 24 -#define _gloffset_Color4b 25 -#define _gloffset_Color4bv 26 -#define _gloffset_Color4d 27 -#define _gloffset_Color4dv 28 -#define _gloffset_Color4f 29 -#define _gloffset_Color4fv 30 -#define _gloffset_Color4i 31 -#define _gloffset_Color4iv 32 -#define _gloffset_Color4s 33 -#define _gloffset_Color4sv 34 -#define _gloffset_Color4ub 35 -#define _gloffset_Color4ubv 36 -#define _gloffset_Color4ui 37 -#define _gloffset_Color4uiv 38 -#define _gloffset_Color4us 39 -#define _gloffset_Color4usv 40 -#define _gloffset_EdgeFlag 41 -#define _gloffset_EdgeFlagv 42 -#define _gloffset_End 43 -#define _gloffset_Indexd 44 -#define _gloffset_Indexdv 45 -#define _gloffset_Indexf 46 -#define _gloffset_Indexfv 47 -#define _gloffset_Indexi 48 -#define _gloffset_Indexiv 49 -#define _gloffset_Indexs 50 -#define _gloffset_Indexsv 51 -#define _gloffset_Normal3b 52 -#define _gloffset_Normal3bv 53 -#define _gloffset_Normal3d 54 -#define _gloffset_Normal3dv 55 -#define _gloffset_Normal3f 56 -#define _gloffset_Normal3fv 57 -#define _gloffset_Normal3i 58 -#define _gloffset_Normal3iv 59 -#define _gloffset_Normal3s 60 -#define _gloffset_Normal3sv 61 -#define _gloffset_RasterPos2d 62 -#define _gloffset_RasterPos2dv 63 -#define _gloffset_RasterPos2f 64 -#define _gloffset_RasterPos2fv 65 -#define _gloffset_RasterPos2i 66 -#define _gloffset_RasterPos2iv 67 -#define _gloffset_RasterPos2s 68 -#define _gloffset_RasterPos2sv 69 -#define _gloffset_RasterPos3d 70 -#define _gloffset_RasterPos3dv 71 -#define _gloffset_RasterPos3f 72 -#define _gloffset_RasterPos3fv 73 -#define _gloffset_RasterPos3i 74 -#define _gloffset_RasterPos3iv 75 -#define _gloffset_RasterPos3s 76 -#define _gloffset_RasterPos3sv 77 -#define _gloffset_RasterPos4d 78 -#define _gloffset_RasterPos4dv 79 -#define _gloffset_RasterPos4f 80 -#define _gloffset_RasterPos4fv 81 -#define _gloffset_RasterPos4i 82 -#define _gloffset_RasterPos4iv 83 -#define _gloffset_RasterPos4s 84 -#define _gloffset_RasterPos4sv 85 -#define _gloffset_Rectd 86 -#define _gloffset_Rectdv 87 -#define _gloffset_Rectf 88 -#define _gloffset_Rectfv 89 -#define _gloffset_Recti 90 -#define _gloffset_Rectiv 91 -#define _gloffset_Rects 92 -#define _gloffset_Rectsv 93 -#define _gloffset_TexCoord1d 94 -#define _gloffset_TexCoord1dv 95 -#define _gloffset_TexCoord1f 96 -#define _gloffset_TexCoord1fv 97 -#define _gloffset_TexCoord1i 98 -#define _gloffset_TexCoord1iv 99 -#define _gloffset_TexCoord1s 100 -#define _gloffset_TexCoord1sv 101 -#define _gloffset_TexCoord2d 102 -#define _gloffset_TexCoord2dv 103 -#define _gloffset_TexCoord2f 104 -#define _gloffset_TexCoord2fv 105 -#define _gloffset_TexCoord2i 106 -#define _gloffset_TexCoord2iv 107 -#define _gloffset_TexCoord2s 108 -#define _gloffset_TexCoord2sv 109 -#define _gloffset_TexCoord3d 110 -#define _gloffset_TexCoord3dv 111 -#define _gloffset_TexCoord3f 112 -#define _gloffset_TexCoord3fv 113 -#define _gloffset_TexCoord3i 114 -#define _gloffset_TexCoord3iv 115 -#define _gloffset_TexCoord3s 116 -#define _gloffset_TexCoord3sv 117 -#define _gloffset_TexCoord4d 118 -#define _gloffset_TexCoord4dv 119 -#define _gloffset_TexCoord4f 120 -#define _gloffset_TexCoord4fv 121 -#define _gloffset_TexCoord4i 122 -#define _gloffset_TexCoord4iv 123 -#define _gloffset_TexCoord4s 124 -#define _gloffset_TexCoord4sv 125 -#define _gloffset_Vertex2d 126 -#define _gloffset_Vertex2dv 127 -#define _gloffset_Vertex2f 128 -#define _gloffset_Vertex2fv 129 -#define _gloffset_Vertex2i 130 -#define _gloffset_Vertex2iv 131 -#define _gloffset_Vertex2s 132 -#define _gloffset_Vertex2sv 133 -#define _gloffset_Vertex3d 134 -#define _gloffset_Vertex3dv 135 -#define _gloffset_Vertex3f 136 -#define _gloffset_Vertex3fv 137 -#define _gloffset_Vertex3i 138 -#define _gloffset_Vertex3iv 139 -#define _gloffset_Vertex3s 140 -#define _gloffset_Vertex3sv 141 -#define _gloffset_Vertex4d 142 -#define _gloffset_Vertex4dv 143 -#define _gloffset_Vertex4f 144 -#define _gloffset_Vertex4fv 145 -#define _gloffset_Vertex4i 146 -#define _gloffset_Vertex4iv 147 -#define _gloffset_Vertex4s 148 -#define _gloffset_Vertex4sv 149 -#define _gloffset_ClipPlane 150 -#define _gloffset_ColorMaterial 151 -#define _gloffset_CullFace 152 -#define _gloffset_Fogf 153 -#define _gloffset_Fogfv 154 -#define _gloffset_Fogi 155 -#define _gloffset_Fogiv 156 -#define _gloffset_FrontFace 157 -#define _gloffset_Hint 158 -#define _gloffset_Lightf 159 -#define _gloffset_Lightfv 160 -#define _gloffset_Lighti 161 -#define _gloffset_Lightiv 162 -#define _gloffset_LightModelf 163 -#define _gloffset_LightModelfv 164 -#define _gloffset_LightModeli 165 -#define _gloffset_LightModeliv 166 -#define _gloffset_LineStipple 167 -#define _gloffset_LineWidth 168 -#define _gloffset_Materialf 169 -#define _gloffset_Materialfv 170 -#define _gloffset_Materiali 171 -#define _gloffset_Materialiv 172 -#define _gloffset_PointSize 173 -#define _gloffset_PolygonMode 174 -#define _gloffset_PolygonStipple 175 -#define _gloffset_Scissor 176 -#define _gloffset_ShadeModel 177 -#define _gloffset_TexParameterf 178 -#define _gloffset_TexParameterfv 179 -#define _gloffset_TexParameteri 180 -#define _gloffset_TexParameteriv 181 -#define _gloffset_TexImage1D 182 -#define _gloffset_TexImage2D 183 -#define _gloffset_TexEnvf 184 -#define _gloffset_TexEnvfv 185 -#define _gloffset_TexEnvi 186 -#define _gloffset_TexEnviv 187 -#define _gloffset_TexGend 188 -#define _gloffset_TexGendv 189 -#define _gloffset_TexGenf 190 -#define _gloffset_TexGenfv 191 -#define _gloffset_TexGeni 192 -#define _gloffset_TexGeniv 193 -#define _gloffset_FeedbackBuffer 194 -#define _gloffset_SelectBuffer 195 -#define _gloffset_RenderMode 196 -#define _gloffset_InitNames 197 -#define _gloffset_LoadName 198 -#define _gloffset_PassThrough 199 -#define _gloffset_PopName 200 -#define _gloffset_PushName 201 -#define _gloffset_DrawBuffer 202 -#define _gloffset_Clear 203 -#define _gloffset_ClearAccum 204 -#define _gloffset_ClearIndex 205 -#define _gloffset_ClearColor 206 -#define _gloffset_ClearStencil 207 -#define _gloffset_ClearDepth 208 -#define _gloffset_StencilMask 209 -#define _gloffset_ColorMask 210 -#define _gloffset_DepthMask 211 -#define _gloffset_IndexMask 212 -#define _gloffset_Accum 213 -#define _gloffset_Disable 214 -#define _gloffset_Enable 215 -#define _gloffset_Finish 216 -#define _gloffset_Flush 217 -#define _gloffset_PopAttrib 218 -#define _gloffset_PushAttrib 219 -#define _gloffset_Map1d 220 -#define _gloffset_Map1f 221 -#define _gloffset_Map2d 222 -#define _gloffset_Map2f 223 -#define _gloffset_MapGrid1d 224 -#define _gloffset_MapGrid1f 225 -#define _gloffset_MapGrid2d 226 -#define _gloffset_MapGrid2f 227 -#define _gloffset_EvalCoord1d 228 -#define _gloffset_EvalCoord1dv 229 -#define _gloffset_EvalCoord1f 230 -#define _gloffset_EvalCoord1fv 231 -#define _gloffset_EvalCoord2d 232 -#define _gloffset_EvalCoord2dv 233 -#define _gloffset_EvalCoord2f 234 -#define _gloffset_EvalCoord2fv 235 -#define _gloffset_EvalMesh1 236 -#define _gloffset_EvalPoint1 237 -#define _gloffset_EvalMesh2 238 -#define _gloffset_EvalPoint2 239 -#define _gloffset_AlphaFunc 240 -#define _gloffset_BlendFunc 241 -#define _gloffset_LogicOp 242 -#define _gloffset_StencilFunc 243 -#define _gloffset_StencilOp 244 -#define _gloffset_DepthFunc 245 -#define _gloffset_PixelZoom 246 -#define _gloffset_PixelTransferf 247 -#define _gloffset_PixelTransferi 248 -#define _gloffset_PixelStoref 249 -#define _gloffset_PixelStorei 250 -#define _gloffset_PixelMapfv 251 -#define _gloffset_PixelMapuiv 252 -#define _gloffset_PixelMapusv 253 -#define _gloffset_ReadBuffer 254 -#define _gloffset_CopyPixels 255 -#define _gloffset_ReadPixels 256 -#define _gloffset_DrawPixels 257 -#define _gloffset_GetBooleanv 258 -#define _gloffset_GetClipPlane 259 -#define _gloffset_GetDoublev 260 -#define _gloffset_GetError 261 -#define _gloffset_GetFloatv 262 -#define _gloffset_GetIntegerv 263 -#define _gloffset_GetLightfv 264 -#define _gloffset_GetLightiv 265 -#define _gloffset_GetMapdv 266 -#define _gloffset_GetMapfv 267 -#define _gloffset_GetMapiv 268 -#define _gloffset_GetMaterialfv 269 -#define _gloffset_GetMaterialiv 270 -#define _gloffset_GetPixelMapfv 271 -#define _gloffset_GetPixelMapuiv 272 -#define _gloffset_GetPixelMapusv 273 -#define _gloffset_GetPolygonStipple 274 -#define _gloffset_GetString 275 -#define _gloffset_GetTexEnvfv 276 -#define _gloffset_GetTexEnviv 277 -#define _gloffset_GetTexGendv 278 -#define _gloffset_GetTexGenfv 279 -#define _gloffset_GetTexGeniv 280 -#define _gloffset_GetTexImage 281 -#define _gloffset_GetTexParameterfv 282 -#define _gloffset_GetTexParameteriv 283 -#define _gloffset_GetTexLevelParameterfv 284 -#define _gloffset_GetTexLevelParameteriv 285 -#define _gloffset_IsEnabled 286 -#define _gloffset_IsList 287 -#define _gloffset_DepthRange 288 -#define _gloffset_Frustum 289 -#define _gloffset_LoadIdentity 290 -#define _gloffset_LoadMatrixf 291 -#define _gloffset_LoadMatrixd 292 -#define _gloffset_MatrixMode 293 -#define _gloffset_MultMatrixf 294 -#define _gloffset_MultMatrixd 295 -#define _gloffset_Ortho 296 -#define _gloffset_PopMatrix 297 -#define _gloffset_PushMatrix 298 -#define _gloffset_Rotated 299 -#define _gloffset_Rotatef 300 -#define _gloffset_Scaled 301 -#define _gloffset_Scalef 302 -#define _gloffset_Translated 303 -#define _gloffset_Translatef 304 -#define _gloffset_Viewport 305 -#define _gloffset_ArrayElement 306 -#define _gloffset_BindTexture 307 -#define _gloffset_ColorPointer 308 -#define _gloffset_DisableClientState 309 -#define _gloffset_DrawArrays 310 -#define _gloffset_DrawElements 311 -#define _gloffset_EdgeFlagPointer 312 -#define _gloffset_EnableClientState 313 -#define _gloffset_IndexPointer 314 -#define _gloffset_Indexub 315 -#define _gloffset_Indexubv 316 -#define _gloffset_InterleavedArrays 317 -#define _gloffset_NormalPointer 318 -#define _gloffset_PolygonOffset 319 -#define _gloffset_TexCoordPointer 320 -#define _gloffset_VertexPointer 321 -#define _gloffset_AreTexturesResident 322 -#define _gloffset_CopyTexImage1D 323 -#define _gloffset_CopyTexImage2D 324 -#define _gloffset_CopyTexSubImage1D 325 -#define _gloffset_CopyTexSubImage2D 326 -#define _gloffset_DeleteTextures 327 -#define _gloffset_GenTextures 328 -#define _gloffset_GetPointerv 329 -#define _gloffset_IsTexture 330 -#define _gloffset_PrioritizeTextures 331 -#define _gloffset_TexSubImage1D 332 -#define _gloffset_TexSubImage2D 333 -#define _gloffset_PopClientAttrib 334 -#define _gloffset_PushClientAttrib 335 -#define _gloffset_BlendColor 336 -#define _gloffset_BlendEquation 337 -#define _gloffset_DrawRangeElements 338 -#define _gloffset_ColorTable 339 -#define _gloffset_ColorTableParameterfv 340 -#define _gloffset_ColorTableParameteriv 341 -#define _gloffset_CopyColorTable 342 -#define _gloffset_GetColorTable 343 -#define _gloffset_GetColorTableParameterfv 344 -#define _gloffset_GetColorTableParameteriv 345 -#define _gloffset_ColorSubTable 346 -#define _gloffset_CopyColorSubTable 347 -#define _gloffset_ConvolutionFilter1D 348 -#define _gloffset_ConvolutionFilter2D 349 -#define _gloffset_ConvolutionParameterf 350 -#define _gloffset_ConvolutionParameterfv 351 -#define _gloffset_ConvolutionParameteri 352 -#define _gloffset_ConvolutionParameteriv 353 -#define _gloffset_CopyConvolutionFilter1D 354 -#define _gloffset_CopyConvolutionFilter2D 355 -#define _gloffset_GetConvolutionFilter 356 -#define _gloffset_GetConvolutionParameterfv 357 -#define _gloffset_GetConvolutionParameteriv 358 -#define _gloffset_GetSeparableFilter 359 -#define _gloffset_SeparableFilter2D 360 -#define _gloffset_GetHistogram 361 -#define _gloffset_GetHistogramParameterfv 362 -#define _gloffset_GetHistogramParameteriv 363 -#define _gloffset_GetMinmax 364 -#define _gloffset_GetMinmaxParameterfv 365 -#define _gloffset_GetMinmaxParameteriv 366 -#define _gloffset_Histogram 367 -#define _gloffset_Minmax 368 -#define _gloffset_ResetHistogram 369 -#define _gloffset_ResetMinmax 370 -#define _gloffset_TexImage3D 371 -#define _gloffset_TexSubImage3D 372 -#define _gloffset_CopyTexSubImage3D 373 -#define _gloffset_ActiveTextureARB 374 -#define _gloffset_ClientActiveTextureARB 375 -#define _gloffset_MultiTexCoord1dARB 376 -#define _gloffset_MultiTexCoord1dvARB 377 -#define _gloffset_MultiTexCoord1fARB 378 -#define _gloffset_MultiTexCoord1fvARB 379 -#define _gloffset_MultiTexCoord1iARB 380 -#define _gloffset_MultiTexCoord1ivARB 381 -#define _gloffset_MultiTexCoord1sARB 382 -#define _gloffset_MultiTexCoord1svARB 383 -#define _gloffset_MultiTexCoord2dARB 384 -#define _gloffset_MultiTexCoord2dvARB 385 -#define _gloffset_MultiTexCoord2fARB 386 -#define _gloffset_MultiTexCoord2fvARB 387 -#define _gloffset_MultiTexCoord2iARB 388 -#define _gloffset_MultiTexCoord2ivARB 389 -#define _gloffset_MultiTexCoord2sARB 390 -#define _gloffset_MultiTexCoord2svARB 391 -#define _gloffset_MultiTexCoord3dARB 392 -#define _gloffset_MultiTexCoord3dvARB 393 -#define _gloffset_MultiTexCoord3fARB 394 -#define _gloffset_MultiTexCoord3fvARB 395 -#define _gloffset_MultiTexCoord3iARB 396 -#define _gloffset_MultiTexCoord3ivARB 397 -#define _gloffset_MultiTexCoord3sARB 398 -#define _gloffset_MultiTexCoord3svARB 399 -#define _gloffset_MultiTexCoord4dARB 400 -#define _gloffset_MultiTexCoord4dvARB 401 -#define _gloffset_MultiTexCoord4fARB 402 -#define _gloffset_MultiTexCoord4fvARB 403 -#define _gloffset_MultiTexCoord4iARB 404 -#define _gloffset_MultiTexCoord4ivARB 405 -#define _gloffset_MultiTexCoord4sARB 406 -#define _gloffset_MultiTexCoord4svARB 407 - -#if !defined(IN_DRI_DRIVER) - -#define _gloffset_AttachShader 408 -#define _gloffset_CreateProgram 409 -#define _gloffset_CreateShader 410 -#define _gloffset_DeleteProgram 411 -#define _gloffset_DeleteShader 412 -#define _gloffset_DetachShader 413 -#define _gloffset_GetAttachedShaders 414 -#define _gloffset_GetProgramInfoLog 415 -#define _gloffset_GetProgramiv 416 -#define _gloffset_GetShaderInfoLog 417 -#define _gloffset_GetShaderiv 418 -#define _gloffset_IsProgram 419 -#define _gloffset_IsShader 420 -#define _gloffset_StencilFuncSeparate 421 -#define _gloffset_StencilMaskSeparate 422 -#define _gloffset_StencilOpSeparate 423 -#define _gloffset_UniformMatrix2x3fv 424 -#define _gloffset_UniformMatrix2x4fv 425 -#define _gloffset_UniformMatrix3x2fv 426 -#define _gloffset_UniformMatrix3x4fv 427 -#define _gloffset_UniformMatrix4x2fv 428 -#define _gloffset_UniformMatrix4x3fv 429 -#define _gloffset_LoadTransposeMatrixdARB 430 -#define _gloffset_LoadTransposeMatrixfARB 431 -#define _gloffset_MultTransposeMatrixdARB 432 -#define _gloffset_MultTransposeMatrixfARB 433 -#define _gloffset_SampleCoverageARB 434 -#define _gloffset_CompressedTexImage1DARB 435 -#define _gloffset_CompressedTexImage2DARB 436 -#define _gloffset_CompressedTexImage3DARB 437 -#define _gloffset_CompressedTexSubImage1DARB 438 -#define _gloffset_CompressedTexSubImage2DARB 439 -#define _gloffset_CompressedTexSubImage3DARB 440 -#define _gloffset_GetCompressedTexImageARB 441 -#define _gloffset_DisableVertexAttribArrayARB 442 -#define _gloffset_EnableVertexAttribArrayARB 443 -#define _gloffset_GetProgramEnvParameterdvARB 444 -#define _gloffset_GetProgramEnvParameterfvARB 445 -#define _gloffset_GetProgramLocalParameterdvARB 446 -#define _gloffset_GetProgramLocalParameterfvARB 447 -#define _gloffset_GetProgramStringARB 448 -#define _gloffset_GetProgramivARB 449 -#define _gloffset_GetVertexAttribdvARB 450 -#define _gloffset_GetVertexAttribfvARB 451 -#define _gloffset_GetVertexAttribivARB 452 -#define _gloffset_ProgramEnvParameter4dARB 453 -#define _gloffset_ProgramEnvParameter4dvARB 454 -#define _gloffset_ProgramEnvParameter4fARB 455 -#define _gloffset_ProgramEnvParameter4fvARB 456 -#define _gloffset_ProgramLocalParameter4dARB 457 -#define _gloffset_ProgramLocalParameter4dvARB 458 -#define _gloffset_ProgramLocalParameter4fARB 459 -#define _gloffset_ProgramLocalParameter4fvARB 460 -#define _gloffset_ProgramStringARB 461 -#define _gloffset_VertexAttrib1dARB 462 -#define _gloffset_VertexAttrib1dvARB 463 -#define _gloffset_VertexAttrib1fARB 464 -#define _gloffset_VertexAttrib1fvARB 465 -#define _gloffset_VertexAttrib1sARB 466 -#define _gloffset_VertexAttrib1svARB 467 -#define _gloffset_VertexAttrib2dARB 468 -#define _gloffset_VertexAttrib2dvARB 469 -#define _gloffset_VertexAttrib2fARB 470 -#define _gloffset_VertexAttrib2fvARB 471 -#define _gloffset_VertexAttrib2sARB 472 -#define _gloffset_VertexAttrib2svARB 473 -#define _gloffset_VertexAttrib3dARB 474 -#define _gloffset_VertexAttrib3dvARB 475 -#define _gloffset_VertexAttrib3fARB 476 -#define _gloffset_VertexAttrib3fvARB 477 -#define _gloffset_VertexAttrib3sARB 478 -#define _gloffset_VertexAttrib3svARB 479 -#define _gloffset_VertexAttrib4NbvARB 480 -#define _gloffset_VertexAttrib4NivARB 481 -#define _gloffset_VertexAttrib4NsvARB 482 -#define _gloffset_VertexAttrib4NubARB 483 -#define _gloffset_VertexAttrib4NubvARB 484 -#define _gloffset_VertexAttrib4NuivARB 485 -#define _gloffset_VertexAttrib4NusvARB 486 -#define _gloffset_VertexAttrib4bvARB 487 -#define _gloffset_VertexAttrib4dARB 488 -#define _gloffset_VertexAttrib4dvARB 489 -#define _gloffset_VertexAttrib4fARB 490 -#define _gloffset_VertexAttrib4fvARB 491 -#define _gloffset_VertexAttrib4ivARB 492 -#define _gloffset_VertexAttrib4sARB 493 -#define _gloffset_VertexAttrib4svARB 494 -#define _gloffset_VertexAttrib4ubvARB 495 -#define _gloffset_VertexAttrib4uivARB 496 -#define _gloffset_VertexAttrib4usvARB 497 -#define _gloffset_VertexAttribPointerARB 498 -#define _gloffset_BindBufferARB 499 -#define _gloffset_BufferDataARB 500 -#define _gloffset_BufferSubDataARB 501 -#define _gloffset_DeleteBuffersARB 502 -#define _gloffset_GenBuffersARB 503 -#define _gloffset_GetBufferParameterivARB 504 -#define _gloffset_GetBufferPointervARB 505 -#define _gloffset_GetBufferSubDataARB 506 -#define _gloffset_IsBufferARB 507 -#define _gloffset_MapBufferARB 508 -#define _gloffset_UnmapBufferARB 509 -#define _gloffset_BeginQueryARB 510 -#define _gloffset_DeleteQueriesARB 511 -#define _gloffset_EndQueryARB 512 -#define _gloffset_GenQueriesARB 513 -#define _gloffset_GetQueryObjectivARB 514 -#define _gloffset_GetQueryObjectuivARB 515 -#define _gloffset_GetQueryivARB 516 -#define _gloffset_IsQueryARB 517 -#define _gloffset_AttachObjectARB 518 -#define _gloffset_CompileShaderARB 519 -#define _gloffset_CreateProgramObjectARB 520 -#define _gloffset_CreateShaderObjectARB 521 -#define _gloffset_DeleteObjectARB 522 -#define _gloffset_DetachObjectARB 523 -#define _gloffset_GetActiveUniformARB 524 -#define _gloffset_GetAttachedObjectsARB 525 -#define _gloffset_GetHandleARB 526 -#define _gloffset_GetInfoLogARB 527 -#define _gloffset_GetObjectParameterfvARB 528 -#define _gloffset_GetObjectParameterivARB 529 -#define _gloffset_GetShaderSourceARB 530 -#define _gloffset_GetUniformLocationARB 531 -#define _gloffset_GetUniformfvARB 532 -#define _gloffset_GetUniformivARB 533 -#define _gloffset_LinkProgramARB 534 -#define _gloffset_ShaderSourceARB 535 -#define _gloffset_Uniform1fARB 536 -#define _gloffset_Uniform1fvARB 537 -#define _gloffset_Uniform1iARB 538 -#define _gloffset_Uniform1ivARB 539 -#define _gloffset_Uniform2fARB 540 -#define _gloffset_Uniform2fvARB 541 -#define _gloffset_Uniform2iARB 542 -#define _gloffset_Uniform2ivARB 543 -#define _gloffset_Uniform3fARB 544 -#define _gloffset_Uniform3fvARB 545 -#define _gloffset_Uniform3iARB 546 -#define _gloffset_Uniform3ivARB 547 -#define _gloffset_Uniform4fARB 548 -#define _gloffset_Uniform4fvARB 549 -#define _gloffset_Uniform4iARB 550 -#define _gloffset_Uniform4ivARB 551 -#define _gloffset_UniformMatrix2fvARB 552 -#define _gloffset_UniformMatrix3fvARB 553 -#define _gloffset_UniformMatrix4fvARB 554 -#define _gloffset_UseProgramObjectARB 555 -#define _gloffset_ValidateProgramARB 556 -#define _gloffset_BindAttribLocationARB 557 -#define _gloffset_GetActiveAttribARB 558 -#define _gloffset_GetAttribLocationARB 559 -#define _gloffset_DrawBuffersARB 560 -#define _gloffset_PolygonOffsetEXT 561 -#define _gloffset_GetPixelTexGenParameterfvSGIS 562 -#define _gloffset_GetPixelTexGenParameterivSGIS 563 -#define _gloffset_PixelTexGenParameterfSGIS 564 -#define _gloffset_PixelTexGenParameterfvSGIS 565 -#define _gloffset_PixelTexGenParameteriSGIS 566 -#define _gloffset_PixelTexGenParameterivSGIS 567 -#define _gloffset_SampleMaskSGIS 568 -#define _gloffset_SamplePatternSGIS 569 -#define _gloffset_ColorPointerEXT 570 -#define _gloffset_EdgeFlagPointerEXT 571 -#define _gloffset_IndexPointerEXT 572 -#define _gloffset_NormalPointerEXT 573 -#define _gloffset_TexCoordPointerEXT 574 -#define _gloffset_VertexPointerEXT 575 -#define _gloffset_PointParameterfEXT 576 -#define _gloffset_PointParameterfvEXT 577 -#define _gloffset_LockArraysEXT 578 -#define _gloffset_UnlockArraysEXT 579 -#define _gloffset_CullParameterdvEXT 580 -#define _gloffset_CullParameterfvEXT 581 -#define _gloffset_SecondaryColor3bEXT 582 -#define _gloffset_SecondaryColor3bvEXT 583 -#define _gloffset_SecondaryColor3dEXT 584 -#define _gloffset_SecondaryColor3dvEXT 585 -#define _gloffset_SecondaryColor3fEXT 586 -#define _gloffset_SecondaryColor3fvEXT 587 -#define _gloffset_SecondaryColor3iEXT 588 -#define _gloffset_SecondaryColor3ivEXT 589 -#define _gloffset_SecondaryColor3sEXT 590 -#define _gloffset_SecondaryColor3svEXT 591 -#define _gloffset_SecondaryColor3ubEXT 592 -#define _gloffset_SecondaryColor3ubvEXT 593 -#define _gloffset_SecondaryColor3uiEXT 594 -#define _gloffset_SecondaryColor3uivEXT 595 -#define _gloffset_SecondaryColor3usEXT 596 -#define _gloffset_SecondaryColor3usvEXT 597 -#define _gloffset_SecondaryColorPointerEXT 598 -#define _gloffset_MultiDrawArraysEXT 599 -#define _gloffset_MultiDrawElementsEXT 600 -#define _gloffset_FogCoordPointerEXT 601 -#define _gloffset_FogCoorddEXT 602 -#define _gloffset_FogCoorddvEXT 603 -#define _gloffset_FogCoordfEXT 604 -#define _gloffset_FogCoordfvEXT 605 -#define _gloffset_PixelTexGenSGIX 606 -#define _gloffset_BlendFuncSeparateEXT 607 -#define _gloffset_FlushVertexArrayRangeNV 608 -#define _gloffset_VertexArrayRangeNV 609 -#define _gloffset_CombinerInputNV 610 -#define _gloffset_CombinerOutputNV 611 -#define _gloffset_CombinerParameterfNV 612 -#define _gloffset_CombinerParameterfvNV 613 -#define _gloffset_CombinerParameteriNV 614 -#define _gloffset_CombinerParameterivNV 615 -#define _gloffset_FinalCombinerInputNV 616 -#define _gloffset_GetCombinerInputParameterfvNV 617 -#define _gloffset_GetCombinerInputParameterivNV 618 -#define _gloffset_GetCombinerOutputParameterfvNV 619 -#define _gloffset_GetCombinerOutputParameterivNV 620 -#define _gloffset_GetFinalCombinerInputParameterfvNV 621 -#define _gloffset_GetFinalCombinerInputParameterivNV 622 -#define _gloffset_ResizeBuffersMESA 623 -#define _gloffset_WindowPos2dMESA 624 -#define _gloffset_WindowPos2dvMESA 625 -#define _gloffset_WindowPos2fMESA 626 -#define _gloffset_WindowPos2fvMESA 627 -#define _gloffset_WindowPos2iMESA 628 -#define _gloffset_WindowPos2ivMESA 629 -#define _gloffset_WindowPos2sMESA 630 -#define _gloffset_WindowPos2svMESA 631 -#define _gloffset_WindowPos3dMESA 632 -#define _gloffset_WindowPos3dvMESA 633 -#define _gloffset_WindowPos3fMESA 634 -#define _gloffset_WindowPos3fvMESA 635 -#define _gloffset_WindowPos3iMESA 636 -#define _gloffset_WindowPos3ivMESA 637 -#define _gloffset_WindowPos3sMESA 638 -#define _gloffset_WindowPos3svMESA 639 -#define _gloffset_WindowPos4dMESA 640 -#define _gloffset_WindowPos4dvMESA 641 -#define _gloffset_WindowPos4fMESA 642 -#define _gloffset_WindowPos4fvMESA 643 -#define _gloffset_WindowPos4iMESA 644 -#define _gloffset_WindowPos4ivMESA 645 -#define _gloffset_WindowPos4sMESA 646 -#define _gloffset_WindowPos4svMESA 647 -#define _gloffset_MultiModeDrawArraysIBM 648 -#define _gloffset_MultiModeDrawElementsIBM 649 -#define _gloffset_DeleteFencesNV 650 -#define _gloffset_FinishFenceNV 651 -#define _gloffset_GenFencesNV 652 -#define _gloffset_GetFenceivNV 653 -#define _gloffset_IsFenceNV 654 -#define _gloffset_SetFenceNV 655 -#define _gloffset_TestFenceNV 656 -#define _gloffset_AreProgramsResidentNV 657 -#define _gloffset_BindProgramNV 658 -#define _gloffset_DeleteProgramsNV 659 -#define _gloffset_ExecuteProgramNV 660 -#define _gloffset_GenProgramsNV 661 -#define _gloffset_GetProgramParameterdvNV 662 -#define _gloffset_GetProgramParameterfvNV 663 -#define _gloffset_GetProgramStringNV 664 -#define _gloffset_GetProgramivNV 665 -#define _gloffset_GetTrackMatrixivNV 666 -#define _gloffset_GetVertexAttribPointervNV 667 -#define _gloffset_GetVertexAttribdvNV 668 -#define _gloffset_GetVertexAttribfvNV 669 -#define _gloffset_GetVertexAttribivNV 670 -#define _gloffset_IsProgramNV 671 -#define _gloffset_LoadProgramNV 672 -#define _gloffset_ProgramParameters4dvNV 673 -#define _gloffset_ProgramParameters4fvNV 674 -#define _gloffset_RequestResidentProgramsNV 675 -#define _gloffset_TrackMatrixNV 676 -#define _gloffset_VertexAttrib1dNV 677 -#define _gloffset_VertexAttrib1dvNV 678 -#define _gloffset_VertexAttrib1fNV 679 -#define _gloffset_VertexAttrib1fvNV 680 -#define _gloffset_VertexAttrib1sNV 681 -#define _gloffset_VertexAttrib1svNV 682 -#define _gloffset_VertexAttrib2dNV 683 -#define _gloffset_VertexAttrib2dvNV 684 -#define _gloffset_VertexAttrib2fNV 685 -#define _gloffset_VertexAttrib2fvNV 686 -#define _gloffset_VertexAttrib2sNV 687 -#define _gloffset_VertexAttrib2svNV 688 -#define _gloffset_VertexAttrib3dNV 689 -#define _gloffset_VertexAttrib3dvNV 690 -#define _gloffset_VertexAttrib3fNV 691 -#define _gloffset_VertexAttrib3fvNV 692 -#define _gloffset_VertexAttrib3sNV 693 -#define _gloffset_VertexAttrib3svNV 694 -#define _gloffset_VertexAttrib4dNV 695 -#define _gloffset_VertexAttrib4dvNV 696 -#define _gloffset_VertexAttrib4fNV 697 -#define _gloffset_VertexAttrib4fvNV 698 -#define _gloffset_VertexAttrib4sNV 699 -#define _gloffset_VertexAttrib4svNV 700 -#define _gloffset_VertexAttrib4ubNV 701 -#define _gloffset_VertexAttrib4ubvNV 702 -#define _gloffset_VertexAttribPointerNV 703 -#define _gloffset_VertexAttribs1dvNV 704 -#define _gloffset_VertexAttribs1fvNV 705 -#define _gloffset_VertexAttribs1svNV 706 -#define _gloffset_VertexAttribs2dvNV 707 -#define _gloffset_VertexAttribs2fvNV 708 -#define _gloffset_VertexAttribs2svNV 709 -#define _gloffset_VertexAttribs3dvNV 710 -#define _gloffset_VertexAttribs3fvNV 711 -#define _gloffset_VertexAttribs3svNV 712 -#define _gloffset_VertexAttribs4dvNV 713 -#define _gloffset_VertexAttribs4fvNV 714 -#define _gloffset_VertexAttribs4svNV 715 -#define _gloffset_VertexAttribs4ubvNV 716 -#define _gloffset_AlphaFragmentOp1ATI 717 -#define _gloffset_AlphaFragmentOp2ATI 718 -#define _gloffset_AlphaFragmentOp3ATI 719 -#define _gloffset_BeginFragmentShaderATI 720 -#define _gloffset_BindFragmentShaderATI 721 -#define _gloffset_ColorFragmentOp1ATI 722 -#define _gloffset_ColorFragmentOp2ATI 723 -#define _gloffset_ColorFragmentOp3ATI 724 -#define _gloffset_DeleteFragmentShaderATI 725 -#define _gloffset_EndFragmentShaderATI 726 -#define _gloffset_GenFragmentShadersATI 727 -#define _gloffset_PassTexCoordATI 728 -#define _gloffset_SampleMapATI 729 -#define _gloffset_SetFragmentShaderConstantATI 730 -#define _gloffset_PointParameteriNV 731 -#define _gloffset_PointParameterivNV 732 -#define _gloffset_ActiveStencilFaceEXT 733 -#define _gloffset_BindVertexArrayAPPLE 734 -#define _gloffset_DeleteVertexArraysAPPLE 735 -#define _gloffset_GenVertexArraysAPPLE 736 -#define _gloffset_IsVertexArrayAPPLE 737 -#define _gloffset_GetProgramNamedParameterdvNV 738 -#define _gloffset_GetProgramNamedParameterfvNV 739 -#define _gloffset_ProgramNamedParameter4dNV 740 -#define _gloffset_ProgramNamedParameter4dvNV 741 -#define _gloffset_ProgramNamedParameter4fNV 742 -#define _gloffset_ProgramNamedParameter4fvNV 743 -#define _gloffset_DepthBoundsEXT 744 -#define _gloffset_BlendEquationSeparateEXT 745 -#define _gloffset_BindFramebufferEXT 746 -#define _gloffset_BindRenderbufferEXT 747 -#define _gloffset_CheckFramebufferStatusEXT 748 -#define _gloffset_DeleteFramebuffersEXT 749 -#define _gloffset_DeleteRenderbuffersEXT 750 -#define _gloffset_FramebufferRenderbufferEXT 751 -#define _gloffset_FramebufferTexture1DEXT 752 -#define _gloffset_FramebufferTexture2DEXT 753 -#define _gloffset_FramebufferTexture3DEXT 754 -#define _gloffset_GenFramebuffersEXT 755 -#define _gloffset_GenRenderbuffersEXT 756 -#define _gloffset_GenerateMipmapEXT 757 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 758 -#define _gloffset_GetRenderbufferParameterivEXT 759 -#define _gloffset_IsFramebufferEXT 760 -#define _gloffset_IsRenderbufferEXT 761 -#define _gloffset_RenderbufferStorageEXT 762 -#define _gloffset_BlitFramebufferEXT 763 -#define _gloffset_FramebufferTextureLayerEXT 764 -#define _gloffset_StencilFuncSeparateATI 765 -#define _gloffset_ProgramEnvParameters4fvEXT 766 -#define _gloffset_ProgramLocalParameters4fvEXT 767 -#define _gloffset_GetQueryObjecti64vEXT 768 -#define _gloffset_GetQueryObjectui64vEXT 769 -#define _gloffset_FIRST_DYNAMIC 770 - -#else - -#define _gloffset_AttachShader driDispatchRemapTable[AttachShader_remap_index] -#define _gloffset_CreateProgram driDispatchRemapTable[CreateProgram_remap_index] -#define _gloffset_CreateShader driDispatchRemapTable[CreateShader_remap_index] -#define _gloffset_DeleteProgram driDispatchRemapTable[DeleteProgram_remap_index] -#define _gloffset_DeleteShader driDispatchRemapTable[DeleteShader_remap_index] -#define _gloffset_DetachShader driDispatchRemapTable[DetachShader_remap_index] -#define _gloffset_GetAttachedShaders driDispatchRemapTable[GetAttachedShaders_remap_index] -#define _gloffset_GetProgramInfoLog driDispatchRemapTable[GetProgramInfoLog_remap_index] -#define _gloffset_GetProgramiv driDispatchRemapTable[GetProgramiv_remap_index] -#define _gloffset_GetShaderInfoLog driDispatchRemapTable[GetShaderInfoLog_remap_index] -#define _gloffset_GetShaderiv driDispatchRemapTable[GetShaderiv_remap_index] -#define _gloffset_IsProgram driDispatchRemapTable[IsProgram_remap_index] -#define _gloffset_IsShader driDispatchRemapTable[IsShader_remap_index] -#define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index] -#define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index] -#define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index] -#define _gloffset_UniformMatrix2x3fv driDispatchRemapTable[UniformMatrix2x3fv_remap_index] -#define _gloffset_UniformMatrix2x4fv driDispatchRemapTable[UniformMatrix2x4fv_remap_index] -#define _gloffset_UniformMatrix3x2fv driDispatchRemapTable[UniformMatrix3x2fv_remap_index] -#define _gloffset_UniformMatrix3x4fv driDispatchRemapTable[UniformMatrix3x4fv_remap_index] -#define _gloffset_UniformMatrix4x2fv driDispatchRemapTable[UniformMatrix4x2fv_remap_index] -#define _gloffset_UniformMatrix4x3fv driDispatchRemapTable[UniformMatrix4x3fv_remap_index] -#define _gloffset_LoadTransposeMatrixdARB driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index] -#define _gloffset_LoadTransposeMatrixfARB driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index] -#define _gloffset_MultTransposeMatrixdARB driDispatchRemapTable[MultTransposeMatrixdARB_remap_index] -#define _gloffset_MultTransposeMatrixfARB driDispatchRemapTable[MultTransposeMatrixfARB_remap_index] -#define _gloffset_SampleCoverageARB driDispatchRemapTable[SampleCoverageARB_remap_index] -#define _gloffset_CompressedTexImage1DARB driDispatchRemapTable[CompressedTexImage1DARB_remap_index] -#define _gloffset_CompressedTexImage2DARB driDispatchRemapTable[CompressedTexImage2DARB_remap_index] -#define _gloffset_CompressedTexImage3DARB driDispatchRemapTable[CompressedTexImage3DARB_remap_index] -#define _gloffset_CompressedTexSubImage1DARB driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index] -#define _gloffset_CompressedTexSubImage2DARB driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index] -#define _gloffset_CompressedTexSubImage3DARB driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index] -#define _gloffset_GetCompressedTexImageARB driDispatchRemapTable[GetCompressedTexImageARB_remap_index] -#define _gloffset_DisableVertexAttribArrayARB driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index] -#define _gloffset_EnableVertexAttribArrayARB driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index] -#define _gloffset_GetProgramEnvParameterdvARB driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index] -#define _gloffset_GetProgramEnvParameterfvARB driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index] -#define _gloffset_GetProgramLocalParameterdvARB driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index] -#define _gloffset_GetProgramLocalParameterfvARB driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index] -#define _gloffset_GetProgramStringARB driDispatchRemapTable[GetProgramStringARB_remap_index] -#define _gloffset_GetProgramivARB driDispatchRemapTable[GetProgramivARB_remap_index] -#define _gloffset_GetVertexAttribdvARB driDispatchRemapTable[GetVertexAttribdvARB_remap_index] -#define _gloffset_GetVertexAttribfvARB driDispatchRemapTable[GetVertexAttribfvARB_remap_index] -#define _gloffset_GetVertexAttribivARB driDispatchRemapTable[GetVertexAttribivARB_remap_index] -#define _gloffset_ProgramEnvParameter4dARB driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index] -#define _gloffset_ProgramEnvParameter4dvARB driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index] -#define _gloffset_ProgramEnvParameter4fARB driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index] -#define _gloffset_ProgramEnvParameter4fvARB driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index] -#define _gloffset_ProgramLocalParameter4dARB driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index] -#define _gloffset_ProgramLocalParameter4dvARB driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index] -#define _gloffset_ProgramLocalParameter4fARB driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index] -#define _gloffset_ProgramLocalParameter4fvARB driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index] -#define _gloffset_ProgramStringARB driDispatchRemapTable[ProgramStringARB_remap_index] -#define _gloffset_VertexAttrib1dARB driDispatchRemapTable[VertexAttrib1dARB_remap_index] -#define _gloffset_VertexAttrib1dvARB driDispatchRemapTable[VertexAttrib1dvARB_remap_index] -#define _gloffset_VertexAttrib1fARB driDispatchRemapTable[VertexAttrib1fARB_remap_index] -#define _gloffset_VertexAttrib1fvARB driDispatchRemapTable[VertexAttrib1fvARB_remap_index] -#define _gloffset_VertexAttrib1sARB driDispatchRemapTable[VertexAttrib1sARB_remap_index] -#define _gloffset_VertexAttrib1svARB driDispatchRemapTable[VertexAttrib1svARB_remap_index] -#define _gloffset_VertexAttrib2dARB driDispatchRemapTable[VertexAttrib2dARB_remap_index] -#define _gloffset_VertexAttrib2dvARB driDispatchRemapTable[VertexAttrib2dvARB_remap_index] -#define _gloffset_VertexAttrib2fARB driDispatchRemapTable[VertexAttrib2fARB_remap_index] -#define _gloffset_VertexAttrib2fvARB driDispatchRemapTable[VertexAttrib2fvARB_remap_index] -#define _gloffset_VertexAttrib2sARB driDispatchRemapTable[VertexAttrib2sARB_remap_index] -#define _gloffset_VertexAttrib2svARB driDispatchRemapTable[VertexAttrib2svARB_remap_index] -#define _gloffset_VertexAttrib3dARB driDispatchRemapTable[VertexAttrib3dARB_remap_index] -#define _gloffset_VertexAttrib3dvARB driDispatchRemapTable[VertexAttrib3dvARB_remap_index] -#define _gloffset_VertexAttrib3fARB driDispatchRemapTable[VertexAttrib3fARB_remap_index] -#define _gloffset_VertexAttrib3fvARB driDispatchRemapTable[VertexAttrib3fvARB_remap_index] -#define _gloffset_VertexAttrib3sARB driDispatchRemapTable[VertexAttrib3sARB_remap_index] -#define _gloffset_VertexAttrib3svARB driDispatchRemapTable[VertexAttrib3svARB_remap_index] -#define _gloffset_VertexAttrib4NbvARB driDispatchRemapTable[VertexAttrib4NbvARB_remap_index] -#define _gloffset_VertexAttrib4NivARB driDispatchRemapTable[VertexAttrib4NivARB_remap_index] -#define _gloffset_VertexAttrib4NsvARB driDispatchRemapTable[VertexAttrib4NsvARB_remap_index] -#define _gloffset_VertexAttrib4NubARB driDispatchRemapTable[VertexAttrib4NubARB_remap_index] -#define _gloffset_VertexAttrib4NubvARB driDispatchRemapTable[VertexAttrib4NubvARB_remap_index] -#define _gloffset_VertexAttrib4NuivARB driDispatchRemapTable[VertexAttrib4NuivARB_remap_index] -#define _gloffset_VertexAttrib4NusvARB driDispatchRemapTable[VertexAttrib4NusvARB_remap_index] -#define _gloffset_VertexAttrib4bvARB driDispatchRemapTable[VertexAttrib4bvARB_remap_index] -#define _gloffset_VertexAttrib4dARB driDispatchRemapTable[VertexAttrib4dARB_remap_index] -#define _gloffset_VertexAttrib4dvARB driDispatchRemapTable[VertexAttrib4dvARB_remap_index] -#define _gloffset_VertexAttrib4fARB driDispatchRemapTable[VertexAttrib4fARB_remap_index] -#define _gloffset_VertexAttrib4fvARB driDispatchRemapTable[VertexAttrib4fvARB_remap_index] -#define _gloffset_VertexAttrib4ivARB driDispatchRemapTable[VertexAttrib4ivARB_remap_index] -#define _gloffset_VertexAttrib4sARB driDispatchRemapTable[VertexAttrib4sARB_remap_index] -#define _gloffset_VertexAttrib4svARB driDispatchRemapTable[VertexAttrib4svARB_remap_index] -#define _gloffset_VertexAttrib4ubvARB driDispatchRemapTable[VertexAttrib4ubvARB_remap_index] -#define _gloffset_VertexAttrib4uivARB driDispatchRemapTable[VertexAttrib4uivARB_remap_index] -#define _gloffset_VertexAttrib4usvARB driDispatchRemapTable[VertexAttrib4usvARB_remap_index] -#define _gloffset_VertexAttribPointerARB driDispatchRemapTable[VertexAttribPointerARB_remap_index] -#define _gloffset_BindBufferARB driDispatchRemapTable[BindBufferARB_remap_index] -#define _gloffset_BufferDataARB driDispatchRemapTable[BufferDataARB_remap_index] -#define _gloffset_BufferSubDataARB driDispatchRemapTable[BufferSubDataARB_remap_index] -#define _gloffset_DeleteBuffersARB driDispatchRemapTable[DeleteBuffersARB_remap_index] -#define _gloffset_GenBuffersARB driDispatchRemapTable[GenBuffersARB_remap_index] -#define _gloffset_GetBufferParameterivARB driDispatchRemapTable[GetBufferParameterivARB_remap_index] -#define _gloffset_GetBufferPointervARB driDispatchRemapTable[GetBufferPointervARB_remap_index] -#define _gloffset_GetBufferSubDataARB driDispatchRemapTable[GetBufferSubDataARB_remap_index] -#define _gloffset_IsBufferARB driDispatchRemapTable[IsBufferARB_remap_index] -#define _gloffset_MapBufferARB driDispatchRemapTable[MapBufferARB_remap_index] -#define _gloffset_UnmapBufferARB driDispatchRemapTable[UnmapBufferARB_remap_index] -#define _gloffset_BeginQueryARB driDispatchRemapTable[BeginQueryARB_remap_index] -#define _gloffset_DeleteQueriesARB driDispatchRemapTable[DeleteQueriesARB_remap_index] -#define _gloffset_EndQueryARB driDispatchRemapTable[EndQueryARB_remap_index] -#define _gloffset_GenQueriesARB driDispatchRemapTable[GenQueriesARB_remap_index] -#define _gloffset_GetQueryObjectivARB driDispatchRemapTable[GetQueryObjectivARB_remap_index] -#define _gloffset_GetQueryObjectuivARB driDispatchRemapTable[GetQueryObjectuivARB_remap_index] -#define _gloffset_GetQueryivARB driDispatchRemapTable[GetQueryivARB_remap_index] -#define _gloffset_IsQueryARB driDispatchRemapTable[IsQueryARB_remap_index] -#define _gloffset_AttachObjectARB driDispatchRemapTable[AttachObjectARB_remap_index] -#define _gloffset_CompileShaderARB driDispatchRemapTable[CompileShaderARB_remap_index] -#define _gloffset_CreateProgramObjectARB driDispatchRemapTable[CreateProgramObjectARB_remap_index] -#define _gloffset_CreateShaderObjectARB driDispatchRemapTable[CreateShaderObjectARB_remap_index] -#define _gloffset_DeleteObjectARB driDispatchRemapTable[DeleteObjectARB_remap_index] -#define _gloffset_DetachObjectARB driDispatchRemapTable[DetachObjectARB_remap_index] -#define _gloffset_GetActiveUniformARB driDispatchRemapTable[GetActiveUniformARB_remap_index] -#define _gloffset_GetAttachedObjectsARB driDispatchRemapTable[GetAttachedObjectsARB_remap_index] -#define _gloffset_GetHandleARB driDispatchRemapTable[GetHandleARB_remap_index] -#define _gloffset_GetInfoLogARB driDispatchRemapTable[GetInfoLogARB_remap_index] -#define _gloffset_GetObjectParameterfvARB driDispatchRemapTable[GetObjectParameterfvARB_remap_index] -#define _gloffset_GetObjectParameterivARB driDispatchRemapTable[GetObjectParameterivARB_remap_index] -#define _gloffset_GetShaderSourceARB driDispatchRemapTable[GetShaderSourceARB_remap_index] -#define _gloffset_GetUniformLocationARB driDispatchRemapTable[GetUniformLocationARB_remap_index] -#define _gloffset_GetUniformfvARB driDispatchRemapTable[GetUniformfvARB_remap_index] -#define _gloffset_GetUniformivARB driDispatchRemapTable[GetUniformivARB_remap_index] -#define _gloffset_LinkProgramARB driDispatchRemapTable[LinkProgramARB_remap_index] -#define _gloffset_ShaderSourceARB driDispatchRemapTable[ShaderSourceARB_remap_index] -#define _gloffset_Uniform1fARB driDispatchRemapTable[Uniform1fARB_remap_index] -#define _gloffset_Uniform1fvARB driDispatchRemapTable[Uniform1fvARB_remap_index] -#define _gloffset_Uniform1iARB driDispatchRemapTable[Uniform1iARB_remap_index] -#define _gloffset_Uniform1ivARB driDispatchRemapTable[Uniform1ivARB_remap_index] -#define _gloffset_Uniform2fARB driDispatchRemapTable[Uniform2fARB_remap_index] -#define _gloffset_Uniform2fvARB driDispatchRemapTable[Uniform2fvARB_remap_index] -#define _gloffset_Uniform2iARB driDispatchRemapTable[Uniform2iARB_remap_index] -#define _gloffset_Uniform2ivARB driDispatchRemapTable[Uniform2ivARB_remap_index] -#define _gloffset_Uniform3fARB driDispatchRemapTable[Uniform3fARB_remap_index] -#define _gloffset_Uniform3fvARB driDispatchRemapTable[Uniform3fvARB_remap_index] -#define _gloffset_Uniform3iARB driDispatchRemapTable[Uniform3iARB_remap_index] -#define _gloffset_Uniform3ivARB driDispatchRemapTable[Uniform3ivARB_remap_index] -#define _gloffset_Uniform4fARB driDispatchRemapTable[Uniform4fARB_remap_index] -#define _gloffset_Uniform4fvARB driDispatchRemapTable[Uniform4fvARB_remap_index] -#define _gloffset_Uniform4iARB driDispatchRemapTable[Uniform4iARB_remap_index] -#define _gloffset_Uniform4ivARB driDispatchRemapTable[Uniform4ivARB_remap_index] -#define _gloffset_UniformMatrix2fvARB driDispatchRemapTable[UniformMatrix2fvARB_remap_index] -#define _gloffset_UniformMatrix3fvARB driDispatchRemapTable[UniformMatrix3fvARB_remap_index] -#define _gloffset_UniformMatrix4fvARB driDispatchRemapTable[UniformMatrix4fvARB_remap_index] -#define _gloffset_UseProgramObjectARB driDispatchRemapTable[UseProgramObjectARB_remap_index] -#define _gloffset_ValidateProgramARB driDispatchRemapTable[ValidateProgramARB_remap_index] -#define _gloffset_BindAttribLocationARB driDispatchRemapTable[BindAttribLocationARB_remap_index] -#define _gloffset_GetActiveAttribARB driDispatchRemapTable[GetActiveAttribARB_remap_index] -#define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index] -#define _gloffset_DrawBuffersARB driDispatchRemapTable[DrawBuffersARB_remap_index] -#define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] -#define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] -#define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] -#define _gloffset_PixelTexGenParameterfSGIS driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index] -#define _gloffset_PixelTexGenParameterfvSGIS driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index] -#define _gloffset_PixelTexGenParameteriSGIS driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index] -#define _gloffset_PixelTexGenParameterivSGIS driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index] -#define _gloffset_SampleMaskSGIS driDispatchRemapTable[SampleMaskSGIS_remap_index] -#define _gloffset_SamplePatternSGIS driDispatchRemapTable[SamplePatternSGIS_remap_index] -#define _gloffset_ColorPointerEXT driDispatchRemapTable[ColorPointerEXT_remap_index] -#define _gloffset_EdgeFlagPointerEXT driDispatchRemapTable[EdgeFlagPointerEXT_remap_index] -#define _gloffset_IndexPointerEXT driDispatchRemapTable[IndexPointerEXT_remap_index] -#define _gloffset_NormalPointerEXT driDispatchRemapTable[NormalPointerEXT_remap_index] -#define _gloffset_TexCoordPointerEXT driDispatchRemapTable[TexCoordPointerEXT_remap_index] -#define _gloffset_VertexPointerEXT driDispatchRemapTable[VertexPointerEXT_remap_index] -#define _gloffset_PointParameterfEXT driDispatchRemapTable[PointParameterfEXT_remap_index] -#define _gloffset_PointParameterfvEXT driDispatchRemapTable[PointParameterfvEXT_remap_index] -#define _gloffset_LockArraysEXT driDispatchRemapTable[LockArraysEXT_remap_index] -#define _gloffset_UnlockArraysEXT driDispatchRemapTable[UnlockArraysEXT_remap_index] -#define _gloffset_CullParameterdvEXT driDispatchRemapTable[CullParameterdvEXT_remap_index] -#define _gloffset_CullParameterfvEXT driDispatchRemapTable[CullParameterfvEXT_remap_index] -#define _gloffset_SecondaryColor3bEXT driDispatchRemapTable[SecondaryColor3bEXT_remap_index] -#define _gloffset_SecondaryColor3bvEXT driDispatchRemapTable[SecondaryColor3bvEXT_remap_index] -#define _gloffset_SecondaryColor3dEXT driDispatchRemapTable[SecondaryColor3dEXT_remap_index] -#define _gloffset_SecondaryColor3dvEXT driDispatchRemapTable[SecondaryColor3dvEXT_remap_index] -#define _gloffset_SecondaryColor3fEXT driDispatchRemapTable[SecondaryColor3fEXT_remap_index] -#define _gloffset_SecondaryColor3fvEXT driDispatchRemapTable[SecondaryColor3fvEXT_remap_index] -#define _gloffset_SecondaryColor3iEXT driDispatchRemapTable[SecondaryColor3iEXT_remap_index] -#define _gloffset_SecondaryColor3ivEXT driDispatchRemapTable[SecondaryColor3ivEXT_remap_index] -#define _gloffset_SecondaryColor3sEXT driDispatchRemapTable[SecondaryColor3sEXT_remap_index] -#define _gloffset_SecondaryColor3svEXT driDispatchRemapTable[SecondaryColor3svEXT_remap_index] -#define _gloffset_SecondaryColor3ubEXT driDispatchRemapTable[SecondaryColor3ubEXT_remap_index] -#define _gloffset_SecondaryColor3ubvEXT driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index] -#define _gloffset_SecondaryColor3uiEXT driDispatchRemapTable[SecondaryColor3uiEXT_remap_index] -#define _gloffset_SecondaryColor3uivEXT driDispatchRemapTable[SecondaryColor3uivEXT_remap_index] -#define _gloffset_SecondaryColor3usEXT driDispatchRemapTable[SecondaryColor3usEXT_remap_index] -#define _gloffset_SecondaryColor3usvEXT driDispatchRemapTable[SecondaryColor3usvEXT_remap_index] -#define _gloffset_SecondaryColorPointerEXT driDispatchRemapTable[SecondaryColorPointerEXT_remap_index] -#define _gloffset_MultiDrawArraysEXT driDispatchRemapTable[MultiDrawArraysEXT_remap_index] -#define _gloffset_MultiDrawElementsEXT driDispatchRemapTable[MultiDrawElementsEXT_remap_index] -#define _gloffset_FogCoordPointerEXT driDispatchRemapTable[FogCoordPointerEXT_remap_index] -#define _gloffset_FogCoorddEXT driDispatchRemapTable[FogCoorddEXT_remap_index] -#define _gloffset_FogCoorddvEXT driDispatchRemapTable[FogCoorddvEXT_remap_index] -#define _gloffset_FogCoordfEXT driDispatchRemapTable[FogCoordfEXT_remap_index] -#define _gloffset_FogCoordfvEXT driDispatchRemapTable[FogCoordfvEXT_remap_index] -#define _gloffset_PixelTexGenSGIX driDispatchRemapTable[PixelTexGenSGIX_remap_index] -#define _gloffset_BlendFuncSeparateEXT driDispatchRemapTable[BlendFuncSeparateEXT_remap_index] -#define _gloffset_FlushVertexArrayRangeNV driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index] -#define _gloffset_VertexArrayRangeNV driDispatchRemapTable[VertexArrayRangeNV_remap_index] -#define _gloffset_CombinerInputNV driDispatchRemapTable[CombinerInputNV_remap_index] -#define _gloffset_CombinerOutputNV driDispatchRemapTable[CombinerOutputNV_remap_index] -#define _gloffset_CombinerParameterfNV driDispatchRemapTable[CombinerParameterfNV_remap_index] -#define _gloffset_CombinerParameterfvNV driDispatchRemapTable[CombinerParameterfvNV_remap_index] -#define _gloffset_CombinerParameteriNV driDispatchRemapTable[CombinerParameteriNV_remap_index] -#define _gloffset_CombinerParameterivNV driDispatchRemapTable[CombinerParameterivNV_remap_index] -#define _gloffset_FinalCombinerInputNV driDispatchRemapTable[FinalCombinerInputNV_remap_index] -#define _gloffset_GetCombinerInputParameterfvNV driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index] -#define _gloffset_GetCombinerInputParameterivNV driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index] -#define _gloffset_GetCombinerOutputParameterfvNV driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index] -#define _gloffset_GetCombinerOutputParameterivNV driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index] -#define _gloffset_GetFinalCombinerInputParameterfvNV driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index] -#define _gloffset_GetFinalCombinerInputParameterivNV driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index] -#define _gloffset_ResizeBuffersMESA driDispatchRemapTable[ResizeBuffersMESA_remap_index] -#define _gloffset_WindowPos2dMESA driDispatchRemapTable[WindowPos2dMESA_remap_index] -#define _gloffset_WindowPos2dvMESA driDispatchRemapTable[WindowPos2dvMESA_remap_index] -#define _gloffset_WindowPos2fMESA driDispatchRemapTable[WindowPos2fMESA_remap_index] -#define _gloffset_WindowPos2fvMESA driDispatchRemapTable[WindowPos2fvMESA_remap_index] -#define _gloffset_WindowPos2iMESA driDispatchRemapTable[WindowPos2iMESA_remap_index] -#define _gloffset_WindowPos2ivMESA driDispatchRemapTable[WindowPos2ivMESA_remap_index] -#define _gloffset_WindowPos2sMESA driDispatchRemapTable[WindowPos2sMESA_remap_index] -#define _gloffset_WindowPos2svMESA driDispatchRemapTable[WindowPos2svMESA_remap_index] -#define _gloffset_WindowPos3dMESA driDispatchRemapTable[WindowPos3dMESA_remap_index] -#define _gloffset_WindowPos3dvMESA driDispatchRemapTable[WindowPos3dvMESA_remap_index] -#define _gloffset_WindowPos3fMESA driDispatchRemapTable[WindowPos3fMESA_remap_index] -#define _gloffset_WindowPos3fvMESA driDispatchRemapTable[WindowPos3fvMESA_remap_index] -#define _gloffset_WindowPos3iMESA driDispatchRemapTable[WindowPos3iMESA_remap_index] -#define _gloffset_WindowPos3ivMESA driDispatchRemapTable[WindowPos3ivMESA_remap_index] -#define _gloffset_WindowPos3sMESA driDispatchRemapTable[WindowPos3sMESA_remap_index] -#define _gloffset_WindowPos3svMESA driDispatchRemapTable[WindowPos3svMESA_remap_index] -#define _gloffset_WindowPos4dMESA driDispatchRemapTable[WindowPos4dMESA_remap_index] -#define _gloffset_WindowPos4dvMESA driDispatchRemapTable[WindowPos4dvMESA_remap_index] -#define _gloffset_WindowPos4fMESA driDispatchRemapTable[WindowPos4fMESA_remap_index] -#define _gloffset_WindowPos4fvMESA driDispatchRemapTable[WindowPos4fvMESA_remap_index] -#define _gloffset_WindowPos4iMESA driDispatchRemapTable[WindowPos4iMESA_remap_index] -#define _gloffset_WindowPos4ivMESA driDispatchRemapTable[WindowPos4ivMESA_remap_index] -#define _gloffset_WindowPos4sMESA driDispatchRemapTable[WindowPos4sMESA_remap_index] -#define _gloffset_WindowPos4svMESA driDispatchRemapTable[WindowPos4svMESA_remap_index] -#define _gloffset_MultiModeDrawArraysIBM driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index] -#define _gloffset_MultiModeDrawElementsIBM driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index] -#define _gloffset_DeleteFencesNV driDispatchRemapTable[DeleteFencesNV_remap_index] -#define _gloffset_FinishFenceNV driDispatchRemapTable[FinishFenceNV_remap_index] -#define _gloffset_GenFencesNV driDispatchRemapTable[GenFencesNV_remap_index] -#define _gloffset_GetFenceivNV driDispatchRemapTable[GetFenceivNV_remap_index] -#define _gloffset_IsFenceNV driDispatchRemapTable[IsFenceNV_remap_index] -#define _gloffset_SetFenceNV driDispatchRemapTable[SetFenceNV_remap_index] -#define _gloffset_TestFenceNV driDispatchRemapTable[TestFenceNV_remap_index] -#define _gloffset_AreProgramsResidentNV driDispatchRemapTable[AreProgramsResidentNV_remap_index] -#define _gloffset_BindProgramNV driDispatchRemapTable[BindProgramNV_remap_index] -#define _gloffset_DeleteProgramsNV driDispatchRemapTable[DeleteProgramsNV_remap_index] -#define _gloffset_ExecuteProgramNV driDispatchRemapTable[ExecuteProgramNV_remap_index] -#define _gloffset_GenProgramsNV driDispatchRemapTable[GenProgramsNV_remap_index] -#define _gloffset_GetProgramParameterdvNV driDispatchRemapTable[GetProgramParameterdvNV_remap_index] -#define _gloffset_GetProgramParameterfvNV driDispatchRemapTable[GetProgramParameterfvNV_remap_index] -#define _gloffset_GetProgramStringNV driDispatchRemapTable[GetProgramStringNV_remap_index] -#define _gloffset_GetProgramivNV driDispatchRemapTable[GetProgramivNV_remap_index] -#define _gloffset_GetTrackMatrixivNV driDispatchRemapTable[GetTrackMatrixivNV_remap_index] -#define _gloffset_GetVertexAttribPointervNV driDispatchRemapTable[GetVertexAttribPointervNV_remap_index] -#define _gloffset_GetVertexAttribdvNV driDispatchRemapTable[GetVertexAttribdvNV_remap_index] -#define _gloffset_GetVertexAttribfvNV driDispatchRemapTable[GetVertexAttribfvNV_remap_index] -#define _gloffset_GetVertexAttribivNV driDispatchRemapTable[GetVertexAttribivNV_remap_index] -#define _gloffset_IsProgramNV driDispatchRemapTable[IsProgramNV_remap_index] -#define _gloffset_LoadProgramNV driDispatchRemapTable[LoadProgramNV_remap_index] -#define _gloffset_ProgramParameters4dvNV driDispatchRemapTable[ProgramParameters4dvNV_remap_index] -#define _gloffset_ProgramParameters4fvNV driDispatchRemapTable[ProgramParameters4fvNV_remap_index] -#define _gloffset_RequestResidentProgramsNV driDispatchRemapTable[RequestResidentProgramsNV_remap_index] -#define _gloffset_TrackMatrixNV driDispatchRemapTable[TrackMatrixNV_remap_index] -#define _gloffset_VertexAttrib1dNV driDispatchRemapTable[VertexAttrib1dNV_remap_index] -#define _gloffset_VertexAttrib1dvNV driDispatchRemapTable[VertexAttrib1dvNV_remap_index] -#define _gloffset_VertexAttrib1fNV driDispatchRemapTable[VertexAttrib1fNV_remap_index] -#define _gloffset_VertexAttrib1fvNV driDispatchRemapTable[VertexAttrib1fvNV_remap_index] -#define _gloffset_VertexAttrib1sNV driDispatchRemapTable[VertexAttrib1sNV_remap_index] -#define _gloffset_VertexAttrib1svNV driDispatchRemapTable[VertexAttrib1svNV_remap_index] -#define _gloffset_VertexAttrib2dNV driDispatchRemapTable[VertexAttrib2dNV_remap_index] -#define _gloffset_VertexAttrib2dvNV driDispatchRemapTable[VertexAttrib2dvNV_remap_index] -#define _gloffset_VertexAttrib2fNV driDispatchRemapTable[VertexAttrib2fNV_remap_index] -#define _gloffset_VertexAttrib2fvNV driDispatchRemapTable[VertexAttrib2fvNV_remap_index] -#define _gloffset_VertexAttrib2sNV driDispatchRemapTable[VertexAttrib2sNV_remap_index] -#define _gloffset_VertexAttrib2svNV driDispatchRemapTable[VertexAttrib2svNV_remap_index] -#define _gloffset_VertexAttrib3dNV driDispatchRemapTable[VertexAttrib3dNV_remap_index] -#define _gloffset_VertexAttrib3dvNV driDispatchRemapTable[VertexAttrib3dvNV_remap_index] -#define _gloffset_VertexAttrib3fNV driDispatchRemapTable[VertexAttrib3fNV_remap_index] -#define _gloffset_VertexAttrib3fvNV driDispatchRemapTable[VertexAttrib3fvNV_remap_index] -#define _gloffset_VertexAttrib3sNV driDispatchRemapTable[VertexAttrib3sNV_remap_index] -#define _gloffset_VertexAttrib3svNV driDispatchRemapTable[VertexAttrib3svNV_remap_index] -#define _gloffset_VertexAttrib4dNV driDispatchRemapTable[VertexAttrib4dNV_remap_index] -#define _gloffset_VertexAttrib4dvNV driDispatchRemapTable[VertexAttrib4dvNV_remap_index] -#define _gloffset_VertexAttrib4fNV driDispatchRemapTable[VertexAttrib4fNV_remap_index] -#define _gloffset_VertexAttrib4fvNV driDispatchRemapTable[VertexAttrib4fvNV_remap_index] -#define _gloffset_VertexAttrib4sNV driDispatchRemapTable[VertexAttrib4sNV_remap_index] -#define _gloffset_VertexAttrib4svNV driDispatchRemapTable[VertexAttrib4svNV_remap_index] -#define _gloffset_VertexAttrib4ubNV driDispatchRemapTable[VertexAttrib4ubNV_remap_index] -#define _gloffset_VertexAttrib4ubvNV driDispatchRemapTable[VertexAttrib4ubvNV_remap_index] -#define _gloffset_VertexAttribPointerNV driDispatchRemapTable[VertexAttribPointerNV_remap_index] -#define _gloffset_VertexAttribs1dvNV driDispatchRemapTable[VertexAttribs1dvNV_remap_index] -#define _gloffset_VertexAttribs1fvNV driDispatchRemapTable[VertexAttribs1fvNV_remap_index] -#define _gloffset_VertexAttribs1svNV driDispatchRemapTable[VertexAttribs1svNV_remap_index] -#define _gloffset_VertexAttribs2dvNV driDispatchRemapTable[VertexAttribs2dvNV_remap_index] -#define _gloffset_VertexAttribs2fvNV driDispatchRemapTable[VertexAttribs2fvNV_remap_index] -#define _gloffset_VertexAttribs2svNV driDispatchRemapTable[VertexAttribs2svNV_remap_index] -#define _gloffset_VertexAttribs3dvNV driDispatchRemapTable[VertexAttribs3dvNV_remap_index] -#define _gloffset_VertexAttribs3fvNV driDispatchRemapTable[VertexAttribs3fvNV_remap_index] -#define _gloffset_VertexAttribs3svNV driDispatchRemapTable[VertexAttribs3svNV_remap_index] -#define _gloffset_VertexAttribs4dvNV driDispatchRemapTable[VertexAttribs4dvNV_remap_index] -#define _gloffset_VertexAttribs4fvNV driDispatchRemapTable[VertexAttribs4fvNV_remap_index] -#define _gloffset_VertexAttribs4svNV driDispatchRemapTable[VertexAttribs4svNV_remap_index] -#define _gloffset_VertexAttribs4ubvNV driDispatchRemapTable[VertexAttribs4ubvNV_remap_index] -#define _gloffset_AlphaFragmentOp1ATI driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index] -#define _gloffset_AlphaFragmentOp2ATI driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index] -#define _gloffset_AlphaFragmentOp3ATI driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index] -#define _gloffset_BeginFragmentShaderATI driDispatchRemapTable[BeginFragmentShaderATI_remap_index] -#define _gloffset_BindFragmentShaderATI driDispatchRemapTable[BindFragmentShaderATI_remap_index] -#define _gloffset_ColorFragmentOp1ATI driDispatchRemapTable[ColorFragmentOp1ATI_remap_index] -#define _gloffset_ColorFragmentOp2ATI driDispatchRemapTable[ColorFragmentOp2ATI_remap_index] -#define _gloffset_ColorFragmentOp3ATI driDispatchRemapTable[ColorFragmentOp3ATI_remap_index] -#define _gloffset_DeleteFragmentShaderATI driDispatchRemapTable[DeleteFragmentShaderATI_remap_index] -#define _gloffset_EndFragmentShaderATI driDispatchRemapTable[EndFragmentShaderATI_remap_index] -#define _gloffset_GenFragmentShadersATI driDispatchRemapTable[GenFragmentShadersATI_remap_index] -#define _gloffset_PassTexCoordATI driDispatchRemapTable[PassTexCoordATI_remap_index] -#define _gloffset_SampleMapATI driDispatchRemapTable[SampleMapATI_remap_index] -#define _gloffset_SetFragmentShaderConstantATI driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index] -#define _gloffset_PointParameteriNV driDispatchRemapTable[PointParameteriNV_remap_index] -#define _gloffset_PointParameterivNV driDispatchRemapTable[PointParameterivNV_remap_index] -#define _gloffset_ActiveStencilFaceEXT driDispatchRemapTable[ActiveStencilFaceEXT_remap_index] -#define _gloffset_BindVertexArrayAPPLE driDispatchRemapTable[BindVertexArrayAPPLE_remap_index] -#define _gloffset_DeleteVertexArraysAPPLE driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index] -#define _gloffset_GenVertexArraysAPPLE driDispatchRemapTable[GenVertexArraysAPPLE_remap_index] -#define _gloffset_IsVertexArrayAPPLE driDispatchRemapTable[IsVertexArrayAPPLE_remap_index] -#define _gloffset_GetProgramNamedParameterdvNV driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index] -#define _gloffset_GetProgramNamedParameterfvNV driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index] -#define _gloffset_ProgramNamedParameter4dNV driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index] -#define _gloffset_ProgramNamedParameter4dvNV driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index] -#define _gloffset_ProgramNamedParameter4fNV driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index] -#define _gloffset_ProgramNamedParameter4fvNV driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index] -#define _gloffset_DepthBoundsEXT driDispatchRemapTable[DepthBoundsEXT_remap_index] -#define _gloffset_BlendEquationSeparateEXT driDispatchRemapTable[BlendEquationSeparateEXT_remap_index] -#define _gloffset_BindFramebufferEXT driDispatchRemapTable[BindFramebufferEXT_remap_index] -#define _gloffset_BindRenderbufferEXT driDispatchRemapTable[BindRenderbufferEXT_remap_index] -#define _gloffset_CheckFramebufferStatusEXT driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index] -#define _gloffset_DeleteFramebuffersEXT driDispatchRemapTable[DeleteFramebuffersEXT_remap_index] -#define _gloffset_DeleteRenderbuffersEXT driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index] -#define _gloffset_FramebufferRenderbufferEXT driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index] -#define _gloffset_FramebufferTexture1DEXT driDispatchRemapTable[FramebufferTexture1DEXT_remap_index] -#define _gloffset_FramebufferTexture2DEXT driDispatchRemapTable[FramebufferTexture2DEXT_remap_index] -#define _gloffset_FramebufferTexture3DEXT driDispatchRemapTable[FramebufferTexture3DEXT_remap_index] -#define _gloffset_GenFramebuffersEXT driDispatchRemapTable[GenFramebuffersEXT_remap_index] -#define _gloffset_GenRenderbuffersEXT driDispatchRemapTable[GenRenderbuffersEXT_remap_index] -#define _gloffset_GenerateMipmapEXT driDispatchRemapTable[GenerateMipmapEXT_remap_index] -#define _gloffset_GetFramebufferAttachmentParameterivEXT driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index] -#define _gloffset_GetRenderbufferParameterivEXT driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index] -#define _gloffset_IsFramebufferEXT driDispatchRemapTable[IsFramebufferEXT_remap_index] -#define _gloffset_IsRenderbufferEXT driDispatchRemapTable[IsRenderbufferEXT_remap_index] -#define _gloffset_RenderbufferStorageEXT driDispatchRemapTable[RenderbufferStorageEXT_remap_index] -#define _gloffset_BlitFramebufferEXT driDispatchRemapTable[BlitFramebufferEXT_remap_index] -#define _gloffset_FramebufferTextureLayerEXT driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index] -#define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index] -#define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index] -#define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] -#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] -#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] - -#endif /* !defined(IN_DRI_DRIVER) */ - -#endif /* !defined( _GLAPI_OFFSETS_H_ ) */ diff --git a/src/libs/mesa/mesa/glapi/glapitable.h b/src/libs/mesa/mesa/glapi/glapitable.h deleted file mode 100644 index 5d9d40a8a2..0000000000 --- a/src/libs/mesa/mesa/glapi/glapitable.h +++ /dev/null @@ -1,815 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR 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. - */ - -#if !defined( _GLAPI_TABLE_H_ ) -# define _GLAPI_TABLE_H_ - -#ifndef GLAPIENTRYP -# ifndef GLAPIENTRY -# define GLAPIENTRY -# endif - -# define GLAPIENTRYP GLAPIENTRY * -#endif - - -struct _glapi_table -{ - void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */ - void (GLAPIENTRYP EndList)(void); /* 1 */ - void (GLAPIENTRYP CallList)(GLuint list); /* 2 */ - void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */ - void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */ - GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */ - void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */ - void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */ - void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */ - void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */ - void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */ - void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */ - void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */ - void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */ - void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */ - void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */ - void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */ - void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */ - void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */ - void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */ - void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */ - void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */ - void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */ - void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */ - void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */ - void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */ - void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */ - void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */ - void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */ - void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */ - void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */ - void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */ - void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */ - void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */ - void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */ - void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */ - void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */ - void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */ - void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */ - void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */ - void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */ - void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */ - void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */ - void (GLAPIENTRYP End)(void); /* 43 */ - void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */ - void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */ - void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */ - void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */ - void (GLAPIENTRYP Indexi)(GLint c); /* 48 */ - void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */ - void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */ - void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */ - void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */ - void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */ - void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */ - void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */ - void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */ - void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */ - void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */ - void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */ - void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */ - void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */ - void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */ - void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */ - void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */ - void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */ - void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */ - void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */ - void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */ - void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */ - void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */ - void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */ - void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */ - void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */ - void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */ - void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */ - void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */ - void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */ - void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */ - void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */ - void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */ - void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */ - void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */ - void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */ - void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */ - void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */ - void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */ - void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */ - void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */ - void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */ - void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */ - void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */ - void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */ - void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */ - void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */ - void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */ - void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */ - void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */ - void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */ - void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */ - void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */ - void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */ - void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */ - void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */ - void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */ - void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */ - void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */ - void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */ - void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */ - void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */ - void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */ - void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */ - void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */ - void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */ - void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */ - void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */ - void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */ - void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */ - void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */ - void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */ - void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */ - void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */ - void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */ - void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */ - void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */ - void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */ - void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */ - void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */ - void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */ - void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */ - void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */ - void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */ - void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */ - void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */ - void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */ - void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */ - void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */ - void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */ - void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */ - void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */ - void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */ - void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */ - void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */ - void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */ - void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */ - void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */ - void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */ - void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */ - void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */ - void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */ - void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */ - void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */ - void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */ - void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */ - void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */ - void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */ - void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */ - void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */ - void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */ - void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */ - void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */ - void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */ - void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */ - void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */ - void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */ - void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */ - void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */ - void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */ - void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */ - void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */ - void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */ - void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */ - void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */ - void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */ - void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */ - void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */ - void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */ - void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */ - void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */ - void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */ - void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */ - void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */ - void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */ - void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */ - void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */ - void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */ - void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */ - void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */ - void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */ - void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */ - void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */ - void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */ - void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */ - void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */ - void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */ - void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */ - GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */ - void (GLAPIENTRYP InitNames)(void); /* 197 */ - void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */ - void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */ - void (GLAPIENTRYP PopName)(void); /* 200 */ - void (GLAPIENTRYP PushName)(GLuint name); /* 201 */ - void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */ - void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */ - void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */ - void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */ - void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */ - void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */ - void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */ - void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */ - void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */ - void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */ - void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */ - void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */ - void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */ - void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */ - void (GLAPIENTRYP Finish)(void); /* 216 */ - void (GLAPIENTRYP Flush)(void); /* 217 */ - void (GLAPIENTRYP PopAttrib)(void); /* 218 */ - void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */ - void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */ - void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */ - void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */ - void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */ - void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */ - void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */ - void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */ - void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */ - void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */ - void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */ - void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */ - void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */ - void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */ - void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */ - void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */ - void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */ - void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */ - void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */ - void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */ - void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */ - void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */ - void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */ - void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */ - void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */ - void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */ - void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */ - void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */ - void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */ - void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */ - void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */ - void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */ - void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */ - void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */ - void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */ - void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */ - void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */ - void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */ - void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */ - void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */ - void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */ - void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */ - GLenum (GLAPIENTRYP GetError)(void); /* 261 */ - void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */ - void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */ - void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */ - void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */ - void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */ - void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */ - void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */ - void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */ - void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */ - void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */ - void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */ - void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */ - void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */ - const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */ - void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */ - void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */ - void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */ - void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */ - void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */ - void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */ - void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */ - void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */ - void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */ - void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */ - GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */ - GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */ - void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */ - void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */ - void (GLAPIENTRYP LoadIdentity)(void); /* 290 */ - void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */ - void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */ - void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */ - void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */ - void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */ - void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */ - void (GLAPIENTRYP PopMatrix)(void); /* 297 */ - void (GLAPIENTRYP PushMatrix)(void); /* 298 */ - void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */ - void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */ - void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */ - void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */ - void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */ - void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */ - void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */ - void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */ - void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */ - void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */ - void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */ - void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */ - void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */ - void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */ - void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */ - void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */ - void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */ - void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */ - void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */ - void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */ - void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */ - void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */ - void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */ - GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */ - void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */ - void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */ - void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */ - void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */ - void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */ - void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */ - void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */ - GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */ - void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */ - void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */ - void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */ - void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */ - void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */ - void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */ - void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */ - void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */ - void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */ - void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */ - void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */ - void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */ - void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */ - void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */ - void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */ - void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */ - void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */ - void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */ - void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */ - void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */ - void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */ - void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */ - void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */ - void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */ - void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */ - void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */ - void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */ - void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */ - void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */ - void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */ - void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */ - void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */ - void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */ - void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */ - void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */ - void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */ - void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */ - void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */ - void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */ - void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */ - void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */ - void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */ - void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */ - void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */ - void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */ - void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */ - void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */ - void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */ - void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */ - void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */ - void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */ - void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */ - void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */ - void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */ - void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */ - void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */ - void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */ - void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */ - void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */ - void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */ - void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */ - void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */ - void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */ - void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */ - void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */ - void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */ - void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */ - void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */ - void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */ - void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */ - void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */ - void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */ - void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */ - void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */ - void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */ - void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */ - void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */ - void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */ - GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */ - GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */ - void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */ - void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */ - void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */ - void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */ - void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */ - void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */ - void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */ - void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */ - GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */ - GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */ - void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */ - void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */ - void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */ - void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */ - void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */ - void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */ - void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */ - void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */ - void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */ - void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */ - void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */ - void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */ - void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */ - void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */ - void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */ - void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */ - void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */ - void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */ - void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */ - void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */ - void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */ - void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */ - void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */ - void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */ - void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */ - void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */ - void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */ - void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */ - void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */ - void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */ - void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */ - void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */ - void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */ - void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */ - void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */ - void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */ - void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */ - void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */ - void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */ - void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */ - void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */ - void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */ - void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */ - void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */ - void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */ - void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */ - void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */ - void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */ - void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */ - void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */ - void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */ - void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */ - void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */ - void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */ - void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */ - void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */ - void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */ - void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */ - void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */ - void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */ - void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */ - void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */ - void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */ - void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */ - void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */ - void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */ - void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */ - void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */ - void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */ - void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */ - void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */ - void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */ - void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */ - void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */ - void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */ - void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */ - void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */ - void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */ - void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */ - void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */ - void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */ - void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */ - void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */ - void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */ - void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */ - void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */ - GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */ - GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */ - GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */ - void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */ - void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */ - void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */ - void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */ - void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */ - void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */ - void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */ - GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */ - void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */ - void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */ - GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */ - GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */ - void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */ - void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */ - void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */ - void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */ - GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */ - void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */ - void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */ - void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */ - void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */ - GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */ - void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */ - void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */ - void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */ - void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */ - void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */ - void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */ - void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */ - void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */ - void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */ - void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */ - void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */ - void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */ - void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */ - void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */ - void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */ - void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */ - void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */ - void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */ - void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */ - void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */ - void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */ - void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */ - void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */ - void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */ - void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */ - void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */ - void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */ - GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */ - void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */ - void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */ - void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */ - void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */ - void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */ - void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */ - void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */ - void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */ - void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */ - void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */ - void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */ - void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */ - void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */ - void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */ - void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */ - void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */ - void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */ - void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */ - void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */ - void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */ - void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */ - void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */ - void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */ - void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */ - void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */ - void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */ - void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */ - void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */ - void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */ - void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */ - void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */ - void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */ - void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */ - void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */ - void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */ - void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */ - void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */ - void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */ - void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */ - void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */ - void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */ - void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */ - void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */ - void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */ - void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */ - void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */ - void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */ - void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */ - void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */ - void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */ - void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */ - void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */ - void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */ - void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */ - void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */ - void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */ - void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */ - void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */ - void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */ - void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */ - void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */ - void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */ - void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */ - void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */ - void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */ - void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */ - void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */ - void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */ - void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */ - void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */ - void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */ - void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */ - void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */ - void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */ - void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */ - void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */ - void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */ - void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */ - void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */ - void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */ - void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */ - void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */ - void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */ - void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */ - void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */ - void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */ - void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */ - void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */ - void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */ - void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */ - void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */ - void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */ - GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */ - void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */ - GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */ - GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */ - void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */ - void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */ - void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */ - void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */ - void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */ - void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */ - void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */ - void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */ - void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */ - void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 667 */ - void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */ - void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */ - void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */ - GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */ - void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */ - void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */ - void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */ - void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */ - void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */ - void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */ - void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */ - void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */ - void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */ - void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */ - void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */ - void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */ - void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */ - void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */ - void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */ - void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */ - void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */ - void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */ - void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */ - void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */ - void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */ - void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */ - void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */ - void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */ - void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */ - void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */ - void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */ - void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */ - void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */ - void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */ - void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */ - void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */ - void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */ - void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */ - void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */ - void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */ - void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */ - void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */ - void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */ - void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */ - void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */ - void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */ - void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */ - void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */ - void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */ - void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */ - void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */ - void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */ - void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */ - void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */ - void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */ - void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */ - void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */ - void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */ - void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */ - GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */ - void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */ - void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */ - void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */ - void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */ - void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */ - void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */ - void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */ - void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */ - void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */ - GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */ - void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */ - void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */ - void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */ - void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */ - void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */ - void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */ - void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */ - void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */ - void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */ - void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */ - GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */ - void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */ - void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */ - void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */ - void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */ - void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */ - void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */ - void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */ - void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */ - void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */ - void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */ - void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */ - GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */ - GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */ - void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */ - void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */ - void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */ - void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */ -}; - -#endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/libs/mesa/mesa/glapi/glapitemp.h b/src/libs/mesa/mesa/glapi/glapitemp.h deleted file mode 100644 index 09259f4704..0000000000 --- a/src/libs/mesa/mesa/glapi/glapitemp.h +++ /dev/null @@ -1,6655 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR 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. - */ - - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define HIDDEN __attribute__((visibility("hidden"))) -# else -# define HIDDEN -# endif - -/* - * 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 is 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 - * - */ - - -#if defined( NAME ) -#ifndef KEYWORD1 -#define KEYWORD1 -#endif - -#ifndef KEYWORD1_ALT -#define KEYWORD1_ALT HIDDEN -#endif - -#ifndef KEYWORD2 -#define KEYWORD2 -#endif - -#ifndef DISPATCH -#error DISPATCH must be defined -#endif - -#ifndef RETURN_DISPATCH -#error RETURN_DISPATCH must be defined -#endif - - -KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) -{ - DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(EndList)(void) -{ - DISPATCH(EndList, (), (F, "glEndList();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list) -{ - DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists) -{ - DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range) -{ - DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range) -{ - RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base) -{ - DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base)); -} - -KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode) -{ - DISPATCH(Begin, (mode), (F, "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), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v) -{ - DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v) -{ - DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v) -{ - DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v) -{ - DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v) -{ - DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v) -{ - DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v) -{ - DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v) -{ - DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) -{ - DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v) -{ - DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) -{ - DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v) -{ - DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v) -{ - DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha) -{ - DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v) -{ - DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha) -{ - DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v) -{ - DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) -{ - DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v) -{ - DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha) -{ - DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v) -{ - DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha) -{ - DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v) -{ - DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag) -{ - DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag) -{ - DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag)); -} - -KEYWORD1 void KEYWORD2 NAME(End)(void) -{ - DISPATCH(End, (), (F, "glEnd();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c) -{ - DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c) -{ - DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c) -{ - DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c) -{ - DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c) -{ - DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c) -{ - DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c) -{ - DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c) -{ - DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz) -{ - DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v) -{ - DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz) -{ - DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v) -{ - DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz) -{ - DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v) -{ - DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz) -{ - DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v) -{ - DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz) -{ - DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v) -{ - DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v) -{ - DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v) -{ - DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y) -{ - DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v) -{ - DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y) -{ - DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v) -{ - DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v) -{ - DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v) -{ - DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v) -{ - DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v) -{ - DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v) -{ - DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v) -{ - DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v) -{ - DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v) -{ - DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) -{ - DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2) -{ - DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2) -{ - DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2) -{ - DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2) -{ - DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2) -{ - DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2) -{ - DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s) -{ - DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v) -{ - DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s) -{ - DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v) -{ - DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s) -{ - DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v) -{ - DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s) -{ - DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v) -{ - DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t) -{ - DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v) -{ - DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t) -{ - DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v) -{ - DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t) -{ - DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v) -{ - DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t) -{ - DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v) -{ - DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v) -{ - DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v) -{ - DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r) -{ - DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v) -{ - DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r) -{ - DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v) -{ - DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v) -{ - DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v) -{ - DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v) -{ - DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v) -{ - DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y) -{ - DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v) -{ - DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y) -{ - DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v) -{ - DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y) -{ - DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v) -{ - DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y) -{ - DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v) -{ - DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v) -{ - DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v) -{ - DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v) -{ - DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v) -{ - DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v) -{ - DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v) -{ - DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v) -{ - DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v) -{ - DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation) -{ - DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode) -{ - DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode) -{ - DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param) -{ - DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param) -{ - DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params) -{ - DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode) -{ - DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode) -{ - DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param) -{ - DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params) -{ - DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param) -{ - DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params) -{ - DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param) -{ - DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param) -{ - DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params) -{ - DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern) -{ - DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width) -{ - DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param) -{ - DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params) -{ - DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param) -{ - DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params) -{ - DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size) -{ - DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode) -{ - DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask) -{ - DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode) -{ - DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -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), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels)); -} - -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), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param) -{ - DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params) -{ - DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param) -{ - DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param) -{ - DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params) -{ - DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer) -{ - DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer) -{ - DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer)); -} - -KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode) -{ - RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(InitNames)(void) -{ - DISPATCH(InitNames, (), (F, "glInitNames();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name) -{ - DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token) -{ - DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token)); -} - -KEYWORD1 void KEYWORD2 NAME(PopName)(void) -{ - DISPATCH(PopName, (), (F, "glPopName();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name) -{ - DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode) -{ - DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask) -{ - DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c) -{ - DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s) -{ - DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth) -{ - DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask) -{ - DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -{ - DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag) -{ - DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask) -{ - DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value) -{ - DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value)); -} - -KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap) -{ - DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap) -{ - DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Finish)(void) -{ - DISPATCH(Finish, (), (F, "glFinish();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Flush)(void) -{ - DISPATCH(Flush, (), (F, "glFlush();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void) -{ - DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask) -{ - DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask)); -} - -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), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -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), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -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), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -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), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2) -{ - DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2) -{ - DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2)); -} - -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), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -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), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u) -{ - DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u) -{ - DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v) -{ - DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v) -{ - DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2) -{ - DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i) -{ - DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j) -{ - DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref) -{ - DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor) -{ - DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode) -{ - DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func) -{ - DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor) -{ - DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param) -{ - DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param) -{ - DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values) -{ - DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values) -{ - DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values) -{ - DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode) -{ - DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) -{ - DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type)); -} - -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), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params) -{ - DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation) -{ - DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params) -{ - DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void) -{ - RETURN_DISPATCH(GetError, (), (F, "glGetError();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params) -{ - DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params) -{ - DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params) -{ - DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v) -{ - DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v) -{ - DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v) -{ - DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params) -{ - DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values) -{ - DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values) -{ - DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values) -{ - DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask) -{ - DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name) -{ - RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params) -{ - DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params) -{ - DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) -{ - DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params) -{ - DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap) -{ - RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list) -{ - RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar) -{ - DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void) -{ - DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode) -{ - DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m) -{ - DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m) -{ - DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void) -{ - DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void) -{ - DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array) -{ - DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array) -{ - DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c) -{ - DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c) -{ - DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units) -{ - DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -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), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) -{ - DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -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), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(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), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -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), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -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), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(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), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -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), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -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), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -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(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void) -{ - DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask) -{ - DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode)); -} - -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), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -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), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -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), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) -{ - DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -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), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -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), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -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), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -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), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -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), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(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), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target)); -} - -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), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -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), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -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), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -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), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -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), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -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), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader) -{ - DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void) -{ - RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type) -{ - RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program) -{ - DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program) -{ - DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader) -{ - DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) -{ - DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params) -{ - DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program) -{ - RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader) -{ - RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask) -{ - DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string) -{ - DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string) -{ - DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj) -{ - DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void) -{ - RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n")); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType) -{ - RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj) -{ - DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj) -{ - DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog) -{ - DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname) -{ - RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname)); -} - -KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) -{ - DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params) -{ - DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params) -{ - DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) -{ - DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params) -{ - DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param) -{ - DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params) -{ - DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern) -{ - DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer) -{ - DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count) -{ - DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) -{ - DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params) -{ - DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params) -{ - DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode) -{ - DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void) -{ - DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer) -{ - DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) -{ - DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param) -{ - DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params) -{ - DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void) -{ - DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences) -{ - DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) -{ - DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences) -{ - DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params) -{ - DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence) -{ - RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition) -{ - DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence) -{ - RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences) -{ - RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params) -{ - DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program) -{ - DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params) -{ - DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program) -{ - DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params) -{ - DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params) -{ - DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids) -{ - DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform) -{ - DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v) -{ - DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void) -{ - DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id) -{ - DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id) -{ - DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void) -{ - DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range) -{ - RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle) -{ - DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle) -{ - DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value) -{ - DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face) -{ - DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array) -{ - DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays) -{ - DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays) -{ - DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array) -{ - RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) -{ - DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) -{ - DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) -{ - DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) -{ - DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax) -{ - DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer) -{ - DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer) -{ - DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target) -{ - RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers) -{ - DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers) -{ - DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) -{ - DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) -{ - DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset)); -} - -KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers) -{ - DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers) -{ - DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target) -{ - DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params) -{ - DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer) -{ - RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer) -{ - RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) -{ - DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) -{ - DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) -{ - DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params) -{ - DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params) -{ - DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - - -#endif /* defined( NAME ) */ - -/* - * This is how a dispatch table can be initialized with all the functions - * we generated above. - */ -#ifdef DISPATCH_TABLE_NAME - -#ifndef TABLE_ENTRY -#error TABLE_ENTRY must be defined -#endif - -static _glapi_proc DISPATCH_TABLE_NAME[] = { - TABLE_ENTRY(NewList), - TABLE_ENTRY(EndList), - TABLE_ENTRY(CallList), - TABLE_ENTRY(CallLists), - TABLE_ENTRY(DeleteLists), - TABLE_ENTRY(GenLists), - TABLE_ENTRY(ListBase), - TABLE_ENTRY(Begin), - TABLE_ENTRY(Bitmap), - TABLE_ENTRY(Color3b), - TABLE_ENTRY(Color3bv), - TABLE_ENTRY(Color3d), - TABLE_ENTRY(Color3dv), - TABLE_ENTRY(Color3f), - TABLE_ENTRY(Color3fv), - TABLE_ENTRY(Color3i), - TABLE_ENTRY(Color3iv), - TABLE_ENTRY(Color3s), - TABLE_ENTRY(Color3sv), - TABLE_ENTRY(Color3ub), - TABLE_ENTRY(Color3ubv), - TABLE_ENTRY(Color3ui), - TABLE_ENTRY(Color3uiv), - TABLE_ENTRY(Color3us), - TABLE_ENTRY(Color3usv), - TABLE_ENTRY(Color4b), - TABLE_ENTRY(Color4bv), - TABLE_ENTRY(Color4d), - TABLE_ENTRY(Color4dv), - TABLE_ENTRY(Color4f), - TABLE_ENTRY(Color4fv), - TABLE_ENTRY(Color4i), - TABLE_ENTRY(Color4iv), - TABLE_ENTRY(Color4s), - TABLE_ENTRY(Color4sv), - TABLE_ENTRY(Color4ub), - TABLE_ENTRY(Color4ubv), - TABLE_ENTRY(Color4ui), - TABLE_ENTRY(Color4uiv), - TABLE_ENTRY(Color4us), - TABLE_ENTRY(Color4usv), - TABLE_ENTRY(EdgeFlag), - TABLE_ENTRY(EdgeFlagv), - TABLE_ENTRY(End), - TABLE_ENTRY(Indexd), - TABLE_ENTRY(Indexdv), - TABLE_ENTRY(Indexf), - TABLE_ENTRY(Indexfv), - TABLE_ENTRY(Indexi), - TABLE_ENTRY(Indexiv), - TABLE_ENTRY(Indexs), - TABLE_ENTRY(Indexsv), - TABLE_ENTRY(Normal3b), - TABLE_ENTRY(Normal3bv), - TABLE_ENTRY(Normal3d), - TABLE_ENTRY(Normal3dv), - TABLE_ENTRY(Normal3f), - TABLE_ENTRY(Normal3fv), - TABLE_ENTRY(Normal3i), - TABLE_ENTRY(Normal3iv), - TABLE_ENTRY(Normal3s), - TABLE_ENTRY(Normal3sv), - TABLE_ENTRY(RasterPos2d), - TABLE_ENTRY(RasterPos2dv), - TABLE_ENTRY(RasterPos2f), - TABLE_ENTRY(RasterPos2fv), - TABLE_ENTRY(RasterPos2i), - TABLE_ENTRY(RasterPos2iv), - TABLE_ENTRY(RasterPos2s), - TABLE_ENTRY(RasterPos2sv), - TABLE_ENTRY(RasterPos3d), - TABLE_ENTRY(RasterPos3dv), - TABLE_ENTRY(RasterPos3f), - TABLE_ENTRY(RasterPos3fv), - TABLE_ENTRY(RasterPos3i), - TABLE_ENTRY(RasterPos3iv), - TABLE_ENTRY(RasterPos3s), - TABLE_ENTRY(RasterPos3sv), - TABLE_ENTRY(RasterPos4d), - TABLE_ENTRY(RasterPos4dv), - TABLE_ENTRY(RasterPos4f), - TABLE_ENTRY(RasterPos4fv), - TABLE_ENTRY(RasterPos4i), - TABLE_ENTRY(RasterPos4iv), - TABLE_ENTRY(RasterPos4s), - TABLE_ENTRY(RasterPos4sv), - TABLE_ENTRY(Rectd), - TABLE_ENTRY(Rectdv), - TABLE_ENTRY(Rectf), - TABLE_ENTRY(Rectfv), - TABLE_ENTRY(Recti), - TABLE_ENTRY(Rectiv), - TABLE_ENTRY(Rects), - TABLE_ENTRY(Rectsv), - TABLE_ENTRY(TexCoord1d), - TABLE_ENTRY(TexCoord1dv), - TABLE_ENTRY(TexCoord1f), - TABLE_ENTRY(TexCoord1fv), - TABLE_ENTRY(TexCoord1i), - TABLE_ENTRY(TexCoord1iv), - TABLE_ENTRY(TexCoord1s), - TABLE_ENTRY(TexCoord1sv), - TABLE_ENTRY(TexCoord2d), - TABLE_ENTRY(TexCoord2dv), - TABLE_ENTRY(TexCoord2f), - TABLE_ENTRY(TexCoord2fv), - TABLE_ENTRY(TexCoord2i), - TABLE_ENTRY(TexCoord2iv), - TABLE_ENTRY(TexCoord2s), - TABLE_ENTRY(TexCoord2sv), - TABLE_ENTRY(TexCoord3d), - TABLE_ENTRY(TexCoord3dv), - TABLE_ENTRY(TexCoord3f), - TABLE_ENTRY(TexCoord3fv), - TABLE_ENTRY(TexCoord3i), - TABLE_ENTRY(TexCoord3iv), - TABLE_ENTRY(TexCoord3s), - TABLE_ENTRY(TexCoord3sv), - TABLE_ENTRY(TexCoord4d), - TABLE_ENTRY(TexCoord4dv), - TABLE_ENTRY(TexCoord4f), - TABLE_ENTRY(TexCoord4fv), - TABLE_ENTRY(TexCoord4i), - TABLE_ENTRY(TexCoord4iv), - TABLE_ENTRY(TexCoord4s), - TABLE_ENTRY(TexCoord4sv), - TABLE_ENTRY(Vertex2d), - TABLE_ENTRY(Vertex2dv), - TABLE_ENTRY(Vertex2f), - TABLE_ENTRY(Vertex2fv), - TABLE_ENTRY(Vertex2i), - TABLE_ENTRY(Vertex2iv), - TABLE_ENTRY(Vertex2s), - TABLE_ENTRY(Vertex2sv), - TABLE_ENTRY(Vertex3d), - TABLE_ENTRY(Vertex3dv), - TABLE_ENTRY(Vertex3f), - TABLE_ENTRY(Vertex3fv), - TABLE_ENTRY(Vertex3i), - TABLE_ENTRY(Vertex3iv), - TABLE_ENTRY(Vertex3s), - TABLE_ENTRY(Vertex3sv), - TABLE_ENTRY(Vertex4d), - TABLE_ENTRY(Vertex4dv), - TABLE_ENTRY(Vertex4f), - TABLE_ENTRY(Vertex4fv), - TABLE_ENTRY(Vertex4i), - TABLE_ENTRY(Vertex4iv), - TABLE_ENTRY(Vertex4s), - TABLE_ENTRY(Vertex4sv), - TABLE_ENTRY(ClipPlane), - TABLE_ENTRY(ColorMaterial), - TABLE_ENTRY(CullFace), - TABLE_ENTRY(Fogf), - TABLE_ENTRY(Fogfv), - TABLE_ENTRY(Fogi), - TABLE_ENTRY(Fogiv), - TABLE_ENTRY(FrontFace), - TABLE_ENTRY(Hint), - TABLE_ENTRY(Lightf), - TABLE_ENTRY(Lightfv), - TABLE_ENTRY(Lighti), - TABLE_ENTRY(Lightiv), - TABLE_ENTRY(LightModelf), - TABLE_ENTRY(LightModelfv), - TABLE_ENTRY(LightModeli), - TABLE_ENTRY(LightModeliv), - TABLE_ENTRY(LineStipple), - TABLE_ENTRY(LineWidth), - TABLE_ENTRY(Materialf), - TABLE_ENTRY(Materialfv), - TABLE_ENTRY(Materiali), - TABLE_ENTRY(Materialiv), - TABLE_ENTRY(PointSize), - TABLE_ENTRY(PolygonMode), - TABLE_ENTRY(PolygonStipple), - TABLE_ENTRY(Scissor), - TABLE_ENTRY(ShadeModel), - TABLE_ENTRY(TexParameterf), - TABLE_ENTRY(TexParameterfv), - TABLE_ENTRY(TexParameteri), - TABLE_ENTRY(TexParameteriv), - TABLE_ENTRY(TexImage1D), - TABLE_ENTRY(TexImage2D), - TABLE_ENTRY(TexEnvf), - TABLE_ENTRY(TexEnvfv), - TABLE_ENTRY(TexEnvi), - TABLE_ENTRY(TexEnviv), - TABLE_ENTRY(TexGend), - TABLE_ENTRY(TexGendv), - TABLE_ENTRY(TexGenf), - TABLE_ENTRY(TexGenfv), - TABLE_ENTRY(TexGeni), - TABLE_ENTRY(TexGeniv), - TABLE_ENTRY(FeedbackBuffer), - TABLE_ENTRY(SelectBuffer), - TABLE_ENTRY(RenderMode), - TABLE_ENTRY(InitNames), - TABLE_ENTRY(LoadName), - TABLE_ENTRY(PassThrough), - TABLE_ENTRY(PopName), - TABLE_ENTRY(PushName), - TABLE_ENTRY(DrawBuffer), - TABLE_ENTRY(Clear), - TABLE_ENTRY(ClearAccum), - TABLE_ENTRY(ClearIndex), - TABLE_ENTRY(ClearColor), - TABLE_ENTRY(ClearStencil), - TABLE_ENTRY(ClearDepth), - TABLE_ENTRY(StencilMask), - TABLE_ENTRY(ColorMask), - TABLE_ENTRY(DepthMask), - TABLE_ENTRY(IndexMask), - TABLE_ENTRY(Accum), - TABLE_ENTRY(Disable), - TABLE_ENTRY(Enable), - TABLE_ENTRY(Finish), - TABLE_ENTRY(Flush), - TABLE_ENTRY(PopAttrib), - TABLE_ENTRY(PushAttrib), - TABLE_ENTRY(Map1d), - TABLE_ENTRY(Map1f), - TABLE_ENTRY(Map2d), - TABLE_ENTRY(Map2f), - TABLE_ENTRY(MapGrid1d), - TABLE_ENTRY(MapGrid1f), - TABLE_ENTRY(MapGrid2d), - TABLE_ENTRY(MapGrid2f), - TABLE_ENTRY(EvalCoord1d), - TABLE_ENTRY(EvalCoord1dv), - TABLE_ENTRY(EvalCoord1f), - TABLE_ENTRY(EvalCoord1fv), - TABLE_ENTRY(EvalCoord2d), - TABLE_ENTRY(EvalCoord2dv), - TABLE_ENTRY(EvalCoord2f), - TABLE_ENTRY(EvalCoord2fv), - TABLE_ENTRY(EvalMesh1), - TABLE_ENTRY(EvalPoint1), - TABLE_ENTRY(EvalMesh2), - TABLE_ENTRY(EvalPoint2), - TABLE_ENTRY(AlphaFunc), - TABLE_ENTRY(BlendFunc), - TABLE_ENTRY(LogicOp), - TABLE_ENTRY(StencilFunc), - TABLE_ENTRY(StencilOp), - TABLE_ENTRY(DepthFunc), - TABLE_ENTRY(PixelZoom), - TABLE_ENTRY(PixelTransferf), - TABLE_ENTRY(PixelTransferi), - TABLE_ENTRY(PixelStoref), - TABLE_ENTRY(PixelStorei), - TABLE_ENTRY(PixelMapfv), - TABLE_ENTRY(PixelMapuiv), - TABLE_ENTRY(PixelMapusv), - TABLE_ENTRY(ReadBuffer), - TABLE_ENTRY(CopyPixels), - TABLE_ENTRY(ReadPixels), - TABLE_ENTRY(DrawPixels), - TABLE_ENTRY(GetBooleanv), - TABLE_ENTRY(GetClipPlane), - TABLE_ENTRY(GetDoublev), - TABLE_ENTRY(GetError), - TABLE_ENTRY(GetFloatv), - TABLE_ENTRY(GetIntegerv), - TABLE_ENTRY(GetLightfv), - TABLE_ENTRY(GetLightiv), - TABLE_ENTRY(GetMapdv), - TABLE_ENTRY(GetMapfv), - TABLE_ENTRY(GetMapiv), - TABLE_ENTRY(GetMaterialfv), - TABLE_ENTRY(GetMaterialiv), - TABLE_ENTRY(GetPixelMapfv), - TABLE_ENTRY(GetPixelMapuiv), - TABLE_ENTRY(GetPixelMapusv), - TABLE_ENTRY(GetPolygonStipple), - TABLE_ENTRY(GetString), - TABLE_ENTRY(GetTexEnvfv), - TABLE_ENTRY(GetTexEnviv), - TABLE_ENTRY(GetTexGendv), - TABLE_ENTRY(GetTexGenfv), - TABLE_ENTRY(GetTexGeniv), - TABLE_ENTRY(GetTexImage), - TABLE_ENTRY(GetTexParameterfv), - TABLE_ENTRY(GetTexParameteriv), - TABLE_ENTRY(GetTexLevelParameterfv), - TABLE_ENTRY(GetTexLevelParameteriv), - TABLE_ENTRY(IsEnabled), - TABLE_ENTRY(IsList), - TABLE_ENTRY(DepthRange), - TABLE_ENTRY(Frustum), - TABLE_ENTRY(LoadIdentity), - TABLE_ENTRY(LoadMatrixf), - TABLE_ENTRY(LoadMatrixd), - TABLE_ENTRY(MatrixMode), - TABLE_ENTRY(MultMatrixf), - TABLE_ENTRY(MultMatrixd), - TABLE_ENTRY(Ortho), - TABLE_ENTRY(PopMatrix), - TABLE_ENTRY(PushMatrix), - TABLE_ENTRY(Rotated), - TABLE_ENTRY(Rotatef), - TABLE_ENTRY(Scaled), - TABLE_ENTRY(Scalef), - TABLE_ENTRY(Translated), - TABLE_ENTRY(Translatef), - TABLE_ENTRY(Viewport), - TABLE_ENTRY(ArrayElement), - TABLE_ENTRY(BindTexture), - TABLE_ENTRY(ColorPointer), - TABLE_ENTRY(DisableClientState), - TABLE_ENTRY(DrawArrays), - TABLE_ENTRY(DrawElements), - TABLE_ENTRY(EdgeFlagPointer), - TABLE_ENTRY(EnableClientState), - TABLE_ENTRY(IndexPointer), - TABLE_ENTRY(Indexub), - TABLE_ENTRY(Indexubv), - TABLE_ENTRY(InterleavedArrays), - TABLE_ENTRY(NormalPointer), - TABLE_ENTRY(PolygonOffset), - TABLE_ENTRY(TexCoordPointer), - TABLE_ENTRY(VertexPointer), - TABLE_ENTRY(AreTexturesResident), - TABLE_ENTRY(CopyTexImage1D), - TABLE_ENTRY(CopyTexImage2D), - TABLE_ENTRY(CopyTexSubImage1D), - TABLE_ENTRY(CopyTexSubImage2D), - TABLE_ENTRY(DeleteTextures), - TABLE_ENTRY(GenTextures), - TABLE_ENTRY(GetPointerv), - TABLE_ENTRY(IsTexture), - TABLE_ENTRY(PrioritizeTextures), - TABLE_ENTRY(TexSubImage1D), - TABLE_ENTRY(TexSubImage2D), - TABLE_ENTRY(PopClientAttrib), - TABLE_ENTRY(PushClientAttrib), - TABLE_ENTRY(BlendColor), - TABLE_ENTRY(BlendEquation), - TABLE_ENTRY(DrawRangeElements), - TABLE_ENTRY(ColorTable), - TABLE_ENTRY(ColorTableParameterfv), - TABLE_ENTRY(ColorTableParameteriv), - TABLE_ENTRY(CopyColorTable), - TABLE_ENTRY(GetColorTable), - TABLE_ENTRY(GetColorTableParameterfv), - TABLE_ENTRY(GetColorTableParameteriv), - TABLE_ENTRY(ColorSubTable), - TABLE_ENTRY(CopyColorSubTable), - TABLE_ENTRY(ConvolutionFilter1D), - TABLE_ENTRY(ConvolutionFilter2D), - TABLE_ENTRY(ConvolutionParameterf), - TABLE_ENTRY(ConvolutionParameterfv), - TABLE_ENTRY(ConvolutionParameteri), - TABLE_ENTRY(ConvolutionParameteriv), - TABLE_ENTRY(CopyConvolutionFilter1D), - TABLE_ENTRY(CopyConvolutionFilter2D), - TABLE_ENTRY(GetConvolutionFilter), - TABLE_ENTRY(GetConvolutionParameterfv), - TABLE_ENTRY(GetConvolutionParameteriv), - TABLE_ENTRY(GetSeparableFilter), - TABLE_ENTRY(SeparableFilter2D), - TABLE_ENTRY(GetHistogram), - TABLE_ENTRY(GetHistogramParameterfv), - TABLE_ENTRY(GetHistogramParameteriv), - TABLE_ENTRY(GetMinmax), - TABLE_ENTRY(GetMinmaxParameterfv), - TABLE_ENTRY(GetMinmaxParameteriv), - TABLE_ENTRY(Histogram), - TABLE_ENTRY(Minmax), - TABLE_ENTRY(ResetHistogram), - TABLE_ENTRY(ResetMinmax), - TABLE_ENTRY(TexImage3D), - TABLE_ENTRY(TexSubImage3D), - TABLE_ENTRY(CopyTexSubImage3D), - TABLE_ENTRY(ActiveTextureARB), - TABLE_ENTRY(ClientActiveTextureARB), - TABLE_ENTRY(MultiTexCoord1dARB), - TABLE_ENTRY(MultiTexCoord1dvARB), - TABLE_ENTRY(MultiTexCoord1fARB), - TABLE_ENTRY(MultiTexCoord1fvARB), - TABLE_ENTRY(MultiTexCoord1iARB), - TABLE_ENTRY(MultiTexCoord1ivARB), - TABLE_ENTRY(MultiTexCoord1sARB), - TABLE_ENTRY(MultiTexCoord1svARB), - TABLE_ENTRY(MultiTexCoord2dARB), - TABLE_ENTRY(MultiTexCoord2dvARB), - TABLE_ENTRY(MultiTexCoord2fARB), - TABLE_ENTRY(MultiTexCoord2fvARB), - TABLE_ENTRY(MultiTexCoord2iARB), - TABLE_ENTRY(MultiTexCoord2ivARB), - TABLE_ENTRY(MultiTexCoord2sARB), - TABLE_ENTRY(MultiTexCoord2svARB), - TABLE_ENTRY(MultiTexCoord3dARB), - TABLE_ENTRY(MultiTexCoord3dvARB), - TABLE_ENTRY(MultiTexCoord3fARB), - TABLE_ENTRY(MultiTexCoord3fvARB), - TABLE_ENTRY(MultiTexCoord3iARB), - TABLE_ENTRY(MultiTexCoord3ivARB), - TABLE_ENTRY(MultiTexCoord3sARB), - TABLE_ENTRY(MultiTexCoord3svARB), - TABLE_ENTRY(MultiTexCoord4dARB), - TABLE_ENTRY(MultiTexCoord4dvARB), - TABLE_ENTRY(MultiTexCoord4fARB), - TABLE_ENTRY(MultiTexCoord4fvARB), - TABLE_ENTRY(MultiTexCoord4iARB), - TABLE_ENTRY(MultiTexCoord4ivARB), - TABLE_ENTRY(MultiTexCoord4sARB), - TABLE_ENTRY(MultiTexCoord4svARB), - TABLE_ENTRY(AttachShader), - TABLE_ENTRY(CreateProgram), - TABLE_ENTRY(CreateShader), - TABLE_ENTRY(DeleteProgram), - TABLE_ENTRY(DeleteShader), - TABLE_ENTRY(DetachShader), - TABLE_ENTRY(GetAttachedShaders), - TABLE_ENTRY(GetProgramInfoLog), - TABLE_ENTRY(GetProgramiv), - TABLE_ENTRY(GetShaderInfoLog), - TABLE_ENTRY(GetShaderiv), - TABLE_ENTRY(IsProgram), - TABLE_ENTRY(IsShader), - TABLE_ENTRY(StencilFuncSeparate), - TABLE_ENTRY(StencilMaskSeparate), - TABLE_ENTRY(StencilOpSeparate), - TABLE_ENTRY(UniformMatrix2x3fv), - TABLE_ENTRY(UniformMatrix2x4fv), - TABLE_ENTRY(UniformMatrix3x2fv), - TABLE_ENTRY(UniformMatrix3x4fv), - TABLE_ENTRY(UniformMatrix4x2fv), - TABLE_ENTRY(UniformMatrix4x3fv), - TABLE_ENTRY(LoadTransposeMatrixdARB), - TABLE_ENTRY(LoadTransposeMatrixfARB), - TABLE_ENTRY(MultTransposeMatrixdARB), - TABLE_ENTRY(MultTransposeMatrixfARB), - TABLE_ENTRY(SampleCoverageARB), - TABLE_ENTRY(CompressedTexImage1DARB), - TABLE_ENTRY(CompressedTexImage2DARB), - TABLE_ENTRY(CompressedTexImage3DARB), - TABLE_ENTRY(CompressedTexSubImage1DARB), - TABLE_ENTRY(CompressedTexSubImage2DARB), - TABLE_ENTRY(CompressedTexSubImage3DARB), - TABLE_ENTRY(GetCompressedTexImageARB), - TABLE_ENTRY(DisableVertexAttribArrayARB), - TABLE_ENTRY(EnableVertexAttribArrayARB), - TABLE_ENTRY(GetProgramEnvParameterdvARB), - TABLE_ENTRY(GetProgramEnvParameterfvARB), - TABLE_ENTRY(GetProgramLocalParameterdvARB), - TABLE_ENTRY(GetProgramLocalParameterfvARB), - TABLE_ENTRY(GetProgramStringARB), - TABLE_ENTRY(GetProgramivARB), - TABLE_ENTRY(GetVertexAttribdvARB), - TABLE_ENTRY(GetVertexAttribfvARB), - TABLE_ENTRY(GetVertexAttribivARB), - TABLE_ENTRY(ProgramEnvParameter4dARB), - TABLE_ENTRY(ProgramEnvParameter4dvARB), - TABLE_ENTRY(ProgramEnvParameter4fARB), - TABLE_ENTRY(ProgramEnvParameter4fvARB), - TABLE_ENTRY(ProgramLocalParameter4dARB), - TABLE_ENTRY(ProgramLocalParameter4dvARB), - TABLE_ENTRY(ProgramLocalParameter4fARB), - TABLE_ENTRY(ProgramLocalParameter4fvARB), - TABLE_ENTRY(ProgramStringARB), - TABLE_ENTRY(VertexAttrib1dARB), - TABLE_ENTRY(VertexAttrib1dvARB), - TABLE_ENTRY(VertexAttrib1fARB), - TABLE_ENTRY(VertexAttrib1fvARB), - TABLE_ENTRY(VertexAttrib1sARB), - TABLE_ENTRY(VertexAttrib1svARB), - TABLE_ENTRY(VertexAttrib2dARB), - TABLE_ENTRY(VertexAttrib2dvARB), - TABLE_ENTRY(VertexAttrib2fARB), - TABLE_ENTRY(VertexAttrib2fvARB), - TABLE_ENTRY(VertexAttrib2sARB), - TABLE_ENTRY(VertexAttrib2svARB), - TABLE_ENTRY(VertexAttrib3dARB), - TABLE_ENTRY(VertexAttrib3dvARB), - TABLE_ENTRY(VertexAttrib3fARB), - TABLE_ENTRY(VertexAttrib3fvARB), - TABLE_ENTRY(VertexAttrib3sARB), - TABLE_ENTRY(VertexAttrib3svARB), - TABLE_ENTRY(VertexAttrib4NbvARB), - TABLE_ENTRY(VertexAttrib4NivARB), - TABLE_ENTRY(VertexAttrib4NsvARB), - TABLE_ENTRY(VertexAttrib4NubARB), - TABLE_ENTRY(VertexAttrib4NubvARB), - TABLE_ENTRY(VertexAttrib4NuivARB), - TABLE_ENTRY(VertexAttrib4NusvARB), - TABLE_ENTRY(VertexAttrib4bvARB), - TABLE_ENTRY(VertexAttrib4dARB), - TABLE_ENTRY(VertexAttrib4dvARB), - TABLE_ENTRY(VertexAttrib4fARB), - TABLE_ENTRY(VertexAttrib4fvARB), - TABLE_ENTRY(VertexAttrib4ivARB), - TABLE_ENTRY(VertexAttrib4sARB), - TABLE_ENTRY(VertexAttrib4svARB), - TABLE_ENTRY(VertexAttrib4ubvARB), - TABLE_ENTRY(VertexAttrib4uivARB), - TABLE_ENTRY(VertexAttrib4usvARB), - TABLE_ENTRY(VertexAttribPointerARB), - TABLE_ENTRY(BindBufferARB), - TABLE_ENTRY(BufferDataARB), - TABLE_ENTRY(BufferSubDataARB), - TABLE_ENTRY(DeleteBuffersARB), - TABLE_ENTRY(GenBuffersARB), - TABLE_ENTRY(GetBufferParameterivARB), - TABLE_ENTRY(GetBufferPointervARB), - TABLE_ENTRY(GetBufferSubDataARB), - TABLE_ENTRY(IsBufferARB), - TABLE_ENTRY(MapBufferARB), - TABLE_ENTRY(UnmapBufferARB), - TABLE_ENTRY(BeginQueryARB), - TABLE_ENTRY(DeleteQueriesARB), - TABLE_ENTRY(EndQueryARB), - TABLE_ENTRY(GenQueriesARB), - TABLE_ENTRY(GetQueryObjectivARB), - TABLE_ENTRY(GetQueryObjectuivARB), - TABLE_ENTRY(GetQueryivARB), - TABLE_ENTRY(IsQueryARB), - TABLE_ENTRY(AttachObjectARB), - TABLE_ENTRY(CompileShaderARB), - TABLE_ENTRY(CreateProgramObjectARB), - TABLE_ENTRY(CreateShaderObjectARB), - TABLE_ENTRY(DeleteObjectARB), - TABLE_ENTRY(DetachObjectARB), - TABLE_ENTRY(GetActiveUniformARB), - TABLE_ENTRY(GetAttachedObjectsARB), - TABLE_ENTRY(GetHandleARB), - TABLE_ENTRY(GetInfoLogARB), - TABLE_ENTRY(GetObjectParameterfvARB), - TABLE_ENTRY(GetObjectParameterivARB), - TABLE_ENTRY(GetShaderSourceARB), - TABLE_ENTRY(GetUniformLocationARB), - TABLE_ENTRY(GetUniformfvARB), - TABLE_ENTRY(GetUniformivARB), - TABLE_ENTRY(LinkProgramARB), - TABLE_ENTRY(ShaderSourceARB), - TABLE_ENTRY(Uniform1fARB), - TABLE_ENTRY(Uniform1fvARB), - TABLE_ENTRY(Uniform1iARB), - TABLE_ENTRY(Uniform1ivARB), - TABLE_ENTRY(Uniform2fARB), - TABLE_ENTRY(Uniform2fvARB), - TABLE_ENTRY(Uniform2iARB), - TABLE_ENTRY(Uniform2ivARB), - TABLE_ENTRY(Uniform3fARB), - TABLE_ENTRY(Uniform3fvARB), - TABLE_ENTRY(Uniform3iARB), - TABLE_ENTRY(Uniform3ivARB), - TABLE_ENTRY(Uniform4fARB), - TABLE_ENTRY(Uniform4fvARB), - TABLE_ENTRY(Uniform4iARB), - TABLE_ENTRY(Uniform4ivARB), - TABLE_ENTRY(UniformMatrix2fvARB), - TABLE_ENTRY(UniformMatrix3fvARB), - TABLE_ENTRY(UniformMatrix4fvARB), - TABLE_ENTRY(UseProgramObjectARB), - TABLE_ENTRY(ValidateProgramARB), - TABLE_ENTRY(BindAttribLocationARB), - TABLE_ENTRY(GetActiveAttribARB), - TABLE_ENTRY(GetAttribLocationARB), - TABLE_ENTRY(DrawBuffersARB), - TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_562), - TABLE_ENTRY(_dispatch_stub_563), - TABLE_ENTRY(_dispatch_stub_564), - TABLE_ENTRY(_dispatch_stub_565), - TABLE_ENTRY(_dispatch_stub_566), - TABLE_ENTRY(_dispatch_stub_567), - TABLE_ENTRY(_dispatch_stub_568), - TABLE_ENTRY(_dispatch_stub_569), - TABLE_ENTRY(ColorPointerEXT), - TABLE_ENTRY(EdgeFlagPointerEXT), - TABLE_ENTRY(IndexPointerEXT), - TABLE_ENTRY(NormalPointerEXT), - TABLE_ENTRY(TexCoordPointerEXT), - TABLE_ENTRY(VertexPointerEXT), - TABLE_ENTRY(PointParameterfEXT), - TABLE_ENTRY(PointParameterfvEXT), - TABLE_ENTRY(LockArraysEXT), - TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_580), - TABLE_ENTRY(_dispatch_stub_581), - TABLE_ENTRY(SecondaryColor3bEXT), - TABLE_ENTRY(SecondaryColor3bvEXT), - TABLE_ENTRY(SecondaryColor3dEXT), - TABLE_ENTRY(SecondaryColor3dvEXT), - TABLE_ENTRY(SecondaryColor3fEXT), - TABLE_ENTRY(SecondaryColor3fvEXT), - TABLE_ENTRY(SecondaryColor3iEXT), - TABLE_ENTRY(SecondaryColor3ivEXT), - TABLE_ENTRY(SecondaryColor3sEXT), - TABLE_ENTRY(SecondaryColor3svEXT), - TABLE_ENTRY(SecondaryColor3ubEXT), - TABLE_ENTRY(SecondaryColor3ubvEXT), - TABLE_ENTRY(SecondaryColor3uiEXT), - TABLE_ENTRY(SecondaryColor3uivEXT), - TABLE_ENTRY(SecondaryColor3usEXT), - TABLE_ENTRY(SecondaryColor3usvEXT), - TABLE_ENTRY(SecondaryColorPointerEXT), - TABLE_ENTRY(MultiDrawArraysEXT), - TABLE_ENTRY(MultiDrawElementsEXT), - TABLE_ENTRY(FogCoordPointerEXT), - TABLE_ENTRY(FogCoorddEXT), - TABLE_ENTRY(FogCoorddvEXT), - TABLE_ENTRY(FogCoordfEXT), - TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_606), - TABLE_ENTRY(BlendFuncSeparateEXT), - TABLE_ENTRY(FlushVertexArrayRangeNV), - TABLE_ENTRY(VertexArrayRangeNV), - TABLE_ENTRY(CombinerInputNV), - TABLE_ENTRY(CombinerOutputNV), - TABLE_ENTRY(CombinerParameterfNV), - TABLE_ENTRY(CombinerParameterfvNV), - TABLE_ENTRY(CombinerParameteriNV), - TABLE_ENTRY(CombinerParameterivNV), - TABLE_ENTRY(FinalCombinerInputNV), - TABLE_ENTRY(GetCombinerInputParameterfvNV), - TABLE_ENTRY(GetCombinerInputParameterivNV), - TABLE_ENTRY(GetCombinerOutputParameterfvNV), - TABLE_ENTRY(GetCombinerOutputParameterivNV), - TABLE_ENTRY(GetFinalCombinerInputParameterfvNV), - TABLE_ENTRY(GetFinalCombinerInputParameterivNV), - TABLE_ENTRY(ResizeBuffersMESA), - TABLE_ENTRY(WindowPos2dMESA), - TABLE_ENTRY(WindowPos2dvMESA), - TABLE_ENTRY(WindowPos2fMESA), - TABLE_ENTRY(WindowPos2fvMESA), - TABLE_ENTRY(WindowPos2iMESA), - TABLE_ENTRY(WindowPos2ivMESA), - TABLE_ENTRY(WindowPos2sMESA), - TABLE_ENTRY(WindowPos2svMESA), - TABLE_ENTRY(WindowPos3dMESA), - TABLE_ENTRY(WindowPos3dvMESA), - TABLE_ENTRY(WindowPos3fMESA), - TABLE_ENTRY(WindowPos3fvMESA), - TABLE_ENTRY(WindowPos3iMESA), - TABLE_ENTRY(WindowPos3ivMESA), - TABLE_ENTRY(WindowPos3sMESA), - TABLE_ENTRY(WindowPos3svMESA), - TABLE_ENTRY(WindowPos4dMESA), - TABLE_ENTRY(WindowPos4dvMESA), - TABLE_ENTRY(WindowPos4fMESA), - TABLE_ENTRY(WindowPos4fvMESA), - TABLE_ENTRY(WindowPos4iMESA), - TABLE_ENTRY(WindowPos4ivMESA), - TABLE_ENTRY(WindowPos4sMESA), - TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_648), - TABLE_ENTRY(_dispatch_stub_649), - TABLE_ENTRY(_dispatch_stub_650), - TABLE_ENTRY(_dispatch_stub_651), - TABLE_ENTRY(_dispatch_stub_652), - TABLE_ENTRY(_dispatch_stub_653), - TABLE_ENTRY(_dispatch_stub_654), - TABLE_ENTRY(_dispatch_stub_655), - TABLE_ENTRY(_dispatch_stub_656), - TABLE_ENTRY(AreProgramsResidentNV), - TABLE_ENTRY(BindProgramNV), - TABLE_ENTRY(DeleteProgramsNV), - TABLE_ENTRY(ExecuteProgramNV), - TABLE_ENTRY(GenProgramsNV), - TABLE_ENTRY(GetProgramParameterdvNV), - TABLE_ENTRY(GetProgramParameterfvNV), - TABLE_ENTRY(GetProgramStringNV), - TABLE_ENTRY(GetProgramivNV), - TABLE_ENTRY(GetTrackMatrixivNV), - TABLE_ENTRY(GetVertexAttribPointervNV), - TABLE_ENTRY(GetVertexAttribdvNV), - TABLE_ENTRY(GetVertexAttribfvNV), - TABLE_ENTRY(GetVertexAttribivNV), - TABLE_ENTRY(IsProgramNV), - TABLE_ENTRY(LoadProgramNV), - TABLE_ENTRY(ProgramParameters4dvNV), - TABLE_ENTRY(ProgramParameters4fvNV), - TABLE_ENTRY(RequestResidentProgramsNV), - TABLE_ENTRY(TrackMatrixNV), - TABLE_ENTRY(VertexAttrib1dNV), - TABLE_ENTRY(VertexAttrib1dvNV), - TABLE_ENTRY(VertexAttrib1fNV), - TABLE_ENTRY(VertexAttrib1fvNV), - TABLE_ENTRY(VertexAttrib1sNV), - TABLE_ENTRY(VertexAttrib1svNV), - TABLE_ENTRY(VertexAttrib2dNV), - TABLE_ENTRY(VertexAttrib2dvNV), - TABLE_ENTRY(VertexAttrib2fNV), - TABLE_ENTRY(VertexAttrib2fvNV), - TABLE_ENTRY(VertexAttrib2sNV), - TABLE_ENTRY(VertexAttrib2svNV), - TABLE_ENTRY(VertexAttrib3dNV), - TABLE_ENTRY(VertexAttrib3dvNV), - TABLE_ENTRY(VertexAttrib3fNV), - TABLE_ENTRY(VertexAttrib3fvNV), - TABLE_ENTRY(VertexAttrib3sNV), - TABLE_ENTRY(VertexAttrib3svNV), - TABLE_ENTRY(VertexAttrib4dNV), - TABLE_ENTRY(VertexAttrib4dvNV), - TABLE_ENTRY(VertexAttrib4fNV), - TABLE_ENTRY(VertexAttrib4fvNV), - TABLE_ENTRY(VertexAttrib4sNV), - TABLE_ENTRY(VertexAttrib4svNV), - TABLE_ENTRY(VertexAttrib4ubNV), - TABLE_ENTRY(VertexAttrib4ubvNV), - TABLE_ENTRY(VertexAttribPointerNV), - TABLE_ENTRY(VertexAttribs1dvNV), - TABLE_ENTRY(VertexAttribs1fvNV), - TABLE_ENTRY(VertexAttribs1svNV), - TABLE_ENTRY(VertexAttribs2dvNV), - TABLE_ENTRY(VertexAttribs2fvNV), - TABLE_ENTRY(VertexAttribs2svNV), - TABLE_ENTRY(VertexAttribs3dvNV), - TABLE_ENTRY(VertexAttribs3fvNV), - TABLE_ENTRY(VertexAttribs3svNV), - TABLE_ENTRY(VertexAttribs4dvNV), - TABLE_ENTRY(VertexAttribs4fvNV), - TABLE_ENTRY(VertexAttribs4svNV), - TABLE_ENTRY(VertexAttribs4ubvNV), - TABLE_ENTRY(AlphaFragmentOp1ATI), - TABLE_ENTRY(AlphaFragmentOp2ATI), - TABLE_ENTRY(AlphaFragmentOp3ATI), - TABLE_ENTRY(BeginFragmentShaderATI), - TABLE_ENTRY(BindFragmentShaderATI), - TABLE_ENTRY(ColorFragmentOp1ATI), - TABLE_ENTRY(ColorFragmentOp2ATI), - TABLE_ENTRY(ColorFragmentOp3ATI), - TABLE_ENTRY(DeleteFragmentShaderATI), - TABLE_ENTRY(EndFragmentShaderATI), - TABLE_ENTRY(GenFragmentShadersATI), - TABLE_ENTRY(PassTexCoordATI), - TABLE_ENTRY(SampleMapATI), - TABLE_ENTRY(SetFragmentShaderConstantATI), - TABLE_ENTRY(PointParameteriNV), - TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_733), - TABLE_ENTRY(_dispatch_stub_734), - TABLE_ENTRY(_dispatch_stub_735), - TABLE_ENTRY(_dispatch_stub_736), - TABLE_ENTRY(_dispatch_stub_737), - TABLE_ENTRY(GetProgramNamedParameterdvNV), - TABLE_ENTRY(GetProgramNamedParameterfvNV), - TABLE_ENTRY(ProgramNamedParameter4dNV), - TABLE_ENTRY(ProgramNamedParameter4dvNV), - TABLE_ENTRY(ProgramNamedParameter4fNV), - TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_744), - TABLE_ENTRY(_dispatch_stub_745), - TABLE_ENTRY(BindFramebufferEXT), - TABLE_ENTRY(BindRenderbufferEXT), - TABLE_ENTRY(CheckFramebufferStatusEXT), - TABLE_ENTRY(DeleteFramebuffersEXT), - TABLE_ENTRY(DeleteRenderbuffersEXT), - TABLE_ENTRY(FramebufferRenderbufferEXT), - TABLE_ENTRY(FramebufferTexture1DEXT), - TABLE_ENTRY(FramebufferTexture2DEXT), - TABLE_ENTRY(FramebufferTexture3DEXT), - TABLE_ENTRY(GenFramebuffersEXT), - TABLE_ENTRY(GenRenderbuffersEXT), - TABLE_ENTRY(GenerateMipmapEXT), - TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT), - TABLE_ENTRY(GetRenderbufferParameterivEXT), - TABLE_ENTRY(IsFramebufferEXT), - TABLE_ENTRY(IsRenderbufferEXT), - TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_763), - TABLE_ENTRY(FramebufferTextureLayerEXT), - TABLE_ENTRY(_dispatch_stub_765), - TABLE_ENTRY(_dispatch_stub_766), - TABLE_ENTRY(_dispatch_stub_767), - TABLE_ENTRY(_dispatch_stub_768), - TABLE_ENTRY(_dispatch_stub_769), - /* A whole bunch of no-op functions. These might be called - * when someone tries to call a dynamically-registered - * extension function without a current rendering context. - */ - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), -}; -#endif /* DISPATCH_TABLE_NAME */ - - -/* - * This is just used to silence compiler warnings. - * We list the functions which are not otherwise used. - */ -#ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = { - TABLE_ENTRY(ArrayElementEXT), - TABLE_ENTRY(BindTextureEXT), - TABLE_ENTRY(DrawArraysEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(AreTexturesResidentEXT), -#endif - TABLE_ENTRY(CopyTexImage1DEXT), - TABLE_ENTRY(CopyTexImage2DEXT), - TABLE_ENTRY(CopyTexSubImage1DEXT), - TABLE_ENTRY(CopyTexSubImage2DEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(DeleteTexturesEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GenTexturesEXT), -#endif - TABLE_ENTRY(GetPointervEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(IsTextureEXT), -#endif - TABLE_ENTRY(PrioritizeTexturesEXT), - TABLE_ENTRY(TexSubImage1DEXT), - TABLE_ENTRY(TexSubImage2DEXT), - TABLE_ENTRY(BlendColorEXT), - TABLE_ENTRY(BlendEquationEXT), - TABLE_ENTRY(DrawRangeElementsEXT), - TABLE_ENTRY(ColorTableEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterfvEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterivEXT), -#endif - TABLE_ENTRY(TexImage3DEXT), - TABLE_ENTRY(TexSubImage3DEXT), - TABLE_ENTRY(CopyTexSubImage3DEXT), - TABLE_ENTRY(ActiveTexture), - TABLE_ENTRY(ClientActiveTexture), - TABLE_ENTRY(MultiTexCoord1d), - TABLE_ENTRY(MultiTexCoord1dv), - TABLE_ENTRY(MultiTexCoord1f), - TABLE_ENTRY(MultiTexCoord1fv), - TABLE_ENTRY(MultiTexCoord1i), - TABLE_ENTRY(MultiTexCoord1iv), - TABLE_ENTRY(MultiTexCoord1s), - TABLE_ENTRY(MultiTexCoord1sv), - TABLE_ENTRY(MultiTexCoord2d), - TABLE_ENTRY(MultiTexCoord2dv), - TABLE_ENTRY(MultiTexCoord2f), - TABLE_ENTRY(MultiTexCoord2fv), - TABLE_ENTRY(MultiTexCoord2i), - TABLE_ENTRY(MultiTexCoord2iv), - TABLE_ENTRY(MultiTexCoord2s), - TABLE_ENTRY(MultiTexCoord2sv), - TABLE_ENTRY(MultiTexCoord3d), - TABLE_ENTRY(MultiTexCoord3dv), - TABLE_ENTRY(MultiTexCoord3f), - TABLE_ENTRY(MultiTexCoord3fv), - TABLE_ENTRY(MultiTexCoord3i), - TABLE_ENTRY(MultiTexCoord3iv), - TABLE_ENTRY(MultiTexCoord3s), - TABLE_ENTRY(MultiTexCoord3sv), - TABLE_ENTRY(MultiTexCoord4d), - TABLE_ENTRY(MultiTexCoord4dv), - TABLE_ENTRY(MultiTexCoord4f), - TABLE_ENTRY(MultiTexCoord4fv), - TABLE_ENTRY(MultiTexCoord4i), - TABLE_ENTRY(MultiTexCoord4iv), - TABLE_ENTRY(MultiTexCoord4s), - TABLE_ENTRY(MultiTexCoord4sv), - TABLE_ENTRY(LoadTransposeMatrixd), - TABLE_ENTRY(LoadTransposeMatrixf), - TABLE_ENTRY(MultTransposeMatrixd), - TABLE_ENTRY(MultTransposeMatrixf), - TABLE_ENTRY(SampleCoverage), - TABLE_ENTRY(CompressedTexImage1D), - TABLE_ENTRY(CompressedTexImage2D), - TABLE_ENTRY(CompressedTexImage3D), - TABLE_ENTRY(CompressedTexSubImage1D), - TABLE_ENTRY(CompressedTexSubImage2D), - TABLE_ENTRY(CompressedTexSubImage3D), - TABLE_ENTRY(GetCompressedTexImage), - TABLE_ENTRY(DisableVertexAttribArray), - TABLE_ENTRY(EnableVertexAttribArray), - TABLE_ENTRY(GetVertexAttribdv), - TABLE_ENTRY(GetVertexAttribfv), - TABLE_ENTRY(GetVertexAttribiv), - TABLE_ENTRY(ProgramParameter4dNV), - TABLE_ENTRY(ProgramParameter4dvNV), - TABLE_ENTRY(ProgramParameter4fNV), - TABLE_ENTRY(ProgramParameter4fvNV), - TABLE_ENTRY(VertexAttrib1d), - TABLE_ENTRY(VertexAttrib1dv), - TABLE_ENTRY(VertexAttrib1f), - TABLE_ENTRY(VertexAttrib1fv), - TABLE_ENTRY(VertexAttrib1s), - TABLE_ENTRY(VertexAttrib1sv), - TABLE_ENTRY(VertexAttrib2d), - TABLE_ENTRY(VertexAttrib2dv), - TABLE_ENTRY(VertexAttrib2f), - TABLE_ENTRY(VertexAttrib2fv), - TABLE_ENTRY(VertexAttrib2s), - TABLE_ENTRY(VertexAttrib2sv), - TABLE_ENTRY(VertexAttrib3d), - TABLE_ENTRY(VertexAttrib3dv), - TABLE_ENTRY(VertexAttrib3f), - TABLE_ENTRY(VertexAttrib3fv), - TABLE_ENTRY(VertexAttrib3s), - TABLE_ENTRY(VertexAttrib3sv), - TABLE_ENTRY(VertexAttrib4Nbv), - TABLE_ENTRY(VertexAttrib4Niv), - TABLE_ENTRY(VertexAttrib4Nsv), - TABLE_ENTRY(VertexAttrib4Nub), - TABLE_ENTRY(VertexAttrib4Nubv), - TABLE_ENTRY(VertexAttrib4Nuiv), - TABLE_ENTRY(VertexAttrib4Nusv), - TABLE_ENTRY(VertexAttrib4bv), - TABLE_ENTRY(VertexAttrib4d), - TABLE_ENTRY(VertexAttrib4dv), - TABLE_ENTRY(VertexAttrib4f), - TABLE_ENTRY(VertexAttrib4fv), - TABLE_ENTRY(VertexAttrib4iv), - TABLE_ENTRY(VertexAttrib4s), - TABLE_ENTRY(VertexAttrib4sv), - TABLE_ENTRY(VertexAttrib4ubv), - TABLE_ENTRY(VertexAttrib4uiv), - TABLE_ENTRY(VertexAttrib4usv), - TABLE_ENTRY(VertexAttribPointer), - TABLE_ENTRY(BindBuffer), - TABLE_ENTRY(BufferData), - TABLE_ENTRY(BufferSubData), - TABLE_ENTRY(DeleteBuffers), - TABLE_ENTRY(GenBuffers), - TABLE_ENTRY(GetBufferParameteriv), - TABLE_ENTRY(GetBufferPointerv), - TABLE_ENTRY(GetBufferSubData), - TABLE_ENTRY(IsBuffer), - TABLE_ENTRY(MapBuffer), - TABLE_ENTRY(UnmapBuffer), - TABLE_ENTRY(BeginQuery), - TABLE_ENTRY(DeleteQueries), - TABLE_ENTRY(EndQuery), - TABLE_ENTRY(GenQueries), - TABLE_ENTRY(GetQueryObjectiv), - TABLE_ENTRY(GetQueryObjectuiv), - TABLE_ENTRY(GetQueryiv), - TABLE_ENTRY(IsQuery), - TABLE_ENTRY(CompileShader), - TABLE_ENTRY(GetActiveUniform), - TABLE_ENTRY(GetShaderSource), - TABLE_ENTRY(GetUniformLocation), - TABLE_ENTRY(GetUniformfv), - TABLE_ENTRY(GetUniformiv), - TABLE_ENTRY(LinkProgram), - TABLE_ENTRY(ShaderSource), - TABLE_ENTRY(Uniform1f), - TABLE_ENTRY(Uniform1fv), - TABLE_ENTRY(Uniform1i), - TABLE_ENTRY(Uniform1iv), - TABLE_ENTRY(Uniform2f), - TABLE_ENTRY(Uniform2fv), - TABLE_ENTRY(Uniform2i), - TABLE_ENTRY(Uniform2iv), - TABLE_ENTRY(Uniform3f), - TABLE_ENTRY(Uniform3fv), - TABLE_ENTRY(Uniform3i), - TABLE_ENTRY(Uniform3iv), - TABLE_ENTRY(Uniform4f), - TABLE_ENTRY(Uniform4fv), - TABLE_ENTRY(Uniform4i), - TABLE_ENTRY(Uniform4iv), - TABLE_ENTRY(UniformMatrix2fv), - TABLE_ENTRY(UniformMatrix3fv), - TABLE_ENTRY(UniformMatrix4fv), - TABLE_ENTRY(UseProgram), - TABLE_ENTRY(ValidateProgram), - TABLE_ENTRY(BindAttribLocation), - TABLE_ENTRY(GetActiveAttrib), - TABLE_ENTRY(GetAttribLocation), - TABLE_ENTRY(DrawBuffers), - TABLE_ENTRY(DrawBuffersATI), - TABLE_ENTRY(PointParameterf), - TABLE_ENTRY(PointParameterfARB), - TABLE_ENTRY(PointParameterfv), - TABLE_ENTRY(PointParameterfvARB), - TABLE_ENTRY(SecondaryColor3b), - TABLE_ENTRY(SecondaryColor3bv), - TABLE_ENTRY(SecondaryColor3d), - TABLE_ENTRY(SecondaryColor3dv), - TABLE_ENTRY(SecondaryColor3f), - TABLE_ENTRY(SecondaryColor3fv), - TABLE_ENTRY(SecondaryColor3i), - TABLE_ENTRY(SecondaryColor3iv), - TABLE_ENTRY(SecondaryColor3s), - TABLE_ENTRY(SecondaryColor3sv), - TABLE_ENTRY(SecondaryColor3ub), - TABLE_ENTRY(SecondaryColor3ubv), - TABLE_ENTRY(SecondaryColor3ui), - TABLE_ENTRY(SecondaryColor3uiv), - TABLE_ENTRY(SecondaryColor3us), - TABLE_ENTRY(SecondaryColor3usv), - TABLE_ENTRY(SecondaryColorPointer), - TABLE_ENTRY(MultiDrawArrays), - TABLE_ENTRY(MultiDrawElements), - TABLE_ENTRY(FogCoordPointer), - TABLE_ENTRY(FogCoordd), - TABLE_ENTRY(FogCoorddv), - TABLE_ENTRY(FogCoordf), - TABLE_ENTRY(FogCoordfv), - TABLE_ENTRY(BlendFuncSeparate), - TABLE_ENTRY(WindowPos2d), - TABLE_ENTRY(WindowPos2dARB), - TABLE_ENTRY(WindowPos2dv), - TABLE_ENTRY(WindowPos2dvARB), - TABLE_ENTRY(WindowPos2f), - TABLE_ENTRY(WindowPos2fARB), - TABLE_ENTRY(WindowPos2fv), - TABLE_ENTRY(WindowPos2fvARB), - TABLE_ENTRY(WindowPos2i), - TABLE_ENTRY(WindowPos2iARB), - TABLE_ENTRY(WindowPos2iv), - TABLE_ENTRY(WindowPos2ivARB), - TABLE_ENTRY(WindowPos2s), - TABLE_ENTRY(WindowPos2sARB), - TABLE_ENTRY(WindowPos2sv), - TABLE_ENTRY(WindowPos2svARB), - TABLE_ENTRY(WindowPos3d), - TABLE_ENTRY(WindowPos3dARB), - TABLE_ENTRY(WindowPos3dv), - TABLE_ENTRY(WindowPos3dvARB), - TABLE_ENTRY(WindowPos3f), - TABLE_ENTRY(WindowPos3fARB), - TABLE_ENTRY(WindowPos3fv), - TABLE_ENTRY(WindowPos3fvARB), - TABLE_ENTRY(WindowPos3i), - TABLE_ENTRY(WindowPos3iARB), - TABLE_ENTRY(WindowPos3iv), - TABLE_ENTRY(WindowPos3ivARB), - TABLE_ENTRY(WindowPos3s), - TABLE_ENTRY(WindowPos3sARB), - TABLE_ENTRY(WindowPos3sv), - TABLE_ENTRY(WindowPos3svARB), - TABLE_ENTRY(BindProgramARB), - TABLE_ENTRY(DeleteProgramsARB), - TABLE_ENTRY(GenProgramsARB), - TABLE_ENTRY(GetVertexAttribPointerv), - TABLE_ENTRY(GetVertexAttribPointervARB), - TABLE_ENTRY(IsProgramARB), - TABLE_ENTRY(PointParameteri), - TABLE_ENTRY(PointParameteriv), - TABLE_ENTRY(BlendEquationSeparate), -}; -#endif /*UNUSED_TABLE_NAME*/ - - -# undef KEYWORD1 -# undef KEYWORD1_ALT -# undef KEYWORD2 -# undef NAME -# undef DISPATCH -# undef RETURN_DISPATCH -# undef DISPATCH_TABLE_NAME -# undef UNUSED_TABLE_NAME -# undef TABLE_ENTRY -# undef HIDDEN diff --git a/src/libs/mesa/mesa/glapi/glprocs.h b/src/libs/mesa/mesa/glapi/glprocs.h deleted file mode 100644 index 5a99d505ec..0000000000 --- a/src/libs/mesa/mesa/glapi/glprocs.h +++ /dev/null @@ -1,2260 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_procs.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004, 2006 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR 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. - */ - - -/* This file is only included by glapi.c and is used for - * the GetProcAddress() function - */ - -typedef struct { - GLint Name_offset; -#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) - _glapi_proc Address; -#endif - GLuint Offset; -} glprocs_table_t; - -#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } -#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } -#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } -#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } -#endif - - - -static const char gl_string_table[] = - "glNewList\0" - "glEndList\0" - "glCallList\0" - "glCallLists\0" - "glDeleteLists\0" - "glGenLists\0" - "glListBase\0" - "glBegin\0" - "glBitmap\0" - "glColor3b\0" - "glColor3bv\0" - "glColor3d\0" - "glColor3dv\0" - "glColor3f\0" - "glColor3fv\0" - "glColor3i\0" - "glColor3iv\0" - "glColor3s\0" - "glColor3sv\0" - "glColor3ub\0" - "glColor3ubv\0" - "glColor3ui\0" - "glColor3uiv\0" - "glColor3us\0" - "glColor3usv\0" - "glColor4b\0" - "glColor4bv\0" - "glColor4d\0" - "glColor4dv\0" - "glColor4f\0" - "glColor4fv\0" - "glColor4i\0" - "glColor4iv\0" - "glColor4s\0" - "glColor4sv\0" - "glColor4ub\0" - "glColor4ubv\0" - "glColor4ui\0" - "glColor4uiv\0" - "glColor4us\0" - "glColor4usv\0" - "glEdgeFlag\0" - "glEdgeFlagv\0" - "glEnd\0" - "glIndexd\0" - "glIndexdv\0" - "glIndexf\0" - "glIndexfv\0" - "glIndexi\0" - "glIndexiv\0" - "glIndexs\0" - "glIndexsv\0" - "glNormal3b\0" - "glNormal3bv\0" - "glNormal3d\0" - "glNormal3dv\0" - "glNormal3f\0" - "glNormal3fv\0" - "glNormal3i\0" - "glNormal3iv\0" - "glNormal3s\0" - "glNormal3sv\0" - "glRasterPos2d\0" - "glRasterPos2dv\0" - "glRasterPos2f\0" - "glRasterPos2fv\0" - "glRasterPos2i\0" - "glRasterPos2iv\0" - "glRasterPos2s\0" - "glRasterPos2sv\0" - "glRasterPos3d\0" - "glRasterPos3dv\0" - "glRasterPos3f\0" - "glRasterPos3fv\0" - "glRasterPos3i\0" - "glRasterPos3iv\0" - "glRasterPos3s\0" - "glRasterPos3sv\0" - "glRasterPos4d\0" - "glRasterPos4dv\0" - "glRasterPos4f\0" - "glRasterPos4fv\0" - "glRasterPos4i\0" - "glRasterPos4iv\0" - "glRasterPos4s\0" - "glRasterPos4sv\0" - "glRectd\0" - "glRectdv\0" - "glRectf\0" - "glRectfv\0" - "glRecti\0" - "glRectiv\0" - "glRects\0" - "glRectsv\0" - "glTexCoord1d\0" - "glTexCoord1dv\0" - "glTexCoord1f\0" - "glTexCoord1fv\0" - "glTexCoord1i\0" - "glTexCoord1iv\0" - "glTexCoord1s\0" - "glTexCoord1sv\0" - "glTexCoord2d\0" - "glTexCoord2dv\0" - "glTexCoord2f\0" - "glTexCoord2fv\0" - "glTexCoord2i\0" - "glTexCoord2iv\0" - "glTexCoord2s\0" - "glTexCoord2sv\0" - "glTexCoord3d\0" - "glTexCoord3dv\0" - "glTexCoord3f\0" - "glTexCoord3fv\0" - "glTexCoord3i\0" - "glTexCoord3iv\0" - "glTexCoord3s\0" - "glTexCoord3sv\0" - "glTexCoord4d\0" - "glTexCoord4dv\0" - "glTexCoord4f\0" - "glTexCoord4fv\0" - "glTexCoord4i\0" - "glTexCoord4iv\0" - "glTexCoord4s\0" - "glTexCoord4sv\0" - "glVertex2d\0" - "glVertex2dv\0" - "glVertex2f\0" - "glVertex2fv\0" - "glVertex2i\0" - "glVertex2iv\0" - "glVertex2s\0" - "glVertex2sv\0" - "glVertex3d\0" - "glVertex3dv\0" - "glVertex3f\0" - "glVertex3fv\0" - "glVertex3i\0" - "glVertex3iv\0" - "glVertex3s\0" - "glVertex3sv\0" - "glVertex4d\0" - "glVertex4dv\0" - "glVertex4f\0" - "glVertex4fv\0" - "glVertex4i\0" - "glVertex4iv\0" - "glVertex4s\0" - "glVertex4sv\0" - "glClipPlane\0" - "glColorMaterial\0" - "glCullFace\0" - "glFogf\0" - "glFogfv\0" - "glFogi\0" - "glFogiv\0" - "glFrontFace\0" - "glHint\0" - "glLightf\0" - "glLightfv\0" - "glLighti\0" - "glLightiv\0" - "glLightModelf\0" - "glLightModelfv\0" - "glLightModeli\0" - "glLightModeliv\0" - "glLineStipple\0" - "glLineWidth\0" - "glMaterialf\0" - "glMaterialfv\0" - "glMateriali\0" - "glMaterialiv\0" - "glPointSize\0" - "glPolygonMode\0" - "glPolygonStipple\0" - "glScissor\0" - "glShadeModel\0" - "glTexParameterf\0" - "glTexParameterfv\0" - "glTexParameteri\0" - "glTexParameteriv\0" - "glTexImage1D\0" - "glTexImage2D\0" - "glTexEnvf\0" - "glTexEnvfv\0" - "glTexEnvi\0" - "glTexEnviv\0" - "glTexGend\0" - "glTexGendv\0" - "glTexGenf\0" - "glTexGenfv\0" - "glTexGeni\0" - "glTexGeniv\0" - "glFeedbackBuffer\0" - "glSelectBuffer\0" - "glRenderMode\0" - "glInitNames\0" - "glLoadName\0" - "glPassThrough\0" - "glPopName\0" - "glPushName\0" - "glDrawBuffer\0" - "glClear\0" - "glClearAccum\0" - "glClearIndex\0" - "glClearColor\0" - "glClearStencil\0" - "glClearDepth\0" - "glStencilMask\0" - "glColorMask\0" - "glDepthMask\0" - "glIndexMask\0" - "glAccum\0" - "glDisable\0" - "glEnable\0" - "glFinish\0" - "glFlush\0" - "glPopAttrib\0" - "glPushAttrib\0" - "glMap1d\0" - "glMap1f\0" - "glMap2d\0" - "glMap2f\0" - "glMapGrid1d\0" - "glMapGrid1f\0" - "glMapGrid2d\0" - "glMapGrid2f\0" - "glEvalCoord1d\0" - "glEvalCoord1dv\0" - "glEvalCoord1f\0" - "glEvalCoord1fv\0" - "glEvalCoord2d\0" - "glEvalCoord2dv\0" - "glEvalCoord2f\0" - "glEvalCoord2fv\0" - "glEvalMesh1\0" - "glEvalPoint1\0" - "glEvalMesh2\0" - "glEvalPoint2\0" - "glAlphaFunc\0" - "glBlendFunc\0" - "glLogicOp\0" - "glStencilFunc\0" - "glStencilOp\0" - "glDepthFunc\0" - "glPixelZoom\0" - "glPixelTransferf\0" - "glPixelTransferi\0" - "glPixelStoref\0" - "glPixelStorei\0" - "glPixelMapfv\0" - "glPixelMapuiv\0" - "glPixelMapusv\0" - "glReadBuffer\0" - "glCopyPixels\0" - "glReadPixels\0" - "glDrawPixels\0" - "glGetBooleanv\0" - "glGetClipPlane\0" - "glGetDoublev\0" - "glGetError\0" - "glGetFloatv\0" - "glGetIntegerv\0" - "glGetLightfv\0" - "glGetLightiv\0" - "glGetMapdv\0" - "glGetMapfv\0" - "glGetMapiv\0" - "glGetMaterialfv\0" - "glGetMaterialiv\0" - "glGetPixelMapfv\0" - "glGetPixelMapuiv\0" - "glGetPixelMapusv\0" - "glGetPolygonStipple\0" - "glGetString\0" - "glGetTexEnvfv\0" - "glGetTexEnviv\0" - "glGetTexGendv\0" - "glGetTexGenfv\0" - "glGetTexGeniv\0" - "glGetTexImage\0" - "glGetTexParameterfv\0" - "glGetTexParameteriv\0" - "glGetTexLevelParameterfv\0" - "glGetTexLevelParameteriv\0" - "glIsEnabled\0" - "glIsList\0" - "glDepthRange\0" - "glFrustum\0" - "glLoadIdentity\0" - "glLoadMatrixf\0" - "glLoadMatrixd\0" - "glMatrixMode\0" - "glMultMatrixf\0" - "glMultMatrixd\0" - "glOrtho\0" - "glPopMatrix\0" - "glPushMatrix\0" - "glRotated\0" - "glRotatef\0" - "glScaled\0" - "glScalef\0" - "glTranslated\0" - "glTranslatef\0" - "glViewport\0" - "glArrayElement\0" - "glBindTexture\0" - "glColorPointer\0" - "glDisableClientState\0" - "glDrawArrays\0" - "glDrawElements\0" - "glEdgeFlagPointer\0" - "glEnableClientState\0" - "glIndexPointer\0" - "glIndexub\0" - "glIndexubv\0" - "glInterleavedArrays\0" - "glNormalPointer\0" - "glPolygonOffset\0" - "glTexCoordPointer\0" - "glVertexPointer\0" - "glAreTexturesResident\0" - "glCopyTexImage1D\0" - "glCopyTexImage2D\0" - "glCopyTexSubImage1D\0" - "glCopyTexSubImage2D\0" - "glDeleteTextures\0" - "glGenTextures\0" - "glGetPointerv\0" - "glIsTexture\0" - "glPrioritizeTextures\0" - "glTexSubImage1D\0" - "glTexSubImage2D\0" - "glPopClientAttrib\0" - "glPushClientAttrib\0" - "glBlendColor\0" - "glBlendEquation\0" - "glDrawRangeElements\0" - "glColorTable\0" - "glColorTableParameterfv\0" - "glColorTableParameteriv\0" - "glCopyColorTable\0" - "glGetColorTable\0" - "glGetColorTableParameterfv\0" - "glGetColorTableParameteriv\0" - "glColorSubTable\0" - "glCopyColorSubTable\0" - "glConvolutionFilter1D\0" - "glConvolutionFilter2D\0" - "glConvolutionParameterf\0" - "glConvolutionParameterfv\0" - "glConvolutionParameteri\0" - "glConvolutionParameteriv\0" - "glCopyConvolutionFilter1D\0" - "glCopyConvolutionFilter2D\0" - "glGetConvolutionFilter\0" - "glGetConvolutionParameterfv\0" - "glGetConvolutionParameteriv\0" - "glGetSeparableFilter\0" - "glSeparableFilter2D\0" - "glGetHistogram\0" - "glGetHistogramParameterfv\0" - "glGetHistogramParameteriv\0" - "glGetMinmax\0" - "glGetMinmaxParameterfv\0" - "glGetMinmaxParameteriv\0" - "glHistogram\0" - "glMinmax\0" - "glResetHistogram\0" - "glResetMinmax\0" - "glTexImage3D\0" - "glTexSubImage3D\0" - "glCopyTexSubImage3D\0" - "glActiveTextureARB\0" - "glClientActiveTextureARB\0" - "glMultiTexCoord1dARB\0" - "glMultiTexCoord1dvARB\0" - "glMultiTexCoord1fARB\0" - "glMultiTexCoord1fvARB\0" - "glMultiTexCoord1iARB\0" - "glMultiTexCoord1ivARB\0" - "glMultiTexCoord1sARB\0" - "glMultiTexCoord1svARB\0" - "glMultiTexCoord2dARB\0" - "glMultiTexCoord2dvARB\0" - "glMultiTexCoord2fARB\0" - "glMultiTexCoord2fvARB\0" - "glMultiTexCoord2iARB\0" - "glMultiTexCoord2ivARB\0" - "glMultiTexCoord2sARB\0" - "glMultiTexCoord2svARB\0" - "glMultiTexCoord3dARB\0" - "glMultiTexCoord3dvARB\0" - "glMultiTexCoord3fARB\0" - "glMultiTexCoord3fvARB\0" - "glMultiTexCoord3iARB\0" - "glMultiTexCoord3ivARB\0" - "glMultiTexCoord3sARB\0" - "glMultiTexCoord3svARB\0" - "glMultiTexCoord4dARB\0" - "glMultiTexCoord4dvARB\0" - "glMultiTexCoord4fARB\0" - "glMultiTexCoord4fvARB\0" - "glMultiTexCoord4iARB\0" - "glMultiTexCoord4ivARB\0" - "glMultiTexCoord4sARB\0" - "glMultiTexCoord4svARB\0" - "glAttachShader\0" - "glCreateProgram\0" - "glCreateShader\0" - "glDeleteProgram\0" - "glDeleteShader\0" - "glDetachShader\0" - "glGetAttachedShaders\0" - "glGetProgramInfoLog\0" - "glGetProgramiv\0" - "glGetShaderInfoLog\0" - "glGetShaderiv\0" - "glIsProgram\0" - "glIsShader\0" - "glStencilFuncSeparate\0" - "glStencilMaskSeparate\0" - "glStencilOpSeparate\0" - "glUniformMatrix2x3fv\0" - "glUniformMatrix2x4fv\0" - "glUniformMatrix3x2fv\0" - "glUniformMatrix3x4fv\0" - "glUniformMatrix4x2fv\0" - "glUniformMatrix4x3fv\0" - "glLoadTransposeMatrixdARB\0" - "glLoadTransposeMatrixfARB\0" - "glMultTransposeMatrixdARB\0" - "glMultTransposeMatrixfARB\0" - "glSampleCoverageARB\0" - "glCompressedTexImage1DARB\0" - "glCompressedTexImage2DARB\0" - "glCompressedTexImage3DARB\0" - "glCompressedTexSubImage1DARB\0" - "glCompressedTexSubImage2DARB\0" - "glCompressedTexSubImage3DARB\0" - "glGetCompressedTexImageARB\0" - "glDisableVertexAttribArrayARB\0" - "glEnableVertexAttribArrayARB\0" - "glGetProgramEnvParameterdvARB\0" - "glGetProgramEnvParameterfvARB\0" - "glGetProgramLocalParameterdvARB\0" - "glGetProgramLocalParameterfvARB\0" - "glGetProgramStringARB\0" - "glGetProgramivARB\0" - "glGetVertexAttribdvARB\0" - "glGetVertexAttribfvARB\0" - "glGetVertexAttribivARB\0" - "glProgramEnvParameter4dARB\0" - "glProgramEnvParameter4dvARB\0" - "glProgramEnvParameter4fARB\0" - "glProgramEnvParameter4fvARB\0" - "glProgramLocalParameter4dARB\0" - "glProgramLocalParameter4dvARB\0" - "glProgramLocalParameter4fARB\0" - "glProgramLocalParameter4fvARB\0" - "glProgramStringARB\0" - "glVertexAttrib1dARB\0" - "glVertexAttrib1dvARB\0" - "glVertexAttrib1fARB\0" - "glVertexAttrib1fvARB\0" - "glVertexAttrib1sARB\0" - "glVertexAttrib1svARB\0" - "glVertexAttrib2dARB\0" - "glVertexAttrib2dvARB\0" - "glVertexAttrib2fARB\0" - "glVertexAttrib2fvARB\0" - "glVertexAttrib2sARB\0" - "glVertexAttrib2svARB\0" - "glVertexAttrib3dARB\0" - "glVertexAttrib3dvARB\0" - "glVertexAttrib3fARB\0" - "glVertexAttrib3fvARB\0" - "glVertexAttrib3sARB\0" - "glVertexAttrib3svARB\0" - "glVertexAttrib4NbvARB\0" - "glVertexAttrib4NivARB\0" - "glVertexAttrib4NsvARB\0" - "glVertexAttrib4NubARB\0" - "glVertexAttrib4NubvARB\0" - "glVertexAttrib4NuivARB\0" - "glVertexAttrib4NusvARB\0" - "glVertexAttrib4bvARB\0" - "glVertexAttrib4dARB\0" - "glVertexAttrib4dvARB\0" - "glVertexAttrib4fARB\0" - "glVertexAttrib4fvARB\0" - "glVertexAttrib4ivARB\0" - "glVertexAttrib4sARB\0" - "glVertexAttrib4svARB\0" - "glVertexAttrib4ubvARB\0" - "glVertexAttrib4uivARB\0" - "glVertexAttrib4usvARB\0" - "glVertexAttribPointerARB\0" - "glBindBufferARB\0" - "glBufferDataARB\0" - "glBufferSubDataARB\0" - "glDeleteBuffersARB\0" - "glGenBuffersARB\0" - "glGetBufferParameterivARB\0" - "glGetBufferPointervARB\0" - "glGetBufferSubDataARB\0" - "glIsBufferARB\0" - "glMapBufferARB\0" - "glUnmapBufferARB\0" - "glBeginQueryARB\0" - "glDeleteQueriesARB\0" - "glEndQueryARB\0" - "glGenQueriesARB\0" - "glGetQueryObjectivARB\0" - "glGetQueryObjectuivARB\0" - "glGetQueryivARB\0" - "glIsQueryARB\0" - "glAttachObjectARB\0" - "glCompileShaderARB\0" - "glCreateProgramObjectARB\0" - "glCreateShaderObjectARB\0" - "glDeleteObjectARB\0" - "glDetachObjectARB\0" - "glGetActiveUniformARB\0" - "glGetAttachedObjectsARB\0" - "glGetHandleARB\0" - "glGetInfoLogARB\0" - "glGetObjectParameterfvARB\0" - "glGetObjectParameterivARB\0" - "glGetShaderSourceARB\0" - "glGetUniformLocationARB\0" - "glGetUniformfvARB\0" - "glGetUniformivARB\0" - "glLinkProgramARB\0" - "glShaderSourceARB\0" - "glUniform1fARB\0" - "glUniform1fvARB\0" - "glUniform1iARB\0" - "glUniform1ivARB\0" - "glUniform2fARB\0" - "glUniform2fvARB\0" - "glUniform2iARB\0" - "glUniform2ivARB\0" - "glUniform3fARB\0" - "glUniform3fvARB\0" - "glUniform3iARB\0" - "glUniform3ivARB\0" - "glUniform4fARB\0" - "glUniform4fvARB\0" - "glUniform4iARB\0" - "glUniform4ivARB\0" - "glUniformMatrix2fvARB\0" - "glUniformMatrix3fvARB\0" - "glUniformMatrix4fvARB\0" - "glUseProgramObjectARB\0" - "glValidateProgramARB\0" - "glBindAttribLocationARB\0" - "glGetActiveAttribARB\0" - "glGetAttribLocationARB\0" - "glDrawBuffersARB\0" - "glPolygonOffsetEXT\0" - "glGetPixelTexGenParameterfvSGIS\0" - "glGetPixelTexGenParameterivSGIS\0" - "glPixelTexGenParameterfSGIS\0" - "glPixelTexGenParameterfvSGIS\0" - "glPixelTexGenParameteriSGIS\0" - "glPixelTexGenParameterivSGIS\0" - "glSampleMaskSGIS\0" - "glSamplePatternSGIS\0" - "glColorPointerEXT\0" - "glEdgeFlagPointerEXT\0" - "glIndexPointerEXT\0" - "glNormalPointerEXT\0" - "glTexCoordPointerEXT\0" - "glVertexPointerEXT\0" - "glPointParameterfEXT\0" - "glPointParameterfvEXT\0" - "glLockArraysEXT\0" - "glUnlockArraysEXT\0" - "glCullParameterdvEXT\0" - "glCullParameterfvEXT\0" - "glSecondaryColor3bEXT\0" - "glSecondaryColor3bvEXT\0" - "glSecondaryColor3dEXT\0" - "glSecondaryColor3dvEXT\0" - "glSecondaryColor3fEXT\0" - "glSecondaryColor3fvEXT\0" - "glSecondaryColor3iEXT\0" - "glSecondaryColor3ivEXT\0" - "glSecondaryColor3sEXT\0" - "glSecondaryColor3svEXT\0" - "glSecondaryColor3ubEXT\0" - "glSecondaryColor3ubvEXT\0" - "glSecondaryColor3uiEXT\0" - "glSecondaryColor3uivEXT\0" - "glSecondaryColor3usEXT\0" - "glSecondaryColor3usvEXT\0" - "glSecondaryColorPointerEXT\0" - "glMultiDrawArraysEXT\0" - "glMultiDrawElementsEXT\0" - "glFogCoordPointerEXT\0" - "glFogCoorddEXT\0" - "glFogCoorddvEXT\0" - "glFogCoordfEXT\0" - "glFogCoordfvEXT\0" - "glPixelTexGenSGIX\0" - "glBlendFuncSeparateEXT\0" - "glFlushVertexArrayRangeNV\0" - "glVertexArrayRangeNV\0" - "glCombinerInputNV\0" - "glCombinerOutputNV\0" - "glCombinerParameterfNV\0" - "glCombinerParameterfvNV\0" - "glCombinerParameteriNV\0" - "glCombinerParameterivNV\0" - "glFinalCombinerInputNV\0" - "glGetCombinerInputParameterfvNV\0" - "glGetCombinerInputParameterivNV\0" - "glGetCombinerOutputParameterfvNV\0" - "glGetCombinerOutputParameterivNV\0" - "glGetFinalCombinerInputParameterfvNV\0" - "glGetFinalCombinerInputParameterivNV\0" - "glResizeBuffersMESA\0" - "glWindowPos2dMESA\0" - "glWindowPos2dvMESA\0" - "glWindowPos2fMESA\0" - "glWindowPos2fvMESA\0" - "glWindowPos2iMESA\0" - "glWindowPos2ivMESA\0" - "glWindowPos2sMESA\0" - "glWindowPos2svMESA\0" - "glWindowPos3dMESA\0" - "glWindowPos3dvMESA\0" - "glWindowPos3fMESA\0" - "glWindowPos3fvMESA\0" - "glWindowPos3iMESA\0" - "glWindowPos3ivMESA\0" - "glWindowPos3sMESA\0" - "glWindowPos3svMESA\0" - "glWindowPos4dMESA\0" - "glWindowPos4dvMESA\0" - "glWindowPos4fMESA\0" - "glWindowPos4fvMESA\0" - "glWindowPos4iMESA\0" - "glWindowPos4ivMESA\0" - "glWindowPos4sMESA\0" - "glWindowPos4svMESA\0" - "glMultiModeDrawArraysIBM\0" - "glMultiModeDrawElementsIBM\0" - "glDeleteFencesNV\0" - "glFinishFenceNV\0" - "glGenFencesNV\0" - "glGetFenceivNV\0" - "glIsFenceNV\0" - "glSetFenceNV\0" - "glTestFenceNV\0" - "glAreProgramsResidentNV\0" - "glBindProgramNV\0" - "glDeleteProgramsNV\0" - "glExecuteProgramNV\0" - "glGenProgramsNV\0" - "glGetProgramParameterdvNV\0" - "glGetProgramParameterfvNV\0" - "glGetProgramStringNV\0" - "glGetProgramivNV\0" - "glGetTrackMatrixivNV\0" - "glGetVertexAttribPointervNV\0" - "glGetVertexAttribdvNV\0" - "glGetVertexAttribfvNV\0" - "glGetVertexAttribivNV\0" - "glIsProgramNV\0" - "glLoadProgramNV\0" - "glProgramParameters4dvNV\0" - "glProgramParameters4fvNV\0" - "glRequestResidentProgramsNV\0" - "glTrackMatrixNV\0" - "glVertexAttrib1dNV\0" - "glVertexAttrib1dvNV\0" - "glVertexAttrib1fNV\0" - "glVertexAttrib1fvNV\0" - "glVertexAttrib1sNV\0" - "glVertexAttrib1svNV\0" - "glVertexAttrib2dNV\0" - "glVertexAttrib2dvNV\0" - "glVertexAttrib2fNV\0" - "glVertexAttrib2fvNV\0" - "glVertexAttrib2sNV\0" - "glVertexAttrib2svNV\0" - "glVertexAttrib3dNV\0" - "glVertexAttrib3dvNV\0" - "glVertexAttrib3fNV\0" - "glVertexAttrib3fvNV\0" - "glVertexAttrib3sNV\0" - "glVertexAttrib3svNV\0" - "glVertexAttrib4dNV\0" - "glVertexAttrib4dvNV\0" - "glVertexAttrib4fNV\0" - "glVertexAttrib4fvNV\0" - "glVertexAttrib4sNV\0" - "glVertexAttrib4svNV\0" - "glVertexAttrib4ubNV\0" - "glVertexAttrib4ubvNV\0" - "glVertexAttribPointerNV\0" - "glVertexAttribs1dvNV\0" - "glVertexAttribs1fvNV\0" - "glVertexAttribs1svNV\0" - "glVertexAttribs2dvNV\0" - "glVertexAttribs2fvNV\0" - "glVertexAttribs2svNV\0" - "glVertexAttribs3dvNV\0" - "glVertexAttribs3fvNV\0" - "glVertexAttribs3svNV\0" - "glVertexAttribs4dvNV\0" - "glVertexAttribs4fvNV\0" - "glVertexAttribs4svNV\0" - "glVertexAttribs4ubvNV\0" - "glAlphaFragmentOp1ATI\0" - "glAlphaFragmentOp2ATI\0" - "glAlphaFragmentOp3ATI\0" - "glBeginFragmentShaderATI\0" - "glBindFragmentShaderATI\0" - "glColorFragmentOp1ATI\0" - "glColorFragmentOp2ATI\0" - "glColorFragmentOp3ATI\0" - "glDeleteFragmentShaderATI\0" - "glEndFragmentShaderATI\0" - "glGenFragmentShadersATI\0" - "glPassTexCoordATI\0" - "glSampleMapATI\0" - "glSetFragmentShaderConstantATI\0" - "glPointParameteriNV\0" - "glPointParameterivNV\0" - "glActiveStencilFaceEXT\0" - "glBindVertexArrayAPPLE\0" - "glDeleteVertexArraysAPPLE\0" - "glGenVertexArraysAPPLE\0" - "glIsVertexArrayAPPLE\0" - "glGetProgramNamedParameterdvNV\0" - "glGetProgramNamedParameterfvNV\0" - "glProgramNamedParameter4dNV\0" - "glProgramNamedParameter4dvNV\0" - "glProgramNamedParameter4fNV\0" - "glProgramNamedParameter4fvNV\0" - "glDepthBoundsEXT\0" - "glBlendEquationSeparateEXT\0" - "glBindFramebufferEXT\0" - "glBindRenderbufferEXT\0" - "glCheckFramebufferStatusEXT\0" - "glDeleteFramebuffersEXT\0" - "glDeleteRenderbuffersEXT\0" - "glFramebufferRenderbufferEXT\0" - "glFramebufferTexture1DEXT\0" - "glFramebufferTexture2DEXT\0" - "glFramebufferTexture3DEXT\0" - "glGenFramebuffersEXT\0" - "glGenRenderbuffersEXT\0" - "glGenerateMipmapEXT\0" - "glGetFramebufferAttachmentParameterivEXT\0" - "glGetRenderbufferParameterivEXT\0" - "glIsFramebufferEXT\0" - "glIsRenderbufferEXT\0" - "glRenderbufferStorageEXT\0" - "glBlitFramebufferEXT\0" - "glFramebufferTextureLayerEXT\0" - "glStencilFuncSeparateATI\0" - "glProgramEnvParameters4fvEXT\0" - "glProgramLocalParameters4fvEXT\0" - "glGetQueryObjecti64vEXT\0" - "glGetQueryObjectui64vEXT\0" - "glArrayElementEXT\0" - "glBindTextureEXT\0" - "glDrawArraysEXT\0" - "glAreTexturesResidentEXT\0" - "glCopyTexImage1DEXT\0" - "glCopyTexImage2DEXT\0" - "glCopyTexSubImage1DEXT\0" - "glCopyTexSubImage2DEXT\0" - "glDeleteTexturesEXT\0" - "glGenTexturesEXT\0" - "glGetPointervEXT\0" - "glIsTextureEXT\0" - "glPrioritizeTexturesEXT\0" - "glTexSubImage1DEXT\0" - "glTexSubImage2DEXT\0" - "glBlendColorEXT\0" - "glBlendEquationEXT\0" - "glDrawRangeElementsEXT\0" - "glColorTableSGI\0" - "glColorTableEXT\0" - "glColorTableParameterfvSGI\0" - "glColorTableParameterivSGI\0" - "glCopyColorTableSGI\0" - "glGetColorTableSGI\0" - "glGetColorTableEXT\0" - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterfvEXT\0" - "glGetColorTableParameterivSGI\0" - "glGetColorTableParameterivEXT\0" - "glColorSubTableEXT\0" - "glCopyColorSubTableEXT\0" - "glConvolutionFilter1DEXT\0" - "glConvolutionFilter2DEXT\0" - "glConvolutionParameterfEXT\0" - "glConvolutionParameterfvEXT\0" - "glConvolutionParameteriEXT\0" - "glConvolutionParameterivEXT\0" - "glCopyConvolutionFilter1DEXT\0" - "glCopyConvolutionFilter2DEXT\0" - "glGetConvolutionFilterEXT\0" - "glGetConvolutionParameterfvEXT\0" - "glGetConvolutionParameterivEXT\0" - "glGetSeparableFilterEXT\0" - "glSeparableFilter2DEXT\0" - "glGetHistogramEXT\0" - "glGetHistogramParameterfvEXT\0" - "glGetHistogramParameterivEXT\0" - "glGetMinmaxEXT\0" - "glGetMinmaxParameterfvEXT\0" - "glGetMinmaxParameterivEXT\0" - "glHistogramEXT\0" - "glMinmaxEXT\0" - "glResetHistogramEXT\0" - "glResetMinmaxEXT\0" - "glTexImage3DEXT\0" - "glTexSubImage3DEXT\0" - "glCopyTexSubImage3DEXT\0" - "glActiveTexture\0" - "glClientActiveTexture\0" - "glMultiTexCoord1d\0" - "glMultiTexCoord1dv\0" - "glMultiTexCoord1f\0" - "glMultiTexCoord1fv\0" - "glMultiTexCoord1i\0" - "glMultiTexCoord1iv\0" - "glMultiTexCoord1s\0" - "glMultiTexCoord1sv\0" - "glMultiTexCoord2d\0" - "glMultiTexCoord2dv\0" - "glMultiTexCoord2f\0" - "glMultiTexCoord2fv\0" - "glMultiTexCoord2i\0" - "glMultiTexCoord2iv\0" - "glMultiTexCoord2s\0" - "glMultiTexCoord2sv\0" - "glMultiTexCoord3d\0" - "glMultiTexCoord3dv\0" - "glMultiTexCoord3f\0" - "glMultiTexCoord3fv\0" - "glMultiTexCoord3i\0" - "glMultiTexCoord3iv\0" - "glMultiTexCoord3s\0" - "glMultiTexCoord3sv\0" - "glMultiTexCoord4d\0" - "glMultiTexCoord4dv\0" - "glMultiTexCoord4f\0" - "glMultiTexCoord4fv\0" - "glMultiTexCoord4i\0" - "glMultiTexCoord4iv\0" - "glMultiTexCoord4s\0" - "glMultiTexCoord4sv\0" - "glStencilOpSeparateATI\0" - "glLoadTransposeMatrixd\0" - "glLoadTransposeMatrixf\0" - "glMultTransposeMatrixd\0" - "glMultTransposeMatrixf\0" - "glSampleCoverage\0" - "glCompressedTexImage1D\0" - "glCompressedTexImage2D\0" - "glCompressedTexImage3D\0" - "glCompressedTexSubImage1D\0" - "glCompressedTexSubImage2D\0" - "glCompressedTexSubImage3D\0" - "glGetCompressedTexImage\0" - "glDisableVertexAttribArray\0" - "glEnableVertexAttribArray\0" - "glGetVertexAttribdv\0" - "glGetVertexAttribfv\0" - "glGetVertexAttribiv\0" - "glProgramParameter4dNV\0" - "glProgramParameter4dvNV\0" - "glProgramParameter4fNV\0" - "glProgramParameter4fvNV\0" - "glVertexAttrib1d\0" - "glVertexAttrib1dv\0" - "glVertexAttrib1f\0" - "glVertexAttrib1fv\0" - "glVertexAttrib1s\0" - "glVertexAttrib1sv\0" - "glVertexAttrib2d\0" - "glVertexAttrib2dv\0" - "glVertexAttrib2f\0" - "glVertexAttrib2fv\0" - "glVertexAttrib2s\0" - "glVertexAttrib2sv\0" - "glVertexAttrib3d\0" - "glVertexAttrib3dv\0" - "glVertexAttrib3f\0" - "glVertexAttrib3fv\0" - "glVertexAttrib3s\0" - "glVertexAttrib3sv\0" - "glVertexAttrib4Nbv\0" - "glVertexAttrib4Niv\0" - "glVertexAttrib4Nsv\0" - "glVertexAttrib4Nub\0" - "glVertexAttrib4Nubv\0" - "glVertexAttrib4Nuiv\0" - "glVertexAttrib4Nusv\0" - "glVertexAttrib4bv\0" - "glVertexAttrib4d\0" - "glVertexAttrib4dv\0" - "glVertexAttrib4f\0" - "glVertexAttrib4fv\0" - "glVertexAttrib4iv\0" - "glVertexAttrib4s\0" - "glVertexAttrib4sv\0" - "glVertexAttrib4ubv\0" - "glVertexAttrib4uiv\0" - "glVertexAttrib4usv\0" - "glVertexAttribPointer\0" - "glBindBuffer\0" - "glBufferData\0" - "glBufferSubData\0" - "glDeleteBuffers\0" - "glGenBuffers\0" - "glGetBufferParameteriv\0" - "glGetBufferPointerv\0" - "glGetBufferSubData\0" - "glIsBuffer\0" - "glMapBuffer\0" - "glUnmapBuffer\0" - "glBeginQuery\0" - "glDeleteQueries\0" - "glEndQuery\0" - "glGenQueries\0" - "glGetQueryObjectiv\0" - "glGetQueryObjectuiv\0" - "glGetQueryiv\0" - "glIsQuery\0" - "glCompileShader\0" - "glGetActiveUniform\0" - "glGetShaderSource\0" - "glGetUniformLocation\0" - "glGetUniformfv\0" - "glGetUniformiv\0" - "glLinkProgram\0" - "glShaderSource\0" - "glUniform1f\0" - "glUniform1fv\0" - "glUniform1i\0" - "glUniform1iv\0" - "glUniform2f\0" - "glUniform2fv\0" - "glUniform2i\0" - "glUniform2iv\0" - "glUniform3f\0" - "glUniform3fv\0" - "glUniform3i\0" - "glUniform3iv\0" - "glUniform4f\0" - "glUniform4fv\0" - "glUniform4i\0" - "glUniform4iv\0" - "glUniformMatrix2fv\0" - "glUniformMatrix3fv\0" - "glUniformMatrix4fv\0" - "glUseProgram\0" - "glValidateProgram\0" - "glBindAttribLocation\0" - "glGetActiveAttrib\0" - "glGetAttribLocation\0" - "glDrawBuffers\0" - "glDrawBuffersATI\0" - "glSampleMaskEXT\0" - "glSamplePatternEXT\0" - "glPointParameterf\0" - "glPointParameterfARB\0" - "glPointParameterfSGIS\0" - "glPointParameterfv\0" - "glPointParameterfvARB\0" - "glPointParameterfvSGIS\0" - "glSecondaryColor3b\0" - "glSecondaryColor3bv\0" - "glSecondaryColor3d\0" - "glSecondaryColor3dv\0" - "glSecondaryColor3f\0" - "glSecondaryColor3fv\0" - "glSecondaryColor3i\0" - "glSecondaryColor3iv\0" - "glSecondaryColor3s\0" - "glSecondaryColor3sv\0" - "glSecondaryColor3ub\0" - "glSecondaryColor3ubv\0" - "glSecondaryColor3ui\0" - "glSecondaryColor3uiv\0" - "glSecondaryColor3us\0" - "glSecondaryColor3usv\0" - "glSecondaryColorPointer\0" - "glMultiDrawArrays\0" - "glMultiDrawElements\0" - "glFogCoordPointer\0" - "glFogCoordd\0" - "glFogCoorddv\0" - "glFogCoordf\0" - "glFogCoordfv\0" - "glBlendFuncSeparate\0" - "glBlendFuncSeparateINGR\0" - "glWindowPos2d\0" - "glWindowPos2dARB\0" - "glWindowPos2dv\0" - "glWindowPos2dvARB\0" - "glWindowPos2f\0" - "glWindowPos2fARB\0" - "glWindowPos2fv\0" - "glWindowPos2fvARB\0" - "glWindowPos2i\0" - "glWindowPos2iARB\0" - "glWindowPos2iv\0" - "glWindowPos2ivARB\0" - "glWindowPos2s\0" - "glWindowPos2sARB\0" - "glWindowPos2sv\0" - "glWindowPos2svARB\0" - "glWindowPos3d\0" - "glWindowPos3dARB\0" - "glWindowPos3dv\0" - "glWindowPos3dvARB\0" - "glWindowPos3f\0" - "glWindowPos3fARB\0" - "glWindowPos3fv\0" - "glWindowPos3fvARB\0" - "glWindowPos3i\0" - "glWindowPos3iARB\0" - "glWindowPos3iv\0" - "glWindowPos3ivARB\0" - "glWindowPos3s\0" - "glWindowPos3sARB\0" - "glWindowPos3sv\0" - "glWindowPos3svARB\0" - "glBindProgramARB\0" - "glDeleteProgramsARB\0" - "glGenProgramsARB\0" - "glGetVertexAttribPointerv\0" - "glGetVertexAttribPointervARB\0" - "glIsProgramARB\0" - "glPointParameteri\0" - "glPointParameteriv\0" - "glBlendEquationSeparate\0" - "glBlendEquationSeparateATI\0" - ; - - -#ifdef USE_MGL_NAMESPACE -#define gl_dispatch_stub_343 mgl_dispatch_stub_343 -#define gl_dispatch_stub_344 mgl_dispatch_stub_344 -#define gl_dispatch_stub_345 mgl_dispatch_stub_345 -#define gl_dispatch_stub_356 mgl_dispatch_stub_356 -#define gl_dispatch_stub_357 mgl_dispatch_stub_357 -#define gl_dispatch_stub_358 mgl_dispatch_stub_358 -#define gl_dispatch_stub_359 mgl_dispatch_stub_359 -#define gl_dispatch_stub_361 mgl_dispatch_stub_361 -#define gl_dispatch_stub_362 mgl_dispatch_stub_362 -#define gl_dispatch_stub_363 mgl_dispatch_stub_363 -#define gl_dispatch_stub_364 mgl_dispatch_stub_364 -#define gl_dispatch_stub_365 mgl_dispatch_stub_365 -#define gl_dispatch_stub_366 mgl_dispatch_stub_366 -#define gl_dispatch_stub_562 mgl_dispatch_stub_562 -#define gl_dispatch_stub_563 mgl_dispatch_stub_563 -#define gl_dispatch_stub_564 mgl_dispatch_stub_564 -#define gl_dispatch_stub_565 mgl_dispatch_stub_565 -#define gl_dispatch_stub_566 mgl_dispatch_stub_566 -#define gl_dispatch_stub_567 mgl_dispatch_stub_567 -#define gl_dispatch_stub_568 mgl_dispatch_stub_568 -#define gl_dispatch_stub_569 mgl_dispatch_stub_569 -#define gl_dispatch_stub_580 mgl_dispatch_stub_580 -#define gl_dispatch_stub_581 mgl_dispatch_stub_581 -#define gl_dispatch_stub_606 mgl_dispatch_stub_606 -#define gl_dispatch_stub_648 mgl_dispatch_stub_648 -#define gl_dispatch_stub_649 mgl_dispatch_stub_649 -#define gl_dispatch_stub_650 mgl_dispatch_stub_650 -#define gl_dispatch_stub_651 mgl_dispatch_stub_651 -#define gl_dispatch_stub_652 mgl_dispatch_stub_652 -#define gl_dispatch_stub_653 mgl_dispatch_stub_653 -#define gl_dispatch_stub_654 mgl_dispatch_stub_654 -#define gl_dispatch_stub_655 mgl_dispatch_stub_655 -#define gl_dispatch_stub_656 mgl_dispatch_stub_656 -#define gl_dispatch_stub_733 mgl_dispatch_stub_733 -#define gl_dispatch_stub_734 mgl_dispatch_stub_734 -#define gl_dispatch_stub_735 mgl_dispatch_stub_735 -#define gl_dispatch_stub_736 mgl_dispatch_stub_736 -#define gl_dispatch_stub_737 mgl_dispatch_stub_737 -#define gl_dispatch_stub_744 mgl_dispatch_stub_744 -#define gl_dispatch_stub_745 mgl_dispatch_stub_745 -#define gl_dispatch_stub_763 mgl_dispatch_stub_763 -#define gl_dispatch_stub_765 mgl_dispatch_stub_765 -#define gl_dispatch_stub_766 mgl_dispatch_stub_766 -#define gl_dispatch_stub_767 mgl_dispatch_stub_767 -#define gl_dispatch_stub_768 mgl_dispatch_stub_768 -#define gl_dispatch_stub_769 mgl_dispatch_stub_769 -#endif /* USE_MGL_NAMESPACE */ - - -/* FIXME: Having these (incorrect) prototypes here is ugly. */ -#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) -extern void gl_dispatch_stub_343(void); -extern void gl_dispatch_stub_344(void); -extern void gl_dispatch_stub_345(void); -extern void gl_dispatch_stub_356(void); -extern void gl_dispatch_stub_357(void); -extern void gl_dispatch_stub_358(void); -extern void gl_dispatch_stub_359(void); -extern void gl_dispatch_stub_361(void); -extern void gl_dispatch_stub_362(void); -extern void gl_dispatch_stub_363(void); -extern void gl_dispatch_stub_364(void); -extern void gl_dispatch_stub_365(void); -extern void gl_dispatch_stub_366(void); -extern void gl_dispatch_stub_562(void); -extern void gl_dispatch_stub_563(void); -extern void gl_dispatch_stub_564(void); -extern void gl_dispatch_stub_565(void); -extern void gl_dispatch_stub_566(void); -extern void gl_dispatch_stub_567(void); -extern void gl_dispatch_stub_568(void); -extern void gl_dispatch_stub_569(void); -extern void gl_dispatch_stub_580(void); -extern void gl_dispatch_stub_581(void); -extern void gl_dispatch_stub_606(void); -extern void gl_dispatch_stub_648(void); -extern void gl_dispatch_stub_649(void); -extern void gl_dispatch_stub_650(void); -extern void gl_dispatch_stub_651(void); -extern void gl_dispatch_stub_652(void); -extern void gl_dispatch_stub_653(void); -extern void gl_dispatch_stub_654(void); -extern void gl_dispatch_stub_655(void); -extern void gl_dispatch_stub_656(void); -extern void gl_dispatch_stub_733(void); -extern void gl_dispatch_stub_734(void); -extern void gl_dispatch_stub_735(void); -extern void gl_dispatch_stub_736(void); -extern void gl_dispatch_stub_737(void); -extern void gl_dispatch_stub_744(void); -extern void gl_dispatch_stub_745(void); -extern void gl_dispatch_stub_763(void); -extern void gl_dispatch_stub_765(void); -extern void gl_dispatch_stub_766(void); -extern void gl_dispatch_stub_767(void); -extern void gl_dispatch_stub_768(void); -extern void gl_dispatch_stub_769(void); -#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ - -static const glprocs_table_t static_functions[] = { - NAME_FUNC_OFFSET( 0, glNewList, glNewList, NULL, _gloffset_NewList), - NAME_FUNC_OFFSET( 10, glEndList, glEndList, NULL, _gloffset_EndList), - NAME_FUNC_OFFSET( 20, glCallList, glCallList, NULL, _gloffset_CallList), - NAME_FUNC_OFFSET( 31, glCallLists, glCallLists, NULL, _gloffset_CallLists), - NAME_FUNC_OFFSET( 43, glDeleteLists, glDeleteLists, NULL, _gloffset_DeleteLists), - NAME_FUNC_OFFSET( 57, glGenLists, glGenLists, NULL, _gloffset_GenLists), - NAME_FUNC_OFFSET( 68, glListBase, glListBase, NULL, _gloffset_ListBase), - NAME_FUNC_OFFSET( 79, glBegin, glBegin, NULL, _gloffset_Begin), - NAME_FUNC_OFFSET( 87, glBitmap, glBitmap, NULL, _gloffset_Bitmap), - NAME_FUNC_OFFSET( 96, glColor3b, glColor3b, NULL, _gloffset_Color3b), - NAME_FUNC_OFFSET( 106, glColor3bv, glColor3bv, NULL, _gloffset_Color3bv), - NAME_FUNC_OFFSET( 117, glColor3d, glColor3d, NULL, _gloffset_Color3d), - NAME_FUNC_OFFSET( 127, glColor3dv, glColor3dv, NULL, _gloffset_Color3dv), - NAME_FUNC_OFFSET( 138, glColor3f, glColor3f, NULL, _gloffset_Color3f), - NAME_FUNC_OFFSET( 148, glColor3fv, glColor3fv, NULL, _gloffset_Color3fv), - NAME_FUNC_OFFSET( 159, glColor3i, glColor3i, NULL, _gloffset_Color3i), - NAME_FUNC_OFFSET( 169, glColor3iv, glColor3iv, NULL, _gloffset_Color3iv), - NAME_FUNC_OFFSET( 180, glColor3s, glColor3s, NULL, _gloffset_Color3s), - NAME_FUNC_OFFSET( 190, glColor3sv, glColor3sv, NULL, _gloffset_Color3sv), - NAME_FUNC_OFFSET( 201, glColor3ub, glColor3ub, NULL, _gloffset_Color3ub), - NAME_FUNC_OFFSET( 212, glColor3ubv, glColor3ubv, NULL, _gloffset_Color3ubv), - NAME_FUNC_OFFSET( 224, glColor3ui, glColor3ui, NULL, _gloffset_Color3ui), - NAME_FUNC_OFFSET( 235, glColor3uiv, glColor3uiv, NULL, _gloffset_Color3uiv), - NAME_FUNC_OFFSET( 247, glColor3us, glColor3us, NULL, _gloffset_Color3us), - NAME_FUNC_OFFSET( 258, glColor3usv, glColor3usv, NULL, _gloffset_Color3usv), - NAME_FUNC_OFFSET( 270, glColor4b, glColor4b, NULL, _gloffset_Color4b), - NAME_FUNC_OFFSET( 280, glColor4bv, glColor4bv, NULL, _gloffset_Color4bv), - NAME_FUNC_OFFSET( 291, glColor4d, glColor4d, NULL, _gloffset_Color4d), - NAME_FUNC_OFFSET( 301, glColor4dv, glColor4dv, NULL, _gloffset_Color4dv), - NAME_FUNC_OFFSET( 312, glColor4f, glColor4f, NULL, _gloffset_Color4f), - NAME_FUNC_OFFSET( 322, glColor4fv, glColor4fv, NULL, _gloffset_Color4fv), - NAME_FUNC_OFFSET( 333, glColor4i, glColor4i, NULL, _gloffset_Color4i), - NAME_FUNC_OFFSET( 343, glColor4iv, glColor4iv, NULL, _gloffset_Color4iv), - NAME_FUNC_OFFSET( 354, glColor4s, glColor4s, NULL, _gloffset_Color4s), - NAME_FUNC_OFFSET( 364, glColor4sv, glColor4sv, NULL, _gloffset_Color4sv), - NAME_FUNC_OFFSET( 375, glColor4ub, glColor4ub, NULL, _gloffset_Color4ub), - NAME_FUNC_OFFSET( 386, glColor4ubv, glColor4ubv, NULL, _gloffset_Color4ubv), - NAME_FUNC_OFFSET( 398, glColor4ui, glColor4ui, NULL, _gloffset_Color4ui), - NAME_FUNC_OFFSET( 409, glColor4uiv, glColor4uiv, NULL, _gloffset_Color4uiv), - NAME_FUNC_OFFSET( 421, glColor4us, glColor4us, NULL, _gloffset_Color4us), - NAME_FUNC_OFFSET( 432, glColor4usv, glColor4usv, NULL, _gloffset_Color4usv), - NAME_FUNC_OFFSET( 444, glEdgeFlag, glEdgeFlag, NULL, _gloffset_EdgeFlag), - NAME_FUNC_OFFSET( 455, glEdgeFlagv, glEdgeFlagv, NULL, _gloffset_EdgeFlagv), - NAME_FUNC_OFFSET( 467, glEnd, glEnd, NULL, _gloffset_End), - NAME_FUNC_OFFSET( 473, glIndexd, glIndexd, NULL, _gloffset_Indexd), - NAME_FUNC_OFFSET( 482, glIndexdv, glIndexdv, NULL, _gloffset_Indexdv), - NAME_FUNC_OFFSET( 492, glIndexf, glIndexf, NULL, _gloffset_Indexf), - NAME_FUNC_OFFSET( 501, glIndexfv, glIndexfv, NULL, _gloffset_Indexfv), - NAME_FUNC_OFFSET( 511, glIndexi, glIndexi, NULL, _gloffset_Indexi), - NAME_FUNC_OFFSET( 520, glIndexiv, glIndexiv, NULL, _gloffset_Indexiv), - NAME_FUNC_OFFSET( 530, glIndexs, glIndexs, NULL, _gloffset_Indexs), - NAME_FUNC_OFFSET( 539, glIndexsv, glIndexsv, NULL, _gloffset_Indexsv), - NAME_FUNC_OFFSET( 549, glNormal3b, glNormal3b, NULL, _gloffset_Normal3b), - NAME_FUNC_OFFSET( 560, glNormal3bv, glNormal3bv, NULL, _gloffset_Normal3bv), - NAME_FUNC_OFFSET( 572, glNormal3d, glNormal3d, NULL, _gloffset_Normal3d), - NAME_FUNC_OFFSET( 583, glNormal3dv, glNormal3dv, NULL, _gloffset_Normal3dv), - NAME_FUNC_OFFSET( 595, glNormal3f, glNormal3f, NULL, _gloffset_Normal3f), - NAME_FUNC_OFFSET( 606, glNormal3fv, glNormal3fv, NULL, _gloffset_Normal3fv), - NAME_FUNC_OFFSET( 618, glNormal3i, glNormal3i, NULL, _gloffset_Normal3i), - NAME_FUNC_OFFSET( 629, glNormal3iv, glNormal3iv, NULL, _gloffset_Normal3iv), - NAME_FUNC_OFFSET( 641, glNormal3s, glNormal3s, NULL, _gloffset_Normal3s), - NAME_FUNC_OFFSET( 652, glNormal3sv, glNormal3sv, NULL, _gloffset_Normal3sv), - NAME_FUNC_OFFSET( 664, glRasterPos2d, glRasterPos2d, NULL, _gloffset_RasterPos2d), - NAME_FUNC_OFFSET( 678, glRasterPos2dv, glRasterPos2dv, NULL, _gloffset_RasterPos2dv), - NAME_FUNC_OFFSET( 693, glRasterPos2f, glRasterPos2f, NULL, _gloffset_RasterPos2f), - NAME_FUNC_OFFSET( 707, glRasterPos2fv, glRasterPos2fv, NULL, _gloffset_RasterPos2fv), - NAME_FUNC_OFFSET( 722, glRasterPos2i, glRasterPos2i, NULL, _gloffset_RasterPos2i), - NAME_FUNC_OFFSET( 736, glRasterPos2iv, glRasterPos2iv, NULL, _gloffset_RasterPos2iv), - NAME_FUNC_OFFSET( 751, glRasterPos2s, glRasterPos2s, NULL, _gloffset_RasterPos2s), - NAME_FUNC_OFFSET( 765, glRasterPos2sv, glRasterPos2sv, NULL, _gloffset_RasterPos2sv), - NAME_FUNC_OFFSET( 780, glRasterPos3d, glRasterPos3d, NULL, _gloffset_RasterPos3d), - NAME_FUNC_OFFSET( 794, glRasterPos3dv, glRasterPos3dv, NULL, _gloffset_RasterPos3dv), - NAME_FUNC_OFFSET( 809, glRasterPos3f, glRasterPos3f, NULL, _gloffset_RasterPos3f), - NAME_FUNC_OFFSET( 823, glRasterPos3fv, glRasterPos3fv, NULL, _gloffset_RasterPos3fv), - NAME_FUNC_OFFSET( 838, glRasterPos3i, glRasterPos3i, NULL, _gloffset_RasterPos3i), - NAME_FUNC_OFFSET( 852, glRasterPos3iv, glRasterPos3iv, NULL, _gloffset_RasterPos3iv), - NAME_FUNC_OFFSET( 867, glRasterPos3s, glRasterPos3s, NULL, _gloffset_RasterPos3s), - NAME_FUNC_OFFSET( 881, glRasterPos3sv, glRasterPos3sv, NULL, _gloffset_RasterPos3sv), - NAME_FUNC_OFFSET( 896, glRasterPos4d, glRasterPos4d, NULL, _gloffset_RasterPos4d), - NAME_FUNC_OFFSET( 910, glRasterPos4dv, glRasterPos4dv, NULL, _gloffset_RasterPos4dv), - NAME_FUNC_OFFSET( 925, glRasterPos4f, glRasterPos4f, NULL, _gloffset_RasterPos4f), - NAME_FUNC_OFFSET( 939, glRasterPos4fv, glRasterPos4fv, NULL, _gloffset_RasterPos4fv), - NAME_FUNC_OFFSET( 954, glRasterPos4i, glRasterPos4i, NULL, _gloffset_RasterPos4i), - NAME_FUNC_OFFSET( 968, glRasterPos4iv, glRasterPos4iv, NULL, _gloffset_RasterPos4iv), - NAME_FUNC_OFFSET( 983, glRasterPos4s, glRasterPos4s, NULL, _gloffset_RasterPos4s), - NAME_FUNC_OFFSET( 997, glRasterPos4sv, glRasterPos4sv, NULL, _gloffset_RasterPos4sv), - NAME_FUNC_OFFSET( 1012, glRectd, glRectd, NULL, _gloffset_Rectd), - NAME_FUNC_OFFSET( 1020, glRectdv, glRectdv, NULL, _gloffset_Rectdv), - NAME_FUNC_OFFSET( 1029, glRectf, glRectf, NULL, _gloffset_Rectf), - NAME_FUNC_OFFSET( 1037, glRectfv, glRectfv, NULL, _gloffset_Rectfv), - NAME_FUNC_OFFSET( 1046, glRecti, glRecti, NULL, _gloffset_Recti), - NAME_FUNC_OFFSET( 1054, glRectiv, glRectiv, NULL, _gloffset_Rectiv), - NAME_FUNC_OFFSET( 1063, glRects, glRects, NULL, _gloffset_Rects), - NAME_FUNC_OFFSET( 1071, glRectsv, glRectsv, NULL, _gloffset_Rectsv), - NAME_FUNC_OFFSET( 1080, glTexCoord1d, glTexCoord1d, NULL, _gloffset_TexCoord1d), - NAME_FUNC_OFFSET( 1093, glTexCoord1dv, glTexCoord1dv, NULL, _gloffset_TexCoord1dv), - NAME_FUNC_OFFSET( 1107, glTexCoord1f, glTexCoord1f, NULL, _gloffset_TexCoord1f), - NAME_FUNC_OFFSET( 1120, glTexCoord1fv, glTexCoord1fv, NULL, _gloffset_TexCoord1fv), - NAME_FUNC_OFFSET( 1134, glTexCoord1i, glTexCoord1i, NULL, _gloffset_TexCoord1i), - NAME_FUNC_OFFSET( 1147, glTexCoord1iv, glTexCoord1iv, NULL, _gloffset_TexCoord1iv), - NAME_FUNC_OFFSET( 1161, glTexCoord1s, glTexCoord1s, NULL, _gloffset_TexCoord1s), - NAME_FUNC_OFFSET( 1174, glTexCoord1sv, glTexCoord1sv, NULL, _gloffset_TexCoord1sv), - NAME_FUNC_OFFSET( 1188, glTexCoord2d, glTexCoord2d, NULL, _gloffset_TexCoord2d), - NAME_FUNC_OFFSET( 1201, glTexCoord2dv, glTexCoord2dv, NULL, _gloffset_TexCoord2dv), - NAME_FUNC_OFFSET( 1215, glTexCoord2f, glTexCoord2f, NULL, _gloffset_TexCoord2f), - NAME_FUNC_OFFSET( 1228, glTexCoord2fv, glTexCoord2fv, NULL, _gloffset_TexCoord2fv), - NAME_FUNC_OFFSET( 1242, glTexCoord2i, glTexCoord2i, NULL, _gloffset_TexCoord2i), - NAME_FUNC_OFFSET( 1255, glTexCoord2iv, glTexCoord2iv, NULL, _gloffset_TexCoord2iv), - NAME_FUNC_OFFSET( 1269, glTexCoord2s, glTexCoord2s, NULL, _gloffset_TexCoord2s), - NAME_FUNC_OFFSET( 1282, glTexCoord2sv, glTexCoord2sv, NULL, _gloffset_TexCoord2sv), - NAME_FUNC_OFFSET( 1296, glTexCoord3d, glTexCoord3d, NULL, _gloffset_TexCoord3d), - NAME_FUNC_OFFSET( 1309, glTexCoord3dv, glTexCoord3dv, NULL, _gloffset_TexCoord3dv), - NAME_FUNC_OFFSET( 1323, glTexCoord3f, glTexCoord3f, NULL, _gloffset_TexCoord3f), - NAME_FUNC_OFFSET( 1336, glTexCoord3fv, glTexCoord3fv, NULL, _gloffset_TexCoord3fv), - NAME_FUNC_OFFSET( 1350, glTexCoord3i, glTexCoord3i, NULL, _gloffset_TexCoord3i), - NAME_FUNC_OFFSET( 1363, glTexCoord3iv, glTexCoord3iv, NULL, _gloffset_TexCoord3iv), - NAME_FUNC_OFFSET( 1377, glTexCoord3s, glTexCoord3s, NULL, _gloffset_TexCoord3s), - NAME_FUNC_OFFSET( 1390, glTexCoord3sv, glTexCoord3sv, NULL, _gloffset_TexCoord3sv), - NAME_FUNC_OFFSET( 1404, glTexCoord4d, glTexCoord4d, NULL, _gloffset_TexCoord4d), - NAME_FUNC_OFFSET( 1417, glTexCoord4dv, glTexCoord4dv, NULL, _gloffset_TexCoord4dv), - NAME_FUNC_OFFSET( 1431, glTexCoord4f, glTexCoord4f, NULL, _gloffset_TexCoord4f), - NAME_FUNC_OFFSET( 1444, glTexCoord4fv, glTexCoord4fv, NULL, _gloffset_TexCoord4fv), - NAME_FUNC_OFFSET( 1458, glTexCoord4i, glTexCoord4i, NULL, _gloffset_TexCoord4i), - NAME_FUNC_OFFSET( 1471, glTexCoord4iv, glTexCoord4iv, NULL, _gloffset_TexCoord4iv), - NAME_FUNC_OFFSET( 1485, glTexCoord4s, glTexCoord4s, NULL, _gloffset_TexCoord4s), - NAME_FUNC_OFFSET( 1498, glTexCoord4sv, glTexCoord4sv, NULL, _gloffset_TexCoord4sv), - NAME_FUNC_OFFSET( 1512, glVertex2d, glVertex2d, NULL, _gloffset_Vertex2d), - NAME_FUNC_OFFSET( 1523, glVertex2dv, glVertex2dv, NULL, _gloffset_Vertex2dv), - NAME_FUNC_OFFSET( 1535, glVertex2f, glVertex2f, NULL, _gloffset_Vertex2f), - NAME_FUNC_OFFSET( 1546, glVertex2fv, glVertex2fv, NULL, _gloffset_Vertex2fv), - NAME_FUNC_OFFSET( 1558, glVertex2i, glVertex2i, NULL, _gloffset_Vertex2i), - NAME_FUNC_OFFSET( 1569, glVertex2iv, glVertex2iv, NULL, _gloffset_Vertex2iv), - NAME_FUNC_OFFSET( 1581, glVertex2s, glVertex2s, NULL, _gloffset_Vertex2s), - NAME_FUNC_OFFSET( 1592, glVertex2sv, glVertex2sv, NULL, _gloffset_Vertex2sv), - NAME_FUNC_OFFSET( 1604, glVertex3d, glVertex3d, NULL, _gloffset_Vertex3d), - NAME_FUNC_OFFSET( 1615, glVertex3dv, glVertex3dv, NULL, _gloffset_Vertex3dv), - NAME_FUNC_OFFSET( 1627, glVertex3f, glVertex3f, NULL, _gloffset_Vertex3f), - NAME_FUNC_OFFSET( 1638, glVertex3fv, glVertex3fv, NULL, _gloffset_Vertex3fv), - NAME_FUNC_OFFSET( 1650, glVertex3i, glVertex3i, NULL, _gloffset_Vertex3i), - NAME_FUNC_OFFSET( 1661, glVertex3iv, glVertex3iv, NULL, _gloffset_Vertex3iv), - NAME_FUNC_OFFSET( 1673, glVertex3s, glVertex3s, NULL, _gloffset_Vertex3s), - NAME_FUNC_OFFSET( 1684, glVertex3sv, glVertex3sv, NULL, _gloffset_Vertex3sv), - NAME_FUNC_OFFSET( 1696, glVertex4d, glVertex4d, NULL, _gloffset_Vertex4d), - NAME_FUNC_OFFSET( 1707, glVertex4dv, glVertex4dv, NULL, _gloffset_Vertex4dv), - NAME_FUNC_OFFSET( 1719, glVertex4f, glVertex4f, NULL, _gloffset_Vertex4f), - NAME_FUNC_OFFSET( 1730, glVertex4fv, glVertex4fv, NULL, _gloffset_Vertex4fv), - NAME_FUNC_OFFSET( 1742, glVertex4i, glVertex4i, NULL, _gloffset_Vertex4i), - NAME_FUNC_OFFSET( 1753, glVertex4iv, glVertex4iv, NULL, _gloffset_Vertex4iv), - NAME_FUNC_OFFSET( 1765, glVertex4s, glVertex4s, NULL, _gloffset_Vertex4s), - NAME_FUNC_OFFSET( 1776, glVertex4sv, glVertex4sv, NULL, _gloffset_Vertex4sv), - NAME_FUNC_OFFSET( 1788, glClipPlane, glClipPlane, NULL, _gloffset_ClipPlane), - NAME_FUNC_OFFSET( 1800, glColorMaterial, glColorMaterial, NULL, _gloffset_ColorMaterial), - NAME_FUNC_OFFSET( 1816, glCullFace, glCullFace, NULL, _gloffset_CullFace), - NAME_FUNC_OFFSET( 1827, glFogf, glFogf, NULL, _gloffset_Fogf), - NAME_FUNC_OFFSET( 1834, glFogfv, glFogfv, NULL, _gloffset_Fogfv), - NAME_FUNC_OFFSET( 1842, glFogi, glFogi, NULL, _gloffset_Fogi), - NAME_FUNC_OFFSET( 1849, glFogiv, glFogiv, NULL, _gloffset_Fogiv), - NAME_FUNC_OFFSET( 1857, glFrontFace, glFrontFace, NULL, _gloffset_FrontFace), - NAME_FUNC_OFFSET( 1869, glHint, glHint, NULL, _gloffset_Hint), - NAME_FUNC_OFFSET( 1876, glLightf, glLightf, NULL, _gloffset_Lightf), - NAME_FUNC_OFFSET( 1885, glLightfv, glLightfv, NULL, _gloffset_Lightfv), - NAME_FUNC_OFFSET( 1895, glLighti, glLighti, NULL, _gloffset_Lighti), - NAME_FUNC_OFFSET( 1904, glLightiv, glLightiv, NULL, _gloffset_Lightiv), - NAME_FUNC_OFFSET( 1914, glLightModelf, glLightModelf, NULL, _gloffset_LightModelf), - NAME_FUNC_OFFSET( 1928, glLightModelfv, glLightModelfv, NULL, _gloffset_LightModelfv), - NAME_FUNC_OFFSET( 1943, glLightModeli, glLightModeli, NULL, _gloffset_LightModeli), - NAME_FUNC_OFFSET( 1957, glLightModeliv, glLightModeliv, NULL, _gloffset_LightModeliv), - NAME_FUNC_OFFSET( 1972, glLineStipple, glLineStipple, NULL, _gloffset_LineStipple), - NAME_FUNC_OFFSET( 1986, glLineWidth, glLineWidth, NULL, _gloffset_LineWidth), - NAME_FUNC_OFFSET( 1998, glMaterialf, glMaterialf, NULL, _gloffset_Materialf), - NAME_FUNC_OFFSET( 2010, glMaterialfv, glMaterialfv, NULL, _gloffset_Materialfv), - NAME_FUNC_OFFSET( 2023, glMateriali, glMateriali, NULL, _gloffset_Materiali), - NAME_FUNC_OFFSET( 2035, glMaterialiv, glMaterialiv, NULL, _gloffset_Materialiv), - NAME_FUNC_OFFSET( 2048, glPointSize, glPointSize, NULL, _gloffset_PointSize), - NAME_FUNC_OFFSET( 2060, glPolygonMode, glPolygonMode, NULL, _gloffset_PolygonMode), - NAME_FUNC_OFFSET( 2074, glPolygonStipple, glPolygonStipple, NULL, _gloffset_PolygonStipple), - NAME_FUNC_OFFSET( 2091, glScissor, glScissor, NULL, _gloffset_Scissor), - NAME_FUNC_OFFSET( 2101, glShadeModel, glShadeModel, NULL, _gloffset_ShadeModel), - NAME_FUNC_OFFSET( 2114, glTexParameterf, glTexParameterf, NULL, _gloffset_TexParameterf), - NAME_FUNC_OFFSET( 2130, glTexParameterfv, glTexParameterfv, NULL, _gloffset_TexParameterfv), - NAME_FUNC_OFFSET( 2147, glTexParameteri, glTexParameteri, NULL, _gloffset_TexParameteri), - NAME_FUNC_OFFSET( 2163, glTexParameteriv, glTexParameteriv, NULL, _gloffset_TexParameteriv), - NAME_FUNC_OFFSET( 2180, glTexImage1D, glTexImage1D, NULL, _gloffset_TexImage1D), - NAME_FUNC_OFFSET( 2193, glTexImage2D, glTexImage2D, NULL, _gloffset_TexImage2D), - NAME_FUNC_OFFSET( 2206, glTexEnvf, glTexEnvf, NULL, _gloffset_TexEnvf), - NAME_FUNC_OFFSET( 2216, glTexEnvfv, glTexEnvfv, NULL, _gloffset_TexEnvfv), - NAME_FUNC_OFFSET( 2227, glTexEnvi, glTexEnvi, NULL, _gloffset_TexEnvi), - NAME_FUNC_OFFSET( 2237, glTexEnviv, glTexEnviv, NULL, _gloffset_TexEnviv), - NAME_FUNC_OFFSET( 2248, glTexGend, glTexGend, NULL, _gloffset_TexGend), - NAME_FUNC_OFFSET( 2258, glTexGendv, glTexGendv, NULL, _gloffset_TexGendv), - NAME_FUNC_OFFSET( 2269, glTexGenf, glTexGenf, NULL, _gloffset_TexGenf), - NAME_FUNC_OFFSET( 2279, glTexGenfv, glTexGenfv, NULL, _gloffset_TexGenfv), - NAME_FUNC_OFFSET( 2290, glTexGeni, glTexGeni, NULL, _gloffset_TexGeni), - NAME_FUNC_OFFSET( 2300, glTexGeniv, glTexGeniv, NULL, _gloffset_TexGeniv), - NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, glFeedbackBuffer, NULL, _gloffset_FeedbackBuffer), - NAME_FUNC_OFFSET( 2328, glSelectBuffer, glSelectBuffer, NULL, _gloffset_SelectBuffer), - NAME_FUNC_OFFSET( 2343, glRenderMode, glRenderMode, NULL, _gloffset_RenderMode), - NAME_FUNC_OFFSET( 2356, glInitNames, glInitNames, NULL, _gloffset_InitNames), - NAME_FUNC_OFFSET( 2368, glLoadName, glLoadName, NULL, _gloffset_LoadName), - NAME_FUNC_OFFSET( 2379, glPassThrough, glPassThrough, NULL, _gloffset_PassThrough), - NAME_FUNC_OFFSET( 2393, glPopName, glPopName, NULL, _gloffset_PopName), - NAME_FUNC_OFFSET( 2403, glPushName, glPushName, NULL, _gloffset_PushName), - NAME_FUNC_OFFSET( 2414, glDrawBuffer, glDrawBuffer, NULL, _gloffset_DrawBuffer), - NAME_FUNC_OFFSET( 2427, glClear, glClear, NULL, _gloffset_Clear), - NAME_FUNC_OFFSET( 2435, glClearAccum, glClearAccum, NULL, _gloffset_ClearAccum), - NAME_FUNC_OFFSET( 2448, glClearIndex, glClearIndex, NULL, _gloffset_ClearIndex), - NAME_FUNC_OFFSET( 2461, glClearColor, glClearColor, NULL, _gloffset_ClearColor), - NAME_FUNC_OFFSET( 2474, glClearStencil, glClearStencil, NULL, _gloffset_ClearStencil), - NAME_FUNC_OFFSET( 2489, glClearDepth, glClearDepth, NULL, _gloffset_ClearDepth), - NAME_FUNC_OFFSET( 2502, glStencilMask, glStencilMask, NULL, _gloffset_StencilMask), - NAME_FUNC_OFFSET( 2516, glColorMask, glColorMask, NULL, _gloffset_ColorMask), - NAME_FUNC_OFFSET( 2528, glDepthMask, glDepthMask, NULL, _gloffset_DepthMask), - NAME_FUNC_OFFSET( 2540, glIndexMask, glIndexMask, NULL, _gloffset_IndexMask), - NAME_FUNC_OFFSET( 2552, glAccum, glAccum, NULL, _gloffset_Accum), - NAME_FUNC_OFFSET( 2560, glDisable, glDisable, NULL, _gloffset_Disable), - NAME_FUNC_OFFSET( 2570, glEnable, glEnable, NULL, _gloffset_Enable), - NAME_FUNC_OFFSET( 2579, glFinish, glFinish, NULL, _gloffset_Finish), - NAME_FUNC_OFFSET( 2588, glFlush, glFlush, NULL, _gloffset_Flush), - NAME_FUNC_OFFSET( 2596, glPopAttrib, glPopAttrib, NULL, _gloffset_PopAttrib), - NAME_FUNC_OFFSET( 2608, glPushAttrib, glPushAttrib, NULL, _gloffset_PushAttrib), - NAME_FUNC_OFFSET( 2621, glMap1d, glMap1d, NULL, _gloffset_Map1d), - NAME_FUNC_OFFSET( 2629, glMap1f, glMap1f, NULL, _gloffset_Map1f), - NAME_FUNC_OFFSET( 2637, glMap2d, glMap2d, NULL, _gloffset_Map2d), - NAME_FUNC_OFFSET( 2645, glMap2f, glMap2f, NULL, _gloffset_Map2f), - NAME_FUNC_OFFSET( 2653, glMapGrid1d, glMapGrid1d, NULL, _gloffset_MapGrid1d), - NAME_FUNC_OFFSET( 2665, glMapGrid1f, glMapGrid1f, NULL, _gloffset_MapGrid1f), - NAME_FUNC_OFFSET( 2677, glMapGrid2d, glMapGrid2d, NULL, _gloffset_MapGrid2d), - NAME_FUNC_OFFSET( 2689, glMapGrid2f, glMapGrid2f, NULL, _gloffset_MapGrid2f), - NAME_FUNC_OFFSET( 2701, glEvalCoord1d, glEvalCoord1d, NULL, _gloffset_EvalCoord1d), - NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, glEvalCoord1dv, NULL, _gloffset_EvalCoord1dv), - NAME_FUNC_OFFSET( 2730, glEvalCoord1f, glEvalCoord1f, NULL, _gloffset_EvalCoord1f), - NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, glEvalCoord1fv, NULL, _gloffset_EvalCoord1fv), - NAME_FUNC_OFFSET( 2759, glEvalCoord2d, glEvalCoord2d, NULL, _gloffset_EvalCoord2d), - NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, glEvalCoord2dv, NULL, _gloffset_EvalCoord2dv), - NAME_FUNC_OFFSET( 2788, glEvalCoord2f, glEvalCoord2f, NULL, _gloffset_EvalCoord2f), - NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, glEvalCoord2fv, NULL, _gloffset_EvalCoord2fv), - NAME_FUNC_OFFSET( 2817, glEvalMesh1, glEvalMesh1, NULL, _gloffset_EvalMesh1), - NAME_FUNC_OFFSET( 2829, glEvalPoint1, glEvalPoint1, NULL, _gloffset_EvalPoint1), - NAME_FUNC_OFFSET( 2842, glEvalMesh2, glEvalMesh2, NULL, _gloffset_EvalMesh2), - NAME_FUNC_OFFSET( 2854, glEvalPoint2, glEvalPoint2, NULL, _gloffset_EvalPoint2), - NAME_FUNC_OFFSET( 2867, glAlphaFunc, glAlphaFunc, NULL, _gloffset_AlphaFunc), - NAME_FUNC_OFFSET( 2879, glBlendFunc, glBlendFunc, NULL, _gloffset_BlendFunc), - NAME_FUNC_OFFSET( 2891, glLogicOp, glLogicOp, NULL, _gloffset_LogicOp), - NAME_FUNC_OFFSET( 2901, glStencilFunc, glStencilFunc, NULL, _gloffset_StencilFunc), - NAME_FUNC_OFFSET( 2915, glStencilOp, glStencilOp, NULL, _gloffset_StencilOp), - NAME_FUNC_OFFSET( 2927, glDepthFunc, glDepthFunc, NULL, _gloffset_DepthFunc), - NAME_FUNC_OFFSET( 2939, glPixelZoom, glPixelZoom, NULL, _gloffset_PixelZoom), - NAME_FUNC_OFFSET( 2951, glPixelTransferf, glPixelTransferf, NULL, _gloffset_PixelTransferf), - NAME_FUNC_OFFSET( 2968, glPixelTransferi, glPixelTransferi, NULL, _gloffset_PixelTransferi), - NAME_FUNC_OFFSET( 2985, glPixelStoref, glPixelStoref, NULL, _gloffset_PixelStoref), - NAME_FUNC_OFFSET( 2999, glPixelStorei, glPixelStorei, NULL, _gloffset_PixelStorei), - NAME_FUNC_OFFSET( 3013, glPixelMapfv, glPixelMapfv, NULL, _gloffset_PixelMapfv), - NAME_FUNC_OFFSET( 3026, glPixelMapuiv, glPixelMapuiv, NULL, _gloffset_PixelMapuiv), - NAME_FUNC_OFFSET( 3040, glPixelMapusv, glPixelMapusv, NULL, _gloffset_PixelMapusv), - NAME_FUNC_OFFSET( 3054, glReadBuffer, glReadBuffer, NULL, _gloffset_ReadBuffer), - NAME_FUNC_OFFSET( 3067, glCopyPixels, glCopyPixels, NULL, _gloffset_CopyPixels), - NAME_FUNC_OFFSET( 3080, glReadPixels, glReadPixels, NULL, _gloffset_ReadPixels), - NAME_FUNC_OFFSET( 3093, glDrawPixels, glDrawPixels, NULL, _gloffset_DrawPixels), - NAME_FUNC_OFFSET( 3106, glGetBooleanv, glGetBooleanv, NULL, _gloffset_GetBooleanv), - NAME_FUNC_OFFSET( 3120, glGetClipPlane, glGetClipPlane, NULL, _gloffset_GetClipPlane), - NAME_FUNC_OFFSET( 3135, glGetDoublev, glGetDoublev, NULL, _gloffset_GetDoublev), - NAME_FUNC_OFFSET( 3148, glGetError, glGetError, NULL, _gloffset_GetError), - NAME_FUNC_OFFSET( 3159, glGetFloatv, glGetFloatv, NULL, _gloffset_GetFloatv), - NAME_FUNC_OFFSET( 3171, glGetIntegerv, glGetIntegerv, NULL, _gloffset_GetIntegerv), - NAME_FUNC_OFFSET( 3185, glGetLightfv, glGetLightfv, NULL, _gloffset_GetLightfv), - NAME_FUNC_OFFSET( 3198, glGetLightiv, glGetLightiv, NULL, _gloffset_GetLightiv), - NAME_FUNC_OFFSET( 3211, glGetMapdv, glGetMapdv, NULL, _gloffset_GetMapdv), - NAME_FUNC_OFFSET( 3222, glGetMapfv, glGetMapfv, NULL, _gloffset_GetMapfv), - NAME_FUNC_OFFSET( 3233, glGetMapiv, glGetMapiv, NULL, _gloffset_GetMapiv), - NAME_FUNC_OFFSET( 3244, glGetMaterialfv, glGetMaterialfv, NULL, _gloffset_GetMaterialfv), - NAME_FUNC_OFFSET( 3260, glGetMaterialiv, glGetMaterialiv, NULL, _gloffset_GetMaterialiv), - NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, glGetPixelMapfv, NULL, _gloffset_GetPixelMapfv), - NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, _gloffset_GetPixelMapuiv), - NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, glGetPixelMapusv, NULL, _gloffset_GetPixelMapusv), - NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, glGetPolygonStipple, NULL, _gloffset_GetPolygonStipple), - NAME_FUNC_OFFSET( 3346, glGetString, glGetString, NULL, _gloffset_GetString), - NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, glGetTexEnvfv, NULL, _gloffset_GetTexEnvfv), - NAME_FUNC_OFFSET( 3372, glGetTexEnviv, glGetTexEnviv, NULL, _gloffset_GetTexEnviv), - NAME_FUNC_OFFSET( 3386, glGetTexGendv, glGetTexGendv, NULL, _gloffset_GetTexGendv), - NAME_FUNC_OFFSET( 3400, glGetTexGenfv, glGetTexGenfv, NULL, _gloffset_GetTexGenfv), - NAME_FUNC_OFFSET( 3414, glGetTexGeniv, glGetTexGeniv, NULL, _gloffset_GetTexGeniv), - NAME_FUNC_OFFSET( 3428, glGetTexImage, glGetTexImage, NULL, _gloffset_GetTexImage), - NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, glGetTexParameterfv, NULL, _gloffset_GetTexParameterfv), - NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, glGetTexParameteriv, NULL, _gloffset_GetTexParameteriv), - NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, NULL, _gloffset_GetTexLevelParameterfv), - NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, NULL, _gloffset_GetTexLevelParameteriv), - NAME_FUNC_OFFSET( 3532, glIsEnabled, glIsEnabled, NULL, _gloffset_IsEnabled), - NAME_FUNC_OFFSET( 3544, glIsList, glIsList, NULL, _gloffset_IsList), - NAME_FUNC_OFFSET( 3553, glDepthRange, glDepthRange, NULL, _gloffset_DepthRange), - NAME_FUNC_OFFSET( 3566, glFrustum, glFrustum, NULL, _gloffset_Frustum), - NAME_FUNC_OFFSET( 3576, glLoadIdentity, glLoadIdentity, NULL, _gloffset_LoadIdentity), - NAME_FUNC_OFFSET( 3591, glLoadMatrixf, glLoadMatrixf, NULL, _gloffset_LoadMatrixf), - NAME_FUNC_OFFSET( 3605, glLoadMatrixd, glLoadMatrixd, NULL, _gloffset_LoadMatrixd), - NAME_FUNC_OFFSET( 3619, glMatrixMode, glMatrixMode, NULL, _gloffset_MatrixMode), - NAME_FUNC_OFFSET( 3632, glMultMatrixf, glMultMatrixf, NULL, _gloffset_MultMatrixf), - NAME_FUNC_OFFSET( 3646, glMultMatrixd, glMultMatrixd, NULL, _gloffset_MultMatrixd), - NAME_FUNC_OFFSET( 3660, glOrtho, glOrtho, NULL, _gloffset_Ortho), - NAME_FUNC_OFFSET( 3668, glPopMatrix, glPopMatrix, NULL, _gloffset_PopMatrix), - NAME_FUNC_OFFSET( 3680, glPushMatrix, glPushMatrix, NULL, _gloffset_PushMatrix), - NAME_FUNC_OFFSET( 3693, glRotated, glRotated, NULL, _gloffset_Rotated), - NAME_FUNC_OFFSET( 3703, glRotatef, glRotatef, NULL, _gloffset_Rotatef), - NAME_FUNC_OFFSET( 3713, glScaled, glScaled, NULL, _gloffset_Scaled), - NAME_FUNC_OFFSET( 3722, glScalef, glScalef, NULL, _gloffset_Scalef), - NAME_FUNC_OFFSET( 3731, glTranslated, glTranslated, NULL, _gloffset_Translated), - NAME_FUNC_OFFSET( 3744, glTranslatef, glTranslatef, NULL, _gloffset_Translatef), - NAME_FUNC_OFFSET( 3757, glViewport, glViewport, NULL, _gloffset_Viewport), - NAME_FUNC_OFFSET( 3768, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET( 3783, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET( 3797, glColorPointer, glColorPointer, NULL, _gloffset_ColorPointer), - NAME_FUNC_OFFSET( 3812, glDisableClientState, glDisableClientState, NULL, _gloffset_DisableClientState), - NAME_FUNC_OFFSET( 3833, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET( 3846, glDrawElements, glDrawElements, NULL, _gloffset_DrawElements), - NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, _gloffset_EdgeFlagPointer), - NAME_FUNC_OFFSET( 3879, glEnableClientState, glEnableClientState, NULL, _gloffset_EnableClientState), - NAME_FUNC_OFFSET( 3899, glIndexPointer, glIndexPointer, NULL, _gloffset_IndexPointer), - NAME_FUNC_OFFSET( 3914, glIndexub, glIndexub, NULL, _gloffset_Indexub), - NAME_FUNC_OFFSET( 3924, glIndexubv, glIndexubv, NULL, _gloffset_Indexubv), - NAME_FUNC_OFFSET( 3935, glInterleavedArrays, glInterleavedArrays, NULL, _gloffset_InterleavedArrays), - NAME_FUNC_OFFSET( 3955, glNormalPointer, glNormalPointer, NULL, _gloffset_NormalPointer), - NAME_FUNC_OFFSET( 3971, glPolygonOffset, glPolygonOffset, NULL, _gloffset_PolygonOffset), - NAME_FUNC_OFFSET( 3987, glTexCoordPointer, glTexCoordPointer, NULL, _gloffset_TexCoordPointer), - NAME_FUNC_OFFSET( 4005, glVertexPointer, glVertexPointer, NULL, _gloffset_VertexPointer), - NAME_FUNC_OFFSET( 4021, glAreTexturesResident, glAreTexturesResident, NULL, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET( 4117, glDeleteTextures, glDeleteTextures, NULL, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET( 4134, glGenTextures, glGenTextures, NULL, _gloffset_GenTextures), - NAME_FUNC_OFFSET( 4148, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET( 4162, glIsTexture, glIsTexture, NULL, _gloffset_IsTexture), - NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET( 4195, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET( 4211, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET( 4227, glPopClientAttrib, glPopClientAttrib, NULL, _gloffset_PopClientAttrib), - NAME_FUNC_OFFSET( 4245, glPushClientAttrib, glPushClientAttrib, NULL, _gloffset_PushClientAttrib), - NAME_FUNC_OFFSET( 4264, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET( 4277, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET( 4293, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET( 4313, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET( 4374, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET( 4391, glGetColorTable, glGetColorTable, NULL, _gloffset_GetColorTable), - NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, glGetColorTableParameterfv, NULL, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, glGetColorTableParameteriv, NULL, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET( 4461, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, glGetConvolutionParameterfv, NULL, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, glGetConvolutionParameteriv, NULL, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, glGetSeparableFilter, NULL, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET( 4811, glGetHistogram, glGetHistogram, NULL, _gloffset_GetHistogram), - NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, glGetHistogramParameterfv, NULL, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, glGetHistogramParameteriv, NULL, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET( 4878, glGetMinmax, glGetMinmax, NULL, _gloffset_GetMinmax), - NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET( 4936, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET( 4948, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET( 4957, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET( 4974, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET( 4988, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET( 5001, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET( 5037, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, _gloffset_AttachShader), - NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, _gloffset_CreateProgram), - NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, _gloffset_CreateShader), - NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, _gloffset_DeleteProgram), - NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, _gloffset_DeleteShader), - NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, _gloffset_DetachShader), - NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, _gloffset_GetAttachedShaders), - NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, _gloffset_GetProgramInfoLog), - NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, _gloffset_GetProgramiv), - NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, _gloffset_GetShaderInfoLog), - NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, _gloffset_GetShaderiv), - NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, _gloffset_IsProgram), - NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, _gloffset_IsShader), - NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, _gloffset_StencilFuncSeparate), - NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, _gloffset_StencilMaskSeparate), - NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, _gloffset_UniformMatrix2x3fv), - NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, _gloffset_UniformMatrix2x4fv), - NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, _gloffset_UniformMatrix3x2fv), - NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, _gloffset_UniformMatrix3x4fv), - NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, _gloffset_UniformMatrix4x2fv), - NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, _gloffset_UniformMatrix4x3fv), - NAME_FUNC_OFFSET( 6163, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET( 6189, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET( 6215, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET( 6241, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET( 6267, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET( 6287, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET( 6313, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET( 6339, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET( 6365, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET( 6394, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET( 6423, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET( 6452, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET( 6479, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET( 6509, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET( 6538, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, _gloffset_GetProgramEnvParameterdvARB), - NAME_FUNC_OFFSET( 6568, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, _gloffset_GetProgramEnvParameterfvARB), - NAME_FUNC_OFFSET( 6598, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, _gloffset_GetProgramLocalParameterdvARB), - NAME_FUNC_OFFSET( 6630, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, _gloffset_GetProgramLocalParameterfvARB), - NAME_FUNC_OFFSET( 6662, glGetProgramStringARB, glGetProgramStringARB, NULL, _gloffset_GetProgramStringARB), - NAME_FUNC_OFFSET( 6684, glGetProgramivARB, glGetProgramivARB, NULL, _gloffset_GetProgramivARB), - NAME_FUNC_OFFSET( 6702, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET( 6725, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET( 6748, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET( 6771, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET( 6798, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET( 6826, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET( 6853, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET( 6881, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, _gloffset_ProgramLocalParameter4dARB), - NAME_FUNC_OFFSET( 6910, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, _gloffset_ProgramLocalParameter4dvARB), - NAME_FUNC_OFFSET( 6940, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, _gloffset_ProgramLocalParameter4fARB), - NAME_FUNC_OFFSET( 6969, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, _gloffset_ProgramLocalParameter4fvARB), - NAME_FUNC_OFFSET( 6999, glProgramStringARB, glProgramStringARB, NULL, _gloffset_ProgramStringARB), - NAME_FUNC_OFFSET( 7018, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET( 7038, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET( 7059, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET( 7079, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET( 7100, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET( 7120, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET( 7141, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET( 7161, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET( 7182, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET( 7202, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET( 7223, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET( 7243, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET( 7264, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET( 7284, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET( 7305, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET( 7325, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET( 7346, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET( 7366, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET( 7387, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET( 7409, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET( 7431, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET( 7453, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET( 7475, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET( 7498, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET( 7521, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET( 7544, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET( 7565, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET( 7585, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET( 7606, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET( 7626, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET( 7647, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET( 7668, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET( 7688, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET( 7709, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET( 7731, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET( 7753, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET( 7775, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET( 7800, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET( 7816, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET( 7832, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET( 7851, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET( 7870, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET( 7886, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET( 7912, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET( 7935, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET( 7957, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET( 7971, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET( 7986, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET( 8003, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET( 8019, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET( 8038, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET( 8052, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET( 8068, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET( 8090, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET( 8113, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET( 8129, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET( 8142, glAttachObjectARB, glAttachObjectARB, NULL, _gloffset_AttachObjectARB), - NAME_FUNC_OFFSET( 8160, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET( 8179, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, _gloffset_CreateProgramObjectARB), - NAME_FUNC_OFFSET( 8204, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, _gloffset_CreateShaderObjectARB), - NAME_FUNC_OFFSET( 8228, glDeleteObjectARB, glDeleteObjectARB, NULL, _gloffset_DeleteObjectARB), - NAME_FUNC_OFFSET( 8246, glDetachObjectARB, glDetachObjectARB, NULL, _gloffset_DetachObjectARB), - NAME_FUNC_OFFSET( 8264, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET( 8286, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, _gloffset_GetAttachedObjectsARB), - NAME_FUNC_OFFSET( 8310, glGetHandleARB, glGetHandleARB, NULL, _gloffset_GetHandleARB), - NAME_FUNC_OFFSET( 8325, glGetInfoLogARB, glGetInfoLogARB, NULL, _gloffset_GetInfoLogARB), - NAME_FUNC_OFFSET( 8341, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, _gloffset_GetObjectParameterfvARB), - NAME_FUNC_OFFSET( 8367, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, _gloffset_GetObjectParameterivARB), - NAME_FUNC_OFFSET( 8393, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET( 8414, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET( 8438, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET( 8456, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET( 8474, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET( 8491, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET( 8509, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET( 8524, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET( 8540, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET( 8555, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET( 8571, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET( 8586, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET( 8602, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET( 8617, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET( 8633, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET( 8648, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET( 8664, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET( 8679, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET( 8695, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET( 8710, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET( 8726, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET( 8741, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET( 8757, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET( 8779, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET( 8801, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET( 8823, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET( 8845, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET( 8866, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), - NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS), - NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS), - NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), - NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), - NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), - NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), - NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), - NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), - NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), - NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), - NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT), - NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT), - NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX), - NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), - NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), - NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), - NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), - NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), - NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), - NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), - NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), - NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), - NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), - NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), - NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), - NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), - NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), - NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), - NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), - NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), - NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), - NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), - NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), - NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM), - NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM), - NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV), - NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV), - NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV), - NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV), - NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV), - NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV), - NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV), - NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), - NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), - NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), - NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), - NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), - NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), - NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), - NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), - NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), - NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), - NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), - NAME_FUNC_OFFSET(11332, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), - NAME_FUNC_OFFSET(11357, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), - NAME_FUNC_OFFSET(11382, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), - NAME_FUNC_OFFSET(11410, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), - NAME_FUNC_OFFSET(11426, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), - NAME_FUNC_OFFSET(11445, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), - NAME_FUNC_OFFSET(11465, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), - NAME_FUNC_OFFSET(11484, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), - NAME_FUNC_OFFSET(11504, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), - NAME_FUNC_OFFSET(11523, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), - NAME_FUNC_OFFSET(11543, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), - NAME_FUNC_OFFSET(11562, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), - NAME_FUNC_OFFSET(11582, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), - NAME_FUNC_OFFSET(11601, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), - NAME_FUNC_OFFSET(11621, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), - NAME_FUNC_OFFSET(11640, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), - NAME_FUNC_OFFSET(11660, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), - NAME_FUNC_OFFSET(11679, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), - NAME_FUNC_OFFSET(11699, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), - NAME_FUNC_OFFSET(11718, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), - NAME_FUNC_OFFSET(11738, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), - NAME_FUNC_OFFSET(11757, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), - NAME_FUNC_OFFSET(11777, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), - NAME_FUNC_OFFSET(11796, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), - NAME_FUNC_OFFSET(11816, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), - NAME_FUNC_OFFSET(11835, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), - NAME_FUNC_OFFSET(11855, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), - NAME_FUNC_OFFSET(11874, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), - NAME_FUNC_OFFSET(11894, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), - NAME_FUNC_OFFSET(11914, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), - NAME_FUNC_OFFSET(11935, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), - NAME_FUNC_OFFSET(11959, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), - NAME_FUNC_OFFSET(11980, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), - NAME_FUNC_OFFSET(12001, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), - NAME_FUNC_OFFSET(12022, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), - NAME_FUNC_OFFSET(12043, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), - NAME_FUNC_OFFSET(12064, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), - NAME_FUNC_OFFSET(12085, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), - NAME_FUNC_OFFSET(12106, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), - NAME_FUNC_OFFSET(12127, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), - NAME_FUNC_OFFSET(12148, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), - NAME_FUNC_OFFSET(12169, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), - NAME_FUNC_OFFSET(12190, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), - NAME_FUNC_OFFSET(12211, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), - NAME_FUNC_OFFSET(12233, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), - NAME_FUNC_OFFSET(12255, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), - NAME_FUNC_OFFSET(12277, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), - NAME_FUNC_OFFSET(12299, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), - NAME_FUNC_OFFSET(12324, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), - NAME_FUNC_OFFSET(12348, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), - NAME_FUNC_OFFSET(12370, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), - NAME_FUNC_OFFSET(12392, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), - NAME_FUNC_OFFSET(12414, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), - NAME_FUNC_OFFSET(12440, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), - NAME_FUNC_OFFSET(12463, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), - NAME_FUNC_OFFSET(12487, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), - NAME_FUNC_OFFSET(12505, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), - NAME_FUNC_OFFSET(12520, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), - NAME_FUNC_OFFSET(12551, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(12571, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(12592, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, _gloffset_ActiveStencilFaceEXT), - NAME_FUNC_OFFSET(12615, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_BindVertexArrayAPPLE), - NAME_FUNC_OFFSET(12638, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(12664, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_GenVertexArraysAPPLE), - NAME_FUNC_OFFSET(12687, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(12708, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), - NAME_FUNC_OFFSET(12739, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), - NAME_FUNC_OFFSET(12770, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), - NAME_FUNC_OFFSET(12798, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), - NAME_FUNC_OFFSET(12827, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), - NAME_FUNC_OFFSET(12855, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), - NAME_FUNC_OFFSET(12884, gl_dispatch_stub_744, gl_dispatch_stub_744, NULL, _gloffset_DepthBoundsEXT), - NAME_FUNC_OFFSET(12901, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(12928, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(12949, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(12971, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(12999, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(13023, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(13048, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(13077, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(13103, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(13129, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(13155, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(13176, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(13198, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(13218, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(13259, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(13291, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(13310, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(13330, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(13355, gl_dispatch_stub_763, gl_dispatch_stub_763, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(13376, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(13405, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_StencilFuncSeparateATI), - NAME_FUNC_OFFSET(13430, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(13459, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(13490, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(13514, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(13539, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(13557, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(13574, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(13590, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(13615, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(13635, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(13655, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(13678, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(13701, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(13721, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(13738, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(13755, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(13770, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(13794, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(13813, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(13832, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(13848, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(13867, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(13890, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13906, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(13922, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(13949, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(13976, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(13996, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14015, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14034, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14064, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14094, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14124, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14154, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14173, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14196, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14221, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14246, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14273, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(14301, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(14328, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(14356, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(14385, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(14414, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(14440, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(14471, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(14502, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(14526, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(14549, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(14567, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(14596, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(14625, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(14640, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(14666, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(14692, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(14707, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(14719, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(14739, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(14756, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(14772, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(14791, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(14814, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(14830, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(14852, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(14870, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(14889, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(14907, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(14926, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(14944, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(14963, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(14981, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15000, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15018, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15037, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15055, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15074, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15092, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15111, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15129, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15148, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15166, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15185, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15203, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15222, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15240, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15259, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15277, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(15296, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(15314, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(15333, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(15351, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(15370, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(15388, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(15407, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(15425, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(15444, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(15467, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(15490, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(15513, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(15536, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(15559, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(15576, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(15599, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(15622, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(15645, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(15671, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(15697, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(15723, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(15747, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15774, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(15800, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(15820, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(15840, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(15860, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(15883, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(15907, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(15930, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(15954, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(15971, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(15989, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16006, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16024, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16041, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16059, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16076, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16094, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16111, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16129, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16146, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16164, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16181, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16199, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16216, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16234, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16251, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16269, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(16288, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(16307, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(16326, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(16345, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(16365, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(16385, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16405, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(16423, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16440, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16458, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16475, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16493, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(16511, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16528, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16546, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(16565, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(16584, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(16603, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(16625, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(16638, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(16651, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(16667, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(16683, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(16696, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(16719, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(16739, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(16758, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(16769, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(16781, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(16795, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(16808, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(16824, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(16835, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(16848, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(16867, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(16887, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(16900, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(16910, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(16926, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(16945, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(16963, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(16984, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(16999, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17014, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17028, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17043, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17055, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17068, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17080, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17093, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17105, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17118, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17130, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17143, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17155, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17168, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17180, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17193, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17205, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17218, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17230, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17243, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17262, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17281, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17300, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17313, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17331, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17352, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17370, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17390, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17404, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17421, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17437, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17456, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17474, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17495, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17517, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17536, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17558, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17581, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(17600, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(17620, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(17639, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(17659, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(17678, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(17698, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(17717, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(17737, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(17756, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(17776, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(17796, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(17817, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(17837, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(17858, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(17878, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(17899, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(17923, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(17941, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(17961, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(17979, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(17991, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18004, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18016, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18029, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18049, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18073, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18087, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18104, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18119, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18137, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18151, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18168, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18183, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18201, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18215, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18232, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18247, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18265, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18279, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18296, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18311, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18329, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18343, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18360, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18375, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18393, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18407, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18424, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18439, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18457, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18471, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18488, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18503, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18521, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18535, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18552, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18567, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(18585, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(18602, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(18622, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(18639, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18665, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(18694, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(18709, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(18727, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(18746, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(18770, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) -}; - -#undef NAME_FUNC_OFFSET diff --git a/src/libs/mesa/mesa/glapi/glthread.c b/src/libs/mesa/mesa/glapi/glthread.c deleted file mode 100644 index b818f4e26e..0000000000 --- a/src/libs/mesa/mesa/glapi/glthread.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/* - * XXX There's probably some work to do in order to make this file - * truly reusable outside of Mesa. - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "glthread.h" - - -/* - * 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 - -/* - * 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 to determine if a TSD object has been initialized. - * Kind of a hack but there doesn't appear to be a better cross-platform - * solution. - */ -#define INIT_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); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return pthread_getspecific(tsd->key); -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - 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); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void* ret; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } -#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) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - 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_THREADS - -void FreeTSD(_glthread_TSD *p) -{ - if (p->initMagic==INIT_MAGIC) { - TlsFree(p->key); - p->initMagic=0; - } -} - -void InsteadOf_exit(int nCode) -{ - DWORD dwErr=GetLastError(); -} - -unsigned long -_glthread_GetID(void) -{ - return GetCurrentThreadId(); -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - tsd->key = TlsAlloc(); - if (tsd->key == TLS_OUT_OF_INDEXES) { - perror("Mesa:_glthread_InitTSD"); - InsteadOf_exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return TlsGetValue(tsd->key); -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - /* the following code assumes that the _glthread_TSD has been initialized - to zero at creation */ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if (TlsSetValue(tsd->key, ptr) == 0) { - perror("Mesa:_glthread_SetTSD"); - InsteadOf_exit(-1); - } -} - -#endif /* WIN32_THREADS */ - - - -/* - * XFree86 has its own thread wrapper, Xthreads.h - * We wrap it again for GL. - */ -#ifdef USE_XTHREADS - -unsigned long -_glthread_GetID(void) -{ - return (unsigned long) xthread_self(); -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - if (xthread_key_create(&tsd->key, NULL) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void *ptr; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - xthread_get_specific(tsd->key, &ptr); - return ptr; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - xthread_set_specific(tsd->key, ptr); -} - -#endif /* XTHREAD */ - - - -/* - * BeOS threads - */ -#ifdef BEOS_THREADS - -unsigned long -_glthread_GetID(void) -{ - return (unsigned long) find_thread(NULL); -} - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - tsd->key = tls_allocate(); - tsd->initMagic = INIT_MAGIC; -} - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return tls_get(tsd->key); -} - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - tls_set(tsd->key, ptr); -} - -#endif /* BEOS_THREADS */ - - - -#else /* THREADS */ - - -/* - * no-op functions - */ - -unsigned long -_glthread_GetID(void) -{ - return 0; -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - (void) tsd; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - (void) tsd; - return NULL; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - (void) tsd; - (void) ptr; -} - - -#endif /* THREADS */ diff --git a/src/libs/mesa/mesa/glapi/glthread.h b/src/libs/mesa/mesa/glapi/glthread.h deleted file mode 100644 index c9b7340e61..0000000000 --- a/src/libs/mesa/mesa/glapi/glthread.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 - * - * - * - * DOCUMENTATION - * - * This thread module exports the following types: - * _glthread_TSD Thread-specific data area - * _glthread_Thread Thread datatype - * _glthread_Mutex Mutual exclusion lock - * - * Macros: - * _glthread_DECLARE_STATIC_MUTEX(name) Declare a non-local mutex - * _glthread_INIT_MUTEX(name) Initialize a mutex - * _glthread_LOCK_MUTEX(name) Lock a mutex - * _glthread_UNLOCK_MUTEX(name) Unlock a mutex - * - * Functions: - * _glthread_GetID(v) Get integer thread ID - * _glthread_InitTSD() Initialize thread-specific data - * _glthread_GetTSD() Get thread-specific data - * _glthread_SetTSD() Set thread-specific data - * - */ - -/* - * 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. - */ - -#ifndef GLTHREAD_H -#define GLTHREAD_H - - -#if defined(USE_MGL_NAMESPACE) -#define _glapi_Dispatch _mglapi_Dispatch -#endif - - - -#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\ - defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \ - && !defined(THREADS) -# define THREADS -#endif - -#ifdef VMS -#include -#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. - */ -#if defined(PTHREADS) -#include /* POSIX threads headers */ - -typedef struct { - pthread_key_t key; - int initMagic; -} _glthread_TSD; - -typedef pthread_t _glthread_Thread; - -typedef pthread_mutex_t _glthread_Mutex; - -#define _glthread_DECLARE_STATIC_MUTEX(name) \ - static _glthread_Mutex name = PTHREAD_MUTEX_INITIALIZER - -#define _glthread_INIT_MUTEX(name) \ - pthread_mutex_init(&(name), NULL) - -#define _glthread_DESTROY_MUTEX(name) \ - pthread_mutex_destroy(&(name)) - -#define _glthread_LOCK_MUTEX(name) \ - (void) pthread_mutex_lock(&(name)) - -#define _glthread_UNLOCK_MUTEX(name) \ - (void) pthread_mutex_unlock(&(name)) - -#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 - -typedef struct { - thread_key_t key; - mutex_t keylock; - int initMagic; -} _glthread_TSD; - -typedef thread_t _glthread_Thread; - -typedef mutex_t _glthread_Mutex; - -/* XXX need to really implement mutex-related macros */ -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 -#define _glthread_INIT_MUTEX(name) (void) name -#define _glthread_DESTROY_MUTEX(name) (void) name -#define _glthread_LOCK_MUTEX(name) (void) name -#define _glthread_UNLOCK_MUTEX(name) (void) name - -#endif /* SOLARIS_THREADS */ - - - - -/* - * Windows threads. Should work with Windows NT and 95. - * IMPORTANT: Link with multithreaded runtime library when THREADS are - * used! - */ -#ifdef WIN32_THREADS -#include - -typedef struct { - DWORD key; - int initMagic; -} _glthread_TSD; - -typedef HANDLE _glthread_Thread; - -typedef CRITICAL_SECTION _glthread_Mutex; - -#define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0} -#define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name) -#define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name) -#define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name) -#define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name) - -#endif /* WIN32_THREADS */ - - - - -/* - * XFree86 has its own thread wrapper, Xthreads.h - * We wrap it again for GL. - */ -#ifdef USE_XTHREADS -#include - -typedef struct { - xthread_key_t key; - int initMagic; -} _glthread_TSD; - -typedef xthread_t _glthread_Thread; - -typedef xmutex_rec _glthread_Mutex; - -#ifdef XMUTEX_INITIALIZER -#define _glthread_DECLARE_STATIC_MUTEX(name) \ - static _glthread_Mutex name = XMUTEX_INITIALIZER -#else -#define _glthread_DECLARE_STATIC_MUTEX(name) \ - static _glthread_Mutex name -#endif - -#define _glthread_INIT_MUTEX(name) \ - xmutex_init(&(name)) - -#define _glthread_DESTROY_MUTEX(name) \ - xmutex_clear(&(name)) - -#define _glthread_LOCK_MUTEX(name) \ - (void) xmutex_lock(&(name)) - -#define _glthread_UNLOCK_MUTEX(name) \ - (void) xmutex_unlock(&(name)) - -#endif /* USE_XTHREADS */ - - - -/* - * BeOS threads. R5.x or newer required. - */ -#ifdef BEOS_THREADS - -#include -#include - -typedef struct { - int32 key; - int initMagic; -} _glthread_TSD; - -typedef thread_id _glthread_Thread; - -/* Use Benaphore, aka speeder semaphore */ -typedef struct { - int32 lock; - sem_id sem; -} benaphore; -typedef benaphore _glthread_Mutex; - -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0, 0 } -#define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0 -#define _glthread_DESTROY_MUTEX(name) delete_sem(name.sem), name.lock = 0 -#define _glthread_LOCK_MUTEX(name) if (name.sem == 0) _glthread_INIT_MUTEX(name); \ - if (atomic_add(&(name.lock), 1) >= 1) acquire_sem(name.sem) -#define _glthread_UNLOCK_MUTEX(name) if (atomic_add(&(name.lock), -1) > 1) release_sem(name.sem) - -#endif /* BEOS_THREADS */ - - - -#ifndef THREADS - -/* - * THREADS not defined - */ - -typedef int _glthread_TSD; - -typedef int _glthread_Thread; - -typedef int _glthread_Mutex; - -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 - -#define _glthread_INIT_MUTEX(name) (void) name - -#define _glthread_DESTROY_MUTEX(name) (void) name - -#define _glthread_LOCK_MUTEX(name) (void) name - -#define _glthread_UNLOCK_MUTEX(name) (void) name - -#endif /* THREADS */ - - - -/* - * 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 *); - -#if !defined __GNUC__ || __GNUC__ < 3 -# define __builtin_expect(x, y) x -#endif - -#if defined(GLX_USE_TLS) - -extern __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))); - -#define GET_DISPATCH() _glapi_tls_Dispatch - -#elif !defined(GL_CALL) -# if defined(THREADS) -# define GET_DISPATCH() \ - ((__builtin_expect( _glapi_Dispatch != NULL, 1 )) \ - ? _glapi_Dispatch : _glapi_get_dispatch()) -# else -# define GET_DISPATCH() _glapi_Dispatch -# endif /* defined(THREADS) */ -#endif /* ndef GL_CALL */ - - -#endif /* THREADS_H */ diff --git a/src/libs/mesa/mesa/main/accum.c b/src/libs/mesa/mesa/main/accum.c deleted file mode 100644 index 2345695f3c..0000000000 --- a/src/libs/mesa/mesa/main/accum.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -#include "glheader.h" -#include "accum.h" -#include "context.h" -#include "imports.h" -#include "macros.h" -#include "state.h" -#include "mtypes.h" - - -void GLAPIENTRY -_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) -{ - GLfloat tmp[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - tmp[0] = CLAMP( red, -1.0F, 1.0F ); - tmp[1] = CLAMP( green, -1.0F, 1.0F ); - tmp[2] = CLAMP( blue, -1.0F, 1.0F ); - tmp[3] = CLAMP( alpha, -1.0F, 1.0F ); - - if (TEST_EQ_4V(tmp, ctx->Accum.ClearColor)) - return; - - FLUSH_VERTICES(ctx, _NEW_ACCUM); - COPY_4FV( ctx->Accum.ClearColor, tmp ); -} - - -void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (op) { - case GL_ADD: - case GL_MULT: - case GL_ACCUM: - case GL_LOAD: - case GL_RETURN: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)"); - return; - } - - if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)"); - return; - } - - if (ctx->DrawBuffer != ctx->ReadBuffer) { - /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read, - * or GL_EXT_framebuffer_blit. - */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glAccum(different read/draw buffers)"); - return; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glAccum(incomplete framebuffer)"); - return; - } - - if (ctx->RenderMode == GL_RENDER) { - ctx->Driver.Accum(ctx, op, value); - } -} - - - -void -_mesa_init_accum( GLcontext *ctx ) -{ - /* Accumulate buffer group */ - ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 ); -} diff --git a/src/libs/mesa/mesa/main/accum.h b/src/libs/mesa/mesa/main/accum.h deleted file mode 100644 index ce92688a5b..0000000000 --- a/src/libs/mesa/mesa/main/accum.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * \file accum.h - * Accumulation buffer operations. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 ACCUM_H -#define ACCUM_H - - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ); - - -extern void GLAPIENTRY -_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -extern void -_mesa_init_accum( GLcontext *ctx ); - -#else - -/** No-op */ -#define _mesa_init_accum( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/api_arrayelt.c b/src/libs/mesa/mesa/main/api_arrayelt.c deleted file mode 100644 index d124c724c9..0000000000 --- a/src/libs/mesa/mesa/main/api_arrayelt.c +++ /dev/null @@ -1,1317 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - -/* Author: - * Keith Whitwell - */ - -#include "glheader.h" -#include "api_arrayelt.h" -#include "context.h" -#include "imports.h" -#include "macros.h" -#include "glapi/glapioffsets.h" -#include "glapi/dispatch.h" - -typedef void (GLAPIENTRY *array_func)( const void * ); - -typedef struct { - const struct gl_client_array *array; - int offset; -} AEarray; - -typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); - -typedef struct { - const struct gl_client_array *array; - attrib_func func; - GLuint index; -} AEattrib; - -typedef struct { - AEarray arrays[32]; - AEattrib attribs[VERT_ATTRIB_MAX + 1]; - GLuint NewState; - - struct gl_buffer_object *vbo[VERT_ATTRIB_MAX]; - GLuint nr_vbos; - GLboolean mapped_vbos; - -} AEcontext; - -#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) - - -/* - * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer - * in the range [0, 7]. Luckily these type tokens are sequentially - * numbered in gl.h, except for GL_DOUBLE. - */ -#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) - -static const int ColorFuncs[2][8] = { - { - _gloffset_Color3bv, - _gloffset_Color3ubv, - _gloffset_Color3sv, - _gloffset_Color3usv, - _gloffset_Color3iv, - _gloffset_Color3uiv, - _gloffset_Color3fv, - _gloffset_Color3dv, - }, - { - _gloffset_Color4bv, - _gloffset_Color4ubv, - _gloffset_Color4sv, - _gloffset_Color4usv, - _gloffset_Color4iv, - _gloffset_Color4uiv, - _gloffset_Color4fv, - _gloffset_Color4dv, - }, -}; - -static const int VertexFuncs[3][8] = { - { - -1, - -1, - _gloffset_Vertex2sv, - -1, - _gloffset_Vertex2iv, - -1, - _gloffset_Vertex2fv, - _gloffset_Vertex2dv, - }, - { - -1, - -1, - _gloffset_Vertex3sv, - -1, - _gloffset_Vertex3iv, - -1, - _gloffset_Vertex3fv, - _gloffset_Vertex3dv, - }, - { - -1, - -1, - _gloffset_Vertex4sv, - -1, - _gloffset_Vertex4iv, - -1, - _gloffset_Vertex4fv, - _gloffset_Vertex4dv, - }, -}; - -static const int IndexFuncs[8] = { - -1, - _gloffset_Indexubv, - _gloffset_Indexsv, - -1, - _gloffset_Indexiv, - -1, - _gloffset_Indexfv, - _gloffset_Indexdv, -}; - -static const int NormalFuncs[8] = { - _gloffset_Normal3bv, - -1, - _gloffset_Normal3sv, - -1, - _gloffset_Normal3iv, - -1, - _gloffset_Normal3fv, - _gloffset_Normal3dv, -}; - -/* Note: _gloffset_* for these may not be a compile-time constant. */ -static int SecondaryColorFuncs[8]; -static int FogCoordFuncs[8]; - - -/** - ** GL_NV_vertex_program - **/ - -/* GL_BYTE attributes */ - -static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]), - BYTE_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_BYTE attributes */ - -static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]))); -} -static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), - UBYTE_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_SHORT attributes */ - -static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]), - SHORT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_SHORT attributes */ - -static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]), - USHORT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_INT attributes */ - -static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]), - INT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_INT attributes */ - -static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]), - UINT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_FLOAT attributes */ - -static void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v)); -} - -/* GL_DOUBLE attributes */ - -static void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v)); -} - - -/* - * Array [size][type] of VertexAttrib functions - */ -static attrib_func AttribFuncsNV[2][4][8] = { - { - /* non-normalized */ - { - /* size 1 */ - (attrib_func) VertexAttrib1bvNV, - (attrib_func) VertexAttrib1ubvNV, - (attrib_func) VertexAttrib1svNV, - (attrib_func) VertexAttrib1usvNV, - (attrib_func) VertexAttrib1ivNV, - (attrib_func) VertexAttrib1uivNV, - (attrib_func) VertexAttrib1fvNV, - (attrib_func) VertexAttrib1dvNV - }, - { - /* size 2 */ - (attrib_func) VertexAttrib2bvNV, - (attrib_func) VertexAttrib2ubvNV, - (attrib_func) VertexAttrib2svNV, - (attrib_func) VertexAttrib2usvNV, - (attrib_func) VertexAttrib2ivNV, - (attrib_func) VertexAttrib2uivNV, - (attrib_func) VertexAttrib2fvNV, - (attrib_func) VertexAttrib2dvNV - }, - { - /* size 3 */ - (attrib_func) VertexAttrib3bvNV, - (attrib_func) VertexAttrib3ubvNV, - (attrib_func) VertexAttrib3svNV, - (attrib_func) VertexAttrib3usvNV, - (attrib_func) VertexAttrib3ivNV, - (attrib_func) VertexAttrib3uivNV, - (attrib_func) VertexAttrib3fvNV, - (attrib_func) VertexAttrib3dvNV - }, - { - /* size 4 */ - (attrib_func) VertexAttrib4bvNV, - (attrib_func) VertexAttrib4ubvNV, - (attrib_func) VertexAttrib4svNV, - (attrib_func) VertexAttrib4usvNV, - (attrib_func) VertexAttrib4ivNV, - (attrib_func) VertexAttrib4uivNV, - (attrib_func) VertexAttrib4fvNV, - (attrib_func) VertexAttrib4dvNV - } - }, - { - /* normalized (except for float/double) */ - { - /* size 1 */ - (attrib_func) VertexAttrib1NbvNV, - (attrib_func) VertexAttrib1NubvNV, - (attrib_func) VertexAttrib1NsvNV, - (attrib_func) VertexAttrib1NusvNV, - (attrib_func) VertexAttrib1NivNV, - (attrib_func) VertexAttrib1NuivNV, - (attrib_func) VertexAttrib1fvNV, - (attrib_func) VertexAttrib1dvNV - }, - { - /* size 2 */ - (attrib_func) VertexAttrib2NbvNV, - (attrib_func) VertexAttrib2NubvNV, - (attrib_func) VertexAttrib2NsvNV, - (attrib_func) VertexAttrib2NusvNV, - (attrib_func) VertexAttrib2NivNV, - (attrib_func) VertexAttrib2NuivNV, - (attrib_func) VertexAttrib2fvNV, - (attrib_func) VertexAttrib2dvNV - }, - { - /* size 3 */ - (attrib_func) VertexAttrib3NbvNV, - (attrib_func) VertexAttrib3NubvNV, - (attrib_func) VertexAttrib3NsvNV, - (attrib_func) VertexAttrib3NusvNV, - (attrib_func) VertexAttrib3NivNV, - (attrib_func) VertexAttrib3NuivNV, - (attrib_func) VertexAttrib3fvNV, - (attrib_func) VertexAttrib3dvNV - }, - { - /* size 4 */ - (attrib_func) VertexAttrib4NbvNV, - (attrib_func) VertexAttrib4NubvNV, - (attrib_func) VertexAttrib4NsvNV, - (attrib_func) VertexAttrib4NusvNV, - (attrib_func) VertexAttrib4NivNV, - (attrib_func) VertexAttrib4NuivNV, - (attrib_func) VertexAttrib4fvNV, - (attrib_func) VertexAttrib4dvNV - } - } -}; - - -/** - ** GL_ARB_vertex_program - **/ - -/* GL_BYTE attributes */ - -static void GLAPIENTRY VertexAttrib1NbvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1bvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NbvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2bvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NbvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3bvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NbvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]), - BYTE_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4bvARB(GLuint index, const GLbyte *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_BYTE attributes */ - -static void GLAPIENTRY VertexAttrib1NubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1ubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2ubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]))); -} -static void GLAPIENTRY VertexAttrib3ubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), - UBYTE_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4ubvARB(GLuint index, const GLubyte *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_SHORT attributes */ - -static void GLAPIENTRY VertexAttrib1NsvARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1svARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NsvARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2svARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NsvARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3svARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NsvARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]), - SHORT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4svARB(GLuint index, const GLshort *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_SHORT attributes */ - -static void GLAPIENTRY VertexAttrib1NusvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1usvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NusvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2usvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3usvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NusvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]), - USHORT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4usvARB(GLuint index, const GLushort *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_INT attributes */ - -static void GLAPIENTRY VertexAttrib1NivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1ivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2ivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3ivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]), - INT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4ivARB(GLuint index, const GLint *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_UNSIGNED_INT attributes */ - -static void GLAPIENTRY VertexAttrib1NuivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]))); -} - -static void GLAPIENTRY VertexAttrib1uivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); -} - -static void GLAPIENTRY VertexAttrib2NuivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]))); -} - -static void GLAPIENTRY VertexAttrib2uivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); -} - -static void GLAPIENTRY VertexAttrib3NuivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]))); -} - -static void GLAPIENTRY VertexAttrib3uivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); -} - -static void GLAPIENTRY VertexAttrib4NuivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]), - UINT_TO_FLOAT(v[3]))); -} - -static void GLAPIENTRY VertexAttrib4uivARB(GLuint index, const GLuint *v) -{ - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); -} - -/* GL_FLOAT attributes */ - -static void GLAPIENTRY VertexAttrib1fvARB(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib1fvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib2fvARB(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib2fvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib3fvARB(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib3fvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib4fvARB(GLuint index, const GLfloat *v) -{ - CALL_VertexAttrib4fvARB(GET_DISPATCH(), (index, v)); -} - -/* GL_DOUBLE attributes */ - -static void GLAPIENTRY VertexAttrib1dvARB(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib1dvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib2dvARB(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib2dvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib3dvARB(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib3dvARB(GET_DISPATCH(), (index, v)); -} - -static void GLAPIENTRY VertexAttrib4dvARB(GLuint index, const GLdouble *v) -{ - CALL_VertexAttrib4dvARB(GET_DISPATCH(), (index, v)); -} - - -/* - * Array [size][type] of VertexAttrib functions - */ -static attrib_func AttribFuncsARB[2][4][8] = { - { - /* non-normalized */ - { - /* size 1 */ - (attrib_func) VertexAttrib1bvARB, - (attrib_func) VertexAttrib1ubvARB, - (attrib_func) VertexAttrib1svARB, - (attrib_func) VertexAttrib1usvARB, - (attrib_func) VertexAttrib1ivARB, - (attrib_func) VertexAttrib1uivARB, - (attrib_func) VertexAttrib1fvARB, - (attrib_func) VertexAttrib1dvARB - }, - { - /* size 2 */ - (attrib_func) VertexAttrib2bvARB, - (attrib_func) VertexAttrib2ubvARB, - (attrib_func) VertexAttrib2svARB, - (attrib_func) VertexAttrib2usvARB, - (attrib_func) VertexAttrib2ivARB, - (attrib_func) VertexAttrib2uivARB, - (attrib_func) VertexAttrib2fvARB, - (attrib_func) VertexAttrib2dvARB - }, - { - /* size 3 */ - (attrib_func) VertexAttrib3bvARB, - (attrib_func) VertexAttrib3ubvARB, - (attrib_func) VertexAttrib3svARB, - (attrib_func) VertexAttrib3usvARB, - (attrib_func) VertexAttrib3ivARB, - (attrib_func) VertexAttrib3uivARB, - (attrib_func) VertexAttrib3fvARB, - (attrib_func) VertexAttrib3dvARB - }, - { - /* size 4 */ - (attrib_func) VertexAttrib4bvARB, - (attrib_func) VertexAttrib4ubvARB, - (attrib_func) VertexAttrib4svARB, - (attrib_func) VertexAttrib4usvARB, - (attrib_func) VertexAttrib4ivARB, - (attrib_func) VertexAttrib4uivARB, - (attrib_func) VertexAttrib4fvARB, - (attrib_func) VertexAttrib4dvARB - } - }, - { - /* normalized (except for float/double) */ - { - /* size 1 */ - (attrib_func) VertexAttrib1NbvARB, - (attrib_func) VertexAttrib1NubvARB, - (attrib_func) VertexAttrib1NsvARB, - (attrib_func) VertexAttrib1NusvARB, - (attrib_func) VertexAttrib1NivARB, - (attrib_func) VertexAttrib1NuivARB, - (attrib_func) VertexAttrib1fvARB, - (attrib_func) VertexAttrib1dvARB - }, - { - /* size 2 */ - (attrib_func) VertexAttrib2NbvARB, - (attrib_func) VertexAttrib2NubvARB, - (attrib_func) VertexAttrib2NsvARB, - (attrib_func) VertexAttrib2NusvARB, - (attrib_func) VertexAttrib2NivARB, - (attrib_func) VertexAttrib2NuivARB, - (attrib_func) VertexAttrib2fvARB, - (attrib_func) VertexAttrib2dvARB - }, - { - /* size 3 */ - (attrib_func) VertexAttrib3NbvARB, - (attrib_func) VertexAttrib3NubvARB, - (attrib_func) VertexAttrib3NsvARB, - (attrib_func) VertexAttrib3NusvARB, - (attrib_func) VertexAttrib3NivARB, - (attrib_func) VertexAttrib3NuivARB, - (attrib_func) VertexAttrib3fvARB, - (attrib_func) VertexAttrib3dvARB - }, - { - /* size 4 */ - (attrib_func) VertexAttrib4NbvARB, - (attrib_func) VertexAttrib4NubvARB, - (attrib_func) VertexAttrib4NsvARB, - (attrib_func) VertexAttrib4NusvARB, - (attrib_func) VertexAttrib4NivARB, - (attrib_func) VertexAttrib4NuivARB, - (attrib_func) VertexAttrib4fvARB, - (attrib_func) VertexAttrib4dvARB - } - } -}; - -/**********************************************************************/ - - -GLboolean _ae_create_context( GLcontext *ctx ) -{ - if (ctx->aelt_context) - return GL_TRUE; - - /* These _gloffset_* values may not be compile-time constants */ - SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT; - SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT; - SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT; - SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT; - SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT; - SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT; - SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT; - SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT; - - FogCoordFuncs[0] = -1; - FogCoordFuncs[1] = -1; - FogCoordFuncs[2] = -1; - FogCoordFuncs[3] = -1; - FogCoordFuncs[4] = -1; - FogCoordFuncs[5] = -1; - FogCoordFuncs[6] = _gloffset_FogCoordfvEXT; - FogCoordFuncs[7] = _gloffset_FogCoorddvEXT; - - ctx->aelt_context = CALLOC( sizeof(AEcontext) ); - if (!ctx->aelt_context) - return GL_FALSE; - - AE_CONTEXT(ctx)->NewState = ~0; - return GL_TRUE; -} - - -void _ae_destroy_context( GLcontext *ctx ) -{ - if ( AE_CONTEXT( ctx ) ) { - FREE( ctx->aelt_context ); - ctx->aelt_context = NULL; - } -} - -static void check_vbo( AEcontext *actx, - struct gl_buffer_object *vbo ) -{ - if (vbo->Name && !vbo->Pointer) { - GLuint i; - for (i = 0; i < actx->nr_vbos; i++) - if (actx->vbo[i] == vbo) - return; - assert(actx->nr_vbos < VERT_ATTRIB_MAX); - actx->vbo[actx->nr_vbos++] = vbo; - } -} - - -/** - * Make a list of per-vertex functions to call for each glArrayElement call. - * These functions access the array data (i.e. glVertex, glColor, glNormal, - * etc). - * Note: this may be called during display list construction. - */ -static void _ae_update_state( GLcontext *ctx ) -{ - AEcontext *actx = AE_CONTEXT(ctx); - AEarray *aa = actx->arrays; - AEattrib *at = actx->attribs; - GLuint i; - - actx->nr_vbos = 0; - - /* conventional vertex arrays */ - if (ctx->Array.ArrayObj->Index.Enabled) { - aa->array = &ctx->Array.ArrayObj->Index; - aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (ctx->Array.ArrayObj->EdgeFlag.Enabled) { - aa->array = &ctx->Array.ArrayObj->EdgeFlag; - aa->offset = _gloffset_EdgeFlagv; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (ctx->Array.ArrayObj->Normal.Enabled) { - aa->array = &ctx->Array.ArrayObj->Normal; - aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (ctx->Array.ArrayObj->Color.Enabled) { - aa->array = &ctx->Array.ArrayObj->Color; - aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (ctx->Array.ArrayObj->SecondaryColor.Enabled) { - aa->array = &ctx->Array.ArrayObj->SecondaryColor; - aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (ctx->Array.ArrayObj->FogCoord.Enabled) { - aa->array = &ctx->Array.ArrayObj->FogCoord; - aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - struct gl_client_array *attribArray = &ctx->Array.ArrayObj->TexCoord[i]; - if (attribArray->Enabled) { - /* NOTE: we use generic glVertexAttribNV functions here. - * If we ever remove GL_NV_vertex_program this will have to change. - */ - at->array = attribArray; - ASSERT(!at->array->Normalized); - at->func = AttribFuncsNV[at->array->Normalized] - [at->array->Size-1] - [TYPE_IDX(at->array->Type)]; - at->index = VERT_ATTRIB_TEX0 + i; - check_vbo(actx, at->array->BufferObj); - at++; - } - } - - /* generic vertex attribute arrays */ - for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ - struct gl_client_array *attribArray = &ctx->Array.ArrayObj->VertexAttrib[i]; - if (attribArray->Enabled) { - at->array = attribArray; - /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV - * function pointer here (for float arrays) since the pointer may - * change from one execution of _ae_loopback_array_elt() to - * the next. Doing so caused UT to break. - */ - if (ctx->VertexProgram._Enabled - && ctx->VertexProgram.Current->IsNVProgram) { - at->func = AttribFuncsNV[at->array->Normalized] - [at->array->Size-1] - [TYPE_IDX(at->array->Type)]; - } - else { - at->func = AttribFuncsARB[at->array->Normalized] - [at->array->Size-1] - [TYPE_IDX(at->array->Type)]; - } - at->index = i; - check_vbo(actx, at->array->BufferObj); - at++; - } - } - - /* finally, vertex position */ - if (ctx->Array.ArrayObj->VertexAttrib[0].Enabled) { - /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's - * issued as the last (provoking) attribute). - */ - aa->array = &ctx->Array.ArrayObj->VertexAttrib[0]; - assert(aa->array->Size >= 2); /* XXX fix someday? */ - aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - else if (ctx->Array.ArrayObj->Vertex.Enabled) { - aa->array = &ctx->Array.ArrayObj->Vertex; - aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - - check_vbo(actx, ctx->Array.ElementArrayBufferObj); - - ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); - ASSERT(aa - actx->arrays < 32); - at->func = NULL; /* terminate the list */ - aa->offset = -1; /* terminate the list */ - - actx->NewState = 0; -} - -void _ae_map_vbos( GLcontext *ctx ) -{ - AEcontext *actx = AE_CONTEXT(ctx); - GLuint i; - - if (actx->mapped_vbos) - return; - - if (actx->NewState) - _ae_update_state(ctx); - - for (i = 0; i < actx->nr_vbos; i++) - ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - GL_DYNAMIC_DRAW_ARB, - actx->vbo[i]); - - if (actx->nr_vbos) - actx->mapped_vbos = GL_TRUE; -} - -void _ae_unmap_vbos( GLcontext *ctx ) -{ - AEcontext *actx = AE_CONTEXT(ctx); - GLuint i; - - if (!actx->mapped_vbos) - return; - - assert (!actx->NewState); - - for (i = 0; i < actx->nr_vbos; i++) - ctx->Driver.UnmapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - actx->vbo[i]); - - actx->mapped_vbos = GL_FALSE; -} - - -/** - * Called via glArrayElement() and glDrawArrays(). - * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions - * for all enabled vertex arrays (for elt-th element). - * Note: this may be called during display list construction. - */ -void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) -{ - GET_CURRENT_CONTEXT(ctx); - const AEcontext *actx = AE_CONTEXT(ctx); - const AEarray *aa; - const AEattrib *at; - const struct _glapi_table * const disp = GET_DISPATCH(); - GLboolean do_map; - - if (actx->NewState) { - assert(!actx->mapped_vbos); - _ae_update_state( ctx ); - } - - do_map = actx->nr_vbos && !actx->mapped_vbos; - - /* - */ - if (do_map) - _ae_map_vbos(ctx); - - /* generic attributes */ - for (at = actx->attribs; at->func; at++) { - const GLubyte *src - = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr) - + elt * at->array->StrideB; - at->func( at->index, src ); - } - - /* conventional arrays */ - for (aa = actx->arrays; aa->offset != -1 ; aa++) { - const GLubyte *src - = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr) - + elt * aa->array->StrideB; - CALL_by_offset( disp, (array_func), aa->offset, - ((const void *) src) ); - } - - if (do_map) - _ae_unmap_vbos(ctx); -} - - -void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) -{ - AEcontext *actx = AE_CONTEXT(ctx); - - - /* Only interested in this subset of mesa state. Need to prune - * this down as both tnl/ and the drivers can raise statechanges - * for arcane reasons in the middle of seemingly atomic operations - * like DrawElements, over which we'd like to keep a known set of - * arrays and vbo's mapped. - * - * Luckily, neither the drivers nor tnl muck with the state that - * concerns us here: - */ - new_state &= _NEW_ARRAY | _NEW_PROGRAM; - if (new_state) { - assert(!actx->mapped_vbos); - actx->NewState |= new_state; - } -} diff --git a/src/libs/mesa/mesa/main/api_arrayelt.h b/src/libs/mesa/mesa/main/api_arrayelt.h deleted file mode 100644 index e621724fb2..0000000000 --- a/src/libs/mesa/mesa/main/api_arrayelt.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 API_ARRAYELT_H -#define API_ARRAYELT_H - -#include "mtypes.h" - -extern GLboolean _ae_create_context( GLcontext *ctx ); -extern void _ae_destroy_context( GLcontext *ctx ); -extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); -extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); - -/* May optionally be called before a batch of element calls: - */ -extern void _ae_map_vbos( GLcontext *ctx ); -extern void _ae_unmap_vbos( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/api_exec.c b/src/libs/mesa/mesa/main/api_exec.c deleted file mode 100644 index bae3bf11cb..0000000000 --- a/src/libs/mesa/mesa/main/api_exec.c +++ /dev/null @@ -1,884 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file api_exec.c - * Initialize dispatch table with the immidiate mode functions. - */ - - -#include "glheader.h" -#if FEATURE_accum -#include "accum.h" -#endif -#include "api_loopback.h" -#include "api_exec.h" -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -#include "shader/arbprogram.h" -#endif -#if FEATURE_ATI_fragment_shader -#include "shader/atifragshader.h" -#endif -#if FEATURE_attrib_stack -#include "attrib.h" -#endif -#include "blend.h" -#if FEATURE_ARB_vertex_buffer_object -#include "bufferobj.h" -#endif -#include "arrayobj.h" -#if FEATURE_draw_read_buffer -#include "buffers.h" -#endif -#include "clear.h" -#include "clip.h" -#if FEATURE_colortable -#include "colortab.h" -#endif -#include "context.h" -#if FEATURE_convolve -#include "convolve.h" -#endif -#include "depth.h" -#if FEATURE_dlist -#include "dlist.h" -#endif -#if FEATURE_drawpix -#include "drawpix.h" -#include "rastpos.h" -#endif -#include "enable.h" -#if FEATURE_evaluators -#include "eval.h" -#endif -#include "get.h" -#if FEATURE_feedback -#include "feedback.h" -#endif -#include "fog.h" -#if FEATURE_EXT_framebuffer_object -#include "fbobject.h" -#endif -#include "ffvertex_prog.h" -#include "framebuffer.h" -#include "hint.h" -#if FEATURE_histogram -#include "histogram.h" -#endif -#include "imports.h" -#include "light.h" -#include "lines.h" -#include "macros.h" -#include "matrix.h" -#include "multisample.h" -#if FEATURE_pixel_transfer -#include "pixel.h" -#endif -#include "pixelstore.h" -#include "points.h" -#include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query -#include "queryobj.h" -#endif -#include "readpix.h" -#include "scissor.h" -#include "state.h" -#include "stencil.h" -#include "texenv.h" -#include "teximage.h" -#if FEATURE_texgen -#include "texgen.h" -#endif -#include "texobj.h" -#include "texparam.h" -#include "texstate.h" -#include "mtypes.h" -#include "varray.h" -#if FEATURE_NV_vertex_program -#include "shader/nvprogram.h" -#endif -#if FEATURE_NV_fragment_program -#include "shader/nvprogram.h" -#include "shader/program.h" -#include "texenvprogram.h" -#endif -#if FEATURE_ARB_shader_objects -#include "shaders.h" -#endif -#include "debug.h" -#include "glapi/dispatch.h" - - - -/** - * Initialize a dispatch table with pointers to Mesa's immediate-mode - * commands. - * - * Pointers to glBegin()/glEnd() object commands and a few others - * are provided via the GLvertexformat interface. - * - * \param ctx GL context to which \c exec belongs. - * \param exec dispatch table. - */ -void -_mesa_init_exec_table(struct _glapi_table *exec) -{ -#if _HAVE_FULL_GL - _mesa_loopback_init_api_table( exec ); -#endif - - /* load the dispatch slots we understand */ - SET_AlphaFunc(exec, _mesa_AlphaFunc); - SET_BlendFunc(exec, _mesa_BlendFunc); - SET_Clear(exec, _mesa_Clear); - SET_ClearColor(exec, _mesa_ClearColor); - SET_ClearStencil(exec, _mesa_ClearStencil); - SET_ColorMask(exec, _mesa_ColorMask); - SET_CullFace(exec, _mesa_CullFace); - SET_Disable(exec, _mesa_Disable); -#if FEATURE_draw_read_buffer - SET_DrawBuffer(exec, _mesa_DrawBuffer); - SET_ReadBuffer(exec, _mesa_ReadBuffer); -#endif - SET_Enable(exec, _mesa_Enable); - SET_Finish(exec, _mesa_Finish); - SET_Flush(exec, _mesa_Flush); - SET_FrontFace(exec, _mesa_FrontFace); - SET_Frustum(exec, _mesa_Frustum); - SET_GetError(exec, _mesa_GetError); - SET_GetFloatv(exec, _mesa_GetFloatv); - SET_GetString(exec, _mesa_GetString); - SET_LineStipple(exec, _mesa_LineStipple); - SET_LineWidth(exec, _mesa_LineWidth); - SET_LoadIdentity(exec, _mesa_LoadIdentity); - SET_LoadMatrixf(exec, _mesa_LoadMatrixf); - SET_LogicOp(exec, _mesa_LogicOp); - SET_MatrixMode(exec, _mesa_MatrixMode); - SET_MultMatrixf(exec, _mesa_MultMatrixf); - SET_Ortho(exec, _mesa_Ortho); - SET_PixelStorei(exec, _mesa_PixelStorei); - SET_PopMatrix(exec, _mesa_PopMatrix); - SET_PushMatrix(exec, _mesa_PushMatrix); - SET_Rotatef(exec, _mesa_Rotatef); - SET_Scalef(exec, _mesa_Scalef); - SET_Scissor(exec, _mesa_Scissor); - SET_ShadeModel(exec, _mesa_ShadeModel); - SET_StencilFunc(exec, _mesa_StencilFunc); - SET_StencilMask(exec, _mesa_StencilMask); - SET_StencilOp(exec, _mesa_StencilOp); - SET_TexEnvfv(exec, _mesa_TexEnvfv); - SET_TexEnvi(exec, _mesa_TexEnvi); - SET_TexImage2D(exec, _mesa_TexImage2D); - SET_TexParameteri(exec, _mesa_TexParameteri); - SET_Translatef(exec, _mesa_Translatef); - SET_Viewport(exec, _mesa_Viewport); -#if FEATURE_accum - SET_Accum(exec, _mesa_Accum); - SET_ClearAccum(exec, _mesa_ClearAccum); -#endif -#if FEATURE_dlist - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - SET_DeleteLists(exec, _mesa_DeleteLists); - SET_EndList(exec, _mesa_EndList); - SET_GenLists(exec, _mesa_GenLists); - SET_IsList(exec, _mesa_IsList); - SET_ListBase(exec, _mesa_ListBase); - SET_NewList(exec, _mesa_NewList); -#endif - SET_ClearDepth(exec, _mesa_ClearDepth); - SET_ClearIndex(exec, _mesa_ClearIndex); - SET_ClipPlane(exec, _mesa_ClipPlane); - SET_ColorMaterial(exec, _mesa_ColorMaterial); - SET_CullParameterfvEXT(exec, _mesa_CullParameterfvEXT); - SET_CullParameterdvEXT(exec, _mesa_CullParameterdvEXT); - SET_DepthFunc(exec, _mesa_DepthFunc); - SET_DepthMask(exec, _mesa_DepthMask); - SET_DepthRange(exec, _mesa_DepthRange); -#if FEATURE_drawpix - SET_Bitmap(exec, _mesa_Bitmap); - SET_CopyPixels(exec, _mesa_CopyPixels); - SET_DrawPixels(exec, _mesa_DrawPixels); -#endif -#if FEATURE_feedback - SET_InitNames(exec, _mesa_InitNames); - SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); - SET_LoadName(exec, _mesa_LoadName); - SET_PassThrough(exec, _mesa_PassThrough); - SET_PopName(exec, _mesa_PopName); - SET_PushName(exec, _mesa_PushName); - SET_SelectBuffer(exec, _mesa_SelectBuffer); - SET_RenderMode(exec, _mesa_RenderMode); -#endif - SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); - SET_Fogf(exec, _mesa_Fogf); - SET_Fogfv(exec, _mesa_Fogfv); - SET_Fogi(exec, _mesa_Fogi); - SET_Fogiv(exec, _mesa_Fogiv); - SET_GetClipPlane(exec, _mesa_GetClipPlane); - SET_GetBooleanv(exec, _mesa_GetBooleanv); - SET_GetDoublev(exec, _mesa_GetDoublev); - SET_GetIntegerv(exec, _mesa_GetIntegerv); - SET_GetLightfv(exec, _mesa_GetLightfv); - SET_GetLightiv(exec, _mesa_GetLightiv); - SET_GetMaterialfv(exec, _mesa_GetMaterialfv); - SET_GetMaterialiv(exec, _mesa_GetMaterialiv); - SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple); - SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv); - SET_GetTexEnviv(exec, _mesa_GetTexEnviv); - SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv); - SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv); - SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv); - SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv); - SET_GetTexImage(exec, _mesa_GetTexImage); - SET_Hint(exec, _mesa_Hint); - SET_IndexMask(exec, _mesa_IndexMask); - SET_IsEnabled(exec, _mesa_IsEnabled); - SET_LightModelf(exec, _mesa_LightModelf); - SET_LightModelfv(exec, _mesa_LightModelfv); - SET_LightModeli(exec, _mesa_LightModeli); - SET_LightModeliv(exec, _mesa_LightModeliv); - SET_Lightf(exec, _mesa_Lightf); - SET_Lightfv(exec, _mesa_Lightfv); - SET_Lighti(exec, _mesa_Lighti); - SET_Lightiv(exec, _mesa_Lightiv); - SET_LoadMatrixd(exec, _mesa_LoadMatrixd); -#if FEATURE_evaluators - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); - SET_Map1d(exec, _mesa_Map1d); - SET_Map1f(exec, _mesa_Map1f); - SET_Map2d(exec, _mesa_Map2d); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); -#endif - SET_MultMatrixd(exec, _mesa_MultMatrixd); -#if FEATURE_pixel_transfer - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); - SET_PixelMapfv(exec, _mesa_PixelMapfv); - SET_PixelMapuiv(exec, _mesa_PixelMapuiv); - SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); -#endif - SET_PixelStoref(exec, _mesa_PixelStoref); - SET_PointSize(exec, _mesa_PointSize); - SET_PolygonMode(exec, _mesa_PolygonMode); - SET_PolygonOffset(exec, _mesa_PolygonOffset); - SET_PolygonStipple(exec, _mesa_PolygonStipple); -#if FEATURE_attrib_stack - SET_PopAttrib(exec, _mesa_PopAttrib); - SET_PushAttrib(exec, _mesa_PushAttrib); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); -#endif -#if FEATURE_drawpix - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_RasterPos2d(exec, _mesa_RasterPos2d); - SET_RasterPos2dv(exec, _mesa_RasterPos2dv); - SET_RasterPos2s(exec, _mesa_RasterPos2s); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); -#endif - SET_ReadPixels(exec, _mesa_ReadPixels); - SET_Rotated(exec, _mesa_Rotated); - SET_Scaled(exec, _mesa_Scaled); - SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT); - SET_TexEnvf(exec, _mesa_TexEnvf); - SET_TexEnviv(exec, _mesa_TexEnviv); - -#if FEATURE_texgen - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); - SET_TexGend(exec, _mesa_TexGend); - SET_TexGendv(exec, _mesa_TexGendv); - SET_TexGenf(exec, _mesa_TexGenf); - SET_TexGenfv(exec, _mesa_TexGenfv); - SET_TexGeni(exec, _mesa_TexGeni); - SET_TexGeniv(exec, _mesa_TexGeniv); -#endif - - SET_TexImage1D(exec, _mesa_TexImage1D); - SET_TexParameterf(exec, _mesa_TexParameterf); - SET_TexParameterfv(exec, _mesa_TexParameterfv); - SET_TexParameteriv(exec, _mesa_TexParameteriv); - SET_Translated(exec, _mesa_Translated); - - /* 1.1 */ - SET_BindTexture(exec, _mesa_BindTexture); - SET_DeleteTextures(exec, _mesa_DeleteTextures); - SET_GenTextures(exec, _mesa_GenTextures); -#if _HAVE_FULL_GL - SET_AreTexturesResident(exec, _mesa_AreTexturesResident); - SET_ColorPointer(exec, _mesa_ColorPointer); - SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D); - SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D); - SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D); - SET_CopyTexSubImage2D(exec, _mesa_CopyTexSubImage2D); - SET_DisableClientState(exec, _mesa_DisableClientState); - SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer); - SET_EnableClientState(exec, _mesa_EnableClientState); - SET_GetPointerv(exec, _mesa_GetPointerv); - SET_IndexPointer(exec, _mesa_IndexPointer); - SET_InterleavedArrays(exec, _mesa_InterleavedArrays); - SET_IsTexture(exec, _mesa_IsTexture); - SET_NormalPointer(exec, _mesa_NormalPointer); - SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures); - SET_TexCoordPointer(exec, _mesa_TexCoordPointer); - SET_TexSubImage1D(exec, _mesa_TexSubImage1D); - SET_TexSubImage2D(exec, _mesa_TexSubImage2D); - SET_VertexPointer(exec, _mesa_VertexPointer); -#endif - - /* 1.2 */ -#if _HAVE_FULL_GL - SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D); - SET_TexImage3D(exec, _mesa_TexImage3D); - SET_TexSubImage3D(exec, _mesa_TexSubImage3D); -#endif - - /* OpenGL 1.2 GL_ARB_imaging */ - SET_BlendColor(exec, _mesa_BlendColor); - SET_BlendEquation(exec, _mesa_BlendEquation); - SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); - -#if FEATURE_colortable - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); -#endif - -#if FEATURE_convolve - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif -#if FEATURE_histogram - SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); -#endif - - /* OpenGL 2.0 */ - SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); - SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate); - SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); -#if FEATURE_ARB_shader_objects - SET_AttachShader(exec, _mesa_AttachShader); - SET_CreateProgram(exec, _mesa_CreateProgram); - SET_CreateShader(exec, _mesa_CreateShader); - SET_DeleteProgram(exec, _mesa_DeleteProgram); - SET_DeleteShader(exec, _mesa_DeleteShader); - SET_DetachShader(exec, _mesa_DetachShader); - SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders); - SET_GetProgramiv(exec, _mesa_GetProgramiv); - SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog); - SET_GetShaderiv(exec, _mesa_GetShaderiv); - SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog); - SET_IsProgram(exec, _mesa_IsProgram); - SET_IsShader(exec, _mesa_IsShader); -#endif - - /* OpenGL 2.1 */ -#if FEATURE_ARB_shader_objects - SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv); - SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv); - SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv); - SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv); - SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv); - SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv); -#endif - - - /* 2. GL_EXT_blend_color */ -#if 0 -/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */ -#endif - - /* 3. GL_EXT_polygon_offset */ -#if _HAVE_FULL_GL - SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT); -#endif - - /* 6. GL_EXT_texture3d */ -#if 0 -/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */ -/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */ -/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */ -#endif - - /* 11. GL_EXT_histogram */ -#if 0 - SET_GetHistogramEXT(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmaxEXT(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv); -#endif - - /* 14. SGI_color_table */ -#if 0 - SET_ColorTableSGI(exec, _mesa_ColorTable); - SET_ColorSubTableSGI(exec, _mesa_ColorSubTable); - SET_GetColorTableSGI(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); -#endif - - /* 30. GL_EXT_vertex_array */ -#if _HAVE_FULL_GL - SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT); - SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT); - SET_IndexPointerEXT(exec, _mesa_IndexPointerEXT); - SET_NormalPointerEXT(exec, _mesa_NormalPointerEXT); - SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT); - SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT); -#endif - - /* 37. GL_EXT_blend_minmax */ -#if 0 - SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT); -#endif - - /* 54. GL_EXT_point_parameters */ -#if _HAVE_FULL_GL - SET_PointParameterfEXT(exec, _mesa_PointParameterf); - SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); -#endif - - /* 97. GL_EXT_compiled_vertex_array */ -#if _HAVE_FULL_GL - SET_LockArraysEXT(exec, _mesa_LockArraysEXT); - SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); -#endif - - /* 148. GL_EXT_multi_draw_arrays */ -#if _HAVE_FULL_GL - SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT); - SET_MultiDrawElementsEXT(exec, _mesa_MultiDrawElementsEXT); -#endif - - /* 173. GL_INGR_blend_func_separate */ -#if _HAVE_FULL_GL - SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); -#endif - - /* 196. GL_MESA_resize_buffers */ -#if _HAVE_FULL_GL - SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); -#endif - - /* 197. GL_MESA_window_pos */ -#if FEATURE_drawpix - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif - - /* 200. GL_IBM_multimode_draw_arrays */ -#if _HAVE_FULL_GL - SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM); - SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM); -#endif - - /* 233. GL_NV_vertex_program */ -#if FEATURE_NV_vertex_program - SET_BindProgramNV(exec, _mesa_BindProgram); - SET_DeleteProgramsNV(exec, _mesa_DeletePrograms); - SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV); - SET_GenProgramsNV(exec, _mesa_GenPrograms); - SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(exec, _mesa_GetProgramivNV); - SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV); - SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV); - SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV); - SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV); - SET_IsProgramNV(exec, _mesa_IsProgramARB); - SET_LoadProgramNV(exec, _mesa_LoadProgramNV); - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */ - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */ - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */ - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */ - SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV); - SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV); - SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV); - /* glVertexAttrib*NV functions handled in api_loopback.c */ -#endif - - /* 273. GL_APPLE_vertex_array_object */ - SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE); - SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); - SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE); - SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); - - /* 282. GL_NV_fragment_program */ -#if FEATURE_NV_fragment_program - SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV); - SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); - SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); -#endif - - /* 262. GL_NV_point_sprite */ -#if _HAVE_FULL_GL - SET_PointParameteriNV(exec, _mesa_PointParameteri); - SET_PointParameterivNV(exec, _mesa_PointParameteriv); -#endif - - /* 268. GL_EXT_stencil_two_side */ -#if _HAVE_FULL_GL - SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT); -#endif - - /* ???. GL_EXT_depth_bounds_test */ - SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT); - - /* ARB 1. GL_ARB_multitexture */ -#if _HAVE_FULL_GL - SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB); - SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB); -#endif - - /* ARB 3. GL_ARB_transpose_matrix */ -#if _HAVE_FULL_GL - SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB); - SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB); - SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB); - SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB); -#endif - - /* ARB 5. GL_ARB_multisample */ -#if _HAVE_FULL_GL - SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB); -#endif - - /* ARB 12. GL_ARB_texture_compression */ -#if _HAVE_FULL_GL - SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB); - SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB); - SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB); - SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB); - SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB); - SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB); - SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB); -#endif - - /* ARB 14. GL_ARB_point_parameters */ - /* reuse EXT_point_parameters functions */ - - /* ARB 26. GL_ARB_vertex_program */ - /* ARB 27. GL_ARB_fragment_program */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - /* glVertexAttrib1sARB aliases glVertexAttrib1sNV */ - /* glVertexAttrib1fARB aliases glVertexAttrib1fNV */ - /* glVertexAttrib1dARB aliases glVertexAttrib1dNV */ - /* glVertexAttrib2sARB aliases glVertexAttrib2sNV */ - /* glVertexAttrib2fARB aliases glVertexAttrib2fNV */ - /* glVertexAttrib2dARB aliases glVertexAttrib2dNV */ - /* glVertexAttrib3sARB aliases glVertexAttrib3sNV */ - /* glVertexAttrib3fARB aliases glVertexAttrib3fNV */ - /* glVertexAttrib3dARB aliases glVertexAttrib3dNV */ - /* glVertexAttrib4sARB aliases glVertexAttrib4sNV */ - /* glVertexAttrib4fARB aliases glVertexAttrib4fNV */ - /* glVertexAttrib4dARB aliases glVertexAttrib4dNV */ - /* glVertexAttrib4NubARB aliases glVertexAttrib4NubNV */ - /* glVertexAttrib1svARB aliases glVertexAttrib1svNV */ - /* glVertexAttrib1fvARB aliases glVertexAttrib1fvNV */ - /* glVertexAttrib1dvARB aliases glVertexAttrib1dvNV */ - /* glVertexAttrib2svARB aliases glVertexAttrib2svNV */ - /* glVertexAttrib2fvARB aliases glVertexAttrib2fvNV */ - /* glVertexAttrib2dvARB aliases glVertexAttrib2dvNV */ - /* glVertexAttrib3svARB aliases glVertexAttrib3svNV */ - /* glVertexAttrib3fvARB aliases glVertexAttrib3fvNV */ - /* glVertexAttrib3dvARB aliases glVertexAttrib3dvNV */ - /* glVertexAttrib4svARB aliases glVertexAttrib4svNV */ - /* glVertexAttrib4fvARB aliases glVertexAttrib4fvNV */ - /* glVertexAttrib4dvARB aliases glVertexAttrib4dvNV */ - /* glVertexAttrib4NubvARB aliases glVertexAttrib4NubvNV */ - /* glVertexAttrib4bvARB handled in api_loopback.c */ - /* glVertexAttrib4ivARB handled in api_loopback.c */ - /* glVertexAttrib4ubvARB handled in api_loopback.c */ - /* glVertexAttrib4usvARB handled in api_loopback.c */ - /* glVertexAttrib4uivARB handled in api_loopback.c */ - /* glVertexAttrib4NbvARB handled in api_loopback.c */ - /* glVertexAttrib4NsvARB handled in api_loopback.c */ - /* glVertexAttrib4NivARB handled in api_loopback.c */ - /* glVertexAttrib4NusvARB handled in api_loopback.c */ - /* glVertexAttrib4NuivARB handled in api_loopback.c */ - SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB); - SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB); - SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB); - SET_ProgramStringARB(exec, _mesa_ProgramStringARB); - /* glBindProgramARB aliases glBindProgramNV */ - /* glDeleteProgramsARB aliases glDeleteProgramsNV */ - /* glGenProgramsARB aliases glGenProgramsNV */ - /* glIsProgramARB aliases glIsProgramNV */ - SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB); - SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB); - SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB); - /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */ - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); - SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); - SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB); - SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB); - SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); - SET_GetProgramivARB(exec, _mesa_GetProgramivARB); - SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB); -#endif - - /* ARB 28. GL_ARB_vertex_buffer_object */ -#if FEATURE_ARB_vertex_buffer_object - SET_BindBufferARB(exec, _mesa_BindBufferARB); - SET_BufferDataARB(exec, _mesa_BufferDataARB); - SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB); - SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB); - SET_GenBuffersARB(exec, _mesa_GenBuffersARB); - SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB); - SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB); - SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB); - SET_IsBufferARB(exec, _mesa_IsBufferARB); - SET_MapBufferARB(exec, _mesa_MapBufferARB); - SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); -#endif - - /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif - - /* ARB 37. GL_ARB_draw_buffers */ -#if FEATURE_draw_read_buffer - SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); -#endif - -#if FEATURE_ARB_shader_objects - SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); - SET_GetHandleARB(exec, _mesa_GetHandleARB); - SET_DetachObjectARB(exec, _mesa_DetachObjectARB); - SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); - SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB); - SET_CompileShaderARB(exec, _mesa_CompileShaderARB); - SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); - SET_AttachObjectARB(exec, _mesa_AttachObjectARB); - SET_LinkProgramARB(exec, _mesa_LinkProgramARB); - SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB); - SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB); - SET_Uniform1fARB(exec, _mesa_Uniform1fARB); - SET_Uniform2fARB(exec, _mesa_Uniform2fARB); - SET_Uniform3fARB(exec, _mesa_Uniform3fARB); - SET_Uniform4fARB(exec, _mesa_Uniform4fARB); - SET_Uniform1iARB(exec, _mesa_Uniform1iARB); - SET_Uniform2iARB(exec, _mesa_Uniform2iARB); - SET_Uniform3iARB(exec, _mesa_Uniform3iARB); - SET_Uniform4iARB(exec, _mesa_Uniform4iARB); - SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB); - SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB); - SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB); - SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB); - SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB); - SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB); - SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB); - SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB); - SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB); - SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB); - SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB); - SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); - SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); - SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); - SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); - SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB); - SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB); - SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB); - SET_GetUniformivARB(exec, _mesa_GetUniformivARB); - SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB); -#endif /* FEATURE_ARB_shader_objects */ - -#if FEATURE_ARB_vertex_shader - SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB); - SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB); - SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB); -#endif /* FEATURE_ARB_vertex_shader */ - - /* GL_ATI_fragment_shader */ -#if FEATURE_ATI_fragment_shader - SET_GenFragmentShadersATI(exec, _mesa_GenFragmentShadersATI); - SET_BindFragmentShaderATI(exec, _mesa_BindFragmentShaderATI); - SET_DeleteFragmentShaderATI(exec, _mesa_DeleteFragmentShaderATI); - SET_BeginFragmentShaderATI(exec, _mesa_BeginFragmentShaderATI); - SET_EndFragmentShaderATI(exec, _mesa_EndFragmentShaderATI); - SET_PassTexCoordATI(exec, _mesa_PassTexCoordATI); - SET_SampleMapATI(exec, _mesa_SampleMapATI); - SET_ColorFragmentOp1ATI(exec, _mesa_ColorFragmentOp1ATI); - SET_ColorFragmentOp2ATI(exec, _mesa_ColorFragmentOp2ATI); - SET_ColorFragmentOp3ATI(exec, _mesa_ColorFragmentOp3ATI); - SET_AlphaFragmentOp1ATI(exec, _mesa_AlphaFragmentOp1ATI); - SET_AlphaFragmentOp2ATI(exec, _mesa_AlphaFragmentOp2ATI); - SET_AlphaFragmentOp3ATI(exec, _mesa_AlphaFragmentOp3ATI); - SET_SetFragmentShaderConstantATI(exec, _mesa_SetFragmentShaderConstantATI); -#endif - -#if FEATURE_EXT_framebuffer_object - SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT); - SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT); - SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT); - SET_GenRenderbuffersEXT(exec, _mesa_GenRenderbuffersEXT); - SET_RenderbufferStorageEXT(exec, _mesa_RenderbufferStorageEXT); - SET_GetRenderbufferParameterivEXT(exec, _mesa_GetRenderbufferParameterivEXT); - SET_IsFramebufferEXT(exec, _mesa_IsFramebufferEXT); - SET_BindFramebufferEXT(exec, _mesa_BindFramebufferEXT); - SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT); - SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT); - SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT); - SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT); - SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT); - SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT); - SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT); - SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT); - SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); -#endif - -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - -#if FEATURE_EXT_framebuffer_blit - SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); -#endif - - /* GL_EXT_gpu_program_parameters */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT); - SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT); -#endif - - /* GL_MESA_texture_array / GL_EXT_texture_array */ -#if FEATURE_EXT_framebuffer_object - SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT); -#endif - - /* GL_ATI_separate_stencil */ - SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); -} - diff --git a/src/libs/mesa/mesa/main/api_exec.h b/src/libs/mesa/mesa/main/api_exec.h deleted file mode 100644 index 4bd715053a..0000000000 --- a/src/libs/mesa/mesa/main/api_exec.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 API_EXEC_H -#define API_EXEC_H - - -struct _glapi_table; - - -extern void -_mesa_init_exec_table(struct _glapi_table *exec); - - -#endif diff --git a/src/libs/mesa/mesa/main/api_loopback.c b/src/libs/mesa/mesa/main/api_loopback.c deleted file mode 100644 index 0e3f5ff957..0000000000 --- a/src/libs/mesa/mesa/main/api_loopback.c +++ /dev/null @@ -1,1657 +0,0 @@ -/** - * \file api_loopback.c - * - * \author Keith Whitwell - */ - -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - */ - - -#include "glheader.h" -#include "macros.h" -#include "api_loopback.h" -#include "mtypes.h" -#include "glapi/glapi.h" -#include "glapi/glapitable.h" -#include "glapi/glthread.h" -#include "glapi/dispatch.h" - -/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc - * calls to a smaller set of driver-provided formats. Currently just - * go back to dispatch to find these (eg. call glNormal3f directly), - * hence 'loopback'. - * - * The driver must supply all of the remaining entry points, which are - * listed in dd.h. The easiest way for a driver to do this is to - * install the supplied software t&l module. - */ -#define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a)) -#define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y)) -#define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z)) -#define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w)) -#define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z)) -#define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s)) -#define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t)) -#define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u)) -#define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v)) -#define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c)) -#define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s)) -#define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t)) -#define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u)) -#define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v)) -#define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x)) -#define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y)) -#define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c)) -#define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d)) - -#define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x)) -#define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y)) -#define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z)) -#define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w)) -#define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x)) -#define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y)) -#define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z)) -#define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w)) -#define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) -#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) - -static void GLAPIENTRY -loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) -{ - COLORF( BYTE_TO_FLOAT(red), - BYTE_TO_FLOAT(green), - BYTE_TO_FLOAT(blue), - 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3d_f( GLdouble red, GLdouble green, GLdouble blue ) -{ - COLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue, 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3i_f( GLint red, GLint green, GLint blue ) -{ - COLORF( INT_TO_FLOAT(red), INT_TO_FLOAT(green), - INT_TO_FLOAT(blue), 1.0); -} - -static void GLAPIENTRY -loopback_Color3s_f( GLshort red, GLshort green, GLshort blue ) -{ - COLORF( SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), - SHORT_TO_FLOAT(blue), 1.0); -} - -static void GLAPIENTRY -loopback_Color3ui_f( GLuint red, GLuint green, GLuint blue ) -{ - COLORF( UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), - UINT_TO_FLOAT(blue), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3us_f( GLushort red, GLushort green, GLushort blue ) -{ - COLORF( USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), - USHORT_TO_FLOAT(blue), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3ub_f( GLubyte red, GLubyte green, GLubyte blue ) -{ - COLORF( UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green), - UBYTE_TO_FLOAT(blue), 1.0 ); -} - - -static void GLAPIENTRY -loopback_Color3bv_f( const GLbyte *v ) -{ - COLORF( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3dv_f( const GLdouble *v ) -{ - COLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3iv_f( const GLint *v ) -{ - COLORF( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3sv_f( const GLshort *v ) -{ - COLORF( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3uiv_f( const GLuint *v ) -{ - COLORF( UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3usv_f( const GLushort *v ) -{ - COLORF( USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]), 1.0 ); -} - -static void GLAPIENTRY -loopback_Color3ubv_f( const GLubyte *v ) -{ - COLORF( UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), 1.0 ); -} - - -static void GLAPIENTRY -loopback_Color4b_f( GLbyte red, GLbyte green, GLbyte blue, - GLbyte alpha ) -{ - COLORF( BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green), - BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha) ); -} - -static void GLAPIENTRY -loopback_Color4d_f( GLdouble red, GLdouble green, GLdouble blue, - GLdouble alpha ) -{ - COLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha ); -} - -static void GLAPIENTRY -loopback_Color4i_f( GLint red, GLint green, GLint blue, GLint alpha ) -{ - COLORF( INT_TO_FLOAT(red), INT_TO_FLOAT(green), - INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha) ); -} - -static void GLAPIENTRY -loopback_Color4s_f( GLshort red, GLshort green, GLshort blue, - GLshort alpha ) -{ - COLORF( SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), - SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha) ); -} - -static void GLAPIENTRY -loopback_Color4ui_f( GLuint red, GLuint green, GLuint blue, GLuint alpha ) -{ - COLORF( UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), - UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha) ); -} - -static void GLAPIENTRY -loopback_Color4us_f( GLushort red, GLushort green, GLushort blue, GLushort alpha ) -{ - COLORF( USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), - USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha) ); -} - -static void GLAPIENTRY -loopback_Color4ub_f( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) -{ - COLORF( UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green), - UBYTE_TO_FLOAT(blue), UBYTE_TO_FLOAT(alpha) ); -} - - -static void GLAPIENTRY -loopback_Color4iv_f( const GLint *v ) -{ - COLORF( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]) ); -} - - -static void GLAPIENTRY -loopback_Color4bv_f( const GLbyte *v ) -{ - COLORF( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]) ); -} - -static void GLAPIENTRY -loopback_Color4dv_f( const GLdouble *v ) -{ - COLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3] ); -} - - -static void GLAPIENTRY -loopback_Color4sv_f( const GLshort *v) -{ - COLORF( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]) ); -} - - -static void GLAPIENTRY -loopback_Color4uiv_f( const GLuint *v) -{ - COLORF( UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]) ); -} - -static void GLAPIENTRY -loopback_Color4usv_f( const GLushort *v) -{ - COLORF( USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]) ); -} - -static void GLAPIENTRY -loopback_Color4ubv_f( const GLubyte *v) -{ - COLORF( UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]) ); -} - - -static void GLAPIENTRY -loopback_FogCoorddEXT( GLdouble d ) -{ - FOGCOORDF( (GLfloat) d ); -} - -static void GLAPIENTRY -loopback_FogCoorddvEXT( const GLdouble *v ) -{ - FOGCOORDF( (GLfloat) *v ); -} - - -static void GLAPIENTRY -loopback_Indexd( GLdouble c ) -{ - INDEX( (GLfloat) c ); -} - -static void GLAPIENTRY -loopback_Indexi( GLint c ) -{ - INDEX( (GLfloat) c ); -} - -static void GLAPIENTRY -loopback_Indexs( GLshort c ) -{ - INDEX( (GLfloat) c ); -} - -static void GLAPIENTRY -loopback_Indexub( GLubyte c ) -{ - INDEX( (GLfloat) c ); -} - -static void GLAPIENTRY -loopback_Indexdv( const GLdouble *c ) -{ - INDEX( (GLfloat) *c ); -} - -static void GLAPIENTRY -loopback_Indexiv( const GLint *c ) -{ - INDEX( (GLfloat) *c ); -} - -static void GLAPIENTRY -loopback_Indexsv( const GLshort *c ) -{ - INDEX( (GLfloat) *c ); -} - -static void GLAPIENTRY -loopback_Indexubv( const GLubyte *c ) -{ - INDEX( (GLfloat) *c ); -} - - -static void GLAPIENTRY -loopback_EdgeFlagv(const GLboolean *flag) -{ - CALL_EdgeFlag(GET_DISPATCH(), (*flag)); -} - - -static void GLAPIENTRY -loopback_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz ) -{ - NORMAL( BYTE_TO_FLOAT(nx), BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz) ); -} - -static void GLAPIENTRY -loopback_Normal3d( GLdouble nx, GLdouble ny, GLdouble nz ) -{ - NORMAL((GLfloat) nx, (GLfloat) ny, (GLfloat) nz); -} - -static void GLAPIENTRY -loopback_Normal3i( GLint nx, GLint ny, GLint nz ) -{ - NORMAL( INT_TO_FLOAT(nx), INT_TO_FLOAT(ny), INT_TO_FLOAT(nz) ); -} - -static void GLAPIENTRY -loopback_Normal3s( GLshort nx, GLshort ny, GLshort nz ) -{ - NORMAL( SHORT_TO_FLOAT(nx), SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz) ); -} - -static void GLAPIENTRY -loopback_Normal3bv( const GLbyte *v ) -{ - NORMAL( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]) ); -} - -static void GLAPIENTRY -loopback_Normal3dv( const GLdouble *v ) -{ - NORMAL( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_Normal3iv( const GLint *v ) -{ - NORMAL( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]) ); -} - -static void GLAPIENTRY -loopback_Normal3sv( const GLshort *v ) -{ - NORMAL( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]) ); -} - -static void GLAPIENTRY -loopback_TexCoord1d( GLdouble s ) -{ - TEXCOORD1((GLfloat) s); -} - -static void GLAPIENTRY -loopback_TexCoord1i( GLint s ) -{ - TEXCOORD1((GLfloat) s); -} - -static void GLAPIENTRY -loopback_TexCoord1s( GLshort s ) -{ - TEXCOORD1((GLfloat) s); -} - -static void GLAPIENTRY -loopback_TexCoord2d( GLdouble s, GLdouble t ) -{ - TEXCOORD2((GLfloat) s,(GLfloat) t); -} - -static void GLAPIENTRY -loopback_TexCoord2s( GLshort s, GLshort t ) -{ - TEXCOORD2((GLfloat) s,(GLfloat) t); -} - -static void GLAPIENTRY -loopback_TexCoord2i( GLint s, GLint t ) -{ - TEXCOORD2((GLfloat) s,(GLfloat) t); -} - -static void GLAPIENTRY -loopback_TexCoord3d( GLdouble s, GLdouble t, GLdouble r ) -{ - TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r); -} - -static void GLAPIENTRY -loopback_TexCoord3i( GLint s, GLint t, GLint r ) -{ - TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r); -} - -static void GLAPIENTRY -loopback_TexCoord3s( GLshort s, GLshort t, GLshort r ) -{ - TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r); -} - -static void GLAPIENTRY -loopback_TexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) -{ - TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q); -} - -static void GLAPIENTRY -loopback_TexCoord4i( GLint s, GLint t, GLint r, GLint q ) -{ - TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q); -} - -static void GLAPIENTRY -loopback_TexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ) -{ - TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q); -} - -static void GLAPIENTRY -loopback_TexCoord1dv( const GLdouble *v ) -{ - TEXCOORD1((GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_TexCoord1iv( const GLint *v ) -{ - TEXCOORD1((GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_TexCoord1sv( const GLshort *v ) -{ - TEXCOORD1((GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_TexCoord2dv( const GLdouble *v ) -{ - TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_TexCoord2iv( const GLint *v ) -{ - TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_TexCoord2sv( const GLshort *v ) -{ - TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_TexCoord3dv( const GLdouble *v ) -{ - TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_TexCoord3iv( const GLint *v ) -{ - TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_TexCoord3sv( const GLshort *v ) -{ - TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_TexCoord4dv( const GLdouble *v ) -{ - TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_TexCoord4iv( const GLint *v ) -{ - TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_TexCoord4sv( const GLshort *v ) -{ - TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_Vertex2d( GLdouble x, GLdouble y ) -{ - VERTEX2( (GLfloat) x, (GLfloat) y ); -} - -static void GLAPIENTRY -loopback_Vertex2i( GLint x, GLint y ) -{ - VERTEX2( (GLfloat) x, (GLfloat) y ); -} - -static void GLAPIENTRY -loopback_Vertex2s( GLshort x, GLshort y ) -{ - VERTEX2( (GLfloat) x, (GLfloat) y ); -} - -static void GLAPIENTRY -loopback_Vertex3d( GLdouble x, GLdouble y, GLdouble z ) -{ - VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z ); -} - -static void GLAPIENTRY -loopback_Vertex3i( GLint x, GLint y, GLint z ) -{ - VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z ); -} - -static void GLAPIENTRY -loopback_Vertex3s( GLshort x, GLshort y, GLshort z ) -{ - VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z ); -} - -static void GLAPIENTRY -loopback_Vertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) -{ - VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w ); -} - -static void GLAPIENTRY -loopback_Vertex4i( GLint x, GLint y, GLint z, GLint w ) -{ - VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w ); -} - -static void GLAPIENTRY -loopback_Vertex4s( GLshort x, GLshort y, GLshort z, GLshort w ) -{ - VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w ); -} - -static void GLAPIENTRY -loopback_Vertex2dv( const GLdouble *v ) -{ - VERTEX2( (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_Vertex2iv( const GLint *v ) -{ - VERTEX2( (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_Vertex2sv( const GLshort *v ) -{ - VERTEX2( (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_Vertex3dv( const GLdouble *v ) -{ - VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_Vertex3iv( const GLint *v ) -{ - VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_Vertex3sv( const GLshort *v ) -{ - VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_Vertex4dv( const GLdouble *v ) -{ - VERTEX4( (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_Vertex4iv( const GLint *v ) -{ - VERTEX4( (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_Vertex4sv( const GLshort *v ) -{ - VERTEX4( (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1dARB(GLenum target, GLdouble s) -{ - MULTI_TEXCOORD1( target, (GLfloat) s ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1dvARB(GLenum target, const GLdouble *v) -{ - MULTI_TEXCOORD1( target, (GLfloat) v[0] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1iARB(GLenum target, GLint s) -{ - MULTI_TEXCOORD1( target, (GLfloat) s ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1ivARB(GLenum target, const GLint *v) -{ - MULTI_TEXCOORD1( target, (GLfloat) v[0] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1sARB(GLenum target, GLshort s) -{ - MULTI_TEXCOORD1( target, (GLfloat) s ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord1svARB(GLenum target, const GLshort *v) -{ - MULTI_TEXCOORD1( target, (GLfloat) v[0] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) -{ - MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2dvARB(GLenum target, const GLdouble *v) -{ - MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2iARB(GLenum target, GLint s, GLint t) -{ - MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2ivARB(GLenum target, const GLint *v) -{ - MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) -{ - MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord2svARB(GLenum target, const GLshort *v) -{ - MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3dvARB(GLenum target, const GLdouble *v) -{ - MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) -{ - MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3ivARB(GLenum target, const GLint *v) -{ - MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) -{ - MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord3svARB(GLenum target, const GLshort *v) -{ - MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, - (GLfloat) r, (GLfloat) q ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4dvARB(GLenum target, const GLdouble *v) -{ - MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, - (GLfloat) r, (GLfloat) q ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4ivARB(GLenum target, const GLint *v) -{ - MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, - (GLfloat) r, (GLfloat) q ); -} - -static void GLAPIENTRY -loopback_MultiTexCoord4svARB(GLenum target, const GLshort *v) -{ - MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3] ); -} - -static void GLAPIENTRY -loopback_EvalCoord2dv( const GLdouble *u ) -{ - EVALCOORD2( (GLfloat) u[0], (GLfloat) u[1] ); -} - -static void GLAPIENTRY -loopback_EvalCoord2fv( const GLfloat *u ) -{ - EVALCOORD2( u[0], u[1] ); -} - -static void GLAPIENTRY -loopback_EvalCoord2d( GLdouble u, GLdouble v ) -{ - EVALCOORD2( (GLfloat) u, (GLfloat) v ); -} - -static void GLAPIENTRY -loopback_EvalCoord1dv( const GLdouble *u ) -{ - EVALCOORD1( (GLfloat) *u ); -} - -static void GLAPIENTRY -loopback_EvalCoord1fv( const GLfloat *u ) -{ - EVALCOORD1( (GLfloat) *u ); -} - -static void GLAPIENTRY -loopback_EvalCoord1d( GLdouble u ) -{ - EVALCOORD1( (GLfloat) u ); -} - -static void GLAPIENTRY -loopback_Materialf( GLenum face, GLenum pname, GLfloat param ) -{ - GLfloat fparam[4]; - fparam[0] = param; - MATERIALFV( face, pname, fparam ); -} - -static void GLAPIENTRY -loopback_Materiali(GLenum face, GLenum pname, GLint param ) -{ - GLfloat p = (GLfloat) param; - MATERIALFV(face, pname, &p); -} - -static void GLAPIENTRY -loopback_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: - ; - } - MATERIALFV(face, pname, fparam); -} - - -static void GLAPIENTRY -loopback_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) -{ - RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2); -} - -static void GLAPIENTRY -loopback_Rectdv(const GLdouble *v1, const GLdouble *v2) -{ - RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]); -} - -static void GLAPIENTRY -loopback_Rectfv(const GLfloat *v1, const GLfloat *v2) -{ - RECTF(v1[0], v1[1], v2[0], v2[1]); -} - -static void GLAPIENTRY -loopback_Recti(GLint x1, GLint y1, GLint x2, GLint y2) -{ - RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2); -} - -static void GLAPIENTRY -loopback_Rectiv(const GLint *v1, const GLint *v2) -{ - RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]); -} - -static void GLAPIENTRY -loopback_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) -{ - RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2); -} - -static void GLAPIENTRY -loopback_Rectsv(const GLshort *v1, const GLshort *v2) -{ - RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]); -} - -static void GLAPIENTRY -loopback_SecondaryColor3bEXT_f( GLbyte red, GLbyte green, GLbyte blue ) -{ - SECONDARYCOLORF( BYTE_TO_FLOAT(red), - BYTE_TO_FLOAT(green), - BYTE_TO_FLOAT(blue) ); -} - -static void GLAPIENTRY -loopback_SecondaryColor3dEXT_f( GLdouble red, GLdouble green, GLdouble blue ) -{ - SECONDARYCOLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue ); -} - -static void GLAPIENTRY -loopback_SecondaryColor3iEXT_f( GLint red, GLint green, GLint blue ) -{ - SECONDARYCOLORF( INT_TO_FLOAT(red), - INT_TO_FLOAT(green), - INT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3sEXT_f( GLshort red, GLshort green, GLshort blue ) -{ - SECONDARYCOLORF(SHORT_TO_FLOAT(red), - SHORT_TO_FLOAT(green), - SHORT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3uiEXT_f( GLuint red, GLuint green, GLuint blue ) -{ - SECONDARYCOLORF(UINT_TO_FLOAT(red), - UINT_TO_FLOAT(green), - UINT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3usEXT_f( GLushort red, GLushort green, GLushort blue ) -{ - SECONDARYCOLORF(USHORT_TO_FLOAT(red), - USHORT_TO_FLOAT(green), - USHORT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3ubEXT_f( GLubyte red, GLubyte green, GLubyte blue ) -{ - SECONDARYCOLORF(UBYTE_TO_FLOAT(red), - UBYTE_TO_FLOAT(green), - UBYTE_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3bvEXT_f( const GLbyte *v ) -{ - SECONDARYCOLORF(BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3dvEXT_f( const GLdouble *v ) -{ - SECONDARYCOLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} -static void GLAPIENTRY -loopback_SecondaryColor3ivEXT_f( const GLint *v ) -{ - SECONDARYCOLORF(INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3svEXT_f( const GLshort *v ) -{ - SECONDARYCOLORF(SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3uivEXT_f( const GLuint *v ) -{ - SECONDARYCOLORF(UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3usvEXT_f( const GLushort *v ) -{ - SECONDARYCOLORF(USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3ubvEXT_f( const GLubyte *v ) -{ - SECONDARYCOLORF(UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2])); -} - - -/* - * GL_NV_vertex_program: - * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions. - */ - -static void GLAPIENTRY -loopback_VertexAttrib1sNV(GLuint index, GLshort x) -{ - ATTRIB1NV(index, (GLfloat) x); -} - -static void GLAPIENTRY -loopback_VertexAttrib1dNV(GLuint index, GLdouble x) -{ - ATTRIB1NV(index, (GLfloat) x); -} - -static void GLAPIENTRY -loopback_VertexAttrib2sNV(GLuint index, GLshort x, GLshort y) -{ - ATTRIB2NV(index, (GLfloat) x, y); -} - -static void GLAPIENTRY -loopback_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) -{ - ATTRIB2NV(index, (GLfloat) x, (GLfloat) y); -} - -static void GLAPIENTRY -loopback_VertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) -{ - ATTRIB3NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z); -} - -static void GLAPIENTRY -loopback_VertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -loopback_VertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -loopback_VertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -loopback_VertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - ATTRIB4NV(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), - UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w)); -} - -static void GLAPIENTRY -loopback_VertexAttrib1svNV(GLuint index, const GLshort *v) -{ - ATTRIB1NV(index, (GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_VertexAttrib1dvNV(GLuint index, const GLdouble *v) -{ - ATTRIB1NV(index, (GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_VertexAttrib2svNV(GLuint index, const GLshort *v) -{ - ATTRIB2NV(index, (GLfloat) v[0], (GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_VertexAttrib2dvNV(GLuint index, const GLdouble *v) -{ - ATTRIB2NV(index, (GLfloat) v[0], (GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_VertexAttrib3svNV(GLuint index, const GLshort *v) -{ - ATTRIB3NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v) -{ - ATTRIB3NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4svNV(GLuint index, const GLshort *v) -{ - ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], - (GLfloat)v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4dvNV(GLuint index, const GLdouble *v) -{ - ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4ubvNV(GLuint index, const GLubyte *v) -{ - ATTRIB4NV(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3])); -} - - -static void GLAPIENTRY -loopback_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib1svNV(index + i, v + i); -} - -static void GLAPIENTRY -loopback_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB1NV(index + i, v[i]); -} - -static void GLAPIENTRY -loopback_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib1dvNV(index + i, v + i); -} - -static void GLAPIENTRY -loopback_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib2svNV(index + i, v + 2 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB2NV(index + i, v[2 * i], v[2 * i + 1]); -} - -static void GLAPIENTRY -loopback_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib2dvNV(index + i, v + 2 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib3svNV(index + i, v + 3 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB3NV(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]); -} - -static void GLAPIENTRY -loopback_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib3dvNV(index + i, v + 3 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4svNV(index + i, v + 4 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB4NV(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]); -} - -static void GLAPIENTRY -loopback_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4dvNV(index + i, v + 4 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4ubvNV(index + i, v + 4 * i); -} - - -/* - * GL_ARB_vertex_program - * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions. - */ - -static void GLAPIENTRY -loopback_VertexAttrib1sARB(GLuint index, GLshort x) -{ - ATTRIB1ARB(index, (GLfloat) x); -} - -static void GLAPIENTRY -loopback_VertexAttrib1dARB(GLuint index, GLdouble x) -{ - ATTRIB1ARB(index, (GLfloat) x); -} - -static void GLAPIENTRY -loopback_VertexAttrib2sARB(GLuint index, GLshort x, GLshort y) -{ - ATTRIB2ARB(index, (GLfloat) x, y); -} - -static void GLAPIENTRY -loopback_VertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) -{ - ATTRIB2ARB(index, (GLfloat) x, (GLfloat) y); -} - -static void GLAPIENTRY -loopback_VertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) -{ - ATTRIB3ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z); -} - -static void GLAPIENTRY -loopback_VertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -loopback_VertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -loopback_VertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -loopback_VertexAttrib1svARB(GLuint index, const GLshort *v) -{ - ATTRIB1ARB(index, (GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_VertexAttrib1dvARB(GLuint index, const GLdouble *v) -{ - ATTRIB1ARB(index, (GLfloat) v[0]); -} - -static void GLAPIENTRY -loopback_VertexAttrib2svARB(GLuint index, const GLshort *v) -{ - ATTRIB2ARB(index, (GLfloat) v[0], (GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_VertexAttrib2dvARB(GLuint index, const GLdouble *v) -{ - ATTRIB2ARB(index, (GLfloat) v[0], (GLfloat) v[1]); -} - -static void GLAPIENTRY -loopback_VertexAttrib3svARB(GLuint index, const GLshort *v) -{ - ATTRIB3ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_VertexAttrib3dvARB(GLuint index, const GLdouble *v) -{ - ATTRIB3ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4svARB(GLuint index, const GLshort *v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], - (GLfloat)v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4dvARB(GLuint index, const GLdouble *v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4bvARB(GLuint index, const GLbyte * v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4ivARB(GLuint index, const GLint * v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4ubvARB(GLuint index, const GLubyte * v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4usvARB(GLuint index, const GLushort * v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4uivARB(GLuint index, const GLuint * v) -{ - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NbvARB(GLuint index, const GLbyte * v) -{ - ATTRIB4ARB(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3])); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NsvARB(GLuint index, const GLshort * v) -{ - ATTRIB4ARB(index, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3])); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NivARB(GLuint index, const GLint * v) -{ - ATTRIB4ARB(index, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3])); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - ATTRIB4ARB(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), - UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w)); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NubvARB(GLuint index, const GLubyte * v) -{ - ATTRIB4ARB(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3])); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NusvARB(GLuint index, const GLushort * v) -{ - ATTRIB4ARB(index, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3])); -} - -static void GLAPIENTRY -loopback_VertexAttrib4NuivARB(GLuint index, const GLuint * v) -{ - ATTRIB4ARB(index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3])); -} - - - - -/* - * This code never registers handlers for any of the entry points - * listed in vtxfmt.h. - */ -void -_mesa_loopback_init_api_table( struct _glapi_table *dest ) -{ - SET_Color3b(dest, loopback_Color3b_f); - SET_Color3d(dest, loopback_Color3d_f); - SET_Color3i(dest, loopback_Color3i_f); - SET_Color3s(dest, loopback_Color3s_f); - SET_Color3ui(dest, loopback_Color3ui_f); - SET_Color3us(dest, loopback_Color3us_f); - SET_Color3ub(dest, loopback_Color3ub_f); - SET_Color4b(dest, loopback_Color4b_f); - SET_Color4d(dest, loopback_Color4d_f); - SET_Color4i(dest, loopback_Color4i_f); - SET_Color4s(dest, loopback_Color4s_f); - SET_Color4ui(dest, loopback_Color4ui_f); - SET_Color4us(dest, loopback_Color4us_f); - SET_Color4ub(dest, loopback_Color4ub_f); - SET_Color3bv(dest, loopback_Color3bv_f); - SET_Color3dv(dest, loopback_Color3dv_f); - SET_Color3iv(dest, loopback_Color3iv_f); - SET_Color3sv(dest, loopback_Color3sv_f); - SET_Color3uiv(dest, loopback_Color3uiv_f); - SET_Color3usv(dest, loopback_Color3usv_f); - SET_Color3ubv(dest, loopback_Color3ubv_f); - SET_Color4bv(dest, loopback_Color4bv_f); - SET_Color4dv(dest, loopback_Color4dv_f); - SET_Color4iv(dest, loopback_Color4iv_f); - SET_Color4sv(dest, loopback_Color4sv_f); - SET_Color4uiv(dest, loopback_Color4uiv_f); - SET_Color4usv(dest, loopback_Color4usv_f); - SET_Color4ubv(dest, loopback_Color4ubv_f); - - SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f); - SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f); - SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f); - SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f); - SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f); - SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f); - SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f); - SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f); - SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f); - SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f); - SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f); - SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); - SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); - SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); - - SET_EdgeFlagv(dest, loopback_EdgeFlagv); - - SET_Indexd(dest, loopback_Indexd); - SET_Indexi(dest, loopback_Indexi); - SET_Indexs(dest, loopback_Indexs); - SET_Indexub(dest, loopback_Indexub); - SET_Indexdv(dest, loopback_Indexdv); - SET_Indexiv(dest, loopback_Indexiv); - SET_Indexsv(dest, loopback_Indexsv); - SET_Indexubv(dest, loopback_Indexubv); - SET_Normal3b(dest, loopback_Normal3b); - SET_Normal3d(dest, loopback_Normal3d); - SET_Normal3i(dest, loopback_Normal3i); - SET_Normal3s(dest, loopback_Normal3s); - SET_Normal3bv(dest, loopback_Normal3bv); - SET_Normal3dv(dest, loopback_Normal3dv); - SET_Normal3iv(dest, loopback_Normal3iv); - SET_Normal3sv(dest, loopback_Normal3sv); - SET_TexCoord1d(dest, loopback_TexCoord1d); - SET_TexCoord1i(dest, loopback_TexCoord1i); - SET_TexCoord1s(dest, loopback_TexCoord1s); - SET_TexCoord2d(dest, loopback_TexCoord2d); - SET_TexCoord2s(dest, loopback_TexCoord2s); - SET_TexCoord2i(dest, loopback_TexCoord2i); - SET_TexCoord3d(dest, loopback_TexCoord3d); - SET_TexCoord3i(dest, loopback_TexCoord3i); - SET_TexCoord3s(dest, loopback_TexCoord3s); - SET_TexCoord4d(dest, loopback_TexCoord4d); - SET_TexCoord4i(dest, loopback_TexCoord4i); - SET_TexCoord4s(dest, loopback_TexCoord4s); - SET_TexCoord1dv(dest, loopback_TexCoord1dv); - SET_TexCoord1iv(dest, loopback_TexCoord1iv); - SET_TexCoord1sv(dest, loopback_TexCoord1sv); - SET_TexCoord2dv(dest, loopback_TexCoord2dv); - SET_TexCoord2iv(dest, loopback_TexCoord2iv); - SET_TexCoord2sv(dest, loopback_TexCoord2sv); - SET_TexCoord3dv(dest, loopback_TexCoord3dv); - SET_TexCoord3iv(dest, loopback_TexCoord3iv); - SET_TexCoord3sv(dest, loopback_TexCoord3sv); - SET_TexCoord4dv(dest, loopback_TexCoord4dv); - SET_TexCoord4iv(dest, loopback_TexCoord4iv); - SET_TexCoord4sv(dest, loopback_TexCoord4sv); - SET_Vertex2d(dest, loopback_Vertex2d); - SET_Vertex2i(dest, loopback_Vertex2i); - SET_Vertex2s(dest, loopback_Vertex2s); - SET_Vertex3d(dest, loopback_Vertex3d); - SET_Vertex3i(dest, loopback_Vertex3i); - SET_Vertex3s(dest, loopback_Vertex3s); - SET_Vertex4d(dest, loopback_Vertex4d); - SET_Vertex4i(dest, loopback_Vertex4i); - SET_Vertex4s(dest, loopback_Vertex4s); - SET_Vertex2dv(dest, loopback_Vertex2dv); - SET_Vertex2iv(dest, loopback_Vertex2iv); - SET_Vertex2sv(dest, loopback_Vertex2sv); - SET_Vertex3dv(dest, loopback_Vertex3dv); - SET_Vertex3iv(dest, loopback_Vertex3iv); - SET_Vertex3sv(dest, loopback_Vertex3sv); - SET_Vertex4dv(dest, loopback_Vertex4dv); - SET_Vertex4iv(dest, loopback_Vertex4iv); - SET_Vertex4sv(dest, loopback_Vertex4sv); - SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB); - SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB); - SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB); - SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB); - SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB); - SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB); - SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB); - SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB); - SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB); - SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB); - SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB); - SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB); - SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB); - SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB); - SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB); - SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB); - SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB); - SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB); - SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB); - SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB); - SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB); - SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB); - SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB); - SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB); - SET_EvalCoord2dv(dest, loopback_EvalCoord2dv); - SET_EvalCoord2fv(dest, loopback_EvalCoord2fv); - SET_EvalCoord2d(dest, loopback_EvalCoord2d); - SET_EvalCoord1dv(dest, loopback_EvalCoord1dv); - SET_EvalCoord1fv(dest, loopback_EvalCoord1fv); - SET_EvalCoord1d(dest, loopback_EvalCoord1d); - SET_Materialf(dest, loopback_Materialf); - SET_Materiali(dest, loopback_Materiali); - SET_Materialiv(dest, loopback_Materialiv); - SET_Rectd(dest, loopback_Rectd); - SET_Rectdv(dest, loopback_Rectdv); - SET_Rectfv(dest, loopback_Rectfv); - SET_Recti(dest, loopback_Recti); - SET_Rectiv(dest, loopback_Rectiv); - SET_Rects(dest, loopback_Rects); - SET_Rectsv(dest, loopback_Rectsv); - SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); - SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); - - SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); - SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); - SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); - SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV); - SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV); - SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV); - SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV); - SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV); - SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV); - SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV); - SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV); - SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV); - SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV); - SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV); - SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV); - SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV); - SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV); - SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV); - SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV); - SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV); - SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV); - SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV); - SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV); - SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV); - SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV); - SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV); - SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV); - SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV); - SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); - SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); - SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); - - SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB); - SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB); - SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB); - SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB); - SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB); - SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB); - SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB); - SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB); - SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB); - SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB); - SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB); - SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB); - SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB); - SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB); - SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB); - SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB); - SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB); - SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB); - SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB); - SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB); - SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB); - SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB); - SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB); - SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB); - SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB); - SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB); - SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); - SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); -} diff --git a/src/libs/mesa/mesa/main/api_loopback.h b/src/libs/mesa/mesa/main/api_loopback.h deleted file mode 100644 index 6f85bbc1d9..0000000000 --- a/src/libs/mesa/mesa/main/api_loopback.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 API_LOOPBACK_H -#define API_LOOPBACK_H - -#include "glheader.h" - - -struct _glapi_table; - -extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); - -#endif diff --git a/src/libs/mesa/mesa/main/api_noop.c b/src/libs/mesa/mesa/main/api_noop.c deleted file mode 100644 index a1cc3a2a4b..0000000000 --- a/src/libs/mesa/mesa/main/api_noop.c +++ /dev/null @@ -1,985 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "glheader.h" -#include "api_noop.h" -#include "api_validate.h" -#include "api_arrayelt.h" -#include "context.h" -#include "light.h" -#include "macros.h" -#if FEATURE_dlist -#include "dlist.h" -#endif -#include "glapi/dispatch.h" - - -/** - * \file - * Just update the ctx->Current vertex attributes. - * These functions are used when outside glBegin/glEnd or outside display - * lists. - */ - - -static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] = (GLfloat)b; -} - -static void GLAPIENTRY _mesa_noop_Indexf( GLfloat f ) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = f; -} - -static void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = *v; -} - -static void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG]; - dest[0] = a; - dest[1] = 0.0; - dest[2] = 0.0; - dest[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG]; - dest[0] = v[0]; - dest[1] = 0.0; - dest[2] = 0.0; - dest[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; - dest[0] = a; - dest[1] = b; - dest[2] = c; - dest[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = v[2]; - dest[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - color[0] = a; - color[1] = b; - color[2] = c; - color[3] = d; -} - -static void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - color[0] = v[0]; - color[1] = v[1]; - color[2] = v[2]; - color[3] = v[3]; -} - -static void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - color[0] = a; - color[1] = b; - color[2] = c; - color[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - color[0] = v[0]; - color[1] = v[1]; - color[2] = v[2]; - color[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = a; - dest[1] = 0; - dest[2] = 0; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = v[0]; - dest[1] = 0; - dest[2] = 0; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = a; - dest[1] = b; - dest[2] = 0; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = 0; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = a; - dest[1] = b; - dest[2] = c; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = v[2]; - dest[3] = 1; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b, - GLfloat c, GLfloat d ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = a; - dest[1] = b; - dest[2] = c; - dest[3] = d; - } -} - -static void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint unit = target - GL_TEXTURE0_ARB; - - /* unit is unsigned -- cannot be less than zero. - */ - if (unit < MAX_TEXTURE_COORD_UNITS) - { - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = v[2]; - dest[3] = v[3]; - } -} - -static void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; - color[0] = a; - color[1] = b; - color[2] = c; - color[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; - color[0] = v[0]; - color[1] = v[1]; - color[2] = v[2]; - color[3] = 1.0; -} - -static void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = a; - dest[1] = 0; - dest[2] = 0; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = v[0]; - dest[1] = 0; - dest[2] = 0; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = a; - dest[1] = b; - dest[2] = 0; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = 0; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = a; - dest[1] = b; - dest[2] = c; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = v[2]; - dest[3] = 1; -} - -static void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = a; - dest[1] = b; - dest[2] = c; - dest[3] = d; -} - -static void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - dest[0] = v[0]; - dest[1] = v[1]; - dest[2] = v[2]; - dest[3] = v[3]; -} - - -/** - * GL_NV_vertex_program attributes. - * Note that these attributes alias the conventional vertex attributes. - */ - -static void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x, - GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x, - GLfloat y, GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fNV(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) { - ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvNV(index)" ); -} - - - -/** - * GL_ARB_vertex_program attributes. - * Note that these attributes DO NOT alias the conventional vertex attributes. - */ - -static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, 0, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], 0, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], 0, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x, - GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], 1); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x, - GLfloat y, GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, w); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fARB(index)" ); -} - -static void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_ATTRIBS) { - ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], v[3]); - } - else - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvARB(index)" ); -} - - - -/** - * Called by glMaterial*() - */ -void GLAPIENTRY -_mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i, nr; - struct gl_material *mat = &ctx->Light.Material; - GLuint bitmask = _mesa_material_bitmask( ctx, face, pname, ~0, - "_mesa_noop_Materialfv" ); - - if (ctx->Light.ColorMaterialEnabled) - bitmask &= ~ctx->Light.ColorMaterialBitmask; - - if (bitmask == 0) - return; - - switch (pname) { - case GL_SHININESS: nr = 1; break; - case GL_COLOR_INDEXES: nr = 3; break; - default: nr = 4 ; break; - } - - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) - if (bitmask & (1<Attrib[i], nr, params ); - - _mesa_update_material( ctx, bitmask ); -} - - -/** - * These really are noops outside begin/end: - */ -static void GLAPIENTRY _mesa_noop_Vertex2fv( const GLfloat *v ) -{ - (void) v; -} - -static void GLAPIENTRY _mesa_noop_Vertex3fv( const GLfloat *v ) -{ - (void) v; -} - -static void GLAPIENTRY _mesa_noop_Vertex4fv( const GLfloat *v ) -{ - (void) v; -} - -static void GLAPIENTRY _mesa_noop_Vertex2f( GLfloat a, GLfloat b ) -{ - (void) a; (void) b; -} - -static void GLAPIENTRY _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c ) -{ - (void) a; (void) b; (void) c; -} - -static void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d ) -{ - (void) a; (void) b; (void) c; (void) d; -} - - -#if FEATURE_evaluators -/* Similarly, these have no effect outside begin/end: - */ -static void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a ) -{ - (void) a; -} - -static void GLAPIENTRY _mesa_noop_EvalCoord1fv( const GLfloat *v ) -{ - (void) v; -} - -static void GLAPIENTRY _mesa_noop_EvalCoord2f( GLfloat a, GLfloat b ) -{ - (void) a; (void) b; -} - -static void GLAPIENTRY _mesa_noop_EvalCoord2fv( const GLfloat *v ) -{ - (void) v; -} - -static void GLAPIENTRY _mesa_noop_EvalPoint1( GLint a ) -{ - (void) a; -} - -static void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b ) -{ - (void) a; (void) b; -} -#endif /* FEATURE_evaluators */ - - -/* Begin -- call into driver, should result in the vtxfmt being - * swapped out: - */ -static void GLAPIENTRY _mesa_noop_Begin( GLenum mode ) -{ - (void) mode; -} - - -/* End -- just raise an error - */ -static void GLAPIENTRY _mesa_noop_End( void ) -{ - GET_CURRENT_CONTEXT(ctx); - _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd(no glBegin)" ); -} - - -/** - * Execute a glRectf() function. This is not suitable for GL_COMPILE - * modes (as the test for outside begin/end is not compiled), - * but may be useful for drivers in circumstances which exclude - * display list interactions. - * - * (None of the functions in this file are suitable for GL_COMPILE - * modes). - */ -void GLAPIENTRY -_mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - { - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - } - - CALL_Begin(GET_DISPATCH(), (GL_QUADS)); - CALL_Vertex2f(GET_DISPATCH(), (x1, y1)); - CALL_Vertex2f(GET_DISPATCH(), (x2, y1)); - CALL_Vertex2f(GET_DISPATCH(), (x2, y2)); - CALL_Vertex2f(GET_DISPATCH(), (x1, y2)); - CALL_End(GET_DISPATCH(), ()); -} - - -/** - * Some very basic support for arrays. Drivers without explicit array - * support can hook these in, but still need to supply an array-elt - * implementation. - */ -static void GLAPIENTRY -_mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) - return; - - CALL_Begin(GET_DISPATCH(), (mode)); - for (i = 0; i < count; i++) - CALL_ArrayElement(GET_DISPATCH(), (start + i)); - CALL_End(GET_DISPATCH(), ()); -} - - -static void GLAPIENTRY -_mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) - return; - - CALL_Begin(GET_DISPATCH(), (mode)); - - switch (type) { - case GL_UNSIGNED_BYTE: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] )); - break; - case GL_UNSIGNED_SHORT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] )); - break; - case GL_UNSIGNED_INT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] )); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); - break; - } - - CALL_End(GET_DISPATCH(), ()); -} - - -static void GLAPIENTRY -_mesa_noop_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - - if (_mesa_validate_DrawRangeElements( ctx, mode, - start, end, - count, type, indices )) - CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices)); -} - -/* - * Eval Mesh - */ - -/** - * 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. - */ -void GLAPIENTRY -_mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - GLfloat u, du; - GLenum prim; - - switch (mode) { - case GL_POINT: - prim = GL_POINTS; - break; - case GL_LINE: - prim = GL_LINE_STRIP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" ); - return; - } - - /* No effect if vertex maps disabled. - */ - if (!ctx->Eval.Map1Vertex4 && - !ctx->Eval.Map1Vertex3 && - !(ctx->VertexProgram._Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS])) - return; - - du = ctx->Eval.MapGrid1du; - u = ctx->Eval.MapGrid1u1 + i1 * du; - - CALL_Begin(GET_DISPATCH(), (prim)); - for (i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord1f(GET_DISPATCH(), (u)); - } - CALL_End(GET_DISPATCH(), ()); -} - - - -void GLAPIENTRY -_mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat u, du, v, dv, v1, u1; - GLint i, j; - - switch (mode) { - case GL_POINT: - case GL_LINE: - case GL_FILL: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" ); - return; - } - - /* No effect if vertex maps disabled. - */ - if (!ctx->Eval.Map2Vertex4 && - !ctx->Eval.Map2Vertex3 && - !(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS])) - return; - - du = ctx->Eval.MapGrid2du; - dv = ctx->Eval.MapGrid2dv; - v1 = ctx->Eval.MapGrid2v1 + j1 * dv; - u1 = ctx->Eval.MapGrid2u1 + i1 * du; - - switch (mode) { - case GL_POINT: - CALL_Begin(GET_DISPATCH(), (GL_POINTS)); - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - } - CALL_End(GET_DISPATCH(), ()); - break; - case GL_LINE: - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - CALL_End(GET_DISPATCH(), ()); - } - for (u=u1,i=i1;i<=i2;i++,u+=du) { - CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); - for (v=v1,j=j1;j<=j2;j++,v+=dv) { - CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); - } - CALL_End(GET_DISPATCH(), ()); - } - break; - case GL_FILL: - for (v=v1,j=j1;jArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Begin = _mesa_noop_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif - vfmt->Color3f = _mesa_noop_Color3f; - vfmt->Color3fv = _mesa_noop_Color3fv; - vfmt->Color4f = _mesa_noop_Color4f; - vfmt->Color4fv = _mesa_noop_Color4fv; - vfmt->EdgeFlag = _mesa_noop_EdgeFlag; - vfmt->End = _mesa_noop_End; -#if FEATURE_evaluators - vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; - vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; - vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; - vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; - vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; - vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; -#endif - vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; - vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; - vfmt->Indexf = _mesa_noop_Indexf; - vfmt->Indexfv = _mesa_noop_Indexfv; - vfmt->Materialfv = _mesa_noop_Materialfv; - vfmt->MultiTexCoord1fARB = _mesa_noop_MultiTexCoord1fARB; - vfmt->MultiTexCoord1fvARB = _mesa_noop_MultiTexCoord1fvARB; - vfmt->MultiTexCoord2fARB = _mesa_noop_MultiTexCoord2fARB; - vfmt->MultiTexCoord2fvARB = _mesa_noop_MultiTexCoord2fvARB; - vfmt->MultiTexCoord3fARB = _mesa_noop_MultiTexCoord3fARB; - vfmt->MultiTexCoord3fvARB = _mesa_noop_MultiTexCoord3fvARB; - vfmt->MultiTexCoord4fARB = _mesa_noop_MultiTexCoord4fARB; - vfmt->MultiTexCoord4fvARB = _mesa_noop_MultiTexCoord4fvARB; - vfmt->Normal3f = _mesa_noop_Normal3f; - vfmt->Normal3fv = _mesa_noop_Normal3fv; - vfmt->SecondaryColor3fEXT = _mesa_noop_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = _mesa_noop_SecondaryColor3fvEXT; - vfmt->TexCoord1f = _mesa_noop_TexCoord1f; - vfmt->TexCoord1fv = _mesa_noop_TexCoord1fv; - vfmt->TexCoord2f = _mesa_noop_TexCoord2f; - vfmt->TexCoord2fv = _mesa_noop_TexCoord2fv; - vfmt->TexCoord3f = _mesa_noop_TexCoord3f; - vfmt->TexCoord3fv = _mesa_noop_TexCoord3fv; - vfmt->TexCoord4f = _mesa_noop_TexCoord4f; - vfmt->TexCoord4fv = _mesa_noop_TexCoord4fv; - vfmt->Vertex2f = _mesa_noop_Vertex2f; - vfmt->Vertex2fv = _mesa_noop_Vertex2fv; - vfmt->Vertex3f = _mesa_noop_Vertex3f; - vfmt->Vertex3fv = _mesa_noop_Vertex3fv; - vfmt->Vertex4f = _mesa_noop_Vertex4f; - vfmt->Vertex4fv = _mesa_noop_Vertex4fv; - vfmt->VertexAttrib1fNV = _mesa_noop_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = _mesa_noop_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = _mesa_noop_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = _mesa_noop_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = _mesa_noop_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = _mesa_noop_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = _mesa_noop_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = _mesa_noop_VertexAttrib4fvNV; - vfmt->VertexAttrib1fARB = _mesa_noop_VertexAttrib1fARB; - vfmt->VertexAttrib1fvARB = _mesa_noop_VertexAttrib1fvARB; - vfmt->VertexAttrib2fARB = _mesa_noop_VertexAttrib2fARB; - vfmt->VertexAttrib2fvARB = _mesa_noop_VertexAttrib2fvARB; - vfmt->VertexAttrib3fARB = _mesa_noop_VertexAttrib3fARB; - vfmt->VertexAttrib3fvARB = _mesa_noop_VertexAttrib3fvARB; - vfmt->VertexAttrib4fARB = _mesa_noop_VertexAttrib4fARB; - vfmt->VertexAttrib4fvARB = _mesa_noop_VertexAttrib4fvARB; - - vfmt->Rectf = _mesa_noop_Rectf; - - vfmt->DrawArrays = _mesa_noop_DrawArrays; - vfmt->DrawElements = _mesa_noop_DrawElements; - vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; -} diff --git a/src/libs/mesa/mesa/main/api_noop.h b/src/libs/mesa/mesa/main/api_noop.h deleted file mode 100644 index 8bf4660800..0000000000 --- a/src/libs/mesa/mesa/main/api_noop.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 _API_NOOP_H -#define _API_NOOP_H - -#include "mtypes.h" -#include "context.h" - -extern void GLAPIENTRY -_mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); - -extern void GLAPIENTRY -_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2); - -extern void GLAPIENTRY -_mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); - -extern void GLAPIENTRY -_mesa_noop_Materialfv(GLenum face, GLenum pname, const GLfloat *param); - -extern void -_mesa_noop_vtxfmt_init(GLvertexformat *vfmt); - -#endif diff --git a/src/libs/mesa/mesa/main/api_validate.c b/src/libs/mesa/mesa/main/api_validate.c deleted file mode 100644 index d37c4d763b..0000000000 --- a/src/libs/mesa/mesa/main/api_validate.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -#include "glheader.h" -#include "api_validate.h" -#include "context.h" -#include "imports.h" -#include "mtypes.h" -#include "state.h" - - -/** - * Find the max index in the given element/index buffer - */ -static GLuint -max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, - const void *indices, - struct gl_buffer_object *elementBuf) -{ - const GLubyte *map = NULL; - GLuint max = 0; - GLint i; - - if (elementBuf->Name) { - /* elements are in a user-defined buffer object. need to map it */ - map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - elementBuf); - /* Actual address is the sum of pointers */ - indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices); - } - - if (type == GL_UNSIGNED_INT) { - for (i = 0; i < count; i++) - if (((GLuint *) indices)[i] > max) - max = ((GLuint *) indices)[i]; - } - else if (type == GL_UNSIGNED_SHORT) { - for (i = 0; i < count; i++) - if (((GLushort *) indices)[i] > max) - max = ((GLushort *) indices)[i]; - } - else { - ASSERT(type == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) - if (((GLubyte *) indices)[i] > max) - max = ((GLubyte *) indices)[i]; - } - - if (map) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ctx->Array.ElementArrayBufferObj); - } - - return max; -} - -static GLboolean -check_valid_to_render(GLcontext *ctx, char *function) -{ - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glDraw%s(incomplete framebuffer)", function); - return GL_FALSE; - } - -#if FEATURE_es2_glsl - /* For ES2, we can draw if any vertex array is enabled (and we should - * always have a vertex program/shader). - */ - if (ctx->Array.ArrayObj->_Enabled == 0x0 || !ctx->VertexProgram._Current) - return GL_FALSE; -#else - /* For regular OpenGL, only draw if we have vertex positions (regardless - * of whether or not we have a vertex program/shader). - */ - if (!ctx->Array.ArrayObj->Vertex.Enabled && - !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) - return GL_FALSE; -#endif - - return GL_TRUE; -} - -GLboolean -_mesa_validate_DrawElements(GLcontext *ctx, - GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (count <= 0) { - if (count < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawElements(count)" ); - return GL_FALSE; - } - - if (mode > GL_POLYGON) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(mode)" ); - return GL_FALSE; - } - - if (type != GL_UNSIGNED_INT && - type != GL_UNSIGNED_BYTE && - type != GL_UNSIGNED_SHORT) - { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); - return GL_FALSE; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (!check_valid_to_render(ctx, "Elements")) - return GL_FALSE; - - /* Vertex buffer object tests */ - if (ctx->Array.ElementArrayBufferObj->Name) { - /* use indices in the buffer object */ - GLuint indexBytes; - - if (type == GL_UNSIGNED_INT) { - indexBytes = count * sizeof(GLuint); - } - else if (type == GL_UNSIGNED_BYTE) { - indexBytes = count * sizeof(GLubyte); - } - else { - ASSERT(type == GL_UNSIGNED_SHORT); - indexBytes = count * sizeof(GLushort); - } - - /* make sure count doesn't go outside buffer bounds */ - if (indexBytes > (GLuint) ctx->Array.ElementArrayBufferObj->Size) { - _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); - return GL_FALSE; - } - } - else { - /* not using a VBO */ - if (!indices) - return GL_FALSE; - } - - if (ctx->Const.CheckArrayBounds) { - /* find max array index */ - GLuint max = max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array._MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - return GL_FALSE; - } - } - - return GL_TRUE; -} - -GLboolean -_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (count <= 0) { - if (count < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" ); - return GL_FALSE; - } - - if (mode > GL_POLYGON) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(mode)" ); - return GL_FALSE; - } - - if (end < start) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(endNewState) - _mesa_update_state(ctx); - - if (!check_valid_to_render(ctx, "RangeElements")) - return GL_FALSE; - - /* Vertex buffer object tests */ - if (ctx->Array.ElementArrayBufferObj->Name) { - /* use indices in the buffer object */ - GLuint indexBytes; - - if (type == GL_UNSIGNED_INT) { - indexBytes = count * sizeof(GLuint); - } - else if (type == GL_UNSIGNED_BYTE) { - indexBytes = count * sizeof(GLubyte); - } - else { - ASSERT(type == GL_UNSIGNED_SHORT); - indexBytes = count * sizeof(GLushort); - } - - /* make sure count doesn't go outside buffer bounds */ - if (indexBytes > ctx->Array.ElementArrayBufferObj->Size) { - _mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds"); - return GL_FALSE; - } - } - else { - /* not using a VBO */ - if (!indices) - return GL_FALSE; - } - - if (ctx->Const.CheckArrayBounds) { - GLuint max = max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array._MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - return GL_FALSE; - } - } - - return GL_TRUE; -} - - -/** - * Called from the tnl module to error check the function parameters and - * verify that we really can draw something. - */ -GLboolean -_mesa_validate_DrawArrays(GLcontext *ctx, - GLenum mode, GLint start, GLsizei count) -{ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (count <= 0) { - if (count < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" ); - return GL_FALSE; - } - - if (mode > GL_POLYGON) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" ); - return GL_FALSE; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (!check_valid_to_render(ctx, "Arrays")) - return GL_FALSE; - - if (ctx->Const.CheckArrayBounds) { - if (start + count > (GLint) ctx->Array._MaxElement) - return GL_FALSE; - } - - return GL_TRUE; -} diff --git a/src/libs/mesa/mesa/main/api_validate.h b/src/libs/mesa/mesa/main/api_validate.h deleted file mode 100644 index 10f0c34e66..0000000000 --- a/src/libs/mesa/mesa/main/api_validate.h +++ /dev/null @@ -1,49 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 API_VALIDATE_H -#define API_VALIDATE_H - - -#include "mtypes.h" - -extern GLboolean -_mesa_validate_DrawArrays(GLcontext *ctx, - GLenum mode, GLint start, GLsizei count); - -extern GLboolean -_mesa_validate_DrawElements(GLcontext *ctx, - GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices); - -extern GLboolean -_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices); - - -#endif diff --git a/src/libs/mesa/mesa/main/arrayobj.c b/src/libs/mesa/mesa/main/arrayobj.c deleted file mode 100644 index f3f482f8c8..0000000000 --- a/src/libs/mesa/mesa/main/arrayobj.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2006 - * - * 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 OR IBM 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. - */ - - -/** - * \file arrayobj.c - * Functions for the GL_APPLE_vertex_array_object extension. - * - * \todo - * The code in this file borrows a lot from bufferobj.c. There's a certain - * amount of cruft left over from that origin that may be unnecessary. - * - * \author Ian Romanick - * \author Brian Paul - */ - - -#include "glheader.h" -#include "hash.h" -#include "imports.h" -#include "context.h" -#if FEATURE_ARB_vertex_buffer_object -#include "bufferobj.h" -#endif -#include "arrayobj.h" -#include "glapi/dispatch.h" - - -/** - * Look up the array object for the given ID. - * - * \returns - * Either a pointer to the array object with the specified ID or \c NULL for - * a non-existent ID. The spec defines ID 0 as being technically - * non-existent. - */ - -static INLINE struct gl_array_object * -lookup_arrayobj(GLcontext *ctx, GLuint id) -{ - return (id == 0) - ? NULL - : (struct gl_array_object *) _mesa_HashLookup(ctx->Shared->ArrayObjects, - id); -} - - -/** - * Allocate and initialize a new vertex array object. - * - * This function is intended to be called via - * \c dd_function_table::NewArrayObject. - */ -struct gl_array_object * -_mesa_new_array_object( GLcontext *ctx, GLuint name ) -{ - struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object); - if (obj) - _mesa_initialize_array_object(ctx, obj, name); - return obj; -} - - -/** - * Delete an array object. - * - * This function is intended to be called via - * \c dd_function_table::DeleteArrayObject. - */ -void -_mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) -{ - (void) ctx; - _mesa_free(obj); -} - - -void -_mesa_initialize_array_object( GLcontext *ctx, - struct gl_array_object *obj, - GLuint name ) -{ - GLuint i; - - obj->Name = name; - - /* Vertex arrays */ - obj->Vertex.Size = 4; - obj->Vertex.Type = GL_FLOAT; - obj->Vertex.Stride = 0; - obj->Vertex.StrideB = 0; - obj->Vertex.Ptr = NULL; - obj->Vertex.Enabled = GL_FALSE; - obj->Normal.Type = GL_FLOAT; - obj->Normal.Stride = 0; - obj->Normal.StrideB = 0; - obj->Normal.Ptr = NULL; - obj->Normal.Enabled = GL_FALSE; - obj->Color.Size = 4; - obj->Color.Type = GL_FLOAT; - obj->Color.Stride = 0; - obj->Color.StrideB = 0; - obj->Color.Ptr = NULL; - obj->Color.Enabled = GL_FALSE; - obj->SecondaryColor.Size = 4; - obj->SecondaryColor.Type = GL_FLOAT; - obj->SecondaryColor.Stride = 0; - obj->SecondaryColor.StrideB = 0; - obj->SecondaryColor.Ptr = NULL; - obj->SecondaryColor.Enabled = GL_FALSE; - obj->FogCoord.Size = 1; - obj->FogCoord.Type = GL_FLOAT; - obj->FogCoord.Stride = 0; - obj->FogCoord.StrideB = 0; - obj->FogCoord.Ptr = NULL; - obj->FogCoord.Enabled = GL_FALSE; - obj->Index.Type = GL_FLOAT; - obj->Index.Stride = 0; - obj->Index.StrideB = 0; - obj->Index.Ptr = NULL; - obj->Index.Enabled = GL_FALSE; - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - obj->TexCoord[i].Size = 4; - obj->TexCoord[i].Type = GL_FLOAT; - obj->TexCoord[i].Stride = 0; - obj->TexCoord[i].StrideB = 0; - obj->TexCoord[i].Ptr = NULL; - obj->TexCoord[i].Enabled = GL_FALSE; - } - obj->EdgeFlag.Stride = 0; - obj->EdgeFlag.StrideB = 0; - obj->EdgeFlag.Ptr = NULL; - obj->EdgeFlag.Enabled = GL_FALSE; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].Size = 4; - obj->VertexAttrib[i].Type = GL_FLOAT; - obj->VertexAttrib[i].Stride = 0; - obj->VertexAttrib[i].StrideB = 0; - obj->VertexAttrib[i].Ptr = NULL; - obj->VertexAttrib[i].Enabled = GL_FALSE; - obj->VertexAttrib[i].Normalized = GL_FALSE; - } - -#if FEATURE_point_size_array - obj->PointSize.Type = GL_FLOAT; - obj->PointSize.Stride = 0; - obj->PointSize.StrideB = 0; - obj->PointSize.Ptr = NULL; - obj->PointSize.Enabled = GL_FALSE; - obj->PointSize.BufferObj = ctx->Array.NullBufferObj; -#endif - -#if FEATURE_ARB_vertex_buffer_object - /* Vertex array buffers */ - obj->Vertex.BufferObj = ctx->Array.NullBufferObj; - obj->Normal.BufferObj = ctx->Array.NullBufferObj; - obj->Color.BufferObj = ctx->Array.NullBufferObj; - obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; - obj->FogCoord.BufferObj = ctx->Array.NullBufferObj; - obj->Index.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj; - } - obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; - } -#endif -} - - -/** - * Add the given array object to the array object pool. - */ -void -_mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ) -{ - if (obj->Name > 0) { - /* insert into hash table */ - _mesa_HashInsert(ctx->Shared->ArrayObjects, obj->Name, obj); - } -} - - -/** - * Remove the given array object from the array object pool. - * Do not deallocate the array object though. - */ -void -_mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ) -{ - if (obj->Name > 0) { - /* remove from hash table */ - _mesa_HashRemove(ctx->Shared->ArrayObjects, obj->Name); - } -} - - -static void -unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) -{ - if (bufObj != ctx->Array.NullBufferObj) { - _mesa_reference_buffer_object(ctx, &bufObj, NULL); - } -} - - -/**********************************************************************/ -/* API Functions */ -/**********************************************************************/ - -/** - * Bind a new array. - * - * \todo - * The binding could be done more efficiently by comparing the non-NULL - * pointers in the old and new objects. The only arrays that are "dirty" are - * the ones that are non-NULL in either object. - */ -void GLAPIENTRY -_mesa_BindVertexArrayAPPLE( GLuint id ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_array_object * const oldObj = ctx->Array.ArrayObj; - struct gl_array_object *newObj = NULL; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - ASSERT(oldObj != NULL); - - if ( oldObj->Name == id ) - return; /* rebinding the same array object- no change */ - - /* - * Get pointer to new array object (newBufObj) - */ - if (id == 0) { - /* The spec says there is no array object named 0, but we use - * one internally because it simplifies things. - */ - newObj = ctx->Array.DefaultArrayObj; - } - else { - /* non-default array object */ - newObj = lookup_arrayobj(ctx, id); - if (!newObj) { - /* If this is a new array object id, allocate an array object now. - */ - - newObj = (*ctx->Driver.NewArrayObject)(ctx, id); - if (!newObj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE"); - return; - } - _mesa_save_array_object(ctx, newObj); - } - } - - - ctx->NewState |= _NEW_ARRAY; - ctx->Array.NewState |= _NEW_ARRAY_ALL; - ctx->Array.ArrayObj = newObj; - - - /* Pass BindVertexArray call to device driver */ - if (ctx->Driver.BindArrayObject && newObj) - (*ctx->Driver.BindArrayObject)( ctx, newObj ); -} - - -/** - * Delete a set of array objects. - * - * \param n Number of array objects to delete. - * \param ids Array of \c n array object IDs. - */ -void GLAPIENTRY -_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) -{ - GET_CURRENT_CONTEXT(ctx); - GLsizei i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)"); - return; - } - - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - for (i = 0; i < n; i++) { - struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]); - - if ( obj != NULL ) { - ASSERT( obj->Name == ids[i] ); - - - /* If the array object is currently bound, the spec says "the binding - * for that object reverts to zero and the default vertex array - * becomes current." - */ - if ( obj == ctx->Array.ArrayObj ) { - CALL_BindVertexArrayAPPLE( ctx->Exec, (0) ); - } - -#if FEATURE_ARB_vertex_buffer_object - /* Unbind any buffer objects that might be bound to arrays in - * this array object. - */ - unbind_buffer_object( ctx, obj->Vertex.BufferObj ); - unbind_buffer_object( ctx, obj->Normal.BufferObj ); - unbind_buffer_object( ctx, obj->Color.BufferObj ); - unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj ); - unbind_buffer_object( ctx, obj->FogCoord.BufferObj ); - unbind_buffer_object( ctx, obj->Index.BufferObj ); - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj ); - } - unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj ); - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj ); - } -#endif - - /* The ID is immediately freed for re-use */ - _mesa_remove_array_object(ctx, obj); - ctx->Driver.DeleteArrayObject(ctx, obj); - } - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -/** - * Generate a set of unique array object IDs and store them in \c arrays. - * - * \param n Number of IDs to generate. - * \param arrays Array of \c n locations to store the IDs. - */ -void GLAPIENTRY -_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE"); - return; - } - - if (!arrays) { - return; - } - - /* - * This must be atomic (generation and allocation of array object IDs) - */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->ArrayObjects, n); - - /* Allocate new, empty array objects and return identifiers */ - for (i = 0; i < n; i++) { - struct gl_array_object *obj; - GLuint name = first + i; - - obj = (*ctx->Driver.NewArrayObject)( ctx, name ); - if (!obj) { - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE"); - return; - } - _mesa_save_array_object(ctx, obj); - arrays[i] = first + i; - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -/** - * Determine if ID is the name of an array object. - * - * \param id ID of the potential array object. - * \return \c GL_TRUE if \c id is the name of a array object, - * \c GL_FALSE otherwise. - */ -GLboolean GLAPIENTRY -_mesa_IsVertexArrayAPPLE( GLuint id ) -{ - struct gl_array_object * obj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id == 0) - return GL_FALSE; - - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - obj = lookup_arrayobj(ctx, id); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - - return (obj != NULL) ? GL_TRUE : GL_FALSE; -} diff --git a/src/libs/mesa/mesa/main/arrayobj.h b/src/libs/mesa/mesa/main/arrayobj.h deleted file mode 100644 index c7d66ec166..0000000000 --- a/src/libs/mesa/mesa/main/arrayobj.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2006 - * - * 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 OR IBM 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 ARRAYOBJ_H -#define ARRAYOBJ_H - -#include "context.h" - -/** - * \file arrayobj.h - * Functions for the GL_APPLE_vertex_array_object extension. - * - * \author Ian Romanick - * \author Brian Paul - */ - -/* - * Internal functions - */ - -struct gl_array_object * _mesa_new_array_object( GLcontext *ctx, - GLuint name ); - -void _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ); - -void _mesa_initialize_array_object( GLcontext *ctx, - struct gl_array_object *obj, GLuint name ); - -void _mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ); - -void _mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ); - - - -/* - * API functions - */ - -void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id ); - -void GLAPIENTRY _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids); - -void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer); - -GLboolean GLAPIENTRY _mesa_IsVertexArrayAPPLE( GLuint id ); - -#endif /* ARRAYOBJ_H */ diff --git a/src/libs/mesa/mesa/main/attrib.c b/src/libs/mesa/mesa/main/attrib.c deleted file mode 100644 index a54951205f..0000000000 --- a/src/libs/mesa/mesa/main/attrib.c +++ /dev/null @@ -1,1482 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -#include "glheader.h" -#include "imports.h" -#include "accum.h" -#include "arrayobj.h" -#include "attrib.h" -#include "blend.h" -#include "buffers.h" -#include "bufferobj.h" -#include "clear.h" -#include "colormac.h" -#include "colortab.h" -#include "context.h" -#include "depth.h" -#include "enable.h" -#include "enums.h" -#include "fog.h" -#include "hint.h" -#include "light.h" -#include "lines.h" -#include "matrix.h" -#include "multisample.h" -#include "points.h" -#include "polygon.h" -#include "scissor.h" -#include "simple_list.h" -#include "stencil.h" -#include "texenv.h" -#include "texgen.h" -#include "texobj.h" -#include "texparam.h" -#include "texstate.h" -#include "varray.h" -#include "mtypes.h" -#include "math/m_xform.h" - -/** - * Special struct for saving/restoring texture state (GL_TEXTURE_BIT) - */ -struct texture_state -{ - struct gl_texture_attrib Texture; /**< The usual context state */ - - /** to save per texture object state (wrap modes, filters, etc): */ - struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS]; - - /** - * To save references to texture objects (so they don't get accidentally - * deleted while saved in the attribute stack). - */ - struct gl_texture_object *SavedTexRef[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS]; -}; - - -/** - * Allocate a new attribute state node. These nodes have a - * "kind" value and a pointer to a struct of state data. - */ -static struct gl_attrib_node * -new_attrib_node( GLbitfield kind ) -{ - struct gl_attrib_node *an = MALLOC_STRUCT(gl_attrib_node); - if (an) { - an->kind = kind; - } - return an; -} - - -void GLAPIENTRY -_mesa_PushAttrib(GLbitfield mask) -{ - struct gl_attrib_node *newnode; - struct gl_attrib_node *head; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask); - - if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) { - _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" ); - return; - } - - /* Build linked list of attribute nodes which save all attribute */ - /* groups specified by the mask. */ - head = NULL; - - if (mask & GL_ACCUM_BUFFER_BIT) { - struct gl_accum_attrib *attr; - attr = MALLOC_STRUCT( gl_accum_attrib ); - MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); - newnode = new_attrib_node( GL_ACCUM_BUFFER_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_COLOR_BUFFER_BIT) { - GLuint i; - struct gl_colorbuffer_attrib *attr; - attr = MALLOC_STRUCT( gl_colorbuffer_attrib ); - MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); - /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ - for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) - attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; - newnode = new_attrib_node( GL_COLOR_BUFFER_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_CURRENT_BIT) { - struct gl_current_attrib *attr; - FLUSH_CURRENT( ctx, 0 ); - attr = MALLOC_STRUCT( gl_current_attrib ); - MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); - newnode = new_attrib_node( GL_CURRENT_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_depthbuffer_attrib *attr; - attr = MALLOC_STRUCT( gl_depthbuffer_attrib ); - MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); - newnode = new_attrib_node( GL_DEPTH_BUFFER_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_ENABLE_BIT) { - struct gl_enable_attrib *attr; - GLuint i; - attr = MALLOC_STRUCT( gl_enable_attrib ); - /* Copy enable flags from all other attributes into the enable struct. */ - attr->AlphaTest = ctx->Color.AlphaEnabled; - attr->AutoNormal = ctx->Eval.AutoNormal; - attr->Blend = ctx->Color.BlendEnabled; - attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled; - attr->ColorMaterial = ctx->Light.ColorMaterialEnabled; - for (i = 0; i < COLORTABLE_MAX; i++) { - attr->ColorTable[i] = ctx->Pixel.ColorTableEnabled[i]; - } - attr->Convolution1D = ctx->Pixel.Convolution1DEnabled; - attr->Convolution2D = ctx->Pixel.Convolution2DEnabled; - attr->Separable2D = ctx->Pixel.Separable2DEnabled; - attr->CullFace = ctx->Polygon.CullFlag; - attr->DepthTest = ctx->Depth.Test; - attr->Dither = ctx->Color.DitherFlag; - attr->Fog = ctx->Fog.Enabled; - for (i = 0; i < ctx->Const.MaxLights; i++) { - attr->Light[i] = ctx->Light.Light[i].Enabled; - } - attr->Lighting = ctx->Light.Enabled; - attr->LineSmooth = ctx->Line.SmoothFlag; - attr->LineStipple = ctx->Line.StippleFlag; - attr->Histogram = ctx->Pixel.HistogramEnabled; - attr->MinMax = ctx->Pixel.MinMaxEnabled; - attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled; - attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled; - attr->Map1Color4 = ctx->Eval.Map1Color4; - attr->Map1Index = ctx->Eval.Map1Index; - attr->Map1Normal = ctx->Eval.Map1Normal; - attr->Map1TextureCoord1 = ctx->Eval.Map1TextureCoord1; - attr->Map1TextureCoord2 = ctx->Eval.Map1TextureCoord2; - attr->Map1TextureCoord3 = ctx->Eval.Map1TextureCoord3; - attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4; - attr->Map1Vertex3 = ctx->Eval.Map1Vertex3; - attr->Map1Vertex4 = ctx->Eval.Map1Vertex4; - MEMCPY(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); - attr->Map2Color4 = ctx->Eval.Map2Color4; - attr->Map2Index = ctx->Eval.Map2Index; - attr->Map2Normal = ctx->Eval.Map2Normal; - attr->Map2TextureCoord1 = ctx->Eval.Map2TextureCoord1; - attr->Map2TextureCoord2 = ctx->Eval.Map2TextureCoord2; - attr->Map2TextureCoord3 = ctx->Eval.Map2TextureCoord3; - attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4; - attr->Map2Vertex3 = ctx->Eval.Map2Vertex3; - attr->Map2Vertex4 = ctx->Eval.Map2Vertex4; - MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); - attr->Normalize = ctx->Transform.Normalize; - attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped; - attr->PointSmooth = ctx->Point.SmoothFlag; - attr->PointSprite = ctx->Point.PointSprite; - attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint; - attr->PolygonOffsetLine = ctx->Polygon.OffsetLine; - attr->PolygonOffsetFill = ctx->Polygon.OffsetFill; - attr->PolygonSmooth = ctx->Polygon.SmoothFlag; - attr->PolygonStipple = ctx->Polygon.StippleFlag; - attr->RescaleNormals = ctx->Transform.RescaleNormals; - attr->Scissor = ctx->Scissor.Enabled; - attr->Stencil = ctx->Stencil.Enabled; - attr->StencilTwoSide = ctx->Stencil.TestTwoSide; - attr->MultisampleEnabled = ctx->Multisample.Enabled; - attr->SampleAlphaToCoverage = ctx->Multisample.SampleAlphaToCoverage; - attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne; - attr->SampleCoverage = ctx->Multisample.SampleCoverage; - attr->SampleCoverageInvert = ctx->Multisample.SampleCoverageInvert; - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - attr->Texture[i] = ctx->Texture.Unit[i].Enabled; - attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled; - attr->TextureColorTable[i] = ctx->Texture.Unit[i].ColorTableEnabled; - } - /* GL_NV_vertex_program */ - attr->VertexProgram = ctx->VertexProgram.Enabled; - attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled; - attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled; - newnode = new_attrib_node( GL_ENABLE_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_EVAL_BIT) { - struct gl_eval_attrib *attr; - attr = MALLOC_STRUCT( gl_eval_attrib ); - MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); - newnode = new_attrib_node( GL_EVAL_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_FOG_BIT) { - struct gl_fog_attrib *attr; - attr = MALLOC_STRUCT( gl_fog_attrib ); - MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); - newnode = new_attrib_node( GL_FOG_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_HINT_BIT) { - struct gl_hint_attrib *attr; - attr = MALLOC_STRUCT( gl_hint_attrib ); - MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); - newnode = new_attrib_node( GL_HINT_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_LIGHTING_BIT) { - struct gl_light_attrib *attr; - FLUSH_CURRENT(ctx, 0); /* flush material changes */ - attr = MALLOC_STRUCT( gl_light_attrib ); - MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); - newnode = new_attrib_node( GL_LIGHTING_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_LINE_BIT) { - struct gl_line_attrib *attr; - attr = MALLOC_STRUCT( gl_line_attrib ); - MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); - newnode = new_attrib_node( GL_LINE_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_LIST_BIT) { - struct gl_list_attrib *attr; - attr = MALLOC_STRUCT( gl_list_attrib ); - MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) ); - newnode = new_attrib_node( GL_LIST_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_PIXEL_MODE_BIT) { - struct gl_pixel_attrib *attr; - attr = MALLOC_STRUCT( gl_pixel_attrib ); - MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); - /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ - attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; - newnode = new_attrib_node( GL_PIXEL_MODE_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_POINT_BIT) { - struct gl_point_attrib *attr; - attr = MALLOC_STRUCT( gl_point_attrib ); - MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); - newnode = new_attrib_node( GL_POINT_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_POLYGON_BIT) { - struct gl_polygon_attrib *attr; - attr = MALLOC_STRUCT( gl_polygon_attrib ); - MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); - newnode = new_attrib_node( GL_POLYGON_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_POLYGON_STIPPLE_BIT) { - GLuint *stipple; - stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) ); - MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); - newnode = new_attrib_node( GL_POLYGON_STIPPLE_BIT ); - newnode->data = stipple; - newnode->next = head; - head = newnode; - } - - if (mask & GL_SCISSOR_BIT) { - struct gl_scissor_attrib *attr; - attr = MALLOC_STRUCT( gl_scissor_attrib ); - MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); - newnode = new_attrib_node( GL_SCISSOR_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_stencil_attrib *attr; - attr = MALLOC_STRUCT( gl_stencil_attrib ); - MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); - newnode = new_attrib_node( GL_STENCIL_BUFFER_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_TEXTURE_BIT) { - struct texture_state *texstate = CALLOC_STRUCT(texture_state); - GLuint u, tex; - - if (!texstate) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)"); - goto end; - } - - _mesa_lock_context_textures(ctx); - - /* copy/save the bulk of texture state here */ - _mesa_memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); - - /* Save references to the currently bound texture objects so they don't - * accidentally get deleted while referenced in the attribute stack. - */ - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&texstate->SavedTexRef[u][tex], - ctx->Texture.Unit[u].CurrentTex[tex]); - } - } - - /* copy state/contents of the currently bound texture objects */ - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_copy_texture_object(&texstate->SavedObj[u][tex], - ctx->Texture.Unit[u].CurrentTex[tex]); - } - } - - _mesa_unlock_context_textures(ctx); - - newnode = new_attrib_node( GL_TEXTURE_BIT ); - newnode->data = texstate; - newnode->next = head; - head = newnode; - } - - if (mask & GL_TRANSFORM_BIT) { - struct gl_transform_attrib *attr; - attr = MALLOC_STRUCT( gl_transform_attrib ); - MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); - newnode = new_attrib_node( GL_TRANSFORM_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_VIEWPORT_BIT) { - struct gl_viewport_attrib *attr; - attr = MALLOC_STRUCT( gl_viewport_attrib ); - MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); - newnode = new_attrib_node( GL_VIEWPORT_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - /* GL_ARB_multisample */ - if (mask & GL_MULTISAMPLE_BIT_ARB) { - struct gl_multisample_attrib *attr; - attr = MALLOC_STRUCT( gl_multisample_attrib ); - MEMCPY( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); - newnode = new_attrib_node( GL_MULTISAMPLE_BIT_ARB ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - -end: - ctx->AttribStack[ctx->AttribStackDepth] = head; - ctx->AttribStackDepth++; -} - - - -static void -pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) -{ - GLuint i; - -#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \ - if ((VALUE) != (NEWVALUE)) { \ - _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \ - } - - TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST); - TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND); - - for (i=0;iTransform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask)) - _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i), - (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE)); - } - - TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, - GL_COLOR_MATERIAL); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION], - enable->ColorTable[COLORTABLE_PRECONVOLUTION], - GL_COLOR_TABLE); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION], - enable->ColorTable[COLORTABLE_POSTCONVOLUTION], - GL_POST_CONVOLUTION_COLOR_TABLE); - TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX], - enable->ColorTable[COLORTABLE_POSTCOLORMATRIX], - GL_POST_COLOR_MATRIX_COLOR_TABLE); - TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); - TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST); - TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER); - TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, - GL_CONVOLUTION_1D); - TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, - GL_CONVOLUTION_2D); - TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, - GL_SEPARABLE_2D); - TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG); - TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING); - TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH); - TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple, - GL_LINE_STIPPLE); - TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp, - GL_INDEX_LOGIC_OP); - TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp, - GL_COLOR_LOGIC_OP); - - TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4); - TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX); - TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL); - TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1, - GL_MAP1_TEXTURE_COORD_1); - TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2, - GL_MAP1_TEXTURE_COORD_2); - TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3, - GL_MAP1_TEXTURE_COORD_3); - TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4, - GL_MAP1_TEXTURE_COORD_4); - TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3, - GL_MAP1_VERTEX_3); - TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4, - GL_MAP1_VERTEX_4); - for (i = 0; i < 16; i++) { - TEST_AND_UPDATE(ctx->Eval.Map1Attrib[i], enable->Map1Attrib[i], - GL_MAP1_VERTEX_ATTRIB0_4_NV + i); - } - - TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4); - TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX); - TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL); - TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1, - GL_MAP2_TEXTURE_COORD_1); - TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2, - GL_MAP2_TEXTURE_COORD_2); - TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3, - GL_MAP2_TEXTURE_COORD_3); - TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4, - GL_MAP2_TEXTURE_COORD_4); - TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3, - GL_MAP2_VERTEX_3); - TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, - GL_MAP2_VERTEX_4); - for (i = 0; i < 16; i++) { - TEST_AND_UPDATE(ctx->Eval.Map2Attrib[i], enable->Map2Attrib[i], - GL_MAP2_VERTEX_ATTRIB0_4_NV + i); - } - - TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL); - TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE); - TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, - GL_RESCALE_NORMAL_EXT); - TEST_AND_UPDATE(ctx->Transform.RasterPositionUnclipped, - enable->RasterPositionUnclipped, - GL_RASTER_POSITION_UNCLIPPED_IBM); - TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, - GL_POINT_SMOOTH); - if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) { - TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite, - GL_POINT_SPRITE_NV); - } - TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, - GL_POLYGON_OFFSET_POINT); - TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, - GL_POLYGON_OFFSET_LINE); - TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill, - GL_POLYGON_OFFSET_FILL); - TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth, - GL_POLYGON_SMOOTH); - TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple, - GL_POLYGON_STIPPLE); - TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST); - TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST); - if (ctx->Extensions.EXT_stencil_two_side) { - TEST_AND_UPDATE(ctx->Stencil.TestTwoSide, enable->StencilTwoSide, GL_STENCIL_TEST_TWO_SIDE_EXT); - } - TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled, - GL_MULTISAMPLE_ARB); - TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage, - enable->SampleAlphaToCoverage, - GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); - TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToOne, - enable->SampleAlphaToOne, - GL_SAMPLE_ALPHA_TO_ONE_ARB); - TEST_AND_UPDATE(ctx->Multisample.SampleCoverage, - enable->SampleCoverage, - GL_SAMPLE_COVERAGE_ARB); - TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert, - enable->SampleCoverageInvert, - GL_SAMPLE_COVERAGE_INVERT_ARB); - /* GL_ARB_vertex_program, GL_NV_vertex_program */ - TEST_AND_UPDATE(ctx->VertexProgram.Enabled, - enable->VertexProgram, - GL_VERTEX_PROGRAM_ARB); - TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled, - enable->VertexProgramPointSize, - GL_VERTEX_PROGRAM_POINT_SIZE_ARB); - TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled, - enable->VertexProgramTwoSide, - GL_VERTEX_PROGRAM_TWO_SIDE_ARB); - -#undef TEST_AND_UPDATE - - /* texture unit enables */ - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (ctx->Texture.Unit[i].Enabled != enable->Texture[i]) { - ctx->Texture.Unit[i].Enabled = enable->Texture[i]; - if (ctx->Driver.Enable) { - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)(ctx, i); - } - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, - (GLboolean) (enable->Texture[i] & TEXTURE_1D_BIT) ); - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, - (GLboolean) (enable->Texture[i] & TEXTURE_2D_BIT) ); - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, - (GLboolean) (enable->Texture[i] & TEXTURE_3D_BIT) ); - if (ctx->Extensions.ARB_texture_cube_map) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_CUBE_MAP_ARB, - (GLboolean) (enable->Texture[i] & TEXTURE_CUBE_BIT) ); - if (ctx->Extensions.NV_texture_rectangle) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_RECTANGLE_NV, - (GLboolean) (enable->Texture[i] & TEXTURE_RECT_BIT) ); - } - } - - if (ctx->Texture.Unit[i].TexGenEnabled != enable->TexGen[i]) { - ctx->Texture.Unit[i].TexGenEnabled = enable->TexGen[i]; - if (ctx->Driver.Enable) { - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)(ctx, i); - } - if (enable->TexGen[i] & S_BIT) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_TRUE); - else - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_FALSE); - if (enable->TexGen[i] & T_BIT) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_TRUE); - else - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_FALSE); - if (enable->TexGen[i] & R_BIT) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_TRUE); - else - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_FALSE); - if (enable->TexGen[i] & Q_BIT) - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_TRUE); - else - (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_FALSE); - } - } - - /* GL_SGI_texture_color_table */ - ctx->Texture.Unit[i].ColorTableEnabled = enable->TextureColorTable[i]; - } - - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)(ctx, ctx->Texture.CurrentUnit); - } -} - - -/** - * Pop/restore texture attribute/group state. - */ -static void -pop_texture_group(GLcontext *ctx, struct texture_state *texstate) -{ - GLuint u; - - _mesa_lock_context_textures(ctx); - - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - const struct gl_texture_unit *unit = &texstate->Texture.Unit[u]; - GLuint tgt; - - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u); - _mesa_set_enable(ctx, GL_TEXTURE_1D, - (unit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_2D, - (unit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_3D, - (unit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE); - if (ctx->Extensions.ARB_texture_cube_map) { - _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB, - (unit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE); - } - if (ctx->Extensions.NV_texture_rectangle) { - _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV, - (unit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE); - } - if (ctx->Extensions.SGI_texture_color_table) { - _mesa_set_enable(ctx, GL_TEXTURE_COLOR_TABLE_SGI, - unit->ColorTableEnabled); - } - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); - _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); - _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenModeS); - _mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenModeT); - _mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenModeR); - _mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenModeQ); - _mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->ObjectPlaneS); - _mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->ObjectPlaneT); - _mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->ObjectPlaneR); - _mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->ObjectPlaneQ); - /* Eye plane done differently to avoid re-transformation */ - { - struct gl_texture_unit *destUnit = &ctx->Texture.Unit[u]; - COPY_4FV(destUnit->EyePlaneS, unit->EyePlaneS); - COPY_4FV(destUnit->EyePlaneT, unit->EyePlaneT); - COPY_4FV(destUnit->EyePlaneR, unit->EyePlaneR); - COPY_4FV(destUnit->EyePlaneQ, unit->EyePlaneQ); - if (ctx->Driver.TexGen) { - ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->EyePlaneS); - ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->EyePlaneT); - ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->EyePlaneR); - ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->EyePlaneQ); - } - } - _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, - ((unit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE)); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, - ((unit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE)); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, - ((unit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE)); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, - ((unit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE)); - if (ctx->Extensions.EXT_texture_lod_bias) { - _mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, - GL_TEXTURE_LOD_BIAS_EXT, unit->LodBias); - } - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, - unit->Combine.ModeRGB); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, - unit->Combine.ModeA); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, - unit->Combine.SourceRGB[0]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, - unit->Combine.SourceRGB[1]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, - unit->Combine.SourceRGB[2]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, - unit->Combine.SourceA[0]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, - unit->Combine.SourceA[1]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, - unit->Combine.SourceA[2]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, - unit->Combine.OperandRGB[0]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, - unit->Combine.OperandRGB[1]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, - unit->Combine.OperandRGB[2]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, - unit->Combine.OperandA[0]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, - unit->Combine.OperandA[1]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, - unit->Combine.OperandA[2]); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, - 1 << unit->Combine.ScaleShiftRGB); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, - 1 << unit->Combine.ScaleShiftA); - } - - /* Restore texture object state for each target */ - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { - const struct gl_texture_object *obj = NULL; - GLfloat bordColor[4]; - GLenum target; - - obj = &texstate->SavedObj[u][tgt]; - - /* don't restore state for unsupported targets to prevent - * raising GL errors. - */ - if (obj->Target == GL_TEXTURE_CUBE_MAP_ARB && - !ctx->Extensions.ARB_texture_cube_map) { - continue; - } - else if (obj->Target == GL_TEXTURE_RECTANGLE_NV && - !ctx->Extensions.NV_texture_rectangle) { - continue; - } - else if ((obj->Target == GL_TEXTURE_1D_ARRAY_EXT || - obj->Target == GL_TEXTURE_2D_ARRAY_EXT) && - !ctx->Extensions.MESA_texture_array) { - continue; - } - - target = obj->Target; - - _mesa_BindTexture(target, obj->Name); - - bordColor[0] = CHAN_TO_FLOAT(obj->BorderColor[0]); - bordColor[1] = CHAN_TO_FLOAT(obj->BorderColor[1]); - bordColor[2] = CHAN_TO_FLOAT(obj->BorderColor[2]); - bordColor[3] = CHAN_TO_FLOAT(obj->BorderColor[3]); - - _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, bordColor); - _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority); - _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, obj->WrapS); - _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, obj->WrapT); - _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, obj->WrapR); - _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, obj->MinFilter); - _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, obj->MagFilter); - _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, obj->MinLod); - _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, obj->MaxLod); - _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, obj->LodBias); - _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel); - if (target != GL_TEXTURE_RECTANGLE_ARB) - _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel); - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, - obj->MaxAnisotropy); - } - if (ctx->Extensions.SGIX_shadow) { - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_SGIX, - obj->CompareFlag); - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_OPERATOR_SGIX, - obj->CompareOperator); - } - if (ctx->Extensions.SGIX_shadow_ambient) { - _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX, - obj->ShadowAmbient); - } - } - - /* remove saved references to the texture objects */ - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { - _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL); - } - } - - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + texstate->Texture.CurrentUnit); - - _mesa_unlock_context_textures(ctx); -} - - -/* - * This function is kind of long just because we have to call a lot - * of device driver functions to update device driver state. - * - * XXX As it is now, most of the pop-code calls immediate-mode Mesa functions - * in order to restore GL state. This isn't terribly efficient but it - * ensures that dirty flags and any derived state gets updated correctly. - * We could at least check if the value to restore equals the current value - * and then skip the Mesa call. - */ -void GLAPIENTRY -_mesa_PopAttrib(void) -{ - struct gl_attrib_node *attr, *next; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->AttribStackDepth == 0) { - _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopAttrib" ); - return; - } - - ctx->AttribStackDepth--; - attr = ctx->AttribStack[ctx->AttribStackDepth]; - - while (attr) { - - if (MESA_VERBOSE & VERBOSE_API) { - _mesa_debug(ctx, "glPopAttrib %s\n", - _mesa_lookup_enum_by_nr(attr->kind)); - } - - switch (attr->kind) { - case GL_ACCUM_BUFFER_BIT: - { - const struct gl_accum_attrib *accum; - accum = (const struct gl_accum_attrib *) attr->data; - _mesa_ClearAccum(accum->ClearColor[0], - accum->ClearColor[1], - accum->ClearColor[2], - accum->ClearColor[3]); - } - break; - case GL_COLOR_BUFFER_BIT: - { - const struct gl_colorbuffer_attrib *color; - color = (const struct gl_colorbuffer_attrib *) attr->data; - _mesa_ClearIndex((GLfloat) color->ClearIndex); - _mesa_ClearColor(color->ClearColor[0], - color->ClearColor[1], - color->ClearColor[2], - color->ClearColor[3]); - _mesa_IndexMask(color->IndexMask); - _mesa_ColorMask((GLboolean) (color->ColorMask[0] != 0), - (GLboolean) (color->ColorMask[1] != 0), - (GLboolean) (color->ColorMask[2] != 0), - (GLboolean) (color->ColorMask[3] != 0)); - { - /* Need to determine if more than one color output is - * specified. If so, call glDrawBuffersARB, else call - * glDrawBuffer(). This is a subtle, but essential point - * since GL_FRONT (for example) is illegal for the former - * function, but legal for the later. - */ - GLboolean multipleBuffers = GL_FALSE; - if (ctx->Extensions.ARB_draw_buffers) { - GLuint i; - for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { - if (color->DrawBuffer[i] != GL_NONE) { - multipleBuffers = GL_TRUE; - break; - } - } - } - /* Call the API_level functions, not _mesa_drawbuffers() - * since we need to do error checking on the pop'd - * GL_DRAW_BUFFER. - * Ex: if GL_FRONT were pushed, but we're popping with a - * user FBO bound, GL_FRONT will be illegal and we'll need - * to record that error. Per OpenGL ARB decision. - */ - if (multipleBuffers) - _mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers, - color->DrawBuffer); - else - _mesa_DrawBuffer(color->DrawBuffer[0]); - } - _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled); - _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef); - _mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled); - _mesa_BlendFuncSeparateEXT(color->BlendSrcRGB, - color->BlendDstRGB, - color->BlendSrcA, - color->BlendDstA); - /* This special case is because glBlendEquationSeparateEXT - * cannot take GL_LOGIC_OP as a parameter. - */ - if ( color->BlendEquationRGB == color->BlendEquationA ) { - _mesa_BlendEquation(color->BlendEquationRGB); - } - else { - _mesa_BlendEquationSeparateEXT(color->BlendEquationRGB, - color->BlendEquationA); - } - _mesa_BlendColor(color->BlendColor[0], - color->BlendColor[1], - color->BlendColor[2], - color->BlendColor[3]); - _mesa_LogicOp(color->LogicOp); - _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, - color->ColorLogicOpEnabled); - _mesa_set_enable(ctx, GL_INDEX_LOGIC_OP, - color->IndexLogicOpEnabled); - _mesa_set_enable(ctx, GL_DITHER, color->DitherFlag); - } - break; - case GL_CURRENT_BIT: - FLUSH_CURRENT( ctx, 0 ); - MEMCPY( &ctx->Current, attr->data, - sizeof(struct gl_current_attrib) ); - break; - case GL_DEPTH_BUFFER_BIT: - { - const struct gl_depthbuffer_attrib *depth; - depth = (const struct gl_depthbuffer_attrib *) attr->data; - _mesa_DepthFunc(depth->Func); - _mesa_ClearDepth(depth->Clear); - _mesa_set_enable(ctx, GL_DEPTH_TEST, depth->Test); - _mesa_DepthMask(depth->Mask); - } - break; - case GL_ENABLE_BIT: - { - const struct gl_enable_attrib *enable; - enable = (const struct gl_enable_attrib *) attr->data; - pop_enable_group(ctx, enable); - ctx->NewState |= _NEW_ALL; - } - break; - case GL_EVAL_BIT: - MEMCPY( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); - ctx->NewState |= _NEW_EVAL; - break; - case GL_FOG_BIT: - { - const struct gl_fog_attrib *fog; - fog = (const struct gl_fog_attrib *) attr->data; - _mesa_set_enable(ctx, GL_FOG, fog->Enabled); - _mesa_Fogfv(GL_FOG_COLOR, fog->Color); - _mesa_Fogf(GL_FOG_DENSITY, fog->Density); - _mesa_Fogf(GL_FOG_START, fog->Start); - _mesa_Fogf(GL_FOG_END, fog->End); - _mesa_Fogf(GL_FOG_INDEX, fog->Index); - _mesa_Fogi(GL_FOG_MODE, fog->Mode); - } - break; - case GL_HINT_BIT: - { - const struct gl_hint_attrib *hint; - hint = (const struct gl_hint_attrib *) attr->data; - _mesa_Hint(GL_PERSPECTIVE_CORRECTION_HINT, - hint->PerspectiveCorrection ); - _mesa_Hint(GL_POINT_SMOOTH_HINT, hint->PointSmooth); - _mesa_Hint(GL_LINE_SMOOTH_HINT, hint->LineSmooth); - _mesa_Hint(GL_POLYGON_SMOOTH_HINT, hint->PolygonSmooth); - _mesa_Hint(GL_FOG_HINT, hint->Fog); - _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, - hint->ClipVolumeClipping); - if (ctx->Extensions.ARB_texture_compression) - _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, - hint->TextureCompression); - } - break; - case GL_LIGHTING_BIT: - { - GLuint i; - const struct gl_light_attrib *light; - light = (const struct gl_light_attrib *) attr->data; - /* lighting enable */ - _mesa_set_enable(ctx, GL_LIGHTING, light->Enabled); - /* per-light state */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - - for (i = 0; i < ctx->Const.MaxLights; i++) { - const struct gl_light *l = &light->Light[i]; - _mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled); - _mesa_light(ctx, i, GL_AMBIENT, l->Ambient); - _mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse); - _mesa_light(ctx, i, GL_SPECULAR, l->Specular ); - _mesa_light(ctx, i, GL_POSITION, l->EyePosition); - _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->EyeDirection); - _mesa_light(ctx, i, GL_SPOT_EXPONENT, &l->SpotExponent); - _mesa_light(ctx, i, GL_SPOT_CUTOFF, &l->SpotCutoff); - _mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, - &l->ConstantAttenuation); - _mesa_light(ctx, i, GL_LINEAR_ATTENUATION, - &l->LinearAttenuation); - _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, - &l->QuadraticAttenuation); - } - /* light model */ - _mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT, - light->Model.Ambient); - _mesa_LightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, - (GLfloat) light->Model.LocalViewer); - _mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE, - (GLfloat) light->Model.TwoSide); - _mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL, - (GLfloat) light->Model.ColorControl); - /* shade model */ - _mesa_ShadeModel(light->ShadeModel); - /* color material */ - _mesa_ColorMaterial(light->ColorMaterialFace, - light->ColorMaterialMode); - _mesa_set_enable(ctx, GL_COLOR_MATERIAL, - light->ColorMaterialEnabled); - /* materials */ - MEMCPY(&ctx->Light.Material, &light->Material, - sizeof(struct gl_material)); - } - break; - case GL_LINE_BIT: - { - const struct gl_line_attrib *line; - line = (const struct gl_line_attrib *) attr->data; - _mesa_set_enable(ctx, GL_LINE_SMOOTH, line->SmoothFlag); - _mesa_set_enable(ctx, GL_LINE_STIPPLE, line->StippleFlag); - _mesa_LineStipple(line->StippleFactor, line->StipplePattern); - _mesa_LineWidth(line->Width); - } - break; - case GL_LIST_BIT: - MEMCPY( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); - break; - case GL_PIXEL_MODE_BIT: - MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); - /* XXX what other pixel state needs to be set by function calls? */ - _mesa_ReadBuffer(ctx->Pixel.ReadBuffer); - ctx->NewState |= _NEW_PIXEL; - break; - case GL_POINT_BIT: - { - const struct gl_point_attrib *point; - point = (const struct gl_point_attrib *) attr->data; - _mesa_PointSize(point->Size); - _mesa_set_enable(ctx, GL_POINT_SMOOTH, point->SmoothFlag); - if (ctx->Extensions.EXT_point_parameters) { - _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT, - point->Params); - _mesa_PointParameterf(GL_POINT_SIZE_MIN_EXT, - point->MinSize); - _mesa_PointParameterf(GL_POINT_SIZE_MAX_EXT, - point->MaxSize); - _mesa_PointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_EXT, - point->Threshold); - } - if (ctx->Extensions.NV_point_sprite - || ctx->Extensions.ARB_point_sprite) { - GLuint u; - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - _mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV, - (GLint) point->CoordReplace[u]); - } - _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite); - if (ctx->Extensions.NV_point_sprite) - _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, - ctx->Point.SpriteRMode); - _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, - (GLfloat)ctx->Point.SpriteOrigin); - } - } - break; - case GL_POLYGON_BIT: - { - const struct gl_polygon_attrib *polygon; - polygon = (const struct gl_polygon_attrib *) attr->data; - _mesa_CullFace(polygon->CullFaceMode); - _mesa_FrontFace(polygon->FrontFace); - _mesa_PolygonMode(GL_FRONT, polygon->FrontMode); - _mesa_PolygonMode(GL_BACK, polygon->BackMode); - _mesa_PolygonOffset(polygon->OffsetFactor, - polygon->OffsetUnits); - _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, polygon->SmoothFlag); - _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, polygon->StippleFlag); - _mesa_set_enable(ctx, GL_CULL_FACE, polygon->CullFlag); - _mesa_set_enable(ctx, GL_POLYGON_OFFSET_POINT, - polygon->OffsetPoint); - _mesa_set_enable(ctx, GL_POLYGON_OFFSET_LINE, - polygon->OffsetLine); - _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, - polygon->OffsetFill); - } - break; - case GL_POLYGON_STIPPLE_BIT: - MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); - ctx->NewState |= _NEW_POLYGONSTIPPLE; - if (ctx->Driver.PolygonStipple) - ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data ); - break; - case GL_SCISSOR_BIT: - { - const struct gl_scissor_attrib *scissor; - scissor = (const struct gl_scissor_attrib *) attr->data; - _mesa_Scissor(scissor->X, scissor->Y, - scissor->Width, scissor->Height); - _mesa_set_enable(ctx, GL_SCISSOR_TEST, scissor->Enabled); - } - break; - case GL_STENCIL_BUFFER_BIT: - { - const struct gl_stencil_attrib *stencil; - stencil = (const struct gl_stencil_attrib *) attr->data; - _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled); - _mesa_ClearStencil(stencil->Clear); - if (ctx->Extensions.EXT_stencil_two_side) { - _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, - stencil->TestTwoSide); - _mesa_ActiveStencilFaceEXT(stencil->ActiveFace - ? GL_BACK : GL_FRONT); - } - /* front state */ - _mesa_StencilFuncSeparate(GL_FRONT, - stencil->Function[0], - stencil->Ref[0], - stencil->ValueMask[0]); - _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]); - _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0], - stencil->ZFailFunc[0], - stencil->ZPassFunc[0]); - /* back state */ - _mesa_StencilFuncSeparate(GL_BACK, - stencil->Function[1], - stencil->Ref[1], - stencil->ValueMask[1]); - _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]); - _mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1], - stencil->ZFailFunc[1], - stencil->ZPassFunc[1]); - } - break; - case GL_TRANSFORM_BIT: - { - GLuint i; - const struct gl_transform_attrib *xform; - xform = (const struct gl_transform_attrib *) attr->data; - _mesa_MatrixMode(xform->MatrixMode); - if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top)) - _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); - - /* restore clip planes */ - for (i = 0; i < MAX_CLIP_PLANES; i++) { - const GLuint mask = 1 << i; - const GLfloat *eyePlane = xform->EyeUserPlane[i]; - COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane); - if (xform->ClipPlanesEnabled & mask) { - _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE); - } - else { - _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE); - } - if (ctx->Driver.ClipPlane) - ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane ); - } - - /* normalize/rescale */ - if (xform->Normalize != ctx->Transform.Normalize) - _mesa_set_enable(ctx, GL_NORMALIZE,ctx->Transform.Normalize); - if (xform->RescaleNormals != ctx->Transform.RescaleNormals) - _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT, - ctx->Transform.RescaleNormals); - } - break; - case GL_TEXTURE_BIT: - /* Take care of texture object reference counters */ - { - struct texture_state *texstate - = (struct texture_state *) attr->data; - pop_texture_group(ctx, texstate); - ctx->NewState |= _NEW_TEXTURE; - } - break; - case GL_VIEWPORT_BIT: - { - const struct gl_viewport_attrib *vp; - vp = (const struct gl_viewport_attrib *) attr->data; - _mesa_Viewport(vp->X, vp->Y, vp->Width, vp->Height); - _mesa_DepthRange(vp->Near, vp->Far); - } - break; - case GL_MULTISAMPLE_BIT_ARB: - { - const struct gl_multisample_attrib *ms; - ms = (const struct gl_multisample_attrib *) attr->data; - _mesa_SampleCoverageARB(ms->SampleCoverageValue, - ms->SampleCoverageInvert); - } - break; - - default: - _mesa_problem( ctx, "Bad attrib flag in PopAttrib"); - break; - } - - next = attr->next; - FREE( attr->data ); - FREE( attr ); - attr = next; - } -} - - -/** - * Helper for incrementing/decrementing vertex buffer object reference - * counts when pushing/popping the GL_CLIENT_VERTEX_ARRAY_BIT attribute group. - */ -static void -adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step) -{ - GLuint i; - array->ArrayObj->Vertex.BufferObj->RefCount += step; - array->ArrayObj->Normal.BufferObj->RefCount += step; - array->ArrayObj->Color.BufferObj->RefCount += step; - array->ArrayObj->SecondaryColor.BufferObj->RefCount += step; - array->ArrayObj->FogCoord.BufferObj->RefCount += step; - array->ArrayObj->Index.BufferObj->RefCount += step; - array->ArrayObj->EdgeFlag.BufferObj->RefCount += step; - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) - array->ArrayObj->TexCoord[i].BufferObj->RefCount += step; - for (i = 0; i < VERT_ATTRIB_MAX; i++) - array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step; -} - - -/** - * Copy gl_pixelstore_attrib from src to dst, updating buffer - * object refcounts. - */ -static void -copy_pixelstore(GLcontext *ctx, - struct gl_pixelstore_attrib *dst, - const struct gl_pixelstore_attrib *src) -{ - dst->Alignment = src->Alignment; - dst->RowLength = src->RowLength; - dst->SkipPixels = src->SkipPixels; - dst->SkipRows = src->SkipRows; - dst->ImageHeight = src->ImageHeight; - dst->SkipImages = src->SkipImages; - dst->SwapBytes = src->SwapBytes; - dst->LsbFirst = src->LsbFirst; - dst->ClientStorage = src->ClientStorage; - dst->Invert = src->Invert; - _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj); -} - - -#define GL_CLIENT_PACK_BIT (1<<20) -#define GL_CLIENT_UNPACK_BIT (1<<21) - - -void GLAPIENTRY -_mesa_PushClientAttrib(GLbitfield mask) -{ - struct gl_attrib_node *newnode; - struct gl_attrib_node *head; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->ClientAttribStackDepth >= MAX_CLIENT_ATTRIB_STACK_DEPTH) { - _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushClientAttrib" ); - return; - } - - /* Build linked list of attribute nodes which save all attribute - * groups specified by the mask. - */ - head = NULL; - - if (mask & GL_CLIENT_PIXEL_STORE_BIT) { - struct gl_pixelstore_attrib *attr; - /* packing attribs */ - attr = CALLOC_STRUCT( gl_pixelstore_attrib ); - copy_pixelstore(ctx, attr, &ctx->Pack); - newnode = new_attrib_node( GL_CLIENT_PACK_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - /* unpacking attribs */ - attr = CALLOC_STRUCT( gl_pixelstore_attrib ); - copy_pixelstore(ctx, attr, &ctx->Unpack); - newnode = new_attrib_node( GL_CLIENT_UNPACK_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - } - - if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { - struct gl_array_attrib *attr; - struct gl_array_object *obj; - - attr = MALLOC_STRUCT( gl_array_attrib ); - obj = MALLOC_STRUCT( gl_array_object ); - -#if FEATURE_ARB_vertex_buffer_object - /* increment ref counts since we're copying pointers to these objects */ - ctx->Array.ArrayBufferObj->RefCount++; - ctx->Array.ElementArrayBufferObj->RefCount++; -#endif - - MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); - MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); - - attr->ArrayObj = obj; - - newnode = new_attrib_node( GL_CLIENT_VERTEX_ARRAY_BIT ); - newnode->data = attr; - newnode->next = head; - head = newnode; - /* bump reference counts on buffer objects */ - adjust_buffer_object_ref_counts(&ctx->Array, 1); - } - - ctx->ClientAttribStack[ctx->ClientAttribStackDepth] = head; - ctx->ClientAttribStackDepth++; -} - - - - -void GLAPIENTRY -_mesa_PopClientAttrib(void) -{ - struct gl_attrib_node *node, *next; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->ClientAttribStackDepth == 0) { - _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopClientAttrib" ); - return; - } - - ctx->ClientAttribStackDepth--; - node = ctx->ClientAttribStack[ctx->ClientAttribStackDepth]; - - while (node) { - switch (node->kind) { - case GL_CLIENT_PACK_BIT: - { - struct gl_pixelstore_attrib *store = - (struct gl_pixelstore_attrib *) node->data; - copy_pixelstore(ctx, &ctx->Pack, store); - _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); - } - ctx->NewState |= _NEW_PACKUNPACK; - break; - case GL_CLIENT_UNPACK_BIT: - { - struct gl_pixelstore_attrib *store = - (struct gl_pixelstore_attrib *) node->data; - copy_pixelstore(ctx, &ctx->Unpack, store); - _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); - } - ctx->NewState |= _NEW_PACKUNPACK; - break; - case GL_CLIENT_VERTEX_ARRAY_BIT: { - struct gl_array_attrib * data = - (struct gl_array_attrib *) node->data; - - adjust_buffer_object_ref_counts(&ctx->Array, -1); - - ctx->Array.ActiveTexture = data->ActiveTexture; - if (data->LockCount != 0) - _mesa_LockArraysEXT(data->LockFirst, data->LockCount); - else if (ctx->Array.LockCount) - _mesa_UnlockArraysEXT(); - - _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name ); - -#if FEATURE_ARB_vertex_buffer_object - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, - data->ArrayBufferObj->Name); - _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, - data->ElementArrayBufferObj->Name); -#endif - - MEMCPY( ctx->Array.ArrayObj, data->ArrayObj, - sizeof( struct gl_array_object ) ); - - FREE( data->ArrayObj ); - - /* FIXME: Should some bits in ctx->Array->NewState also be set - * FIXME: here? It seems like it should be set to inclusive-or - * FIXME: of the old ArrayObj->_Enabled and the new _Enabled. - */ - - ctx->NewState |= _NEW_ARRAY; - break; - } - default: - _mesa_problem( ctx, "Bad attrib flag in PopClientAttrib"); - break; - } - - next = node->next; - FREE( node->data ); - FREE( node ); - node = next; - } -} - - -/** - * Free any attribute state data that might be attached to the context. - */ -void -_mesa_free_attrib_data(GLcontext *ctx) -{ - while (ctx->AttribStackDepth > 0) { - struct gl_attrib_node *attr, *next; - - ctx->AttribStackDepth--; - attr = ctx->AttribStack[ctx->AttribStackDepth]; - - while (attr) { - if (attr->kind == GL_TEXTURE_BIT) { - struct texture_state *texstate = (struct texture_state*)attr->data; - GLuint u, tgt; - /* clear references to the saved texture objects */ - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { - _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL); - } - } - } - else { - /* any other chunks of state that requires special handling? */ - } - - next = attr->next; - _mesa_free(attr->data); - _mesa_free(attr); - attr = next; - } - } -} - - -void _mesa_init_attrib( GLcontext *ctx ) -{ - /* Renderer and client attribute stacks */ - ctx->AttribStackDepth = 0; - ctx->ClientAttribStackDepth = 0; -} diff --git a/src/libs/mesa/mesa/main/attrib.h b/src/libs/mesa/mesa/main/attrib.h deleted file mode 100644 index 2cf8fe6934..0000000000 --- a/src/libs/mesa/mesa/main/attrib.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 ATTRIB_H -#define ATTRIB_H - - -#include "mtypes.h" - - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_PushAttrib( GLbitfield mask ); - -extern void GLAPIENTRY -_mesa_PopAttrib( void ); - -extern void GLAPIENTRY -_mesa_PushClientAttrib( GLbitfield mask ); - -extern void GLAPIENTRY -_mesa_PopClientAttrib( void ); - -extern void -_mesa_init_attrib( GLcontext *ctx ); - -extern void -_mesa_free_attrib_data( GLcontext *ctx ); - -#else - -/** No-op */ -#define _mesa_init_attrib( c ) ((void)0) -#define _mesa_free_attrib_data( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/bitset.h b/src/libs/mesa/mesa/main/bitset.h deleted file mode 100644 index 8bd4526cb6..0000000000 --- a/src/libs/mesa/mesa/main/bitset.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -/** - * \file bitset.h - * \brief Bitset of arbitrary size definitions. - * \author Michal Krol - */ - -/**************************************************************************** - * generic bitset implementation - */ - -#define BITSET_WORD GLuint -#define BITSET_WORDBITS (sizeof (BITSET_WORD) * 8) - -/* bitset declarations - */ -#define BITSET_DECLARE(name, size) \ - BITSET_WORD name[((size) + BITSET_WORDBITS - 1) / BITSET_WORDBITS] - -/* bitset operations - */ -#define BITSET_COPY(x, y) _mesa_memcpy( (x), (y), sizeof (x) ) -#define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0) -#define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) ) -#define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) ) - -#define BITSET_BITWORD(b) ((b) / BITSET_WORDBITS) -#define BITSET_BIT(b) (1 << ((b) % BITSET_WORDBITS)) - -/* single bit operations - */ -#define BITSET_TEST(x, b) ((x)[BITSET_BITWORD(b)] & BITSET_BIT(b)) -#define BITSET_SET(x, b) ((x)[BITSET_BITWORD(b)] |= BITSET_BIT(b)) -#define BITSET_CLEAR(x, b) ((x)[BITSET_BITWORD(b)] &= ~BITSET_BIT(b)) - -#define BITSET_MASK(b) ((b) == BITSET_WORDBITS ? ~0 : BITSET_BIT(b) - 1) -#define BITSET_RANGE(b, e) (BITSET_MASK((e) + 1) & ~BITSET_MASK(b)) - -/* bit range operations - */ -#define BITSET_TEST_RANGE(x, b, e) \ - (BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \ - ((x)[BITSET_BITWORD(b)] & BITSET_RANGE(b, e)) : \ - (assert (!"BITSET_TEST_RANGE: bit range crosses word boundary"), 0)) -#define BITSET_SET_RANGE(x, b, e) \ - (BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \ - ((x)[BITSET_BITWORD(b)] |= BITSET_RANGE(b, e)) : \ - (assert (!"BITSET_SET_RANGE: bit range crosses word boundary"), 0)) -#define BITSET_CLEAR_RANGE(x, b, e) \ - (BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \ - ((x)[BITSET_BITWORD(b)] &= ~BITSET_RANGE(b, e)) : \ - (assert (!"BITSET_CLEAR_RANGE: bit range crosses word boundary"), 0)) - -/**************************************************************************** - * 64-bit bitset implementation - */ - -#define BITSET64_WORD GLuint -#define BITSET64_WORDBITS (sizeof (BITSET64_WORD) * 8) - -/* bitset declarations - */ -#define BITSET64_DECLARE(name, size) \ - GLuint name[2] - -/* bitset operations - */ -#define BITSET64_COPY(x, y) do { (x)[0] = (y)[0]; (x)[1] = (y)[1]; } while (0) -#define BITSET64_EQUAL(x, y) ( (x)[0] == (y)[0] && (x)[1] == (y)[1] ) -#define BITSET64_ZERO(x) do { (x)[0] = 0; (x)[1] = 0; } while (0) -#define BITSET64_ONES(x) do { (x)[0] = 0xFF; (x)[1] = 0xFF; } while (0) - -#define BITSET64_BITWORD(b) ((b) / BITSET64_WORDBITS) -#define BITSET64_BIT(b) (1 << ((b) % BITSET64_WORDBITS)) - -/* single bit operations - */ -#define BITSET64_TEST(x, b) ((x)[BITSET64_BITWORD(b)] & BITSET64_BIT(b)) -#define BITSET64_SET(x, b) ((x)[BITSET64_BITWORD(b)] |= BITSET64_BIT(b)) -#define BITSET64_CLEAR(x, b) ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_BIT(b)) - -#define BITSET64_MASK(b) ((b) == BITSET64_WORDBITS ? ~0 : BITSET64_BIT(b) - 1) -#define BITSET64_RANGE(b, e) (BITSET64_MASK((e) + 1) & ~BITSET64_MASK(b)) - -/* bit range operations - */ -#define BITSET64_TEST_RANGE(x, b, e) \ - (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ - ((x)[BITSET64_BITWORD(b)] & BITSET64_RANGE(b, e)) : \ - (assert (!"BITSET64_TEST_RANGE: bit range crosses word boundary"), 0)) -#define BITSET64_SET_RANGE(x, b, e) \ - (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ - ((x)[BITSET64_BITWORD(b)] |= BITSET64_RANGE(b, e)) : \ - (assert (!"BITSET64_SET_RANGE: bit range crosses word boundary"), 0)) -#define BITSET64_CLEAR_RANGE(x, b, e) \ - (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ - ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_RANGE(b, e)) : \ - (assert (!"BITSET64_CLEAR_RANGE: bit range crosses word boundary"), 0)) - diff --git a/src/libs/mesa/mesa/main/blend.c b/src/libs/mesa/mesa/main/blend.c deleted file mode 100644 index 39cf6153e2..0000000000 --- a/src/libs/mesa/mesa/main/blend.c +++ /dev/null @@ -1,592 +0,0 @@ -/** - * \file blend.c - * Blending operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - - -#include "glheader.h" -#include "blend.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "mtypes.h" -#include "glapi/glapitable.h" - - -/** - * Specify the blending operation. - * - * \param sfactor source factor operator. - * \param dfactor destination factor operator. - * - * \sa glBlendFunc, glBlendFuncSeparateEXT - */ -void GLAPIENTRY -_mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) -{ - _mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor); -} - - -/** - * Process GL_EXT_blend_func_separate(). - * - * \param sfactorRGB RGB source factor operator. - * \param dfactorRGB RGB destination factor operator. - * \param sfactorA alpha source factor operator. - * \param dfactorA alpha destination factor operator. - * - * Verifies the parameters and updates gl_colorbuffer_attrib. - * On a change, flush the vertices and notify the driver via - * dd_function_table::BlendFuncSeparate. - */ -void GLAPIENTRY -_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n", - _mesa_lookup_enum_by_nr(sfactorRGB), - _mesa_lookup_enum_by_nr(dfactorRGB), - _mesa_lookup_enum_by_nr(sfactorA), - _mesa_lookup_enum_by_nr(dfactorA)); - - switch (sfactorRGB) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - if (!ctx->Extensions.NV_blend_square) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (sfactorRGB)"); - return; - } - /* fall-through */ - case GL_ZERO: - case GL_ONE: - case GL_DST_COLOR: - case GL_ONE_MINUS_DST_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - case GL_DST_ALPHA: - case GL_ONE_MINUS_DST_ALPHA: - case GL_SRC_ALPHA_SATURATE: - case GL_CONSTANT_COLOR: - case GL_ONE_MINUS_CONSTANT_COLOR: - case GL_CONSTANT_ALPHA: - case GL_ONE_MINUS_CONSTANT_ALPHA: - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (sfactorRGB)"); - return; - } - - switch (dfactorRGB) { - case GL_DST_COLOR: - case GL_ONE_MINUS_DST_COLOR: - if (!ctx->Extensions.NV_blend_square) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (dfactorRGB)"); - return; - } - /* fall-through */ - case GL_ZERO: - case GL_ONE: - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - case GL_DST_ALPHA: - case GL_ONE_MINUS_DST_ALPHA: - case GL_CONSTANT_COLOR: - case GL_ONE_MINUS_CONSTANT_COLOR: - case GL_CONSTANT_ALPHA: - case GL_ONE_MINUS_CONSTANT_ALPHA: - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (dfactorRGB)"); - return; - } - - switch (sfactorA) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - if (!ctx->Extensions.NV_blend_square) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (sfactorA)"); - return; - } - /* fall-through */ - case GL_ZERO: - case GL_ONE: - case GL_DST_COLOR: - case GL_ONE_MINUS_DST_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - case GL_DST_ALPHA: - case GL_ONE_MINUS_DST_ALPHA: - case GL_SRC_ALPHA_SATURATE: - case GL_CONSTANT_COLOR: - case GL_ONE_MINUS_CONSTANT_COLOR: - case GL_CONSTANT_ALPHA: - case GL_ONE_MINUS_CONSTANT_ALPHA: - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (sfactorA)"); - return; - } - - switch (dfactorA) { - case GL_DST_COLOR: - case GL_ONE_MINUS_DST_COLOR: - if (!ctx->Extensions.NV_blend_square) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (dfactorA)"); - return; - } - /* fall-through */ - case GL_ZERO: - case GL_ONE: - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - case GL_DST_ALPHA: - case GL_ONE_MINUS_DST_ALPHA: - case GL_CONSTANT_COLOR: - case GL_ONE_MINUS_CONSTANT_COLOR: - case GL_CONSTANT_ALPHA: - case GL_ONE_MINUS_CONSTANT_ALPHA: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glBlendFunc or glBlendFuncSeparate (dfactorA)" ); - return; - } - - if (ctx->Color.BlendSrcRGB == sfactorRGB && - ctx->Color.BlendDstRGB == dfactorRGB && - ctx->Color.BlendSrcA == sfactorA && - ctx->Color.BlendDstA == dfactorA) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - - ctx->Color.BlendSrcRGB = sfactorRGB; - ctx->Color.BlendDstRGB = dfactorRGB; - ctx->Color.BlendSrcA = sfactorA; - ctx->Color.BlendDstA = dfactorA; - - if (ctx->Driver.BlendFuncSeparate) { - (*ctx->Driver.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB, - sfactorA, dfactorA ); - } -} - - -#if _HAVE_FULL_GL - -static GLboolean -_mesa_validate_blend_equation( GLcontext *ctx, - GLenum mode, GLboolean is_separate ) -{ - switch (mode) { - case GL_FUNC_ADD: - break; - case GL_MIN: - case GL_MAX: - if (!ctx->Extensions.EXT_blend_minmax && - !ctx->Extensions.ARB_imaging) { - return GL_FALSE; - } - break; - /* glBlendEquationSeparate cannot take GL_LOGIC_OP as a parameter. - */ - case GL_LOGIC_OP: - if (!ctx->Extensions.EXT_blend_logic_op || is_separate) { - return GL_FALSE; - } - break; - case GL_FUNC_SUBTRACT: - case GL_FUNC_REVERSE_SUBTRACT: - if (!ctx->Extensions.EXT_blend_subtract && - !ctx->Extensions.ARB_imaging) { - return GL_FALSE; - } - break; - default: - return GL_FALSE; - } - - return GL_TRUE; -} - - -/* This is really an extension function! */ -void GLAPIENTRY -_mesa_BlendEquation( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glBlendEquation %s\n", - _mesa_lookup_enum_by_nr(mode)); - - if ( ! _mesa_validate_blend_equation( ctx, mode, GL_FALSE ) ) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation"); - return; - } - - if ( (ctx->Color.BlendEquationRGB == mode) && - (ctx->Color.BlendEquationA == mode) ) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.BlendEquationRGB = mode; - ctx->Color.BlendEquationA = mode; - - if (ctx->Driver.BlendEquationSeparate) - (*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode ); -} - - -void GLAPIENTRY -_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glBlendEquationSeparateEXT %s %s\n", - _mesa_lookup_enum_by_nr(modeRGB), - _mesa_lookup_enum_by_nr(modeA)); - - if ( (modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate ) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlendEquationSeparateEXT not supported by driver"); - return; - } - - if ( ! _mesa_validate_blend_equation( ctx, modeRGB, GL_TRUE ) ) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeRGB)"); - return; - } - - if ( ! _mesa_validate_blend_equation( ctx, modeA, GL_TRUE ) ) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)"); - return; - } - - - if ( (ctx->Color.BlendEquationRGB == modeRGB) && - (ctx->Color.BlendEquationA == modeA) ) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.BlendEquationRGB = modeRGB; - ctx->Color.BlendEquationA = modeA; - - if (ctx->Driver.BlendEquationSeparate) - (*ctx->Driver.BlendEquationSeparate)( ctx, modeRGB, modeA ); -} -#endif - - -/** - * Set the blending color. - * - * \param red red color component. - * \param green green color component. - * \param blue blue color component. - * \param alpha alpha color component. - * - * \sa glBlendColor(). - * - * Clamps the parameters and updates gl_colorbuffer_attrib::BlendColor. On a - * change, flushes the vertices and notifies the driver via - * dd_function_table::BlendColor callback. - */ -void GLAPIENTRY -_mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) -{ - GLfloat tmp[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - tmp[0] = CLAMP( red, 0.0F, 1.0F ); - tmp[1] = CLAMP( green, 0.0F, 1.0F ); - tmp[2] = CLAMP( blue, 0.0F, 1.0F ); - tmp[3] = CLAMP( alpha, 0.0F, 1.0F ); - - if (TEST_EQ_4V(tmp, ctx->Color.BlendColor)) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4FV( ctx->Color.BlendColor, tmp ); - - if (ctx->Driver.BlendColor) - (*ctx->Driver.BlendColor)(ctx, tmp); -} - - -/** - * Specify the alpha test function. - * - * \param func alpha comparison function. - * \param ref reference value. - * - * Verifies the parameters and updates gl_colorbuffer_attrib. - * On a change, flushes the vertices and notifies the driver via - * dd_function_table::AlphaFunc callback. - */ -void GLAPIENTRY -_mesa_AlphaFunc( GLenum func, GLclampf ref ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (func) { - case GL_NEVER: - case GL_LESS: - case GL_EQUAL: - case GL_LEQUAL: - case GL_GREATER: - case GL_NOTEQUAL: - case GL_GEQUAL: - case GL_ALWAYS: - ref = CLAMP(ref, 0.0F, 1.0F); - - if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == ref) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.AlphaFunc = func; - ctx->Color.AlphaRef = ref; - - if (ctx->Driver.AlphaFunc) - ctx->Driver.AlphaFunc(ctx, func, ref); - return; - - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glAlphaFunc(func)" ); - return; - } -} - - -/** - * Specify a logic pixel operation for color index rendering. - * - * \param opcode operation. - * - * Verifies that \p opcode is a valid enum and updates -gl_colorbuffer_attrib::LogicOp. - * On a change, flushes the vertices and notifies the driver via the - * dd_function_table::LogicOpcode callback. - */ -void GLAPIENTRY -_mesa_LogicOp( GLenum opcode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (opcode) { - case GL_CLEAR: - case GL_SET: - case GL_COPY: - case GL_COPY_INVERTED: - case GL_NOOP: - case GL_INVERT: - case GL_AND: - case GL_NAND: - case GL_OR: - case GL_NOR: - case GL_XOR: - case GL_EQUIV: - case GL_AND_REVERSE: - case GL_AND_INVERTED: - case GL_OR_REVERSE: - case GL_OR_INVERTED: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glLogicOp" ); - return; - } - - if (ctx->Color.LogicOp == opcode) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.LogicOp = opcode; - - if (ctx->Driver.LogicOpcode) - ctx->Driver.LogicOpcode( ctx, opcode ); -} - -#if _HAVE_FULL_GL -void GLAPIENTRY -_mesa_IndexMask( GLuint mask ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Color.IndexMask == mask) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.IndexMask = mask; - - if (ctx->Driver.IndexMask) - ctx->Driver.IndexMask( ctx, mask ); -} -#endif - - -/** - * Enable or disable writing of frame buffer color components. - * - * \param red whether to mask writing of the red color component. - * \param green whether to mask writing of the green color component. - * \param blue whether to mask writing of the blue color component. - * \param alpha whether to mask writing of the alpha color component. - * - * \sa glColorMask(). - * - * Sets the appropriate value of gl_colorbuffer_attrib::ColorMask. On a - * change, flushes the vertices and notifies the driver via the - * dd_function_table::ColorMask callback. - */ -void GLAPIENTRY -_mesa_ColorMask( GLboolean red, GLboolean green, - GLboolean blue, GLboolean alpha ) -{ - GET_CURRENT_CONTEXT(ctx); - GLubyte tmp[4]; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glColorMask %d %d %d %d\n", red, green, blue, alpha); - - /* Shouldn't have any information about channel depth in core mesa - * -- should probably store these as the native booleans: - */ - tmp[RCOMP] = red ? 0xff : 0x0; - tmp[GCOMP] = green ? 0xff : 0x0; - tmp[BCOMP] = blue ? 0xff : 0x0; - tmp[ACOMP] = alpha ? 0xff : 0x0; - - if (TEST_EQ_4UBV(tmp, ctx->Color.ColorMask)) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4UBV(ctx->Color.ColorMask, tmp); - - if (ctx->Driver.ColorMask) - ctx->Driver.ColorMask( ctx, red, green, blue, alpha ); -} - - -extern void GLAPIENTRY -_mesa_ClampColorARB(GLenum target, GLenum clamp) -{ - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (clamp != GL_TRUE && clamp != GL_FALSE && clamp != GL_FIXED_ONLY_ARB) { - _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(clamp)"); - return; - } - - switch (target) { - case GL_CLAMP_VERTEX_COLOR_ARB: - ctx->Light.ClampVertexColor = clamp; - break; - case GL_CLAMP_FRAGMENT_COLOR_ARB: - ctx->Color.ClampFragmentColor = clamp; - break; - case GL_CLAMP_READ_COLOR_ARB: - ctx->Color.ClampReadColor = clamp; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(target)"); - return; - } -} - - - - -/**********************************************************************/ -/** \name Initialization */ -/*@{*/ - -/** - * Initialization of the context's Color attribute group. - * - * \param ctx GL context. - * - * Initializes the related fields in the context color attribute group, - * __GLcontextRec::Color. - */ -void _mesa_init_color( GLcontext * ctx ) -{ - /* Color buffer group */ - ctx->Color.IndexMask = ~0u; - ctx->Color.ColorMask[0] = 0xff; - ctx->Color.ColorMask[1] = 0xff; - ctx->Color.ColorMask[2] = 0xff; - ctx->Color.ColorMask[3] = 0xff; - ctx->Color.ClearIndex = 0; - ASSIGN_4V( ctx->Color.ClearColor, 0, 0, 0, 0 ); - 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.BlendEquationRGB = GL_FUNC_ADD; - ctx->Color.BlendEquationA = GL_FUNC_ADD; - 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._LogicOpEnabled = GL_FALSE; - ctx->Color.LogicOp = GL_COPY; - ctx->Color.DitherFlag = GL_TRUE; - - if (ctx->Visual.doubleBufferMode) { - ctx->Color.DrawBuffer[0] = GL_BACK; - } - else { - ctx->Color.DrawBuffer[0] = GL_FRONT; - } - - ctx->Color.ClampFragmentColor = GL_FIXED_ONLY_ARB; - ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB; -} - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/blend.h b/src/libs/mesa/mesa/main/blend.h deleted file mode 100644 index 5c0f2783a7..0000000000 --- a/src/libs/mesa/mesa/main/blend.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * \file blend.h - * Blending functions operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 BLEND_H -#define BLEND_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_BlendFunc( GLenum sfactor, GLenum dfactor ); - - -extern void GLAPIENTRY -_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ); - - -extern void GLAPIENTRY -_mesa_BlendEquation( GLenum mode ); - - -extern void GLAPIENTRY -_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ); - - -extern void GLAPIENTRY -_mesa_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - - -extern void GLAPIENTRY -_mesa_AlphaFunc( GLenum func, GLclampf ref ); - - -extern void GLAPIENTRY -_mesa_LogicOp( GLenum opcode ); - - -extern void GLAPIENTRY -_mesa_IndexMask( GLuint mask ); - -extern void GLAPIENTRY -_mesa_ColorMask( GLboolean red, GLboolean green, - GLboolean blue, GLboolean alpha ); - - -extern void GLAPIENTRY -_mesa_ClampColorARB(GLenum target, GLenum clamp); - - -extern void -_mesa_init_color( GLcontext * ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/bufferobj.c b/src/libs/mesa/mesa/main/bufferobj.c deleted file mode 100644 index df90610440..0000000000 --- a/src/libs/mesa/mesa/main/bufferobj.c +++ /dev/null @@ -1,1141 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file bufferobj.c - * \brief Functions for the GL_ARB_vertex_buffer_object extension. - * \author Brian Paul, Ian Romanick - */ - - -#include "glheader.h" -#include "hash.h" -#include "imports.h" -#include "image.h" -#include "context.h" -#include "bufferobj.h" - - -/** - * Get the buffer object bound to the specified target in a GL context. - * - * \param ctx GL context - * \param target Buffer object target to be retrieved. Currently this must - * be either \c GL_ARRAY_BUFFER or \c GL_ELEMENT_ARRAY_BUFFER. - * \return A pointer to the buffer object bound to \c target in the - * specified context or \c NULL if \c target is invalid. - */ -static INLINE struct gl_buffer_object * -get_buffer(GLcontext *ctx, GLenum target) -{ - struct gl_buffer_object * bufObj = NULL; - - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bufObj = ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bufObj = ctx->Unpack.BufferObj; - break; - default: - /* error must be recorded by caller */ - return NULL; - } - - /* bufObj should point to NullBufferObj or a user-created buffer object */ - ASSERT(bufObj); - - return bufObj; -} - - -/** - * Tests the subdata range parameters and sets the GL error code for - * \c glBufferSubDataARB and \c glGetBufferSubDataARB. - * - * \param ctx GL context. - * \param target Buffer object target on which to operate. - * \param offset Offset of the first byte of the subdata range. - * \param size Size, in bytes, of the subdata range. - * \param caller Name of calling function for recording errors. - * \return A pointer to the buffer object bound to \c target in the - * specified context or \c NULL if any of the parameter or state - * conditions for \c glBufferSubDataARB or \c glGetBufferSubDataARB - * are invalid. - * - * \sa glBufferSubDataARB, glGetBufferSubDataARB - */ -static struct gl_buffer_object * -buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, - GLintptrARB offset, GLsizeiptrARB size, - const char *caller ) -{ - struct gl_buffer_object *bufObj; - - if (size < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", caller); - return NULL; - } - - if (offset < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(offset < 0)", caller); - return NULL; - } - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", caller); - return NULL; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); - return NULL; - } - if (offset + size > bufObj->Size) { - _mesa_error(ctx, GL_INVALID_VALUE, - "%s(size + offset > buffer size)", caller); - return NULL; - } - if (bufObj->Pointer) { - /* Buffer is currently mapped */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); - return NULL; - } - - return bufObj; -} - - -/** - * Allocate and initialize a new buffer object. - * - * This function is intended to be called via - * \c dd_function_table::NewBufferObject. - */ -struct gl_buffer_object * -_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) -{ - struct gl_buffer_object *obj; - - (void) ctx; - - obj = MALLOC_STRUCT(gl_buffer_object); - _mesa_initialize_buffer_object(obj, name, target); - return obj; -} - - -/** - * Delete a buffer object. - * - * This function is intended to be called via - * \c dd_function_table::DeleteBuffer. - */ -void -_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) -{ - (void) ctx; - - if (bufObj->Data) - _mesa_free(bufObj->Data); - - /* assign strange values here to help w/ debugging */ - bufObj->RefCount = -1000; - bufObj->Name = ~0; - - _mesa_free(bufObj); -} - - - -/** - * Set ptr to bufObj w/ reference counting. - */ -void -_mesa_reference_buffer_object(GLcontext *ctx, - struct gl_buffer_object **ptr, - struct gl_buffer_object *bufObj) -{ - if (*ptr == bufObj) - return; - - if (*ptr) { - /* Unreference the old texture */ - GLboolean deleteFlag = GL_FALSE; - struct gl_buffer_object *oldObj = *ptr; - - /*_glthread_LOCK_MUTEX(oldObj->Mutex);*/ - ASSERT(oldObj->RefCount > 0); - oldObj->RefCount--; -#if 0 - printf("BufferObj %p %d DECR to %d\n", - (void *) oldObj, oldObj->Name, oldObj->RefCount); -#endif - deleteFlag = (oldObj->RefCount == 0); - /*_glthread_UNLOCK_MUTEX(oldObj->Mutex);*/ - - if (deleteFlag) { - - /* some sanity checking: don't delete a buffer still in use */ -#if 0 - /* unfortunately, these tests are invalid during context tear-down */ - ASSERT(ctx->Array.ArrayBufferObj != bufObj); - ASSERT(ctx->Array.ElementArrayBufferObj != bufObj); - ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj); -#endif - - ASSERT(ctx->Driver.DeleteBuffer); - ctx->Driver.DeleteBuffer(ctx, oldObj); - } - - *ptr = NULL; - } - ASSERT(!*ptr); - - if (bufObj) { - /* reference new texture */ - /*_glthread_LOCK_MUTEX(tex->Mutex);*/ - if (bufObj->RefCount == 0) { - /* this buffer's being deleted (look just above) */ - /* Not sure this can every really happen. Warn if it does. */ - _mesa_problem(NULL, "referencing deleted buffer object"); - *ptr = NULL; - } - else { - bufObj->RefCount++; -#if 0 - printf("BufferObj %p %d INCR to %d\n", - (void *) bufObj, bufObj->Name, bufObj->RefCount); -#endif - *ptr = bufObj; - } - /*_glthread_UNLOCK_MUTEX(tex->Mutex);*/ - } -} - - -/** - * Initialize a buffer object to default values. - */ -void -_mesa_initialize_buffer_object( struct gl_buffer_object *obj, - GLuint name, GLenum target ) -{ - (void) target; - - _mesa_bzero(obj, sizeof(struct gl_buffer_object)); - obj->RefCount = 1; - obj->Name = name; - obj->Usage = GL_STATIC_DRAW_ARB; - obj->Access = GL_READ_WRITE_ARB; -} - - -/** - * Allocate space for and store data in a buffer object. Any data that was - * previously stored in the buffer object is lost. If \c data is \c NULL, - * memory will be allocated, but no copy will occur. - * - * This function is intended to be called via - * \c dd_function_table::BufferData. This function need not set GL error - * codes. The input parameters will have been tested before calling. - * - * \param ctx GL context. - * \param target Buffer object target on which to operate. - * \param size Size, in bytes, of the new data store. - * \param data Pointer to the data to store in the buffer object. This - * pointer may be \c NULL. - * \param usage Hints about how the data will be used. - * \param bufObj Object to be used. - * - * \sa glBufferDataARB, dd_function_table::BufferData. - */ -void -_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid * data, GLenum usage, - struct gl_buffer_object * bufObj ) -{ - void * new_data; - - (void) ctx; (void) target; - - new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size ); - if (new_data) { - bufObj->Data = (GLubyte *) new_data; - bufObj->Size = size; - bufObj->Usage = usage; - - if (data) { - _mesa_memcpy( bufObj->Data, data, size ); - } - } -} - - -/** - * Replace data in a subrange of buffer object. If the data range - * specified by \c size + \c offset extends beyond the end of the buffer or - * if \c data is \c NULL, no copy is performed. - * - * This function is intended to be called by - * \c dd_function_table::BufferSubData. This function need not set GL error - * codes. The input parameters will have been tested before calling. - * - * \param ctx GL context. - * \param target Buffer object target on which to operate. - * \param offset Offset of the first byte to be modified. - * \param size Size, in bytes, of the data range. - * \param data Pointer to the data to store in the buffer object. - * \param bufObj Object to be used. - * - * \sa glBufferSubDataARB, dd_function_table::BufferSubData. - */ -void -_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data, - struct gl_buffer_object * bufObj ) -{ - (void) ctx; (void) target; - - /* this should have been caught in _mesa_BufferSubData() */ - ASSERT(size + offset <= bufObj->Size); - - if (bufObj->Data) { - _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); - } -} - - -/** - * Retrieve data from a subrange of buffer object. If the data range - * specified by \c size + \c offset extends beyond the end of the buffer or - * if \c data is \c NULL, no copy is performed. - * - * This function is intended to be called by - * \c dd_function_table::BufferGetSubData. This function need not set GL error - * codes. The input parameters will have been tested before calling. - * - * \param ctx GL context. - * \param target Buffer object target on which to operate. - * \param offset Offset of the first byte to be modified. - * \param size Size, in bytes, of the data range. - * \param data Pointer to the data to store in the buffer object. - * \param bufObj Object to be used. - * - * \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData. - */ -void -_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, GLvoid * data, - struct gl_buffer_object * bufObj ) -{ - (void) ctx; (void) target; - - if (bufObj->Data && ((GLsizeiptrARB) (size + offset) <= bufObj->Size)) { - _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); - } -} - - -/** - * Fallback function called via ctx->Driver.MapBuffer(). - * Hardware drivers that really implement buffer objects should never use - * this function. - * - * The function parameters will have been already tested for errors. - * - * \param ctx GL context. - * \param target Buffer object target on which to operate. - * \param access Information about how the buffer will be accessed. - * \param bufObj Object to be mapped. - * \return A pointer to the object's internal data store that can be accessed - * by the processor - * - * \sa glMapBufferARB, dd_function_table::MapBuffer - */ -void * -_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object *bufObj ) -{ - (void) ctx; - (void) target; - (void) access; - ASSERT(!bufObj->OnCard); - /* Just return a direct pointer to the data */ - if (bufObj->Pointer) { - /* already mapped! */ - return NULL; - } - bufObj->Pointer = bufObj->Data; - return bufObj->Pointer; -} - - -/** - * Fallback function called via ctx->Driver.MapBuffer(). - * Hardware drivers that really implement buffer objects should never use - * function. - * - * The input parameters will have been already tested for errors. - * - * \sa glUnmapBufferARB, dd_function_table::UnmapBuffer - */ -GLboolean -_mesa_buffer_unmap( GLcontext *ctx, GLenum target, - struct gl_buffer_object *bufObj ) -{ - (void) ctx; - (void) target; - ASSERT(!bufObj->OnCard); - /* XXX we might assert here that bufObj->Pointer is non-null */ - bufObj->Pointer = NULL; - return GL_TRUE; -} - - -/** - * Initialize the state associated with buffer objects - */ -void -_mesa_init_buffer_objects( GLcontext *ctx ) -{ - /* Allocate the default buffer object and set refcount so high that - * it never gets deleted. - * XXX with recent/improved refcounting this may not longer be needed. - */ - ctx->Array.NullBufferObj = _mesa_new_buffer_object(ctx, 0, 0); - if (ctx->Array.NullBufferObj) - ctx->Array.NullBufferObj->RefCount = 1000; - - ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj; - ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; -} - -/** - * Bind the specified target to buffer for the specified context. - */ -static void -bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) -{ - struct gl_buffer_object *oldBufObj; - struct gl_buffer_object *newBufObj = NULL; - struct gl_buffer_object **bindTarget = NULL; - - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bindTarget = &ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bindTarget = &ctx->Unpack.BufferObj; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target)"); - return; - } - - /* Get pointer to old buffer object (to be unbound) */ - oldBufObj = get_buffer(ctx, target); - if (oldBufObj && oldBufObj->Name == buffer) - return; /* rebinding the same buffer object- no change */ - - /* - * Get pointer to new buffer object (newBufObj) - */ - if (buffer == 0) { - /* The spec says there's not a buffer object named 0, but we use - * one internally because it simplifies things. - */ - newBufObj = ctx->Array.NullBufferObj; - } - else { - /* non-default buffer object */ - newBufObj = _mesa_lookup_bufferobj(ctx, buffer); - if (!newBufObj) { - /* if this is a new buffer object id, allocate a buffer object now */ - ASSERT(ctx->Driver.NewBufferObject); - newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target); - if (!newBufObj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB"); - return; - } - _mesa_HashInsert(ctx->Shared->BufferObjects, buffer, newBufObj); - } - } - - /* bind new buffer */ - _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); - - /* Pass BindBuffer call to device driver */ - if (ctx->Driver.BindBuffer && newBufObj) - ctx->Driver.BindBuffer( ctx, target, newBufObj ); -} - - -/** - * Update the default buffer objects in the given context to reference those - * specified in the shared state and release those referencing the old - * shared state. - */ -void -_mesa_update_default_objects_buffer_objects(GLcontext *ctx) -{ - /* Bind the NullBufferObj to remove references to those - * in the shared context hash table. - */ - bind_buffer_object( ctx, GL_ARRAY_BUFFER_ARB, 0); - bind_buffer_object( ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - bind_buffer_object( ctx, GL_PIXEL_PACK_BUFFER_ARB, 0); - bind_buffer_object( ctx, GL_PIXEL_UNPACK_BUFFER_ARB, 0); -} - - -/** - * When we're about to read pixel data out of a PBO (via glDrawPixels, - * glTexImage, etc) or write data into a PBO (via glReadPixels, - * glGetTexImage, etc) we call this function to check that we're not - * going to read out of bounds. - * - * XXX This would also be a convenient time to check that the PBO isn't - * currently mapped. Whoever calls this function should check for that. - * Remember, we can't use a PBO when it's mapped! - * - * \param width width of image to read/write - * \param height height of image to read/write - * \param depth depth of image to read/write - * \param format format of image to read/write - * \param type datatype of image to read/write - * \param ptr the user-provided pointer/offset - * \return GL_TRUE if the PBO access is OK, GL_FALSE if the access would - * go out of bounds. - */ -GLboolean -_mesa_validate_pbo_access(GLuint dimensions, - const struct gl_pixelstore_attrib *pack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *ptr) -{ - GLvoid *start, *end; - const GLubyte *sizeAddr; /* buffer size, cast to a pointer */ - - ASSERT(pack->BufferObj->Name != 0); - - if (pack->BufferObj->Size == 0) - /* no buffer! */ - return GL_FALSE; - - /* get address of first pixel we'll read */ - start = _mesa_image_address(dimensions, pack, ptr, width, height, - format, type, 0, 0, 0); - - /* get address just past the last pixel we'll read */ - end = _mesa_image_address(dimensions, pack, ptr, width, height, - format, type, depth-1, height-1, width); - - - sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size; - - if ((const GLubyte *) start > sizeAddr) { - /* This will catch negative values / wrap-around */ - return GL_FALSE; - } - if ((const GLubyte *) end > sizeAddr) { - /* Image read goes beyond end of buffer */ - return GL_FALSE; - } - - /* OK! */ - return GL_TRUE; -} - - -/** - * If the source of glBitmap data is a PBO, check that we won't read out - * of buffer bounds, then map the buffer. - * If not sourcing from a PBO, just return the bitmap pointer. - * This is a helper function for (some) drivers. - * Return NULL if error. - * If non-null return, must call _mesa_unmap_bitmap_pbo() when done. - */ -const GLubyte * -_mesa_map_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - const GLubyte *buf; - - if (unpack->BufferObj->Name) { - /* unpack from PBO */ - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - unpack->BufferObj); - if (!buf) - return NULL; - - buf = ADD_POINTERS(buf, bitmap); - } - else { - /* unpack from normal memory */ - buf = bitmap; - } - - return buf; -} - - -/** - * Counterpart to _mesa_map_bitmap_pbo() - * This is a helper function for (some) drivers. - */ -void -_mesa_unmap_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack) -{ - if (unpack->BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - unpack->BufferObj); - } -} - - -/** - * \sa _mesa_map_bitmap_pbo - */ -const GLvoid * -_mesa_map_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) -{ - const GLvoid *buf; - - if (unpack->BufferObj->Name) { - /* unpack from PBO */ - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - unpack->BufferObj); - if (!buf) - return NULL; - - buf = ADD_POINTERS(buf, pixels); - } - else { - /* unpack from normal memory */ - buf = pixels; - } - - return buf; -} - - -/** - * \sa _mesa_unmap_bitmap_pbo - */ -void -_mesa_unmap_drapix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack) -{ - if (unpack->BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - unpack->BufferObj); - } -} - - -/** - * If PBO is bound, map the buffer, return dest pointer in mapped buffer. - * Call _mesa_unmap_readpix_pbo() when finished - * \return NULL if error - */ -void * -_mesa_map_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest) -{ - void *buf; - - if (pack->BufferObj->Name) { - /* pack into PBO */ - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - pack->BufferObj); - if (!buf) - return NULL; - - buf = ADD_POINTERS(buf, dest); - } - else { - /* pack to normal memory */ - buf = dest; - } - - return buf; -} - - -/** - * Counterpart to _mesa_map_readpix_pbo() - */ -void -_mesa_unmap_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack) -{ - if (pack->BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj); - } -} - - - -/** - * Return the gl_buffer_object for the given ID. - * Always return NULL for ID 0. - */ -struct gl_buffer_object * -_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer) -{ - if (buffer == 0) - return NULL; - else - return (struct gl_buffer_object *) - _mesa_HashLookup(ctx->Shared->BufferObjects, buffer); -} - - -/** - * If *ptr points to obj, set ptr = the Null/default buffer object. - * This is a helper for buffer object deletion. - * The GL spec says that deleting a buffer object causes it to get - * unbound from all arrays in the current context. - */ -static void -unbind(GLcontext *ctx, - struct gl_buffer_object **ptr, - struct gl_buffer_object *obj) -{ - if (*ptr == obj) { - _mesa_reference_buffer_object(ctx, ptr, ctx->Array.NullBufferObj); - } -} - - - -/**********************************************************************/ -/* API Functions */ -/**********************************************************************/ - -void GLAPIENTRY -_mesa_BindBufferARB(GLenum target, GLuint buffer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - bind_buffer_object(ctx, target, buffer); -} - - -/** - * Delete a set of buffer objects. - * - * \param n Number of buffer objects to delete. - * \param ids Array of \c n buffer object IDs. - */ -void GLAPIENTRY -_mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) -{ - GET_CURRENT_CONTEXT(ctx); - GLsizei i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteBuffersARB(n)"); - return; - } - - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - for (i = 0; i < n; i++) { - struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]); - if (bufObj) { - /* unbind any vertex pointers bound to this buffer */ - GLuint j; - - ASSERT(bufObj->Name == ids[i]); - - if (bufObj->Pointer) { - /* if mapped, unmap it now */ - ctx->Driver.UnmapBuffer(ctx, 0, bufObj); - bufObj->Access = GL_READ_WRITE_ARB; - bufObj->Pointer = NULL; - } - - unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Color.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->SecondaryColor.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->FogCoord.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Index.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->EdgeFlag.BufferObj, bufObj); - for (j = 0; j < MAX_TEXTURE_COORD_UNITS; j++) { - unbind(ctx, &ctx->Array.ArrayObj->TexCoord[j].BufferObj, bufObj); - } - for (j = 0; j < VERT_ATTRIB_MAX; j++) { - unbind(ctx, &ctx->Array.ArrayObj->VertexAttrib[j].BufferObj, bufObj); - } - - if (ctx->Array.ArrayBufferObj == bufObj) { - _mesa_BindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); - } - if (ctx->Array.ElementArrayBufferObj == bufObj) { - _mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ); - } - - if (ctx->Pack.BufferObj == bufObj) { - _mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 ); - } - if (ctx->Unpack.BufferObj == bufObj) { - _mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 ); - } - - /* The ID is immediately freed for re-use */ - _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name); - _mesa_reference_buffer_object(ctx, &bufObj, NULL); - } - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -/** - * Generate a set of unique buffer object IDs and store them in \c buffer. - * - * \param n Number of IDs to generate. - * \param buffer Array of \c n locations to store the IDs. - */ -void GLAPIENTRY -_mesa_GenBuffersARB(GLsizei n, GLuint *buffer) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenBuffersARB"); - return; - } - - if (!buffer) { - return; - } - - /* - * This must be atomic (generation and allocation of buffer object IDs) - */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->BufferObjects, n); - - /* Allocate new, empty buffer objects and return identifiers */ - for (i = 0; i < n; i++) { - struct gl_buffer_object *bufObj; - GLuint name = first + i; - GLenum target = 0; - bufObj = ctx->Driver.NewBufferObject( ctx, name, target ); - if (!bufObj) { - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenBuffersARB"); - return; - } - _mesa_HashInsert(ctx->Shared->BufferObjects, first + i, bufObj); - buffer[i] = first + i; - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -/** - * Determine if ID is the name of a buffer object. - * - * \param id ID of the potential buffer object. - * \return \c GL_TRUE if \c id is the name of a buffer object, - * \c GL_FALSE otherwise. - */ -GLboolean GLAPIENTRY -_mesa_IsBufferARB(GLuint id) -{ - struct gl_buffer_object *bufObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - bufObj = _mesa_lookup_bufferobj(ctx, id); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - - return bufObj ? GL_TRUE : GL_FALSE; -} - - -void GLAPIENTRY -_mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, - const GLvoid * data, GLenum usage) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *bufObj; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (size < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glBufferDataARB(size < 0)"); - return; - } - - switch (usage) { - case GL_STREAM_DRAW_ARB: - case GL_STREAM_READ_ARB: - case GL_STREAM_COPY_ARB: - case GL_STATIC_DRAW_ARB: - case GL_STATIC_READ_ARB: - case GL_STATIC_COPY_ARB: - case GL_DYNAMIC_DRAW_ARB: - case GL_DYNAMIC_READ_ARB: - case GL_DYNAMIC_COPY_ARB: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBufferDataARB(usage)"); - return; - } - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBufferDataARB(target)" ); - return; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB" ); - return; - } - - if (bufObj->Pointer) { - /* Unmap the existing buffer. We'll replace it now. Not an error. */ - ctx->Driver.UnmapBuffer(ctx, target, bufObj); - bufObj->Access = GL_READ_WRITE_ARB; - bufObj->Pointer = NULL; - } - - ASSERT(ctx->Driver.BufferData); - - /* Give the buffer object to the driver! may be null! */ - ctx->Driver.BufferData( ctx, target, size, data, usage, bufObj ); -} - - -void GLAPIENTRY -_mesa_BufferSubDataARB(GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *bufObj; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - bufObj = buffer_object_subdata_range_good( ctx, target, offset, size, - "glBufferSubDataARB" ); - if (!bufObj) { - /* error already recorded */ - return; - } - - ASSERT(ctx->Driver.BufferSubData); - ctx->Driver.BufferSubData( ctx, target, offset, size, data, bufObj ); -} - - -void GLAPIENTRY -_mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset, - GLsizeiptrARB size, void * data) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *bufObj; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - bufObj = buffer_object_subdata_range_good( ctx, target, offset, size, - "glGetBufferSubDataARB" ); - if (!bufObj) { - /* error already recorded */ - return; - } - - ASSERT(ctx->Driver.GetBufferSubData); - ctx->Driver.GetBufferSubData( ctx, target, offset, size, data, bufObj ); -} - - -void * GLAPIENTRY -_mesa_MapBufferARB(GLenum target, GLenum access) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object * bufObj; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); - - switch (access) { - case GL_READ_ONLY_ARB: - case GL_WRITE_ONLY_ARB: - case GL_READ_WRITE_ARB: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(access)"); - return NULL; - } - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(target)" ); - return NULL; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMapBufferARB" ); - return NULL; - } - if (bufObj->Pointer) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMapBufferARB(already mapped)"); - return NULL; - } - - ASSERT(ctx->Driver.MapBuffer); - bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj ); - if (!bufObj->Pointer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); - } - - bufObj->Access = access; - - return bufObj->Pointer; -} - - -GLboolean GLAPIENTRY -_mesa_UnmapBufferARB(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *bufObj; - GLboolean status = GL_TRUE; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glUnmapBufferARB(target)" ); - return GL_FALSE; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUnmapBufferARB" ); - return GL_FALSE; - } - if (!bufObj->Pointer) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUnmapBufferARB"); - return GL_FALSE; - } - - status = ctx->Driver.UnmapBuffer( ctx, target, bufObj ); - bufObj->Access = GL_READ_WRITE_ARB; - bufObj->Pointer = NULL; - - return status; -} - - -void GLAPIENTRY -_mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *bufObj; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "GetBufferParameterivARB(target)" ); - return; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "GetBufferParameterivARB" ); - return; - } - - switch (pname) { - case GL_BUFFER_SIZE_ARB: - *params = (GLint) bufObj->Size; - break; - case GL_BUFFER_USAGE_ARB: - *params = bufObj->Usage; - break; - case GL_BUFFER_ACCESS_ARB: - *params = bufObj->Access; - break; - case GL_BUFFER_MAPPED_ARB: - *params = (bufObj->Pointer != NULL); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameterivARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object * bufObj; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (pname != GL_BUFFER_MAP_POINTER_ARB) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferPointervARB(pname)"); - return; - } - - bufObj = get_buffer(ctx, target); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferPointervARB(target)" ); - return; - } - if (bufObj->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetBufferPointervARB" ); - return; - } - - *params = bufObj->Pointer; -} diff --git a/src/libs/mesa/mesa/main/bufferobj.h b/src/libs/mesa/mesa/main/bufferobj.h deleted file mode 100644 index 163fe241aa..0000000000 --- a/src/libs/mesa/mesa/main/bufferobj.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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 BUFFEROBJ_H -#define BUFFEROBJ_H - - -#include "context.h" - - -/* - * Internal functions - */ - -extern void -_mesa_init_buffer_objects( GLcontext *ctx ); - -extern void -_mesa_update_default_objects_buffer_objects(GLcontext *ctx); - -extern struct gl_buffer_object * -_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ); - -extern void -_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); - -extern struct gl_buffer_object * -_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer); - -extern void -_mesa_initialize_buffer_object( struct gl_buffer_object *obj, - GLuint name, GLenum target ); - -extern void -_mesa_reference_buffer_object(GLcontext *ctx, - struct gl_buffer_object **ptr, - struct gl_buffer_object *bufObj); - -extern void -_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid * data, GLenum usage, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void * -_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object * bufObj ); - -extern GLboolean -_mesa_buffer_unmap( GLcontext *ctx, GLenum target, - struct gl_buffer_object * bufObj ); - -extern GLboolean -_mesa_validate_pbo_access(GLuint dimensions, - const struct gl_pixelstore_attrib *pack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *ptr); - -extern const GLubyte * -_mesa_map_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap); - -extern void -_mesa_unmap_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); - -extern const GLvoid * -_mesa_map_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); - -extern void -_mesa_unmap_drapix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); - - -extern void * -_mesa_map_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest); - -extern void -_mesa_unmap_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack); - - - -/* - * API functions - */ - -extern void GLAPIENTRY -_mesa_BindBufferARB(GLenum target, GLuint buffer); - -extern void GLAPIENTRY -_mesa_DeleteBuffersARB(GLsizei n, const GLuint * buffer); - -extern void GLAPIENTRY -_mesa_GenBuffersARB(GLsizei n, GLuint * buffer); - -extern GLboolean GLAPIENTRY -_mesa_IsBufferARB(GLuint buffer); - -extern void GLAPIENTRY -_mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); - -extern void GLAPIENTRY -_mesa_BufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); - -extern void GLAPIENTRY -_mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); - -extern void * GLAPIENTRY -_mesa_MapBufferARB(GLenum target, GLenum access); - -extern GLboolean GLAPIENTRY -_mesa_UnmapBufferARB(GLenum target); - -extern void GLAPIENTRY -_mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params); - -#endif diff --git a/src/libs/mesa/mesa/main/buffers.c b/src/libs/mesa/mesa/main/buffers.c deleted file mode 100644 index 897d79155e..0000000000 --- a/src/libs/mesa/mesa/main/buffers.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file buffers.c - * glReadBuffer, DrawBuffer functions. - */ - - - -#include "glheader.h" -#include "buffers.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "fbobject.h" -#include "state.h" - - -#define BAD_MASK ~0u - - -/** - * Return bitmask of BUFFER_BIT_* flags indicating which color buffers are - * available to the rendering context (for drawing or reading). - * This depends on the type of framebuffer. For window system framebuffers - * we look at the framebuffer's visual. But for user-create framebuffers we - * look at the number of supported color attachments. - * \param fb the framebuffer to draw to, or read from - * \return bitmask of BUFFER_BIT_* flags - */ -static GLbitfield -supported_buffer_bitmask(const GLcontext *ctx, const struct gl_framebuffer *fb) -{ - GLbitfield mask = 0x0; - - if (fb->Name > 0) { - /* A user-created renderbuffer */ - GLuint i; - ASSERT(ctx->Extensions.EXT_framebuffer_object); - for (i = 0; i < ctx->Const.MaxColorAttachments; i++) { - mask |= (BUFFER_BIT_COLOR0 << i); - } - } - else { - /* A window system framebuffer */ - GLint i; - mask = BUFFER_BIT_FRONT_LEFT; /* always have this */ - if (fb->Visual.stereoMode) { - mask |= BUFFER_BIT_FRONT_RIGHT; - if (fb->Visual.doubleBufferMode) { - mask |= BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT; - } - } - else if (fb->Visual.doubleBufferMode) { - mask |= BUFFER_BIT_BACK_LEFT; - } - - for (i = 0; i < fb->Visual.numAuxBuffers; i++) { - mask |= (BUFFER_BIT_AUX0 << i); - } - } - - return mask; -} - - -/** - * Helper routine used by glDrawBuffer and glDrawBuffersARB. - * Given a GLenum naming one or more color buffers (such as - * GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags. - */ -static GLbitfield -draw_buffer_enum_to_bitmask(GLenum buffer) -{ - switch (buffer) { - case GL_NONE: - return 0; - case GL_FRONT: - return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT; - case GL_BACK: - return BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT; - case GL_RIGHT: - return BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT; - case GL_FRONT_RIGHT: - return BUFFER_BIT_FRONT_RIGHT; - case GL_BACK_RIGHT: - return BUFFER_BIT_BACK_RIGHT; - case GL_BACK_LEFT: - return BUFFER_BIT_BACK_LEFT; - case GL_FRONT_AND_BACK: - return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT - | BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT; - case GL_LEFT: - return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT; - case GL_FRONT_LEFT: - return BUFFER_BIT_FRONT_LEFT; - case GL_AUX0: - return BUFFER_BIT_AUX0; - case GL_AUX1: - return BUFFER_BIT_AUX1; - case GL_AUX2: - return BUFFER_BIT_AUX2; - case GL_AUX3: - return BUFFER_BIT_AUX3; - case GL_COLOR_ATTACHMENT0_EXT: - return BUFFER_BIT_COLOR0; - case GL_COLOR_ATTACHMENT1_EXT: - return BUFFER_BIT_COLOR1; - case GL_COLOR_ATTACHMENT2_EXT: - return BUFFER_BIT_COLOR2; - case GL_COLOR_ATTACHMENT3_EXT: - return BUFFER_BIT_COLOR3; - case GL_COLOR_ATTACHMENT4_EXT: - return BUFFER_BIT_COLOR4; - case GL_COLOR_ATTACHMENT5_EXT: - return BUFFER_BIT_COLOR5; - case GL_COLOR_ATTACHMENT6_EXT: - return BUFFER_BIT_COLOR6; - case GL_COLOR_ATTACHMENT7_EXT: - return BUFFER_BIT_COLOR7; - default: - /* error */ - return BAD_MASK; - } -} - - -/** - * Helper routine used by glReadBuffer. - * Given a GLenum naming a color buffer, return the index of the corresponding - * renderbuffer (a BUFFER_* value). - * return -1 for an invalid buffer. - */ -static GLint -read_buffer_enum_to_index(GLenum buffer) -{ - switch (buffer) { - case GL_FRONT: - return BUFFER_FRONT_LEFT; - case GL_BACK: - return BUFFER_BACK_LEFT; - case GL_RIGHT: - return BUFFER_FRONT_RIGHT; - case GL_FRONT_RIGHT: - return BUFFER_FRONT_RIGHT; - case GL_BACK_RIGHT: - return BUFFER_BACK_RIGHT; - case GL_BACK_LEFT: - return BUFFER_BACK_LEFT; - case GL_LEFT: - return BUFFER_FRONT_LEFT; - case GL_FRONT_LEFT: - return BUFFER_FRONT_LEFT; - case GL_AUX0: - return BUFFER_AUX0; - case GL_AUX1: - return BUFFER_AUX1; - case GL_AUX2: - return BUFFER_AUX2; - case GL_AUX3: - return BUFFER_AUX3; - case GL_COLOR_ATTACHMENT0_EXT: - return BUFFER_COLOR0; - case GL_COLOR_ATTACHMENT1_EXT: - return BUFFER_COLOR1; - case GL_COLOR_ATTACHMENT2_EXT: - return BUFFER_COLOR2; - case GL_COLOR_ATTACHMENT3_EXT: - return BUFFER_COLOR3; - case GL_COLOR_ATTACHMENT4_EXT: - return BUFFER_COLOR4; - case GL_COLOR_ATTACHMENT5_EXT: - return BUFFER_COLOR5; - case GL_COLOR_ATTACHMENT6_EXT: - return BUFFER_COLOR6; - case GL_COLOR_ATTACHMENT7_EXT: - return BUFFER_COLOR7; - default: - /* error */ - return -1; - } -} - - -/** - * Called by glDrawBuffer(). - * Specify which renderbuffer(s) to draw into for the first color output. - * can name zero, one, two or four renderbuffers! - * \sa _mesa_DrawBuffersARB - * - * \param buffer buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc. - * - * Note that the behaviour of this function depends on whether the - * current ctx->DrawBuffer is a window-system framebuffer (Name=0) or - * a user-created framebuffer object (Name!=0). - * In the former case, we update the per-context ctx->Color.DrawBuffer - * state var _and_ the FB's ColorDrawBuffer state. - * In the later case, we update the FB's ColorDrawBuffer state only. - * - * Furthermore, upon a MakeCurrent() or BindFramebuffer() call, if the - * new FB is a window system FB, we need to re-update the FB's - * ColorDrawBuffer state to match the context. This is handled in - * _mesa_update_framebuffer(). - * - * See the GL_EXT_framebuffer_object spec for more info. - */ -void GLAPIENTRY -_mesa_DrawBuffer(GLenum buffer) -{ - GLbitfield destMask; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */ - - if (MESA_VERBOSE & VERBOSE_API) { - _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - } - - if (buffer == GL_NONE) { - destMask = 0x0; - } - else { - const GLbitfield supportedMask - = supported_buffer_bitmask(ctx, ctx->DrawBuffer); - destMask = draw_buffer_enum_to_bitmask(buffer); - if (destMask == BAD_MASK) { - /* totally bogus buffer */ - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer=0x%x)", buffer); - return; - } - destMask &= supportedMask; - if (destMask == 0x0) { - /* none of the named color buffers exist! */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawBuffer(buffer=0x%x)", buffer); - return; - } - } - - /* if we get here, there's no error so set new state */ - _mesa_drawbuffers(ctx, 1, &buffer, &destMask); - - /* - * Call device driver function. - */ - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, 1, &buffer); - else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, buffer); -} - - -/** - * Called by glDrawBuffersARB; specifies the destination color renderbuffers - * for N fragment program color outputs. - * \sa _mesa_DrawBuffer - * \param n number of outputs - * \param buffers array [n] of renderbuffer names. Unlike glDrawBuffer, the - * names cannot specify more than one buffer. For example, - * GL_FRONT_AND_BACK is illegal. - */ -void GLAPIENTRY -_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) -{ - GLint output; - GLbitfield usedBufferMask, supportedMask; - GLbitfield destMask[MAX_DRAW_BUFFERS]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.ARB_draw_buffers) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB"); - return; - } - if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)"); - return; - } - - supportedMask = supported_buffer_bitmask(ctx, ctx->DrawBuffer); - usedBufferMask = 0x0; - - /* complicated error checking... */ - for (output = 0; output < n; output++) { - if (buffers[output] == GL_NONE) { - destMask[output] = 0x0; - } - else { - destMask[output] = draw_buffer_enum_to_bitmask(buffers[output]); - if (destMask[output] == BAD_MASK - || _mesa_bitcount(destMask[output]) > 1) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)"); - return; - } - destMask[output] &= supportedMask; - if (destMask[output] == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawBuffersARB(unsupported buffer)"); - return; - } - if (destMask[output] & usedBufferMask) { - /* can't specify a dest buffer more than once! */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawBuffersARB(duplicated buffer)"); - return; - } - - /* update bitmask */ - usedBufferMask |= destMask[output]; - } - } - - /* OK, if we get here, there were no errors so set the new state */ - _mesa_drawbuffers(ctx, n, buffers, destMask); - - /* - * Call device driver function. - */ - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, n, buffers); - else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, buffers[0]); -} - - -/** - * Helper function to set the GL_DRAW_BUFFER state in the context and - * current FBO. - * - * All error checking will have been done prior to calling this function - * so nothing should go wrong at this point. - * - * \param ctx current context - * \param n number of color outputs to set - * \param buffers array[n] of colorbuffer names, like GL_LEFT. - * \param destMask array[n] of BUFFER_BIT_* bitmasks which correspond to the - * colorbuffer names. (i.e. GL_FRONT_AND_BACK => - * BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT). - */ -void -_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, - const GLbitfield *destMask) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - GLbitfield mask[MAX_DRAW_BUFFERS]; - - if (!destMask) { - /* compute destMask values now */ - const GLbitfield supportedMask = supported_buffer_bitmask(ctx, fb); - GLuint output; - for (output = 0; output < n; output++) { - mask[output] = draw_buffer_enum_to_bitmask(buffers[output]); - ASSERT(mask[output] != BAD_MASK); - mask[output] &= supportedMask; - } - destMask = mask; - } - - if (n == 1) { - GLuint buf, count = 0; - /* init to -1 to help catch errors */ - fb->_ColorDrawBufferIndexes[0] = -1; - for (buf = 0; buf < BUFFER_COUNT; buf++) { - if (destMask[0] & (1 << buf)) { - fb->_ColorDrawBufferIndexes[count] = buf; - count++; - } - } - fb->ColorDrawBuffer[0] = buffers[0]; - fb->_NumColorDrawBuffers = count; - } - else { - GLuint buf, count = 0; - for (buf = 0; buf < n; buf++ ) { - if (destMask[buf]) { - fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; - fb->ColorDrawBuffer[buf] = buffers[buf]; - count = buf + 1; - } - else { - fb->_ColorDrawBufferIndexes[buf] = -1; - } - } - /* set remaining outputs to -1 (GL_NONE) */ - while (buf < ctx->Const.MaxDrawBuffers) { - fb->_ColorDrawBufferIndexes[buf] = -1; - fb->ColorDrawBuffer[buf] = GL_NONE; - buf++; - } - fb->_NumColorDrawBuffers = count; - } - - if (fb->Name == 0) { - /* also set context drawbuffer state */ - GLuint buf; - for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { - ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; - } - } - - ctx->NewState |= _NEW_COLOR; -} - - -/** - * Like \sa _mesa_drawbuffers(), this is a helper function for setting - * GL_READ_BUFFER state in the context and current FBO. - * \param ctx the rendering context - * \param buffer GL_FRONT, GL_BACK, GL_COLOR_ATTACHMENT0, etc. - * \param bufferIndex the numerical index corresponding to 'buffer' - */ -void -_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - - if (fb->Name == 0) { - /* Only update the per-context READ_BUFFER state if we're bound to - * a window-system framebuffer. - */ - ctx->Pixel.ReadBuffer = buffer; - } - - fb->ColorReadBuffer = buffer; - fb->_ColorReadBufferIndex = bufferIndex; - - ctx->NewState |= _NEW_PIXEL; -} - - - -/** - * Called by glReadBuffer to set the source renderbuffer for reading pixels. - * \param mode color buffer such as GL_FRONT, GL_BACK, etc. - */ -void GLAPIENTRY -_mesa_ReadBuffer(GLenum buffer) -{ - struct gl_framebuffer *fb; - GLbitfield supportedMask; - GLint srcBuffer; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - - fb = ctx->ReadBuffer; - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - - if (fb->Name > 0 && buffer == GL_NONE) { - /* This is legal for user-created framebuffer objects */ - srcBuffer = -1; - } - else { - /* general case / window-system framebuffer */ - srcBuffer = read_buffer_enum_to_index(buffer); - if (srcBuffer == -1) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glReadBuffer(buffer=0x%x)", buffer); - return; - } - supportedMask = supported_buffer_bitmask(ctx, fb); - if (((1 << srcBuffer) & supportedMask) == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadBuffer(buffer=0x%x)", buffer); - return; - } - } - - /* OK, all error checking has been completed now */ - - _mesa_readbuffer(ctx, buffer, srcBuffer); - - /* - * Call device driver function. - */ - if (ctx->Driver.ReadBuffer) - (*ctx->Driver.ReadBuffer)(ctx, buffer); -} diff --git a/src/libs/mesa/mesa/main/buffers.h b/src/libs/mesa/mesa/main/buffers.h deleted file mode 100644 index 8a7e7b5c1f..0000000000 --- a/src/libs/mesa/mesa/main/buffers.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * \file buffers.h - * Frame buffer management functions declarations. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 BUFFERS_H -#define BUFFERS_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_DrawBuffer( GLenum mode ); - -extern void GLAPIENTRY -_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers); - -extern void -_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, - const GLbitfield *destMask); - -extern void -_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex); - -extern void GLAPIENTRY -_mesa_ReadBuffer( GLenum mode ); - - -#endif diff --git a/src/libs/mesa/mesa/main/clear.c b/src/libs/mesa/mesa/main/clear.c deleted file mode 100644 index 63388f42ee..0000000000 --- a/src/libs/mesa/mesa/main/clear.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file clear.c - * glClearColor, glClearIndex, glClear() functions. - */ - - - -#include "glheader.h" -#include "clear.h" -#include "context.h" -#include "colormac.h" -#include "state.h" - - - -#if _HAVE_FULL_GL -void GLAPIENTRY -_mesa_ClearIndex( GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Color.ClearIndex == (GLuint) c) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.ClearIndex = (GLuint) c; - - if (!ctx->Visual.rgbMode && ctx->Driver.ClearIndex) { - /* it's OK to call glClearIndex in RGBA mode but it should be a NOP */ - (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex ); - } -} -#endif - - -/** - * Specify the clear values for the color buffers. - * - * \param red red color component. - * \param green green color component. - * \param blue blue color component. - * \param alpha alpha component. - * - * \sa glClearColor(). - * - * Clamps the parameters and updates gl_colorbuffer_attrib::ClearColor. On a - * change, flushes the vertices and notifies the driver via the - * dd_function_table::ClearColor callback. - */ -void GLAPIENTRY -_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) -{ - GLfloat tmp[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - tmp[0] = CLAMP(red, 0.0F, 1.0F); - tmp[1] = CLAMP(green, 0.0F, 1.0F); - tmp[2] = CLAMP(blue, 0.0F, 1.0F); - tmp[3] = CLAMP(alpha, 0.0F, 1.0F); - - if (TEST_EQ_4V(tmp, ctx->Color.ClearColor)) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4V(ctx->Color.ClearColor, tmp); - - if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) { - /* it's OK to call glClearColor in CI mode but it should be a NOP */ - (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); - } -} - - -/** - * Clear buffers. - * - * \param mask bit-mask indicating the buffers to be cleared. - * - * Flushes the vertices and verifies the parameter. If __GLcontextRec::NewState - * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin, - * etc. If the rasterization mode is set to GL_RENDER then requests the driver - * to clear the buffers, via the dd_function_table::Clear callback. - */ -void GLAPIENTRY -_mesa_Clear( GLbitfield mask ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - FLUSH_CURRENT(ctx, 0); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glClear 0x%x\n", mask); - - if (mask & ~(GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT | - GL_ACCUM_BUFFER_BIT)) { - /* invalid bit set */ - _mesa_error( ctx, GL_INVALID_VALUE, "glClear(0x%x)", mask); - return; - } - - if (ctx->NewState) { - _mesa_update_state( ctx ); /* update _Xmin, etc */ - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glClear(incomplete framebuffer)"); - return; - } - - if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 || - ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax || - ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax) - return; - - if (ctx->RenderMode == GL_RENDER) { - GLbitfield bufferMask; - - /* don't clear depth buffer if depth writing disabled */ - if (!ctx->Depth.Mask) - mask &= ~GL_DEPTH_BUFFER_BIT; - - /* Build the bitmask to send to device driver's Clear function. - * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4 - * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the - * BUFFER_BIT_COLORn flags. - */ - bufferMask = 0; - if (mask & GL_COLOR_BUFFER_BIT) { - GLuint i; - for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); - } - } - - if ((mask & GL_DEPTH_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveDepthBuffer) { - bufferMask |= BUFFER_BIT_DEPTH; - } - - if ((mask & GL_STENCIL_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveStencilBuffer) { - bufferMask |= BUFFER_BIT_STENCIL; - } - - if ((mask & GL_ACCUM_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveAccumBuffer) { - bufferMask |= BUFFER_BIT_ACCUM; - } - - ASSERT(ctx->Driver.Clear); - ctx->Driver.Clear(ctx, bufferMask); - } -} diff --git a/src/libs/mesa/mesa/main/clear.h b/src/libs/mesa/mesa/main/clear.h deleted file mode 100644 index 9a54ba14bc..0000000000 --- a/src/libs/mesa/mesa/main/clear.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 CLEAR_H -#define CLEAR_H - - -#include "main/mtypes.h" - - -extern void GLAPIENTRY -_mesa_ClearIndex( GLfloat c ); - -extern void GLAPIENTRY -_mesa_ClearColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -extern void GLAPIENTRY -_mesa_Clear( GLbitfield mask ); - - -#endif diff --git a/src/libs/mesa/mesa/main/clip.c b/src/libs/mesa/mesa/main/clip.c deleted file mode 100644 index 43ef55ee3b..0000000000 --- a/src/libs/mesa/mesa/main/clip.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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. - */ - - -#include "glheader.h" -#include "clip.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" - -#include "math/m_xform.h" -#include "math/m_matrix.h" - - - -/**********************************************************************/ -/* Get/Set User clip-planes. */ -/**********************************************************************/ - - - -void GLAPIENTRY -_mesa_ClipPlane( GLenum plane, const GLdouble *eq ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint p; - GLfloat equation[4]; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - p = (GLint) plane - (GLint) GL_CLIP_PLANE0; - if (p < 0 || p >= (GLint) ctx->Const.MaxClipPlanes) { - _mesa_error( ctx, GL_INVALID_ENUM, "glClipPlane" ); - return; - } - - equation[0] = (GLfloat) eq[0]; - equation[1] = (GLfloat) eq[1]; - equation[2] = (GLfloat) eq[2]; - equation[3] = (GLfloat) eq[3]; - - /* - * The equation is transformed by the transpose of the inverse of the - * current modelview matrix and stored in the resulting eye coordinates. - * - * KW: Eqn is then transformed to the current clip space, where user - * clipping now takes place. The clip-space equations are recalculated - * whenever the projection matrix changes. - */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - - _mesa_transform_vector( equation, equation, - ctx->ModelviewMatrixStack.Top->inv ); - - if (TEST_EQ_4V(ctx->Transform.EyeUserPlane[p], equation)) - return; - - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - COPY_4FV(ctx->Transform.EyeUserPlane[p], equation); - - /* Update derived state. This state also depends on the projection - * matrix, and is recalculated on changes to the projection matrix by - * code in _mesa_update_state(). - */ - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top)) - _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); - - _mesa_transform_vector( ctx->Transform._ClipUserPlane[p], - ctx->Transform.EyeUserPlane[p], - ctx->ProjectionMatrixStack.Top->inv ); - } - - if (ctx->Driver.ClipPlane) - ctx->Driver.ClipPlane( ctx, plane, equation ); -} - - -void GLAPIENTRY -_mesa_GetClipPlane( GLenum plane, GLdouble *equation ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint p; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - p = (GLint) (plane - GL_CLIP_PLANE0); - if (p < 0 || p >= (GLint) ctx->Const.MaxClipPlanes) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetClipPlane" ); - return; - } - - equation[0] = (GLdouble) ctx->Transform.EyeUserPlane[p][0]; - equation[1] = (GLdouble) ctx->Transform.EyeUserPlane[p][1]; - equation[2] = (GLdouble) ctx->Transform.EyeUserPlane[p][2]; - equation[3] = (GLdouble) ctx->Transform.EyeUserPlane[p][3]; -} - -void GLAPIENTRY -_mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (cap) { - case GL_CULL_VERTEX_EYE_POSITION_EXT: - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - COPY_4FV(ctx->Transform.CullEyePos, v); - - _mesa_transform_vector( ctx->Transform.CullObjPos, - ctx->Transform.CullEyePos, - ctx->ModelviewMatrixStack.Top->inv ); - break; - - case GL_CULL_VERTEX_OBJECT_POSITION_EXT: - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - COPY_4FV(ctx->Transform.CullObjPos, v); - - _mesa_transform_vector( ctx->Transform.CullEyePos, - ctx->Transform.CullObjPos, - ctx->ModelviewMatrixStack.Top->m ); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glCullParameterfvEXT" ); - } -} - -void GLAPIENTRY -_mesa_CullParameterdvEXT (GLenum cap, GLdouble *v) -{ - GLfloat f[4]; - - f[0] = (GLfloat)v[0]; - f[1] = (GLfloat)v[1]; - f[2] = (GLfloat)v[2]; - f[3] = (GLfloat)v[3]; - - _mesa_CullParameterfvEXT(cap, f); -} - diff --git a/src/libs/mesa/mesa/main/clip.h b/src/libs/mesa/mesa/main/clip.h deleted file mode 100644 index d53afb45bd..0000000000 --- a/src/libs/mesa/mesa/main/clip.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * \file clip.h - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 CLIP_H -#define CLIP_H - -#include "mtypes.h" - -extern void GLAPIENTRY -_mesa_ClipPlane( GLenum plane, const GLdouble *equation ); - -extern void GLAPIENTRY -_mesa_GetClipPlane( GLenum plane, GLdouble *equation ); - -extern void GLAPIENTRY -_mesa_CullParameterfvEXT (GLenum cap, GLfloat *v); - -extern void GLAPIENTRY -_mesa_CullParameterdvEXT (GLenum cap, GLdouble *v); - - -#endif diff --git a/src/libs/mesa/mesa/main/colormac.h b/src/libs/mesa/mesa/main/colormac.h deleted file mode 100644 index 74692e9a98..0000000000 --- a/src/libs/mesa/mesa/main/colormac.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file colormac.h - * Color-related macros - */ - - -#ifndef COLORMAC_H -#define COLORMAC_H - - -#include "imports.h" -#include "config.h" -#include "macros.h" - - -/** \def BYTE_TO_CHAN - * Convert from GLbyte to GLchan */ - -/** \def UBYTE_TO_CHAN - * Convert from GLubyte to GLchan */ - -/** \def SHORT_TO_CHAN - * Convert from GLshort to GLchan */ - -/** \def USHORT_TO_CHAN - * Convert from GLushort to GLchan */ - -/** \def INT_TO_CHAN - * Convert from GLint to GLchan */ - -/** \def UINT_TO_CHAN - * Convert from GLuint to GLchan */ - -/** \def CHAN_TO_UBYTE - * Convert from GLchan to GLubyte */ - -/** \def CHAN_TO_FLOAT - * Convert from GLchan to GLfloat */ - -/** \def CLAMPED_FLOAT_TO_CHAN - * Convert from GLclampf to GLchan */ - -/** \def UNCLAMPED_FLOAT_TO_CHAN - * Convert from GLfloat to GLchan */ - -/** \def COPY_CHAN4 - * Copy a GLchan[4] array */ - -/** \def CHAN_PRODUCT - * Scaled product (usually approximated) between two GLchan arguments */ - -#if CHAN_BITS == 8 - -#define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (GLchan) (b)) -#define UBYTE_TO_CHAN(b) (b) -#define SHORT_TO_CHAN(s) ((s) < 0 ? 0 : (GLchan) ((s) >> 7)) -#define USHORT_TO_CHAN(s) ((GLchan) ((s) >> 8)) -#define INT_TO_CHAN(i) ((i) < 0 ? 0 : (GLchan) ((i) >> 23)) -#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 24)) - -#define CHAN_TO_UBYTE(c) (c) -#define CHAN_TO_FLOAT(c) UBYTE_TO_FLOAT(c) - -#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_UBYTE(c, f) -#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_UBYTE(c, f) - -#define COPY_CHAN4(DST, SRC) COPY_4UBV(DST, SRC) - -#define CHAN_PRODUCT(a, b) ((GLubyte) (((GLint)(a) * ((GLint)(b) + 1)) >> 8)) - -#elif CHAN_BITS == 16 - -#define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (((GLchan) (b)) * 516)) -#define UBYTE_TO_CHAN(b) ((((GLchan) (b)) << 8) | ((GLchan) (b))) -#define SHORT_TO_CHAN(s) ((s) < 0 ? 0 : (GLchan) (s)) -#define USHORT_TO_CHAN(s) (s) -#define INT_TO_CHAN(i) ((i) < 0 ? 0 : (GLchan) ((i) >> 15)) -#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 16)) - -#define CHAN_TO_UBYTE(c) ((c) >> 8) -#define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF))) - -#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_USHORT(c, f) -#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_USHORT(c, f) - -#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) - -#define CHAN_PRODUCT(a, b) ((GLchan) ((((GLuint) (a)) * ((GLuint) (b))) / 65535)) - -#elif CHAN_BITS == 32 - -/* XXX floating-point color channels not fully thought-out */ -#define BYTE_TO_CHAN(b) ((GLfloat) ((b) * (1.0F / 127.0F))) -#define UBYTE_TO_CHAN(b) ((GLfloat) ((b) * (1.0F / 255.0F))) -#define SHORT_TO_CHAN(s) ((GLfloat) ((s) * (1.0F / 32767.0F))) -#define USHORT_TO_CHAN(s) ((GLfloat) ((s) * (1.0F / 65535.0F))) -#define INT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 2147483647.0F))) -#define UINT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 4294967295.0F))) - -#define CHAN_TO_UBYTE(c) FLOAT_TO_UBYTE(c) -#define CHAN_TO_FLOAT(c) (c) - -#define CLAMPED_FLOAT_TO_CHAN(c, f) c = (f) -#define UNCLAMPED_FLOAT_TO_CHAN(c, f) c = (f) - -#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) - -#define CHAN_PRODUCT(a, b) ((a) * (b)) - -#else - -#error unexpected CHAN_BITS size - -#endif - - -/** - * Convert 3 channels at once. - * - * \param dst pointer to destination GLchan[3] array. - * \param f pointer to source GLfloat[3] array. - * - * \sa #UNCLAMPED_FLOAT_TO_CHAN. - */ -#define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f) \ -do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ -} while (0) - - -/** - * Convert 4 channels at once. - * - * \param dst pointer to destination GLchan[4] array. - * \param f pointer to source GLfloat[4] array. - * - * \sa #UNCLAMPED_FLOAT_TO_CHAN. - */ -#define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \ -do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[3], f[3]); \ -} while (0) - - - -/** - * \name Generic color packing macros. All inputs should be GLubytes. - * - * \todo We may move these into texstore.h at some point. - */ -/*@{*/ - -#define PACK_COLOR_8888( X, Y, Z, W ) \ - (((X) << 24) | ((Y) << 16) | ((Z) << 8) | (W)) - -#define PACK_COLOR_8888_REV( X, Y, Z, W ) \ - (((W) << 24) | ((Z) << 16) | ((Y) << 8) | (X)) - -#define PACK_COLOR_888( X, Y, Z ) \ - (((X) << 16) | ((Y) << 8) | (Z)) - -#define PACK_COLOR_565( X, Y, Z ) \ - ((((X) & 0xf8) << 8) | (((Y) & 0xfc) << 3) | (((Z) & 0xf8) >> 3)) - -#define PACK_COLOR_565_REV( X, Y, Z ) \ - (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5)) - -#define PACK_COLOR_5551( R, G, B, A ) \ - ((((R) & 0xf8) << 8) | (((G) & 0xf8) << 3) | (((B) & 0xf8) >> 2) | \ - ((A) ? 1 : 0)) - -#define PACK_COLOR_1555( A, B, G, R ) \ - ((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \ - ((A) ? 0x8000 : 0)) - -#define PACK_COLOR_1555_REV( A, B, G, R ) \ - ((((B) & 0xf8) >> 1) | (((G) & 0xc0) >> 6) | (((G) & 0x38) << 10) | (((R) & 0xf8) << 5) | \ - ((A) ? 0x80 : 0)) - -#define PACK_COLOR_4444( R, G, B, A ) \ - ((((R) & 0xf0) << 8) | (((G) & 0xf0) << 4) | ((B) & 0xf0) | ((A) >> 4)) - -#define PACK_COLOR_4444_REV( R, G, B, A ) \ - ((((B) & 0xf0) << 8) | (((A) & 0xf0) << 4) | ((R) & 0xf0) | ((G) >> 4)) - -#define PACK_COLOR_88( L, A ) \ - (((L) << 8) | (A)) - -#define PACK_COLOR_88_REV( L, A ) \ - (((A) << 8) | (L)) - -#define PACK_COLOR_332( R, G, B ) \ - (((R) & 0xe0) | (((G) & 0xe0) >> 3) | (((B) & 0xc0) >> 6)) - -#define PACK_COLOR_233( B, G, R ) \ - (((B) & 0xc0) | (((G) & 0xe0) >> 2) | (((R) & 0xe0) >> 5)) - -/*@}*/ - - -#endif /* COLORMAC_H */ diff --git a/src/libs/mesa/mesa/main/colortab.c b/src/libs/mesa/mesa/main/colortab.c deleted file mode 100644 index bd9cf438b4..0000000000 --- a/src/libs/mesa/mesa/main/colortab.c +++ /dev/null @@ -1,1136 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "colortab.h" -#include "context.h" -#include "image.h" -#include "macros.h" -#include "state.h" -#include "teximage.h" - - -/** - * Given an internalFormat token passed to glColorTable, - * return the corresponding base format. - * Return -1 if invalid token. - */ -static GLint -base_colortab_format( GLenum format ) -{ - switch (format) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_ALPHA; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return GL_INTENSITY; - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return GL_RGBA; - default: - return -1; /* error */ - } -} - - - -/** - * Examine table's format and set the component sizes accordingly. - */ -static void -set_component_sizes( struct gl_color_table *table ) -{ - /* assuming the ubyte table */ - const GLubyte sz = 8; - - switch (table->_BaseFormat) { - case GL_ALPHA: - table->RedSize = 0; - table->GreenSize = 0; - table->BlueSize = 0; - table->AlphaSize = sz; - table->IntensitySize = 0; - table->LuminanceSize = 0; - break; - case GL_LUMINANCE: - table->RedSize = 0; - table->GreenSize = 0; - table->BlueSize = 0; - table->AlphaSize = 0; - table->IntensitySize = 0; - table->LuminanceSize = sz; - break; - case GL_LUMINANCE_ALPHA: - table->RedSize = 0; - table->GreenSize = 0; - table->BlueSize = 0; - table->AlphaSize = sz; - table->IntensitySize = 0; - table->LuminanceSize = sz; - break; - case GL_INTENSITY: - table->RedSize = 0; - table->GreenSize = 0; - table->BlueSize = 0; - table->AlphaSize = 0; - table->IntensitySize = sz; - table->LuminanceSize = 0; - break; - case GL_RGB: - table->RedSize = sz; - table->GreenSize = sz; - table->BlueSize = sz; - table->AlphaSize = 0; - table->IntensitySize = 0; - table->LuminanceSize = 0; - break; - case GL_RGBA: - table->RedSize = sz; - table->GreenSize = sz; - table->BlueSize = sz; - table->AlphaSize = sz; - table->IntensitySize = 0; - table->LuminanceSize = 0; - break; - default: - _mesa_problem(NULL, "unexpected format in set_component_sizes"); - } -} - - - -/** - * Update/replace all or part of a color table. Helper function - * used by _mesa_ColorTable() and _mesa_ColorSubTable(). - * The table->Table buffer should already be allocated. - * \param start first entry to update - * \param count number of entries to update - * \param format format of user-provided table data - * \param type datatype of user-provided table data - * \param data user-provided table data - * \param [rgba]Scale - RGBA scale factors - * \param [rgba]Bias - RGBA bias factors - */ -static void -store_colortable_entries(GLcontext *ctx, struct gl_color_table *table, - GLsizei start, GLsizei count, - GLenum format, GLenum type, const GLvoid *data, - GLfloat rScale, GLfloat rBias, - GLfloat gScale, GLfloat gBias, - GLfloat bScale, GLfloat bBias, - GLfloat aScale, GLfloat aBias) -{ - if (ctx->Unpack.BufferObj->Name) { - /* Get/unpack the color table data from a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, count, 1, 1, - format, type, data)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glColor[Sub]Table(bad PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glColor[Sub]Table(PBO mapped)"); - return; - } - data = ADD_POINTERS(buf, data); - } - - - { - /* convert user-provided data to GLfloat values */ - GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4]; - GLfloat *tableF; - GLint i; - - _mesa_unpack_color_span_float(ctx, - count, /* number of pixels */ - table->_BaseFormat, /* dest format */ - tempTab, /* dest address */ - format, type, /* src format/type */ - data, /* src data */ - &ctx->Unpack, - IMAGE_CLAMP_BIT); /* transfer ops */ - - /* the destination */ - tableF = table->TableF; - - /* Apply scale & bias & clamp now */ - switch (table->_BaseFormat) { - case GL_INTENSITY: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F); - } - break; - case GL_LUMINANCE: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F); - } - break; - case GL_ALPHA: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j] = CLAMP(tempTab[i] * aScale + aBias, 0.0F, 1.0F); - } - break; - case GL_LUMINANCE_ALPHA: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j*2+0] = CLAMP(tempTab[i*2+0] * rScale + rBias, 0.0F, 1.0F); - tableF[j*2+1] = CLAMP(tempTab[i*2+1] * aScale + aBias, 0.0F, 1.0F); - } - break; - case GL_RGB: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j*3+0] = CLAMP(tempTab[i*3+0] * rScale + rBias, 0.0F, 1.0F); - tableF[j*3+1] = CLAMP(tempTab[i*3+1] * gScale + gBias, 0.0F, 1.0F); - tableF[j*3+2] = CLAMP(tempTab[i*3+2] * bScale + bBias, 0.0F, 1.0F); - } - break; - case GL_RGBA: - for (i = 0; i < count; i++) { - GLuint j = start + i; - tableF[j*4+0] = CLAMP(tempTab[i*4+0] * rScale + rBias, 0.0F, 1.0F); - tableF[j*4+1] = CLAMP(tempTab[i*4+1] * gScale + gBias, 0.0F, 1.0F); - tableF[j*4+2] = CLAMP(tempTab[i*4+2] * bScale + bBias, 0.0F, 1.0F); - tableF[j*4+3] = CLAMP(tempTab[i*4+3] * aScale + aBias, 0.0F, 1.0F); - } - break; - default: - _mesa_problem(ctx, "Bad format in store_colortable_entries"); - return; - } - } - - /* update the ubyte table */ - { - const GLint comps = _mesa_components_in_format(table->_BaseFormat); - const GLfloat *tableF = table->TableF + start * comps; - GLubyte *tableUB = table->TableUB + start * comps; - GLint i; - for (i = 0; i < count * comps; i++) { - CLAMPED_FLOAT_TO_UBYTE(tableUB[i], tableF[i]); - } - } - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } -} - - - -void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalFormat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *data ) -{ - static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; - static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_texture_object *texObj = NULL; - struct gl_color_table *table = NULL; - GLboolean proxy = GL_FALSE; - GLint baseFormat; - const GLfloat *scale = one, *bias = zero; - GLint comps; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */ - - switch (target) { - case GL_SHARED_TEXTURE_PALETTE_EXT: - table = &ctx->Texture.Palette; - break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - proxy = GL_TRUE; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); - return; - } - table = &(texUnit->ColorTable); - scale = ctx->Pixel.TextureColorTableScale; - bias = ctx->Pixel.TextureColorTableBias; - break; - case GL_PROXY_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); - return; - } - table = &(texUnit->ProxyColorTable); - proxy = GL_TRUE; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - proxy = GL_TRUE; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - proxy = GL_TRUE; - break; - default: - /* try texture targets */ - { - struct gl_texture_object *texobj - = _mesa_select_tex_object(ctx, texUnit, target); - if (texobj) { - table = &texobj->Palette; - proxy = _mesa_is_proxy_texture(target); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); - return; - } - } - } - - assert(table); - - if (!_mesa_is_legal_format_and_type(ctx, format, type) || - format == GL_INTENSITY) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTable(format or type)"); - return; - } - - baseFormat = base_colortab_format(internalFormat); - if (baseFormat < 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)"); - return; - } - - if (width < 0 || (width != 0 && !_mesa_is_pow_two(width))) { - /* error */ - if (proxy) { - table->Size = 0; - table->InternalFormat = (GLenum) 0; - table->_BaseFormat = (GLenum) 0; - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glColorTable(width=%d)", width); - } - return; - } - - if (width > (GLsizei) ctx->Const.MaxColorTableSize) { - if (proxy) { - table->Size = 0; - table->InternalFormat = (GLenum) 0; - table->_BaseFormat = (GLenum) 0; - } - else { - _mesa_error(ctx, GL_TABLE_TOO_LARGE, "glColorTable(width)"); - } - return; - } - - table->Size = width; - table->InternalFormat = internalFormat; - table->_BaseFormat = (GLenum) baseFormat; - - comps = _mesa_components_in_format(table->_BaseFormat); - assert(comps > 0); /* error should have been caught sooner */ - - if (!proxy) { - _mesa_free_colortable_data(table); - - if (width > 0) { - table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat)); - table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte)); - - if (!table->TableF || !table->TableUB) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable"); - return; - } - - store_colortable_entries(ctx, table, - 0, width, /* start, count */ - format, type, data, - scale[0], bias[0], - scale[1], bias[1], - scale[2], bias[2], - scale[3], bias[3]); - } - } /* proxy */ - - /* do this after the table's Type and Format are set */ - set_component_sizes(table); - - if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) { - /* texture object palette, texObj==NULL means the shared palette */ - if (ctx->Driver.UpdateTexturePalette) { - (*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); - } - } - - ctx->NewState |= _NEW_PIXEL; -} - - - -void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *data ) -{ - static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; - static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_texture_object *texObj = NULL; - struct gl_color_table *table = NULL; - const GLfloat *scale = one, *bias = zero; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_SHARED_TEXTURE_PALETTE_EXT: - table = &ctx->Texture.Palette; - break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); - return; - } - table = &(texUnit->ColorTable); - scale = ctx->Pixel.TextureColorTableScale; - bias = ctx->Pixel.TextureColorTableBias; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; - default: - /* try texture targets */ - texObj = _mesa_select_tex_object(ctx, texUnit, target); - if (texObj && !_mesa_is_proxy_texture(target)) { - table = &texObj->Palette; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); - return; - } - } - - assert(table); - - if (!_mesa_is_legal_format_and_type(ctx, format, type) || - format == GL_INTENSITY) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glColorSubTable(format or type)"); - return; - } - - if (count < 1) { - _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); - return; - } - - /* error should have been caught sooner */ - assert(_mesa_components_in_format(table->_BaseFormat) > 0); - - if (start + count > (GLint) table->Size) { - _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); - return; - } - - if (!table->TableF || !table->TableUB) { - /* a GL_OUT_OF_MEMORY error would have been recorded previously */ - return; - } - - store_colortable_entries(ctx, table, start, count, - format, type, data, - scale[0], bias[0], - scale[1], bias[1], - scale[2], bias[2], - scale[3], bias[3]); - - if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) { - /* per-texture object palette */ - if (ctx->Driver.UpdateTexturePalette) { - (*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); - } - } - - ctx->NewState |= _NEW_PIXEL; -} - - - -void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - /* Select buffer to read from */ - ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); -} - - - -void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width ); -} - - - -void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *data ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_color_table *table = NULL; - GLfloat rgba[MAX_COLOR_TABLE_SIZE][4]; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - switch (target) { - case GL_SHARED_TEXTURE_PALETTE_EXT: - table = &ctx->Texture.Palette; - break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); - return; - } - table = &(texUnit->ColorTable); - break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; - default: - /* try texture targets */ - { - struct gl_texture_object *texobj - = _mesa_select_tex_object(ctx, texUnit, target); - if (texobj && !_mesa_is_proxy_texture(target)) { - table = &texobj->Palette; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); - return; - } - } - } - - ASSERT(table); - - if (table->Size <= 0) { - return; - } - - switch (table->_BaseFormat) { - case GL_ALPHA: - { - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = table->TableF[i]; - } - } - break; - case GL_LUMINANCE: - { - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = table->TableF[i]; - rgba[i][ACOMP] = 1.0F; - } - } - break; - case GL_LUMINANCE_ALPHA: - { - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = table->TableF[i*2+0]; - rgba[i][ACOMP] = table->TableF[i*2+1]; - } - } - break; - case GL_INTENSITY: - { - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = table->TableF[i]; - } - } - break; - case GL_RGB: - { - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = table->TableF[i*3+0]; - rgba[i][GCOMP] = table->TableF[i*3+1]; - rgba[i][BCOMP] = table->TableF[i*3+2]; - rgba[i][ACOMP] = 1.0F; - } - } - break; - case GL_RGBA: - _mesa_memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); - break; - default: - _mesa_problem(ctx, "bad table format in glGetColorTable"); - return; - } - - if (ctx->Pack.BufferObj->Name) { - /* pack color table into PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Pack, table->Size, 1, 1, - format, type, data)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetColorTable(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetColorTable(PBO is mapped)"); - return; - } - data = ADD_POINTERS(buf, data); - } - - _mesa_pack_rgba_span_float(ctx, table->Size, rgba, - format, type, data, &ctx->Pack, 0x0); - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - - -void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GLfloat *scale, *bias; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - scale = ctx->Pixel.TextureColorTableScale; - bias = ctx->Pixel.TextureColorTableBias; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)"); - return; - } - - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(scale, params); - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(bias, params); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; -} - - - -void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GLfloat fparams[4]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI) { - /* four values */ - fparams[0] = (GLfloat) params[0]; - fparams[1] = (GLfloat) params[1]; - fparams[2] = (GLfloat) params[2]; - fparams[3] = (GLfloat) params[3]; - } - else { - /* one values */ - fparams[0] = (GLfloat) params[0]; - } - _mesa_ColorTableParameterfv(target, pname, fparams); -} - - - -void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_color_table *table = NULL; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_SHARED_TEXTURE_PALETTE_EXT: - table = &ctx->Texture.Palette; - break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]); - return; - } - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); - return; - } - table = &(texUnit->ColorTable); - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.TextureColorTableScale); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.TextureColorTableBias); - return; - } - break; - case GL_PROXY_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); - return; - } - table = &(texUnit->ProxyColorTable); - break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]); - return; - } - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]); - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - COPY_4V(params, ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX]); - return; - } - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; - default: - /* try texture targets */ - { - struct gl_texture_object *texobj - = _mesa_select_tex_object(ctx, texUnit, target); - if (texobj) { - table = &texobj->Palette; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetColorTableParameterfv(target)"); - return; - } - } - } - - assert(table); - - switch (pname) { - case GL_COLOR_TABLE_FORMAT: - *params = (GLfloat) table->InternalFormat; - break; - case GL_COLOR_TABLE_WIDTH: - *params = (GLfloat) table->Size; - break; - case GL_COLOR_TABLE_RED_SIZE: - *params = (GLfloat) table->RedSize; - break; - case GL_COLOR_TABLE_GREEN_SIZE: - *params = (GLfloat) table->GreenSize; - break; - case GL_COLOR_TABLE_BLUE_SIZE: - *params = (GLfloat) table->BlueSize; - break; - case GL_COLOR_TABLE_ALPHA_SIZE: - *params = (GLfloat) table->AlphaSize; - break; - case GL_COLOR_TABLE_LUMINANCE_SIZE: - *params = (GLfloat) table->LuminanceSize; - break; - case GL_COLOR_TABLE_INTENSITY_SIZE: - *params = (GLfloat) table->IntensitySize; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(pname)" ); - return; - } -} - - - -void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_color_table *table = NULL; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_SHARED_TEXTURE_PALETTE_EXT: - table = &ctx->Texture.Palette; - break; - case GL_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_PRECONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION]; - params[0] = (GLint) scale[0]; - params[1] = (GLint) scale[1]; - params[2] = (GLint) scale[2]; - params[3] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_PRECONVOLUTION]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); - return; - } - table = &(texUnit->ColorTable); - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - params[0] = (GLint) ctx->Pixel.TextureColorTableScale[0]; - params[1] = (GLint) ctx->Pixel.TextureColorTableScale[1]; - params[2] = (GLint) ctx->Pixel.TextureColorTableScale[2]; - params[3] = (GLint) ctx->Pixel.TextureColorTableScale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - params[0] = (GLint) ctx->Pixel.TextureColorTableBias[0]; - params[1] = (GLint) ctx->Pixel.TextureColorTableBias[1]; - params[2] = (GLint) ctx->Pixel.TextureColorTableBias[2]; - params[3] = (GLint) ctx->Pixel.TextureColorTableBias[3]; - return; - } - break; - case GL_PROXY_TEXTURE_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_texture_color_table) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); - return; - } - table = &(texUnit->ProxyColorTable); - break; - case GL_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCONVOLUTION]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION]; - params[0] = (GLint) scale[0]; - params[1] = (GLint) scale[1]; - params[2] = (GLint) scale[2]; - params[3] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX]; - if (pname == GL_COLOR_TABLE_SCALE_SGI) { - GLfloat *scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - params[0] = (GLint) scale[0]; - params[0] = (GLint) scale[1]; - params[0] = (GLint) scale[2]; - params[0] = (GLint) scale[3]; - return; - } - else if (pname == GL_COLOR_TABLE_BIAS_SGI) { - GLfloat *bias = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX]; - params[0] = (GLint) bias[0]; - params[1] = (GLint) bias[1]; - params[2] = (GLint) bias[2]; - params[3] = (GLint) bias[3]; - return; - } - break; - case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: - table = &ctx->ProxyColorTable[COLORTABLE_POSTCOLORMATRIX]; - break; - default: - /* Try texture targets */ - { - struct gl_texture_object *texobj - = _mesa_select_tex_object(ctx, texUnit, target); - if (texobj) { - table = &texobj->Palette; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetColorTableParameteriv(target)"); - return; - } - } - } - - assert(table); - - switch (pname) { - case GL_COLOR_TABLE_FORMAT: - *params = table->InternalFormat; - break; - case GL_COLOR_TABLE_WIDTH: - *params = table->Size; - break; - case GL_COLOR_TABLE_RED_SIZE: - *params = table->RedSize; - break; - case GL_COLOR_TABLE_GREEN_SIZE: - *params = table->GreenSize; - break; - case GL_COLOR_TABLE_BLUE_SIZE: - *params = table->BlueSize; - break; - case GL_COLOR_TABLE_ALPHA_SIZE: - *params = table->AlphaSize; - break; - case GL_COLOR_TABLE_LUMINANCE_SIZE: - *params = table->LuminanceSize; - break; - case GL_COLOR_TABLE_INTENSITY_SIZE: - *params = table->IntensitySize; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(pname)" ); - return; - } -} - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - - -void -_mesa_init_colortable( struct gl_color_table *p ) -{ - p->TableF = NULL; - p->TableUB = NULL; - p->Size = 0; - p->InternalFormat = GL_RGBA; -} - - - -void -_mesa_free_colortable_data( struct gl_color_table *p ) -{ - if (p->TableF) { - _mesa_free(p->TableF); - p->TableF = NULL; - } - if (p->TableUB) { - _mesa_free(p->TableUB); - p->TableUB = NULL; - } -} - - -/* - * Initialize all colortables for a context. - */ -void -_mesa_init_colortables( GLcontext * ctx ) -{ - GLuint i; - for (i = 0; i < COLORTABLE_MAX; i++) { - _mesa_init_colortable(&ctx->ColorTable[i]); - _mesa_init_colortable(&ctx->ProxyColorTable[i]); - } -} - - -/* - * Free all colortable data for a context - */ -void -_mesa_free_colortables_data( GLcontext *ctx ) -{ - GLuint i; - for (i = 0; i < COLORTABLE_MAX; i++) { - _mesa_free_colortable_data(&ctx->ColorTable[i]); - _mesa_free_colortable_data(&ctx->ProxyColorTable[i]); - } -} diff --git a/src/libs/mesa/mesa/main/colortab.h b/src/libs/mesa/mesa/main/colortab.h deleted file mode 100644 index b6ff737a65..0000000000 --- a/src/libs/mesa/mesa/main/colortab.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 COLORTAB_H -#define COLORTAB_H - - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *table ); - -extern void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *table ); - -extern void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -extern void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -extern void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); - - - -extern void -_mesa_init_colortable( struct gl_color_table *table ); - -extern void -_mesa_free_colortable_data( struct gl_color_table *table ); - -extern void -_mesa_init_colortables( GLcontext *ctx ); - -extern void -_mesa_free_colortables_data( GLcontext *ctx ); - -#else - -/** No-op */ -#define _mesa_init_colortable( p ) ((void) 0) - -/** No-op */ -#define _mesa_free_colortable_data( p ) ((void) 0) - -/** No-op */ -#define _mesa_init_colortables( p ) ((void)0) - -/** No-op */ -#define _mesa_free_colortables_data( p ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/config.h b/src/libs/mesa/mesa/main/config.h deleted file mode 100644 index f74576e10a..0000000000 --- a/src/libs/mesa/mesa/main/config.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file config.h - * Tunable configuration parameters. - */ - -#ifndef MESA_CONFIG_H_INCLUDED -#define MESA_CONFIG_H_INCLUDED - - -#include "main/mfeatures.h" - - -/** - * \name OpenGL implementation limits - */ -/*@{*/ - -/** Maximum modelview matrix stack depth */ -#define MAX_MODELVIEW_STACK_DEPTH 32 - -/** Maximum projection matrix stack depth */ -#define MAX_PROJECTION_STACK_DEPTH 32 - -/** Maximum texture matrix stack depth */ -#define MAX_TEXTURE_STACK_DEPTH 10 - -/** Maximum color matrix stack depth */ -#define MAX_COLOR_STACK_DEPTH 4 - -/** Maximum attribute stack depth */ -#define MAX_ATTRIB_STACK_DEPTH 16 - -/** Maximum client attribute stack depth */ -#define MAX_CLIENT_ATTRIB_STACK_DEPTH 16 - -/** Maximum recursion depth of display list calls */ -#define MAX_LIST_NESTING 64 - -/** Maximum number of lights */ -#define MAX_LIGHTS 8 - -/** Maximum user-defined clipping planes */ -#define MAX_CLIP_PLANES 6 - -/** Maximum pixel map lookup table size */ -#define MAX_PIXEL_MAP_TABLE 256 - -/** Maximum number of auxillary color buffers */ -#define MAX_AUX_BUFFERS 4 - -/** Maximum order (degree) of curves */ -#ifdef AMIGA -# define MAX_EVAL_ORDER 12 -#else -# define MAX_EVAL_ORDER 30 -#endif - -/** Maximum Name stack depth */ -#define MAX_NAME_STACK_DEPTH 64 - -/** Minimum point size */ -#define MIN_POINT_SIZE 1.0 -/** Maximum point size */ -#define MAX_POINT_SIZE 60.0 -/** Point size granularity */ -#define POINT_SIZE_GRANULARITY 0.1 - -/** Minimum line width */ -#define MIN_LINE_WIDTH 1.0 -/** Maximum line width */ -#define MAX_LINE_WIDTH 10.0 -/** Line width granularity */ -#define LINE_WIDTH_GRANULARITY 0.1 - -/** Max texture palette / color table size */ -#define MAX_COLOR_TABLE_SIZE 256 - -/** Number of 1D/2D texture mipmap levels */ -#define MAX_TEXTURE_LEVELS 12 - -/** Number of 3D texture mipmap levels */ -#define MAX_3D_TEXTURE_LEVELS 9 - -/** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */ -#define MAX_CUBE_TEXTURE_LEVELS 12 - -/** Maximum rectangular texture size - GL_NV_texture_rectangle */ -#define MAX_TEXTURE_RECT_SIZE 2048 - -/** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ -#define MAX_ARRAY_TEXTURE_LAYERS 64 - -/** - * Max number of texture coordinate units. This mainly just applies to - * the fixed-function vertex code. This will be difficult to raise above - * eight because of various vertex attribute bitvectors. - */ -#define MAX_TEXTURE_COORD_UNITS 8 - -/** - * Max number of texture image units. Also determines number of texture - * samplers in shaders. - */ -#define MAX_TEXTURE_IMAGE_UNITS 16 - -/** - * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS. - * This value is only used for dimensioning arrays. - * Either MAX_TEXTURE_COORD_UNITS or MAX_TEXTURE_IMAGE_UNITS (or the - * corresponding ctx->Const.MaxTextureCoord/ImageUnits fields) should be - * used almost everywhere else. - */ -#define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS) - - -/** - * Maximum viewport/image width. Must accomodate all texture sizes too. - */ -#define MAX_WIDTH 4096 -/** Maximum viewport/image height */ -#define MAX_HEIGHT 4096 - -/** Maxmimum size for CVA. May be overridden by the drivers. */ -#define MAX_ARRAY_LOCK_SIZE 3000 - -/** Subpixel precision for antialiasing, window coordinate snapping */ -#define SUB_PIXEL_BITS 4 - -/** Size of histogram tables */ -#define HISTOGRAM_TABLE_SIZE 256 - -/** Max convolution filter width */ -#define MAX_CONVOLUTION_WIDTH 9 -/** Max convolution filter height */ -#define MAX_CONVOLUTION_HEIGHT 9 - -/** For GL_ARB_texture_compression */ -#define MAX_COMPRESSED_TEXTURE_FORMATS 25 - -/** For GL_EXT_texture_filter_anisotropic */ -#define MAX_TEXTURE_MAX_ANISOTROPY 16.0 - -/** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */ -#define MAX_TEXTURE_LOD_BIAS 11.0 - -/** For GL_ARB_vertex_program */ -/*@{*/ -#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1 -#define MAX_VERTEX_PROGRAM_ATTRIBS 16 -/*@}*/ - -/** For GL_ARB_fragment_program */ -/*@{*/ -#define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0 -#define MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS 48 -#define MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS 24 -#define MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS 4 -/*@}*/ - -/** For any program target/extension */ -/*@{*/ -#define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */ -#define MAX_PROGRAM_ENV_PARAMS 128 -#define MAX_PROGRAM_MATRICES 8 -#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 -#define MAX_PROGRAM_CALL_DEPTH 8 -#define MAX_PROGRAM_TEMPS 128 -#define MAX_PROGRAM_ADDRESS_REGS 2 -#define MAX_UNIFORMS 1024 /**< number of vec4 uniforms */ -#define MAX_VARYING 8 /**< number of float[4] vectors */ -#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS -#define MAX_PROGRAM_INPUTS 32 -#define MAX_PROGRAM_OUTPUTS 32 -/*@}*/ - -/** For GL_NV_vertex_program */ -/*@{*/ -#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128 -#define MAX_NV_VERTEX_PROGRAM_TEMPS 12 -#define MAX_NV_VERTEX_PROGRAM_PARAMS MAX_PROGRAM_ENV_PARAMS -#define MAX_NV_VERTEX_PROGRAM_INPUTS 16 -#define MAX_NV_VERTEX_PROGRAM_OUTPUTS 15 -/*@}*/ - -/** For GL_NV_fragment_program */ -/*@{*/ -#define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */ -#define MAX_NV_FRAGMENT_PROGRAM_TEMPS 96 -#define MAX_NV_FRAGMENT_PROGRAM_PARAMS 64 -#define MAX_NV_FRAGMENT_PROGRAM_INPUTS 12 -#define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS 3 -#define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS 2 -/*@}*/ - - -/** For GL_ARB_vertex_shader */ -/*@{*/ -#define MAX_VERTEX_ATTRIBS 16 -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -/*@}*/ - - -/** For GL_ARB_draw_buffers */ -/*@{*/ -#define MAX_DRAW_BUFFERS 4 -/*@}*/ - - -/** For GL_EXT_framebuffer_object */ -/*@{*/ -#define MAX_COLOR_ATTACHMENTS 8 -/*@}*/ - - - -/** - * \name Mesa-specific parameters - */ -/*@{*/ - - -/** - * If non-zero use GLdouble for walking triangle edges, for better accuracy. - */ -#define TRIANGLE_WALK_DOUBLE 0 - - -/** - * Bits per depth buffer value (max is 32). - */ -#ifndef DEFAULT_SOFTWARE_DEPTH_BITS -#define DEFAULT_SOFTWARE_DEPTH_BITS 16 -#endif -/** Depth buffer data type */ -#if DEFAULT_SOFTWARE_DEPTH_BITS <= 16 -#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort -#else -#define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint -#endif - - -/** - * Bits per stencil value: 8 - */ -#define STENCIL_BITS 8 - - -/** - * Bits per color channel: 8, 16 or 32 - */ -#ifndef CHAN_BITS -#define CHAN_BITS 8 -#endif - - -/* - * Color channel component order - * - * \note Changes will almost certainly cause problems at this time. - */ -#define RCOMP 0 -#define GCOMP 1 -#define BCOMP 2 -#define ACOMP 3 - - -/** - * Maximum number of temporary vertices required for clipping. - * - * Used in array_cache and tnl modules. - */ -#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1) - - -#endif /* MESA_CONFIG_H_INCLUDED */ diff --git a/src/libs/mesa/mesa/main/context.c b/src/libs/mesa/mesa/main/context.c deleted file mode 100644 index e142c852ed..0000000000 --- a/src/libs/mesa/mesa/main/context.c +++ /dev/null @@ -1,1830 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file context.c - * Mesa context/visual/framebuffer management functions. - * \author Brian Paul - */ - -/** - * \mainpage Mesa Main Module - * - * \section MainIntroduction Introduction - * - * The Mesa Main module consists of all the files in the main/ directory. - * Among the features of this module are: - *
    - *
  • Structures to represent most GL state
  • - *
  • State set/get functions
  • - *
  • Display lists
  • - *
  • Texture unit, object and image handling
  • - *
  • Matrix and attribute stacks
  • - *
- * - * Other modules are responsible for API dispatch, vertex transformation, - * point/line/triangle setup, rasterization, vertex array caching, - * vertex/fragment programs/shaders, etc. - * - * - * \section AboutDoxygen About Doxygen - * - * If you're viewing this information as Doxygen-generated HTML you'll - * see the documentation index at the top of this page. - * - * The first line lists the Mesa source code modules. - * The second line lists the indexes available for viewing the documentation - * for each module. - * - * Selecting the Main page link will display a summary of the module - * (this page). - * - * Selecting Data Structures will list all C structures. - * - * Selecting the File List link will list all the source files in - * the module. - * Selecting a filename will show a list of all functions defined in that file. - * - * Selecting the Data Fields link will display a list of all - * documented structure members. - * - * Selecting the Globals link will display a list - * of all functions, structures, global variables and macros in the module. - * - */ - - -#include "glheader.h" -#include "imports.h" -#if FEATURE_accum -#include "accum.h" -#endif -#include "api_exec.h" -#include "arrayobj.h" -#if FEATURE_attrib_stack -#include "attrib.h" -#endif -#include "blend.h" -#include "buffers.h" -#include "bufferobj.h" -#if FEATURE_colortable -#include "colortab.h" -#endif -#include "context.h" -#include "debug.h" -#include "depth.h" -#if FEATURE_dlist -#include "dlist.h" -#endif -#if FEATURE_evaluators -#include "eval.h" -#endif -#include "enums.h" -#include "extensions.h" -#include "fbobject.h" -#if FEATURE_feedback -#include "feedback.h" -#endif -#include "fog.h" -#include "framebuffer.h" -#include "get.h" -#if FEATURE_histogram -#include "histogram.h" -#endif -#include "hint.h" -#include "hash.h" -#include "light.h" -#include "lines.h" -#include "macros.h" -#include "matrix.h" -#include "multisample.h" -#include "pixel.h" -#include "pixelstore.h" -#include "points.h" -#include "polygon.h" -#if FEATURE_ARB_occlusion_query -#include "queryobj.h" -#endif -#if FEATURE_drawpix -#include "rastpos.h" -#endif -#include "scissor.h" -#include "simple_list.h" -#include "state.h" -#include "stencil.h" -#include "texcompress.h" -#include "teximage.h" -#include "texobj.h" -#include "texstate.h" -#include "mtypes.h" -#include "varray.h" -#include "version.h" -#include "vtxfmt.h" -#include "glapi/glthread.h" -#include "glapi/glapioffsets.h" -#include "glapi/glapitable.h" -#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program -#include "shader/program.h" -#endif -#include "shader/shader_api.h" -#if FEATURE_ATI_fragment_shader -#include "shader/atifragshader.h" -#endif -#if _HAVE_FULL_GL -#include "math/m_translate.h" -#include "math/m_matrix.h" -#include "math/m_xform.h" -#include "math/mathmod.h" -#endif - -#ifdef USE_SPARC_ASM -#include "sparc/sparc.h" -#endif - -#ifndef MESA_VERBOSE -int MESA_VERBOSE = 0; -#endif - -#ifndef MESA_DEBUG_FLAGS -int MESA_DEBUG_FLAGS = 0; -#endif - - -/* ubyte -> float conversion */ -GLfloat _mesa_ubyte_to_float_color_tab[256]; - - - -/** - * Swap buffers notification callback. - * - * \param gc GL context. - * - * Called by window system just before swapping buffers. - * We have to finish any pending rendering. - */ -void -_mesa_notifySwapBuffers(__GLcontext *gc) -{ - FLUSH_VERTICES( gc, 0 ); -} - - -/**********************************************************************/ -/** \name GL Visual allocation/destruction */ -/**********************************************************************/ -/*@{*/ - -/** - * Allocates a GLvisual structure and initializes it via - * _mesa_initialize_visual(). - * - * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode. - * \param dbFlag double buffering - * \param stereoFlag stereo buffer - * \param depthBits requested bits per depth buffer value. Any value in [0, 32] - * is acceptable but the actual depth type will be GLushort or GLuint as - * needed. - * \param stencilBits requested minimum bits per stencil buffer value - * \param accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits number of bits per color component in accum buffer. - * \param indexBits number of bits per pixel if \p rgbFlag is GL_FALSE - * \param redBits number of bits per color component in frame buffer for RGB(A) - * mode. We always use 8 in core Mesa though. - * \param greenBits same as above. - * \param blueBits same as above. - * \param alphaBits same as above. - * \param numSamples not really used. - * - * \return pointer to new GLvisual or NULL if requested parameters can't be - * met. - * - * \note Need to add params for level and numAuxBuffers (at least) - */ -GLvisual * -_mesa_create_visual( GLboolean rgbFlag, - GLboolean dbFlag, - GLboolean stereoFlag, - GLint redBits, - GLint greenBits, - GLint blueBits, - GLint alphaBits, - GLint indexBits, - GLint depthBits, - GLint stencilBits, - GLint accumRedBits, - GLint accumGreenBits, - GLint accumBlueBits, - GLint accumAlphaBits, - GLint numSamples ) -{ - GLvisual *vis = (GLvisual *) _mesa_calloc(sizeof(GLvisual)); - if (vis) { - if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag, - redBits, greenBits, blueBits, alphaBits, - indexBits, depthBits, stencilBits, - accumRedBits, accumGreenBits, - accumBlueBits, accumAlphaBits, - numSamples)) { - _mesa_free(vis); - return NULL; - } - } - return vis; -} - -/** - * Makes some sanity checks and fills in the fields of the - * GLvisual object with the given parameters. If the caller needs - * to set additional fields, he should just probably init the whole GLvisual - * object himself. - * \return GL_TRUE on success, or GL_FALSE on failure. - * - * \sa _mesa_create_visual() above for the parameter description. - */ -GLboolean -_mesa_initialize_visual( GLvisual *vis, - GLboolean rgbFlag, - GLboolean dbFlag, - GLboolean stereoFlag, - GLint redBits, - GLint greenBits, - GLint blueBits, - GLint alphaBits, - GLint indexBits, - GLint depthBits, - GLint stencilBits, - GLint accumRedBits, - GLint accumGreenBits, - GLint accumBlueBits, - GLint accumAlphaBits, - GLint numSamples ) -{ - assert(vis); - - if (depthBits < 0 || depthBits > 32) { - return GL_FALSE; - } - if (stencilBits < 0 || stencilBits > STENCIL_BITS) { - return GL_FALSE; - } - assert(accumRedBits >= 0); - assert(accumGreenBits >= 0); - assert(accumBlueBits >= 0); - assert(accumAlphaBits >= 0); - - vis->rgbMode = rgbFlag; - vis->doubleBufferMode = dbFlag; - vis->stereoMode = stereoFlag; - - vis->redBits = redBits; - vis->greenBits = greenBits; - vis->blueBits = blueBits; - vis->alphaBits = alphaBits; - vis->rgbBits = redBits + greenBits + blueBits; - - vis->indexBits = indexBits; - vis->depthBits = depthBits; - vis->stencilBits = stencilBits; - - vis->accumRedBits = accumRedBits; - vis->accumGreenBits = accumGreenBits; - vis->accumBlueBits = accumBlueBits; - vis->accumAlphaBits = accumAlphaBits; - - vis->haveAccumBuffer = accumRedBits > 0; - vis->haveDepthBuffer = depthBits > 0; - vis->haveStencilBuffer = stencilBits > 0; - - vis->numAuxBuffers = 0; - vis->level = 0; - vis->pixmapMode = 0; - vis->sampleBuffers = numSamples > 0 ? 1 : 0; - vis->samples = numSamples; - - return GL_TRUE; -} - - -/** - * Destroy a visual and free its memory. - * - * \param vis visual. - * - * Frees the visual structure. - */ -void -_mesa_destroy_visual( GLvisual *vis ) -{ - _mesa_free(vis); -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Context allocation, initialization, destroying - * - * The purpose of the most initialization functions here is to provide the - * default state values according to the OpenGL specification. - */ -/**********************************************************************/ -/*@{*/ - -/** - * One-time initialization mutex lock. - * - * \sa Used by one_time_init(). - */ -_glthread_DECLARE_STATIC_MUTEX(OneTimeLock); - -/** - * Calls all the various one-time-init functions in Mesa. - * - * While holding a global mutex lock, calls several initialization functions, - * and sets the glapi callbacks if the \c MESA_DEBUG environment variable is - * defined. - * - * \sa _math_init(). - */ -static void -one_time_init( GLcontext *ctx ) -{ - static GLboolean alreadyCalled = GL_FALSE; - (void) ctx; - _glthread_LOCK_MUTEX(OneTimeLock); - if (!alreadyCalled) { - GLuint i; - - /* do some implementation tests */ - assert( sizeof(GLbyte) == 1 ); - assert( sizeof(GLubyte) == 1 ); - assert( sizeof(GLshort) == 2 ); - assert( sizeof(GLushort) == 2 ); - assert( sizeof(GLint) == 4 ); - assert( sizeof(GLuint) == 4 ); - - _mesa_init_sqrt_table(); - -#if _HAVE_FULL_GL - _math_init(); - - for (i = 0; i < 256; i++) { - _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F; - } -#endif - -#ifdef USE_SPARC_ASM - _mesa_init_sparc_glapi_relocs(); -#endif - if (_mesa_getenv("MESA_DEBUG")) { - _glapi_noop_enable_warnings(GL_TRUE); - _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning ); - } - else { - _glapi_noop_enable_warnings(GL_FALSE); - } - -#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__) - _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n", - MESA_VERSION_STRING, __DATE__, __TIME__); -#endif - - alreadyCalled = GL_TRUE; - } - _glthread_UNLOCK_MUTEX(OneTimeLock); -} - - -/** - * Allocate and initialize a shared context state structure. - * Initializes the display list, texture objects and vertex programs hash - * tables, allocates the texture objects. If it runs out of memory, frees - * everything already allocated before returning NULL. - * - * \return pointer to a gl_shared_state structure on success, or NULL on - * failure. - */ -static GLboolean -alloc_shared_state( GLcontext *ctx ) -{ - GLuint i; - struct gl_shared_state *ss = CALLOC_STRUCT(gl_shared_state); - if (!ss) - return GL_FALSE; - - ctx->Shared = ss; - - _glthread_INIT_MUTEX(ss->Mutex); - - ss->DisplayList = _mesa_NewHashTable(); - ss->TexObjects = _mesa_NewHashTable(); - ss->Programs = _mesa_NewHashTable(); - -#if FEATURE_ARB_vertex_program - ss->DefaultVertexProgram = (struct gl_vertex_program *) - ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); - if (!ss->DefaultVertexProgram) - goto cleanup; -#endif -#if FEATURE_ARB_fragment_program - ss->DefaultFragmentProgram = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - if (!ss->DefaultFragmentProgram) - goto cleanup; -#endif -#if FEATURE_ATI_fragment_shader - ss->ATIShaders = _mesa_NewHashTable(); - ss->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0); - if (!ss->DefaultFragmentShader) - goto cleanup; -#endif - -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object - ss->BufferObjects = _mesa_NewHashTable(); -#endif - - ss->ArrayObjects = _mesa_NewHashTable(); - -#if FEATURE_ARB_shader_objects - ss->ShaderObjects = _mesa_NewHashTable(); -#endif - - /* Create default texture objects */ - for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { - static const GLenum targets[NUM_TEXTURE_TARGETS] = { - GL_TEXTURE_1D, - GL_TEXTURE_2D, - GL_TEXTURE_3D, - GL_TEXTURE_CUBE_MAP, - GL_TEXTURE_RECTANGLE_NV, - GL_TEXTURE_1D_ARRAY_EXT, - GL_TEXTURE_2D_ARRAY_EXT - }; - ss->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]); - if (!ss->DefaultTex[i]) - goto cleanup; - } - - /* sanity check */ - assert(ss->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1); - - _glthread_INIT_MUTEX(ss->TexMutex); - ss->TextureStateStamp = 0; - -#if FEATURE_EXT_framebuffer_object - ss->FrameBuffers = _mesa_NewHashTable(); - if (!ss->FrameBuffers) - goto cleanup; - ss->RenderBuffers = _mesa_NewHashTable(); - if (!ss->RenderBuffers) - goto cleanup; -#endif - - return GL_TRUE; - -cleanup: - /* Ran out of memory at some point. Free everything and return NULL */ - if (ss->DisplayList) - _mesa_DeleteHashTable(ss->DisplayList); - if (ss->TexObjects) - _mesa_DeleteHashTable(ss->TexObjects); - if (ss->Programs) - _mesa_DeleteHashTable(ss->Programs); -#if FEATURE_ARB_vertex_program - _mesa_reference_vertprog(ctx, &ss->DefaultVertexProgram, NULL); -#endif -#if FEATURE_ARB_fragment_program - _mesa_reference_fragprog(ctx, &ss->DefaultFragmentProgram, NULL); -#endif -#if FEATURE_ATI_fragment_shader - if (ss->DefaultFragmentShader) - _mesa_delete_ati_fragment_shader(ctx, ss->DefaultFragmentShader); -#endif -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object - if (ss->BufferObjects) - _mesa_DeleteHashTable(ss->BufferObjects); -#endif - - if (ss->ArrayObjects) - _mesa_DeleteHashTable (ss->ArrayObjects); - -#if FEATURE_ARB_shader_objects - if (ss->ShaderObjects) - _mesa_DeleteHashTable (ss->ShaderObjects); -#endif - -#if FEATURE_EXT_framebuffer_object - if (ss->FrameBuffers) - _mesa_DeleteHashTable(ss->FrameBuffers); - if (ss->RenderBuffers) - _mesa_DeleteHashTable(ss->RenderBuffers); -#endif - - for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { - if (ss->DefaultTex[i]) - ctx->Driver.DeleteTexture(ctx, ss->DefaultTex[i]); - } - - _mesa_free(ss); - - return GL_FALSE; -} - - -/** - * Callback for deleting a display list. Called by _mesa_HashDeleteAll(). - */ -static void -delete_displaylist_cb(GLuint id, void *data, void *userData) -{ -#if FEATURE_dlist - struct mesa_display_list *list = (struct mesa_display_list *) data; - GLcontext *ctx = (GLcontext *) userData; - _mesa_delete_list(ctx, list); -#endif -} - -/** - * Callback for deleting a texture object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_texture_cb(GLuint id, void *data, void *userData) -{ - struct gl_texture_object *texObj = (struct gl_texture_object *) data; - GLcontext *ctx = (GLcontext *) userData; - ctx->Driver.DeleteTexture(ctx, texObj); -} - -/** - * Callback for deleting a program object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_program_cb(GLuint id, void *data, void *userData) -{ - struct gl_program *prog = (struct gl_program *) data; - GLcontext *ctx = (GLcontext *) userData; - ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */ - prog->RefCount = 0; /* now going away */ - ctx->Driver.DeleteProgram(ctx, prog); -} - -/** - * Callback for deleting an ATI fragment shader object. - * Called by _mesa_HashDeleteAll(). - */ -static void -delete_fragshader_cb(GLuint id, void *data, void *userData) -{ - struct ati_fragment_shader *shader = (struct ati_fragment_shader *) data; - GLcontext *ctx = (GLcontext *) userData; - _mesa_delete_ati_fragment_shader(ctx, shader); -} - -/** - * Callback for deleting a buffer object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_bufferobj_cb(GLuint id, void *data, void *userData) -{ - struct gl_buffer_object *bufObj = (struct gl_buffer_object *) data; - GLcontext *ctx = (GLcontext *) userData; - ctx->Driver.DeleteBuffer(ctx, bufObj); -} - -/** - * Callback for deleting an array object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_arrayobj_cb(GLuint id, void *data, void *userData) -{ - struct gl_array_object *arrayObj = (struct gl_array_object *) data; - GLcontext *ctx = (GLcontext *) userData; - _mesa_delete_array_object(ctx, arrayObj); -} - -/** - * Callback for freeing shader program data. Call it before delete_shader_cb - * to avoid memory access error. - */ -static void -free_shader_program_data_cb(GLuint id, void *data, void *userData) -{ - GLcontext *ctx = (GLcontext *) userData; - struct gl_shader_program *shProg = (struct gl_shader_program *) data; - - if (shProg->Type == GL_SHADER_PROGRAM_MESA) { - _mesa_free_shader_program_data(ctx, shProg); - } -} - -/** - * Callback for deleting shader and shader programs objects. - * Called by _mesa_HashDeleteAll(). - */ -static void -delete_shader_cb(GLuint id, void *data, void *userData) -{ - GLcontext *ctx = (GLcontext *) userData; - struct gl_shader *sh = (struct gl_shader *) data; - if (sh->Type == GL_FRAGMENT_SHADER || sh->Type == GL_VERTEX_SHADER) { - _mesa_free_shader(ctx, sh); - } - else { - struct gl_shader_program *shProg = (struct gl_shader_program *) data; - ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA); - _mesa_free_shader_program(ctx, shProg); - } -} - -/** - * Callback for deleting a framebuffer object. Called by _mesa_HashDeleteAll() - */ -static void -delete_framebuffer_cb(GLuint id, void *data, void *userData) -{ - struct gl_framebuffer *fb = (struct gl_framebuffer *) data; - /* The fact that the framebuffer is in the hashtable means its refcount - * is one, but we're removing from the hashtable now. So clear refcount. - */ - /*assert(fb->RefCount == 1);*/ - fb->RefCount = 0; - - /* NOTE: Delete should always be defined but there are two reports - * of it being NULL (bugs 13507, 14293). Work-around for now. - */ - if (fb->Delete) - fb->Delete(fb); -} - -/** - * Callback for deleting a renderbuffer object. Called by _mesa_HashDeleteAll() - */ -static void -delete_renderbuffer_cb(GLuint id, void *data, void *userData) -{ - struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data; - rb->RefCount = 0; /* see comment for FBOs above */ - if (rb->Delete) - rb->Delete(rb); -} - - - -/** - * Deallocate a shared state object and all children structures. - * - * \param ctx GL context. - * \param ss shared state pointer. - * - * Frees the display lists, the texture objects (calling the driver texture - * deletion callback to free its private data) and the vertex programs, as well - * as their hash tables. - * - * \sa alloc_shared_state(). - */ -static void -free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) -{ - GLuint i; - - /* - * Free display lists - */ - _mesa_HashDeleteAll(ss->DisplayList, delete_displaylist_cb, ctx); - _mesa_DeleteHashTable(ss->DisplayList); - -#if FEATURE_ARB_shader_objects - _mesa_HashWalk(ss->ShaderObjects, free_shader_program_data_cb, ctx); - _mesa_HashDeleteAll(ss->ShaderObjects, delete_shader_cb, ctx); - _mesa_DeleteHashTable(ss->ShaderObjects); -#endif - - _mesa_HashDeleteAll(ss->Programs, delete_program_cb, ctx); - _mesa_DeleteHashTable(ss->Programs); - -#if FEATURE_ARB_vertex_program - _mesa_reference_vertprog(ctx, &ss->DefaultVertexProgram, NULL); -#endif -#if FEATURE_ARB_fragment_program - _mesa_reference_fragprog(ctx, &ss->DefaultFragmentProgram, NULL); -#endif - -#if FEATURE_ATI_fragment_shader - _mesa_HashDeleteAll(ss->ATIShaders, delete_fragshader_cb, ctx); - _mesa_DeleteHashTable(ss->ATIShaders); - _mesa_delete_ati_fragment_shader(ctx, ss->DefaultFragmentShader); -#endif - -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object - _mesa_HashDeleteAll(ss->BufferObjects, delete_bufferobj_cb, ctx); - _mesa_DeleteHashTable(ss->BufferObjects); -#endif - - _mesa_HashDeleteAll(ss->ArrayObjects, delete_arrayobj_cb, ctx); - _mesa_DeleteHashTable(ss->ArrayObjects); - -#if FEATURE_EXT_framebuffer_object - _mesa_HashDeleteAll(ss->FrameBuffers, delete_framebuffer_cb, ctx); - _mesa_DeleteHashTable(ss->FrameBuffers); - _mesa_HashDeleteAll(ss->RenderBuffers, delete_renderbuffer_cb, ctx); - _mesa_DeleteHashTable(ss->RenderBuffers); -#endif - - /* - * Free texture objects (after FBOs since some textures might have - * been bound to FBOs). - */ - ASSERT(ctx->Driver.DeleteTexture); - /* the default textures */ - for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { - ctx->Driver.DeleteTexture(ctx, ss->DefaultTex[i]); - } - /* all other textures */ - _mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx); - _mesa_DeleteHashTable(ss->TexObjects); - - _glthread_DESTROY_MUTEX(ss->Mutex); - - _mesa_free(ss); -} - - -/** - * Initialize fields of gl_current_attrib (aka ctx->Current.*) - */ -static void -_mesa_init_current(GLcontext *ctx) -{ - GLuint i; - - /* Init all to (0,0,0,1) */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 ); - } - - /* redo special cases: */ - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX], 1.0, 0.0, 0.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG], 1.0, 0.0, 0.0, 1.0 ); -} - - -/** - * Init vertex/fragment program native limits from logical limits. - */ -static void -init_natives(struct gl_program_constants *prog) -{ - prog->MaxNativeInstructions = prog->MaxInstructions; - prog->MaxNativeAluInstructions = prog->MaxAluInstructions; - prog->MaxNativeTexInstructions = prog->MaxTexInstructions; - prog->MaxNativeTexIndirections = prog->MaxTexIndirections; - prog->MaxNativeAttribs = prog->MaxAttribs; - prog->MaxNativeTemps = prog->MaxTemps; - prog->MaxNativeAddressRegs = prog->MaxAddressRegs; - prog->MaxNativeParameters = prog->MaxParameters; -} - - -/** - * Initialize fields of gl_constants (aka ctx->Const.*). - * Use defaults from config.h. The device drivers will often override - * some of these values (such as number of texture units). - */ -static void -_mesa_init_constants(GLcontext *ctx) -{ - assert(ctx); - - assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS); - assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS); - - /* Constants, may be overriden (usually only reduced) by device drivers */ - ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; - ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; - ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS; - ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE; - ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS; - ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; - ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; - ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, - ctx->Const.MaxTextureImageUnits); - ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; - ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS; - ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE; - ctx->Const.SubPixelBits = SUB_PIXEL_BITS; - ctx->Const.MinPointSize = MIN_POINT_SIZE; - ctx->Const.MaxPointSize = MAX_POINT_SIZE; - ctx->Const.MinPointSizeAA = MIN_POINT_SIZE; - ctx->Const.MaxPointSizeAA = MAX_POINT_SIZE; - ctx->Const.PointSizeGranularity = (GLfloat) POINT_SIZE_GRANULARITY; - ctx->Const.MinLineWidth = MIN_LINE_WIDTH; - ctx->Const.MaxLineWidth = MAX_LINE_WIDTH; - ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH; - ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH; - ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY; - ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE; - ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH; - ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT; - ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES; - ctx->Const.MaxLights = MAX_LIGHTS; - ctx->Const.MaxShininess = 128.0; - ctx->Const.MaxSpotExponent = 128.0; - ctx->Const.MaxViewportWidth = MAX_WIDTH; - ctx->Const.MaxViewportHeight = MAX_HEIGHT; -#if FEATURE_ARB_vertex_program - ctx->Const.VertexProgram.MaxInstructions = MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS; - ctx->Const.VertexProgram.MaxAluInstructions = 0; - ctx->Const.VertexProgram.MaxTexInstructions = 0; - ctx->Const.VertexProgram.MaxTexIndirections = 0; - ctx->Const.VertexProgram.MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; - ctx->Const.VertexProgram.MaxTemps = MAX_PROGRAM_TEMPS; - ctx->Const.VertexProgram.MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS; - ctx->Const.VertexProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; - ctx->Const.VertexProgram.MaxEnvParams = MAX_PROGRAM_ENV_PARAMS; - ctx->Const.VertexProgram.MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; - ctx->Const.VertexProgram.MaxUniformComponents = 4 * MAX_UNIFORMS; - init_natives(&ctx->Const.VertexProgram); -#endif - -#if FEATURE_ARB_fragment_program - ctx->Const.FragmentProgram.MaxInstructions = MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS; - ctx->Const.FragmentProgram.MaxAluInstructions = MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS; - ctx->Const.FragmentProgram.MaxTexInstructions = MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS; - ctx->Const.FragmentProgram.MaxTexIndirections = MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS; - ctx->Const.FragmentProgram.MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS; - ctx->Const.FragmentProgram.MaxTemps = MAX_PROGRAM_TEMPS; - ctx->Const.FragmentProgram.MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS; - ctx->Const.FragmentProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; - ctx->Const.FragmentProgram.MaxEnvParams = MAX_PROGRAM_ENV_PARAMS; - ctx->Const.FragmentProgram.MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS; - ctx->Const.FragmentProgram.MaxUniformComponents = 4 * MAX_UNIFORMS; - init_natives(&ctx->Const.FragmentProgram); -#endif - ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES; - ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH; - - /* CheckArrayBounds is overriden by drivers/x11 for X server */ - ctx->Const.CheckArrayBounds = GL_FALSE; - - /* GL_ARB_draw_buffers */ - ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; - - /* GL_OES_read_format */ - ctx->Const.ColorReadFormat = GL_RGBA; - ctx->Const.ColorReadType = GL_UNSIGNED_BYTE; - -#if FEATURE_EXT_framebuffer_object - ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; - ctx->Const.MaxRenderbufferSize = MAX_WIDTH; -#endif - -#if FEATURE_ARB_vertex_shader - ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; - ctx->Const.MaxVarying = MAX_VARYING; -#endif - - /* sanity checks */ - ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits, - ctx->Const.MaxTextureCoordUnits)); - ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); - ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); - - ASSERT(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS); - ASSERT(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS); - ASSERT(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX); - ASSERT(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX); -} - - -/** - * Do some sanity checks on the limits/constants for the given context. - * Only called the first time a context is bound. - */ -static void -check_context_limits(GLcontext *ctx) -{ - /* Many context limits/constants are limited by the size of - * internal arrays. - */ - assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); - assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS); - assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS); - assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS); - - /* number of coord units cannot be greater than number of image units */ - assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits); - - assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH); - assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH); - - /* make sure largest texture image is <= MAX_WIDTH in size */ - assert((1 << (ctx->Const.MaxTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.MaxCubeTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.Max3DTextureLevels -1 )) <= MAX_WIDTH); - - assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS); - - /* XXX probably add more tests */ -} - - -/** - * Initialize the attribute groups in a GL context. - * - * \param ctx GL context. - * - * Initializes all the attributes, calling the respective init* - * functions for the more complex data structures. - */ -static GLboolean -init_attrib_groups(GLcontext *ctx) -{ - assert(ctx); - - /* Constants */ - _mesa_init_constants( ctx ); - - /* Extensions */ - _mesa_init_extensions( ctx ); - - /* Attribute Groups */ -#if FEATURE_accum - _mesa_init_accum( ctx ); -#endif -#if FEATURE_attrib_stack - _mesa_init_attrib( ctx ); -#endif - _mesa_init_buffer_objects( ctx ); - _mesa_init_color( ctx ); -#if FEATURE_colortable - _mesa_init_colortables( ctx ); -#endif - _mesa_init_current( ctx ); - _mesa_init_depth( ctx ); - _mesa_init_debug( ctx ); -#if FEATURE_dlist - _mesa_init_display_list( ctx ); -#endif -#if FEATURE_evaluators - _mesa_init_eval( ctx ); -#endif - _mesa_init_fbobjects( ctx ); -#if FEATURE_feedback - _mesa_init_feedback( ctx ); -#else - ctx->RenderMode = GL_RENDER; -#endif - _mesa_init_fog( ctx ); -#if FEATURE_histogram - _mesa_init_histogram( ctx ); -#endif - _mesa_init_hint( ctx ); - _mesa_init_line( ctx ); - _mesa_init_lighting( ctx ); - _mesa_init_matrix( ctx ); - _mesa_init_multisample( ctx ); - _mesa_init_pixel( ctx ); - _mesa_init_pixelstore( ctx ); - _mesa_init_point( ctx ); - _mesa_init_polygon( ctx ); - _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif -#if FEATURE_drawpix - _mesa_init_rastpos( ctx ); -#endif - _mesa_init_scissor( ctx ); - _mesa_init_shader_state( ctx ); - _mesa_init_stencil( ctx ); - _mesa_init_transform( ctx ); - _mesa_init_varray( ctx ); - _mesa_init_viewport( ctx ); - - if (!_mesa_init_texture( ctx )) - return GL_FALSE; - -#if FEATURE_texture_s3tc - _mesa_init_texture_s3tc( ctx ); -#endif -#if FEATURE_texture_fxt1 - _mesa_init_texture_fxt1( ctx ); -#endif - - /* Miscellaneous */ - ctx->NewState = _NEW_ALL; - ctx->ErrorValue = (GLenum) GL_NO_ERROR; - - return GL_TRUE; -} - - -/** - * Update default objects in a GL context with respect to shared state. - * - * \param ctx GL context. - * - * Removes references to old default objects, (texture objects, program - * objects, etc.) and changes to reference those from the current shared - * state. - */ -static GLboolean -update_default_objects(GLcontext *ctx) -{ - assert(ctx); - - _mesa_update_default_objects_program(ctx); - _mesa_update_default_objects_texture(ctx); - _mesa_update_default_objects_buffer_objects(ctx); - - return GL_TRUE; -} - - -/** - * This is the default function we plug into all dispatch table slots - * This helps prevents a segfault when someone calls a GL function without - * first checking if the extension's supported. - */ -static int -generic_nop(void) -{ - _mesa_warning(NULL, "User called no-op dispatch function (an unsupported extension function?)"); - return 0; -} - - -/** - * Allocate and initialize a new dispatch table. - */ -static struct _glapi_table * -alloc_dispatch_table(void) -{ - /* Find the larger of Mesa's dispatch table and libGL's dispatch table. - * In practice, this'll be the same for stand-alone Mesa. But for DRI - * Mesa we do this to accomodate different versions of libGL and various - * DRI drivers. - */ - GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), - sizeof(struct _glapi_table) / sizeof(_glapi_proc)); - struct _glapi_table *table = - (struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc)); - if (table) { - _glapi_proc *entry = (_glapi_proc *) table; - GLint i; - for (i = 0; i < numEntries; i++) { - entry[i] = (_glapi_proc) generic_nop; - } - } - return table; -} - - -/** - * Initialize a GLcontext struct (rendering context). - * - * This includes allocating all the other structs and arrays which hang off of - * the context by pointers. - * Note that the driver needs to pass in its dd_function_table here since - * we need to at least call driverFunctions->NewTextureObject to create the - * default texture objects. - * - * Called by _mesa_create_context(). - * - * Performs the imports and exports callback tables initialization, and - * miscellaneous one-time initializations. If no shared context is supplied one - * is allocated, and increase its reference count. Setups the GL API dispatch - * tables. Initialize the TNL module. Sets the maximum Z buffer depth. - * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables - * for debug flags. - * - * \param ctx the context to initialize - * \param visual describes the visual attributes for this context - * \param share_list points to context to share textures, display lists, - * etc with, or NULL - * \param driverFunctions table of device driver functions for this context - * to use - * \param driverContext pointer to driver-specific context data - */ -GLboolean -_mesa_initialize_context(GLcontext *ctx, - const GLvisual *visual, - GLcontext *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext) -{ - ASSERT(driverContext); - assert(driverFunctions->NewTextureObject); - assert(driverFunctions->FreeTexImageData); - - /* misc one-time initializations */ - one_time_init(ctx); - - ctx->Visual = *visual; - ctx->DrawBuffer = NULL; - ctx->ReadBuffer = NULL; - ctx->WinSysDrawBuffer = NULL; - ctx->WinSysReadBuffer = NULL; - - /* Plug in driver functions and context pointer here. - * This is important because when we call alloc_shared_state() below - * we'll call ctx->Driver.NewTextureObject() to create the default - * textures. - */ - ctx->Driver = *driverFunctions; - ctx->DriverCtx = driverContext; - - if (share_list) { - /* share state with another context */ - ctx->Shared = share_list->Shared; - } - else { - /* allocate new, unshared state */ - if (!alloc_shared_state( ctx )) { - return GL_FALSE; - } - } - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - ctx->Shared->RefCount++; - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - - if (!init_attrib_groups( ctx )) { - free_shared_state(ctx, ctx->Shared); - return GL_FALSE; - } - - /* setup the API dispatch tables */ - ctx->Exec = alloc_dispatch_table(); - ctx->Save = alloc_dispatch_table(); - if (!ctx->Exec || !ctx->Save) { - free_shared_state(ctx, ctx->Shared); - if (ctx->Exec) - _mesa_free(ctx->Exec); - } -#if FEATURE_dispatch - _mesa_init_exec_table(ctx->Exec); -#endif - ctx->CurrentDispatch = ctx->Exec; -#if FEATURE_dlist - _mesa_init_dlist_table(ctx->Save); - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -#endif - /* Neutral tnl module stuff */ - _mesa_init_exec_vtxfmt( ctx ); - ctx->TnlModule.Current = NULL; - ctx->TnlModule.SwapCount = 0; - - ctx->FragmentProgram._MaintainTexEnvProgram - = (_mesa_getenv("MESA_TEX_PROG") != NULL); - - ctx->VertexProgram._MaintainTnlProgram - = (_mesa_getenv("MESA_TNL_PROG") != NULL); - if (ctx->VertexProgram._MaintainTnlProgram) { - /* this is required... */ - ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; - } - -#ifdef FEATURE_extra_context_init - _mesa_initialize_context_extra(ctx); -#endif - - ctx->FirstTimeCurrent = GL_TRUE; - - return GL_TRUE; -} - - -/** - * Allocate and initialize a GLcontext structure. - * Note that the driver needs to pass in its dd_function_table here since - * we need to at least call driverFunctions->NewTextureObject to initialize - * the rendering context. - * - * \param visual a GLvisual pointer (we copy the struct contents) - * \param share_list another context to share display lists with or NULL - * \param driverFunctions points to the dd_function_table into which the - * driver has plugged in all its special functions. - * \param driverCtx points to the device driver's private context state - * - * \return pointer to a new __GLcontextRec or NULL if error. - */ -GLcontext * -_mesa_create_context(const GLvisual *visual, - GLcontext *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext) -{ - GLcontext *ctx; - - ASSERT(visual); - ASSERT(driverContext); - - ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext)); - if (!ctx) - return NULL; - - if (_mesa_initialize_context(ctx, visual, share_list, - driverFunctions, driverContext)) { - return ctx; - } - else { - _mesa_free(ctx); - return NULL; - } -} - - -/** - * Free the data associated with the given context. - * - * But doesn't free the GLcontext struct itself. - * - * \sa _mesa_initialize_context() and init_attrib_groups(). - */ -void -_mesa_free_context_data( GLcontext *ctx ) -{ - GLint RefCount; - - if (!_mesa_get_current_context()){ - /* No current context, but we may need one in order to delete - * texture objs, etc. So temporarily bind the context now. - */ - _mesa_make_current(ctx, NULL, NULL); - } - - /* unreference WinSysDraw/Read buffers */ - _mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer); - _mesa_unreference_framebuffer(&ctx->WinSysReadBuffer); - _mesa_unreference_framebuffer(&ctx->DrawBuffer); - _mesa_unreference_framebuffer(&ctx->ReadBuffer); - - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL); - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL); - - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); - - _mesa_free_attrib_data(ctx); - _mesa_free_lighting_data( ctx ); -#if FEATURE_evaluators - _mesa_free_eval_data( ctx ); -#endif - _mesa_free_texture_data( ctx ); - _mesa_free_matrix_data( ctx ); - _mesa_free_viewport_data( ctx ); -#if FEATURE_colortable - _mesa_free_colortables_data( ctx ); -#endif - _mesa_free_program_data(ctx); - _mesa_free_shader_state(ctx); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif - -#if FEATURE_ARB_vertex_buffer_object - _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj); -#endif - _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj); - - /* free dispatch tables */ - _mesa_free(ctx->Exec); - _mesa_free(ctx->Save); - - /* Shared context state (display lists, textures, etc) */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - RefCount = --ctx->Shared->RefCount; - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - assert(RefCount >= 0); - if (RefCount == 0) { - /* free shared state */ - free_shared_state( ctx, ctx->Shared ); - } - - if (ctx->Extensions.String) - _mesa_free((void *) ctx->Extensions.String); - - /* unbind the context if it's currently bound */ - if (ctx == _mesa_get_current_context()) { - _mesa_make_current(NULL, NULL, NULL); - } -} - - -/** - * Destroy a GLcontext structure. - * - * \param ctx GL context. - * - * Calls _mesa_free_context_data() and frees the GLcontext structure itself. - */ -void -_mesa_destroy_context( GLcontext *ctx ) -{ - if (ctx) { - _mesa_free_context_data(ctx); - _mesa_free( (void *) ctx ); - } -} - - -#if _HAVE_FULL_GL -/** - * Copy attribute groups from one context to another. - * - * \param src source context - * \param dst destination context - * \param mask bitwise OR of GL_*_BIT flags - * - * According to the bits specified in \p mask, copies the corresponding - * attributes from \p src into \p dst. For many of the attributes a simple \c - * memcpy is not enough due to the existence of internal pointers in their data - * structures. - */ -void -_mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) -{ - if (mask & GL_ACCUM_BUFFER_BIT) { - /* OK to memcpy */ - dst->Accum = src->Accum; - } - if (mask & GL_COLOR_BUFFER_BIT) { - /* OK to memcpy */ - dst->Color = src->Color; - } - if (mask & GL_CURRENT_BIT) { - /* OK to memcpy */ - dst->Current = src->Current; - } - if (mask & GL_DEPTH_BUFFER_BIT) { - /* OK to memcpy */ - dst->Depth = src->Depth; - } - if (mask & GL_ENABLE_BIT) { - /* no op */ - } - if (mask & GL_EVAL_BIT) { - /* OK to memcpy */ - dst->Eval = src->Eval; - } - if (mask & GL_FOG_BIT) { - /* OK to memcpy */ - dst->Fog = src->Fog; - } - if (mask & GL_HINT_BIT) { - /* OK to memcpy */ - dst->Hint = src->Hint; - } - if (mask & GL_LIGHTING_BIT) { - GLuint i; - /* begin with memcpy */ - dst->Light = src->Light; - /* fixup linked lists to prevent pointer insanity */ - make_empty_list( &(dst->Light.EnabledList) ); - for (i = 0; i < MAX_LIGHTS; i++) { - if (dst->Light.Light[i].Enabled) { - insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i])); - } - } - } - if (mask & GL_LINE_BIT) { - /* OK to memcpy */ - dst->Line = src->Line; - } - if (mask & GL_LIST_BIT) { - /* OK to memcpy */ - dst->List = src->List; - } - if (mask & GL_PIXEL_MODE_BIT) { - /* OK to memcpy */ - dst->Pixel = src->Pixel; - } - if (mask & GL_POINT_BIT) { - /* OK to memcpy */ - dst->Point = src->Point; - } - if (mask & GL_POLYGON_BIT) { - /* OK to memcpy */ - dst->Polygon = src->Polygon; - } - if (mask & GL_POLYGON_STIPPLE_BIT) { - /* Use loop instead of MEMCPY due to problem with Portland Group's - * C compiler. Reported by John Stone. - */ - GLuint i; - for (i = 0; i < 32; i++) { - dst->PolygonStipple[i] = src->PolygonStipple[i]; - } - } - if (mask & GL_SCISSOR_BIT) { - /* OK to memcpy */ - dst->Scissor = src->Scissor; - } - if (mask & GL_STENCIL_BUFFER_BIT) { - /* OK to memcpy */ - dst->Stencil = src->Stencil; - } - if (mask & GL_TEXTURE_BIT) { - /* Cannot memcpy because of pointers */ - _mesa_copy_texture_state(src, dst); - } - if (mask & GL_TRANSFORM_BIT) { - /* OK to memcpy */ - dst->Transform = src->Transform; - } - if (mask & GL_VIEWPORT_BIT) { - /* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */ - dst->Viewport.X = src->Viewport.X; - dst->Viewport.Y = src->Viewport.Y; - dst->Viewport.Width = src->Viewport.Width; - dst->Viewport.Height = src->Viewport.Height; - dst->Viewport.Near = src->Viewport.Near; - dst->Viewport.Far = src->Viewport.Far; - _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap); - } - - /* XXX FIXME: Call callbacks? - */ - dst->NewState = _NEW_ALL; -} -#endif - - -/** - * Check if the given context can render into the given framebuffer - * by checking visual attributes. - * - * Most of these tests could go away because Mesa is now pretty flexible - * in terms of mixing rendering contexts with framebuffers. As long - * as RGB vs. CI mode agree, we're probably good. - * - * \return GL_TRUE if compatible, GL_FALSE otherwise. - */ -static GLboolean -check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) -{ - const GLvisual *ctxvis = &ctx->Visual; - const GLvisual *bufvis = &buffer->Visual; - - if (ctxvis == bufvis) - return GL_TRUE; - - if (ctxvis->rgbMode != bufvis->rgbMode) - return GL_FALSE; -#if 0 - /* disabling this fixes the fgl_glxgears pbuffer demo */ - if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode) - return GL_FALSE; -#endif - if (ctxvis->stereoMode && !bufvis->stereoMode) - return GL_FALSE; - if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer) - return GL_FALSE; - if (ctxvis->haveDepthBuffer && !bufvis->haveDepthBuffer) - return GL_FALSE; - if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer) - return GL_FALSE; - if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask) - return GL_FALSE; - if (ctxvis->greenMask && ctxvis->greenMask != bufvis->greenMask) - return GL_FALSE; - if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask) - return GL_FALSE; -#if 0 - /* disabled (see bug 11161) */ - if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits) - return GL_FALSE; -#endif - if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits) - return GL_FALSE; - - return GL_TRUE; -} - - -/** - * Do one-time initialization for the given framebuffer. Specifically, - * ask the driver for the window's current size and update the framebuffer - * object to match. - * Really, the device driver should totally take care of this. - */ -static void -initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb) -{ - GLuint width, height; - if (ctx->Driver.GetBufferSize) { - ctx->Driver.GetBufferSize(fb, &width, &height); - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, fb, width, height); - fb->Initialized = GL_TRUE; - } -} - - -/** - * Check if the viewport/scissor size has not yet been initialized. - * Initialize the size if the given width and height are non-zero. - */ -void -_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height) -{ - if (!ctx->ViewportInitialized && width > 0 && height > 0) { - /* Note: set flag here, before calling _mesa_set_viewport(), to prevent - * potential infinite recursion. - */ - ctx->ViewportInitialized = GL_TRUE; - _mesa_set_viewport(ctx, 0, 0, width, height); - _mesa_set_scissor(ctx, 0, 0, width, height); - } -} - - -/** - * Bind the given context to the given drawBuffer and readBuffer and - * make it the current context for the calling thread. - * We'll render into the drawBuffer and read pixels from the - * readBuffer (i.e. glRead/CopyPixels, glCopyTexImage, etc). - * - * We check that the context's and framebuffer's visuals are compatible - * and return immediately if they're not. - * - * \param newCtx the new GL context. If NULL then there will be no current GL - * context. - * \param drawBuffer the drawing framebuffer - * \param readBuffer the reading framebuffer - */ -void -_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, - GLframebuffer *readBuffer ) -{ - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(newCtx, "_mesa_make_current()\n"); - - /* Check that the context's and framebuffer's visuals are compatible. - */ - if (newCtx && drawBuffer && newCtx->WinSysDrawBuffer != drawBuffer) { - if (!check_compatible(newCtx, drawBuffer)) { - _mesa_warning(newCtx, - "MakeCurrent: incompatible visuals for context and drawbuffer"); - return; - } - } - if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) { - if (!check_compatible(newCtx, readBuffer)) { - _mesa_warning(newCtx, - "MakeCurrent: incompatible visuals for context and readbuffer"); - return; - } - } - - /* We used to call _glapi_check_multithread() here. Now do it in drivers */ - _glapi_set_context((void *) newCtx); - ASSERT(_mesa_get_current_context() == newCtx); - - if (!newCtx) { - _glapi_set_dispatch(NULL); /* none current */ - } - else { - _glapi_set_dispatch(newCtx->CurrentDispatch); - - if (drawBuffer && readBuffer) { - /* TODO: check if newCtx and buffer's visual match??? */ - - ASSERT(drawBuffer->Name == 0); - ASSERT(readBuffer->Name == 0); - _mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, drawBuffer); - _mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, readBuffer); - - /* - * Only set the context's Draw/ReadBuffer fields if they're NULL - * or not bound to a user-created FBO. - */ - if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { - _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer); - } - if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) { - _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer); - } - - /* XXX only set this flag if we're really changing the draw/read - * framebuffer bindings. - */ - newCtx->NewState |= _NEW_BUFFERS; - -#if 1 - /* We want to get rid of these lines: */ - -#if _HAVE_FULL_GL - if (!drawBuffer->Initialized) { - initialize_framebuffer_size(newCtx, drawBuffer); - } - if (readBuffer != drawBuffer && !readBuffer->Initialized) { - initialize_framebuffer_size(newCtx, readBuffer); - } - - _mesa_resizebuffers(newCtx); -#endif - -#else - /* We want the drawBuffer and readBuffer to be initialized by - * the driver. - * This generally means the Width and Height match the actual - * window size and the renderbuffers (both hardware and software - * based) are allocated to match. The later can generally be - * done with a call to _mesa_resize_framebuffer(). - * - * It's theoretically possible for a buffer to have zero width - * or height, but for now, assert check that the driver did what's - * expected of it. - */ - ASSERT(drawBuffer->Width > 0); - ASSERT(drawBuffer->Height > 0); -#endif - - if (drawBuffer) { - _mesa_check_init_viewport(newCtx, - drawBuffer->Width, drawBuffer->Height); - } - } - - if (newCtx->FirstTimeCurrent) { - check_context_limits(newCtx); - - /* We can use this to help debug user's problems. Tell them 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 (_mesa_getenv("MESA_INFO")) { - _mesa_print_info(); - } - - newCtx->FirstTimeCurrent = GL_FALSE; - } - } -} - - -/** - * Make context 'ctx' share the display lists, textures and programs - * that are associated with 'ctxToShare'. - * Any display lists, textures or programs associated with 'ctx' will - * be deleted if nobody else is sharing them. - */ -GLboolean -_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare) -{ - if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) { - struct gl_shared_state *oldSharedState = ctx->Shared; - - ctx->Shared = ctxToShare->Shared; - ctx->Shared->RefCount++; - - update_default_objects(ctx); - - oldSharedState->RefCount--; - if (oldSharedState->RefCount == 0) { - free_shared_state(ctx, oldSharedState); - } - - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - - -/** - * \return pointer to the current GL context for this thread. - * - * Calls _glapi_get_context(). 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 * -_mesa_get_current_context( void ) -{ - return (GLcontext *) _glapi_get_context(); -} - - -/** - * Get context's current API dispatch table. - * - * It'll either be the immediate-mode execute dispatcher or the display list - * compile dispatcher. - * - * \param ctx GL context. - * - * \return pointer to dispatch_table. - * - * Simply returns __GLcontextRec::CurrentDispatch. - */ -struct _glapi_table * -_mesa_get_dispatch(GLcontext *ctx) -{ - return ctx->CurrentDispatch; -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Miscellaneous functions */ -/**********************************************************************/ -/*@{*/ - -/** - * Record an error. - * - * \param ctx GL context. - * \param error error code. - * - * Records the given error code and call the driver's dd_function_table::Error - * function if defined. - * - * \sa - * This is called via _mesa_error(). - */ -void -_mesa_record_error(GLcontext *ctx, GLenum error) -{ - if (!ctx) - return; - - if (ctx->ErrorValue == GL_NO_ERROR) { - ctx->ErrorValue = error; - } - - /* Call device driver's error handler, if any. This is used on the Mac. */ - if (ctx->Driver.Error) { - ctx->Driver.Error(ctx); - } -} - - -/** - * Execute glFinish(). - * - * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the - * dd_function_table::Finish driver callback, if not NULL. - */ -void GLAPIENTRY -_mesa_Finish(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->Driver.Finish) { - ctx->Driver.Finish(ctx); - } -} - - -/** - * Execute glFlush(). - * - * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the - * dd_function_table::Flush driver callback, if not NULL. - */ -void GLAPIENTRY -_mesa_Flush(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } -} - - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/context.h b/src/libs/mesa/mesa/main/context.h deleted file mode 100644 index 8c1196dd9c..0000000000 --- a/src/libs/mesa/mesa/main/context.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file context.h - * Mesa context and visual-related functions. - * - * There are three large Mesa data types/classes which are meant to be - * used by device drivers: - * - GLcontext: this contains the Mesa rendering state - * - GLvisual: this describes the color buffer (RGB vs. ci), whether or not - * there's a depth buffer, stencil buffer, etc. - * - GLframebuffer: contains pointers to the depth buffer, stencil buffer, - * accum buffer and alpha buffers. - * - * These types should be encapsulated by corresponding device driver - * data types. See xmesa.h and xmesaP.h for an example. - * - * In OOP terms, GLcontext, GLvisual, and GLframebuffer are base classes - * which the device driver must derive from. - * - * The following functions create and destroy these data types. - */ - - -#ifndef CONTEXT_H -#define CONTEXT_H - - -#include "glapi/glapi.h" -#include "imports.h" -#include "mtypes.h" - - -/** \name Visual-related functions */ -/*@{*/ - -extern GLvisual * -_mesa_create_visual( GLboolean rgbFlag, - GLboolean dbFlag, - GLboolean stereoFlag, - GLint redBits, - GLint greenBits, - GLint blueBits, - GLint alphaBits, - GLint indexBits, - GLint depthBits, - GLint stencilBits, - GLint accumRedBits, - GLint accumGreenBits, - GLint accumBlueBits, - GLint accumAlphaBits, - GLint numSamples ); - -extern GLboolean -_mesa_initialize_visual( GLvisual *v, - GLboolean rgbFlag, - GLboolean dbFlag, - GLboolean stereoFlag, - GLint redBits, - GLint greenBits, - GLint blueBits, - GLint alphaBits, - GLint indexBits, - GLint depthBits, - GLint stencilBits, - GLint accumRedBits, - GLint accumGreenBits, - GLint accumBlueBits, - GLint accumAlphaBits, - GLint numSamples ); - -extern void -_mesa_destroy_visual( GLvisual *vis ); - -/*@}*/ - - -/** \name Context-related functions */ -/*@{*/ - -extern GLcontext * -_mesa_create_context( const GLvisual *visual, - GLcontext *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext ); - -extern GLboolean -_mesa_initialize_context( GLcontext *ctx, - const GLvisual *visual, - GLcontext *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext ); - -extern void -_mesa_initialize_context_extra(GLcontext *ctx); - -extern void -_mesa_free_context_data( GLcontext *ctx ); - -extern void -_mesa_destroy_context( GLcontext *ctx ); - - -extern void -_mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); - - -extern void -_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer, - GLframebuffer *readBuffer ); - -extern void -_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height); - -extern GLboolean -_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare); - -extern GLcontext * -_mesa_get_current_context(void); - -/*@}*/ - - -extern void -_mesa_notifySwapBuffers(__GLcontext *gc); - - -extern struct _glapi_table * -_mesa_get_dispatch(GLcontext *ctx); - - - -/** \name Miscellaneous */ -/*@{*/ - -extern void -_mesa_record_error( GLcontext *ctx, GLenum error ); - -extern void GLAPIENTRY -_mesa_Finish( void ); - -extern void GLAPIENTRY -_mesa_Flush( void ); - -/*@}*/ - - - -/** - * \name Macros for flushing buffered rendering commands before state changes, - * checking if inside glBegin/glEnd, etc. - */ -/*@{*/ - -/** - * Flush vertices. - * - * \param ctx GL context. - * \param newstate new state. - * - * Checks if dd_function_table::NeedFlush is marked to flush stored vertices, - * and calls dd_function_table::FlushVertices if so. Marks - * __GLcontextRec::NewState with \p newstate. - */ -#define FLUSH_VERTICES(ctx, newstate) \ -do { \ - if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\ - if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \ - ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \ - ctx->NewState |= newstate; \ -} while (0) - -/** - * Flush current state. - * - * \param ctx GL context. - * \param newstate new state. - * - * Checks if dd_function_table::NeedFlush is marked to flush current state, - * and calls dd_function_table::FlushVertices if so. Marks - * __GLcontextRec::NewState with \p newstate. - */ -#define FLUSH_CURRENT(ctx, newstate) \ -do { \ - if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \ - if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \ - ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \ - ctx->NewState |= newstate; \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair, with return value. - * - * \param ctx GL context. - * \param retval value to return value in case the assertion fails. - */ -#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ -do { \ - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ - _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \ - return retval; \ - } \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair. - * - * \param ctx GL context. - */ -#define ASSERT_OUTSIDE_BEGIN_END(ctx) \ -do { \ - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ - _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \ - return; \ - } \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair and flush the vertices. - * - * \param ctx GL context. - */ -#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) \ -do { \ - ASSERT_OUTSIDE_BEGIN_END(ctx); \ - FLUSH_VERTICES(ctx, 0); \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair and flush the vertices, with return value. - * - * \param ctx GL context. - * \param retval value to return value in case the assertion fails. - */ -#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \ -do { \ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval); \ - FLUSH_VERTICES(ctx, 0); \ -} while (0) - -/*@}*/ - - - -/** - * Is the secondary color needed? - */ -#define NEED_SECONDARY_COLOR(CTX) \ - (((CTX)->Light.Enabled && \ - (CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \ - || (CTX)->Fog.ColorSumEnabled \ - || ((CTX)->VertexProgram._Current && \ - ((CTX)->VertexProgram._Current != (CTX)->VertexProgram._TnlProgram) && \ - ((CTX)->VertexProgram._Current->Base.InputsRead & VERT_BIT_COLOR1)) \ - || ((CTX)->FragmentProgram._Current && \ - ((CTX)->FragmentProgram._Current != (CTX)->FragmentProgram._TexEnvProgram) && \ - ((CTX)->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL1)) \ - ) - - -/** - * Is RGBA LogicOp enabled? - */ -#define RGBA_LOGICOP_ENABLED(CTX) \ - ((CTX)->Color.ColorLogicOpEnabled || \ - ((CTX)->Color.BlendEnabled && (CTX)->Color.BlendEquationRGB == GL_LOGIC_OP)) - - -#endif /* CONTEXT_H */ diff --git a/src/libs/mesa/mesa/main/convolve.c b/src/libs/mesa/mesa/main/convolve.c deleted file mode 100644 index 814c6a0a5a..0000000000 --- a/src/libs/mesa/mesa/main/convolve.c +++ /dev/null @@ -1,1528 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - - -/* - * Image convolution functions. - * - * Notes: filter kernel elements are indexed by and as in - * the GL spec. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "convolve.h" -#include "context.h" -#include "image.h" -#include "mtypes.h" -#include "pixel.h" -#include "state.h" - - -/* - * Given an internalFormat token passed to glConvolutionFilter - * or glSeparableFilter, return the corresponding base format. - * Return -1 if invalid token. - */ -static GLint -base_filter_format( GLenum format ) -{ - switch (format) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_ALPHA; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return GL_INTENSITY; - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return GL_RGBA; - default: - return -1; /* error */ - } -} - - -void GLAPIENTRY -_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) -{ - GLint baseFormat; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_1D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter1D(width)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter1D(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D(format or type)"); - return; - } - - ctx->Convolution1D.Format = format; - ctx->Convolution1D.InternalFormat = internalFormat; - ctx->Convolution1D.Width = width; - ctx->Convolution1D.Height = 1; - - if (ctx->Unpack.BufferObj->Name) { - /* unpack filter from PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, width, 1, 1, - format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter1D(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter1D(PBO is mapped)"); - return; - } - image = ADD_POINTERS(buf, image); - } - else if (!image) { - return; - } - - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, - ctx->Convolution1D.Filter, - format, type, image, &ctx->Unpack, - 0); /* transferOps */ - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - _mesa_scale_and_bias_rgba(width, - (GLfloat (*)[4]) ctx->Convolution1D.Filter, - ctx->Pixel.ConvolutionFilterScale[0][0], - ctx->Pixel.ConvolutionFilterScale[0][1], - ctx->Pixel.ConvolutionFilterScale[0][2], - ctx->Pixel.ConvolutionFilterScale[0][3], - ctx->Pixel.ConvolutionFilterBias[0][0], - ctx->Pixel.ConvolutionFilterBias[0][1], - ctx->Pixel.ConvolutionFilterBias[0][2], - ctx->Pixel.ConvolutionFilterBias[0][3]); - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) -{ - GLint baseFormat; - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glConvolutionFilter2D(height)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter2D(format or type)"); - return; - } - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D(format or type)"); - return; - } - - /* this should have been caught earlier */ - assert(_mesa_components_in_format(format)); - - ctx->Convolution2D.Format = format; - ctx->Convolution2D.InternalFormat = internalFormat; - ctx->Convolution2D.Width = width; - ctx->Convolution2D.Height = height; - - if (ctx->Unpack.BufferObj->Name) { - /* unpack filter from PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, - format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter2D(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter2D(PBO is mapped)"); - return; - } - image = ADD_POINTERS(buf, image); - } - else if (!image) { - return; - } - - /* Unpack filter image. We always store filters in RGBA format. */ - for (i = 0; i < height; i++) { - const GLvoid *src = _mesa_image_address2d(&ctx->Unpack, image, width, - height, format, type, i, 0); - GLfloat *dst = ctx->Convolution2D.Filter + i * width * 4; - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, dst, - format, type, src, &ctx->Unpack, - 0); /* transferOps */ - } - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - _mesa_scale_and_bias_rgba(width * height, - (GLfloat (*)[4]) ctx->Convolution2D.Filter, - ctx->Pixel.ConvolutionFilterScale[1][0], - ctx->Pixel.ConvolutionFilterScale[1][1], - ctx->Pixel.ConvolutionFilterScale[1][2], - ctx->Pixel.ConvolutionFilterScale[1][3], - ctx->Pixel.ConvolutionFilterBias[1][0], - ctx->Pixel.ConvolutionFilterBias[1][1], - ctx->Pixel.ConvolutionFilterBias[1][2], - ctx->Pixel.ConvolutionFilterBias[1][3]); - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_MODE: - if (param == (GLfloat) GL_REDUCE || - param == (GLfloat) GL_CONSTANT_BORDER || - param == (GLfloat) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) param; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(params)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - COPY_4V(ctx->Pixel.ConvolutionBorderColor[c], params); - break; - case GL_CONVOLUTION_BORDER_MODE: - if (params[0] == (GLfloat) GL_REDUCE || - params[0] == (GLfloat) GL_CONSTANT_BORDER || - params[0] == (GLfloat) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(params)"); - return; - } - break; - case GL_CONVOLUTION_FILTER_SCALE: - COPY_4V(ctx->Pixel.ConvolutionFilterScale[c], params); - break; - case GL_CONVOLUTION_FILTER_BIAS: - COPY_4V(ctx->Pixel.ConvolutionFilterBias[c], params); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_MODE: - if (param == (GLint) GL_REDUCE || - param == (GLint) GL_CONSTANT_BORDER || - param == (GLint) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) param; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(params)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint c; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - break; - case GL_CONVOLUTION_2D: - c = 1; - break; - case GL_SEPARABLE_2D: - c = 2; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - ctx->Pixel.ConvolutionBorderColor[c][0] = INT_TO_FLOAT(params[0]); - ctx->Pixel.ConvolutionBorderColor[c][1] = INT_TO_FLOAT(params[1]); - ctx->Pixel.ConvolutionBorderColor[c][2] = INT_TO_FLOAT(params[2]); - ctx->Pixel.ConvolutionBorderColor[c][3] = INT_TO_FLOAT(params[3]); - break; - case GL_CONVOLUTION_BORDER_MODE: - if (params[0] == (GLint) GL_REDUCE || - params[0] == (GLint) GL_CONSTANT_BORDER || - params[0] == (GLint) GL_REPLICATE_BORDER) { - ctx->Pixel.ConvolutionBorderMode[c] = (GLenum) params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(params)"); - return; - } - break; - case GL_CONVOLUTION_FILTER_SCALE: - /* COPY_4V(ctx->Pixel.ConvolutionFilterScale[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterScale[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterScale[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterScale[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterScale[c][3] = (GLfloat) params[3]; - break; - case GL_CONVOLUTION_FILTER_BIAS: - /* COPY_4V(ctx->Pixel.ConvolutionFilterBias[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterBias[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterBias[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterBias[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterBias[c][3] = (GLfloat) params[3]; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(pname)"); - return; - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) -{ - GLint baseFormat; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_1D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter1D(width)"); - return; - } - - ctx->Driver.CopyConvolutionFilter1D( ctx, target, - internalFormat, x, y, width); -} - - -void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - GLint baseFormat; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_CONVOLUTION_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(height)"); - return; - } - - ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, - width, height ); -} - - -void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image) -{ - struct gl_convolution_attrib *filter; - GLuint row; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(format or type)"); - return; - } - - switch (target) { - case GL_CONVOLUTION_1D: - filter = &(ctx->Convolution1D); - break; - case GL_CONVOLUTION_2D: - filter = &(ctx->Convolution2D); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(target)"); - return; - } - - if (ctx->Pack.BufferObj->Name) { - /* Pack the filter into a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(2, &ctx->Pack, - filter->Width, filter->Height, - 1, format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(PBO is mapped)"); - return; - } - image = ADD_POINTERS(image, buf); - } - - for (row = 0; row < filter->Height; row++) { - GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width, - filter->Height, format, type, - row, 0); - GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4); - _mesa_pack_rgba_span_float(ctx, filter->Width, src, - format, type, dst, &ctx->Pack, 0x0); - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - -void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - const struct gl_convolution_attrib *conv; - GLuint c; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - conv = &ctx->Convolution1D; - break; - case GL_CONVOLUTION_2D: - c = 1; - conv = &ctx->Convolution2D; - break; - case GL_SEPARABLE_2D: - c = 2; - conv = &ctx->Separable2D; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - COPY_4V(params, ctx->Pixel.ConvolutionBorderColor[c]); - break; - case GL_CONVOLUTION_BORDER_MODE: - *params = (GLfloat) ctx->Pixel.ConvolutionBorderMode[c]; - break; - case GL_CONVOLUTION_FILTER_SCALE: - COPY_4V(params, ctx->Pixel.ConvolutionFilterScale[c]); - break; - case GL_CONVOLUTION_FILTER_BIAS: - COPY_4V(params, ctx->Pixel.ConvolutionFilterBias[c]); - break; - case GL_CONVOLUTION_FORMAT: - *params = (GLfloat) conv->Format; - break; - case GL_CONVOLUTION_WIDTH: - *params = (GLfloat) conv->Width; - break; - case GL_CONVOLUTION_HEIGHT: - *params = (GLfloat) conv->Height; - break; - case GL_MAX_CONVOLUTION_WIDTH: - *params = (GLfloat) ctx->Const.MaxConvolutionWidth; - break; - case GL_MAX_CONVOLUTION_HEIGHT: - *params = (GLfloat) ctx->Const.MaxConvolutionHeight; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - const struct gl_convolution_attrib *conv; - GLuint c; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_CONVOLUTION_1D: - c = 0; - conv = &ctx->Convolution1D; - break; - case GL_CONVOLUTION_2D: - c = 1; - conv = &ctx->Convolution2D; - break; - case GL_SEPARABLE_2D: - c = 2; - conv = &ctx->Separable2D; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv(target)"); - return; - } - - switch (pname) { - case GL_CONVOLUTION_BORDER_COLOR: - params[0] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][0]); - params[1] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][1]); - params[2] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][2]); - params[3] = FLOAT_TO_INT(ctx->Pixel.ConvolutionBorderColor[c][3]); - break; - case GL_CONVOLUTION_BORDER_MODE: - *params = (GLint) ctx->Pixel.ConvolutionBorderMode[c]; - break; - case GL_CONVOLUTION_FILTER_SCALE: - params[0] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][0]; - params[1] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][1]; - params[2] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][2]; - params[3] = (GLint) ctx->Pixel.ConvolutionFilterScale[c][3]; - break; - case GL_CONVOLUTION_FILTER_BIAS: - params[0] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][0]; - params[1] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][1]; - params[2] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][2]; - params[3] = (GLint) ctx->Pixel.ConvolutionFilterBias[c][3]; - break; - case GL_CONVOLUTION_FORMAT: - *params = (GLint) conv->Format; - break; - case GL_CONVOLUTION_WIDTH: - *params = (GLint) conv->Width; - break; - case GL_CONVOLUTION_HEIGHT: - *params = (GLint) conv->Height; - break; - case GL_MAX_CONVOLUTION_WIDTH: - *params = (GLint) ctx->Const.MaxConvolutionWidth; - break; - case GL_MAX_CONVOLUTION_HEIGHT: - *params = (GLint) ctx->Const.MaxConvolutionHeight; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span) -{ - const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; - struct gl_convolution_attrib *filter; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (target != GL_SEPARABLE_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter(target)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionFilter(format or type)"); - return; - } - - filter = &ctx->Separable2D; - - if (ctx->Pack.BufferObj->Name) { - /* Pack filter into PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Pack, filter->Width, 1, 1, - format, type, row)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetSeparableFilter(invalid PBO access, width)"); - return; - } - if (!_mesa_validate_pbo_access(1, &ctx->Pack, filter->Height, 1, 1, - format, type, column)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetSeparableFilter(invalid PBO access, height)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetSeparableFilter(PBO is mapped)"); - return; - } - row = ADD_POINTERS(buf, row); - column = ADD_POINTERS(buf, column); - } - - /* Row filter */ - if (row) { - GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width, - format, type, 0); - _mesa_pack_rgba_span_float(ctx, filter->Width, - (GLfloat (*)[4]) filter->Filter, - format, type, dst, &ctx->Pack, 0x0); - } - - /* Column filter */ - if (column) { - GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height, - format, type, 0); - GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart); - _mesa_pack_rgba_span_float(ctx, filter->Height, src, - format, type, dst, &ctx->Pack, 0x0); - } - - (void) span; /* unused at this time */ - - if (ctx->Pack.BufferObj->Name) { - /* Pack filter into PBO */ - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } -} - - -void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) -{ - const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; - GLint baseFormat; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target != GL_SEPARABLE_2D) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(target)"); - return; - } - - baseFormat = base_filter_format(internalFormat); - if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(internalFormat)"); - return; - } - - if (width < 0 || width > MAX_CONVOLUTION_WIDTH) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSeparableFilter2D(width)"); - return; - } - if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSeparableFilter2D(height)"); - return; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSeparableFilter2D(format or type)"); - return; - } - - if (format == GL_COLOR_INDEX || - format == GL_STENCIL_INDEX || - format == GL_DEPTH_COMPONENT || - format == GL_INTENSITY || - type == GL_BITMAP) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D(format or type)"); - return; - } - - ctx->Separable2D.Format = format; - ctx->Separable2D.InternalFormat = internalFormat; - ctx->Separable2D.Width = width; - ctx->Separable2D.Height = height; - - if (ctx->Unpack.BufferObj->Name) { - /* unpack filter from PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, width, 1, 1, - format, type, row)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glSeparableFilter2D(invalid PBO access, width)"); - return; - } - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, height, 1, 1, - format, type, column)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glSeparableFilter2D(invalid PBO access, height)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glSeparableFilter2D(PBO is mapped)"); - return; - } - row = ADD_POINTERS(buf, row); - column = ADD_POINTERS(buf, column); - } - - /* unpack row filter */ - if (row) { - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, - ctx->Separable2D.Filter, - format, type, row, &ctx->Unpack, - 0); /* transferOps */ - - _mesa_scale_and_bias_rgba(width, - (GLfloat (*)[4]) ctx->Separable2D.Filter, - ctx->Pixel.ConvolutionFilterScale[2][0], - ctx->Pixel.ConvolutionFilterScale[2][1], - ctx->Pixel.ConvolutionFilterScale[2][2], - ctx->Pixel.ConvolutionFilterScale[2][3], - ctx->Pixel.ConvolutionFilterBias[2][0], - ctx->Pixel.ConvolutionFilterBias[2][1], - ctx->Pixel.ConvolutionFilterBias[2][2], - ctx->Pixel.ConvolutionFilterBias[2][3]); - } - - /* unpack column filter */ - if (column) { - _mesa_unpack_color_span_float(ctx, height, GL_RGBA, - &ctx->Separable2D.Filter[colStart], - format, type, column, &ctx->Unpack, - 0); /* transferOps */ - - _mesa_scale_and_bias_rgba(height, - (GLfloat (*)[4]) (ctx->Separable2D.Filter + colStart), - ctx->Pixel.ConvolutionFilterScale[2][0], - ctx->Pixel.ConvolutionFilterScale[2][1], - ctx->Pixel.ConvolutionFilterScale[2][2], - ctx->Pixel.ConvolutionFilterScale[2][3], - ctx->Pixel.ConvolutionFilterBias[2][0], - ctx->Pixel.ConvolutionFilterBias[2][1], - ctx->Pixel.ConvolutionFilterBias[2][2], - ctx->Pixel.ConvolutionFilterBias[2][3]); - } - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - ctx->NewState |= _NEW_PIXEL; -} - - -/**********************************************************************/ -/*** image convolution functions ***/ -/**********************************************************************/ - -static void -convolve_1d_reduce(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4]) -{ - GLint dstWidth; - GLint i, n; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (dstWidth <= 0) - return; /* null result */ - - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - sumR += src[i + n][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n][ACOMP] * filter[n][ACOMP]; - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_1d_constant(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - GLint i, n; - - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - if (i + n < halfFilterWidth || i + n - halfFilterWidth >= srcWidth) { - sumR += borderColor[RCOMP] * filter[n][RCOMP]; - sumG += borderColor[GCOMP] * filter[n][GCOMP]; - sumB += borderColor[BCOMP] * filter[n][BCOMP]; - sumA += borderColor[ACOMP] * filter[n][ACOMP]; - } - else { - sumR += src[i + n - halfFilterWidth][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n - halfFilterWidth][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n - halfFilterWidth][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n - halfFilterWidth][ACOMP] * filter[n][ACOMP]; - } - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_1d_replicate(GLint srcWidth, const GLfloat src[][4], - GLint filterWidth, const GLfloat filter[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - GLint i, n; - - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (n = 0; n < filterWidth; n++) { - if (i + n < halfFilterWidth) { - sumR += src[0][RCOMP] * filter[n][RCOMP]; - sumG += src[0][GCOMP] * filter[n][GCOMP]; - sumB += src[0][BCOMP] * filter[n][BCOMP]; - sumA += src[0][ACOMP] * filter[n][ACOMP]; - } - else if (i + n - halfFilterWidth >= srcWidth) { - sumR += src[srcWidth - 1][RCOMP] * filter[n][RCOMP]; - sumG += src[srcWidth - 1][GCOMP] * filter[n][GCOMP]; - sumB += src[srcWidth - 1][BCOMP] * filter[n][BCOMP]; - sumA += src[srcWidth - 1][ACOMP] * filter[n][ACOMP]; - } - else { - sumR += src[i + n - halfFilterWidth][RCOMP] * filter[n][RCOMP]; - sumG += src[i + n - halfFilterWidth][GCOMP] * filter[n][GCOMP]; - sumB += src[i + n - halfFilterWidth][BCOMP] * filter[n][BCOMP]; - sumA += src[i + n - halfFilterWidth][ACOMP] * filter[n][ACOMP]; - } - } - dest[i][RCOMP] = sumR; - dest[i][GCOMP] = sumG; - dest[i][BCOMP] = sumB; - dest[i][ACOMP] = sumA; - } -} - - -static void -convolve_2d_reduce(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4]) -{ - GLint dstWidth, dstHeight; - GLint i, j, n, m; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (filterHeight >= 1) - dstHeight = srcHeight - (filterHeight - 1); - else - dstHeight = srcHeight; - - if (dstWidth <= 0 || dstHeight <= 0) - return; - - for (j = 0; j < dstHeight; j++) { - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint k = (j + m) * srcWidth + i + n; - const GLint f = m * filterWidth + n; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - dest[j * dstWidth + i][RCOMP] = sumR; - dest[j * dstWidth + i][GCOMP] = sumG; - dest[j * dstWidth + i][BCOMP] = sumB; - dest[j * dstWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_2d_constant(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint f = m * filterWidth + n; - const GLint is = i + n - halfFilterWidth; - const GLint js = j + m - halfFilterHeight; - if (is < 0 || is >= srcWidth || - js < 0 || js >= srcHeight) { - sumR += borderColor[RCOMP] * filter[f][RCOMP]; - sumG += borderColor[GCOMP] * filter[f][GCOMP]; - sumB += borderColor[BCOMP] * filter[f][BCOMP]; - sumA += borderColor[ACOMP] * filter[f][ACOMP]; - } - else { - const GLint k = js * srcWidth + is; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_2d_replicate(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat filter[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint f = m * filterWidth + n; - GLint is = i + n - halfFilterWidth; - GLint js = j + m - halfFilterHeight; - GLint k; - if (is < 0) - is = 0; - else if (is >= srcWidth) - is = srcWidth - 1; - if (js < 0) - js = 0; - else if (js >= srcHeight) - js = srcHeight - 1; - k = js * srcWidth + is; - sumR += src[k][RCOMP] * filter[f][RCOMP]; - sumG += src[k][GCOMP] * filter[f][GCOMP]; - sumB += src[k][BCOMP] * filter[f][BCOMP]; - sumA += src[k][ACOMP] * filter[f][ACOMP]; - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_reduce(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4]) -{ - GLint dstWidth, dstHeight; - GLint i, j, n, m; - - if (filterWidth >= 1) - dstWidth = srcWidth - (filterWidth - 1); - else - dstWidth = srcWidth; - - if (filterHeight >= 1) - dstHeight = srcHeight - (filterHeight - 1); - else - dstHeight = srcHeight; - - if (dstWidth <= 0 || dstHeight <= 0) - return; - - for (j = 0; j < dstHeight; j++) { - for (i = 0; i < dstWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - GLint k = (j + m) * srcWidth + i + n; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - } - dest[j * dstWidth + i][RCOMP] = sumR; - dest[j * dstWidth + i][GCOMP] = sumG; - dest[j * dstWidth + i][BCOMP] = sumB; - dest[j * dstWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_constant(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4], - const GLfloat borderColor[4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - const GLint is = i + n - halfFilterWidth; - const GLint js = j + m - halfFilterHeight; - if (is < 0 || is >= srcWidth || - js < 0 || js >= srcHeight) { - sumR += borderColor[RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += borderColor[GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += borderColor[BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += borderColor[ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - else { - GLint k = js * srcWidth + is; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - -static void -convolve_sep_replicate(GLint srcWidth, GLint srcHeight, - const GLfloat src[][4], - GLint filterWidth, GLint filterHeight, - const GLfloat rowFilt[][4], - const GLfloat colFilt[][4], - GLfloat dest[][4]) -{ - const GLint halfFilterWidth = filterWidth / 2; - const GLint halfFilterHeight = filterHeight / 2; - GLint i, j, n, m; - - for (j = 0; j < srcHeight; j++) { - for (i = 0; i < srcWidth; i++) { - GLfloat sumR = 0.0; - GLfloat sumG = 0.0; - GLfloat sumB = 0.0; - GLfloat sumA = 0.0; - for (m = 0; m < filterHeight; m++) { - for (n = 0; n < filterWidth; n++) { - GLint is = i + n - halfFilterWidth; - GLint js = j + m - halfFilterHeight; - GLint k; - if (is < 0) - is = 0; - else if (is >= srcWidth) - is = srcWidth - 1; - if (js < 0) - js = 0; - else if (js >= srcHeight) - js = srcHeight - 1; - k = js * srcWidth + is; - sumR += src[k][RCOMP] * rowFilt[n][RCOMP] * colFilt[m][RCOMP]; - sumG += src[k][GCOMP] * rowFilt[n][GCOMP] * colFilt[m][GCOMP]; - sumB += src[k][BCOMP] * rowFilt[n][BCOMP] * colFilt[m][BCOMP]; - sumA += src[k][ACOMP] * rowFilt[n][ACOMP] * colFilt[m][ACOMP]; - } - } - dest[j * srcWidth + i][RCOMP] = sumR; - dest[j * srcWidth + i][GCOMP] = sumG; - dest[j * srcWidth + i][BCOMP] = sumB; - dest[j * srcWidth + i][ACOMP] = sumA; - } - } -} - - - -void -_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage) -{ - switch (ctx->Pixel.ConvolutionBorderMode[0]) { - case GL_REDUCE: - convolve_1d_reduce(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Convolution1D.Width, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_1d_constant(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[0]); - break; - case GL_REPLICATE_BORDER: - convolve_1d_replicate(*width, (const GLfloat (*)[4]) srcImage, - ctx->Convolution1D.Width, - (const GLfloat (*)[4]) ctx->Convolution1D.Filter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } -} - - -void -_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - switch (ctx->Pixel.ConvolutionBorderMode[1]) { - case GL_REDUCE: - convolve_2d_reduce(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4]) ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Convolution2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Convolution2D.Height, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_2d_constant(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4]) ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[1]); - break; - case GL_REPLICATE_BORDER: - convolve_2d_replicate(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Convolution2D.Width, - ctx->Convolution2D.Height, - (const GLfloat (*)[4])ctx->Convolution2D.Filter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } -} - - -void -_mesa_convolve_sep_image(const GLcontext *ctx, - GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage) -{ - const GLfloat *rowFilter = ctx->Separable2D.Filter; - const GLfloat *colFilter = rowFilter + 4 * MAX_CONVOLUTION_WIDTH; - - switch (ctx->Pixel.ConvolutionBorderMode[2]) { - case GL_REDUCE: - convolve_sep_reduce(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage); - *width = *width - (MAX2(ctx->Separable2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); - break; - case GL_CONSTANT_BORDER: - convolve_sep_constant(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage, - ctx->Pixel.ConvolutionBorderColor[2]); - break; - case GL_REPLICATE_BORDER: - convolve_sep_replicate(*width, *height, - (const GLfloat (*)[4]) srcImage, - ctx->Separable2D.Width, - ctx->Separable2D.Height, - (const GLfloat (*)[4]) rowFilter, - (const GLfloat (*)[4]) colFilter, - (GLfloat (*)[4]) dstImage); - break; - default: - ; - } -} - - - -/* - * This function computes an image's size after convolution. - * If the convolution border mode is GL_REDUCE, the post-convolution - * image will be smaller than the original. - */ -void -_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height) -{ - if (ctx->Pixel.Convolution1DEnabled - && dimensions == 1 - && ctx->Pixel.ConvolutionBorderMode[0] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Convolution1D.Width, 1) - 1); - } - else if (ctx->Pixel.Convolution2DEnabled - && dimensions > 1 - && ctx->Pixel.ConvolutionBorderMode[1] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Convolution2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Convolution2D.Height, 1) - 1); - } - else if (ctx->Pixel.Separable2DEnabled - && dimensions > 1 - && ctx->Pixel.ConvolutionBorderMode[2] == GL_REDUCE) { - *width = *width - (MAX2(ctx->Separable2D.Width, 1) - 1); - *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); - } -} diff --git a/src/libs/mesa/mesa/main/convolve.h b/src/libs/mesa/mesa/main/convolve.h deleted file mode 100644 index 4505cdae01..0000000000 --- a/src/libs/mesa/mesa/main/convolve.h +++ /dev/null @@ -1,114 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 CONVOLVE_H -#define CONVOLVE_H - - -#include "mtypes.h" - - -#if _HAVE_FULL_GL -extern void GLAPIENTRY -_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, - GLenum format, GLenum type, const GLvoid *image); - -extern void GLAPIENTRY -_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, - GLsizei height, GLenum format, GLenum type, - const GLvoid *image); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height); - -extern void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image); - -extern void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span); - -extern void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *row, const GLvoid *column); - - - -extern void -_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - - -extern void -_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - - -extern void -_mesa_convolve_sep_image(const GLcontext *ctx, - GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - - -extern void -_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); - -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/dd.h b/src/libs/mesa/mesa/main/dd.h deleted file mode 100644 index ddb38030bf..0000000000 --- a/src/libs/mesa/mesa/main/dd.h +++ /dev/null @@ -1,1136 +0,0 @@ -/** - * \file dd.h - * Device driver interfaces. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 DD_INCLUDED -#define DD_INCLUDED - -/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */ - -struct gl_pixelstore_attrib; -struct mesa_display_list; - -/** - * Device driver function table. - * Core Mesa uses these function pointers to call into device drivers. - * Most of these functions directly correspond to OpenGL state commands. - * Core Mesa will call these functions after error checking has been done - * so that the drivers don't have to worry about error testing. - * - * Vertex transformation/clipping/lighting is patched into the T&L module. - * Rasterization functions are patched into the swrast module. - * - * Note: when new functions are added here, the drivers/common/driverfuncs.c - * file should be updated too!!! - */ -struct dd_function_table { - /** - * Return a string as needed by glGetString(). - * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be - * returned. - */ - const GLubyte * (*GetString)( GLcontext *ctx, GLenum name ); - - /** - * Notify the driver after Mesa has made some internal state changes. - * - * This is in addition to any state change callbacks Mesa may already have - * made. - */ - void (*UpdateState)( GLcontext *ctx, GLbitfield new_state ); - - /** - * Get the width and height of the named buffer/window. - * - * Mesa uses this to determine when the driver's window size has changed. - * XXX OBSOLETE: this function will be removed in the future. - */ - void (*GetBufferSize)( GLframebuffer *buffer, - GLuint *width, GLuint *height ); - - /** - * Resize the given framebuffer to the given size. - * XXX OBSOLETE: this function will be removed in the future. - */ - void (*ResizeBuffers)( GLcontext *ctx, GLframebuffer *fb, - GLuint width, GLuint height); - - /** - * Called whenever an error is generated. - * __GLcontextRec::ErrorValue contains the error value. - */ - void (*Error)( GLcontext *ctx ); - - /** - * This is called whenever glFinish() is called. - */ - void (*Finish)( GLcontext *ctx ); - - /** - * This is called whenever glFlush() is called. - */ - void (*Flush)( GLcontext *ctx ); - - /** - * Clear the color/depth/stencil/accum buffer(s). - * \param buffers a bitmask of BUFFER_BIT_* flags indicating which - * renderbuffers need to be cleared. - */ - void (*Clear)( GLcontext *ctx, GLbitfield buffers ); - - /** - * Execute glAccum command. - */ - void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value ); - - - /** - * Execute glRasterPos, updating the ctx->Current.Raster fields - */ - void (*RasterPos)( GLcontext *ctx, const GLfloat v[4] ); - - /** - * \name Image-related functions - */ - /*@{*/ - - /** - * Called by glDrawPixels(). - * \p unpack describes how to unpack the source image data. - */ - void (*DrawPixels)( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ); - - /** - * Called by glReadPixels(). - */ - void (*ReadPixels)( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - GLvoid *dest ); - - /** - * Called by glCopyPixels(). - */ - void (*CopyPixels)( GLcontext *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type ); - - /** - * Called by glBitmap(). - */ - void (*Bitmap)( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ); - /*@}*/ - - - /** - * \name Texture image functions - */ - /*@{*/ - - /** - * Choose texture format. - * - * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback - * functions. The driver should examine \p internalFormat and return a - * pointer to an appropriate gl_texture_format. - */ - const struct gl_texture_format *(*ChooseTextureFormat)( GLcontext *ctx, - GLint internalFormat, GLenum srcFormat, GLenum srcType ); - - /** - * Called by glTexImage1D(). - * - * \param target user specified. - * \param format user specified. - * \param type user specified. - * \param pixels user specified. - * \param packing indicates the image packing of pixels. - * \param texObj is the target texture object. - * \param texImage is the target texture image. It will have the texture \p - * width, \p height, \p depth, \p border and \p internalFormat information. - * - * \p retainInternalCopy is returned by this function and indicates whether - * core Mesa should keep an internal copy of the texture image. - * - * Drivers should call a fallback routine from texstore.c if needed. - */ - void (*TexImage1D)( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glTexImage2D(). - * - * \sa dd_function_table::TexImage1D. - */ - void (*TexImage2D)( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glTexImage3D(). - * - * \sa dd_function_table::TexImage1D. - */ - void (*TexImage3D)( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glTexSubImage1D(). - * - * \param target user specified. - * \param level user specified. - * \param xoffset user specified. - * \param yoffset user specified. - * \param zoffset user specified. - * \param width user specified. - * \param height user specified. - * \param depth user specified. - * \param format user specified. - * \param type user specified. - * \param pixels user specified. - * \param packing indicates the image packing of pixels. - * \param texObj is the target texture object. - * \param texImage is the target texture image. It will have the texture \p - * width, \p height, \p border and \p internalFormat information. - * - * The driver should use a fallback routine from texstore.c if needed. - */ - void (*TexSubImage1D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glTexSubImage2D(). - * - * \sa dd_function_table::TexSubImage1D. - */ - void (*TexSubImage2D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glTexSubImage3D(). - * - * \sa dd_function_table::TexSubImage1D. - */ - void (*TexSubImage3D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLint depth, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glGetTexImage(). - */ - void (*GetTexImage)( GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glCopyTexImage1D(). - * - * Drivers should use a fallback routine from texstore.c if needed. - */ - void (*CopyTexImage1D)( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, GLint x, GLint y, - GLsizei width, GLint border ); - - /** - * Called by glCopyTexImage2D(). - * - * Drivers should use a fallback routine from texstore.c if needed. - */ - void (*CopyTexImage2D)( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, GLint x, GLint y, - GLsizei width, GLsizei height, GLint border ); - - /** - * Called by glCopyTexSubImage1D(). - * - * Drivers should use a fallback routine from texstore.c if needed. - */ - void (*CopyTexSubImage1D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, - GLint x, GLint y, GLsizei width ); - /** - * Called by glCopyTexSubImage2D(). - * - * Drivers should use a fallback routine from texstore.c if needed. - */ - void (*CopyTexSubImage2D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - /** - * Called by glCopyTexSubImage3D(). - * - * Drivers should use a fallback routine from texstore.c if needed. - */ - void (*CopyTexSubImage3D)( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - /** - * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled. - */ - void (*GenerateMipmap)(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj); - - /** - * Called by glTexImage[123]D when user specifies a proxy texture - * target. - * - * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails. - */ - GLboolean (*TestProxyTexImage)(GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLenum format, GLenum type, - GLint width, GLint height, - GLint depth, GLint border); - /*@}*/ - - - /** - * \name Compressed texture functions - */ - /*@{*/ - - /** - * Called by glCompressedTexImage1D(). - * - * \param target user specified. - * \param format user specified. - * \param type user specified. - * \param pixels user specified. - * \param packing indicates the image packing of pixels. - * \param texObj is the target texture object. - * \param texImage is the target texture image. It will have the texture \p - * width, \p height, \p depth, \p border and \p internalFormat information. - * - * \a retainInternalCopy is returned by this function and indicates whether - * core Mesa should keep an internal copy of the texture image. - */ - void (*CompressedTexImage1D)( GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - /** - * Called by glCompressedTexImage2D(). - * - * \sa dd_function_table::CompressedTexImage1D. - */ - void (*CompressedTexImage2D)( GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - /** - * Called by glCompressedTexImage3D(). - * - * \sa dd_function_table::CompressedTexImage3D. - */ - void (*CompressedTexImage3D)( GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); - - /** - * Called by glCompressedTexSubImage1D(). - * - * \param target user specified. - * \param level user specified. - * \param xoffset user specified. - * \param yoffset user specified. - * \param zoffset user specified. - * \param width user specified. - * \param height user specified. - * \param depth user specified. - * \param imageSize user specified. - * \param data user specified. - * \param texObj is the target texture object. - * \param texImage is the target texture image. It will have the texture \p - * width, \p height, \p depth, \p border and \p internalFormat information. - */ - void (*CompressedTexSubImage1D)(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - /** - * Called by glCompressedTexSubImage2D(). - * - * \sa dd_function_table::CompressedTexImage3D. - */ - void (*CompressedTexSubImage2D)(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLint height, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - /** - * Called by glCompressedTexSubImage3D(). - * - * \sa dd_function_table::CompressedTexImage3D. - */ - void (*CompressedTexSubImage3D)(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLint height, GLint depth, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - - /** - * Called by glGetCompressedTexImage. - */ - void (*GetCompressedTexImage)(GLcontext *ctx, GLenum target, GLint level, - GLvoid *img, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - /** - * Called to query number of bytes of storage needed to store the - * specified compressed texture. - */ - GLuint (*CompressedTextureSize)( GLcontext *ctx, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format ); - /*@}*/ - - /** - * \name Texture object functions - */ - /*@{*/ - - /** - * Called by glBindTexture(). - */ - void (*BindTexture)( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj ); - - /** - * Called to allocate a new texture object. - * A new gl_texture_object should be returned. The driver should - * attach to it any device-specific info it needs. - */ - struct gl_texture_object * (*NewTextureObject)( GLcontext *ctx, GLuint name, - GLenum target ); - /** - * Called when a texture object is about to be deallocated. - * - * Driver should delete the gl_texture_object object and anything - * hanging off of it. - */ - void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); - - /** - * Called to allocate a new texture image object. - */ - struct gl_texture_image * (*NewTextureImage)( GLcontext *ctx ); - - /** - * Called to free tImage->Data. - */ - void (*FreeTexImageData)( GLcontext *ctx, struct gl_texture_image *tImage ); - - /** Map texture image data into user space */ - void (*MapTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); - /** Unmap texture images from user space */ - void (*UnmapTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); - - /** - * Note: no context argument. This function doesn't initially look - * like it belongs here, except that the driver is the only entity - * that knows for sure how the texture memory is allocated - via - * the above callbacks. There is then an argument that the driver - * knows what memcpy paths might be fast. Typically this is invoked with - * - * to -- a pointer into texture memory allocated by NewTextureImage() above. - * from -- a pointer into client memory or a mesa temporary. - * sz -- nr bytes to copy. - */ - void* (*TextureMemCpy)( void *to, const void *from, size_t sz ); - - /** - * Called by glAreTextureResident(). - */ - GLboolean (*IsTextureResident)( GLcontext *ctx, - struct gl_texture_object *t ); - - /** - * Called by glPrioritizeTextures(). - */ - void (*PrioritizeTexture)( GLcontext *ctx, struct gl_texture_object *t, - GLclampf priority ); - - /** - * Called by glActiveTextureARB() to set current texture unit. - */ - void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber ); - - /** - * Called when the texture's color lookup table is changed. - * - * If \p tObj is NULL then the shared texture palette - * gl_texture_object::Palette is to be updated. - */ - void (*UpdateTexturePalette)( GLcontext *ctx, - struct gl_texture_object *tObj ); - /*@}*/ - - - /** - * \name Imaging functionality - */ - /*@{*/ - void (*CopyColorTable)( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - - void (*CopyColorSubTable)( GLcontext *ctx, - GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - - void (*CopyConvolutionFilter1D)( GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width ); - - void (*CopyConvolutionFilter2D)( GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLsizei height ); - /*@}*/ - - - /** - * \name Vertex/fragment program functions - */ - /*@{*/ - /** Bind a vertex/fragment program */ - void (*BindProgram)(GLcontext *ctx, GLenum target, struct gl_program *prog); - /** Allocate a new program */ - struct gl_program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id); - /** Delete a program */ - void (*DeleteProgram)(GLcontext *ctx, struct gl_program *prog); - /** Notify driver that a program string has been specified. */ - void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, - struct gl_program *prog); - /** Get value of a program register during program execution. */ - void (*GetProgramRegister)(GLcontext *ctx, enum register_file file, - GLuint index, GLfloat val[4]); - - /** Query if program can be loaded onto hardware */ - GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, - struct gl_program *prog); - - /*@}*/ - - - /** - * \name State-changing functions. - * - * \note drawing functions are above. - * - * These functions are called by their corresponding OpenGL API functions. - * They are \e also called by the gl_PopAttrib() function!!! - * May add more functions like these to the device driver in the future. - */ - /*@{*/ - /** Specify the alpha test function */ - void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLfloat ref); - /** Set the blend color */ - void (*BlendColor)(GLcontext *ctx, const GLfloat color[4]); - /** Set the blend equation */ - void (*BlendEquationSeparate)(GLcontext *ctx, GLenum modeRGB, GLenum modeA); - /** Specify pixel arithmetic */ - void (*BlendFuncSeparate)(GLcontext *ctx, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA); - /** Specify clear values for the color buffers */ - void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]); - /** Specify the clear value for the depth buffer */ - void (*ClearDepth)(GLcontext *ctx, GLclampd d); - /** Specify the clear value for the color index buffers */ - void (*ClearIndex)(GLcontext *ctx, GLuint index); - /** Specify the clear value for the stencil buffer */ - void (*ClearStencil)(GLcontext *ctx, GLint s); - /** Specify a plane against which all geometry is clipped */ - void (*ClipPlane)(GLcontext *ctx, GLenum plane, const GLfloat *equation ); - /** Enable and disable writing of frame buffer color components */ - void (*ColorMask)(GLcontext *ctx, GLboolean rmask, GLboolean gmask, - GLboolean bmask, GLboolean amask ); - /** Cause a material color to track the current color */ - void (*ColorMaterial)(GLcontext *ctx, GLenum face, GLenum mode); - /** Specify whether front- or back-facing facets can be culled */ - void (*CullFace)(GLcontext *ctx, GLenum mode); - /** Define front- and back-facing polygons */ - void (*FrontFace)(GLcontext *ctx, GLenum mode); - /** Specify the value used for depth buffer comparisons */ - void (*DepthFunc)(GLcontext *ctx, GLenum func); - /** Enable or disable writing into the depth buffer */ - void (*DepthMask)(GLcontext *ctx, GLboolean flag); - /** Specify mapping of depth values from NDC to window coordinates */ - void (*DepthRange)(GLcontext *ctx, GLclampd nearval, GLclampd farval); - /** Specify the current buffer for writing */ - void (*DrawBuffer)( GLcontext *ctx, GLenum buffer ); - /** Specify the buffers for writing for fragment programs*/ - void (*DrawBuffers)( GLcontext *ctx, GLsizei n, const GLenum *buffers ); - /** Enable or disable server-side gl capabilities */ - void (*Enable)(GLcontext *ctx, GLenum cap, GLboolean state); - /** Specify fog parameters */ - void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params); - /** Specify implementation-specific hints */ - void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode); - /** Control the writing of individual bits in the color index buffers */ - void (*IndexMask)(GLcontext *ctx, GLuint mask); - /** Set light source parameters. - * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already - * been transformed to eye-space. - */ - void (*Lightfv)(GLcontext *ctx, GLenum light, - GLenum pname, const GLfloat *params ); - /** Set the lighting model parameters */ - void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params); - /** Specify the line stipple pattern */ - void (*LineStipple)(GLcontext *ctx, GLint factor, GLushort pattern ); - /** Specify the width of rasterized lines */ - void (*LineWidth)(GLcontext *ctx, GLfloat width); - /** Specify a logical pixel operation for color index rendering */ - void (*LogicOpcode)(GLcontext *ctx, GLenum opcode); - void (*PointParameterfv)(GLcontext *ctx, GLenum pname, - const GLfloat *params); - /** Specify the diameter of rasterized points */ - void (*PointSize)(GLcontext *ctx, GLfloat size); - /** Select a polygon rasterization mode */ - void (*PolygonMode)(GLcontext *ctx, GLenum face, GLenum mode); - /** Set the scale and units used to calculate depth values */ - void (*PolygonOffset)(GLcontext *ctx, GLfloat factor, GLfloat units); - /** Set the polygon stippling pattern */ - void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask ); - /* Specifies the current buffer for reading */ - void (*ReadBuffer)( GLcontext *ctx, GLenum buffer ); - /** Set rasterization mode */ - void (*RenderMode)(GLcontext *ctx, GLenum mode ); - /** Define the scissor box */ - void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); - /** Select flat or smooth shading */ - void (*ShadeModel)(GLcontext *ctx, GLenum mode); - /** OpenGL 2.0 two-sided StencilFunc */ - void (*StencilFuncSeparate)(GLcontext *ctx, GLenum face, GLenum func, - GLint ref, GLuint mask); - /** OpenGL 2.0 two-sided StencilMask */ - void (*StencilMaskSeparate)(GLcontext *ctx, GLenum face, GLuint mask); - /** OpenGL 2.0 two-sided StencilOp */ - void (*StencilOpSeparate)(GLcontext *ctx, GLenum face, GLenum fail, - GLenum zfail, GLenum zpass); - /** Control the generation of texture coordinates */ - void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname, - const GLfloat *params); - /** Set texture environment parameters */ - void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname, - const GLfloat *param); - /** Set texture parameters */ - void (*TexParameter)(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj, - GLenum pname, const GLfloat *params); - void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat); - /** Set the viewport */ - void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); - /*@}*/ - - - /** - * \name Vertex array functions - * - * Called by the corresponding OpenGL functions. - */ - /*@{*/ - void (*VertexPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*NormalPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*ColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*FogCoordPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*IndexPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*SecondaryColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr); - void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size, - GLenum type, GLsizei stride, const GLvoid *ptr); - void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count ); - void (*UnlockArraysEXT)( GLcontext *ctx ); - /*@}*/ - - - /** - * \name State-query functions - * - * Return GL_TRUE if query was completed, GL_FALSE otherwise. - */ - /*@{*/ - /** Return the value or values of a selected parameter */ - GLboolean (*GetBooleanv)(GLcontext *ctx, GLenum pname, GLboolean *result); - /** Return the value or values of a selected parameter */ - GLboolean (*GetDoublev)(GLcontext *ctx, GLenum pname, GLdouble *result); - /** Return the value or values of a selected parameter */ - GLboolean (*GetFloatv)(GLcontext *ctx, GLenum pname, GLfloat *result); - /** Return the value or values of a selected parameter */ - GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result); - /** Return the value or values of a selected parameter */ - GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result); - /*@}*/ - - - /** - * \name Vertex/pixel buffer object functions - */ -#if FEATURE_ARB_vertex_buffer_object - /*@{*/ - void (*BindBuffer)( GLcontext *ctx, GLenum target, - struct gl_buffer_object *obj ); - - struct gl_buffer_object * (*NewBufferObject)( GLcontext *ctx, GLuint buffer, - GLenum target ); - - void (*DeleteBuffer)( GLcontext *ctx, struct gl_buffer_object *obj ); - - void (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid *data, GLenum usage, - struct gl_buffer_object *obj ); - - void (*BufferSubData)( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid *data, - struct gl_buffer_object *obj ); - - void (*GetBufferSubData)( GLcontext *ctx, GLenum target, - GLintptrARB offset, GLsizeiptrARB size, - GLvoid *data, struct gl_buffer_object *obj ); - - void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object *obj ); - - GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target, - struct gl_buffer_object *obj ); - /*@}*/ -#endif - - /** - * \name Functions for GL_EXT_framebuffer_object - */ -#if FEATURE_EXT_framebuffer_object - /*@{*/ - struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); - struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); - void (*BindFramebuffer)(GLcontext *ctx, GLenum target, - struct gl_framebuffer *fb, struct gl_framebuffer *fbread); - void (*FramebufferRenderbuffer)(GLcontext *ctx, - struct gl_framebuffer *fb, - GLenum attachment, - struct gl_renderbuffer *rb); - void (*RenderTexture)(GLcontext *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att); - void (*FinishRenderTexture)(GLcontext *ctx, - struct gl_renderbuffer_attachment *att); - /*@}*/ -#endif -#if FEATURE_EXT_framebuffer_blit - void (*BlitFramebuffer)(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); -#endif - - /** - * \name Query objects - */ - /*@{*/ - struct gl_query_object * (*NewQueryObject)(GLcontext *ctx, GLuint id); - void (*DeleteQuery)(GLcontext *ctx, struct gl_query_object *q); - void (*BeginQuery)(GLcontext *ctx, struct gl_query_object *q); - void (*EndQuery)(GLcontext *ctx, struct gl_query_object *q); - void (*CheckQuery)(GLcontext *ctx, struct gl_query_object *q); - void (*WaitQuery)(GLcontext *ctx, struct gl_query_object *q); - /*@}*/ - - - /** - * \name Vertex Array objects - */ - /*@{*/ - struct gl_array_object * (*NewArrayObject)(GLcontext *ctx, GLuint id); - void (*DeleteArrayObject)(GLcontext *ctx, struct gl_array_object *obj); - void (*BindArrayObject)(GLcontext *ctx, struct gl_array_object *obj); - /*@}*/ - - /** - * \name GLSL-related functions (ARB extensions and OpenGL 2.x) - */ - /*@{*/ - void (*AttachShader)(GLcontext *ctx, GLuint program, GLuint shader); - void (*BindAttribLocation)(GLcontext *ctx, GLuint program, GLuint index, - const GLcharARB *name); - void (*CompileShader)(GLcontext *ctx, GLuint shader); - GLuint (*CreateShader)(GLcontext *ctx, GLenum type); - GLuint (*CreateProgram)(GLcontext *ctx); - void (*DeleteProgram2)(GLcontext *ctx, GLuint program); - void (*DeleteShader)(GLcontext *ctx, GLuint shader); - void (*DetachShader)(GLcontext *ctx, GLuint program, GLuint shader); - void (*GetActiveAttrib)(GLcontext *ctx, GLuint program, GLuint index, - GLsizei maxLength, GLsizei * length, GLint * size, - GLenum * type, GLcharARB * name); - void (*GetActiveUniform)(GLcontext *ctx, GLuint program, GLuint index, - GLsizei maxLength, GLsizei *length, GLint *size, - GLenum *type, GLcharARB *name); - void (*GetAttachedShaders)(GLcontext *ctx, GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj); - GLint (*GetAttribLocation)(GLcontext *ctx, GLuint program, - const GLcharARB *name); - GLuint (*GetHandle)(GLcontext *ctx, GLenum pname); - void (*GetProgramiv)(GLcontext *ctx, GLuint program, - GLenum pname, GLint *params); - void (*GetProgramInfoLog)(GLcontext *ctx, GLuint program, GLsizei bufSize, - GLsizei *length, GLchar *infoLog); - void (*GetShaderiv)(GLcontext *ctx, GLuint shader, - GLenum pname, GLint *params); - void (*GetShaderInfoLog)(GLcontext *ctx, GLuint shader, GLsizei bufSize, - GLsizei *length, GLchar *infoLog); - void (*GetShaderSource)(GLcontext *ctx, GLuint shader, GLsizei maxLength, - GLsizei *length, GLcharARB *sourceOut); - void (*GetUniformfv)(GLcontext *ctx, GLuint program, GLint location, - GLfloat *params); - void (*GetUniformiv)(GLcontext *ctx, GLuint program, GLint location, - GLint *params); - GLint (*GetUniformLocation)(GLcontext *ctx, GLuint program, - const GLcharARB *name); - GLboolean (*IsProgram)(GLcontext *ctx, GLuint name); - GLboolean (*IsShader)(GLcontext *ctx, GLuint name); - void (*LinkProgram)(GLcontext *ctx, GLuint program); - void (*ShaderSource)(GLcontext *ctx, GLuint shader, const GLchar *source); - void (*Uniform)(GLcontext *ctx, GLint location, GLsizei count, - const GLvoid *values, GLenum type); - void (*UniformMatrix)(GLcontext *ctx, GLint cols, GLint rows, - GLenum matrixType, GLint location, GLsizei count, - GLboolean transpose, const GLfloat *values); - void (*UseProgram)(GLcontext *ctx, GLuint program); - void (*ValidateProgram)(GLcontext *ctx, GLuint program); - /* XXX many more to come */ - /*@}*/ - - - /** - * \name Support for multiple T&L engines - */ - /*@{*/ - - /** - * Bitmask of state changes that require the current T&L module to be - * validated, using ValidateTnlModule() below. - */ - GLuint NeedValidate; - - /** - * Validate the current T&L module. - * - * This is called directly after UpdateState() when a state change that has - * occurred matches the dd_function_table::NeedValidate bitmask above. This - * ensures all computed values are up to date, thus allowing the driver to - * decide if the current T&L module needs to be swapped out. - * - * This must be non-NULL if a driver installs a custom T&L module and sets - * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise. - */ - void (*ValidateTnlModule)( GLcontext *ctx, GLuint new_state ); - - -#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) -#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) -#define PRIM_UNKNOWN (GL_POLYGON+3) - - /** - * Set by the driver-supplied T&L engine. - * - * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd(). - */ - GLuint CurrentExecPrimitive; - - /** - * Current state of an in-progress compilation. - * - * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END, - * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above. - */ - GLuint CurrentSavePrimitive; - - -#define FLUSH_STORED_VERTICES 0x1 -#define FLUSH_UPDATE_CURRENT 0x2 - /** - * Set by the driver-supplied T&L engine whenever vertices are buffered - * between glBegin()/glEnd() objects or __GLcontextRec::Current is not - * updated. - * - * The dd_function_table::FlushVertices call below may be used to resolve - * these conditions. - */ - GLuint NeedFlush; - GLuint SaveNeedFlush; - - /** - * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if - * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered - * vertices, if FLUSH_UPDATE_CURRENT bit is set updates - * __GLcontextRec::Current and gl_light_attrib::Material - * - * Note that the default T&L engine never clears the - * FLUSH_UPDATE_CURRENT bit, even after performing the update. - */ - void (*FlushVertices)( GLcontext *ctx, GLuint flags ); - void (*SaveFlushVertices)( GLcontext *ctx ); - - /** - * Give the driver the opportunity to hook in its own vtxfmt for - * compiling optimized display lists. This is called on each valid - * glBegin() during list compilation. - */ - GLboolean (*NotifySaveBegin)( GLcontext *ctx, GLenum mode ); - - /** - * Notify driver that the special derived value _NeedEyeCoords has - * changed. - */ - void (*LightingSpaceChange)( GLcontext *ctx ); - - /** - * Called by glNewList(). - * - * Let the T&L component know what is going on with display lists - * in time to make changes to dispatch tables, etc. - */ - void (*NewList)( GLcontext *ctx, GLuint list, GLenum mode ); - /** - * Called by glEndList(). - * - * \sa dd_function_table::NewList. - */ - void (*EndList)( GLcontext *ctx ); - - /** - * Called by glCallList(s). - * - * Notify the T&L component before and after calling a display list. - */ - void (*BeginCallList)( GLcontext *ctx, - struct mesa_display_list *dlist ); - /** - * Called by glEndCallList(). - * - * \sa dd_function_table::BeginCallList. - */ - void (*EndCallList)( GLcontext *ctx ); - -}; - - -/** - * Transform/Clip/Lighting interface - * - * Drivers present a reduced set of the functions possible in - * glBegin()/glEnd() objects. Core mesa provides translation stubs for the - * remaining functions to map down to these entry points. - * - * These are the initial values to be installed into dispatch by - * mesa. If the T&L driver wants to modify the dispatch table - * while installed, it must do so itself. It would be possible for - * the vertexformat to install it's own initial values for these - * functions, but this way there is an obvious list of what is - * expected of the driver. - * - * If the driver wants to hook in entry points other than those - * listed, it must restore them to their original values in - * the disable() callback, below. - */ -typedef struct { - /** - * \name Vertex - */ - /*@{*/ - void (GLAPIENTRYP ArrayElement)( GLint ); /* NOTE */ - void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP Color3fv)( const GLfloat * ); - void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP Color4fv)( const GLfloat * ); - void (GLAPIENTRYP EdgeFlag)( GLboolean ); - void (GLAPIENTRYP EvalCoord1f)( GLfloat ); /* NOTE */ - void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * ); /* NOTE */ - void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat ); /* NOTE */ - void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * ); /* NOTE */ - void (GLAPIENTRYP EvalPoint1)( GLint ); /* NOTE */ - void (GLAPIENTRYP EvalPoint2)( GLint, GLint ); /* NOTE */ - void (GLAPIENTRYP FogCoordfEXT)( GLfloat ); - void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * ); - void (GLAPIENTRYP Indexf)( GLfloat ); - void (GLAPIENTRYP Indexfv)( const GLfloat * ); - void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * ); /* NOTE */ - void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat ); - void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * ); - void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat ); - void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * ); - void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * ); - void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * ); - void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP Normal3fv)( const GLfloat * ); - void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * ); - void (GLAPIENTRYP TexCoord1f)( GLfloat ); - void (GLAPIENTRYP TexCoord1fv)( const GLfloat * ); - void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat ); - void (GLAPIENTRYP TexCoord2fv)( const GLfloat * ); - void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP TexCoord3fv)( const GLfloat * ); - void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP TexCoord4fv)( const GLfloat * ); - void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat ); - void (GLAPIENTRYP Vertex2fv)( const GLfloat * ); - void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP Vertex3fv)( const GLfloat * ); - void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP Vertex4fv)( const GLfloat * ); - void (GLAPIENTRYP CallList)( GLuint ); /* NOTE */ - void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * ); /* NOTE */ - void (GLAPIENTRYP Begin)( GLenum ); - void (GLAPIENTRYP End)( void ); - /* GL_NV_vertex_program */ - void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x ); - void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y ); - void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z ); - void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); - void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v ); -#if FEATURE_ARB_vertex_program - void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x ); - void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y ); - void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z ); - void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v ); - void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); - void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v ); -#endif - /*@}*/ - - /* - */ - void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat ); - - /** - * \name Array - */ - /*@{*/ - void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count ); - void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices ); - void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ); - /*@}*/ - - /** - * \name Eval - * - * If you don't support eval, fallback to the default vertex format - * on receiving an eval call and use the pipeline mechanism to - * provide partial T&L acceleration. - * - * Mesa will provide a set of helper functions to do eval within - * accelerated vertex formats, eventually... - */ - /*@{*/ - void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 ); - void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - /*@}*/ - -} GLvertexformat; - - -#endif /* DD_INCLUDED */ diff --git a/src/libs/mesa/mesa/main/debug.c b/src/libs/mesa/mesa/main/debug.c deleted file mode 100644 index 77fef32558..0000000000 --- a/src/libs/mesa/mesa/main/debug.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -#include "mtypes.h" -#include "context.h" -#include "imports.h" -#include "debug.h" -#include "get.h" - -/** - * Primitive names - */ -const char *_mesa_prim_name[GL_POLYGON+4] = { - "GL_POINTS", - "GL_LINES", - "GL_LINE_LOOP", - "GL_LINE_STRIP", - "GL_TRIANGLES", - "GL_TRIANGLE_STRIP", - "GL_TRIANGLE_FAN", - "GL_QUADS", - "GL_QUAD_STRIP", - "GL_POLYGON", - "outside begin/end", - "inside unkown primitive", - "unknown state" -}; - -void -_mesa_print_state( const char *msg, GLuint state ) -{ - _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - msg, - state, - (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", - (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", - (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", - (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "", - (state & _NEW_ACCUM) ? "ctx->Accum, " : "", - (state & _NEW_COLOR) ? "ctx->Color, " : "", - (state & _NEW_DEPTH) ? "ctx->Depth, " : "", - (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "", - (state & _NEW_FOG) ? "ctx->Fog, " : "", - (state & _NEW_HINT) ? "ctx->Hint, " : "", - (state & _NEW_LIGHT) ? "ctx->Light, " : "", - (state & _NEW_LINE) ? "ctx->Line, " : "", - (state & _NEW_PIXEL) ? "ctx->Pixel, " : "", - (state & _NEW_POINT) ? "ctx->Point, " : "", - (state & _NEW_POLYGON) ? "ctx->Polygon, " : "", - (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "", - (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "", - (state & _NEW_TEXTURE) ? "ctx->Texture, " : "", - (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "", - (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "", - (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "", - (state & _NEW_ARRAY) ? "ctx->Array, " : "", - (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "", - (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : ""); -} - - - -void -_mesa_print_tri_caps( const char *name, GLuint flags ) -{ - _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - name, - flags, - (flags & DD_FLATSHADE) ? "flat-shade, " : "", - (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "", - (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "", - (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "", - (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "", - (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "", - (flags & DD_TRI_OFFSET) ? "tri-offset, " : "", - (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "", - (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "", - (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "", - (flags & DD_LINE_WIDTH) ? "line-wide, " : "", - (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "", - (flags & DD_POINT_SIZE) ? "point-size, " : "", - (flags & DD_POINT_ATTEN) ? "point-atten, " : "", - (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "" - ); -} - - -/** - * Print information about this Mesa version and build options. - */ -void _mesa_print_info( void ) -{ - _mesa_debug(NULL, "Mesa GL_VERSION = %s\n", - (char *) _mesa_GetString(GL_VERSION)); - _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n", - (char *) _mesa_GetString(GL_RENDERER)); - _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n", - (char *) _mesa_GetString(GL_VENDOR)); - _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n", - (char *) _mesa_GetString(GL_EXTENSIONS)); -#if defined(THREADS) - _mesa_debug(NULL, "Mesa thread-safe: YES\n"); -#else - _mesa_debug(NULL, "Mesa thread-safe: NO\n"); -#endif -#if defined(USE_X86_ASM) - _mesa_debug(NULL, "Mesa x86-optimized: YES\n"); -#else - _mesa_debug(NULL, "Mesa x86-optimized: NO\n"); -#endif -#if defined(USE_SPARC_ASM) - _mesa_debug(NULL, "Mesa sparc-optimized: YES\n"); -#else - _mesa_debug(NULL, "Mesa sparc-optimized: NO\n"); -#endif -} - - -/** - * Set the debugging flags. - * - * \param debug debug string - * - * If compiled with debugging support then search for keywords in \p debug and - * enables the verbose debug output of the respective feature. - */ -static void add_debug_flags( const char *debug ) -{ -#ifdef DEBUG - struct debug_option { - const char *name; - GLbitfield flag; - }; - static const struct debug_option debug_opt[] = { - { "varray", VERBOSE_VARRAY }, - { "tex", VERBOSE_TEXTURE }, - { "imm", VERBOSE_IMMEDIATE }, - { "pipe", VERBOSE_PIPELINE }, - { "driver", VERBOSE_DRIVER }, - { "state", VERBOSE_STATE }, - { "api", VERBOSE_API }, - { "list", VERBOSE_DISPLAY_LIST }, - { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM }, - { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ - { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ - }; - GLuint i; - - MESA_VERBOSE = 0x0; - for (i = 0; i < Elements(debug_opt); i++) { - if (_mesa_strstr(debug, debug_opt[i].name)) - MESA_VERBOSE |= debug_opt[i].flag; - } - - /* Debug flag: - */ - if (_mesa_strstr(debug, "flush")) - MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; - -#if defined(_FPU_GETCW) && defined(_FPU_SETCW) - if (_mesa_strstr(debug, "fpexceptions")) { - /* raise FP exceptions */ - fpu_control_t mask; - _FPU_GETCW(mask); - mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM - | _FPU_MASK_OM | _FPU_MASK_UM); - _FPU_SETCW(mask); - } -#endif - -#else - (void) debug; -#endif -} - - -void -_mesa_init_debug( GLcontext *ctx ) -{ - char *c; - - /* Dither disable */ - ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; - if (ctx->NoDither) { - if (_mesa_getenv("MESA_DEBUG")) { - _mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n"); - } - ctx->Color.DitherFlag = GL_FALSE; - } - - c = _mesa_getenv("MESA_DEBUG"); - if (c) - add_debug_flags(c); - - c = _mesa_getenv("MESA_VERBOSE"); - if (c) - add_debug_flags(c); -} - diff --git a/src/libs/mesa/mesa/main/debug.h b/src/libs/mesa/mesa/main/debug.h deleted file mode 100644 index 94d99c384b..0000000000 --- a/src/libs/mesa/mesa/main/debug.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - -/** - * \file debug.h - * Debugging functions. - * - * \if subset - * (No-op) - * - * \endif - */ - - -#ifndef _DEBUG_H -#define _DEBUG_H - -#if _HAVE_FULL_GL - -extern void _mesa_print_tri_caps( const char *name, GLuint flags ); -extern void _mesa_print_enable_flags( const char *msg, GLuint flags ); -extern void _mesa_print_state( const char *msg, GLuint state ); -extern void _mesa_print_info( void ); -extern void _mesa_init_debug( GLcontext *ctx ); - -#else - -/** No-op */ -#define _mesa_print_state( m, s ) ((void)0) - -/** No-op */ -#define _mesa_print_info() ((void)0) - -/** No-op */ -#define _mesa_init_debug( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/depth.c b/src/libs/mesa/mesa/main/depth.c deleted file mode 100644 index 91c036ef96..0000000000 --- a/src/libs/mesa/mesa/main/depth.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "depth.h" -#include "enums.h" -#include "macros.h" -#include "mtypes.h" - - -/**********************************************************************/ -/***** API Functions *****/ -/**********************************************************************/ - - - -void GLAPIENTRY -_mesa_ClearDepth( GLclampd depth ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - depth = CLAMP( depth, 0.0, 1.0 ); - - if (ctx->Depth.Clear == depth) - return; - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Clear = depth; - if (ctx->Driver.ClearDepth) - (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear ); -} - - - -void GLAPIENTRY -_mesa_DepthFunc( GLenum func ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); - - switch (func) { - case GL_LESS: /* (default) pass if incoming z < stored z */ - case GL_GEQUAL: - case GL_LEQUAL: - case GL_GREATER: - case GL_NOTEQUAL: - case GL_EQUAL: - case GL_ALWAYS: - case GL_NEVER: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glDepth.Func" ); - return; - } - - if (ctx->Depth.Func == func) - return; - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Func = func; - - if (ctx->Driver.DepthFunc) - ctx->Driver.DepthFunc( ctx, func ); -} - - - -void GLAPIENTRY -_mesa_DepthMask( GLboolean flag ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glDepthMask %d\n", flag); - - /* - * GL_TRUE indicates depth buffer writing is enabled (default) - * GL_FALSE indicates depth buffer writing is disabled - */ - if (ctx->Depth.Mask == flag) - return; - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Mask = flag; - - if (ctx->Driver.DepthMask) - ctx->Driver.DepthMask( ctx, flag ); -} - - - -/** - * Specified by the GL_EXT_depth_bounds_test extension. - */ -void GLAPIENTRY -_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (zmin > zmax) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)"); - return; - } - - zmin = CLAMP(zmin, 0.0, 1.0); - zmax = CLAMP(zmax, 0.0, 1.0); - - if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax) - return; - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.BoundsMin = (GLfloat) zmin; - ctx->Depth.BoundsMax = (GLfloat) zmax; -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - - -/** - * Initialize the depth buffer attribute group in the given context. - */ -void -_mesa_init_depth(GLcontext *ctx) -{ - ctx->Depth.Test = GL_FALSE; - ctx->Depth.Clear = 1.0; - ctx->Depth.Func = GL_LESS; - ctx->Depth.Mask = GL_TRUE; -} diff --git a/src/libs/mesa/mesa/main/depth.h b/src/libs/mesa/mesa/main/depth.h deleted file mode 100644 index dcc0b4637a..0000000000 --- a/src/libs/mesa/mesa/main/depth.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * \file depth.h - * Depth buffer operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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 DEPTH_H -#define DEPTH_H - - -#include "mtypes.h" - - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_ClearDepth( GLclampd depth ); - -extern void GLAPIENTRY -_mesa_DepthFunc( GLenum func ); - -extern void GLAPIENTRY -_mesa_DepthMask( GLboolean flag ); - -extern void GLAPIENTRY -_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ); - -extern void -_mesa_init_depth( GLcontext * ctx ); - -#else - -/** No-op */ -#define _mesa_init_depth( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/depthstencil.c b/src/libs/mesa/mesa/main/depthstencil.c deleted file mode 100644 index 9d208e2997..0000000000 --- a/src/libs/mesa/mesa/main/depthstencil.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "fbobject.h" -#include "mtypes.h" -#include "depthstencil.h" -#include "renderbuffer.h" - - -/** - * Adaptor/wrappers for GL_DEPTH_STENCIL renderbuffers. - * - * The problem with a GL_DEPTH_STENCIL renderbuffer is that sometimes we - * want to treat it as a stencil buffer, other times we want to treat it - * as a depth/z buffer and still other times when we want to treat it as - * a combined Z+stencil buffer! That implies we need three different sets - * of Get/Put functions. - * - * We solve this by wrapping the Z24_S8 renderbuffer with depth and stencil - * adaptors, each with the right kind of depth/stencil Get/Put functions. - */ - - -static void * -nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) -{ - (void) ctx; - (void) rb; - (void) x; - (void) y; - return NULL; -} - - -/** - * Delete a depth or stencil wrapper renderbuffer. - */ -static void -delete_wrapper(struct gl_renderbuffer *rb) -{ - struct gl_renderbuffer *dsrb = rb->Wrapped; - ASSERT(dsrb); - ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 || - rb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - /* decrement refcount on the wrapped buffer and delete it if necessary */ - dsrb->RefCount--; - if (dsrb->RefCount <= 0) { - dsrb->Delete(dsrb); - } - _mesa_free(rb); -} - - -/** - * Realloc storage for wrapper. - */ -static GLboolean -alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, GLuint width, GLuint height) -{ - /* just pass this on to the wrapped renderbuffer */ - struct gl_renderbuffer *dsrb = rb->Wrapped; - GLboolean retVal; - - (void) internalFormat; - - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - - retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height); - if (retVal) { - rb->Width = width; - rb->Height = height; - } - return retVal; -} - - - - -/*====================================================================== - * Depth wrapper around depth/stencil renderbuffer - */ - -static void -get_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, - GLint x, GLint y, void *values) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - GLuint *dst = (GLuint *) values; - const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (!src) { - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - src = temp; - } - for (i = 0; i < count; i++) { - dst[i] = src[i] >> 8; - } -} - -static void -get_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - GLuint *dst = (GLuint *) values; - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(count <= MAX_WIDTH); - /* don't bother trying direct access */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - dst[i] = temp[i] >> 8; - } -} - -static void -put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLuint *src = (const GLuint *) values; - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dst) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (src[i] << 8) | (dst[i] & 0xff); - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLuint shiftedVal = *((GLuint *) value) << 8; - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dst) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = shiftedVal | (dst[i] & 0xff); - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, - const GLint x[], const GLint y[], - const void *values, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLuint *src = (const GLuint *) values; - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); - *dst = (src[i] << 8) | (*dst & 0xff); - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - const GLuint shiftedVal = *((GLuint *) value) << 8; - /* get, modify, put */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); -} - - -/** - * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like - * a depth renderbuffer. - * \return new depth renderbuffer - */ -struct gl_renderbuffer * -_mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, - struct gl_renderbuffer *dsrb) -{ - struct gl_renderbuffer *z24rb; - - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - - z24rb = _mesa_new_renderbuffer(ctx, 0); - if (!z24rb) - return NULL; - - z24rb->Wrapped = dsrb; - z24rb->Name = dsrb->Name; - z24rb->RefCount = 1; - z24rb->Width = dsrb->Width; - z24rb->Height = dsrb->Height; - z24rb->InternalFormat = GL_DEPTH_COMPONENT24; - z24rb->_ActualFormat = GL_DEPTH_COMPONENT24; - z24rb->_BaseFormat = GL_DEPTH_COMPONENT; - z24rb->DataType = GL_UNSIGNED_INT; - z24rb->DepthBits = 24; - z24rb->Data = NULL; - z24rb->Delete = delete_wrapper; - z24rb->AllocStorage = alloc_wrapper_storage; - z24rb->GetPointer = nop_get_pointer; - z24rb->GetRow = get_row_z24; - z24rb->GetValues = get_values_z24; - z24rb->PutRow = put_row_z24; - z24rb->PutRowRGB = NULL; - z24rb->PutMonoRow = put_mono_row_z24; - z24rb->PutValues = put_values_z24; - z24rb->PutMonoValues = put_mono_values_z24; - - return z24rb; -} - - -/*====================================================================== - * Stencil wrapper around depth/stencil renderbuffer - */ - -static void -get_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - GLint x, GLint y, void *values) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - GLubyte *dst = (GLubyte *) values; - const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (!src) { - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - src = temp; - } - for (i = 0; i < count; i++) { - dst[i] = src[i] & 0xff; - } -} - -static void -get_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - GLubyte *dst = (GLubyte *) values; - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(count <= MAX_WIDTH); - /* don't bother trying direct access */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - dst[i] = temp[i] & 0xff; - } -} - -static void -put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - const GLubyte *src = (const GLubyte *) values; - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dst) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | src[i]; - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - const GLubyte val = *((GLubyte *) value); - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dst) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | val; - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | val; - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - const GLint x[], const GLint y[], - const void *values, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - const GLubyte *src = (const GLubyte *) values; - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { - /* direct access */ - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); - *dst = (*dst & 0xffffff00) | src[i]; - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); - } -} - -static void -put_mono_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, - const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - const GLubyte val = *((GLubyte *) value); - /* get, modify, put */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff) | val; - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); -} - - -/** - * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like - * a stencil renderbuffer. - * \return new stencil renderbuffer - */ -struct gl_renderbuffer * -_mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb) -{ - struct gl_renderbuffer *s8rb; - - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - - s8rb = _mesa_new_renderbuffer(ctx, 0); - if (!s8rb) - return NULL; - - s8rb->Wrapped = dsrb; - s8rb->Name = dsrb->Name; - s8rb->RefCount = 1; - s8rb->Width = dsrb->Width; - s8rb->Height = dsrb->Height; - s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT; - s8rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - s8rb->_BaseFormat = GL_STENCIL_INDEX; - s8rb->DataType = GL_UNSIGNED_BYTE; - s8rb->StencilBits = 8; - s8rb->Data = NULL; - s8rb->Delete = delete_wrapper; - s8rb->AllocStorage = alloc_wrapper_storage; - s8rb->GetPointer = nop_get_pointer; - s8rb->GetRow = get_row_s8; - s8rb->GetValues = get_values_s8; - s8rb->PutRow = put_row_s8; - s8rb->PutRowRGB = NULL; - s8rb->PutMonoRow = put_mono_row_s8; - s8rb->PutValues = put_values_s8; - s8rb->PutMonoValues = put_mono_values_s8; - - return s8rb; -} - - - -/** - ** The following functions are useful for hardware drivers that only - ** implement combined depth/stencil buffers. - ** The GL_EXT_framebuffer_object extension allows indepedent depth and - ** stencil buffers to be used in any combination. - ** Therefore, we sometimes have to merge separate depth and stencil - ** renderbuffers into a single depth+stencil renderbuffer. And sometimes - ** we have to split combined depth+stencil renderbuffers into separate - ** renderbuffers. - **/ - - -/** - * Extract stencil values from the combined depth/stencil renderbuffer, storing - * the values into a separate stencil renderbuffer. - * \param dsRb the source depth/stencil renderbuffer - * \param stencilRb the destination stencil renderbuffer - * (either 8-bit or 32-bit) - */ -void -_mesa_extract_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb) -{ - GLuint row, width, height; - - ASSERT(dsRb); - ASSERT(stencilRb); - - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - ASSERT(dsRb->Width == stencilRb->Width); - ASSERT(dsRb->Height == stencilRb->Height); - - width = dsRb->Width; - height = dsRb->Height; - - for (row = 0; row < height; row++) { - GLuint depthStencil[MAX_WIDTH]; - dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { - /* 8bpp stencil */ - GLubyte stencil[MAX_WIDTH]; - GLuint i; - for (i = 0; i < width; i++) { - stencil[i] = depthStencil[i] & 0xff; - } - stencilRb->PutRow(ctx, stencilRb, width, 0, row, stencil, NULL); - } - else { - /* 32bpp stencil */ - /* the 24 depth bits will be ignored */ - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - stencilRb->PutRow(ctx, stencilRb, width, 0, row, depthStencil, NULL); - } - } -} - - -/** - * Copy stencil values from a stencil renderbuffer into a combined - * depth/stencil renderbuffer. - * \param dsRb the destination depth/stencil renderbuffer - * \param stencilRb the source stencil buffer (either 8-bit or 32-bit) - */ -void -_mesa_insert_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb) -{ - GLuint row, width, height; - - ASSERT(dsRb); - ASSERT(stencilRb); - - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - - ASSERT(dsRb->Width == stencilRb->Width); - ASSERT(dsRb->Height == stencilRb->Height); - - width = dsRb->Width; - height = dsRb->Height; - - for (row = 0; row < height; row++) { - GLuint depthStencil[MAX_WIDTH]; - - dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { - /* 8bpp stencil */ - GLubyte stencil[MAX_WIDTH]; - GLuint i; - stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil); - for (i = 0; i < width; i++) { - depthStencil[i] = (depthStencil[i] & 0xffffff00) | stencil[i]; - } - } - else { - /* 32bpp stencil buffer */ - GLuint stencil[MAX_WIDTH], i; - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); - ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil); - for (i = 0; i < width; i++) { - depthStencil[i] - = (depthStencil[i] & 0xffffff00) | (stencil[i] & 0xff); - } - } - - dsRb->PutRow(ctx, dsRb, width, 0, row, depthStencil, NULL); - } -} - - -/** - * Convert the stencil buffer from 8bpp to 32bpp depth/stencil. - * \param stencilRb the stencil renderbuffer to promote - */ -void -_mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) -{ - const GLsizei width = stencilRb->Width; - const GLsizei height = stencilRb->Height; - GLubyte *data; - GLint i, j, k; - - ASSERT(stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - ASSERT(stencilRb->Data); - - data = (GLubyte *) stencilRb->Data; - stencilRb->Data = NULL; - stencilRb->AllocStorage(ctx, stencilRb, GL_DEPTH24_STENCIL8_EXT, - width, height); - - ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - - k = 0; - for (i = 0; i < height; i++) { - GLuint depthStencil[MAX_WIDTH]; - for (j = 0; j < width; j++) { - depthStencil[j] = data[k++]; - } - stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL); - } - _mesa_free(data); - - stencilRb->_BaseFormat = GL_DEPTH_STENCIL_EXT; -} diff --git a/src/libs/mesa/mesa/main/depthstencil.h b/src/libs/mesa/mesa/main/depthstencil.h deleted file mode 100644 index 3dde081f5a..0000000000 --- a/src/libs/mesa/mesa/main/depthstencil.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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 DEPTHSTENCIL_H -#define DEPTHSTENCIL_H - - -extern struct gl_renderbuffer * -_mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, - struct gl_renderbuffer *dsrb); - - -extern struct gl_renderbuffer * -_mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, - struct gl_renderbuffer *dsrb); - - -extern void -_mesa_extract_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb); - - -extern void -_mesa_insert_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb); - - -extern void -_mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb); - - -#endif /* DEPTHSTENCIL_H */ diff --git a/src/libs/mesa/mesa/main/dispatch.c b/src/libs/mesa/mesa/main/dispatch.c deleted file mode 100644 index 34127cb248..0000000000 --- a/src/libs/mesa/mesa/main/dispatch.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - */ - - -/** - * \file dispatch.c - * - * This file generates all the gl* function entrypoints. This code is not - * used if optimized assembly stubs are available (e.g., using x86/glapi_x86.S - * on IA32 or sparc/glapi_sparc.S on SPARC). - * - * \note - * This file is also used to build the client-side libGL that loads DRI-based - * device drivers. At build-time it is symlinked to src/glx/x11. - * - * \author Brian Paul - */ - -#ifndef GLX_USE_APPLEGL - -#include "main/glheader.h" -#include "glapi/glapi.h" -#include "glapi/glapitable.h" -#include "glapi/glthread.h" - - -#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM)) - -#if defined(WIN32) -#define KEYWORD1 GLAPI -#else -#define KEYWORD1 PUBLIC -#endif - -#define KEYWORD2 GLAPIENTRY - -#if defined(USE_MGL_NAMESPACE) -#define NAME(func) mgl##func -#else -#define NAME(func) gl##func -#endif - -#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */ - -#define F stdout -#define DISPATCH(FUNC, ARGS, MESSAGE) \ - fprintf MESSAGE; \ - CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ - fprintf MESSAGE; \ - return CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#else - -#define DISPATCH(FUNC, ARGS, MESSAGE) \ - CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ - return CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#endif /* logging */ - - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#include "glapi/dispatch.h" -#include "glapi/glapitemp.h" - -#endif /* USE_X86_ASM */ - -#endif /* !GLX_USE_APPLEGL */ diff --git a/src/libs/mesa/mesa/main/dlist.c b/src/libs/mesa/mesa/main/dlist.c deleted file mode 100644 index d3aee196c7..0000000000 --- a/src/libs/mesa/mesa/main/dlist.c +++ /dev/null @@ -1,8596 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file dlist.c - * Display lists management functions. - */ - -#include "glheader.h" -#include "imports.h" -#include "api_arrayelt.h" -#include "api_loopback.h" -#include "config.h" -#include "attrib.h" -#include "blend.h" -#include "buffers.h" -#if FEATURE_ARB_vertex_buffer_object -#include "bufferobj.h" -#endif -#include "arrayobj.h" -#include "clip.h" -#include "colortab.h" -#include "context.h" -#include "convolve.h" -#include "depth.h" -#include "dlist.h" -#include "enable.h" -#include "enums.h" -#include "eval.h" -#include "extensions.h" -#include "feedback.h" -#include "framebuffer.h" -#include "get.h" -#include "glapi/glapi.h" -#include "hash.h" -#include "histogram.h" -#include "image.h" -#include "light.h" -#include "lines.h" -#include "dlist.h" -#include "macros.h" -#include "matrix.h" -#include "pixel.h" -#include "points.h" -#include "polygon.h" -#include "queryobj.h" -#include "state.h" -#include "texobj.h" -#include "teximage.h" -#include "texstate.h" -#include "mtypes.h" -#include "varray.h" -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -#include "shader/arbprogram.h" -#include "shader/program.h" -#endif -#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program -#include "shader/nvprogram.h" -#include "shader/program.h" -#endif -#if FEATURE_ATI_fragment_shader -#include "shader/atifragshader.h" -#endif - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "glapi/dispatch.h" - - -/** - * Flush vertices. - * - * \param ctx GL context. - * - * Checks if dd_function_table::SaveNeedFlush is marked to flush - * stored (save) vertices, and calls - * dd_function_table::SaveFlushVertices if so. - */ -#define SAVE_FLUSH_VERTICES(ctx) \ -do { \ - if (ctx->Driver.SaveNeedFlush) \ - ctx->Driver.SaveFlushVertices(ctx); \ -} while (0) - - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair, with return value. - * - * \param ctx GL context. - * \param retval value to return value in case the assertion fails. - */ -#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \ -do { \ - if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \ - ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \ - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ - return retval; \ - } \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair. - * - * \param ctx GL context. - */ -#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \ -do { \ - if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \ - ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \ - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ - return; \ - } \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair and flush the vertices. - * - * \param ctx GL context. - */ -#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \ -do { \ - ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \ - SAVE_FLUSH_VERTICES(ctx); \ -} while (0) - -/** - * Macro to assert that the API call was made outside the - * glBegin()/glEnd() pair and flush the vertices, with return value. - * - * \param ctx GL context. - * \param retval value to return value in case the assertion fails. - */ -#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\ -do { \ - ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \ - SAVE_FLUSH_VERTICES(ctx); \ -} while (0) - - - -/** - * Display list opcodes. - * - * The fact that these identifiers are assigned consecutive - * integer values starting at 0 is very important, see InstSize array usage) - */ -typedef enum -{ - OPCODE_INVALID = -1, /* Force signed enum */ - OPCODE_ACCUM, - OPCODE_ALPHA_FUNC, - OPCODE_BIND_TEXTURE, - OPCODE_BITMAP, - OPCODE_BLEND_COLOR, - OPCODE_BLEND_EQUATION, - OPCODE_BLEND_EQUATION_SEPARATE, - OPCODE_BLEND_FUNC_SEPARATE, - OPCODE_CALL_LIST, - OPCODE_CALL_LIST_OFFSET, - OPCODE_CLEAR, - OPCODE_CLEAR_ACCUM, - OPCODE_CLEAR_COLOR, - OPCODE_CLEAR_DEPTH, - OPCODE_CLEAR_INDEX, - OPCODE_CLEAR_STENCIL, - OPCODE_CLIP_PLANE, - OPCODE_COLOR_MASK, - OPCODE_COLOR_MATERIAL, - OPCODE_COLOR_TABLE, - OPCODE_COLOR_TABLE_PARAMETER_FV, - OPCODE_COLOR_TABLE_PARAMETER_IV, - OPCODE_COLOR_SUB_TABLE, - OPCODE_CONVOLUTION_FILTER_1D, - OPCODE_CONVOLUTION_FILTER_2D, - OPCODE_CONVOLUTION_PARAMETER_I, - OPCODE_CONVOLUTION_PARAMETER_IV, - OPCODE_CONVOLUTION_PARAMETER_F, - OPCODE_CONVOLUTION_PARAMETER_FV, - OPCODE_COPY_COLOR_SUB_TABLE, - OPCODE_COPY_COLOR_TABLE, - OPCODE_COPY_PIXELS, - OPCODE_COPY_TEX_IMAGE1D, - OPCODE_COPY_TEX_IMAGE2D, - OPCODE_COPY_TEX_SUB_IMAGE1D, - OPCODE_COPY_TEX_SUB_IMAGE2D, - OPCODE_COPY_TEX_SUB_IMAGE3D, - OPCODE_CULL_FACE, - OPCODE_DEPTH_FUNC, - OPCODE_DEPTH_MASK, - OPCODE_DEPTH_RANGE, - OPCODE_DISABLE, - OPCODE_DRAW_BUFFER, - OPCODE_DRAW_PIXELS, - OPCODE_ENABLE, - OPCODE_EVALMESH1, - OPCODE_EVALMESH2, - OPCODE_FOG, - OPCODE_FRONT_FACE, - OPCODE_FRUSTUM, - OPCODE_HINT, - OPCODE_HISTOGRAM, - OPCODE_INDEX_MASK, - OPCODE_INIT_NAMES, - OPCODE_LIGHT, - OPCODE_LIGHT_MODEL, - OPCODE_LINE_STIPPLE, - OPCODE_LINE_WIDTH, - OPCODE_LIST_BASE, - OPCODE_LOAD_IDENTITY, - OPCODE_LOAD_MATRIX, - OPCODE_LOAD_NAME, - OPCODE_LOGIC_OP, - OPCODE_MAP1, - OPCODE_MAP2, - OPCODE_MAPGRID1, - OPCODE_MAPGRID2, - OPCODE_MATRIX_MODE, - OPCODE_MIN_MAX, - OPCODE_MULT_MATRIX, - OPCODE_ORTHO, - OPCODE_PASSTHROUGH, - OPCODE_PIXEL_MAP, - OPCODE_PIXEL_TRANSFER, - OPCODE_PIXEL_ZOOM, - OPCODE_POINT_SIZE, - OPCODE_POINT_PARAMETERS, - OPCODE_POLYGON_MODE, - OPCODE_POLYGON_STIPPLE, - OPCODE_POLYGON_OFFSET, - OPCODE_POP_ATTRIB, - OPCODE_POP_MATRIX, - OPCODE_POP_NAME, - OPCODE_PRIORITIZE_TEXTURE, - OPCODE_PUSH_ATTRIB, - OPCODE_PUSH_MATRIX, - OPCODE_PUSH_NAME, - OPCODE_RASTER_POS, - OPCODE_READ_BUFFER, - OPCODE_RESET_HISTOGRAM, - OPCODE_RESET_MIN_MAX, - OPCODE_ROTATE, - OPCODE_SCALE, - OPCODE_SCISSOR, - OPCODE_SELECT_TEXTURE_SGIS, - OPCODE_SELECT_TEXTURE_COORD_SET, - OPCODE_SHADE_MODEL, - OPCODE_STENCIL_FUNC, - OPCODE_STENCIL_MASK, - OPCODE_STENCIL_OP, - OPCODE_TEXENV, - OPCODE_TEXGEN, - OPCODE_TEXPARAMETER, - OPCODE_TEX_IMAGE1D, - OPCODE_TEX_IMAGE2D, - OPCODE_TEX_IMAGE3D, - OPCODE_TEX_SUB_IMAGE1D, - OPCODE_TEX_SUB_IMAGE2D, - OPCODE_TEX_SUB_IMAGE3D, - OPCODE_TRANSLATE, - OPCODE_VIEWPORT, - OPCODE_WINDOW_POS, - /* GL_ARB_multitexture */ - OPCODE_ACTIVE_TEXTURE, - /* GL_ARB_texture_compression */ - OPCODE_COMPRESSED_TEX_IMAGE_1D, - OPCODE_COMPRESSED_TEX_IMAGE_2D, - OPCODE_COMPRESSED_TEX_IMAGE_3D, - OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, - OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, - OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, - /* GL_ARB_multisample */ - OPCODE_SAMPLE_COVERAGE, - /* GL_ARB_window_pos */ - OPCODE_WINDOW_POS_ARB, - /* GL_NV_vertex_program */ - OPCODE_BIND_PROGRAM_NV, - OPCODE_EXECUTE_PROGRAM_NV, - OPCODE_REQUEST_RESIDENT_PROGRAMS_NV, - OPCODE_LOAD_PROGRAM_NV, - OPCODE_TRACK_MATRIX_NV, - /* GL_NV_fragment_program */ - OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, - OPCODE_PROGRAM_NAMED_PARAMETER_NV, - /* GL_EXT_stencil_two_side */ - OPCODE_ACTIVE_STENCIL_FACE_EXT, - /* GL_EXT_depth_bounds_test */ - OPCODE_DEPTH_BOUNDS_EXT, - /* GL_ARB_vertex/fragment_program */ - OPCODE_PROGRAM_STRING_ARB, - OPCODE_PROGRAM_ENV_PARAMETER_ARB, - /* GL_ARB_occlusion_query */ - OPCODE_BEGIN_QUERY_ARB, - OPCODE_END_QUERY_ARB, - /* GL_ARB_draw_buffers */ - OPCODE_DRAW_BUFFERS_ARB, - /* GL_ATI_fragment_shader */ - OPCODE_BIND_FRAGMENT_SHADER_ATI, - OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, - /* OpenGL 2.0 */ - OPCODE_STENCIL_FUNC_SEPARATE, - OPCODE_STENCIL_OP_SEPARATE, - OPCODE_STENCIL_MASK_SEPARATE, - - /* GL_EXT_framebuffer_blit */ - OPCODE_BLIT_FRAMEBUFFER, - - /* Vertex attributes -- fallback for when optimized display - * list build isn't active. - */ - OPCODE_ATTR_1F_NV, - OPCODE_ATTR_2F_NV, - OPCODE_ATTR_3F_NV, - OPCODE_ATTR_4F_NV, - OPCODE_ATTR_1F_ARB, - OPCODE_ATTR_2F_ARB, - OPCODE_ATTR_3F_ARB, - OPCODE_ATTR_4F_ARB, - OPCODE_MATERIAL, - OPCODE_BEGIN, - OPCODE_END, - OPCODE_RECTF, - OPCODE_EVAL_C1, - OPCODE_EVAL_C2, - OPCODE_EVAL_P1, - OPCODE_EVAL_P2, - - /* The following three are meta instructions */ - OPCODE_ERROR, /* raise compiled-in error */ - OPCODE_CONTINUE, - OPCODE_END_OF_LIST, - OPCODE_EXT_0 -} OpCode; - - - -/** - * Display list node. - * - * Display list instructions are stored as sequences of "nodes". Nodes - * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks - * are linked together with a pointer. - * - * Each instruction in the display list is stored as a sequence of - * contiguous nodes in memory. - * Each node is the union of a variety of data types. - */ -union node -{ - OpCode opcode; - GLboolean b; - GLbitfield bf; - GLubyte ub; - GLshort s; - GLushort us; - GLint i; - GLuint ui; - GLenum e; - GLfloat f; - GLvoid *data; - void *next; /* If prev node's opcode==OPCODE_CONTINUE */ -}; - - -/** - * How many nodes to allocate at a time. - * - * \note Reduced now that we hold vertices etc. elsewhere. - */ -#define BLOCK_SIZE 256 - - - -/** - * Number of nodes of storage needed for each instruction. - * Sizes for dynamically allocated opcodes are stored in the context struct. - */ -static GLuint InstSize[OPCODE_END_OF_LIST + 1]; - -void mesa_print_display_list(GLuint list); - - -/**********************************************************************/ -/***** Private *****/ -/**********************************************************************/ - - -/** - * Make an empty display list. This is used by glGenLists() to - * reserve display list IDs. - */ -static struct mesa_display_list * -make_list(GLuint list, GLuint count) -{ - struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list); - dlist->id = list; - dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count); - dlist->node[0].opcode = OPCODE_END_OF_LIST; - return dlist; -} - - -/** - * Lookup function to just encapsulate casting. - */ -static INLINE struct mesa_display_list * -lookup_list(GLcontext *ctx, GLuint list) -{ - return (struct mesa_display_list *) - _mesa_HashLookup(ctx->Shared->DisplayList, list); -} - - - -/** - * Delete the named display list, but don't remove from hash table. - * \param dlist - display list pointer - */ -void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist) -{ - Node *n, *block; - GLboolean done; - - n = block = dlist->node; - - done = block ? GL_FALSE : GL_TRUE; - while (!done) { - - /* check for extension opcodes first */ - - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; - } - else { - switch (n[0].opcode) { - /* for some commands, we need to free malloc'd memory */ - case OPCODE_MAP1: - _mesa_free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_MAP2: - _mesa_free(n[10].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_DRAW_PIXELS: - _mesa_free(n[5].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_BITMAP: - _mesa_free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COLOR_TABLE: - _mesa_free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COLOR_SUB_TABLE: - _mesa_free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_1D: - _mesa_free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_2D: - _mesa_free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_POLYGON_STIPPLE: - _mesa_free(n[1].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_IMAGE1D: - _mesa_free(n[8].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_IMAGE2D: - _mesa_free(n[9].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_IMAGE3D: - _mesa_free(n[10].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_SUB_IMAGE1D: - _mesa_free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_SUB_IMAGE2D: - _mesa_free(n[9].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_TEX_SUB_IMAGE3D: - _mesa_free(n[11].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_IMAGE_1D: - _mesa_free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_IMAGE_2D: - _mesa_free(n[8].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_IMAGE_3D: - _mesa_free(n[9].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: - _mesa_free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: - _mesa_free(n[9].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: - _mesa_free(n[11].data); - n += InstSize[n[0].opcode]; - break; -#if FEATURE_NV_vertex_program - case OPCODE_LOAD_PROGRAM_NV: - _mesa_free(n[4].data); /* program string */ - n += InstSize[n[0].opcode]; - break; - case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - _mesa_free(n[2].data); /* array of program ids */ - n += InstSize[n[0].opcode]; - break; -#endif -#if FEATURE_NV_fragment_program - case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - _mesa_free(n[3].data); /* parameter name */ - n += InstSize[n[0].opcode]; - break; -#endif -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - case OPCODE_PROGRAM_STRING_ARB: - _mesa_free(n[4].data); /* program string */ - n += InstSize[n[0].opcode]; - break; -#endif - case OPCODE_CONTINUE: - n = (Node *) n[1].next; - _mesa_free(block); - block = n; - break; - case OPCODE_END_OF_LIST: - _mesa_free(block); - done = GL_TRUE; - break; - default: - /* Most frequent case */ - n += InstSize[n[0].opcode]; - break; - } - } - } - - _mesa_free(dlist); -} - - -/** - * Destroy a display list and remove from hash table. - * \param list - display list number - */ -static void -destroy_list(GLcontext *ctx, GLuint list) -{ - struct mesa_display_list *dlist; - - if (list == 0) - return; - - dlist = lookup_list(ctx, list); - if (!dlist) - return; - - _mesa_delete_list(ctx, dlist); - _mesa_HashRemove(ctx->Shared->DisplayList, list); -} - - -/* - * Translate the nth element of list from to GLint. - */ -static GLint -translate_id(GLsizei n, GLenum type, const GLvoid * list) -{ - GLbyte *bptr; - GLubyte *ubptr; - GLshort *sptr; - GLushort *usptr; - GLint *iptr; - GLuint *uiptr; - GLfloat *fptr; - - switch (type) { - case GL_BYTE: - bptr = (GLbyte *) list; - return (GLint) bptr[n]; - case GL_UNSIGNED_BYTE: - ubptr = (GLubyte *) list; - return (GLint) ubptr[n]; - case GL_SHORT: - sptr = (GLshort *) list; - return (GLint) sptr[n]; - case GL_UNSIGNED_SHORT: - usptr = (GLushort *) list; - return (GLint) usptr[n]; - case GL_INT: - iptr = (GLint *) list; - return iptr[n]; - case GL_UNSIGNED_INT: - uiptr = (GLuint *) list; - return (GLint) uiptr[n]; - case GL_FLOAT: - fptr = (GLfloat *) list; - return (GLint) FLOORF(fptr[n]); - case GL_2_BYTES: - ubptr = ((GLubyte *) list) + 2 * n; - return (GLint) ubptr[0] * 256 - + (GLint) ubptr[1]; - case GL_3_BYTES: - ubptr = ((GLubyte *) list) + 3 * n; - return (GLint) ubptr[0] * 65536 - + (GLint) ubptr[1] * 256 - + (GLint) ubptr[2]; - case GL_4_BYTES: - ubptr = ((GLubyte *) list) + 4 * n; - return (GLint) ubptr[0] * 16777216 - + (GLint) ubptr[1] * 65536 - + (GLint) ubptr[2] * 256 - + (GLint) ubptr[3]; - default: - return 0; - } -} - - - - -/**********************************************************************/ -/***** Public *****/ -/**********************************************************************/ - -/** - * Wrapper for _mesa_unpack_image() that handles pixel buffer objects. - * \todo This won't suffice when the PBO is really in VRAM/GPU memory. - */ -static GLvoid * -unpack_image(GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *unpack) -{ - if (unpack->BufferObj->Name == 0) { - /* no PBO */ - return _mesa_unpack_image(dimensions, width, height, depth, format, - type, pixels, unpack); - } - else - if (_mesa_validate_pbo_access - (dimensions, unpack, width, height, depth, format, type, pixels)) { - const GLubyte *src = ADD_POINTERS(unpack->BufferObj->Data, pixels); - return _mesa_unpack_image(dimensions, width, height, depth, format, - type, src, unpack); - } - /* bad access! */ - return NULL; -} - - -/** - * Allocate space for a display list instruction. - * \param opcode the instruction opcode (OPCODE_* value) - * \param size instruction size in bytes, not counting opcode. - * \return pointer to the usable data area (not including the internal - * opcode). - */ -void * -_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) -{ - const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); - Node *n; - - if (opcode < (GLuint) OPCODE_EXT_0) { - if (InstSize[opcode] == 0) { - /* save instruction size now */ - InstSize[opcode] = numNodes; - } - else { - /* make sure instruction size agrees */ - ASSERT(numNodes == InstSize[opcode]); - } - } - - if (ctx->ListState.CurrentPos + numNodes + 2 > BLOCK_SIZE) { - /* This block is full. Allocate a new block and chain to it */ - Node *newblock; - n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; - n[0].opcode = OPCODE_CONTINUE; - newblock = (Node *) _mesa_malloc(sizeof(Node) * BLOCK_SIZE); - if (!newblock) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list"); - return NULL; - } - n[1].next = (Node *) newblock; - ctx->ListState.CurrentBlock = newblock; - ctx->ListState.CurrentPos = 0; - } - - n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; - ctx->ListState.CurrentPos += numNodes; - - n[0].opcode = (OpCode) opcode; - - return (void *) (n + 1); /* return ptr to node following opcode */ -} - - -/** - * This function allows modules and drivers to get their own opcodes - * for extending display list functionality. - * \param ctx the rendering context - * \param size number of bytes for storing the new display list command - * \param execute function to execute the new display list command - * \param destroy function to destroy the new display list command - * \param print function to print the new display list command - * \return the new opcode number or -1 if error - */ -GLint -_mesa_alloc_opcode(GLcontext *ctx, - GLuint size, - void (*execute) (GLcontext *, void *), - void (*destroy) (GLcontext *, void *), - void (*print) (GLcontext *, void *)) -{ - if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) { - const GLuint i = ctx->ListExt.NumOpcodes++; - ctx->ListExt.Opcode[i].Size = - 1 + (size + sizeof(Node) - 1) / sizeof(Node); - ctx->ListExt.Opcode[i].Execute = execute; - ctx->ListExt.Opcode[i].Destroy = destroy; - ctx->ListExt.Opcode[i].Print = print; - return i + OPCODE_EXT_0; - } - return -1; -} - - - -/** - * Allocate display list instruction. Returns Node ptr to where the opcode - * is stored. - * - nParams is the number of function parameters - * - return value a pointer to sizeof(Node) before the actual - * usable data area. - */ -#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \ - ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) - - - -/* - * Display List compilation functions - */ -static void GLAPIENTRY -save_Accum(GLenum op, GLfloat value) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACCUM, 2); - if (n) { - n[1].e = op; - n[2].f = value; - } - if (ctx->ExecuteFlag) { - CALL_Accum(ctx->Exec, (op, value)); - } -} - - -static void GLAPIENTRY -save_AlphaFunc(GLenum func, GLclampf ref) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ALPHA_FUNC, 2); - if (n) { - n[1].e = func; - n[2].f = (GLfloat) ref; - } - if (ctx->ExecuteFlag) { - CALL_AlphaFunc(ctx->Exec, (func, ref)); - } -} - - -static void GLAPIENTRY -save_BindTexture(GLenum target, GLuint texture) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_TEXTURE, 2); - if (n) { - n[1].e = target; - n[2].ui = texture; - } - if (ctx->ExecuteFlag) { - CALL_BindTexture(ctx->Exec, (target, texture)); - } -} - - -static void GLAPIENTRY -save_Bitmap(GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, const GLubyte * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = _mesa_unpack_bitmap(width, height, pixels, &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7); - if (n) { - 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 = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_Bitmap(ctx->Exec, (width, height, - xorig, yorig, xmove, ymove, pixels)); - } -} - - -static void GLAPIENTRY -save_BlendEquation(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_BlendEquation(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); - if (n) { - n[1].e = modeRGB; - n[2].e = modeA; - } - if (ctx->ExecuteFlag) { - CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA)); - } -} - - -static void GLAPIENTRY -save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); - if (n) { - n[1].e = sfactorRGB; - n[2].e = dfactorRGB; - n[3].e = sfactorA; - n[4].e = dfactorA; - } - if (ctx->ExecuteFlag) { - CALL_BlendFuncSeparateEXT(ctx->Exec, - (sfactorRGB, dfactorRGB, sfactorA, dfactorA)); - } -} - - -static void GLAPIENTRY -save_BlendFunc(GLenum srcfactor, GLenum dstfactor) -{ - save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor); -} - - -static void GLAPIENTRY -save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_COLOR, 4); - if (n) { - n[1].f = red; - n[2].f = green; - n[3].f = blue; - n[4].f = alpha; - } - if (ctx->ExecuteFlag) { - CALL_BlendColor(ctx->Exec, (red, green, blue, alpha)); - } -} - - -void GLAPIENTRY -_mesa_save_CallList(GLuint list) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - - n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST, 1); - if (n) { - n[1].ui = list; - } - - /* After this, we don't know what begin/end state we're in: - */ - ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; - - if (ctx->ExecuteFlag) { - CALL_CallList(ctx->Exec, (list)); - } -} - - -void GLAPIENTRY -_mesa_save_CallLists(GLsizei n, GLenum type, const GLvoid * lists) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - GLboolean typeErrorFlag; - - SAVE_FLUSH_VERTICES(ctx); - - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_2_BYTES: - case GL_3_BYTES: - case GL_4_BYTES: - typeErrorFlag = GL_FALSE; - break; - default: - typeErrorFlag = GL_TRUE; - } - - for (i = 0; i < n; i++) { - GLint list = translate_id(i, type, lists); - Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2); - if (n) { - n[1].i = list; - n[2].b = typeErrorFlag; - } - } - - /* After this, we don't know what begin/end state we're in: - */ - ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; - - if (ctx->ExecuteFlag) { - CALL_CallLists(ctx->Exec, (n, type, lists)); - } -} - - -static void GLAPIENTRY -save_Clear(GLbitfield mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR, 1); - if (n) { - n[1].bf = mask; - } - if (ctx->ExecuteFlag) { - CALL_Clear(ctx->Exec, (mask)); - } -} - - -static void GLAPIENTRY -save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_ACCUM, 4); - if (n) { - n[1].f = red; - n[2].f = green; - n[3].f = blue; - n[4].f = alpha; - } - if (ctx->ExecuteFlag) { - CALL_ClearAccum(ctx->Exec, (red, green, blue, alpha)); - } -} - - -static void GLAPIENTRY -save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_COLOR, 4); - if (n) { - n[1].f = red; - n[2].f = green; - n[3].f = blue; - n[4].f = alpha; - } - if (ctx->ExecuteFlag) { - CALL_ClearColor(ctx->Exec, (red, green, blue, alpha)); - } -} - - -static void GLAPIENTRY -save_ClearDepth(GLclampd depth) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_DEPTH, 1); - if (n) { - n[1].f = (GLfloat) depth; - } - if (ctx->ExecuteFlag) { - CALL_ClearDepth(ctx->Exec, (depth)); - } -} - - -static void GLAPIENTRY -save_ClearIndex(GLfloat c) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_INDEX, 1); - if (n) { - n[1].f = c; - } - if (ctx->ExecuteFlag) { - CALL_ClearIndex(ctx->Exec, (c)); - } -} - - -static void GLAPIENTRY -save_ClearStencil(GLint s) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_STENCIL, 1); - if (n) { - n[1].i = s; - } - if (ctx->ExecuteFlag) { - CALL_ClearStencil(ctx->Exec, (s)); - } -} - - -static void GLAPIENTRY -save_ClipPlane(GLenum plane, const GLdouble * equ) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLIP_PLANE, 5); - if (n) { - n[1].e = plane; - n[2].f = (GLfloat) equ[0]; - n[3].f = (GLfloat) equ[1]; - n[4].f = (GLfloat) equ[2]; - n[5].f = (GLfloat) equ[3]; - } - if (ctx->ExecuteFlag) { - CALL_ClipPlane(ctx->Exec, (plane, equ)); - } -} - - - -static void GLAPIENTRY -save_ColorMask(GLboolean red, GLboolean green, - GLboolean blue, GLboolean alpha) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4); - if (n) { - n[1].b = red; - n[2].b = green; - n[3].b = blue; - n[4].b = alpha; - } - if (ctx->ExecuteFlag) { - CALL_ColorMask(ctx->Exec, (red, green, blue, alpha)); - } -} - - -static void GLAPIENTRY -save_ColorMaterial(GLenum face, GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2); - if (n) { - n[1].e = face; - n[2].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_ColorMaterial(ctx->Exec, (face, mode)); - } -} - - -static void GLAPIENTRY -save_ColorTable(GLenum target, GLenum internalFormat, - GLsizei width, GLenum format, GLenum type, - const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - if (_mesa_is_proxy_texture(target)) { - /* execute immediately */ - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - else { - GLvoid *image = unpack_image(1, width, 1, 1, format, type, table, - &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - 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) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - } -} - - - -static void GLAPIENTRY -save_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params)); - } -} - - - -static void GLAPIENTRY -save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, - GLenum format, GLenum type, const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = unpack_image(1, count, 1, 1, format, type, table, - &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = count; - n[4].e = format; - n[5].e = type; - n[6].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_ColorSubTable(ctx->Exec, - (target, start, count, format, type, table)); - } -} - - -static void GLAPIENTRY -save_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width)); - } -} - - -static void GLAPIENTRY -save_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5); - if (n) { - n[1].e = target; - n[2].e = internalformat; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, - GLenum format, GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = unpack_image(1, width, 1, 1, format, type, filter, - &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 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) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width, - format, type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = unpack_image(2, width, height, 1, format, type, filter, - &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].i = height; - n[5].e = format; - n[6].e = type; - n[7].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter2D(ctx->Exec, - (target, internalFormat, width, height, format, - type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - else { - n[4].i = n[5].i = n[6].i = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - else { - n[4].f = n[5].f = n[6].f = 0.0F; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_PIXELS, 5); - if (n) { - n[1].i = x; - n[2].i = y; - n[3].i = (GLint) width; - n[4].i = (GLint) height; - n[5].e = type; - } - if (ctx->ExecuteFlag) { - CALL_CopyPixels(ctx->Exec, (x, y, width, height, type)); - } -} - - - -static void GLAPIENTRY -save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLint border) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].e = internalformat; - n[4].i = x; - n[5].i = y; - n[6].i = width; - n[7].i = border; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexImage1D(ctx->Exec, (target, level, internalformat, - x, y, width, border)); - } -} - - -static void GLAPIENTRY -save_CopyTexImage2D(GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, GLsizei width, - GLsizei height, GLint border) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].e = internalformat; - n[4].i = x; - n[5].i = y; - n[6].i = width; - n[7].i = height; - n[8].i = border; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexImage2D(ctx->Exec, (target, level, internalformat, - x, y, width, height, border)); - } -} - - - -static void GLAPIENTRY -save_CopyTexSubImage1D(GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = x; - n[5].i = y; - n[6].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexSubImage1D(ctx->Exec, - (target, level, xoffset, x, y, width)); - } -} - - -static void GLAPIENTRY -save_CopyTexSubImage2D(GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLint height) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = x; - n[6].i = y; - n[7].i = width; - n[8].i = height; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset, - x, y, width, height)); - } -} - - -static void GLAPIENTRY -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; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = zoffset; - n[6].i = x; - n[7].i = y; - n[8].i = width; - n[9].i = height; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexSubImage3D(ctx->Exec, (target, level, - xoffset, yoffset, zoffset, - x, y, width, height)); - } -} - - -static void GLAPIENTRY -save_CullFace(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CULL_FACE, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_CullFace(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_DepthFunc(GLenum func) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_FUNC, 1); - if (n) { - n[1].e = func; - } - if (ctx->ExecuteFlag) { - CALL_DepthFunc(ctx->Exec, (func)); - } -} - - -static void GLAPIENTRY -save_DepthMask(GLboolean mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_MASK, 1); - if (n) { - n[1].b = mask; - } - if (ctx->ExecuteFlag) { - CALL_DepthMask(ctx->Exec, (mask)); - } -} - - -static void GLAPIENTRY -save_DepthRange(GLclampd nearval, GLclampd farval) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_RANGE, 2); - if (n) { - n[1].f = (GLfloat) nearval; - n[2].f = (GLfloat) farval; - } - if (ctx->ExecuteFlag) { - CALL_DepthRange(ctx->Exec, (nearval, farval)); - } -} - - -static void GLAPIENTRY -save_Disable(GLenum cap) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DISABLE, 1); - if (n) { - n[1].e = cap; - } - if (ctx->ExecuteFlag) { - CALL_Disable(ctx->Exec, (cap)); - } -} - - -static void GLAPIENTRY -save_DrawBuffer(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFER, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_DrawBuffer(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_DrawPixels(GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = unpack_image(2, width, height, 1, format, type, - pixels, &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5); - if (n) { - n[1].i = width; - n[2].i = height; - n[3].e = format; - n[4].e = type; - n[5].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels)); - } -} - - - -static void GLAPIENTRY -save_Enable(GLenum cap) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ENABLE, 1); - if (n) { - n[1].e = cap; - } - if (ctx->ExecuteFlag) { - CALL_Enable(ctx->Exec, (cap)); - } -} - - - -static void GLAPIENTRY -_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH1, 3); - if (n) { - n[1].e = mode; - n[2].i = i1; - n[3].i = i2; - } - if (ctx->ExecuteFlag) { - CALL_EvalMesh1(ctx->Exec, (mode, i1, i2)); - } -} - - -static void GLAPIENTRY -_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH2, 5); - if (n) { - n[1].e = mode; - n[2].i = i1; - n[3].i = i2; - n[4].i = j1; - n[5].i = j2; - } - if (ctx->ExecuteFlag) { - CALL_EvalMesh2(ctx->Exec, (mode, i1, i2, j1, j2)); - } -} - - - - -static void GLAPIENTRY -save_Fogfv(GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FOG, 5); - if (n) { - n[1].e = pname; - n[2].f = params[0]; - n[3].f = params[1]; - n[4].f = params[2]; - n[5].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_Fogfv(ctx->Exec, (pname, params)); - } -} - - -static void GLAPIENTRY -save_Fogf(GLenum pname, GLfloat param) -{ - save_Fogfv(pname, ¶m); -} - - -static void GLAPIENTRY -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 GLAPIENTRY -save_Fogi(GLenum pname, GLint param) -{ - save_Fogiv(pname, ¶m); -} - - -static void GLAPIENTRY -save_FrontFace(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRONT_FACE, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_FrontFace(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_Frustum(GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6); - if (n) { - n[1].f = (GLfloat) left; - n[2].f = (GLfloat) right; - n[3].f = (GLfloat) bottom; - n[4].f = (GLfloat) top; - n[5].f = (GLfloat) nearval; - n[6].f = (GLfloat) farval; - } - if (ctx->ExecuteFlag) { - CALL_Frustum(ctx->Exec, (left, right, bottom, top, nearval, farval)); - } -} - - -static void GLAPIENTRY -save_Hint(GLenum target, GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HINT, 2); - if (n) { - n[1].e = target; - n[2].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_Hint(ctx->Exec, (target, mode)); - } -} - - -static void GLAPIENTRY -save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, - GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4); - if (n) { - n[1].e = target; - n[2].i = width; - n[3].e = internalFormat; - n[4].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink)); - } -} - - -static void GLAPIENTRY -save_IndexMask(GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX_MASK, 1); - if (n) { - n[1].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_IndexMask(ctx->Exec, (mask)); - } -} - - -static void GLAPIENTRY -save_InitNames(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0); - if (ctx->ExecuteFlag) { - CALL_InitNames(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_Lightfv(GLenum light, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT, 6); - if (n) { - GLint i, nParams; - n[1].e = light; - n[2].e = pname; - 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) { - CALL_Lightfv(ctx->Exec, (light, pname, params)); - } -} - - -static void GLAPIENTRY -save_Lightf(GLenum light, GLenum pname, GLfloat params) -{ - save_Lightfv(light, pname, ¶ms); -} - - -static void GLAPIENTRY -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 GLAPIENTRY -save_Lighti(GLenum light, GLenum pname, GLint param) -{ - save_Lightiv(light, pname, ¶m); -} - - -static void GLAPIENTRY -save_LightModelfv(GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT_MODEL, 5); - if (n) { - n[1].e = pname; - n[2].f = params[0]; - n[3].f = params[1]; - n[4].f = params[2]; - n[5].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_LightModelfv(ctx->Exec, (pname, params)); - } -} - - -static void GLAPIENTRY -save_LightModelf(GLenum pname, GLfloat param) -{ - save_LightModelfv(pname, ¶m); -} - - -static void GLAPIENTRY -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 GLAPIENTRY -save_LightModeli(GLenum pname, GLint param) -{ - save_LightModeliv(pname, ¶m); -} - - -static void GLAPIENTRY -save_LineStipple(GLint factor, GLushort pattern) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2); - if (n) { - n[1].i = factor; - n[2].us = pattern; - } - if (ctx->ExecuteFlag) { - CALL_LineStipple(ctx->Exec, (factor, pattern)); - } -} - - -static void GLAPIENTRY -save_LineWidth(GLfloat width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1); - if (n) { - n[1].f = width; - } - if (ctx->ExecuteFlag) { - CALL_LineWidth(ctx->Exec, (width)); - } -} - - -static void GLAPIENTRY -save_ListBase(GLuint base) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1); - if (n) { - n[1].ui = base; - } - if (ctx->ExecuteFlag) { - CALL_ListBase(ctx->Exec, (base)); - } -} - - -static void GLAPIENTRY -save_LoadIdentity(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0); - if (ctx->ExecuteFlag) { - CALL_LoadIdentity(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_LoadMatrixf(const GLfloat * m) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16); - if (n) { - GLuint i; - for (i = 0; i < 16; i++) { - n[1 + i].f = m[i]; - } - } - if (ctx->ExecuteFlag) { - CALL_LoadMatrixf(ctx->Exec, (m)); - } -} - - -static void GLAPIENTRY -save_LoadMatrixd(const GLdouble * m) -{ - GLfloat f[16]; - GLint i; - for (i = 0; i < 16; i++) { - f[i] = (GLfloat) m[i]; - } - save_LoadMatrixf(f); -} - - -static void GLAPIENTRY -save_LoadName(GLuint name) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1); - if (n) { - n[1].ui = name; - } - if (ctx->ExecuteFlag) { - CALL_LoadName(ctx->Exec, (name)); - } -} - - -static void GLAPIENTRY -save_LogicOp(GLenum opcode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1); - if (n) { - n[1].e = opcode; - } - if (ctx->ExecuteFlag) { - CALL_LogicOp(ctx->Exec, (opcode)); - } -} - - -static void GLAPIENTRY -save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble * points) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); - if (n) { - GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points); - n[1].e = target; - n[2].f = (GLfloat) u1; - n[3].f = (GLfloat) u2; - n[4].i = _mesa_evaluator_components(target); /* stride */ - n[5].i = order; - n[6].data = (void *) pnts; - } - if (ctx->ExecuteFlag) { - CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points)); - } -} - -static void GLAPIENTRY -save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat * points) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); - if (n) { - GLfloat *pnts = _mesa_copy_map_points1f(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) { - CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points)); - } -} - - -static void GLAPIENTRY -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; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); - if (n) { - GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder, - vstride, vorder, points); - n[1].e = target; - n[2].f = (GLfloat) u1; - n[3].f = (GLfloat) u2; - n[4].f = (GLfloat) v1; - n[5].f = (GLfloat) 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) { - CALL_Map2d(ctx->Exec, (target, - u1, u2, ustride, uorder, - v1, v2, vstride, vorder, points)); - } -} - - -static void GLAPIENTRY -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; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); - if (n) { - GLfloat *pnts = _mesa_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) { - CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder, - v1, v2, vstride, vorder, points)); - } -} - - -static void GLAPIENTRY -save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3); - if (n) { - n[1].i = un; - n[2].f = u1; - n[3].f = u2; - } - if (ctx->ExecuteFlag) { - CALL_MapGrid1f(ctx->Exec, (un, u1, u2)); - } -} - - -static void GLAPIENTRY -save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2) -{ - save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2); -} - - -static void GLAPIENTRY -save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6); - if (n) { - n[1].i = un; - n[2].f = u1; - n[3].f = u2; - n[4].i = vn; - n[5].f = v1; - n[6].f = v2; - } - if (ctx->ExecuteFlag) { - CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2)); - } -} - - - -static void GLAPIENTRY -save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2) -{ - save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2, - vn, (GLfloat) v1, (GLfloat) v2); -} - - -static void GLAPIENTRY -save_MatrixMode(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_MatrixMode(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Minmax(ctx->Exec, (target, internalFormat, sink)); - } -} - - -static void GLAPIENTRY -save_MultMatrixf(const GLfloat * m) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16); - if (n) { - GLuint i; - for (i = 0; i < 16; i++) { - n[1 + i].f = m[i]; - } - } - if (ctx->ExecuteFlag) { - CALL_MultMatrixf(ctx->Exec, (m)); - } -} - - -static void GLAPIENTRY -save_MultMatrixd(const GLdouble * m) -{ - GLfloat f[16]; - GLint i; - for (i = 0; i < 16; i++) { - f[i] = (GLfloat) m[i]; - } - save_MultMatrixf(f); -} - - -static void GLAPIENTRY -save_NewList(GLuint list, GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - /* It's an error to call this function while building a display list */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); - (void) list; - (void) mode; -} - - - -static void GLAPIENTRY -save_Ortho(GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6); - if (n) { - n[1].f = (GLfloat) left; - n[2].f = (GLfloat) right; - n[3].f = (GLfloat) bottom; - n[4].f = (GLfloat) top; - n[5].f = (GLfloat) nearval; - n[6].f = (GLfloat) farval; - } - if (ctx->ExecuteFlag) { - CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval)); - } -} - - -static void GLAPIENTRY -save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3); - if (n) { - n[1].e = map; - n[2].i = mapsize; - n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); - MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); - } - if (ctx->ExecuteFlag) { - CALL_PixelMapfv(ctx->Exec, (map, mapsize, values)); - } -} - - -static void GLAPIENTRY -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 GLAPIENTRY -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 GLAPIENTRY -save_PixelTransferf(GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2); - if (n) { - n[1].e = pname; - n[2].f = param; - } - if (ctx->ExecuteFlag) { - CALL_PixelTransferf(ctx->Exec, (pname, param)); - } -} - - -static void GLAPIENTRY -save_PixelTransferi(GLenum pname, GLint param) -{ - save_PixelTransferf(pname, (GLfloat) param); -} - - -static void GLAPIENTRY -save_PixelZoom(GLfloat xfactor, GLfloat yfactor) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2); - if (n) { - n[1].f = xfactor; - n[2].f = yfactor; - } - if (ctx->ExecuteFlag) { - CALL_PixelZoom(ctx->Exec, (xfactor, yfactor)); - } -} - - -static void GLAPIENTRY -save_PointParameterfvEXT(GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_PARAMETERS, 4); - if (n) { - n[1].e = pname; - n[2].f = params[0]; - n[3].f = params[1]; - n[4].f = params[2]; - } - if (ctx->ExecuteFlag) { - CALL_PointParameterfvEXT(ctx->Exec, (pname, params)); - } -} - - -static void GLAPIENTRY -save_PointParameterfEXT(GLenum pname, GLfloat param) -{ - save_PointParameterfvEXT(pname, ¶m); -} - -static void GLAPIENTRY -save_PointParameteriNV(GLenum pname, GLint param) -{ - GLfloat p = (GLfloat) param; - save_PointParameterfvEXT(pname, &p); -} - -static void GLAPIENTRY -save_PointParameterivNV(GLenum pname, const GLint * param) -{ - GLfloat p = (GLfloat) param[0]; - save_PointParameterfvEXT(pname, &p); -} - - -static void GLAPIENTRY -save_PointSize(GLfloat size) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_SIZE, 1); - if (n) { - n[1].f = size; - } - if (ctx->ExecuteFlag) { - CALL_PointSize(ctx->Exec, (size)); - } -} - - -static void GLAPIENTRY -save_PolygonMode(GLenum face, GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_MODE, 2); - if (n) { - n[1].e = face; - n[2].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_PolygonMode(ctx->Exec, (face, mode)); - } -} - - -static void GLAPIENTRY -save_PolygonStipple(const GLubyte * pattern) -{ - GET_CURRENT_CONTEXT(ctx); - GLvoid *image = unpack_image(2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, - pattern, &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1); - if (n) { - n[1].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern)); - } -} - - -static void GLAPIENTRY -save_PolygonOffset(GLfloat factor, GLfloat units) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_OFFSET, 2); - if (n) { - n[1].f = factor; - n[2].f = units; - } - if (ctx->ExecuteFlag) { - CALL_PolygonOffset(ctx->Exec, (factor, units)); - } -} - - -static void GLAPIENTRY -save_PolygonOffsetEXT(GLfloat factor, GLfloat bias) -{ - GET_CURRENT_CONTEXT(ctx); - /* XXX mult by DepthMaxF here??? */ - save_PolygonOffset(factor, ctx->DrawBuffer->_DepthMaxF * bias); -} - - -static void GLAPIENTRY -save_PopAttrib(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0); - if (ctx->ExecuteFlag) { - CALL_PopAttrib(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_PopMatrix(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0); - if (ctx->ExecuteFlag) { - CALL_PopMatrix(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_PopName(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0); - if (ctx->ExecuteFlag) { - CALL_PopName(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_PrioritizeTextures(GLsizei num, const GLuint * textures, - const GLclampf * priorities) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < num; i++) { - Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); - if (n) { - n[1].ui = textures[i]; - n[2].f = priorities[i]; - } - } - if (ctx->ExecuteFlag) { - CALL_PrioritizeTextures(ctx->Exec, (num, textures, priorities)); - } -} - - -static void GLAPIENTRY -save_PushAttrib(GLbitfield mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_ATTRIB, 1); - if (n) { - n[1].bf = mask; - } - if (ctx->ExecuteFlag) { - CALL_PushAttrib(ctx->Exec, (mask)); - } -} - - -static void GLAPIENTRY -save_PushMatrix(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0); - if (ctx->ExecuteFlag) { - CALL_PushMatrix(ctx->Exec, ()); - } -} - - -static void GLAPIENTRY -save_PushName(GLuint name) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_NAME, 1); - if (n) { - n[1].ui = name; - } - if (ctx->ExecuteFlag) { - CALL_PushName(ctx->Exec, (name)); - } -} - - -static void GLAPIENTRY -save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RASTER_POS, 4); - if (n) { - n[1].f = x; - n[2].f = y; - n[3].f = z; - n[4].f = w; - } - if (ctx->ExecuteFlag) { - CALL_RasterPos4f(ctx->Exec, (x, y, z, w)); - } -} - -static void GLAPIENTRY -save_RasterPos2d(GLdouble x, GLdouble y) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2f(GLfloat x, GLfloat y) -{ - save_RasterPos4f(x, y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2i(GLint x, GLint y) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2s(GLshort x, GLshort y) -{ - save_RasterPos4f(x, y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) -{ - save_RasterPos4f(x, y, z, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3i(GLint x, GLint y, GLint z) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3s(GLshort x, GLshort y, GLshort z) -{ - save_RasterPos4f(x, y, z, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -save_RasterPos4i(GLint x, GLint y, GLint z, GLint w) -{ - save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) -{ - save_RasterPos4f(x, y, z, w); -} - -static void GLAPIENTRY -save_RasterPos2dv(const GLdouble * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2fv(const GLfloat * v) -{ - save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2iv(const GLint * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos2sv(const GLshort * v) -{ - save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3dv(const GLdouble * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3fv(const GLfloat * v) -{ - save_RasterPos4f(v[0], v[1], v[2], 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3iv(const GLint * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -static void GLAPIENTRY -save_RasterPos3sv(const GLshort * v) -{ - save_RasterPos4f(v[0], v[1], v[2], 1.0F); -} - -static void GLAPIENTRY -save_RasterPos4dv(const GLdouble * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -save_RasterPos4fv(const GLfloat * v) -{ - save_RasterPos4f(v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_RasterPos4iv(const GLint * v) -{ - save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -save_RasterPos4sv(const GLshort * v) -{ - save_RasterPos4f(v[0], v[1], v[2], v[3]); -} - - -static void GLAPIENTRY -save_PassThrough(GLfloat token) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PASSTHROUGH, 1); - if (n) { - n[1].f = token; - } - if (ctx->ExecuteFlag) { - CALL_PassThrough(ctx->Exec, (token)); - } -} - - -static void GLAPIENTRY -save_ReadBuffer(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_READ_BUFFER, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_ReadBuffer(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_ResetHistogram(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_HISTOGRAM, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetHistogram(ctx->Exec, (target)); - } -} - - -static void GLAPIENTRY -save_ResetMinmax(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_MIN_MAX, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetMinmax(ctx->Exec, (target)); - } -} - - -static void GLAPIENTRY -save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ROTATE, 4); - if (n) { - n[1].f = angle; - n[2].f = x; - n[3].f = y; - n[4].f = z; - } - if (ctx->ExecuteFlag) { - CALL_Rotatef(ctx->Exec, (angle, x, y, z)); - } -} - - -static void GLAPIENTRY -save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) -{ - save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z); -} - - -static void GLAPIENTRY -save_Scalef(GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCALE, 3); - if (n) { - n[1].f = x; - n[2].f = y; - n[3].f = z; - } - if (ctx->ExecuteFlag) { - CALL_Scalef(ctx->Exec, (x, y, z)); - } -} - - -static void GLAPIENTRY -save_Scaled(GLdouble x, GLdouble y, GLdouble z) -{ - save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z); -} - - -static void GLAPIENTRY -save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCISSOR, 4); - if (n) { - n[1].i = x; - n[2].i = y; - n[3].i = width; - n[4].i = height; - } - if (ctx->ExecuteFlag) { - CALL_Scissor(ctx->Exec, (x, y, width, height)); - } -} - - -static void GLAPIENTRY -save_ShadeModel(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_ShadeModel(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_StencilFunc(GLenum func, GLint ref, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC, 3); - if (n) { - n[1].e = func; - n[2].i = ref; - n[3].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilFunc(ctx->Exec, (func, ref, mask)); - } -} - - -static void GLAPIENTRY -save_StencilMask(GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK, 1); - if (n) { - n[1].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilMask(ctx->Exec, (mask)); - } -} - - -static void GLAPIENTRY -save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP, 3); - if (n) { - n[1].e = fail; - n[2].e = zfail; - n[3].e = zpass; - } - if (ctx->ExecuteFlag) { - CALL_StencilOp(ctx->Exec, (fail, zfail, zpass)); - } -} - - -static void GLAPIENTRY -save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = face; - n[2].e = func; - n[3].i = ref; - n[4].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilFuncSeparate(ctx->Exec, (face, func, ref, mask)); - } -} - - -static void GLAPIENTRY -save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, - GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - /* GL_FRONT */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = GL_FRONT; - n[2].e = frontfunc; - n[3].i = ref; - n[4].ui = mask; - } - /* GL_BACK */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = GL_BACK; - n[2].e = backfunc; - n[3].i = ref; - n[4].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask)); - CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask)); - } -} - - -static void GLAPIENTRY -save_StencilMaskSeparate(GLenum face, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); - if (n) { - n[1].e = face; - n[2].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilMaskSeparate(ctx->Exec, (face, mask)); - } -} - - -static void GLAPIENTRY -save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); - if (n) { - n[1].e = face; - n[2].e = fail; - n[3].e = zfail; - n[4].e = zpass; - } - if (ctx->ExecuteFlag) { - CALL_StencilOpSeparate(ctx->Exec, (face, fail, zfail, zpass)); - } -} - - -static void GLAPIENTRY -save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXENV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - if (pname == GL_TEXTURE_ENV_COLOR) { - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - else { - n[3].f = params[0]; - n[4].f = n[5].f = n[6].f = 0.0F; - } - } - if (ctx->ExecuteFlag) { - CALL_TexEnvfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_TexEnvf(GLenum target, GLenum pname, GLfloat param) -{ - save_TexEnvfv(target, pname, ¶m); -} - - -static void GLAPIENTRY -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 GLAPIENTRY -save_TexEnviv(GLenum target, GLenum pname, const GLint * param) -{ - GLfloat p[4]; - if (pname == GL_TEXTURE_ENV_COLOR) { - 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]); - } - else { - p[0] = (GLfloat) param[0]; - p[1] = p[2] = p[3] = 0.0F; - } - save_TexEnvfv(target, pname, p); -} - - -static void GLAPIENTRY -save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXGEN, 6); - if (n) { - n[1].e = coord; - n[2].e = pname; - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_TexGenfv(ctx->Exec, (coord, pname, params)); - } -} - - -static void GLAPIENTRY -save_TexGeniv(GLenum coord, GLenum pname, const GLint *params) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - save_TexGenfv(coord, pname, p); -} - - -static void GLAPIENTRY -save_TexGend(GLenum coord, GLenum pname, GLdouble param) -{ - GLfloat p = (GLfloat) param; - save_TexGenfv(coord, pname, &p); -} - - -static void GLAPIENTRY -save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - save_TexGenfv(coord, pname, p); -} - - -static void GLAPIENTRY -save_TexGenf(GLenum coord, GLenum pname, GLfloat param) -{ - save_TexGenfv(coord, pname, ¶m); -} - - -static void GLAPIENTRY -save_TexGeni(GLenum coord, GLenum pname, GLint param) -{ - save_TexGeniv(coord, pname, ¶m); -} - - -static void GLAPIENTRY -save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXPARAMETER, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_TexParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_TexParameterf(GLenum target, GLenum pname, GLfloat param) -{ - save_TexParameterfv(target, pname, ¶m); -} - - -static void GLAPIENTRY -save_TexParameteri(GLenum target, GLenum pname, GLint param) -{ - GLfloat fparam[4]; - fparam[0] = (GLfloat) param; - fparam[1] = fparam[2] = fparam[3] = 0.0; - save_TexParameterfv(target, pname, fparam); -} - - -static void GLAPIENTRY -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 GLAPIENTRY -save_TexImage1D(GLenum target, - GLint level, GLint components, - GLsizei width, GLint border, - GLenum format, GLenum type, const GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_1D) { - /* don't compile, execute immediately */ - CALL_TexImage1D(ctx->Exec, (target, level, components, width, - border, format, type, pixels)); - } - else { - GLvoid *image = unpack_image(1, width, 1, 1, format, type, - pixels, &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = components; - n[4].i = (GLint) width; - n[5].i = border; - n[6].e = format; - n[7].e = type; - n[8].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexImage1D(ctx->Exec, (target, level, components, width, - border, format, type, pixels)); - } - } -} - - -static void GLAPIENTRY -save_TexImage2D(GLenum target, - GLint level, GLint components, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, const GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_2D) { - /* don't compile, execute immediately */ - CALL_TexImage2D(ctx->Exec, (target, level, components, width, - height, border, format, type, pixels)); - } - else { - GLvoid *image = unpack_image(2, width, height, 1, format, type, - pixels, &ctx->Unpack); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = components; - n[4].i = (GLint) width; - n[5].i = (GLint) height; - n[6].i = border; - n[7].e = format; - n[8].e = type; - n[9].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexImage2D(ctx->Exec, (target, level, components, width, - height, border, format, type, pixels)); - } - } -} - - -static void GLAPIENTRY -save_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); - if (target == GL_PROXY_TEXTURE_3D) { - /* don't compile, execute immediately */ - CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width, - height, depth, border, format, type, - pixels)); - } - else { - Node *n; - GLvoid *image = unpack_image(3, width, height, depth, format, type, - pixels, &ctx->Unpack); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = (GLint) internalFormat; - n[4].i = (GLint) width; - n[5].i = (GLint) height; - n[6].i = (GLint) depth; - n[7].i = border; - n[8].e = format; - n[9].e = type; - n[10].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width, - height, depth, border, format, type, - pixels)); - } - } -} - - -static void GLAPIENTRY -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 = unpack_image(1, width, 1, 1, format, type, - pixels, &ctx->Unpack); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = (GLint) width; - n[5].e = format; - n[6].e = type; - n[7].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width, - format, type, pixels)); - } -} - - -static void GLAPIENTRY -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 = unpack_image(2, width, height, 1, format, type, - pixels, &ctx->Unpack); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = (GLint) width; - n[6].i = (GLint) height; - n[7].e = format; - n[8].e = type; - n[9].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset, - width, height, format, type, pixels)); - } -} - - -static void GLAPIENTRY -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 = unpack_image(3, width, height, depth, format, type, - pixels, &ctx->Unpack); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = zoffset; - n[6].i = (GLint) width; - n[7].i = (GLint) height; - n[8].i = (GLint) depth; - n[9].e = format; - n[10].e = type; - n[11].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_TexSubImage3D(ctx->Exec, (target, level, - xoffset, yoffset, zoffset, - width, height, depth, format, type, - pixels)); - } -} - - -static void GLAPIENTRY -save_Translatef(GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRANSLATE, 3); - if (n) { - n[1].f = x; - n[2].f = y; - n[3].f = z; - } - if (ctx->ExecuteFlag) { - CALL_Translatef(ctx->Exec, (x, y, z)); - } -} - - -static void GLAPIENTRY -save_Translated(GLdouble x, GLdouble y, GLdouble z) -{ - save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z); -} - - - -static void GLAPIENTRY -save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_VIEWPORT, 4); - if (n) { - n[1].i = x; - n[2].i = y; - n[3].i = (GLint) width; - n[4].i = (GLint) height; - } - if (ctx->ExecuteFlag) { - CALL_Viewport(ctx->Exec, (x, y, width, height)); - } -} - - -static void GLAPIENTRY -save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_WINDOW_POS, 4); - if (n) { - n[1].f = x; - n[2].f = y; - n[3].f = z; - n[4].f = w; - } - if (ctx->ExecuteFlag) { - CALL_WindowPos4fMESA(ctx->Exec, (x, y, z, w)); - } -} - -static void GLAPIENTRY -save_WindowPos2dMESA(GLdouble x, GLdouble y) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2fMESA(GLfloat x, GLfloat y) -{ - save_WindowPos4fMESA(x, y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2iMESA(GLint x, GLint y) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2sMESA(GLshort x, GLshort y) -{ - save_WindowPos4fMESA(x, y, 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) -{ - save_WindowPos4fMESA(x, y, z, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3iMESA(GLint x, GLint y, GLint z) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) -{ - save_WindowPos4fMESA(x, y, z, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) -{ - save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -static void GLAPIENTRY -save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) -{ - save_WindowPos4fMESA(x, y, z, w); -} - -static void GLAPIENTRY -save_WindowPos2dvMESA(const GLdouble * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2fvMESA(const GLfloat * v) -{ - save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2ivMESA(const GLint * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos2svMESA(const GLshort * v) -{ - save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3dvMESA(const GLdouble * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3fvMESA(const GLfloat * v) -{ - save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3ivMESA(const GLint * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -static void GLAPIENTRY -save_WindowPos3svMESA(const GLshort * v) -{ - save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); -} - -static void GLAPIENTRY -save_WindowPos4dvMESA(const GLdouble * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -save_WindowPos4fvMESA(const GLfloat * v) -{ - save_WindowPos4fMESA(v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_WindowPos4ivMESA(const GLint * v) -{ - save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -static void GLAPIENTRY -save_WindowPos4svMESA(const GLshort * v) -{ - save_WindowPos4fMESA(v[0], v[1], v[2], v[3]); -} - - - -/* GL_ARB_multitexture */ -static void GLAPIENTRY -save_ActiveTextureARB(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_TEXTURE, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ActiveTextureARB(ctx->Exec, (target)); - } -} - - -/* GL_ARB_transpose_matrix */ - -static void GLAPIENTRY -save_LoadTransposeMatrixdARB(const GLdouble m[16]) -{ - GLfloat tm[16]; - _math_transposefd(tm, m); - save_LoadMatrixf(tm); -} - - -static void GLAPIENTRY -save_LoadTransposeMatrixfARB(const GLfloat m[16]) -{ - GLfloat tm[16]; - _math_transposef(tm, m); - save_LoadMatrixf(tm); -} - - -static void GLAPIENTRY -save_MultTransposeMatrixdARB(const GLdouble m[16]) -{ - GLfloat tm[16]; - _math_transposefd(tm, m); - save_MultMatrixf(tm); -} - - -static void GLAPIENTRY -save_MultTransposeMatrixfARB(const GLfloat m[16]) -{ - GLfloat tm[16]; - _math_transposef(tm, m); - save_MultMatrixf(tm); -} - - -/* GL_ARB_texture_compression */ -static void GLAPIENTRY -save_CompressedTexImage1DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLint border, GLsizei imageSize, - const GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_1D) { - /* don't compile, execute immediately */ - CALL_CompressedTexImage1DARB(ctx->Exec, (target, level, internalFormat, - width, border, imageSize, - data)); - } - else { - Node *n; - GLvoid *image; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].e = internalFormat; - n[4].i = (GLint) width; - n[5].i = border; - n[6].i = imageSize; - n[7].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexImage1DARB(ctx->Exec, - (target, level, internalFormat, width, - border, imageSize, data)); - } - } -} - - -static void GLAPIENTRY -save_CompressedTexImage2DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLint border, GLsizei imageSize, - const GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_2D) { - /* don't compile, execute immediately */ - CALL_CompressedTexImage2DARB(ctx->Exec, (target, level, internalFormat, - width, height, border, - imageSize, data)); - } - else { - Node *n; - GLvoid *image; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].e = internalFormat; - n[4].i = (GLint) width; - n[5].i = (GLint) height; - n[6].i = border; - n[7].i = imageSize; - n[8].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexImage2DARB(ctx->Exec, - (target, level, internalFormat, width, - height, border, imageSize, data)); - } - } -} - - -static void GLAPIENTRY -save_CompressedTexImage3DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLsizei depth, GLint border, - GLsizei imageSize, const GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_3D) { - /* don't compile, execute immediately */ - CALL_CompressedTexImage3DARB(ctx->Exec, (target, level, internalFormat, - width, height, depth, border, - imageSize, data)); - } - else { - Node *n; - GLvoid *image; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].e = internalFormat; - n[4].i = (GLint) width; - n[5].i = (GLint) height; - n[6].i = (GLint) depth; - n[7].i = border; - n[8].i = imageSize; - n[9].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexImage3DARB(ctx->Exec, - (target, level, internalFormat, width, - height, depth, border, imageSize, - data)); - } - } -} - - -static void GLAPIENTRY -save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, - GLsizei imageSize, const GLvoid * data) -{ - Node *n; - GLvoid *image; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = (GLint) width; - n[5].e = format; - n[6].i = imageSize; - n[7].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset, - width, format, imageSize, - data)); - } -} - - -static void GLAPIENTRY -save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLsizei imageSize, - const GLvoid * data) -{ - Node *n; - GLvoid *image; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = (GLint) width; - n[6].i = (GLint) height; - n[7].e = format; - n[8].i = imageSize; - n[9].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexSubImage2DARB(ctx->Exec, - (target, level, xoffset, yoffset, width, - height, format, imageSize, data)); - } -} - - -static void GLAPIENTRY -save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, GLenum format, - GLsizei imageSize, const GLvoid * data) -{ - Node *n; - GLvoid *image; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - /* make copy of image */ - image = _mesa_malloc(imageSize); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); - return; - } - MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = zoffset; - n[6].i = (GLint) width; - n[7].i = (GLint) height; - n[8].i = (GLint) depth; - n[9].e = format; - n[10].i = imageSize; - n[11].data = image; - } - else if (image) { - _mesa_free(image); - } - if (ctx->ExecuteFlag) { - CALL_CompressedTexSubImage3DARB(ctx->Exec, - (target, level, xoffset, yoffset, - zoffset, width, height, depth, format, - imageSize, data)); - } -} - - -/* GL_ARB_multisample */ -static void GLAPIENTRY -save_SampleCoverageARB(GLclampf value, GLboolean invert) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SAMPLE_COVERAGE, 2); - if (n) { - n[1].f = value; - n[2].b = invert; - } - if (ctx->ExecuteFlag) { - CALL_SampleCoverageARB(ctx->Exec, (value, invert)); - } -} - - -/* - * GL_NV_vertex_program - */ -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -static void GLAPIENTRY -save_BindProgramNV(GLenum target, GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_PROGRAM_NV, 2); - if (n) { - n[1].e = target; - n[2].ui = id; - } - if (ctx->ExecuteFlag) { - CALL_BindProgramNV(ctx->Exec, (target, id)); - } -} - -static void GLAPIENTRY -save_ProgramEnvParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = x; - n[4].f = y; - n[5].f = z; - n[6].f = w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_ProgramEnvParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) -{ - save_ProgramEnvParameter4fARB(target, index, params[0], params[1], - params[2], params[3]); -} - - -static void GLAPIENTRY -save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat * params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - if (count > 0) { - GLint i; - const GLfloat * p = params; - - for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = p[0]; - n[4].f = p[1]; - n[5].f = p[2]; - n[6].f = p[3]; - p += 4; - } - } - } - - if (ctx->ExecuteFlag) { - CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params)); - } -} - - -static void GLAPIENTRY -save_ProgramEnvParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_ProgramEnvParameter4fARB(target, index, - (GLfloat) x, - (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - - -static void GLAPIENTRY -save_ProgramEnvParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params) -{ - save_ProgramEnvParameter4fARB(target, index, - (GLfloat) params[0], - (GLfloat) params[1], - (GLfloat) params[2], (GLfloat) params[3]); -} - -#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */ - -#if FEATURE_NV_vertex_program -static void GLAPIENTRY -save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); - if (n) { - n[1].e = target; - n[2].ui = id; - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_ExecuteProgramNV(ctx->Exec, (target, id, params)); - } -} - - -static void GLAPIENTRY -save_ProgramParameters4dvNV(GLenum target, GLuint index, - GLuint num, const GLdouble *params) -{ - GLuint i; - for (i = 0; i < num; i++) { - save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i); - } -} - - -static void GLAPIENTRY -save_ProgramParameters4fvNV(GLenum target, GLuint index, - GLuint num, const GLfloat *params) -{ - GLuint i; - for (i = 0; i < num; i++) { - save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i); - } -} - - -static void GLAPIENTRY -save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, - const GLubyte * program) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - GLubyte *programCopy; - - programCopy = (GLubyte *) _mesa_malloc(len); - if (!programCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_memcpy(programCopy, program, len); - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4); - if (n) { - n[1].e = target; - n[2].ui = id; - n[3].i = len; - n[4].data = programCopy; - } - if (ctx->ExecuteFlag) { - CALL_LoadProgramNV(ctx->Exec, (target, id, len, program)); - } -} - - -static void GLAPIENTRY -save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); - if (!idCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); - return; - } - _mesa_memcpy(idCopy, ids, num * sizeof(GLuint)); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2); - if (n) { - n[1].i = num; - n[2].data = idCopy; - } - if (ctx->ExecuteFlag) { - CALL_RequestResidentProgramsNV(ctx->Exec, (num, ids)); - } -} - - -static void GLAPIENTRY -save_TrackMatrixNV(GLenum target, GLuint address, - GLenum matrix, GLenum transform) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4); - if (n) { - n[1].e = target; - n[2].ui = address; - n[3].e = matrix; - n[4].e = transform; - } - if (ctx->ExecuteFlag) { - CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform)); - } -} -#endif /* FEATURE_NV_vertex_program */ - - -/* - * GL_NV_fragment_program - */ -#if FEATURE_NV_fragment_program -static void GLAPIENTRY -save_ProgramLocalParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = x; - n[4].f = y; - n[5].f = z; - n[6].f = w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramLocalParameter4fARB(ctx->Exec, (target, index, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_ProgramLocalParameter4fvARB(ctx->Exec, (target, index, params)); - } -} - - -static void GLAPIENTRY -save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - if (count > 0) { - GLint i; - const GLfloat * p = params; - - for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = p[0]; - n[4].f = p[1]; - n[5].f = p[2]; - n[6].f = p[3]; - p += 4; - } - } - } - - if (ctx->ExecuteFlag) { - CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params)); - } -} - - -static void GLAPIENTRY -save_ProgramLocalParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, - GLdouble z, GLdouble w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = (GLfloat) x; - n[4].f = (GLfloat) y; - n[5].f = (GLfloat) z; - n[6].f = (GLfloat) w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramLocalParameter4dARB(ctx->Exec, (target, index, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); - if (n) { - n[1].e = target; - n[2].ui = index; - n[3].f = (GLfloat) params[0]; - n[4].f = (GLfloat) params[1]; - n[5].f = (GLfloat) params[2]; - n[6].f = (GLfloat) params[3]; - } - if (ctx->ExecuteFlag) { - CALL_ProgramLocalParameter4dvARB(ctx->Exec, (target, index, params)); - } -} - -static void GLAPIENTRY -save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); - if (!nameCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); - return; - } - _mesa_memcpy(nameCopy, name, len); - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); - if (n) { - n[1].ui = id; - n[2].i = len; - n[3].data = nameCopy; - n[4].f = x; - n[5].f = y; - n[6].f = z; - n[7].f = w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramNamedParameter4fNV(ctx->Exec, (id, len, name, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, - const float v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y, - (GLfloat) z, (GLfloat) w); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, - const double v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0], - (GLfloat) v[1], (GLfloat) v[2], - (GLfloat) v[3]); -} - -#endif /* FEATURE_NV_fragment_program */ - - - -/* GL_EXT_stencil_two_side */ -static void GLAPIENTRY -save_ActiveStencilFaceEXT(GLenum face) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); - if (n) { - n[1].e = face; - } - if (ctx->ExecuteFlag) { - CALL_ActiveStencilFaceEXT(ctx->Exec, (face)); - } -} - - -/* GL_EXT_depth_bounds_test */ -static void GLAPIENTRY -save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); - if (n) { - n[1].f = (GLfloat) zmin; - n[2].f = (GLfloat) zmax; - } - if (ctx->ExecuteFlag) { - CALL_DepthBoundsEXT(ctx->Exec, (zmin, zmax)); - } -} - - - -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - -static void GLAPIENTRY -save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, - const GLvoid * string) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - GLubyte *programCopy; - - programCopy = (GLubyte *) _mesa_malloc(len); - if (!programCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); - return; - } - _mesa_memcpy(programCopy, string, len); - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4); - if (n) { - n[1].e = target; - n[2].e = format; - n[3].i = len; - n[4].data = programCopy; - } - if (ctx->ExecuteFlag) { - CALL_ProgramStringARB(ctx->Exec, (target, format, len, string)); - } -} - -#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ - - -#if FEATURE_ARB_occlusion_query - -static void GLAPIENTRY -save_BeginQueryARB(GLenum target, GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN_QUERY_ARB, 2); - if (n) { - n[1].e = target; - n[2].ui = id; - } - if (ctx->ExecuteFlag) { - CALL_BeginQueryARB(ctx->Exec, (target, id)); - } -} - - -static void GLAPIENTRY -save_EndQueryARB(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_END_QUERY_ARB, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_EndQueryARB(ctx->Exec, (target)); - } -} - -#endif /* FEATURE_ARB_occlusion_query */ - - -static void GLAPIENTRY -save_DrawBuffersARB(GLsizei count, const GLenum * buffers) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); - if (n) { - GLint i; - n[1].i = count; - if (count > MAX_DRAW_BUFFERS) - count = MAX_DRAW_BUFFERS; - for (i = 0; i < count; i++) { - n[2 + i].e = buffers[i]; - } - } - if (ctx->ExecuteFlag) { - CALL_DrawBuffersARB(ctx->Exec, (count, buffers)); - } -} - -#if FEATURE_ATI_fragment_shader -static void GLAPIENTRY -save_BindFragmentShaderATI(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); - if (n) { - n[1].ui = id; - } - if (ctx->ExecuteFlag) { - CALL_BindFragmentShaderATI(ctx->Exec, (id)); - } -} - -static void GLAPIENTRY -save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); - if (n) { - n[1].ui = dst; - n[2].f = value[0]; - n[3].f = value[1]; - n[4].f = value[2]; - n[5].f = value[3]; - } - if (ctx->ExecuteFlag) { - CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value)); - } -} -#endif - -static void -save_Attr1fNV(GLenum attr, GLfloat x) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_NV, 2); - if (n) { - n[1].e = attr; - n[2].f = x; - } - - ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 1; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib1fNV(ctx->Exec, (attr, x)); - } -} - -static void -save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_NV, 3); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - } - - ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 2; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib2fNV(ctx->Exec, (attr, x, y)); - } -} - -static void -save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_NV, 4); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - n[4].f = z; - } - - ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 3; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib3fNV(ctx->Exec, (attr, x, y, z)); - } -} - -static void -save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_NV, 5); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - n[4].f = z; - n[5].f = w; - } - - ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 4; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib4fNV(ctx->Exec, (attr, x, y, z, w)); - } -} - - -static void -save_Attr1fARB(GLenum attr, GLfloat x) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_ARB, 2); - if (n) { - n[1].e = attr; - n[2].f = x; - } - - ASSERT(attr < MAX_VERTEX_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 1; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib1fARB(ctx->Exec, (attr, x)); - } -} - -static void -save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_ARB, 3); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - } - - ASSERT(attr < MAX_VERTEX_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 2; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib2fARB(ctx->Exec, (attr, x, y)); - } -} - -static void -save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_ARB, 4); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - n[4].f = z; - } - - ASSERT(attr < MAX_VERTEX_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 3; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib3fARB(ctx->Exec, (attr, x, y, z)); - } -} - -static void -save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_ARB, 5); - if (n) { - n[1].e = attr; - n[2].f = x; - n[3].f = y; - n[4].f = z; - n[5].f = w; - } - - ASSERT(attr < MAX_VERTEX_ATTRIBS); - ctx->ListState.ActiveAttribSize[attr] = 4; - ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w); - - if (ctx->ExecuteFlag) { - CALL_VertexAttrib4fARB(ctx->Exec, (attr, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_EvalCoord1f(GLfloat x) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1); - if (n) { - n[1].f = x; - } - if (ctx->ExecuteFlag) { - CALL_EvalCoord1f(ctx->Exec, (x)); - } -} - -static void GLAPIENTRY -save_EvalCoord1fv(const GLfloat * v) -{ - save_EvalCoord1f(v[0]); -} - -static void GLAPIENTRY -save_EvalCoord2f(GLfloat x, GLfloat y) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2); - if (n) { - n[1].f = x; - n[2].f = y; - } - if (ctx->ExecuteFlag) { - CALL_EvalCoord2f(ctx->Exec, (x, y)); - } -} - -static void GLAPIENTRY -save_EvalCoord2fv(const GLfloat * v) -{ - save_EvalCoord2f(v[0], v[1]); -} - - -static void GLAPIENTRY -save_EvalPoint1(GLint x) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1); - if (n) { - n[1].i = x; - } - if (ctx->ExecuteFlag) { - CALL_EvalPoint1(ctx->Exec, (x)); - } -} - -static void GLAPIENTRY -save_EvalPoint2(GLint x, GLint y) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2); - if (n) { - n[1].i = x; - n[2].i = y; - } - if (ctx->ExecuteFlag) { - CALL_EvalPoint2(ctx->Exec, (x, y)); - } -} - -static void GLAPIENTRY -save_Indexf(GLfloat x) -{ - save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, x); -} - -static void GLAPIENTRY -save_Indexfv(const GLfloat * v) -{ - save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, v[0]); -} - -static void GLAPIENTRY -save_EdgeFlag(GLboolean x) -{ - save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0); -} - -static void GLAPIENTRY -save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - int args, i; - - SAVE_FLUSH_VERTICES(ctx); - - switch (face) { - case GL_BACK: - case GL_FRONT: - case GL_FRONT_AND_BACK: - break; - default: - _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(face)"); - return; - } - - switch (pname) { - case GL_EMISSION: - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - case GL_AMBIENT_AND_DIFFUSE: - args = 4; - break; - case GL_SHININESS: - args = 1; - break; - case GL_COLOR_INDEXES: - args = 3; - break; - default: - _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(pname)"); - return; - } - - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6); - if (n) { - n[1].e = face; - n[2].e = pname; - for (i = 0; i < args; i++) - n[3 + i].f = param[i]; - } - - { - GLuint bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL); - for (i = 0; i < MAT_ATTRIB_MAX; i++) - if (bitmask & (1 << i)) { - ctx->ListState.ActiveMaterialSize[i] = args; - COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param); - } - } - - if (ctx->ExecuteFlag) { - CALL_Materialfv(ctx->Exec, (face, pname, param)); - } -} - -static void GLAPIENTRY -save_Begin(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - GLboolean error = GL_FALSE; - - if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) { - _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)"); - error = GL_TRUE; - } - else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) { - /* Typically the first begin. This may raise an error on - * playback, depending on whether CallList is issued from inside - * a begin/end or not. - */ - ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM; - } - else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) { - ctx->Driver.CurrentSavePrimitive = mode; - } - else { - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive begin"); - error = GL_TRUE; - } - - if (!error) { - /* Give the driver an opportunity to hook in an optimized - * display list compiler. - */ - if (ctx->Driver.NotifySaveBegin(ctx, mode)) - return; - - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1); - if (n) { - n[1].e = mode; - } - } - - if (ctx->ExecuteFlag) { - CALL_Begin(ctx->Exec, (mode)); - } -} - -static void GLAPIENTRY -save_End(void) -{ - GET_CURRENT_CONTEXT(ctx); - SAVE_FLUSH_VERTICES(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0); - ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; - if (ctx->ExecuteFlag) { - CALL_End(ctx->Exec, ()); - } -} - -static void GLAPIENTRY -save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RECTF, 4); - if (n) { - n[1].f = a; - n[2].f = b; - n[3].f = c; - n[4].f = d; - } - if (ctx->ExecuteFlag) { - CALL_Rectf(ctx->Exec, (a, b, c, d)); - } -} - - -static void GLAPIENTRY -save_Vertex2f(GLfloat x, GLfloat y) -{ - save_Attr2fNV(VERT_ATTRIB_POS, x, y); -} - -static void GLAPIENTRY -save_Vertex2fv(const GLfloat * v) -{ - save_Attr2fNV(VERT_ATTRIB_POS, v[0], v[1]); -} - -static void GLAPIENTRY -save_Vertex3f(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_POS, x, y, z); -} - -static void GLAPIENTRY -save_Vertex3fv(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_POS, v[0], v[1], v[2]); -} - -static void GLAPIENTRY -save_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - save_Attr4fNV(VERT_ATTRIB_POS, x, y, z, w); -} - -static void GLAPIENTRY -save_Vertex4fv(const GLfloat * v) -{ - save_Attr4fNV(VERT_ATTRIB_POS, v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_TexCoord1f(GLfloat x) -{ - save_Attr1fNV(VERT_ATTRIB_TEX0, x); -} - -static void GLAPIENTRY -save_TexCoord1fv(const GLfloat * v) -{ - save_Attr1fNV(VERT_ATTRIB_TEX0, v[0]); -} - -static void GLAPIENTRY -save_TexCoord2f(GLfloat x, GLfloat y) -{ - save_Attr2fNV(VERT_ATTRIB_TEX0, x, y); -} - -static void GLAPIENTRY -save_TexCoord2fv(const GLfloat * v) -{ - save_Attr2fNV(VERT_ATTRIB_TEX0, v[0], v[1]); -} - -static void GLAPIENTRY -save_TexCoord3f(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_TEX0, x, y, z); -} - -static void GLAPIENTRY -save_TexCoord3fv(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2]); -} - -static void GLAPIENTRY -save_TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - save_Attr4fNV(VERT_ATTRIB_TEX0, x, y, z, w); -} - -static void GLAPIENTRY -save_TexCoord4fv(const GLfloat * v) -{ - save_Attr4fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_Normal3f(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_NORMAL, x, y, z); -} - -static void GLAPIENTRY -save_Normal3fv(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_NORMAL, v[0], v[1], v[2]); -} - -static void GLAPIENTRY -save_FogCoordfEXT(GLfloat x) -{ - save_Attr1fNV(VERT_ATTRIB_FOG, x); -} - -static void GLAPIENTRY -save_FogCoordfvEXT(const GLfloat * v) -{ - save_Attr1fNV(VERT_ATTRIB_FOG, v[0]); -} - -static void GLAPIENTRY -save_Color3f(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z); -} - -static void GLAPIENTRY -save_Color3fv(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]); -} - -static void GLAPIENTRY -save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w); -} - -static void GLAPIENTRY -save_Color4fv(const GLfloat * v) -{ - save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z); -} - -static void GLAPIENTRY -save_SecondaryColor3fvEXT(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]); -} - - -/* Just call the respective ATTR for texcoord - */ -static void GLAPIENTRY -save_MultiTexCoord1f(GLenum target, GLfloat x) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr1fNV(attr, x); -} - -static void GLAPIENTRY -save_MultiTexCoord1fv(GLenum target, const GLfloat * v) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr1fNV(attr, v[0]); -} - -static void GLAPIENTRY -save_MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr2fNV(attr, x, y); -} - -static void GLAPIENTRY -save_MultiTexCoord2fv(GLenum target, const GLfloat * v) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr2fNV(attr, v[0], v[1]); -} - -static void GLAPIENTRY -save_MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr3fNV(attr, x, y, z); -} - -static void GLAPIENTRY -save_MultiTexCoord3fv(GLenum target, const GLfloat * v) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr3fNV(attr, v[0], v[1], v[2]); -} - -static void GLAPIENTRY -save_MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y, - GLfloat z, GLfloat w) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr4fNV(attr, x, y, z, w); -} - -static void GLAPIENTRY -save_MultiTexCoord4fv(GLenum target, const GLfloat * v) -{ - GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0; - save_Attr4fNV(attr, v[0], v[1], v[2], v[3]); -} - - -/** - * Record a GL_INVALID_VALUE error when a invalid vertex attribute - * index is found. - */ -static void -index_error(void) -{ - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)"); -} - - -/* First level for NV_vertex_program: - * - * Check for errors at compile time?. - */ -static void GLAPIENTRY -save_VertexAttrib1fNV(GLuint index, GLfloat x) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr1fNV(index, x); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib1fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr1fNV(index, v[0]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr2fNV(index, x, y); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr2fNV(index, v[0], v[1]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr3fNV(index, x, y, z); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr3fNV(index, v[0], v[1], v[2]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, - GLfloat z, GLfloat w) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr4fNV(index, x, y, z, w); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_PROGRAM_ATTRIBS) - save_Attr4fNV(index, v[0], v[1], v[2], v[3]); - else - index_error(); -} - - - - -static void GLAPIENTRY -save_VertexAttrib1fARB(GLuint index, GLfloat x) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr1fARB(index, x); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib1fvARB(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr1fARB(index, v[0]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr2fARB(index, x, y); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fvARB(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr2fARB(index, v[0], v[1]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr3fARB(index, x, y, z); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fvARB(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr3fARB(index, v[0], v[1], v[2]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, - GLfloat w) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr4fARB(index, x, y, z, w); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fvARB(GLuint index, const GLfloat * v) -{ - if (index < MAX_VERTEX_ATTRIBS) - save_Attr4fARB(index, v[0], v[1], v[2], v[3]); - else - index_error(); -} - - -/* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */ - -static void GLAPIENTRY -exec_BindAttribLocationARB(GLuint program, GLuint index, const GLchar *name) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_BindAttribLocationARB(ctx->Exec, (program, index, name)); -} - -static GLint GLAPIENTRY -exec_GetAttribLocationARB(GLuint program, const GLchar *name) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_GetAttribLocationARB(ctx->Exec, (program, name)); -} -/* XXX more shader functions needed here */ - - - -#if FEATURE_EXT_framebuffer_blit -static void GLAPIENTRY -save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); - if (n) { - n[1].i = srcX0; - n[2].i = srcY0; - n[3].i = srcX1; - n[4].i = srcY1; - n[5].i = dstX0; - n[6].i = dstY0; - n[7].i = dstX1; - n[8].i = dstY1; - n[9].i = mask; - n[10].e = filter; - } - if (ctx->ExecuteFlag) { - CALL_BlitFramebufferEXT(ctx->Exec, (srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter)); - } -} -#endif - - -/** - * Save an error-generating command into display list. - * - * KW: Will appear in the list before the vertex buffer containing the - * command that provoked the error. I don't see this as a problem. - */ -static void -save_error(GLcontext *ctx, GLenum error, const char *s) -{ - Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2); - if (n) { - n[1].e = error; - n[2].data = (void *) s; - } -} - - -/** - * Compile an error into current display list. - */ -void -_mesa_compile_error(GLcontext *ctx, GLenum error, const char *s) -{ - if (ctx->CompileFlag) - save_error(ctx, error, s); - if (ctx->ExecuteFlag) - _mesa_error(ctx, error, s); -} - - -/** - * Test if ID names a display list. - */ -static GLboolean -islist(GLcontext *ctx, GLuint list) -{ - if (list > 0 && lookup_list(ctx, list)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - - -/**********************************************************************/ -/* Display list execution */ -/**********************************************************************/ - - -/* - * Execute a display list. Note that the ListBase offset must have already - * been added before calling this function. I.e. the list argument is - * the absolute list number, not relative to ListBase. - * \param list - display list number - */ -static void -execute_list(GLcontext *ctx, GLuint list) -{ - struct mesa_display_list *dlist; - Node *n; - GLboolean done; - - if (list == 0 || !islist(ctx, list)) - return; - - if (ctx->ListState.CallDepth == MAX_LIST_NESTING) { - /* raise an error? */ - return; - } - - dlist = lookup_list(ctx, list); - if (!dlist) - return; - - ctx->ListState.CallDepth++; - - if (ctx->Driver.BeginCallList) - ctx->Driver.BeginCallList(ctx, dlist); - - n = dlist->node; - - done = GL_FALSE; - while (!done) { - OpCode opcode = n[0].opcode; - int i = (int) n[0].opcode - (int) OPCODE_EXT_0; - - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Execute(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; - } - else { - switch (opcode) { - case OPCODE_ERROR: - _mesa_error(ctx, n[1].e, (const char *) n[2].data); - break; - case OPCODE_ACCUM: - CALL_Accum(ctx->Exec, (n[1].e, n[2].f)); - break; - case OPCODE_ALPHA_FUNC: - CALL_AlphaFunc(ctx->Exec, (n[1].e, n[2].f)); - break; - case OPCODE_BIND_TEXTURE: - CALL_BindTexture(ctx->Exec, (n[1].e, n[2].ui)); - break; - case OPCODE_BITMAP: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i, - n[3].f, n[4].f, n[5].f, n[6].f, - (const GLubyte *) n[7].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_BLEND_COLOR: - CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_BLEND_EQUATION: - CALL_BlendEquation(ctx->Exec, (n[1].e)); - break; - case OPCODE_BLEND_EQUATION_SEPARATE: - CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e)); - break; - case OPCODE_BLEND_FUNC_SEPARATE: - CALL_BlendFuncSeparateEXT(ctx->Exec, - (n[1].e, n[2].e, n[3].e, n[4].e)); - break; - case OPCODE_CALL_LIST: - /* Generated by glCallList(), don't add ListBase */ - if (ctx->ListState.CallDepth < MAX_LIST_NESTING) { - execute_list(ctx, n[1].ui); - } - break; - case OPCODE_CALL_LIST_OFFSET: - /* Generated by glCallLists() so we must add ListBase */ - if (n[2].b) { - /* user specified a bad data type at compile time */ - _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)"); - } - else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) { - GLuint list = (GLuint) (ctx->List.ListBase + n[1].i); - execute_list(ctx, list); - } - break; - case OPCODE_CLEAR: - CALL_Clear(ctx->Exec, (n[1].bf)); - break; - case OPCODE_CLEAR_COLOR: - CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_CLEAR_ACCUM: - CALL_ClearAccum(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_CLEAR_DEPTH: - CALL_ClearDepth(ctx->Exec, ((GLclampd) n[1].f)); - break; - case OPCODE_CLEAR_INDEX: - CALL_ClearIndex(ctx->Exec, ((GLfloat) n[1].ui)); - break; - case OPCODE_CLEAR_STENCIL: - CALL_ClearStencil(ctx->Exec, (n[1].i)); - break; - case OPCODE_CLIP_PLANE: - { - GLdouble eq[4]; - eq[0] = n[2].f; - eq[1] = n[3].f; - eq[2] = n[4].f; - eq[3] = n[5].f; - CALL_ClipPlane(ctx->Exec, (n[1].e, eq)); - } - break; - case OPCODE_COLOR_MASK: - CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b)); - break; - case OPCODE_COLOR_MATERIAL: - CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e)); - break; - case OPCODE_COLOR_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorTable(ctx->Exec, (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_TABLE_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ColorTableParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ColorTableParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_SUB_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorSubTable(ctx->Exec, (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_CONVOLUTION_FILTER_1D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter1D(ctx->Exec, (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_CONVOLUTION_FILTER_2D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter2D(ctx->Exec, (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_CONVOLUTION_PARAMETER_I: - CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i)); - break; - case OPCODE_CONVOLUTION_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ConvolutionParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_CONVOLUTION_PARAMETER_F: - CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f)); - break; - case OPCODE_CONVOLUTION_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ConvolutionParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COPY_COLOR_SUB_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; - case OPCODE_COPY_COLOR_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; - case OPCODE_COPY_PIXELS: - CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i, - (GLsizei) n[3].i, (GLsizei) n[4].i, - n[5].e)); - break; - case OPCODE_COPY_TEX_IMAGE1D: - CALL_CopyTexImage1D(ctx->Exec, (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: - CALL_CopyTexImage2D(ctx->Exec, (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: - CALL_CopyTexSubImage1D(ctx->Exec, (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: - CALL_CopyTexSubImage2D(ctx->Exec, (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: - CALL_CopyTexSubImage3D(ctx->Exec, (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: - CALL_CullFace(ctx->Exec, (n[1].e)); - break; - case OPCODE_DEPTH_FUNC: - CALL_DepthFunc(ctx->Exec, (n[1].e)); - break; - case OPCODE_DEPTH_MASK: - CALL_DepthMask(ctx->Exec, (n[1].b)); - break; - case OPCODE_DEPTH_RANGE: - CALL_DepthRange(ctx->Exec, - ((GLclampd) n[1].f, (GLclampd) n[2].f)); - break; - case OPCODE_DISABLE: - CALL_Disable(ctx->Exec, (n[1].e)); - break; - case OPCODE_DRAW_BUFFER: - CALL_DrawBuffer(ctx->Exec, (n[1].e)); - break; - case OPCODE_DRAW_PIXELS: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e, - n[5].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_ENABLE: - CALL_Enable(ctx->Exec, (n[1].e)); - break; - case OPCODE_EVALMESH1: - CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i)); - break; - case OPCODE_EVALMESH2: - CALL_EvalMesh2(ctx->Exec, - (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i)); - break; - case OPCODE_FOG: - { - GLfloat p[4]; - p[0] = n[2].f; - p[1] = n[3].f; - p[2] = n[4].f; - p[3] = n[5].f; - CALL_Fogfv(ctx->Exec, (n[1].e, p)); - } - break; - case OPCODE_FRONT_FACE: - CALL_FrontFace(ctx->Exec, (n[1].e)); - break; - case OPCODE_FRUSTUM: - CALL_Frustum(ctx->Exec, - (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f)); - break; - case OPCODE_HINT: - CALL_Hint(ctx->Exec, (n[1].e, n[2].e)); - break; - case OPCODE_HISTOGRAM: - CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b)); - break; - case OPCODE_INDEX_MASK: - CALL_IndexMask(ctx->Exec, (n[1].ui)); - break; - case OPCODE_INIT_NAMES: - CALL_InitNames(ctx->Exec, ()); - break; - case OPCODE_LIGHT: - { - GLfloat p[4]; - p[0] = n[3].f; - p[1] = n[4].f; - p[2] = n[5].f; - p[3] = n[6].f; - CALL_Lightfv(ctx->Exec, (n[1].e, n[2].e, p)); - } - break; - case OPCODE_LIGHT_MODEL: - { - GLfloat p[4]; - p[0] = n[2].f; - p[1] = n[3].f; - p[2] = n[4].f; - p[3] = n[5].f; - CALL_LightModelfv(ctx->Exec, (n[1].e, p)); - } - break; - case OPCODE_LINE_STIPPLE: - CALL_LineStipple(ctx->Exec, (n[1].i, n[2].us)); - break; - case OPCODE_LINE_WIDTH: - CALL_LineWidth(ctx->Exec, (n[1].f)); - break; - case OPCODE_LIST_BASE: - CALL_ListBase(ctx->Exec, (n[1].ui)); - break; - case OPCODE_LOAD_IDENTITY: - CALL_LoadIdentity(ctx->Exec, ()); - break; - case OPCODE_LOAD_MATRIX: - if (sizeof(Node) == sizeof(GLfloat)) { - CALL_LoadMatrixf(ctx->Exec, (&n[1].f)); - } - else { - GLfloat m[16]; - GLuint i; - for (i = 0; i < 16; i++) { - m[i] = n[1 + i].f; - } - CALL_LoadMatrixf(ctx->Exec, (m)); - } - break; - case OPCODE_LOAD_NAME: - CALL_LoadName(ctx->Exec, (n[1].ui)); - break; - case OPCODE_LOGIC_OP: - CALL_LogicOp(ctx->Exec, (n[1].e)); - break; - case OPCODE_MAP1: - { - 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; - CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder, - (GLfloat *) n[6].data)); - } - break; - case OPCODE_MAP2: - { - 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; - CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder, - v1, v2, vstride, vorder, - (GLfloat *) n[10].data)); - } - break; - case OPCODE_MAPGRID1: - CALL_MapGrid1f(ctx->Exec, (n[1].i, n[2].f, n[3].f)); - break; - case OPCODE_MAPGRID2: - CALL_MapGrid2f(ctx->Exec, - (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f)); - break; - case OPCODE_MATRIX_MODE: - CALL_MatrixMode(ctx->Exec, (n[1].e)); - break; - case OPCODE_MIN_MAX: - CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b)); - break; - case OPCODE_MULT_MATRIX: - if (sizeof(Node) == sizeof(GLfloat)) { - CALL_MultMatrixf(ctx->Exec, (&n[1].f)); - } - else { - GLfloat m[16]; - GLuint i; - for (i = 0; i < 16; i++) { - m[i] = n[1 + i].f; - } - CALL_MultMatrixf(ctx->Exec, (m)); - } - break; - case OPCODE_ORTHO: - CALL_Ortho(ctx->Exec, - (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f)); - break; - case OPCODE_PASSTHROUGH: - CALL_PassThrough(ctx->Exec, (n[1].f)); - break; - case OPCODE_PIXEL_MAP: - CALL_PixelMapfv(ctx->Exec, - (n[1].e, n[2].i, (GLfloat *) n[3].data)); - break; - case OPCODE_PIXEL_TRANSFER: - CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f)); - break; - case OPCODE_PIXEL_ZOOM: - CALL_PixelZoom(ctx->Exec, (n[1].f, n[2].f)); - break; - case OPCODE_POINT_SIZE: - CALL_PointSize(ctx->Exec, (n[1].f)); - break; - case OPCODE_POINT_PARAMETERS: - { - GLfloat params[3]; - params[0] = n[2].f; - params[1] = n[3].f; - params[2] = n[4].f; - CALL_PointParameterfvEXT(ctx->Exec, (n[1].e, params)); - } - break; - case OPCODE_POLYGON_MODE: - CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e)); - break; - case OPCODE_POLYGON_STIPPLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_POLYGON_OFFSET: - CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f)); - break; - case OPCODE_POP_ATTRIB: - CALL_PopAttrib(ctx->Exec, ()); - break; - case OPCODE_POP_MATRIX: - CALL_PopMatrix(ctx->Exec, ()); - break; - case OPCODE_POP_NAME: - CALL_PopName(ctx->Exec, ()); - break; - case OPCODE_PRIORITIZE_TEXTURE: - CALL_PrioritizeTextures(ctx->Exec, (1, &n[1].ui, &n[2].f)); - break; - case OPCODE_PUSH_ATTRIB: - CALL_PushAttrib(ctx->Exec, (n[1].bf)); - break; - case OPCODE_PUSH_MATRIX: - CALL_PushMatrix(ctx->Exec, ()); - break; - case OPCODE_PUSH_NAME: - CALL_PushName(ctx->Exec, (n[1].ui)); - break; - case OPCODE_RASTER_POS: - CALL_RasterPos4f(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_READ_BUFFER: - CALL_ReadBuffer(ctx->Exec, (n[1].e)); - break; - case OPCODE_RESET_HISTOGRAM: - CALL_ResetHistogram(ctx->Exec, (n[1].e)); - break; - case OPCODE_RESET_MIN_MAX: - CALL_ResetMinmax(ctx->Exec, (n[1].e)); - break; - case OPCODE_ROTATE: - CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_SCALE: - CALL_Scalef(ctx->Exec, (n[1].f, n[2].f, n[3].f)); - break; - case OPCODE_SCISSOR: - CALL_Scissor(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i)); - break; - case OPCODE_SHADE_MODEL: - CALL_ShadeModel(ctx->Exec, (n[1].e)); - break; - case OPCODE_STENCIL_FUNC: - CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui)); - break; - case OPCODE_STENCIL_MASK: - CALL_StencilMask(ctx->Exec, (n[1].ui)); - break; - case OPCODE_STENCIL_OP: - CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e)); - break; - case OPCODE_STENCIL_FUNC_SEPARATE: - CALL_StencilFuncSeparate(ctx->Exec, - (n[1].e, n[2].e, n[3].i, n[4].ui)); - break; - case OPCODE_STENCIL_MASK_SEPARATE: - CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui)); - break; - case OPCODE_STENCIL_OP_SEPARATE: - CALL_StencilOpSeparate(ctx->Exec, - (n[1].e, n[2].e, n[3].e, n[4].e)); - break; - case OPCODE_TEXENV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_TexEnvfv(ctx->Exec, (n[1].e, n[2].e, params)); - } - break; - case OPCODE_TEXGEN: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_TexGenfv(ctx->Exec, (n[1].e, n[2].e, params)); - } - break; - case OPCODE_TEXPARAMETER: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_TexParameterfv(ctx->Exec, (n[1].e, n[2].e, params)); - } - break; - case OPCODE_TEX_IMAGE1D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexImage1D(ctx->Exec, (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: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexImage2D(ctx->Exec, (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: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexImage3D(ctx->Exec, (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: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexSubImage1D(ctx->Exec, (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: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexSubImage2D(ctx->Exec, (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 */ - } - break; - case OPCODE_TEX_SUB_IMAGE3D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexSubImage3D(ctx->Exec, (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: - CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f)); - break; - case OPCODE_VIEWPORT: - CALL_Viewport(ctx->Exec, (n[1].i, n[2].i, - (GLsizei) n[3].i, (GLsizei) n[4].i)); - break; - case OPCODE_WINDOW_POS: - CALL_WindowPos4fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */ - CALL_ActiveTextureARB(ctx->Exec, (n[1].e)); - break; - case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */ - CALL_CompressedTexImage1DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].data)); - break; - case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */ - CALL_CompressedTexImage2DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].i, n[8].data)); - break; - case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */ - CALL_CompressedTexImage3DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].i, n[8].i, - n[9].data)); - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */ - CALL_CompressedTexSubImage1DARB(ctx->Exec, - (n[1].e, n[2].i, n[3].i, n[4].i, - n[5].e, n[6].i, n[7].data)); - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */ - CALL_CompressedTexSubImage2DARB(ctx->Exec, - (n[1].e, n[2].i, n[3].i, n[4].i, - n[5].i, n[6].i, n[7].e, n[8].i, - n[9].data)); - break; - case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */ - CALL_CompressedTexSubImage3DARB(ctx->Exec, - (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].i, n[11].data)); - break; - case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */ - CALL_SampleCoverageARB(ctx->Exec, (n[1].f, n[2].b)); - break; - case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */ - CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f)); - break; -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */ - CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui)); - break; -#endif -#if FEATURE_NV_vertex_program - case OPCODE_EXECUTE_PROGRAM_NV: - { - GLfloat v[4]; - v[0] = n[3].f; - v[1] = n[4].f; - v[2] = n[5].f; - v[3] = n[6].f; - CALL_ExecuteProgramNV(ctx->Exec, (n[1].e, n[2].ui, v)); - } - break; - case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui, - (GLuint *) n[2].data)); - break; - case OPCODE_LOAD_PROGRAM_NV: - CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i, - (const GLubyte *) n[4].data)); - break; - case OPCODE_TRACK_MATRIX_NV: - CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e)); - break; -#endif - -#if FEATURE_NV_fragment_program - case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB: - CALL_ProgramLocalParameter4fARB(ctx->Exec, - (n[1].e, n[2].ui, n[3].f, n[4].f, - n[5].f, n[6].f)); - break; - case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i, - (const GLubyte *) n[3]. - data, n[4].f, n[5].f, - n[6].f, n[7].f)); - break; -#endif - - case OPCODE_ACTIVE_STENCIL_FACE_EXT: - CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e)); - break; - case OPCODE_DEPTH_BOUNDS_EXT: - CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f)); - break; -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - case OPCODE_PROGRAM_STRING_ARB: - CALL_ProgramStringARB(ctx->Exec, - (n[1].e, n[2].e, n[3].i, n[4].data)); - break; -#endif -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program - case OPCODE_PROGRAM_ENV_PARAMETER_ARB: - CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f, - n[4].f, n[5].f, - n[6].f)); - break; -#endif -#if FEATURE_ARB_occlusion_query - case OPCODE_BEGIN_QUERY_ARB: - CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); - break; - case OPCODE_END_QUERY_ARB: - CALL_EndQueryARB(ctx->Exec, (n[1].e)); - break; -#endif - case OPCODE_DRAW_BUFFERS_ARB: - { - GLenum buffers[MAX_DRAW_BUFFERS]; - GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS); - for (i = 0; i < count; i++) - buffers[i] = n[2 + i].e; - CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers)); - } - break; -#if FEATURE_EXT_framebuffer_blit - case OPCODE_BLIT_FRAMEBUFFER: - CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i, - n[5].i, n[6].i, n[7].i, n[8].i, - n[9].i, n[10].e)); - break; -#endif -#if FEATURE_ATI_fragment_shader - case OPCODE_BIND_FRAGMENT_SHADER_ATI: - CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i)); - break; - case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI: - { - GLfloat values[4]; - GLuint i, dst = n[1].ui; - - for (i = 0; i < 4; i++) - values[i] = n[1 + i].f; - CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values)); - } - break; -#endif - case OPCODE_ATTR_1F_NV: - CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f)); - break; - case OPCODE_ATTR_2F_NV: - /* Really shouldn't have to do this - the Node structure - * is convenient, but it would be better to store the data - * packed appropriately so that it can be sent directly - * on. With x86_64 becoming common, this will start to - * matter more. - */ - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f)); - break; - case OPCODE_ATTR_3F_NV: - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f, - n[4].f)); - break; - case OPCODE_ATTR_4F_NV: - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f, - n[4].f, n[5].f)); - break; - case OPCODE_ATTR_1F_ARB: - CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f)); - break; - case OPCODE_ATTR_2F_ARB: - /* Really shouldn't have to do this - the Node structure - * is convenient, but it would be better to store the data - * packed appropriately so that it can be sent directly - * on. With x86_64 becoming common, this will start to - * matter more. - */ - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f)); - break; - case OPCODE_ATTR_3F_ARB: - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f, - n[4].f)); - break; - case OPCODE_ATTR_4F_ARB: - if (sizeof(Node) == sizeof(GLfloat)) - CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f)); - else - CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f, - n[4].f, n[5].f)); - break; - case OPCODE_MATERIAL: - if (sizeof(Node) == sizeof(GLfloat)) - CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f)); - else { - GLfloat f[4]; - f[0] = n[3].f; - f[1] = n[4].f; - f[2] = n[5].f; - f[3] = n[6].f; - CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f)); - } - break; - case OPCODE_BEGIN: - CALL_Begin(ctx->Exec, (n[1].e)); - break; - case OPCODE_END: - CALL_End(ctx->Exec, ()); - break; - case OPCODE_RECTF: - CALL_Rectf(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); - break; - case OPCODE_EVAL_C1: - CALL_EvalCoord1f(ctx->Exec, (n[1].f)); - break; - case OPCODE_EVAL_C2: - CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f)); - break; - case OPCODE_EVAL_P1: - CALL_EvalPoint1(ctx->Exec, (n[1].i)); - break; - case OPCODE_EVAL_P2: - CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i)); - break; - - case OPCODE_CONTINUE: - n = (Node *) n[1].next; - break; - case OPCODE_END_OF_LIST: - done = GL_TRUE; - break; - default: - { - char msg[1000]; - _mesa_sprintf(msg, "Error in execute_list: opcode=%d", - (int) opcode); - _mesa_problem(ctx, msg); - } - done = GL_TRUE; - } - - /* increment n to point to next compiled command */ - if (opcode != OPCODE_CONTINUE) { - n += InstSize[opcode]; - } - } - } - - if (ctx->Driver.EndCallList) - ctx->Driver.EndCallList(ctx); - - ctx->ListState.CallDepth--; -} - - - -/**********************************************************************/ -/* GL functions */ -/**********************************************************************/ - -/** - * Test if a display list number is valid. - */ -GLboolean GLAPIENTRY -_mesa_IsList(GLuint list) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); /* must be called before assert */ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - return islist(ctx, list); -} - - -/** - * Delete a sequence of consecutive display lists. - */ -void GLAPIENTRY -_mesa_DeleteLists(GLuint list, GLsizei range) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint i; - FLUSH_VERTICES(ctx, 0); /* must be called before assert */ - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (range < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists"); - return; - } - for (i = list; i < list + range; i++) { - destroy_list(ctx, i); - } -} - - -/** - * Return a display list number, n, such that lists n through n+range-1 - * are free. - */ -GLuint GLAPIENTRY -_mesa_GenLists(GLsizei range) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint base; - FLUSH_VERTICES(ctx, 0); /* must be called before assert */ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - if (range < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists"); - return 0; - } - if (range == 0) { - return 0; - } - - /* - * Make this an atomic operation - */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - 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++) { - _mesa_HashInsert(ctx->Shared->DisplayList, base + i, - make_list(base + i, 1)); - } - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - - return base; -} - - -/** - * Begin a new display list. - */ -void GLAPIENTRY -_mesa_NewList(GLuint list, GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - FLUSH_CURRENT(ctx, 0); /* must be called before assert */ - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glNewList %u %s\n", list, - _mesa_lookup_enum_by_nr(mode)); - - if (list == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glNewList"); - return; - } - - if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) { - _mesa_error(ctx, GL_INVALID_ENUM, "glNewList"); - return; - } - - if (ctx->ListState.CurrentListPtr) { - /* already compiling a display list */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); - return; - } - - ctx->CompileFlag = GL_TRUE; - ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE); - - /* Allocate new display list */ - ctx->ListState.CurrentListNum = list; - ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE); - ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node; - ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock; - ctx->ListState.CurrentPos = 0; - - /* Reset acumulated list state: - */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) - ctx->ListState.ActiveAttribSize[i] = 0; - - for (i = 0; i < MAT_ATTRIB_MAX; i++) - ctx->ListState.ActiveMaterialSize[i] = 0; - - ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; - ctx->Driver.NewList(ctx, list, mode); - - ctx->CurrentDispatch = ctx->Save; - _glapi_set_dispatch(ctx->CurrentDispatch); -} - - -/** - * End definition of current display list. - */ -void GLAPIENTRY -_mesa_EndList(void) -{ - GET_CURRENT_CONTEXT(ctx); - SAVE_FLUSH_VERTICES(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glEndList\n"); - - /* Check that a list is under construction */ - if (!ctx->ListState.CurrentListPtr) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); - return; - } - - /* Call before emitting END_OF_LIST, in case the driver wants to - * emit opcodes itself. - */ - ctx->Driver.EndList(ctx); - - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); - - /* Destroy old list, if any */ - destroy_list(ctx, ctx->ListState.CurrentListNum); - /* Install the list */ - _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, - ctx->ListState.CurrentList); - - - if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) - mesa_print_display_list(ctx->ListState.CurrentListNum); - - ctx->ListState.CurrentList = NULL; - ctx->ListState.CurrentListNum = 0; - ctx->ListState.CurrentListPtr = NULL; - ctx->ExecuteFlag = GL_TRUE; - ctx->CompileFlag = GL_FALSE; - - ctx->CurrentDispatch = ctx->Exec; - _glapi_set_dispatch(ctx->CurrentDispatch); -} - - -void GLAPIENTRY -_mesa_CallList(GLuint list) -{ - GLboolean save_compile_flag; - GET_CURRENT_CONTEXT(ctx); - FLUSH_CURRENT(ctx, 0); - /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */ - /* execute the display list, and restore the CompileFlag. */ - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glCallList %d\n", list); - - if (list == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)"); - return; - } - -/* mesa_print_display_list( list ); */ - - save_compile_flag = ctx->CompileFlag; - if (save_compile_flag) { - ctx->CompileFlag = GL_FALSE; - } - - execute_list(ctx, list); - ctx->CompileFlag = save_compile_flag; - - /* also restore API function pointers to point to "save" versions */ - if (save_compile_flag) { - ctx->CurrentDispatch = ctx->Save; - _glapi_set_dispatch(ctx->CurrentDispatch); - } -} - - -/** - * Execute glCallLists: call multiple display lists. - */ -void GLAPIENTRY -_mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - GLboolean save_compile_flag; - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glCallLists %d\n", n); - - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_2_BYTES: - case GL_3_BYTES: - case GL_4_BYTES: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)"); - return; - } - - /* Save the CompileFlag status, turn it off, execute display list, - * and restore the CompileFlag. - */ - save_compile_flag = ctx->CompileFlag; - ctx->CompileFlag = GL_FALSE; - - for (i = 0; i < n; i++) { - GLuint list = (GLuint) (ctx->List.ListBase + translate_id(i, type, lists)); - execute_list(ctx, list); - } - - ctx->CompileFlag = save_compile_flag; - - /* also restore API function pointers to point to "save" versions */ - if (save_compile_flag) { - ctx->CurrentDispatch = ctx->Save; - _glapi_set_dispatch(ctx->CurrentDispatch); - } -} - - -/** - * Set the offset added to list numbers in glCallLists. - */ -void GLAPIENTRY -_mesa_ListBase(GLuint base) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); /* must be called before assert */ - ASSERT_OUTSIDE_BEGIN_END(ctx); - ctx->List.ListBase = base; -} - - -/* Can no longer assume ctx->Exec->Func is equal to _mesa_Func. - */ -static void GLAPIENTRY -exec_Finish(void) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_Finish(ctx->Exec, ()); -} - -static void GLAPIENTRY -exec_Flush(void) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_Flush(ctx->Exec, ()); -} - -static void GLAPIENTRY -exec_GetBooleanv(GLenum pname, GLboolean *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetBooleanv(ctx->Exec, (pname, params)); -} - -static void GLAPIENTRY -exec_GetClipPlane(GLenum plane, GLdouble * equation) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetClipPlane(ctx->Exec, (plane, equation)); -} - -static void GLAPIENTRY -exec_GetDoublev(GLenum pname, GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetDoublev(ctx->Exec, (pname, params)); -} - -static GLenum GLAPIENTRY -exec_GetError(void) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_GetError(ctx->Exec, ()); -} - -static void GLAPIENTRY -exec_GetFloatv(GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetFloatv(ctx->Exec, (pname, params)); -} - -static void GLAPIENTRY -exec_GetIntegerv(GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetIntegerv(ctx->Exec, (pname, params)); -} - -static void GLAPIENTRY -exec_GetLightfv(GLenum light, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetLightfv(ctx->Exec, (light, pname, params)); -} - -static void GLAPIENTRY -exec_GetLightiv(GLenum light, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetLightiv(ctx->Exec, (light, pname, params)); -} - -static void GLAPIENTRY -exec_GetMapdv(GLenum target, GLenum query, GLdouble * v) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMapdv(ctx->Exec, (target, query, v)); -} - -static void GLAPIENTRY -exec_GetMapfv(GLenum target, GLenum query, GLfloat * v) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMapfv(ctx->Exec, (target, query, v)); -} - -static void GLAPIENTRY -exec_GetMapiv(GLenum target, GLenum query, GLint * v) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMapiv(ctx->Exec, (target, query, v)); -} - -static void GLAPIENTRY -exec_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMaterialfv(ctx->Exec, (face, pname, params)); -} - -static void GLAPIENTRY -exec_GetMaterialiv(GLenum face, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMaterialiv(ctx->Exec, (face, pname, params)); -} - -static void GLAPIENTRY -exec_GetPixelMapfv(GLenum map, GLfloat *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetPixelMapfv(ctx->Exec, (map, values)); -} - -static void GLAPIENTRY -exec_GetPixelMapuiv(GLenum map, GLuint *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetPixelMapuiv(ctx->Exec, (map, values)); -} - -static void GLAPIENTRY -exec_GetPixelMapusv(GLenum map, GLushort *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetPixelMapusv(ctx->Exec, (map, values)); -} - -static void GLAPIENTRY -exec_GetPolygonStipple(GLubyte * dest) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetPolygonStipple(ctx->Exec, (dest)); -} - -static const GLubyte *GLAPIENTRY -exec_GetString(GLenum name) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_GetString(ctx->Exec, (name)); -} - -static void GLAPIENTRY -exec_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexEnvfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexEnviv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexEnviv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexGendv(GLenum coord, GLenum pname, GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexGendv(ctx->Exec, (coord, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexGenfv(ctx->Exec, (coord, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexGeniv(GLenum coord, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexGeniv(ctx->Exec, (coord, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexImage(GLenum target, GLint level, GLenum format, - GLenum type, GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexImage(ctx->Exec, (target, level, format, type, pixels)); -} - -static void GLAPIENTRY -exec_GetTexLevelParameterfv(GLenum target, GLint level, - GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexLevelParameterfv(ctx->Exec, (target, level, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexLevelParameteriv(GLenum target, GLint level, - GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexLevelParameteriv(ctx->Exec, (target, level, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetTexParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetTexParameteriv(ctx->Exec, (target, pname, params)); -} - -static GLboolean GLAPIENTRY -exec_IsEnabled(GLenum cap) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_IsEnabled(ctx->Exec, (cap)); -} - -static void GLAPIENTRY -exec_PixelStoref(GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_PixelStoref(ctx->Exec, (pname, param)); -} - -static void GLAPIENTRY -exec_PixelStorei(GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_PixelStorei(ctx->Exec, (pname, param)); -} - -static void GLAPIENTRY -exec_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_ReadPixels(ctx->Exec, (x, y, width, height, format, type, pixels)); -} - -static GLint GLAPIENTRY -exec_RenderMode(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_RenderMode(ctx->Exec, (mode)); -} - -static void GLAPIENTRY -exec_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_FeedbackBuffer(ctx->Exec, (size, type, buffer)); -} - -static void GLAPIENTRY -exec_SelectBuffer(GLsizei size, GLuint * buffer) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_SelectBuffer(ctx->Exec, (size, buffer)); -} - -static GLboolean GLAPIENTRY -exec_AreTexturesResident(GLsizei n, const GLuint * texName, - GLboolean * residences) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_AreTexturesResident(ctx->Exec, (n, texName, residences)); -} - -static void GLAPIENTRY -exec_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_ColorPointer(ctx->Exec, (size, type, stride, ptr)); -} - -static void GLAPIENTRY -exec_DeleteTextures(GLsizei n, const GLuint * texName) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_DeleteTextures(ctx->Exec, (n, texName)); -} - -static void GLAPIENTRY -exec_DisableClientState(GLenum cap) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_DisableClientState(ctx->Exec, (cap)); -} - -static void GLAPIENTRY -exec_EdgeFlagPointer(GLsizei stride, const GLvoid * vptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_EdgeFlagPointer(ctx->Exec, (stride, vptr)); -} - -static void GLAPIENTRY -exec_EnableClientState(GLenum cap) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_EnableClientState(ctx->Exec, (cap)); -} - -static void GLAPIENTRY -exec_GenTextures(GLsizei n, GLuint * texName) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GenTextures(ctx->Exec, (n, texName)); -} - -static void GLAPIENTRY -exec_GetPointerv(GLenum pname, GLvoid **params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetPointerv(ctx->Exec, (pname, params)); -} - -static void GLAPIENTRY -exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_IndexPointer(ctx->Exec, (type, stride, ptr)); -} - -static void GLAPIENTRY -exec_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_InterleavedArrays(ctx->Exec, (format, stride, pointer)); -} - -static GLboolean GLAPIENTRY -exec_IsTexture(GLuint texture) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - return CALL_IsTexture(ctx->Exec, (texture)); -} - -static void GLAPIENTRY -exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_NormalPointer(ctx->Exec, (type, stride, ptr)); -} - -static void GLAPIENTRY -exec_PopClientAttrib(void) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_PopClientAttrib(ctx->Exec, ()); -} - -static void GLAPIENTRY -exec_PushClientAttrib(GLbitfield mask) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_PushClientAttrib(ctx->Exec, (mask)); -} - -static void GLAPIENTRY -exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_TexCoordPointer(ctx->Exec, (size, type, stride, ptr)); -} - -static void GLAPIENTRY -exec_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetCompressedTexImageARB(ctx->Exec, (target, level, img)); -} - -static void GLAPIENTRY -exec_VertexPointer(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr)); -} - -static void GLAPIENTRY -exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_CopyConvolutionFilter1D(ctx->Exec, - (target, internalFormat, x, y, width)); -} - -static void GLAPIENTRY -exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_CopyConvolutionFilter2D(ctx->Exec, - (target, internalFormat, x, y, width, - height)); -} - -static void GLAPIENTRY -exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTable(ctx->Exec, (target, format, type, data)); -} - -static void GLAPIENTRY -exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid * image) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image)); -} - -static void GLAPIENTRY -exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetHistogram(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogram(ctx->Exec, (target, reset, format, type, values)); -} - -static void GLAPIENTRY -exec_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogramParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogramParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetMinmax(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmax(ctx->Exec, (target, reset, format, type, values)); -} - -static void GLAPIENTRY -exec_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmaxParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmaxParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetSeparableFilter(ctx->Exec, - (target, format, type, row, column, span)); -} - -static void GLAPIENTRY -exec_SeparableFilter2D(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_SeparableFilter2D(ctx->Exec, - (target, internalFormat, width, height, format, - type, row, column)); -} - -static void GLAPIENTRY -exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_ColorPointerEXT(ctx->Exec, (size, type, stride, count, ptr)); -} - -static void GLAPIENTRY -exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_EdgeFlagPointerEXT(ctx->Exec, (stride, count, ptr)); -} - -static void GLAPIENTRY -exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_IndexPointerEXT(ctx->Exec, (type, stride, count, ptr)); -} - -static void GLAPIENTRY -exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_NormalPointerEXT(ctx->Exec, (type, stride, count, ptr)); -} - -static void GLAPIENTRY -exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_TexCoordPointerEXT(ctx->Exec, (size, type, stride, count, ptr)); -} - -static void GLAPIENTRY -exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_VertexPointerEXT(ctx->Exec, (size, type, stride, count, ptr)); -} - -static void GLAPIENTRY -exec_LockArraysEXT(GLint first, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_LockArraysEXT(ctx->Exec, (first, count)); -} - -static void GLAPIENTRY -exec_UnlockArraysEXT(void) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_UnlockArraysEXT(ctx->Exec, ()); -} - -static void GLAPIENTRY -exec_ClientActiveTextureARB(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_ClientActiveTextureARB(ctx->Exec, (target)); -} - -static void GLAPIENTRY -exec_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr)); -} - -static void GLAPIENTRY -exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_FogCoordPointerEXT(ctx->Exec, (type, stride, ptr)); -} - -/* GL_EXT_multi_draw_arrays */ -static void GLAPIENTRY -exec_MultiDrawArraysEXT(GLenum mode, GLint * first, - GLsizei * count, GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_MultiDrawArraysEXT(ctx->Exec, (mode, first, count, primcount)); -} - -/* GL_EXT_multi_draw_arrays */ -static void GLAPIENTRY -exec_MultiDrawElementsEXT(GLenum mode, const GLsizei * count, - GLenum type, const GLvoid ** indices, - GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_MultiDrawElementsEXT(ctx->Exec, - (mode, count, type, indices, primcount)); -} - -/* GL_IBM_multimode_draw_arrays */ -static void GLAPIENTRY -exec_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, - const GLsizei * count, GLsizei primcount, - GLint modestride) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_MultiModeDrawArraysIBM(ctx->Exec, - (mode, first, count, primcount, modestride)); -} - -/* GL_IBM_multimode_draw_arrays */ -static void GLAPIENTRY -exec_MultiModeDrawElementsIBM(const GLenum * mode, - const GLsizei * count, - GLenum type, - const GLvoid * const *indices, - GLsizei primcount, GLint modestride) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_MultiModeDrawElementsIBM(ctx->Exec, - (mode, count, type, indices, primcount, - modestride)); -} - - - -/** - * Setup the given dispatch table to point to Mesa's display list - * building functions. - * - * This does not include any of the tnl functions - they are - * initialized from _mesa_init_api_defaults and from the active vtxfmt - * struct. - */ -void -_mesa_init_dlist_table(struct _glapi_table *table) -{ - _mesa_loopback_init_api_table(table); - - /* GL 1.0 */ - SET_Accum(table, save_Accum); - SET_AlphaFunc(table, save_AlphaFunc); - SET_Bitmap(table, save_Bitmap); - SET_BlendFunc(table, save_BlendFunc); - SET_CallList(table, _mesa_save_CallList); - SET_CallLists(table, _mesa_save_CallLists); - SET_Clear(table, save_Clear); - SET_ClearAccum(table, save_ClearAccum); - SET_ClearColor(table, save_ClearColor); - SET_ClearDepth(table, save_ClearDepth); - SET_ClearIndex(table, save_ClearIndex); - SET_ClearStencil(table, save_ClearStencil); - SET_ClipPlane(table, save_ClipPlane); - SET_ColorMask(table, save_ColorMask); - SET_ColorMaterial(table, save_ColorMaterial); - SET_CopyPixels(table, save_CopyPixels); - SET_CullFace(table, save_CullFace); - SET_DeleteLists(table, _mesa_DeleteLists); - SET_DepthFunc(table, save_DepthFunc); - SET_DepthMask(table, save_DepthMask); - SET_DepthRange(table, save_DepthRange); - SET_Disable(table, save_Disable); - SET_DrawBuffer(table, save_DrawBuffer); - SET_DrawPixels(table, save_DrawPixels); - SET_Enable(table, save_Enable); - SET_EndList(table, _mesa_EndList); - SET_EvalMesh1(table, _mesa_save_EvalMesh1); - SET_EvalMesh2(table, _mesa_save_EvalMesh2); - SET_Finish(table, exec_Finish); - SET_Flush(table, exec_Flush); - SET_Fogf(table, save_Fogf); - SET_Fogfv(table, save_Fogfv); - SET_Fogi(table, save_Fogi); - SET_Fogiv(table, save_Fogiv); - SET_FrontFace(table, save_FrontFace); - SET_Frustum(table, save_Frustum); - SET_GenLists(table, _mesa_GenLists); - SET_GetBooleanv(table, exec_GetBooleanv); - SET_GetClipPlane(table, exec_GetClipPlane); - SET_GetDoublev(table, exec_GetDoublev); - SET_GetError(table, exec_GetError); - SET_GetFloatv(table, exec_GetFloatv); - SET_GetIntegerv(table, exec_GetIntegerv); - SET_GetLightfv(table, exec_GetLightfv); - SET_GetLightiv(table, exec_GetLightiv); - SET_GetMapdv(table, exec_GetMapdv); - SET_GetMapfv(table, exec_GetMapfv); - SET_GetMapiv(table, exec_GetMapiv); - SET_GetMaterialfv(table, exec_GetMaterialfv); - SET_GetMaterialiv(table, exec_GetMaterialiv); - SET_GetPixelMapfv(table, exec_GetPixelMapfv); - SET_GetPixelMapuiv(table, exec_GetPixelMapuiv); - SET_GetPixelMapusv(table, exec_GetPixelMapusv); - SET_GetPolygonStipple(table, exec_GetPolygonStipple); - SET_GetString(table, exec_GetString); - SET_GetTexEnvfv(table, exec_GetTexEnvfv); - SET_GetTexEnviv(table, exec_GetTexEnviv); - SET_GetTexGendv(table, exec_GetTexGendv); - SET_GetTexGenfv(table, exec_GetTexGenfv); - SET_GetTexGeniv(table, exec_GetTexGeniv); - SET_GetTexImage(table, exec_GetTexImage); - SET_GetTexLevelParameterfv(table, exec_GetTexLevelParameterfv); - SET_GetTexLevelParameteriv(table, exec_GetTexLevelParameteriv); - SET_GetTexParameterfv(table, exec_GetTexParameterfv); - SET_GetTexParameteriv(table, exec_GetTexParameteriv); - SET_Hint(table, save_Hint); - SET_IndexMask(table, save_IndexMask); - SET_InitNames(table, save_InitNames); - SET_IsEnabled(table, exec_IsEnabled); - SET_IsList(table, _mesa_IsList); - SET_LightModelf(table, save_LightModelf); - SET_LightModelfv(table, save_LightModelfv); - SET_LightModeli(table, save_LightModeli); - SET_LightModeliv(table, save_LightModeliv); - SET_Lightf(table, save_Lightf); - SET_Lightfv(table, save_Lightfv); - SET_Lighti(table, save_Lighti); - SET_Lightiv(table, save_Lightiv); - SET_LineStipple(table, save_LineStipple); - SET_LineWidth(table, save_LineWidth); - SET_ListBase(table, save_ListBase); - SET_LoadIdentity(table, save_LoadIdentity); - SET_LoadMatrixd(table, save_LoadMatrixd); - SET_LoadMatrixf(table, save_LoadMatrixf); - SET_LoadName(table, save_LoadName); - SET_LogicOp(table, save_LogicOp); - SET_Map1d(table, save_Map1d); - SET_Map1f(table, save_Map1f); - SET_Map2d(table, save_Map2d); - SET_Map2f(table, save_Map2f); - SET_MapGrid1d(table, save_MapGrid1d); - SET_MapGrid1f(table, save_MapGrid1f); - SET_MapGrid2d(table, save_MapGrid2d); - SET_MapGrid2f(table, save_MapGrid2f); - SET_MatrixMode(table, save_MatrixMode); - SET_MultMatrixd(table, save_MultMatrixd); - SET_MultMatrixf(table, save_MultMatrixf); - SET_NewList(table, save_NewList); - SET_Ortho(table, save_Ortho); - SET_PassThrough(table, save_PassThrough); - SET_PixelMapfv(table, save_PixelMapfv); - SET_PixelMapuiv(table, save_PixelMapuiv); - SET_PixelMapusv(table, save_PixelMapusv); - SET_PixelStoref(table, exec_PixelStoref); - SET_PixelStorei(table, exec_PixelStorei); - SET_PixelTransferf(table, save_PixelTransferf); - SET_PixelTransferi(table, save_PixelTransferi); - SET_PixelZoom(table, save_PixelZoom); - SET_PointSize(table, save_PointSize); - SET_PolygonMode(table, save_PolygonMode); - SET_PolygonOffset(table, save_PolygonOffset); - SET_PolygonStipple(table, save_PolygonStipple); - SET_PopAttrib(table, save_PopAttrib); - SET_PopMatrix(table, save_PopMatrix); - SET_PopName(table, save_PopName); - SET_PushAttrib(table, save_PushAttrib); - SET_PushMatrix(table, save_PushMatrix); - SET_PushName(table, save_PushName); - SET_RasterPos2d(table, save_RasterPos2d); - SET_RasterPos2dv(table, save_RasterPos2dv); - SET_RasterPos2f(table, save_RasterPos2f); - SET_RasterPos2fv(table, save_RasterPos2fv); - SET_RasterPos2i(table, save_RasterPos2i); - SET_RasterPos2iv(table, save_RasterPos2iv); - SET_RasterPos2s(table, save_RasterPos2s); - SET_RasterPos2sv(table, save_RasterPos2sv); - SET_RasterPos3d(table, save_RasterPos3d); - SET_RasterPos3dv(table, save_RasterPos3dv); - SET_RasterPos3f(table, save_RasterPos3f); - SET_RasterPos3fv(table, save_RasterPos3fv); - SET_RasterPos3i(table, save_RasterPos3i); - SET_RasterPos3iv(table, save_RasterPos3iv); - SET_RasterPos3s(table, save_RasterPos3s); - SET_RasterPos3sv(table, save_RasterPos3sv); - SET_RasterPos4d(table, save_RasterPos4d); - SET_RasterPos4dv(table, save_RasterPos4dv); - SET_RasterPos4f(table, save_RasterPos4f); - SET_RasterPos4fv(table, save_RasterPos4fv); - SET_RasterPos4i(table, save_RasterPos4i); - SET_RasterPos4iv(table, save_RasterPos4iv); - SET_RasterPos4s(table, save_RasterPos4s); - SET_RasterPos4sv(table, save_RasterPos4sv); - SET_ReadBuffer(table, save_ReadBuffer); - SET_ReadPixels(table, exec_ReadPixels); - SET_RenderMode(table, exec_RenderMode); - SET_Rotated(table, save_Rotated); - SET_Rotatef(table, save_Rotatef); - SET_Scaled(table, save_Scaled); - SET_Scalef(table, save_Scalef); - SET_Scissor(table, save_Scissor); - SET_FeedbackBuffer(table, exec_FeedbackBuffer); - SET_SelectBuffer(table, exec_SelectBuffer); - SET_ShadeModel(table, save_ShadeModel); - SET_StencilFunc(table, save_StencilFunc); - SET_StencilMask(table, save_StencilMask); - SET_StencilOp(table, save_StencilOp); - SET_TexEnvf(table, save_TexEnvf); - SET_TexEnvfv(table, save_TexEnvfv); - SET_TexEnvi(table, save_TexEnvi); - SET_TexEnviv(table, save_TexEnviv); - SET_TexGend(table, save_TexGend); - SET_TexGendv(table, save_TexGendv); - SET_TexGenf(table, save_TexGenf); - SET_TexGenfv(table, save_TexGenfv); - SET_TexGeni(table, save_TexGeni); - SET_TexGeniv(table, save_TexGeniv); - SET_TexImage1D(table, save_TexImage1D); - SET_TexImage2D(table, save_TexImage2D); - SET_TexParameterf(table, save_TexParameterf); - SET_TexParameterfv(table, save_TexParameterfv); - SET_TexParameteri(table, save_TexParameteri); - SET_TexParameteriv(table, save_TexParameteriv); - SET_Translated(table, save_Translated); - SET_Translatef(table, save_Translatef); - SET_Viewport(table, save_Viewport); - - /* GL 1.1 */ - SET_AreTexturesResident(table, exec_AreTexturesResident); - SET_BindTexture(table, save_BindTexture); - SET_ColorPointer(table, exec_ColorPointer); - SET_CopyTexImage1D(table, save_CopyTexImage1D); - SET_CopyTexImage2D(table, save_CopyTexImage2D); - SET_CopyTexSubImage1D(table, save_CopyTexSubImage1D); - SET_CopyTexSubImage2D(table, save_CopyTexSubImage2D); - SET_DeleteTextures(table, exec_DeleteTextures); - SET_DisableClientState(table, exec_DisableClientState); - SET_EdgeFlagPointer(table, exec_EdgeFlagPointer); - SET_EnableClientState(table, exec_EnableClientState); - SET_GenTextures(table, exec_GenTextures); - SET_GetPointerv(table, exec_GetPointerv); - SET_IndexPointer(table, exec_IndexPointer); - SET_InterleavedArrays(table, exec_InterleavedArrays); - SET_IsTexture(table, exec_IsTexture); - SET_NormalPointer(table, exec_NormalPointer); - SET_PopClientAttrib(table, exec_PopClientAttrib); - SET_PrioritizeTextures(table, save_PrioritizeTextures); - SET_PushClientAttrib(table, exec_PushClientAttrib); - SET_TexCoordPointer(table, exec_TexCoordPointer); - SET_TexSubImage1D(table, save_TexSubImage1D); - SET_TexSubImage2D(table, save_TexSubImage2D); - SET_VertexPointer(table, exec_VertexPointer); - - /* GL 1.2 */ - SET_CopyTexSubImage3D(table, save_CopyTexSubImage3D); - SET_TexImage3D(table, save_TexImage3D); - SET_TexSubImage3D(table, save_TexSubImage3D); - - /* GL 2.0 */ - SET_StencilFuncSeparate(table, save_StencilFuncSeparate); - SET_StencilMaskSeparate(table, save_StencilMaskSeparate); - SET_StencilOpSeparate(table, save_StencilOpSeparate); - - /* ATI_separate_stencil */ - SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI); - - /* GL_ARB_imaging */ - /* Not all are supported */ - SET_BlendColor(table, save_BlendColor); - SET_BlendEquation(table, save_BlendEquation); - SET_ColorSubTable(table, save_ColorSubTable); - SET_ColorTable(table, save_ColorTable); - SET_ColorTableParameterfv(table, save_ColorTableParameterfv); - SET_ColorTableParameteriv(table, save_ColorTableParameteriv); - SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D); - SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D); - SET_ConvolutionParameterf(table, save_ConvolutionParameterf); - SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv); - SET_ConvolutionParameteri(table, save_ConvolutionParameteri); - SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv); - SET_CopyColorSubTable(table, save_CopyColorSubTable); - SET_CopyColorTable(table, save_CopyColorTable); - SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D); - SET_GetColorTable(table, exec_GetColorTable); - SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv); - SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv); - SET_GetConvolutionFilter(table, exec_GetConvolutionFilter); - SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv); - SET_GetHistogram(table, exec_GetHistogram); - SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv); - SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv); - SET_GetMinmax(table, exec_GetMinmax); - SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv); - SET_GetSeparableFilter(table, exec_GetSeparableFilter); - SET_Histogram(table, save_Histogram); - SET_Minmax(table, save_Minmax); - SET_ResetHistogram(table, save_ResetHistogram); - SET_ResetMinmax(table, save_ResetMinmax); - SET_SeparableFilter2D(table, exec_SeparableFilter2D); - - /* 2. GL_EXT_blend_color */ -#if 0 - SET_BlendColorEXT(table, save_BlendColorEXT); -#endif - - /* 3. GL_EXT_polygon_offset */ - SET_PolygonOffsetEXT(table, save_PolygonOffsetEXT); - - /* 6. GL_EXT_texture3d */ -#if 0 - SET_CopyTexSubImage3DEXT(table, save_CopyTexSubImage3D); - SET_TexImage3DEXT(table, save_TexImage3DEXT); - SET_TexSubImage3DEXT(table, save_TexSubImage3D); -#endif - - /* 14. GL_SGI_color_table */ -#if 0 - SET_ColorTableSGI(table, save_ColorTable); - SET_ColorSubTableSGI(table, save_ColorSubTable); - SET_GetColorTableSGI(table, exec_GetColorTable); - SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv); - SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv); -#endif - - /* 30. GL_EXT_vertex_array */ - SET_ColorPointerEXT(table, exec_ColorPointerEXT); - SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT); - SET_IndexPointerEXT(table, exec_IndexPointerEXT); - SET_NormalPointerEXT(table, exec_NormalPointerEXT); - SET_TexCoordPointerEXT(table, exec_TexCoordPointerEXT); - SET_VertexPointerEXT(table, exec_VertexPointerEXT); - - /* 37. GL_EXT_blend_minmax */ -#if 0 - SET_BlendEquationEXT(table, save_BlendEquationEXT); -#endif - - /* 54. GL_EXT_point_parameters */ - SET_PointParameterfEXT(table, save_PointParameterfEXT); - SET_PointParameterfvEXT(table, save_PointParameterfvEXT); - - /* 97. GL_EXT_compiled_vertex_array */ - SET_LockArraysEXT(table, exec_LockArraysEXT); - SET_UnlockArraysEXT(table, exec_UnlockArraysEXT); - - /* 145. GL_EXT_secondary_color */ - SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT); - - /* 148. GL_EXT_multi_draw_arrays */ - SET_MultiDrawArraysEXT(table, exec_MultiDrawArraysEXT); - SET_MultiDrawElementsEXT(table, exec_MultiDrawElementsEXT); - - /* 149. GL_EXT_fog_coord */ - SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT); - - /* 173. GL_EXT_blend_func_separate */ - SET_BlendFuncSeparateEXT(table, save_BlendFuncSeparateEXT); - - /* 196. GL_MESA_resize_buffers */ - SET_ResizeBuffersMESA(table, _mesa_ResizeBuffersMESA); - - /* 197. GL_MESA_window_pos */ - SET_WindowPos2dMESA(table, save_WindowPos2dMESA); - SET_WindowPos2dvMESA(table, save_WindowPos2dvMESA); - SET_WindowPos2fMESA(table, save_WindowPos2fMESA); - SET_WindowPos2fvMESA(table, save_WindowPos2fvMESA); - SET_WindowPos2iMESA(table, save_WindowPos2iMESA); - SET_WindowPos2ivMESA(table, save_WindowPos2ivMESA); - SET_WindowPos2sMESA(table, save_WindowPos2sMESA); - SET_WindowPos2svMESA(table, save_WindowPos2svMESA); - SET_WindowPos3dMESA(table, save_WindowPos3dMESA); - SET_WindowPos3dvMESA(table, save_WindowPos3dvMESA); - SET_WindowPos3fMESA(table, save_WindowPos3fMESA); - SET_WindowPos3fvMESA(table, save_WindowPos3fvMESA); - SET_WindowPos3iMESA(table, save_WindowPos3iMESA); - SET_WindowPos3ivMESA(table, save_WindowPos3ivMESA); - SET_WindowPos3sMESA(table, save_WindowPos3sMESA); - SET_WindowPos3svMESA(table, save_WindowPos3svMESA); - SET_WindowPos4dMESA(table, save_WindowPos4dMESA); - SET_WindowPos4dvMESA(table, save_WindowPos4dvMESA); - SET_WindowPos4fMESA(table, save_WindowPos4fMESA); - SET_WindowPos4fvMESA(table, save_WindowPos4fvMESA); - SET_WindowPos4iMESA(table, save_WindowPos4iMESA); - SET_WindowPos4ivMESA(table, save_WindowPos4ivMESA); - SET_WindowPos4sMESA(table, save_WindowPos4sMESA); - SET_WindowPos4svMESA(table, save_WindowPos4svMESA); - - /* 200. GL_IBM_multimode_draw_arrays */ - SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM); - SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM); - -#if FEATURE_NV_vertex_program - /* 233. GL_NV_vertex_program */ - /* The following commands DO NOT go into display lists: - * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV, - * VertexAttribPointerNV, GetProgram*, GetVertexAttrib* - */ - SET_BindProgramNV(table, save_BindProgramNV); - SET_DeleteProgramsNV(table, _mesa_DeletePrograms); - SET_ExecuteProgramNV(table, save_ExecuteProgramNV); - SET_GenProgramsNV(table, _mesa_GenPrograms); - SET_AreProgramsResidentNV(table, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(table, save_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(table, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(table, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(table, _mesa_GetProgramivNV); - SET_GetProgramStringNV(table, _mesa_GetProgramStringNV); - SET_GetTrackMatrixivNV(table, _mesa_GetTrackMatrixivNV); - SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV); - SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV); - SET_IsProgramNV(table, _mesa_IsProgramARB); - SET_LoadProgramNV(table, save_LoadProgramNV); - SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB); - SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV); - SET_TrackMatrixNV(table, save_TrackMatrixNV); - SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV); -#endif - - /* 245. GL_ATI_fragment_shader */ -#if FEATURE_ATI_fragment_shader - SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI); - SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI); -#endif - - /* 282. GL_NV_fragment_program */ -#if FEATURE_NV_fragment_program - SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(table, - _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(table, - _mesa_GetProgramNamedParameterdvNV); - SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB); - SET_GetProgramLocalParameterdvARB(table, - _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(table, - _mesa_GetProgramLocalParameterfvARB); -#endif - - /* 262. GL_NV_point_sprite */ - SET_PointParameteriNV(table, save_PointParameteriNV); - SET_PointParameterivNV(table, save_PointParameterivNV); - - /* 268. GL_EXT_stencil_two_side */ - SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT); - - /* 273. GL_APPLE_vertex_array_object */ - SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE); - SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE); - SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE); - SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE); - - /* ???. GL_EXT_depth_bounds_test */ - SET_DepthBoundsEXT(table, save_DepthBoundsEXT); - - /* ARB 1. GL_ARB_multitexture */ - SET_ActiveTextureARB(table, save_ActiveTextureARB); - SET_ClientActiveTextureARB(table, exec_ClientActiveTextureARB); - - /* ARB 3. GL_ARB_transpose_matrix */ - SET_LoadTransposeMatrixdARB(table, save_LoadTransposeMatrixdARB); - SET_LoadTransposeMatrixfARB(table, save_LoadTransposeMatrixfARB); - SET_MultTransposeMatrixdARB(table, save_MultTransposeMatrixdARB); - SET_MultTransposeMatrixfARB(table, save_MultTransposeMatrixfARB); - - /* ARB 5. GL_ARB_multisample */ - SET_SampleCoverageARB(table, save_SampleCoverageARB); - - /* ARB 12. GL_ARB_texture_compression */ - SET_CompressedTexImage3DARB(table, save_CompressedTexImage3DARB); - SET_CompressedTexImage2DARB(table, save_CompressedTexImage2DARB); - SET_CompressedTexImage1DARB(table, save_CompressedTexImage1DARB); - SET_CompressedTexSubImage3DARB(table, save_CompressedTexSubImage3DARB); - SET_CompressedTexSubImage2DARB(table, save_CompressedTexSubImage2DARB); - SET_CompressedTexSubImage1DARB(table, save_CompressedTexSubImage1DARB); - SET_GetCompressedTexImageARB(table, exec_GetCompressedTexImageARB); - - /* ARB 14. GL_ARB_point_parameters */ - /* aliased with EXT_point_parameters functions */ - - /* ARB 25. GL_ARB_window_pos */ - /* aliased with MESA_window_pos functions */ - - /* ARB 26. GL_ARB_vertex_program */ - /* ARB 27. GL_ARB_fragment_program */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - /* glVertexAttrib* functions alias the NV ones, handled elsewhere */ - SET_VertexAttribPointerARB(table, _mesa_VertexAttribPointerARB); - SET_EnableVertexAttribArrayARB(table, _mesa_EnableVertexAttribArrayARB); - SET_DisableVertexAttribArrayARB(table, _mesa_DisableVertexAttribArrayARB); - SET_ProgramStringARB(table, save_ProgramStringARB); - SET_BindProgramNV(table, save_BindProgramNV); - SET_DeleteProgramsNV(table, _mesa_DeletePrograms); - SET_GenProgramsNV(table, _mesa_GenPrograms); - SET_IsProgramNV(table, _mesa_IsProgramARB); - SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV); - SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV); - SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB); - SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB); - SET_GetProgramEnvParameterdvARB(table, _mesa_GetProgramEnvParameterdvARB); - SET_GetProgramEnvParameterfvARB(table, _mesa_GetProgramEnvParameterfvARB); - SET_GetProgramLocalParameterdvARB(table, - _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(table, - _mesa_GetProgramLocalParameterfvARB); - SET_GetProgramivARB(table, _mesa_GetProgramivARB); - SET_GetProgramStringARB(table, _mesa_GetProgramStringARB); -#endif - - /* ARB 28. GL_ARB_vertex_buffer_object */ -#if FEATURE_ARB_vertex_buffer_object - /* None of the extension's functions get compiled */ - SET_BindBufferARB(table, _mesa_BindBufferARB); - SET_BufferDataARB(table, _mesa_BufferDataARB); - SET_BufferSubDataARB(table, _mesa_BufferSubDataARB); - SET_DeleteBuffersARB(table, _mesa_DeleteBuffersARB); - SET_GenBuffersARB(table, _mesa_GenBuffersARB); - SET_GetBufferParameterivARB(table, _mesa_GetBufferParameterivARB); - SET_GetBufferPointervARB(table, _mesa_GetBufferPointervARB); - SET_GetBufferSubDataARB(table, _mesa_GetBufferSubDataARB); - SET_IsBufferARB(table, _mesa_IsBufferARB); - SET_MapBufferARB(table, _mesa_MapBufferARB); - SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); -#endif - -#if FEATURE_ARB_occlusion_query - SET_BeginQueryARB(table, save_BeginQueryARB); - SET_EndQueryARB(table, save_EndQueryARB); - SET_GenQueriesARB(table, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(table, _mesa_DeleteQueriesARB); - SET_IsQueryARB(table, _mesa_IsQueryARB); - SET_GetQueryivARB(table, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(table, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(table, _mesa_GetQueryObjectuivARB); -#endif - SET_DrawBuffersARB(table, save_DrawBuffersARB); - -#if FEATURE_EXT_framebuffer_blit - SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT); -#endif - - /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */ - SET_BindAttribLocationARB(table, exec_BindAttribLocationARB); - SET_GetAttribLocationARB(table, exec_GetAttribLocationARB); - /* XXX additional functions need to be implemented here! */ - - /* 299. GL_EXT_blend_equation_separate */ - SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT); - - /* GL_EXT_gpu_program_parmaeters */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT); - SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT); -#endif -} - - - -static const char * -enum_string(GLenum k) -{ - return _mesa_lookup_enum_by_nr(k); -} - - -/** - * Print the commands in a display list. For debugging only. - * TODO: many commands aren't handled yet. - */ -static void GLAPIENTRY -print_list(GLcontext *ctx, GLuint list) -{ - struct mesa_display_list *dlist; - Node *n; - GLboolean done; - - if (!islist(ctx, list)) { - _mesa_printf("%u is not a display list ID\n", list); - return; - } - - dlist = lookup_list(ctx, list); - if (!dlist) - return; - - n = dlist->node; - - _mesa_printf("START-LIST %u, address %p\n", list, (void *) n); - - done = n ? GL_FALSE : GL_TRUE; - while (!done) { - OpCode opcode = n[0].opcode; - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Print(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; - } - else { - switch (opcode) { - case OPCODE_ACCUM: - _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f); - break; - case OPCODE_BITMAP: - _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, - n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data); - break; - case OPCODE_CALL_LIST: - _mesa_printf("CallList %d\n", (int) n[1].ui); - break; - case OPCODE_CALL_LIST_OFFSET: - _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui, - ctx->List.ListBase, ctx->List.ListBase + n[1].ui); - break; - case OPCODE_COLOR_TABLE_PARAMETER_FV: - _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].i, n[4].i, n[5].i, n[6].i); - break; - case OPCODE_DISABLE: - _mesa_printf("Disable %s\n", enum_string(n[1].e)); - break; - case OPCODE_ENABLE: - _mesa_printf("Enable %s\n", enum_string(n[1].e)); - break; - case OPCODE_FRUSTUM: - _mesa_printf("Frustum %g %g %g %g %g %g\n", - n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_LINE_STIPPLE: - _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us); - break; - case OPCODE_LOAD_IDENTITY: - _mesa_printf("LoadIdentity\n"); - break; - case OPCODE_LOAD_MATRIX: - _mesa_printf("LoadMatrix\n"); - _mesa_printf(" %8f %8f %8f %8f\n", - n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[4].f, n[8].f, n[12].f, n[16].f); - break; - case OPCODE_MULT_MATRIX: - _mesa_printf("MultMatrix (or Rotate)\n"); - _mesa_printf(" %8f %8f %8f %8f\n", - n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", - n[4].f, n[8].f, n[12].f, n[16].f); - break; - case OPCODE_ORTHO: - _mesa_printf("Ortho %g %g %g %g %g %g\n", - n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_POP_ATTRIB: - _mesa_printf("PopAttrib\n"); - break; - case OPCODE_POP_MATRIX: - _mesa_printf("PopMatrix\n"); - break; - case OPCODE_POP_NAME: - _mesa_printf("PopName\n"); - break; - case OPCODE_PUSH_ATTRIB: - _mesa_printf("PushAttrib %x\n", n[1].bf); - break; - case OPCODE_PUSH_MATRIX: - _mesa_printf("PushMatrix\n"); - break; - case OPCODE_PUSH_NAME: - _mesa_printf("PushName %d\n", (int) n[1].ui); - break; - case OPCODE_RASTER_POS: - _mesa_printf("RasterPos %g %g %g %g\n", - n[1].f, n[2].f, n[3].f, n[4].f); - break; - case OPCODE_ROTATE: - _mesa_printf("Rotate %g %g %g %g\n", - n[1].f, n[2].f, n[3].f, n[4].f); - break; - case OPCODE_SCALE: - _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f); - break; - case OPCODE_TRANSLATE: - _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f); - break; - case OPCODE_BIND_TEXTURE: - _mesa_printf("BindTexture %s %d\n", - _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui); - break; - case OPCODE_SHADE_MODEL: - _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); - break; - case OPCODE_MAP1: - _mesa_printf("Map1 %s %.3f %.3f %d %d\n", - _mesa_lookup_enum_by_nr(n[1].ui), - n[2].f, n[3].f, n[4].i, n[5].i); - break; - case OPCODE_MAP2: - _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", - _mesa_lookup_enum_by_nr(n[1].ui), - n[2].f, n[3].f, n[4].f, n[5].f, - n[6].i, n[7].i, n[8].i, n[9].i); - break; - case OPCODE_MAPGRID1: - _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); - break; - case OPCODE_MAPGRID2: - _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", - n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); - break; - case OPCODE_EVALMESH1: - _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); - break; - case OPCODE_EVALMESH2: - _mesa_printf("EvalMesh2 %d %d %d %d\n", - n[1].i, n[2].i, n[3].i, n[4].i); - break; - - case OPCODE_ATTR_1F_NV: - _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f); - break; - case OPCODE_ATTR_2F_NV: - _mesa_printf("ATTR_2F_NV attr %d: %f %f\n", - n[1].i, n[2].f, n[3].f); - break; - case OPCODE_ATTR_3F_NV: - _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n", - n[1].i, n[2].f, n[3].f, n[4].f); - break; - case OPCODE_ATTR_4F_NV: - _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n", - n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); - break; - case OPCODE_ATTR_1F_ARB: - _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f); - break; - case OPCODE_ATTR_2F_ARB: - _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n", - n[1].i, n[2].f, n[3].f); - break; - case OPCODE_ATTR_3F_ARB: - _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n", - n[1].i, n[2].f, n[3].f, n[4].f); - break; - case OPCODE_ATTR_4F_ARB: - _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n", - n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); - break; - - case OPCODE_MATERIAL: - _mesa_printf("MATERIAL %x %x: %f %f %f %f\n", - n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_BEGIN: - _mesa_printf("BEGIN %x\n", n[1].i); - break; - case OPCODE_END: - _mesa_printf("END\n"); - break; - case OPCODE_RECTF: - _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, - n[4].f); - break; - case OPCODE_EVAL_C1: - _mesa_printf("EVAL_C1 %f\n", n[1].f); - break; - case OPCODE_EVAL_C2: - _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f); - break; - case OPCODE_EVAL_P1: - _mesa_printf("EVAL_P1 %d\n", n[1].i); - break; - case OPCODE_EVAL_P2: - _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); - break; - - /* - * meta opcodes/commands - */ - case OPCODE_ERROR: - _mesa_printf("Error: %s %s\n", - enum_string(n[1].e), (const char *) n[2].data); - break; - case OPCODE_CONTINUE: - _mesa_printf("DISPLAY-LIST-CONTINUE\n"); - n = (Node *) n[1].next; - break; - case OPCODE_END_OF_LIST: - _mesa_printf("END-LIST %u\n", list); - done = GL_TRUE; - break; - default: - if (opcode < 0 || opcode > OPCODE_END_OF_LIST) { - _mesa_printf - ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", - opcode, (void *) n); - return; - } - else { - _mesa_printf("command %d, %u operands\n", opcode, - InstSize[opcode]); - } - } - /* increment n to point to next compiled command */ - if (opcode != OPCODE_CONTINUE) { - n += InstSize[opcode]; - } - } - } -} - - - -/** - * Clients may call this function to help debug display list problems. - * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed, - * changed, or break in the future without notice. - */ -void -mesa_print_display_list(GLuint list) -{ - GET_CURRENT_CONTEXT(ctx); - print_list(ctx, list); -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -void -_mesa_save_vtxfmt_init(GLvertexformat * vfmt) -{ - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Begin = save_Begin; - vfmt->CallList = _mesa_save_CallList; - vfmt->CallLists = _mesa_save_CallLists; - vfmt->Color3f = save_Color3f; - vfmt->Color3fv = save_Color3fv; - vfmt->Color4f = save_Color4f; - vfmt->Color4fv = save_Color4fv; - vfmt->EdgeFlag = save_EdgeFlag; - vfmt->End = save_End; - vfmt->EvalCoord1f = save_EvalCoord1f; - vfmt->EvalCoord1fv = save_EvalCoord1fv; - vfmt->EvalCoord2f = save_EvalCoord2f; - vfmt->EvalCoord2fv = save_EvalCoord2fv; - vfmt->EvalPoint1 = save_EvalPoint1; - vfmt->EvalPoint2 = save_EvalPoint2; - vfmt->FogCoordfEXT = save_FogCoordfEXT; - vfmt->FogCoordfvEXT = save_FogCoordfvEXT; - vfmt->Indexf = save_Indexf; - vfmt->Indexfv = save_Indexfv; - vfmt->Materialfv = save_Materialfv; - vfmt->MultiTexCoord1fARB = save_MultiTexCoord1f; - vfmt->MultiTexCoord1fvARB = save_MultiTexCoord1fv; - vfmt->MultiTexCoord2fARB = save_MultiTexCoord2f; - vfmt->MultiTexCoord2fvARB = save_MultiTexCoord2fv; - vfmt->MultiTexCoord3fARB = save_MultiTexCoord3f; - vfmt->MultiTexCoord3fvARB = save_MultiTexCoord3fv; - vfmt->MultiTexCoord4fARB = save_MultiTexCoord4f; - vfmt->MultiTexCoord4fvARB = save_MultiTexCoord4fv; - vfmt->Normal3f = save_Normal3f; - vfmt->Normal3fv = save_Normal3fv; - vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT; - vfmt->TexCoord1f = save_TexCoord1f; - vfmt->TexCoord1fv = save_TexCoord1fv; - vfmt->TexCoord2f = save_TexCoord2f; - vfmt->TexCoord2fv = save_TexCoord2fv; - vfmt->TexCoord3f = save_TexCoord3f; - vfmt->TexCoord3fv = save_TexCoord3fv; - vfmt->TexCoord4f = save_TexCoord4f; - vfmt->TexCoord4fv = save_TexCoord4fv; - vfmt->Vertex2f = save_Vertex2f; - vfmt->Vertex2fv = save_Vertex2fv; - vfmt->Vertex3f = save_Vertex3f; - vfmt->Vertex3fv = save_Vertex3fv; - vfmt->Vertex4f = save_Vertex4f; - vfmt->Vertex4fv = save_Vertex4fv; - vfmt->VertexAttrib1fNV = save_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = save_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = save_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = save_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = save_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = save_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = save_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = save_VertexAttrib4fvNV; - vfmt->VertexAttrib1fARB = save_VertexAttrib1fARB; - vfmt->VertexAttrib1fvARB = save_VertexAttrib1fvARB; - vfmt->VertexAttrib2fARB = save_VertexAttrib2fARB; - vfmt->VertexAttrib2fvARB = save_VertexAttrib2fvARB; - vfmt->VertexAttrib3fARB = save_VertexAttrib3fARB; - vfmt->VertexAttrib3fvARB = save_VertexAttrib3fvARB; - vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; - vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - - vfmt->EvalMesh1 = _mesa_save_EvalMesh1; - vfmt->EvalMesh2 = _mesa_save_EvalMesh2; - vfmt->Rectf = save_Rectf; - - /* The driver is required to implement these as - * 1) They can probably do a better job. - * 2) A lot of new mechanisms would have to be added to this module - * to support it. That code would probably never get used, - * because of (1). - */ -#if 0 - vfmt->DrawArrays = 0; - vfmt->DrawElements = 0; - vfmt->DrawRangeElements = 0; -#endif -} - - -/** - * Initialize display list state for given context. - */ -void -_mesa_init_display_list(GLcontext *ctx) -{ - static GLboolean tableInitialized = GL_FALSE; - - /* zero-out the instruction size table, just once */ - if (!tableInitialized) { - _mesa_bzero(InstSize, sizeof(InstSize)); - tableInitialized = GL_TRUE; - } - - /* Display list */ - ctx->ListState.CallDepth = 0; - ctx->ExecuteFlag = GL_TRUE; - ctx->CompileFlag = GL_FALSE; - ctx->ListState.CurrentListPtr = NULL; - ctx->ListState.CurrentBlock = NULL; - ctx->ListState.CurrentListNum = 0; - ctx->ListState.CurrentPos = 0; - - /* Display List group */ - ctx->List.ListBase = 0; - - _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); -} diff --git a/src/libs/mesa/mesa/main/dlist.h b/src/libs/mesa/mesa/main/dlist.h deleted file mode 100644 index ef6a10af83..0000000000 --- a/src/libs/mesa/mesa/main/dlist.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * \file dlist.h - * Display lists management. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 DLIST_H -#define DLIST_H - - -#include "mtypes.h" - - -#if _HAVE_FULL_GL - -extern void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist); - -extern void GLAPIENTRY _mesa_CallList( GLuint list ); - -extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); - -extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ); - -extern void GLAPIENTRY _mesa_EndList( void ); - -extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range ); - -extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list ); - -extern void GLAPIENTRY _mesa_ListBase( GLuint base ); - -extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode ); - -extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); - -extern void GLAPIENTRY _mesa_save_CallList( GLuint list ); - - - -extern void _mesa_init_dlist_table( struct _glapi_table *table ); - -extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); - - -extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); - -extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, - void (*execute)( GLcontext *, void * ), - void (*destroy)( GLcontext *, void * ), - void (*print)( GLcontext *, void * ) ); - -extern void _mesa_init_display_list( GLcontext * ctx ); - -extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); - - -#else - -/** No-op */ -#define _mesa_init_dlist_table(t,ts) ((void)0) - -/** No-op */ -#define _mesa_init_display_list(c) ((void)0) - -/** No-op */ -#define _mesa_save_vtxfmt_init(v) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/dlopen.c b/src/libs/mesa/mesa/main/dlopen.c deleted file mode 100644 index d9d1152bfb..0000000000 --- a/src/libs/mesa/mesa/main/dlopen.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * Wrapper functions for dlopen(), dlsym(), dlclose(). - * Note that the #ifdef tests for various environments should be expanded. - */ - - -#include "glheader.h" -#include "imports.h" -#include "dlopen.h" - -#if defined(_GNU_SOURCE) && !defined(__MINGW32__) -#include -#endif - -#if defined(_WIN32) -#include -#endif - -#if defined(__HAIKU__) -/* for NULL */ -#include -#endif - - -/** - * Wrapper for dlopen(). - * Note that 'flags' isn't used at this time. - */ -void * -_mesa_dlopen(const char *libname, int flags) -{ -#if defined(_GNU_SOURCE) - flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */ - return dlopen(libname, flags); -#elif defined(__MINGW32__) - return LoadLibrary(libname); -#else - return NULL; -#endif -} - - -/** - * Wrapper for dlsym() that does a cast to a generic function type, - * rather than a void *. This reduces the number of warnings that are - * generated. - */ -GenericFunc -_mesa_dlsym(void *handle, const char *fname) -{ -#if defined(__DJGPP__) - /* need '_' prefix on symbol names */ - char fname2[1000]; - fname2[0] = '_'; - _mesa_strncpy(fname2 + 1, fname, 998); - fname2[999] = 0; - return (GenericFunc) dlsym(handle, fname2); -#elif defined(_GNU_SOURCE) - return (GenericFunc) dlsym(handle, fname); -#elif defined(__MINGW32__) - return (GenericFunc) GetProcAddress(handle, fname); -#else - return (GenericFunc) NULL; -#endif -} - - -/** - * Wrapper for dlclose(). - */ -void -_mesa_dlclose(void *handle) -{ -#if defined(_GNU_SOURCE) - dlclose(handle); -#elif defined(__MINGW32__) - FreeLibrary(handle); -#else - (void) handle; -#endif -} - - - diff --git a/src/libs/mesa/mesa/main/dlopen.h b/src/libs/mesa/mesa/main/dlopen.h deleted file mode 100644 index 9895a22549..0000000000 --- a/src/libs/mesa/mesa/main/dlopen.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2008 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 DLOPEN_H -#define DLOPEN_H - - -typedef void (*GenericFunc)(void); - - -extern void * -_mesa_dlopen(const char *libname, int flags); - -extern GenericFunc -_mesa_dlsym(void *handle, const char *fname); - -extern void -_mesa_dlclose(void *handle); - - -#endif diff --git a/src/libs/mesa/mesa/main/drawpix.c b/src/libs/mesa/mesa/main/drawpix.c deleted file mode 100644 index cb837de4dd..0000000000 --- a/src/libs/mesa/mesa/main/drawpix.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -#include "glheader.h" -#include "imports.h" -#include "bufferobj.h" -#include "context.h" -#include "drawpix.h" -#include "feedback.h" -#include "framebuffer.h" -#include "image.h" -#include "readpix.h" -#include "state.h" - - -#if _HAVE_FULL_GL - -/* - * Execute glDrawPixels - */ -void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" ); - return; - } - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels (invalid fragment program)"); - return; - } - - if (_mesa_error_check_format_type(ctx, format, type, GL_TRUE)) { - /* found an error */ - return; - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glDrawPixels(incomplete framebuffer)" ); - return; - } - - if (!ctx->Current.RasterPosValid) { - return; - } - - if (ctx->RenderMode == GL_RENDER) { - if (width > 0 && height > 0) { - /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ - GLint x = IROUND(ctx->Current.RasterPos[0]); - GLint y = IROUND(ctx->Current.RasterPos[1]); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack from PBO */ - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(invalid PBO access)"); - return; - } - if (ctx->Unpack.BufferObj->Pointer) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(PBO is mapped)"); - return; - } - } - - ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type, - &ctx->Unpack, pixels); - } - } - else if (ctx->RenderMode == GL_FEEDBACK) { - /* Feedback the current raster pos info */ - FLUSH_CURRENT( ctx, 0 ); - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); - _mesa_feedback_vertex( ctx, - ctx->Current.RasterPos, - ctx->Current.RasterColor, - ctx->Current.RasterIndex, - ctx->Current.RasterTexCoords[0] ); - } - else { - ASSERT(ctx->RenderMode == GL_SELECT); - /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ - } -} - - -void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyPixels (invalid fragment program)"); - return; - } - - if (width < 0 || height < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)"); - return; - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || - ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glCopyPixels(incomplete framebuffer)" ); - return; - } - - if (!_mesa_source_buffer_exists(ctx, type) || - !_mesa_dest_buffer_exists(ctx, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyPixels(missing source or dest buffer)"); - return; - } - - if (!ctx->Current.RasterPosValid) { - return; - } - - if (ctx->RenderMode == GL_RENDER) { - /* Round to satisfy conformance tests (matches SGI's OpenGL) */ - if (width > 0 && height > 0) { - GLint destx = IROUND(ctx->Current.RasterPos[0]); - GLint desty = IROUND(ctx->Current.RasterPos[1]); - ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty, - type ); - } - } - else if (ctx->RenderMode == GL_FEEDBACK) { - FLUSH_CURRENT( ctx, 0 ); - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN ); - _mesa_feedback_vertex( ctx, - ctx->Current.RasterPos, - ctx->Current.RasterColor, - ctx->Current.RasterIndex, - ctx->Current.RasterTexCoords[0] ); - } - else { - ASSERT(ctx->RenderMode == GL_SELECT); - /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ - } -} - -#endif /* _HAVE_FULL_GL */ - - - -void GLAPIENTRY -_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); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glBitmap(width or height < 0)" ); - return; - } - - if (!ctx->Current.RasterPosValid) { - return; /* do nothing */ - } - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBitmap (invalid fragment program)"); - return; - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glBitmap(incomplete framebuffer)"); - return; - } - - if (ctx->RenderMode == GL_RENDER) { - /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ - const GLfloat epsilon = (const GLfloat)0.0001; - GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig); - GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack from PBO */ - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, - GL_COLOR_INDEX, GL_BITMAP, - (GLvoid *) bitmap)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBitmap(invalid PBO access)"); - return; - } - if (ctx->Unpack.BufferObj->Pointer) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)"); - return; - } - } - - ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap ); - } -#if _HAVE_FULL_GL - else if (ctx->RenderMode == GL_FEEDBACK) { - FLUSH_CURRENT(ctx, 0); - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN ); - _mesa_feedback_vertex( ctx, - ctx->Current.RasterPos, - ctx->Current.RasterColor, - ctx->Current.RasterIndex, - ctx->Current.RasterTexCoords[0] ); - } - else { - ASSERT(ctx->RenderMode == GL_SELECT); - /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ - } -#endif - - /* update raster position */ - ctx->Current.RasterPos[0] += xmove; - ctx->Current.RasterPos[1] += ymove; -} - - - -#if 0 /* experimental */ -/* - * Execute glDrawDepthPixelsMESA(). This function accepts both a color - * image and depth (Z) image. Rasterization produces fragments with - * color and Z taken from these images. This function is intended for - * Z-compositing. Normally, this operation requires two glDrawPixels - * calls with stencil testing. - */ -void GLAPIENTRY -_mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height, - GLenum colorFormat, GLenum colorType, - const GLvoid *colors, - GLenum depthType, const GLvoid *depths ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glDrawDepthPixelsMESA(width or height < 0" ); - return; - } - - if (!ctx->Current.RasterPosValid) { - return; - } - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glDrawDepthPixelsMESA(incomplete framebuffer)"); - return; - } - - if (ctx->RenderMode == GL_RENDER) { - /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ - GLint x = IROUND(ctx->Current.RasterPos[0]); - GLint y = IROUND(ctx->Current.RasterPos[1]); - ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height, - colorFormat, colorType, colors, - depthType, depths, &ctx->Unpack); - } - else if (ctx->RenderMode == GL_FEEDBACK) { - /* Feedback the current raster pos info */ - FLUSH_CURRENT( ctx, 0 ); - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); - _mesa_feedback_vertex( ctx, - ctx->Current.RasterPos, - ctx->Current.RasterColor, - ctx->Current.RasterIndex, - ctx->Current.RasterTexCoords[0] ); - } - else { - ASSERT(ctx->RenderMode == GL_SELECT); - /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ - } -} - -#endif diff --git a/src/libs/mesa/mesa/main/drawpix.h b/src/libs/mesa/mesa/main/drawpix.h deleted file mode 100644 index 6177adad6d..0000000000 --- a/src/libs/mesa/mesa/main/drawpix.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 DRAWPIXELS_H -#define DRAWPIXELS_H - - -#include "main/glheader.h" - - -extern void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ); - - -extern void GLAPIENTRY -_mesa_Bitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - - -#endif diff --git a/src/libs/mesa/mesa/main/enable.c b/src/libs/mesa/mesa/main/enable.c deleted file mode 100644 index 1c026174b8..0000000000 --- a/src/libs/mesa/mesa/main/enable.c +++ /dev/null @@ -1,1431 +0,0 @@ -/** - * \file enable.c - * Enable/disable/query GL capabilities. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "enable.h" -#include "light.h" -#include "macros.h" -#include "simple_list.h" -#include "mtypes.h" -#include "enums.h" -#include "math/m_matrix.h" -#include "math/m_xform.h" -#include "api_arrayelt.h" - - - -#define CHECK_EXTENSION(EXTNAME, CAP) \ - if (!ctx->Extensions.EXTNAME) { \ - _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)", \ - state ? "Enable" : "Disable", CAP); \ - return; \ - } - - -/** - * Helper to enable/disable client-side state. - */ -static void -client_state(GLcontext *ctx, GLenum cap, GLboolean state) -{ - GLuint flag; - GLboolean *var; - - switch (cap) { - case GL_VERTEX_ARRAY: - var = &ctx->Array.ArrayObj->Vertex.Enabled; - flag = _NEW_ARRAY_VERTEX; - break; - case GL_NORMAL_ARRAY: - var = &ctx->Array.ArrayObj->Normal.Enabled; - flag = _NEW_ARRAY_NORMAL; - break; - case GL_COLOR_ARRAY: - var = &ctx->Array.ArrayObj->Color.Enabled; - flag = _NEW_ARRAY_COLOR0; - break; - case GL_INDEX_ARRAY: - var = &ctx->Array.ArrayObj->Index.Enabled; - flag = _NEW_ARRAY_INDEX; - break; - case GL_TEXTURE_COORD_ARRAY: - var = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; - flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); - break; - case GL_EDGE_FLAG_ARRAY: - var = &ctx->Array.ArrayObj->EdgeFlag.Enabled; - flag = _NEW_ARRAY_EDGEFLAG; - break; - case GL_FOG_COORDINATE_ARRAY_EXT: - var = &ctx->Array.ArrayObj->FogCoord.Enabled; - flag = _NEW_ARRAY_FOGCOORD; - break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &ctx->Array.ArrayObj->SecondaryColor.Enabled; - flag = _NEW_ARRAY_COLOR1; - break; - -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_OES: - var = &ctx->Array.ArrayObj->PointSize.Enabled; - flag = _NEW_ARRAY_POINT_SIZE; - break; -#endif - -#if FEATURE_NV_vertex_program - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - var = &ctx->Array.ArrayObj->VertexAttrib[n].Enabled; - flag = _NEW_ARRAY_ATTRIB(n); - } - break; -#endif /* FEATURE_NV_vertex_program */ - - default: - _mesa_error( ctx, GL_INVALID_ENUM, - "glEnable/DisableClientState(0x%x)", cap); - return; - } - - if (*var == state) - return; - - FLUSH_VERTICES(ctx, _NEW_ARRAY); - ctx->Array.NewState |= flag; - - _ae_invalidate_state(ctx, _NEW_ARRAY); - - *var = state; - - if (state) - ctx->Array.ArrayObj->_Enabled |= flag; - else - ctx->Array.ArrayObj->_Enabled &= ~flag; - - if (ctx->Driver.Enable) { - ctx->Driver.Enable( ctx, cap, state ); - } -} - - -/** - * Enable GL capability. - * \param cap state to enable/disable. - * - * Get's the current context, assures that we're outside glBegin()/glEnd() and - * calls client_state(). - */ -void GLAPIENTRY -_mesa_EnableClientState( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - client_state( ctx, cap, GL_TRUE ); -} - - -/** - * Disable GL capability. - * \param cap state to enable/disable. - * - * Get's the current context, assures that we're outside glBegin()/glEnd() and - * calls client_state(). - */ -void GLAPIENTRY -_mesa_DisableClientState( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - client_state( ctx, cap, GL_FALSE ); -} - - -#undef CHECK_EXTENSION -#define CHECK_EXTENSION(EXTNAME, CAP) \ - if (!ctx->Extensions.EXTNAME) { \ - _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)", \ - state ? "Enable" : "Disable", CAP); \ - return; \ - } - -#define CHECK_EXTENSION2(EXT1, EXT2, CAP) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)", \ - state ? "Enable" : "Disable", CAP); \ - return; \ - } - - - -/** - * Return pointer to current texture unit for setting/getting coordinate - * state. - * Note that we'll set GL_INVALID_OPERATION if the active texture unit is - * higher than the number of supported coordinate units. And we'll return NULL. - */ -static struct gl_texture_unit * -get_texcoord_unit(GLcontext *ctx) -{ - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)"); - return NULL; - } - else { - return &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - } -} - - -/** - * Helper function to enable or disable a texture target. - */ -static GLboolean -enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) -{ - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - const GLuint newenabled = (!state) - ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit); - - if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) - return GL_FALSE; - - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; - return GL_TRUE; -} - - -/** - * Helper function to enable or disable state. - * - * \param ctx GL context. - * \param cap the state to enable/disable - * \param state whether to enable or disable the specified capability. - * - * Updates the current context and flushes the vertices as needed. For - * capabilities associated with extensions it verifies that those extensions - * are effectivly present before updating. Notifies the driver via - * dd_function_table::Enable. - */ -void -_mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) -{ - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "%s %s (newstate is %x)\n", - state ? "glEnable" : "glDisable", - _mesa_lookup_enum_by_nr(cap), - ctx->NewState); - - switch (cap) { - case GL_ALPHA_TEST: - if (ctx->Color.AlphaEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.AlphaEnabled = state; - break; - case GL_AUTO_NORMAL: - if (ctx->Eval.AutoNormal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.AutoNormal = state; - break; - case GL_BLEND: - if (ctx->Color.BlendEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.BlendEnabled = state; - break; -#if FEATURE_userclip - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - { - const GLuint p = cap - GL_CLIP_PLANE0; - - if ((ctx->Transform.ClipPlanesEnabled & (1 << p)) == ((GLuint) state << p)) - return; - - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - - if (state) { - ctx->Transform.ClipPlanesEnabled |= (1 << p); - - if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top)) - _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); - - /* This derived state also calculated in clip.c and - * from _mesa_update_state() on changes to EyeUserPlane - * and ctx->ProjectionMatrix respectively. - */ - _mesa_transform_vector( ctx->Transform._ClipUserPlane[p], - ctx->Transform.EyeUserPlane[p], - ctx->ProjectionMatrixStack.Top->inv ); - } - else { - ctx->Transform.ClipPlanesEnabled &= ~(1 << p); - } - } - break; -#endif - case GL_COLOR_MATERIAL: - if (ctx->Light.ColorMaterialEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - FLUSH_CURRENT(ctx, 0); - ctx->Light.ColorMaterialEnabled = state; - if (state) { - _mesa_update_color_material( ctx, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); - } - break; - case GL_CULL_FACE: - if (ctx->Polygon.CullFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.CullFlag = state; - break; - case GL_CULL_VERTEX_EXT: - CHECK_EXTENSION(EXT_cull_vertex, cap); - if (ctx->Transform.CullVertexFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.CullVertexFlag = state; - break; - case GL_DEPTH_TEST: - if (ctx->Depth.Test == state) - return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Test = state; - break; - case GL_DITHER: - if (ctx->NoDither) { - state = GL_FALSE; /* MESA_NO_DITHER env var */ - } - if (ctx->Color.DitherFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.DitherFlag = state; - break; - case GL_FOG: - if (ctx->Fog.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Enabled = state; - break; - case GL_HISTOGRAM: - CHECK_EXTENSION(EXT_histogram, cap); - if (ctx->Pixel.HistogramEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.HistogramEnabled = state; - break; - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; - if (state) { - insert_at_tail(&ctx->Light.EnabledList, - &ctx->Light.Light[cap-GL_LIGHT0]); - } - else { - remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]); - } - break; - case GL_LIGHTING: - if (ctx->Light.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Enabled = state; - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - else - ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; - break; - case GL_LINE_SMOOTH: - if (ctx->Line.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_LINE_SMOOTH; - break; - case GL_LINE_STIPPLE: - if (ctx->Line.StippleFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.StippleFlag = state; - ctx->_TriangleCaps ^= DD_LINE_STIPPLE; - break; - case GL_INDEX_LOGIC_OP: - if (ctx->Color.IndexLogicOpEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.IndexLogicOpEnabled = state; - break; - case GL_COLOR_LOGIC_OP: - if (ctx->Color.ColorLogicOpEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.ColorLogicOpEnabled = state; - break; - case GL_MAP1_COLOR_4: - if (ctx->Eval.Map1Color4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Color4 = state; - break; - case GL_MAP1_INDEX: - if (ctx->Eval.Map1Index == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Index = state; - break; - case GL_MAP1_NORMAL: - if (ctx->Eval.Map1Normal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Normal = state; - break; - case GL_MAP1_TEXTURE_COORD_1: - if (ctx->Eval.Map1TextureCoord1 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord1 = state; - break; - case GL_MAP1_TEXTURE_COORD_2: - if (ctx->Eval.Map1TextureCoord2 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord2 = state; - break; - case GL_MAP1_TEXTURE_COORD_3: - if (ctx->Eval.Map1TextureCoord3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord3 = state; - break; - case GL_MAP1_TEXTURE_COORD_4: - if (ctx->Eval.Map1TextureCoord4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord4 = state; - break; - case GL_MAP1_VERTEX_3: - if (ctx->Eval.Map1Vertex3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Vertex3 = state; - break; - case GL_MAP1_VERTEX_4: - if (ctx->Eval.Map1Vertex4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Vertex4 = state; - break; - case GL_MAP2_COLOR_4: - if (ctx->Eval.Map2Color4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Color4 = state; - break; - case GL_MAP2_INDEX: - if (ctx->Eval.Map2Index == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Index = state; - break; - case GL_MAP2_NORMAL: - if (ctx->Eval.Map2Normal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Normal = state; - break; - case GL_MAP2_TEXTURE_COORD_1: - if (ctx->Eval.Map2TextureCoord1 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord1 = state; - break; - case GL_MAP2_TEXTURE_COORD_2: - if (ctx->Eval.Map2TextureCoord2 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord2 = state; - break; - case GL_MAP2_TEXTURE_COORD_3: - if (ctx->Eval.Map2TextureCoord3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord3 = state; - break; - case GL_MAP2_TEXTURE_COORD_4: - if (ctx->Eval.Map2TextureCoord4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord4 = state; - break; - case GL_MAP2_VERTEX_3: - if (ctx->Eval.Map2Vertex3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Vertex3 = state; - break; - case GL_MAP2_VERTEX_4: - if (ctx->Eval.Map2Vertex4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Vertex4 = state; - break; - case GL_MINMAX: - if (ctx->Pixel.MinMaxEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.MinMaxEnabled = state; - break; - case GL_NORMALIZE: - if (ctx->Transform.Normalize == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.Normalize = state; - break; - case GL_POINT_SMOOTH: - if (ctx->Point.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_POINT_SMOOTH; - break; - case GL_POLYGON_SMOOTH: - if (ctx->Polygon.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_TRI_SMOOTH; - break; - case GL_POLYGON_STIPPLE: - if (ctx->Polygon.StippleFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.StippleFlag = state; - ctx->_TriangleCaps ^= DD_TRI_STIPPLE; - break; - case GL_POLYGON_OFFSET_POINT: - if (ctx->Polygon.OffsetPoint == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetPoint = state; - break; - case GL_POLYGON_OFFSET_LINE: - if (ctx->Polygon.OffsetLine == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetLine = state; - break; - case GL_POLYGON_OFFSET_FILL: - /*case GL_POLYGON_OFFSET_EXT:*/ - if (ctx->Polygon.OffsetFill == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetFill = state; - break; - case GL_RESCALE_NORMAL_EXT: - if (ctx->Transform.RescaleNormals == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.RescaleNormals = state; - break; - case GL_SCISSOR_TEST: - if (ctx->Scissor.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_SCISSOR); - ctx->Scissor.Enabled = state; - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - if (ctx->Texture.SharedPalette == state) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - ctx->Texture.SharedPalette = state; - break; - case GL_STENCIL_TEST: - if (state && ctx->DrawBuffer->Visual.stencilBits == 0) { - _mesa_warning(ctx, - "glEnable(GL_STENCIL_TEST) but no stencil buffer"); - return; - } - if (ctx->Stencil.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Enabled = state; - break; - case GL_TEXTURE_1D: - if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) { - return; - } - break; - case GL_TEXTURE_2D: - if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) { - return; - } - break; - case GL_TEXTURE_3D: - if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { - return; - } - break; - case GL_TEXTURE_GEN_Q: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT; - if (state) - newenabled |= Q_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_R: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT; - if (state) - newenabled |= R_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_S: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT; - if (state) - newenabled |= S_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_T: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT; - if (state) - newenabled |= T_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - - /* - * CLIENT STATE!!! - */ - case GL_VERTEX_ARRAY: - case GL_NORMAL_ARRAY: - case GL_COLOR_ARRAY: - case GL_INDEX_ARRAY: - case GL_TEXTURE_COORD_ARRAY: - case GL_EDGE_FLAG_ARRAY: - case GL_FOG_COORDINATE_ARRAY_EXT: - case GL_SECONDARY_COLOR_ARRAY_EXT: - case GL_POINT_SIZE_ARRAY_OES: - client_state( ctx, cap, state ); - return; - - /* GL_SGI_color_table */ - case GL_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] = state; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] = state; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table, cap); - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] = state; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_texture_color_table, cap); - if (ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled = state; - break; - - /* GL_EXT_convolution */ - case GL_CONVOLUTION_1D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Convolution1DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Convolution1DEnabled = state; - break; - case GL_CONVOLUTION_2D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Convolution2DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Convolution2DEnabled = state; - break; - case GL_SEPARABLE_2D: - CHECK_EXTENSION(EXT_convolution, cap); - if (ctx->Pixel.Separable2DEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.Separable2DEnabled = state; - break; - - /* GL_ARB_texture_cube_map */ - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXTENSION(ARB_texture_cube_map, cap); - if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) { - return; - } - break; - - /* GL_EXT_secondary_color */ - case GL_COLOR_SUM_EXT: - CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap); - if (ctx->Fog.ColorSumEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.ColorSumEnabled = state; - break; - - /* GL_ARB_multisample */ - case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); - if (ctx->Multisample.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.Enabled = state; - break; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); - if (ctx->Multisample.SampleAlphaToCoverage == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleAlphaToCoverage = state; - break; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); - if (ctx->Multisample.SampleAlphaToOne == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleAlphaToOne = state; - break; - case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); - if (ctx->Multisample.SampleCoverage == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleCoverage = state; - break; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample, cap); - if (ctx->Multisample.SampleCoverageInvert == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleCoverageInvert = state; - break; - - /* GL_IBM_rasterpos_clip */ - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXTENSION(IBM_rasterpos_clip, cap); - if (ctx->Transform.RasterPositionUnclipped == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.RasterPositionUnclipped = state; - break; - - /* GL_NV_point_sprite */ - case GL_POINT_SPRITE_NV: - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap); - if (ctx->Point.PointSprite == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.PointSprite = state; - break; - -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.Enabled = state; - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.PointSizeEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.PointSizeEnabled = state; - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.TwoSideEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.TwoSideEnabled = state; - break; -#endif -#if FEATURE_NV_vertex_program - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Attrib[map] = state; - } - break; - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Attrib[map] = state; - } - break; -#endif /* FEATURE_NV_vertex_program */ - -#if FEATURE_NV_fragment_program - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXTENSION(NV_fragment_program, cap); - if (ctx->FragmentProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->FragmentProgram.Enabled = state; - break; -#endif /* FEATURE_NV_fragment_program */ - - /* GL_NV_texture_rectangle */ - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXTENSION(NV_texture_rectangle, cap); - if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) { - return; - } - break; - - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side, cap); - if (ctx->Stencil.TestTwoSide == state) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.TestTwoSide = state; - if (state) { - ctx->Stencil._BackFace = 2; - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; - } else { - ctx->Stencil._BackFace = 1; - ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; - } - break; - -#if FEATURE_ARB_fragment_program - case GL_FRAGMENT_PROGRAM_ARB: - CHECK_EXTENSION(ARB_fragment_program, cap); - if (ctx->FragmentProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->FragmentProgram.Enabled = state; - break; -#endif /* FEATURE_ARB_fragment_program */ - - /* GL_EXT_depth_bounds_test */ - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx, - "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); - return; - } - if (ctx->Depth.BoundsTest == state) - return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.BoundsTest = state; - break; - - /* GL_MESA_program_debug */ - case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: - CHECK_EXTENSION(MESA_program_debug, cap); - ctx->FragmentProgram.CallbackEnabled = state; - break; - case GL_VERTEX_PROGRAM_CALLBACK_MESA: - CHECK_EXTENSION(MESA_program_debug, cap); - ctx->VertexProgram.CallbackEnabled = state; - break; - -#if FEATURE_ATI_fragment_shader - case GL_FRAGMENT_SHADER_ATI: - CHECK_EXTENSION(ATI_fragment_shader, cap); - if (ctx->ATIFragmentShader.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->ATIFragmentShader.Enabled = state; - break; -#endif - - /* GL_MESA_texture_array */ - case GL_TEXTURE_1D_ARRAY_EXT: - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { - return; - } - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { - return; - } - break; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "%s(0x%x)", state ? "glEnable" : "glDisable", cap); - return; - } - - if (ctx->Driver.Enable) { - ctx->Driver.Enable( ctx, cap, state ); - } -} - - -/** - * Enable GL capability. Called by glEnable() - * \param cap state to enable. - */ -void GLAPIENTRY -_mesa_Enable( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_set_enable( ctx, cap, GL_TRUE ); -} - - -/** - * Disable GL capability. Called by glDisable() - * \param cap state to disable. - */ -void GLAPIENTRY -_mesa_Disable( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_set_enable( ctx, cap, GL_FALSE ); -} - - -#undef CHECK_EXTENSION -#define CHECK_EXTENSION(EXTNAME) \ - if (!ctx->Extensions.EXTNAME) { \ - _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \ - return GL_FALSE; \ - } - -#undef CHECK_EXTENSION2 -#define CHECK_EXTENSION2(EXT1, EXT2) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \ - return GL_FALSE; \ - } - - -/** - * Helper function to determine whether a texture target is enabled. - */ -static GLboolean -is_texture_enabled(GLcontext *ctx, GLbitfield bit) -{ - const struct gl_texture_unit *const texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE; -} - - -/** - * Return simple enable/disable state. - * - * \param cap state variable to query. - * - * Returns the state of the specified capability from the current GL context. - * For the capabilities associated with extensions verifies that those - * extensions are effectively present before reporting. - */ -GLboolean GLAPIENTRY -_mesa_IsEnabled( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - switch (cap) { - case GL_ALPHA_TEST: - return ctx->Color.AlphaEnabled; - case GL_AUTO_NORMAL: - return ctx->Eval.AutoNormal; - case GL_BLEND: - return ctx->Color.BlendEnabled; - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1; - case GL_COLOR_MATERIAL: - return ctx->Light.ColorMaterialEnabled; - case GL_CULL_FACE: - return ctx->Polygon.CullFlag; - case GL_DEPTH_TEST: - return ctx->Depth.Test; - case GL_DITHER: - return ctx->Color.DitherFlag; - case GL_FOG: - return ctx->Fog.Enabled; - case GL_LIGHTING: - return ctx->Light.Enabled; - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - return ctx->Light.Light[cap-GL_LIGHT0].Enabled; - case GL_LINE_SMOOTH: - return ctx->Line.SmoothFlag; - case GL_LINE_STIPPLE: - return ctx->Line.StippleFlag; - case GL_INDEX_LOGIC_OP: - return ctx->Color.IndexLogicOpEnabled; - case GL_COLOR_LOGIC_OP: - return ctx->Color.ColorLogicOpEnabled; - case GL_MAP1_COLOR_4: - return ctx->Eval.Map1Color4; - case GL_MAP1_INDEX: - return ctx->Eval.Map1Index; - case GL_MAP1_NORMAL: - return ctx->Eval.Map1Normal; - case GL_MAP1_TEXTURE_COORD_1: - return ctx->Eval.Map1TextureCoord1; - case GL_MAP1_TEXTURE_COORD_2: - return ctx->Eval.Map1TextureCoord2; - case GL_MAP1_TEXTURE_COORD_3: - return ctx->Eval.Map1TextureCoord3; - case GL_MAP1_TEXTURE_COORD_4: - return ctx->Eval.Map1TextureCoord4; - case GL_MAP1_VERTEX_3: - return ctx->Eval.Map1Vertex3; - case GL_MAP1_VERTEX_4: - return ctx->Eval.Map1Vertex4; - case GL_MAP2_COLOR_4: - return ctx->Eval.Map2Color4; - case GL_MAP2_INDEX: - return ctx->Eval.Map2Index; - case GL_MAP2_NORMAL: - return ctx->Eval.Map2Normal; - case GL_MAP2_TEXTURE_COORD_1: - return ctx->Eval.Map2TextureCoord1; - case GL_MAP2_TEXTURE_COORD_2: - return ctx->Eval.Map2TextureCoord2; - case GL_MAP2_TEXTURE_COORD_3: - return ctx->Eval.Map2TextureCoord3; - case GL_MAP2_TEXTURE_COORD_4: - return ctx->Eval.Map2TextureCoord4; - case GL_MAP2_VERTEX_3: - return ctx->Eval.Map2Vertex3; - case GL_MAP2_VERTEX_4: - return ctx->Eval.Map2Vertex4; - case GL_NORMALIZE: - return ctx->Transform.Normalize; - case GL_POINT_SMOOTH: - return ctx->Point.SmoothFlag; - case GL_POLYGON_SMOOTH: - return ctx->Polygon.SmoothFlag; - case GL_POLYGON_STIPPLE: - return ctx->Polygon.StippleFlag; - case GL_POLYGON_OFFSET_POINT: - return ctx->Polygon.OffsetPoint; - case GL_POLYGON_OFFSET_LINE: - return ctx->Polygon.OffsetLine; - case GL_POLYGON_OFFSET_FILL: - /*case GL_POLYGON_OFFSET_EXT:*/ - return ctx->Polygon.OffsetFill; - case GL_RESCALE_NORMAL_EXT: - return ctx->Transform.RescaleNormals; - case GL_SCISSOR_TEST: - return ctx->Scissor.Enabled; - case GL_SHARED_TEXTURE_PALETTE_EXT: - return ctx->Texture.SharedPalette; - case GL_STENCIL_TEST: - return ctx->Stencil.Enabled; - case GL_TEXTURE_1D: - return is_texture_enabled(ctx, TEXTURE_1D_BIT); - case GL_TEXTURE_2D: - return is_texture_enabled(ctx, TEXTURE_2D_BIT); - case GL_TEXTURE_3D: - return is_texture_enabled(ctx, TEXTURE_3D_BIT); - case GL_TEXTURE_GEN_Q: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_R: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_S: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_T: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - - /* - * CLIENT STATE!!! - */ - case GL_VERTEX_ARRAY: - return (ctx->Array.ArrayObj->Vertex.Enabled != 0); - case GL_NORMAL_ARRAY: - return (ctx->Array.ArrayObj->Normal.Enabled != 0); - case GL_COLOR_ARRAY: - return (ctx->Array.ArrayObj->Color.Enabled != 0); - case GL_INDEX_ARRAY: - return (ctx->Array.ArrayObj->Index.Enabled != 0); - case GL_TEXTURE_COORD_ARRAY: - return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled != 0); - case GL_EDGE_FLAG_ARRAY: - return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0); - case GL_FOG_COORDINATE_ARRAY_EXT: - CHECK_EXTENSION(EXT_fog_coord); - return (ctx->Array.ArrayObj->FogCoord.Enabled != 0); - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXTENSION(EXT_secondary_color); - return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_OES: - return (ctx->Array.ArrayObj->PointSize.Enabled != 0); -#endif - - /* GL_EXT_histogram */ - case GL_HISTOGRAM: - CHECK_EXTENSION(EXT_histogram); - return ctx->Pixel.HistogramEnabled; - case GL_MINMAX: - CHECK_EXTENSION(EXT_histogram); - return ctx->Pixel.MinMaxEnabled; - - /* GL_SGI_color_table */ - case GL_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_color_table); - return ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]; - - /* GL_SGI_texture_color_table */ - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_texture_color_table); - return ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; - - /* GL_EXT_convolution */ - case GL_CONVOLUTION_1D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Convolution1DEnabled; - case GL_CONVOLUTION_2D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Convolution2DEnabled; - case GL_SEPARABLE_2D: - CHECK_EXTENSION(EXT_convolution); - return ctx->Pixel.Separable2DEnabled; - - /* GL_ARB_texture_cube_map */ - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXTENSION(ARB_texture_cube_map); - return is_texture_enabled(ctx, TEXTURE_CUBE_BIT); - - /* GL_EXT_secondary_color */ - case GL_COLOR_SUM_EXT: - CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program); - return ctx->Fog.ColorSumEnabled; - - /* GL_ARB_multisample */ - case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample); - return ctx->Multisample.Enabled; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); - return ctx->Multisample.SampleAlphaToCoverage; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample); - return ctx->Multisample.SampleAlphaToOne; - case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); - return ctx->Multisample.SampleCoverage; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample); - return ctx->Multisample.SampleCoverageInvert; - - /* GL_IBM_rasterpos_clip */ - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXTENSION(IBM_rasterpos_clip); - return ctx->Transform.RasterPositionUnclipped; - - /* GL_NV_point_sprite */ - case GL_POINT_SPRITE_NV: - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) - return ctx->Point.PointSprite; - -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.Enabled; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.PointSizeEnabled; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.TwoSideEnabled; -#endif -#if FEATURE_NV_vertex_program - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0); - } - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map1Attrib[map]; - } - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map2Attrib[map]; - } -#endif /* FEATURE_NV_vertex_program */ - -#if FEATURE_NV_fragment_program - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXTENSION(NV_fragment_program); - return ctx->FragmentProgram.Enabled; -#endif /* FEATURE_NV_fragment_program */ - - /* GL_NV_texture_rectangle */ - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXTENSION(NV_texture_rectangle); - return is_texture_enabled(ctx, TEXTURE_RECT_BIT); - - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side); - return ctx->Stencil.TestTwoSide; - -#if FEATURE_ARB_fragment_program - case GL_FRAGMENT_PROGRAM_ARB: - return ctx->FragmentProgram.Enabled; -#endif /* FEATURE_ARB_fragment_program */ - - /* GL_EXT_depth_bounds_test */ - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXTENSION(EXT_depth_bounds_test); - return ctx->Depth.BoundsTest; - - /* GL_MESA_program_debug */ - case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: - CHECK_EXTENSION(MESA_program_debug); - return ctx->FragmentProgram.CallbackEnabled; - case GL_VERTEX_PROGRAM_CALLBACK_MESA: - CHECK_EXTENSION(MESA_program_debug); - return ctx->VertexProgram.CallbackEnabled; -#if FEATURE_ATI_fragment_shader - case GL_FRAGMENT_SHADER_ATI: - CHECK_EXTENSION(ATI_fragment_shader); - return ctx->ATIFragmentShader.Enabled; -#endif /* FEATURE_ATI_fragment_shader */ - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap); - return GL_FALSE; - } -} diff --git a/src/libs/mesa/mesa/main/enable.h b/src/libs/mesa/mesa/main/enable.h deleted file mode 100644 index 25c90b0275..0000000000 --- a/src/libs/mesa/mesa/main/enable.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * \file enable.h - * Enable/disable/query GL capabilities. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 ENABLE_H -#define ENABLE_H - - -#include "mtypes.h" - - -extern void -_mesa_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); - -extern void GLAPIENTRY -_mesa_Disable( GLenum cap ); - -extern void GLAPIENTRY -_mesa_Enable( GLenum cap ); - -extern GLboolean GLAPIENTRY -_mesa_IsEnabled( GLenum cap ); - -extern void GLAPIENTRY -_mesa_EnableClientState( GLenum cap ); - -extern void GLAPIENTRY -_mesa_DisableClientState( GLenum cap ); - - -#endif diff --git a/src/libs/mesa/mesa/main/enums.c b/src/libs/mesa/mesa/main/enums.c deleted file mode 100644 index 4796f3027a..0000000000 --- a/src/libs/mesa/mesa/main/enums.c +++ /dev/null @@ -1,4898 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_enums.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * 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 - * BRIAN PAUL, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "glheader.h" -#include "enums.h" -#include "imports.h" - -typedef struct { - size_t offset; - int n; -} enum_elt; - -LONGSTRING static const char enum_string_table[] = - "GL_2D\0" - "GL_2_BYTES\0" - "GL_3D\0" - "GL_3D_COLOR\0" - "GL_3D_COLOR_TEXTURE\0" - "GL_3_BYTES\0" - "GL_4D_COLOR_TEXTURE\0" - "GL_4_BYTES\0" - "GL_ACCUM\0" - "GL_ACCUM_ALPHA_BITS\0" - "GL_ACCUM_BLUE_BITS\0" - "GL_ACCUM_BUFFER_BIT\0" - "GL_ACCUM_CLEAR_VALUE\0" - "GL_ACCUM_GREEN_BITS\0" - "GL_ACCUM_RED_BITS\0" - "GL_ACTIVE_ATTRIBUTES\0" - "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0" - "GL_ACTIVE_STENCIL_FACE_EXT\0" - "GL_ACTIVE_TEXTURE\0" - "GL_ACTIVE_TEXTURE_ARB\0" - "GL_ACTIVE_UNIFORMS\0" - "GL_ACTIVE_UNIFORM_MAX_LENGTH\0" - "GL_ACTIVE_VERTEX_UNITS_ARB\0" - "GL_ADD\0" - "GL_ADD_SIGNED\0" - "GL_ADD_SIGNED_ARB\0" - "GL_ADD_SIGNED_EXT\0" - "GL_ALIASED_LINE_WIDTH_RANGE\0" - "GL_ALIASED_POINT_SIZE_RANGE\0" - "GL_ALL_ATTRIB_BITS\0" - "GL_ALL_CLIENT_ATTRIB_BITS\0" - "GL_ALPHA\0" - "GL_ALPHA12\0" - "GL_ALPHA12_EXT\0" - "GL_ALPHA16\0" - "GL_ALPHA16_EXT\0" - "GL_ALPHA4\0" - "GL_ALPHA4_EXT\0" - "GL_ALPHA8\0" - "GL_ALPHA8_EXT\0" - "GL_ALPHA_BIAS\0" - "GL_ALPHA_BITS\0" - "GL_ALPHA_SCALE\0" - "GL_ALPHA_TEST\0" - "GL_ALPHA_TEST_FUNC\0" - "GL_ALPHA_TEST_REF\0" - "GL_ALWAYS\0" - "GL_AMBIENT\0" - "GL_AMBIENT_AND_DIFFUSE\0" - "GL_AND\0" - "GL_AND_INVERTED\0" - "GL_AND_REVERSE\0" - "GL_ARRAY_BUFFER\0" - "GL_ARRAY_BUFFER_BINDING\0" - "GL_ARRAY_BUFFER_BINDING_ARB\0" - "GL_ATTACHED_SHADERS\0" - "GL_ATTRIB_ARRAY_POINTER_NV\0" - "GL_ATTRIB_ARRAY_SIZE_NV\0" - "GL_ATTRIB_ARRAY_STRIDE_NV\0" - "GL_ATTRIB_ARRAY_TYPE_NV\0" - "GL_ATTRIB_STACK_DEPTH\0" - "GL_AUTO_NORMAL\0" - "GL_AUX0\0" - "GL_AUX1\0" - "GL_AUX2\0" - "GL_AUX3\0" - "GL_AUX_BUFFERS\0" - "GL_BACK\0" - "GL_BACK_LEFT\0" - "GL_BACK_RIGHT\0" - "GL_BGR\0" - "GL_BGRA\0" - "GL_BITMAP\0" - "GL_BITMAP_TOKEN\0" - "GL_BLEND\0" - "GL_BLEND_COLOR\0" - "GL_BLEND_COLOR_EXT\0" - "GL_BLEND_DST\0" - "GL_BLEND_DST_ALPHA\0" - "GL_BLEND_DST_RGB\0" - "GL_BLEND_EQUATION\0" - "GL_BLEND_EQUATION_ALPHA\0" - "GL_BLEND_EQUATION_ALPHA_EXT\0" - "GL_BLEND_EQUATION_EXT\0" - "GL_BLEND_EQUATION_RGB_EXT\0" - "GL_BLEND_SRC\0" - "GL_BLEND_SRC_ALPHA\0" - "GL_BLEND_SRC_RGB\0" - "GL_BLUE\0" - "GL_BLUE_BIAS\0" - "GL_BLUE_BITS\0" - "GL_BLUE_SCALE\0" - "GL_BOOL\0" - "GL_BOOL_ARB\0" - "GL_BOOL_VEC2\0" - "GL_BOOL_VEC2_ARB\0" - "GL_BOOL_VEC3\0" - "GL_BOOL_VEC3_ARB\0" - "GL_BOOL_VEC4\0" - "GL_BOOL_VEC4_ARB\0" - "GL_BUFFER_ACCESS\0" - "GL_BUFFER_ACCESS_ARB\0" - "GL_BUFFER_MAPPED\0" - "GL_BUFFER_MAPPED_ARB\0" - "GL_BUFFER_MAP_POINTER\0" - "GL_BUFFER_MAP_POINTER_ARB\0" - "GL_BUFFER_SIZE\0" - "GL_BUFFER_SIZE_ARB\0" - "GL_BUFFER_USAGE\0" - "GL_BUFFER_USAGE_ARB\0" - "GL_BYTE\0" - "GL_C3F_V3F\0" - "GL_C4F_N3F_V3F\0" - "GL_C4UB_V2F\0" - "GL_C4UB_V3F\0" - "GL_CCW\0" - "GL_CLAMP\0" - "GL_CLAMP_TO_BORDER\0" - "GL_CLAMP_TO_BORDER_ARB\0" - "GL_CLAMP_TO_BORDER_SGIS\0" - "GL_CLAMP_TO_EDGE\0" - "GL_CLAMP_TO_EDGE_SGIS\0" - "GL_CLEAR\0" - "GL_CLIENT_ACTIVE_TEXTURE\0" - "GL_CLIENT_ACTIVE_TEXTURE_ARB\0" - "GL_CLIENT_ALL_ATTRIB_BITS\0" - "GL_CLIENT_ATTRIB_STACK_DEPTH\0" - "GL_CLIENT_PIXEL_STORE_BIT\0" - "GL_CLIENT_VERTEX_ARRAY_BIT\0" - "GL_CLIP_PLANE0\0" - "GL_CLIP_PLANE1\0" - "GL_CLIP_PLANE2\0" - "GL_CLIP_PLANE3\0" - "GL_CLIP_PLANE4\0" - "GL_CLIP_PLANE5\0" - "GL_CLIP_VOLUME_CLIPPING_HINT_EXT\0" - "GL_COEFF\0" - "GL_COLOR\0" - "GL_COLOR_ARRAY\0" - "GL_COLOR_ARRAY_BUFFER_BINDING\0" - "GL_COLOR_ARRAY_BUFFER_BINDING_ARB\0" - "GL_COLOR_ARRAY_POINTER\0" - "GL_COLOR_ARRAY_SIZE\0" - "GL_COLOR_ARRAY_STRIDE\0" - "GL_COLOR_ARRAY_TYPE\0" - "GL_COLOR_ATTACHMENT0_EXT\0" - "GL_COLOR_ATTACHMENT10_EXT\0" - "GL_COLOR_ATTACHMENT11_EXT\0" - "GL_COLOR_ATTACHMENT12_EXT\0" - "GL_COLOR_ATTACHMENT13_EXT\0" - "GL_COLOR_ATTACHMENT14_EXT\0" - "GL_COLOR_ATTACHMENT15_EXT\0" - "GL_COLOR_ATTACHMENT1_EXT\0" - "GL_COLOR_ATTACHMENT2_EXT\0" - "GL_COLOR_ATTACHMENT3_EXT\0" - "GL_COLOR_ATTACHMENT4_EXT\0" - "GL_COLOR_ATTACHMENT5_EXT\0" - "GL_COLOR_ATTACHMENT6_EXT\0" - "GL_COLOR_ATTACHMENT7_EXT\0" - "GL_COLOR_ATTACHMENT8_EXT\0" - "GL_COLOR_ATTACHMENT9_EXT\0" - "GL_COLOR_BUFFER_BIT\0" - "GL_COLOR_CLEAR_VALUE\0" - "GL_COLOR_INDEX\0" - "GL_COLOR_INDEXES\0" - "GL_COLOR_LOGIC_OP\0" - "GL_COLOR_MATERIAL\0" - "GL_COLOR_MATERIAL_FACE\0" - "GL_COLOR_MATERIAL_PARAMETER\0" - "GL_COLOR_MATRIX\0" - "GL_COLOR_MATRIX_SGI\0" - "GL_COLOR_MATRIX_STACK_DEPTH\0" - "GL_COLOR_MATRIX_STACK_DEPTH_SGI\0" - "GL_COLOR_SUM\0" - "GL_COLOR_SUM_ARB\0" - "GL_COLOR_TABLE\0" - "GL_COLOR_TABLE_ALPHA_SIZE\0" - "GL_COLOR_TABLE_ALPHA_SIZE_EXT\0" - "GL_COLOR_TABLE_ALPHA_SIZE_SGI\0" - "GL_COLOR_TABLE_BIAS\0" - "GL_COLOR_TABLE_BIAS_SGI\0" - "GL_COLOR_TABLE_BLUE_SIZE\0" - "GL_COLOR_TABLE_BLUE_SIZE_EXT\0" - "GL_COLOR_TABLE_BLUE_SIZE_SGI\0" - "GL_COLOR_TABLE_FORMAT\0" - "GL_COLOR_TABLE_FORMAT_EXT\0" - "GL_COLOR_TABLE_FORMAT_SGI\0" - "GL_COLOR_TABLE_GREEN_SIZE\0" - "GL_COLOR_TABLE_GREEN_SIZE_EXT\0" - "GL_COLOR_TABLE_GREEN_SIZE_SGI\0" - "GL_COLOR_TABLE_INTENSITY_SIZE\0" - "GL_COLOR_TABLE_INTENSITY_SIZE_EXT\0" - "GL_COLOR_TABLE_INTENSITY_SIZE_SGI\0" - "GL_COLOR_TABLE_LUMINANCE_SIZE\0" - "GL_COLOR_TABLE_LUMINANCE_SIZE_EXT\0" - "GL_COLOR_TABLE_LUMINANCE_SIZE_SGI\0" - "GL_COLOR_TABLE_RED_SIZE\0" - "GL_COLOR_TABLE_RED_SIZE_EXT\0" - "GL_COLOR_TABLE_RED_SIZE_SGI\0" - "GL_COLOR_TABLE_SCALE\0" - "GL_COLOR_TABLE_SCALE_SGI\0" - "GL_COLOR_TABLE_WIDTH\0" - "GL_COLOR_TABLE_WIDTH_EXT\0" - "GL_COLOR_TABLE_WIDTH_SGI\0" - "GL_COLOR_WRITEMASK\0" - "GL_COMBINE\0" - "GL_COMBINE4\0" - "GL_COMBINE_ALPHA\0" - "GL_COMBINE_ALPHA_ARB\0" - "GL_COMBINE_ALPHA_EXT\0" - "GL_COMBINE_ARB\0" - "GL_COMBINE_EXT\0" - "GL_COMBINE_RGB\0" - "GL_COMBINE_RGB_ARB\0" - "GL_COMBINE_RGB_EXT\0" - "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT\0" - "GL_COMPARE_R_TO_TEXTURE\0" - "GL_COMPARE_R_TO_TEXTURE_ARB\0" - "GL_COMPILE\0" - "GL_COMPILE_AND_EXECUTE\0" - "GL_COMPILE_STATUS\0" - "GL_COMPRESSED_ALPHA\0" - "GL_COMPRESSED_ALPHA_ARB\0" - "GL_COMPRESSED_INTENSITY\0" - "GL_COMPRESSED_INTENSITY_ARB\0" - "GL_COMPRESSED_LUMINANCE\0" - "GL_COMPRESSED_LUMINANCE_ALPHA\0" - "GL_COMPRESSED_LUMINANCE_ALPHA_ARB\0" - "GL_COMPRESSED_LUMINANCE_ARB\0" - "GL_COMPRESSED_RGB\0" - "GL_COMPRESSED_RGBA\0" - "GL_COMPRESSED_RGBA_ARB\0" - "GL_COMPRESSED_RGBA_FXT1_3DFX\0" - "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT\0" - "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT\0" - "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\0" - "GL_COMPRESSED_RGB_ARB\0" - "GL_COMPRESSED_RGB_FXT1_3DFX\0" - "GL_COMPRESSED_RGB_S3TC_DXT1_EXT\0" - "GL_COMPRESSED_TEXTURE_FORMATS\0" - "GL_CONSTANT\0" - "GL_CONSTANT_ALPHA\0" - "GL_CONSTANT_ALPHA_EXT\0" - "GL_CONSTANT_ARB\0" - "GL_CONSTANT_ATTENUATION\0" - "GL_CONSTANT_BORDER_HP\0" - "GL_CONSTANT_COLOR\0" - "GL_CONSTANT_COLOR_EXT\0" - "GL_CONSTANT_EXT\0" - "GL_CONVOLUTION_1D\0" - "GL_CONVOLUTION_2D\0" - "GL_CONVOLUTION_BORDER_COLOR\0" - "GL_CONVOLUTION_BORDER_COLOR_HP\0" - "GL_CONVOLUTION_BORDER_MODE\0" - "GL_CONVOLUTION_BORDER_MODE_EXT\0" - "GL_CONVOLUTION_FILTER_BIAS\0" - "GL_CONVOLUTION_FILTER_BIAS_EXT\0" - "GL_CONVOLUTION_FILTER_SCALE\0" - "GL_CONVOLUTION_FILTER_SCALE_EXT\0" - "GL_CONVOLUTION_FORMAT\0" - "GL_CONVOLUTION_FORMAT_EXT\0" - "GL_CONVOLUTION_HEIGHT\0" - "GL_CONVOLUTION_HEIGHT_EXT\0" - "GL_CONVOLUTION_WIDTH\0" - "GL_CONVOLUTION_WIDTH_EXT\0" - "GL_COORD_REPLACE\0" - "GL_COORD_REPLACE_ARB\0" - "GL_COORD_REPLACE_NV\0" - "GL_COPY\0" - "GL_COPY_INVERTED\0" - "GL_COPY_PIXEL_TOKEN\0" - "GL_CULL_FACE\0" - "GL_CULL_FACE_MODE\0" - "GL_CULL_VERTEX_EXT\0" - "GL_CULL_VERTEX_EYE_POSITION_EXT\0" - "GL_CULL_VERTEX_OBJECT_POSITION_EXT\0" - "GL_CURRENT_ATTRIB_NV\0" - "GL_CURRENT_BIT\0" - "GL_CURRENT_COLOR\0" - "GL_CURRENT_FOG_COORD\0" - "GL_CURRENT_FOG_COORDINATE\0" - "GL_CURRENT_INDEX\0" - "GL_CURRENT_MATRIX_ARB\0" - "GL_CURRENT_MATRIX_INDEX_ARB\0" - "GL_CURRENT_MATRIX_NV\0" - "GL_CURRENT_MATRIX_STACK_DEPTH_ARB\0" - "GL_CURRENT_MATRIX_STACK_DEPTH_NV\0" - "GL_CURRENT_NORMAL\0" - "GL_CURRENT_PALETTE_MATRIX_ARB\0" - "GL_CURRENT_PROGRAM\0" - "GL_CURRENT_QUERY\0" - "GL_CURRENT_QUERY_ARB\0" - "GL_CURRENT_RASTER_COLOR\0" - "GL_CURRENT_RASTER_DISTANCE\0" - "GL_CURRENT_RASTER_INDEX\0" - "GL_CURRENT_RASTER_POSITION\0" - "GL_CURRENT_RASTER_POSITION_VALID\0" - "GL_CURRENT_RASTER_TEXTURE_COORDS\0" - "GL_CURRENT_SECONDARY_COLOR\0" - "GL_CURRENT_TEXTURE_COORDS\0" - "GL_CURRENT_VERTEX_ATTRIB\0" - "GL_CURRENT_VERTEX_ATTRIB_ARB\0" - "GL_CURRENT_WEIGHT_ARB\0" - "GL_CW\0" - "GL_DEBUG_ASSERT_MESA\0" - "GL_DEBUG_OBJECT_MESA\0" - "GL_DEBUG_PRINT_MESA\0" - "GL_DECAL\0" - "GL_DECR\0" - "GL_DECR_WRAP\0" - "GL_DECR_WRAP_EXT\0" - "GL_DELETE_STATUS\0" - "GL_DEPTH\0" - "GL_DEPTH_ATTACHMENT_EXT\0" - "GL_DEPTH_BIAS\0" - "GL_DEPTH_BITS\0" - "GL_DEPTH_BOUNDS_EXT\0" - "GL_DEPTH_BOUNDS_TEST_EXT\0" - "GL_DEPTH_BUFFER_BIT\0" - "GL_DEPTH_CLAMP_NV\0" - "GL_DEPTH_CLEAR_VALUE\0" - "GL_DEPTH_COMPONENT\0" - "GL_DEPTH_COMPONENT16\0" - "GL_DEPTH_COMPONENT16_ARB\0" - "GL_DEPTH_COMPONENT16_SGIX\0" - "GL_DEPTH_COMPONENT24\0" - "GL_DEPTH_COMPONENT24_ARB\0" - "GL_DEPTH_COMPONENT24_SGIX\0" - "GL_DEPTH_COMPONENT32\0" - "GL_DEPTH_COMPONENT32_ARB\0" - "GL_DEPTH_COMPONENT32_SGIX\0" - "GL_DEPTH_FUNC\0" - "GL_DEPTH_RANGE\0" - "GL_DEPTH_SCALE\0" - "GL_DEPTH_STENCIL_NV\0" - "GL_DEPTH_STENCIL_TO_BGRA_NV\0" - "GL_DEPTH_STENCIL_TO_RGBA_NV\0" - "GL_DEPTH_TEST\0" - "GL_DEPTH_TEXTURE_MODE\0" - "GL_DEPTH_TEXTURE_MODE_ARB\0" - "GL_DEPTH_WRITEMASK\0" - "GL_DIFFUSE\0" - "GL_DITHER\0" - "GL_DOMAIN\0" - "GL_DONT_CARE\0" - "GL_DOT3_RGB\0" - "GL_DOT3_RGBA\0" - "GL_DOT3_RGBA_ARB\0" - "GL_DOT3_RGBA_EXT\0" - "GL_DOT3_RGB_ARB\0" - "GL_DOT3_RGB_EXT\0" - "GL_DOUBLE\0" - "GL_DOUBLEBUFFER\0" - "GL_DRAW_BUFFER\0" - "GL_DRAW_BUFFER0\0" - "GL_DRAW_BUFFER0_ARB\0" - "GL_DRAW_BUFFER0_ATI\0" - "GL_DRAW_BUFFER1\0" - "GL_DRAW_BUFFER10\0" - "GL_DRAW_BUFFER10_ARB\0" - "GL_DRAW_BUFFER10_ATI\0" - "GL_DRAW_BUFFER11\0" - "GL_DRAW_BUFFER11_ARB\0" - "GL_DRAW_BUFFER11_ATI\0" - "GL_DRAW_BUFFER12\0" - "GL_DRAW_BUFFER12_ARB\0" - "GL_DRAW_BUFFER12_ATI\0" - "GL_DRAW_BUFFER13\0" - "GL_DRAW_BUFFER13_ARB\0" - "GL_DRAW_BUFFER13_ATI\0" - "GL_DRAW_BUFFER14\0" - "GL_DRAW_BUFFER14_ARB\0" - "GL_DRAW_BUFFER14_ATI\0" - "GL_DRAW_BUFFER15\0" - "GL_DRAW_BUFFER15_ARB\0" - "GL_DRAW_BUFFER15_ATI\0" - "GL_DRAW_BUFFER1_ARB\0" - "GL_DRAW_BUFFER1_ATI\0" - "GL_DRAW_BUFFER2\0" - "GL_DRAW_BUFFER2_ARB\0" - "GL_DRAW_BUFFER2_ATI\0" - "GL_DRAW_BUFFER3\0" - "GL_DRAW_BUFFER3_ARB\0" - "GL_DRAW_BUFFER3_ATI\0" - "GL_DRAW_BUFFER4\0" - "GL_DRAW_BUFFER4_ARB\0" - "GL_DRAW_BUFFER4_ATI\0" - "GL_DRAW_BUFFER5\0" - "GL_DRAW_BUFFER5_ARB\0" - "GL_DRAW_BUFFER5_ATI\0" - "GL_DRAW_BUFFER6\0" - "GL_DRAW_BUFFER6_ARB\0" - "GL_DRAW_BUFFER6_ATI\0" - "GL_DRAW_BUFFER7\0" - "GL_DRAW_BUFFER7_ARB\0" - "GL_DRAW_BUFFER7_ATI\0" - "GL_DRAW_BUFFER8\0" - "GL_DRAW_BUFFER8_ARB\0" - "GL_DRAW_BUFFER8_ATI\0" - "GL_DRAW_BUFFER9\0" - "GL_DRAW_BUFFER9_ARB\0" - "GL_DRAW_BUFFER9_ATI\0" - "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0" - "GL_DRAW_FRAMEBUFFER_EXT\0" - "GL_DRAW_PIXEL_TOKEN\0" - "GL_DST_ALPHA\0" - "GL_DST_COLOR\0" - "GL_DYNAMIC_COPY\0" - "GL_DYNAMIC_COPY_ARB\0" - "GL_DYNAMIC_DRAW\0" - "GL_DYNAMIC_DRAW_ARB\0" - "GL_DYNAMIC_READ\0" - "GL_DYNAMIC_READ_ARB\0" - "GL_EDGE_FLAG\0" - "GL_EDGE_FLAG_ARRAY\0" - "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING\0" - "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB\0" - "GL_EDGE_FLAG_ARRAY_POINTER\0" - "GL_EDGE_FLAG_ARRAY_STRIDE\0" - "GL_ELEMENT_ARRAY_BUFFER\0" - "GL_ELEMENT_ARRAY_BUFFER_BINDING\0" - "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB\0" - "GL_EMISSION\0" - "GL_ENABLE_BIT\0" - "GL_EQUAL\0" - "GL_EQUIV\0" - "GL_EVAL_BIT\0" - "GL_EXP\0" - "GL_EXP2\0" - "GL_EXTENSIONS\0" - "GL_EYE_LINEAR\0" - "GL_EYE_PLANE\0" - "GL_EYE_PLANE_ABSOLUTE_NV\0" - "GL_EYE_RADIAL_NV\0" - "GL_FALSE\0" - "GL_FASTEST\0" - "GL_FEEDBACK\0" - "GL_FEEDBACK_BUFFER_POINTER\0" - "GL_FEEDBACK_BUFFER_SIZE\0" - "GL_FEEDBACK_BUFFER_TYPE\0" - "GL_FILL\0" - "GL_FLAT\0" - "GL_FLOAT\0" - "GL_FLOAT_MAT2\0" - "GL_FLOAT_MAT2_ARB\0" - "GL_FLOAT_MAT3\0" - "GL_FLOAT_MAT3_ARB\0" - "GL_FLOAT_MAT4\0" - "GL_FLOAT_MAT4_ARB\0" - "GL_FLOAT_VEC2\0" - "GL_FLOAT_VEC2_ARB\0" - "GL_FLOAT_VEC3\0" - "GL_FLOAT_VEC3_ARB\0" - "GL_FLOAT_VEC4\0" - "GL_FLOAT_VEC4_ARB\0" - "GL_FOG\0" - "GL_FOG_BIT\0" - "GL_FOG_COLOR\0" - "GL_FOG_COORD\0" - "GL_FOG_COORDINATE\0" - "GL_FOG_COORDINATE_ARRAY\0" - "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING\0" - "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB\0" - "GL_FOG_COORDINATE_ARRAY_POINTER\0" - "GL_FOG_COORDINATE_ARRAY_STRIDE\0" - "GL_FOG_COORDINATE_ARRAY_TYPE\0" - "GL_FOG_COORDINATE_SOURCE\0" - "GL_FOG_COORD_ARRAY\0" - "GL_FOG_COORD_ARRAY_BUFFER_BINDING\0" - "GL_FOG_COORD_ARRAY_POINTER\0" - "GL_FOG_COORD_ARRAY_STRIDE\0" - "GL_FOG_COORD_ARRAY_TYPE\0" - "GL_FOG_COORD_SRC\0" - "GL_FOG_DENSITY\0" - "GL_FOG_DISTANCE_MODE_NV\0" - "GL_FOG_END\0" - "GL_FOG_HINT\0" - "GL_FOG_INDEX\0" - "GL_FOG_MODE\0" - "GL_FOG_OFFSET_SGIX\0" - "GL_FOG_OFFSET_VALUE_SGIX\0" - "GL_FOG_START\0" - "GL_FRAGMENT_DEPTH\0" - "GL_FRAGMENT_PROGRAM_ARB\0" - "GL_FRAGMENT_SHADER\0" - "GL_FRAGMENT_SHADER_ARB\0" - "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0" - "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0" - "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0" - "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0" - "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0" - "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" - "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" - "GL_FRAMEBUFFER_BINDING_EXT\0" - "GL_FRAMEBUFFER_COMPLETE_EXT\0" - "GL_FRAMEBUFFER_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0" - "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0" - "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0" - "GL_FRAMEBUFFER_UNSUPPORTED_EXT\0" - "GL_FRONT\0" - "GL_FRONT_AND_BACK\0" - "GL_FRONT_FACE\0" - "GL_FRONT_LEFT\0" - "GL_FRONT_RIGHT\0" - "GL_FUNC_ADD\0" - "GL_FUNC_ADD_EXT\0" - "GL_FUNC_REVERSE_SUBTRACT\0" - "GL_FUNC_REVERSE_SUBTRACT_EXT\0" - "GL_FUNC_SUBTRACT\0" - "GL_FUNC_SUBTRACT_EXT\0" - "GL_GENERATE_MIPMAP\0" - "GL_GENERATE_MIPMAP_HINT\0" - "GL_GENERATE_MIPMAP_HINT_SGIS\0" - "GL_GENERATE_MIPMAP_SGIS\0" - "GL_GEQUAL\0" - "GL_GL_BLEND_EQUATION_RGB\0" - "GL_GL_COMPRESSED_SLUMINANCE\0" - "GL_GL_COMPRESSED_SLUMINANCE_ALPHA\0" - "GL_GL_COMPRESSED_SRGB\0" - "GL_GL_COMPRESSED_SRGB_ALPHA\0" - "GL_GL_CURRENT_RASTER_SECONDARY_COLOR\0" - "GL_GL_FLOAT_MAT2x3\0" - "GL_GL_FLOAT_MAT2x4\0" - "GL_GL_FLOAT_MAT3x2\0" - "GL_GL_FLOAT_MAT3x4\0" - "GL_GL_FLOAT_MAT4x2\0" - "GL_GL_FLOAT_MAT4x3\0" - "GL_GL_PIXEL_PACK_BUFFER\0" - "GL_GL_PIXEL_PACK_BUFFER_BINDING\0" - "GL_GL_PIXEL_UNPACK_BUFFER\0" - "GL_GL_PIXEL_UNPACK_BUFFER_BINDING\0" - "GL_GL_SLUMINANCE\0" - "GL_GL_SLUMINANCE8\0" - "GL_GL_SLUMINANCE8_ALPHA8\0" - "GL_GL_SLUMINANCE_ALPHA\0" - "GL_GL_SRGB\0" - "GL_GL_SRGB8\0" - "GL_GL_SRGB8_ALPHA8\0" - "GL_GL_SRGB_ALPHA\0" - "GL_GREATER\0" - "GL_GREEN\0" - "GL_GREEN_BIAS\0" - "GL_GREEN_BITS\0" - "GL_GREEN_SCALE\0" - "GL_HINT_BIT\0" - "GL_HISTOGRAM\0" - "GL_HISTOGRAM_ALPHA_SIZE\0" - "GL_HISTOGRAM_ALPHA_SIZE_EXT\0" - "GL_HISTOGRAM_BLUE_SIZE\0" - "GL_HISTOGRAM_BLUE_SIZE_EXT\0" - "GL_HISTOGRAM_EXT\0" - "GL_HISTOGRAM_FORMAT\0" - "GL_HISTOGRAM_FORMAT_EXT\0" - "GL_HISTOGRAM_GREEN_SIZE\0" - "GL_HISTOGRAM_GREEN_SIZE_EXT\0" - "GL_HISTOGRAM_LUMINANCE_SIZE\0" - "GL_HISTOGRAM_LUMINANCE_SIZE_EXT\0" - "GL_HISTOGRAM_RED_SIZE\0" - "GL_HISTOGRAM_RED_SIZE_EXT\0" - "GL_HISTOGRAM_SINK\0" - "GL_HISTOGRAM_SINK_EXT\0" - "GL_HISTOGRAM_WIDTH\0" - "GL_HISTOGRAM_WIDTH_EXT\0" - "GL_IDENTITY_NV\0" - "GL_IGNORE_BORDER_HP\0" - "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES\0" - "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES\0" - "GL_INCR\0" - "GL_INCR_WRAP\0" - "GL_INCR_WRAP_EXT\0" - "GL_INDEX_ARRAY\0" - "GL_INDEX_ARRAY_BUFFER_BINDING\0" - "GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0" - "GL_INDEX_ARRAY_POINTER\0" - "GL_INDEX_ARRAY_STRIDE\0" - "GL_INDEX_ARRAY_TYPE\0" - "GL_INDEX_BITS\0" - "GL_INDEX_CLEAR_VALUE\0" - "GL_INDEX_LOGIC_OP\0" - "GL_INDEX_MODE\0" - "GL_INDEX_OFFSET\0" - "GL_INDEX_SHIFT\0" - "GL_INDEX_WRITEMASK\0" - "GL_INFO_LOG_LENGTH\0" - "GL_INT\0" - "GL_INTENSITY\0" - "GL_INTENSITY12\0" - "GL_INTENSITY12_EXT\0" - "GL_INTENSITY16\0" - "GL_INTENSITY16_EXT\0" - "GL_INTENSITY4\0" - "GL_INTENSITY4_EXT\0" - "GL_INTENSITY8\0" - "GL_INTENSITY8_EXT\0" - "GL_INTENSITY_EXT\0" - "GL_INTERPOLATE\0" - "GL_INTERPOLATE_ARB\0" - "GL_INTERPOLATE_EXT\0" - "GL_INT_VEC2\0" - "GL_INT_VEC2_ARB\0" - "GL_INT_VEC3\0" - "GL_INT_VEC3_ARB\0" - "GL_INT_VEC4\0" - "GL_INT_VEC4_ARB\0" - "GL_INVALID_ENUM\0" - "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0" - "GL_INVALID_OPERATION\0" - "GL_INVALID_VALUE\0" - "GL_INVERSE_NV\0" - "GL_INVERSE_TRANSPOSE_NV\0" - "GL_INVERT\0" - "GL_KEEP\0" - "GL_LEFT\0" - "GL_LEQUAL\0" - "GL_LESS\0" - "GL_LIGHT0\0" - "GL_LIGHT1\0" - "GL_LIGHT2\0" - "GL_LIGHT3\0" - "GL_LIGHT4\0" - "GL_LIGHT5\0" - "GL_LIGHT6\0" - "GL_LIGHT7\0" - "GL_LIGHTING\0" - "GL_LIGHTING_BIT\0" - "GL_LIGHT_MODEL_AMBIENT\0" - "GL_LIGHT_MODEL_COLOR_CONTROL\0" - "GL_LIGHT_MODEL_COLOR_CONTROL_EXT\0" - "GL_LIGHT_MODEL_LOCAL_VIEWER\0" - "GL_LIGHT_MODEL_TWO_SIDE\0" - "GL_LINE\0" - "GL_LINEAR\0" - "GL_LINEAR_ATTENUATION\0" - "GL_LINEAR_CLIPMAP_LINEAR_SGIX\0" - "GL_LINEAR_CLIPMAP_NEAREST_SGIX\0" - "GL_LINEAR_MIPMAP_LINEAR\0" - "GL_LINEAR_MIPMAP_NEAREST\0" - "GL_LINES\0" - "GL_LINE_BIT\0" - "GL_LINE_LOOP\0" - "GL_LINE_RESET_TOKEN\0" - "GL_LINE_SMOOTH\0" - "GL_LINE_SMOOTH_HINT\0" - "GL_LINE_STIPPLE\0" - "GL_LINE_STIPPLE_PATTERN\0" - "GL_LINE_STIPPLE_REPEAT\0" - "GL_LINE_STRIP\0" - "GL_LINE_TOKEN\0" - "GL_LINE_WIDTH\0" - "GL_LINE_WIDTH_GRANULARITY\0" - "GL_LINE_WIDTH_RANGE\0" - "GL_LINK_STATUS\0" - "GL_LIST_BASE\0" - "GL_LIST_BIT\0" - "GL_LIST_INDEX\0" - "GL_LIST_MODE\0" - "GL_LOAD\0" - "GL_LOGIC_OP\0" - "GL_LOGIC_OP_MODE\0" - "GL_LOWER_LEFT\0" - "GL_LUMINANCE\0" - "GL_LUMINANCE12\0" - "GL_LUMINANCE12_ALPHA12\0" - "GL_LUMINANCE12_ALPHA12_EXT\0" - "GL_LUMINANCE12_ALPHA4\0" - "GL_LUMINANCE12_ALPHA4_EXT\0" - "GL_LUMINANCE12_EXT\0" - "GL_LUMINANCE16\0" - "GL_LUMINANCE16_ALPHA16\0" - "GL_LUMINANCE16_ALPHA16_EXT\0" - "GL_LUMINANCE16_EXT\0" - "GL_LUMINANCE4\0" - "GL_LUMINANCE4_ALPHA4\0" - "GL_LUMINANCE4_ALPHA4_EXT\0" - "GL_LUMINANCE4_EXT\0" - "GL_LUMINANCE6_ALPHA2\0" - "GL_LUMINANCE6_ALPHA2_EXT\0" - "GL_LUMINANCE8\0" - "GL_LUMINANCE8_ALPHA8\0" - "GL_LUMINANCE8_ALPHA8_EXT\0" - "GL_LUMINANCE8_EXT\0" - "GL_LUMINANCE_ALPHA\0" - "GL_MAP1_COLOR_4\0" - "GL_MAP1_GRID_DOMAIN\0" - "GL_MAP1_GRID_SEGMENTS\0" - "GL_MAP1_INDEX\0" - "GL_MAP1_NORMAL\0" - "GL_MAP1_TEXTURE_COORD_1\0" - "GL_MAP1_TEXTURE_COORD_2\0" - "GL_MAP1_TEXTURE_COORD_3\0" - "GL_MAP1_TEXTURE_COORD_4\0" - "GL_MAP1_VERTEX_3\0" - "GL_MAP1_VERTEX_4\0" - "GL_MAP1_VERTEX_ATTRIB0_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB10_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB11_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB12_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB13_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB14_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB15_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB1_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB2_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB3_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB4_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB5_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB6_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB7_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB8_4_NV\0" - "GL_MAP1_VERTEX_ATTRIB9_4_NV\0" - "GL_MAP2_COLOR_4\0" - "GL_MAP2_GRID_DOMAIN\0" - "GL_MAP2_GRID_SEGMENTS\0" - "GL_MAP2_INDEX\0" - "GL_MAP2_NORMAL\0" - "GL_MAP2_TEXTURE_COORD_1\0" - "GL_MAP2_TEXTURE_COORD_2\0" - "GL_MAP2_TEXTURE_COORD_3\0" - "GL_MAP2_TEXTURE_COORD_4\0" - "GL_MAP2_VERTEX_3\0" - "GL_MAP2_VERTEX_4\0" - "GL_MAP2_VERTEX_ATTRIB0_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB10_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB11_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB12_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB13_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB14_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB15_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB1_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB2_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB3_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB4_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB5_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB6_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB7_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB8_4_NV\0" - "GL_MAP2_VERTEX_ATTRIB9_4_NV\0" - "GL_MAP_COLOR\0" - "GL_MAP_STENCIL\0" - "GL_MATRIX0_ARB\0" - "GL_MATRIX0_NV\0" - "GL_MATRIX10_ARB\0" - "GL_MATRIX11_ARB\0" - "GL_MATRIX12_ARB\0" - "GL_MATRIX13_ARB\0" - "GL_MATRIX14_ARB\0" - "GL_MATRIX15_ARB\0" - "GL_MATRIX16_ARB\0" - "GL_MATRIX17_ARB\0" - "GL_MATRIX18_ARB\0" - "GL_MATRIX19_ARB\0" - "GL_MATRIX1_ARB\0" - "GL_MATRIX1_NV\0" - "GL_MATRIX20_ARB\0" - "GL_MATRIX21_ARB\0" - "GL_MATRIX22_ARB\0" - "GL_MATRIX23_ARB\0" - "GL_MATRIX24_ARB\0" - "GL_MATRIX25_ARB\0" - "GL_MATRIX26_ARB\0" - "GL_MATRIX27_ARB\0" - "GL_MATRIX28_ARB\0" - "GL_MATRIX29_ARB\0" - "GL_MATRIX2_ARB\0" - "GL_MATRIX2_NV\0" - "GL_MATRIX30_ARB\0" - "GL_MATRIX31_ARB\0" - "GL_MATRIX3_ARB\0" - "GL_MATRIX3_NV\0" - "GL_MATRIX4_ARB\0" - "GL_MATRIX4_NV\0" - "GL_MATRIX5_ARB\0" - "GL_MATRIX5_NV\0" - "GL_MATRIX6_ARB\0" - "GL_MATRIX6_NV\0" - "GL_MATRIX7_ARB\0" - "GL_MATRIX7_NV\0" - "GL_MATRIX8_ARB\0" - "GL_MATRIX9_ARB\0" - "GL_MATRIX_INDEX_ARRAY_ARB\0" - "GL_MATRIX_INDEX_ARRAY_POINTER_ARB\0" - "GL_MATRIX_INDEX_ARRAY_SIZE_ARB\0" - "GL_MATRIX_INDEX_ARRAY_STRIDE_ARB\0" - "GL_MATRIX_INDEX_ARRAY_TYPE_ARB\0" - "GL_MATRIX_MODE\0" - "GL_MATRIX_PALETTE_ARB\0" - "GL_MAX\0" - "GL_MAX_3D_TEXTURE_SIZE\0" - "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT\0" - "GL_MAX_ATTRIB_STACK_DEPTH\0" - "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\0" - "GL_MAX_CLIPMAP_DEPTH_SGIX\0" - "GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX\0" - "GL_MAX_CLIP_PLANES\0" - "GL_MAX_COLOR_ATTACHMENTS_EXT\0" - "GL_MAX_COLOR_MATRIX_STACK_DEPTH\0" - "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0" - "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0" - "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0" - "GL_MAX_CONVOLUTION_HEIGHT\0" - "GL_MAX_CONVOLUTION_HEIGHT_EXT\0" - "GL_MAX_CONVOLUTION_WIDTH\0" - "GL_MAX_CONVOLUTION_WIDTH_EXT\0" - "GL_MAX_CUBE_MAP_TEXTURE_SIZE\0" - "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0" - "GL_MAX_DRAW_BUFFERS\0" - "GL_MAX_DRAW_BUFFERS_ARB\0" - "GL_MAX_DRAW_BUFFERS_ATI\0" - "GL_MAX_ELEMENTS_INDICES\0" - "GL_MAX_ELEMENTS_VERTICES\0" - "GL_MAX_EVAL_ORDER\0" - "GL_MAX_EXT\0" - "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0" - "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0" - "GL_MAX_LIGHTS\0" - "GL_MAX_LIST_NESTING\0" - "GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB\0" - "GL_MAX_MODELVIEW_STACK_DEPTH\0" - "GL_MAX_NAME_STACK_DEPTH\0" - "GL_MAX_PALETTE_MATRICES_ARB\0" - "GL_MAX_PIXEL_MAP_TABLE\0" - "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB\0" - "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB\0" - "GL_MAX_PROGRAM_ATTRIBS_ARB\0" - "GL_MAX_PROGRAM_CALL_DEPTH_NV\0" - "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB\0" - "GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV\0" - "GL_MAX_PROGRAM_IF_DEPTH_NV\0" - "GL_MAX_PROGRAM_INSTRUCTIONS_ARB\0" - "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB\0" - "GL_MAX_PROGRAM_LOOP_COUNT_NV\0" - "GL_MAX_PROGRAM_LOOP_DEPTH_NV\0" - "GL_MAX_PROGRAM_MATRICES_ARB\0" - "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB\0" - "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB\0" - "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0" - "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0" - "GL_MAX_PROGRAM_PARAMETERS_ARB\0" - "GL_MAX_PROGRAM_TEMPORARIES_ARB\0" - "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB\0" - "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB\0" - "GL_MAX_PROJECTION_STACK_DEPTH\0" - "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0" - "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0" - "GL_MAX_RENDERBUFFER_SIZE_EXT\0" - "GL_MAX_SHININESS_NV\0" - "GL_MAX_SPOT_EXPONENT_NV\0" - "GL_MAX_TEXTURE_COORDS\0" - "GL_MAX_TEXTURE_COORDS_ARB\0" - "GL_MAX_TEXTURE_IMAGE_UNITS\0" - "GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0" - "GL_MAX_TEXTURE_LOD_BIAS\0" - "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0" - "GL_MAX_TEXTURE_SIZE\0" - "GL_MAX_TEXTURE_STACK_DEPTH\0" - "GL_MAX_TEXTURE_UNITS\0" - "GL_MAX_TEXTURE_UNITS_ARB\0" - "GL_MAX_TRACK_MATRICES_NV\0" - "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0" - "GL_MAX_VARYING_FLOATS\0" - "GL_MAX_VARYING_FLOATS_ARB\0" - "GL_MAX_VERTEX_ATTRIBS\0" - "GL_MAX_VERTEX_ATTRIBS_ARB\0" - "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0" - "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0" - "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0" - "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0" - "GL_MAX_VERTEX_UNITS_ARB\0" - "GL_MAX_VIEWPORT_DIMS\0" - "GL_MIN\0" - "GL_MINMAX\0" - "GL_MINMAX_EXT\0" - "GL_MINMAX_FORMAT\0" - "GL_MINMAX_FORMAT_EXT\0" - "GL_MINMAX_SINK\0" - "GL_MINMAX_SINK_EXT\0" - "GL_MIN_EXT\0" - "GL_MIRRORED_REPEAT\0" - "GL_MIRRORED_REPEAT_ARB\0" - "GL_MIRRORED_REPEAT_IBM\0" - "GL_MIRROR_CLAMP_ATI\0" - "GL_MIRROR_CLAMP_EXT\0" - "GL_MIRROR_CLAMP_TO_BORDER_EXT\0" - "GL_MIRROR_CLAMP_TO_EDGE_ATI\0" - "GL_MIRROR_CLAMP_TO_EDGE_EXT\0" - "GL_MODELVIEW\0" - "GL_MODELVIEW0_ARB\0" - "GL_MODELVIEW10_ARB\0" - "GL_MODELVIEW11_ARB\0" - "GL_MODELVIEW12_ARB\0" - "GL_MODELVIEW13_ARB\0" - "GL_MODELVIEW14_ARB\0" - "GL_MODELVIEW15_ARB\0" - "GL_MODELVIEW16_ARB\0" - "GL_MODELVIEW17_ARB\0" - "GL_MODELVIEW18_ARB\0" - "GL_MODELVIEW19_ARB\0" - "GL_MODELVIEW1_ARB\0" - "GL_MODELVIEW20_ARB\0" - "GL_MODELVIEW21_ARB\0" - "GL_MODELVIEW22_ARB\0" - "GL_MODELVIEW23_ARB\0" - "GL_MODELVIEW24_ARB\0" - "GL_MODELVIEW25_ARB\0" - "GL_MODELVIEW26_ARB\0" - "GL_MODELVIEW27_ARB\0" - "GL_MODELVIEW28_ARB\0" - "GL_MODELVIEW29_ARB\0" - "GL_MODELVIEW2_ARB\0" - "GL_MODELVIEW30_ARB\0" - "GL_MODELVIEW31_ARB\0" - "GL_MODELVIEW3_ARB\0" - "GL_MODELVIEW4_ARB\0" - "GL_MODELVIEW5_ARB\0" - "GL_MODELVIEW6_ARB\0" - "GL_MODELVIEW7_ARB\0" - "GL_MODELVIEW8_ARB\0" - "GL_MODELVIEW9_ARB\0" - "GL_MODELVIEW_MATRIX\0" - "GL_MODELVIEW_PROJECTION_NV\0" - "GL_MODELVIEW_STACK_DEPTH\0" - "GL_MODULATE\0" - "GL_MODULATE_ADD_ATI\0" - "GL_MODULATE_SIGNED_ADD_ATI\0" - "GL_MODULATE_SUBTRACT_ATI\0" - "GL_MULT\0" - "GL_MULTISAMPLE\0" - "GL_MULTISAMPLE_3DFX\0" - "GL_MULTISAMPLE_ARB\0" - "GL_MULTISAMPLE_BIT\0" - "GL_MULTISAMPLE_BIT_3DFX\0" - "GL_MULTISAMPLE_BIT_ARB\0" - "GL_MULTISAMPLE_FILTER_HINT_NV\0" - "GL_N3F_V3F\0" - "GL_NAME_STACK_DEPTH\0" - "GL_NAND\0" - "GL_NEAREST\0" - "GL_NEAREST_CLIPMAP_LINEAR_SGIX\0" - "GL_NEAREST_CLIPMAP_NEAREST_SGIX\0" - "GL_NEAREST_MIPMAP_LINEAR\0" - "GL_NEAREST_MIPMAP_NEAREST\0" - "GL_NEVER\0" - "GL_NICEST\0" - "GL_NONE\0" - "GL_NOOP\0" - "GL_NOR\0" - "GL_NORMALIZE\0" - "GL_NORMAL_ARRAY\0" - "GL_NORMAL_ARRAY_BUFFER_BINDING\0" - "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB\0" - "GL_NORMAL_ARRAY_POINTER\0" - "GL_NORMAL_ARRAY_STRIDE\0" - "GL_NORMAL_ARRAY_TYPE\0" - "GL_NORMAL_MAP\0" - "GL_NORMAL_MAP_ARB\0" - "GL_NORMAL_MAP_NV\0" - "GL_NOTEQUAL\0" - "GL_NO_ERROR\0" - "GL_NUM_COMPRESSED_TEXTURE_FORMATS\0" - "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\0" - "GL_OBJECT_ACTIVE_ATTRIBUTES_ARB\0" - "GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB\0" - "GL_OBJECT_ACTIVE_UNIFORMS_ARB\0" - "GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB\0" - "GL_OBJECT_ATTACHED_OBJECTS_ARB\0" - "GL_OBJECT_COMPILE_STATUS_ARB\0" - "GL_OBJECT_DELETE_STATUS_ARB\0" - "GL_OBJECT_INFO_LOG_LENGTH_ARB\0" - "GL_OBJECT_LINEAR\0" - "GL_OBJECT_LINK_STATUS_ARB\0" - "GL_OBJECT_PLANE\0" - "GL_OBJECT_SHADER_SOURCE_LENGTH_ARB\0" - "GL_OBJECT_SUBTYPE_ARB\0" - "GL_OBJECT_TYPE_ARB\0" - "GL_OBJECT_VALIDATE_STATUS_ARB\0" - "GL_OCCLUSION_TEST_HP\0" - "GL_OCCLUSION_TEST_RESULT_HP\0" - "GL_ONE\0" - "GL_ONE_MINUS_CONSTANT_ALPHA\0" - "GL_ONE_MINUS_CONSTANT_ALPHA_EXT\0" - "GL_ONE_MINUS_CONSTANT_COLOR\0" - "GL_ONE_MINUS_CONSTANT_COLOR_EXT\0" - "GL_ONE_MINUS_DST_ALPHA\0" - "GL_ONE_MINUS_DST_COLOR\0" - "GL_ONE_MINUS_SRC_ALPHA\0" - "GL_ONE_MINUS_SRC_COLOR\0" - "GL_OPERAND0_ALPHA\0" - "GL_OPERAND0_ALPHA_ARB\0" - "GL_OPERAND0_ALPHA_EXT\0" - "GL_OPERAND0_RGB\0" - "GL_OPERAND0_RGB_ARB\0" - "GL_OPERAND0_RGB_EXT\0" - "GL_OPERAND1_ALPHA\0" - "GL_OPERAND1_ALPHA_ARB\0" - "GL_OPERAND1_ALPHA_EXT\0" - "GL_OPERAND1_RGB\0" - "GL_OPERAND1_RGB_ARB\0" - "GL_OPERAND1_RGB_EXT\0" - "GL_OPERAND2_ALPHA\0" - "GL_OPERAND2_ALPHA_ARB\0" - "GL_OPERAND2_ALPHA_EXT\0" - "GL_OPERAND2_RGB\0" - "GL_OPERAND2_RGB_ARB\0" - "GL_OPERAND2_RGB_EXT\0" - "GL_OPERAND3_ALPHA_NV\0" - "GL_OPERAND3_RGB_NV\0" - "GL_OR\0" - "GL_ORDER\0" - "GL_OR_INVERTED\0" - "GL_OR_REVERSE\0" - "GL_OUT_OF_MEMORY\0" - "GL_PACK_ALIGNMENT\0" - "GL_PACK_IMAGE_HEIGHT\0" - "GL_PACK_INVERT_MESA\0" - "GL_PACK_LSB_FIRST\0" - "GL_PACK_ROW_LENGTH\0" - "GL_PACK_SKIP_IMAGES\0" - "GL_PACK_SKIP_PIXELS\0" - "GL_PACK_SKIP_ROWS\0" - "GL_PACK_SWAP_BYTES\0" - "GL_PALETTE4_R5_G6_B5_OES\0" - "GL_PALETTE4_RGB5_A1_OES\0" - "GL_PALETTE4_RGB8_OES\0" - "GL_PALETTE4_RGBA4_OES\0" - "GL_PALETTE4_RGBA8_OES\0" - "GL_PALETTE8_R5_G6_B5_OES\0" - "GL_PALETTE8_RGB5_A1_OES\0" - "GL_PALETTE8_RGB8_OES\0" - "GL_PALETTE8_RGBA4_OES\0" - "GL_PALETTE8_RGBA8_OES\0" - "GL_PASS_THROUGH_TOKEN\0" - "GL_PERSPECTIVE_CORRECTION_HINT\0" - "GL_PIXEL_MAP_A_TO_A\0" - "GL_PIXEL_MAP_A_TO_A_SIZE\0" - "GL_PIXEL_MAP_B_TO_B\0" - "GL_PIXEL_MAP_B_TO_B_SIZE\0" - "GL_PIXEL_MAP_G_TO_G\0" - "GL_PIXEL_MAP_G_TO_G_SIZE\0" - "GL_PIXEL_MAP_I_TO_A\0" - "GL_PIXEL_MAP_I_TO_A_SIZE\0" - "GL_PIXEL_MAP_I_TO_B\0" - "GL_PIXEL_MAP_I_TO_B_SIZE\0" - "GL_PIXEL_MAP_I_TO_G\0" - "GL_PIXEL_MAP_I_TO_G_SIZE\0" - "GL_PIXEL_MAP_I_TO_I\0" - "GL_PIXEL_MAP_I_TO_I_SIZE\0" - "GL_PIXEL_MAP_I_TO_R\0" - "GL_PIXEL_MAP_I_TO_R_SIZE\0" - "GL_PIXEL_MAP_R_TO_R\0" - "GL_PIXEL_MAP_R_TO_R_SIZE\0" - "GL_PIXEL_MAP_S_TO_S\0" - "GL_PIXEL_MAP_S_TO_S_SIZE\0" - "GL_PIXEL_MODE_BIT\0" - "GL_PIXEL_PACK_BUFFER_BINDING_EXT\0" - "GL_PIXEL_PACK_BUFFER_EXT\0" - "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT\0" - "GL_PIXEL_UNPACK_BUFFER_EXT\0" - "GL_POINT\0" - "GL_POINTS\0" - "GL_POINT_BIT\0" - "GL_POINT_DISTANCE_ATTENUATION\0" - "GL_POINT_DISTANCE_ATTENUATION_ARB\0" - "GL_POINT_DISTANCE_ATTENUATION_EXT\0" - "GL_POINT_DISTANCE_ATTENUATION_SGIS\0" - "GL_POINT_FADE_THRESHOLD_SIZE\0" - "GL_POINT_FADE_THRESHOLD_SIZE_ARB\0" - "GL_POINT_FADE_THRESHOLD_SIZE_EXT\0" - "GL_POINT_FADE_THRESHOLD_SIZE_SGIS\0" - "GL_POINT_SIZE\0" - "GL_POINT_SIZE_GRANULARITY\0" - "GL_POINT_SIZE_MAX\0" - "GL_POINT_SIZE_MAX_ARB\0" - "GL_POINT_SIZE_MAX_EXT\0" - "GL_POINT_SIZE_MAX_SGIS\0" - "GL_POINT_SIZE_MIN\0" - "GL_POINT_SIZE_MIN_ARB\0" - "GL_POINT_SIZE_MIN_EXT\0" - "GL_POINT_SIZE_MIN_SGIS\0" - "GL_POINT_SIZE_RANGE\0" - "GL_POINT_SMOOTH\0" - "GL_POINT_SMOOTH_HINT\0" - "GL_POINT_SPRITE\0" - "GL_POINT_SPRITE_ARB\0" - "GL_POINT_SPRITE_COORD_ORIGIN\0" - "GL_POINT_SPRITE_NV\0" - "GL_POINT_SPRITE_R_MODE_NV\0" - "GL_POINT_TOKEN\0" - "GL_POLYGON\0" - "GL_POLYGON_BIT\0" - "GL_POLYGON_MODE\0" - "GL_POLYGON_OFFSET_BIAS\0" - "GL_POLYGON_OFFSET_FACTOR\0" - "GL_POLYGON_OFFSET_FILL\0" - "GL_POLYGON_OFFSET_LINE\0" - "GL_POLYGON_OFFSET_POINT\0" - "GL_POLYGON_OFFSET_UNITS\0" - "GL_POLYGON_SMOOTH\0" - "GL_POLYGON_SMOOTH_HINT\0" - "GL_POLYGON_STIPPLE\0" - "GL_POLYGON_STIPPLE_BIT\0" - "GL_POLYGON_TOKEN\0" - "GL_POSITION\0" - "GL_POST_COLOR_MATRIX_ALPHA_BIAS\0" - "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI\0" - "GL_POST_COLOR_MATRIX_ALPHA_SCALE\0" - "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI\0" - "GL_POST_COLOR_MATRIX_BLUE_BIAS\0" - "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI\0" - "GL_POST_COLOR_MATRIX_BLUE_SCALE\0" - "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI\0" - "GL_POST_COLOR_MATRIX_COLOR_TABLE\0" - "GL_POST_COLOR_MATRIX_GREEN_BIAS\0" - "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI\0" - "GL_POST_COLOR_MATRIX_GREEN_SCALE\0" - "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI\0" - "GL_POST_COLOR_MATRIX_RED_BIAS\0" - "GL_POST_COLOR_MATRIX_RED_BIAS_SGI\0" - "GL_POST_COLOR_MATRIX_RED_SCALE\0" - "GL_POST_COLOR_MATRIX_RED_SCALE_SGI\0" - "GL_POST_CONVOLUTION_ALPHA_BIAS\0" - "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT\0" - "GL_POST_CONVOLUTION_ALPHA_SCALE\0" - "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT\0" - "GL_POST_CONVOLUTION_BLUE_BIAS\0" - "GL_POST_CONVOLUTION_BLUE_BIAS_EXT\0" - "GL_POST_CONVOLUTION_BLUE_SCALE\0" - "GL_POST_CONVOLUTION_BLUE_SCALE_EXT\0" - "GL_POST_CONVOLUTION_COLOR_TABLE\0" - "GL_POST_CONVOLUTION_GREEN_BIAS\0" - "GL_POST_CONVOLUTION_GREEN_BIAS_EXT\0" - "GL_POST_CONVOLUTION_GREEN_SCALE\0" - "GL_POST_CONVOLUTION_GREEN_SCALE_EXT\0" - "GL_POST_CONVOLUTION_RED_BIAS\0" - "GL_POST_CONVOLUTION_RED_BIAS_EXT\0" - "GL_POST_CONVOLUTION_RED_SCALE\0" - "GL_POST_CONVOLUTION_RED_SCALE_EXT\0" - "GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX\0" - "GL_POST_TEXTURE_FILTER_BIAS_SGIX\0" - "GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX\0" - "GL_POST_TEXTURE_FILTER_SCALE_SGIX\0" - "GL_PREVIOUS\0" - "GL_PREVIOUS_ARB\0" - "GL_PREVIOUS_EXT\0" - "GL_PRIMARY_COLOR\0" - "GL_PRIMARY_COLOR_ARB\0" - "GL_PRIMARY_COLOR_EXT\0" - "GL_PROGRAM_ADDRESS_REGISTERS_ARB\0" - "GL_PROGRAM_ALU_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_ATTRIBS_ARB\0" - "GL_PROGRAM_BINDING_ARB\0" - "GL_PROGRAM_ERROR_POSITION_ARB\0" - "GL_PROGRAM_ERROR_POSITION_NV\0" - "GL_PROGRAM_ERROR_STRING_ARB\0" - "GL_PROGRAM_FORMAT_ARB\0" - "GL_PROGRAM_FORMAT_ASCII_ARB\0" - "GL_PROGRAM_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_LENGTH_ARB\0" - "GL_PROGRAM_LENGTH_NV\0" - "GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0" - "GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_NATIVE_ATTRIBS_ARB\0" - "GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_NATIVE_PARAMETERS_ARB\0" - "GL_PROGRAM_NATIVE_TEMPORARIES_ARB\0" - "GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0" - "GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_OBJECT_ARB\0" - "GL_PROGRAM_PARAMETERS_ARB\0" - "GL_PROGRAM_PARAMETER_NV\0" - "GL_PROGRAM_RESIDENT_NV\0" - "GL_PROGRAM_STRING_ARB\0" - "GL_PROGRAM_STRING_NV\0" - "GL_PROGRAM_TARGET_NV\0" - "GL_PROGRAM_TEMPORARIES_ARB\0" - "GL_PROGRAM_TEX_INDIRECTIONS_ARB\0" - "GL_PROGRAM_TEX_INSTRUCTIONS_ARB\0" - "GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB\0" - "GL_PROJECTION\0" - "GL_PROJECTION_MATRIX\0" - "GL_PROJECTION_STACK_DEPTH\0" - "GL_PROXY_COLOR_TABLE\0" - "GL_PROXY_HISTOGRAM\0" - "GL_PROXY_HISTOGRAM_EXT\0" - "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE\0" - "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE\0" - "GL_PROXY_TEXTURE_1D\0" - "GL_PROXY_TEXTURE_1D_ARRAY_EXT\0" - "GL_PROXY_TEXTURE_1D_EXT\0" - "GL_PROXY_TEXTURE_2D\0" - "GL_PROXY_TEXTURE_2D_ARRAY_EXT\0" - "GL_PROXY_TEXTURE_2D_EXT\0" - "GL_PROXY_TEXTURE_3D\0" - "GL_PROXY_TEXTURE_COLOR_TABLE_SGI\0" - "GL_PROXY_TEXTURE_CUBE_MAP\0" - "GL_PROXY_TEXTURE_CUBE_MAP_ARB\0" - "GL_PROXY_TEXTURE_RECTANGLE_ARB\0" - "GL_PROXY_TEXTURE_RECTANGLE_NV\0" - "GL_Q\0" - "GL_QUADRATIC_ATTENUATION\0" - "GL_QUADS\0" - "GL_QUAD_MESH_SUN\0" - "GL_QUAD_STRIP\0" - "GL_QUERY_COUNTER_BITS\0" - "GL_QUERY_COUNTER_BITS_ARB\0" - "GL_QUERY_RESULT\0" - "GL_QUERY_RESULT_ARB\0" - "GL_QUERY_RESULT_AVAILABLE\0" - "GL_QUERY_RESULT_AVAILABLE_ARB\0" - "GL_R\0" - "GL_R3_G3_B2\0" - "GL_RASTER_POSITION_UNCLIPPED_IBM\0" - "GL_READ_BUFFER\0" - "GL_READ_FRAMEBUFFER_BINDING_EXT\0" - "GL_READ_FRAMEBUFFER_EXT\0" - "GL_READ_ONLY\0" - "GL_READ_ONLY_ARB\0" - "GL_READ_WRITE\0" - "GL_READ_WRITE_ARB\0" - "GL_RED\0" - "GL_REDUCE\0" - "GL_REDUCE_EXT\0" - "GL_RED_BIAS\0" - "GL_RED_BITS\0" - "GL_RED_SCALE\0" - "GL_REFLECTION_MAP\0" - "GL_REFLECTION_MAP_ARB\0" - "GL_REFLECTION_MAP_NV\0" - "GL_RENDER\0" - "GL_RENDERBUFFER_BINDING_EXT\0" - "GL_RENDERBUFFER_EXT\0" - "GL_RENDERBUFFER_HEIGHT_EXT\0" - "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0" - "GL_RENDERBUFFER_WIDTH_EXT\0" - "GL_RENDERER\0" - "GL_RENDER_MODE\0" - "GL_REPEAT\0" - "GL_REPLACE\0" - "GL_REPLACE_EXT\0" - "GL_REPLICATE_BORDER_HP\0" - "GL_RESCALE_NORMAL\0" - "GL_RESCALE_NORMAL_EXT\0" - "GL_RETURN\0" - "GL_RGB\0" - "GL_RGB10\0" - "GL_RGB10_A2\0" - "GL_RGB10_A2_EXT\0" - "GL_RGB10_EXT\0" - "GL_RGB12\0" - "GL_RGB12_EXT\0" - "GL_RGB16\0" - "GL_RGB16_EXT\0" - "GL_RGB2_EXT\0" - "GL_RGB4\0" - "GL_RGB4_EXT\0" - "GL_RGB4_S3TC\0" - "GL_RGB5\0" - "GL_RGB5_A1\0" - "GL_RGB5_A1_EXT\0" - "GL_RGB5_EXT\0" - "GL_RGB8\0" - "GL_RGB8_EXT\0" - "GL_RGBA\0" - "GL_RGBA12\0" - "GL_RGBA12_EXT\0" - "GL_RGBA16\0" - "GL_RGBA16_EXT\0" - "GL_RGBA2\0" - "GL_RGBA2_EXT\0" - "GL_RGBA4\0" - "GL_RGBA4_DXT5_S3TC\0" - "GL_RGBA4_EXT\0" - "GL_RGBA4_S3TC\0" - "GL_RGBA8\0" - "GL_RGBA8_EXT\0" - "GL_RGBA_DXT5_S3TC\0" - "GL_RGBA_MODE\0" - "GL_RGBA_S3TC\0" - "GL_RGB_S3TC\0" - "GL_RGB_SCALE\0" - "GL_RGB_SCALE_ARB\0" - "GL_RGB_SCALE_EXT\0" - "GL_RIGHT\0" - "GL_S\0" - "GL_SAMPLER_1D\0" - "GL_SAMPLER_1D_SHADOW\0" - "GL_SAMPLER_2D\0" - "GL_SAMPLER_2D_SHADOW\0" - "GL_SAMPLER_3D\0" - "GL_SAMPLER_CUBE\0" - "GL_SAMPLES\0" - "GL_SAMPLES_3DFX\0" - "GL_SAMPLES_ARB\0" - "GL_SAMPLES_PASSED\0" - "GL_SAMPLES_PASSED_ARB\0" - "GL_SAMPLE_ALPHA_TO_COVERAGE\0" - "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB\0" - "GL_SAMPLE_ALPHA_TO_ONE\0" - "GL_SAMPLE_ALPHA_TO_ONE_ARB\0" - "GL_SAMPLE_BUFFERS\0" - "GL_SAMPLE_BUFFERS_3DFX\0" - "GL_SAMPLE_BUFFERS_ARB\0" - "GL_SAMPLE_COVERAGE\0" - "GL_SAMPLE_COVERAGE_ARB\0" - "GL_SAMPLE_COVERAGE_INVERT\0" - "GL_SAMPLE_COVERAGE_INVERT_ARB\0" - "GL_SAMPLE_COVERAGE_VALUE\0" - "GL_SAMPLE_COVERAGE_VALUE_ARB\0" - "GL_SCISSOR_BIT\0" - "GL_SCISSOR_BOX\0" - "GL_SCISSOR_TEST\0" - "GL_SECONDARY_COLOR_ARRAY\0" - "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING\0" - "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB\0" - "GL_SECONDARY_COLOR_ARRAY_POINTER\0" - "GL_SECONDARY_COLOR_ARRAY_SIZE\0" - "GL_SECONDARY_COLOR_ARRAY_STRIDE\0" - "GL_SECONDARY_COLOR_ARRAY_TYPE\0" - "GL_SELECT\0" - "GL_SELECTION_BUFFER_POINTER\0" - "GL_SELECTION_BUFFER_SIZE\0" - "GL_SEPARABLE_2D\0" - "GL_SEPARATE_SPECULAR_COLOR\0" - "GL_SEPARATE_SPECULAR_COLOR_EXT\0" - "GL_SET\0" - "GL_SHADER_OBJECT_ARB\0" - "GL_SHADER_SOURCE_LENGTH\0" - "GL_SHADER_TYPE\0" - "GL_SHADE_MODEL\0" - "GL_SHADING_LANGUAGE_VERSION\0" - "GL_SHADOW_AMBIENT_SGIX\0" - "GL_SHARED_TEXTURE_PALETTE_EXT\0" - "GL_SHININESS\0" - "GL_SHORT\0" - "GL_SINGLE_COLOR\0" - "GL_SINGLE_COLOR_EXT\0" - "GL_SLICE_ACCUM_SUN\0" - "GL_SMOOTH\0" - "GL_SMOOTH_LINE_WIDTH_GRANULARITY\0" - "GL_SMOOTH_LINE_WIDTH_RANGE\0" - "GL_SMOOTH_POINT_SIZE_GRANULARITY\0" - "GL_SMOOTH_POINT_SIZE_RANGE\0" - "GL_SOURCE0_ALPHA\0" - "GL_SOURCE0_ALPHA_ARB\0" - "GL_SOURCE0_ALPHA_EXT\0" - "GL_SOURCE0_RGB\0" - "GL_SOURCE0_RGB_ARB\0" - "GL_SOURCE0_RGB_EXT\0" - "GL_SOURCE1_ALPHA\0" - "GL_SOURCE1_ALPHA_ARB\0" - "GL_SOURCE1_ALPHA_EXT\0" - "GL_SOURCE1_RGB\0" - "GL_SOURCE1_RGB_ARB\0" - "GL_SOURCE1_RGB_EXT\0" - "GL_SOURCE2_ALPHA\0" - "GL_SOURCE2_ALPHA_ARB\0" - "GL_SOURCE2_ALPHA_EXT\0" - "GL_SOURCE2_RGB\0" - "GL_SOURCE2_RGB_ARB\0" - "GL_SOURCE2_RGB_EXT\0" - "GL_SOURCE3_ALPHA_NV\0" - "GL_SOURCE3_RGB_NV\0" - "GL_SPECULAR\0" - "GL_SPHERE_MAP\0" - "GL_SPOT_CUTOFF\0" - "GL_SPOT_DIRECTION\0" - "GL_SPOT_EXPONENT\0" - "GL_SRC0_ALPHA\0" - "GL_SRC0_RGB\0" - "GL_SRC1_ALPHA\0" - "GL_SRC1_RGB\0" - "GL_SRC2_ALPHA\0" - "GL_SRC2_RGB\0" - "GL_SRC_ALPHA\0" - "GL_SRC_ALPHA_SATURATE\0" - "GL_SRC_COLOR\0" - "GL_STACK_OVERFLOW\0" - "GL_STACK_UNDERFLOW\0" - "GL_STATIC_COPY\0" - "GL_STATIC_COPY_ARB\0" - "GL_STATIC_DRAW\0" - "GL_STATIC_DRAW_ARB\0" - "GL_STATIC_READ\0" - "GL_STATIC_READ_ARB\0" - "GL_STENCIL\0" - "GL_STENCIL_ATTACHMENT_EXT\0" - "GL_STENCIL_BACK_FAIL\0" - "GL_STENCIL_BACK_FAIL_ATI\0" - "GL_STENCIL_BACK_FUNC\0" - "GL_STENCIL_BACK_FUNC_ATI\0" - "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0" - "GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI\0" - "GL_STENCIL_BACK_PASS_DEPTH_PASS\0" - "GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI\0" - "GL_STENCIL_BACK_REF\0" - "GL_STENCIL_BACK_VALUE_MASK\0" - "GL_STENCIL_BACK_WRITEMASK\0" - "GL_STENCIL_BITS\0" - "GL_STENCIL_BUFFER_BIT\0" - "GL_STENCIL_CLEAR_VALUE\0" - "GL_STENCIL_FAIL\0" - "GL_STENCIL_FUNC\0" - "GL_STENCIL_INDEX\0" - "GL_STENCIL_INDEX16_EXT\0" - "GL_STENCIL_INDEX1_EXT\0" - "GL_STENCIL_INDEX4_EXT\0" - "GL_STENCIL_INDEX8_EXT\0" - "GL_STENCIL_INDEX_EXT\0" - "GL_STENCIL_PASS_DEPTH_FAIL\0" - "GL_STENCIL_PASS_DEPTH_PASS\0" - "GL_STENCIL_REF\0" - "GL_STENCIL_TEST\0" - "GL_STENCIL_TEST_TWO_SIDE_EXT\0" - "GL_STENCIL_VALUE_MASK\0" - "GL_STENCIL_WRITEMASK\0" - "GL_STEREO\0" - "GL_STREAM_COPY\0" - "GL_STREAM_COPY_ARB\0" - "GL_STREAM_DRAW\0" - "GL_STREAM_DRAW_ARB\0" - "GL_STREAM_READ\0" - "GL_STREAM_READ_ARB\0" - "GL_SUBPIXEL_BITS\0" - "GL_SUBTRACT\0" - "GL_SUBTRACT_ARB\0" - "GL_T\0" - "GL_T2F_C3F_V3F\0" - "GL_T2F_C4F_N3F_V3F\0" - "GL_T2F_C4UB_V3F\0" - "GL_T2F_N3F_V3F\0" - "GL_T2F_V3F\0" - "GL_T4F_C4F_N3F_V4F\0" - "GL_T4F_V4F\0" - "GL_TABLE_TOO_LARGE_EXT\0" - "GL_TEXTURE\0" - "GL_TEXTURE0\0" - "GL_TEXTURE0_ARB\0" - "GL_TEXTURE1\0" - "GL_TEXTURE10\0" - "GL_TEXTURE10_ARB\0" - "GL_TEXTURE11\0" - "GL_TEXTURE11_ARB\0" - "GL_TEXTURE12\0" - "GL_TEXTURE12_ARB\0" - "GL_TEXTURE13\0" - "GL_TEXTURE13_ARB\0" - "GL_TEXTURE14\0" - "GL_TEXTURE14_ARB\0" - "GL_TEXTURE15\0" - "GL_TEXTURE15_ARB\0" - "GL_TEXTURE16\0" - "GL_TEXTURE16_ARB\0" - "GL_TEXTURE17\0" - "GL_TEXTURE17_ARB\0" - "GL_TEXTURE18\0" - "GL_TEXTURE18_ARB\0" - "GL_TEXTURE19\0" - "GL_TEXTURE19_ARB\0" - "GL_TEXTURE1_ARB\0" - "GL_TEXTURE2\0" - "GL_TEXTURE20\0" - "GL_TEXTURE20_ARB\0" - "GL_TEXTURE21\0" - "GL_TEXTURE21_ARB\0" - "GL_TEXTURE22\0" - "GL_TEXTURE22_ARB\0" - "GL_TEXTURE23\0" - "GL_TEXTURE23_ARB\0" - "GL_TEXTURE24\0" - "GL_TEXTURE24_ARB\0" - "GL_TEXTURE25\0" - "GL_TEXTURE25_ARB\0" - "GL_TEXTURE26\0" - "GL_TEXTURE26_ARB\0" - "GL_TEXTURE27\0" - "GL_TEXTURE27_ARB\0" - "GL_TEXTURE28\0" - "GL_TEXTURE28_ARB\0" - "GL_TEXTURE29\0" - "GL_TEXTURE29_ARB\0" - "GL_TEXTURE2_ARB\0" - "GL_TEXTURE3\0" - "GL_TEXTURE30\0" - "GL_TEXTURE30_ARB\0" - "GL_TEXTURE31\0" - "GL_TEXTURE31_ARB\0" - "GL_TEXTURE3_ARB\0" - "GL_TEXTURE4\0" - "GL_TEXTURE4_ARB\0" - "GL_TEXTURE5\0" - "GL_TEXTURE5_ARB\0" - "GL_TEXTURE6\0" - "GL_TEXTURE6_ARB\0" - "GL_TEXTURE7\0" - "GL_TEXTURE7_ARB\0" - "GL_TEXTURE8\0" - "GL_TEXTURE8_ARB\0" - "GL_TEXTURE9\0" - "GL_TEXTURE9_ARB\0" - "GL_TEXTURE_1D\0" - "GL_TEXTURE_1D_ARRAY_EXT\0" - "GL_TEXTURE_2D\0" - "GL_TEXTURE_2D_ARRAY_EXT\0" - "GL_TEXTURE_3D\0" - "GL_TEXTURE_ALPHA_SIZE\0" - "GL_TEXTURE_ALPHA_SIZE_EXT\0" - "GL_TEXTURE_BASE_LEVEL\0" - "GL_TEXTURE_BINDING_1D\0" - "GL_TEXTURE_BINDING_1D_ARRAY_EXT\0" - "GL_TEXTURE_BINDING_2D\0" - "GL_TEXTURE_BINDING_2D_ARRAY_EXT\0" - "GL_TEXTURE_BINDING_3D\0" - "GL_TEXTURE_BINDING_CUBE_MAP\0" - "GL_TEXTURE_BINDING_CUBE_MAP_ARB\0" - "GL_TEXTURE_BINDING_RECTANGLE_ARB\0" - "GL_TEXTURE_BINDING_RECTANGLE_NV\0" - "GL_TEXTURE_BIT\0" - "GL_TEXTURE_BLUE_SIZE\0" - "GL_TEXTURE_BLUE_SIZE_EXT\0" - "GL_TEXTURE_BORDER\0" - "GL_TEXTURE_BORDER_COLOR\0" - "GL_TEXTURE_CLIPMAP_CENTER_SGIX\0" - "GL_TEXTURE_CLIPMAP_DEPTH_SGIX\0" - "GL_TEXTURE_CLIPMAP_FRAME_SGIX\0" - "GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX\0" - "GL_TEXTURE_CLIPMAP_OFFSET_SGIX\0" - "GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX\0" - "GL_TEXTURE_COLOR_TABLE_SGI\0" - "GL_TEXTURE_COLOR_WRITEMASK_SGIS\0" - "GL_TEXTURE_COMPARE_FAIL_VALUE_ARB\0" - "GL_TEXTURE_COMPARE_FUNC\0" - "GL_TEXTURE_COMPARE_FUNC_ARB\0" - "GL_TEXTURE_COMPARE_MODE\0" - "GL_TEXTURE_COMPARE_MODE_ARB\0" - "GL_TEXTURE_COMPARE_OPERATOR_SGIX\0" - "GL_TEXTURE_COMPARE_SGIX\0" - "GL_TEXTURE_COMPONENTS\0" - "GL_TEXTURE_COMPRESSED\0" - "GL_TEXTURE_COMPRESSED_ARB\0" - "GL_TEXTURE_COMPRESSED_FORMATS_ARB\0" - "GL_TEXTURE_COMPRESSED_IMAGE_SIZE\0" - "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB\0" - "GL_TEXTURE_COMPRESSION_HINT\0" - "GL_TEXTURE_COMPRESSION_HINT_ARB\0" - "GL_TEXTURE_COORD_ARRAY\0" - "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING\0" - "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB\0" - "GL_TEXTURE_COORD_ARRAY_POINTER\0" - "GL_TEXTURE_COORD_ARRAY_SIZE\0" - "GL_TEXTURE_COORD_ARRAY_STRIDE\0" - "GL_TEXTURE_COORD_ARRAY_TYPE\0" - "GL_TEXTURE_CUBE_MAP\0" - "GL_TEXTURE_CUBE_MAP_ARB\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_X\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z\0" - "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_X\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_Y\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_Z\0" - "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB\0" - "GL_TEXTURE_DEPTH\0" - "GL_TEXTURE_DEPTH_SIZE\0" - "GL_TEXTURE_DEPTH_SIZE_ARB\0" - "GL_TEXTURE_ENV\0" - "GL_TEXTURE_ENV_COLOR\0" - "GL_TEXTURE_ENV_MODE\0" - "GL_TEXTURE_FILTER_CONTROL\0" - "GL_TEXTURE_GEN_MODE\0" - "GL_TEXTURE_GEN_Q\0" - "GL_TEXTURE_GEN_R\0" - "GL_TEXTURE_GEN_S\0" - "GL_TEXTURE_GEN_T\0" - "GL_TEXTURE_GEQUAL_R_SGIX\0" - "GL_TEXTURE_GREEN_SIZE\0" - "GL_TEXTURE_GREEN_SIZE_EXT\0" - "GL_TEXTURE_HEIGHT\0" - "GL_TEXTURE_INDEX_SIZE_EXT\0" - "GL_TEXTURE_INTENSITY_SIZE\0" - "GL_TEXTURE_INTENSITY_SIZE_EXT\0" - "GL_TEXTURE_INTERNAL_FORMAT\0" - "GL_TEXTURE_LEQUAL_R_SGIX\0" - "GL_TEXTURE_LOD_BIAS\0" - "GL_TEXTURE_LOD_BIAS_EXT\0" - "GL_TEXTURE_LOD_BIAS_R_SGIX\0" - "GL_TEXTURE_LOD_BIAS_S_SGIX\0" - "GL_TEXTURE_LOD_BIAS_T_SGIX\0" - "GL_TEXTURE_LUMINANCE_SIZE\0" - "GL_TEXTURE_LUMINANCE_SIZE_EXT\0" - "GL_TEXTURE_MAG_FILTER\0" - "GL_TEXTURE_MATRIX\0" - "GL_TEXTURE_MAX_ANISOTROPY_EXT\0" - "GL_TEXTURE_MAX_CLAMP_R_SGIX\0" - "GL_TEXTURE_MAX_CLAMP_S_SGIX\0" - "GL_TEXTURE_MAX_CLAMP_T_SGIX\0" - "GL_TEXTURE_MAX_LEVEL\0" - "GL_TEXTURE_MAX_LOD\0" - "GL_TEXTURE_MIN_FILTER\0" - "GL_TEXTURE_MIN_LOD\0" - "GL_TEXTURE_PRIORITY\0" - "GL_TEXTURE_RECTANGLE_ARB\0" - "GL_TEXTURE_RECTANGLE_NV\0" - "GL_TEXTURE_RED_SIZE\0" - "GL_TEXTURE_RED_SIZE_EXT\0" - "GL_TEXTURE_RESIDENT\0" - "GL_TEXTURE_STACK_DEPTH\0" - "GL_TEXTURE_TOO_LARGE_EXT\0" - "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0" - "GL_TEXTURE_WIDTH\0" - "GL_TEXTURE_WRAP_R\0" - "GL_TEXTURE_WRAP_S\0" - "GL_TEXTURE_WRAP_T\0" - "GL_TIME_ELAPSED_EXT\0" - "GL_TRACK_MATRIX_NV\0" - "GL_TRACK_MATRIX_TRANSFORM_NV\0" - "GL_TRANSFORM_BIT\0" - "GL_TRANSPOSE_COLOR_MATRIX\0" - "GL_TRANSPOSE_COLOR_MATRIX_ARB\0" - "GL_TRANSPOSE_CURRENT_MATRIX_ARB\0" - "GL_TRANSPOSE_MODELVIEW_MATRIX\0" - "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB\0" - "GL_TRANSPOSE_NV\0" - "GL_TRANSPOSE_PROJECTION_MATRIX\0" - "GL_TRANSPOSE_PROJECTION_MATRIX_ARB\0" - "GL_TRANSPOSE_TEXTURE_MATRIX\0" - "GL_TRANSPOSE_TEXTURE_MATRIX_ARB\0" - "GL_TRIANGLES\0" - "GL_TRIANGLE_FAN\0" - "GL_TRIANGLE_MESH_SUN\0" - "GL_TRIANGLE_STRIP\0" - "GL_TRUE\0" - "GL_UNPACK_ALIGNMENT\0" - "GL_UNPACK_IMAGE_HEIGHT\0" - "GL_UNPACK_LSB_FIRST\0" - "GL_UNPACK_ROW_LENGTH\0" - "GL_UNPACK_SKIP_IMAGES\0" - "GL_UNPACK_SKIP_PIXELS\0" - "GL_UNPACK_SKIP_ROWS\0" - "GL_UNPACK_SWAP_BYTES\0" - "GL_UNSIGNED_BYTE\0" - "GL_UNSIGNED_BYTE_2_3_3_REV\0" - "GL_UNSIGNED_BYTE_3_3_2\0" - "GL_UNSIGNED_INT\0" - "GL_UNSIGNED_INT_10_10_10_2\0" - "GL_UNSIGNED_INT_24_8_NV\0" - "GL_UNSIGNED_INT_2_10_10_10_REV\0" - "GL_UNSIGNED_INT_8_8_8_8\0" - "GL_UNSIGNED_INT_8_8_8_8_REV\0" - "GL_UNSIGNED_SHORT\0" - "GL_UNSIGNED_SHORT_1_5_5_5_REV\0" - "GL_UNSIGNED_SHORT_4_4_4_4\0" - "GL_UNSIGNED_SHORT_4_4_4_4_REV\0" - "GL_UNSIGNED_SHORT_5_5_5_1\0" - "GL_UNSIGNED_SHORT_5_6_5\0" - "GL_UNSIGNED_SHORT_5_6_5_REV\0" - "GL_UNSIGNED_SHORT_8_8_APPLE\0" - "GL_UNSIGNED_SHORT_8_8_MESA\0" - "GL_UNSIGNED_SHORT_8_8_REV_APPLE\0" - "GL_UNSIGNED_SHORT_8_8_REV_MESA\0" - "GL_UPPER_LEFT\0" - "GL_V2F\0" - "GL_V3F\0" - "GL_VALIDATE_STATUS\0" - "GL_VENDOR\0" - "GL_VERSION\0" - "GL_VERTEX_ARRAY\0" - "GL_VERTEX_ARRAY_BINDING_APPLE\0" - "GL_VERTEX_ARRAY_BUFFER_BINDING\0" - "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB\0" - "GL_VERTEX_ARRAY_POINTER\0" - "GL_VERTEX_ARRAY_SIZE\0" - "GL_VERTEX_ARRAY_STRIDE\0" - "GL_VERTEX_ARRAY_TYPE\0" - "GL_VERTEX_ATTRIB_ARRAY0_NV\0" - "GL_VERTEX_ATTRIB_ARRAY10_NV\0" - "GL_VERTEX_ATTRIB_ARRAY11_NV\0" - "GL_VERTEX_ATTRIB_ARRAY12_NV\0" - "GL_VERTEX_ATTRIB_ARRAY13_NV\0" - "GL_VERTEX_ATTRIB_ARRAY14_NV\0" - "GL_VERTEX_ATTRIB_ARRAY15_NV\0" - "GL_VERTEX_ATTRIB_ARRAY1_NV\0" - "GL_VERTEX_ATTRIB_ARRAY2_NV\0" - "GL_VERTEX_ATTRIB_ARRAY3_NV\0" - "GL_VERTEX_ATTRIB_ARRAY4_NV\0" - "GL_VERTEX_ATTRIB_ARRAY5_NV\0" - "GL_VERTEX_ATTRIB_ARRAY6_NV\0" - "GL_VERTEX_ATTRIB_ARRAY7_NV\0" - "GL_VERTEX_ATTRIB_ARRAY8_NV\0" - "GL_VERTEX_ATTRIB_ARRAY9_NV\0" - "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0" - "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0" - "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0" - "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_POINTER\0" - "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_SIZE\0" - "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0" - "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0" - "GL_VERTEX_ATTRIB_ARRAY_TYPE\0" - "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0" - "GL_VERTEX_BLEND_ARB\0" - "GL_VERTEX_PROGRAM_ARB\0" - "GL_VERTEX_PROGRAM_BINDING_NV\0" - "GL_VERTEX_PROGRAM_NV\0" - "GL_VERTEX_PROGRAM_POINT_SIZE\0" - "GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0" - "GL_VERTEX_PROGRAM_POINT_SIZE_NV\0" - "GL_VERTEX_PROGRAM_TWO_SIDE\0" - "GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0" - "GL_VERTEX_PROGRAM_TWO_SIDE_NV\0" - "GL_VERTEX_SHADER\0" - "GL_VERTEX_SHADER_ARB\0" - "GL_VERTEX_STATE_PROGRAM_NV\0" - "GL_VIEWPORT\0" - "GL_VIEWPORT_BIT\0" - "GL_WEIGHT_ARRAY_ARB\0" - "GL_WEIGHT_ARRAY_BUFFER_BINDING\0" - "GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB\0" - "GL_WEIGHT_ARRAY_POINTER_ARB\0" - "GL_WEIGHT_ARRAY_SIZE_ARB\0" - "GL_WEIGHT_ARRAY_STRIDE_ARB\0" - "GL_WEIGHT_ARRAY_TYPE_ARB\0" - "GL_WEIGHT_SUM_UNITY_ARB\0" - "GL_WRAP_BORDER_SUN\0" - "GL_WRITE_ONLY\0" - "GL_WRITE_ONLY_ARB\0" - "GL_XOR\0" - "GL_YCBCR_422_APPLE\0" - "GL_YCBCR_MESA\0" - "GL_ZERO\0" - "GL_ZOOM_X\0" - "GL_ZOOM_Y\0" - ; - -static const enum_elt all_enums[1748] = -{ - { 0, 0x00000600 }, /* GL_2D */ - { 6, 0x00001407 }, /* GL_2_BYTES */ - { 17, 0x00000601 }, /* GL_3D */ - { 23, 0x00000602 }, /* GL_3D_COLOR */ - { 35, 0x00000603 }, /* GL_3D_COLOR_TEXTURE */ - { 55, 0x00001408 }, /* GL_3_BYTES */ - { 66, 0x00000604 }, /* GL_4D_COLOR_TEXTURE */ - { 86, 0x00001409 }, /* GL_4_BYTES */ - { 97, 0x00000100 }, /* GL_ACCUM */ - { 106, 0x00000D5B }, /* GL_ACCUM_ALPHA_BITS */ - { 126, 0x00000D5A }, /* GL_ACCUM_BLUE_BITS */ - { 145, 0x00000200 }, /* GL_ACCUM_BUFFER_BIT */ - { 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */ - { 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */ - { 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */ - { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */ - { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - { 276, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */ - { 303, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */ - { 321, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */ - { 343, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */ - { 362, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - { 391, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - { 418, 0x00000104 }, /* GL_ADD */ - { 425, 0x00008574 }, /* GL_ADD_SIGNED */ - { 439, 0x00008574 }, /* GL_ADD_SIGNED_ARB */ - { 457, 0x00008574 }, /* GL_ADD_SIGNED_EXT */ - { 475, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */ - { 503, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */ - { 531, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */ - { 550, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */ - { 576, 0x00001906 }, /* GL_ALPHA */ - { 585, 0x0000803D }, /* GL_ALPHA12 */ - { 596, 0x0000803D }, /* GL_ALPHA12_EXT */ - { 611, 0x0000803E }, /* GL_ALPHA16 */ - { 622, 0x0000803E }, /* GL_ALPHA16_EXT */ - { 637, 0x0000803B }, /* GL_ALPHA4 */ - { 647, 0x0000803B }, /* GL_ALPHA4_EXT */ - { 661, 0x0000803C }, /* GL_ALPHA8 */ - { 671, 0x0000803C }, /* GL_ALPHA8_EXT */ - { 685, 0x00000D1D }, /* GL_ALPHA_BIAS */ - { 699, 0x00000D55 }, /* GL_ALPHA_BITS */ - { 713, 0x00000D1C }, /* GL_ALPHA_SCALE */ - { 728, 0x00000BC0 }, /* GL_ALPHA_TEST */ - { 742, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */ - { 761, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */ - { 779, 0x00000207 }, /* GL_ALWAYS */ - { 789, 0x00001200 }, /* GL_AMBIENT */ - { 800, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */ - { 823, 0x00001501 }, /* GL_AND */ - { 830, 0x00001504 }, /* GL_AND_INVERTED */ - { 846, 0x00001502 }, /* GL_AND_REVERSE */ - { 861, 0x00008892 }, /* GL_ARRAY_BUFFER */ - { 877, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */ - { 901, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */ - { 929, 0x00008B85 }, /* GL_ATTACHED_SHADERS */ - { 949, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */ - { 976, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */ - { 1000, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */ - { 1026, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */ - { 1050, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */ - { 1072, 0x00000D80 }, /* GL_AUTO_NORMAL */ - { 1087, 0x00000409 }, /* GL_AUX0 */ - { 1095, 0x0000040A }, /* GL_AUX1 */ - { 1103, 0x0000040B }, /* GL_AUX2 */ - { 1111, 0x0000040C }, /* GL_AUX3 */ - { 1119, 0x00000C00 }, /* GL_AUX_BUFFERS */ - { 1134, 0x00000405 }, /* GL_BACK */ - { 1142, 0x00000402 }, /* GL_BACK_LEFT */ - { 1155, 0x00000403 }, /* GL_BACK_RIGHT */ - { 1169, 0x000080E0 }, /* GL_BGR */ - { 1176, 0x000080E1 }, /* GL_BGRA */ - { 1184, 0x00001A00 }, /* GL_BITMAP */ - { 1194, 0x00000704 }, /* GL_BITMAP_TOKEN */ - { 1210, 0x00000BE2 }, /* GL_BLEND */ - { 1219, 0x00008005 }, /* GL_BLEND_COLOR */ - { 1234, 0x00008005 }, /* GL_BLEND_COLOR_EXT */ - { 1253, 0x00000BE0 }, /* GL_BLEND_DST */ - { 1266, 0x000080CA }, /* GL_BLEND_DST_ALPHA */ - { 1285, 0x000080C8 }, /* GL_BLEND_DST_RGB */ - { 1302, 0x00008009 }, /* GL_BLEND_EQUATION */ - { 1320, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */ - { 1344, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ - { 1372, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ - { 1394, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ - { 1420, 0x00000BE1 }, /* GL_BLEND_SRC */ - { 1433, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ - { 1452, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ - { 1469, 0x00001905 }, /* GL_BLUE */ - { 1477, 0x00000D1B }, /* GL_BLUE_BIAS */ - { 1490, 0x00000D54 }, /* GL_BLUE_BITS */ - { 1503, 0x00000D1A }, /* GL_BLUE_SCALE */ - { 1517, 0x00008B56 }, /* GL_BOOL */ - { 1525, 0x00008B56 }, /* GL_BOOL_ARB */ - { 1537, 0x00008B57 }, /* GL_BOOL_VEC2 */ - { 1550, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ - { 1567, 0x00008B58 }, /* GL_BOOL_VEC3 */ - { 1580, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ - { 1597, 0x00008B59 }, /* GL_BOOL_VEC4 */ - { 1610, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ - { 1627, 0x000088BB }, /* GL_BUFFER_ACCESS */ - { 1644, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ - { 1665, 0x000088BC }, /* GL_BUFFER_MAPPED */ - { 1682, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ - { 1703, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ - { 1725, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ - { 1751, 0x00008764 }, /* GL_BUFFER_SIZE */ - { 1766, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ - { 1785, 0x00008765 }, /* GL_BUFFER_USAGE */ - { 1801, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ - { 1821, 0x00001400 }, /* GL_BYTE */ - { 1829, 0x00002A24 }, /* GL_C3F_V3F */ - { 1840, 0x00002A26 }, /* GL_C4F_N3F_V3F */ - { 1855, 0x00002A22 }, /* GL_C4UB_V2F */ - { 1867, 0x00002A23 }, /* GL_C4UB_V3F */ - { 1879, 0x00000901 }, /* GL_CCW */ - { 1886, 0x00002900 }, /* GL_CLAMP */ - { 1895, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ - { 1914, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ - { 1937, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ - { 1961, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ - { 1978, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ - { 2000, 0x00001500 }, /* GL_CLEAR */ - { 2009, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ - { 2034, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ - { 2063, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ - { 2089, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - { 2118, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ - { 2144, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ - { 2171, 0x00003000 }, /* GL_CLIP_PLANE0 */ - { 2186, 0x00003001 }, /* GL_CLIP_PLANE1 */ - { 2201, 0x00003002 }, /* GL_CLIP_PLANE2 */ - { 2216, 0x00003003 }, /* GL_CLIP_PLANE3 */ - { 2231, 0x00003004 }, /* GL_CLIP_PLANE4 */ - { 2246, 0x00003005 }, /* GL_CLIP_PLANE5 */ - { 2261, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - { 2294, 0x00000A00 }, /* GL_COEFF */ - { 2303, 0x00001800 }, /* GL_COLOR */ - { 2312, 0x00008076 }, /* GL_COLOR_ARRAY */ - { 2327, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - { 2357, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 2391, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ - { 2414, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ - { 2434, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ - { 2456, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2501, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2527, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2553, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2579, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2605, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 2631, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 2657, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 2682, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 2707, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 2732, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 2757, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 2782, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 2807, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 2832, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 2857, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 2882, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 2902, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 2923, 0x00001900 }, /* GL_COLOR_INDEX */ - { 2938, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 2955, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 2973, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 2991, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 3014, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 3042, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 3058, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 3078, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 3106, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 3138, 0x00008458 }, /* GL_COLOR_SUM */ - { 3151, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 3168, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3183, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3209, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3239, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3269, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3313, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3338, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3367, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3396, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 3418, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 3444, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 3470, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 3496, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 3526, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 3556, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 3586, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 3620, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 3654, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 3684, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 3718, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 3752, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 3776, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 3804, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 3832, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 3853, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 3878, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 3899, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 3924, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 3949, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 3968, 0x00008570 }, /* GL_COMBINE */ - { 3979, 0x00008503 }, /* GL_COMBINE4 */ - { 3991, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 4008, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 4029, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 4050, 0x00008570 }, /* GL_COMBINE_ARB */ - { 4065, 0x00008570 }, /* GL_COMBINE_EXT */ - { 4080, 0x00008571 }, /* GL_COMBINE_RGB */ - { 4095, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 4114, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4133, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ - { 4169, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4193, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4221, 0x00001300 }, /* GL_COMPILE */ - { 4232, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4255, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4273, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4293, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4317, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4341, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4369, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4393, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4423, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4457, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4485, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4503, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 4522, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 4545, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 4574, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 4607, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 4640, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 4673, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 4695, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 4723, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 4755, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 4785, 0x00008576 }, /* GL_CONSTANT */ - { 4797, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 4815, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 4837, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 4853, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 4877, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 4899, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 4917, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 4939, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 4955, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 4973, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 4991, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5019, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5050, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5077, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5108, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5135, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5166, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5194, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5226, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5248, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5274, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5296, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5322, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5343, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5368, 0x00008862 }, /* GL_COORD_REPLACE */ - { 5385, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5406, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5426, 0x00001503 }, /* GL_COPY */ - { 5434, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5451, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5471, 0x00000B44 }, /* GL_CULL_FACE */ - { 5484, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5502, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 5521, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 5553, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 5588, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 5609, 0x00000001 }, /* GL_CURRENT_BIT */ - { 5624, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 5641, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 5662, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 5688, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 5705, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 5727, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 5755, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 5776, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 5810, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 5843, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 5861, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 5891, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 5910, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 5927, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 5948, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 5972, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 5999, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6023, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6050, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6083, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6116, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6143, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6169, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6194, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 6223, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 6245, 0x00000900 }, /* GL_CW */ - { 6251, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 6272, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6293, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6313, 0x00002101 }, /* GL_DECAL */ - { 6322, 0x00001E03 }, /* GL_DECR */ - { 6330, 0x00008508 }, /* GL_DECR_WRAP */ - { 6343, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6360, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 6377, 0x00001801 }, /* GL_DEPTH */ - { 6386, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6410, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6424, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6438, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6458, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 6483, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 6503, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 6521, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 6542, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 6561, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 6582, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 6607, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 6633, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 6654, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 6679, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 6705, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 6726, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 6751, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 6777, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 6791, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 6806, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 6821, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 6841, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 6869, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 6897, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 6911, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 6933, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 6959, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 6978, 0x00001201 }, /* GL_DIFFUSE */ - { 6989, 0x00000BD0 }, /* GL_DITHER */ - { 6999, 0x00000A02 }, /* GL_DOMAIN */ - { 7009, 0x00001100 }, /* GL_DONT_CARE */ - { 7022, 0x000086AE }, /* GL_DOT3_RGB */ - { 7034, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7047, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7064, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7081, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7097, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7113, 0x0000140A }, /* GL_DOUBLE */ - { 7123, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 7139, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 7170, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 7190, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 7210, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 7226, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 7243, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 7264, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 7285, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 7302, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 7323, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 7344, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 7361, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 7382, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7403, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 7420, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 7441, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 7462, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 7479, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 7500, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 7521, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 7538, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 7559, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 7580, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 7600, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 7636, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 7656, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 7692, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 7712, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 7748, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 7768, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 7804, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 7824, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 7860, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 7880, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 7916, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 7936, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 7972, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 7992, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8028, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8048, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8068, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8100, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 8124, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 8144, 0x00000304 }, /* GL_DST_ALPHA */ - { 8157, 0x00000306 }, /* GL_DST_COLOR */ - { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 8186, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 8222, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 8258, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 8278, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 8291, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 8310, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 8344, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 8382, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 8409, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 8435, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 8459, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 8491, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 8527, 0x00001600 }, /* GL_EMISSION */ - { 8539, 0x00002000 }, /* GL_ENABLE_BIT */ - { 8553, 0x00000202 }, /* GL_EQUAL */ - { 8562, 0x00001509 }, /* GL_EQUIV */ - { 8571, 0x00010000 }, /* GL_EVAL_BIT */ - { 8583, 0x00000800 }, /* GL_EXP */ - { 8590, 0x00000801 }, /* GL_EXP2 */ - { 8598, 0x00001F03 }, /* GL_EXTENSIONS */ - { 8612, 0x00002400 }, /* GL_EYE_LINEAR */ - { 8626, 0x00002502 }, /* GL_EYE_PLANE */ - { 8639, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 8664, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 8681, 0x00000000 }, /* GL_FALSE */ - { 8690, 0x00001101 }, /* GL_FASTEST */ - { 8701, 0x00001C01 }, /* GL_FEEDBACK */ - { 8713, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 8740, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 8764, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 8788, 0x00001B02 }, /* GL_FILL */ - { 8796, 0x00001D00 }, /* GL_FLAT */ - { 8804, 0x00001406 }, /* GL_FLOAT */ - { 8813, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 8827, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 8845, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 8859, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 8877, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 8891, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 8909, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 8923, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 8941, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 8955, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 8973, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 8987, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 9005, 0x00000B60 }, /* GL_FOG */ - { 9012, 0x00000080 }, /* GL_FOG_BIT */ - { 9023, 0x00000B66 }, /* GL_FOG_COLOR */ - { 9036, 0x00008451 }, /* GL_FOG_COORD */ - { 9049, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 9067, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 9091, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 9130, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 9173, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 9205, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 9236, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 9265, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 9290, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 9309, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 9343, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 9370, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 9396, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 9420, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 9437, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 9452, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 9476, 0x00000B64 }, /* GL_FOG_END */ - { 9487, 0x00000C54 }, /* GL_FOG_HINT */ - { 9499, 0x00000B61 }, /* GL_FOG_INDEX */ - { 9512, 0x00000B65 }, /* GL_FOG_MODE */ - { 9524, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 9543, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 9568, 0x00000B63 }, /* GL_FOG_START */ - { 9581, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 9599, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 9623, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 9642, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 9665, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 9700, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 9742, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 9784, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 9833, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 9885, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 9929, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 9973, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 10000, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 10028, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 10047, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 10088, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 10129, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 10171, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 10222, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 10260, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 10309, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 10351, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 10383, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 10414, 0x00000404 }, /* GL_FRONT */ - { 10423, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 10441, 0x00000B46 }, /* GL_FRONT_FACE */ - { 10455, 0x00000400 }, /* GL_FRONT_LEFT */ - { 10469, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 10484, 0x00008006 }, /* GL_FUNC_ADD */ - { 10496, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 10512, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 10537, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 10566, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 10583, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 10604, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 10623, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 10647, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 10676, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 10700, 0x00000206 }, /* GL_GEQUAL */ - { 10710, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ - { 10735, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ - { 10763, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 10797, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ - { 10819, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - { 10847, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 10884, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ - { 10903, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ - { 10922, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ - { 10941, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ - { 10960, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ - { 10979, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ - { 10998, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ - { 11022, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - { 11054, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ - { 11080, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 11114, 0x00008C46 }, /* GL_GL_SLUMINANCE */ - { 11131, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ - { 11149, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ - { 11174, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ - { 11197, 0x00008C40 }, /* GL_GL_SRGB */ - { 11208, 0x00008C41 }, /* GL_GL_SRGB8 */ - { 11220, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ - { 11239, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ - { 11256, 0x00000204 }, /* GL_GREATER */ - { 11267, 0x00001904 }, /* GL_GREEN */ - { 11276, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 11290, 0x00000D53 }, /* GL_GREEN_BITS */ - { 11304, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 11319, 0x00008000 }, /* GL_HINT_BIT */ - { 11331, 0x00008024 }, /* GL_HISTOGRAM */ - { 11344, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 11368, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 11396, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 11419, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 11446, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 11463, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 11483, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 11507, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 11531, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 11559, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 11587, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 11619, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 11641, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 11667, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 11685, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 11707, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 11726, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 11749, 0x0000862A }, /* GL_IDENTITY_NV */ - { 11764, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 11784, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 11824, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 11862, 0x00001E02 }, /* GL_INCR */ - { 11870, 0x00008507 }, /* GL_INCR_WRAP */ - { 11883, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 11900, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 11915, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 11945, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 11979, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 12002, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 12024, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 12044, 0x00000D51 }, /* GL_INDEX_BITS */ - { 12058, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 12079, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 12097, 0x00000C30 }, /* GL_INDEX_MODE */ - { 12111, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 12127, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 12142, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 12161, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 12180, 0x00001404 }, /* GL_INT */ - { 12187, 0x00008049 }, /* GL_INTENSITY */ - { 12200, 0x0000804C }, /* GL_INTENSITY12 */ - { 12215, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 12234, 0x0000804D }, /* GL_INTENSITY16 */ - { 12249, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 12268, 0x0000804A }, /* GL_INTENSITY4 */ - { 12282, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 12300, 0x0000804B }, /* GL_INTENSITY8 */ - { 12314, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 12332, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 12349, 0x00008575 }, /* GL_INTERPOLATE */ - { 12364, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 12383, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 12402, 0x00008B53 }, /* GL_INT_VEC2 */ - { 12414, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 12430, 0x00008B54 }, /* GL_INT_VEC3 */ - { 12442, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 12458, 0x00008B55 }, /* GL_INT_VEC4 */ - { 12470, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 12486, 0x00000500 }, /* GL_INVALID_ENUM */ - { 12502, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 12539, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 12560, 0x00000501 }, /* GL_INVALID_VALUE */ - { 12577, 0x0000862B }, /* GL_INVERSE_NV */ - { 12591, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 12615, 0x0000150A }, /* GL_INVERT */ - { 12625, 0x00001E00 }, /* GL_KEEP */ - { 12633, 0x00000406 }, /* GL_LEFT */ - { 12641, 0x00000203 }, /* GL_LEQUAL */ - { 12651, 0x00000201 }, /* GL_LESS */ - { 12659, 0x00004000 }, /* GL_LIGHT0 */ - { 12669, 0x00004001 }, /* GL_LIGHT1 */ - { 12679, 0x00004002 }, /* GL_LIGHT2 */ - { 12689, 0x00004003 }, /* GL_LIGHT3 */ - { 12699, 0x00004004 }, /* GL_LIGHT4 */ - { 12709, 0x00004005 }, /* GL_LIGHT5 */ - { 12719, 0x00004006 }, /* GL_LIGHT6 */ - { 12729, 0x00004007 }, /* GL_LIGHT7 */ - { 12739, 0x00000B50 }, /* GL_LIGHTING */ - { 12751, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 12767, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 12790, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 12819, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 12852, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 12880, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 12904, 0x00001B01 }, /* GL_LINE */ - { 12912, 0x00002601 }, /* GL_LINEAR */ - { 12922, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 12944, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 12974, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 13005, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 13029, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 13054, 0x00000001 }, /* GL_LINES */ - { 13063, 0x00000004 }, /* GL_LINE_BIT */ - { 13075, 0x00000002 }, /* GL_LINE_LOOP */ - { 13088, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 13108, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 13123, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 13143, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 13159, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 13183, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 13206, 0x00000003 }, /* GL_LINE_STRIP */ - { 13220, 0x00000702 }, /* GL_LINE_TOKEN */ - { 13234, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 13248, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 13274, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 13294, 0x00008B82 }, /* GL_LINK_STATUS */ - { 13309, 0x00000B32 }, /* GL_LIST_BASE */ - { 13322, 0x00020000 }, /* GL_LIST_BIT */ - { 13334, 0x00000B33 }, /* GL_LIST_INDEX */ - { 13348, 0x00000B30 }, /* GL_LIST_MODE */ - { 13361, 0x00000101 }, /* GL_LOAD */ - { 13369, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 13381, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 13398, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 13412, 0x00001909 }, /* GL_LUMINANCE */ - { 13425, 0x00008041 }, /* GL_LUMINANCE12 */ - { 13440, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 13463, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 13490, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 13512, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 13538, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 13557, 0x00008042 }, /* GL_LUMINANCE16 */ - { 13572, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 13595, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 13622, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 13641, 0x0000803F }, /* GL_LUMINANCE4 */ - { 13655, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 13676, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 13701, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 13719, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 13740, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 13765, 0x00008040 }, /* GL_LUMINANCE8 */ - { 13779, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 13800, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 13825, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 13843, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 13862, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 13878, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 13898, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 13920, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 13934, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 13949, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 13973, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 13997, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 14021, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 14045, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 14062, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 14079, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 14107, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 14136, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 14165, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 14194, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 14223, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 14252, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 14281, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 14309, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 14337, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 14365, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 14393, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 14421, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 14449, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 14477, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 14505, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 14533, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 14549, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 14569, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 14591, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 14605, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 14620, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 14644, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 14668, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 14692, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 14716, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 14733, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 14750, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 14778, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 14807, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 14836, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 14865, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 14894, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 14923, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 14952, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 14980, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 15008, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 15036, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 15064, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 15092, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 15120, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 15148, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 15176, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 15204, 0x00000D10 }, /* GL_MAP_COLOR */ - { 15217, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 15232, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 15247, 0x00008630 }, /* GL_MATRIX0_NV */ - { 15261, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 15277, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 15293, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 15309, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 15325, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 15341, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 15357, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 15373, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 15389, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 15405, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 15421, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 15436, 0x00008631 }, /* GL_MATRIX1_NV */ - { 15450, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 15466, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 15482, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 15498, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 15514, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 15530, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 15546, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 15562, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 15578, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 15594, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 15610, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 15625, 0x00008632 }, /* GL_MATRIX2_NV */ - { 15639, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 15655, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 15671, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 15686, 0x00008633 }, /* GL_MATRIX3_NV */ - { 15700, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 15715, 0x00008634 }, /* GL_MATRIX4_NV */ - { 15729, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 15744, 0x00008635 }, /* GL_MATRIX5_NV */ - { 15758, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 15773, 0x00008636 }, /* GL_MATRIX6_NV */ - { 15787, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 15802, 0x00008637 }, /* GL_MATRIX7_NV */ - { 15816, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 15831, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 15846, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 15872, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 15906, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 15937, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 15970, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 16001, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 16016, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 16038, 0x00008008 }, /* GL_MAX */ - { 16045, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 16068, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 16100, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 16126, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 16159, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 16185, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 16219, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 16238, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 16267, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 16299, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 16335, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 16371, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 16411, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 16437, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 16467, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 16492, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 16521, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 16550, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 16583, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 16603, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 16627, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 16651, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 16675, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 16700, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 16718, 0x00008008 }, /* GL_MAX_EXT */ - { 16729, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 16764, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 16803, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 16817, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 16837, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 16875, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 16904, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 16928, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 16956, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 16979, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 17016, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 17052, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 17079, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 17108, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 17142, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 17178, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 17205, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 17237, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 17273, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 17302, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 17331, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 17359, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 17397, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 17441, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 17484, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 17518, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 17557, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 17594, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 17632, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 17675, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 17718, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 17748, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 17779, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 17815, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 17851, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 17881, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 17915, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 17948, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 17977, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 17997, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 18021, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 18043, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 18069, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 18096, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 18127, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 18151, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 18185, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 18205, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 18232, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 18253, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 18278, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 18303, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 18338, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 18360, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 18386, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 18408, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 18434, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 18468, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 18506, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 18539, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 18576, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 18600, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 18621, 0x00008007 }, /* GL_MIN */ - { 18628, 0x0000802E }, /* GL_MINMAX */ - { 18638, 0x0000802E }, /* GL_MINMAX_EXT */ - { 18652, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 18669, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 18690, 0x00008030 }, /* GL_MINMAX_SINK */ - { 18705, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 18724, 0x00008007 }, /* GL_MIN_EXT */ - { 18735, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 18754, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 18777, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 18800, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 18820, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 18840, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 18870, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 18898, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 18926, 0x00001700 }, /* GL_MODELVIEW */ - { 18939, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 18957, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 18976, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 18995, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 19014, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 19033, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 19052, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 19071, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 19090, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 19109, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 19128, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 19147, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 19165, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 19184, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 19203, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 19222, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 19241, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 19260, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 19279, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 19298, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 19317, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 19336, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 19355, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 19373, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 19392, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 19411, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 19429, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 19447, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 19465, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 19483, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 19501, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 19519, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 19537, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 19557, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 19584, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 19609, 0x00002100 }, /* GL_MODULATE */ - { 19621, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 19641, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 19668, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 19693, 0x00000103 }, /* GL_MULT */ - { 19701, 0x0000809D }, /* GL_MULTISAMPLE */ - { 19716, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 19736, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 19755, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 19774, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 19798, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 19821, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 19851, 0x00002A25 }, /* GL_N3F_V3F */ - { 19862, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 19882, 0x0000150E }, /* GL_NAND */ - { 19890, 0x00002600 }, /* GL_NEAREST */ - { 19901, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 19932, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 19964, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 19989, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 20015, 0x00000200 }, /* GL_NEVER */ - { 20024, 0x00001102 }, /* GL_NICEST */ - { 20034, 0x00000000 }, /* GL_NONE */ - { 20042, 0x00001505 }, /* GL_NOOP */ - { 20050, 0x00001508 }, /* GL_NOR */ - { 20057, 0x00000BA1 }, /* GL_NORMALIZE */ - { 20070, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 20086, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 20117, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 20152, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 20176, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 20199, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 20220, 0x00008511 }, /* GL_NORMAL_MAP */ - { 20234, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 20252, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 20269, 0x00000205 }, /* GL_NOTEQUAL */ - { 20281, 0x00000000 }, /* GL_NO_ERROR */ - { 20293, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 20327, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 20365, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 20397, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 20439, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 20469, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 20509, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 20540, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 20569, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 20597, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 20627, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 20644, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 20670, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 20686, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 20721, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 20743, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 20762, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 20792, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 20813, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 20841, 0x00000001 }, /* GL_ONE */ - { 20848, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 20876, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 20908, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 20936, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 20968, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 20991, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 21014, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 21037, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 21060, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 21078, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 21100, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 21122, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 21138, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 21158, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 21178, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 21196, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 21218, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 21240, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 21256, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 21276, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 21296, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 21314, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 21336, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 21358, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 21374, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 21394, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 21414, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 21435, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 21454, 0x00001507 }, /* GL_OR */ - { 21460, 0x00000A01 }, /* GL_ORDER */ - { 21469, 0x0000150D }, /* GL_OR_INVERTED */ - { 21484, 0x0000150B }, /* GL_OR_REVERSE */ - { 21498, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 21515, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 21533, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 21554, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 21574, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 21592, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 21611, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 21631, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 21651, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 21669, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 21688, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 21713, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 21737, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 21758, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 21780, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 21802, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 21827, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 21851, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 21872, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 21894, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 21916, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 21938, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 21969, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 21989, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 22014, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 22034, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 22059, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 22079, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 22104, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 22124, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 22149, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 22169, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 22194, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 22214, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 22239, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 22259, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 22284, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 22304, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 22329, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 22349, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 22374, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 22394, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 22419, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 22437, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 22470, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 22495, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 22530, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 22557, 0x00001B00 }, /* GL_POINT */ - { 22566, 0x00000000 }, /* GL_POINTS */ - { 22576, 0x00000002 }, /* GL_POINT_BIT */ - { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 22619, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 22653, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 22687, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 22722, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 22751, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 22784, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 22817, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 22851, 0x00000B11 }, /* GL_POINT_SIZE */ - { 22865, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 22891, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 22909, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 22931, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 22953, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 22976, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 22994, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 23016, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 23038, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 23061, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 23081, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 23097, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 23118, 0x00008861 }, /* GL_POINT_SPRITE */ - { 23134, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 23154, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 23183, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 23202, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 23228, 0x00000701 }, /* GL_POINT_TOKEN */ - { 23243, 0x00000009 }, /* GL_POLYGON */ - { 23254, 0x00000008 }, /* GL_POLYGON_BIT */ - { 23269, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 23285, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 23308, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 23333, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 23356, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 23379, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 23403, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 23427, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 23445, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 23468, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 23487, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 23510, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 23527, 0x00001203 }, /* GL_POSITION */ - { 23539, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 23571, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 23607, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 23640, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 23677, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 23708, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 23743, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 23775, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 23811, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 23844, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 23876, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 23912, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 23945, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 23982, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 24012, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 24046, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 24077, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 24112, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 24143, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 24178, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 24210, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 24246, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 24276, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 24310, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 24341, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 24376, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 24408, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 24439, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 24474, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 24506, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 24542, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 24571, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 24604, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 24634, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 24668, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 24707, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 24740, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 24780, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 24814, 0x00008578 }, /* GL_PREVIOUS */ - { 24826, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 24842, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 24858, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 24875, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 24896, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 24917, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 24950, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 24982, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 25005, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 25028, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 25058, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 25087, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 25115, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 25137, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 25165, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 25193, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 25215, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 25236, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 25276, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 25315, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 25345, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 25380, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 25413, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 25447, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 25486, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 25525, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 25547, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 25573, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 25597, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 25620, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 25642, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 25663, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 25684, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 25711, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 25743, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 25775, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 25810, 0x00001701 }, /* GL_PROJECTION */ - { 25824, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 25845, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 25871, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 25892, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 25911, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 25934, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25973, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 26011, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 26031, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 26061, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 26085, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 26105, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 26135, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 26159, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 26179, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 26212, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 26238, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 26268, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 26299, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 26329, 0x00002003 }, /* GL_Q */ - { 26334, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 26359, 0x00000007 }, /* GL_QUADS */ - { 26368, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 26385, 0x00000008 }, /* GL_QUAD_STRIP */ - { 26399, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 26421, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 26447, 0x00008866 }, /* GL_QUERY_RESULT */ - { 26463, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 26483, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 26509, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 26539, 0x00002002 }, /* GL_R */ - { 26544, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 26556, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 26589, 0x00000C02 }, /* GL_READ_BUFFER */ - { 26604, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 26636, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 26660, 0x000088B8 }, /* GL_READ_ONLY */ - { 26673, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 26690, 0x000088BA }, /* GL_READ_WRITE */ - { 26704, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 26722, 0x00001903 }, /* GL_RED */ - { 26729, 0x00008016 }, /* GL_REDUCE */ - { 26739, 0x00008016 }, /* GL_REDUCE_EXT */ - { 26753, 0x00000D15 }, /* GL_RED_BIAS */ - { 26765, 0x00000D52 }, /* GL_RED_BITS */ - { 26777, 0x00000D14 }, /* GL_RED_SCALE */ - { 26790, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 26808, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 26830, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 26851, 0x00001C00 }, /* GL_RENDER */ - { 26861, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 26889, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 26909, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 26936, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 26972, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 26998, 0x00001F01 }, /* GL_RENDERER */ - { 27010, 0x00000C40 }, /* GL_RENDER_MODE */ - { 27025, 0x00002901 }, /* GL_REPEAT */ - { 27035, 0x00001E01 }, /* GL_REPLACE */ - { 27046, 0x00008062 }, /* GL_REPLACE_EXT */ - { 27061, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 27084, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 27102, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 27124, 0x00000102 }, /* GL_RETURN */ - { 27134, 0x00001907 }, /* GL_RGB */ - { 27141, 0x00008052 }, /* GL_RGB10 */ - { 27150, 0x00008059 }, /* GL_RGB10_A2 */ - { 27162, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 27178, 0x00008052 }, /* GL_RGB10_EXT */ - { 27191, 0x00008053 }, /* GL_RGB12 */ - { 27200, 0x00008053 }, /* GL_RGB12_EXT */ - { 27213, 0x00008054 }, /* GL_RGB16 */ - { 27222, 0x00008054 }, /* GL_RGB16_EXT */ - { 27235, 0x0000804E }, /* GL_RGB2_EXT */ - { 27247, 0x0000804F }, /* GL_RGB4 */ - { 27255, 0x0000804F }, /* GL_RGB4_EXT */ - { 27267, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 27280, 0x00008050 }, /* GL_RGB5 */ - { 27288, 0x00008057 }, /* GL_RGB5_A1 */ - { 27299, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 27314, 0x00008050 }, /* GL_RGB5_EXT */ - { 27326, 0x00008051 }, /* GL_RGB8 */ - { 27334, 0x00008051 }, /* GL_RGB8_EXT */ - { 27346, 0x00001908 }, /* GL_RGBA */ - { 27354, 0x0000805A }, /* GL_RGBA12 */ - { 27364, 0x0000805A }, /* GL_RGBA12_EXT */ - { 27378, 0x0000805B }, /* GL_RGBA16 */ - { 27388, 0x0000805B }, /* GL_RGBA16_EXT */ - { 27402, 0x00008055 }, /* GL_RGBA2 */ - { 27411, 0x00008055 }, /* GL_RGBA2_EXT */ - { 27424, 0x00008056 }, /* GL_RGBA4 */ - { 27433, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 27452, 0x00008056 }, /* GL_RGBA4_EXT */ - { 27465, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 27479, 0x00008058 }, /* GL_RGBA8 */ - { 27488, 0x00008058 }, /* GL_RGBA8_EXT */ - { 27501, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 27519, 0x00000C31 }, /* GL_RGBA_MODE */ - { 27532, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 27545, 0x000083A0 }, /* GL_RGB_S3TC */ - { 27557, 0x00008573 }, /* GL_RGB_SCALE */ - { 27570, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 27587, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 27604, 0x00000407 }, /* GL_RIGHT */ - { 27613, 0x00002000 }, /* GL_S */ - { 27618, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 27632, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 27653, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 27667, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 27688, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 27702, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 27718, 0x000080A9 }, /* GL_SAMPLES */ - { 27729, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 27745, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 27760, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 27778, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 27800, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 27828, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 27860, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 27883, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 27910, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 27928, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 27951, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 27973, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 27992, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 28015, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 28041, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 28071, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 28096, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 28125, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 28140, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 28155, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 28171, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 28196, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 28236, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 28280, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 28313, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 28343, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 28375, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 28405, 0x00001C02 }, /* GL_SELECT */ - { 28415, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 28443, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 28468, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 28484, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 28511, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 28542, 0x0000150F }, /* GL_SET */ - { 28549, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 28570, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 28594, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 28609, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 28624, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 28652, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 28675, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 28705, 0x00001601 }, /* GL_SHININESS */ - { 28718, 0x00001402 }, /* GL_SHORT */ - { 28727, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 28743, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 28763, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 28782, 0x00001D01 }, /* GL_SMOOTH */ - { 28792, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 28825, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 28852, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 28885, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 28912, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 28929, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 28950, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 28971, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 28986, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 29005, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 29024, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 29041, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 29062, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 29083, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 29098, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 29117, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 29136, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 29153, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 29174, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 29195, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 29210, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 29229, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 29248, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 29268, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 29286, 0x00001202 }, /* GL_SPECULAR */ - { 29298, 0x00002402 }, /* GL_SPHERE_MAP */ - { 29312, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 29327, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 29345, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 29362, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 29376, 0x00008580 }, /* GL_SRC0_RGB */ - { 29388, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 29402, 0x00008581 }, /* GL_SRC1_RGB */ - { 29414, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 29428, 0x00008582 }, /* GL_SRC2_RGB */ - { 29440, 0x00000302 }, /* GL_SRC_ALPHA */ - { 29453, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 29475, 0x00000300 }, /* GL_SRC_COLOR */ - { 29488, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 29506, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 29525, 0x000088E6 }, /* GL_STATIC_COPY */ - { 29540, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 29559, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 29574, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 29593, 0x000088E5 }, /* GL_STATIC_READ */ - { 29608, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 29627, 0x00001802 }, /* GL_STENCIL */ - { 29638, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 29664, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 29685, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 29710, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 29731, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 29756, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 29788, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 29824, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 29856, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 29892, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 29912, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 29939, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 29965, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 29981, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 30003, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 30026, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 30042, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 30058, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 30075, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 30098, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 30120, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 30142, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 30164, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 30185, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 30212, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 30239, 0x00000B97 }, /* GL_STENCIL_REF */ - { 30254, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 30270, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 30299, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 30321, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 30342, 0x00000C33 }, /* GL_STEREO */ - { 30352, 0x000088E2 }, /* GL_STREAM_COPY */ - { 30367, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 30386, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 30401, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 30420, 0x000088E1 }, /* GL_STREAM_READ */ - { 30435, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 30454, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 30471, 0x000084E7 }, /* GL_SUBTRACT */ - { 30483, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 30499, 0x00002001 }, /* GL_T */ - { 30504, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 30519, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 30538, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 30554, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 30569, 0x00002A27 }, /* GL_T2F_V3F */ - { 30580, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 30599, 0x00002A28 }, /* GL_T4F_V4F */ - { 30610, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 30633, 0x00001702 }, /* GL_TEXTURE */ - { 30644, 0x000084C0 }, /* GL_TEXTURE0 */ - { 30656, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 30672, 0x000084C1 }, /* GL_TEXTURE1 */ - { 30684, 0x000084CA }, /* GL_TEXTURE10 */ - { 30697, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 30714, 0x000084CB }, /* GL_TEXTURE11 */ - { 30727, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 30744, 0x000084CC }, /* GL_TEXTURE12 */ - { 30757, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 30774, 0x000084CD }, /* GL_TEXTURE13 */ - { 30787, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 30804, 0x000084CE }, /* GL_TEXTURE14 */ - { 30817, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 30834, 0x000084CF }, /* GL_TEXTURE15 */ - { 30847, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 30864, 0x000084D0 }, /* GL_TEXTURE16 */ - { 30877, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 30894, 0x000084D1 }, /* GL_TEXTURE17 */ - { 30907, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 30924, 0x000084D2 }, /* GL_TEXTURE18 */ - { 30937, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 30954, 0x000084D3 }, /* GL_TEXTURE19 */ - { 30967, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 30984, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 31000, 0x000084C2 }, /* GL_TEXTURE2 */ - { 31012, 0x000084D4 }, /* GL_TEXTURE20 */ - { 31025, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 31042, 0x000084D5 }, /* GL_TEXTURE21 */ - { 31055, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 31072, 0x000084D6 }, /* GL_TEXTURE22 */ - { 31085, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 31102, 0x000084D7 }, /* GL_TEXTURE23 */ - { 31115, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 31132, 0x000084D8 }, /* GL_TEXTURE24 */ - { 31145, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 31162, 0x000084D9 }, /* GL_TEXTURE25 */ - { 31175, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 31192, 0x000084DA }, /* GL_TEXTURE26 */ - { 31205, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 31222, 0x000084DB }, /* GL_TEXTURE27 */ - { 31235, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 31252, 0x000084DC }, /* GL_TEXTURE28 */ - { 31265, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 31282, 0x000084DD }, /* GL_TEXTURE29 */ - { 31295, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 31312, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 31328, 0x000084C3 }, /* GL_TEXTURE3 */ - { 31340, 0x000084DE }, /* GL_TEXTURE30 */ - { 31353, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 31370, 0x000084DF }, /* GL_TEXTURE31 */ - { 31383, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 31400, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 31416, 0x000084C4 }, /* GL_TEXTURE4 */ - { 31428, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 31444, 0x000084C5 }, /* GL_TEXTURE5 */ - { 31456, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 31472, 0x000084C6 }, /* GL_TEXTURE6 */ - { 31484, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 31500, 0x000084C7 }, /* GL_TEXTURE7 */ - { 31512, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 31528, 0x000084C8 }, /* GL_TEXTURE8 */ - { 31540, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 31556, 0x000084C9 }, /* GL_TEXTURE9 */ - { 31568, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 31584, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 31598, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 31622, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 31636, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 31660, 0x0000806F }, /* GL_TEXTURE_3D */ - { 31674, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 31696, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 31722, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 31744, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 31766, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 31798, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 31820, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 31852, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 31874, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 31902, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 31934, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 31967, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 31999, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 32014, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 32035, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 32060, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 32078, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 32102, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 32133, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 32163, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 32193, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 32228, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 32259, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 32297, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 32324, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 32356, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 32390, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 32414, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 32442, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 32466, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 32494, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 32527, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 32551, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 32573, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 32595, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 32621, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 32655, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 32688, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 32725, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 32753, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 32785, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 32808, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 32846, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 32888, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 32919, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 32947, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 32977, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 33005, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 33025, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 33049, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 33080, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 33115, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 33146, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 33181, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 33212, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 33247, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 33278, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 33313, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 33344, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 33379, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 33410, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 33445, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 33462, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 33484, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 33510, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 33525, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 33546, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 33566, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 33592, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 33612, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 33629, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 33646, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 33663, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 33680, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 33705, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 33727, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 33753, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 33771, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 33797, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 33823, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 33853, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 33880, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 33905, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 33925, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 33949, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 33976, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 34003, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 34030, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 34056, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 34086, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 34108, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 34126, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 34156, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 34184, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 34212, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 34240, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 34261, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 34280, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 34302, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 34321, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 34341, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 34366, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 34390, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 34410, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 34434, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 34454, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 34477, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 34502, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 34536, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 34553, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 34571, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 34589, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 34607, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 34627, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 34646, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 34675, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 34692, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 34718, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 34748, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 34780, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 34810, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 34844, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 34860, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 34891, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 34926, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 34954, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 34986, 0x00000004 }, /* GL_TRIANGLES */ - { 34999, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 35015, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 35036, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 35054, 0x00000001 }, /* GL_TRUE */ - { 35062, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 35082, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 35105, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 35125, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 35146, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 35168, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 35190, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 35210, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 35231, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 35248, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 35275, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 35298, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 35314, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 35341, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 35365, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 35396, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 35420, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 35448, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 35466, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 35496, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 35522, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 35552, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 35578, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 35602, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 35630, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 35658, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 35685, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 35717, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 35748, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 35762, 0x00002A20 }, /* GL_V2F */ - { 35769, 0x00002A21 }, /* GL_V3F */ - { 35776, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 35795, 0x00001F00 }, /* GL_VENDOR */ - { 35805, 0x00001F02 }, /* GL_VERSION */ - { 35816, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 35832, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 35862, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 35893, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 35928, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 35952, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 35973, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 35996, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 36017, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 36044, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 36072, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 36100, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 36128, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 36156, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 36184, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 36212, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 36239, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 36266, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 36293, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 36320, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 36347, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 36374, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 36401, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 36428, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 36455, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 36493, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 36535, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 36566, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 36601, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 36635, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 36673, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 36704, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 36739, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 36767, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 36799, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 36829, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 36863, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 36891, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 36923, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 36943, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 36965, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 36994, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 37015, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 37044, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 37077, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 37109, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 37136, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 37167, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 37197, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 37214, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 37235, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 37262, 0x00000BA2 }, /* GL_VIEWPORT */ - { 37274, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 37290, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 37310, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 37341, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 37376, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 37404, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 37429, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 37456, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 37481, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 37505, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 37524, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 37538, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 37556, 0x00001506 }, /* GL_XOR */ - { 37563, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 37582, 0x00008757 }, /* GL_YCBCR_MESA */ - { 37596, 0x00000000 }, /* GL_ZERO */ - { 37604, 0x00000D16 }, /* GL_ZOOM_X */ - { 37614, 0x00000D17 }, /* GL_ZOOM_Y */ -}; - -static const unsigned reduced_enums[1284] = -{ - 434, /* GL_FALSE */ - 643, /* GL_LINES */ - 645, /* GL_LINE_LOOP */ - 652, /* GL_LINE_STRIP */ - 1639, /* GL_TRIANGLES */ - 1642, /* GL_TRIANGLE_STRIP */ - 1640, /* GL_TRIANGLE_FAN */ - 1209, /* GL_QUADS */ - 1211, /* GL_QUAD_STRIP */ - 1097, /* GL_POLYGON */ - 1109, /* GL_POLYGON_STIPPLE_BIT */ - 1062, /* GL_PIXEL_MODE_BIT */ - 630, /* GL_LIGHTING_BIT */ - 456, /* GL_FOG_BIT */ - 8, /* GL_ACCUM */ - 662, /* GL_LOAD */ - 1251, /* GL_RETURN */ - 935, /* GL_MULT */ - 23, /* GL_ADD */ - 951, /* GL_NEVER */ - 620, /* GL_LESS */ - 424, /* GL_EQUAL */ - 619, /* GL_LEQUAL */ - 545, /* GL_GREATER */ - 966, /* GL_NOTEQUAL */ - 520, /* GL_GEQUAL */ - 46, /* GL_ALWAYS */ - 1384, /* GL_SRC_COLOR */ - 995, /* GL_ONE_MINUS_SRC_COLOR */ - 1382, /* GL_SRC_ALPHA */ - 994, /* GL_ONE_MINUS_SRC_ALPHA */ - 405, /* GL_DST_ALPHA */ - 992, /* GL_ONE_MINUS_DST_ALPHA */ - 406, /* GL_DST_COLOR */ - 993, /* GL_ONE_MINUS_DST_COLOR */ - 1383, /* GL_SRC_ALPHA_SATURATE */ - 508, /* GL_FRONT_LEFT */ - 509, /* GL_FRONT_RIGHT */ - 68, /* GL_BACK_LEFT */ - 69, /* GL_BACK_RIGHT */ - 505, /* GL_FRONT */ - 67, /* GL_BACK */ - 618, /* GL_LEFT */ - 1291, /* GL_RIGHT */ - 506, /* GL_FRONT_AND_BACK */ - 62, /* GL_AUX0 */ - 63, /* GL_AUX1 */ - 64, /* GL_AUX2 */ - 65, /* GL_AUX3 */ - 610, /* GL_INVALID_ENUM */ - 613, /* GL_INVALID_VALUE */ - 612, /* GL_INVALID_OPERATION */ - 1385, /* GL_STACK_OVERFLOW */ - 1386, /* GL_STACK_UNDERFLOW */ - 1020, /* GL_OUT_OF_MEMORY */ - 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - 0, /* GL_2D */ - 2, /* GL_3D */ - 3, /* GL_3D_COLOR */ - 4, /* GL_3D_COLOR_TEXTURE */ - 6, /* GL_4D_COLOR_TEXTURE */ - 1040, /* GL_PASS_THROUGH_TOKEN */ - 1096, /* GL_POINT_TOKEN */ - 653, /* GL_LINE_TOKEN */ - 1110, /* GL_POLYGON_TOKEN */ - 73, /* GL_BITMAP_TOKEN */ - 404, /* GL_DRAW_PIXEL_TOKEN */ - 270, /* GL_COPY_PIXEL_TOKEN */ - 646, /* GL_LINE_RESET_TOKEN */ - 427, /* GL_EXP */ - 428, /* GL_EXP2 */ - 303, /* GL_CW */ - 115, /* GL_CCW */ - 136, /* GL_COEFF */ - 1017, /* GL_ORDER */ - 343, /* GL_DOMAIN */ - 278, /* GL_CURRENT_COLOR */ - 281, /* GL_CURRENT_INDEX */ - 287, /* GL_CURRENT_NORMAL */ - 299, /* GL_CURRENT_TEXTURE_COORDS */ - 292, /* GL_CURRENT_RASTER_COLOR */ - 294, /* GL_CURRENT_RASTER_INDEX */ - 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 295, /* GL_CURRENT_RASTER_POSITION */ - 296, /* GL_CURRENT_RASTER_POSITION_VALID */ - 293, /* GL_CURRENT_RASTER_DISTANCE */ - 1089, /* GL_POINT_SMOOTH */ - 1078, /* GL_POINT_SIZE */ - 1088, /* GL_POINT_SIZE_RANGE */ - 1079, /* GL_POINT_SIZE_GRANULARITY */ - 647, /* GL_LINE_SMOOTH */ - 654, /* GL_LINE_WIDTH */ - 656, /* GL_LINE_WIDTH_RANGE */ - 655, /* GL_LINE_WIDTH_GRANULARITY */ - 649, /* GL_LINE_STIPPLE */ - 650, /* GL_LINE_STIPPLE_PATTERN */ - 651, /* GL_LINE_STIPPLE_REPEAT */ - 661, /* GL_LIST_MODE */ - 820, /* GL_MAX_LIST_NESTING */ - 658, /* GL_LIST_BASE */ - 660, /* GL_LIST_INDEX */ - 1099, /* GL_POLYGON_MODE */ - 1106, /* GL_POLYGON_SMOOTH */ - 1108, /* GL_POLYGON_STIPPLE */ - 413, /* GL_EDGE_FLAG */ - 271, /* GL_CULL_FACE */ - 272, /* GL_CULL_FACE_MODE */ - 507, /* GL_FRONT_FACE */ - 629, /* GL_LIGHTING */ - 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 635, /* GL_LIGHT_MODEL_TWO_SIDE */ - 631, /* GL_LIGHT_MODEL_AMBIENT */ - 1337, /* GL_SHADE_MODEL */ - 167, /* GL_COLOR_MATERIAL_FACE */ - 168, /* GL_COLOR_MATERIAL_PARAMETER */ - 166, /* GL_COLOR_MATERIAL */ - 455, /* GL_FOG */ - 477, /* GL_FOG_INDEX */ - 473, /* GL_FOG_DENSITY */ - 481, /* GL_FOG_START */ - 475, /* GL_FOG_END */ - 478, /* GL_FOG_MODE */ - 457, /* GL_FOG_COLOR */ - 332, /* GL_DEPTH_RANGE */ - 337, /* GL_DEPTH_TEST */ - 340, /* GL_DEPTH_WRITEMASK */ - 320, /* GL_DEPTH_CLEAR_VALUE */ - 331, /* GL_DEPTH_FUNC */ - 12, /* GL_ACCUM_CLEAR_VALUE */ - 1420, /* GL_STENCIL_TEST */ - 1408, /* GL_STENCIL_CLEAR_VALUE */ - 1410, /* GL_STENCIL_FUNC */ - 1422, /* GL_STENCIL_VALUE_MASK */ - 1409, /* GL_STENCIL_FAIL */ - 1417, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1418, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1419, /* GL_STENCIL_REF */ - 1423, /* GL_STENCIL_WRITEMASK */ - 789, /* GL_MATRIX_MODE */ - 956, /* GL_NORMALIZE */ - 1729, /* GL_VIEWPORT */ - 930, /* GL_MODELVIEW_STACK_DEPTH */ - 1189, /* GL_PROJECTION_STACK_DEPTH */ - 1618, /* GL_TEXTURE_STACK_DEPTH */ - 928, /* GL_MODELVIEW_MATRIX */ - 1188, /* GL_PROJECTION_MATRIX */ - 1603, /* GL_TEXTURE_MATRIX */ - 60, /* GL_ATTRIB_STACK_DEPTH */ - 126, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - 43, /* GL_ALPHA_TEST */ - 44, /* GL_ALPHA_TEST_FUNC */ - 45, /* GL_ALPHA_TEST_REF */ - 342, /* GL_DITHER */ - 77, /* GL_BLEND_DST */ - 85, /* GL_BLEND_SRC */ - 74, /* GL_BLEND */ - 664, /* GL_LOGIC_OP_MODE */ - 584, /* GL_INDEX_LOGIC_OP */ - 165, /* GL_COLOR_LOGIC_OP */ - 66, /* GL_AUX_BUFFERS */ - 353, /* GL_DRAW_BUFFER */ - 1221, /* GL_READ_BUFFER */ - 1318, /* GL_SCISSOR_BOX */ - 1319, /* GL_SCISSOR_TEST */ - 583, /* GL_INDEX_CLEAR_VALUE */ - 588, /* GL_INDEX_WRITEMASK */ - 162, /* GL_COLOR_CLEAR_VALUE */ - 204, /* GL_COLOR_WRITEMASK */ - 585, /* GL_INDEX_MODE */ - 1285, /* GL_RGBA_MODE */ - 352, /* GL_DOUBLEBUFFER */ - 1424, /* GL_STEREO */ - 1244, /* GL_RENDER_MODE */ - 1041, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1090, /* GL_POINT_SMOOTH_HINT */ - 648, /* GL_LINE_SMOOTH_HINT */ - 1107, /* GL_POLYGON_SMOOTH_HINT */ - 476, /* GL_FOG_HINT */ - 1584, /* GL_TEXTURE_GEN_S */ - 1585, /* GL_TEXTURE_GEN_T */ - 1583, /* GL_TEXTURE_GEN_R */ - 1582, /* GL_TEXTURE_GEN_Q */ - 1054, /* GL_PIXEL_MAP_I_TO_I */ - 1060, /* GL_PIXEL_MAP_S_TO_S */ - 1056, /* GL_PIXEL_MAP_I_TO_R */ - 1052, /* GL_PIXEL_MAP_I_TO_G */ - 1050, /* GL_PIXEL_MAP_I_TO_B */ - 1048, /* GL_PIXEL_MAP_I_TO_A */ - 1058, /* GL_PIXEL_MAP_R_TO_R */ - 1046, /* GL_PIXEL_MAP_G_TO_G */ - 1044, /* GL_PIXEL_MAP_B_TO_B */ - 1042, /* GL_PIXEL_MAP_A_TO_A */ - 1055, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1061, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1057, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1053, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1051, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1049, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1059, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1047, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1045, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1043, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1651, /* GL_UNPACK_SWAP_BYTES */ - 1646, /* GL_UNPACK_LSB_FIRST */ - 1647, /* GL_UNPACK_ROW_LENGTH */ - 1650, /* GL_UNPACK_SKIP_ROWS */ - 1649, /* GL_UNPACK_SKIP_PIXELS */ - 1644, /* GL_UNPACK_ALIGNMENT */ - 1029, /* GL_PACK_SWAP_BYTES */ - 1024, /* GL_PACK_LSB_FIRST */ - 1025, /* GL_PACK_ROW_LENGTH */ - 1028, /* GL_PACK_SKIP_ROWS */ - 1027, /* GL_PACK_SKIP_PIXELS */ - 1021, /* GL_PACK_ALIGNMENT */ - 742, /* GL_MAP_COLOR */ - 743, /* GL_MAP_STENCIL */ - 587, /* GL_INDEX_SHIFT */ - 586, /* GL_INDEX_OFFSET */ - 1233, /* GL_RED_SCALE */ - 1231, /* GL_RED_BIAS */ - 1746, /* GL_ZOOM_X */ - 1747, /* GL_ZOOM_Y */ - 549, /* GL_GREEN_SCALE */ - 547, /* GL_GREEN_BIAS */ - 91, /* GL_BLUE_SCALE */ - 89, /* GL_BLUE_BIAS */ - 42, /* GL_ALPHA_SCALE */ - 40, /* GL_ALPHA_BIAS */ - 333, /* GL_DEPTH_SCALE */ - 314, /* GL_DEPTH_BIAS */ - 815, /* GL_MAX_EVAL_ORDER */ - 819, /* GL_MAX_LIGHTS */ - 798, /* GL_MAX_CLIP_PLANES */ - 863, /* GL_MAX_TEXTURE_SIZE */ - 825, /* GL_MAX_PIXEL_MAP_TABLE */ - 794, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 822, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 823, /* GL_MAX_NAME_STACK_DEPTH */ - 851, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 864, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 878, /* GL_MAX_VIEWPORT_DIMS */ - 795, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1431, /* GL_SUBPIXEL_BITS */ - 582, /* GL_INDEX_BITS */ - 1232, /* GL_RED_BITS */ - 548, /* GL_GREEN_BITS */ - 90, /* GL_BLUE_BITS */ - 41, /* GL_ALPHA_BITS */ - 315, /* GL_DEPTH_BITS */ - 1406, /* GL_STENCIL_BITS */ - 14, /* GL_ACCUM_RED_BITS */ - 13, /* GL_ACCUM_GREEN_BITS */ - 10, /* GL_ACCUM_BLUE_BITS */ - 9, /* GL_ACCUM_ALPHA_BITS */ - 944, /* GL_NAME_STACK_DEPTH */ - 61, /* GL_AUTO_NORMAL */ - 688, /* GL_MAP1_COLOR_4 */ - 691, /* GL_MAP1_INDEX */ - 692, /* GL_MAP1_NORMAL */ - 693, /* GL_MAP1_TEXTURE_COORD_1 */ - 694, /* GL_MAP1_TEXTURE_COORD_2 */ - 695, /* GL_MAP1_TEXTURE_COORD_3 */ - 696, /* GL_MAP1_TEXTURE_COORD_4 */ - 697, /* GL_MAP1_VERTEX_3 */ - 698, /* GL_MAP1_VERTEX_4 */ - 715, /* GL_MAP2_COLOR_4 */ - 718, /* GL_MAP2_INDEX */ - 719, /* GL_MAP2_NORMAL */ - 720, /* GL_MAP2_TEXTURE_COORD_1 */ - 721, /* GL_MAP2_TEXTURE_COORD_2 */ - 722, /* GL_MAP2_TEXTURE_COORD_3 */ - 723, /* GL_MAP2_TEXTURE_COORD_4 */ - 724, /* GL_MAP2_VERTEX_3 */ - 725, /* GL_MAP2_VERTEX_4 */ - 689, /* GL_MAP1_GRID_DOMAIN */ - 690, /* GL_MAP1_GRID_SEGMENTS */ - 716, /* GL_MAP2_GRID_DOMAIN */ - 717, /* GL_MAP2_GRID_SEGMENTS */ - 1508, /* GL_TEXTURE_1D */ - 1510, /* GL_TEXTURE_2D */ - 437, /* GL_FEEDBACK_BUFFER_POINTER */ - 438, /* GL_FEEDBACK_BUFFER_SIZE */ - 439, /* GL_FEEDBACK_BUFFER_TYPE */ - 1328, /* GL_SELECTION_BUFFER_POINTER */ - 1329, /* GL_SELECTION_BUFFER_SIZE */ - 1621, /* GL_TEXTURE_WIDTH */ - 1589, /* GL_TEXTURE_HEIGHT */ - 1545, /* GL_TEXTURE_COMPONENTS */ - 1529, /* GL_TEXTURE_BORDER_COLOR */ - 1528, /* GL_TEXTURE_BORDER */ - 344, /* GL_DONT_CARE */ - 435, /* GL_FASTEST */ - 952, /* GL_NICEST */ - 47, /* GL_AMBIENT */ - 341, /* GL_DIFFUSE */ - 1371, /* GL_SPECULAR */ - 1111, /* GL_POSITION */ - 1374, /* GL_SPOT_DIRECTION */ - 1375, /* GL_SPOT_EXPONENT */ - 1373, /* GL_SPOT_CUTOFF */ - 244, /* GL_CONSTANT_ATTENUATION */ - 638, /* GL_LINEAR_ATTENUATION */ - 1208, /* GL_QUADRATIC_ATTENUATION */ - 218, /* GL_COMPILE */ - 219, /* GL_COMPILE_AND_EXECUTE */ - 110, /* GL_BYTE */ - 1652, /* GL_UNSIGNED_BYTE */ - 1342, /* GL_SHORT */ - 1661, /* GL_UNSIGNED_SHORT */ - 590, /* GL_INT */ - 1655, /* GL_UNSIGNED_INT */ - 442, /* GL_FLOAT */ - 1, /* GL_2_BYTES */ - 5, /* GL_3_BYTES */ - 7, /* GL_4_BYTES */ - 351, /* GL_DOUBLE */ - 122, /* GL_CLEAR */ - 49, /* GL_AND */ - 51, /* GL_AND_REVERSE */ - 268, /* GL_COPY */ - 50, /* GL_AND_INVERTED */ - 954, /* GL_NOOP */ - 1742, /* GL_XOR */ - 1016, /* GL_OR */ - 955, /* GL_NOR */ - 425, /* GL_EQUIV */ - 616, /* GL_INVERT */ - 1019, /* GL_OR_REVERSE */ - 269, /* GL_COPY_INVERTED */ - 1018, /* GL_OR_INVERTED */ - 945, /* GL_NAND */ - 1333, /* GL_SET */ - 422, /* GL_EMISSION */ - 1341, /* GL_SHININESS */ - 48, /* GL_AMBIENT_AND_DIFFUSE */ - 164, /* GL_COLOR_INDEXES */ - 895, /* GL_MODELVIEW */ - 1187, /* GL_PROJECTION */ - 1443, /* GL_TEXTURE */ - 137, /* GL_COLOR */ - 312, /* GL_DEPTH */ - 1393, /* GL_STENCIL */ - 163, /* GL_COLOR_INDEX */ - 1411, /* GL_STENCIL_INDEX */ - 321, /* GL_DEPTH_COMPONENT */ - 1228, /* GL_RED */ - 546, /* GL_GREEN */ - 88, /* GL_BLUE */ - 31, /* GL_ALPHA */ - 1252, /* GL_RGB */ - 1271, /* GL_RGBA */ - 666, /* GL_LUMINANCE */ - 687, /* GL_LUMINANCE_ALPHA */ - 72, /* GL_BITMAP */ - 1067, /* GL_POINT */ - 636, /* GL_LINE */ - 440, /* GL_FILL */ - 1237, /* GL_RENDER */ - 436, /* GL_FEEDBACK */ - 1327, /* GL_SELECT */ - 441, /* GL_FLAT */ - 1346, /* GL_SMOOTH */ - 617, /* GL_KEEP */ - 1246, /* GL_REPLACE */ - 573, /* GL_INCR */ - 308, /* GL_DECR */ - 1676, /* GL_VENDOR */ - 1243, /* GL_RENDERER */ - 1677, /* GL_VERSION */ - 429, /* GL_EXTENSIONS */ - 1292, /* GL_S */ - 1434, /* GL_T */ - 1218, /* GL_R */ - 1207, /* GL_Q */ - 931, /* GL_MODULATE */ - 307, /* GL_DECAL */ - 1579, /* GL_TEXTURE_ENV_MODE */ - 1578, /* GL_TEXTURE_ENV_COLOR */ - 1577, /* GL_TEXTURE_ENV */ - 430, /* GL_EYE_LINEAR */ - 978, /* GL_OBJECT_LINEAR */ - 1372, /* GL_SPHERE_MAP */ - 1581, /* GL_TEXTURE_GEN_MODE */ - 980, /* GL_OBJECT_PLANE */ - 431, /* GL_EYE_PLANE */ - 946, /* GL_NEAREST */ - 637, /* GL_LINEAR */ - 950, /* GL_NEAREST_MIPMAP_NEAREST */ - 642, /* GL_LINEAR_MIPMAP_NEAREST */ - 949, /* GL_NEAREST_MIPMAP_LINEAR */ - 641, /* GL_LINEAR_MIPMAP_LINEAR */ - 1602, /* GL_TEXTURE_MAG_FILTER */ - 1610, /* GL_TEXTURE_MIN_FILTER */ - 1623, /* GL_TEXTURE_WRAP_S */ - 1624, /* GL_TEXTURE_WRAP_T */ - 116, /* GL_CLAMP */ - 1245, /* GL_REPEAT */ - 1105, /* GL_POLYGON_OFFSET_UNITS */ - 1104, /* GL_POLYGON_OFFSET_POINT */ - 1103, /* GL_POLYGON_OFFSET_LINE */ - 1219, /* GL_R3_G3_B2 */ - 1673, /* GL_V2F */ - 1674, /* GL_V3F */ - 113, /* GL_C4UB_V2F */ - 114, /* GL_C4UB_V3F */ - 111, /* GL_C3F_V3F */ - 943, /* GL_N3F_V3F */ - 112, /* GL_C4F_N3F_V3F */ - 1439, /* GL_T2F_V3F */ - 1441, /* GL_T4F_V4F */ - 1437, /* GL_T2F_C4UB_V3F */ - 1435, /* GL_T2F_C3F_V3F */ - 1438, /* GL_T2F_N3F_V3F */ - 1436, /* GL_T2F_C4F_N3F_V3F */ - 1440, /* GL_T4F_C4F_N3F_V4F */ - 129, /* GL_CLIP_PLANE0 */ - 130, /* GL_CLIP_PLANE1 */ - 131, /* GL_CLIP_PLANE2 */ - 132, /* GL_CLIP_PLANE3 */ - 133, /* GL_CLIP_PLANE4 */ - 134, /* GL_CLIP_PLANE5 */ - 621, /* GL_LIGHT0 */ - 622, /* GL_LIGHT1 */ - 623, /* GL_LIGHT2 */ - 624, /* GL_LIGHT3 */ - 625, /* GL_LIGHT4 */ - 626, /* GL_LIGHT5 */ - 627, /* GL_LIGHT6 */ - 628, /* GL_LIGHT7 */ - 550, /* GL_HINT_BIT */ - 246, /* GL_CONSTANT_COLOR */ - 990, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 241, /* GL_CONSTANT_ALPHA */ - 988, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - 75, /* GL_BLEND_COLOR */ - 510, /* GL_FUNC_ADD */ - 879, /* GL_MIN */ - 791, /* GL_MAX */ - 80, /* GL_BLEND_EQUATION */ - 514, /* GL_FUNC_SUBTRACT */ - 512, /* GL_FUNC_REVERSE_SUBTRACT */ - 249, /* GL_CONVOLUTION_1D */ - 250, /* GL_CONVOLUTION_2D */ - 1330, /* GL_SEPARABLE_2D */ - 253, /* GL_CONVOLUTION_BORDER_MODE */ - 257, /* GL_CONVOLUTION_FILTER_SCALE */ - 255, /* GL_CONVOLUTION_FILTER_BIAS */ - 1229, /* GL_REDUCE */ - 259, /* GL_CONVOLUTION_FORMAT */ - 263, /* GL_CONVOLUTION_WIDTH */ - 261, /* GL_CONVOLUTION_HEIGHT */ - 806, /* GL_MAX_CONVOLUTION_WIDTH */ - 804, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1144, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1140, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1135, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1131, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1142, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1138, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1133, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1129, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 551, /* GL_HISTOGRAM */ - 1191, /* GL_PROXY_HISTOGRAM */ - 567, /* GL_HISTOGRAM_WIDTH */ - 557, /* GL_HISTOGRAM_FORMAT */ - 563, /* GL_HISTOGRAM_RED_SIZE */ - 559, /* GL_HISTOGRAM_GREEN_SIZE */ - 554, /* GL_HISTOGRAM_BLUE_SIZE */ - 552, /* GL_HISTOGRAM_ALPHA_SIZE */ - 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 565, /* GL_HISTOGRAM_SINK */ - 880, /* GL_MINMAX */ - 882, /* GL_MINMAX_FORMAT */ - 884, /* GL_MINMAX_SINK */ - 1442, /* GL_TABLE_TOO_LARGE_EXT */ - 1654, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1663, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1665, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1659, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1656, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1102, /* GL_POLYGON_OFFSET_FILL */ - 1101, /* GL_POLYGON_OFFSET_FACTOR */ - 1100, /* GL_POLYGON_OFFSET_BIAS */ - 1249, /* GL_RESCALE_NORMAL */ - 36, /* GL_ALPHA4 */ - 38, /* GL_ALPHA8 */ - 32, /* GL_ALPHA12 */ - 34, /* GL_ALPHA16 */ - 677, /* GL_LUMINANCE4 */ - 683, /* GL_LUMINANCE8 */ - 667, /* GL_LUMINANCE12 */ - 673, /* GL_LUMINANCE16 */ - 678, /* GL_LUMINANCE4_ALPHA4 */ - 681, /* GL_LUMINANCE6_ALPHA2 */ - 684, /* GL_LUMINANCE8_ALPHA8 */ - 670, /* GL_LUMINANCE12_ALPHA4 */ - 668, /* GL_LUMINANCE12_ALPHA12 */ - 674, /* GL_LUMINANCE16_ALPHA16 */ - 591, /* GL_INTENSITY */ - 596, /* GL_INTENSITY4 */ - 598, /* GL_INTENSITY8 */ - 592, /* GL_INTENSITY12 */ - 594, /* GL_INTENSITY16 */ - 1261, /* GL_RGB2_EXT */ - 1262, /* GL_RGB4 */ - 1265, /* GL_RGB5 */ - 1269, /* GL_RGB8 */ - 1253, /* GL_RGB10 */ - 1257, /* GL_RGB12 */ - 1259, /* GL_RGB16 */ - 1276, /* GL_RGBA2 */ - 1278, /* GL_RGBA4 */ - 1266, /* GL_RGB5_A1 */ - 1282, /* GL_RGBA8 */ - 1254, /* GL_RGB10_A2 */ - 1272, /* GL_RGBA12 */ - 1274, /* GL_RGBA16 */ - 1615, /* GL_TEXTURE_RED_SIZE */ - 1587, /* GL_TEXTURE_GREEN_SIZE */ - 1526, /* GL_TEXTURE_BLUE_SIZE */ - 1513, /* GL_TEXTURE_ALPHA_SIZE */ - 1600, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1591, /* GL_TEXTURE_INTENSITY_SIZE */ - 1247, /* GL_REPLACE_EXT */ - 1195, /* GL_PROXY_TEXTURE_1D */ - 1198, /* GL_PROXY_TEXTURE_2D */ - 1619, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1612, /* GL_TEXTURE_PRIORITY */ - 1617, /* GL_TEXTURE_RESIDENT */ - 1516, /* GL_TEXTURE_BINDING_1D */ - 1518, /* GL_TEXTURE_BINDING_2D */ - 1520, /* GL_TEXTURE_BINDING_3D */ - 1026, /* GL_PACK_SKIP_IMAGES */ - 1022, /* GL_PACK_IMAGE_HEIGHT */ - 1648, /* GL_UNPACK_SKIP_IMAGES */ - 1645, /* GL_UNPACK_IMAGE_HEIGHT */ - 1512, /* GL_TEXTURE_3D */ - 1201, /* GL_PROXY_TEXTURE_3D */ - 1574, /* GL_TEXTURE_DEPTH */ - 1622, /* GL_TEXTURE_WRAP_R */ - 792, /* GL_MAX_3D_TEXTURE_SIZE */ - 1678, /* GL_VERTEX_ARRAY */ - 957, /* GL_NORMAL_ARRAY */ - 138, /* GL_COLOR_ARRAY */ - 576, /* GL_INDEX_ARRAY */ - 1553, /* GL_TEXTURE_COORD_ARRAY */ - 414, /* GL_EDGE_FLAG_ARRAY */ - 1683, /* GL_VERTEX_ARRAY_SIZE */ - 1685, /* GL_VERTEX_ARRAY_TYPE */ - 1684, /* GL_VERTEX_ARRAY_STRIDE */ - 962, /* GL_NORMAL_ARRAY_TYPE */ - 961, /* GL_NORMAL_ARRAY_STRIDE */ - 142, /* GL_COLOR_ARRAY_SIZE */ - 144, /* GL_COLOR_ARRAY_TYPE */ - 143, /* GL_COLOR_ARRAY_STRIDE */ - 581, /* GL_INDEX_ARRAY_TYPE */ - 580, /* GL_INDEX_ARRAY_STRIDE */ - 1557, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1559, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1558, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1682, /* GL_VERTEX_ARRAY_POINTER */ - 960, /* GL_NORMAL_ARRAY_POINTER */ - 141, /* GL_COLOR_ARRAY_POINTER */ - 579, /* GL_INDEX_ARRAY_POINTER */ - 1556, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 417, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 936, /* GL_MULTISAMPLE */ - 1304, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1306, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1311, /* GL_SAMPLE_COVERAGE */ - 1308, /* GL_SAMPLE_BUFFERS */ - 1299, /* GL_SAMPLES */ - 1315, /* GL_SAMPLE_COVERAGE_VALUE */ - 1313, /* GL_SAMPLE_COVERAGE_INVERT */ - 169, /* GL_COLOR_MATRIX */ - 171, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 800, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1127, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1123, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1118, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1114, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1125, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1121, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1116, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1112, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1536, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1202, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1538, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - 79, /* GL_BLEND_DST_RGB */ - 87, /* GL_BLEND_SRC_RGB */ - 78, /* GL_BLEND_DST_ALPHA */ - 86, /* GL_BLEND_SRC_ALPHA */ - 175, /* GL_COLOR_TABLE */ - 1137, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1120, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1190, /* GL_PROXY_COLOR_TABLE */ - 1194, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1193, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 199, /* GL_COLOR_TABLE_SCALE */ - 179, /* GL_COLOR_TABLE_BIAS */ - 184, /* GL_COLOR_TABLE_FORMAT */ - 201, /* GL_COLOR_TABLE_WIDTH */ - 196, /* GL_COLOR_TABLE_RED_SIZE */ - 187, /* GL_COLOR_TABLE_GREEN_SIZE */ - 181, /* GL_COLOR_TABLE_BLUE_SIZE */ - 176, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 193, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 190, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - 70, /* GL_BGR */ - 71, /* GL_BGRA */ - 814, /* GL_MAX_ELEMENTS_VERTICES */ - 813, /* GL_MAX_ELEMENTS_INDICES */ - 1590, /* GL_TEXTURE_INDEX_SIZE_EXT */ - 135, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1084, /* GL_POINT_SIZE_MIN */ - 1080, /* GL_POINT_SIZE_MAX */ - 1074, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1070, /* GL_POINT_DISTANCE_ATTENUATION */ - 117, /* GL_CLAMP_TO_BORDER */ - 120, /* GL_CLAMP_TO_EDGE */ - 1611, /* GL_TEXTURE_MIN_LOD */ - 1609, /* GL_TEXTURE_MAX_LOD */ - 1515, /* GL_TEXTURE_BASE_LEVEL */ - 1608, /* GL_TEXTURE_MAX_LEVEL */ - 570, /* GL_IGNORE_BORDER_HP */ - 245, /* GL_CONSTANT_BORDER_HP */ - 1248, /* GL_REPLICATE_BORDER_HP */ - 251, /* GL_CONVOLUTION_BORDER_COLOR */ - 985, /* GL_OCCLUSION_TEST_HP */ - 986, /* GL_OCCLUSION_TEST_RESULT_HP */ - 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1530, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1532, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1534, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1535, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1533, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1531, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 796, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 797, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1147, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1149, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1146, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1148, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1598, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1599, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1597, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 516, /* GL_GENERATE_MIPMAP */ - 517, /* GL_GENERATE_MIPMAP_HINT */ - 479, /* GL_FOG_OFFSET_SGIX */ - 480, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1544, /* GL_TEXTURE_COMPARE_SGIX */ - 1543, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1594, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1586, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 322, /* GL_DEPTH_COMPONENT16 */ - 325, /* GL_DEPTH_COMPONENT24 */ - 328, /* GL_DEPTH_COMPONENT32 */ - 273, /* GL_CULL_VERTEX_EXT */ - 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1739, /* GL_WRAP_BORDER_SUN */ - 1537, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1343, /* GL_SINGLE_COLOR */ - 1331, /* GL_SEPARATE_SPECULAR_COLOR */ - 1340, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1653, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1666, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1667, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1664, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1662, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1660, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1658, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1606, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1607, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1605, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 887, /* GL_MIRRORED_REPEAT */ - 1287, /* GL_RGB_S3TC */ - 1264, /* GL_RGB4_S3TC */ - 1286, /* GL_RGBA_S3TC */ - 1281, /* GL_RGBA4_S3TC */ - 1284, /* GL_RGBA_DXT5_S3TC */ - 1279, /* GL_RGBA4_DXT5_S3TC */ - 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 948, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 947, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 466, /* GL_FOG_COORDINATE_SOURCE */ - 458, /* GL_FOG_COORD */ - 482, /* GL_FRAGMENT_DEPTH */ - 279, /* GL_CURRENT_FOG_COORD */ - 465, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 464, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 463, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 460, /* GL_FOG_COORDINATE_ARRAY */ - 173, /* GL_COLOR_SUM */ - 298, /* GL_CURRENT_SECONDARY_COLOR */ - 1324, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1326, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1325, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1323, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1320, /* GL_SECONDARY_COLOR_ARRAY */ - 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - 28, /* GL_ALIASED_POINT_SIZE_RANGE */ - 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1444, /* GL_TEXTURE0 */ - 1446, /* GL_TEXTURE1 */ - 1468, /* GL_TEXTURE2 */ - 1490, /* GL_TEXTURE3 */ - 1496, /* GL_TEXTURE4 */ - 1498, /* GL_TEXTURE5 */ - 1500, /* GL_TEXTURE6 */ - 1502, /* GL_TEXTURE7 */ - 1504, /* GL_TEXTURE8 */ - 1506, /* GL_TEXTURE9 */ - 1447, /* GL_TEXTURE10 */ - 1449, /* GL_TEXTURE11 */ - 1451, /* GL_TEXTURE12 */ - 1453, /* GL_TEXTURE13 */ - 1455, /* GL_TEXTURE14 */ - 1457, /* GL_TEXTURE15 */ - 1459, /* GL_TEXTURE16 */ - 1461, /* GL_TEXTURE17 */ - 1463, /* GL_TEXTURE18 */ - 1465, /* GL_TEXTURE19 */ - 1469, /* GL_TEXTURE20 */ - 1471, /* GL_TEXTURE21 */ - 1473, /* GL_TEXTURE22 */ - 1475, /* GL_TEXTURE23 */ - 1477, /* GL_TEXTURE24 */ - 1479, /* GL_TEXTURE25 */ - 1481, /* GL_TEXTURE26 */ - 1483, /* GL_TEXTURE27 */ - 1485, /* GL_TEXTURE28 */ - 1487, /* GL_TEXTURE29 */ - 1491, /* GL_TEXTURE30 */ - 1493, /* GL_TEXTURE31 */ - 18, /* GL_ACTIVE_TEXTURE */ - 123, /* GL_CLIENT_ACTIVE_TEXTURE */ - 865, /* GL_MAX_TEXTURE_UNITS */ - 1632, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1635, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1637, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1629, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1432, /* GL_SUBTRACT */ - 854, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - 221, /* GL_COMPRESSED_ALPHA */ - 225, /* GL_COMPRESSED_LUMINANCE */ - 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 223, /* GL_COMPRESSED_INTENSITY */ - 229, /* GL_COMPRESSED_RGB */ - 230, /* GL_COMPRESSED_RGBA */ - 1551, /* GL_TEXTURE_COMPRESSION_HINT */ - 1613, /* GL_TEXTURE_RECTANGLE_ARB */ - 1523, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1205, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 852, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 334, /* GL_DEPTH_STENCIL_NV */ - 1657, /* GL_UNSIGNED_INT_24_8_NV */ - 861, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1604, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 862, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1580, /* GL_TEXTURE_FILTER_CONTROL */ - 1595, /* GL_TEXTURE_LOD_BIAS */ - 206, /* GL_COMBINE4 */ - 855, /* GL_MAX_SHININESS_NV */ - 856, /* GL_MAX_SPOT_EXPONENT_NV */ - 574, /* GL_INCR_WRAP */ - 309, /* GL_DECR_WRAP */ - 907, /* GL_MODELVIEW1_ARB */ - 963, /* GL_NORMAL_MAP */ - 1234, /* GL_REFLECTION_MAP */ - 1560, /* GL_TEXTURE_CUBE_MAP */ - 1521, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1568, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1562, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1570, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1564, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1572, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1566, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1203, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 808, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 942, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 474, /* GL_FOG_DISTANCE_MODE_NV */ - 433, /* GL_EYE_RADIAL_NV */ - 432, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 205, /* GL_COMBINE */ - 212, /* GL_COMBINE_RGB */ - 207, /* GL_COMBINE_ALPHA */ - 1288, /* GL_RGB_SCALE */ - 24, /* GL_ADD_SIGNED */ - 601, /* GL_INTERPOLATE */ - 240, /* GL_CONSTANT */ - 1153, /* GL_PRIMARY_COLOR */ - 1150, /* GL_PREVIOUS */ - 1354, /* GL_SOURCE0_RGB */ - 1360, /* GL_SOURCE1_RGB */ - 1366, /* GL_SOURCE2_RGB */ - 1370, /* GL_SOURCE3_RGB_NV */ - 1351, /* GL_SOURCE0_ALPHA */ - 1357, /* GL_SOURCE1_ALPHA */ - 1363, /* GL_SOURCE2_ALPHA */ - 1369, /* GL_SOURCE3_ALPHA_NV */ - 999, /* GL_OPERAND0_RGB */ - 1005, /* GL_OPERAND1_RGB */ - 1011, /* GL_OPERAND2_RGB */ - 1015, /* GL_OPERAND3_RGB_NV */ - 996, /* GL_OPERAND0_ALPHA */ - 1002, /* GL_OPERAND1_ALPHA */ - 1008, /* GL_OPERAND2_ALPHA */ - 1014, /* GL_OPERAND3_ALPHA_NV */ - 1679, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1743, /* GL_YCBCR_422_APPLE */ - 1668, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1670, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1345, /* GL_SLICE_ACCUM_SUN */ - 1210, /* GL_QUAD_MESH_SUN */ - 1641, /* GL_TRIANGLE_MESH_SUN */ - 1717, /* GL_VERTEX_PROGRAM_ARB */ - 1728, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1704, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1710, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1712, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1714, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 300, /* GL_CURRENT_VERTEX_ATTRIB */ - 1166, /* GL_PROGRAM_LENGTH_ARB */ - 1180, /* GL_PROGRAM_STRING_ARB */ - 929, /* GL_MODELVIEW_PROJECTION_NV */ - 569, /* GL_IDENTITY_NV */ - 614, /* GL_INVERSE_NV */ - 1634, /* GL_TRANSPOSE_NV */ - 615, /* GL_INVERSE_TRANSPOSE_NV */ - 838, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 837, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 745, /* GL_MATRIX0_NV */ - 757, /* GL_MATRIX1_NV */ - 769, /* GL_MATRIX2_NV */ - 773, /* GL_MATRIX3_NV */ - 775, /* GL_MATRIX4_NV */ - 777, /* GL_MATRIX5_NV */ - 779, /* GL_MATRIX6_NV */ - 781, /* GL_MATRIX7_NV */ - 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 282, /* GL_CURRENT_MATRIX_ARB */ - 1720, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1723, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1178, /* GL_PROGRAM_PARAMETER_NV */ - 1708, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1182, /* GL_PROGRAM_TARGET_NV */ - 1179, /* GL_PROGRAM_RESIDENT_NV */ - 1626, /* GL_TRACK_MATRIX_NV */ - 1627, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1718, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1160, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 319, /* GL_DEPTH_CLAMP_NV */ - 1686, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1693, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1694, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1695, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1696, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1697, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1698, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1699, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1700, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1701, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1687, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1688, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1689, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1690, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1691, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1692, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1159, /* GL_PROGRAM_BINDING_ARB */ - 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1549, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1546, /* GL_TEXTURE_COMPRESSED */ - 968, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 239, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 877, /* GL_MAX_VERTEX_UNITS_ARB */ - 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1738, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1716, /* GL_VERTEX_BLEND_ARB */ - 302, /* GL_CURRENT_WEIGHT_ARB */ - 1737, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1736, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1735, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1734, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1731, /* GL_WEIGHT_ARRAY_ARB */ - 345, /* GL_DOT3_RGB */ - 346, /* GL_DOT3_RGBA */ - 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 937, /* GL_MULTISAMPLE_3DFX */ - 1309, /* GL_SAMPLE_BUFFERS_3DFX */ - 1300, /* GL_SAMPLES_3DFX */ - 918, /* GL_MODELVIEW2_ARB */ - 921, /* GL_MODELVIEW3_ARB */ - 922, /* GL_MODELVIEW4_ARB */ - 923, /* GL_MODELVIEW5_ARB */ - 924, /* GL_MODELVIEW6_ARB */ - 925, /* GL_MODELVIEW7_ARB */ - 926, /* GL_MODELVIEW8_ARB */ - 927, /* GL_MODELVIEW9_ARB */ - 897, /* GL_MODELVIEW10_ARB */ - 898, /* GL_MODELVIEW11_ARB */ - 899, /* GL_MODELVIEW12_ARB */ - 900, /* GL_MODELVIEW13_ARB */ - 901, /* GL_MODELVIEW14_ARB */ - 902, /* GL_MODELVIEW15_ARB */ - 903, /* GL_MODELVIEW16_ARB */ - 904, /* GL_MODELVIEW17_ARB */ - 905, /* GL_MODELVIEW18_ARB */ - 906, /* GL_MODELVIEW19_ARB */ - 908, /* GL_MODELVIEW20_ARB */ - 909, /* GL_MODELVIEW21_ARB */ - 910, /* GL_MODELVIEW22_ARB */ - 911, /* GL_MODELVIEW23_ARB */ - 912, /* GL_MODELVIEW24_ARB */ - 913, /* GL_MODELVIEW25_ARB */ - 914, /* GL_MODELVIEW26_ARB */ - 915, /* GL_MODELVIEW27_ARB */ - 916, /* GL_MODELVIEW28_ARB */ - 917, /* GL_MODELVIEW29_ARB */ - 919, /* GL_MODELVIEW30_ARB */ - 920, /* GL_MODELVIEW31_ARB */ - 350, /* GL_DOT3_RGB_EXT */ - 348, /* GL_DOT3_RGBA_EXT */ - 891, /* GL_MIRROR_CLAMP_EXT */ - 894, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 932, /* GL_MODULATE_ADD_ATI */ - 933, /* GL_MODULATE_SIGNED_ADD_ATI */ - 934, /* GL_MODULATE_SUBTRACT_ATI */ - 1744, /* GL_YCBCR_MESA */ - 1023, /* GL_PACK_INVERT_MESA */ - 305, /* GL_DEBUG_OBJECT_MESA */ - 306, /* GL_DEBUG_PRINT_MESA */ - 304, /* GL_DEBUG_ASSERT_MESA */ - 106, /* GL_BUFFER_SIZE */ - 108, /* GL_BUFFER_USAGE */ - 1397, /* GL_STENCIL_BACK_FUNC */ - 1395, /* GL_STENCIL_BACK_FAIL */ - 1399, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1401, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 483, /* GL_FRAGMENT_PROGRAM_ARB */ - 1157, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1185, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1184, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1169, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1175, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1174, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 827, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 850, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 849, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 840, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 846, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 810, /* GL_MAX_DRAW_BUFFERS */ - 354, /* GL_DRAW_BUFFER0 */ - 357, /* GL_DRAW_BUFFER1 */ - 378, /* GL_DRAW_BUFFER2 */ - 381, /* GL_DRAW_BUFFER3 */ - 384, /* GL_DRAW_BUFFER4 */ - 387, /* GL_DRAW_BUFFER5 */ - 390, /* GL_DRAW_BUFFER6 */ - 393, /* GL_DRAW_BUFFER7 */ - 396, /* GL_DRAW_BUFFER8 */ - 399, /* GL_DRAW_BUFFER9 */ - 358, /* GL_DRAW_BUFFER10 */ - 361, /* GL_DRAW_BUFFER11 */ - 364, /* GL_DRAW_BUFFER12 */ - 367, /* GL_DRAW_BUFFER13 */ - 370, /* GL_DRAW_BUFFER14 */ - 373, /* GL_DRAW_BUFFER15 */ - 81, /* GL_BLEND_EQUATION_ALPHA */ - 790, /* GL_MATRIX_PALETTE_ARB */ - 821, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 824, /* GL_MAX_PALETTE_MATRICES_ARB */ - 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 784, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 283, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1575, /* GL_TEXTURE_DEPTH_SIZE */ - 338, /* GL_DEPTH_TEXTURE_MODE */ - 1541, /* GL_TEXTURE_COMPARE_MODE */ - 1539, /* GL_TEXTURE_COMPARE_FUNC */ - 216, /* GL_COMPARE_R_TO_TEXTURE */ - 1091, /* GL_POINT_SPRITE */ - 265, /* GL_COORD_REPLACE */ - 1095, /* GL_POINT_SPRITE_R_MODE_NV */ - 1212, /* GL_QUERY_COUNTER_BITS */ - 290, /* GL_CURRENT_QUERY */ - 1214, /* GL_QUERY_RESULT */ - 1216, /* GL_QUERY_RESULT_AVAILABLE */ - 871, /* GL_MAX_VERTEX_ATTRIBS */ - 1706, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 857, /* GL_MAX_TEXTURE_COORDS */ - 859, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1162, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1164, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1163, /* GL_PROGRAM_FORMAT_ARB */ - 1620, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 317, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 316, /* GL_DEPTH_BOUNDS_EXT */ - 52, /* GL_ARRAY_BUFFER */ - 419, /* GL_ELEMENT_ARRAY_BUFFER */ - 53, /* GL_ARRAY_BUFFER_BINDING */ - 420, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1680, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 958, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - 139, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1554, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1321, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 461, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1732, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1702, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1165, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 833, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1171, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 842, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1183, /* GL_PROGRAM_TEMPORARIES_ARB */ - 848, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1173, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 844, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1177, /* GL_PROGRAM_PARAMETERS_ARB */ - 847, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1172, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 843, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1158, /* GL_PROGRAM_ATTRIBS_ARB */ - 828, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1170, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 841, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1156, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 826, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1168, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 839, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 834, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 830, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1186, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1631, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1224, /* GL_READ_ONLY */ - 1740, /* GL_WRITE_ONLY */ - 1226, /* GL_READ_WRITE */ - 100, /* GL_BUFFER_ACCESS */ - 102, /* GL_BUFFER_MAPPED */ - 104, /* GL_BUFFER_MAP_POINTER */ - 1625, /* GL_TIME_ELAPSED_EXT */ - 744, /* GL_MATRIX0_ARB */ - 756, /* GL_MATRIX1_ARB */ - 768, /* GL_MATRIX2_ARB */ - 772, /* GL_MATRIX3_ARB */ - 774, /* GL_MATRIX4_ARB */ - 776, /* GL_MATRIX5_ARB */ - 778, /* GL_MATRIX6_ARB */ - 780, /* GL_MATRIX7_ARB */ - 782, /* GL_MATRIX8_ARB */ - 783, /* GL_MATRIX9_ARB */ - 746, /* GL_MATRIX10_ARB */ - 747, /* GL_MATRIX11_ARB */ - 748, /* GL_MATRIX12_ARB */ - 749, /* GL_MATRIX13_ARB */ - 750, /* GL_MATRIX14_ARB */ - 751, /* GL_MATRIX15_ARB */ - 752, /* GL_MATRIX16_ARB */ - 753, /* GL_MATRIX17_ARB */ - 754, /* GL_MATRIX18_ARB */ - 755, /* GL_MATRIX19_ARB */ - 758, /* GL_MATRIX20_ARB */ - 759, /* GL_MATRIX21_ARB */ - 760, /* GL_MATRIX22_ARB */ - 761, /* GL_MATRIX23_ARB */ - 762, /* GL_MATRIX24_ARB */ - 763, /* GL_MATRIX25_ARB */ - 764, /* GL_MATRIX26_ARB */ - 765, /* GL_MATRIX27_ARB */ - 766, /* GL_MATRIX28_ARB */ - 767, /* GL_MATRIX29_ARB */ - 770, /* GL_MATRIX30_ARB */ - 771, /* GL_MATRIX31_ARB */ - 1427, /* GL_STREAM_DRAW */ - 1429, /* GL_STREAM_READ */ - 1425, /* GL_STREAM_COPY */ - 1389, /* GL_STATIC_DRAW */ - 1391, /* GL_STATIC_READ */ - 1387, /* GL_STATIC_COPY */ - 409, /* GL_DYNAMIC_DRAW */ - 411, /* GL_DYNAMIC_READ */ - 407, /* GL_DYNAMIC_COPY */ - 533, /* GL_GL_PIXEL_PACK_BUFFER */ - 535, /* GL_GL_PIXEL_UNPACK_BUFFER */ - 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - 831, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 829, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 832, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 836, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 835, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 793, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1421, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 892, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1302, /* GL_SAMPLES_PASSED */ - 484, /* GL_FRAGMENT_SHADER */ - 1726, /* GL_VERTEX_SHADER */ - 1176, /* GL_PROGRAM_OBJECT_ARB */ - 1334, /* GL_SHADER_OBJECT_ARB */ - 817, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 875, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 869, /* GL_MAX_VARYING_FLOATS */ - 873, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 802, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 983, /* GL_OBJECT_TYPE_ARB */ - 1336, /* GL_SHADER_TYPE */ - 449, /* GL_FLOAT_VEC2 */ - 451, /* GL_FLOAT_VEC3 */ - 453, /* GL_FLOAT_VEC4 */ - 604, /* GL_INT_VEC2 */ - 606, /* GL_INT_VEC3 */ - 608, /* GL_INT_VEC4 */ - 92, /* GL_BOOL */ - 94, /* GL_BOOL_VEC2 */ - 96, /* GL_BOOL_VEC3 */ - 98, /* GL_BOOL_VEC4 */ - 443, /* GL_FLOAT_MAT2 */ - 445, /* GL_FLOAT_MAT3 */ - 447, /* GL_FLOAT_MAT4 */ - 1293, /* GL_SAMPLER_1D */ - 1295, /* GL_SAMPLER_2D */ - 1297, /* GL_SAMPLER_3D */ - 1298, /* GL_SAMPLER_CUBE */ - 1294, /* GL_SAMPLER_1D_SHADOW */ - 1296, /* GL_SAMPLER_2D_SHADOW */ - 527, /* GL_GL_FLOAT_MAT2x3 */ - 528, /* GL_GL_FLOAT_MAT2x4 */ - 529, /* GL_GL_FLOAT_MAT3x2 */ - 530, /* GL_GL_FLOAT_MAT3x4 */ - 531, /* GL_GL_FLOAT_MAT4x2 */ - 532, /* GL_GL_FLOAT_MAT4x3 */ - 311, /* GL_DELETE_STATUS */ - 220, /* GL_COMPILE_STATUS */ - 657, /* GL_LINK_STATUS */ - 1675, /* GL_VALIDATE_STATUS */ - 589, /* GL_INFO_LOG_LENGTH */ - 55, /* GL_ATTACHED_SHADERS */ - 20, /* GL_ACTIVE_UNIFORMS */ - 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1335, /* GL_SHADER_SOURCE_LENGTH */ - 15, /* GL_ACTIVE_ATTRIBUTES */ - 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 486, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1338, /* GL_SHADING_LANGUAGE_VERSION */ - 289, /* GL_CURRENT_PROGRAM */ - 1032, /* GL_PALETTE4_RGB8_OES */ - 1034, /* GL_PALETTE4_RGBA8_OES */ - 1030, /* GL_PALETTE4_R5_G6_B5_OES */ - 1033, /* GL_PALETTE4_RGBA4_OES */ - 1031, /* GL_PALETTE4_RGB5_A1_OES */ - 1037, /* GL_PALETTE8_RGB8_OES */ - 1039, /* GL_PALETTE8_RGBA8_OES */ - 1035, /* GL_PALETTE8_R5_G6_B5_OES */ - 1038, /* GL_PALETTE8_RGBA4_OES */ - 1036, /* GL_PALETTE8_RGB5_A1_OES */ - 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1509, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1196, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1511, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1199, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1517, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1519, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 541, /* GL_GL_SRGB */ - 542, /* GL_GL_SRGB8 */ - 544, /* GL_GL_SRGB_ALPHA */ - 543, /* GL_GL_SRGB8_ALPHA8 */ - 540, /* GL_GL_SLUMINANCE_ALPHA */ - 539, /* GL_GL_SLUMINANCE8_ALPHA8 */ - 537, /* GL_GL_SLUMINANCE */ - 538, /* GL_GL_SLUMINANCE8 */ - 524, /* GL_GL_COMPRESSED_SRGB */ - 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - 522, /* GL_GL_COMPRESSED_SLUMINANCE */ - 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1093, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 665, /* GL_LOWER_LEFT */ - 1672, /* GL_UPPER_LEFT */ - 1403, /* GL_STENCIL_BACK_REF */ - 1404, /* GL_STENCIL_BACK_VALUE_MASK */ - 1405, /* GL_STENCIL_BACK_WRITEMASK */ - 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1238, /* GL_RENDERBUFFER_BINDING_EXT */ - 1223, /* GL_READ_FRAMEBUFFER_EXT */ - 403, /* GL_DRAW_FRAMEBUFFER_EXT */ - 1222, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - 487, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - 489, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 799, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - 145, /* GL_COLOR_ATTACHMENT0_EXT */ - 152, /* GL_COLOR_ATTACHMENT1_EXT */ - 153, /* GL_COLOR_ATTACHMENT2_EXT */ - 154, /* GL_COLOR_ATTACHMENT3_EXT */ - 155, /* GL_COLOR_ATTACHMENT4_EXT */ - 156, /* GL_COLOR_ATTACHMENT5_EXT */ - 157, /* GL_COLOR_ATTACHMENT6_EXT */ - 158, /* GL_COLOR_ATTACHMENT7_EXT */ - 159, /* GL_COLOR_ATTACHMENT8_EXT */ - 160, /* GL_COLOR_ATTACHMENT9_EXT */ - 146, /* GL_COLOR_ATTACHMENT10_EXT */ - 147, /* GL_COLOR_ATTACHMENT11_EXT */ - 148, /* GL_COLOR_ATTACHMENT12_EXT */ - 149, /* GL_COLOR_ATTACHMENT13_EXT */ - 150, /* GL_COLOR_ATTACHMENT14_EXT */ - 151, /* GL_COLOR_ATTACHMENT15_EXT */ - 313, /* GL_DEPTH_ATTACHMENT_EXT */ - 1394, /* GL_STENCIL_ATTACHMENT_EXT */ - 495, /* GL_FRAMEBUFFER_EXT */ - 1239, /* GL_RENDERBUFFER_EXT */ - 1242, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1240, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1241, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1416, /* GL_STENCIL_INDEX_EXT */ - 1413, /* GL_STENCIL_INDEX1_EXT */ - 1414, /* GL_STENCIL_INDEX4_EXT */ - 1415, /* GL_STENCIL_INDEX8_EXT */ - 1412, /* GL_STENCIL_INDEX16_EXT */ - 426, /* GL_EVAL_BIT */ - 1220, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 659, /* GL_LIST_BIT */ - 1525, /* GL_TEXTURE_BIT */ - 1317, /* GL_SCISSOR_BIT */ - 29, /* GL_ALL_ATTRIB_BITS */ - 939, /* GL_MULTISAMPLE_BIT */ - 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ -}; - -#define Elements(x) sizeof(x)/sizeof(*x) - -typedef int (*cfunc)(const void *, const void *); - -/** - * Compare a key name to an element in the \c all_enums array. - * - * \c bsearch always passes the key as the first parameter and the pointer - * to the array element as the second parameter. We can elimiate some - * extra work by taking advantage of that fact. - * - * \param a Pointer to the desired enum name. - * \param b Pointer to an element of the \c all_enums array. - */ -static int compar_name( const char *a, const enum_elt *b ) -{ - return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); -} - -/** - * Compare a key enum value to an element in the \c all_enums array. - * - * \c bsearch always passes the key as the first parameter and the pointer - * to the array element as the second parameter. We can elimiate some - * extra work by taking advantage of that fact. - * - * \param a Pointer to the desired enum name. - * \param b Pointer to an index into the \c all_enums array. - */ -static int compar_nr( const int *a, const unsigned *b ) -{ - return a[0] - all_enums[*b].n; -} - - -static char token_tmp[20]; - -const char *_mesa_lookup_enum_by_nr( int nr ) -{ - unsigned * i; - - i = (unsigned *) _mesa_bsearch(& nr, reduced_enums, - Elements(reduced_enums), - sizeof(reduced_enums[0]), - (cfunc) compar_nr); - - if ( i != NULL ) { - return & enum_string_table[ all_enums[ *i ].offset ]; - } - else { - /* this is not re-entrant safe, no big deal here */ - _mesa_sprintf(token_tmp, "0x%x", nr); - return token_tmp; - } -} - -int _mesa_lookup_enum_by_name( const char *symbol ) -{ - enum_elt * f = NULL; - - if ( symbol != NULL ) { - f = (enum_elt *) _mesa_bsearch(symbol, all_enums, - Elements(all_enums), - sizeof( enum_elt ), - (cfunc) compar_name); - } - - return (f != NULL) ? f->n : -1; -} - - diff --git a/src/libs/mesa/mesa/main/enums.h b/src/libs/mesa/mesa/main/enums.h deleted file mode 100644 index 23a4767f35..0000000000 --- a/src/libs/mesa/mesa/main/enums.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * \file enums.h - * Enumeration name/number lookup functions. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 _ENUMS_H_ -#define _ENUMS_H_ - - -#if defined(_HAVE_FULL_GL) && _HAVE_FULL_GL - -extern const char *_mesa_lookup_enum_by_nr( int nr ); -extern int _mesa_lookup_enum_by_name( const char *symbol ); - -#else - -/** No-op */ -#define _mesa_lookup_enum_by_name( s ) 0 - -/** No-op */ -#define _mesa_lookup_enum_by_nr( n ) "unknown" - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/eval.c b/src/libs/mesa/mesa/main/eval.c deleted file mode 100644 index 3f89f9c1ea..0000000000 --- a/src/libs/mesa/mesa/main/eval.c +++ /dev/null @@ -1,962 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - - -/* - * eval.c was written by - * Bernd Barsuhn (bdbarsuh@cip.informatik.uni-erlangen.de) and - * Volker Weiss (vrweiss@cip.informatik.uni-erlangen.de). - * - * My original implementation of evaluators was simplistic and didn't - * compute surface normal vectors properly. Bernd and Volker applied - * used more sophisticated methods to get better results. - * - * Thanks guys! - */ - - -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "eval.h" -#include "macros.h" -#include "mtypes.h" - - -/* - * 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. - */ -GLuint _mesa_evaluator_components( GLenum target ) -{ - switch (target) { - case GL_MAP1_VERTEX_3: return 3; - case GL_MAP1_VERTEX_4: return 4; - case GL_MAP1_INDEX: return 1; - case GL_MAP1_COLOR_4: return 4; - case GL_MAP1_NORMAL: return 3; - case GL_MAP1_TEXTURE_COORD_1: return 1; - case GL_MAP1_TEXTURE_COORD_2: return 2; - case GL_MAP1_TEXTURE_COORD_3: return 3; - case GL_MAP1_TEXTURE_COORD_4: return 4; - case GL_MAP2_VERTEX_3: return 3; - case GL_MAP2_VERTEX_4: return 4; - case GL_MAP2_INDEX: return 1; - case GL_MAP2_COLOR_4: return 4; - case GL_MAP2_NORMAL: return 3; - case GL_MAP2_TEXTURE_COORD_1: return 1; - case GL_MAP2_TEXTURE_COORD_2: return 2; - case GL_MAP2_TEXTURE_COORD_3: return 3; - case GL_MAP2_TEXTURE_COORD_4: return 4; - default: break; - } - - /* XXX need to check for the vertex program extension - if (!ctx->Extensions.NV_vertex_program) - return 0; - */ - - if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV && - target <= GL_MAP1_VERTEX_ATTRIB15_4_NV) - return 4; - - if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV && - target <= GL_MAP2_VERTEX_ATTRIB15_4_NV) - return 4; - - return 0; -} - - -/* - * Return pointer to the gl_1d_map struct for the named target. - */ -static struct gl_1d_map * -get_1d_map( GLcontext *ctx, GLenum target ) -{ - switch (target) { - case GL_MAP1_VERTEX_3: - return &ctx->EvalMap.Map1Vertex3; - case GL_MAP1_VERTEX_4: - return &ctx->EvalMap.Map1Vertex4; - case GL_MAP1_INDEX: - return &ctx->EvalMap.Map1Index; - case GL_MAP1_COLOR_4: - return &ctx->EvalMap.Map1Color4; - case GL_MAP1_NORMAL: - return &ctx->EvalMap.Map1Normal; - case GL_MAP1_TEXTURE_COORD_1: - return &ctx->EvalMap.Map1Texture1; - case GL_MAP1_TEXTURE_COORD_2: - return &ctx->EvalMap.Map1Texture2; - case GL_MAP1_TEXTURE_COORD_3: - return &ctx->EvalMap.Map1Texture3; - case GL_MAP1_TEXTURE_COORD_4: - return &ctx->EvalMap.Map1Texture4; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - if (!ctx->Extensions.NV_vertex_program) - return NULL; - return &ctx->EvalMap.Map1Attrib[target - GL_MAP1_VERTEX_ATTRIB0_4_NV]; - default: - return NULL; - } -} - - -/* - * Return pointer to the gl_2d_map struct for the named target. - */ -static struct gl_2d_map * -get_2d_map( GLcontext *ctx, GLenum target ) -{ - switch (target) { - case GL_MAP2_VERTEX_3: - return &ctx->EvalMap.Map2Vertex3; - case GL_MAP2_VERTEX_4: - return &ctx->EvalMap.Map2Vertex4; - case GL_MAP2_INDEX: - return &ctx->EvalMap.Map2Index; - case GL_MAP2_COLOR_4: - return &ctx->EvalMap.Map2Color4; - case GL_MAP2_NORMAL: - return &ctx->EvalMap.Map2Normal; - case GL_MAP2_TEXTURE_COORD_1: - return &ctx->EvalMap.Map2Texture1; - case GL_MAP2_TEXTURE_COORD_2: - return &ctx->EvalMap.Map2Texture2; - case GL_MAP2_TEXTURE_COORD_3: - return &ctx->EvalMap.Map2Texture3; - case GL_MAP2_TEXTURE_COORD_4: - return &ctx->EvalMap.Map2Texture4; - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - if (!ctx->Extensions.NV_vertex_program) - return NULL; - return &ctx->EvalMap.Map2Attrib[target - GL_MAP2_VERTEX_ATTRIB0_4_NV]; - default: - return NULL; - } -} - - -/**********************************************************************/ -/*** Copy and deallocate control points ***/ -/**********************************************************************/ - - -/* - * Copy 1-parametric evaluator control points from user-specified - * memory space to a buffer of contiguous control points. - * \param see glMap1f for details - * \return pointer to buffer of contiguous control points or NULL if out - * of memory. - */ -GLfloat *_mesa_copy_map_points1f( GLenum target, GLint ustride, GLint uorder, - const GLfloat *points ) -{ - GLfloat *buffer, *p; - GLint i, k, size = _mesa_evaluator_components(target); - - if (!points || !size) - return NULL; - - buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat)); - - if (buffer) - for (i = 0, p = buffer; i < uorder; i++, points += ustride) - for (k = 0; k < size; k++) - *p++ = points[k]; - - return buffer; -} - - - -/* - * Same as above but convert doubles to floats. - */ -GLfloat *_mesa_copy_map_points1d( GLenum target, GLint ustride, GLint uorder, - const GLdouble *points ) -{ - GLfloat *buffer, *p; - GLint i, k, size = _mesa_evaluator_components(target); - - if (!points || !size) - return NULL; - - buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat)); - - if (buffer) - for (i = 0, p = buffer; i < uorder; i++, points += ustride) - for (k = 0; k < size; k++) - *p++ = (GLfloat) points[k]; - - return buffer; -} - - - -/* - * Copy 2-parametric evaluator control points from user-specified - * memory space to a buffer of contiguous control points. - * Additional memory is allocated to be used by the horner and - * de Casteljau evaluation schemes. - * - * \param see glMap2f for details - * \return pointer to buffer of contiguous control points or NULL if out - * of memory. - */ -GLfloat *_mesa_copy_map_points2f( GLenum target, - GLint ustride, GLint uorder, - GLint vstride, GLint vorder, - const GLfloat *points ) -{ - GLfloat *buffer, *p; - GLint i, j, k, size, dsize, hsize; - GLint uinc; - - size = _mesa_evaluator_components(target); - - if (!points || size==0) { - return NULL; - } - - /* max(uorder, vorder) additional points are used in */ - /* horner evaluation and uorder*vorder additional */ - /* values are needed for de Casteljau */ - dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder; - hsize = (uorder > vorder ? uorder : vorder)*size; - - if(hsize>dsize) - buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat)); - else - buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat)); - - /* compute the increment value for the u-loop */ - uinc = ustride - vorder*vstride; - - if (buffer) - for (i=0, p=buffer; i vorder ? uorder : vorder)*size; - - if(hsize>dsize) - buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat)); - else - buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat)); - - /* compute the increment value for the u-loop */ - uinc = ustride - vorder*vstride; - - if (buffer) - for (i=0, p=buffer; i MAX_EVAL_ORDER) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(order)" ); - return; - } - if (!points) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(points)" ); - return; - } - - k = _mesa_evaluator_components( target ); - if (k == 0) { - _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); - } - - if (ustride < k) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" ); - return; - } - - if (ctx->Texture.CurrentUnit != 0) { - /* See OpenGL 1.2.1 spec, section F.2.13 */ - _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" ); - return; - } - - map = get_1d_map(ctx, target); - if (!map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); - return; - } - - /* make copy of the control points */ - if (type == GL_FLOAT) - pnts = _mesa_copy_map_points1f(target, ustride, uorder, (GLfloat*) points); - else - pnts = _mesa_copy_map_points1d(target, ustride, uorder, (GLdouble*) points); - - - FLUSH_VERTICES(ctx, _NEW_EVAL); - map->Order = uorder; - map->u1 = u1; - map->u2 = u2; - map->du = 1.0F / (u2 - u1); - if (map->Points) - FREE( map->Points ); - map->Points = pnts; -} - - - -void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ) -{ - map1(target, u1, u2, stride, order, points, GL_FLOAT); -} - - -void GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ) -{ - map1(target, (GLfloat) u1, (GLfloat) 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; - struct gl_2d_map *map = NULL; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - ASSERT(type == GL_FLOAT || type == GL_DOUBLE); - - if (u1==u2) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" ); - return; - } - - if (v1==v2) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(v1,v2)" ); - return; - } - - if (uorder<1 || uorder>MAX_EVAL_ORDER) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(uorder)" ); - return; - } - - if (vorder<1 || vorder>MAX_EVAL_ORDER) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vorder)" ); - return; - } - - k = _mesa_evaluator_components( target ); - if (k==0) { - _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); - } - - if (ustride < k) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(ustride)" ); - return; - } - if (vstride < k) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vstride)" ); - return; - } - - if (ctx->Texture.CurrentUnit != 0) { - /* See OpenGL 1.2.1 spec, section F.2.13 */ - _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" ); - return; - } - - map = get_2d_map(ctx, target); - if (!map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); - return; - } - - /* make copy of the control points */ - if (type == GL_FLOAT) - pnts = _mesa_copy_map_points2f(target, ustride, uorder, - vstride, vorder, (GLfloat*) points); - else - pnts = _mesa_copy_map_points2d(target, ustride, uorder, - vstride, vorder, (GLdouble*) points); - - - FLUSH_VERTICES(ctx, _NEW_EVAL); - map->Uorder = uorder; - map->u1 = u1; - map->u2 = u2; - map->du = 1.0F / (u2 - u1); - map->Vorder = vorder; - map->v1 = v1; - map->v2 = v2; - map->dv = 1.0F / (v2 - v1); - if (map->Points) - FREE( map->Points ); - map->Points = pnts; -} - - -void GLAPIENTRY -_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 GLAPIENTRY -_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, (GLfloat) u1, (GLfloat) u2, ustride, uorder, - (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE); -} - - - -void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_1d_map *map1d; - struct gl_2d_map *map2d; - GLint i, n; - GLfloat *data; - GLuint comps; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - comps = _mesa_evaluator_components(target); - if (!comps) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" ); - return; - } - - map1d = get_1d_map(ctx, target); - map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); - - switch (query) { - case GL_COEFF: - if (map1d) { - data = map1d->Points; - n = map1d->Order * comps; - } - else { - data = map2d->Points; - n = map2d->Uorder * map2d->Vorder * comps; - } - if (data) { - for (i=0;iOrder; - } - else { - v[0] = (GLdouble) map2d->Uorder; - v[1] = (GLdouble) map2d->Vorder; - } - break; - case GL_DOMAIN: - if (map1d) { - v[0] = (GLdouble) map1d->u1; - v[1] = (GLdouble) map1d->u2; - } - else { - v[0] = (GLdouble) map2d->u1; - v[1] = (GLdouble) map2d->u2; - v[2] = (GLdouble) map2d->v1; - v[3] = (GLdouble) map2d->v2; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(query)" ); - } -} - - -void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_1d_map *map1d; - struct gl_2d_map *map2d; - GLint i, n; - GLfloat *data; - GLuint comps; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - comps = _mesa_evaluator_components(target); - if (!comps) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" ); - return; - } - - map1d = get_1d_map(ctx, target); - map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); - - switch (query) { - case GL_COEFF: - if (map1d) { - data = map1d->Points; - n = map1d->Order * comps; - } - else { - data = map2d->Points; - n = map2d->Uorder * map2d->Vorder * comps; - } - if (data) { - for (i=0;iOrder; - } - else { - v[0] = (GLfloat) map2d->Uorder; - v[1] = (GLfloat) map2d->Vorder; - } - break; - case GL_DOMAIN: - if (map1d) { - v[0] = map1d->u1; - v[1] = map1d->u2; - } - else { - v[0] = map2d->u1; - v[1] = map2d->u2; - v[2] = map2d->v1; - v[3] = map2d->v2; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(query)" ); - } -} - - -void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_1d_map *map1d; - struct gl_2d_map *map2d; - GLuint i, n; - GLfloat *data; - GLuint comps; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - comps = _mesa_evaluator_components(target); - if (!comps) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" ); - return; - } - - map1d = get_1d_map(ctx, target); - map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); - - switch (query) { - case GL_COEFF: - if (map1d) { - data = map1d->Points; - n = map1d->Order * comps; - } - else { - data = map2d->Points; - n = map2d->Uorder * map2d->Vorder * comps; - } - if (data) { - for (i=0;iOrder; - } - else { - v[0] = map2d->Uorder; - v[1] = map2d->Vorder; - } - break; - case GL_DOMAIN: - if (map1d) { - v[0] = IROUND(map1d->u1); - v[1] = IROUND(map1d->u2); - } - else { - v[0] = IROUND(map2d->u1); - v[1] = IROUND(map2d->u2); - v[2] = IROUND(map2d->v1); - v[3] = IROUND(map2d->v2); - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(query)" ); - } -} - - - -void GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (un<1) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" ); - return; - } - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.MapGrid1un = un; - ctx->Eval.MapGrid1u1 = u1; - ctx->Eval.MapGrid1u2 = u2; - ctx->Eval.MapGrid1du = (u2 - u1) / (GLfloat) un; -} - - -void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) -{ - _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); -} - - -void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (un<1) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" ); - return; - } - if (vn<1) { - _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(vn)" ); - return; - } - - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.MapGrid2un = un; - ctx->Eval.MapGrid2u1 = u1; - ctx->Eval.MapGrid2u2 = u2; - ctx->Eval.MapGrid2du = (u2 - u1) / (GLfloat) un; - ctx->Eval.MapGrid2vn = vn; - ctx->Eval.MapGrid2v1 = v1; - ctx->Eval.MapGrid2v2 = v2; - ctx->Eval.MapGrid2dv = (v2 - v1) / (GLfloat) vn; -} - - -void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ) -{ - _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, - vn, (GLfloat) v1, (GLfloat) v2 ); -} - - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -/** - * Initialize a 1-D evaluator map. - */ -static void -init_1d_map( struct gl_1d_map *map, int n, const float *initial ) -{ - map->Order = 1; - map->u1 = 0.0; - map->u2 = 1.0; - map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat)); - if (map->Points) { - GLint i; - for (i=0;iPoints[i] = initial[i]; - } -} - - -/** - * Initialize a 2-D evaluator map - */ -static void -init_2d_map( struct gl_2d_map *map, int n, const float *initial ) -{ - map->Uorder = 1; - map->Vorder = 1; - map->u1 = 0.0; - map->u2 = 1.0; - map->v1 = 0.0; - map->v2 = 1.0; - map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat)); - if (map->Points) { - GLint i; - for (i=0;iPoints[i] = initial[i]; - } -} - - -void _mesa_init_eval( GLcontext *ctx ) -{ - int i; - - /* 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; - MEMSET(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib)); - 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; - MEMSET(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib)); - 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 }; - static GLfloat attrib[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 ); - for (i = 0; i < 16; i++) - init_1d_map( ctx->EvalMap.Map1Attrib + i, 4, attrib ); - - 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 ); - for (i = 0; i < 16; i++) - init_2d_map( ctx->EvalMap.Map2Attrib + i, 4, attrib ); - } -} - - -void _mesa_free_eval_data( GLcontext *ctx ) -{ - int i; - - /* 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 ); - for (i = 0; i < 16; i++) - FREE((ctx->EvalMap.Map1Attrib[i].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 ); - for (i = 0; i < 16; i++) - FREE((ctx->EvalMap.Map2Attrib[i].Points)); -} diff --git a/src/libs/mesa/mesa/main/eval.h b/src/libs/mesa/mesa/main/eval.h deleted file mode 100644 index b3ff0a96f8..0000000000 --- a/src/libs/mesa/mesa/main/eval.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - * \file eval.h - * Eval operations. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 EVAL_H -#define EVAL_H - - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); - - -extern GLuint _mesa_evaluator_components( GLenum target ); - - -extern void gl_free_control_points( GLcontext *ctx, - GLenum target, GLfloat *data ); - - -extern GLfloat *_mesa_copy_map_points1f( GLenum target, - GLint ustride, GLint uorder, - const GLfloat *points ); - -extern GLfloat *_mesa_copy_map_points1d( GLenum target, - GLint ustride, GLint uorder, - const GLdouble *points ); - -extern GLfloat *_mesa_copy_map_points2f( GLenum target, - GLint ustride, GLint uorder, - GLint vstride, GLint vorder, - const GLfloat *points ); - -extern GLfloat *_mesa_copy_map_points2d(GLenum target, - GLint ustride, GLint uorder, - GLint vstride, GLint vorder, - const GLdouble *points ); - - - -extern void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ); - -extern void GLAPIENTRY -_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 GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ); - -extern void GLAPIENTRY -_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 GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -extern void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); - -extern void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -extern void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); - -extern void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); - -extern void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); - -extern void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); - -#else - -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) - -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/execmem.c b/src/libs/mesa/mesa/main/execmem.c deleted file mode 100644 index b71846c904..0000000000 --- a/src/libs/mesa/mesa/main/execmem.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - - -/** - * \file exemem.c - * Functions for allocating executable memory. - * - * \author Keith Whitwell - */ - - -#include "imports.h" -#include "glapi/glthread.h" - - - -#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) - -/* - * Allocate a large block of memory which can hold code then dole it out - * in pieces by means of the generic memory manager code. -*/ - -#include -#include -#include "mm.h" - -#ifdef MESA_SELINUX -#include -#endif - - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - - -#define EXEC_HEAP_SIZE (10*1024*1024) - -_glthread_DECLARE_STATIC_MUTEX(exec_mutex); - -static struct mem_block *exec_heap = NULL; -static unsigned char *exec_mem = NULL; - - -static int -init_heap(void) -{ -#ifdef MESA_SELINUX - if (is_selinux_enabled()) { - if (!security_get_boolean_active("allow_execmem") || - !security_get_boolean_pending("allow_execmem")) - return 0; - } -#endif - - if (!exec_heap) - exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); - - if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - - return (exec_mem != NULL); -} - - -void * -_mesa_exec_malloc(GLuint size) -{ - struct mem_block *block = NULL; - void *addr = NULL; - - _glthread_LOCK_MUTEX(exec_mutex); - - if (!init_heap()) - goto bail; - - if (exec_heap) { - size = (size + 31) & ~31; - block = mmAllocMem( exec_heap, size, 32, 0 ); - } - - if (block) - addr = exec_mem + block->ofs; - else - _mesa_printf("_mesa_exec_malloc failed\n"); - -bail: - _glthread_UNLOCK_MUTEX(exec_mutex); - - return addr; -} - - -void -_mesa_exec_free(void *addr) -{ - _glthread_LOCK_MUTEX(exec_mutex); - - if (exec_heap) { - struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); - - if (block) - mmFreeMem(block); - } - - _glthread_UNLOCK_MUTEX(exec_mutex); -} - - -#else - -/* - * Just use regular memory. - */ - -void * -_mesa_exec_malloc(GLuint size) -{ - return _mesa_malloc( size ); -} - - -void -_mesa_exec_free(void *addr) -{ - _mesa_free(addr); -} - - -#endif diff --git a/src/libs/mesa/mesa/main/extensions.c b/src/libs/mesa/mesa/main/extensions.c deleted file mode 100644 index bdfec006f3..0000000000 --- a/src/libs/mesa/mesa/main/extensions.c +++ /dev/null @@ -1,564 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "extensions.h" -#include "simple_list.h" -#include "mtypes.h" - - -#define F(x) (int)(uintptr_t)&(((struct gl_extensions *)0)->x) -#define ON GL_TRUE -#define OFF GL_FALSE - - -/* - * Note: The GL_MESAX_* extensions are placeholders for future ARB extensions. - */ -static const struct { - GLboolean enabled; - const char *name; - int flag_offset; -} default_extensions[] = { - { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, - { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, - { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, - { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, - { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, - { OFF, "GL_ARB_imaging", F(ARB_imaging) }, - { OFF, "GL_ARB_multisample", F(ARB_multisample) }, - { OFF, "GL_ARB_multitexture", F(ARB_multitexture) }, - { OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) }, - { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, - { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) }, - { OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) }, - { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, - { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, - { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, - { OFF, "GL_ARB_shadow", F(ARB_shadow) }, - { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, - { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, - { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) }, - { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, - { OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) }, - { OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) }, - { OFF, "GL_ARB_texture_env_crossbar", F(ARB_texture_env_crossbar) }, - { OFF, "GL_ARB_texture_env_dot3", F(ARB_texture_env_dot3) }, - { OFF, "GL_MESAX_texture_float", F(ARB_texture_float) }, - { OFF, "GL_ARB_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, - { OFF, "GL_ARB_texture_non_power_of_two", F(ARB_texture_non_power_of_two)}, - { OFF, "GL_ARB_texture_rectangle", F(NV_texture_rectangle) }, - { ON, "GL_ARB_transpose_matrix", F(ARB_transpose_matrix) }, - { OFF, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, - { OFF, "GL_ARB_vertex_program", F(ARB_vertex_program) }, - { OFF, "GL_ARB_vertex_shader", F(ARB_vertex_shader) }, - { ON, "GL_ARB_window_pos", F(ARB_window_pos) }, - { ON, "GL_EXT_abgr", F(EXT_abgr) }, - { ON, "GL_EXT_bgra", F(EXT_bgra) }, - { OFF, "GL_EXT_blend_color", F(EXT_blend_color) }, - { OFF, "GL_EXT_blend_equation_separate", F(EXT_blend_equation_separate) }, - { OFF, "GL_EXT_blend_func_separate", F(EXT_blend_func_separate) }, - { OFF, "GL_EXT_blend_logic_op", F(EXT_blend_logic_op) }, - { OFF, "GL_EXT_blend_minmax", F(EXT_blend_minmax) }, - { OFF, "GL_EXT_blend_subtract", F(EXT_blend_subtract) }, - { ON, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) }, - { OFF, "GL_EXT_cull_vertex", F(EXT_cull_vertex) }, - { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, - { OFF, "GL_EXT_convolution", F(EXT_convolution) }, - { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, - { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, - { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, - { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, - { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, - { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, - { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, - { OFF, "GL_EXT_histogram", F(EXT_histogram) }, - { OFF, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, - { OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) }, - { ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) }, - { OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) }, - { OFF, "GL_EXT_pixel_buffer_object", F(EXT_pixel_buffer_object) }, - { OFF, "GL_EXT_point_parameters", F(EXT_point_parameters) }, - { ON, "GL_EXT_polygon_offset", F(EXT_polygon_offset) }, - { ON, "GL_EXT_rescale_normal", F(EXT_rescale_normal) }, - { OFF, "GL_EXT_secondary_color", F(EXT_secondary_color) }, - { ON, "GL_EXT_separate_specular_color", F(EXT_separate_specular_color) }, - { OFF, "GL_EXT_shadow_funcs", F(EXT_shadow_funcs) }, - { OFF, "GL_EXT_shared_texture_palette", F(EXT_shared_texture_palette) }, - { OFF, "GL_EXT_stencil_two_side", F(EXT_stencil_two_side) }, - { OFF, "GL_EXT_stencil_wrap", F(EXT_stencil_wrap) }, - { ON, "GL_EXT_subtexture", F(EXT_subtexture) }, - { ON, "GL_EXT_texture", F(EXT_texture) }, - { ON, "GL_EXT_texture3D", F(EXT_texture3D) }, - { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, - { ON, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, - { OFF, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, - { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) }, - { OFF, "GL_EXT_texture_env_dot3", F(EXT_texture_env_dot3) }, - { OFF, "GL_EXT_texture_filter_anisotropic", F(EXT_texture_filter_anisotropic) }, - { OFF, "GL_EXT_texture_lod_bias", F(EXT_texture_lod_bias) }, - { OFF, "GL_EXT_texture_mirror_clamp", F(EXT_texture_mirror_clamp) }, - { ON, "GL_EXT_texture_object", F(EXT_texture_object) }, - { OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) }, - { OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) }, - { OFF, "GL_EXT_timer_query", F(EXT_timer_query) }, - { ON, "GL_EXT_vertex_array", F(EXT_vertex_array) }, - { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) }, - { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) }, - { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, - { ON, "GL_APPLE_packed_pixels", F(APPLE_packed_pixels) }, - { OFF, "GL_APPLE_vertex_array_object", F(APPLE_vertex_array_object) }, - { OFF, "GL_ATI_blend_equation_separate", F(EXT_blend_equation_separate) }, - { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, - { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, - { OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)}, - { OFF, "GL_ATI_separate_stencil", F(ATI_separate_stencil)}, - { OFF, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, - { ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) }, - { OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, - { OFF, "GL_INGR_blend_func_separate", F(EXT_blend_func_separate) }, - { OFF, "GL_MESA_pack_invert", F(MESA_pack_invert) }, - { OFF, "GL_MESA_packed_depth_stencil", F(MESA_packed_depth_stencil) }, - { OFF, "GL_MESA_program_debug", F(MESA_program_debug) }, - { OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) }, - { OFF, "GL_MESA_texture_array", F(MESA_texture_array) }, - { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, - { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, - { OFF, "GL_NV_blend_square", F(NV_blend_square) }, - { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, - { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, - { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, - { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, - { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) }, - { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, - { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, - { ON, "GL_OES_read_format", F(OES_read_format) }, - { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, - { OFF, "GL_SGI_color_table", F(SGI_color_table) }, - { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, - { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, - { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, - { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, - { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, - { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_SGIX_shadow", F(SGIX_shadow) }, - { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) }, - { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, - { OFF, "GL_S3_s3tc", F(S3_s3tc) }, -}; - - - -/** - * Enable all extensions suitable for a software-only renderer. - * This is a convenience function used by the XMesa, OSMesa, GGI drivers, etc. - */ -void -_mesa_enable_sw_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_draw_buffers = GL_TRUE; -#if FEATURE_ARB_fragment_program - ctx->Extensions.ARB_fragment_program = GL_TRUE; - ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; -#endif -#if FEATURE_ARB_fragment_shader - ctx->Extensions.ARB_fragment_shader = GL_TRUE; -#endif - ctx->Extensions.ARB_half_float_pixel = GL_TRUE; - ctx->Extensions.ARB_imaging = GL_TRUE; - ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query - ctx->Extensions.ARB_occlusion_query = GL_TRUE; -#endif - ctx->Extensions.ARB_point_sprite = GL_TRUE; -#if FEATURE_ARB_shader_objects - ctx->Extensions.ARB_shader_objects = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_100 - ctx->Extensions.ARB_shading_language_100 = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; -#endif - ctx->Extensions.ARB_shadow = GL_TRUE; - ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; - ctx->Extensions.ARB_texture_cube_map = GL_TRUE; - ctx->Extensions.ARB_texture_env_combine = GL_TRUE; - ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; - ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; - /*ctx->Extensions.ARB_texture_float = GL_TRUE;*/ - ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; -#if FEATURE_ARB_vertex_program - ctx->Extensions.ARB_vertex_program = GL_TRUE; -#endif -#if FEATURE_ARB_vertex_shader - ctx->Extensions.ARB_vertex_shader = GL_TRUE; -#endif -#if FEATURE_ARB_vertex_buffer_object - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; -#endif - ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; -#if FEATURE_ATI_fragment_shader - ctx->Extensions.ATI_fragment_shader = GL_TRUE; -#endif - ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; - ctx->Extensions.ATI_texture_mirror_once = GL_TRUE; - ctx->Extensions.ATI_separate_stencil = GL_TRUE; - ctx->Extensions.EXT_blend_color = GL_TRUE; - ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; - ctx->Extensions.EXT_blend_func_separate = GL_TRUE; - ctx->Extensions.EXT_blend_logic_op = GL_TRUE; - ctx->Extensions.EXT_blend_minmax = GL_TRUE; - ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; - ctx->Extensions.EXT_fog_coord = GL_TRUE; -#if FEATURE_EXT_framebuffer_object - ctx->Extensions.EXT_framebuffer_object = GL_TRUE; -#endif -#if FEATURE_EXT_framebuffer_blit - ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; -#endif - ctx->Extensions.EXT_histogram = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; - ctx->Extensions.EXT_paletted_texture = GL_TRUE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif - ctx->Extensions.EXT_point_parameters = GL_TRUE; - ctx->Extensions.EXT_shadow_funcs = GL_TRUE; - ctx->Extensions.EXT_secondary_color = GL_TRUE; - ctx->Extensions.EXT_shared_texture_palette = GL_TRUE; - ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; - ctx->Extensions.EXT_texture_env_add = GL_TRUE; - ctx->Extensions.EXT_texture_env_combine = GL_TRUE; - ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; - ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; - ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; -#if FEATURE_EXT_texture_sRGB - ctx->Extensions.EXT_texture_sRGB = GL_TRUE; -#endif - ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; - ctx->Extensions.MESA_pack_invert = GL_TRUE; -#if FEATURE_MESA_program_debug - ctx->Extensions.MESA_program_debug = GL_TRUE; -#endif - ctx->Extensions.MESA_resize_buffers = GL_TRUE; - ctx->Extensions.MESA_texture_array = GL_TRUE; - ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; - ctx->Extensions.NV_blend_square = GL_TRUE; - /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/ - ctx->Extensions.NV_point_sprite = GL_TRUE; - ctx->Extensions.NV_texture_rectangle = GL_TRUE; - /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/ -#if FEATURE_NV_vertex_program - ctx->Extensions.NV_vertex_program = GL_TRUE; - ctx->Extensions.NV_vertex_program1_1 = GL_TRUE; -#endif -#if FEATURE_NV_fragment_program - ctx->Extensions.NV_fragment_program = GL_TRUE; -#endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; - ctx->Extensions.SGI_texture_color_table = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; - ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; - ctx->Extensions.SGIX_shadow = GL_TRUE; - ctx->Extensions.SGIX_shadow_ambient = GL_TRUE; -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; -#endif -#if FEATURE_texture_fxt1 - _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); -#endif -#if FEATURE_texture_s3tc - if (ctx->Mesa_DXTn) { - _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); - _mesa_enable_extension(ctx, "GL_S3_s3tc"); - } -#endif -} - - -/** - * Enable GL_ARB_imaging and all the EXT extensions that are subsets of it. - */ -void -_mesa_enable_imaging_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_imaging = GL_TRUE; - ctx->Extensions.EXT_blend_color = GL_TRUE; - ctx->Extensions.EXT_blend_logic_op = GL_TRUE; - ctx->Extensions.EXT_blend_minmax = GL_TRUE; - ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.EXT_histogram = GL_TRUE; - ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; -} - - - -/** - * Enable all OpenGL 1.3 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_3_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_multisample = GL_TRUE; - ctx->Extensions.ARB_multitexture = GL_TRUE; - ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; - ctx->Extensions.ARB_texture_compression = GL_TRUE; - ctx->Extensions.ARB_texture_cube_map = GL_TRUE; - ctx->Extensions.ARB_texture_env_combine = GL_TRUE; - ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; - ctx->Extensions.EXT_texture_env_add = GL_TRUE; - /*ctx->Extensions.ARB_transpose_matrix = GL_TRUE;*/ -} - - - -/** - * Enable all OpenGL 1.4 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_4_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_shadow = GL_TRUE; - ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; - ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; - ctx->Extensions.ARB_window_pos = GL_TRUE; - ctx->Extensions.EXT_blend_color = GL_TRUE; - ctx->Extensions.EXT_blend_func_separate = GL_TRUE; - ctx->Extensions.EXT_blend_minmax = GL_TRUE; - ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_fog_coord = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; - ctx->Extensions.EXT_point_parameters = GL_TRUE; - ctx->Extensions.EXT_secondary_color = GL_TRUE; - ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; -} - - -/** - * Enable all OpenGL 1.5 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_5_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; - ctx->Extensions.EXT_shadow_funcs = GL_TRUE; -} - - -/** - * Enable all OpenGL 2.0 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_2_0_extensions(GLcontext *ctx) -{ - ctx->Extensions.ARB_draw_buffers = GL_TRUE; -#if FEATURE_ARB_fragment_shader - ctx->Extensions.ARB_fragment_shader = GL_TRUE; -#endif - ctx->Extensions.ARB_point_sprite = GL_TRUE; - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; -#if FEATURE_ARB_shader_objects - ctx->Extensions.ARB_shader_objects = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_100 - ctx->Extensions.ARB_shading_language_100 = GL_TRUE; -#endif - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; -#if FEATURE_ARB_vertex_shader - ctx->Extensions.ARB_vertex_shader = GL_TRUE; -#endif -} - - -/** - * Enable all OpenGL 2.1 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_2_1_extensions(GLcontext *ctx) -{ -#if FEATURE_EXT_pixel_buffer_object - ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif -#if FEATURE_EXT_texture_sRGB - ctx->Extensions.EXT_texture_sRGB = GL_TRUE; -#endif -#ifdef FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; -#endif -} - - - -/** - * Either enable or disable the named extension. - */ -static void -set_extension( GLcontext *ctx, const char *name, GLboolean state ) -{ - GLboolean *base = (GLboolean *) &ctx->Extensions; - GLuint i; - - if (ctx->Extensions.String) { - /* The string was already queried - can't change it now! */ - _mesa_problem(ctx, "Trying to enable/disable extension after glGetString(GL_EXTENSIONS): %s", name); - return; - } - - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (_mesa_strcmp(default_extensions[i].name, name) == 0) { - if (default_extensions[i].flag_offset) { - GLboolean *enabled = base + default_extensions[i].flag_offset; - *enabled = state; - } - return; - } - } - _mesa_problem(ctx, "Trying to enable unknown extension: %s", name); -} - - -/** - * Enable the named extension. - * Typically called by drivers. - */ -void -_mesa_enable_extension( GLcontext *ctx, const char *name ) -{ - set_extension(ctx, name, GL_TRUE); -} - - -/** - * Disable the named extension. - * XXX is this really needed??? - */ -void -_mesa_disable_extension( GLcontext *ctx, const char *name ) -{ - set_extension(ctx, name, GL_FALSE); -} - - -/** - * Test if the named extension is enabled in this context. - */ -GLboolean -_mesa_extension_is_enabled( GLcontext *ctx, const char *name ) -{ - const GLboolean *base = (const GLboolean *) &ctx->Extensions; - GLuint i; - - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (_mesa_strcmp(default_extensions[i].name, name) == 0) { - if (!default_extensions[i].flag_offset) - return GL_TRUE; - return *(base + default_extensions[i].flag_offset); - } - } - return GL_FALSE; -} - - -/** - * Run through the default_extensions array above and set the - * ctx->Extensions.ARB/EXT_* flags accordingly. - * To be called during context initialization. - */ -void -_mesa_init_extensions( GLcontext *ctx ) -{ - GLboolean *base = (GLboolean *) &ctx->Extensions; - GLuint i; - - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (default_extensions[i].enabled && - default_extensions[i].flag_offset) { - *(base + default_extensions[i].flag_offset) = GL_TRUE; - } - } -} - - -/** - * Construct the GL_EXTENSIONS string. Called the first time that - * glGetString(GL_EXTENSIONS) is called. - */ -GLubyte * -_mesa_make_extension_string( GLcontext *ctx ) -{ - const GLboolean *base = (const GLboolean *) &ctx->Extensions; - GLuint extStrLen = 0; - GLubyte *s; - GLuint i; - - /* first, compute length of the extension string */ - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (!default_extensions[i].flag_offset || - *(base + default_extensions[i].flag_offset)) { - extStrLen += (GLuint)_mesa_strlen(default_extensions[i].name) + 1; - } - } - s = (GLubyte *) _mesa_malloc(extStrLen); - - /* second, build the extension string */ - extStrLen = 0; - for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (!default_extensions[i].flag_offset || - *(base + default_extensions[i].flag_offset)) { - GLuint len = (GLuint)_mesa_strlen(default_extensions[i].name); - _mesa_memcpy(s + extStrLen, default_extensions[i].name, len); - extStrLen += len; - s[extStrLen] = (GLubyte) ' '; - extStrLen++; - } - } - ASSERT(extStrLen > 0); - - s[extStrLen - 1] = 0; - - return s; -} diff --git a/src/libs/mesa/mesa/main/extensions.h b/src/libs/mesa/mesa/main/extensions.h deleted file mode 100644 index 05ad859a27..0000000000 --- a/src/libs/mesa/mesa/main/extensions.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * \file extensions.h - * Extension handling. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 _EXTENSIONS_H_ -#define _EXTENSIONS_H_ - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void _mesa_enable_sw_extensions(GLcontext *ctx); - -extern void _mesa_enable_imaging_extensions(GLcontext *ctx); - -extern void _mesa_enable_1_3_extensions(GLcontext *ctx); - -extern void _mesa_enable_1_4_extensions(GLcontext *ctx); - -extern void _mesa_enable_1_5_extensions(GLcontext *ctx); - -extern void _mesa_enable_2_0_extensions(GLcontext *ctx); - -extern void _mesa_enable_2_1_extensions(GLcontext *ctx); - -extern void _mesa_enable_extension(GLcontext *ctx, const char *name); - -extern void _mesa_disable_extension(GLcontext *ctx, const char *name); - -extern GLboolean _mesa_extension_is_enabled(GLcontext *ctx, const char *name); - -extern void _mesa_init_extensions(GLcontext *ctx); - -extern GLubyte *_mesa_make_extension_string(GLcontext *ctx); - -#else - -/** No-op */ -#define _mesa_extensions_dtr( ctx ) ((void)0) - -/** No-op */ -#define _mesa_extensions_ctr( ctx ) ((void)0) - -/** No-op */ -#define _mesa_extensions_get_string( ctx ) "GL_EXT_texture_object" - -/** No-op */ -#define _mesa_enable_imaging_extensions( c ) ((void)0) - -/** No-op */ -#define _mesa_enable_extension( c, n ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/fbobject.c b/src/libs/mesa/mesa/main/fbobject.c deleted file mode 100644 index 5a7ba453aa..0000000000 --- a/src/libs/mesa/mesa/main/fbobject.c +++ /dev/null @@ -1,1680 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/* - * Authors: - * Brian Paul - */ - - -#include "buffers.h" -#include "context.h" -#include "fbobject.h" -#include "framebuffer.h" -#include "hash.h" -#include "mipmap.h" -#include "renderbuffer.h" -#include "state.h" -#include "teximage.h" -#include "texobj.h" -#include "texstore.h" - - -/** - * Notes: - * - * None of the GL_EXT_framebuffer_object functions are compiled into - * display lists. - */ - - - -/* - * When glGenRender/FramebuffersEXT() is called we insert pointers to - * these placeholder objects into the hash table. - * Later, when the object ID is first bound, we replace the placeholder - * with the real frame/renderbuffer. - */ -static struct gl_framebuffer DummyFramebuffer; -static struct gl_renderbuffer DummyRenderbuffer; - - -#define IS_CUBE_FACE(TARGET) \ - ((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \ - (TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) - - -static void -delete_dummy_renderbuffer(struct gl_renderbuffer *rb) -{ - /* no op */ -} - -static void -delete_dummy_framebuffer(struct gl_framebuffer *fb) -{ - /* no op */ -} - - -void -_mesa_init_fbobjects(GLcontext *ctx) -{ - DummyFramebuffer.Delete = delete_dummy_framebuffer; - DummyRenderbuffer.Delete = delete_dummy_renderbuffer; -} - - -/** - * Helper routine for getting a gl_renderbuffer. - */ -struct gl_renderbuffer * -_mesa_lookup_renderbuffer(GLcontext *ctx, GLuint id) -{ - struct gl_renderbuffer *rb; - - if (id == 0) - return NULL; - - rb = (struct gl_renderbuffer *) - _mesa_HashLookup(ctx->Shared->RenderBuffers, id); - return rb; -} - - -/** - * Helper routine for getting a gl_framebuffer. - */ -struct gl_framebuffer * -_mesa_lookup_framebuffer(GLcontext *ctx, GLuint id) -{ - struct gl_framebuffer *fb; - - if (id == 0) - return NULL; - - fb = (struct gl_framebuffer *) - _mesa_HashLookup(ctx->Shared->FrameBuffers, id); - return fb; -} - - -/** - * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding - * gl_renderbuffer_attachment object. - */ -struct gl_renderbuffer_attachment * -_mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, - GLenum attachment) -{ - GLuint i; - - switch (attachment) { - case GL_COLOR_ATTACHMENT0_EXT: - case GL_COLOR_ATTACHMENT1_EXT: - case GL_COLOR_ATTACHMENT2_EXT: - case GL_COLOR_ATTACHMENT3_EXT: - case GL_COLOR_ATTACHMENT4_EXT: - case GL_COLOR_ATTACHMENT5_EXT: - case GL_COLOR_ATTACHMENT6_EXT: - case GL_COLOR_ATTACHMENT7_EXT: - case GL_COLOR_ATTACHMENT8_EXT: - case GL_COLOR_ATTACHMENT9_EXT: - case GL_COLOR_ATTACHMENT10_EXT: - case GL_COLOR_ATTACHMENT11_EXT: - case GL_COLOR_ATTACHMENT12_EXT: - case GL_COLOR_ATTACHMENT13_EXT: - case GL_COLOR_ATTACHMENT14_EXT: - case GL_COLOR_ATTACHMENT15_EXT: - i = attachment - GL_COLOR_ATTACHMENT0_EXT; - if (i >= ctx->Const.MaxColorAttachments) { - return NULL; - } - return &fb->Attachment[BUFFER_COLOR0 + i]; - case GL_DEPTH_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_DEPTH]; - case GL_STENCIL_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_STENCIL]; - default: - return NULL; - } -} - - -/** - * Remove any texture or renderbuffer attached to the given attachment - * point. Update reference counts, etc. - */ -void -_mesa_remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att) -{ - if (att->Type == GL_TEXTURE) { - ASSERT(att->Texture); - if (ctx->Driver.FinishRenderTexture) { - /* tell driver we're done rendering to this texobj */ - ctx->Driver.FinishRenderTexture(ctx, att); - } - _mesa_reference_texobj(&att->Texture, NULL); /* unbind */ - ASSERT(!att->Texture); - } - if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) { - ASSERT(!att->Texture); - _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */ - ASSERT(!att->Renderbuffer); - } - att->Type = GL_NONE; - att->Complete = GL_TRUE; -} - - -/** - * Bind a texture object to an attachment point. - * The previous binding, if any, will be removed first. - */ -void -_mesa_set_texture_attachment(GLcontext *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att, - struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset) -{ - if (att->Texture == texObj) { - /* re-attaching same texture */ - ASSERT(att->Type == GL_TEXTURE); - } - else { - /* new attachment */ - _mesa_remove_attachment(ctx, att); - att->Type = GL_TEXTURE; - assert(!att->Texture); - _mesa_reference_texobj(&att->Texture, texObj); - } - - /* always update these fields */ - att->TextureLevel = level; - if (IS_CUBE_FACE(texTarget)) { - att->CubeMapFace = texTarget - GL_TEXTURE_CUBE_MAP_POSITIVE_X; - } - else { - att->CubeMapFace = 0; - } - att->Zoffset = zoffset; - att->Complete = GL_FALSE; - - if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { - ctx->Driver.RenderTexture(ctx, fb, att); - } -} - - -/** - * Bind a renderbuffer to an attachment point. - * The previous binding, if any, will be removed first. - */ -void -_mesa_set_renderbuffer_attachment(GLcontext *ctx, - struct gl_renderbuffer_attachment *att, - struct gl_renderbuffer *rb) -{ - /* XXX check if re-doing same attachment, exit early */ - _mesa_remove_attachment(ctx, att); - att->Type = GL_RENDERBUFFER_EXT; - att->Texture = NULL; /* just to be safe */ - att->Complete = GL_FALSE; - _mesa_reference_renderbuffer(&att->Renderbuffer, rb); -} - - -/** - * Fallback for ctx->Driver.FramebufferRenderbuffer() - * Attach a renderbuffer object to a framebuffer object. - */ -void -_mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLenum attachment, struct gl_renderbuffer *rb) -{ - struct gl_renderbuffer_attachment *att; - - _glthread_LOCK_MUTEX(fb->Mutex); - - att = _mesa_get_attachment(ctx, fb, attachment); - ASSERT(att); - if (rb) { - _mesa_set_renderbuffer_attachment(ctx, att, rb); - } - else { - _mesa_remove_attachment(ctx, att); - } - - _glthread_UNLOCK_MUTEX(fb->Mutex); -} - - -/** - * Test if an attachment point is complete and update its Complete field. - * \param format if GL_COLOR, this is a color attachment point, - * if GL_DEPTH, this is a depth component attachment point, - * if GL_STENCIL, this is a stencil component attachment point. - */ -static void -test_attachment_completeness(const GLcontext *ctx, GLenum format, - struct gl_renderbuffer_attachment *att) -{ - assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL); - - /* assume complete */ - att->Complete = GL_TRUE; - - /* Look for reasons why the attachment might be incomplete */ - if (att->Type == GL_TEXTURE) { - const struct gl_texture_object *texObj = att->Texture; - struct gl_texture_image *texImage; - - if (!texObj) { - att->Complete = GL_FALSE; - return; - } - - texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; - if (!texImage) { - att->Complete = GL_FALSE; - return; - } - if (texImage->Width < 1 || texImage->Height < 1) { - att->Complete = GL_FALSE; - return; - } - if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) { - att->Complete = GL_FALSE; - return; - } - - if (format == GL_COLOR) { - if (texImage->TexFormat->BaseFormat != GL_RGB && - texImage->TexFormat->BaseFormat != GL_RGBA) { - att->Complete = GL_FALSE; - return; - } - } - else if (format == GL_DEPTH) { - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att->Complete = GL_FALSE; - return; - } - } - else { - ASSERT(format == GL_STENCIL); - ASSERT(att->Renderbuffer->StencilBits); - if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - /* no such thing as stencil-only textures */ - att->Complete = GL_FALSE; - return; - } - } - } - else if (att->Type == GL_RENDERBUFFER_EXT) { - ASSERT(att->Renderbuffer); - if (!att->Renderbuffer->InternalFormat || - att->Renderbuffer->Width < 1 || - att->Renderbuffer->Height < 1) { - att->Complete = GL_FALSE; - return; - } - if (format == GL_COLOR) { - if (att->Renderbuffer->_BaseFormat != GL_RGB && - att->Renderbuffer->_BaseFormat != GL_RGBA) { - ASSERT(att->Renderbuffer->RedBits); - ASSERT(att->Renderbuffer->GreenBits); - ASSERT(att->Renderbuffer->BlueBits); - att->Complete = GL_FALSE; - return; - } - } - else if (format == GL_DEPTH) { - ASSERT(att->Renderbuffer->DepthBits); - if (att->Renderbuffer->_BaseFormat == GL_DEPTH_COMPONENT) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att->Complete = GL_FALSE; - return; - } - } - else { - assert(format == GL_STENCIL); - ASSERT(att->Renderbuffer->StencilBits); - if (att->Renderbuffer->_BaseFormat == GL_STENCIL_INDEX) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att->Complete = GL_FALSE; - return; - } - } - } - else { - ASSERT(att->Type == GL_NONE); - /* complete */ - return; - } -} - - -/** - * Helpful for debugging - */ -static void -fbo_incomplete(const char *msg, int index) -{ - (void) msg; - (void) index; - /* - _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index); - */ -} - - -/** - * Test if the given framebuffer object is complete and update its - * Status field with the results. - * Also update the framebuffer's Width and Height fields if the - * framebuffer is complete. - */ -void -_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) -{ - GLuint numImages, width = 0, height = 0; - GLenum intFormat = GL_NONE; - GLuint w = 0, h = 0; - GLint i; - GLuint j; - - assert(fb->Name != 0); - - numImages = 0; - fb->Width = 0; - fb->Height = 0; - - /* Start at -2 to more easily loop over all attachment points */ - for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { - struct gl_renderbuffer_attachment *att; - GLenum f; - - if (i == -2) { - att = &fb->Attachment[BUFFER_DEPTH]; - test_attachment_completeness(ctx, GL_DEPTH, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("depth attachment incomplete", -1); - return; - } - } - else if (i == -1) { - att = &fb->Attachment[BUFFER_STENCIL]; - test_attachment_completeness(ctx, GL_STENCIL, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("stencil attachment incomplete", -1); - return; - } - } - else { - att = &fb->Attachment[BUFFER_COLOR0 + i]; - test_attachment_completeness(ctx, GL_COLOR, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("color attachment incomplete", i); - return; - } - } - - if (att->Type == GL_TEXTURE) { - const struct gl_texture_image *texImg - = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - w = texImg->Width; - h = texImg->Height; - f = texImg->_BaseFormat; - numImages++; - if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT - && f != GL_DEPTH_STENCIL_EXT) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("texture attachment incomplete", -1); - return; - } - } - else if (att->Type == GL_RENDERBUFFER_EXT) { - w = att->Renderbuffer->Width; - h = att->Renderbuffer->Height; - f = att->Renderbuffer->InternalFormat; - numImages++; - } - else { - assert(att->Type == GL_NONE); - continue; - } - - if (numImages == 1) { - /* set required width, height and format */ - width = w; - height = h; - if (i >= 0) - intFormat = f; - } - else { - /* check that width, height, format are same */ - if (w != width || h != height) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; - fbo_incomplete("width or height mismatch", -1); - return; - } - if (intFormat != GL_NONE && f != intFormat) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("format mismatch", -1); - return; - } - } - } - -#ifndef FEATURE_OES_framebuffer_object - /* Check that all DrawBuffers are present */ - for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { - if (fb->ColorDrawBuffer[j] != GL_NONE) { - const struct gl_renderbuffer_attachment *att - = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]); - assert(att); - if (att->Type == GL_NONE) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT; - fbo_incomplete("missing drawbuffer", j); - return; - } - } - } - - /* Check that the ReadBuffer is present */ - if (fb->ColorReadBuffer != GL_NONE) { - const struct gl_renderbuffer_attachment *att - = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer); - assert(att); - if (att->Type == GL_NONE) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT; - fbo_incomplete("missing readbuffer", -1); - return; - } - } -#endif - - if (numImages == 0) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; - fbo_incomplete("no attachments", -1); - return; - } - - /* - * If we get here, the framebuffer is complete! - */ - fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - fb->Width = w; - fb->Height = h; -} - - -GLboolean GLAPIENTRY -_mesa_IsRenderbufferEXT(GLuint renderbuffer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (renderbuffer) { - struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (rb != NULL && rb != &DummyRenderbuffer) - return GL_TRUE; - } - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) -{ - struct gl_renderbuffer *newRb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glBindRenderbufferEXT(target)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - - - if (renderbuffer) { - newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (newRb == &DummyRenderbuffer) { - /* ID was reserved, but no real renderbuffer object made yet */ - newRb = NULL; - } - if (!newRb) { - /* create new renderbuffer object */ - newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); - if (!newRb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT"); - return; - } - ASSERT(newRb->AllocStorage); - _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb); - newRb->RefCount = 1; /* referenced by hash table */ - } - } - else { - newRb = NULL; - } - - ASSERT(newRb != &DummyRenderbuffer); - - _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb); -} - - -void GLAPIENTRY -_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - for (i = 0; i < n; i++) { - if (renderbuffers[i] > 0) { - struct gl_renderbuffer *rb; - rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]); - if (rb) { - /* check if deleting currently bound renderbuffer object */ - if (rb == ctx->CurrentRenderbuffer) { - /* bind default */ - ASSERT(rb->RefCount >= 2); - _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); - } - - /* Remove from hash table immediately, to free the ID. - * But the object will not be freed until it's no longer - * referenced anywhere else. - */ - _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]); - - if (rb != &DummyRenderbuffer) { - /* no longer referenced by hash table */ - _mesa_reference_renderbuffer(&rb, NULL); - } - } - } - } -} - - -void GLAPIENTRY -_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)"); - return; - } - - if (!renderbuffers) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n); - - for (i = 0; i < n; i++) { - GLuint name = first + i; - renderbuffers[i] = name; - /* insert dummy placeholder into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - } -} - - -/** - * Given an internal format token for a render buffer, return the - * corresponding base format. - * This is very similar to _mesa_base_tex_format() but the set of valid - * internal formats is somewhat different. - * - * \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT - * GL_DEPTH_STENCIL_EXT or zero if error. - */ -GLenum -_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat) -{ - switch (internalFormat) { - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return GL_RGBA; - case GL_STENCIL_INDEX: - case GL_STENCIL_INDEX1_EXT: - case GL_STENCIL_INDEX4_EXT: - case GL_STENCIL_INDEX8_EXT: - case GL_STENCIL_INDEX16_EXT: - return GL_STENCIL_INDEX; - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil) - return GL_DEPTH_STENCIL_EXT; - else - return 0; - /* XXX add floating point formats eventually */ - default: - return 0; - } -} - - -void GLAPIENTRY -_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height) -{ - struct gl_renderbuffer *rb; - GLenum baseFormat; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)"); - return; - } - - baseFormat = _mesa_base_fbo_format(ctx, internalFormat); - if (baseFormat == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glRenderbufferStorageEXT(internalFormat)"); - return; - } - - if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(width)"); - return; - } - - if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(height)"); - return; - } - - rb = ctx->CurrentRenderbuffer; - - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glRenderbufferStorageEXT"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - if (rb->InternalFormat == internalFormat && - rb->Width == (GLuint) width && - rb->Height == (GLuint) height) { - /* no change in allocation needed */ - return; - } - - /* These MUST get set by the AllocStorage func */ - rb->_ActualFormat = 0; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; - - /* Now allocate the storage */ - ASSERT(rb->AllocStorage); - if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { - /* No error - check/set fields now */ - assert(rb->_ActualFormat); - assert(rb->Width == (GLuint) width); - assert(rb->Height == (GLuint) height); - assert(rb->RedBits || rb->GreenBits || rb->BlueBits || rb->AlphaBits || - rb->DepthBits || rb->StencilBits || rb->IndexBits); - rb->InternalFormat = internalFormat; - rb->_BaseFormat = baseFormat; - } - else { - /* Probably ran out of memory - clear the fields */ - rb->Width = 0; - rb->Height = 0; - rb->InternalFormat = GL_NONE; - rb->_ActualFormat = GL_NONE; - rb->_BaseFormat = GL_NONE; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; - } - - /* - test_framebuffer_completeness(ctx, fb); - */ - /* XXX if this renderbuffer is attached anywhere, invalidate attachment - * points??? - */ -} - - -void GLAPIENTRY -_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetRenderbufferParameterivEXT(target)"); - return; - } - - if (!ctx->CurrentRenderbuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetRenderbufferParameterivEXT"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - switch (pname) { - case GL_RENDERBUFFER_WIDTH_EXT: - *params = ctx->CurrentRenderbuffer->Width; - return; - case GL_RENDERBUFFER_HEIGHT_EXT: - *params = ctx->CurrentRenderbuffer->Height; - return; - case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: - *params = ctx->CurrentRenderbuffer->InternalFormat; - return; - case GL_RENDERBUFFER_RED_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->RedBits; - break; - case GL_RENDERBUFFER_GREEN_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->GreenBits; - break; - case GL_RENDERBUFFER_BLUE_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->BlueBits; - break; - case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->AlphaBits; - break; - case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->DepthBits; - break; - case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->StencilBits; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetRenderbufferParameterivEXT(target)"); - return; - } -} - - -GLboolean GLAPIENTRY -_mesa_IsFramebufferEXT(GLuint framebuffer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (framebuffer) { - struct gl_framebuffer *rb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (rb != NULL && rb != &DummyFramebuffer) - return GL_TRUE; - } - return GL_FALSE; -} - - -static void -check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) -{ - GLuint i; - ASSERT(ctx->Driver.RenderTexture); - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = fb->Attachment + i; - struct gl_texture_object *texObj = att->Texture; - if (texObj - && att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { - ctx->Driver.RenderTexture(ctx, fb, att); - } - } -} - - -/** - * Examine all the framebuffer's attachments to see if any are textures. - * If so, call ctx->Driver.FinishRenderTexture() for each texture to - * notify the device driver that the texture image may have changed. - */ -static void -check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) -{ - if (ctx->Driver.FinishRenderTexture) { - GLuint i; - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = fb->Attachment + i; - if (att->Texture && att->Renderbuffer) { - ctx->Driver.FinishRenderTexture(ctx, att); - } - } - } -} - - -void GLAPIENTRY -_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) -{ - struct gl_framebuffer *newFb, *newFbread; - GLboolean bindReadBuf, bindDrawBuf; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindFramebufferEXT(unsupported)"); - return; - } - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - bindDrawBuf = GL_TRUE; - bindReadBuf = GL_FALSE; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - bindDrawBuf = GL_FALSE; - bindReadBuf = GL_TRUE; - break; -#endif - case GL_FRAMEBUFFER_EXT: - bindDrawBuf = GL_TRUE; - bindReadBuf = GL_TRUE; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } - - if (framebuffer) { - /* Binding a user-created framebuffer object */ - newFb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (newFb == &DummyFramebuffer) { - /* ID was reserved, but no real framebuffer object made yet */ - newFb = NULL; - } - if (!newFb) { - /* create new framebuffer object */ - newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); - if (!newFb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT"); - return; - } - _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb); - } - newFbread = newFb; - } - else { - /* Binding the window system framebuffer (which was originally set - * with MakeCurrent). - */ - newFb = ctx->WinSysDrawBuffer; - newFbread = ctx->WinSysReadBuffer; - } - - ASSERT(newFb); - ASSERT(newFb != &DummyFramebuffer); - - /* - * XXX check if re-binding same buffer and skip some of this code. - */ - - if (bindReadBuf) { - _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); - } - - if (bindDrawBuf) { - /* check if old FB had any texture attachments */ - check_end_texture_render(ctx, ctx->DrawBuffer); - - /* check if time to delete this framebuffer */ - _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); - - if (newFb->Name != 0) { - /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newFb); - } - } - - if (ctx->Driver.BindFramebuffer) { - ctx->Driver.BindFramebuffer(ctx, target, newFb, newFbread); - } -} - - -void GLAPIENTRY -_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - - for (i = 0; i < n; i++) { - if (framebuffers[i] > 0) { - struct gl_framebuffer *fb; - fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]); - if (fb) { - ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); - - /* check if deleting currently bound framebuffer object */ - if (fb == ctx->DrawBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - } - - /* remove from hash table immediately, to free the ID */ - _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]); - - if (fb != &DummyFramebuffer) { - /* But the object will not be freed until it's no longer - * bound in any context. - */ - _mesa_unreference_framebuffer(&fb); - } - } - } - } -} - - -void GLAPIENTRY -_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenFramebuffersEXT(n)"); - return; - } - - if (!framebuffers) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->FrameBuffers, n); - - for (i = 0; i < n; i++) { - GLuint name = first + i; - framebuffers[i] = name; - /* insert dummy placeholder into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashInsert(ctx->Shared->FrameBuffers, name, &DummyFramebuffer); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - } -} - - - -GLenum GLAPIENTRY -_mesa_CheckFramebufferStatusEXT(GLenum target) -{ - struct gl_framebuffer *buffer; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; - } - buffer = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; - } - buffer = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - buffer = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; /* formerly GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - } - - if (buffer->Name == 0) { - /* The window system / default framebuffer is always complete */ - return GL_FRAMEBUFFER_COMPLETE_EXT; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - _mesa_test_framebuffer_completeness(ctx, buffer); - return buffer->_Status; -} - - - -/** - * Common code called by glFramebufferTexture1D/2D/3DEXT(). - */ -static void -framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, - GLenum attachment, GLenum textarget, GLuint texture, - GLint level, GLint zoffset) -{ - struct gl_renderbuffer_attachment *att; - struct gl_texture_object *texObj = NULL; - struct gl_framebuffer *fb; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_FRAMEBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target)", caller); - return; - } - - fb = ctx->DrawBuffer; - ASSERT(fb); - - /* check framebuffer binding */ - if (fb->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT", caller); - return; - } - - - /* The textarget, level, and zoffset parameters are only validated if - * texture is non-zero. - */ - if (texture) { - GLboolean err = GL_TRUE; - - texObj = _mesa_lookup_texture(ctx, texture); - if (texObj != NULL) { - if (textarget == 0) { - err = (texObj->Target != GL_TEXTURE_3D) && - (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && - (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); - } - else { - err = (texObj->Target == GL_TEXTURE_CUBE_MAP) - ? !IS_CUBE_FACE(textarget) - : (texObj->Target != textarget); - } - } - - if (err) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(texture target mismatch)", - caller); - return; - } - - if (texObj->Target == GL_TEXTURE_3D) { - const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - if (zoffset < 0 || zoffset >= maxSize) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(zoffset)", caller); - return; - } - } - else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) || - (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) { - if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(layer)", caller); - return; - } - } - - - if ((level < 0) || - (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(level)", caller); - return; - } - } - - att = _mesa_get_attachment(ctx, fb, attachment); - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(attachment)", caller); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - - _glthread_LOCK_MUTEX(fb->Mutex); - if (texObj) { - _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, - level, zoffset); - } - else { - _mesa_remove_attachment(ctx, att); - } - _glthread_UNLOCK_MUTEX(fb->Mutex); -} - - - -void GLAPIENTRY -_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && (textarget != GL_TEXTURE_1D)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture1DEXT(textarget)"); - return; - } - - framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, - level, 0); -} - - -void GLAPIENTRY -_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && - (textarget != GL_TEXTURE_2D) && - (textarget != GL_TEXTURE_RECTANGLE_ARB) && - (!IS_CUBE_FACE(textarget))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget)"); - return; - } - - framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, - level, 0); -} - - -void GLAPIENTRY -_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, - GLint level, GLint zoffset) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && (textarget != GL_TEXTURE_3D)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture3DEXT(textarget)"); - return; - } - - framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, - level, zoffset); -} - - -void GLAPIENTRY -_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, - GLuint texture, GLint level, GLint layer) -{ - GET_CURRENT_CONTEXT(ctx); - - framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, - level, layer); -} - - -void GLAPIENTRY -_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, - GLenum renderbufferTarget, - GLuint renderbuffer) -{ - struct gl_renderbuffer_attachment *att; - struct gl_framebuffer *fb; - struct gl_renderbuffer *rb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - fb = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - fb = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - fb = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - - if (renderbufferTarget != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(renderbufferTarget)"); - return; - } - - if (fb->Name == 0) { - /* Can't attach new renderbuffers to a window system framebuffer */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT"); - return; - } - - att = _mesa_get_attachment(ctx, fb, attachment); - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(attachment)"); - return; - } - - if (renderbuffer) { - rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer)"); - return; - } - } - else { - /* remove renderbuffer attachment */ - rb = NULL; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - - assert(ctx->Driver.FramebufferRenderbuffer); - ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); - - /* Some subsequent GL commands may depend on the framebuffer's visual - * after the binding is updated. Update visual info now. - */ - _mesa_update_framebuffer_visual(fb); -} - - -void GLAPIENTRY -_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, - GLenum pname, GLint *params) -{ - const struct gl_renderbuffer_attachment *att; - struct gl_framebuffer *buffer; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - buffer = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - buffer = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - buffer = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - - if (buffer->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetFramebufferAttachmentParameterivEXT"); - return; - } - - att = _mesa_get_attachment(ctx, buffer, attachment); - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(attachment)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - - switch (pname) { - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: - *params = att->Type; - return; - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: - if (att->Type == GL_RENDERBUFFER_EXT) { - *params = att->Renderbuffer->Name; - } - else if (att->Type == GL_TEXTURE) { - *params = att->Texture->Name; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: - if (att->Type == GL_TEXTURE) { - *params = att->TextureLevel; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: - if (att->Type == GL_TEXTURE) { - if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) { - *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace; - } - else { - *params = 0; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: - if (att->Type == GL_TEXTURE) { - if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) { - *params = att->Zoffset; - } - else { - *params = 0; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GenerateMipmapEXT(GLenum target) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - switch (target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_CUBE_MAP: - /* OK, legal value */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - if (target == GL_TEXTURE_CUBE_MAP) { - int face; - - for (face = 0; face < 6; face++) - ctx->Driver.GenerateMipmap(ctx, - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, - texObj); - } else { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unlock_texture(ctx, texObj); -} - - -#if FEATURE_EXT_framebuffer_blit -void GLAPIENTRY -_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) -{ - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - if (!ctx->ReadBuffer) { - /* XXX */ - } - - /* check for complete framebuffers */ - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || - ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glBlitFramebufferEXT(incomplete draw/read buffers)"); - return; - } - - if (filter != GL_NEAREST && filter != GL_LINEAR) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)"); - return; - } - - if (mask & ~(GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT)) { - _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)"); - return; - } - - /* depth/stencil must be blitted with nearest filtering */ - if ((mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) - && filter != GL_NEAREST) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(depth/stencil requires GL_NEAREST filter"); - return; - } - - if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_StencilBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_StencilBuffer; - if (readRb->StencilBits != drawRb->StencilBits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(stencil buffer size mismatch"); - return; - } - } - - if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_DepthBuffer; - if (readRb->DepthBits != drawRb->DepthBits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(depth buffer size mismatch"); - return; - } - } - - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT"); - return; - } - - ASSERT(ctx->Driver.BlitFramebuffer); - ctx->Driver.BlitFramebuffer(ctx, - srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter); -} -#endif /* FEATURE_EXT_framebuffer_blit */ diff --git a/src/libs/mesa/mesa/main/fbobject.h b/src/libs/mesa/mesa/main/fbobject.h deleted file mode 100644 index b6154719ab..0000000000 --- a/src/libs/mesa/mesa/main/fbobject.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 FBOBJECT_H -#define FBOBJECT_H - - -extern void -_mesa_init_fbobjects(GLcontext *ctx); - -extern struct gl_renderbuffer * -_mesa_lookup_renderbuffer(GLcontext *ctx, GLuint id); - -extern struct gl_framebuffer * -_mesa_lookup_framebuffer(GLcontext *ctx, GLuint id); - -extern struct gl_renderbuffer_attachment * -_mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, - GLenum attachment); - - -extern void -_mesa_remove_attachment(GLcontext *ctx, - struct gl_renderbuffer_attachment *att); - -extern void -_mesa_set_texture_attachment(GLcontext *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att, - struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset); - -extern void -_mesa_set_renderbuffer_attachment(GLcontext *ctx, - struct gl_renderbuffer_attachment *att, - struct gl_renderbuffer *rb); - -extern void -_mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLenum attachment, struct gl_renderbuffer *rb); - -extern void -_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb); - -extern GLenum -_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat); - -extern GLboolean GLAPIENTRY -_mesa_IsRenderbufferEXT(GLuint renderbuffer); - -extern void GLAPIENTRY -_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer); - -extern void GLAPIENTRY -_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers); - -extern void GLAPIENTRY -_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers); - -extern void GLAPIENTRY -_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height); - -extern void GLAPIENTRY -_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, - GLint *params); - -extern GLboolean GLAPIENTRY -_mesa_IsFramebufferEXT(GLuint framebuffer); - -extern void GLAPIENTRY -_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer); - -extern void GLAPIENTRY -_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers); - -extern void GLAPIENTRY -_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers); - -extern GLenum GLAPIENTRY -_mesa_CheckFramebufferStatusEXT(GLenum target); - -extern void GLAPIENTRY -_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level); - -extern void GLAPIENTRY -_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level); - -extern void GLAPIENTRY -_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, - GLint level, GLint zoffset); - -extern void GLAPIENTRY -_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, - GLuint texture, GLint level, GLint layer); - -extern void GLAPIENTRY -_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, - GLenum renderbuffertarget, - GLuint renderbuffer); - -extern void GLAPIENTRY -_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, - GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GenerateMipmapEXT(GLenum target); - - -extern void GLAPIENTRY -_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); - - -#endif /* FBOBJECT_H */ diff --git a/src/libs/mesa/mesa/main/feedback.c b/src/libs/mesa/mesa/main/feedback.c deleted file mode 100644 index 48c2ccbff3..0000000000 --- a/src/libs/mesa/mesa/main/feedback.c +++ /dev/null @@ -1,541 +0,0 @@ -/** - * \file feedback.c - * Selection and feedback modes functions. - */ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - - -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "feedback.h" -#include "macros.h" -#include "mtypes.h" - - -#if _HAVE_FULL_GL - - -#define FB_3D 0x01 -#define FB_4D 0x02 -#define FB_INDEX 0x04 -#define FB_COLOR 0x08 -#define FB_TEXTURE 0X10 - - - -void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode==GL_FEEDBACK) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glFeedbackBuffer" ); - return; - } - if (size<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glFeedbackBuffer(size<0)" ); - return; - } - if (!buffer) { - _mesa_error( ctx, GL_INVALID_VALUE, "glFeedbackBuffer(buffer==NULL)" ); - ctx->Feedback.BufferSize = 0; - return; - } - - switch (type) { - case GL_2D: - ctx->Feedback._Mask = 0; - break; - case GL_3D: - ctx->Feedback._Mask = FB_3D; - break; - case GL_3D_COLOR: - ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX)); - break; - case GL_3D_COLOR_TEXTURE: - ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | - FB_TEXTURE); - break; - case GL_4D_COLOR_TEXTURE: - ctx->Feedback._Mask = (FB_3D | FB_4D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | - FB_TEXTURE); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glFeedbackBuffer" ); - return; - } - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); /* Always flush */ - ctx->Feedback.Type = type; - ctx->Feedback.BufferSize = size; - ctx->Feedback.Buffer = buffer; - ctx->Feedback.Count = 0; /* Becaues of this. */ -} - - -void GLAPIENTRY -_mesa_PassThrough( GLfloat token ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode==GL_FEEDBACK) { - FLUSH_VERTICES(ctx, 0); - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_PASS_THROUGH_TOKEN ); - FEEDBACK_TOKEN( ctx, token ); - } -} - - - -/* - * Put a vertex into the feedback buffer. - */ -void _mesa_feedback_vertex( GLcontext *ctx, - const GLfloat win[4], - const GLfloat color[4], - GLfloat index, - const GLfloat texcoord[4] ) -{ -#if 0 - { - /* snap window x, y to fractional pixel position */ - const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); - GLfixed x, y; - x = FloatToFixed(win[0]) & snapMask; - y = FloatToFixed(win[1]) & snapMask; - FEEDBACK_TOKEN(ctx, FixedToFloat(x)); - FEEDBACK_TOKEN(ctx, FixedToFloat(y) ); - } -#else - FEEDBACK_TOKEN( ctx, win[0] ); - FEEDBACK_TOKEN( ctx, win[1] ); -#endif - if (ctx->Feedback._Mask & FB_3D) { - FEEDBACK_TOKEN( ctx, win[2] ); - } - if (ctx->Feedback._Mask & FB_4D) { - FEEDBACK_TOKEN( ctx, win[3] ); - } - if (ctx->Feedback._Mask & FB_INDEX) { - FEEDBACK_TOKEN( ctx, (GLfloat) index ); - } - if (ctx->Feedback._Mask & FB_COLOR) { - FEEDBACK_TOKEN( ctx, color[0] ); - FEEDBACK_TOKEN( ctx, color[1] ); - FEEDBACK_TOKEN( ctx, color[2] ); - FEEDBACK_TOKEN( ctx, color[3] ); - } - if (ctx->Feedback._Mask & FB_TEXTURE) { - FEEDBACK_TOKEN( ctx, texcoord[0] ); - FEEDBACK_TOKEN( ctx, texcoord[1] ); - FEEDBACK_TOKEN( ctx, texcoord[2] ); - FEEDBACK_TOKEN( ctx, texcoord[3] ); - } -} - -#endif - - -/**********************************************************************/ -/** \name Selection */ -/*@{*/ - -/** - * Establish a buffer for selection mode values. - * - * \param size buffer size. - * \param buffer buffer. - * - * \sa glSelectBuffer(). - * - * \note this function can't be put in a display list. - * - * Verifies we're not in selection mode, flushes the vertices and initialize - * the fields in __GLcontextRec::Select with the given buffer. - */ -void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode==GL_SELECT) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" ); - return; /* KW: added return */ - } - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); - ctx->Select.Buffer = buffer; - ctx->Select.BufferSize = size; - ctx->Select.BufferCount = 0; - ctx->Select.HitFlag = GL_FALSE; - ctx->Select.HitMinZ = 1.0; - ctx->Select.HitMaxZ = 0.0; -} - - -/** - * Write a value of a record into the selection buffer. - * - * \param CTX GL context. - * \param V value. - * - * Verifies there is free space in the buffer to write the value and - * increments the pointer. - */ -#define WRITE_RECORD( CTX, V ) \ - if (CTX->Select.BufferCount < CTX->Select.BufferSize) { \ - CTX->Select.Buffer[CTX->Select.BufferCount] = (V); \ - } \ - CTX->Select.BufferCount++; - - -/** - * Update the hit flag and the maximum and minimum depth values. - * - * \param ctx GL context. - * \param z depth. - * - * Sets gl_selection::HitFlag and updates gl_selection::HitMinZ and - * gl_selection::HitMaxZ. - */ -void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ) -{ - ctx->Select.HitFlag = GL_TRUE; - if (z < ctx->Select.HitMinZ) { - ctx->Select.HitMinZ = z; - } - if (z > ctx->Select.HitMaxZ) { - ctx->Select.HitMaxZ = z; - } -} - - -/** - * Write the hit record. - * - * \param ctx GL context. - * - * Write the hit record, i.e., the number of names in the stack, the minimum and - * maximum depth values and the number of names in the name stack at the time - * of the event. Resets the hit flag. - * - * \sa gl_selection. - */ -static void write_hit_record( GLcontext *ctx ) -{ - GLuint i; - GLuint zmin, zmax, zscale = (~0u); - - /* HitMinZ and HitMaxZ are in [0,1]. Multiply these values by */ - /* 2^32-1 and round to nearest unsigned integer. */ - - assert( ctx != NULL ); /* this line magically fixes a SunOS 5.x/gcc bug */ - zmin = (GLuint) ((GLfloat) zscale * ctx->Select.HitMinZ); - zmax = (GLuint) ((GLfloat) zscale * ctx->Select.HitMaxZ); - - WRITE_RECORD( ctx, ctx->Select.NameStackDepth ); - WRITE_RECORD( ctx, zmin ); - WRITE_RECORD( ctx, zmax ); - for (i = 0; i < ctx->Select.NameStackDepth; i++) { - WRITE_RECORD( ctx, ctx->Select.NameStack[i] ); - } - - ctx->Select.Hits++; - ctx->Select.HitFlag = GL_FALSE; - ctx->Select.HitMinZ = 1.0; - ctx->Select.HitMaxZ = -1.0; -} - - -/** - * Initialize the name stack. - * - * Verifies we are in select mode and resets the name stack depth and resets - * the hit record data in gl_selection. Marks new render mode in - * __GLcontextRec::NewState. - */ -void GLAPIENTRY -_mesa_InitNames( void ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - /* Record the hit before the HitFlag is wiped out again. */ - if (ctx->RenderMode == GL_SELECT) { - if (ctx->Select.HitFlag) { - write_hit_record( ctx ); - } - } - ctx->Select.NameStackDepth = 0; - ctx->Select.HitFlag = GL_FALSE; - ctx->Select.HitMinZ = 1.0; - ctx->Select.HitMaxZ = 0.0; - ctx->NewState |= _NEW_RENDERMODE; -} - - -/** - * Load the top-most name of the name stack. - * - * \param name name. - * - * Verifies we are in selection mode and that the name stack is not empty. - * Flushes vertices. If there is a hit flag writes it (via write_hit_record()), - * and replace the top-most name in the stack. - * - * sa __GLcontextRec::Select. - */ -void GLAPIENTRY -_mesa_LoadName( GLuint name ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode != GL_SELECT) { - return; - } - if (ctx->Select.NameStackDepth == 0) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glLoadName" ); - return; - } - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); - - if (ctx->Select.HitFlag) { - write_hit_record( ctx ); - } - if (ctx->Select.NameStackDepth < MAX_NAME_STACK_DEPTH) { - ctx->Select.NameStack[ctx->Select.NameStackDepth-1] = name; - } - else { - ctx->Select.NameStack[MAX_NAME_STACK_DEPTH-1] = name; - } -} - - -/** - * Push a name into the name stack. - * - * \param name name. - * - * Verifies we are in selection mode and that the name stack is not full. - * Flushes vertices. If there is a hit flag writes it (via write_hit_record()), - * and adds the name to the top of the name stack. - * - * sa __GLcontextRec::Select. - */ -void GLAPIENTRY -_mesa_PushName( GLuint name ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode != GL_SELECT) { - return; - } - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); - if (ctx->Select.HitFlag) { - write_hit_record( ctx ); - } - if (ctx->Select.NameStackDepth >= MAX_NAME_STACK_DEPTH) { - _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushName" ); - } - else - ctx->Select.NameStack[ctx->Select.NameStackDepth++] = name; -} - - -/** - * Pop a name into the name stack. - * - * Verifies we are in selection mode and that the name stack is not empty. - * Flushes vertices. If there is a hit flag writes it (via write_hit_record()), - * and removes top-most name in the name stack. - * - * sa __GLcontextRec::Select. - */ -void GLAPIENTRY -_mesa_PopName( void ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->RenderMode != GL_SELECT) { - return; - } - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); - if (ctx->Select.HitFlag) { - write_hit_record( ctx ); - } - if (ctx->Select.NameStackDepth == 0) { - _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopName" ); - } - else - ctx->Select.NameStackDepth--; -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Render Mode */ -/*@{*/ - -/** - * Set rasterization mode. - * - * \param mode rasterization mode. - * - * \note this function can't be put in a display list. - * - * \sa glRenderMode(). - * - * Flushes the vertices and do the necessary cleanup according to the previous - * rasterization mode, such as writing the hit record or resent the select - * buffer index when exiting the select mode. Updates - * __GLcontextRec::RenderMode and notifies the driver via the - * dd_function_table::RenderMode callback. - */ -GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint result; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glRenderMode %s\n", _mesa_lookup_enum_by_nr(mode)); - - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); - - switch (ctx->RenderMode) { - case GL_RENDER: - result = 0; - break; - case GL_SELECT: - if (ctx->Select.HitFlag) { - write_hit_record( ctx ); - } - if (ctx->Select.BufferCount > ctx->Select.BufferSize) { - /* overflow */ -#ifdef DEBUG - _mesa_warning(ctx, "Feedback buffer overflow"); -#endif - result = -1; - } - else { - result = ctx->Select.Hits; - } - ctx->Select.BufferCount = 0; - ctx->Select.Hits = 0; - ctx->Select.NameStackDepth = 0; - break; -#if _HAVE_FULL_GL - case GL_FEEDBACK: - if (ctx->Feedback.Count > ctx->Feedback.BufferSize) { - /* overflow */ - result = -1; - } - else { - result = ctx->Feedback.Count; - } - ctx->Feedback.Count = 0; - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" ); - return 0; - } - - switch (mode) { - case GL_RENDER: - break; - case GL_SELECT: - if (ctx->Select.BufferSize==0) { - /* haven't called glSelectBuffer yet */ - _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" ); - } - break; -#if _HAVE_FULL_GL - case GL_FEEDBACK: - if (ctx->Feedback.BufferSize==0) { - /* haven't called glFeedbackBuffer yet */ - _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" ); - } - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" ); - return 0; - } - - ctx->RenderMode = mode; - if (ctx->Driver.RenderMode) - ctx->Driver.RenderMode( ctx, mode ); - - return result; -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Initialization */ -/*@{*/ - -/** - * Initialize context feedback data. - */ -void _mesa_init_feedback( GLcontext * ctx ) -{ - /* 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; - - /* Miscellaneous */ - ctx->RenderMode = GL_RENDER; -} - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/feedback.h b/src/libs/mesa/mesa/main/feedback.h deleted file mode 100644 index 6c448ad631..0000000000 --- a/src/libs/mesa/mesa/main/feedback.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \file feedback.h - * Selection and feedback modes functions. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 FEEDBACK_H -#define FEEDBACK_H - - -#include "mtypes.h" - - -#define FEEDBACK_TOKEN( CTX, T ) \ - if (CTX->Feedback.Count < CTX->Feedback.BufferSize) { \ - CTX->Feedback.Buffer[CTX->Feedback.Count] = (GLfloat) (T); \ - } \ - CTX->Feedback.Count++; - - -extern void _mesa_init_feedback( GLcontext * ctx ); - -extern void _mesa_feedback_vertex( GLcontext *ctx, - const GLfloat win[4], - const GLfloat color[4], - GLfloat index, - const GLfloat texcoord[4] ); - - -extern void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ); - - -extern void GLAPIENTRY -_mesa_PassThrough( GLfloat token ); - -extern void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -extern void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); - -extern void GLAPIENTRY -_mesa_InitNames( void ); - -extern void GLAPIENTRY -_mesa_LoadName( GLuint name ); - -extern void GLAPIENTRY -_mesa_PushName( GLuint name ); - -extern void GLAPIENTRY -_mesa_PopName( void ); - -extern GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ); - - -#endif diff --git a/src/libs/mesa/mesa/main/ffvertex_prog.c b/src/libs/mesa/mesa/main/ffvertex_prog.c deleted file mode 100644 index 4321b4c2eb..0000000000 --- a/src/libs/mesa/mesa/main/ffvertex_prog.c +++ /dev/null @@ -1,1784 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * \file ffvertex_prog.c - * - * Create a vertex program to execute the current fixed function T&L pipeline. - * \author Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/enums.h" -#include "main/ffvertex_prog.h" -#include "shader/program.h" -#include "shader/prog_cache.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" - - -struct state_key { - unsigned light_global_enabled:1; - unsigned light_local_viewer:1; - unsigned light_twoside:1; - unsigned light_color_material:1; - unsigned light_color_material_mask:12; - unsigned light_material_mask:12; - unsigned material_shininess_is_zero:1; - - unsigned need_eye_coords:1; - unsigned normalize:1; - unsigned rescale_normals:1; - unsigned fog_source_is_depth:1; - unsigned tnl_do_vertex_fog:1; - unsigned separate_specular:1; - unsigned fog_mode:2; - unsigned point_attenuated:1; - unsigned point_array:1; - unsigned texture_enabled_global:1; - unsigned fragprog_inputs_read:12; - - struct { - unsigned light_enabled:1; - unsigned light_eyepos3_is_zero:1; - unsigned light_spotcutoff_is_180:1; - unsigned light_attenuated:1; - unsigned texunit_really_enabled:1; - unsigned texmat_enabled:1; - unsigned texgen_enabled:4; - unsigned texgen_mode0:4; - unsigned texgen_mode1:4; - unsigned texgen_mode2:4; - unsigned texgen_mode3:4; - } unit[8]; -}; - - - -#define FOG_NONE 0 -#define FOG_LINEAR 1 -#define FOG_EXP 2 -#define FOG_EXP2 3 - -static GLuint translate_fog_mode( GLenum mode ) -{ - switch (mode) { - case GL_LINEAR: return FOG_LINEAR; - case GL_EXP: return FOG_EXP; - case GL_EXP2: return FOG_EXP2; - default: return FOG_NONE; - } -} - - -#define TXG_NONE 0 -#define TXG_OBJ_LINEAR 1 -#define TXG_EYE_LINEAR 2 -#define TXG_SPHERE_MAP 3 -#define TXG_REFLECTION_MAP 4 -#define TXG_NORMAL_MAP 5 - -static GLuint translate_texgen( GLboolean enabled, GLenum mode ) -{ - if (!enabled) - return TXG_NONE; - - switch (mode) { - case GL_OBJECT_LINEAR: return TXG_OBJ_LINEAR; - case GL_EYE_LINEAR: return TXG_EYE_LINEAR; - case GL_SPHERE_MAP: return TXG_SPHERE_MAP; - case GL_REFLECTION_MAP_NV: return TXG_REFLECTION_MAP; - case GL_NORMAL_MAP_NV: return TXG_NORMAL_MAP; - default: return TXG_NONE; - } -} - - -/** - * Returns bitmask of flags indicating which materials are set per-vertex - * in the current VB. - * XXX get these from the VBO... - */ -static GLbitfield -tnl_get_per_vertex_materials(GLcontext *ctx) -{ - GLbitfield mask = 0x0; -#if 0 - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) - if (VB->AttribPtr[i] && VB->AttribPtr[i]->stride) - mask |= 1 << (i - _TNL_FIRST_MAT); -#endif - return mask; -} - - -/** - * Should fog be computed per-vertex? - */ -static GLboolean -tnl_get_per_vertex_fog(GLcontext *ctx) -{ -#if 0 - TNLcontext *tnl = TNL_CONTEXT(ctx); - return tnl->_DoVertexFog; -#else - return GL_FALSE; -#endif -} - - -static GLboolean check_active_shininess( GLcontext *ctx, - const struct state_key *key, - GLuint side ) -{ - GLuint bit = 1 << (MAT_ATTRIB_FRONT_SHININESS + side); - - if (key->light_color_material_mask & bit) - return GL_TRUE; - - if (key->light_material_mask & bit) - return GL_TRUE; - - if (ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS + side][0] != 0.0F) - return GL_TRUE; - - return GL_FALSE; -} - - -static void make_state_key( GLcontext *ctx, struct state_key *key ) -{ - const struct gl_fragment_program *fp; - GLuint i; - - memset(key, 0, sizeof(struct state_key)); - fp = ctx->FragmentProgram._Current; - - /* This now relies on texenvprogram.c being active: - */ - assert(fp); - - key->need_eye_coords = ctx->_NeedEyeCoords; - - key->fragprog_inputs_read = fp->Base.InputsRead; - - if (ctx->RenderMode == GL_FEEDBACK) { - /* make sure the vertprog emits color and tex0 */ - key->fragprog_inputs_read |= (FRAG_BIT_COL0 | FRAG_BIT_TEX0); - } - - key->separate_specular = (ctx->Light.Model.ColorControl == - GL_SEPARATE_SPECULAR_COLOR); - - if (ctx->Light.Enabled) { - key->light_global_enabled = 1; - - if (ctx->Light.Model.LocalViewer) - key->light_local_viewer = 1; - - if (ctx->Light.Model.TwoSide) - key->light_twoside = 1; - - if (ctx->Light.ColorMaterialEnabled) { - key->light_color_material = 1; - key->light_color_material_mask = ctx->Light.ColorMaterialBitmask; - } - - key->light_material_mask = tnl_get_per_vertex_materials(ctx); - - for (i = 0; i < MAX_LIGHTS; i++) { - struct gl_light *light = &ctx->Light.Light[i]; - - if (light->Enabled) { - key->unit[i].light_enabled = 1; - - if (light->EyePosition[3] == 0.0) - key->unit[i].light_eyepos3_is_zero = 1; - - if (light->SpotCutoff == 180.0) - key->unit[i].light_spotcutoff_is_180 = 1; - - if (light->ConstantAttenuation != 1.0 || - light->LinearAttenuation != 0.0 || - light->QuadraticAttenuation != 0.0) - key->unit[i].light_attenuated = 1; - } - } - - if (check_active_shininess(ctx, key, 0)) { - key->material_shininess_is_zero = 0; - } - else if (key->light_twoside && - check_active_shininess(ctx, key, 1)) { - key->material_shininess_is_zero = 0; - } - else { - key->material_shininess_is_zero = 1; - } - } - - if (ctx->Transform.Normalize) - key->normalize = 1; - - if (ctx->Transform.RescaleNormals) - key->rescale_normals = 1; - - key->fog_mode = translate_fog_mode(fp->FogOption); - - if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) - key->fog_source_is_depth = 1; - - key->tnl_do_vertex_fog = tnl_get_per_vertex_fog(ctx); - - if (ctx->Point._Attenuated) - key->point_attenuated = 1; - -#if FEATURE_point_size_array - if (ctx->Array.ArrayObj->PointSize.Enabled) - key->point_array = 1; -#endif - - if (ctx->Texture._TexGenEnabled || - ctx->Texture._TexMatEnabled || - ctx->Texture._EnabledUnits) - key->texture_enabled_global = 1; - - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - - if (texUnit->_ReallyEnabled) - key->unit[i].texunit_really_enabled = 1; - - if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) - key->unit[i].texmat_enabled = 1; - - if (texUnit->TexGenEnabled) { - key->unit[i].texgen_enabled = 1; - - key->unit[i].texgen_mode0 = - translate_texgen( texUnit->TexGenEnabled & (1<<0), - texUnit->GenModeS ); - key->unit[i].texgen_mode1 = - translate_texgen( texUnit->TexGenEnabled & (1<<1), - texUnit->GenModeT ); - key->unit[i].texgen_mode2 = - translate_texgen( texUnit->TexGenEnabled & (1<<2), - texUnit->GenModeR ); - key->unit[i].texgen_mode3 = - translate_texgen( texUnit->TexGenEnabled & (1<<3), - texUnit->GenModeQ ); - } - } -} - - - -/* Very useful debugging tool - produces annotated listing of - * generated program with line/function references for each - * instruction back into this file: - */ -#define DISASSEM 0 - -/* Should be tunable by the driver - do we want to do matrix - * multiplications with DP4's or with MUL/MAD's? SSE works better - * with the latter, drivers may differ. - */ -#define PREFER_DP4 0 - - -/* Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. - * - * NOTE: These are passed by value extensively in this file rather - * than as usual by pointer reference. If this disturbs you, try - * remembering they are just 32bits in size. - * - * GCC is smart enough to deal with these dword-sized structures in - * much the same way as if I had defined them as dwords and was using - * macros to access and set the fields. This is much nicer and easier - * to evolve. - */ -struct ureg { - GLuint file:4; - GLint idx:9; /* relative addressing may be negative */ - /* sizeof(idx) should == sizeof(prog_src_reg::Index) */ - GLuint negate:1; - GLuint swz:12; - GLuint pad:6; -}; - - -struct tnl_program { - const struct state_key *state; - struct gl_vertex_program *program; - GLint max_inst; /** number of instructions allocated for program */ - - GLuint temp_in_use; - GLuint temp_reserved; - - struct ureg eye_position; - struct ureg eye_position_z; - struct ureg eye_position_normalized; - struct ureg transformed_normal; - struct ureg identity; - - GLuint materials; - GLuint color_materials; -}; - - -static const struct ureg undef = { - PROGRAM_UNDEFINED, - 0, - 0, - 0, - 0 -}; - -/* Local shorthand: - */ -#define X SWIZZLE_X -#define Y SWIZZLE_Y -#define Z SWIZZLE_Z -#define W SWIZZLE_W - - -/* Construct a ureg: - */ -static struct ureg make_ureg(GLuint file, GLint idx) -{ - struct ureg reg; - reg.file = file; - reg.idx = idx; - reg.negate = 0; - reg.swz = SWIZZLE_NOOP; - reg.pad = 0; - return reg; -} - - - -static struct ureg negate( struct ureg reg ) -{ - reg.negate ^= 1; - return reg; -} - - -static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) -{ - reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x), - GET_SWZ(reg.swz, y), - GET_SWZ(reg.swz, z), - GET_SWZ(reg.swz, w)); - - return reg; -} - - -static struct ureg swizzle1( struct ureg reg, int x ) -{ - return swizzle(reg, x, x, x, x); -} - - -static struct ureg get_temp( struct tnl_program *p ) -{ - int bit = _mesa_ffs( ~p->temp_in_use ); - if (!bit) { - _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); - _mesa_exit(1); - } - - if ((GLuint) bit > p->program->Base.NumTemporaries) - p->program->Base.NumTemporaries = bit; - - p->temp_in_use |= 1<<(bit-1); - return make_ureg(PROGRAM_TEMPORARY, bit-1); -} - - -static struct ureg reserve_temp( struct tnl_program *p ) -{ - struct ureg temp = get_temp( p ); - p->temp_reserved |= 1<temp_in_use &= ~(1<temp_in_use |= p->temp_reserved; /* can't release reserved temps */ - } -} - - -static void release_temps( struct tnl_program *p ) -{ - p->temp_in_use = p->temp_reserved; -} - - -/** - * \param input one of VERT_ATTRIB_x tokens. - */ -static struct ureg register_input( struct tnl_program *p, GLuint input ) -{ - p->program->Base.InputsRead |= (1<program->Base.OutputsWritten |= (1<program->Base.Parameters, values, 4, - &swizzle ); - ASSERT(swizzle == SWIZZLE_NOOP); - return make_ureg(PROGRAM_CONSTANT, idx); -} - - -#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1) -#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0) -#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1) -#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1) - -static GLboolean is_undef( struct ureg reg ) -{ - return reg.file == PROGRAM_UNDEFINED; -} - - -static struct ureg get_identity_param( struct tnl_program *p ) -{ - if (is_undef(p->identity)) - p->identity = register_const4f(p, 0,0,0,1); - - return p->identity; -} - - -static struct ureg register_param5(struct tnl_program *p, - GLint s0, - GLint s1, - GLint s2, - GLint s3, - GLint s4) -{ - gl_state_index tokens[STATE_LENGTH]; - GLint idx; - tokens[0] = s0; - tokens[1] = s1; - tokens[2] = s2; - tokens[3] = s3; - tokens[4] = s4; - idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens ); - return make_ureg(PROGRAM_STATE_VAR, idx); -} - - -#define register_param1(p,s0) register_param5(p,s0,0,0,0,0) -#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0) -#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0) -#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0) - - -static void register_matrix_param5( struct tnl_program *p, - GLint s0, /* modelview, projection, etc */ - GLint s1, /* texture matrix number */ - GLint s2, /* first row */ - GLint s3, /* last row */ - GLint s4, /* inverse, transpose, etc */ - struct ureg *matrix ) -{ - GLint i; - - /* This is a bit sad as the support is there to pull the whole - * matrix out in one go: - */ - for (i = 0; i <= s3 - s2; i++) - matrix[i] = register_param5( p, s0, s1, i, i, s4 ); -} - - -static void emit_arg( struct prog_src_register *src, - struct ureg reg ) -{ - src->File = reg.file; - src->Index = reg.idx; - src->Swizzle = reg.swz; - src->NegateBase = reg.negate ? NEGATE_XYZW : 0; - src->Abs = 0; - src->NegateAbs = 0; - src->RelAddr = 0; - /* Check that bitfield sizes aren't exceeded */ - ASSERT(src->Index == reg.idx); -} - - -static void emit_dst( struct prog_dst_register *dst, - struct ureg reg, GLuint mask ) -{ - dst->File = reg.file; - dst->Index = reg.idx; - /* allow zero as a shorthand for xyzw */ - dst->WriteMask = mask ? mask : WRITEMASK_XYZW; - dst->CondMask = COND_TR; /* always pass cond test */ - dst->CondSwizzle = SWIZZLE_NOOP; - dst->CondSrc = 0; - dst->pad = 0; - /* Check that bitfield sizes aren't exceeded */ - ASSERT(dst->Index == reg.idx); -} - - -static void debug_insn( struct prog_instruction *inst, const char *fn, - GLuint line ) -{ - if (DISASSEM) { - static const char *last_fn; - - if (fn != last_fn) { - last_fn = fn; - _mesa_printf("%s:\n", fn); - } - - _mesa_printf("%d:\t", line); - _mesa_print_instruction(inst); - } -} - - -static void emit_op3fn(struct tnl_program *p, - enum prog_opcode op, - struct ureg dest, - GLuint mask, - struct ureg src0, - struct ureg src1, - struct ureg src2, - const char *fn, - GLuint line) -{ - GLuint nr; - struct prog_instruction *inst; - - assert((GLint) p->program->Base.NumInstructions <= p->max_inst); - - if (p->program->Base.NumInstructions == p->max_inst) { - /* need to extend the program's instruction array */ - struct prog_instruction *newInst; - - /* double the size */ - p->max_inst *= 2; - - newInst = _mesa_alloc_instructions(p->max_inst); - if (!newInst) { - _mesa_error(NULL, GL_OUT_OF_MEMORY, "vertex program build"); - return; - } - - _mesa_copy_instructions(newInst, - p->program->Base.Instructions, - p->program->Base.NumInstructions); - - _mesa_free_instructions(p->program->Base.Instructions, - p->program->Base.NumInstructions); - - p->program->Base.Instructions = newInst; - } - - nr = p->program->Base.NumInstructions++; - - inst = &p->program->Base.Instructions[nr]; - inst->Opcode = (enum prog_opcode) op; - inst->StringPos = 0; - inst->Data = 0; - - emit_arg( &inst->SrcReg[0], src0 ); - emit_arg( &inst->SrcReg[1], src1 ); - emit_arg( &inst->SrcReg[2], src2 ); - - emit_dst( &inst->DstReg, dest, mask ); - - debug_insn(inst, fn, line); -} - - -#define emit_op3(p, op, dst, mask, src0, src1, src2) \ - emit_op3fn(p, op, dst, mask, src0, src1, src2, __FUNCTION__, __LINE__) - -#define emit_op2(p, op, dst, mask, src0, src1) \ - emit_op3fn(p, op, dst, mask, src0, src1, undef, __FUNCTION__, __LINE__) - -#define emit_op1(p, op, dst, mask, src0) \ - emit_op3fn(p, op, dst, mask, src0, undef, undef, __FUNCTION__, __LINE__) - - -static struct ureg make_temp( struct tnl_program *p, struct ureg reg ) -{ - if (reg.file == PROGRAM_TEMPORARY && - !(p->temp_reserved & (1<eye_position)) { - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); - struct ureg modelview[4]; - - p->eye_position = reserve_temp(p); - - if (PREFER_DP4) { - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, - 0, modelview ); - - emit_matrix_transform_vec4(p, p->eye_position, modelview, pos); - } - else { - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, - STATE_MATRIX_TRANSPOSE, modelview ); - - emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos); - } - } - - return p->eye_position; -} - - -static struct ureg get_eye_position_z( struct tnl_program *p ) -{ - if (!is_undef(p->eye_position)) - return swizzle1(p->eye_position, Z); - - if (is_undef(p->eye_position_z)) { - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); - struct ureg modelview[4]; - - p->eye_position_z = reserve_temp(p); - - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, - 0, modelview ); - - emit_op2(p, OPCODE_DP4, p->eye_position_z, 0, pos, modelview[2]); - } - - return p->eye_position_z; -} - - -static struct ureg get_eye_position_normalized( struct tnl_program *p ) -{ - if (is_undef(p->eye_position_normalized)) { - struct ureg eye = get_eye_position(p); - p->eye_position_normalized = reserve_temp(p); - emit_normalize_vec3(p, p->eye_position_normalized, eye); - } - - return p->eye_position_normalized; -} - - -static struct ureg get_transformed_normal( struct tnl_program *p ) -{ - if (is_undef(p->transformed_normal) && - !p->state->need_eye_coords && - !p->state->normalize && - !(p->state->need_eye_coords == p->state->rescale_normals)) - { - p->transformed_normal = register_input(p, VERT_ATTRIB_NORMAL ); - } - else if (is_undef(p->transformed_normal)) - { - struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL ); - struct ureg mvinv[3]; - struct ureg transformed_normal = reserve_temp(p); - - if (p->state->need_eye_coords) { - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 2, - STATE_MATRIX_INVTRANS, mvinv ); - - /* Transform to eye space: - */ - emit_matrix_transform_vec3( p, transformed_normal, mvinv, normal ); - normal = transformed_normal; - } - - /* Normalize/Rescale: - */ - if (p->state->normalize) { - emit_normalize_vec3( p, transformed_normal, normal ); - normal = transformed_normal; - } - else if (p->state->need_eye_coords == p->state->rescale_normals) { - /* This is already adjusted for eye/non-eye rendering: - */ - struct ureg rescale = register_param2(p, STATE_INTERNAL, - STATE_NORMAL_SCALE); - - emit_op2( p, OPCODE_MUL, transformed_normal, 0, normal, rescale ); - normal = transformed_normal; - } - - assert(normal.file == PROGRAM_TEMPORARY); - p->transformed_normal = normal; - } - - return p->transformed_normal; -} - - -static void build_hpos( struct tnl_program *p ) -{ - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); - struct ureg hpos = register_output( p, VERT_RESULT_HPOS ); - struct ureg mvp[4]; - - if (PREFER_DP4) { - register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, - 0, mvp ); - emit_matrix_transform_vec4( p, hpos, mvp, pos ); - } - else { - register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, - STATE_MATRIX_TRANSPOSE, mvp ); - emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos ); - } -} - - -static GLuint material_attrib( GLuint side, GLuint property ) -{ - return ((property - STATE_AMBIENT) * 2 + - side); -} - - -/** - * Get a bitmask of which material values vary on a per-vertex basis. - */ -static void set_material_flags( struct tnl_program *p ) -{ - p->color_materials = 0; - p->materials = 0; - - if (p->state->light_color_material) { - p->materials = - p->color_materials = p->state->light_color_material_mask; - } - - p->materials |= p->state->light_material_mask; -} - - -/* XXX temporary!!! */ -#define _TNL_ATTRIB_MAT_FRONT_AMBIENT 32 - -static struct ureg get_material( struct tnl_program *p, GLuint side, - GLuint property ) -{ - GLuint attrib = material_attrib(side, property); - - if (p->color_materials & (1<materials & (1<materials & SCENE_COLOR_BITS(side)) { - struct ureg lm_ambient = register_param1(p, STATE_LIGHTMODEL_AMBIENT); - struct ureg material_emission = get_material(p, side, STATE_EMISSION); - struct ureg material_ambient = get_material(p, side, STATE_AMBIENT); - struct ureg material_diffuse = get_material(p, side, STATE_DIFFUSE); - struct ureg tmp = make_temp(p, material_diffuse); - emit_op3(p, OPCODE_MAD, tmp, WRITEMASK_XYZ, lm_ambient, - material_ambient, material_emission); - return tmp; - } - else - return register_param2( p, STATE_LIGHTMODEL_SCENECOLOR, side ); -} - - -static struct ureg get_lightprod( struct tnl_program *p, GLuint light, - GLuint side, GLuint property ) -{ - GLuint attrib = material_attrib(side, property); - if (p->materials & (1<state->unit[i].light_spotcutoff_is_180) { - struct ureg spot_dir_norm = register_param3(p, STATE_INTERNAL, - STATE_LIGHT_SPOT_DIR_NORMALIZED, i); - struct ureg spot = get_temp(p); - struct ureg slt = get_temp(p); - - emit_op2(p, OPCODE_DP3, spot, 0, negate(VPpli), spot_dir_norm); - emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir_norm,W), spot); - emit_op2(p, OPCODE_POW, spot, 0, spot, swizzle1(attenuation, W)); - emit_op2(p, OPCODE_MUL, att, 0, slt, spot); - - release_temp(p, spot); - release_temp(p, slt); - } - - /* Calculate distance attenuation: - */ - if (p->state->unit[i].light_attenuated) { - - /* 1/d,d,d,1/d */ - emit_op1(p, OPCODE_RCP, dist, WRITEMASK_YZ, dist); - /* 1,d,d*d,1/d */ - emit_op2(p, OPCODE_MUL, dist, WRITEMASK_XZ, dist, swizzle1(dist,Y)); - /* 1/dist-atten */ - emit_op2(p, OPCODE_DP3, dist, 0, attenuation, dist); - - if (!p->state->unit[i].light_spotcutoff_is_180) { - /* dist-atten */ - emit_op1(p, OPCODE_RCP, dist, 0, dist); - /* spot-atten * dist-atten */ - emit_op2(p, OPCODE_MUL, att, 0, dist, att); - } else { - /* dist-atten */ - emit_op1(p, OPCODE_RCP, att, 0, dist); - } - } - - return att; -} - - -/** - * Compute: - * lit.y = MAX(0, dots.x) - * lit.z = SLT(0, dots.x) - */ -static void emit_degenerate_lit( struct tnl_program *p, - struct ureg lit, - struct ureg dots ) -{ - struct ureg id = get_identity_param(p); /* id = {0,0,0,1} */ - - /* Note that lit.x & lit.w will not be examined. Note also that - * dots.xyzw == dots.xxxx. - */ - - /* MAX lit, id, dots; - */ - emit_op2(p, OPCODE_MAX, lit, WRITEMASK_XYZW, id, dots); - - /* result[2] = (in > 0 ? 1 : 0) - * SLT lit.z, id.z, dots; # lit.z = (0 < dots.z) ? 1 : 0 - */ - emit_op2(p, OPCODE_SLT, lit, WRITEMASK_Z, swizzle1(id,Z), dots); -} - - -/* Need to add some addtional parameters to allow lighting in object - * space - STATE_SPOT_DIRECTION and STATE_HALF_VECTOR implicitly assume eye - * space lighting. - */ -static void build_lighting( struct tnl_program *p ) -{ - const GLboolean twoside = p->state->light_twoside; - const GLboolean separate = p->state->separate_specular; - GLuint nr_lights = 0, count = 0; - struct ureg normal = get_transformed_normal(p); - struct ureg lit = get_temp(p); - struct ureg dots = get_temp(p); - struct ureg _col0 = undef, _col1 = undef; - struct ureg _bfc0 = undef, _bfc1 = undef; - GLuint i; - - /* - * NOTE: - * dot.x = dot(normal, VPpli) - * dot.y = dot(normal, halfAngle) - * dot.z = back.shininess - * dot.w = front.shininess - */ - - for (i = 0; i < MAX_LIGHTS; i++) - if (p->state->unit[i].light_enabled) - nr_lights++; - - set_material_flags(p); - - { - if (!p->state->material_shininess_is_zero) { - struct ureg shininess = get_material(p, 0, STATE_SHININESS); - emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X)); - release_temp(p, shininess); - } - - _col0 = make_temp(p, get_scenecolor(p, 0)); - if (separate) - _col1 = make_temp(p, get_identity_param(p)); - else - _col1 = _col0; - - } - - if (twoside) { - if (!p->state->material_shininess_is_zero) { - /* Note that we negate the back-face specular exponent here. - * The negation will be un-done later in the back-face code below. - */ - struct ureg shininess = get_material(p, 1, STATE_SHININESS); - emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z, - negate(swizzle1(shininess,X))); - release_temp(p, shininess); - } - - _bfc0 = make_temp(p, get_scenecolor(p, 1)); - if (separate) - _bfc1 = make_temp(p, get_identity_param(p)); - else - _bfc1 = _bfc0; - } - - /* If no lights, still need to emit the scenecolor. - */ - { - struct ureg res0 = register_output( p, VERT_RESULT_COL0 ); - emit_op1(p, OPCODE_MOV, res0, 0, _col0); - } - - if (separate) { - struct ureg res1 = register_output( p, VERT_RESULT_COL1 ); - emit_op1(p, OPCODE_MOV, res1, 0, _col1); - } - - if (twoside) { - struct ureg res0 = register_output( p, VERT_RESULT_BFC0 ); - emit_op1(p, OPCODE_MOV, res0, 0, _bfc0); - } - - if (twoside && separate) { - struct ureg res1 = register_output( p, VERT_RESULT_BFC1 ); - emit_op1(p, OPCODE_MOV, res1, 0, _bfc1); - } - - if (nr_lights == 0) { - release_temps(p); - return; - } - - for (i = 0; i < MAX_LIGHTS; i++) { - if (p->state->unit[i].light_enabled) { - struct ureg half = undef; - struct ureg att = undef, VPpli = undef; - - count++; - - if (p->state->unit[i].light_eyepos3_is_zero) { - /* Can used precomputed constants in this case. - * Attenuation never applies to infinite lights. - */ - VPpli = register_param3(p, STATE_INTERNAL, - STATE_LIGHT_POSITION_NORMALIZED, i); - - if (!p->state->material_shininess_is_zero) { - if (p->state->light_local_viewer) { - struct ureg eye_hat = get_eye_position_normalized(p); - half = get_temp(p); - emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); - emit_normalize_vec3(p, half, half); - } else { - half = register_param3(p, STATE_INTERNAL, - STATE_LIGHT_HALF_VECTOR, i); - } - } - } - else { - struct ureg Ppli = register_param3(p, STATE_INTERNAL, - STATE_LIGHT_POSITION, i); - struct ureg V = get_eye_position(p); - struct ureg dist = get_temp(p); - - VPpli = get_temp(p); - - /* Calculate VPpli vector - */ - emit_op2(p, OPCODE_SUB, VPpli, 0, Ppli, V); - - /* Normalize VPpli. The dist value also used in - * attenuation below. - */ - emit_op2(p, OPCODE_DP3, dist, 0, VPpli, VPpli); - emit_op1(p, OPCODE_RSQ, dist, 0, dist); - emit_op2(p, OPCODE_MUL, VPpli, 0, VPpli, dist); - - /* Calculate attenuation: - */ - if (!p->state->unit[i].light_spotcutoff_is_180 || - p->state->unit[i].light_attenuated) { - att = calculate_light_attenuation(p, i, VPpli, dist); - } - - /* Calculate viewer direction, or use infinite viewer: - */ - if (!p->state->material_shininess_is_zero) { - half = get_temp(p); - - if (p->state->light_local_viewer) { - struct ureg eye_hat = get_eye_position_normalized(p); - emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); - } - else { - struct ureg z_dir = swizzle(get_identity_param(p),X,Y,W,Z); - emit_op2(p, OPCODE_ADD, half, 0, VPpli, z_dir); - } - - emit_normalize_vec3(p, half, half); - } - - release_temp(p, dist); - } - - /* Calculate dot products: - */ - if (p->state->material_shininess_is_zero) { - emit_op2(p, OPCODE_DP3, dots, 0, normal, VPpli); - } - else { - emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli); - emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half); - } - - /* Front face lighting: - */ - { - struct ureg ambient = get_lightprod(p, i, 0, STATE_AMBIENT); - struct ureg diffuse = get_lightprod(p, i, 0, STATE_DIFFUSE); - struct ureg specular = get_lightprod(p, i, 0, STATE_SPECULAR); - struct ureg res0, res1; - GLuint mask0, mask1; - - if (count == nr_lights) { - if (separate) { - mask0 = WRITEMASK_XYZ; - mask1 = WRITEMASK_XYZ; - res0 = register_output( p, VERT_RESULT_COL0 ); - res1 = register_output( p, VERT_RESULT_COL1 ); - } - else { - mask0 = 0; - mask1 = WRITEMASK_XYZ; - res0 = _col0; - res1 = register_output( p, VERT_RESULT_COL0 ); - } - } else { - mask0 = 0; - mask1 = 0; - res0 = _col0; - res1 = _col1; - } - - if (!is_undef(att)) { - /* light is attenuated by distance */ - emit_op1(p, OPCODE_LIT, lit, 0, dots); - emit_op2(p, OPCODE_MUL, lit, 0, lit, att); - emit_op3(p, OPCODE_MAD, _col0, 0, swizzle1(lit,X), ambient, _col0); - } - else if (!p->state->material_shininess_is_zero) { - /* there's a non-zero specular term */ - emit_op1(p, OPCODE_LIT, lit, 0, dots); - emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); - } - else { - /* no attenutation, no specular */ - emit_degenerate_lit(p, lit, dots); - emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); - } - - emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _col0); - emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _col1); - - release_temp(p, ambient); - release_temp(p, diffuse); - release_temp(p, specular); - } - - /* Back face lighting: - */ - if (twoside) { - struct ureg ambient = get_lightprod(p, i, 1, STATE_AMBIENT); - struct ureg diffuse = get_lightprod(p, i, 1, STATE_DIFFUSE); - struct ureg specular = get_lightprod(p, i, 1, STATE_SPECULAR); - struct ureg res0, res1; - GLuint mask0, mask1; - - if (count == nr_lights) { - if (separate) { - mask0 = WRITEMASK_XYZ; - mask1 = WRITEMASK_XYZ; - res0 = register_output( p, VERT_RESULT_BFC0 ); - res1 = register_output( p, VERT_RESULT_BFC1 ); - } - else { - mask0 = 0; - mask1 = WRITEMASK_XYZ; - res0 = _bfc0; - res1 = register_output( p, VERT_RESULT_BFC0 ); - } - } else { - res0 = _bfc0; - res1 = _bfc1; - mask0 = 0; - mask1 = 0; - } - - /* For the back face we need to negate the X and Y component - * dot products. dots.Z has the negated back-face specular - * exponent. We swizzle that into the W position. This - * negation makes the back-face specular term positive again. - */ - dots = negate(swizzle(dots,X,Y,W,Z)); - - if (!is_undef(att)) { - emit_op1(p, OPCODE_LIT, lit, 0, dots); - emit_op2(p, OPCODE_MUL, lit, 0, lit, att); - emit_op3(p, OPCODE_MAD, _bfc0, 0, swizzle1(lit,X), ambient, _bfc0); - } - else if (!p->state->material_shininess_is_zero) { - emit_op1(p, OPCODE_LIT, lit, 0, dots); - emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); - } - else { - emit_degenerate_lit(p, lit, dots); - emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); - } - - emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); - emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); - /* restore dots to its original state for subsequent lights - * by negating and swizzling again. - */ - dots = negate(swizzle(dots,X,Y,W,Z)); - - release_temp(p, ambient); - release_temp(p, diffuse); - release_temp(p, specular); - } - - release_temp(p, half); - release_temp(p, VPpli); - release_temp(p, att); - } - } - - release_temps( p ); -} - - -static void build_fog( struct tnl_program *p ) -{ - struct ureg fog = register_output(p, VERT_RESULT_FOGC); - struct ureg input; - - if (p->state->fog_source_is_depth) { - input = get_eye_position_z(p); - } - else { - input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X); - } - - if (p->state->fog_mode && p->state->tnl_do_vertex_fog) { - struct ureg params = register_param2(p, STATE_INTERNAL, - STATE_FOG_PARAMS_OPTIMIZED); - struct ureg tmp = get_temp(p); - GLboolean useabs = (p->state->fog_mode != FOG_EXP2); - - if (useabs) { - emit_op1(p, OPCODE_ABS, tmp, 0, input); - } - - switch (p->state->fog_mode) { - case FOG_LINEAR: { - struct ureg id = get_identity_param(p); - emit_op3(p, OPCODE_MAD, tmp, 0, useabs ? tmp : input, - swizzle1(params,X), swizzle1(params,Y)); - emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ - emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); - break; - } - case FOG_EXP: - emit_op2(p, OPCODE_MUL, tmp, 0, useabs ? tmp : input, - swizzle1(params,Z)); - emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); - break; - case FOG_EXP2: - emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W)); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); - emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); - break; - } - - release_temp(p, tmp); - } - else { - /* results = incoming fog coords (compute fog per-fragment later) - * - * KW: Is it really necessary to do anything in this case? - * BP: Yes, we always need to compute the absolute value, unless - * we want to push that down into the fragment program... - */ - GLboolean useabs = GL_TRUE; - emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input); - } -} - - -static void build_reflect_texgen( struct tnl_program *p, - struct ureg dest, - GLuint writemask ) -{ - struct ureg normal = get_transformed_normal(p); - struct ureg eye_hat = get_eye_position_normalized(p); - struct ureg tmp = get_temp(p); - - /* n.u */ - emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); - /* 2n.u */ - emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); - /* (-2n.u)n + u */ - emit_op3(p, OPCODE_MAD, dest, writemask, negate(tmp), normal, eye_hat); - - release_temp(p, tmp); -} - - -static void build_sphere_texgen( struct tnl_program *p, - struct ureg dest, - GLuint writemask ) -{ - struct ureg normal = get_transformed_normal(p); - struct ureg eye_hat = get_eye_position_normalized(p); - struct ureg tmp = get_temp(p); - struct ureg half = register_scalar_const(p, .5); - struct ureg r = get_temp(p); - struct ureg inv_m = get_temp(p); - struct ureg id = get_identity_param(p); - - /* Could share the above calculations, but it would be - * a fairly odd state for someone to set (both sphere and - * reflection active for different texture coordinate - * components. Of course - if two texture units enable - * reflect and/or sphere, things start to tilt in favour - * of seperating this out: - */ - - /* n.u */ - emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); - /* 2n.u */ - emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); - /* (-2n.u)n + u */ - emit_op3(p, OPCODE_MAD, r, 0, negate(tmp), normal, eye_hat); - /* r + 0,0,1 */ - emit_op2(p, OPCODE_ADD, tmp, 0, r, swizzle(id,X,Y,W,Z)); - /* rx^2 + ry^2 + (rz+1)^2 */ - emit_op2(p, OPCODE_DP3, tmp, 0, tmp, tmp); - /* 2/m */ - emit_op1(p, OPCODE_RSQ, tmp, 0, tmp); - /* 1/m */ - emit_op2(p, OPCODE_MUL, inv_m, 0, tmp, half); - /* r/m + 1/2 */ - emit_op3(p, OPCODE_MAD, dest, writemask, r, inv_m, half); - - release_temp(p, tmp); - release_temp(p, r); - release_temp(p, inv_m); -} - - -static void build_texture_transform( struct tnl_program *p ) -{ - GLuint i, j; - - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - - if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i))) - continue; - - if (p->state->unit[i].texgen_enabled || - p->state->unit[i].texmat_enabled) { - - GLuint texmat_enabled = p->state->unit[i].texmat_enabled; - struct ureg out = register_output(p, VERT_RESULT_TEX0 + i); - struct ureg out_texgen = undef; - - if (p->state->unit[i].texgen_enabled) { - GLuint copy_mask = 0; - GLuint sphere_mask = 0; - GLuint reflect_mask = 0; - GLuint normal_mask = 0; - GLuint modes[4]; - - if (texmat_enabled) - out_texgen = get_temp(p); - else - out_texgen = out; - - modes[0] = p->state->unit[i].texgen_mode0; - modes[1] = p->state->unit[i].texgen_mode1; - modes[2] = p->state->unit[i].texgen_mode2; - modes[3] = p->state->unit[i].texgen_mode3; - - for (j = 0; j < 4; j++) { - switch (modes[j]) { - case TXG_OBJ_LINEAR: { - struct ureg obj = register_input(p, VERT_ATTRIB_POS); - struct ureg plane = - register_param3(p, STATE_TEXGEN, i, - STATE_TEXGEN_OBJECT_S + j); - - emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, - obj, plane ); - break; - } - case TXG_EYE_LINEAR: { - struct ureg eye = get_eye_position(p); - struct ureg plane = - register_param3(p, STATE_TEXGEN, i, - STATE_TEXGEN_EYE_S + j); - - emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, - eye, plane ); - break; - } - case TXG_SPHERE_MAP: - sphere_mask |= WRITEMASK_X << j; - break; - case TXG_REFLECTION_MAP: - reflect_mask |= WRITEMASK_X << j; - break; - case TXG_NORMAL_MAP: - normal_mask |= WRITEMASK_X << j; - break; - case TXG_NONE: - copy_mask |= WRITEMASK_X << j; - } - } - - if (sphere_mask) { - build_sphere_texgen(p, out_texgen, sphere_mask); - } - - if (reflect_mask) { - build_reflect_texgen(p, out_texgen, reflect_mask); - } - - if (normal_mask) { - struct ureg normal = get_transformed_normal(p); - emit_op1(p, OPCODE_MOV, out_texgen, normal_mask, normal ); - } - - if (copy_mask) { - struct ureg in = register_input(p, VERT_ATTRIB_TEX0+i); - emit_op1(p, OPCODE_MOV, out_texgen, copy_mask, in ); - } - } - - if (texmat_enabled) { - struct ureg texmat[4]; - struct ureg in = (!is_undef(out_texgen) ? - out_texgen : - register_input(p, VERT_ATTRIB_TEX0+i)); - if (PREFER_DP4) { - register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, - 0, texmat ); - emit_matrix_transform_vec4( p, out, texmat, in ); - } - else { - register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, - STATE_MATRIX_TRANSPOSE, texmat ); - emit_transpose_matrix_transform_vec4( p, out, texmat, in ); - } - } - - release_temps(p); - } - else { - emit_passthrough(p, VERT_ATTRIB_TEX0+i, VERT_RESULT_TEX0+i); - } - } -} - - -/** - * Point size attenuation computation. - */ -static void build_atten_pointsize( struct tnl_program *p ) -{ - struct ureg eye = get_eye_position_z(p); - struct ureg state_size = register_param1(p, STATE_POINT_SIZE); - struct ureg state_attenuation = register_param1(p, STATE_POINT_ATTENUATION); - struct ureg out = register_output(p, VERT_RESULT_PSIZ); - struct ureg ut = get_temp(p); - - /* dist = |eyez| */ - emit_op1(p, OPCODE_ABS, ut, WRITEMASK_Y, swizzle1(eye, Z)); - /* p1 + dist * (p2 + dist * p3); */ - emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), - swizzle1(state_attenuation, Z), swizzle1(state_attenuation, Y)); - emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), - ut, swizzle1(state_attenuation, X)); - - /* 1 / sqrt(factor) */ - emit_op1(p, OPCODE_RSQ, ut, WRITEMASK_X, ut ); - -#if 0 - /* out = pointSize / sqrt(factor) */ - emit_op2(p, OPCODE_MUL, out, WRITEMASK_X, ut, state_size); -#else - /* this is a good place to clamp the point size since there's likely - * no hardware registers to clamp point size at rasterization time. - */ - emit_op2(p, OPCODE_MUL, ut, WRITEMASK_X, ut, state_size); - emit_op2(p, OPCODE_MAX, ut, WRITEMASK_X, ut, swizzle1(state_size, Y)); - emit_op2(p, OPCODE_MIN, out, WRITEMASK_X, ut, swizzle1(state_size, Z)); -#endif - - release_temp(p, ut); -} - - -/** - * Emit constant point size. - */ -static void build_constant_pointsize( struct tnl_program *p ) -{ - struct ureg state_size = register_param1(p, STATE_POINT_SIZE); - struct ureg out = register_output(p, VERT_RESULT_PSIZ); - emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, state_size); -} - - -/** - * Pass-though per-vertex point size, from user's point size array. - */ -static void build_array_pointsize( struct tnl_program *p ) -{ - struct ureg in = register_input(p, VERT_ATTRIB_POINT_SIZE); - struct ureg out = register_output(p, VERT_RESULT_PSIZ); - emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, in); -} - - -static void build_tnl_program( struct tnl_program *p ) -{ /* Emit the program, starting with modelviewproject: - */ - build_hpos(p); - - /* Lighting calculations: - */ - if (p->state->fragprog_inputs_read & (FRAG_BIT_COL0|FRAG_BIT_COL1)) { - if (p->state->light_global_enabled) - build_lighting(p); - else { - if (p->state->fragprog_inputs_read & FRAG_BIT_COL0) - emit_passthrough(p, VERT_ATTRIB_COLOR0, VERT_RESULT_COL0); - - if (p->state->fragprog_inputs_read & FRAG_BIT_COL1) - emit_passthrough(p, VERT_ATTRIB_COLOR1, VERT_RESULT_COL1); - } - } - - if ((p->state->fragprog_inputs_read & FRAG_BIT_FOGC) || - p->state->fog_mode != FOG_NONE) - build_fog(p); - - if (p->state->fragprog_inputs_read & FRAG_BITS_TEX_ANY) - build_texture_transform(p); - - if (p->state->point_attenuated) - build_atten_pointsize(p); - else if (p->state->point_array) - build_array_pointsize(p); -#if 0 - else - build_constant_pointsize(p); -#else - (void) build_constant_pointsize; -#endif - - /* Finish up: - */ - emit_op1(p, OPCODE_END, undef, 0, undef); - - /* Disassemble: - */ - if (DISASSEM) { - _mesa_printf ("\n"); - } -} - - -static void -create_new_program( const struct state_key *key, - struct gl_vertex_program *program, - GLuint max_temps) -{ - struct tnl_program p; - - _mesa_memset(&p, 0, sizeof(p)); - p.state = key; - p.program = program; - p.eye_position = undef; - p.eye_position_z = undef; - p.eye_position_normalized = undef; - p.transformed_normal = undef; - p.identity = undef; - p.temp_in_use = 0; - - if (max_temps >= sizeof(int) * 8) - p.temp_reserved = 0; - else - p.temp_reserved = ~((1<Base.Instructions = _mesa_alloc_instructions(p.max_inst); - p.program->Base.String = NULL; - p.program->Base.NumInstructions = - p.program->Base.NumTemporaries = - p.program->Base.NumParameters = - p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0; - p.program->Base.Parameters = _mesa_new_parameter_list(); - p.program->Base.InputsRead = 0; - p.program->Base.OutputsWritten = 0; - - build_tnl_program( &p ); -} - - -/** - * Return a vertex program which implements the current fixed-function - * transform/lighting/texgen operations. - * XXX move this into core mesa (main/) - */ -struct gl_vertex_program * -_mesa_get_fixed_func_vertex_program(GLcontext *ctx) -{ - struct gl_vertex_program *prog; - struct state_key key; - - /* Grab all the relevent state and put it in a single structure: - */ - make_state_key(ctx, &key); - - /* Look for an already-prepared program for this state: - */ - prog = (struct gl_vertex_program *) - _mesa_search_program_cache(ctx->VertexProgram.Cache, &key, sizeof(key)); - - if (!prog) { - /* OK, we'll have to build a new one */ - if (0) - _mesa_printf("Build new TNL program\n"); - - prog = (struct gl_vertex_program *) - ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); - if (!prog) - return NULL; - - create_new_program( &key, prog, - ctx->Const.VertexProgram.MaxTemps ); - -#if 0 - if (ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, GL_VERTEX_PROGRAM_ARB, - &prog->Base ); -#endif - _mesa_program_cache_insert(ctx, ctx->VertexProgram.Cache, - &key, sizeof(key), &prog->Base); - } - - return prog; -} diff --git a/src/libs/mesa/mesa/main/ffvertex_prog.h b/src/libs/mesa/mesa/main/ffvertex_prog.h deleted file mode 100644 index 38dc5fbb8d..0000000000 --- a/src/libs/mesa/mesa/main/ffvertex_prog.h +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef FFVERTEX_PROG_H -#define FFVERTEX_PROG_H - - -#include "main/mtypes.h" - -struct gl_vertex_program * -_mesa_get_fixed_func_vertex_program(GLcontext *ctx); - - - -#endif /* FFVERTEX_PROG_H */ diff --git a/src/libs/mesa/mesa/main/fog.c b/src/libs/mesa/mesa/main/fog.c deleted file mode 100644 index 50a61bd84b..0000000000 --- a/src/libs/mesa/mesa/main/fog.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - - -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "fog.h" -#include "mtypes.h" - - - -void GLAPIENTRY -_mesa_Fogf(GLenum pname, GLfloat param) -{ - _mesa_Fogfv(pname, ¶m); -} - - -void GLAPIENTRY -_mesa_Fogi(GLenum pname, GLint param ) -{ - GLfloat fparam = (GLfloat) param; - _mesa_Fogfv(pname, &fparam); -} - - -void GLAPIENTRY -_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: - case GL_FOG_COORDINATE_SOURCE_EXT: - 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 _mesa_Fogfv */ - ; - } - _mesa_Fogfv(pname, p); -} - - -#define UPDATE_FOG_SCALE(ctx) do {\ - if (ctx->Fog.End == ctx->Fog.Start)\ - ctx->Fog._Scale = 1.0f;\ - else\ - ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);\ - } while(0) - - -void GLAPIENTRY -_mesa_Fogfv( GLenum pname, const GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLenum m; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (pname) { - case GL_FOG_MODE: - m = (GLenum) (GLint) *params; - switch (m) { - case GL_LINEAR: - case GL_EXP: - case GL_EXP2: - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glFog" ); - return; - } - if (ctx->Fog.Mode == m) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Mode = m; - break; - case GL_FOG_DENSITY: - if (*params<0.0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glFog" ); - return; - } - if (ctx->Fog.Density == *params) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Density = *params; - break; - case GL_FOG_START: - if (ctx->Fog.Start == *params) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Start = *params; - UPDATE_FOG_SCALE(ctx); - break; - case GL_FOG_END: - if (ctx->Fog.End == *params) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.End = *params; - UPDATE_FOG_SCALE(ctx); - break; - case GL_FOG_INDEX: - if (ctx->Fog.Index == *params) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Index = *params; - break; - case GL_FOG_COLOR: - if (TEST_EQ_4V(ctx->Fog.Color, params)) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F); - ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F); - ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F); - ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F); - break; - case GL_FOG_COORDINATE_SOURCE_EXT: { - GLenum p = (GLenum) (GLint) *params; - if (!ctx->Extensions.EXT_fog_coord || - (p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glFog"); - return; - } - if (ctx->Fog.FogCoordinateSource == p) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.FogCoordinateSource = p; - break; - } - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glFog" ); - return; - } - - if (ctx->Driver.Fogfv) { - (*ctx->Driver.Fogfv)( ctx, pname, params ); - } -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -void _mesa_init_fog( GLcontext * ctx ) -{ - /* 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; - ctx->Fog.ColorSumEnabled = GL_FALSE; - ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT; - ctx->Fog._Scale = 1.0f; -} diff --git a/src/libs/mesa/mesa/main/fog.h b/src/libs/mesa/mesa/main/fog.h deleted file mode 100644 index a14d19cdb3..0000000000 --- a/src/libs/mesa/mesa/main/fog.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * \file fog.h - * Fog operations. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 FOG_H -#define FOG_H - - -#include "mtypes.h" - - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Fogf(GLenum pname, GLfloat param); - -extern void GLAPIENTRY -_mesa_Fogi(GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_Fogfv(GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_Fogiv(GLenum pname, const GLint *params ); - -extern void _mesa_init_fog( GLcontext * ctx ); - -#else - -/** No-op */ -#define _mesa_init_fog( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/framebuffer.c b/src/libs/mesa/mesa/main/framebuffer.c deleted file mode 100644 index 7ede5bcb6d..0000000000 --- a/src/libs/mesa/mesa/main/framebuffer.c +++ /dev/null @@ -1,967 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * Functions for allocating/managing framebuffers and renderbuffers. - * Also, routines for reading/writing renderbuffer data as ubytes, - * ushorts, uints, etc. - */ - - -#include "glheader.h" -#include "imports.h" -#include "buffers.h" -#include "context.h" -#include "depthstencil.h" -#include "mtypes.h" -#include "fbobject.h" -#include "framebuffer.h" -#include "renderbuffer.h" -#include "texobj.h" - - - -/** - * Compute/set the _DepthMax field for the given framebuffer. - * This value depends on the Z buffer resolution. - */ -static void -compute_depth_max(struct gl_framebuffer *fb) -{ - if (fb->Visual.depthBits == 0) { - /* Special case. Even if we don't have a depth buffer we need - * good values for DepthMax for Z vertex transformation purposes - * and for per-fragment fog computation. - */ - fb->_DepthMax = (1 << 16) - 1; - } - else if (fb->Visual.depthBits < 32) { - fb->_DepthMax = (1 << fb->Visual.depthBits) - 1; - } - else { - /* Special case since shift values greater than or equal to the - * number of bits in the left hand expression's type are undefined. - */ - fb->_DepthMax = 0xffffffff; - } - fb->_DepthMaxF = (GLfloat) fb->_DepthMax; - - /* Minimum resolvable depth value, for polygon offset */ - fb->_MRD = (GLfloat)1.0 / fb->_DepthMaxF; -} - - -/** - * Create and initialize a gl_framebuffer object. - * This is intended for creating _window_system_ framebuffers, not generic - * framebuffer objects ala GL_EXT_framebuffer_object. - * - * \sa _mesa_new_framebuffer - */ -struct gl_framebuffer * -_mesa_create_framebuffer(const GLvisual *visual) -{ - struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer); - assert(visual); - if (fb) { - _mesa_initialize_framebuffer(fb, visual); - } - return fb; -} - - -/** - * Allocate a new gl_framebuffer object. - * This is the default function for ctx->Driver.NewFramebuffer(). - * This is for allocating user-created framebuffers, not window-system - * framebuffers! - * \sa _mesa_create_framebuffer - */ -struct gl_framebuffer * -_mesa_new_framebuffer(GLcontext *ctx, GLuint name) -{ - struct gl_framebuffer *fb; - (void) ctx; - assert(name != 0); - fb = CALLOC_STRUCT(gl_framebuffer); - if (fb) { - fb->Name = name; - fb->RefCount = 1; - fb->_NumColorDrawBuffers = 1; - fb->ColorDrawBuffer[0] = GL_COLOR_ATTACHMENT0_EXT; - fb->_ColorDrawBufferIndexes[0] = BUFFER_COLOR0; - fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT; - fb->_ColorReadBufferIndex = BUFFER_COLOR0; - fb->Delete = _mesa_destroy_framebuffer; - _glthread_INIT_MUTEX(fb->Mutex); - } - return fb; -} - - -/** - * Initialize a gl_framebuffer object. Typically used to initialize - * window system-created framebuffers, not user-created framebuffers. - * \sa _mesa_create_framebuffer - */ -void -_mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual) -{ - assert(fb); - assert(visual); - - _mesa_bzero(fb, sizeof(struct gl_framebuffer)); - - _glthread_INIT_MUTEX(fb->Mutex); - - fb->RefCount = 1; - - /* save the visual */ - fb->Visual = *visual; - - /* Init read/draw renderbuffer state */ - if (visual->doubleBufferMode) { - fb->_NumColorDrawBuffers = 1; - fb->ColorDrawBuffer[0] = GL_BACK; - fb->_ColorDrawBufferIndexes[0] = BUFFER_BACK_LEFT; - fb->ColorReadBuffer = GL_BACK; - fb->_ColorReadBufferIndex = BUFFER_BACK_LEFT; - } - else { - fb->_NumColorDrawBuffers = 1; - fb->ColorDrawBuffer[0] = GL_FRONT; - fb->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT; - fb->ColorReadBuffer = GL_FRONT; - fb->_ColorReadBufferIndex = BUFFER_FRONT_LEFT; - } - - fb->Delete = _mesa_destroy_framebuffer; - fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - - compute_depth_max(fb); -} - - -/** - * Deallocate buffer and everything attached to it. - * Typically called via the gl_framebuffer->Delete() method. - */ -void -_mesa_destroy_framebuffer(struct gl_framebuffer *fb) -{ - if (fb) { - _mesa_free_framebuffer_data(fb); - _mesa_free(fb); - } -} - - -/** - * Free all the data hanging off the given gl_framebuffer, but don't free - * the gl_framebuffer object itself. - */ -void -_mesa_free_framebuffer_data(struct gl_framebuffer *fb) -{ - GLuint i; - - assert(fb); - assert(fb->RefCount == 0); - - _glthread_DESTROY_MUTEX(fb->Mutex); - - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; - if (att->Renderbuffer) { - _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); - } - if (att->Texture) { - _mesa_reference_texobj(&att->Texture, NULL); - } - ASSERT(!att->Renderbuffer); - ASSERT(!att->Texture); - att->Type = GL_NONE; - } - - /* unbind _Depth/_StencilBuffer to decr ref counts */ - _mesa_reference_renderbuffer(&fb->_DepthBuffer, NULL); - _mesa_reference_renderbuffer(&fb->_StencilBuffer, NULL); -} - - -/** - * Set *ptr to point to fb, with refcounting and locking. - */ -void -_mesa_reference_framebuffer(struct gl_framebuffer **ptr, - struct gl_framebuffer *fb) -{ - assert(ptr); - if (*ptr == fb) { - /* no change */ - return; - } - if (*ptr) { - _mesa_unreference_framebuffer(ptr); - } - assert(!*ptr); - assert(fb); - _glthread_LOCK_MUTEX(fb->Mutex); - fb->RefCount++; - _glthread_UNLOCK_MUTEX(fb->Mutex); - *ptr = fb; -} - - -/** - * Undo/remove a reference to a framebuffer object. - * Decrement the framebuffer object's reference count and delete it when - * the refcount hits zero. - * Note: we pass the address of a pointer and set it to NULL. - */ -void -_mesa_unreference_framebuffer(struct gl_framebuffer **fb) -{ - assert(fb); - if (*fb) { - GLboolean deleteFlag = GL_FALSE; - - _glthread_LOCK_MUTEX((*fb)->Mutex); - ASSERT((*fb)->RefCount > 0); - (*fb)->RefCount--; - deleteFlag = ((*fb)->RefCount == 0); - _glthread_UNLOCK_MUTEX((*fb)->Mutex); - - if (deleteFlag) - (*fb)->Delete(*fb); - - *fb = NULL; - } -} - - - - -/** - * Resize the given framebuffer's renderbuffers to the new width and height. - * This should only be used for window-system framebuffers, not - * user-created renderbuffers (i.e. made with GL_EXT_framebuffer_object). - * This will typically be called via ctx->Driver.ResizeBuffers() or directly - * from a device driver. - * - * \note it's possible for ctx to be null since a window can be resized - * without a currently bound rendering context. - */ -void -_mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint width, GLuint height) -{ - GLuint i; - - /* XXX I think we could check if the size is not changing - * and return early. - */ - - /* For window system framebuffers, Name is zero */ - assert(fb->Name == 0); - - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; - if (att->Type == GL_RENDERBUFFER_EXT && att->Renderbuffer) { - struct gl_renderbuffer *rb = att->Renderbuffer; - /* only resize if size is changing */ - if (rb->Width != width || rb->Height != height) { - /* could just as well pass rb->_ActualFormat here */ - if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { - ASSERT(rb->Width == width); - ASSERT(rb->Height == height); - } - else { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer"); - /* no return */ - } - } - } - } - - if (fb->_DepthBuffer) { - struct gl_renderbuffer *rb = fb->_DepthBuffer; - if (rb->Width != width || rb->Height != height) { - if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer"); - } - } - } - - if (fb->_StencilBuffer) { - struct gl_renderbuffer *rb = fb->_StencilBuffer; - if (rb->Width != width || rb->Height != height) { - if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer"); - } - } - } - - fb->Width = width; - fb->Height = height; - - if (ctx) { - /* update scissor / window bounds */ - _mesa_update_draw_buffer_bounds(ctx); - /* Signal new buffer state so that swrast will update its clipping - * info (the CLIP_BIT flag). - */ - ctx->NewState |= _NEW_BUFFERS; - } -} - - - -/** - * XXX THIS IS OBSOLETE - drivers should take care of detecting window - * size changes and act accordingly, likely calling _mesa_resize_framebuffer(). - * - * GL_MESA_resize_buffers extension. - * - * When this function is called, we'll ask the window system how large - * the current window is. If it's a new size, we'll call the driver's - * ResizeBuffers function. The driver will then resize its color buffers - * as needed, and maybe call the swrast's routine for reallocating - * swrast-managed depth/stencil/accum/etc buffers. - * \note This function should only be called through the GL API, not - * from device drivers (as was done in the past). - */ -void -_mesa_resizebuffers( GLcontext *ctx ) -{ - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glResizeBuffersMESA\n"); - - if (!ctx->Driver.GetBufferSize) { - return; - } - - if (ctx->WinSysDrawBuffer) { - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - - assert(buffer->Name == 0); - - /* ask device driver for size of output buffer */ - ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width != newWidth || buffer->Height != newHeight) { - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); - } - } - - if (ctx->WinSysReadBuffer - && ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) { - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysReadBuffer; - - assert(buffer->Name == 0); - - /* ask device driver for size of read buffer */ - ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width != newWidth || buffer->Height != newHeight) { - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); - } - } - - ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ -} - - -/* - * XXX THIS IS OBSOLETE - */ -void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ) -{ - GET_CURRENT_CONTEXT(ctx); - - if (ctx->Extensions.MESA_resize_buffers) - _mesa_resizebuffers( ctx ); -} - - - -/** - * Examine all the framebuffer's renderbuffers to update the Width/Height - * fields of the framebuffer. If we have renderbuffers with different - * sizes, set the framebuffer's width and height to zero. - * Note: this is only intended for user-created framebuffers, not - * window-system framebuffes. - */ -static void -update_framebuffer_size(struct gl_framebuffer *fb) -{ - GLboolean haveSize = GL_FALSE; - GLuint i; - - /* user-created framebuffers only */ - assert(fb->Name); - - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; - const struct gl_renderbuffer *rb = att->Renderbuffer; - if (rb) { - if (haveSize) { - if (rb->Width != fb->Width && rb->Height != fb->Height) { - /* size mismatch! */ - fb->Width = 0; - fb->Height = 0; - return; - } - } - else { - fb->Width = rb->Width; - fb->Height = rb->Height; - haveSize = GL_TRUE; - } - } - } -} - - -/** - * Update the context's current drawing buffer's Xmin, Xmax, Ymin, Ymax fields. - * These values are computed from the buffer's width and height and - * the scissor box, if it's enabled. - * \param ctx the GL context. - */ -void -_mesa_update_draw_buffer_bounds(GLcontext *ctx) -{ - struct gl_framebuffer *buffer = ctx->DrawBuffer; - - if (!buffer) - return; - - if (buffer->Name) { - /* user-created framebuffer size depends on the renderbuffers */ - update_framebuffer_size(buffer); - } - - buffer->_Xmin = 0; - buffer->_Ymin = 0; - buffer->_Xmax = buffer->Width; - buffer->_Ymax = buffer->Height; - - if (ctx->Scissor.Enabled) { - if (ctx->Scissor.X > buffer->_Xmin) { - buffer->_Xmin = ctx->Scissor.X; - } - if (ctx->Scissor.Y > buffer->_Ymin) { - buffer->_Ymin = ctx->Scissor.Y; - } - if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) { - buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width; - } - if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) { - buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height; - } - /* finally, check for empty region */ - if (buffer->_Xmin > buffer->_Xmax) { - buffer->_Xmin = buffer->_Xmax; - } - if (buffer->_Ymin > buffer->_Ymax) { - buffer->_Ymin = buffer->_Ymax; - } - } - - ASSERT(buffer->_Xmin <= buffer->_Xmax); - ASSERT(buffer->_Ymin <= buffer->_Ymax); -} - - -/** - * The glGet queries of the framebuffer red/green/blue size, stencil size, - * etc. are satisfied by the fields of ctx->DrawBuffer->Visual. These can - * change depending on the renderbuffer bindings. This function updates - * the given framebuffer's Visual from the current renderbuffer bindings. - * - * This may apply to user-created framebuffers or window system framebuffers. - * - * Also note: ctx->DrawBuffer->Visual.depthBits might not equal - * ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer.DepthBits. - * The former one is used to convert floating point depth values into - * integer Z values. - */ -void -_mesa_update_framebuffer_visual(struct gl_framebuffer *fb) -{ - GLuint i; - - _mesa_bzero(&fb->Visual, sizeof(fb->Visual)); - fb->Visual.rgbMode = GL_TRUE; /* assume this */ - -#if 0 /* this _might_ be needed */ - if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - /* leave visual fields zero'd */ - return; - } -#endif - - /* find first RGB or CI renderbuffer */ - for (i = 0; i < BUFFER_COUNT; i++) { - if (fb->Attachment[i].Renderbuffer) { - const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; - if (rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB) { - fb->Visual.redBits = rb->RedBits; - fb->Visual.greenBits = rb->GreenBits; - fb->Visual.blueBits = rb->BlueBits; - fb->Visual.alphaBits = rb->AlphaBits; - fb->Visual.rgbBits = fb->Visual.redBits - + fb->Visual.greenBits + fb->Visual.blueBits; - fb->Visual.floatMode = GL_FALSE; - break; - } - else if (rb->_BaseFormat == GL_COLOR_INDEX) { - fb->Visual.indexBits = rb->IndexBits; - fb->Visual.rgbMode = GL_FALSE; - break; - } - } - } - - if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) { - fb->Visual.haveDepthBuffer = GL_TRUE; - fb->Visual.depthBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->DepthBits; - } - - if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) { - fb->Visual.haveStencilBuffer = GL_TRUE; - fb->Visual.stencilBits - = fb->Attachment[BUFFER_STENCIL].Renderbuffer->StencilBits; - } - - if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) { - fb->Visual.haveAccumBuffer = GL_TRUE; - fb->Visual.accumRedBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->RedBits; - fb->Visual.accumGreenBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->GreenBits; - fb->Visual.accumBlueBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->BlueBits; - fb->Visual.accumAlphaBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->AlphaBits; - } - - compute_depth_max(fb); -} - - -/** - * Update the framebuffer's _DepthBuffer field using the renderbuffer - * found at the given attachment index. - * - * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer, - * create and install a depth wrapper/adaptor. - * - * \param fb the framebuffer whose _DepthBuffer field to update - * \param attIndex indicates the renderbuffer to possibly wrap - */ -void -_mesa_update_depth_buffer(GLcontext *ctx, - struct gl_framebuffer *fb, - GLuint attIndex) -{ - struct gl_renderbuffer *depthRb; - - /* only one possiblity for now */ - ASSERT(attIndex == BUFFER_DEPTH); - - depthRb = fb->Attachment[attIndex].Renderbuffer; - - if (depthRb && depthRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { - /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */ - if (!fb->_DepthBuffer - || fb->_DepthBuffer->Wrapped != depthRb - || fb->_DepthBuffer->_BaseFormat != GL_DEPTH_COMPONENT) { - /* need to update wrapper */ - struct gl_renderbuffer *wrapper - = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb); - _mesa_reference_renderbuffer(&fb->_DepthBuffer, wrapper); - ASSERT(fb->_DepthBuffer->Wrapped == depthRb); - } - } - else { - /* depthRb may be null */ - _mesa_reference_renderbuffer(&fb->_DepthBuffer, depthRb); - } -} - - -/** - * Update the framebuffer's _StencilBuffer field using the renderbuffer - * found at the given attachment index. - * - * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer, - * create and install a stencil wrapper/adaptor. - * - * \param fb the framebuffer whose _StencilBuffer field to update - * \param attIndex indicates the renderbuffer to possibly wrap - */ -void -_mesa_update_stencil_buffer(GLcontext *ctx, - struct gl_framebuffer *fb, - GLuint attIndex) -{ - struct gl_renderbuffer *stencilRb; - - ASSERT(attIndex == BUFFER_DEPTH || - attIndex == BUFFER_STENCIL); - - stencilRb = fb->Attachment[attIndex].Renderbuffer; - - if (stencilRb && stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { - /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */ - if (!fb->_StencilBuffer - || fb->_StencilBuffer->Wrapped != stencilRb - || fb->_StencilBuffer->_BaseFormat != GL_STENCIL_INDEX) { - /* need to update wrapper */ - struct gl_renderbuffer *wrapper - = _mesa_new_s8_renderbuffer_wrapper(ctx, stencilRb); - _mesa_reference_renderbuffer(&fb->_StencilBuffer, wrapper); - ASSERT(fb->_StencilBuffer->Wrapped == stencilRb); - } - } - else { - /* stencilRb may be null */ - _mesa_reference_renderbuffer(&fb->_StencilBuffer, stencilRb); - } -} - - -/* - * Example DrawBuffers scenarios: - * - * 1. glDrawBuffer(GL_FRONT_AND_BACK), fixed-func or shader writes to - * "gl_FragColor" or program writes to the "result.color" register: - * - * fragment color output renderbuffer - * --------------------- --------------- - * color[0] Front, Back - * - * - * 2. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]), shader writes to - * gl_FragData[i] or program writes to result.color[i] registers: - * - * fragment color output renderbuffer - * --------------------- --------------- - * color[0] Front - * color[1] Aux0 - * color[3] Aux1 - * - * - * 3. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]) and shader writes to - * gl_FragColor, or fixed function: - * - * fragment color output renderbuffer - * --------------------- --------------- - * color[0] Front, Aux0, Aux1 - * - * - * In either case, the list of renderbuffers is stored in the - * framebuffer->_ColorDrawBuffers[] array and - * framebuffer->_NumColorDrawBuffers indicates the number of buffers. - * The renderer (like swrast) has to look at the current fragment shader - * to see if it writes to gl_FragColor vs. gl_FragData[i] to determine - * how to map color outputs to renderbuffers. - * - * Note that these two calls are equivalent (for fixed function fragment - * shading anyway): - * a) glDrawBuffer(GL_FRONT_AND_BACK); (assuming non-stereo framebuffer) - * b) glDrawBuffers(2, [GL_FRONT_LEFT, GL_BACK_LEFT]); - */ - - - - -/** - * Update the (derived) list of color drawing renderbuffer pointers. - * Later, when we're rendering we'll loop from 0 to _NumColorDrawBuffers - * writing colors. - */ -static void -update_color_draw_buffers(GLcontext *ctx, struct gl_framebuffer *fb) -{ - GLuint output; - - /* set 0th buffer to NULL now in case _NumColorDrawBuffers is zero */ - fb->_ColorDrawBuffers[0] = NULL; - - for (output = 0; output < fb->_NumColorDrawBuffers; output++) { - GLint buf = fb->_ColorDrawBufferIndexes[output]; - if (buf >= 0) { - fb->_ColorDrawBuffers[output] = fb->Attachment[buf].Renderbuffer; - } - else { - fb->_ColorDrawBuffers[output] = NULL; - } - } -} - - -/** - * Update the (derived) color read renderbuffer pointer. - * Unlike the DrawBuffer, we can only read from one (or zero) color buffers. - */ -static void -update_color_read_buffer(GLcontext *ctx, struct gl_framebuffer *fb) -{ - (void) ctx; - if (fb->_ColorReadBufferIndex == -1 || - fb->DeletePending || - fb->Width == 0 || - fb->Height == 0) { - fb->_ColorReadBuffer = NULL; /* legal! */ - } - else { - ASSERT(fb->_ColorReadBufferIndex >= 0); - ASSERT(fb->_ColorReadBufferIndex < BUFFER_COUNT); - fb->_ColorReadBuffer - = fb->Attachment[fb->_ColorReadBufferIndex].Renderbuffer; - } -} - - -/** - * Update a gl_framebuffer's derived state. - * - * Specifically, update these framebuffer fields: - * _ColorDrawBuffers - * _NumColorDrawBuffers - * _ColorReadBuffer - * _DepthBuffer - * _StencilBuffer - * - * If the framebuffer is user-created, make sure it's complete. - * - * The following functions (at least) can effect framebuffer state: - * glReadBuffer, glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT, - * glRenderbufferStorageEXT. - */ -static void -update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) -{ - if (fb->Name == 0) { - /* This is a window-system framebuffer */ - /* Need to update the FB's GL_DRAW_BUFFER state to match the - * context state (GL_READ_BUFFER too). - */ - if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) { - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, - ctx->Color.DrawBuffer, NULL); - } - if (fb->ColorReadBuffer != ctx->Pixel.ReadBuffer) { - - } - } - else { - /* This is a user-created framebuffer. - * Completeness only matters for user-created framebuffers. - */ - _mesa_test_framebuffer_completeness(ctx, fb); - _mesa_update_framebuffer_visual(fb); - } - - /* Strictly speaking, we don't need to update the draw-state - * if this FB is bound as ctx->ReadBuffer (and conversely, the - * read-state if this FB is bound as ctx->DrawBuffer), but no - * harm. - */ - update_color_draw_buffers(ctx, fb); - update_color_read_buffer(ctx, fb); - _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH); - _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL); - - compute_depth_max(fb); -} - - -/** - * Update state related to the current draw/read framebuffers. - */ -void -_mesa_update_framebuffer(GLcontext *ctx) -{ - struct gl_framebuffer *drawFb = ctx->DrawBuffer; - struct gl_framebuffer *readFb = ctx->ReadBuffer; - - update_framebuffer(ctx, drawFb); - if (readFb != drawFb) - update_framebuffer(ctx, readFb); -} - - -/** - * Check if the renderbuffer for a read operation (glReadPixels, glCopyPixels, - * glCopyTex[Sub]Image, etc. exists. - * \param format a basic image format such as GL_RGB, GL_RGBA, GL_ALPHA, - * GL_DEPTH_COMPONENT, etc. or GL_COLOR, GL_DEPTH, GL_STENCIL. - * \return GL_TRUE if buffer exists, GL_FALSE otherwise - */ -GLboolean -_mesa_source_buffer_exists(GLcontext *ctx, GLenum format) -{ - const struct gl_renderbuffer_attachment *att - = ctx->ReadBuffer->Attachment; - - if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - return GL_FALSE; - } - - switch (format) { - case GL_COLOR: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - case GL_COLOR_INDEX: - if (ctx->ReadBuffer->_ColorReadBuffer == NULL) { - return GL_FALSE; - } - /* XXX enable this post 6.5 release: - ASSERT(ctx->ReadBuffer->_ColorReadBuffer->RedBits > 0 || - ctx->ReadBuffer->_ColorReadBuffer->IndexBits > 0); - */ - break; - case GL_DEPTH: - case GL_DEPTH_COMPONENT: - if (!att[BUFFER_DEPTH].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); - break; - case GL_STENCIL: - case GL_STENCIL_INDEX: - if (!att[BUFFER_STENCIL].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); - break; - case GL_DEPTH_STENCIL_EXT: - if (!att[BUFFER_DEPTH].Renderbuffer || - !att[BUFFER_STENCIL].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); - break; - default: - _mesa_problem(ctx, - "Unexpected format 0x%x in _mesa_source_buffer_exists", - format); - return GL_FALSE; - } - - /* OK */ - return GL_TRUE; -} - - -/** - * As above, but for drawing operations. - * XXX code do some code merging w/ above function. - */ -GLboolean -_mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) -{ - const struct gl_renderbuffer_attachment *att - = ctx->ReadBuffer->Attachment; - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - return GL_FALSE; - } - - switch (format) { - case GL_COLOR: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - case GL_COLOR_INDEX: - /* nothing special */ - /* Could assert that colorbuffer has RedBits > 0 */ - break; - case GL_DEPTH: - case GL_DEPTH_COMPONENT: - if (!att[BUFFER_DEPTH].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); - break; - case GL_STENCIL: - case GL_STENCIL_INDEX: - if (!att[BUFFER_STENCIL].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); - break; - case GL_DEPTH_STENCIL_EXT: - if (!att[BUFFER_DEPTH].Renderbuffer || - !att[BUFFER_STENCIL].Renderbuffer) { - return GL_FALSE; - } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); - break; - default: - _mesa_problem(ctx, - "Unexpected format 0x%x in _mesa_source_buffer_exists", - format); - return GL_FALSE; - } - - /* OK */ - return GL_TRUE; -} diff --git a/src/libs/mesa/mesa/main/framebuffer.h b/src/libs/mesa/mesa/main/framebuffer.h deleted file mode 100644 index e9eeed28cb..0000000000 --- a/src/libs/mesa/mesa/main/framebuffer.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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 FRAMEBUFFER_H -#define FRAMEBUFFER_H - - -extern struct gl_framebuffer * -_mesa_create_framebuffer(const GLvisual *visual); - -extern struct gl_framebuffer * -_mesa_new_framebuffer(GLcontext *ctx, GLuint name); - -extern void -_mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual); - -extern void -_mesa_destroy_framebuffer(struct gl_framebuffer *buffer); - -extern void -_mesa_free_framebuffer_data(struct gl_framebuffer *buffer); - -extern void -_mesa_reference_framebuffer(struct gl_framebuffer **ptr, - struct gl_framebuffer *fb); - -extern void -_mesa_unreference_framebuffer(struct gl_framebuffer **fb); - -extern void -_mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint width, GLuint height); - - -extern void -_mesa_resizebuffers( GLcontext *ctx ); - -extern void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ); - - -extern void -_mesa_update_draw_buffer_bounds(GLcontext *ctx); - -extern void -_mesa_update_framebuffer_visual(struct gl_framebuffer *fb); - -extern void -_mesa_update_depth_buffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint attIndex); - -extern void -_mesa_update_stencil_buffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint attIndex); - -extern void -_mesa_update_framebuffer(GLcontext *ctx); - -extern GLboolean -_mesa_source_buffer_exists(GLcontext *ctx, GLenum format); - -extern GLboolean -_mesa_dest_buffer_exists(GLcontext *ctx, GLenum format); - - -#endif /* FRAMEBUFFER_H */ diff --git a/src/libs/mesa/mesa/main/get.c b/src/libs/mesa/mesa/main/get.c deleted file mode 100644 index 4b60c9e38a..0000000000 --- a/src/libs/mesa/mesa/main/get.c +++ /dev/null @@ -1,5643 +0,0 @@ - -/*** - *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py - ***/ - -#include "glheader.h" -#include "context.h" -#include "enable.h" -#include "extensions.h" -#include "fbobject.h" -#include "get.h" -#include "macros.h" -#include "mtypes.h" -#include "state.h" -#include "texcompress.h" - - -#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) - -#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) - -#define BOOLEAN_TO_INT(B) ( (GLint) (B) ) -#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) - - -/* - * Check if named extension is enabled, if not generate error and return. - */ -#define CHECK_EXT1(EXT1, FUNC) \ - if (!ctx->Extensions.EXT1) { \ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ - return; \ - } - -/* - * Check if either of two extensions is enabled. - */ -#define CHECK_EXT2(EXT1, EXT2, FUNC) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ - return; \ - } - -/* - * Check if either of three extensions is enabled. - */ -#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \ - !ctx->Extensions.EXT3) { \ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ - return; \ - } - -/* - * Check if either of four extensions is enabled. - */ -#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \ - !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ - return; \ - } - - -void GLAPIENTRY -_mesa_GetBooleanv( GLenum pname, GLboolean *params ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!params) - return; - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (ctx->Driver.GetBooleanv && - ctx->Driver.GetBooleanv(ctx, pname, params)) - return; - - switch (pname) { - case GL_ACCUM_RED_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumRedBits); - break; - case GL_ACCUM_GREEN_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumGreenBits); - break; - case GL_ACCUM_BLUE_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumBlueBits); - break; - case GL_ACCUM_ALPHA_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumAlphaBits); - break; - case GL_ACCUM_CLEAR_VALUE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[3]); - break; - case GL_ALPHA_BIAS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaBias); - break; - case GL_ALPHA_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.alphaBits); - break; - case GL_ALPHA_SCALE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaScale); - break; - case GL_ALPHA_TEST: - params[0] = ctx->Color.AlphaEnabled; - break; - case GL_ALPHA_TEST_FUNC: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.AlphaFunc); - break; - case GL_ALPHA_TEST_REF: - params[0] = FLOAT_TO_BOOLEAN(ctx->Color.AlphaRef); - break; - case GL_ATTRIB_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->AttribStackDepth); - break; - case GL_AUTO_NORMAL: - params[0] = ctx->Eval.AutoNormal; - break; - case GL_AUX_BUFFERS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.numAuxBuffers); - break; - case GL_BLEND: - params[0] = ctx->Color.BlendEnabled; - break; - case GL_BLEND_DST: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_SRC_RGB_EXT: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_DST_RGB_EXT: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC_ALPHA_EXT: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcA); - break; - case GL_BLEND_DST_ALPHA_EXT: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstA); - break; - case GL_BLEND_EQUATION: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationRGB ); - break; - case GL_BLEND_EQUATION_ALPHA_EXT: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationA ); - break; - case GL_BLEND_COLOR_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[3]); - break; - case GL_BLUE_BIAS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueBias); - break; - case GL_BLUE_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.blueBits); - break; - case GL_BLUE_SCALE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueScale); - break; - case GL_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->ClientAttribStackDepth); - break; - case GL_CLIP_PLANE0: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 0) & 1; - break; - case GL_CLIP_PLANE1: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 1) & 1; - break; - case GL_CLIP_PLANE2: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 2) & 1; - break; - case GL_CLIP_PLANE3: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 3) & 1; - break; - case GL_CLIP_PLANE4: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 4) & 1; - break; - case GL_CLIP_PLANE5: - params[0] = (ctx->Transform.ClipPlanesEnabled >> 5) & 1; - break; - case GL_COLOR_CLEAR_VALUE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[3]); - break; - case GL_COLOR_MATERIAL: - params[0] = ctx->Light.ColorMaterialEnabled; - break; - case GL_COLOR_MATERIAL_FACE: - params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialFace); - break; - case GL_COLOR_MATERIAL_PARAMETER: - params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialMode); - break; - case GL_COLOR_WRITEMASK: - params[0] = INT_TO_BOOLEAN(ctx->Color.ColorMask[RCOMP] ? 1 : 0); - params[1] = INT_TO_BOOLEAN(ctx->Color.ColorMask[GCOMP] ? 1 : 0); - params[2] = INT_TO_BOOLEAN(ctx->Color.ColorMask[BCOMP] ? 1 : 0); - params[3] = INT_TO_BOOLEAN(ctx->Color.ColorMask[ACOMP] ? 1 : 0); - break; - case GL_CULL_FACE: - params[0] = ctx->Polygon.CullFlag; - break; - case GL_CULL_FACE_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.CullFaceMode); - break; - case GL_CURRENT_COLOR: - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]); - } - break; - case GL_CURRENT_INDEX: - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]); - } - break; - case GL_CURRENT_NORMAL: - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]); - } - break; - case GL_CURRENT_RASTER_COLOR: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[3]); - break; - case GL_CURRENT_RASTER_DISTANCE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterDistance); - break; - case GL_CURRENT_RASTER_INDEX: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterIndex); - break; - case GL_CURRENT_RASTER_POSITION: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[3]); - break; - case GL_CURRENT_RASTER_SECONDARY_COLOR: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[3]); - break; - case GL_CURRENT_RASTER_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][3]); - } - break; - case GL_CURRENT_RASTER_POSITION_VALID: - params[0] = ctx->Current.RasterPosValid; - break; - case GL_CURRENT_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]); - } - break; - case GL_DEPTH_BIAS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthBias); - break; - case GL_DEPTH_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.depthBits); - break; - case GL_DEPTH_CLEAR_VALUE: - params[0] = FLOAT_TO_BOOLEAN(((GLfloat) ctx->Depth.Clear)); - break; - case GL_DEPTH_FUNC: - params[0] = ENUM_TO_BOOLEAN(ctx->Depth.Func); - break; - case GL_DEPTH_RANGE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Viewport.Near); - params[1] = FLOAT_TO_BOOLEAN(ctx->Viewport.Far); - break; - case GL_DEPTH_SCALE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthScale); - break; - case GL_DEPTH_TEST: - params[0] = ctx->Depth.Test; - break; - case GL_DEPTH_WRITEMASK: - params[0] = ctx->Depth.Mask; - break; - case GL_DITHER: - params[0] = ctx->Color.DitherFlag; - break; - case GL_DOUBLEBUFFER: - params[0] = ctx->DrawBuffer->Visual.doubleBufferMode; - break; - case GL_DRAW_BUFFER: - params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_EDGE_FLAG: - { - FLUSH_CURRENT(ctx, 0); - params[0] = (ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0); - } - break; - case GL_FEEDBACK_BUFFER_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Feedback.BufferSize); - break; - case GL_FEEDBACK_BUFFER_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Feedback.Type); - break; - case GL_FOG: - params[0] = ctx->Fog.Enabled; - break; - case GL_FOG_COLOR: - params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[3]); - break; - case GL_FOG_DENSITY: - params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Density); - break; - case GL_FOG_END: - params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.End); - break; - case GL_FOG_HINT: - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.Fog); - break; - case GL_FOG_INDEX: - params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Index); - break; - case GL_FOG_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->Fog.Mode); - break; - case GL_FOG_START: - params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Start); - break; - case GL_FRONT_FACE: - params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontFace); - break; - case GL_GREEN_BIAS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenBias); - break; - case GL_GREEN_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.greenBits); - break; - case GL_GREEN_SCALE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenScale); - break; - case GL_INDEX_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.indexBits); - break; - case GL_INDEX_CLEAR_VALUE: - params[0] = INT_TO_BOOLEAN(ctx->Color.ClearIndex); - break; - case GL_INDEX_MODE: - params[0] = !ctx->DrawBuffer->Visual.rgbMode; - break; - case GL_INDEX_OFFSET: - params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexOffset); - break; - case GL_INDEX_SHIFT: - params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexShift); - break; - case GL_INDEX_WRITEMASK: - params[0] = INT_TO_BOOLEAN(ctx->Color.IndexMask); - break; - case GL_LIGHT0: - params[0] = ctx->Light.Light[0].Enabled; - break; - case GL_LIGHT1: - params[0] = ctx->Light.Light[1].Enabled; - break; - case GL_LIGHT2: - params[0] = ctx->Light.Light[2].Enabled; - break; - case GL_LIGHT3: - params[0] = ctx->Light.Light[3].Enabled; - break; - case GL_LIGHT4: - params[0] = ctx->Light.Light[4].Enabled; - break; - case GL_LIGHT5: - params[0] = ctx->Light.Light[5].Enabled; - break; - case GL_LIGHT6: - params[0] = ctx->Light.Light[6].Enabled; - break; - case GL_LIGHT7: - params[0] = ctx->Light.Light[7].Enabled; - break; - case GL_LIGHTING: - params[0] = ctx->Light.Enabled; - break; - case GL_LIGHT_MODEL_AMBIENT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[3]); - break; - case GL_LIGHT_MODEL_COLOR_CONTROL: - params[0] = ENUM_TO_BOOLEAN(ctx->Light.Model.ColorControl); - break; - case GL_LIGHT_MODEL_LOCAL_VIEWER: - params[0] = ctx->Light.Model.LocalViewer; - break; - case GL_LIGHT_MODEL_TWO_SIDE: - params[0] = ctx->Light.Model.TwoSide; - break; - case GL_LINE_SMOOTH: - params[0] = ctx->Line.SmoothFlag; - break; - case GL_LINE_SMOOTH_HINT: - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.LineSmooth); - break; - case GL_LINE_STIPPLE: - params[0] = ctx->Line.StippleFlag; - break; - case GL_LINE_STIPPLE_PATTERN: - params[0] = INT_TO_BOOLEAN(ctx->Line.StipplePattern); - break; - case GL_LINE_STIPPLE_REPEAT: - params[0] = INT_TO_BOOLEAN(ctx->Line.StippleFactor); - break; - case GL_LINE_WIDTH: - params[0] = FLOAT_TO_BOOLEAN(ctx->Line.Width); - break; - case GL_LINE_WIDTH_GRANULARITY: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.LineWidthGranularity); - break; - case GL_LINE_WIDTH_RANGE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidthAA); - params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidthAA); - break; - case GL_ALIASED_LINE_WIDTH_RANGE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidth); - params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidth); - break; - case GL_LIST_BASE: - params[0] = INT_TO_BOOLEAN(ctx->List.ListBase); - break; - case GL_LIST_INDEX: - params[0] = INT_TO_BOOLEAN(ctx->ListState.CurrentListNum); - break; - case GL_LIST_MODE: - { - GLenum mode; - if (!ctx->CompileFlag) - mode = 0; - else if (ctx->ExecuteFlag) - mode = GL_COMPILE_AND_EXECUTE; - else - mode = GL_COMPILE; - params[0] = ENUM_TO_BOOLEAN(mode); - } - break; - case GL_INDEX_LOGIC_OP: - params[0] = ctx->Color.IndexLogicOpEnabled; - break; - case GL_COLOR_LOGIC_OP: - params[0] = ctx->Color.ColorLogicOpEnabled; - break; - case GL_LOGIC_OP_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->Color.LogicOp); - break; - case GL_MAP1_COLOR_4: - params[0] = ctx->Eval.Map1Color4; - break; - case GL_MAP1_GRID_DOMAIN: - params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u1); - params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u2); - break; - case GL_MAP1_GRID_SEGMENTS: - params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid1un); - break; - case GL_MAP1_INDEX: - params[0] = ctx->Eval.Map1Index; - break; - case GL_MAP1_NORMAL: - params[0] = ctx->Eval.Map1Normal; - break; - case GL_MAP1_TEXTURE_COORD_1: - params[0] = ctx->Eval.Map1TextureCoord1; - break; - case GL_MAP1_TEXTURE_COORD_2: - params[0] = ctx->Eval.Map1TextureCoord2; - break; - case GL_MAP1_TEXTURE_COORD_3: - params[0] = ctx->Eval.Map1TextureCoord3; - break; - case GL_MAP1_TEXTURE_COORD_4: - params[0] = ctx->Eval.Map1TextureCoord4; - break; - case GL_MAP1_VERTEX_3: - params[0] = ctx->Eval.Map1Vertex3; - break; - case GL_MAP1_VERTEX_4: - params[0] = ctx->Eval.Map1Vertex4; - break; - case GL_MAP2_COLOR_4: - params[0] = ctx->Eval.Map2Color4; - break; - case GL_MAP2_GRID_DOMAIN: - params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u1); - params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u2); - params[2] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v1); - params[3] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v2); - break; - case GL_MAP2_GRID_SEGMENTS: - params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2un); - params[1] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2vn); - break; - case GL_MAP2_INDEX: - params[0] = ctx->Eval.Map2Index; - break; - case GL_MAP2_NORMAL: - params[0] = ctx->Eval.Map2Normal; - break; - case GL_MAP2_TEXTURE_COORD_1: - params[0] = ctx->Eval.Map2TextureCoord1; - break; - case GL_MAP2_TEXTURE_COORD_2: - params[0] = ctx->Eval.Map2TextureCoord2; - break; - case GL_MAP2_TEXTURE_COORD_3: - params[0] = ctx->Eval.Map2TextureCoord3; - break; - case GL_MAP2_TEXTURE_COORD_4: - params[0] = ctx->Eval.Map2TextureCoord4; - break; - case GL_MAP2_VERTEX_3: - params[0] = ctx->Eval.Map2Vertex3; - break; - case GL_MAP2_VERTEX_4: - params[0] = ctx->Eval.Map2Vertex4; - break; - case GL_MAP_COLOR: - params[0] = ctx->Pixel.MapColorFlag; - break; - case GL_MAP_STENCIL: - params[0] = ctx->Pixel.MapStencilFlag; - break; - case GL_MATRIX_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->Transform.MatrixMode); - break; - case GL_MAX_ATTRIB_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_ATTRIB_STACK_DEPTH); - break; - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_CLIENT_ATTRIB_STACK_DEPTH); - break; - case GL_MAX_CLIP_PLANES: - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxClipPlanes); - break; - case GL_MAX_ELEMENTS_VERTICES: - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize); - break; - case GL_MAX_ELEMENTS_INDICES: - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize); - break; - case GL_MAX_EVAL_ORDER: - params[0] = INT_TO_BOOLEAN(MAX_EVAL_ORDER); - break; - case GL_MAX_LIGHTS: - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxLights); - break; - case GL_MAX_LIST_NESTING: - params[0] = INT_TO_BOOLEAN(MAX_LIST_NESTING); - break; - case GL_MAX_MODELVIEW_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_MODELVIEW_STACK_DEPTH); - break; - case GL_MAX_NAME_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_NAME_STACK_DEPTH); - break; - case GL_MAX_PIXEL_MAP_TABLE: - params[0] = INT_TO_BOOLEAN(MAX_PIXEL_MAP_TABLE); - break; - case GL_MAX_PROJECTION_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_PROJECTION_STACK_DEPTH); - break; - case GL_MAX_TEXTURE_SIZE: - params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.MaxTextureLevels - 1)); - break; - case GL_MAX_3D_TEXTURE_SIZE: - params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.Max3DTextureLevels - 1)); - break; - case GL_MAX_TEXTURE_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(MAX_TEXTURE_STACK_DEPTH); - break; - case GL_MAX_VIEWPORT_DIMS: - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxViewportWidth); - params[1] = INT_TO_BOOLEAN(ctx->Const.MaxViewportHeight); - break; - case GL_MODELVIEW_MATRIX: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_MODELVIEW_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->ModelviewMatrixStack.Depth + 1); - break; - case GL_NAME_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->Select.NameStackDepth); - break; - case GL_NORMALIZE: - params[0] = ctx->Transform.Normalize; - break; - case GL_PACK_ALIGNMENT: - params[0] = INT_TO_BOOLEAN(ctx->Pack.Alignment); - break; - case GL_PACK_LSB_FIRST: - params[0] = ctx->Pack.LsbFirst; - break; - case GL_PACK_ROW_LENGTH: - params[0] = INT_TO_BOOLEAN(ctx->Pack.RowLength); - break; - case GL_PACK_SKIP_PIXELS: - params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipPixels); - break; - case GL_PACK_SKIP_ROWS: - params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipRows); - break; - case GL_PACK_SWAP_BYTES: - params[0] = ctx->Pack.SwapBytes; - break; - case GL_PACK_SKIP_IMAGES_EXT: - params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipImages); - break; - case GL_PACK_IMAGE_HEIGHT_EXT: - params[0] = INT_TO_BOOLEAN(ctx->Pack.ImageHeight); - break; - case GL_PACK_INVERT_MESA: - params[0] = ctx->Pack.Invert; - break; - case GL_PERSPECTIVE_CORRECTION_HINT: - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PerspectiveCorrection); - break; - case GL_PIXEL_MAP_A_TO_A_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.AtoA.Size); - break; - case GL_PIXEL_MAP_B_TO_B_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.BtoB.Size); - break; - case GL_PIXEL_MAP_G_TO_G_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.GtoG.Size); - break; - case GL_PIXEL_MAP_I_TO_A_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoA.Size); - break; - case GL_PIXEL_MAP_I_TO_B_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoB.Size); - break; - case GL_PIXEL_MAP_I_TO_G_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoG.Size); - break; - case GL_PIXEL_MAP_I_TO_I_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoI.Size); - break; - case GL_PIXEL_MAP_I_TO_R_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoR.Size); - break; - case GL_PIXEL_MAP_R_TO_R_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.RtoR.Size); - break; - case GL_PIXEL_MAP_S_TO_S_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.StoS.Size); - break; - case GL_POINT_SIZE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Size); - break; - case GL_POINT_SIZE_GRANULARITY: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.PointSizeGranularity); - break; - case GL_POINT_SIZE_RANGE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSizeAA); - params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSizeAA); - break; - case GL_ALIASED_POINT_SIZE_RANGE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSize); - params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSize); - break; - case GL_POINT_SMOOTH: - params[0] = ctx->Point.SmoothFlag; - break; - case GL_POINT_SMOOTH_HINT: - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PointSmooth); - break; - case GL_POINT_SIZE_MIN_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MinSize); - break; - case GL_POINT_SIZE_MAX_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MaxSize); - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Threshold); - break; - case GL_DISTANCE_ATTENUATION_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Params[0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Point.Params[1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Point.Params[2]); - break; - case GL_POLYGON_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontMode); - params[1] = ENUM_TO_BOOLEAN(ctx->Polygon.BackMode); - break; - case GL_POLYGON_OFFSET_BIAS_EXT: - params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits); - break; - case GL_POLYGON_OFFSET_FACTOR: - params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetFactor ); - break; - case GL_POLYGON_OFFSET_UNITS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits ); - break; - case GL_POLYGON_OFFSET_POINT: - params[0] = ctx->Polygon.OffsetPoint; - break; - case GL_POLYGON_OFFSET_LINE: - params[0] = ctx->Polygon.OffsetLine; - break; - case GL_POLYGON_OFFSET_FILL: - params[0] = ctx->Polygon.OffsetFill; - break; - case GL_POLYGON_SMOOTH: - params[0] = ctx->Polygon.SmoothFlag; - break; - case GL_POLYGON_SMOOTH_HINT: - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PolygonSmooth); - break; - case GL_POLYGON_STIPPLE: - params[0] = ctx->Polygon.StippleFlag; - break; - case GL_PROJECTION_MATRIX: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_PROJECTION_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->ProjectionMatrixStack.Depth + 1); - break; - case GL_READ_BUFFER: - params[0] = ENUM_TO_BOOLEAN(ctx->ReadBuffer->ColorReadBuffer); - break; - case GL_RED_BIAS: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias); - break; - case GL_RED_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.redBits); - break; - case GL_RED_SCALE: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale); - break; - case GL_RENDER_MODE: - params[0] = ENUM_TO_BOOLEAN(ctx->RenderMode); - break; - case GL_RESCALE_NORMAL: - params[0] = ctx->Transform.RescaleNormals; - break; - case GL_RGBA_MODE: - params[0] = ctx->DrawBuffer->Visual.rgbMode; - break; - case GL_SCISSOR_BOX: - params[0] = INT_TO_BOOLEAN(ctx->Scissor.X); - params[1] = INT_TO_BOOLEAN(ctx->Scissor.Y); - params[2] = INT_TO_BOOLEAN(ctx->Scissor.Width); - params[3] = INT_TO_BOOLEAN(ctx->Scissor.Height); - break; - case GL_SCISSOR_TEST: - params[0] = ctx->Scissor.Enabled; - break; - case GL_SELECTION_BUFFER_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Select.BufferSize); - break; - case GL_SHADE_MODEL: - params[0] = ENUM_TO_BOOLEAN(ctx->Light.ShadeModel); - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - params[0] = ctx->Texture.SharedPalette; - break; - case GL_STENCIL_BITS: - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.stencilBits); - break; - case GL_STENCIL_CLEAR_VALUE: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.Clear); - break; - case GL_STENCIL_FAIL: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_FUNC: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_PASS: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_REF: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_TEST: - params[0] = ctx->Stencil.Enabled; - break; - case GL_STENCIL_VALUE_MASK: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_WRITEMASK: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); - break; - case GL_STEREO: - params[0] = ctx->DrawBuffer->Visual.stereoMode; - break; - case GL_SUBPIXEL_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Const.SubPixelBits); - break; - case GL_TEXTURE_1D: - params[0] = _mesa_IsEnabled(GL_TEXTURE_1D); - break; - case GL_TEXTURE_2D: - params[0] = _mesa_IsEnabled(GL_TEXTURE_2D); - break; - case GL_TEXTURE_3D: - params[0] = _mesa_IsEnabled(GL_TEXTURE_3D); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = _mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT); - break; - case GL_TEXTURE_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = _mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT); - break; - case GL_TEXTURE_BINDING_1D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_2D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_3D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name); - break; - case GL_TEXTURE_GEN_S: - params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0); - break; - case GL_TEXTURE_GEN_T: - params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0); - break; - case GL_TEXTURE_GEN_R: - params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0); - break; - case GL_TEXTURE_GEN_Q: - params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0); - break; - case GL_TEXTURE_MATRIX: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_TEXTURE_STACK_DEPTH: - params[0] = INT_TO_BOOLEAN(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1); - break; - case GL_UNPACK_ALIGNMENT: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.Alignment); - break; - case GL_UNPACK_LSB_FIRST: - params[0] = ctx->Unpack.LsbFirst; - break; - case GL_UNPACK_ROW_LENGTH: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.RowLength); - break; - case GL_UNPACK_SKIP_PIXELS: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipPixels); - break; - case GL_UNPACK_SKIP_ROWS: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipRows); - break; - case GL_UNPACK_SWAP_BYTES: - params[0] = ctx->Unpack.SwapBytes; - break; - case GL_UNPACK_SKIP_IMAGES_EXT: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipImages); - break; - case GL_UNPACK_IMAGE_HEIGHT_EXT: - params[0] = INT_TO_BOOLEAN(ctx->Unpack.ImageHeight); - break; - case GL_UNPACK_CLIENT_STORAGE_APPLE: - params[0] = ctx->Unpack.ClientStorage; - break; - case GL_VIEWPORT: - params[0] = INT_TO_BOOLEAN(ctx->Viewport.X); - params[1] = INT_TO_BOOLEAN(ctx->Viewport.Y); - params[2] = INT_TO_BOOLEAN(ctx->Viewport.Width); - params[3] = INT_TO_BOOLEAN(ctx->Viewport.Height); - break; - case GL_ZOOM_X: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomX); - break; - case GL_ZOOM_Y: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomY); - break; - case GL_VERTEX_ARRAY: - params[0] = ctx->Array.ArrayObj->Vertex.Enabled; - break; - case GL_VERTEX_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Size); - break; - case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Type); - break; - case GL_VERTEX_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Stride); - break; - case GL_VERTEX_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Enabled); - break; - case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Type); - break; - case GL_NORMAL_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Stride); - break; - case GL_NORMAL_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_COLOR_ARRAY: - params[0] = ctx->Array.ArrayObj->Color.Enabled; - break; - case GL_COLOR_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Size); - break; - case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Type); - break; - case GL_COLOR_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Stride); - break; - case GL_COLOR_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_INDEX_ARRAY: - params[0] = ctx->Array.ArrayObj->Index.Enabled; - break; - case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Type); - break; - case GL_INDEX_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Stride); - break; - case GL_INDEX_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_TEXTURE_COORD_ARRAY: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; - break; - case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); - break; - case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); - break; - case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); - break; - case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_EDGE_FLAG_ARRAY: - params[0] = ctx->Array.ArrayObj->EdgeFlag.Enabled; - break; - case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.Stride); - break; - case GL_EDGE_FLAG_ARRAY_COUNT_EXT: - params[0] = INT_TO_BOOLEAN(0); - break; - case GL_MAX_TEXTURE_UNITS_ARB: - CHECK_EXT1(ARB_multitexture, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureUnits); - break; - case GL_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit); - break; - case GL_CLIENT_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture); - break; - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); - params[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB); - break; - case GL_TEXTURE_BINDING_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name); - break; - case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1))); - break; - case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression); - break; - case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); - break; - case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); - { - GLint formats[100]; - GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); - ASSERT(n <= 100); - for (i = 0; i < n; i++) - params[i] = ENUM_TO_BOOLEAN(formats[i]); - } - break; - case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.LockFirst); - break; - case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.LockCount); - break; - case GL_TRANSPOSE_COLOR_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[4]); - params[2] = FLOAT_TO_BOOLEAN(matrix[8]); - params[3] = FLOAT_TO_BOOLEAN(matrix[12]); - params[4] = FLOAT_TO_BOOLEAN(matrix[1]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[9]); - params[7] = FLOAT_TO_BOOLEAN(matrix[13]); - params[8] = FLOAT_TO_BOOLEAN(matrix[2]); - params[9] = FLOAT_TO_BOOLEAN(matrix[6]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[14]); - params[12] = FLOAT_TO_BOOLEAN(matrix[3]); - params[13] = FLOAT_TO_BOOLEAN(matrix[7]); - params[14] = FLOAT_TO_BOOLEAN(matrix[11]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[4]); - params[2] = FLOAT_TO_BOOLEAN(matrix[8]); - params[3] = FLOAT_TO_BOOLEAN(matrix[12]); - params[4] = FLOAT_TO_BOOLEAN(matrix[1]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[9]); - params[7] = FLOAT_TO_BOOLEAN(matrix[13]); - params[8] = FLOAT_TO_BOOLEAN(matrix[2]); - params[9] = FLOAT_TO_BOOLEAN(matrix[6]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[14]); - params[12] = FLOAT_TO_BOOLEAN(matrix[3]); - params[13] = FLOAT_TO_BOOLEAN(matrix[7]); - params[14] = FLOAT_TO_BOOLEAN(matrix[11]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[4]); - params[2] = FLOAT_TO_BOOLEAN(matrix[8]); - params[3] = FLOAT_TO_BOOLEAN(matrix[12]); - params[4] = FLOAT_TO_BOOLEAN(matrix[1]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[9]); - params[7] = FLOAT_TO_BOOLEAN(matrix[13]); - params[8] = FLOAT_TO_BOOLEAN(matrix[2]); - params[9] = FLOAT_TO_BOOLEAN(matrix[6]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[14]); - params[12] = FLOAT_TO_BOOLEAN(matrix[3]); - params[13] = FLOAT_TO_BOOLEAN(matrix[7]); - params[14] = FLOAT_TO_BOOLEAN(matrix[11]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[4]); - params[2] = FLOAT_TO_BOOLEAN(matrix[8]); - params[3] = FLOAT_TO_BOOLEAN(matrix[12]); - params[4] = FLOAT_TO_BOOLEAN(matrix[1]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[9]); - params[7] = FLOAT_TO_BOOLEAN(matrix[13]); - params[8] = FLOAT_TO_BOOLEAN(matrix[2]); - params[9] = FLOAT_TO_BOOLEAN(matrix[6]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[14]); - params[12] = FLOAT_TO_BOOLEAN(matrix[3]); - params[13] = FLOAT_TO_BOOLEAN(matrix[7]); - params[14] = FLOAT_TO_BOOLEAN(matrix[11]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_COLOR_MATRIX_SGI: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = INT_TO_BOOLEAN(ctx->ColorMatrixStack.Depth + 1); - break; - case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH); - break; - case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[0]); - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[1]); - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[2]); - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[3]); - break; - case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[0]); - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[1]); - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[2]); - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[3]); - break; - case GL_CONVOLUTION_1D_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = ctx->Pixel.Convolution1DEnabled; - break; - case GL_CONVOLUTION_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = ctx->Pixel.Convolution2DEnabled; - break; - case GL_SEPARABLE_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = ctx->Pixel.Separable2DEnabled; - break; - case GL_POST_CONVOLUTION_RED_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[0]); - break; - case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[1]); - break; - case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[2]); - break; - case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[3]); - break; - case GL_POST_CONVOLUTION_RED_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[0]); - break; - case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[1]); - break; - case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[2]); - break; - case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[3]); - break; - case GL_HISTOGRAM: - CHECK_EXT1(EXT_histogram, "GetBooleanv"); - params[0] = ctx->Pixel.HistogramEnabled; - break; - case GL_MINMAX: - CHECK_EXT1(EXT_histogram, "GetBooleanv"); - params[0] = ctx->Pixel.MinMaxEnabled; - break; - case GL_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetBooleanv"); - params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]; - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetBooleanv"); - params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]; - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetBooleanv"); - params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]; - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_texture_color_table, "GetBooleanv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; - break; - case GL_COLOR_SUM_EXT: - CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetBooleanv"); - params[0] = ctx->Fog.ColorSumEnabled; - break; - case GL_CURRENT_SECONDARY_COLOR_EXT: - CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]); - params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]); - params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]); - params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]); - } - break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.Enabled; - break; - case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Type); - break; - case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Stride); - break; - case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Size); - break; - case GL_CURRENT_FOG_COORDINATE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]); - } - break; - case GL_FOG_COORDINATE_ARRAY_EXT: - CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->FogCoord.Enabled; - break; - case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Type); - break; - case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Stride); - break; - case GL_FOG_COORDINATE_SOURCE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Fog.FogCoordinateSource); - break; - case GL_MAX_TEXTURE_LOD_BIAS_EXT: - CHECK_EXT1(EXT_texture_lod_bias, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureLodBias); - break; - case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: - CHECK_EXT1(EXT_texture_filter_anisotropic, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy); - break; - case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = ctx->Multisample.Enabled; - break; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = ctx->Multisample.SampleAlphaToCoverage; - break; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = ctx->Multisample.SampleAlphaToOne; - break; - case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = ctx->Multisample.SampleCoverage; - break; - case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue); - break; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = ctx->Multisample.SampleCoverageInvert; - break; - case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers); - break; - case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples); - break; - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXT1(IBM_rasterpos_clip, "GetBooleanv"); - params[0] = ctx->Transform.RasterPositionUnclipped; - break; - case GL_POINT_SPRITE_NV: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv"); - params[0] = ctx->Point.PointSprite; - break; - case GL_POINT_SPRITE_R_MODE_NV: - CHECK_EXT1(NV_point_sprite, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteRMode); - break; - case GL_POINT_SPRITE_COORD_ORIGIN: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteOrigin); - break; - case GL_GENERATE_MIPMAP_HINT_SGIS: - CHECK_EXT1(SGIS_generate_mipmap, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.GenerateMipmap); - break; - case GL_VERTEX_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); - break; - case GL_VERTEX_ATTRIB_ARRAY0_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[0].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY1_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[1].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY2_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[2].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY3_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[3].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[4].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY5_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[5].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY6_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[6].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY7_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[7].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY8_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[8].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY9_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[9].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY10_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[10].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY11_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[11].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY12_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[12].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY13_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[13].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY14_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[14].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.ArrayObj->VertexAttrib[15].Enabled; - break; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[0]; - break; - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[1]; - break; - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[2]; - break; - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[3]; - break; - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[4]; - break; - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[5]; - break; - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[6]; - break; - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[7]; - break; - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[8]; - break; - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[9]; - break; - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[10]; - break; - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[11]; - break; - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[12]; - break; - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[13]; - break; - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[14]; - break; - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Eval.Map1Attrib[15]; - break; - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXT1(NV_fragment_program, "GetBooleanv"); - params[0] = ctx->FragmentProgram.Enabled; - break; - case GL_FRAGMENT_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); - break; - case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: - CHECK_EXT1(NV_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS); - break; - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); - params[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV); - break; - case GL_TEXTURE_BINDING_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name); - break; - case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureRectSize); - break; - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv"); - params[0] = ctx->Stencil.TestTwoSide; - break; - case GL_ACTIVE_STENCIL_FACE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); - break; - case GL_MAX_SHININESS_NV: - CHECK_EXT1(NV_light_max_exponent, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxShininess); - break; - case GL_MAX_SPOT_EXPONENT_NV: - CHECK_EXT1(NV_light_max_exponent, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent); - break; - case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name); - break; - case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name); - break; - case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name); - break; - case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name); - break; - case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name); - break; - case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); - break; - case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); - break; - case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); - break; - case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); - break; - case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name); - break; - case GL_PIXEL_PACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Pack.BufferObj->Name); - break; - case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Unpack.BufferObj->Name); - break; - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.Enabled; - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.PointSizeEnabled; - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.TwoSideEnabled; - break; - case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrixStackDepth); - break; - case GL_MAX_PROGRAM_MATRICES_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrices); - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); - params[0] = ctx->CurrentStack->Depth + 1; - break; - case GL_CURRENT_MATRIX_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetBooleanv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_TRANSPOSE_CURRENT_MATRIX_ARB: - CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[4]); - params[2] = FLOAT_TO_BOOLEAN(matrix[8]); - params[3] = FLOAT_TO_BOOLEAN(matrix[12]); - params[4] = FLOAT_TO_BOOLEAN(matrix[1]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[9]); - params[7] = FLOAT_TO_BOOLEAN(matrix[13]); - params[8] = FLOAT_TO_BOOLEAN(matrix[2]); - params[9] = FLOAT_TO_BOOLEAN(matrix[6]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[14]); - params[12] = FLOAT_TO_BOOLEAN(matrix[3]); - params[13] = FLOAT_TO_BOOLEAN(matrix[7]); - params[14] = FLOAT_TO_BOOLEAN(matrix[11]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs); - break; - case GL_PROGRAM_ERROR_POSITION_ARB: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Program.ErrorPos); - break; - case GL_FRAGMENT_PROGRAM_ARB: - CHECK_EXT1(ARB_fragment_program, "GetBooleanv"); - params[0] = ctx->FragmentProgram.Enabled; - break; - case GL_MAX_TEXTURE_COORDS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureCoordUnits); - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureImageUnits); - break; - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv"); - params[0] = ctx->Depth.BoundsTest; - break; - case GL_DEPTH_BOUNDS_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv"); - params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin); - params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax); - break; - case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetBooleanv"); - params[0] = ctx->FragmentProgram.CallbackEnabled; - break; - case GL_VERTEX_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetBooleanv"); - params[0] = ctx->VertexProgram.CallbackEnabled; - break; - case GL_FRAGMENT_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.CurrentPosition); - break; - case GL_VERTEX_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition); - break; - case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); - break; - case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; - params[0] = ENUM_TO_BOOLEAN(buffer); - } - break; - case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; - params[0] = ENUM_TO_BOOLEAN(buffer); - } - break; - case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; - params[0] = ENUM_TO_BOOLEAN(buffer); - } - break; - case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: - CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadType); - break; - case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: - CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadFormat); - break; - case GL_NUM_FRAGMENT_REGISTERS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(6); - break; - case GL_NUM_FRAGMENT_CONSTANTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(8); - break; - case GL_NUM_PASSES_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(2); - break; - case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(8); - break; - case GL_NUM_INSTRUCTIONS_TOTAL_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(16); - break; - case GL_COLOR_ALPHA_PAIRING_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = GL_TRUE; - break; - case GL_NUM_LOOPBACK_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(3); - break; - case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(3); - break; - case GL_STENCIL_BACK_FUNC: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[1]); - break; - case GL_STENCIL_BACK_VALUE_MASK: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]); - break; - case GL_STENCIL_BACK_WRITEMASK: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[1]); - break; - case GL_STENCIL_BACK_REF: - params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]); - break; - case GL_STENCIL_BACK_FAIL: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_PASS: - params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[1]); - break; - case GL_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Name); - break; - case GL_RENDERBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0); - break; - case GL_MAX_COLOR_ATTACHMENTS_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxColorAttachments); - break; - case GL_MAX_RENDERBUFFER_SIZE_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxRenderbufferSize); - break; - case GL_READ_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_blit, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->ReadBuffer->Name); - break; - case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.FragmentProgram.MaxUniformComponents); - break; - case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Hint.FragmentShaderDerivative); - break; - case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxUniformComponents); - break; - case GL_MAX_VARYING_FLOATS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVarying * 4); - break; - case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVertexTextureImageUnits); - break; - case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS); - break; - case GL_CURRENT_PROGRAM: - CHECK_EXT1(ARB_shader_objects, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); - break; - case GL_VERTEX_ARRAY_BINDING_APPLE: - CHECK_EXT1(APPLE_vertex_array_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Name); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); - } -} - -void GLAPIENTRY -_mesa_GetFloatv( GLenum pname, GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!params) - return; - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (ctx->Driver.GetFloatv && - ctx->Driver.GetFloatv(ctx, pname, params)) - return; - - switch (pname) { - case GL_ACCUM_RED_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumRedBits); - break; - case GL_ACCUM_GREEN_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumGreenBits); - break; - case GL_ACCUM_BLUE_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumBlueBits); - break; - case GL_ACCUM_ALPHA_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumAlphaBits); - break; - case GL_ACCUM_CLEAR_VALUE: - params[0] = ctx->Accum.ClearColor[0]; - params[1] = ctx->Accum.ClearColor[1]; - params[2] = ctx->Accum.ClearColor[2]; - params[3] = ctx->Accum.ClearColor[3]; - break; - case GL_ALPHA_BIAS: - params[0] = ctx->Pixel.AlphaBias; - break; - case GL_ALPHA_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.alphaBits); - break; - case GL_ALPHA_SCALE: - params[0] = ctx->Pixel.AlphaScale; - break; - case GL_ALPHA_TEST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.AlphaEnabled); - break; - case GL_ALPHA_TEST_FUNC: - params[0] = ENUM_TO_FLOAT(ctx->Color.AlphaFunc); - break; - case GL_ALPHA_TEST_REF: - params[0] = ctx->Color.AlphaRef; - break; - case GL_ATTRIB_STACK_DEPTH: - params[0] = (GLfloat)(ctx->AttribStackDepth); - break; - case GL_AUTO_NORMAL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.AutoNormal); - break; - case GL_AUX_BUFFERS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.numAuxBuffers); - break; - case GL_BLEND: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.BlendEnabled); - break; - case GL_BLEND_DST: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_SRC_RGB_EXT: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_DST_RGB_EXT: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC_ALPHA_EXT: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcA); - break; - case GL_BLEND_DST_ALPHA_EXT: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstA); - break; - case GL_BLEND_EQUATION: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationRGB ); - break; - case GL_BLEND_EQUATION_ALPHA_EXT: - params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationA ); - break; - case GL_BLEND_COLOR_EXT: - params[0] = ctx->Color.BlendColor[0]; - params[1] = ctx->Color.BlendColor[1]; - params[2] = ctx->Color.BlendColor[2]; - params[3] = ctx->Color.BlendColor[3]; - break; - case GL_BLUE_BIAS: - params[0] = ctx->Pixel.BlueBias; - break; - case GL_BLUE_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.blueBits); - break; - case GL_BLUE_SCALE: - params[0] = ctx->Pixel.BlueScale; - break; - case GL_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = (GLfloat)(ctx->ClientAttribStackDepth); - break; - case GL_CLIP_PLANE0: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 0) & 1); - break; - case GL_CLIP_PLANE1: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 1) & 1); - break; - case GL_CLIP_PLANE2: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 2) & 1); - break; - case GL_CLIP_PLANE3: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 3) & 1); - break; - case GL_CLIP_PLANE4: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 4) & 1); - break; - case GL_CLIP_PLANE5: - params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 5) & 1); - break; - case GL_COLOR_CLEAR_VALUE: - params[0] = ctx->Color.ClearColor[0]; - params[1] = ctx->Color.ClearColor[1]; - params[2] = ctx->Color.ClearColor[2]; - params[3] = ctx->Color.ClearColor[3]; - break; - case GL_COLOR_MATERIAL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.ColorMaterialEnabled); - break; - case GL_COLOR_MATERIAL_FACE: - params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialFace); - break; - case GL_COLOR_MATERIAL_PARAMETER: - params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialMode); - break; - case GL_COLOR_WRITEMASK: - params[0] = (GLfloat)(ctx->Color.ColorMask[RCOMP] ? 1 : 0); - params[1] = (GLfloat)(ctx->Color.ColorMask[GCOMP] ? 1 : 0); - params[2] = (GLfloat)(ctx->Color.ColorMask[BCOMP] ? 1 : 0); - params[3] = (GLfloat)(ctx->Color.ColorMask[ACOMP] ? 1 : 0); - break; - case GL_CULL_FACE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.CullFlag); - break; - case GL_CULL_FACE_MODE: - params[0] = ENUM_TO_FLOAT(ctx->Polygon.CullFaceMode); - break; - case GL_CURRENT_COLOR: - { - FLUSH_CURRENT(ctx, 0); - params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]; - params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]; - params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]; - params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; - } - break; - case GL_CURRENT_INDEX: - { - FLUSH_CURRENT(ctx, 0); - params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } - break; - case GL_CURRENT_NORMAL: - { - FLUSH_CURRENT(ctx, 0); - params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]; - params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]; - params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]; - } - break; - case GL_CURRENT_RASTER_COLOR: - params[0] = ctx->Current.RasterColor[0]; - params[1] = ctx->Current.RasterColor[1]; - params[2] = ctx->Current.RasterColor[2]; - params[3] = ctx->Current.RasterColor[3]; - break; - case GL_CURRENT_RASTER_DISTANCE: - params[0] = ctx->Current.RasterDistance; - break; - case GL_CURRENT_RASTER_INDEX: - params[0] = ctx->Current.RasterIndex; - break; - case GL_CURRENT_RASTER_POSITION: - params[0] = ctx->Current.RasterPos[0]; - params[1] = ctx->Current.RasterPos[1]; - params[2] = ctx->Current.RasterPos[2]; - params[3] = ctx->Current.RasterPos[3]; - break; - case GL_CURRENT_RASTER_SECONDARY_COLOR: - params[0] = ctx->Current.RasterSecondaryColor[0]; - params[1] = ctx->Current.RasterSecondaryColor[1]; - params[2] = ctx->Current.RasterSecondaryColor[2]; - params[3] = ctx->Current.RasterSecondaryColor[3]; - break; - case GL_CURRENT_RASTER_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = ctx->Current.RasterTexCoords[texUnit][0]; - params[1] = ctx->Current.RasterTexCoords[texUnit][1]; - params[2] = ctx->Current.RasterTexCoords[texUnit][2]; - params[3] = ctx->Current.RasterTexCoords[texUnit][3]; - } - break; - case GL_CURRENT_RASTER_POSITION_VALID: - params[0] = BOOLEAN_TO_FLOAT(ctx->Current.RasterPosValid); - break; - case GL_CURRENT_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]; - params[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]; - params[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]; - params[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]; - } - break; - case GL_DEPTH_BIAS: - params[0] = ctx->Pixel.DepthBias; - break; - case GL_DEPTH_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.depthBits); - break; - case GL_DEPTH_CLEAR_VALUE: - params[0] = ((GLfloat) ctx->Depth.Clear); - break; - case GL_DEPTH_FUNC: - params[0] = ENUM_TO_FLOAT(ctx->Depth.Func); - break; - case GL_DEPTH_RANGE: - params[0] = ctx->Viewport.Near; - params[1] = ctx->Viewport.Far; - break; - case GL_DEPTH_SCALE: - params[0] = ctx->Pixel.DepthScale; - break; - case GL_DEPTH_TEST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Test); - break; - case GL_DEPTH_WRITEMASK: - params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Mask); - break; - case GL_DITHER: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.DitherFlag); - break; - case GL_DOUBLEBUFFER: - params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.doubleBufferMode); - break; - case GL_DRAW_BUFFER: - params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_EDGE_FLAG: - { - FLUSH_CURRENT(ctx, 0); - params[0] = BOOLEAN_TO_FLOAT((ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0)); - } - break; - case GL_FEEDBACK_BUFFER_SIZE: - params[0] = (GLfloat)(ctx->Feedback.BufferSize); - break; - case GL_FEEDBACK_BUFFER_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Feedback.Type); - break; - case GL_FOG: - params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.Enabled); - break; - case GL_FOG_COLOR: - params[0] = ctx->Fog.Color[0]; - params[1] = ctx->Fog.Color[1]; - params[2] = ctx->Fog.Color[2]; - params[3] = ctx->Fog.Color[3]; - break; - case GL_FOG_DENSITY: - params[0] = ctx->Fog.Density; - break; - case GL_FOG_END: - params[0] = ctx->Fog.End; - break; - case GL_FOG_HINT: - params[0] = ENUM_TO_FLOAT(ctx->Hint.Fog); - break; - case GL_FOG_INDEX: - params[0] = ctx->Fog.Index; - break; - case GL_FOG_MODE: - params[0] = ENUM_TO_FLOAT(ctx->Fog.Mode); - break; - case GL_FOG_START: - params[0] = ctx->Fog.Start; - break; - case GL_FRONT_FACE: - params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontFace); - break; - case GL_GREEN_BIAS: - params[0] = ctx->Pixel.GreenBias; - break; - case GL_GREEN_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.greenBits); - break; - case GL_GREEN_SCALE: - params[0] = ctx->Pixel.GreenScale; - break; - case GL_INDEX_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.indexBits); - break; - case GL_INDEX_CLEAR_VALUE: - params[0] = (GLfloat)(ctx->Color.ClearIndex); - break; - case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_FLOAT(!ctx->DrawBuffer->Visual.rgbMode); - break; - case GL_INDEX_OFFSET: - params[0] = (GLfloat)(ctx->Pixel.IndexOffset); - break; - case GL_INDEX_SHIFT: - params[0] = (GLfloat)(ctx->Pixel.IndexShift); - break; - case GL_INDEX_WRITEMASK: - params[0] = (GLfloat)(ctx->Color.IndexMask); - break; - case GL_LIGHT0: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[0].Enabled); - break; - case GL_LIGHT1: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[1].Enabled); - break; - case GL_LIGHT2: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[2].Enabled); - break; - case GL_LIGHT3: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[3].Enabled); - break; - case GL_LIGHT4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[4].Enabled); - break; - case GL_LIGHT5: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[5].Enabled); - break; - case GL_LIGHT6: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[6].Enabled); - break; - case GL_LIGHT7: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[7].Enabled); - break; - case GL_LIGHTING: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Enabled); - break; - case GL_LIGHT_MODEL_AMBIENT: - params[0] = ctx->Light.Model.Ambient[0]; - params[1] = ctx->Light.Model.Ambient[1]; - params[2] = ctx->Light.Model.Ambient[2]; - params[3] = ctx->Light.Model.Ambient[3]; - break; - case GL_LIGHT_MODEL_COLOR_CONTROL: - params[0] = ENUM_TO_FLOAT(ctx->Light.Model.ColorControl); - break; - case GL_LIGHT_MODEL_LOCAL_VIEWER: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.LocalViewer); - break; - case GL_LIGHT_MODEL_TWO_SIDE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.TwoSide); - break; - case GL_LINE_SMOOTH: - params[0] = BOOLEAN_TO_FLOAT(ctx->Line.SmoothFlag); - break; - case GL_LINE_SMOOTH_HINT: - params[0] = ENUM_TO_FLOAT(ctx->Hint.LineSmooth); - break; - case GL_LINE_STIPPLE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Line.StippleFlag); - break; - case GL_LINE_STIPPLE_PATTERN: - params[0] = (GLfloat)(ctx->Line.StipplePattern); - break; - case GL_LINE_STIPPLE_REPEAT: - params[0] = (GLfloat)(ctx->Line.StippleFactor); - break; - case GL_LINE_WIDTH: - params[0] = ctx->Line.Width; - break; - case GL_LINE_WIDTH_GRANULARITY: - params[0] = ctx->Const.LineWidthGranularity; - break; - case GL_LINE_WIDTH_RANGE: - params[0] = ctx->Const.MinLineWidthAA; - params[1] = ctx->Const.MaxLineWidthAA; - break; - case GL_ALIASED_LINE_WIDTH_RANGE: - params[0] = ctx->Const.MinLineWidth; - params[1] = ctx->Const.MaxLineWidth; - break; - case GL_LIST_BASE: - params[0] = (GLfloat)(ctx->List.ListBase); - break; - case GL_LIST_INDEX: - params[0] = (GLfloat)(ctx->ListState.CurrentListNum); - break; - case GL_LIST_MODE: - { - GLenum mode; - if (!ctx->CompileFlag) - mode = 0; - else if (ctx->ExecuteFlag) - mode = GL_COMPILE_AND_EXECUTE; - else - mode = GL_COMPILE; - params[0] = ENUM_TO_FLOAT(mode); - } - break; - case GL_INDEX_LOGIC_OP: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.IndexLogicOpEnabled); - break; - case GL_COLOR_LOGIC_OP: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.ColorLogicOpEnabled); - break; - case GL_LOGIC_OP_MODE: - params[0] = ENUM_TO_FLOAT(ctx->Color.LogicOp); - break; - case GL_MAP1_COLOR_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Color4); - break; - case GL_MAP1_GRID_DOMAIN: - params[0] = ctx->Eval.MapGrid1u1; - params[1] = ctx->Eval.MapGrid1u2; - break; - case GL_MAP1_GRID_SEGMENTS: - params[0] = (GLfloat)(ctx->Eval.MapGrid1un); - break; - case GL_MAP1_INDEX: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Index); - break; - case GL_MAP1_NORMAL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Normal); - break; - case GL_MAP1_TEXTURE_COORD_1: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord1); - break; - case GL_MAP1_TEXTURE_COORD_2: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord2); - break; - case GL_MAP1_TEXTURE_COORD_3: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord3); - break; - case GL_MAP1_TEXTURE_COORD_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord4); - break; - case GL_MAP1_VERTEX_3: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex3); - break; - case GL_MAP1_VERTEX_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex4); - break; - case GL_MAP2_COLOR_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Color4); - break; - case GL_MAP2_GRID_DOMAIN: - params[0] = ctx->Eval.MapGrid2u1; - params[1] = ctx->Eval.MapGrid2u2; - params[2] = ctx->Eval.MapGrid2v1; - params[3] = ctx->Eval.MapGrid2v2; - break; - case GL_MAP2_GRID_SEGMENTS: - params[0] = (GLfloat)(ctx->Eval.MapGrid2un); - params[1] = (GLfloat)(ctx->Eval.MapGrid2vn); - break; - case GL_MAP2_INDEX: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Index); - break; - case GL_MAP2_NORMAL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Normal); - break; - case GL_MAP2_TEXTURE_COORD_1: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord1); - break; - case GL_MAP2_TEXTURE_COORD_2: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord2); - break; - case GL_MAP2_TEXTURE_COORD_3: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord3); - break; - case GL_MAP2_TEXTURE_COORD_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord4); - break; - case GL_MAP2_VERTEX_3: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex3); - break; - case GL_MAP2_VERTEX_4: - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex4); - break; - case GL_MAP_COLOR: - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapColorFlag); - break; - case GL_MAP_STENCIL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapStencilFlag); - break; - case GL_MATRIX_MODE: - params[0] = ENUM_TO_FLOAT(ctx->Transform.MatrixMode); - break; - case GL_MAX_ATTRIB_STACK_DEPTH: - params[0] = (GLfloat)(MAX_ATTRIB_STACK_DEPTH); - break; - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = (GLfloat)(MAX_CLIENT_ATTRIB_STACK_DEPTH); - break; - case GL_MAX_CLIP_PLANES: - params[0] = (GLfloat)(ctx->Const.MaxClipPlanes); - break; - case GL_MAX_ELEMENTS_VERTICES: - params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize); - break; - case GL_MAX_ELEMENTS_INDICES: - params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize); - break; - case GL_MAX_EVAL_ORDER: - params[0] = (GLfloat)(MAX_EVAL_ORDER); - break; - case GL_MAX_LIGHTS: - params[0] = (GLfloat)(ctx->Const.MaxLights); - break; - case GL_MAX_LIST_NESTING: - params[0] = (GLfloat)(MAX_LIST_NESTING); - break; - case GL_MAX_MODELVIEW_STACK_DEPTH: - params[0] = (GLfloat)(MAX_MODELVIEW_STACK_DEPTH); - break; - case GL_MAX_NAME_STACK_DEPTH: - params[0] = (GLfloat)(MAX_NAME_STACK_DEPTH); - break; - case GL_MAX_PIXEL_MAP_TABLE: - params[0] = (GLfloat)(MAX_PIXEL_MAP_TABLE); - break; - case GL_MAX_PROJECTION_STACK_DEPTH: - params[0] = (GLfloat)(MAX_PROJECTION_STACK_DEPTH); - break; - case GL_MAX_TEXTURE_SIZE: - params[0] = (GLfloat)(1 << (ctx->Const.MaxTextureLevels - 1)); - break; - case GL_MAX_3D_TEXTURE_SIZE: - params[0] = (GLfloat)(1 << (ctx->Const.Max3DTextureLevels - 1)); - break; - case GL_MAX_TEXTURE_STACK_DEPTH: - params[0] = (GLfloat)(MAX_TEXTURE_STACK_DEPTH); - break; - case GL_MAX_VIEWPORT_DIMS: - params[0] = (GLfloat)(ctx->Const.MaxViewportWidth); - params[1] = (GLfloat)(ctx->Const.MaxViewportHeight); - break; - case GL_MODELVIEW_MATRIX: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; - case GL_MODELVIEW_STACK_DEPTH: - params[0] = (GLfloat)(ctx->ModelviewMatrixStack.Depth + 1); - break; - case GL_NAME_STACK_DEPTH: - params[0] = (GLfloat)(ctx->Select.NameStackDepth); - break; - case GL_NORMALIZE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.Normalize); - break; - case GL_PACK_ALIGNMENT: - params[0] = (GLfloat)(ctx->Pack.Alignment); - break; - case GL_PACK_LSB_FIRST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.LsbFirst); - break; - case GL_PACK_ROW_LENGTH: - params[0] = (GLfloat)(ctx->Pack.RowLength); - break; - case GL_PACK_SKIP_PIXELS: - params[0] = (GLfloat)(ctx->Pack.SkipPixels); - break; - case GL_PACK_SKIP_ROWS: - params[0] = (GLfloat)(ctx->Pack.SkipRows); - break; - case GL_PACK_SWAP_BYTES: - params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.SwapBytes); - break; - case GL_PACK_SKIP_IMAGES_EXT: - params[0] = (GLfloat)(ctx->Pack.SkipImages); - break; - case GL_PACK_IMAGE_HEIGHT_EXT: - params[0] = (GLfloat)(ctx->Pack.ImageHeight); - break; - case GL_PACK_INVERT_MESA: - params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.Invert); - break; - case GL_PERSPECTIVE_CORRECTION_HINT: - params[0] = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection); - break; - case GL_PIXEL_MAP_A_TO_A_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.AtoA.Size); - break; - case GL_PIXEL_MAP_B_TO_B_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.BtoB.Size); - break; - case GL_PIXEL_MAP_G_TO_G_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.GtoG.Size); - break; - case GL_PIXEL_MAP_I_TO_A_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.ItoA.Size); - break; - case GL_PIXEL_MAP_I_TO_B_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.ItoB.Size); - break; - case GL_PIXEL_MAP_I_TO_G_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.ItoG.Size); - break; - case GL_PIXEL_MAP_I_TO_I_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.ItoI.Size); - break; - case GL_PIXEL_MAP_I_TO_R_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.ItoR.Size); - break; - case GL_PIXEL_MAP_R_TO_R_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.RtoR.Size); - break; - case GL_PIXEL_MAP_S_TO_S_SIZE: - params[0] = (GLfloat)(ctx->PixelMaps.StoS.Size); - break; - case GL_POINT_SIZE: - params[0] = ctx->Point.Size; - break; - case GL_POINT_SIZE_GRANULARITY: - params[0] = ctx->Const.PointSizeGranularity; - break; - case GL_POINT_SIZE_RANGE: - params[0] = ctx->Const.MinPointSizeAA; - params[1] = ctx->Const.MaxPointSizeAA; - break; - case GL_ALIASED_POINT_SIZE_RANGE: - params[0] = ctx->Const.MinPointSize; - params[1] = ctx->Const.MaxPointSize; - break; - case GL_POINT_SMOOTH: - params[0] = BOOLEAN_TO_FLOAT(ctx->Point.SmoothFlag); - break; - case GL_POINT_SMOOTH_HINT: - params[0] = ENUM_TO_FLOAT(ctx->Hint.PointSmooth); - break; - case GL_POINT_SIZE_MIN_EXT: - params[0] = ctx->Point.MinSize; - break; - case GL_POINT_SIZE_MAX_EXT: - params[0] = ctx->Point.MaxSize; - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - params[0] = ctx->Point.Threshold; - break; - case GL_DISTANCE_ATTENUATION_EXT: - params[0] = ctx->Point.Params[0]; - params[1] = ctx->Point.Params[1]; - params[2] = ctx->Point.Params[2]; - break; - case GL_POLYGON_MODE: - params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontMode); - params[1] = ENUM_TO_FLOAT(ctx->Polygon.BackMode); - break; - case GL_POLYGON_OFFSET_BIAS_EXT: - params[0] = ctx->Polygon.OffsetUnits; - break; - case GL_POLYGON_OFFSET_FACTOR: - params[0] = ctx->Polygon.OffsetFactor ; - break; - case GL_POLYGON_OFFSET_UNITS: - params[0] = ctx->Polygon.OffsetUnits ; - break; - case GL_POLYGON_OFFSET_POINT: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetPoint); - break; - case GL_POLYGON_OFFSET_LINE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetLine); - break; - case GL_POLYGON_OFFSET_FILL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetFill); - break; - case GL_POLYGON_SMOOTH: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.SmoothFlag); - break; - case GL_POLYGON_SMOOTH_HINT: - params[0] = ENUM_TO_FLOAT(ctx->Hint.PolygonSmooth); - break; - case GL_POLYGON_STIPPLE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.StippleFlag); - break; - case GL_PROJECTION_MATRIX: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; - case GL_PROJECTION_STACK_DEPTH: - params[0] = (GLfloat)(ctx->ProjectionMatrixStack.Depth + 1); - break; - case GL_READ_BUFFER: - params[0] = ENUM_TO_FLOAT(ctx->ReadBuffer->ColorReadBuffer); - break; - case GL_RED_BIAS: - params[0] = ctx->Pixel.RedBias; - break; - case GL_RED_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.redBits); - break; - case GL_RED_SCALE: - params[0] = ctx->Pixel.RedScale; - break; - case GL_RENDER_MODE: - params[0] = ENUM_TO_FLOAT(ctx->RenderMode); - break; - case GL_RESCALE_NORMAL: - params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RescaleNormals); - break; - case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.rgbMode); - break; - case GL_SCISSOR_BOX: - params[0] = (GLfloat)(ctx->Scissor.X); - params[1] = (GLfloat)(ctx->Scissor.Y); - params[2] = (GLfloat)(ctx->Scissor.Width); - params[3] = (GLfloat)(ctx->Scissor.Height); - break; - case GL_SCISSOR_TEST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Scissor.Enabled); - break; - case GL_SELECTION_BUFFER_SIZE: - params[0] = (GLfloat)(ctx->Select.BufferSize); - break; - case GL_SHADE_MODEL: - params[0] = ENUM_TO_FLOAT(ctx->Light.ShadeModel); - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.SharedPalette); - break; - case GL_STENCIL_BITS: - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.stencilBits); - break; - case GL_STENCIL_CLEAR_VALUE: - params[0] = (GLfloat)(ctx->Stencil.Clear); - break; - case GL_STENCIL_FAIL: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_FUNC: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_PASS: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_REF: - params[0] = (GLfloat)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_TEST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.Enabled); - break; - case GL_STENCIL_VALUE_MASK: - params[0] = (GLfloat)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_WRITEMASK: - params[0] = (GLfloat)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); - break; - case GL_STEREO: - params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.stereoMode); - break; - case GL_SUBPIXEL_BITS: - params[0] = (GLfloat)(ctx->Const.SubPixelBits); - break; - case GL_TEXTURE_1D: - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D)); - break; - case GL_TEXTURE_2D: - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D)); - break; - case GL_TEXTURE_3D: - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D)); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)); - break; - case GL_TEXTURE_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)); - break; - case GL_TEXTURE_BINDING_1D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_2D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_3D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name); - break; - case GL_TEXTURE_BINDING_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name); - break; - case GL_TEXTURE_GEN_S: - params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_T: - params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_R: - params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_Q: - params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_MATRIX: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; - case GL_TEXTURE_STACK_DEPTH: - params[0] = (GLfloat)(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1); - break; - case GL_UNPACK_ALIGNMENT: - params[0] = (GLfloat)(ctx->Unpack.Alignment); - break; - case GL_UNPACK_LSB_FIRST: - params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.LsbFirst); - break; - case GL_UNPACK_ROW_LENGTH: - params[0] = (GLfloat)(ctx->Unpack.RowLength); - break; - case GL_UNPACK_SKIP_PIXELS: - params[0] = (GLfloat)(ctx->Unpack.SkipPixels); - break; - case GL_UNPACK_SKIP_ROWS: - params[0] = (GLfloat)(ctx->Unpack.SkipRows); - break; - case GL_UNPACK_SWAP_BYTES: - params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.SwapBytes); - break; - case GL_UNPACK_SKIP_IMAGES_EXT: - params[0] = (GLfloat)(ctx->Unpack.SkipImages); - break; - case GL_UNPACK_IMAGE_HEIGHT_EXT: - params[0] = (GLfloat)(ctx->Unpack.ImageHeight); - break; - case GL_UNPACK_CLIENT_STORAGE_APPLE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.ClientStorage); - break; - case GL_VIEWPORT: - params[0] = (GLfloat)(ctx->Viewport.X); - params[1] = (GLfloat)(ctx->Viewport.Y); - params[2] = (GLfloat)(ctx->Viewport.Width); - params[3] = (GLfloat)(ctx->Viewport.Height); - break; - case GL_ZOOM_X: - params[0] = ctx->Pixel.ZoomX; - break; - case GL_ZOOM_Y: - params[0] = ctx->Pixel.ZoomY; - break; - case GL_VERTEX_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Enabled); - break; - case GL_VERTEX_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Size); - break; - case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Type); - break; - case GL_VERTEX_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Stride); - break; - case GL_VERTEX_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Enabled); - break; - case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Type); - break; - case GL_NORMAL_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.Stride); - break; - case GL_NORMAL_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_COLOR_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Color.Enabled); - break; - case GL_COLOR_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Size); - break; - case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Color.Type); - break; - case GL_COLOR_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Stride); - break; - case GL_COLOR_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_INDEX_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Index.Enabled); - break; - case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Index.Type); - break; - case GL_INDEX_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.Stride); - break; - case GL_INDEX_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_TEXTURE_COORD_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); - break; - case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); - break; - case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); - break; - case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); - break; - case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_EDGE_FLAG_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->EdgeFlag.Enabled); - break; - case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.Stride); - break; - case GL_EDGE_FLAG_ARRAY_COUNT_EXT: - params[0] = (GLfloat)(0); - break; - case GL_MAX_TEXTURE_UNITS_ARB: - CHECK_EXT1(ARB_multitexture, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureUnits); - break; - case GL_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetFloatv"); - params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit); - break; - case GL_CLIENT_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetFloatv"); - params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture); - break; - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)); - break; - case GL_TEXTURE_BINDING_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name); - break; - case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); - params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1))); - break; - case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); - params[0] = (GLfloat)(ctx->Hint.TextureCompression); - break; - case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); - params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); - break; - case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); - { - GLint formats[100]; - GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); - ASSERT(n <= 100); - for (i = 0; i < n; i++) - params[i] = ENUM_TO_FLOAT(formats[i]); - } - break; - case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.LockFirst); - break; - case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.LockCount); - break; - case GL_TRANSPOSE_COLOR_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[4]; - params[2] = matrix[8]; - params[3] = matrix[12]; - params[4] = matrix[1]; - params[5] = matrix[5]; - params[6] = matrix[9]; - params[7] = matrix[13]; - params[8] = matrix[2]; - params[9] = matrix[6]; - params[10] = matrix[10]; - params[11] = matrix[14]; - params[12] = matrix[3]; - params[13] = matrix[7]; - params[14] = matrix[11]; - params[15] = matrix[15]; - } - break; - case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[4]; - params[2] = matrix[8]; - params[3] = matrix[12]; - params[4] = matrix[1]; - params[5] = matrix[5]; - params[6] = matrix[9]; - params[7] = matrix[13]; - params[8] = matrix[2]; - params[9] = matrix[6]; - params[10] = matrix[10]; - params[11] = matrix[14]; - params[12] = matrix[3]; - params[13] = matrix[7]; - params[14] = matrix[11]; - params[15] = matrix[15]; - } - break; - case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[4]; - params[2] = matrix[8]; - params[3] = matrix[12]; - params[4] = matrix[1]; - params[5] = matrix[5]; - params[6] = matrix[9]; - params[7] = matrix[13]; - params[8] = matrix[2]; - params[9] = matrix[6]; - params[10] = matrix[10]; - params[11] = matrix[14]; - params[12] = matrix[3]; - params[13] = matrix[7]; - params[14] = matrix[11]; - params[15] = matrix[15]; - } - break; - case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = matrix[0]; - params[1] = matrix[4]; - params[2] = matrix[8]; - params[3] = matrix[12]; - params[4] = matrix[1]; - params[5] = matrix[5]; - params[6] = matrix[9]; - params[7] = matrix[13]; - params[8] = matrix[2]; - params[9] = matrix[6]; - params[10] = matrix[10]; - params[11] = matrix[14]; - params[12] = matrix[3]; - params[13] = matrix[7]; - params[14] = matrix[11]; - params[15] = matrix[15]; - } - break; - case GL_COLOR_MATRIX_SGI: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; - case GL_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = (GLfloat)(ctx->ColorMatrixStack.Depth + 1); - break; - case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = (GLfloat)(MAX_COLOR_STACK_DEPTH); - break; - case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: - params[0] = ctx->Pixel.PostColorMatrixScale[0]; - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: - params[0] = ctx->Pixel.PostColorMatrixScale[1]; - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: - params[0] = ctx->Pixel.PostColorMatrixScale[2]; - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: - params[0] = ctx->Pixel.PostColorMatrixScale[3]; - break; - case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: - params[0] = ctx->Pixel.PostColorMatrixBias[0]; - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: - params[0] = ctx->Pixel.PostColorMatrixBias[1]; - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: - params[0] = ctx->Pixel.PostColorMatrixBias[2]; - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: - params[0] = ctx->Pixel.PostColorMatrixBias[3]; - break; - case GL_CONVOLUTION_1D_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution1DEnabled); - break; - case GL_CONVOLUTION_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution2DEnabled); - break; - case GL_SEPARABLE_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Separable2DEnabled); - break; - case GL_POST_CONVOLUTION_RED_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionScale[0]; - break; - case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionScale[1]; - break; - case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionScale[2]; - break; - case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionScale[3]; - break; - case GL_POST_CONVOLUTION_RED_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionBias[0]; - break; - case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionBias[1]; - break; - case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionBias[2]; - break; - case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetFloatv"); - params[0] = ctx->Pixel.PostConvolutionBias[3]; - break; - case GL_HISTOGRAM: - CHECK_EXT1(EXT_histogram, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.HistogramEnabled); - break; - case GL_MINMAX: - CHECK_EXT1(EXT_histogram, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MinMaxEnabled); - break; - case GL_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]); - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]); - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]); - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_texture_color_table, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled); - break; - case GL_COLOR_SUM_EXT: - CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.ColorSumEnabled); - break; - case GL_CURRENT_SECONDARY_COLOR_EXT: - CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]; - params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]; - params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]; - params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]; - } - break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Enabled); - break; - case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Type); - break; - case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Stride); - break; - case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Size); - break; - case GL_CURRENT_FOG_COORDINATE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; - } - break; - case GL_FOG_COORDINATE_ARRAY_EXT: - CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Enabled); - break; - case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Type); - break; - case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.Stride); - break; - case GL_FOG_COORDINATE_SOURCE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Fog.FogCoordinateSource); - break; - case GL_MAX_TEXTURE_LOD_BIAS_EXT: - CHECK_EXT1(EXT_texture_lod_bias, "GetFloatv"); - params[0] = ctx->Const.MaxTextureLodBias; - break; - case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: - CHECK_EXT1(EXT_texture_filter_anisotropic, "GetFloatv"); - params[0] = ctx->Const.MaxTextureMaxAnisotropy; - break; - case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled); - break; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage); - break; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne); - break; - case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage); - break; - case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = ctx->Multisample.SampleCoverageValue; - break; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert); - break; - case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers); - break; - case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); - params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples); - break; - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXT1(IBM_rasterpos_clip, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RasterPositionUnclipped); - break; - case GL_POINT_SPRITE_NV: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Point.PointSprite); - break; - case GL_POINT_SPRITE_R_MODE_NV: - CHECK_EXT1(NV_point_sprite, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteRMode); - break; - case GL_POINT_SPRITE_COORD_ORIGIN: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteOrigin); - break; - case GL_GENERATE_MIPMAP_HINT_SGIS: - CHECK_EXT1(SGIS_generate_mipmap, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Hint.GenerateMipmap); - break; - case GL_VERTEX_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = (GLfloat)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); - break; - case GL_VERTEX_ATTRIB_ARRAY0_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY1_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY2_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY3_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY5_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY6_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY7_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY8_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY9_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY10_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY11_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY12_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY13_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY14_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); - break; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[0]); - break; - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[1]); - break; - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[2]); - break; - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[3]); - break; - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[4]); - break; - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[5]); - break; - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[6]); - break; - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[7]); - break; - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[8]); - break; - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[9]); - break; - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[10]); - break; - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[11]); - break; - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[12]); - break; - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[13]); - break; - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[14]); - break; - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[15]); - break; - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXT1(NV_fragment_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); - break; - case GL_FRAGMENT_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); - break; - case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: - CHECK_EXT1(NV_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(MAX_NV_FRAGMENT_PROGRAM_PARAMS); - break; - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)); - break; - case GL_TEXTURE_BINDING_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name); - break; - case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureRectSize); - break; - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.TestTwoSide); - break; - case GL_ACTIVE_STENCIL_FACE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); - break; - case GL_MAX_SHININESS_NV: - CHECK_EXT1(NV_light_max_exponent, "GetFloatv"); - params[0] = ctx->Const.MaxShininess; - break; - case GL_MAX_SPOT_EXPONENT_NV: - CHECK_EXT1(NV_light_max_exponent, "GetFloatv"); - params[0] = ctx->Const.MaxSpotExponent; - break; - case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name); - break; - case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); - break; - case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name); - break; - case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name); - break; - case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name); - break; - case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); - break; - case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); - break; - case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); - break; - case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); - break; - case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name); - break; - case GL_PIXEL_PACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Pack.BufferObj->Name); - break; - case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Unpack.BufferObj->Name); - break; - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.Enabled); - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.PointSizeEnabled); - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.TwoSideEnabled); - break; - case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxProgramMatrixStackDepth); - break; - case GL_MAX_PROGRAM_MATRICES_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxProgramMatrices); - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->CurrentStack->Depth + 1); - break; - case GL_CURRENT_MATRIX_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetFloatv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; - case GL_TRANSPOSE_CURRENT_MATRIX_ARB: - CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetFloatv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = matrix[0]; - params[1] = matrix[4]; - params[2] = matrix[8]; - params[3] = matrix[12]; - params[4] = matrix[1]; - params[5] = matrix[5]; - params[6] = matrix[9]; - params[7] = matrix[13]; - params[8] = matrix[2]; - params[9] = matrix[6]; - params[10] = matrix[10]; - params[11] = matrix[14]; - params[12] = matrix[3]; - params[13] = matrix[7]; - params[14] = matrix[11]; - params[15] = matrix[15]; - } - break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs); - break; - case GL_PROGRAM_ERROR_POSITION_ARB: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Program.ErrorPos); - break; - case GL_FRAGMENT_PROGRAM_ARB: - CHECK_EXT1(ARB_fragment_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); - break; - case GL_MAX_TEXTURE_COORDS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureCoordUnits); - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureImageUnits); - break; - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.BoundsTest); - break; - case GL_DEPTH_BOUNDS_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv"); - params[0] = ctx->Depth.BoundsMin; - params[1] = ctx->Depth.BoundsMax; - break; - case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.CallbackEnabled); - break; - case GL_VERTEX_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.CallbackEnabled); - break; - case GL_FRAGMENT_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetFloatv"); - params[0] = (GLfloat)(ctx->FragmentProgram.CurrentPosition); - break; - case GL_VERTEX_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetFloatv"); - params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition); - break; - case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); - break; - case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; - params[0] = ENUM_TO_FLOAT(buffer); - } - break; - case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; - params[0] = ENUM_TO_FLOAT(buffer); - } - break; - case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; - params[0] = ENUM_TO_FLOAT(buffer); - } - break; - case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: - CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadType); - break; - case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: - CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadFormat); - break; - case GL_NUM_FRAGMENT_REGISTERS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(6); - break; - case GL_NUM_FRAGMENT_CONSTANTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(8); - break; - case GL_NUM_PASSES_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(2); - break; - case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(8); - break; - case GL_NUM_INSTRUCTIONS_TOTAL_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(16); - break; - case GL_COLOR_ALPHA_PAIRING_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(GL_TRUE); - break; - case GL_NUM_LOOPBACK_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(3); - break; - case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(3); - break; - case GL_STENCIL_BACK_FUNC: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[1]); - break; - case GL_STENCIL_BACK_VALUE_MASK: - params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]); - break; - case GL_STENCIL_BACK_WRITEMASK: - params[0] = (GLfloat)(ctx->Stencil.WriteMask[1]); - break; - case GL_STENCIL_BACK_REF: - params[0] = (GLfloat)(ctx->Stencil.Ref[1]); - break; - case GL_STENCIL_BACK_FAIL: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_PASS: - params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[1]); - break; - case GL_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->DrawBuffer->Name); - break; - case GL_RENDERBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0); - break; - case GL_MAX_COLOR_ATTACHMENTS_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxColorAttachments); - break; - case GL_MAX_RENDERBUFFER_SIZE_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxRenderbufferSize); - break; - case GL_READ_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_blit, "GetFloatv"); - params[0] = (GLfloat)(ctx->ReadBuffer->Name); - break; - case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.FragmentProgram.MaxUniformComponents); - break; - case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Hint.FragmentShaderDerivative); - break; - case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxUniformComponents); - break; - case GL_MAX_VARYING_FLOATS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxVarying * 4); - break; - case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxVertexTextureImageUnits); - break; - case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_COMBINED_TEXTURE_IMAGE_UNITS); - break; - case GL_CURRENT_PROGRAM: - CHECK_EXT1(ARB_shader_objects, "GetFloatv"); - params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); - break; - case GL_VERTEX_ARRAY_BINDING_APPLE: - CHECK_EXT1(APPLE_vertex_array_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.ArrayObj->Name); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); - } -} - -void GLAPIENTRY -_mesa_GetIntegerv( GLenum pname, GLint *params ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!params) - return; - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (ctx->Driver.GetIntegerv && - ctx->Driver.GetIntegerv(ctx, pname, params)) - return; - - switch (pname) { - case GL_ACCUM_RED_BITS: - params[0] = ctx->DrawBuffer->Visual.accumRedBits; - break; - case GL_ACCUM_GREEN_BITS: - params[0] = ctx->DrawBuffer->Visual.accumGreenBits; - break; - case GL_ACCUM_BLUE_BITS: - params[0] = ctx->DrawBuffer->Visual.accumBlueBits; - break; - case GL_ACCUM_ALPHA_BITS: - params[0] = ctx->DrawBuffer->Visual.accumAlphaBits; - break; - case GL_ACCUM_CLEAR_VALUE: - params[0] = FLOAT_TO_INT(ctx->Accum.ClearColor[0]); - params[1] = FLOAT_TO_INT(ctx->Accum.ClearColor[1]); - params[2] = FLOAT_TO_INT(ctx->Accum.ClearColor[2]); - params[3] = FLOAT_TO_INT(ctx->Accum.ClearColor[3]); - break; - case GL_ALPHA_BIAS: - params[0] = IROUND(ctx->Pixel.AlphaBias); - break; - case GL_ALPHA_BITS: - params[0] = ctx->DrawBuffer->Visual.alphaBits; - break; - case GL_ALPHA_SCALE: - params[0] = IROUND(ctx->Pixel.AlphaScale); - break; - case GL_ALPHA_TEST: - params[0] = BOOLEAN_TO_INT(ctx->Color.AlphaEnabled); - break; - case GL_ALPHA_TEST_FUNC: - params[0] = ENUM_TO_INT(ctx->Color.AlphaFunc); - break; - case GL_ALPHA_TEST_REF: - params[0] = FLOAT_TO_INT(ctx->Color.AlphaRef); - break; - case GL_ATTRIB_STACK_DEPTH: - params[0] = ctx->AttribStackDepth; - break; - case GL_AUTO_NORMAL: - params[0] = BOOLEAN_TO_INT(ctx->Eval.AutoNormal); - break; - case GL_AUX_BUFFERS: - params[0] = ctx->DrawBuffer->Visual.numAuxBuffers; - break; - case GL_BLEND: - params[0] = BOOLEAN_TO_INT(ctx->Color.BlendEnabled); - break; - case GL_BLEND_DST: - params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC: - params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_SRC_RGB_EXT: - params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB); - break; - case GL_BLEND_DST_RGB_EXT: - params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB); - break; - case GL_BLEND_SRC_ALPHA_EXT: - params[0] = ENUM_TO_INT(ctx->Color.BlendSrcA); - break; - case GL_BLEND_DST_ALPHA_EXT: - params[0] = ENUM_TO_INT(ctx->Color.BlendDstA); - break; - case GL_BLEND_EQUATION: - params[0] = ENUM_TO_INT(ctx->Color.BlendEquationRGB ); - break; - case GL_BLEND_EQUATION_ALPHA_EXT: - params[0] = ENUM_TO_INT(ctx->Color.BlendEquationA ); - break; - case GL_BLEND_COLOR_EXT: - params[0] = FLOAT_TO_INT(ctx->Color.BlendColor[0]); - params[1] = FLOAT_TO_INT(ctx->Color.BlendColor[1]); - params[2] = FLOAT_TO_INT(ctx->Color.BlendColor[2]); - params[3] = FLOAT_TO_INT(ctx->Color.BlendColor[3]); - break; - case GL_BLUE_BIAS: - params[0] = IROUND(ctx->Pixel.BlueBias); - break; - case GL_BLUE_BITS: - params[0] = ctx->DrawBuffer->Visual.blueBits; - break; - case GL_BLUE_SCALE: - params[0] = IROUND(ctx->Pixel.BlueScale); - break; - case GL_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = ctx->ClientAttribStackDepth; - break; - case GL_CLIP_PLANE0: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 0) & 1); - break; - case GL_CLIP_PLANE1: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 1) & 1); - break; - case GL_CLIP_PLANE2: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 2) & 1); - break; - case GL_CLIP_PLANE3: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 3) & 1); - break; - case GL_CLIP_PLANE4: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 4) & 1); - break; - case GL_CLIP_PLANE5: - params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 5) & 1); - break; - case GL_COLOR_CLEAR_VALUE: - params[0] = FLOAT_TO_INT(ctx->Color.ClearColor[0]); - params[1] = FLOAT_TO_INT(ctx->Color.ClearColor[1]); - params[2] = FLOAT_TO_INT(ctx->Color.ClearColor[2]); - params[3] = FLOAT_TO_INT(ctx->Color.ClearColor[3]); - break; - case GL_COLOR_MATERIAL: - params[0] = BOOLEAN_TO_INT(ctx->Light.ColorMaterialEnabled); - break; - case GL_COLOR_MATERIAL_FACE: - params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialFace); - break; - case GL_COLOR_MATERIAL_PARAMETER: - params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialMode); - break; - case GL_COLOR_WRITEMASK: - params[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0; - params[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0; - params[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0; - params[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0; - break; - case GL_CULL_FACE: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.CullFlag); - break; - case GL_CULL_FACE_MODE: - params[0] = ENUM_TO_INT(ctx->Polygon.CullFaceMode); - break; - case GL_CURRENT_COLOR: - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]); - params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]); - params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]); - params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]); - } - break; - case GL_CURRENT_INDEX: - { - FLUSH_CURRENT(ctx, 0); - params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]); - } - break; - case GL_CURRENT_NORMAL: - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]); - params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]); - params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]); - } - break; - case GL_CURRENT_RASTER_COLOR: - params[0] = FLOAT_TO_INT(ctx->Current.RasterColor[0]); - params[1] = FLOAT_TO_INT(ctx->Current.RasterColor[1]); - params[2] = FLOAT_TO_INT(ctx->Current.RasterColor[2]); - params[3] = FLOAT_TO_INT(ctx->Current.RasterColor[3]); - break; - case GL_CURRENT_RASTER_DISTANCE: - params[0] = IROUND(ctx->Current.RasterDistance); - break; - case GL_CURRENT_RASTER_INDEX: - params[0] = IROUND(ctx->Current.RasterIndex); - break; - case GL_CURRENT_RASTER_POSITION: - params[0] = IROUND(ctx->Current.RasterPos[0]); - params[1] = IROUND(ctx->Current.RasterPos[1]); - params[2] = IROUND(ctx->Current.RasterPos[2]); - params[3] = IROUND(ctx->Current.RasterPos[3]); - break; - case GL_CURRENT_RASTER_SECONDARY_COLOR: - params[0] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[0]); - params[1] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[1]); - params[2] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[2]); - params[3] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[3]); - break; - case GL_CURRENT_RASTER_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = IROUND(ctx->Current.RasterTexCoords[texUnit][0]); - params[1] = IROUND(ctx->Current.RasterTexCoords[texUnit][1]); - params[2] = IROUND(ctx->Current.RasterTexCoords[texUnit][2]); - params[3] = IROUND(ctx->Current.RasterTexCoords[texUnit][3]); - } - break; - case GL_CURRENT_RASTER_POSITION_VALID: - params[0] = BOOLEAN_TO_INT(ctx->Current.RasterPosValid); - break; - case GL_CURRENT_TEXTURE_COORDS: - { - const GLuint texUnit = ctx->Texture.CurrentUnit; - params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]); - params[1] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]); - params[2] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]); - params[3] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]); - } - break; - case GL_DEPTH_BIAS: - params[0] = IROUND(ctx->Pixel.DepthBias); - break; - case GL_DEPTH_BITS: - params[0] = ctx->DrawBuffer->Visual.depthBits; - break; - case GL_DEPTH_CLEAR_VALUE: - params[0] = FLOAT_TO_INT(((GLfloat) ctx->Depth.Clear)); - break; - case GL_DEPTH_FUNC: - params[0] = ENUM_TO_INT(ctx->Depth.Func); - break; - case GL_DEPTH_RANGE: - params[0] = FLOAT_TO_INT(ctx->Viewport.Near); - params[1] = FLOAT_TO_INT(ctx->Viewport.Far); - break; - case GL_DEPTH_SCALE: - params[0] = IROUND(ctx->Pixel.DepthScale); - break; - case GL_DEPTH_TEST: - params[0] = BOOLEAN_TO_INT(ctx->Depth.Test); - break; - case GL_DEPTH_WRITEMASK: - params[0] = BOOLEAN_TO_INT(ctx->Depth.Mask); - break; - case GL_DITHER: - params[0] = BOOLEAN_TO_INT(ctx->Color.DitherFlag); - break; - case GL_DOUBLEBUFFER: - params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.doubleBufferMode); - break; - case GL_DRAW_BUFFER: - params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_EDGE_FLAG: - { - FLUSH_CURRENT(ctx, 0); - params[0] = BOOLEAN_TO_INT((ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0)); - } - break; - case GL_FEEDBACK_BUFFER_SIZE: - params[0] = ctx->Feedback.BufferSize; - break; - case GL_FEEDBACK_BUFFER_TYPE: - params[0] = ENUM_TO_INT(ctx->Feedback.Type); - break; - case GL_FOG: - params[0] = BOOLEAN_TO_INT(ctx->Fog.Enabled); - break; - case GL_FOG_COLOR: - params[0] = FLOAT_TO_INT(ctx->Fog.Color[0]); - params[1] = FLOAT_TO_INT(ctx->Fog.Color[1]); - params[2] = FLOAT_TO_INT(ctx->Fog.Color[2]); - params[3] = FLOAT_TO_INT(ctx->Fog.Color[3]); - break; - case GL_FOG_DENSITY: - params[0] = IROUND(ctx->Fog.Density); - break; - case GL_FOG_END: - params[0] = IROUND(ctx->Fog.End); - break; - case GL_FOG_HINT: - params[0] = ENUM_TO_INT(ctx->Hint.Fog); - break; - case GL_FOG_INDEX: - params[0] = IROUND(ctx->Fog.Index); - break; - case GL_FOG_MODE: - params[0] = ENUM_TO_INT(ctx->Fog.Mode); - break; - case GL_FOG_START: - params[0] = IROUND(ctx->Fog.Start); - break; - case GL_FRONT_FACE: - params[0] = ENUM_TO_INT(ctx->Polygon.FrontFace); - break; - case GL_GREEN_BIAS: - params[0] = IROUND(ctx->Pixel.GreenBias); - break; - case GL_GREEN_BITS: - params[0] = ctx->DrawBuffer->Visual.greenBits; - break; - case GL_GREEN_SCALE: - params[0] = IROUND(ctx->Pixel.GreenScale); - break; - case GL_INDEX_BITS: - params[0] = ctx->DrawBuffer->Visual.indexBits; - break; - case GL_INDEX_CLEAR_VALUE: - params[0] = ctx->Color.ClearIndex; - break; - case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_INT(!ctx->DrawBuffer->Visual.rgbMode); - break; - case GL_INDEX_OFFSET: - params[0] = ctx->Pixel.IndexOffset; - break; - case GL_INDEX_SHIFT: - params[0] = ctx->Pixel.IndexShift; - break; - case GL_INDEX_WRITEMASK: - params[0] = ctx->Color.IndexMask; - break; - case GL_LIGHT0: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[0].Enabled); - break; - case GL_LIGHT1: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[1].Enabled); - break; - case GL_LIGHT2: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[2].Enabled); - break; - case GL_LIGHT3: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[3].Enabled); - break; - case GL_LIGHT4: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[4].Enabled); - break; - case GL_LIGHT5: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[5].Enabled); - break; - case GL_LIGHT6: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[6].Enabled); - break; - case GL_LIGHT7: - params[0] = BOOLEAN_TO_INT(ctx->Light.Light[7].Enabled); - break; - case GL_LIGHTING: - params[0] = BOOLEAN_TO_INT(ctx->Light.Enabled); - break; - case GL_LIGHT_MODEL_AMBIENT: - params[0] = FLOAT_TO_INT(ctx->Light.Model.Ambient[0]); - params[1] = FLOAT_TO_INT(ctx->Light.Model.Ambient[1]); - params[2] = FLOAT_TO_INT(ctx->Light.Model.Ambient[2]); - params[3] = FLOAT_TO_INT(ctx->Light.Model.Ambient[3]); - break; - case GL_LIGHT_MODEL_COLOR_CONTROL: - params[0] = ENUM_TO_INT(ctx->Light.Model.ColorControl); - break; - case GL_LIGHT_MODEL_LOCAL_VIEWER: - params[0] = BOOLEAN_TO_INT(ctx->Light.Model.LocalViewer); - break; - case GL_LIGHT_MODEL_TWO_SIDE: - params[0] = BOOLEAN_TO_INT(ctx->Light.Model.TwoSide); - break; - case GL_LINE_SMOOTH: - params[0] = BOOLEAN_TO_INT(ctx->Line.SmoothFlag); - break; - case GL_LINE_SMOOTH_HINT: - params[0] = ENUM_TO_INT(ctx->Hint.LineSmooth); - break; - case GL_LINE_STIPPLE: - params[0] = BOOLEAN_TO_INT(ctx->Line.StippleFlag); - break; - case GL_LINE_STIPPLE_PATTERN: - params[0] = ctx->Line.StipplePattern; - break; - case GL_LINE_STIPPLE_REPEAT: - params[0] = ctx->Line.StippleFactor; - break; - case GL_LINE_WIDTH: - params[0] = IROUND(ctx->Line.Width); - break; - case GL_LINE_WIDTH_GRANULARITY: - params[0] = IROUND(ctx->Const.LineWidthGranularity); - break; - case GL_LINE_WIDTH_RANGE: - params[0] = IROUND(ctx->Const.MinLineWidthAA); - params[1] = IROUND(ctx->Const.MaxLineWidthAA); - break; - case GL_ALIASED_LINE_WIDTH_RANGE: - params[0] = IROUND(ctx->Const.MinLineWidth); - params[1] = IROUND(ctx->Const.MaxLineWidth); - break; - case GL_LIST_BASE: - params[0] = ctx->List.ListBase; - break; - case GL_LIST_INDEX: - params[0] = ctx->ListState.CurrentListNum; - break; - case GL_LIST_MODE: - { - GLenum mode; - if (!ctx->CompileFlag) - mode = 0; - else if (ctx->ExecuteFlag) - mode = GL_COMPILE_AND_EXECUTE; - else - mode = GL_COMPILE; - params[0] = ENUM_TO_INT(mode); - } - break; - case GL_INDEX_LOGIC_OP: - params[0] = BOOLEAN_TO_INT(ctx->Color.IndexLogicOpEnabled); - break; - case GL_COLOR_LOGIC_OP: - params[0] = BOOLEAN_TO_INT(ctx->Color.ColorLogicOpEnabled); - break; - case GL_LOGIC_OP_MODE: - params[0] = ENUM_TO_INT(ctx->Color.LogicOp); - break; - case GL_MAP1_COLOR_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Color4); - break; - case GL_MAP1_GRID_DOMAIN: - params[0] = IROUND(ctx->Eval.MapGrid1u1); - params[1] = IROUND(ctx->Eval.MapGrid1u2); - break; - case GL_MAP1_GRID_SEGMENTS: - params[0] = ctx->Eval.MapGrid1un; - break; - case GL_MAP1_INDEX: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Index); - break; - case GL_MAP1_NORMAL: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Normal); - break; - case GL_MAP1_TEXTURE_COORD_1: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord1); - break; - case GL_MAP1_TEXTURE_COORD_2: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord2); - break; - case GL_MAP1_TEXTURE_COORD_3: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord3); - break; - case GL_MAP1_TEXTURE_COORD_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord4); - break; - case GL_MAP1_VERTEX_3: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex3); - break; - case GL_MAP1_VERTEX_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex4); - break; - case GL_MAP2_COLOR_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Color4); - break; - case GL_MAP2_GRID_DOMAIN: - params[0] = IROUND(ctx->Eval.MapGrid2u1); - params[1] = IROUND(ctx->Eval.MapGrid2u2); - params[2] = IROUND(ctx->Eval.MapGrid2v1); - params[3] = IROUND(ctx->Eval.MapGrid2v2); - break; - case GL_MAP2_GRID_SEGMENTS: - params[0] = ctx->Eval.MapGrid2un; - params[1] = ctx->Eval.MapGrid2vn; - break; - case GL_MAP2_INDEX: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Index); - break; - case GL_MAP2_NORMAL: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Normal); - break; - case GL_MAP2_TEXTURE_COORD_1: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord1); - break; - case GL_MAP2_TEXTURE_COORD_2: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord2); - break; - case GL_MAP2_TEXTURE_COORD_3: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord3); - break; - case GL_MAP2_TEXTURE_COORD_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord4); - break; - case GL_MAP2_VERTEX_3: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex3); - break; - case GL_MAP2_VERTEX_4: - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex4); - break; - case GL_MAP_COLOR: - params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapColorFlag); - break; - case GL_MAP_STENCIL: - params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapStencilFlag); - break; - case GL_MATRIX_MODE: - params[0] = ENUM_TO_INT(ctx->Transform.MatrixMode); - break; - case GL_MAX_ATTRIB_STACK_DEPTH: - params[0] = MAX_ATTRIB_STACK_DEPTH; - break; - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH; - break; - case GL_MAX_CLIP_PLANES: - params[0] = ctx->Const.MaxClipPlanes; - break; - case GL_MAX_ELEMENTS_VERTICES: - params[0] = ctx->Const.MaxArrayLockSize; - break; - case GL_MAX_ELEMENTS_INDICES: - params[0] = ctx->Const.MaxArrayLockSize; - break; - case GL_MAX_EVAL_ORDER: - params[0] = MAX_EVAL_ORDER; - break; - case GL_MAX_LIGHTS: - params[0] = ctx->Const.MaxLights; - break; - case GL_MAX_LIST_NESTING: - params[0] = MAX_LIST_NESTING; - break; - case GL_MAX_MODELVIEW_STACK_DEPTH: - params[0] = MAX_MODELVIEW_STACK_DEPTH; - break; - case GL_MAX_NAME_STACK_DEPTH: - params[0] = MAX_NAME_STACK_DEPTH; - break; - case GL_MAX_PIXEL_MAP_TABLE: - params[0] = MAX_PIXEL_MAP_TABLE; - break; - case GL_MAX_PROJECTION_STACK_DEPTH: - params[0] = MAX_PROJECTION_STACK_DEPTH; - break; - case GL_MAX_TEXTURE_SIZE: - params[0] = 1 << (ctx->Const.MaxTextureLevels - 1); - break; - case GL_MAX_3D_TEXTURE_SIZE: - params[0] = 1 << (ctx->Const.Max3DTextureLevels - 1); - break; - case GL_MAX_TEXTURE_STACK_DEPTH: - params[0] = MAX_TEXTURE_STACK_DEPTH; - break; - case GL_MAX_VIEWPORT_DIMS: - params[0] = ctx->Const.MaxViewportWidth; - params[1] = ctx->Const.MaxViewportHeight; - break; - case GL_MODELVIEW_MATRIX: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_MODELVIEW_STACK_DEPTH: - params[0] = ctx->ModelviewMatrixStack.Depth + 1; - break; - case GL_NAME_STACK_DEPTH: - params[0] = ctx->Select.NameStackDepth; - break; - case GL_NORMALIZE: - params[0] = BOOLEAN_TO_INT(ctx->Transform.Normalize); - break; - case GL_PACK_ALIGNMENT: - params[0] = ctx->Pack.Alignment; - break; - case GL_PACK_LSB_FIRST: - params[0] = BOOLEAN_TO_INT(ctx->Pack.LsbFirst); - break; - case GL_PACK_ROW_LENGTH: - params[0] = ctx->Pack.RowLength; - break; - case GL_PACK_SKIP_PIXELS: - params[0] = ctx->Pack.SkipPixels; - break; - case GL_PACK_SKIP_ROWS: - params[0] = ctx->Pack.SkipRows; - break; - case GL_PACK_SWAP_BYTES: - params[0] = BOOLEAN_TO_INT(ctx->Pack.SwapBytes); - break; - case GL_PACK_SKIP_IMAGES_EXT: - params[0] = ctx->Pack.SkipImages; - break; - case GL_PACK_IMAGE_HEIGHT_EXT: - params[0] = ctx->Pack.ImageHeight; - break; - case GL_PACK_INVERT_MESA: - params[0] = BOOLEAN_TO_INT(ctx->Pack.Invert); - break; - case GL_PERSPECTIVE_CORRECTION_HINT: - params[0] = ENUM_TO_INT(ctx->Hint.PerspectiveCorrection); - break; - case GL_PIXEL_MAP_A_TO_A_SIZE: - params[0] = ctx->PixelMaps.AtoA.Size; - break; - case GL_PIXEL_MAP_B_TO_B_SIZE: - params[0] = ctx->PixelMaps.BtoB.Size; - break; - case GL_PIXEL_MAP_G_TO_G_SIZE: - params[0] = ctx->PixelMaps.GtoG.Size; - break; - case GL_PIXEL_MAP_I_TO_A_SIZE: - params[0] = ctx->PixelMaps.ItoA.Size; - break; - case GL_PIXEL_MAP_I_TO_B_SIZE: - params[0] = ctx->PixelMaps.ItoB.Size; - break; - case GL_PIXEL_MAP_I_TO_G_SIZE: - params[0] = ctx->PixelMaps.ItoG.Size; - break; - case GL_PIXEL_MAP_I_TO_I_SIZE: - params[0] = ctx->PixelMaps.ItoI.Size; - break; - case GL_PIXEL_MAP_I_TO_R_SIZE: - params[0] = ctx->PixelMaps.ItoR.Size; - break; - case GL_PIXEL_MAP_R_TO_R_SIZE: - params[0] = ctx->PixelMaps.RtoR.Size; - break; - case GL_PIXEL_MAP_S_TO_S_SIZE: - params[0] = ctx->PixelMaps.StoS.Size; - break; - case GL_POINT_SIZE: - params[0] = IROUND(ctx->Point.Size); - break; - case GL_POINT_SIZE_GRANULARITY: - params[0] = IROUND(ctx->Const.PointSizeGranularity); - break; - case GL_POINT_SIZE_RANGE: - params[0] = IROUND(ctx->Const.MinPointSizeAA); - params[1] = IROUND(ctx->Const.MaxPointSizeAA); - break; - case GL_ALIASED_POINT_SIZE_RANGE: - params[0] = IROUND(ctx->Const.MinPointSize); - params[1] = IROUND(ctx->Const.MaxPointSize); - break; - case GL_POINT_SMOOTH: - params[0] = BOOLEAN_TO_INT(ctx->Point.SmoothFlag); - break; - case GL_POINT_SMOOTH_HINT: - params[0] = ENUM_TO_INT(ctx->Hint.PointSmooth); - break; - case GL_POINT_SIZE_MIN_EXT: - params[0] = IROUND(ctx->Point.MinSize); - break; - case GL_POINT_SIZE_MAX_EXT: - params[0] = IROUND(ctx->Point.MaxSize); - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - params[0] = IROUND(ctx->Point.Threshold); - break; - case GL_DISTANCE_ATTENUATION_EXT: - params[0] = IROUND(ctx->Point.Params[0]); - params[1] = IROUND(ctx->Point.Params[1]); - params[2] = IROUND(ctx->Point.Params[2]); - break; - case GL_POLYGON_MODE: - params[0] = ENUM_TO_INT(ctx->Polygon.FrontMode); - params[1] = ENUM_TO_INT(ctx->Polygon.BackMode); - break; - case GL_POLYGON_OFFSET_BIAS_EXT: - params[0] = IROUND(ctx->Polygon.OffsetUnits); - break; - case GL_POLYGON_OFFSET_FACTOR: - params[0] = IROUND(ctx->Polygon.OffsetFactor ); - break; - case GL_POLYGON_OFFSET_UNITS: - params[0] = IROUND(ctx->Polygon.OffsetUnits ); - break; - case GL_POLYGON_OFFSET_POINT: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetPoint); - break; - case GL_POLYGON_OFFSET_LINE: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetLine); - break; - case GL_POLYGON_OFFSET_FILL: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetFill); - break; - case GL_POLYGON_SMOOTH: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.SmoothFlag); - break; - case GL_POLYGON_SMOOTH_HINT: - params[0] = ENUM_TO_INT(ctx->Hint.PolygonSmooth); - break; - case GL_POLYGON_STIPPLE: - params[0] = BOOLEAN_TO_INT(ctx->Polygon.StippleFlag); - break; - case GL_PROJECTION_MATRIX: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_PROJECTION_STACK_DEPTH: - params[0] = ctx->ProjectionMatrixStack.Depth + 1; - break; - case GL_READ_BUFFER: - params[0] = ENUM_TO_INT(ctx->ReadBuffer->ColorReadBuffer); - break; - case GL_RED_BIAS: - params[0] = IROUND(ctx->Pixel.RedBias); - break; - case GL_RED_BITS: - params[0] = ctx->DrawBuffer->Visual.redBits; - break; - case GL_RED_SCALE: - params[0] = IROUND(ctx->Pixel.RedScale); - break; - case GL_RENDER_MODE: - params[0] = ENUM_TO_INT(ctx->RenderMode); - break; - case GL_RESCALE_NORMAL: - params[0] = BOOLEAN_TO_INT(ctx->Transform.RescaleNormals); - break; - case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.rgbMode); - break; - case GL_SCISSOR_BOX: - params[0] = ctx->Scissor.X; - params[1] = ctx->Scissor.Y; - params[2] = ctx->Scissor.Width; - params[3] = ctx->Scissor.Height; - break; - case GL_SCISSOR_TEST: - params[0] = BOOLEAN_TO_INT(ctx->Scissor.Enabled); - break; - case GL_SELECTION_BUFFER_SIZE: - params[0] = ctx->Select.BufferSize; - break; - case GL_SHADE_MODEL: - params[0] = ENUM_TO_INT(ctx->Light.ShadeModel); - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - params[0] = BOOLEAN_TO_INT(ctx->Texture.SharedPalette); - break; - case GL_STENCIL_BITS: - params[0] = ctx->DrawBuffer->Visual.stencilBits; - break; - case GL_STENCIL_CLEAR_VALUE: - params[0] = ctx->Stencil.Clear; - break; - case GL_STENCIL_FAIL: - params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_FUNC: - params[0] = ENUM_TO_INT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_PASS_DEPTH_PASS: - params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); - break; - case GL_STENCIL_REF: - params[0] = ctx->Stencil.Ref[ctx->Stencil.ActiveFace]; - break; - case GL_STENCIL_TEST: - params[0] = BOOLEAN_TO_INT(ctx->Stencil.Enabled); - break; - case GL_STENCIL_VALUE_MASK: - params[0] = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]; - break; - case GL_STENCIL_WRITEMASK: - params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]; - break; - case GL_STEREO: - params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.stereoMode); - break; - case GL_SUBPIXEL_BITS: - params[0] = ctx->Const.SubPixelBits; - break; - case GL_TEXTURE_1D: - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D)); - break; - case GL_TEXTURE_2D: - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D)); - break; - case GL_TEXTURE_3D: - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D)); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)); - break; - case GL_TEXTURE_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)); - break; - case GL_TEXTURE_BINDING_1D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name; - break; - case GL_TEXTURE_BINDING_2D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name; - break; - case GL_TEXTURE_BINDING_3D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name; - break; - case GL_TEXTURE_BINDING_1D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name; - break; - case GL_TEXTURE_BINDING_2D_ARRAY_EXT: - CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name; - break; - case GL_TEXTURE_GEN_S: - params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_T: - params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_R: - params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_GEN_Q: - params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)); - break; - case GL_TEXTURE_MATRIX: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_TEXTURE_STACK_DEPTH: - params[0] = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1; - break; - case GL_UNPACK_ALIGNMENT: - params[0] = ctx->Unpack.Alignment; - break; - case GL_UNPACK_LSB_FIRST: - params[0] = BOOLEAN_TO_INT(ctx->Unpack.LsbFirst); - break; - case GL_UNPACK_ROW_LENGTH: - params[0] = ctx->Unpack.RowLength; - break; - case GL_UNPACK_SKIP_PIXELS: - params[0] = ctx->Unpack.SkipPixels; - break; - case GL_UNPACK_SKIP_ROWS: - params[0] = ctx->Unpack.SkipRows; - break; - case GL_UNPACK_SWAP_BYTES: - params[0] = BOOLEAN_TO_INT(ctx->Unpack.SwapBytes); - break; - case GL_UNPACK_SKIP_IMAGES_EXT: - params[0] = ctx->Unpack.SkipImages; - break; - case GL_UNPACK_IMAGE_HEIGHT_EXT: - params[0] = ctx->Unpack.ImageHeight; - break; - case GL_UNPACK_CLIENT_STORAGE_APPLE: - params[0] = BOOLEAN_TO_INT(ctx->Unpack.ClientStorage); - break; - case GL_VIEWPORT: - params[0] = ctx->Viewport.X; - params[1] = ctx->Viewport.Y; - params[2] = ctx->Viewport.Width; - params[3] = ctx->Viewport.Height; - break; - case GL_ZOOM_X: - params[0] = IROUND(ctx->Pixel.ZoomX); - break; - case GL_ZOOM_Y: - params[0] = IROUND(ctx->Pixel.ZoomY); - break; - case GL_VERTEX_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Vertex.Enabled); - break; - case GL_VERTEX_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->Vertex.Size; - break; - case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Vertex.Type); - break; - case GL_VERTEX_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Vertex.Stride; - break; - case GL_VERTEX_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Enabled); - break; - case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Type); - break; - case GL_NORMAL_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Normal.Stride; - break; - case GL_NORMAL_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_COLOR_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Color.Enabled); - break; - case GL_COLOR_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->Color.Size; - break; - case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Color.Type); - break; - case GL_COLOR_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Color.Stride; - break; - case GL_COLOR_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_INDEX_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Index.Enabled); - break; - case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Index.Type); - break; - case GL_INDEX_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Index.Stride; - break; - case GL_INDEX_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_TEXTURE_COORD_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); - break; - case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size; - break; - case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); - break; - case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride; - break; - case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_EDGE_FLAG_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->EdgeFlag.Enabled); - break; - case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride; - break; - case GL_EDGE_FLAG_ARRAY_COUNT_EXT: - params[0] = 0; - break; - case GL_MAX_TEXTURE_UNITS_ARB: - CHECK_EXT1(ARB_multitexture, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureUnits; - break; - case GL_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetIntegerv"); - params[0] = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit; - break; - case GL_CLIENT_ACTIVE_TEXTURE_ARB: - CHECK_EXT1(ARB_multitexture, "GetIntegerv"); - params[0] = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture; - break; - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)); - break; - case GL_TEXTURE_BINDING_CUBE_MAP_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name; - break; - case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: - CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); - params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1)); - break; - case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); - params[0] = ctx->Hint.TextureCompression; - break; - case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); - params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); - break; - case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); - { - GLint formats[100]; - GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); - ASSERT(n <= 100); - for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]); - } - break; - case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv"); - params[0] = ctx->Array.LockFirst; - break; - case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: - CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv"); - params[0] = ctx->Array.LockCount; - break; - case GL_TRANSPOSE_COLOR_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[4]); - params[2] = IROUND(matrix[8]); - params[3] = IROUND(matrix[12]); - params[4] = IROUND(matrix[1]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[9]); - params[7] = IROUND(matrix[13]); - params[8] = IROUND(matrix[2]); - params[9] = IROUND(matrix[6]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[14]); - params[12] = IROUND(matrix[3]); - params[13] = IROUND(matrix[7]); - params[14] = IROUND(matrix[11]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[4]); - params[2] = IROUND(matrix[8]); - params[3] = IROUND(matrix[12]); - params[4] = IROUND(matrix[1]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[9]); - params[7] = IROUND(matrix[13]); - params[8] = IROUND(matrix[2]); - params[9] = IROUND(matrix[6]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[14]); - params[12] = IROUND(matrix[3]); - params[13] = IROUND(matrix[7]); - params[14] = IROUND(matrix[11]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: - { - const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[4]); - params[2] = IROUND(matrix[8]); - params[3] = IROUND(matrix[12]); - params[4] = IROUND(matrix[1]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[9]); - params[7] = IROUND(matrix[13]); - params[8] = IROUND(matrix[2]); - params[9] = IROUND(matrix[6]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[14]); - params[12] = IROUND(matrix[3]); - params[13] = IROUND(matrix[7]); - params[14] = IROUND(matrix[11]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: - { - const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[4]); - params[2] = IROUND(matrix[8]); - params[3] = IROUND(matrix[12]); - params[4] = IROUND(matrix[1]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[9]); - params[7] = IROUND(matrix[13]); - params[8] = IROUND(matrix[2]); - params[9] = IROUND(matrix[6]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[14]); - params[12] = IROUND(matrix[3]); - params[13] = IROUND(matrix[7]); - params[14] = IROUND(matrix[11]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_COLOR_MATRIX_SGI: - { - const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = ctx->ColorMatrixStack.Depth + 1; - break; - case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = MAX_COLOR_STACK_DEPTH; - break; - case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[0]); - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[1]); - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[2]); - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[3]); - break; - case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[0]); - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[1]); - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[2]); - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: - params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[3]); - break; - case GL_CONVOLUTION_1D_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution1DEnabled); - break; - case GL_CONVOLUTION_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution2DEnabled); - break; - case GL_SEPARABLE_2D_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.Separable2DEnabled); - break; - case GL_POST_CONVOLUTION_RED_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionScale[0]); - break; - case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionScale[1]); - break; - case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionScale[2]); - break; - case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionScale[3]); - break; - case GL_POST_CONVOLUTION_RED_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionBias[0]); - break; - case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionBias[1]); - break; - case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionBias[2]); - break; - case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: - CHECK_EXT1(EXT_convolution, "GetIntegerv"); - params[0] = IROUND(ctx->Pixel.PostConvolutionBias[3]); - break; - case GL_HISTOGRAM: - CHECK_EXT1(EXT_histogram, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.HistogramEnabled); - break; - case GL_MINMAX: - CHECK_EXT1(EXT_histogram, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.MinMaxEnabled); - break; - case GL_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]); - break; - case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]); - break; - case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_color_table, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]); - break; - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXT1(SGI_texture_color_table, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled); - break; - case GL_COLOR_SUM_EXT: - CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Fog.ColorSumEnabled); - break; - case GL_CURRENT_SECONDARY_COLOR_EXT: - CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]); - params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]); - params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]); - params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]); - } - break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Enabled); - break; - case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Type); - break; - case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride; - break; - case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: - CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.Size; - break; - case GL_CURRENT_FOG_COORDINATE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - { - FLUSH_CURRENT(ctx, 0); - params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]); - } - break; - case GL_FOG_COORDINATE_ARRAY_EXT: - CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->FogCoord.Enabled); - break; - case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->FogCoord.Type); - break; - case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->FogCoord.Stride; - break; - case GL_FOG_COORDINATE_SOURCE_EXT: - CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Fog.FogCoordinateSource); - break; - case GL_MAX_TEXTURE_LOD_BIAS_EXT: - CHECK_EXT1(EXT_texture_lod_bias, "GetIntegerv"); - params[0] = IROUND(ctx->Const.MaxTextureLodBias); - break; - case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: - CHECK_EXT1(EXT_texture_filter_anisotropic, "GetIntegerv"); - params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy); - break; - case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled); - break; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage); - break; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne); - break; - case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage); - break; - case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = IROUND(ctx->Multisample.SampleCoverageValue); - break; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert); - break; - case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = ctx->DrawBuffer->Visual.sampleBuffers; - break; - case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); - params[0] = ctx->DrawBuffer->Visual.samples; - break; - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXT1(IBM_rasterpos_clip, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Transform.RasterPositionUnclipped); - break; - case GL_POINT_SPRITE_NV: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Point.PointSprite); - break; - case GL_POINT_SPRITE_R_MODE_NV: - CHECK_EXT1(NV_point_sprite, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Point.SpriteRMode); - break; - case GL_POINT_SPRITE_COORD_ORIGIN: - CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Point.SpriteOrigin); - break; - case GL_GENERATE_MIPMAP_HINT_SGIS: - CHECK_EXT1(SGIS_generate_mipmap, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Hint.GenerateMipmap); - break; - case GL_VERTEX_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0); - break; - case GL_VERTEX_ATTRIB_ARRAY0_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY1_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY2_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY3_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY5_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY6_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY7_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY8_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY9_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY10_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY11_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY12_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY13_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY14_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); - break; - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); - break; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[0]); - break; - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[1]); - break; - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[2]); - break; - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[3]); - break; - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[4]); - break; - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[5]); - break; - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[6]); - break; - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[7]); - break; - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[8]); - break; - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[9]); - break; - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[10]); - break; - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[11]); - break; - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[12]); - break; - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[13]); - break; - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[14]); - break; - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[15]); - break; - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXT1(NV_fragment_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); - break; - case GL_FRAGMENT_PROGRAM_BINDING_NV: - CHECK_EXT1(NV_fragment_program, "GetIntegerv"); - params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; - break; - case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: - CHECK_EXT1(NV_fragment_program, "GetIntegerv"); - params[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS; - break; - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)); - break; - case GL_TEXTURE_BINDING_RECTANGLE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name; - break; - case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: - CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureRectSize; - break; - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Stencil.TestTwoSide); - break; - case GL_ACTIVE_STENCIL_FACE_EXT: - CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); - break; - case GL_MAX_SHININESS_NV: - CHECK_EXT1(NV_light_max_exponent, "GetIntegerv"); - params[0] = IROUND(ctx->Const.MaxShininess); - break; - case GL_MAX_SPOT_EXPONENT_NV: - CHECK_EXT1(NV_light_max_exponent, "GetIntegerv"); - params[0] = IROUND(ctx->Const.MaxSpotExponent); - break; - case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayBufferObj->Name; - break; - case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; - break; - case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; - break; - case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; - break; - case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; - break; - case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; - break; - case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; - break; - case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; - break; - case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; - break; - case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.ElementArrayBufferObj->Name; - break; - case GL_PIXEL_PACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv"); - params[0] = ctx->Pack.BufferObj->Name; - break; - case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: - CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv"); - params[0] = ctx->Unpack.BufferObj->Name; - break; - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.Enabled); - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.PointSizeEnabled); - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.TwoSideEnabled); - break; - case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); - params[0] = ctx->Const.MaxProgramMatrixStackDepth; - break; - case GL_MAX_PROGRAM_MATRICES_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); - params[0] = ctx->Const.MaxProgramMatrices; - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->CurrentStack->Depth + 1); - break; - case GL_CURRENT_MATRIX_ARB: - CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetIntegerv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_TRANSPOSE_CURRENT_MATRIX_ARB: - CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[4]); - params[2] = IROUND(matrix[8]); - params[3] = IROUND(matrix[12]); - params[4] = IROUND(matrix[1]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[9]); - params[7] = IROUND(matrix[13]); - params[8] = IROUND(matrix[2]); - params[9] = IROUND(matrix[6]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[14]); - params[12] = IROUND(matrix[3]); - params[13] = IROUND(matrix[7]); - params[14] = IROUND(matrix[11]); - params[15] = IROUND(matrix[15]); - } - break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetIntegerv"); - params[0] = ctx->Const.VertexProgram.MaxAttribs; - break; - case GL_PROGRAM_ERROR_POSITION_ARB: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Program.ErrorPos; - break; - case GL_FRAGMENT_PROGRAM_ARB: - CHECK_EXT1(ARB_fragment_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); - break; - case GL_MAX_TEXTURE_COORDS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureCoordUnits; - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureImageUnits; - break; - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Depth.BoundsTest); - break; - case GL_DEPTH_BOUNDS_EXT: - CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv"); - params[0] = IROUND(ctx->Depth.BoundsMin); - params[1] = IROUND(ctx->Depth.BoundsMax); - break; - case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.CallbackEnabled); - break; - case GL_VERTEX_PROGRAM_CALLBACK_MESA: - CHECK_EXT1(MESA_program_debug, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.CallbackEnabled); - break; - case GL_FRAGMENT_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetIntegerv"); - params[0] = ctx->FragmentProgram.CurrentPosition; - break; - case GL_VERTEX_PROGRAM_POSITION_MESA: - CHECK_EXT1(MESA_program_debug, "GetIntegerv"); - params[0] = ctx->VertexProgram.CurrentPosition; - break; - case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); - params[0] = ctx->Const.MaxDrawBuffers; - break; - case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); - break; - case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; - params[0] = ENUM_TO_INT(buffer); - } - break; - case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; - params[0] = ENUM_TO_INT(buffer); - } - break; - case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); - { - GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; - params[0] = ENUM_TO_INT(buffer); - } - break; - case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: - CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadType; - break; - case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: - CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadFormat; - break; - case GL_NUM_FRAGMENT_REGISTERS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 6; - break; - case GL_NUM_FRAGMENT_CONSTANTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 8; - break; - case GL_NUM_PASSES_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 2; - break; - case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 8; - break; - case GL_NUM_INSTRUCTIONS_TOTAL_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 16; - break; - case GL_COLOR_ALPHA_PAIRING_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(GL_TRUE); - break; - case GL_NUM_LOOPBACK_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 3; - break; - case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: - CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); - params[0] = 3; - break; - case GL_STENCIL_BACK_FUNC: - params[0] = ENUM_TO_INT(ctx->Stencil.Function[1]); - break; - case GL_STENCIL_BACK_VALUE_MASK: - params[0] = ctx->Stencil.ValueMask[1]; - break; - case GL_STENCIL_BACK_WRITEMASK: - params[0] = ctx->Stencil.WriteMask[1]; - break; - case GL_STENCIL_BACK_REF: - params[0] = ctx->Stencil.Ref[1]; - break; - case GL_STENCIL_BACK_FAIL: - params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_FAIL: - params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[1]); - break; - case GL_STENCIL_BACK_PASS_DEPTH_PASS: - params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[1]); - break; - case GL_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); - params[0] = ctx->DrawBuffer->Name; - break; - case GL_RENDERBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); - params[0] = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0; - break; - case GL_MAX_COLOR_ATTACHMENTS_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); - params[0] = ctx->Const.MaxColorAttachments; - break; - case GL_MAX_RENDERBUFFER_SIZE_EXT: - CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); - params[0] = ctx->Const.MaxRenderbufferSize; - break; - case GL_READ_FRAMEBUFFER_BINDING_EXT: - CHECK_EXT1(EXT_framebuffer_blit, "GetIntegerv"); - params[0] = ctx->ReadBuffer->Name; - break; - case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); - params[0] = ctx->Const.FragmentProgram.MaxUniformComponents; - break; - case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: - CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Hint.FragmentShaderDerivative); - break; - case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = ctx->Const.VertexProgram.MaxUniformComponents; - break; - case GL_MAX_VARYING_FLOATS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = ctx->Const.MaxVarying * 4; - break; - case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = ctx->Const.MaxVertexTextureImageUnits; - break; - case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: - CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS; - break; - case GL_CURRENT_PROGRAM: - CHECK_EXT1(ARB_shader_objects, "GetIntegerv"); - params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0; - break; - case GL_VERTEX_ARRAY_BINDING_APPLE: - CHECK_EXT1(APPLE_vertex_array_object, "GetIntegerv"); - params[0] = ctx->Array.ArrayObj->Name; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); - } -} - - -void GLAPIENTRY -_mesa_GetDoublev( GLenum pname, GLdouble *params ) -{ - const GLfloat magic = -1234.5F; - GLfloat values[16]; - GLuint i; - - if (!params) - return; - - /* Init temp array to magic numbers so we can figure out how many values - * are returned by the GetFloatv() call. - */ - for (i = 0; i < 16; i++) - values[i] = magic; - - _mesa_GetFloatv(pname, values); - - for (i = 0; i < 16 && values[i] != magic; i++) - params[i] = (GLdouble) values[i]; -} - diff --git a/src/libs/mesa/mesa/main/get.h b/src/libs/mesa/mesa/main/get.h deleted file mode 100644 index 9b47b230a9..0000000000 --- a/src/libs/mesa/mesa/main/get.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * \file get.h - * State query functions. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 GET_H -#define GET_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_GetBooleanv( GLenum pname, GLboolean *params ); - -extern void GLAPIENTRY -_mesa_GetDoublev( GLenum pname, GLdouble *params ); - -extern void GLAPIENTRY -_mesa_GetFloatv( GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetIntegerv( GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetPointerv( GLenum pname, GLvoid **params ); - -extern const GLubyte * GLAPIENTRY -_mesa_GetString( GLenum name ); - -extern GLenum GLAPIENTRY -_mesa_GetError( void ); - -#endif diff --git a/src/libs/mesa/mesa/main/getstring.c b/src/libs/mesa/mesa/main/getstring.c deleted file mode 100644 index a42c44686d..0000000000 --- a/src/libs/mesa/mesa/main/getstring.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - - -#include "glheader.h" -#include "context.h" -#include "get.h" -#include "version.h" -#include "enums.h" -#include "extensions.h" - - -/** - * Examine enabled GL extensions to determine GL version. - * \return version string - */ -static const char * -compute_version(const GLcontext *ctx) -{ - static const char *version_1_2 = "1.2 Mesa " MESA_VERSION_STRING; - static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING; - static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING; - static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING; - static const char *version_2_0 = "2.0 Mesa " MESA_VERSION_STRING; - static const char *version_2_1 = "2.1 Mesa " MESA_VERSION_STRING; - - const GLboolean ver_1_3 = (ctx->Extensions.ARB_multisample && - ctx->Extensions.ARB_multitexture && - ctx->Extensions.ARB_texture_border_clamp && - ctx->Extensions.ARB_texture_compression && - ctx->Extensions.ARB_texture_cube_map && - ctx->Extensions.EXT_texture_env_add && - ctx->Extensions.ARB_texture_env_combine && - ctx->Extensions.ARB_texture_env_dot3); - const GLboolean ver_1_4 = (ver_1_3 && - ctx->Extensions.ARB_depth_texture && - ctx->Extensions.ARB_shadow && - ctx->Extensions.ARB_texture_env_crossbar && - ctx->Extensions.ARB_texture_mirrored_repeat && - ctx->Extensions.ARB_window_pos && - ctx->Extensions.EXT_blend_color && - ctx->Extensions.EXT_blend_func_separate && - ctx->Extensions.EXT_blend_minmax && - ctx->Extensions.EXT_blend_subtract && - ctx->Extensions.EXT_fog_coord && - ctx->Extensions.EXT_multi_draw_arrays && - ctx->Extensions.EXT_point_parameters && - ctx->Extensions.EXT_secondary_color && - ctx->Extensions.EXT_stencil_wrap && - ctx->Extensions.EXT_texture_lod_bias && - ctx->Extensions.SGIS_generate_mipmap); - const GLboolean ver_1_5 = (ver_1_4 && - ctx->Extensions.ARB_occlusion_query && - ctx->Extensions.ARB_vertex_buffer_object && - ctx->Extensions.EXT_shadow_funcs); - const GLboolean ver_2_0 = (ver_1_5 && - ctx->Extensions.ARB_draw_buffers && - ctx->Extensions.ARB_point_sprite && - ctx->Extensions.ARB_shader_objects && - ctx->Extensions.ARB_vertex_shader && - ctx->Extensions.ARB_fragment_shader && - ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_blend_equation_separate && - - /* Technically, 2.0 requires the functionality - * of the EXT version. Enable 2.0 if either - * extension is available, and assume that a - * driver that only exposes the ATI extension - * will fallback to software when necessary. - */ - (ctx->Extensions.EXT_stencil_two_side - || ctx->Extensions.ATI_separate_stencil)); - const GLboolean ver_2_1 = (ver_2_0 && - ctx->Extensions.ARB_shading_language_120 && - ctx->Extensions.EXT_pixel_buffer_object && - ctx->Extensions.EXT_texture_sRGB); - if (ver_2_1) - return version_2_1; - if (ver_2_0) - return version_2_0; - if (ver_1_5) - return version_1_5; - if (ver_1_4) - return version_1_4; - if (ver_1_3) - return version_1_3; - return version_1_2; -} - - - -/** - * Query string-valued state. The return value should _not_ be freed by - * the caller. - * - * \param name the state variable to query. - * - * \sa glGetString(). - * - * Tries to get the string from dd_function_table::GetString, otherwise returns - * the hardcoded strings. - */ -const GLubyte * GLAPIENTRY -_mesa_GetString( GLenum name ) -{ - GET_CURRENT_CONTEXT(ctx); - static const char *vendor = "Brian Paul"; - static const char *renderer = "Mesa"; - - if (!ctx) - return NULL; - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); - - /* this is a required driver function */ - assert(ctx->Driver.GetString); - { - /* Give the driver the chance to handle this query */ - const GLubyte *str = (*ctx->Driver.GetString)(ctx, name); - if (str) - return str; - } - - switch (name) { - case GL_VENDOR: - return (const GLubyte *) vendor; - case GL_RENDERER: - return (const GLubyte *) renderer; - case GL_VERSION: - return (const GLubyte *) compute_version(ctx); - case GL_EXTENSIONS: - if (!ctx->Extensions.String) - ctx->Extensions.String = _mesa_make_extension_string(ctx); - return (const GLubyte *) ctx->Extensions.String; -#if FEATURE_ARB_shading_language_100 - case GL_SHADING_LANGUAGE_VERSION_ARB: - if (ctx->Extensions.ARB_shading_language_120) - return (const GLubyte *) "1.20"; - else if (ctx->Extensions.ARB_shading_language_100) - return (const GLubyte *) "1.10"; - goto error; -#endif -#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \ - FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_PROGRAM_ERROR_STRING_NV: - if (ctx->Extensions.NV_fragment_program || - ctx->Extensions.ARB_fragment_program || - ctx->Extensions.NV_vertex_program || - ctx->Extensions.ARB_vertex_program) { - return (const GLubyte *) ctx->Program.ErrorString; - } - /* FALL-THROUGH */ -#endif -#if FEATURE_ARB_shading_language_100 - error: -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); - return (const GLubyte *) 0; - } -} - - -/** - * Return pointer-valued state, such as a vertex array pointer. - * - * \param pname names state to be queried - * \param params returns the pointer value - * - * \sa glGetPointerv(). - * - * Tries to get the specified pointer via dd_function_table::GetPointerv, - * otherwise gets the specified pointer from the current context. - */ -void GLAPIENTRY -_mesa_GetPointerv( GLenum pname, GLvoid **params ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint clientUnit = ctx->Array.ActiveTexture; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!params) - return; - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname)); - - if (ctx->Driver.GetPointerv - && (*ctx->Driver.GetPointerv)(ctx, pname, params)) - return; - - switch (pname) { - case GL_VERTEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->Vertex.Ptr; - break; - case GL_NORMAL_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->Normal.Ptr; - break; - case GL_COLOR_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->Color.Ptr; - break; - case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.ArrayObj->SecondaryColor.Ptr; - break; - case GL_FOG_COORDINATE_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.ArrayObj->FogCoord.Ptr; - break; - case GL_INDEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->Index.Ptr; - break; - case GL_TEXTURE_COORD_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->TexCoord[clientUnit].Ptr; - break; - case GL_EDGE_FLAG_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->EdgeFlag.Ptr; - break; - case GL_FEEDBACK_BUFFER_POINTER: - *params = ctx->Feedback.Buffer; - break; - case GL_SELECTION_BUFFER_POINTER: - *params = ctx->Select.Buffer; - break; -#if FEATURE_MESA_program_debug - case GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA: - if (!ctx->Extensions.MESA_program_debug) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); - return; - } - *params = *(GLvoid **) &ctx->FragmentProgram.Callback; - break; - case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA: - if (!ctx->Extensions.MESA_program_debug) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); - return; - } - *params = ctx->FragmentProgram.CallbackData; - break; - case GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA: - if (!ctx->Extensions.MESA_program_debug) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); - return; - } - *params = *(GLvoid **) &ctx->VertexProgram.Callback; - break; - case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA: - if (!ctx->Extensions.MESA_program_debug) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); - return; - } - *params = ctx->VertexProgram.CallbackData; - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" ); - return; - } -} - - -/** - * Returns the current GL error code, or GL_NO_ERROR. - * \return current error code - * - * Returns __GLcontextRec::ErrorValue. - */ -GLenum GLAPIENTRY -_mesa_GetError( void ) -{ - GET_CURRENT_CONTEXT(ctx); - GLenum e = ctx->ErrorValue; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e)); - - ctx->ErrorValue = (GLenum) GL_NO_ERROR; - return e; -} diff --git a/src/libs/mesa/mesa/main/glheader.h b/src/libs/mesa/mesa/main/glheader.h deleted file mode 100644 index 3aad113bf6..0000000000 --- a/src/libs/mesa/mesa/main/glheader.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - * \file glheader.h - * Top-most include file. - * - * 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 \e not directly include any system - * headers. This allows system-dependent hacks/workarounds to be - * collected in one place. - * - * \note Actually, a lot of system-dependent stuff is now in imports.[ch]. - * - * If you touch this file, everything gets recompiled! - * - * This file should be included before any other header in the .c files. - * - * Put compiler/OS/assembly pragmas and macros here to avoid - * cluttering other source files. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 - -#include -#include -#if defined(__alpha__) && defined(CCPML) -#include /* use Compaq's Fast Math Library on Alpha */ -#else -#include -#endif -#include -#include -#include -#include -#if defined(__linux__) && defined(__i386__) -#include -#endif -#include -#include - - -/* Get typedefs for uintptr_t and friends */ -#if defined(__MINGW32__) || defined(__NetBSD__) -# include -#elif defined(_WIN32) -# include -# if _MSC_VER == 1200 - typedef UINT_PTR uintptr_t; -# endif -#elif defined(__INTERIX) -/* Interix 3.x has a gcc that shadows this. */ -# ifndef _UINTPTR_T_DEFINED - typedef unsigned long uintptr_t; -# define _UINTPTR_T_DEFINED -# endif -#else -# include -#endif - - -/* Sun compilers define __i386 instead of the gcc-style __i386__ */ -#ifdef __SUNPRO_C -# if !defined(__i386__) && defined(__i386) -# define __i386__ -# elif !defined(__amd64__) && defined(__amd64) -# define __amd64__ -# elif !defined(__sparc__) && defined(__sparc) -# define __sparc__ -# endif -# if !defined(__volatile) -# define __volatile volatile -# endif -#endif - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ -# define finite _finite -#endif - -#if defined(__WATCOMC__) -# define finite _finite -# pragma disable_message(201) /* Disable unreachable code warnings */ -#endif - -#ifdef WGLAPI -# undef WGLAPI -#endif - -#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP) -# if !defined(__GNUC__) /* mingw environment */ -# pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ -# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ -# pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -# endif -# endif -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define WGLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define WGLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define WGLAPI __declspec(dllimport) -# endif /* _STATIC_MESA support */ -#endif /* WIN32 / CYGWIN bracket */ - - -/* - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. - * Do not use them unless absolutely necessary! - * Try to use a runtime test instead. - * For now, only used by some DRI hardware drivers for color/texel packing. - */ -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN -#if defined(__linux__) -#include -#define CPU_TO_LE32( x ) bswap_32( x ) -#elif defined(__APPLE__) -#include -#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#elif defined(__BEOS__) || defined(__HAIKU__) -#include -#define CPU_TO_LE32( x ) B_HOST_TO_LENDIAN_INT32( x ) -#else /*__linux__ __APPLE__ __BEOS__ __HAIKU__ */ -#include -#define CPU_TO_LE32( x ) bswap32( x ) -#endif /*__linux__*/ -#define MESA_BIG_ENDIAN 1 -#else - #define CPU_TO_LE32( x ) ( x ) - #define MESA_LITTLE_ENDIAN 1 -#endif -#define LE32_TO_CPU( x ) CPU_TO_LE32( x ) - - -#define GL_GLEXT_PROTOTYPES -#include "GL/gl.h" -#include "GL/glext.h" - - -#ifndef GL_FIXED -#define GL_FIXED 0x140C -#endif - - -#ifndef GL_OES_point_size_array -#define GL_POINT_SIZE_ARRAY_OES 0x8B9C -#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A -#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B -#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C -#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F -#endif - - -#ifndef GL_OES_draw_texture -#define GL_TEXTURE_CROP_RECT_OES 0x8B9D -#endif - - -#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP) -#define CAPI _cdecl -#endif - - -/* This is a macro on IRIX */ -#ifdef _P -#undef _P -#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(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/ -#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 - - -/* Function inlining */ -#if defined(__GNUC__) -# define INLINE __inline__ -#elif defined(__MSC__) -# define INLINE __inline -#elif defined(_MSC_VER) -# define INLINE __inline -#elif defined(__ICL) -# define INLINE __inline -#elif defined(__INTEL_COMPILER) -# define INLINE inline -#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) -# define INLINE __inline -#elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -# define INLINE inline -# define __inline inline -# define __inline__ inline -#elif (__STDC_VERSION__ >= 199901L) /* C99 */ -# define INLINE inline -#else -# define INLINE -#endif - - -/* If we build the library with gcc's -fvisibility=hidden flag, we'll - * use the PUBLIC macro to mark functions that are to be exported. - * - * We also need to define a USED attribute, so the optimizer doesn't - * inline a static function that we later use in an alias. - ajax - */ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 -# define PUBLIC __attribute__((visibility("default"))) -# define USED __attribute__((used)) -#else -# define PUBLIC -# define USED -#endif - - -/* Some compilers don't like some of Mesa's const usage */ -#ifdef NO_CONST -# define CONST -#else -# define CONST const -#endif - - -#if !defined(_WIN32_WCE) -#if defined(BUILD_FOR_SNAP) && defined(CHECKED) -# define ASSERT(X) _CHECK(X) -#elif defined(DEBUG) -# define ASSERT(X) assert(X) -#else -# define ASSERT(X) -#endif -#endif - - -#if (!defined(__GNUC__) || __GNUC__ < 3) && (!defined(__IBMC__) || __IBMC__ < 900) -# define __builtin_expect(x, y) x -#endif - -/* The __FUNCTION__ gcc variable is generally only used for debugging. - * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. - * Don't define it if using a newer Windows compiler. - */ -#ifndef __FUNCTION__ -# if defined(__VMS) -# define __FUNCTION__ "VMS$NL:" -# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ - (!defined(_MSC_VER) || _MSC_VER < 1300) -# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ - (defined(__SUNPRO_C) && defined(__C99FEATURES__)) -# define __FUNCTION__ __func__ -# else -# define __FUNCTION__ "" -# endif -# endif -#endif - - -#include "config.h" - -#endif /* GLHEADER_H */ diff --git a/src/libs/mesa/mesa/main/hash.c b/src/libs/mesa/mesa/main/hash.c deleted file mode 100644 index 08c64568c8..0000000000 --- a/src/libs/mesa/mesa/main/hash.c +++ /dev/null @@ -1,530 +0,0 @@ -/** - * \file hash.c - * Generic hash table. - * - * Used for display lists, texture objects, vertex/fragment programs, - * buffer objects, etc. The hash functions are thread-safe. - * - * \note key=0 is illegal. - * - * \author Brian Paul - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "glapi/glthread.h" -#include "hash.h" - - -#define TABLE_SIZE 1023 /**< Size of lookup table/array */ - -#define HASH_FUNC(K) ((K) % TABLE_SIZE) - - -/** - * An entry in the hash table. - */ -struct HashEntry { - GLuint Key; /**< the entry's key */ - void *Data; /**< the entry's data */ - struct HashEntry *Next; /**< pointer to next entry */ -}; - - -/** - * The hash table data structure. - */ -struct _mesa_HashTable { - struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */ - GLuint MaxKey; /**< highest key inserted so far */ - _glthread_Mutex Mutex; /**< mutual exclusion lock */ - _glthread_Mutex WalkMutex; /**< for _mesa_HashWalk() */ - GLboolean InDeleteAll; /**< Debug check */ -}; - - - -/** - * Create a new hash table. - * - * \return pointer to a new, empty hash table. - */ -struct _mesa_HashTable * -_mesa_NewHashTable(void) -{ - struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable); - if (table) { - _glthread_INIT_MUTEX(table->Mutex); - _glthread_INIT_MUTEX(table->WalkMutex); - } - return table; -} - - - -/** - * Delete a hash table. - * Frees each entry on the hash table and then the hash table structure itself. - * Note that the caller should have already traversed the table and deleted - * the objects in the table (i.e. We don't free the entries' data pointer). - * - * \param table the hash table to delete. - */ -void -_mesa_DeleteHashTable(struct _mesa_HashTable *table) -{ - GLuint pos; - assert(table); - for (pos = 0; pos < TABLE_SIZE; pos++) { - struct HashEntry *entry = table->Table[pos]; - while (entry) { - struct HashEntry *next = entry->Next; - if (entry->Data) { - _mesa_problem(NULL, - "In _mesa_DeleteHashTable, found non-freed data"); - } - _mesa_free(entry); - entry = next; - } - } - _glthread_DESTROY_MUTEX(table->Mutex); - _glthread_DESTROY_MUTEX(table->WalkMutex); - _mesa_free(table); -} - - - -/** - * Lookup an entry in the hash table. - * - * \param table the hash table. - * \param key the key. - * - * \return pointer to user's data or NULL if key not in table - */ -void * -_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key) -{ - GLuint pos; - const struct HashEntry *entry; - - assert(table); - assert(key); - - pos = HASH_FUNC(key); - entry = table->Table[pos]; - while (entry) { - if (entry->Key == key) { - return entry->Data; - } - entry = entry->Next; - } - return NULL; -} - - - -/** - * Insert a key/pointer pair into the hash table. - * If an entry with this key already exists we'll replace the existing entry. - * - * \param table the hash table. - * \param key the key (not zero). - * \param data pointer to user data. - */ -void -_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data) -{ - /* search for existing entry with this key */ - GLuint pos; - struct HashEntry *entry; - - assert(table); - assert(key); - - _glthread_LOCK_MUTEX(table->Mutex); - - if (key > table->MaxKey) - table->MaxKey = key; - - pos = HASH_FUNC(key); - - /* check if replacing an existing entry with same key */ - for (entry = table->Table[pos]; entry; entry = entry->Next) { - if (entry->Key == key) { - /* replace entry's data */ -#if 0 /* not sure this check is always valid */ - if (entry->Data) { - _mesa_problem(NULL, "Memory leak detected in _mesa_HashInsert"); - } -#endif - entry->Data = data; - _glthread_UNLOCK_MUTEX(table->Mutex); - return; - } - } - - /* alloc and insert new table entry */ - entry = MALLOC_STRUCT(HashEntry); - entry->Key = key; - entry->Data = data; - entry->Next = table->Table[pos]; - table->Table[pos] = entry; - - _glthread_UNLOCK_MUTEX(table->Mutex); -} - - - -/** - * Remove an entry from the hash table. - * - * \param table the hash table. - * \param key key of entry to remove. - * - * While holding the hash table's lock, searches the entry with the matching - * key and unlinks it. - */ -void -_mesa_HashRemove(struct _mesa_HashTable *table, GLuint key) -{ - GLuint pos; - struct HashEntry *entry, *prev; - - assert(table); - assert(key); - - /* have to check this outside of mutex lock */ - if (table->InDeleteAll) { - _mesa_problem(NULL, "_mesa_HashRemove illegally called from " - "_mesa_HashDeleteAll callback function"); - return; - } - - _glthread_LOCK_MUTEX(table->Mutex); - - pos = HASH_FUNC(key); - prev = NULL; - entry = table->Table[pos]; - while (entry) { - if (entry->Key == key) { - /* found it! */ - if (prev) { - prev->Next = entry->Next; - } - else { - table->Table[pos] = entry->Next; - } - _mesa_free(entry); - _glthread_UNLOCK_MUTEX(table->Mutex); - return; - } - prev = entry; - entry = entry->Next; - } - - _glthread_UNLOCK_MUTEX(table->Mutex); -} - - - -/** - * Delete all entries in a hash table, but don't delete the table itself. - * Invoke the given callback function for each table entry. - * - * \param table the hash table to delete - * \param callback the callback function - * \param userData arbitrary pointer to pass along to the callback - * (this is typically a GLcontext pointer) - */ -void -_mesa_HashDeleteAll(struct _mesa_HashTable *table, - void (*callback)(GLuint key, void *data, void *userData), - void *userData) -{ - GLuint pos; - ASSERT(table); - ASSERT(callback); - _glthread_LOCK_MUTEX(table->Mutex); - table->InDeleteAll = GL_TRUE; - for (pos = 0; pos < TABLE_SIZE; pos++) { - struct HashEntry *entry, *next; - for (entry = table->Table[pos]; entry; entry = next) { - callback(entry->Key, entry->Data, userData); - next = entry->Next; - _mesa_free(entry); - } - table->Table[pos] = NULL; - } - table->InDeleteAll = GL_FALSE; - _glthread_UNLOCK_MUTEX(table->Mutex); -} - - -/** - * Walk over all entries in a hash table, calling callback function for each. - * Note: we use a separate mutex in this function to avoid a recursive - * locking deadlock (in case the callback calls _mesa_HashRemove()) and to - * prevent multiple threads/contexts from getting tangled up. - * A lock-less version of this function could be used when the table will - * not be modified. - * \param table the hash table to walk - * \param callback the callback function - * \param userData arbitrary pointer to pass along to the callback - * (this is typically a GLcontext pointer) - */ -void -_mesa_HashWalk(const struct _mesa_HashTable *table, - void (*callback)(GLuint key, void *data, void *userData), - void *userData) -{ - /* cast-away const */ - struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table; - GLuint pos; - ASSERT(table); - ASSERT(callback); - _glthread_LOCK_MUTEX(table2->WalkMutex); - for (pos = 0; pos < TABLE_SIZE; pos++) { - struct HashEntry *entry, *next; - for (entry = table->Table[pos]; entry; entry = next) { - /* save 'next' pointer now in case the callback deletes the entry */ - next = entry->Next; - callback(entry->Key, entry->Data, userData); - } - } - _glthread_UNLOCK_MUTEX(table2->WalkMutex); -} - - -/** - * Return the key of the "first" entry in the hash table. - * While holding the lock, walks through all table positions until finding - * the first entry of the first non-empty one. - * - * \param table the hash table - * \return key for the "first" entry in the hash table. - */ -GLuint -_mesa_HashFirstEntry(struct _mesa_HashTable *table) -{ - GLuint pos; - assert(table); - _glthread_LOCK_MUTEX(table->Mutex); - for (pos = 0; pos < TABLE_SIZE; pos++) { - if (table->Table[pos]) { - _glthread_UNLOCK_MUTEX(table->Mutex); - return table->Table[pos]->Key; - } - } - _glthread_UNLOCK_MUTEX(table->Mutex); - return 0; -} - - -/** - * Given a hash table key, return the next key. This is used to walk - * over all entries in the table. Note that the keys returned during - * walking won't be in any particular order. - * \return next hash key or 0 if end of table. - */ -GLuint -_mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key) -{ - const struct HashEntry *entry; - GLuint pos; - - assert(table); - assert(key); - - /* Find the entry with given key */ - pos = HASH_FUNC(key); - for (entry = table->Table[pos]; entry ; entry = entry->Next) { - if (entry->Key == key) { - break; - } - } - - if (!entry) { - /* the given key was not found, so we can't find the next entry */ - return 0; - } - - if (entry->Next) { - /* return next in linked list */ - return entry->Next->Key; - } - else { - /* look for next non-empty table slot */ - pos++; - while (pos < TABLE_SIZE) { - if (table->Table[pos]) { - return table->Table[pos]->Key; - } - pos++; - } - return 0; - } -} - - -/** - * Dump contents of hash table for debugging. - * - * \param table the hash table. - */ -void -_mesa_HashPrint(const struct _mesa_HashTable *table) -{ - GLuint pos; - assert(table); - for (pos = 0; pos < TABLE_SIZE; pos++) { - const struct HashEntry *entry = table->Table[pos]; - while (entry) { - _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data); - entry = entry->Next; - } - } -} - - - -/** - * Find a block of adjacent unused hash keys. - * - * \param table the hash table. - * \param numKeys number of keys needed. - * - * \return Starting key of free block or 0 if failure. - * - * If there are enough free keys between the maximum key existing in the table - * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return - * the adjacent key. Otherwise do a full search for a free key block in the - * allowable key range. - */ -GLuint -_mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys) -{ - const GLuint maxKey = ~((GLuint) 0); - _glthread_LOCK_MUTEX(table->Mutex); - if (maxKey - numKeys > table->MaxKey) { - /* the quick solution */ - _glthread_UNLOCK_MUTEX(table->Mutex); - return table->MaxKey + 1; - } - else { - /* the slow solution */ - GLuint freeCount = 0; - GLuint freeStart = 1; - GLuint key; - for (key = 1; key != maxKey; key++) { - if (_mesa_HashLookup(table, key)) { - /* darn, this key is already in use */ - freeCount = 0; - freeStart = key+1; - } - else { - /* this key not in use, check if we've found enough */ - freeCount++; - if (freeCount == numKeys) { - _glthread_UNLOCK_MUTEX(table->Mutex); - return freeStart; - } - } - } - /* cannot allocate a block of numKeys consecutive keys */ - _glthread_UNLOCK_MUTEX(table->Mutex); - return 0; - } -} - - -#if 0 /* debug only */ - -/** - * Test walking over all the entries in a hash table. - */ -static void -test_hash_walking(void) -{ - struct _mesa_HashTable *t = _mesa_NewHashTable(); - const GLuint limit = 50000; - GLuint i; - - /* create some entries */ - for (i = 0; i < limit; i++) { - GLuint dummy; - GLuint k = (rand() % (limit * 10)) + 1; - while (_mesa_HashLookup(t, k)) { - /* id already in use, try another */ - k = (rand() % (limit * 10)) + 1; - } - _mesa_HashInsert(t, k, &dummy); - } - - /* walk over all entries */ - { - GLuint k = _mesa_HashFirstEntry(t); - GLuint count = 0; - while (k) { - GLuint knext = _mesa_HashNextEntry(t, k); - assert(knext != k); - _mesa_HashRemove(t, k); - count++; - k = knext; - } - assert(count == limit); - k = _mesa_HashFirstEntry(t); - assert(k==0); - } - - _mesa_DeleteHashTable(t); -} - - -void -_mesa_test_hash_functions(void) -{ - int a, b, c; - struct _mesa_HashTable *t; - - t = _mesa_NewHashTable(); - _mesa_HashInsert(t, 501, &a); - _mesa_HashInsert(t, 10, &c); - _mesa_HashInsert(t, 0xfffffff8, &b); - /*_mesa_HashPrint(t);*/ - - assert(_mesa_HashLookup(t,501)); - assert(!_mesa_HashLookup(t,1313)); - assert(_mesa_HashFindFreeKeyBlock(t, 100)); - - _mesa_DeleteHashTable(t); - - test_hash_walking(); -} - -#endif diff --git a/src/libs/mesa/mesa/main/hash.h b/src/libs/mesa/mesa/main/hash.h deleted file mode 100644 index d18db76abe..0000000000 --- a/src/libs/mesa/mesa/main/hash.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * \file hash.h - * Generic hash table. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 HASH_H -#define HASH_H - - -#include "glheader.h" - - -extern struct _mesa_HashTable *_mesa_NewHashTable(void); - -extern void _mesa_DeleteHashTable(struct _mesa_HashTable *table); - -extern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key); - -extern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data); - -extern void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key); - -extern void -_mesa_HashDeleteAll(struct _mesa_HashTable *table, - void (*callback)(GLuint key, void *data, void *userData), - void *userData); - -extern void -_mesa_HashWalk(const struct _mesa_HashTable *table, - void (*callback)(GLuint key, void *data, void *userData), - void *userData); - -extern GLuint _mesa_HashFirstEntry(struct _mesa_HashTable *table); - -extern GLuint _mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key); - -extern void _mesa_HashPrint(const struct _mesa_HashTable *table); - -extern GLuint _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys); - -extern void _mesa_test_hash_functions(void); - - -#endif diff --git a/src/libs/mesa/mesa/main/hint.c b/src/libs/mesa/mesa/main/hint.c deleted file mode 100644 index dcfa9c7363..0000000000 --- a/src/libs/mesa/mesa/main/hint.c +++ /dev/null @@ -1,153 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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. - */ - - -#include "glheader.h" -#include "enums.h" -#include "context.h" -#include "hint.h" -#include "imports.h" - - - -void GLAPIENTRY -_mesa_Hint( GLenum target, GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glHint %s %d\n", - _mesa_lookup_enum_by_nr(target), mode); - - if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)"); - return; - } - - switch (target) { - case GL_FOG_HINT: - if (ctx->Hint.Fog == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.Fog = mode; - break; - case GL_LINE_SMOOTH_HINT: - if (ctx->Hint.LineSmooth == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.LineSmooth = mode; - break; - case GL_PERSPECTIVE_CORRECTION_HINT: - if (ctx->Hint.PerspectiveCorrection == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.PerspectiveCorrection = mode; - break; - case GL_POINT_SMOOTH_HINT: - if (ctx->Hint.PointSmooth == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.PointSmooth = mode; - break; - case GL_POLYGON_SMOOTH_HINT: - if (ctx->Hint.PolygonSmooth == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.PolygonSmooth = mode; - break; - - /* GL_EXT_clip_volume_hint */ - case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: - if (ctx->Hint.ClipVolumeClipping == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.ClipVolumeClipping = mode; - break; - - /* GL_ARB_texture_compression */ - case GL_TEXTURE_COMPRESSION_HINT_ARB: - if (!ctx->Extensions.ARB_texture_compression) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } - if (ctx->Hint.TextureCompression == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.TextureCompression = mode; - break; - - /* GL_SGIS_generate_mipmap */ - case GL_GENERATE_MIPMAP_HINT_SGIS: - if (!ctx->Extensions.SGIS_generate_mipmap) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } - if (ctx->Hint.GenerateMipmap == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.GenerateMipmap = mode; - break; - - /* GL_ARB_fragment_shader */ - case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: - if (!ctx->Extensions.ARB_fragment_shader) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } - if (ctx->Hint.FragmentShaderDerivative == mode) - return; - FLUSH_VERTICES(ctx, _NEW_HINT); - ctx->Hint.FragmentShaderDerivative = mode; - break; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } - - if (ctx->Driver.Hint) { - (*ctx->Driver.Hint)( ctx, target, mode ); - } -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -void _mesa_init_hint( GLcontext * ctx ) -{ - /* 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.ClipVolumeClipping = GL_DONT_CARE; - ctx->Hint.TextureCompression = GL_DONT_CARE; - ctx->Hint.GenerateMipmap = GL_DONT_CARE; - ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE; -} diff --git a/src/libs/mesa/mesa/main/hint.h b/src/libs/mesa/mesa/main/hint.h deleted file mode 100644 index bfc3887107..0000000000 --- a/src/libs/mesa/mesa/main/hint.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * \file hint.h - * Hints operations. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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 HINT_H -#define HINT_H - - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Hint( GLenum target, GLenum mode ); - -extern void -_mesa_init_hint( GLcontext * ctx ); - -#else - -/** No-op */ -#define _mesa_init_hint( c ) ((void) 0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/histogram.c b/src/libs/mesa/mesa/main/histogram.c deleted file mode 100644 index 905c1ad830..0000000000 --- a/src/libs/mesa/mesa/main/histogram.c +++ /dev/null @@ -1,1122 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "context.h" -#include "image.h" -#include "histogram.h" - - - -/* - * XXX the packed pixel formats haven't been tested. - */ -static void -pack_histogram( GLcontext *ctx, - GLuint n, CONST GLuint rgba[][4], - GLenum format, GLenum type, GLvoid *destination, - const struct gl_pixelstore_attrib *packing ) -{ - const GLint comps = _mesa_components_in_format(format); - GLuint luminance[MAX_WIDTH]; - - if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) { - GLuint i; - for (i = 0; i < n; i++) { - luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - } - } - -#define PACK_MACRO(TYPE) \ - { \ - GLuint i; \ - switch (format) { \ - case GL_RED: \ - for (i=0;iSwapBytes) { - _mesa_swap2(dst, n * comps); - } - } - break; - case GL_SHORT: - { - GLshort *dst = (GLshort *) destination; - PACK_MACRO(GLshort); - if (packing->SwapBytes) { - _mesa_swap2((GLushort *) dst, n * comps); - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint *dst = (GLuint *) destination; - PACK_MACRO(GLuint); - if (packing->SwapBytes) { - _mesa_swap4(dst, n * comps); - } - } - break; - case GL_INT: - { - GLint *dst = (GLint *) destination; - PACK_MACRO(GLint); - if (packing->SwapBytes) { - _mesa_swap4((GLuint *) dst, n * comps); - } - } - break; - case GL_FLOAT: - { - GLfloat *dst = (GLfloat *) destination; - PACK_MACRO(GLfloat); - if (packing->SwapBytes) { - _mesa_swap4((GLuint *) dst, n * comps); - } - } - break; - case GL_HALF_FLOAT_ARB: - { - /* temporarily store as GLuints */ - GLuint temp[4*HISTOGRAM_TABLE_SIZE]; - GLhalfARB *dst = (GLhalfARB *) destination; - GLuint i; - /* get GLuint values */ - PACK_MACRO(GLuint); - /* convert to GLhalf */ - for (i = 0; i < n * comps; i++) { - dst[i] = _mesa_float_to_half((GLfloat) temp[i]); - } - if (packing->SwapBytes) { - _mesa_swap2((GLushort *) dst, n * comps); - } - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - if (format == GL_RGB) { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x7) << 5) - | ((rgba[i][GCOMP] & 0x7) << 2) - | ((rgba[i][BCOMP] & 0x3) ); - } - } - else { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x7) << 5) - | ((rgba[i][GCOMP] & 0x7) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - if (format == GL_RGB) { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3) << 6) - | ((rgba[i][GCOMP] & 0x7) << 3) - | ((rgba[i][BCOMP] & 0x7) ); - } - } - else { - GLubyte *dst = (GLubyte *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x3) << 6) - | ((rgba[i][GCOMP] & 0x7) << 3) - | ((rgba[i][RCOMP] & 0x7) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - if (format == GL_RGB) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][BCOMP] & 0x1f) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][RCOMP] & 0x1f) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - if (format == GL_RGB) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][RCOMP] & 0x1f) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_BGR); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x3f) << 5) - | ((rgba[i][BCOMP] & 0x1f) ); - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][BCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][RCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][BCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][RCOMP] & 0xf) ); - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][BCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][RCOMP] & 0xf) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xf) << 12) - | ((rgba[i][RCOMP] & 0xf) << 8) - | ((rgba[i][GCOMP] & 0xf) << 4) - | ((rgba[i][BCOMP] & 0xf) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xf) << 12) - | ((rgba[i][GCOMP] & 0xf) << 8) - | ((rgba[i][BCOMP] & 0xf) << 4) - | ((rgba[i][ACOMP] & 0xf) ); - } - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][BCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][RCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][BCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][RCOMP] & 0x1) ); - } - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - if (format == GL_RGBA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][BCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][RCOMP] & 0x1) ); - } - } - else if (format == GL_BGRA) { - GLushort *dst = (GLushort *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x1f) << 11) - | ((rgba[i][RCOMP] & 0x1f) << 6) - | ((rgba[i][GCOMP] & 0x1f) << 1) - | ((rgba[i][BCOMP] & 0x1) ); - } - } - else { - GLushort *dst = (GLushort *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x1f) << 11) - | ((rgba[i][GCOMP] & 0x1f) << 6) - | ((rgba[i][BCOMP] & 0x1f) << 1) - | ((rgba[i][ACOMP] & 0x1) ); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][BCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][RCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][BCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][RCOMP] & 0xff) ); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][BCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][RCOMP] & 0xff) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0xff) << 24) - | ((rgba[i][RCOMP] & 0xff) << 16) - | ((rgba[i][GCOMP] & 0xff) << 8) - | ((rgba[i][BCOMP] & 0xff) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0xff) << 24) - | ((rgba[i][GCOMP] & 0xff) << 16) - | ((rgba[i][BCOMP] & 0xff) << 8) - | ((rgba[i][ACOMP] & 0xff) ); - } - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][BCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][BCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][RCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][BCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - if (format == GL_RGBA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][BCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][RCOMP] & 0x3) ); - } - } - else if (format == GL_BGRA) { - GLuint *dst = (GLuint *) destination; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][ACOMP] & 0x3ff) << 22) - | ((rgba[i][RCOMP] & 0x3ff) << 12) - | ((rgba[i][GCOMP] & 0x3ff) << 2) - | ((rgba[i][BCOMP] & 0x3) ); - } - } - else { - GLuint *dst = (GLuint *) destination; - GLuint i; - ASSERT(format == GL_ABGR_EXT); - for (i = 0; i < n; i++) { - dst[i] = ((rgba[i][RCOMP] & 0x3ff) << 22) - | ((rgba[i][GCOMP] & 0x3ff) << 12) - | ((rgba[i][BCOMP] & 0x3ff) << 2) - | ((rgba[i][ACOMP] & 0x3) ); - } - } - break; - default: - _mesa_problem(ctx, "Bad type in pack_histogram"); - } - -#undef PACK_MACRO -} - - -/* - * Given an internalFormat token passed to glHistogram or glMinMax, - * return the corresponding base format. - * Return -1 if invalid token. - */ -static GLint -base_histogram_format( GLenum format ) -{ - switch (format) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_ALPHA; - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return GL_RGBA; - default: - return -1; /* error */ - } -} - - - -/********************************************************************** - * API functions - */ - - -void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); - return; - } - - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmax(target)"); - return; - } - - if (format != GL_RED && - format != GL_GREEN && - format != GL_BLUE && - format != GL_ALPHA && - format != GL_RGB && - format != GL_BGR && - format != GL_RGBA && - format != GL_BGRA && - format != GL_ABGR_EXT && - format != GL_LUMINANCE && - format != GL_LUMINANCE_ALPHA) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMax(format)"); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax(format or type)"); - return; - } - - if (ctx->Pack.BufferObj->Name) { - /* pack min/max values into a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Pack, 2, 1, 1, - format, type, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetMinMax(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION,"glGetMinMax(PBO is mapped)"); - return; - } - values = ADD_POINTERS(buf, values); - } - else if (!values) { - /* not an error */ - return; - } - - { - GLfloat minmax[2][4]; - minmax[0][RCOMP] = CLAMP(ctx->MinMax.Min[RCOMP], 0.0F, 1.0F); - minmax[0][GCOMP] = CLAMP(ctx->MinMax.Min[GCOMP], 0.0F, 1.0F); - minmax[0][BCOMP] = CLAMP(ctx->MinMax.Min[BCOMP], 0.0F, 1.0F); - minmax[0][ACOMP] = CLAMP(ctx->MinMax.Min[ACOMP], 0.0F, 1.0F); - minmax[1][RCOMP] = CLAMP(ctx->MinMax.Max[RCOMP], 0.0F, 1.0F); - minmax[1][GCOMP] = CLAMP(ctx->MinMax.Max[GCOMP], 0.0F, 1.0F); - minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F); - minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F); - _mesa_pack_rgba_span_float(ctx, 2, minmax, - format, type, values, &ctx->Pack, 0x0); - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } - - if (reset) { - _mesa_ResetMinmax(GL_MINMAX); - } -} - - -void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); - return; - } - - if (target != GL_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogram(target)"); - return; - } - - if (format != GL_RED && - format != GL_GREEN && - format != GL_BLUE && - format != GL_ALPHA && - format != GL_RGB && - format != GL_BGR && - format != GL_RGBA && - format != GL_BGRA && - format != GL_ABGR_EXT && - format != GL_LUMINANCE && - format != GL_LUMINANCE_ALPHA) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogram(format)"); - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram(format or type)"); - return; - } - - if (ctx->Pack.BufferObj->Name) { - /* pack min/max values into a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(1, &ctx->Pack, ctx->Histogram.Width, 1, 1, - format, type, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetHistogram(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx,GL_INVALID_OPERATION,"glGetHistogram(PBO is mapped)"); - return; - } - values = ADD_POINTERS(buf, values); - } - else if (!values) { - /* not an error */ - return; - } - - pack_histogram(ctx, ctx->Histogram.Width, - (CONST GLuint (*)[4]) ctx->Histogram.Count, - format, type, values, &ctx->Pack); - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } - - if (reset) { - GLuint i; - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - } -} - - -void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); - return; - } - - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameterfv(target)"); - return; - } - - switch (pname) { - case GL_HISTOGRAM_WIDTH: - *params = (GLfloat) ctx->Histogram.Width; - break; - case GL_HISTOGRAM_FORMAT: - *params = (GLfloat) ctx->Histogram.Format; - break; - case GL_HISTOGRAM_RED_SIZE: - *params = (GLfloat) ctx->Histogram.RedSize; - break; - case GL_HISTOGRAM_GREEN_SIZE: - *params = (GLfloat) ctx->Histogram.GreenSize; - break; - case GL_HISTOGRAM_BLUE_SIZE: - *params = (GLfloat) ctx->Histogram.BlueSize; - break; - case GL_HISTOGRAM_ALPHA_SIZE: - *params = (GLfloat) ctx->Histogram.AlphaSize; - break; - case GL_HISTOGRAM_LUMINANCE_SIZE: - *params = (GLfloat) ctx->Histogram.LuminanceSize; - break; - case GL_HISTOGRAM_SINK: - *params = (GLfloat) ctx->Histogram.Sink; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameterfv(pname)"); - } -} - - -void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); - return; - } - - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameteriv(target)"); - return; - } - - switch (pname) { - case GL_HISTOGRAM_WIDTH: - *params = (GLint) ctx->Histogram.Width; - break; - case GL_HISTOGRAM_FORMAT: - *params = (GLint) ctx->Histogram.Format; - break; - case GL_HISTOGRAM_RED_SIZE: - *params = (GLint) ctx->Histogram.RedSize; - break; - case GL_HISTOGRAM_GREEN_SIZE: - *params = (GLint) ctx->Histogram.GreenSize; - break; - case GL_HISTOGRAM_BLUE_SIZE: - *params = (GLint) ctx->Histogram.BlueSize; - break; - case GL_HISTOGRAM_ALPHA_SIZE: - *params = (GLint) ctx->Histogram.AlphaSize; - break; - case GL_HISTOGRAM_LUMINANCE_SIZE: - *params = (GLint) ctx->Histogram.LuminanceSize; - break; - case GL_HISTOGRAM_SINK: - *params = (GLint) ctx->Histogram.Sink; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHistogramParameteriv(pname)"); - } -} - - -void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); - return; - } - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmaxParameterfv(target)"); - return; - } - if (pname == GL_MINMAX_FORMAT) { - *params = (GLfloat) ctx->MinMax.Format; - } - else if (pname == GL_MINMAX_SINK) { - *params = (GLfloat) ctx->MinMax.Sink; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMaxParameterfv(pname)"); - } -} - - -void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); - return; - } - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinmaxParameteriv(target)"); - return; - } - if (pname == GL_MINMAX_FORMAT) { - *params = (GLint) ctx->MinMax.Format; - } - else if (pname == GL_MINMAX_SINK) { - *params = (GLint) ctx->MinMax.Sink; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetMinMaxParameteriv(pname)"); - } -} - - -void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) -{ - GLuint i; - GLboolean error = GL_FALSE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); - return; - } - - if (target != GL_HISTOGRAM && target != GL_PROXY_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHistogram(target)"); - return; - } - - if (width < 0 || width > HISTOGRAM_TABLE_SIZE) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - if (width < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glHistogram(width)"); - else - _mesa_error(ctx, GL_TABLE_TOO_LARGE, "glHistogram(width)"); - return; - } - } - - if (width != 0 && !_mesa_is_pow_two(width)) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glHistogram(width)"); - return; - } - } - - if (base_histogram_format(internalFormat) < 0) { - if (target == GL_PROXY_HISTOGRAM) { - error = GL_TRUE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glHistogram(internalFormat)"); - return; - } - } - - /* reset histograms */ - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - - if (error) { - ctx->Histogram.Width = 0; - ctx->Histogram.Format = 0; - ctx->Histogram.RedSize = 0; - ctx->Histogram.GreenSize = 0; - ctx->Histogram.BlueSize = 0; - ctx->Histogram.AlphaSize = 0; - ctx->Histogram.LuminanceSize = 0; - } - else { - ctx->Histogram.Width = width; - ctx->Histogram.Format = internalFormat; - ctx->Histogram.Sink = sink; - ctx->Histogram.RedSize = 8 * sizeof(GLuint); - ctx->Histogram.GreenSize = 8 * sizeof(GLuint); - ctx->Histogram.BlueSize = 8 * sizeof(GLuint); - ctx->Histogram.AlphaSize = 8 * sizeof(GLuint); - ctx->Histogram.LuminanceSize = 8 * sizeof(GLuint); - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); - return; - } - - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glMinMax(target)"); - return; - } - - if (base_histogram_format(internalFormat) < 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glMinMax(internalFormat)"); - return; - } - - if (ctx->MinMax.Sink == sink) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->MinMax.Sink = sink; -} - - -void GLAPIENTRY -_mesa_ResetHistogram(GLenum target) -{ - GLuint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); - return; - } - - if (target != GL_HISTOGRAM) { - _mesa_error(ctx, GL_INVALID_ENUM, "glResetHistogram(target)"); - return; - } - - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - - ctx->NewState |= _NEW_PIXEL; -} - - -void GLAPIENTRY -_mesa_ResetMinmax(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); - return; - } - - if (target != GL_MINMAX) { - _mesa_error(ctx, GL_INVALID_ENUM, "glResetMinMax(target)"); - return; - } - - ctx->MinMax.Min[RCOMP] = 1000; ctx->MinMax.Max[RCOMP] = -1000; - ctx->MinMax.Min[GCOMP] = 1000; ctx->MinMax.Max[GCOMP] = -1000; - ctx->MinMax.Min[BCOMP] = 1000; ctx->MinMax.Max[BCOMP] = -1000; - ctx->MinMax.Min[ACOMP] = 1000; ctx->MinMax.Max[ACOMP] = -1000; - ctx->NewState |= _NEW_PIXEL; -} - - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -void _mesa_init_histogram( GLcontext * ctx ) -{ - int i; - - /* Histogram group */ - ctx->Histogram.Width = 0; - ctx->Histogram.Format = GL_RGBA; - ctx->Histogram.Sink = GL_FALSE; - ctx->Histogram.RedSize = 0; - ctx->Histogram.GreenSize = 0; - ctx->Histogram.BlueSize = 0; - ctx->Histogram.AlphaSize = 0; - ctx->Histogram.LuminanceSize = 0; - for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) { - ctx->Histogram.Count[i][0] = 0; - ctx->Histogram.Count[i][1] = 0; - ctx->Histogram.Count[i][2] = 0; - ctx->Histogram.Count[i][3] = 0; - } - - /* Min/Max group */ - ctx->MinMax.Format = GL_RGBA; - ctx->MinMax.Sink = GL_FALSE; - ctx->MinMax.Min[RCOMP] = 1000; ctx->MinMax.Max[RCOMP] = -1000; - ctx->MinMax.Min[GCOMP] = 1000; ctx->MinMax.Max[GCOMP] = -1000; - ctx->MinMax.Min[BCOMP] = 1000; ctx->MinMax.Max[BCOMP] = -1000; - ctx->MinMax.Min[ACOMP] = 1000; ctx->MinMax.Max[ACOMP] = -1000; -} diff --git a/src/libs/mesa/mesa/main/histogram.h b/src/libs/mesa/mesa/main/histogram.h deleted file mode 100644 index 367e9b11ba..0000000000 --- a/src/libs/mesa/mesa/main/histogram.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * \file histogram.h - * Histogram. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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 HISTOGRAM_H -#define HISTOGRAM_H - -#include "glheader.h" -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); - -extern void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); - -extern void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_ResetHistogram(GLenum target); - -extern void GLAPIENTRY -_mesa_ResetMinmax(GLenum target); - -extern void _mesa_init_histogram( GLcontext * ctx ); - -#else - -/** No-op */ -#define _mesa_init_histogram( c ) ((void) 0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/image.c b/src/libs/mesa/mesa/main/image.c deleted file mode 100644 index b41939cc7f..0000000000 --- a/src/libs/mesa/mesa/main/image.c +++ /dev/null @@ -1,5184 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.5 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - - -/** - * \file image.c - * Image handling. - */ - - -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "image.h" -#include "imports.h" -#include "macros.h" -#include "pixel.h" - - -/** - * NOTE: - * Normally, BYTE_TO_FLOAT(0) returns 0.00392 That causes problems when - * we later convert the float to a packed integer value (such as for - * GL_RGB5_A1) because we'll wind up with a non-zero value. - * - * We redefine the macros here so zero is handled correctly. - */ -#undef BYTE_TO_FLOAT -#define BYTE_TO_FLOAT(B) ((B) == 0 ? 0.0F : ((2.0F * (B) + 1.0F) * (1.0F/255.0F))) - -#undef SHORT_TO_FLOAT -#define SHORT_TO_FLOAT(S) ((S) == 0 ? 0.0F : ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))) - - - -/** Compute ceiling of integer quotient of A divided by B. */ -#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) - - -/** - * \return GL_TRUE if type is packed pixel type, GL_FALSE otherwise. - */ -GLboolean -_mesa_type_is_packed(GLenum type) -{ - switch (type) { - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - case GL_UNSIGNED_SHORT_8_8_MESA: - case GL_UNSIGNED_SHORT_8_8_REV_MESA: - case GL_UNSIGNED_INT_24_8_EXT: - return GL_TRUE; - } - - return GL_FALSE; -} - -/** - * Flip the 8 bits in each byte of the given array. - * - * \param p array. - * \param n number of bytes. - * - * \todo try this trick to flip bytes someday: - * \code - * v = ((v & 0x55555555) << 1) | ((v >> 1) & 0x55555555); - * v = ((v & 0x33333333) << 2) | ((v >> 2) & 0x33333333); - * v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f); - * \endcode - */ -static void -flip_bytes( GLubyte *p, GLuint n ) -{ - GLuint i, a, b; - for (i = 0; i < n; i++) { - b = (GLuint) p[i]; /* words are often faster than bytes */ - a = ((b & 0x01) << 7) | - ((b & 0x02) << 5) | - ((b & 0x04) << 3) | - ((b & 0x08) << 1) | - ((b & 0x10) >> 1) | - ((b & 0x20) >> 3) | - ((b & 0x40) >> 5) | - ((b & 0x80) >> 7); - p[i] = (GLubyte) a; - } -} - - -/** - * Flip the order of the 2 bytes in each word in the given array. - * - * \param p array. - * \param n number of words. - */ -void -_mesa_swap2( GLushort *p, GLuint n ) -{ - GLuint i; - for (i = 0; i < n; i++) { - p[i] = (p[i] >> 8) | ((p[i] << 8) & 0xff00); - } -} - - - -/* - * Flip the order of the 4 bytes in each word in the given array. - */ -void -_mesa_swap4( GLuint *p, GLuint n ) -{ - GLuint i, a, b; - for (i = 0; i < n; i++) { - b = p[i]; - a = (b >> 24) - | ((b >> 8) & 0xff00) - | ((b << 8) & 0xff0000) - | ((b << 24) & 0xff000000); - p[i] = a; - } -} - - -/** - * Get the size of a GL data type. - * - * \param type GL data type. - * - * \return the size, in bytes, of the given data type, 0 if a GL_BITMAP, or -1 - * if an invalid type enum. - */ -GLint -_mesa_sizeof_type( GLenum type ) -{ - switch (type) { - case GL_BITMAP: - return 0; - case GL_UNSIGNED_BYTE: - return sizeof(GLubyte); - case GL_BYTE: - return sizeof(GLbyte); - case GL_UNSIGNED_SHORT: - return sizeof(GLushort); - case GL_SHORT: - return sizeof(GLshort); - case GL_UNSIGNED_INT: - return sizeof(GLuint); - case GL_INT: - return sizeof(GLint); - case GL_FLOAT: - return sizeof(GLfloat); - case GL_HALF_FLOAT_ARB: - return sizeof(GLhalfARB); - default: - return -1; - } -} - - -/** - * Same as _mesa_sizeof_type() but also accepting the packed pixel - * format data types. - */ -GLint -_mesa_sizeof_packed_type( GLenum type ) -{ - switch (type) { - case GL_BITMAP: - return 0; - case GL_UNSIGNED_BYTE: - return sizeof(GLubyte); - case GL_BYTE: - return sizeof(GLbyte); - case GL_UNSIGNED_SHORT: - return sizeof(GLushort); - case GL_SHORT: - return sizeof(GLshort); - case GL_UNSIGNED_INT: - return sizeof(GLuint); - case GL_INT: - return sizeof(GLint); - case GL_HALF_FLOAT_ARB: - return sizeof(GLhalfARB); - case GL_FLOAT: - return sizeof(GLfloat); - case GL_UNSIGNED_BYTE_3_3_2: - return sizeof(GLubyte); - case GL_UNSIGNED_BYTE_2_3_3_REV: - return sizeof(GLubyte); - case GL_UNSIGNED_SHORT_5_6_5: - return sizeof(GLushort); - case GL_UNSIGNED_SHORT_5_6_5_REV: - return sizeof(GLushort); - case GL_UNSIGNED_SHORT_4_4_4_4: - return sizeof(GLushort); - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return sizeof(GLushort); - case GL_UNSIGNED_SHORT_5_5_5_1: - return sizeof(GLushort); - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return sizeof(GLushort); - case GL_UNSIGNED_INT_8_8_8_8: - return sizeof(GLuint); - case GL_UNSIGNED_INT_8_8_8_8_REV: - return sizeof(GLuint); - case GL_UNSIGNED_INT_10_10_10_2: - return sizeof(GLuint); - case GL_UNSIGNED_INT_2_10_10_10_REV: - return sizeof(GLuint); - case GL_UNSIGNED_SHORT_8_8_MESA: - case GL_UNSIGNED_SHORT_8_8_REV_MESA: - return sizeof(GLushort); - case GL_UNSIGNED_INT_24_8_EXT: - return sizeof(GLuint); - default: - return -1; - } -} - - -/** - * Get the number of components in a pixel format. - * - * \param format pixel format. - * - * \return the number of components in the given format, or -1 if a bad format. - */ -GLint -_mesa_components_in_format( GLenum format ) -{ - switch (format) { - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX8_EXT: - case GL_COLOR_INDEX12_EXT: - case GL_COLOR_INDEX16_EXT: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - return 1; - case GL_LUMINANCE_ALPHA: - return 2; - case GL_RGB: - return 3; - case GL_RGBA: - return 4; - case GL_BGR: - return 3; - case GL_BGRA: - return 4; - case GL_ABGR_EXT: - return 4; - case GL_YCBCR_MESA: - return 2; - case GL_DEPTH_STENCIL_EXT: - return 2; - default: - return -1; - } -} - - -/** - * Get the bytes per pixel of pixel format type pair. - * - * \param format pixel format. - * \param type pixel type. - * - * \return bytes per pixel, or -1 if a bad format or type was given. - */ -GLint -_mesa_bytes_per_pixel( GLenum format, GLenum type ) -{ - GLint comps = _mesa_components_in_format( format ); - if (comps < 0) - return -1; - - switch (type) { - case GL_BITMAP: - return 0; /* special case */ - case GL_BYTE: - case GL_UNSIGNED_BYTE: - return comps * sizeof(GLubyte); - case GL_SHORT: - case GL_UNSIGNED_SHORT: - return comps * sizeof(GLshort); - case GL_INT: - case GL_UNSIGNED_INT: - return comps * sizeof(GLint); - case GL_FLOAT: - return comps * sizeof(GLfloat); - case GL_HALF_FLOAT_ARB: - return comps * sizeof(GLhalfARB); - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - if (format == GL_RGB || format == GL_BGR) - return sizeof(GLubyte); - else - return -1; /* error */ - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - if (format == GL_RGB || format == GL_BGR) - return sizeof(GLushort); - else - return -1; /* error */ - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT) - return sizeof(GLushort); - else - return -1; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT) - return sizeof(GLuint); - else - return -1; - case GL_UNSIGNED_SHORT_8_8_MESA: - case GL_UNSIGNED_SHORT_8_8_REV_MESA: - if (format == GL_YCBCR_MESA) - return sizeof(GLushort); - else - return -1; - case GL_UNSIGNED_INT_24_8_EXT: - if (format == GL_DEPTH_STENCIL_EXT) - return sizeof(GLuint); - else - return -1; - default: - return -1; - } -} - - -/** - * Test for a legal pixel format and type. - * - * \param format pixel format. - * \param type pixel type. - * - * \return GL_TRUE if the given pixel format and type are legal, or GL_FALSE - * otherwise. - */ -GLboolean -_mesa_is_legal_format_and_type( GLcontext *ctx, GLenum format, GLenum type ) -{ - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - switch (type) { - case GL_BITMAP: - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - return GL_TRUE; - case GL_HALF_FLOAT_ARB: - return ctx->Extensions.ARB_half_float_pixel; - default: - return GL_FALSE; - } - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: -#if 0 /* not legal! see table 3.6 of the 1.5 spec */ - case GL_INTENSITY: -#endif - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_DEPTH_COMPONENT: - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - return GL_TRUE; - case GL_HALF_FLOAT_ARB: - return ctx->Extensions.ARB_half_float_pixel; - default: - return GL_FALSE; - } - case GL_RGB: - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - return GL_TRUE; - case GL_HALF_FLOAT_ARB: - return ctx->Extensions.ARB_half_float_pixel; - default: - return GL_FALSE; - } - case GL_BGR: - switch (type) { - /* NOTE: no packed types are supported with BGR. That's - * intentional, according to the GL spec. - */ - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - return GL_TRUE; - case GL_HALF_FLOAT_ARB: - return ctx->Extensions.ARB_half_float_pixel; - default: - return GL_FALSE; - } - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return GL_TRUE; - case GL_HALF_FLOAT_ARB: - return ctx->Extensions.ARB_half_float_pixel; - default: - return GL_FALSE; - } - case GL_YCBCR_MESA: - if (type == GL_UNSIGNED_SHORT_8_8_MESA || - type == GL_UNSIGNED_SHORT_8_8_REV_MESA) - return GL_TRUE; - else - return GL_FALSE; - case GL_DEPTH_STENCIL_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil - && type == GL_UNSIGNED_INT_24_8_EXT) - return GL_TRUE; - else - return GL_FALSE; - default: - ; /* fall-through */ - } - return GL_FALSE; -} - - -/** - * Return the address of a specific pixel in an image (1D, 2D or 3D). - * - * Pixel unpacking/packing parameters are observed according to \p packing. - * - * \param dimensions either 1, 2 or 3 to indicate dimensionality of image - * \param image starting address of image data - * \param width the image width - * \param height theimage height - * \param format the pixel format - * \param type the pixel data type - * \param packing the pixelstore attributes - * \param img which image in the volume (0 for 1D or 2D images) - * \param row row of pixel in the image (0 for 1D images) - * \param column column of pixel in the image - * - * \return address of pixel on success, or NULL on error. - * - * \sa gl_pixelstore_attrib. - */ -GLvoid * -_mesa_image_address( GLuint dimensions, - const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint img, GLint row, GLint column ) -{ - GLint alignment; /* 1, 2 or 4 */ - GLint pixels_per_row; - GLint rows_per_image; - GLint skiprows; - GLint skippixels; - GLint skipimages; /* for 3-D volume images */ - GLubyte *pixel_addr; - - ASSERT(dimensions >= 1 && dimensions <= 3); - - alignment = packing->Alignment; - if (packing->RowLength > 0) { - pixels_per_row = packing->RowLength; - } - else { - pixels_per_row = width; - } - if (packing->ImageHeight > 0) { - rows_per_image = packing->ImageHeight; - } - else { - rows_per_image = height; - } - - skippixels = packing->SkipPixels; - /* Note: SKIP_ROWS _is_ used for 1D images */ - skiprows = packing->SkipRows; - /* Note: SKIP_IMAGES is only used for 3D images */ - skipimages = (dimensions == 3) ? packing->SkipImages : 0; - - if (type == GL_BITMAP) { - /* BITMAP data */ - GLint comp_per_pixel; /* components per pixel */ - GLint bytes_per_comp; /* bytes per component */ - GLint bytes_per_row; - GLint bytes_per_image; - - /* Compute bytes per component */ - bytes_per_comp = _mesa_sizeof_packed_type( type ); - if (bytes_per_comp < 0) { - return NULL; - } - - /* Compute number of components per pixel */ - comp_per_pixel = _mesa_components_in_format( format ); - if (comp_per_pixel < 0) { - return NULL; - } - - bytes_per_row = alignment - * CEILING( comp_per_pixel*pixels_per_row, 8*alignment ); - - bytes_per_image = bytes_per_row * rows_per_image; - - pixel_addr = (GLubyte *) image - + (skipimages + img) * bytes_per_image - + (skiprows + row) * bytes_per_row - + (skippixels + column) / 8; - } - else { - /* Non-BITMAP data */ - GLint bytes_per_pixel, bytes_per_row, remainder, bytes_per_image; - GLint topOfImage; - - bytes_per_pixel = _mesa_bytes_per_pixel( format, type ); - - /* The pixel type and format should have been error checked earlier */ - assert(bytes_per_pixel > 0); - - bytes_per_row = pixels_per_row * bytes_per_pixel; - remainder = bytes_per_row % alignment; - if (remainder > 0) - bytes_per_row += (alignment - remainder); - - ASSERT(bytes_per_row % alignment == 0); - - bytes_per_image = bytes_per_row * rows_per_image; - - if (packing->Invert) { - /* set pixel_addr to the last row */ - topOfImage = bytes_per_row * (height - 1); - bytes_per_row = -bytes_per_row; - } - else { - topOfImage = 0; - } - - /* compute final pixel address */ - pixel_addr = (GLubyte *) image - + (skipimages + img) * bytes_per_image - + topOfImage - + (skiprows + row) * bytes_per_row - + (skippixels + column) * bytes_per_pixel; - } - - return (GLvoid *) pixel_addr; -} - - -GLvoid * -_mesa_image_address1d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, - GLenum format, GLenum type, - GLint column ) -{ - return _mesa_image_address(1, packing, image, width, 1, - format, type, 0, 0, column); -} - - -GLvoid * -_mesa_image_address2d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint row, GLint column ) -{ - return _mesa_image_address(2, packing, image, width, height, - format, type, 0, row, column); -} - - -GLvoid * -_mesa_image_address3d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint img, GLint row, GLint column ) -{ - return _mesa_image_address(3, packing, image, width, height, - format, type, img, row, column); -} - - - -/** - * Compute the stride (in bytes) between image rows. - * - * \param packing the pixelstore attributes - * \param width image width. - * \param format pixel format. - * \param type pixel data type. - * - * \return the stride in bytes for the given parameters, or -1 if error - */ -GLint -_mesa_image_row_stride( const struct gl_pixelstore_attrib *packing, - GLint width, GLenum format, GLenum type ) -{ - GLint bytesPerRow, remainder; - - ASSERT(packing); - - if (type == GL_BITMAP) { - if (packing->RowLength == 0) { - bytesPerRow = (width + 7) / 8; - } - else { - bytesPerRow = (packing->RowLength + 7) / 8; - } - } - else { - /* Non-BITMAP data */ - const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type); - if (bytesPerPixel <= 0) - return -1; /* error */ - if (packing->RowLength == 0) { - bytesPerRow = bytesPerPixel * width; - } - else { - bytesPerRow = bytesPerPixel * packing->RowLength; - } - } - - remainder = bytesPerRow % packing->Alignment; - if (remainder > 0) { - bytesPerRow += (packing->Alignment - remainder); - } - - if (packing->Invert) { - /* negate the bytes per row (negative row stride) */ - bytesPerRow = -bytesPerRow; - } - - return bytesPerRow; -} - - -#if _HAVE_FULL_GL - -/* - * Compute the stride between images in a 3D texture (in bytes) for the given - * pixel packing parameters and image width, format and type. - */ -GLint -_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, - GLint width, GLint height, - GLenum format, GLenum type ) -{ - GLint bytesPerRow, bytesPerImage, remainder; - - ASSERT(packing); - - if (type == GL_BITMAP) { - if (packing->RowLength == 0) { - bytesPerRow = (width + 7) / 8; - } - else { - bytesPerRow = (packing->RowLength + 7) / 8; - } - } - else { - const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type); - - if (bytesPerPixel <= 0) - return -1; /* error */ - if (packing->RowLength == 0) { - bytesPerRow = bytesPerPixel * width; - } - else { - bytesPerRow = bytesPerPixel * packing->RowLength; - } - } - - remainder = bytesPerRow % packing->Alignment; - if (remainder > 0) - bytesPerRow += (packing->Alignment - remainder); - - if (packing->ImageHeight == 0) - bytesPerImage = bytesPerRow * height; - else - bytesPerImage = bytesPerRow * packing->ImageHeight; - - return bytesPerImage; -} - - -/* - * Unpack a 32x32 pixel polygon stipple from user memory using the - * current pixel unpack settings. - */ -void -_mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32], - const struct gl_pixelstore_attrib *unpacking ) -{ - GLubyte *ptrn = (GLubyte *) _mesa_unpack_bitmap(32, 32, pattern, unpacking); - if (ptrn) { - /* Convert pattern from GLubytes to GLuints and handle big/little - * endian differences - */ - GLubyte *p = ptrn; - GLint i; - for (i = 0; i < 32; i++) { - dest[i] = (p[0] << 24) - | (p[1] << 16) - | (p[2] << 8) - | (p[3] ); - p += 4; - } - _mesa_free(ptrn); - } -} - - -/* - * Pack polygon stipple into user memory given current pixel packing - * settings. - */ -void -_mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest, - const struct gl_pixelstore_attrib *packing ) -{ - /* Convert pattern from GLuints to GLubytes to handle big/little - * endian differences. - */ - GLubyte ptrn[32*4]; - GLint i; - for (i = 0; i < 32; i++) { - ptrn[i * 4 + 0] = (GLubyte) ((pattern[i] >> 24) & 0xff); - ptrn[i * 4 + 1] = (GLubyte) ((pattern[i] >> 16) & 0xff); - ptrn[i * 4 + 2] = (GLubyte) ((pattern[i] >> 8 ) & 0xff); - ptrn[i * 4 + 3] = (GLubyte) ((pattern[i] ) & 0xff); - } - - _mesa_pack_bitmap(32, 32, ptrn, dest, packing); -} - - -/* - * 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 *) _mesa_malloc( bytes ); - if (!buffer) - return NULL; - - width_in_bytes = CEILING( width, 8 ); - dst = buffer; - for (row = 0; row < height; row++) { - const GLubyte *src = (const GLubyte *) - _mesa_image_address2d(packing, pixels, width, height, - GL_COLOR_INDEX, GL_BITMAP, row, 0); - if (!src) { - _mesa_free(buffer); - return NULL; - } - - if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); - if (packing->LsbFirst) { - 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; - const 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; - const 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; -} - - -/* - * Pack bitmap data. - */ -void -_mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, - GLubyte *dest, const struct gl_pixelstore_attrib *packing ) -{ - GLint row, width_in_bytes; - const GLubyte *src; - - if (!source) - return; - - width_in_bytes = CEILING( width, 8 ); - src = source; - for (row = 0; row < height; row++) { - GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dest, - width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0); - if (!dst) - return; - - if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); - if (packing->LsbFirst) { - flip_bytes( dst, width_in_bytes ); - } - } - else { - /* handling SkipPixels is a bit tricky (no pun intended!) */ - GLint i; - if (packing->LsbFirst) { - GLubyte srcMask = 128; - GLubyte dstMask = 1 << (packing->SkipPixels & 0x7); - const 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 == 128) { - dstMask = 1; - d++; - *d = 0; - } - else { - dstMask = dstMask << 1; - } - } - } - else { - GLubyte srcMask = 128; - GLubyte dstMask = 128 >> (packing->SkipPixels & 0x7); - const 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; - } - } - } - } - src += width_in_bytes; - } -} - - -/**********************************************************************/ -/***** Pixel processing functions ******/ -/**********************************************************************/ - -/* - * Apply scale and bias factors to an array of RGBA pixels. - */ -void -_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], - GLfloat rScale, GLfloat gScale, - GLfloat bScale, GLfloat aScale, - GLfloat rBias, GLfloat gBias, - GLfloat bBias, GLfloat aBias) -{ - if (rScale != 1.0 || rBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = rgba[i][RCOMP] * rScale + rBias; - } - } - if (gScale != 1.0 || gBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = rgba[i][GCOMP] * gScale + gBias; - } - } - if (bScale != 1.0 || bBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][BCOMP] = rgba[i][BCOMP] * bScale + bBias; - } - } - if (aScale != 1.0 || aBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = rgba[i][ACOMP] * aScale + aBias; - } - } -} - - -/* - * Apply pixel mapping to an array of floating point RGBA pixels. - */ -void -_mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) -{ - const GLfloat rscale = (GLfloat) (ctx->PixelMaps.RtoR.Size - 1); - const GLfloat gscale = (GLfloat) (ctx->PixelMaps.GtoG.Size - 1); - const GLfloat bscale = (GLfloat) (ctx->PixelMaps.BtoB.Size - 1); - const GLfloat ascale = (GLfloat) (ctx->PixelMaps.AtoA.Size - 1); - const GLfloat *rMap = ctx->PixelMaps.RtoR.Map; - const GLfloat *gMap = ctx->PixelMaps.GtoG.Map; - const GLfloat *bMap = ctx->PixelMaps.BtoB.Map; - const GLfloat *aMap = ctx->PixelMaps.AtoA.Map; - GLuint i; - for (i=0;iPixel.PostColorMatrixScale[0]; - const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0]; - const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1]; - const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1]; - const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2]; - const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2]; - const GLfloat as = ctx->Pixel.PostColorMatrixScale[3]; - const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3]; - const GLfloat *m = ctx->ColorMatrixStack.Top->m; - GLuint i; - for (i = 0; i < n; i++) { - const GLfloat r = rgba[i][RCOMP]; - const GLfloat g = rgba[i][GCOMP]; - const GLfloat b = rgba[i][BCOMP]; - const GLfloat a = rgba[i][ACOMP]; - rgba[i][RCOMP] = (m[0] * r + m[4] * g + m[ 8] * b + m[12] * a) * rs + rb; - rgba[i][GCOMP] = (m[1] * r + m[5] * g + m[ 9] * b + m[13] * a) * gs + gb; - rgba[i][BCOMP] = (m[2] * r + m[6] * g + m[10] * b + m[14] * a) * bs + bb; - rgba[i][ACOMP] = (m[3] * r + m[7] * g + m[11] * b + m[15] * a) * as + ab; - } -} - - -/** - * Apply a color table lookup to an array of floating point RGBA colors. - */ -void -_mesa_lookup_rgba_float(const struct gl_color_table *table, - GLuint n, GLfloat rgba[][4]) -{ - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = table->TableF; - GLuint i; - - if (!table->TableF || table->Size == 0) - return; - - switch (table->_BaseFormat) { - case GL_INTENSITY: - /* replace RGBA with I */ - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = lut[CLAMP(j, 0, max)]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = c; - } - break; - case GL_LUMINANCE: - /* replace RGB with L */ - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = lut[CLAMP(j, 0, max)]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = c; - } - break; - case GL_ALPHA: - /* replace A with A */ - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = lut[CLAMP(j, 0, max)]; - } - break; - case GL_LUMINANCE_ALPHA: - /* replace RGBA with LLLA */ - for (i = 0; i < n; i++) { - GLint jL = IROUND(rgba[i][RCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - GLfloat luminance, alpha; - jL = CLAMP(jL, 0, max); - jA = CLAMP(jA, 0, max); - luminance = lut[jL * 2 + 0]; - alpha = lut[jA * 2 + 1]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha;; - } - break; - case GL_RGB: - /* replace RGB with RGB */ - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - rgba[i][RCOMP] = lut[jR * 3 + 0]; - rgba[i][GCOMP] = lut[jG * 3 + 1]; - rgba[i][BCOMP] = lut[jB * 3 + 2]; - } - break; - case GL_RGBA: - /* replace RGBA with RGBA */ - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - jA = CLAMP(jA, 0, max); - rgba[i][RCOMP] = lut[jR * 4 + 0]; - rgba[i][GCOMP] = lut[jG * 4 + 1]; - rgba[i][BCOMP] = lut[jB * 4 + 2]; - rgba[i][ACOMP] = lut[jA * 4 + 3]; - } - break; - default: - _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_float"); - return; - } -} - - - -/** - * Apply a color table lookup to an array of ubyte/RGBA colors. - */ -void -_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, - GLuint n, GLubyte rgba[][4]) -{ - const GLubyte *lut = table->TableUB; - const GLfloat scale = (GLfloat) (table->Size - 1) / (GLfloat)255.0; - GLuint i; - - if (!table->TableUB || table->Size == 0) - return; - - switch (table->_BaseFormat) { - case GL_INTENSITY: - /* replace RGBA with I */ - if (table->Size == 256) { - for (i = 0; i < n; i++) { - const GLubyte c = lut[rgba[i][RCOMP]]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = c; - } - } - else { - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = lut[j]; - } - } - break; - case GL_LUMINANCE: - /* replace RGB with L */ - if (table->Size == 256) { - for (i = 0; i < n; i++) { - const GLubyte c = lut[rgba[i][RCOMP]]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = c; - } - } - else { - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = lut[j]; - } - } - break; - case GL_ALPHA: - /* replace A with A */ - if (table->Size == 256) { - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = lut[rgba[i][ACOMP]]; - } - } - else { - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = lut[j]; - } - } - break; - case GL_LUMINANCE_ALPHA: - /* replace RGBA with LLLA */ - if (table->Size == 256) { - for (i = 0; i < n; i++) { - GLubyte l = lut[rgba[i][RCOMP] * 2 + 0]; - GLubyte a = lut[rgba[i][ACOMP] * 2 + 1];; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = l; - rgba[i][ACOMP] = a; - } - } - else { - for (i = 0; i < n; i++) { - GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - GLubyte luminance = lut[jL * 2 + 0]; - GLubyte alpha = lut[jA * 2 + 1]; - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha; - } - } - break; - case GL_RGB: - if (table->Size == 256) { - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 3 + 0]; - rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 3 + 1]; - rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2]; - } - } - else { - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - rgba[i][RCOMP] = lut[jR * 3 + 0]; - rgba[i][GCOMP] = lut[jG * 3 + 1]; - rgba[i][BCOMP] = lut[jB * 3 + 2]; - } - } - break; - case GL_RGBA: - if (table->Size == 256) { - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 4 + 0]; - rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 4 + 1]; - rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 4 + 2]; - rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3]; - } - } - else { - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]); - } - } - break; - default: - _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan"); - return; - } -} - - - -/* - * Map color indexes to float rgba values. - */ -void -_mesa_map_ci_to_rgba( const GLcontext *ctx, GLuint n, - const GLuint index[], GLfloat rgba[][4] ) -{ - GLuint rmask = ctx->PixelMaps.ItoR.Size - 1; - GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; - GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; - GLuint amask = ctx->PixelMaps.ItoA.Size - 1; - const GLfloat *rMap = ctx->PixelMaps.ItoR.Map; - const GLfloat *gMap = ctx->PixelMaps.ItoG.Map; - const GLfloat *bMap = ctx->PixelMaps.ItoB.Map; - const GLfloat *aMap = ctx->PixelMaps.ItoA.Map; - GLuint i; - for (i=0;iPixelMaps.ItoR.Size - 1; - GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; - GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; - GLuint amask = ctx->PixelMaps.ItoA.Size - 1; - const GLubyte *rMap = ctx->PixelMaps.ItoR.Map8; - const GLubyte *gMap = ctx->PixelMaps.ItoG.Map8; - const GLubyte *bMap = ctx->PixelMaps.ItoB.Map8; - const GLubyte *aMap = ctx->PixelMaps.ItoA.Map8; - GLuint i; - for (i=0;iPixel.DepthScale; - const GLfloat bias = ctx->Pixel.DepthBias; - GLuint i; - for (i = 0; i < n; i++) { - GLfloat d = depthValues[i] * scale + bias; - depthValues[i] = CLAMP(d, 0.0F, 1.0F); - } -} - - -void -_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n, - GLuint depthValues[]) -{ - const GLdouble max = (double) 0xffffffff; - const GLdouble scale = ctx->Pixel.DepthScale; - const GLdouble bias = ctx->Pixel.DepthBias * max; - GLuint i; - for (i = 0; i < n; i++) { - GLdouble d = (GLdouble) depthValues[i] * scale + bias; - d = CLAMP(d, 0.0, max); - depthValues[i] = (GLuint) d; - } -} - - - -/* - * Update the min/max values from an array of fragment colors. - */ -static void -update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - /* update mins */ - if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP]) - ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP]) - ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP]) - ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP]) - ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP]; - - /* update maxs */ - if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP]) - ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP]) - ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP]) - ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP]) - ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP]; - } -} - - -/* - * Update the histogram values from an array of fragment colors. - */ -static void -update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - const GLint max = ctx->Histogram.Width - 1; - GLfloat w = (GLfloat) max; - GLuint i; - - if (ctx->Histogram.Width == 0) - return; - - for (i = 0; i < n; i++) { - GLint ri = IROUND(rgba[i][RCOMP] * w); - GLint gi = IROUND(rgba[i][GCOMP] * w); - GLint bi = IROUND(rgba[i][BCOMP] * w); - GLint ai = IROUND(rgba[i][ACOMP] * w); - ri = CLAMP(ri, 0, max); - gi = CLAMP(gi, 0, max); - bi = CLAMP(bi, 0, max); - ai = CLAMP(ai, 0, max); - ctx->Histogram.Count[ri][RCOMP]++; - ctx->Histogram.Count[gi][GCOMP]++; - ctx->Histogram.Count[bi][BCOMP]++; - ctx->Histogram.Count[ai][ACOMP]++; - } -} - - -/** - * Apply various pixel transfer operations to an array of RGBA pixels - * as indicated by the transferOps bitmask - */ -void -_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, - GLuint n, GLfloat rgba[][4]) -{ - /* scale & bias */ - if (transferOps & IMAGE_SCALE_BIAS_BIT) { - _mesa_scale_and_bias_rgba(n, rgba, - ctx->Pixel.RedScale, ctx->Pixel.GreenScale, - ctx->Pixel.BlueScale, ctx->Pixel.AlphaScale, - ctx->Pixel.RedBias, ctx->Pixel.GreenBias, - ctx->Pixel.BlueBias, ctx->Pixel.AlphaBias); - } - /* color map lookup */ - if (transferOps & IMAGE_MAP_COLOR_BIT) { - _mesa_map_rgba( ctx, n, rgba ); - } - /* GL_COLOR_TABLE lookup */ - if (transferOps & IMAGE_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_PRECONVOLUTION], n, rgba); - } - /* convolution */ - if (transferOps & IMAGE_CONVOLUTION_BIT) { - /* this has to be done in the calling code */ - _mesa_problem(ctx, "IMAGE_CONVOLUTION_BIT set in _mesa_apply_transfer_ops"); - } - /* GL_POST_CONVOLUTION_RED/GREEN/BLUE/ALPHA_SCALE/BIAS */ - if (transferOps & IMAGE_POST_CONVOLUTION_SCALE_BIAS) { - _mesa_scale_and_bias_rgba(n, rgba, - ctx->Pixel.PostConvolutionScale[RCOMP], - ctx->Pixel.PostConvolutionScale[GCOMP], - ctx->Pixel.PostConvolutionScale[BCOMP], - ctx->Pixel.PostConvolutionScale[ACOMP], - ctx->Pixel.PostConvolutionBias[RCOMP], - ctx->Pixel.PostConvolutionBias[GCOMP], - ctx->Pixel.PostConvolutionBias[BCOMP], - ctx->Pixel.PostConvolutionBias[ACOMP]); - } - /* GL_POST_CONVOLUTION_COLOR_TABLE lookup */ - if (transferOps & IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCONVOLUTION], n, rgba); - } - /* color matrix transform */ - if (transferOps & IMAGE_COLOR_MATRIX_BIT) { - _mesa_transform_rgba(ctx, n, rgba); - } - /* GL_POST_COLOR_MATRIX_COLOR_TABLE lookup */ - if (transferOps & IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) { - _mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX], n, rgba); - } - /* update histogram count */ - if (transferOps & IMAGE_HISTOGRAM_BIT) { - update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba); - } - /* update min/max values */ - if (transferOps & IMAGE_MIN_MAX_BIT) { - update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba); - } - /* clamping to [0,1] */ - if (transferOps & IMAGE_CLAMP_BIT) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); - rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); - rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); - rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); - } - } -} - - -/* - * Apply color index shift and offset to an array of pixels. - */ -static void -shift_and_offset_ci( const GLcontext *ctx, GLuint n, GLuint indexes[] ) -{ - GLint shift = ctx->Pixel.IndexShift; - GLint offset = ctx->Pixel.IndexOffset; - GLuint i; - if (shift > 0) { - for (i=0;i> shift) + offset; - } - } - else { - for (i=0;iPixelMaps.ItoI.Size - 1; - GLuint i; - for (i = 0; i < n; i++) { - const GLuint j = indexes[i] & mask; - indexes[i] = IROUND(ctx->PixelMaps.ItoI.Map[j]); - } - } -} - - -/** - * Apply stencil index shift, offset and table lookup to an array - * of stencil values. - */ -void -_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, - GLstencil stencil[]) -{ - if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) { - const GLint offset = ctx->Pixel.IndexOffset; - GLint shift = ctx->Pixel.IndexShift; - GLuint i; - if (shift > 0) { - for (i = 0; i < n; i++) { - stencil[i] = (stencil[i] << shift) + offset; - } - } - else if (shift < 0) { - shift = -shift; - for (i = 0; i < n; i++) { - stencil[i] = (stencil[i] >> shift) + offset; - } - } - else { - for (i = 0; i < n; i++) { - stencil[i] = stencil[i] + offset; - } - } - } - if (ctx->Pixel.MapStencilFlag) { - GLuint mask = ctx->PixelMaps.StoS.Size - 1; - GLuint i; - for (i = 0; i < n; i++) { - stencil[i] = (GLstencil)ctx->PixelMaps.StoS.Map[ stencil[i] & mask ]; - } - } -} - - -/** - * Used to pack an array [][4] of RGBA float colors as specified - * by the dstFormat, dstType and dstPacking. Used by glReadPixels, - * glGetConvolutionFilter(), etc. - * Incoming colors will be clamped to [0,1] if needed. - * Note: the rgba values will be modified by this function when any pixel - * transfer ops are enabled. - */ -void -_mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], - GLenum dstFormat, GLenum dstType, - GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLbitfield transferOps) -{ - GLfloat luminance[MAX_WIDTH]; - const GLint comps = _mesa_components_in_format(dstFormat); - GLuint i; - - if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { - /* need to clamp to [0, 1] */ - transferOps |= IMAGE_CLAMP_BIT; - } - - if (transferOps) { - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); - if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) { - return; - } - } - - if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { - /* compute luminance values */ - if (transferOps & IMAGE_CLAMP_BIT) { - for (i = 0; i < n; i++) { - GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - luminance[i] = CLAMP(sum, 0.0F, 1.0F); - } - } - else { - for (i = 0; i < n; i++) { - luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - } - } - } - - /* - * Pack/store the pixels. Ugh! Lots of cases!!! - */ - switch (dstType) { - case GL_UNSIGNED_BYTE: - { - GLubyte *dst = (GLubyte *) dstAddr; - switch (dstFormat) { - case GL_RED: - for (i=0;iSwapBytes) { - GLint swapSize = _mesa_sizeof_packed_type(dstType); - if (swapSize == 2) { - if (dstPacking->SwapBytes) { - _mesa_swap2((GLushort *) dstAddr, n * comps); - } - } - else if (swapSize == 4) { - if (dstPacking->SwapBytes) { - _mesa_swap4((GLuint *) dstAddr, n * comps); - } - } - } -} - - -#define SWAP2BYTE(VALUE) \ - { \ - GLubyte *bytes = (GLubyte *) &(VALUE); \ - GLubyte tmp = bytes[0]; \ - bytes[0] = bytes[1]; \ - bytes[1] = tmp; \ - } - -#define SWAP4BYTE(VALUE) \ - { \ - GLubyte *bytes = (GLubyte *) &(VALUE); \ - GLubyte tmp = bytes[0]; \ - bytes[0] = bytes[3]; \ - bytes[3] = tmp; \ - tmp = bytes[1]; \ - bytes[1] = bytes[2]; \ - bytes[2] = tmp; \ - } - - -static void -extract_uint_indexes(GLuint n, GLuint indexes[], - GLenum srcFormat, GLenum srcType, const GLvoid *src, - const struct gl_pixelstore_attrib *unpack ) -{ - ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX); - - 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_UNSIGNED_INT_24_8_EXT || - srcType == GL_HALF_FLOAT_ARB || - srcType == GL_FLOAT); - - switch (srcType) { - case GL_BITMAP: - { - GLubyte *ubsrc = (GLubyte *) src; - if (unpack->LsbFirst) { - GLubyte mask = 1 << (unpack->SkipPixels & 0x7); - GLuint i; - for (i = 0; i < n; i++) { - indexes[i] = (*ubsrc & mask) ? 1 : 0; - if (mask == 128) { - mask = 1; - ubsrc++; - } - else { - mask = mask << 1; - } - } - } - else { - GLubyte mask = 128 >> (unpack->SkipPixels & 0x7); - GLuint i; - for (i = 0; i < n; i++) { - indexes[i] = (*ubsrc & mask) ? 1 : 0; - if (mask == 1) { - mask = 128; - ubsrc++; - } - else { - mask = mask >> 1; - } - } - } - } - break; - case GL_UNSIGNED_BYTE: - { - GLuint i; - const GLubyte *s = (const GLubyte *) src; - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - break; - case GL_BYTE: - { - GLuint i; - const GLbyte *s = (const GLbyte *) src; - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - break; - case GL_UNSIGNED_SHORT: - { - GLuint i; - const GLushort *s = (const GLushort *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLushort value = s[i]; - SWAP2BYTE(value); - indexes[i] = value; - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - } - break; - case GL_SHORT: - { - GLuint i; - const GLshort *s = (const GLshort *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLshort value = s[i]; - SWAP2BYTE(value); - indexes[i] = value; - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint i; - const GLuint *s = (const GLuint *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLuint value = s[i]; - SWAP4BYTE(value); - indexes[i] = value; - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - } - break; - case GL_INT: - { - GLuint i; - const GLint *s = (const GLint *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLint value = s[i]; - SWAP4BYTE(value); - indexes[i] = value; - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = s[i]; - } - } - break; - case GL_FLOAT: - { - GLuint i; - const GLfloat *s = (const GLfloat *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLfloat value = s[i]; - SWAP4BYTE(value); - indexes[i] = (GLuint) value; - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = (GLuint) s[i]; - } - } - break; - case GL_HALF_FLOAT_ARB: - { - GLuint i; - const GLhalfARB *s = (const GLhalfARB *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLhalfARB value = s[i]; - SWAP2BYTE(value); - indexes[i] = (GLuint) _mesa_half_to_float(value); - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = (GLuint) _mesa_half_to_float(s[i]); - } - } - break; - case GL_UNSIGNED_INT_24_8_EXT: - { - GLuint i; - const GLuint *s = (const GLuint *) src; - if (unpack->SwapBytes) { - for (i = 0; i < n; i++) { - GLuint value = s[i]; - SWAP4BYTE(value); - indexes[i] = value & 0xff; /* lower 8 bits */ - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = s[i] & 0xfff; /* lower 8 bits */ - } - } - break; - - default: - _mesa_problem(NULL, "bad srcType in extract_uint_indexes"); - return; - } -} - - -/* - * This function extracts floating point RGBA values from arbitrary - * image data. srcFormat and srcType are the format and type parameters - * passed to glDrawPixels, glTexImage[123]D, glTexSubImage[123]D, etc. - * - * Refering to section 3.6.4 of the OpenGL 1.2 spec, this function - * implements the "Conversion to floating point", "Conversion to RGB", - * and "Final Expansion to RGBA" operations. - * - * Args: n - number of pixels - * rgba - output colors - * srcFormat - format of incoming data - * srcType - data type of incoming data - * src - source data pointer - * swapBytes - perform byteswapping of incoming data? - */ -static void -extract_float_rgba(GLuint n, GLfloat rgba[][4], - GLenum srcFormat, GLenum srcType, const GLvoid *src, - GLboolean swapBytes) -{ - GLint redIndex, greenIndex, blueIndex, alphaIndex; - GLint stride; - GLint rComp, bComp, gComp, aComp; - - ASSERT(srcFormat == GL_RED || - srcFormat == GL_GREEN || - srcFormat == GL_BLUE || - srcFormat == GL_ALPHA || - srcFormat == GL_LUMINANCE || - srcFormat == GL_LUMINANCE_ALPHA || - srcFormat == GL_INTENSITY || - srcFormat == GL_RGB || - srcFormat == GL_BGR || - srcFormat == GL_RGBA || - srcFormat == GL_BGRA || - srcFormat == GL_ABGR_EXT); - - ASSERT(srcType == GL_UNSIGNED_BYTE || - srcType == GL_BYTE || - srcType == GL_UNSIGNED_SHORT || - srcType == GL_SHORT || - srcType == GL_UNSIGNED_INT || - srcType == GL_INT || - srcType == GL_HALF_FLOAT_ARB || - 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); - - rComp = gComp = bComp = aComp = -1; - - switch (srcFormat) { - case GL_RED: - redIndex = 0; - greenIndex = blueIndex = alphaIndex = -1; - stride = 1; - break; - case GL_GREEN: - greenIndex = 0; - redIndex = blueIndex = alphaIndex = -1; - stride = 1; - break; - case GL_BLUE: - blueIndex = 0; - redIndex = greenIndex = alphaIndex = -1; - stride = 1; - break; - case GL_ALPHA: - redIndex = greenIndex = blueIndex = -1; - alphaIndex = 0; - stride = 1; - break; - case GL_LUMINANCE: - redIndex = greenIndex = blueIndex = 0; - alphaIndex = -1; - stride = 1; - break; - case GL_LUMINANCE_ALPHA: - redIndex = greenIndex = blueIndex = 0; - alphaIndex = 1; - stride = 2; - break; - case GL_INTENSITY: - redIndex = greenIndex = blueIndex = alphaIndex = 0; - stride = 1; - break; - case GL_RGB: - redIndex = 0; - greenIndex = 1; - blueIndex = 2; - alphaIndex = -1; - rComp = 0; - gComp = 1; - bComp = 2; - aComp = 3; - stride = 3; - break; - case GL_BGR: - redIndex = 2; - greenIndex = 1; - blueIndex = 0; - alphaIndex = -1; - rComp = 2; - gComp = 1; - bComp = 0; - aComp = 3; - stride = 3; - break; - case GL_RGBA: - redIndex = 0; - greenIndex = 1; - blueIndex = 2; - alphaIndex = 3; - rComp = 0; - gComp = 1; - bComp = 2; - aComp = 3; - stride = 4; - break; - case GL_BGRA: - redIndex = 2; - greenIndex = 1; - blueIndex = 0; - alphaIndex = 3; - rComp = 2; - gComp = 1; - bComp = 0; - aComp = 3; - stride = 4; - break; - case GL_ABGR_EXT: - redIndex = 3; - greenIndex = 2; - blueIndex = 1; - alphaIndex = 0; - rComp = 3; - gComp = 2; - bComp = 1; - aComp = 0; - stride = 4; - break; - default: - _mesa_problem(NULL, "bad srcFormat in extract float data"); - return; - } - - -#define PROCESS(INDEX, CHANNEL, DEFAULT, TYPE, CONVERSION) \ - if ((INDEX) < 0) { \ - GLuint i; \ - for (i = 0; i < n; i++) { \ - rgba[i][CHANNEL] = DEFAULT; \ - } \ - } \ - else if (swapBytes) { \ - const TYPE *s = (const TYPE *) src; \ - GLuint i; \ - for (i = 0; i < n; i++) { \ - TYPE value = s[INDEX]; \ - if (sizeof(TYPE) == 2) { \ - SWAP2BYTE(value); \ - } \ - else if (sizeof(TYPE) == 4) { \ - SWAP4BYTE(value); \ - } \ - rgba[i][CHANNEL] = (GLfloat) CONVERSION(value); \ - s += stride; \ - } \ - } \ - else { \ - const TYPE *s = (const TYPE *) src; \ - GLuint i; \ - for (i = 0; i < n; i++) { \ - rgba[i][CHANNEL] = (GLfloat) CONVERSION(s[INDEX]); \ - s += stride; \ - } \ - } - - switch (srcType) { - case GL_UNSIGNED_BYTE: - PROCESS(redIndex, RCOMP, 0.0F, GLubyte, UBYTE_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLubyte, UBYTE_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLubyte, UBYTE_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLubyte, UBYTE_TO_FLOAT); - break; - case GL_BYTE: - PROCESS(redIndex, RCOMP, 0.0F, GLbyte, BYTE_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLbyte, BYTE_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLbyte, BYTE_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLbyte, BYTE_TO_FLOAT); - break; - case GL_UNSIGNED_SHORT: - PROCESS(redIndex, RCOMP, 0.0F, GLushort, USHORT_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLushort, USHORT_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLushort, USHORT_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLushort, USHORT_TO_FLOAT); - break; - case GL_SHORT: - PROCESS(redIndex, RCOMP, 0.0F, GLshort, SHORT_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLshort, SHORT_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLshort, SHORT_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLshort, SHORT_TO_FLOAT); - break; - case GL_UNSIGNED_INT: - PROCESS(redIndex, RCOMP, 0.0F, GLuint, UINT_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLuint, UINT_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLuint, UINT_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLuint, UINT_TO_FLOAT); - break; - case GL_INT: - PROCESS(redIndex, RCOMP, 0.0F, GLint, INT_TO_FLOAT); - PROCESS(greenIndex, GCOMP, 0.0F, GLint, INT_TO_FLOAT); - PROCESS(blueIndex, BCOMP, 0.0F, GLint, INT_TO_FLOAT); - PROCESS(alphaIndex, ACOMP, 1.0F, GLint, INT_TO_FLOAT); - break; - case GL_FLOAT: - PROCESS(redIndex, RCOMP, 0.0F, GLfloat, (GLfloat)); - PROCESS(greenIndex, GCOMP, 0.0F, GLfloat, (GLfloat)); - PROCESS(blueIndex, BCOMP, 0.0F, GLfloat, (GLfloat)); - PROCESS(alphaIndex, ACOMP, 1.0F, GLfloat, (GLfloat)); - break; - case GL_HALF_FLOAT_ARB: - PROCESS(redIndex, RCOMP, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(greenIndex, GCOMP, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(blueIndex, BCOMP, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(alphaIndex, ACOMP, 1.0F, GLhalfARB, _mesa_half_to_float); - break; - case GL_UNSIGNED_BYTE_3_3_2: - { - const GLubyte *ubsrc = (const GLubyte *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLubyte p = ubsrc[i]; - rgba[i][rComp] = ((p >> 5) ) * (1.0F / 7.0F); - rgba[i][gComp] = ((p >> 2) & 0x7) * (1.0F / 7.0F); - rgba[i][bComp] = ((p ) & 0x3) * (1.0F / 3.0F); - rgba[i][aComp] = 1.0F; - } - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - { - const GLubyte *ubsrc = (const GLubyte *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLubyte p = ubsrc[i]; - rgba[i][rComp] = ((p ) & 0x7) * (1.0F / 7.0F); - rgba[i][gComp] = ((p >> 3) & 0x7) * (1.0F / 7.0F); - rgba[i][bComp] = ((p >> 6) ) * (1.0F / 3.0F); - rgba[i][aComp] = 1.0F; - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x3f) * (1.0F / 63.0F); - rgba[i][bComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = 1.0F; - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x3f) * (1.0F / 63.0F); - rgba[i][bComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = 1.0F; - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x3f) * (1.0F / 63.0F); - rgba[i][bComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][aComp] = 1.0F; - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x3f) * (1.0F / 63.0F); - rgba[i][bComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][aComp] = 1.0F; - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p >> 12) ) * (1.0F / 15.0F); - rgba[i][gComp] = ((p >> 8) & 0xf) * (1.0F / 15.0F); - rgba[i][bComp] = ((p >> 4) & 0xf) * (1.0F / 15.0F); - rgba[i][aComp] = ((p ) & 0xf) * (1.0F / 15.0F); - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p >> 12) ) * (1.0F / 15.0F); - rgba[i][gComp] = ((p >> 8) & 0xf) * (1.0F / 15.0F); - rgba[i][bComp] = ((p >> 4) & 0xf) * (1.0F / 15.0F); - rgba[i][aComp] = ((p ) & 0xf) * (1.0F / 15.0F); - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p ) & 0xf) * (1.0F / 15.0F); - rgba[i][gComp] = ((p >> 4) & 0xf) * (1.0F / 15.0F); - rgba[i][bComp] = ((p >> 8) & 0xf) * (1.0F / 15.0F); - rgba[i][aComp] = ((p >> 12) ) * (1.0F / 15.0F); - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p ) & 0xf) * (1.0F / 15.0F); - rgba[i][gComp] = ((p >> 4) & 0xf) * (1.0F / 15.0F); - rgba[i][bComp] = ((p >> 8) & 0xf) * (1.0F / 15.0F); - rgba[i][aComp] = ((p >> 12) ) * (1.0F / 15.0F); - } - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 6) & 0x1f) * (1.0F / 31.0F); - rgba[i][bComp] = ((p >> 1) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = ((p ) & 0x1) * (1.0F / 1.0F); - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p >> 11) ) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 6) & 0x1f) * (1.0F / 31.0F); - rgba[i][bComp] = ((p >> 1) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = ((p ) & 0x1) * (1.0F / 1.0F); - } - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - if (swapBytes) { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - SWAP2BYTE(p); - rgba[i][rComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x1f) * (1.0F / 31.0F); - rgba[i][bComp] = ((p >> 10) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = ((p >> 15) ) * (1.0F / 1.0F); - } - } - else { - const GLushort *ussrc = (const GLushort *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLushort p = ussrc[i]; - rgba[i][rComp] = ((p ) & 0x1f) * (1.0F / 31.0F); - rgba[i][gComp] = ((p >> 5) & 0x1f) * (1.0F / 31.0F); - rgba[i][bComp] = ((p >> 10) & 0x1f) * (1.0F / 31.0F); - rgba[i][aComp] = ((p >> 15) ) * (1.0F / 1.0F); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - if (swapBytes) { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = UBYTE_TO_FLOAT((p ) & 0xff); - rgba[i][gComp] = UBYTE_TO_FLOAT((p >> 8) & 0xff); - rgba[i][bComp] = UBYTE_TO_FLOAT((p >> 16) & 0xff); - rgba[i][aComp] = UBYTE_TO_FLOAT((p >> 24) ); - } - } - else { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = UBYTE_TO_FLOAT((p >> 24) ); - rgba[i][gComp] = UBYTE_TO_FLOAT((p >> 16) & 0xff); - rgba[i][bComp] = UBYTE_TO_FLOAT((p >> 8) & 0xff); - rgba[i][aComp] = UBYTE_TO_FLOAT((p ) & 0xff); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - if (swapBytes) { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = UBYTE_TO_FLOAT((p >> 24) ); - rgba[i][gComp] = UBYTE_TO_FLOAT((p >> 16) & 0xff); - rgba[i][bComp] = UBYTE_TO_FLOAT((p >> 8) & 0xff); - rgba[i][aComp] = UBYTE_TO_FLOAT((p ) & 0xff); - } - } - else { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = UBYTE_TO_FLOAT((p ) & 0xff); - rgba[i][gComp] = UBYTE_TO_FLOAT((p >> 8) & 0xff); - rgba[i][bComp] = UBYTE_TO_FLOAT((p >> 16) & 0xff); - rgba[i][aComp] = UBYTE_TO_FLOAT((p >> 24) ); - } - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - if (swapBytes) { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - SWAP4BYTE(p); - rgba[i][rComp] = ((p >> 22) ) * (1.0F / 1023.0F); - rgba[i][gComp] = ((p >> 12) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][bComp] = ((p >> 2) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][aComp] = ((p ) & 0x3 ) * (1.0F / 3.0F); - } - } - else { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = ((p >> 22) ) * (1.0F / 1023.0F); - rgba[i][gComp] = ((p >> 12) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][bComp] = ((p >> 2) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][aComp] = ((p ) & 0x3 ) * (1.0F / 3.0F); - } - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - if (swapBytes) { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - SWAP4BYTE(p); - rgba[i][rComp] = ((p ) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][gComp] = ((p >> 10) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][bComp] = ((p >> 20) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][aComp] = ((p >> 30) ) * (1.0F / 3.0F); - } - } - else { - const GLuint *uisrc = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i ++) { - GLuint p = uisrc[i]; - rgba[i][rComp] = ((p ) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][gComp] = ((p >> 10) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][bComp] = ((p >> 20) & 0x3ff) * (1.0F / 1023.0F); - rgba[i][aComp] = ((p >> 30) ) * (1.0F / 3.0F); - } - } - break; - default: - _mesa_problem(NULL, "bad srcType in extract float data"); - break; - } -} - - -/* - * Unpack a row of color image data from a client buffer according to - * the pixel unpacking parameters. - * Return GLchan values in the specified dest image format. - * This is used by glDrawPixels and glTexImage?D(). - * \param ctx - the context - * n - number of pixels in the span - * dstFormat - format of destination color array - * dest - the destination color array - * srcFormat - source image format - * srcType - source image data type - * source - source image pointer - * srcPacking - pixel unpacking parameters - * transferOps - bitmask of IMAGE_*_BIT values of operations to apply - * - * XXX perhaps expand this to process whole images someday. - */ -void -_mesa_unpack_color_span_chan( GLcontext *ctx, - GLuint n, GLenum dstFormat, GLchan dest[], - GLenum srcFormat, GLenum srcType, - const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ) -{ - ASSERT(dstFormat == GL_ALPHA || - dstFormat == GL_LUMINANCE || - dstFormat == GL_LUMINANCE_ALPHA || - dstFormat == GL_INTENSITY || - dstFormat == GL_RGB || - dstFormat == GL_RGBA || - dstFormat == GL_COLOR_INDEX); - - ASSERT(srcFormat == GL_RED || - srcFormat == GL_GREEN || - srcFormat == GL_BLUE || - srcFormat == GL_ALPHA || - srcFormat == GL_LUMINANCE || - srcFormat == GL_LUMINANCE_ALPHA || - srcFormat == GL_INTENSITY || - srcFormat == GL_RGB || - srcFormat == GL_BGR || - srcFormat == GL_RGBA || - srcFormat == GL_BGRA || - srcFormat == GL_ABGR_EXT || - srcFormat == GL_COLOR_INDEX); - - 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_HALF_FLOAT_ARB || - 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); - - /* Try simple cases first */ - if (transferOps == 0) { - if (srcType == CHAN_TYPE) { - if (dstFormat == GL_RGBA) { - if (srcFormat == GL_RGBA) { - _mesa_memcpy( dest, source, n * 4 * sizeof(GLchan) ); - return; - } - else if (srcFormat == GL_RGB) { - GLuint i; - const GLchan *src = (const GLchan *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = CHAN_MAX; - src += 3; - dst += 4; - } - return; - } - } - else if (dstFormat == GL_RGB) { - if (srcFormat == GL_RGB) { - _mesa_memcpy( dest, source, n * 3 * sizeof(GLchan) ); - return; - } - else if (srcFormat == GL_RGBA) { - GLuint i; - const GLchan *src = (const GLchan *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - src += 4; - dst += 3; - } - return; - } - } - else if (dstFormat == srcFormat) { - GLint comps = _mesa_components_in_format(srcFormat); - assert(comps > 0); - _mesa_memcpy( dest, source, n * comps * sizeof(GLchan) ); - return; - } - } - /* - * Common situation, loading 8bit RGBA/RGB source images - * into 16/32 bit destination. (OSMesa16/32) - */ - else if (srcType == GL_UNSIGNED_BYTE) { - if (dstFormat == GL_RGBA) { - if (srcFormat == GL_RGB) { - GLuint i; - const GLubyte *src = (const GLubyte *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = UBYTE_TO_CHAN(src[0]); - dst[1] = UBYTE_TO_CHAN(src[1]); - dst[2] = UBYTE_TO_CHAN(src[2]); - dst[3] = CHAN_MAX; - src += 3; - dst += 4; - } - return; - } - else if (srcFormat == GL_RGBA) { - GLuint i; - const GLubyte *src = (const GLubyte *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = UBYTE_TO_CHAN(src[0]); - dst[1] = UBYTE_TO_CHAN(src[1]); - dst[2] = UBYTE_TO_CHAN(src[2]); - dst[3] = UBYTE_TO_CHAN(src[3]); - src += 4; - dst += 4; - } - return; - } - } - else if (dstFormat == GL_RGB) { - if (srcFormat == GL_RGB) { - GLuint i; - const GLubyte *src = (const GLubyte *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = UBYTE_TO_CHAN(src[0]); - dst[1] = UBYTE_TO_CHAN(src[1]); - dst[2] = UBYTE_TO_CHAN(src[2]); - src += 3; - dst += 3; - } - return; - } - else if (srcFormat == GL_RGBA) { - GLuint i; - const GLubyte *src = (const GLubyte *) source; - GLchan *dst = dest; - for (i = 0; i < n; i++) { - dst[0] = UBYTE_TO_CHAN(src[0]); - dst[1] = UBYTE_TO_CHAN(src[1]); - dst[2] = UBYTE_TO_CHAN(src[2]); - src += 4; - dst += 3; - } - return; - } - } - } - } - - - /* general solution begins here */ - { - GLint dstComponents; - GLint dstRedIndex, dstGreenIndex, dstBlueIndex, dstAlphaIndex; - GLint dstLuminanceIndex, dstIntensityIndex; - GLfloat rgba[MAX_WIDTH][4]; - - dstComponents = _mesa_components_in_format( dstFormat ); - /* source & dest image formats should have been error checked by now */ - assert(dstComponents > 0); - - /* - * Extract image data and convert to RGBA floats - */ - assert(n <= MAX_WIDTH); - if (srcFormat == GL_COLOR_INDEX) { - GLuint indexes[MAX_WIDTH]; - extract_uint_indexes(n, indexes, srcFormat, srcType, source, - srcPacking); - - if (dstFormat == GL_COLOR_INDEX) { - GLuint i; - _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); - /* convert to GLchan and return */ - for (i = 0; i < n; i++) { - dest[i] = (GLchan) (indexes[i] & 0xff); - } - return; - } - else { - /* Convert indexes to RGBA */ - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - shift_and_offset_ci(ctx, n, indexes); - } - _mesa_map_ci_to_rgba(ctx, n, indexes, rgba); - } - - /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting - * with color indexes. - */ - transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT); - } - else { - /* non-color index data */ - extract_float_rgba(n, rgba, srcFormat, srcType, source, - srcPacking->SwapBytes); - } - - /* Need to clamp if returning GLubytes or GLushorts */ -#if CHAN_TYPE != GL_FLOAT - transferOps |= IMAGE_CLAMP_BIT; -#endif - - if (transferOps) { - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); - } - - /* Now determine which color channels we need to produce. - * And determine the dest index (offset) within each color tuple. - */ - switch (dstFormat) { - case GL_ALPHA: - dstAlphaIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = -1; - dstLuminanceIndex = dstIntensityIndex = -1; - break; - case GL_LUMINANCE: - dstLuminanceIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; - dstIntensityIndex = -1; - break; - case GL_LUMINANCE_ALPHA: - dstLuminanceIndex = 0; - dstAlphaIndex = 1; - dstRedIndex = dstGreenIndex = dstBlueIndex = -1; - dstIntensityIndex = -1; - break; - case GL_INTENSITY: - dstIntensityIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; - dstLuminanceIndex = -1; - break; - case GL_RGB: - dstRedIndex = 0; - dstGreenIndex = 1; - dstBlueIndex = 2; - dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; - break; - case GL_RGBA: - dstRedIndex = 0; - dstGreenIndex = 1; - dstBlueIndex = 2; - dstAlphaIndex = 3; - dstLuminanceIndex = dstIntensityIndex = -1; - break; - default: - _mesa_problem(ctx, "bad dstFormat in _mesa_unpack_chan_span()"); - return; - } - - - /* Now return the GLchan data in the requested dstFormat */ - - if (dstRedIndex >= 0) { - GLchan *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - CLAMPED_FLOAT_TO_CHAN(dst[dstRedIndex], rgba[i][RCOMP]); - dst += dstComponents; - } - } - - if (dstGreenIndex >= 0) { - GLchan *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - CLAMPED_FLOAT_TO_CHAN(dst[dstGreenIndex], rgba[i][GCOMP]); - dst += dstComponents; - } - } - - if (dstBlueIndex >= 0) { - GLchan *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - CLAMPED_FLOAT_TO_CHAN(dst[dstBlueIndex], rgba[i][BCOMP]); - dst += dstComponents; - } - } - - if (dstAlphaIndex >= 0) { - GLchan *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - CLAMPED_FLOAT_TO_CHAN(dst[dstAlphaIndex], rgba[i][ACOMP]); - dst += dstComponents; - } - } - - if (dstIntensityIndex >= 0) { - GLchan *dst = dest; - GLuint i; - assert(dstIntensityIndex == 0); - assert(dstComponents == 1); - for (i = 0; i < n; i++) { - /* Intensity comes from red channel */ - CLAMPED_FLOAT_TO_CHAN(dst[i], rgba[i][RCOMP]); - } - } - - if (dstLuminanceIndex >= 0) { - GLchan *dst = dest; - GLuint i; - assert(dstLuminanceIndex == 0); - for (i = 0; i < n; i++) { - /* Luminance comes from red channel */ - CLAMPED_FLOAT_TO_CHAN(dst[0], rgba[i][RCOMP]); - dst += dstComponents; - } - } - } -} - - -/** - * Same as _mesa_unpack_color_span_chan(), but return GLfloat data - * instead of GLchan. - */ -void -_mesa_unpack_color_span_float( GLcontext *ctx, - GLuint n, GLenum dstFormat, GLfloat dest[], - GLenum srcFormat, GLenum srcType, - const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ) -{ - ASSERT(dstFormat == GL_ALPHA || - dstFormat == GL_LUMINANCE || - dstFormat == GL_LUMINANCE_ALPHA || - dstFormat == GL_INTENSITY || - dstFormat == GL_RGB || - dstFormat == GL_RGBA || - dstFormat == GL_COLOR_INDEX); - - ASSERT(srcFormat == GL_RED || - srcFormat == GL_GREEN || - srcFormat == GL_BLUE || - srcFormat == GL_ALPHA || - srcFormat == GL_LUMINANCE || - srcFormat == GL_LUMINANCE_ALPHA || - srcFormat == GL_INTENSITY || - srcFormat == GL_RGB || - srcFormat == GL_BGR || - srcFormat == GL_RGBA || - srcFormat == GL_BGRA || - srcFormat == GL_ABGR_EXT || - srcFormat == GL_COLOR_INDEX); - - 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_HALF_FLOAT_ARB || - 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); - - /* general solution, no special cases, yet */ - { - GLint dstComponents; - GLint dstRedIndex, dstGreenIndex, dstBlueIndex, dstAlphaIndex; - GLint dstLuminanceIndex, dstIntensityIndex; - GLfloat rgba[MAX_WIDTH][4]; - - dstComponents = _mesa_components_in_format( dstFormat ); - /* source & dest image formats should have been error checked by now */ - assert(dstComponents > 0); - - /* - * Extract image data and convert to RGBA floats - */ - assert(n <= MAX_WIDTH); - if (srcFormat == GL_COLOR_INDEX) { - GLuint indexes[MAX_WIDTH]; - extract_uint_indexes(n, indexes, srcFormat, srcType, source, - srcPacking); - - if (dstFormat == GL_COLOR_INDEX) { - GLuint i; - _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); - /* convert to GLchan and return */ - for (i = 0; i < n; i++) { - dest[i] = (GLchan) (indexes[i] & 0xff); - } - return; - } - else { - /* Convert indexes to RGBA */ - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - shift_and_offset_ci(ctx, n, indexes); - } - _mesa_map_ci_to_rgba(ctx, n, indexes, rgba); - } - - /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting - * with color indexes. - */ - transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT); - } - else { - /* non-color index data */ - extract_float_rgba(n, rgba, srcFormat, srcType, source, - srcPacking->SwapBytes); - } - - if (transferOps) { - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); - } - - /* Now determine which color channels we need to produce. - * And determine the dest index (offset) within each color tuple. - */ - switch (dstFormat) { - case GL_ALPHA: - dstAlphaIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = -1; - dstLuminanceIndex = dstIntensityIndex = -1; - break; - case GL_LUMINANCE: - dstLuminanceIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; - dstIntensityIndex = -1; - break; - case GL_LUMINANCE_ALPHA: - dstLuminanceIndex = 0; - dstAlphaIndex = 1; - dstRedIndex = dstGreenIndex = dstBlueIndex = -1; - dstIntensityIndex = -1; - break; - case GL_INTENSITY: - dstIntensityIndex = 0; - dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1; - dstLuminanceIndex = -1; - break; - case GL_RGB: - dstRedIndex = 0; - dstGreenIndex = 1; - dstBlueIndex = 2; - dstAlphaIndex = dstLuminanceIndex = dstIntensityIndex = -1; - break; - case GL_RGBA: - dstRedIndex = 0; - dstGreenIndex = 1; - dstBlueIndex = 2; - dstAlphaIndex = 3; - dstLuminanceIndex = dstIntensityIndex = -1; - break; - default: - _mesa_problem(ctx, "bad dstFormat in _mesa_unpack_color_span_float()"); - return; - } - - /* Now pack results in the requested dstFormat */ - if (dstRedIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[dstRedIndex] = rgba[i][RCOMP]; - dst += dstComponents; - } - } - - if (dstGreenIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[dstGreenIndex] = rgba[i][GCOMP]; - dst += dstComponents; - } - } - - if (dstBlueIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[dstBlueIndex] = rgba[i][BCOMP]; - dst += dstComponents; - } - } - - if (dstAlphaIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[dstAlphaIndex] = rgba[i][ACOMP]; - dst += dstComponents; - } - } - - if (dstIntensityIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - assert(dstIntensityIndex == 0); - assert(dstComponents == 1); - for (i = 0; i < n; i++) { - /* Intensity comes from red channel */ - dst[i] = rgba[i][RCOMP]; - } - } - - if (dstLuminanceIndex >= 0) { - GLfloat *dst = dest; - GLuint i; - assert(dstLuminanceIndex == 0); - for (i = 0; i < n; i++) { - /* Luminance comes from red channel */ - dst[0] = rgba[i][RCOMP]; - dst += dstComponents; - } - } - } -} - - -/* - * Unpack a row of color index data from a client buffer according to - * the pixel unpacking parameters. - * This is (or will be) used by glDrawPixels, glTexImage[123]D, etc. - * - * Args: ctx - the context - * n - number of pixels - * dstType - destination data type - * dest - destination array - * srcType - source pixel type - * source - source data pointer - * srcPacking - pixel unpacking parameters - * transferOps - the pixel transfer operations to apply - */ -void -_mesa_unpack_index_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, - GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ) -{ - 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_HALF_FLOAT_ARB || - srcType == GL_FLOAT); - - ASSERT(dstType == GL_UNSIGNED_BYTE || - dstType == GL_UNSIGNED_SHORT || - dstType == GL_UNSIGNED_INT); - - - transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT); - - /* - * Try simple cases first - */ - if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE - && dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); - } - else if (transferOps == 0 && srcType == GL_UNSIGNED_INT - && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { - _mesa_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, - srcPacking); - - if (transferOps) - _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); - - /* 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: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); - break; - default: - _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span"); - } - } -} - - -void -_mesa_pack_index_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, const GLuint *source, - const struct gl_pixelstore_attrib *dstPacking, - GLbitfield transferOps ) -{ - GLuint indexes[MAX_WIDTH]; - - ASSERT(n <= MAX_WIDTH); - - transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT); - - if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) { - /* make a copy of input */ - _mesa_memcpy(indexes, source, n * sizeof(GLuint)); - _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); - source = indexes; - } - - switch (dstType) { - case GL_UNSIGNED_BYTE: - { - GLubyte *dst = (GLubyte *) dest; - GLuint i; - for (i = 0; i < n; i++) { - *dst++ = (GLubyte) source[i]; - } - } - break; - case GL_BYTE: - { - GLbyte *dst = (GLbyte *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLbyte) source[i]; - } - } - break; - case GL_UNSIGNED_SHORT: - { - GLushort *dst = (GLushort *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLushort) source[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_SHORT: - { - GLshort *dst = (GLshort *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLshort) source[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint *dst = (GLuint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLuint) source[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_INT: - { - GLint *dst = (GLint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLint) source[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_FLOAT: - { - GLfloat *dst = (GLfloat *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = (GLfloat) source[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = _mesa_float_to_half((GLfloat) source[i]); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - default: - _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); - } -} - - -/* - * Unpack a row of stencil data from a client buffer according to - * the pixel unpacking parameters. - * This is (or will be) used by glDrawPixels - * - * Args: ctx - the context - * n - number of pixels - * dstType - destination data type - * dest - destination array - * srcType - source pixel type - * source - source data pointer - * srcPacking - pixel unpacking parameters - * transferOps - 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 *srcPacking, - GLbitfield transferOps ) -{ - 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_UNSIGNED_INT_24_8_EXT || - srcType == GL_HALF_FLOAT_ARB || - srcType == GL_FLOAT); - - ASSERT(dstType == GL_UNSIGNED_BYTE || - dstType == GL_UNSIGNED_SHORT || - dstType == GL_UNSIGNED_INT); - - /* only shift and offset apply to stencil */ - transferOps &= IMAGE_SHIFT_OFFSET_BIT; - - /* - * Try simple cases first - */ - if (transferOps == 0 && - !ctx->Pixel.MapStencilFlag && - srcType == GL_UNSIGNED_BYTE && - dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); - } - else if (transferOps == 0 && - !ctx->Pixel.MapStencilFlag && - srcType == GL_UNSIGNED_INT && - dstType == GL_UNSIGNED_INT && - !srcPacking->SwapBytes) { - _mesa_memcpy(dest, source, n * sizeof(GLuint)); - } - else { - /* - * general solution - */ - GLuint indexes[MAX_WIDTH]; - assert(n <= MAX_WIDTH); - - extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source, - srcPacking); - - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - /* shift and offset indexes */ - shift_and_offset_ci(ctx, n, indexes); - } - - if (ctx->Pixel.MapStencilFlag) { - /* Apply stencil lookup table */ - const GLuint mask = ctx->PixelMaps.StoS.Size - 1; - GLuint i; - for (i = 0; i < n; i++) { - indexes[i] = (GLuint)ctx->PixelMaps.StoS.Map[ 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: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); - break; - default: - _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); - } - } -} - - -void -_mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, const GLstencil *source, - const struct gl_pixelstore_attrib *dstPacking ) -{ - GLstencil stencil[MAX_WIDTH]; - - ASSERT(n <= MAX_WIDTH); - - if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || - ctx->Pixel.MapStencilFlag) { - /* make a copy of input */ - _mesa_memcpy(stencil, source, n * sizeof(GLstencil)); - _mesa_apply_stencil_transfer_ops(ctx, n, stencil); - source = stencil; - } - - switch (dstType) { - case GL_UNSIGNED_BYTE: - if (sizeof(GLstencil) == 1) { - _mesa_memcpy( dest, source, n ); - } - else { - GLubyte *dst = (GLubyte *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_SHORT: - { - GLshort *dst = (GLshort *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint *dst = (GLuint *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_INT: - { - GLint *dst = (GLint *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_FLOAT: - { - GLfloat *dst = (GLfloat *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_BITMAP: - if (dstPacking->LsbFirst) { - GLubyte *dst = (GLubyte *) dest; - GLint shift = 0; - GLuint i; - for (i = 0; i < n; i++) { - if (shift == 0) - *dst = 0; - *dst |= ((source[i] != 0) << shift); - shift++; - if (shift == 8) { - shift = 0; - dst++; - } - } - } - else { - GLubyte *dst = (GLubyte *) dest; - GLint shift = 7; - GLuint i; - for (i = 0; i < n; i++) { - if (shift == 7) - *dst = 0; - *dst |= ((source[i] != 0) << shift); - shift--; - if (shift < 0) { - shift = 7; - dst++; - } - } - } - break; - default: - _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); - } -} - -#define DEPTH_VALUES(GLTYPE, GLTYPE2FLOAT) \ - do { \ - GLuint i; \ - const GLTYPE *src = (const GLTYPE *)source; \ - for (i = 0; i < n; i++) { \ - GLTYPE value = src[i]; \ - if (srcPacking->SwapBytes) { \ - if (sizeof(GLTYPE) == 2) { \ - SWAP2BYTE(value); \ - } else if (sizeof(GLTYPE) == 4) { \ - SWAP4BYTE(value); \ - } \ - } \ - depthValues[i] = GLTYPE2FLOAT(value); \ - } \ - } while (0) - - -/** - * Unpack a row of depth/z values from memory, returning GLushort, GLuint - * or GLfloat values. - * The glPixelTransfer (scale/bias) params will be applied. - * - * \param dstType one of GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_FLOAT - * \param depthMax max value for returned GLushort or GLuint values - * (ignored for GLfloat). - */ -void -_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, GLuint depthMax, - GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking ) -{ - GLfloat depthTemp[MAX_WIDTH], *depthValues; - GLboolean needClamp = GL_FALSE; - - /* Look for special cases first. - * Not only are these faster, they're less prone to numeric conversion - * problems. Otherwise, converting from an int type to a float then - * back to an int type can introduce errors that will show up as - * artifacts in things like depth peeling which uses glCopyTexImage. - */ - if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) { - if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) { - const GLuint *src = (const GLuint *) source; - GLushort *dst = (GLushort *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = src[i] >> 16; - } - return; - } - if (srcType == GL_UNSIGNED_SHORT - && dstType == GL_UNSIGNED_INT - && depthMax == 0xffffffff) { - const GLushort *src = (const GLushort *) source; - GLuint *dst = (GLuint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = src[i] | (src[i] << 16); - } - return; - } - /* XXX may want to add additional cases here someday */ - } - - /* general case path follows */ - - if (dstType == GL_FLOAT) { - depthValues = (GLfloat *) dest; - } - else { - depthValues = depthTemp; - } - - /* Convert incoming values to GLfloat. Some conversions will require - * clamping, below. - */ - switch (srcType) { - case GL_BYTE: - DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT); - needClamp = GL_TRUE; - break; - case GL_UNSIGNED_BYTE: - DEPTH_VALUES(GLubyte, UBYTE_TO_FLOAT); - break; - case GL_SHORT: - DEPTH_VALUES(GLshort, SHORT_TO_FLOAT); - needClamp = GL_TRUE; - break; - case GL_UNSIGNED_SHORT: - DEPTH_VALUES(GLushort, USHORT_TO_FLOAT); - break; - case GL_INT: - DEPTH_VALUES(GLint, INT_TO_FLOAT); - needClamp = GL_TRUE; - break; - case GL_UNSIGNED_INT: - DEPTH_VALUES(GLuint, UINT_TO_FLOAT); - break; - case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */ - if (dstType == GL_UNSIGNED_INT_24_8_EXT && - depthMax == 0xffffff && - ctx->Pixel.DepthScale == 1.0 && - ctx->Pixel.DepthBias == 0.0) { - const GLuint *src = (const GLuint *) source; - GLuint *zValues = (GLuint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - GLuint value = src[i]; - if (srcPacking->SwapBytes) { - SWAP4BYTE(value); - } - zValues[i] = value & 0xffffff00; - } - return; - } - else { - const GLuint *src = (const GLuint *) source; - const GLfloat scale = 1.0f / 0xffffff; - GLuint i; - for (i = 0; i < n; i++) { - GLuint value = src[i]; - if (srcPacking->SwapBytes) { - SWAP4BYTE(value); - } - depthValues[i] = (value >> 8) * scale; - } - } - break; - case GL_FLOAT: - DEPTH_VALUES(GLfloat, 1*); - needClamp = GL_TRUE; - break; - case GL_HALF_FLOAT_ARB: - { - GLuint i; - const GLhalfARB *src = (const GLhalfARB *) source; - for (i = 0; i < n; i++) { - GLhalfARB value = src[i]; - if (srcPacking->SwapBytes) { - SWAP2BYTE(value); - } - depthValues[i] = _mesa_half_to_float(value); - } - needClamp = GL_TRUE; - } - break; - default: - _mesa_problem(NULL, "bad type in _mesa_unpack_depth_span()"); - return; - } - - /* apply depth scale and bias */ - { - const GLfloat scale = ctx->Pixel.DepthScale; - const GLfloat bias = ctx->Pixel.DepthBias; - if (scale != 1.0 || bias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - depthValues[i] = depthValues[i] * scale + bias; - } - needClamp = GL_TRUE; - } - } - - /* clamp to [0, 1] */ - if (needClamp) { - GLuint i; - for (i = 0; i < n; i++) { - depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0); - } - } - - /* - * Convert values to dstType - */ - if (dstType == GL_UNSIGNED_INT) { - GLuint *zValues = (GLuint *) dest; - GLuint i; - if (depthMax <= 0xffffff) { - /* no overflow worries */ - for (i = 0; i < n; i++) { - zValues[i] = (GLuint) (depthValues[i] * (GLfloat) depthMax); - } - } - else { - /* need to use double precision to prevent overflow problems */ - for (i = 0; i < n; i++) { - GLdouble z = depthValues[i] * (GLfloat) depthMax; - if (z >= (GLdouble) 0xffffffff) - zValues[i] = 0xffffffff; - else - zValues[i] = (GLuint) z; - } - } - } - else if (dstType == GL_UNSIGNED_SHORT) { - GLushort *zValues = (GLushort *) dest; - GLuint i; - ASSERT(depthMax <= 0xffff); - for (i = 0; i < n; i++) { - zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax); - } - } - else { - ASSERT(dstType == GL_FLOAT); - /*ASSERT(depthMax == 1.0F);*/ - } -} - - -/* - * Pack an array of depth values. The values are floats in [0,1]. - */ -void -_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest, - GLenum dstType, const GLfloat *depthSpan, - const struct gl_pixelstore_attrib *dstPacking ) -{ - GLfloat depthCopy[MAX_WIDTH]; - - ASSERT(n <= MAX_WIDTH); - - if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); - _mesa_scale_and_bias_depth(ctx, n, depthCopy); - depthSpan = depthCopy; - } - - switch (dstType) { - case GL_UNSIGNED_BYTE: - { - GLubyte *dst = (GLubyte *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = FLOAT_TO_UBYTE( depthSpan[i] ); - } - } - break; - case GL_BYTE: - { - GLbyte *dst = (GLbyte *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = FLOAT_TO_BYTE( depthSpan[i] ); - } - } - break; - case GL_UNSIGNED_SHORT: - { - GLushort *dst = (GLushort *) dest; - GLuint i; - for (i = 0; i < n; i++) { - CLAMPED_FLOAT_TO_USHORT(dst[i], depthSpan[i]); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_SHORT: - { - GLshort *dst = (GLshort *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = FLOAT_TO_SHORT( depthSpan[i] ); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - case GL_UNSIGNED_INT: - { - GLuint *dst = (GLuint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = FLOAT_TO_UINT( depthSpan[i] ); - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_INT: - { - GLint *dst = (GLint *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = FLOAT_TO_INT( depthSpan[i] ); - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_FLOAT: - { - GLfloat *dst = (GLfloat *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = depthSpan[i]; - } - if (dstPacking->SwapBytes) { - _mesa_swap4( (GLuint *) dst, n ); - } - } - break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = _mesa_float_to_half(depthSpan[i]); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; - default: - _mesa_problem(ctx, "bad type in _mesa_pack_depth_span"); - } -} - - - -/** - * Pack depth and stencil values as GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8. - */ -void -_mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, - const GLfloat *depthVals, - const GLstencil *stencilVals, - const struct gl_pixelstore_attrib *dstPacking) -{ - GLfloat depthCopy[MAX_WIDTH]; - GLstencil stencilCopy[MAX_WIDTH]; - GLuint i; - - ASSERT(n <= MAX_WIDTH); - - if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); - _mesa_scale_and_bias_depth(ctx, n, depthCopy); - depthVals = depthCopy; - } - - if (ctx->Pixel.IndexShift || - ctx->Pixel.IndexOffset || - ctx->Pixel.MapStencilFlag) { - _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); - _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy); - stencilVals = stencilCopy; - } - - for (i = 0; i < n; i++) { - GLuint z = (GLuint) (depthVals[i] * 0xffffff); - dest[i] = (z << 8) | (stencilVals[i] & 0xff); - } - - if (dstPacking->SwapBytes) { - _mesa_swap4(dest, n); - } -} - - - - -/** - * Unpack image data. Apply byte swapping, byte flipping (bitmap). - * Return all image data in a contiguous block. This is used when we - * compile glDrawPixels, glTexImage, etc into a display list. We - * need a copy of the data in a standard format. - */ -void * -_mesa_unpack_image( GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack ) -{ - GLint bytesPerRow, compsPerRow; - GLboolean flipBytes, swap2, swap4; - - if (!pixels) - return NULL; /* not necessarily an error */ - - if (width <= 0 || height <= 0 || depth <= 0) - return NULL; /* generate error later */ - - if (type == GL_BITMAP) { - bytesPerRow = (width + 7) >> 3; - flipBytes = unpack->LsbFirst; - swap2 = swap4 = GL_FALSE; - compsPerRow = 0; - } - else { - const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type); - GLint components = _mesa_components_in_format(format); - GLint bytesPerComp; - - if (_mesa_type_is_packed(type)) - components = 1; - - if (bytesPerPixel <= 0 || components <= 0) - return NULL; /* bad format or type. generate error later */ - bytesPerRow = bytesPerPixel * width; - bytesPerComp = bytesPerPixel / components; - flipBytes = GL_FALSE; - swap2 = (bytesPerComp == 2) && unpack->SwapBytes; - swap4 = (bytesPerComp == 4) && unpack->SwapBytes; - compsPerRow = components * width; - assert(compsPerRow >= width); - } - - { - GLubyte *destBuffer - = (GLubyte *) _mesa_malloc(bytesPerRow * height * depth); - GLubyte *dst; - GLint img, row; - if (!destBuffer) - return NULL; /* generate GL_OUT_OF_MEMORY later */ - - dst = destBuffer; - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - const GLvoid *src = _mesa_image_address(dimensions, unpack, pixels, - width, height, format, type, img, row, 0); - - if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) { - GLint i; - flipBytes = GL_FALSE; - if (unpack->LsbFirst) { - GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7); - GLubyte dstMask = 128; - const 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 >> (unpack->SkipPixels & 0x7); - GLubyte dstMask = 128; - const 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; - } - } - } - } - else { - _mesa_memcpy(dst, src, bytesPerRow); - } - - /* byte flipping/swapping */ - if (flipBytes) { - flip_bytes((GLubyte *) dst, bytesPerRow); - } - else if (swap2) { - _mesa_swap2((GLushort*) dst, compsPerRow); - } - else if (swap4) { - _mesa_swap4((GLuint*) dst, compsPerRow); - } - dst += bytesPerRow; - } - } - return destBuffer; - } -} - -#endif /* _HAVE_FULL_GL */ - - - -/** - * Convert an array of RGBA colors from one datatype to another. - * NOTE: src may equal dst. In that case, we use a temporary buffer. - */ -void -_mesa_convert_colors(GLenum srcType, const GLvoid *src, - GLenum dstType, GLvoid *dst, - GLuint count, const GLubyte mask[]) -{ - GLuint tempBuffer[MAX_WIDTH][4]; - const GLboolean useTemp = (src == dst); - - ASSERT(srcType != dstType); - - switch (srcType) { - case GL_UNSIGNED_BYTE: - if (dstType == GL_UNSIGNED_SHORT) { - const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; - GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst2[i][RCOMP] = UBYTE_TO_USHORT(src1[i][RCOMP]); - dst2[i][GCOMP] = UBYTE_TO_USHORT(src1[i][GCOMP]); - dst2[i][BCOMP] = UBYTE_TO_USHORT(src1[i][BCOMP]); - dst2[i][ACOMP] = UBYTE_TO_USHORT(src1[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); - } - else { - const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; - GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - ASSERT(dstType == GL_FLOAT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst4[i][RCOMP] = UBYTE_TO_FLOAT(src1[i][RCOMP]); - dst4[i][GCOMP] = UBYTE_TO_FLOAT(src1[i][GCOMP]); - dst4[i][BCOMP] = UBYTE_TO_FLOAT(src1[i][BCOMP]); - dst4[i][ACOMP] = UBYTE_TO_FLOAT(src1[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); - } - break; - case GL_UNSIGNED_SHORT: - if (dstType == GL_UNSIGNED_BYTE) { - const GLushort (*src2)[4] = (const GLushort (*)[4]) src; - GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst1[i][RCOMP] = USHORT_TO_UBYTE(src2[i][RCOMP]); - dst1[i][GCOMP] = USHORT_TO_UBYTE(src2[i][GCOMP]); - dst1[i][BCOMP] = USHORT_TO_UBYTE(src2[i][BCOMP]); - dst1[i][ACOMP] = USHORT_TO_UBYTE(src2[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); - } - else { - const GLushort (*src2)[4] = (const GLushort (*)[4]) src; - GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - ASSERT(dstType == GL_FLOAT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst4[i][RCOMP] = USHORT_TO_FLOAT(src2[i][RCOMP]); - dst4[i][GCOMP] = USHORT_TO_FLOAT(src2[i][GCOMP]); - dst4[i][BCOMP] = USHORT_TO_FLOAT(src2[i][BCOMP]); - dst4[i][ACOMP] = USHORT_TO_FLOAT(src2[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); - } - break; - case GL_FLOAT: - if (dstType == GL_UNSIGNED_BYTE) { - const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; - GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][RCOMP], src4[i][RCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][GCOMP], src4[i][GCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][BCOMP], src4[i][BCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][ACOMP], src4[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); - } - else { - const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; - GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst); - GLuint i; - ASSERT(dstType == GL_UNSIGNED_SHORT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - UNCLAMPED_FLOAT_TO_USHORT(dst2[i][RCOMP], src4[i][RCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(dst2[i][GCOMP], src4[i][GCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(dst2[i][BCOMP], src4[i][BCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(dst2[i][ACOMP], src4[i][ACOMP]); - } - } - if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); - } - break; - default: - _mesa_problem(NULL, "Invalid datatype in _mesa_convert_colors"); - } -} - - - - -/** - * Perform basic clipping for glDrawPixels. The image's position and size - * and the unpack SkipPixels and SkipRows are adjusted so that the image - * region is entirely within the window and scissor bounds. - * NOTE: this will only work when glPixelZoom is (1, 1) or (1, -1). - * If Pixel.ZoomY is -1, *destY will be changed to be the first row which - * we'll actually write. Beforehand, *destY-1 is the first drawing row. - * - * \return GL_TRUE if image is ready for drawing or - * GL_FALSE if image was completely clipped away (draw nothing) - */ -GLboolean -_mesa_clip_drawpixels(const GLcontext *ctx, - GLint *destX, GLint *destY, - GLsizei *width, GLsizei *height, - struct gl_pixelstore_attrib *unpack) -{ - const GLframebuffer *buffer = ctx->DrawBuffer; - - if (unpack->RowLength == 0) { - unpack->RowLength = *width; - } - - ASSERT(ctx->Pixel.ZoomX == 1.0F); - ASSERT(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F); - - /* left clipping */ - if (*destX < buffer->_Xmin) { - unpack->SkipPixels += (buffer->_Xmin - *destX); - *width -= (buffer->_Xmin - *destX); - *destX = buffer->_Xmin; - } - /* right clipping */ - if (*destX + *width > buffer->_Xmax) - *width -= (*destX + *width - buffer->_Xmax); - - if (*width <= 0) - return GL_FALSE; - - if (ctx->Pixel.ZoomY == 1.0F) { - /* bottom clipping */ - if (*destY < buffer->_Ymin) { - unpack->SkipRows += (buffer->_Ymin - *destY); - *height -= (buffer->_Ymin - *destY); - *destY = buffer->_Ymin; - } - /* top clipping */ - if (*destY + *height > buffer->_Ymax) - *height -= (*destY + *height - buffer->_Ymax); - } - else { /* upside down */ - /* top clipping */ - if (*destY > buffer->_Ymax) { - unpack->SkipRows += (*destY - buffer->_Ymax); - *height -= (*destY - buffer->_Ymax); - *destY = buffer->_Ymax; - } - /* bottom clipping */ - if (*destY - *height < buffer->_Ymin) - *height -= (buffer->_Ymin - (*destY - *height)); - /* adjust destY so it's the first row to write to */ - (*destY)--; - } - - if (*height <= 0) - return GL_TRUE; - - return GL_TRUE; -} - - -/** - * Perform clipping for glReadPixels. The image's window position - * and size, and the pack skipPixels, skipRows and rowLength are adjusted - * so that the image region is entirely within the window bounds. - * Note: this is different from _mesa_clip_drawpixels() in that the - * scissor box is ignored, and we use the bounds of the current readbuffer - * surface. - * - * \return GL_TRUE if image is ready for drawing or - * GL_FALSE if image was completely clipped away (draw nothing) - */ -GLboolean -_mesa_clip_readpixels(const GLcontext *ctx, - GLint *srcX, GLint *srcY, - GLsizei *width, GLsizei *height, - struct gl_pixelstore_attrib *pack) -{ - const GLframebuffer *buffer = ctx->ReadBuffer; - - if (pack->RowLength == 0) { - pack->RowLength = *width; - } - - /* left clipping */ - if (*srcX < 0) { - pack->SkipPixels += (0 - *srcX); - *width -= (0 - *srcX); - *srcX = 0; - } - /* right clipping */ - if (*srcX + *width > (GLsizei) buffer->Width) - *width -= (*srcX + *width - buffer->Width); - - if (*width <= 0) - return GL_FALSE; - - /* bottom clipping */ - if (*srcY < 0) { - pack->SkipRows += (0 - *srcY); - *height -= (0 - *srcY); - *srcY = 0; - } - /* top clipping */ - if (*srcY + *height > (GLsizei) buffer->Height) - *height -= (*srcY + *height - buffer->Height); - - if (*height <= 0) - return GL_TRUE; - - return GL_TRUE; -} - - -/** - * Do clipping for a glCopyTexSubImage call. - * The framebuffer source region might extend outside the framebuffer - * bounds. Clip the source region against the framebuffer bounds and - * adjust the texture/dest position and size accordingly. - * - * \return GL_FALSE if region is totally clipped, GL_TRUE otherwise. - */ -GLboolean -_mesa_clip_copytexsubimage(const GLcontext *ctx, - GLint *destX, GLint *destY, - GLint *srcX, GLint *srcY, - GLsizei *width, GLsizei *height) -{ - const struct gl_framebuffer *fb = ctx->ReadBuffer; - const GLint srcX0 = *srcX, srcY0 = *srcY; - - if (_mesa_clip_to_region(0, 0, fb->Width, fb->Height, - srcX, srcY, width, height)) { - *destX = *destX + *srcX - srcX0; - *destY = *destY + *srcY - srcY0; - - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - - -/** - * Clip the rectangle defined by (x, y, width, height) against the bounds - * specified by [xmin, xmax) and [ymin, ymax). - * \return GL_FALSE if rect is totally clipped, GL_TRUE otherwise. - */ -GLboolean -_mesa_clip_to_region(GLint xmin, GLint ymin, - GLint xmax, GLint ymax, - GLint *x, GLint *y, - GLsizei *width, GLsizei *height ) -{ - /* left clipping */ - if (*x < xmin) { - *width -= (xmin - *x); - *x = xmin; - } - - /* right clipping */ - if (*x + *width > xmax) - *width -= (*x + *width - xmax); - - if (*width <= 0) - return GL_FALSE; - - /* bottom (or top) clipping */ - if (*y < ymin) { - *height -= (ymin - *y); - *y = ymin; - } - - /* top (or bottom) clipping */ - if (*y + *height > ymax) - *height -= (*y + *height - ymax); - - if (*height <= 0) - return GL_FALSE; - - return GL_TRUE; -} diff --git a/src/libs/mesa/mesa/main/image.h b/src/libs/mesa/mesa/main/image.h deleted file mode 100644 index 0e0bbd96d8..0000000000 --- a/src/libs/mesa/mesa/main/image.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 IMAGE_H -#define IMAGE_H - - -#include "mtypes.h" - - -extern void -_mesa_swap2( GLushort *p, GLuint n ); - -extern void -_mesa_swap4( GLuint *p, GLuint n ); - -extern GLboolean -_mesa_type_is_packed(GLenum type); - -extern GLint -_mesa_sizeof_type( GLenum type ); - -extern GLint -_mesa_sizeof_packed_type( GLenum type ); - -extern GLint -_mesa_components_in_format( GLenum format ); - -extern GLint -_mesa_bytes_per_pixel( GLenum format, GLenum type ); - -extern GLboolean -_mesa_is_legal_format_and_type( GLcontext *ctx, GLenum format, GLenum type ); - - -extern GLvoid * -_mesa_image_address( GLuint dimensions, - const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint img, GLint row, GLint column ); - -extern GLvoid * -_mesa_image_address1d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, - GLenum format, GLenum type, - GLint column ); - -extern GLvoid * -_mesa_image_address2d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint row, GLint column ); - -extern GLvoid * -_mesa_image_address3d( const struct gl_pixelstore_attrib *packing, - const GLvoid *image, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLint img, GLint row, GLint column ); - - -extern GLint -_mesa_image_row_stride( const struct gl_pixelstore_attrib *packing, - GLint width, GLenum format, GLenum type ); - - -extern GLint -_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, - GLint width, GLint height, - GLenum format, GLenum type ); - -extern void -_mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32], - const struct gl_pixelstore_attrib *unpacking ); - - -extern void -_mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest, - const struct gl_pixelstore_attrib *packing ); - - -extern GLvoid * -_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, - const struct gl_pixelstore_attrib *packing ); - -extern void -_mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, - GLubyte *dest, const struct gl_pixelstore_attrib *packing ); - - -/** \name Pixel processing functions */ -/*@{*/ - -extern void -_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], - GLfloat rScale, GLfloat gScale, - GLfloat bScale, GLfloat aScale, - GLfloat rBias, GLfloat gBias, - GLfloat bBias, GLfloat aBias); - -extern void -_mesa_map_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - -extern void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - -extern void -_mesa_lookup_rgba_float(const struct gl_color_table *table, - GLuint n, GLfloat rgba[][4]); - -extern void -_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, - GLuint n, GLubyte rgba[][4]); - - -extern void -_mesa_map_ci_to_rgba(const GLcontext *ctx, - GLuint n, const GLuint index[], GLfloat rgba[][4]); - - -extern void -_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], - GLubyte rgba[][4]); - - -extern void -_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, - GLfloat depthValues[]); - -extern void -_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n, - GLuint depthValues[]); - -extern void -_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, - GLuint n, GLfloat rgba[][4]); - - -extern void -_mesa_apply_ci_transfer_ops(const GLcontext *ctx, GLbitfield transferOps, - GLuint n, GLuint indexes[]); - - -extern void -_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, - GLstencil stencil[]); - - -extern void -_mesa_pack_rgba_span_float( GLcontext *ctx, GLuint n, GLfloat rgba[][4], - GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLbitfield transferOps ); - - -extern void -_mesa_unpack_color_span_chan( GLcontext *ctx, - GLuint n, GLenum dstFormat, GLchan dest[], - GLenum srcFormat, GLenum srcType, - const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ); - - -extern void -_mesa_unpack_color_span_float( GLcontext *ctx, - GLuint n, GLenum dstFormat, GLfloat dest[], - GLenum srcFormat, GLenum srcType, - const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ); - - -extern void -_mesa_unpack_index_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, - GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking, - GLbitfield transferOps ); - - -extern void -_mesa_pack_index_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, const GLuint *source, - const struct gl_pixelstore_attrib *dstPacking, - GLbitfield transferOps ); - - -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 *srcPacking, - GLbitfield transferOps ); - -extern void -_mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, const GLstencil *source, - const struct gl_pixelstore_attrib *dstPacking ); - - -extern void -_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, - GLenum dstType, GLvoid *dest, GLuint depthMax, - GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *srcPacking ); - -extern void -_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest, - GLenum dstType, const GLfloat *depthSpan, - const struct gl_pixelstore_attrib *dstPacking ); - - -extern void -_mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, - const GLfloat *depthVals, - const GLstencil *stencilVals, - const struct gl_pixelstore_attrib *dstPacking); - - -extern void * -_mesa_unpack_image( GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack ); - - -extern void -_mesa_convert_colors(GLenum srcType, const GLvoid *src, - GLenum dstType, GLvoid *dst, - GLuint count, const GLubyte mask[]); - - -extern GLboolean -_mesa_clip_drawpixels(const GLcontext *ctx, - GLint *destX, GLint *destY, - GLsizei *width, GLsizei *height, - struct gl_pixelstore_attrib *unpack); - - -extern GLboolean -_mesa_clip_readpixels(const GLcontext *ctx, - GLint *destX, GLint *destY, - GLsizei *width, GLsizei *height, - struct gl_pixelstore_attrib *pack); - -extern GLboolean -_mesa_clip_copytexsubimage(const GLcontext *ctx, - GLint *destX, GLint *destY, - GLint *srcX, GLint *srcY, - GLsizei *width, GLsizei *height); - -extern GLboolean -_mesa_clip_to_region(GLint xmin, GLint ymin, - GLint xmax, GLint ymax, - GLint *x, GLint *y, - GLsizei *width, GLsizei *height ); - -#endif diff --git a/src/libs/mesa/mesa/main/imports.c b/src/libs/mesa/mesa/main/imports.c deleted file mode 100644 index 0c2c894eef..0000000000 --- a/src/libs/mesa/mesa/main/imports.c +++ /dev/null @@ -1,1148 +0,0 @@ -/** - * \file imports.c - * Standard C library function wrappers. - * - * Imports are services which the device driver or window system or - * operating system provides to the core renderer. The core renderer (Mesa) - * will call these functions in order to do memory allocation, simple I/O, - * etc. - * - * Some drivers will want to override/replace this file with something - * specialized, but that'll be rare. - * - * Eventually, I want to move roll the glheader.h file into this. - * - * \todo Functions still needed: - * - scanf - * - qsort - * - rand and RAND_MAX - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - - -#include "imports.h" -#include "context.h" -#include "version.h" - - -#define MAXSTRING 4000 /* for vsnprintf() */ - -#ifdef WIN32 -#define vsnprintf _vsnprintf -#elif defined(__IBMC__) || defined(__IBMCPP__) || ( defined(__VMS) && __CRTL_VER < 70312000 ) -extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); -#ifdef __VMS -#include "vsnprintf.c" -#endif -#endif - -/**********************************************************************/ -/** \name Memory */ -/*@{*/ - -/** Wrapper around malloc() */ -void * -_mesa_malloc(size_t bytes) -{ - return malloc(bytes); -} - -/** Wrapper around calloc() */ -void * -_mesa_calloc(size_t bytes) -{ - return calloc(1, bytes); -} - -/** Wrapper around free() */ -void -_mesa_free(void *ptr) -{ - free(ptr); -} - -/** - * Allocate aligned memory. - * - * \param bytes number of bytes to allocate. - * \param alignment alignment (must be greater than zero). - * - * Allocates extra memory to accommodate rounding up the address for - * alignment and to record the real malloc address. - * - * \sa _mesa_align_free(). - */ -void * -_mesa_align_malloc(size_t bytes, unsigned long alignment) -{ -#if defined(HAVE_POSIX_MEMALIGN) - void *mem; - - (void) posix_memalign(& mem, alignment, bytes); - return mem; -#elif defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(bytes, alignment); -#else - uintptr_t ptr, buf; - - ASSERT( alignment > 0 ); - - ptr = (uintptr_t) _mesa_malloc(bytes + alignment + sizeof(void *)); - if (!ptr) - return NULL; - - buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1); - *(uintptr_t *)(buf - sizeof(void *)) = ptr; - -#ifdef DEBUG - /* mark the non-aligned area */ - while ( ptr < buf - sizeof(void *) ) { - *(unsigned long *)ptr = 0xcdcdcdcd; - ptr += sizeof(unsigned long); - } -#endif - - return (void *) buf; -#endif /* defined(HAVE_POSIX_MEMALIGN) */ -} - -/** - * Same as _mesa_align_malloc(), but using _mesa_calloc() instead of - * _mesa_malloc() - */ -void * -_mesa_align_calloc(size_t bytes, unsigned long alignment) -{ -#if defined(HAVE_POSIX_MEMALIGN) - void *mem; - - mem = _mesa_align_malloc(bytes, alignment); - if (mem != NULL) { - (void) memset(mem, 0, bytes); - } - - return mem; -#elif defined(_WIN32) && defined(_MSC_VER) - void *mem; - - mem = _aligned_malloc(bytes, alignment); - if (mem != NULL) { - (void) memset(mem, 0, bytes); - } - - return mem; -#else - uintptr_t ptr, buf; - - ASSERT( alignment > 0 ); - - ptr = (uintptr_t) _mesa_calloc(bytes + alignment + sizeof(void *)); - if (!ptr) - return NULL; - - buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1); - *(uintptr_t *)(buf - sizeof(void *)) = ptr; - -#ifdef DEBUG - /* mark the non-aligned area */ - while ( ptr < buf - sizeof(void *) ) { - *(unsigned long *)ptr = 0xcdcdcdcd; - ptr += sizeof(unsigned long); - } -#endif - - return (void *)buf; -#endif /* defined(HAVE_POSIX_MEMALIGN) */ -} - -/** - * Free memory which was allocated with either _mesa_align_malloc() - * or _mesa_align_calloc(). - * \param ptr pointer to the memory to be freed. - * The actual address to free is stored in the word immediately before the - * address the client sees. - */ -void -_mesa_align_free(void *ptr) -{ -#if defined(HAVE_POSIX_MEMALIGN) - free(ptr); -#elif defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#else - void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); - void *realAddr = *cubbyHole; - _mesa_free(realAddr); -#endif /* defined(HAVE_POSIX_MEMALIGN) */ -} - -/** - * Reallocate memory, with alignment. - */ -void * -_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, - unsigned long alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - (void) oldSize; - return _aligned_realloc(oldBuffer, newSize, alignment); -#else - const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuf = _mesa_align_malloc(newSize, alignment); - if (newBuf && oldBuffer && copySize > 0) { - _mesa_memcpy(newBuf, oldBuffer, copySize); - } - if (oldBuffer) - _mesa_align_free(oldBuffer); - return newBuf; -#endif -} - - - -/** Reallocate memory */ -void * -_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) -{ - const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = _mesa_malloc(newSize); - if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); - if (oldBuffer) - _mesa_free(oldBuffer); - return newBuffer; -} - -/** memcpy wrapper */ -void * -_mesa_memcpy(void *dest, const void *src, size_t n) -{ -#if defined(SUNOS4) - return memcpy((char *) dest, (char *) src, (int) n); -#else - return memcpy(dest, src, n); -#endif -} - -/** Wrapper around memset() */ -void -_mesa_memset( void *dst, int val, size_t n ) -{ -#if defined(SUNOS4) - memset( (char *) dst, (int) val, (int) n ); -#else - memset(dst, val, n); -#endif -} - -/** - * Fill memory with a constant 16bit word. - * \param dst destination pointer. - * \param val value. - * \param n number of words. - */ -void -_mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) -{ - while (n-- > 0) - *dst++ = val; -} - -/** Wrapper around either memset() or bzero() */ -void -_mesa_bzero( void *dst, size_t n ) -{ -#if defined(__FreeBSD__) - bzero( dst, n ); -#else - memset( dst, 0, n ); -#endif -} - -/** Wrapper around memcmp() */ -int -_mesa_memcmp( const void *s1, const void *s2, size_t n ) -{ -#if defined(SUNOS4) - return memcmp( (char *) s1, (char *) s2, (int) n ); -#else - return memcmp(s1, s2, n); -#endif -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Math */ -/*@{*/ - -/** Wrapper around sin() */ -double -_mesa_sin(double a) -{ - return sin(a); -} - -/** Single precision wrapper around sin() */ -float -_mesa_sinf(float a) -{ - return (float) sin((double) a); -} - -/** Wrapper around cos() */ -double -_mesa_cos(double a) -{ - return cos(a); -} - -/** Single precision wrapper around asin() */ -float -_mesa_asinf(float x) -{ - return (float) asin((double) x); -} - -/** Single precision wrapper around atan() */ -float -_mesa_atanf(float x) -{ - return (float) atan((double) x); -} - -/** Wrapper around sqrt() */ -double -_mesa_sqrtd(double x) -{ - return sqrt(x); -} - - -/* - * A High Speed, Low Precision Square Root - * by Paul Lalonde and Robert Dawson - * from "Graphics Gems", Academic Press, 1990 - * - * SPARC implementation of a fast square root by table - * lookup. - * SPARC floating point format is as follows: - * - * BIT 31 30 23 22 0 - * sign exponent mantissa - */ -static short sqrttab[0x100]; /* declare table of square roots */ - -void -_mesa_init_sqrt_table(void) -{ -#if defined(USE_IEEE) && !defined(DEBUG) - unsigned short i; - fi_type fi; /* to access the bits of a float in C quickly */ - /* we use a union defined in glheader.h */ - - for(i=0; i<= 0x7f; i++) { - fi.i = 0; - - /* - * Build a float with the bit pattern i as mantissa - * and an exponent of 0, stored as 127 - */ - - fi.i = (i << 16) | (127 << 23); - fi.f = _mesa_sqrtd(fi.f); - - /* - * Take the square root then strip the first 7 bits of - * the mantissa into the table - */ - - sqrttab[i] = (fi.i & 0x7fffff) >> 16; - - /* - * Repeat the process, this time with an exponent of - * 1, stored as 128 - */ - - fi.i = 0; - fi.i = (i << 16) | (128 << 23); - fi.f = sqrt(fi.f); - sqrttab[i+0x80] = (fi.i & 0x7fffff) >> 16; - } -#else - (void) sqrttab; /* silence compiler warnings */ -#endif /*HAVE_FAST_MATH*/ -} - - -/** - * Single precision square root. - */ -float -_mesa_sqrtf( float x ) -{ -#if defined(USE_IEEE) && !defined(DEBUG) - fi_type num; - /* to access the bits of a float in C - * we use a union from glheader.h */ - - short e; /* the exponent */ - if (x == 0.0F) return 0.0F; /* check for square root of 0 */ - num.f = x; - e = (num.i >> 23) - 127; /* get the exponent - on a SPARC the */ - /* exponent is stored with 127 added */ - num.i &= 0x7fffff; /* leave only the mantissa */ - if (e & 0x01) num.i |= 0x800000; - /* the exponent is odd so we have to */ - /* look it up in the second half of */ - /* the lookup table, so we set the */ - /* high bit */ - e >>= 1; /* divide the exponent by two */ - /* note that in C the shift */ - /* operators are sign preserving */ - /* for signed operands */ - /* Do the table lookup, based on the quaternary mantissa, - * then reconstruct the result back into a float - */ - num.i = ((sqrttab[num.i >> 16]) << 16) | ((e + 127) << 23); - - return num.f; -#else - return (float) _mesa_sqrtd((double) x); -#endif -} - - -/** - inv_sqrt - A single precision 1/sqrt routine for IEEE format floats. - written by Josh Vanderhoof, based on newsgroup posts by James Van Buskirk - and Vesa Karvonen. -*/ -float -_mesa_inv_sqrtf(float n) -{ -#if defined(USE_IEEE) && !defined(DEBUG) - float r0, x0, y0; - float r1, x1, y1; - float r2, x2, y2; -#if 0 /* not used, see below -BP */ - float r3, x3, y3; -#endif - union { float f; unsigned int i; } u; - unsigned int magic; - - /* - Exponent part of the magic number - - - We want to: - 1. subtract the bias from the exponent, - 2. negate it - 3. divide by two (rounding towards -inf) - 4. add the bias back - - Which is the same as subtracting the exponent from 381 and dividing - by 2. - - floor(-(x - 127) / 2) + 127 = floor((381 - x) / 2) - */ - - magic = 381 << 23; - - /* - Significand part of magic number - - - With the current magic number, "(magic - u.i) >> 1" will give you: - - for 1 <= u.f <= 2: 1.25 - u.f / 4 - for 2 <= u.f <= 4: 1.00 - u.f / 8 - - This isn't a bad approximation of 1/sqrt. The maximum difference from - 1/sqrt will be around .06. After three Newton-Raphson iterations, the - maximum difference is less than 4.5e-8. (Which is actually close - enough to make the following bias academic...) - - To get a better approximation you can add a bias to the magic - number. For example, if you subtract 1/2 of the maximum difference in - the first approximation (.03), you will get the following function: - - for 1 <= u.f <= 2: 1.22 - u.f / 4 - for 2 <= u.f <= 3.76: 0.97 - u.f / 8 - for 3.76 <= u.f <= 4: 0.72 - u.f / 16 - (The 3.76 to 4 range is where the result is < .5.) - - This is the closest possible initial approximation, but with a maximum - error of 8e-11 after three NR iterations, it is still not perfect. If - you subtract 0.0332281 instead of .03, the maximum error will be - 2.5e-11 after three NR iterations, which should be about as close as - is possible. - - for 1 <= u.f <= 2: 1.2167719 - u.f / 4 - for 2 <= u.f <= 3.73: 0.9667719 - u.f / 8 - for 3.73 <= u.f <= 4: 0.7167719 - u.f / 16 - - */ - - magic -= (int)(0.0332281 * (1 << 25)); - - u.f = n; - u.i = (magic - u.i) >> 1; - - /* - Instead of Newton-Raphson, we use Goldschmidt's algorithm, which - allows more parallelism. From what I understand, the parallelism - comes at the cost of less precision, because it lets error - accumulate across iterations. - */ - x0 = 1.0f; - y0 = 0.5f * n; - r0 = u.f; - - x1 = x0 * r0; - y1 = y0 * r0 * r0; - r1 = 1.5f - y1; - - x2 = x1 * r1; - y2 = y1 * r1 * r1; - r2 = 1.5f - y2; - -#if 1 - return x2 * r2; /* we can stop here, and be conformant -BP */ -#else - x3 = x2 * r2; - y3 = y2 * r2 * r2; - r3 = 1.5f - y3; - - return x3 * r3; -#endif -#else - return (float) (1.0 / sqrt(n)); -#endif -} - - -/** Wrapper around pow() */ -double -_mesa_pow(double x, double y) -{ - return pow(x, y); -} - - -/** - * Find the first bit set in a word. - */ -int -_mesa_ffs(int i) -{ -#if (defined(_WIN32) ) || defined(__IBMC__) || defined(__IBMCPP__) - register int bit = 0; - if (i != 0) { - if ((i & 0xffff) == 0) { - bit += 16; - i >>= 16; - } - if ((i & 0xff) == 0) { - bit += 8; - i >>= 8; - } - if ((i & 0xf) == 0) { - bit += 4; - i >>= 4; - } - while ((i & 1) == 0) { - bit++; - i >>= 1; - } - bit++; - } - return bit; -#else - return ffs(i); -#endif -} - - -/** - * Find position of first bit set in given value. - * XXX Warning: this function can only be used on 64-bit systems! - * \return position of least-significant bit set, starting at 1, return zero - * if no bits set. - */ -int -#ifdef __MINGW32__ -_mesa_ffsll(long val) -#else -_mesa_ffsll(long long val) -#endif -{ -#ifdef ffsll - return ffsll(val); -#else - int bit; - - assert(sizeof(val) == 8); - - bit = _mesa_ffs(val); - if (bit != 0) - return bit; - - bit = _mesa_ffs(val >> 32); - if (bit != 0) - return 32 + bit; - - return 0; -#endif -} - - -/** - * Return number of bits set in given GLuint. - */ -unsigned int -_mesa_bitcount(unsigned int n) -{ - unsigned int bits; - for (bits = 0; n > 0; n = n >> 1) { - bits += (n & 1); - } - return bits; -} - - -/** - * Convert a 4-byte float to a 2-byte half float. - * Based on code from: - * http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008786.html - */ -GLhalfARB -_mesa_float_to_half(float val) -{ - const int flt = *((int *) (void *) &val); - const int flt_m = flt & 0x7fffff; - const int flt_e = (flt >> 23) & 0xff; - const int flt_s = (flt >> 31) & 0x1; - int s, e, m = 0; - GLhalfARB result; - - /* sign bit */ - s = flt_s; - - /* handle special cases */ - if ((flt_e == 0) && (flt_m == 0)) { - /* zero */ - /* m = 0; - already set */ - e = 0; - } - else if ((flt_e == 0) && (flt_m != 0)) { - /* denorm -- denorm float maps to 0 half */ - /* m = 0; - already set */ - e = 0; - } - else if ((flt_e == 0xff) && (flt_m == 0)) { - /* infinity */ - /* m = 0; - already set */ - e = 31; - } - else if ((flt_e == 0xff) && (flt_m != 0)) { - /* NaN */ - m = 1; - e = 31; - } - else { - /* regular number */ - const int new_exp = flt_e - 127; - if (new_exp < -24) { - /* this maps to 0 */ - /* m = 0; - already set */ - e = 0; - } - else if (new_exp < -14) { - /* this maps to a denorm */ - unsigned int exp_val = (unsigned int) (-14 - new_exp); /* 2^-exp_val*/ - e = 0; - switch (exp_val) { - case 0: - _mesa_warning(NULL, - "float_to_half: logical error in denorm creation!\n"); - /* m = 0; - already set */ - break; - case 1: m = 512 + (flt_m >> 14); break; - case 2: m = 256 + (flt_m >> 15); break; - case 3: m = 128 + (flt_m >> 16); break; - case 4: m = 64 + (flt_m >> 17); break; - case 5: m = 32 + (flt_m >> 18); break; - case 6: m = 16 + (flt_m >> 19); break; - case 7: m = 8 + (flt_m >> 20); break; - case 8: m = 4 + (flt_m >> 21); break; - case 9: m = 2 + (flt_m >> 22); break; - case 10: m = 1; break; - } - } - else if (new_exp > 15) { - /* map this value to infinity */ - /* m = 0; - already set */ - e = 31; - } - else { - /* regular */ - e = new_exp + 15; - m = flt_m >> 13; - } - } - - result = (s << 15) | (e << 10) | m; - return result; -} - - -/** - * Convert a 2-byte half float to a 4-byte float. - * Based on code from: - * http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008786.html - */ -float -_mesa_half_to_float(GLhalfARB val) -{ - /* XXX could also use a 64K-entry lookup table */ - const int m = val & 0x3ff; - const int e = (val >> 10) & 0x1f; - const int s = (val >> 15) & 0x1; - int flt_m, flt_e, flt_s, flt; - float result; - - /* sign bit */ - flt_s = s; - - /* handle special cases */ - if ((e == 0) && (m == 0)) { - /* zero */ - flt_m = 0; - flt_e = 0; - } - else if ((e == 0) && (m != 0)) { - /* denorm -- denorm half will fit in non-denorm single */ - const float half_denorm = 1.0f / 16384.0f; /* 2^-14 */ - float mantissa = ((float) (m)) / 1024.0f; - float sign = s ? -1.0f : 1.0f; - return sign * mantissa * half_denorm; - } - else if ((e == 31) && (m == 0)) { - /* infinity */ - flt_e = 0xff; - flt_m = 0; - } - else if ((e == 31) && (m != 0)) { - /* NaN */ - flt_e = 0xff; - flt_m = 1; - } - else { - /* regular */ - flt_e = e + 112; - flt_m = m << 13; - } - - flt = (flt_s << 31) | (flt_e << 23) | flt_m; - result = *((float *) (void *) &flt); - return result; -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Sort & Search */ -/*@{*/ - -/** - * Wrapper for bsearch(). - */ -void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ) -{ -#if defined(_WIN32_WCE) - void *mid; - int cmp; - while (nmemb) { - nmemb >>= 1; - mid = (char *)base + nmemb * size; - cmp = (*compar)(key, mid); - if (cmp == 0) - return mid; - if (cmp > 0) { - base = (char *)mid + size; - --nmemb; - } - } - return NULL; -#else - return bsearch(key, base, nmemb, size, compar); -#endif -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Environment vars */ -/*@{*/ - -/** - * Wrapper for getenv(). - */ -char * -_mesa_getenv( const char *var ) -{ -#if defined(_XBOX) || defined(_WIN32_WCE) - return NULL; -#else - return getenv(var); -#endif -} - -/*@}*/ - - -/**********************************************************************/ -/** \name String */ -/*@{*/ - -/** Wrapper around strstr() */ -char * -_mesa_strstr( const char *haystack, const char *needle ) -{ - return strstr(haystack, needle); -} - -/** Wrapper around strncat() */ -char * -_mesa_strncat( char *dest, const char *src, size_t n ) -{ - return strncat(dest, src, n); -} - -/** Wrapper around strcpy() */ -char * -_mesa_strcpy( char *dest, const char *src ) -{ - return strcpy(dest, src); -} - -/** Wrapper around strncpy() */ -char * -_mesa_strncpy( char *dest, const char *src, size_t n ) -{ - return strncpy(dest, src, n); -} - -/** Wrapper around strlen() */ -size_t -_mesa_strlen( const char *s ) -{ - return strlen(s); -} - -/** Wrapper around strcmp() */ -int -_mesa_strcmp( const char *s1, const char *s2 ) -{ - return strcmp(s1, s2); -} - -/** Wrapper around strncmp() */ -int -_mesa_strncmp( const char *s1, const char *s2, size_t n ) -{ - return strncmp(s1, s2, n); -} - -/** - * Implemented using _mesa_malloc() and _mesa_strcpy. - * Note that NULL is handled accordingly. - */ -char * -_mesa_strdup( const char *s ) -{ - if (s) { - size_t l = _mesa_strlen(s); - char *s2 = (char *) _mesa_malloc(l + 1); - if (s2) - _mesa_strcpy(s2, s); - return s2; - } - else { - return NULL; - } -} - -/** Wrapper around atoi() */ -int -_mesa_atoi(const char *s) -{ - return atoi(s); -} - -/** Wrapper around strtod() */ -double -_mesa_strtod( const char *s, char **end ) -{ - return strtod(s, end); -} - -/*@}*/ - - -/**********************************************************************/ -/** \name I/O */ -/*@{*/ - -/** Wrapper around vsprintf() */ -int -_mesa_sprintf( char *str, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsprintf( str, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around vsnprintf() */ -int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsnprintf( str, size, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around printf(), using vsprintf() for the formatting. */ -void -_mesa_printf( const char *fmtString, ... ) -{ - char s[MAXSTRING]; - va_list args; - va_start( args, fmtString ); - vsnprintf(s, MAXSTRING, fmtString, args); - va_end( args ); - fprintf(stderr, "%s", s); -} - -/** Wrapper around fprintf(), using vsprintf() for the formatting. */ -void -_mesa_fprintf( FILE *f, const char *fmtString, ... ) -{ - char s[MAXSTRING]; - va_list args; - va_start( args, fmtString ); - vsnprintf(s, MAXSTRING, fmtString, args); - va_end( args ); - fprintf(f, "%s", s); -} - - -/** Wrapper around vsprintf() */ -int -_mesa_vsprintf( char *str, const char *fmt, va_list args ) -{ - return vsprintf( str, fmt, args ); -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Diagnostics */ -/*@{*/ - -/** - * Report a warning (a recoverable error condition) to stderr if - * either DEBUG is defined or the MESA_DEBUG env var is set. - * - * \param ctx GL context. - * \param fmtString printf() alike format string. - */ -void -_mesa_warning( GLcontext *ctx, const char *fmtString, ... ) -{ - GLboolean debug; - char str[MAXSTRING]; - va_list args; - (void) ctx; - va_start( args, fmtString ); - (void) vsnprintf( str, MAXSTRING, fmtString, args ); - va_end( args ); -#ifdef DEBUG - debug = GL_TRUE; /* always print warning */ -#else - debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE; -#endif - if (debug) { - fprintf(stderr, "Mesa warning: %s\n", str); - } -} - -/** - * Report an internla implementation problem. - * Prints the message to stderr via fprintf(). - * - * \param ctx GL context. - * \param s problem description string. - */ -void -_mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) -{ - va_list args; - char str[MAXSTRING]; - (void) ctx; - - va_start( args, fmtString ); - vsnprintf( str, MAXSTRING, fmtString, args ); - va_end( args ); - - fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str); - fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); -} - -/** - * Record an OpenGL state error. These usually occur when the users - * passes invalid parameters to a GL function. - * - * If debugging is enabled (either at compile-time via the DEBUG macro, or - * run-time via the MESA_DEBUG environment variable), report the error with - * _mesa_debug(). - * - * \param ctx the GL context. - * \param error the error value. - * \param fmtString printf() style format string, followed by optional args - */ -void -_mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) -{ - const char *debugEnv; - GLboolean debug; - - debugEnv = _mesa_getenv("MESA_DEBUG"); - -#ifdef DEBUG - if (debugEnv && _mesa_strstr(debugEnv, "silent")) - debug = GL_FALSE; - else - debug = GL_TRUE; -#else - if (debugEnv) - debug = GL_TRUE; - else - debug = GL_FALSE; -#endif - - if (debug) { - va_list args; - char where[MAXSTRING]; - const char *errstr; - - va_start( args, fmtString ); - vsnprintf( where, MAXSTRING, fmtString, args ); - va_end( args ); - - switch (error) { - case GL_NO_ERROR: - errstr = "GL_NO_ERROR"; - break; - case GL_INVALID_VALUE: - errstr = "GL_INVALID_VALUE"; - break; - case GL_INVALID_ENUM: - errstr = "GL_INVALID_ENUM"; - break; - case GL_INVALID_OPERATION: - errstr = "GL_INVALID_OPERATION"; - break; - case GL_STACK_OVERFLOW: - errstr = "GL_STACK_OVERFLOW"; - break; - case GL_STACK_UNDERFLOW: - errstr = "GL_STACK_UNDERFLOW"; - break; - case GL_OUT_OF_MEMORY: - errstr = "GL_OUT_OF_MEMORY"; - break; - case GL_TABLE_TOO_LARGE: - errstr = "GL_TABLE_TOO_LARGE"; - break; - case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: - errstr = "GL_INVALID_FRAMEBUFFER_OPERATION"; - break; - default: - errstr = "unknown"; - break; - } - _mesa_debug(ctx, "User error: %s in %s\n", errstr, where); - } - - _mesa_record_error(ctx, error); -} - -/** - * Report debug information. Print error message to stderr via fprintf(). - * No-op if DEBUG mode not enabled. - * - * \param ctx GL context. - * \param fmtString printf()-style format string, followed by optional args. - */ -void -_mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) -{ -#ifdef DEBUG - char s[MAXSTRING]; - va_list args; - va_start(args, fmtString); - vsnprintf(s, MAXSTRING, fmtString, args); - va_end(args); - fprintf(stderr, "Mesa: %s", s); -#endif /* DEBUG */ - (void) ctx; - (void) fmtString; -} - -/*@}*/ - - -/** - * Wrapper for exit(). - */ -void -_mesa_exit( int status ) -{ - exit(status); -} diff --git a/src/libs/mesa/mesa/main/imports.h b/src/libs/mesa/mesa/main/imports.h deleted file mode 100644 index e560bc0599..0000000000 --- a/src/libs/mesa/mesa/main/imports.h +++ /dev/null @@ -1,805 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file imports.h - * Standard C library function wrappers. - * - * This file provides wrappers for all the standard C library functions - * like malloc(), free(), printf(), getenv(), etc. - */ - - -#ifndef IMPORTS_H -#define IMPORTS_H - - -/* XXX some of the stuff in glheader.h should be moved into this file. - */ -#include "glheader.h" -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/**********************************************************************/ -/** \name General macros */ -/*@{*/ - -#ifndef NULL -#define NULL 0 -#endif - - -/** gcc -pedantic warns about long string literals, LONGSTRING silences that */ -#if !defined(__GNUC__) || (__GNUC__ < 2) || \ - ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) -# define LONGSTRING -#else -# define LONGSTRING __extension__ -#endif - -/*@}*/ - - -/**********************************************************************/ -/** Memory macros */ -/*@{*/ - -/** Allocate \p BYTES bytes */ -#define MALLOC(BYTES) _mesa_malloc(BYTES) -/** Allocate and zero \p BYTES bytes */ -#define CALLOC(BYTES) _mesa_calloc(BYTES) -/** Allocate a structure of type \p T */ -#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T)) -/** Allocate and zero a structure of type \p T */ -#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) -/** Free memory */ -#define FREE(PTR) _mesa_free(PTR) - -/** Allocate \p BYTES aligned at \p N bytes */ -#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N) -/** Allocate and zero \p BYTES bytes aligned at \p N bytes */ -#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N) -/** Allocate a structure of type \p T aligned at \p N bytes */ -#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N) -/** Allocate and zero a structure of type \p T aligned at \p N bytes */ -#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N) -/** Free aligned memory */ -#define ALIGN_FREE(PTR) _mesa_align_free(PTR) - -/** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES) -/** Set \p N bytes in \p DST to \p VAL */ -#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N) - -/*@}*/ - - -/* - * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers - * as offsets into buffer stores. Since the vertex array pointer and - * buffer store pointer are both pointers and we need to add them, we use - * this macro. - * Both pointers/offsets are expressed in bytes. - */ -#define ADD_POINTERS(A, B) ( (GLubyte *) (A) + (uintptr_t) (B) ) - - -/** - * Sometimes we treat GLfloats as GLints. On x86 systems, moving a float - * as a int (thereby using integer registers instead of FP registers) is - * a performance win. Typically, this can be done with ordinary casts. - * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0) - * these casts generate warnings. - * The following union typedef is used to solve that. - */ -typedef union { GLfloat f; GLint i; } fi_type; - - - -/********************************************************************** - * Math macros - */ - -#define MAX_GLUSHORT 0xffff -#define MAX_GLUINT 0xffffffff - -#ifndef M_PI -#define M_PI (3.1415926536) -#endif - -#ifndef M_E -#define M_E (2.7182818284590452354) -#endif - -#ifndef ONE_DIV_LN2 -#define ONE_DIV_LN2 (1.442695040888963456) -#endif - -#ifndef ONE_DIV_SQRT_LN2 -#define ONE_DIV_SQRT_LN2 (1.201122408786449815) -#endif - -#ifndef FLT_MAX_EXP -#define FLT_MAX_EXP 128 -#endif - -/* Degrees to radians conversion: */ -#define DEG2RAD (M_PI/180.0) - - -/*** - *** USE_IEEE: Determine if we're using IEEE floating point - ***/ -#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ - defined(__s390x__) || defined(__powerpc__) || \ - defined(__x86_64__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__hppa__) || defined(hpux) || \ - defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ - defined(__sh__) || defined(__m32r__) || \ - (defined(__sun) && defined(_IEEE_754)) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) -#define USE_IEEE -#define IEEE_ONE 0x3f800000 -#endif - - -/*** - *** SQRTF: single-precision square root - ***/ -#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */ -# define SQRTF(X) _mesa_sqrtf(X) -#else -# define SQRTF(X) (float) sqrt((float) (X)) -#endif - - -/*** - *** INV_SQRTF: single-precision inverse square root - ***/ -#if 0 -#define INV_SQRTF(X) _mesa_inv_sqrt(X) -#else -#define INV_SQRTF(X) (1.0F / SQRTF(X)) /* this is faster on a P4 */ -#endif - - -/*** - *** LOG2: Log base 2 of float - ***/ -#ifdef USE_IEEE -#if 0 -/* This is pretty fast, but not accurate enough (only 2 fractional bits). - * Based on code from http://www.stereopsis.com/log2.html - */ -static INLINE GLfloat LOG2(GLfloat x) -{ - const GLfloat y = x * x * x * x; - const GLuint ix = *((GLuint *) &y); - const GLuint exp = (ix >> 23) & 0xFF; - const GLint log2 = ((GLint) exp) - 127; - return (GLfloat) log2 * (1.0 / 4.0); /* 4, because of x^4 above */ -} -#endif -/* Pretty fast, and accurate. - * Based on code from http://www.flipcode.com/totd/ - */ -static INLINE GLfloat LOG2(GLfloat val) -{ - fi_type num; - GLint log_2; - num.f = val; - log_2 = ((num.i >> 23) & 255) - 128; - num.i &= ~(255 << 23); - num.i += 127 << 23; - num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3; - return num.f + log_2; -} -#else -/* - * NOTE: log_base_2(x) = log(x) / log(2) - * NOTE: 1.442695 = 1/log(2). - */ -#define LOG2(x) ((GLfloat) (log(x) * 1.442695F)) -#endif - - -/*** - *** IS_INF_OR_NAN: test if float is infinite or NaN - ***/ -#ifdef USE_IEEE -static INLINE int IS_INF_OR_NAN( float x ) -{ - fi_type tmp; - tmp.f = x; - return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31); -} -#elif defined(isfinite) -#define IS_INF_OR_NAN(x) (!isfinite(x)) -#elif defined(finite) -#define IS_INF_OR_NAN(x) (!finite(x)) -#elif defined(__VMS) -#define IS_INF_OR_NAN(x) (!finite(x)) -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#define IS_INF_OR_NAN(x) (!isfinite(x)) -#else -#define IS_INF_OR_NAN(x) (!finite(x)) -#endif - - -/*** - *** IS_NEGATIVE: test if float is negative - ***/ -#if defined(USE_IEEE) -static INLINE int GET_FLOAT_BITS( float x ) -{ - fi_type fi; - fi.f = x; - return fi.i; -} -#define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) < 0) -#else -#define IS_NEGATIVE(x) (x < 0.0F) -#endif - - -/*** - *** DIFFERENT_SIGNS: test if two floats have opposite signs - ***/ -#if defined(USE_IEEE) -#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31)) -#else -/* Could just use (x*y<0) except for the flatshading requirements. - * Maybe there's a better way? - */ -#define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F) -#endif - - -/*** - *** CEILF: ceiling of float - *** FLOORF: floor of float - *** FABSF: absolute value of float - *** LOGF: the natural logarithm (base e) of the value - *** EXPF: raise e to the value - *** LDEXPF: multiply value by an integral power of two - *** FREXPF: extract mantissa and exponent from value - ***/ -#if defined(__gnu_linux__) -/* C99 functions */ -#define CEILF(x) ceilf(x) -#define FLOORF(x) floorf(x) -#define FABSF(x) fabsf(x) -#define LOGF(x) logf(x) -#define EXPF(x) expf(x) -#define LDEXPF(x,y) ldexpf(x,y) -#define FREXPF(x,y) frexpf(x,y) -#else -#define CEILF(x) ((GLfloat) ceil(x)) -#define FLOORF(x) ((GLfloat) floor(x)) -#define FABSF(x) ((GLfloat) fabs(x)) -#define LOGF(x) ((GLfloat) log(x)) -#define EXPF(x) ((GLfloat) exp(x)) -#define LDEXPF(x,y) ((GLfloat) ldexp(x,y)) -#define FREXPF(x,y) ((GLfloat) frexp(x,y)) -#endif - - -/*** - *** IROUND: return (as an integer) float rounded to nearest integer - ***/ -#if defined(USE_SPARC_ASM) && defined(__GNUC__) && defined(__sparc__) -static INLINE int iround(float f) -{ - int r; - __asm__ ("fstoi %1, %0" : "=f" (r) : "f" (f)); - return r; -} -#define IROUND(x) iround(x) -#elif defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \ - (!(defined(__BEOS__) || defined(__HAIKU__)) || \ - (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))) -static INLINE int iround(float f) -{ - int r; - __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st"); - return r; -} -#define IROUND(x) iround(x) -#elif defined(USE_X86_ASM) && defined(_MSC_VER) -static INLINE int iround(float f) -{ - int r; - _asm { - fld f - fistp r - } - return r; -} -#define IROUND(x) iround(x) -#elif defined(__WATCOMC__) && defined(__386__) -long iround(float f); -#pragma aux iround = \ - "push eax" \ - "fistp dword ptr [esp]" \ - "pop eax" \ - parm [8087] \ - value [eax] \ - modify exact [eax]; -#define IROUND(x) iround(x) -#else -#define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F))) -#endif - - -/*** - *** IROUND_POS: return (as an integer) positive float rounded to nearest int - ***/ -#ifdef DEBUG -#define IROUND_POS(f) (assert((f) >= 0.0F), IROUND(f)) -#else -#define IROUND_POS(f) (IROUND(f)) -#endif - - -/*** - *** IFLOOR: return (as an integer) floor of float - ***/ -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) -/* - * IEEE floor for computers that round to nearest or even. - * 'f' must be between -4194304 and 4194303. - * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1", - * but uses some IEEE specific tricks for better speed. - * Contributed by Josh Vanderhoof - */ -static INLINE int ifloor(float f) -{ - int ai, bi; - double af, bf; - af = (3 << 22) + 0.5 + (double)f; - bf = (3 << 22) + 0.5 - (double)f; - /* GCC generates an extra fstp/fld without this. */ - __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); - __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); - return (ai - bi) >> 1; -} -#define IFLOOR(x) ifloor(x) -#elif defined(USE_IEEE) -static INLINE int ifloor(float f) -{ - int ai, bi; - double af, bf; - fi_type u; - - af = (3 << 22) + 0.5 + (double)f; - bf = (3 << 22) + 0.5 - (double)f; - u.f = (float) af; ai = u.i; - u.f = (float) bf; bi = u.i; - return (ai - bi) >> 1; -} -#define IFLOOR(x) ifloor(x) -#else -static INLINE int ifloor(float f) -{ - int i = IROUND(f); - return (i > f) ? i - 1 : i; -} -#define IFLOOR(x) ifloor(x) -#endif - - -/*** - *** ICEIL: return (as an integer) ceiling of float - ***/ -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) -/* - * IEEE ceil for computers that round to nearest or even. - * 'f' must be between -4194304 and 4194303. - * This ceil operation is done by "(iround(f + .5) + iround(f - .5) + 1) >> 1", - * but uses some IEEE specific tricks for better speed. - * Contributed by Josh Vanderhoof - */ -static INLINE int iceil(float f) -{ - int ai, bi; - double af, bf; - af = (3 << 22) + 0.5 + (double)f; - bf = (3 << 22) + 0.5 - (double)f; - /* GCC generates an extra fstp/fld without this. */ - __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); - __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); - return (ai - bi + 1) >> 1; -} -#define ICEIL(x) iceil(x) -#elif defined(USE_IEEE) -static INLINE int iceil(float f) -{ - int ai, bi; - double af, bf; - fi_type u; - af = (3 << 22) + 0.5 + (double)f; - bf = (3 << 22) + 0.5 - (double)f; - u.f = (float) af; ai = u.i; - u.f = (float) bf; bi = u.i; - return (ai - bi + 1) >> 1; -} -#define ICEIL(x) iceil(x) -#else -static INLINE int iceil(float f) -{ - int i = IROUND(f); - return (i < f) ? i + 1 : i; -} -#define ICEIL(x) iceil(x) -#endif - - -/** - * Is x a power of two? - */ -static INLINE int -_mesa_is_pow_two(int x) -{ - return !(x & (x - 1)); -} - - -/*** - *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255] - *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255] - ***/ -#if defined(USE_IEEE) && !defined(DEBUG) -#define IEEE_0996 0x3f7f0000 /* 0.996 or so */ -/* This function/macro is sensitive to precision. Test very carefully - * if you change it! - */ -#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \ - do { \ - fi_type __tmp; \ - __tmp.f = (F); \ - if (__tmp.i < 0) \ - UB = (GLubyte) 0; \ - else if (__tmp.i >= IEEE_0996) \ - UB = (GLubyte) 255; \ - else { \ - __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \ - UB = (GLubyte) __tmp.i; \ - } \ - } while (0) -#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \ - do { \ - fi_type __tmp; \ - __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \ - UB = (GLubyte) __tmp.i; \ - } while (0) -#else -#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \ - ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F)) -#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \ - ub = ((GLubyte) IROUND((f) * 255.0F)) -#endif - - -/*** - *** START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save - *** original mode to a temporary). - *** END_FAST_MATH: Restore x86 FPU to original mode. - ***/ -#if defined(__GNUC__) && defined(__i386__) -/* - * Set the x86 FPU control word to guarentee only 32 bits of precision - * are stored in registers. Allowing the FPU to store more introduces - * differences between situations where numbers are pulled out of memory - * vs. situations where the compiler is able to optimize register usage. - * - * In the worst case, we force the compiler to use a memory access to - * truncate the float, by specifying the 'volatile' keyword. - */ -/* Hardware default: All exceptions masked, extended double precision, - * round to nearest (IEEE compliant): - */ -#define DEFAULT_X86_FPU 0x037f -/* All exceptions masked, single precision, round to nearest: - */ -#define FAST_X86_FPU 0x003f -/* The fldcw instruction will cause any pending FP exceptions to be - * raised prior to entering the block, and we clear any pending - * exceptions before exiting the block. Hence, asm code has free - * reign over the FPU while in the fast math block. - */ -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) \ -do { \ - static GLuint mask = DEFAULT_X86_FPU; \ - __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ - __asm__ ( "fldcw %0" : : "m" (mask) ); \ -} while (0) -#else -#define START_FAST_MATH(x) \ -do { \ - static GLuint mask = FAST_X86_FPU; \ - __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ - __asm__ ( "fldcw %0" : : "m" (mask) ); \ -} while (0) -#endif -/* Restore original FPU mode, and clear any exceptions that may have - * occurred in the FAST_MATH block. - */ -#define END_FAST_MATH(x) \ -do { \ - __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \ -} while (0) - -#elif defined(__WATCOMC__) && defined(__386__) -#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ -#define FAST_X86_FPU 0x003f /* See GCC comments above */ -void _watcom_start_fast_math(unsigned short *x,unsigned short *mask); -#pragma aux _watcom_start_fast_math = \ - "fnstcw word ptr [eax]" \ - "fldcw word ptr [ecx]" \ - parm [eax] [ecx] \ - modify exact []; -void _watcom_end_fast_math(unsigned short *x); -#pragma aux _watcom_end_fast_math = \ - "fnclex" \ - "fldcw word ptr [eax]" \ - parm [eax] \ - modify exact []; -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = DEFAULT_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#else -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = FAST_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#endif -#define END_FAST_MATH(x) _watcom_end_fast_math(&x) - -#elif defined(_MSC_VER) && defined(_M_IX86) -#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ -#define FAST_X86_FPU 0x003f /* See GCC comments above */ -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) do {\ - static GLuint mask = DEFAULT_X86_FPU;\ - __asm fnstcw word ptr [x]\ - __asm fldcw word ptr [mask]\ -} while(0) -#else -#define START_FAST_MATH(x) do {\ - static GLuint mask = FAST_X86_FPU;\ - __asm fnstcw word ptr [x]\ - __asm fldcw word ptr [mask]\ -} while(0) -#endif -#define END_FAST_MATH(x) do {\ - __asm fnclex\ - __asm fldcw word ptr [x]\ -} while(0) - -#else -#define START_FAST_MATH(x) x = 0 -#define END_FAST_MATH(x) (void)(x) -#endif - - -/** - * Return 1 if this is a little endian machine, 0 if big endian. - */ -static INLINE GLboolean -_mesa_little_endian(void) -{ - const GLuint ui = 1; /* intentionally not static */ - return *((const GLubyte *) &ui); -} - - - -/********************************************************************** - * Functions - */ - -extern void * -_mesa_malloc( size_t bytes ); - -extern void * -_mesa_calloc( size_t bytes ); - -extern void -_mesa_free( void *ptr ); - -extern void * -_mesa_align_malloc( size_t bytes, unsigned long alignment ); - -extern void * -_mesa_align_calloc( size_t bytes, unsigned long alignment ); - -extern void -_mesa_align_free( void *ptr ); - -extern void * -_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, - unsigned long alignment); - -extern void * -_mesa_exec_malloc( GLuint size ); - -extern void -_mesa_exec_free( void *addr ); - -extern void * -_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); - -extern void * -_mesa_memcpy( void *dest, const void *src, size_t n ); - -extern void -_mesa_memset( void *dst, int val, size_t n ); - -extern void -_mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); - -extern void -_mesa_bzero( void *dst, size_t n ); - -extern int -_mesa_memcmp( const void *s1, const void *s2, size_t n ); - -extern double -_mesa_sin(double a); - -extern float -_mesa_sinf(float a); - -extern double -_mesa_cos(double a); - -extern float -_mesa_asinf(float x); - -extern float -_mesa_atanf(float x); - -extern double -_mesa_sqrtd(double x); - -extern float -_mesa_sqrtf(float x); - -extern float -_mesa_inv_sqrtf(float x); - -extern void -_mesa_init_sqrt_table(void); - -extern double -_mesa_pow(double x, double y); - -extern int -_mesa_ffs(int i); - -extern int -#ifdef __MINGW32__ -_mesa_ffsll(long i); -#else -_mesa_ffsll(long long i); -#endif - -extern unsigned int -_mesa_bitcount(unsigned int n); - -extern GLhalfARB -_mesa_float_to_half(float f); - -extern float -_mesa_half_to_float(GLhalfARB h); - - -extern void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ); - -extern char * -_mesa_getenv( const char *var ); - -extern char * -_mesa_strstr( const char *haystack, const char *needle ); - -extern char * -_mesa_strncat( char *dest, const char *src, size_t n ); - -extern char * -_mesa_strcpy( char *dest, const char *src ); - -extern char * -_mesa_strncpy( char *dest, const char *src, size_t n ); - -extern size_t -_mesa_strlen( const char *s ); - -extern int -_mesa_strcmp( const char *s1, const char *s2 ); - -extern int -_mesa_strncmp( const char *s1, const char *s2, size_t n ); - -extern char * -_mesa_strdup( const char *s ); - -extern int -_mesa_atoi( const char *s ); - -extern double -_mesa_strtod( const char *s, char **end ); - -extern int -_mesa_sprintf( char *str, const char *fmt, ... ); - -extern int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); - -extern void -_mesa_printf( const char *fmtString, ... ); - -extern void -_mesa_fprintf( FILE *f, const char *fmtString, ... ); - -extern int -_mesa_vsprintf( char *str, const char *fmt, va_list args ); - - -extern void -_mesa_warning( __GLcontext *gc, const char *fmtString, ... ); - -extern void -_mesa_problem( const __GLcontext *ctx, const char *fmtString, ... ); - -extern void -_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... ); - -extern void -_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... ); - -extern void -_mesa_exit( int status ); - - -#ifdef __cplusplus -} -#endif - - -#endif /* IMPORTS_H */ diff --git a/src/libs/mesa/mesa/main/light.c b/src/libs/mesa/mesa/main/light.c deleted file mode 100644 index 4372f7bb53..0000000000 --- a/src/libs/mesa/mesa/main/light.c +++ /dev/null @@ -1,1393 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "enums.h" -#include "light.h" -#include "macros.h" -#include "simple_list.h" -#include "mtypes.h" -#include "math/m_matrix.h" - - -void GLAPIENTRY -_mesa_ShadeModel( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode)); - - if (mode != GL_FLAT && mode != GL_SMOOTH) { - _mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel"); - return; - } - - if (ctx->Light.ShadeModel == mode) - return; - - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.ShadeModel = mode; - if (mode == GL_FLAT) - ctx->_TriangleCaps |= DD_FLATSHADE; - else - ctx->_TriangleCaps &= ~DD_FLATSHADE; - - if (ctx->Driver.ShadeModel) - ctx->Driver.ShadeModel( ctx, mode ); -} - - -/** - * Helper function called by _mesa_Lightfv and _mesa_PopAttrib to set - * per-light state. - * For GL_POSITION and GL_SPOT_DIRECTION the params position/direction - * will have already been transformed by the modelview matrix! - * Also, all error checking should have already been done. - */ -void -_mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) -{ - struct gl_light *light; - - ASSERT(lnum < MAX_LIGHTS); - light = &ctx->Light.Light[lnum]; - - switch (pname) { - case GL_AMBIENT: - if (TEST_EQ_4V(light->Ambient, params)) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_4V( light->Ambient, params ); - break; - case GL_DIFFUSE: - if (TEST_EQ_4V(light->Diffuse, params)) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_4V( light->Diffuse, params ); - break; - case GL_SPECULAR: - if (TEST_EQ_4V(light->Specular, params)) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_4V( light->Specular, params ); - break; - case GL_POSITION: - /* NOTE: position has already been transformed by ModelView! */ - if (TEST_EQ_4V(light->EyePosition, params)) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_4V(light->EyePosition, params); - if (light->EyePosition[3] != 0.0F) - light->_Flags |= LIGHT_POSITIONAL; - else - light->_Flags &= ~LIGHT_POSITIONAL; - break; - case GL_SPOT_DIRECTION: - /* NOTE: Direction already transformed by inverse ModelView! */ - if (TEST_EQ_3V(light->EyeDirection, params)) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_3V(light->EyeDirection, params); - break; - case GL_SPOT_EXPONENT: - ASSERT(params[0] >= 0.0); - ASSERT(params[0] <= ctx->Const.MaxSpotExponent); - if (light->SpotExponent == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - light->SpotExponent = params[0]; - _mesa_invalidate_spot_exp_table(light); - break; - case GL_SPOT_CUTOFF: - ASSERT(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0)); - if (light->SpotCutoff == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - light->SpotCutoff = params[0]; - light->_CosCutoffNeg = (GLfloat) (_mesa_cos(light->SpotCutoff * DEG2RAD)); - if (light->_CosCutoffNeg < 0) - light->_CosCutoff = 0; - else - light->_CosCutoff = light->_CosCutoffNeg; - if (light->SpotCutoff != 180.0F) - light->_Flags |= LIGHT_SPOT; - else - light->_Flags &= ~LIGHT_SPOT; - break; - case GL_CONSTANT_ATTENUATION: - ASSERT(params[0] >= 0.0); - if (light->ConstantAttenuation == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - light->ConstantAttenuation = params[0]; - break; - case GL_LINEAR_ATTENUATION: - ASSERT(params[0] >= 0.0); - if (light->LinearAttenuation == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - light->LinearAttenuation = params[0]; - break; - case GL_QUADRATIC_ATTENUATION: - ASSERT(params[0] >= 0.0); - if (light->QuadraticAttenuation == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - light->QuadraticAttenuation = params[0]; - break; - default: - _mesa_problem(ctx, "Unexpected pname in _mesa_light()"); - return; - } - - if (ctx->Driver.Lightfv) - ctx->Driver.Lightfv( ctx, GL_LIGHT0 + lnum, pname, params ); -} - - -void GLAPIENTRY -_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) -{ - _mesa_Lightfv( light, pname, ¶m ); -} - - -void GLAPIENTRY -_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i = (GLint) (light - GL_LIGHT0); - GLfloat temp[4]; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (i < 0 || i >= (GLint) ctx->Const.MaxLights) { - _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light ); - return; - } - - /* do particular error checks, transformations */ - switch (pname) { - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - /* nothing */ - break; - case GL_POSITION: - /* transform position by ModelView matrix */ - TRANSFORM_POINT(temp, ctx->ModelviewMatrixStack.Top->m, params); - params = temp; - break; - case GL_SPOT_DIRECTION: - /* transform direction by inverse modelview */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse(ctx->ModelviewMatrixStack.Top); - } - TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m); - params = temp; - break; - case GL_SPOT_EXPONENT: - if (params[0] < 0.0 || params[0] > ctx->Const.MaxSpotExponent) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLight"); - return; - } - break; - case GL_SPOT_CUTOFF: - if ((params[0] < 0.0 || params[0] > 90.0) && params[0] != 180.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLight"); - return; - } - break; - case GL_CONSTANT_ATTENUATION: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLight"); - return; - } - break; - case GL_LINEAR_ATTENUATION: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLight"); - return; - } - break; - case GL_QUADRATIC_ATTENUATION: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLight"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glLight(pname=0x%x)", pname); - return; - } - - _mesa_light(ctx, i, pname, params); -} - - -void GLAPIENTRY -_mesa_Lighti( GLenum light, GLenum pname, GLint param ) -{ - _mesa_Lightiv( light, pname, ¶m ); -} - - -void GLAPIENTRY -_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 GLAPIENTRY -_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint l = (GLint) (light - GL_LIGHT0); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (l < 0 || l >= (GLint) ctx->Const.MaxLights) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightfv" ); - return; - } - - switch (pname) { - case GL_AMBIENT: - COPY_4V( params, ctx->Light.Light[l].Ambient ); - break; - case GL_DIFFUSE: - COPY_4V( params, ctx->Light.Light[l].Diffuse ); - break; - case GL_SPECULAR: - COPY_4V( params, ctx->Light.Light[l].Specular ); - break; - case GL_POSITION: - COPY_4V( params, ctx->Light.Light[l].EyePosition ); - break; - case GL_SPOT_DIRECTION: - COPY_3V( params, ctx->Light.Light[l].EyeDirection ); - break; - case GL_SPOT_EXPONENT: - params[0] = ctx->Light.Light[l].SpotExponent; - break; - case GL_SPOT_CUTOFF: - params[0] = ctx->Light.Light[l].SpotCutoff; - break; - case GL_CONSTANT_ATTENUATION: - params[0] = ctx->Light.Light[l].ConstantAttenuation; - break; - case GL_LINEAR_ATTENUATION: - params[0] = ctx->Light.Light[l].LinearAttenuation; - break; - case GL_QUADRATIC_ATTENUATION: - params[0] = ctx->Light.Light[l].QuadraticAttenuation; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightfv" ); - break; - } -} - - -void GLAPIENTRY -_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint l = (GLint) (light - GL_LIGHT0); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (l < 0 || l >= (GLint) ctx->Const.MaxLights) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightiv" ); - return; - } - - switch (pname) { - case GL_AMBIENT: - params[0] = FLOAT_TO_INT(ctx->Light.Light[l].Ambient[0]); - params[1] = FLOAT_TO_INT(ctx->Light.Light[l].Ambient[1]); - params[2] = FLOAT_TO_INT(ctx->Light.Light[l].Ambient[2]); - params[3] = FLOAT_TO_INT(ctx->Light.Light[l].Ambient[3]); - break; - case GL_DIFFUSE: - params[0] = FLOAT_TO_INT(ctx->Light.Light[l].Diffuse[0]); - params[1] = FLOAT_TO_INT(ctx->Light.Light[l].Diffuse[1]); - params[2] = FLOAT_TO_INT(ctx->Light.Light[l].Diffuse[2]); - params[3] = FLOAT_TO_INT(ctx->Light.Light[l].Diffuse[3]); - break; - case GL_SPECULAR: - params[0] = FLOAT_TO_INT(ctx->Light.Light[l].Specular[0]); - params[1] = FLOAT_TO_INT(ctx->Light.Light[l].Specular[1]); - params[2] = FLOAT_TO_INT(ctx->Light.Light[l].Specular[2]); - params[3] = FLOAT_TO_INT(ctx->Light.Light[l].Specular[3]); - break; - case GL_POSITION: - params[0] = (GLint) ctx->Light.Light[l].EyePosition[0]; - params[1] = (GLint) ctx->Light.Light[l].EyePosition[1]; - params[2] = (GLint) ctx->Light.Light[l].EyePosition[2]; - params[3] = (GLint) ctx->Light.Light[l].EyePosition[3]; - break; - case GL_SPOT_DIRECTION: - params[0] = (GLint) ctx->Light.Light[l].EyeDirection[0]; - params[1] = (GLint) ctx->Light.Light[l].EyeDirection[1]; - params[2] = (GLint) ctx->Light.Light[l].EyeDirection[2]; - break; - case GL_SPOT_EXPONENT: - params[0] = (GLint) ctx->Light.Light[l].SpotExponent; - break; - case GL_SPOT_CUTOFF: - params[0] = (GLint) ctx->Light.Light[l].SpotCutoff; - break; - case GL_CONSTANT_ATTENUATION: - params[0] = (GLint) ctx->Light.Light[l].ConstantAttenuation; - break; - case GL_LINEAR_ATTENUATION: - params[0] = (GLint) ctx->Light.Light[l].LinearAttenuation; - break; - case GL_QUADRATIC_ATTENUATION: - params[0] = (GLint) ctx->Light.Light[l].QuadraticAttenuation; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightiv" ); - break; - } -} - - - -/**********************************************************************/ -/*** Light Model ***/ -/**********************************************************************/ - - -void GLAPIENTRY -_mesa_LightModelfv( GLenum pname, const GLfloat *params ) -{ - GLenum newenum; - GLboolean newbool; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (pname) { - case GL_LIGHT_MODEL_AMBIENT: - if (TEST_EQ_4V( ctx->Light.Model.Ambient, params )) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_4V( ctx->Light.Model.Ambient, params ); - break; - case GL_LIGHT_MODEL_LOCAL_VIEWER: - newbool = (params[0]!=0.0); - if (ctx->Light.Model.LocalViewer == newbool) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Model.LocalViewer = newbool; - break; - case GL_LIGHT_MODEL_TWO_SIDE: - newbool = (params[0]!=0.0); - if (ctx->Light.Model.TwoSide == newbool) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Model.TwoSide = newbool; - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - else - ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; - break; - case GL_LIGHT_MODEL_COLOR_CONTROL: - if (params[0] == (GLfloat) GL_SINGLE_COLOR) - newenum = GL_SINGLE_COLOR; - else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR) - newenum = GL_SEPARATE_SPECULAR_COLOR; - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param=0x0%x)", - (GLint) params[0] ); - return; - } - if (ctx->Light.Model.ColorControl == newenum) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Model.ColorControl = newenum; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname ); - break; - } - - if (ctx->Driver.LightModelfv) - ctx->Driver.LightModelfv( ctx, pname, params ); -} - - -void GLAPIENTRY -_mesa_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 */ - ; - } - _mesa_LightModelfv( pname, fparam ); -} - - -void GLAPIENTRY -_mesa_LightModeli( GLenum pname, GLint param ) -{ - _mesa_LightModeliv( pname, ¶m ); -} - - -void GLAPIENTRY -_mesa_LightModelf( GLenum pname, GLfloat param ) -{ - _mesa_LightModelfv( pname, ¶m ); -} - - - -/********** MATERIAL **********/ - - -/* - * Given a face and pname value (ala glColorMaterial), compute a bitmask - * of the targeted material values. - */ -GLuint -_mesa_material_bitmask( GLcontext *ctx, GLenum face, GLenum pname, - GLuint legal, const char *where ) -{ - GLuint bitmask = 0; - - /* Make a bitmask indicating what material attribute(s) we're updating */ - switch (pname) { - case GL_EMISSION: - bitmask |= MAT_BIT_FRONT_EMISSION | MAT_BIT_BACK_EMISSION; - break; - case GL_AMBIENT: - bitmask |= MAT_BIT_FRONT_AMBIENT | MAT_BIT_BACK_AMBIENT; - break; - case GL_DIFFUSE: - bitmask |= MAT_BIT_FRONT_DIFFUSE | MAT_BIT_BACK_DIFFUSE; - break; - case GL_SPECULAR: - bitmask |= MAT_BIT_FRONT_SPECULAR | MAT_BIT_BACK_SPECULAR; - break; - case GL_SHININESS: - bitmask |= MAT_BIT_FRONT_SHININESS | MAT_BIT_BACK_SHININESS; - break; - case GL_AMBIENT_AND_DIFFUSE: - bitmask |= MAT_BIT_FRONT_AMBIENT | MAT_BIT_BACK_AMBIENT; - bitmask |= MAT_BIT_FRONT_DIFFUSE | MAT_BIT_BACK_DIFFUSE; - break; - case GL_COLOR_INDEXES: - bitmask |= MAT_BIT_FRONT_INDEXES | MAT_BIT_BACK_INDEXES; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, where ); - return 0; - } - - if (face==GL_FRONT) { - bitmask &= FRONT_MATERIAL_BITS; - } - else if (face==GL_BACK) { - bitmask &= BACK_MATERIAL_BITS; - } - else if (face != GL_FRONT_AND_BACK) { - _mesa_error( ctx, GL_INVALID_ENUM, where ); - return 0; - } - - if (bitmask & ~legal) { - _mesa_error( ctx, GL_INVALID_ENUM, where ); - return 0; - } - - return bitmask; -} - - - -/* Perform a straight copy between materials. - */ -void -_mesa_copy_materials( struct gl_material *dst, - const struct gl_material *src, - GLuint bitmask ) -{ - int i; - - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) - if (bitmask & (1<Attrib[i], src->Attrib[i] ); -} - - - -/* Update derived values following a change in ctx->Light.Material - */ -void -_mesa_update_material( GLcontext *ctx, GLuint bitmask ) -{ - struct gl_light *light, *list = &ctx->Light.EnabledList; - GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - - if (MESA_VERBOSE&VERBOSE_IMMEDIATE) - _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); - - if (!bitmask) - return; - - /* update material ambience */ - if (bitmask & MAT_BIT_FRONT_AMBIENT) { - foreach (light, list) { - SCALE_3V( light->_MatAmbient[0], light->Ambient, - mat[MAT_ATTRIB_FRONT_AMBIENT]); - } - } - - if (bitmask & MAT_BIT_BACK_AMBIENT) { - foreach (light, list) { - SCALE_3V( light->_MatAmbient[1], light->Ambient, - mat[MAT_ATTRIB_BACK_AMBIENT]); - } - } - - /* update BaseColor = emission + scene's ambience * material's ambience */ - if (bitmask & (MAT_BIT_FRONT_EMISSION | MAT_BIT_FRONT_AMBIENT)) { - COPY_3V( ctx->Light._BaseColor[0], mat[MAT_ATTRIB_FRONT_EMISSION] ); - ACC_SCALE_3V( ctx->Light._BaseColor[0], mat[MAT_ATTRIB_FRONT_AMBIENT], - ctx->Light.Model.Ambient ); - } - - if (bitmask & (MAT_BIT_BACK_EMISSION | MAT_BIT_BACK_AMBIENT)) { - COPY_3V( ctx->Light._BaseColor[1], mat[MAT_ATTRIB_BACK_EMISSION] ); - ACC_SCALE_3V( ctx->Light._BaseColor[1], mat[MAT_ATTRIB_BACK_AMBIENT], - ctx->Light.Model.Ambient ); - } - - /* update material diffuse values */ - if (bitmask & MAT_BIT_FRONT_DIFFUSE) { - foreach (light, list) { - SCALE_3V( light->_MatDiffuse[0], light->Diffuse, - mat[MAT_ATTRIB_FRONT_DIFFUSE] ); - } - } - - if (bitmask & MAT_BIT_BACK_DIFFUSE) { - foreach (light, list) { - SCALE_3V( light->_MatDiffuse[1], light->Diffuse, - mat[MAT_ATTRIB_BACK_DIFFUSE] ); - } - } - - /* update material specular values */ - if (bitmask & MAT_BIT_FRONT_SPECULAR) { - foreach (light, list) { - SCALE_3V( light->_MatSpecular[0], light->Specular, - mat[MAT_ATTRIB_FRONT_SPECULAR]); - } - } - - if (bitmask & MAT_BIT_BACK_SPECULAR) { - foreach (light, list) { - SCALE_3V( light->_MatSpecular[1], light->Specular, - mat[MAT_ATTRIB_BACK_SPECULAR]); - } - } - - if (bitmask & MAT_BIT_FRONT_SHININESS) { - _mesa_invalidate_shine_table( ctx, 0 ); - } - - if (bitmask & MAT_BIT_BACK_SHININESS) { - _mesa_invalidate_shine_table( ctx, 1 ); - } -} - - -/* - * Update the current materials from the given rgba color - * according to the bitmask in ColorMaterialBitmask, which is - * set by glColorMaterial(). - */ -void -_mesa_update_color_material( GLcontext *ctx, const GLfloat color[4] ) -{ - GLuint bitmask = ctx->Light.ColorMaterialBitmask; - struct gl_material *mat = &ctx->Light.Material; - int i; - - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) - if (bitmask & (1<Attrib[i], color ); - - _mesa_update_material( ctx, bitmask ); -} - - -void GLAPIENTRY -_mesa_ColorMaterial( GLenum face, GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint bitmask; - GLuint legal = (MAT_BIT_FRONT_EMISSION | MAT_BIT_BACK_EMISSION | - MAT_BIT_FRONT_SPECULAR | MAT_BIT_BACK_SPECULAR | - MAT_BIT_FRONT_DIFFUSE | MAT_BIT_BACK_DIFFUSE | - MAT_BIT_FRONT_AMBIENT | MAT_BIT_BACK_AMBIENT); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glColorMaterial %s %s\n", - _mesa_lookup_enum_by_nr(face), - _mesa_lookup_enum_by_nr(mode)); - - bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial"); - - if (ctx->Light.ColorMaterialBitmask == bitmask && - ctx->Light.ColorMaterialFace == face && - ctx->Light.ColorMaterialMode == mode) - return; - - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.ColorMaterialBitmask = bitmask; - ctx->Light.ColorMaterialFace = face; - ctx->Light.ColorMaterialMode = mode; - - if (ctx->Light.ColorMaterialEnabled) { - FLUSH_CURRENT( ctx, 0 ); - _mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); - } - - if (ctx->Driver.ColorMaterial) - ctx->Driver.ColorMaterial( ctx, face, mode ); -} - - -void GLAPIENTRY -_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint f; - GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */ - - FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */ - - if (face==GL_FRONT) { - f = 0; - } - else if (face==GL_BACK) { - f = 1; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(face)" ); - return; - } - - switch (pname) { - case GL_AMBIENT: - COPY_4FV( params, mat[MAT_ATTRIB_AMBIENT(f)] ); - break; - case GL_DIFFUSE: - COPY_4FV( params, mat[MAT_ATTRIB_DIFFUSE(f)] ); - break; - case GL_SPECULAR: - COPY_4FV( params, mat[MAT_ATTRIB_SPECULAR(f)] ); - break; - case GL_EMISSION: - COPY_4FV( params, mat[MAT_ATTRIB_EMISSION(f)] ); - break; - case GL_SHININESS: - *params = mat[MAT_ATTRIB_SHININESS(f)][0]; - break; - case GL_COLOR_INDEXES: - params[0] = mat[MAT_ATTRIB_INDEXES(f)][0]; - params[1] = mat[MAT_ATTRIB_INDEXES(f)][1]; - params[2] = mat[MAT_ATTRIB_INDEXES(f)][2]; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" ); - } -} - - -void GLAPIENTRY -_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint f; - GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */ - - FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */ - - if (face==GL_FRONT) { - f = 0; - } - else if (face==GL_BACK) { - f = 1; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialiv(face)" ); - return; - } - switch (pname) { - case GL_AMBIENT: - params[0] = FLOAT_TO_INT( mat[MAT_ATTRIB_AMBIENT(f)][0] ); - params[1] = FLOAT_TO_INT( mat[MAT_ATTRIB_AMBIENT(f)][1] ); - params[2] = FLOAT_TO_INT( mat[MAT_ATTRIB_AMBIENT(f)][2] ); - params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_AMBIENT(f)][3] ); - break; - case GL_DIFFUSE: - params[0] = FLOAT_TO_INT( mat[MAT_ATTRIB_DIFFUSE(f)][0] ); - params[1] = FLOAT_TO_INT( mat[MAT_ATTRIB_DIFFUSE(f)][1] ); - params[2] = FLOAT_TO_INT( mat[MAT_ATTRIB_DIFFUSE(f)][2] ); - params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_DIFFUSE(f)][3] ); - break; - case GL_SPECULAR: - params[0] = FLOAT_TO_INT( mat[MAT_ATTRIB_SPECULAR(f)][0] ); - params[1] = FLOAT_TO_INT( mat[MAT_ATTRIB_SPECULAR(f)][1] ); - params[2] = FLOAT_TO_INT( mat[MAT_ATTRIB_SPECULAR(f)][2] ); - params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_SPECULAR(f)][3] ); - break; - case GL_EMISSION: - params[0] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][0] ); - params[1] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][1] ); - params[2] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][2] ); - params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][3] ); - break; - case GL_SHININESS: - *params = IROUND( mat[MAT_ATTRIB_SHININESS(f)][0] ); - break; - case GL_COLOR_INDEXES: - params[0] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][0] ); - params[1] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][1] ); - params[2] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][2] ); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" ); - } -} - - - -/**********************************************************************/ -/***** Lighting computation *****/ -/**********************************************************************/ - - -/* - * Notes: - * When two-sided lighting is enabled we compute the color (or index) - * for both the front and back side of the primitive. Then, when the - * orientation of the facet is later learned, we can determine which - * color (or index) to use for rendering. - * - * KW: We now know orientation in advance and only shade for - * the side or sides which are actually required. - * - * Variables: - * n = normal vector - * V = vertex position - * P = light source position - * Pe = (0,0,0,1) - * - * Precomputed: - * IF P[3]==0 THEN - * // light at infinity - * IF local_viewer THEN - * _VP_inf_norm = unit vector from V to P // Precompute - * ELSE - * // eye at infinity - * _h_inf_norm = Normalize( VP + <0,0,1> ) // Precompute - * ENDIF - * ENDIF - * - * Functions: - * Normalize( v ) = normalized vector v - * Magnitude( v ) = length of vector v - */ - - - -/* - * Whenever the spotlight exponent for a light changes we must call - * this function to recompute the exponent lookup table. - */ -void -_mesa_invalidate_spot_exp_table( struct gl_light *l ) -{ - l->_SpotExpTable[0][0] = -1; -} - - -static void -validate_spot_exp_table( struct gl_light *l ) -{ - GLint i; - GLdouble exponent = l->SpotExponent; - GLdouble tmp = 0; - GLint clamp = 0; - - l->_SpotExpTable[0][0] = 0.0; - - for (i = EXP_TABLE_SIZE - 1; i > 0 ;i--) { - if (clamp == 0) { - tmp = _mesa_pow(i / (GLdouble) (EXP_TABLE_SIZE - 1), exponent); - if (tmp < FLT_MIN * 100.0) { - tmp = 0.0; - clamp = 1; - } - } - l->_SpotExpTable[i][0] = (GLfloat) tmp; - } - for (i = 0; i < EXP_TABLE_SIZE - 1; i++) { - l->_SpotExpTable[i][1] = (l->_SpotExpTable[i+1][0] - - l->_SpotExpTable[i][0]); - } - l->_SpotExpTable[EXP_TABLE_SIZE-1][1] = 0.0; -} - - - -/* Calculate a new shine table. Doing this here saves a branch in - * lighting, and the cost of doing it early may be partially offset - * by keeping a MRU cache of shine tables for various shine values. - */ -void -_mesa_invalidate_shine_table( GLcontext *ctx, GLuint side ) -{ - ASSERT(side < 2); - if (ctx->_ShineTable[side]) - ctx->_ShineTable[side]->refcount--; - ctx->_ShineTable[side] = NULL; -} - - -static void -validate_shine_table( GLcontext *ctx, GLuint side, GLfloat shininess ) -{ - struct gl_shine_tab *list = ctx->_ShineTabList; - struct gl_shine_tab *s; - - ASSERT(side < 2); - - foreach(s, list) - if ( s->shininess == shininess ) - break; - - if (s == list) { - GLint j; - GLfloat *m; - - foreach(s, list) - if (s->refcount == 0) - break; - - m = s->tab; - m[0] = 0.0; - if (shininess == 0.0) { - for (j = 1 ; j <= SHINE_TABLE_SIZE ; j++) - m[j] = 1.0; - } - else { - for (j = 1 ; j < SHINE_TABLE_SIZE ; j++) { - GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1); - if (x < 0.005) /* underflow check */ - x = 0.005; - t = _mesa_pow(x, shininess); - if (t > 1e-20) - m[j] = (GLfloat) t; - else - m[j] = 0.0; - } - m[SHINE_TABLE_SIZE] = 1.0; - } - - s->shininess = shininess; - } - - if (ctx->_ShineTable[side]) - ctx->_ShineTable[side]->refcount--; - - ctx->_ShineTable[side] = s; - move_to_tail( list, s ); - s->refcount++; -} - - -void -_mesa_validate_all_lighting_tables( GLcontext *ctx ) -{ - GLuint i; - GLfloat shininess; - - shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0]; - if (!ctx->_ShineTable[0] || ctx->_ShineTable[0]->shininess != shininess) - validate_shine_table( ctx, 0, shininess ); - - shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SHININESS][0]; - if (!ctx->_ShineTable[1] || ctx->_ShineTable[1]->shininess != shininess) - validate_shine_table( ctx, 1, shininess ); - - for (i = 0; i < ctx->Const.MaxLights; i++) - if (ctx->Light.Light[i]._SpotExpTable[0][0] == -1) - validate_spot_exp_table( &ctx->Light.Light[i] ); -} - - -/** - * Examine current lighting parameters to determine if the optimized lighting - * function can be used. - * Also, precompute some lighting values such as the products of light - * source and material ambient, diffuse and specular coefficients. - */ -void -_mesa_update_lighting( GLcontext *ctx ) -{ - struct gl_light *light; - ctx->Light._NeedEyeCoords = GL_FALSE; - ctx->Light._Flags = 0; - - if (!ctx->Light.Enabled) - return; - - foreach(light, &ctx->Light.EnabledList) { - ctx->Light._Flags |= light->_Flags; - } - - ctx->Light._NeedVertices = - ((ctx->Light._Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) || - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR || - ctx->Light.Model.LocalViewer); - - ctx->Light._NeedEyeCoords = ((ctx->Light._Flags & LIGHT_POSITIONAL) || - ctx->Light.Model.LocalViewer); - - /* XXX: This test is overkill & needs to be fixed both for software and - * hardware t&l drivers. The above should be sufficient & should - * be tested to verify this. - */ - if (ctx->Light._NeedVertices) - ctx->Light._NeedEyeCoords = GL_TRUE; - - /* Precompute some shading values. Although we reference - * Light.Material here, we can get away without flushing - * FLUSH_UPDATE_CURRENT, as when any outstanding material changes - * are flushed, they will update the derived state at that time. - */ - if (ctx->Visual.rgbMode) { - if (ctx->Light.Model.TwoSide) - _mesa_update_material( ctx, - MAT_BIT_FRONT_EMISSION | - MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | - MAT_BIT_FRONT_SPECULAR | - MAT_BIT_BACK_EMISSION | - MAT_BIT_BACK_AMBIENT | - MAT_BIT_BACK_DIFFUSE | - MAT_BIT_BACK_SPECULAR); - else - _mesa_update_material( ctx, - MAT_BIT_FRONT_EMISSION | - MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | - MAT_BIT_FRONT_SPECULAR); - } - else { - static const GLfloat ci[3] = { .30F, .59F, .11F }; - foreach(light, &ctx->Light.EnabledList) { - light->_dli = DOT3(ci, light->Diffuse); - light->_sli = DOT3(ci, light->Specular); - } - } -} - - -/** - * Update state derived from light position, spot direction. - * Called upon: - * _NEW_MODELVIEW - * _NEW_LIGHT - * _TNL_NEW_NEED_EYE_COORDS - * - * Update on (_NEW_MODELVIEW | _NEW_LIGHT) when lighting is enabled. - * Also update on lighting space changes. - */ -static void -compute_light_positions( GLcontext *ctx ) -{ - struct gl_light *light; - static const GLfloat eye_z[3] = { 0, 0, 1 }; - - if (!ctx->Light.Enabled) - return; - - if (ctx->_NeedEyeCoords) { - COPY_3V( ctx->_EyeZDir, eye_z ); - } - else { - TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelviewMatrixStack.Top->m ); - } - - foreach (light, &ctx->Light.EnabledList) { - - if (ctx->_NeedEyeCoords) { - /* _Position is in eye coordinate space */ - COPY_4FV( light->_Position, light->EyePosition ); - } - else { - /* _Position is in object coordinate space */ - TRANSFORM_POINT( light->_Position, ctx->ModelviewMatrixStack.Top->inv, - light->EyePosition ); - } - - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* VP (VP) = Normalize( Position ) */ - COPY_3V( light->_VP_inf_norm, light->_Position ); - NORMALIZE_3FV( light->_VP_inf_norm ); - - if (!ctx->Light.Model.LocalViewer) { - /* _h_inf_norm = Normalize( V_to_P + <0,0,1> ) */ - ADD_3V( light->_h_inf_norm, light->_VP_inf_norm, ctx->_EyeZDir); - NORMALIZE_3FV( light->_h_inf_norm ); - } - light->_VP_inf_spot_attenuation = 1.0; - } - else { - /* positional light w/ homogeneous coordinate, divide by W */ - GLfloat wInv = (GLfloat)1.0 / light->_Position[3]; - light->_Position[0] *= wInv; - light->_Position[1] *= wInv; - light->_Position[2] *= wInv; - } - - if (light->_Flags & LIGHT_SPOT) { - /* Note: we normalize the spot direction now */ - - if (ctx->_NeedEyeCoords) { - COPY_3V( light->_NormDirection, light->EyeDirection ); - NORMALIZE_3FV( light->_NormDirection ); - } - else { - GLfloat spotDir[3]; - COPY_3V(spotDir, light->EyeDirection); - NORMALIZE_3FV(spotDir); - TRANSFORM_NORMAL( light->_NormDirection, - spotDir, - ctx->ModelviewMatrixStack.Top->m); - } - - NORMALIZE_3FV( light->_NormDirection ); - - if (!(light->_Flags & LIGHT_POSITIONAL)) { - GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm, - light->_NormDirection); - - if (PV_dot_dir > light->_CosCutoff) { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; - light->_VP_inf_spot_attenuation = - (GLfloat) (light->_SpotExpTable[k][0] + - (x-k)*light->_SpotExpTable[k][1]); - } - else { - light->_VP_inf_spot_attenuation = 0; - } - } - } - } -} - - - -static void -update_modelview_scale( GLcontext *ctx ) -{ - ctx->_ModelViewInvScale = 1.0F; - if (!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) { - const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv; - GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10]; - if (f < 1e-12) f = 1.0; - if (ctx->_NeedEyeCoords) - ctx->_ModelViewInvScale = (GLfloat) INV_SQRTF(f); - else - ctx->_ModelViewInvScale = (GLfloat) SQRTF(f); - } -} - - -/** - * Bring up to date any state that relies on _NeedEyeCoords. - */ -void -_mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state ) -{ - const GLuint oldneedeyecoords = ctx->_NeedEyeCoords; - - (void) new_state; - ctx->_NeedEyeCoords = GL_FALSE; - - if (ctx->_ForceEyeCoords || - (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) || - ctx->Point._Attenuated || - ctx->Light._NeedEyeCoords) - ctx->_NeedEyeCoords = GL_TRUE; - - if (ctx->Light.Enabled && - !_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) - ctx->_NeedEyeCoords = GL_TRUE; - - /* Check if the truth-value interpretations of the bitfields have - * changed: - */ - if (oldneedeyecoords != ctx->_NeedEyeCoords) { - /* Recalculate all state that depends on _NeedEyeCoords. - */ - update_modelview_scale(ctx); - compute_light_positions( ctx ); - - if (ctx->Driver.LightingSpaceChange) - ctx->Driver.LightingSpaceChange( ctx ); - } - else { - GLuint new_state = ctx->NewState; - - /* Recalculate that same state only if it has been invalidated - * by other statechanges. - */ - if (new_state & _NEW_MODELVIEW) - update_modelview_scale(ctx); - - if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW)) - compute_light_positions( ctx ); - } -} - - -/** - * Drivers may need this if the hardware tnl unit doesn't support the - * light-in-modelspace optimization. It's also useful for debugging. - */ -void -_mesa_allow_light_in_model( GLcontext *ctx, GLboolean flag ) -{ - ctx->_ForceEyeCoords = !flag; - ctx->NewState |= _NEW_POINT; /* one of the bits from - * _MESA_NEW_NEED_EYE_COORDS. - */ -} - - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -/** - * Initialize the n-th light data structure. - * - * \param l pointer to the gl_light structure to be initialized. - * \param n number of the light. - * \note The defaults for light 0 are different than the other lights. - */ -static void -init_light( struct gl_light *l, GLuint n ) -{ - make_empty_list( l ); - - ASSIGN_4V( l->Ambient, 0.0, 0.0, 0.0, 1.0 ); - if (n==0) { - ASSIGN_4V( l->Diffuse, 1.0, 1.0, 1.0, 1.0 ); - ASSIGN_4V( l->Specular, 1.0, 1.0, 1.0, 1.0 ); - } - else { - ASSIGN_4V( l->Diffuse, 0.0, 0.0, 0.0, 1.0 ); - ASSIGN_4V( l->Specular, 0.0, 0.0, 0.0, 1.0 ); - } - ASSIGN_4V( l->EyePosition, 0.0, 0.0, 1.0, 0.0 ); - ASSIGN_3V( l->EyeDirection, 0.0, 0.0, -1.0 ); - l->SpotExponent = 0.0; - _mesa_invalidate_spot_exp_table( l ); - l->SpotCutoff = 180.0; - l->_CosCutoffNeg = -1.0f; - l->_CosCutoff = 0.0; /* KW: -ve values not admitted */ - l->ConstantAttenuation = 1.0; - l->LinearAttenuation = 0.0; - l->QuadraticAttenuation = 0.0; - l->Enabled = GL_FALSE; -} - - -/** - * Initialize the light model data structure. - * - * \param lm pointer to the gl_lightmodel structure to be initialized. - */ -static void -init_lightmodel( struct gl_lightmodel *lm ) -{ - ASSIGN_4V( lm->Ambient, 0.2F, 0.2F, 0.2F, 1.0F ); - lm->LocalViewer = GL_FALSE; - lm->TwoSide = GL_FALSE; - lm->ColorControl = GL_SINGLE_COLOR; -} - - -/** - * Initialize the material data structure. - * - * \param m pointer to the gl_material structure to be initialized. - */ -static void -init_material( struct gl_material *m ) -{ - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_AMBIENT], 0.2F, 0.2F, 0.2F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_DIFFUSE], 0.8F, 0.8F, 0.8F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_SPECULAR], 0.0F, 0.0F, 0.0F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_EMISSION], 0.0F, 0.0F, 0.0F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_SHININESS], 0.0F, 0.0F, 0.0F, 0.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_INDEXES], 0.0F, 1.0F, 1.0F, 0.0F ); - - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_AMBIENT], 0.2F, 0.2F, 0.2F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_DIFFUSE], 0.8F, 0.8F, 0.8F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_SPECULAR], 0.0F, 0.0F, 0.0F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_EMISSION], 0.0F, 0.0F, 0.0F, 1.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_SHININESS], 0.0F, 0.0F, 0.0F, 0.0F ); - ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_INDEXES], 0.0F, 1.0F, 1.0F, 0.0F ); -} - - -/** - * Initialize all lighting state for the given context. - */ -void -_mesa_init_lighting( GLcontext *ctx ) -{ - GLuint i; - - /* 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 ); - 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 = _mesa_material_bitmask( ctx, - GL_FRONT_AND_BACK, - GL_AMBIENT_AND_DIFFUSE, ~0, - NULL ); - - ctx->Light.ColorMaterialEnabled = GL_FALSE; - ctx->Light.ClampVertexColor = GL_TRUE; - - /* Lighting miscellaneous */ - ctx->_ShineTabList = MALLOC_STRUCT( gl_shine_tab ); - make_empty_list( ctx->_ShineTabList ); - /* Allocate 10 (arbitrary) shininess lookup tables */ - 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 ); - } - - /* Miscellaneous */ - ctx->Light._NeedEyeCoords = GL_FALSE; - ctx->_NeedEyeCoords = GL_FALSE; - ctx->_ModelViewInvScale = 1.0; -} - - -/** - * Deallocate malloc'd lighting state attached to given context. - */ -void -_mesa_free_lighting_data( GLcontext *ctx ) -{ - struct gl_shine_tab *s, *tmps; - - /* Free lighting shininess exponentiation table */ - foreach_s( s, tmps, ctx->_ShineTabList ) { - _mesa_free( s ); - } - _mesa_free( ctx->_ShineTabList ); -} diff --git a/src/libs/mesa/mesa/main/light.h b/src/libs/mesa/mesa/main/light.h deleted file mode 100644 index b97e17b5be..0000000000 --- a/src/libs/mesa/mesa/main/light.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * \file light.h - * Lighting. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 LIGHT_H -#define LIGHT_H - - -#include "mtypes.h" - -extern void GLAPIENTRY -_mesa_ShadeModel( GLenum mode ); - -#if _HAVE_FULL_GL -extern void GLAPIENTRY -_mesa_ColorMaterial( GLenum face, GLenum mode ); - -extern void GLAPIENTRY -_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ); - -extern void GLAPIENTRY -_mesa_Lighti( GLenum light, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_LightModelf( GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_LightModelfv( GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_LightModeli( GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_LightModeliv( GLenum pname, const GLint *params ); - -extern void GLAPIENTRY -_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); - - -extern void -_mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params); - - -/* Lerp between adjacent values in the f(x) lookup table, giving a - * continuous function, with adequeate overall accuracy. (Though - * still pretty good compared to a straight lookup). - * Result should be a GLfloat. - */ -#define GET_SHINE_TAB_ENTRY( table, dp, result ) \ -do { \ - struct gl_shine_tab *_tab = table; \ - float f = (dp * (SHINE_TABLE_SIZE-1)); \ - int k = (int) f; \ - if (k < 0 /* gcc may cast an overflow float value to negative int value*/ \ - || k > SHINE_TABLE_SIZE-2) \ - result = (GLfloat) _mesa_pow( dp, _tab->shininess ); \ - else \ - result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \ -} while (0) - - -extern GLuint _mesa_material_bitmask( GLcontext *ctx, - GLenum face, GLenum pname, - GLuint legal, - const char * ); - -extern void _mesa_invalidate_spot_exp_table( struct gl_light *l ); - -extern void _mesa_invalidate_shine_table( GLcontext *ctx, GLuint i ); - -extern void _mesa_validate_all_lighting_tables( GLcontext *ctx ); - -extern void _mesa_update_lighting( GLcontext *ctx ); - -extern void _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state ); - -extern void _mesa_update_material( GLcontext *ctx, - GLuint bitmask ); - -extern void _mesa_copy_materials( struct gl_material *dst, - const struct gl_material *src, - GLuint bitmask ); - -extern void _mesa_update_color_material( GLcontext *ctx, - const GLfloat rgba[4] ); - -extern void _mesa_init_lighting( GLcontext *ctx ); - -extern void _mesa_free_lighting_data( GLcontext *ctx ); - -extern void _mesa_allow_light_in_model( GLcontext *ctx, GLboolean flag ); - -#else -#define _mesa_update_color_material( c, r ) ((void)0) -#define _mesa_validate_all_lighting_tables( c ) ((void)0) -#define _mesa_invalidate_spot_exp_table( l ) ((void)0) -#define _mesa_material_bitmask( c, f, p, l, s ) 0 -#define _mesa_init_lighting( c ) ((void)0) -#define _mesa_free_lighting_data( c ) ((void)0) -#define _mesa_update_lighting( c ) ((void)0) -#define _mesa_update_tnl_spaces( c, n ) ((void)0) -#define GET_SHINE_TAB_ENTRY( table, dp, result ) ((result)=0) -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/lines.c b/src/libs/mesa/mesa/main/lines.c deleted file mode 100644 index 81d0d33abb..0000000000 --- a/src/libs/mesa/mesa/main/lines.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "depth.h" -#include "lines.h" -#include "macros.h" -#include "texstate.h" -#include "mtypes.h" - - -/** - * Set the line width. - * - * \param width line width in pixels. - * - * \sa glLineWidth(). - */ -void GLAPIENTRY -_mesa_LineWidth( GLfloat width ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (width<=0.0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" ); - return; - } - - if (ctx->Line.Width == width) - return; - - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.Width = width; - - if (width != 1.0F) - ctx->_TriangleCaps |= DD_LINE_WIDTH; - else - ctx->_TriangleCaps &= ~DD_LINE_WIDTH; - - if (ctx->Driver.LineWidth) - ctx->Driver.LineWidth(ctx, width); -} - - -/** - * Set the line stipple pattern. - * - * \param factor pattern scale factor. - * \param pattern bit pattern. - * - * \sa glLineStipple(). - * - * Updates gl_line_attrib::StippleFactor and gl_line_attrib::StipplePattern. On - * change flushes the vertices and notifies the driver via - * the dd_function_table::LineStipple callback. - */ -void GLAPIENTRY -_mesa_LineStipple( GLint factor, GLushort pattern ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - factor = CLAMP( factor, 1, 256 ); - - if (ctx->Line.StippleFactor == factor && - ctx->Line.StipplePattern == pattern) - return; - - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.StippleFactor = factor; - ctx->Line.StipplePattern = pattern; - - if (ctx->Driver.LineStipple) - ctx->Driver.LineStipple( ctx, factor, pattern ); -} - - -/** - * Initialize the context line state. - * - * \param ctx GL context. - * - * Initializes __GLcontextRec::Line and line related constants in - * __GLcontextRec::Const. - */ -void GLAPIENTRY -_mesa_init_line( GLcontext * ctx ) -{ - ctx->Line.SmoothFlag = GL_FALSE; - ctx->Line.StippleFlag = GL_FALSE; - ctx->Line.Width = 1.0; - ctx->Line.StipplePattern = 0xffff; - ctx->Line.StippleFactor = 1; -} diff --git a/src/libs/mesa/mesa/main/lines.h b/src/libs/mesa/mesa/main/lines.h deleted file mode 100644 index 5a47e9858d..0000000000 --- a/src/libs/mesa/mesa/main/lines.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * \file lines.h - * Line operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 LINES_H -#define LINES_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_LineWidth( GLfloat width ); - -extern void GLAPIENTRY -_mesa_LineStipple( GLint factor, GLushort pattern ); - -extern void GLAPIENTRY -_mesa_init_line( GLcontext * ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/macros.h b/src/libs/mesa/mesa/main/macros.h deleted file mode 100644 index 2630855a0e..0000000000 --- a/src/libs/mesa/mesa/main/macros.h +++ /dev/null @@ -1,667 +0,0 @@ -/** - * \file macros.h - * A collection of useful macros. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 MACROS_H -#define MACROS_H - -#include "imports.h" - - -/** - * \name Integer / float conversion for colors, normals, etc. - */ -/*@{*/ - -/** Convert GLubyte in [0,255] to GLfloat in [0.0,1.0] */ -extern GLfloat _mesa_ubyte_to_float_color_tab[256]; -#define UBYTE_TO_FLOAT(u) _mesa_ubyte_to_float_color_tab[(unsigned int)(u)] - -/** Convert GLfloat in [0.0,1.0] to GLubyte in [0,255] */ -#define FLOAT_TO_UBYTE(X) ((GLubyte) (GLint) ((X) * 255.0F)) - - -/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */ -#define BYTE_TO_FLOAT(B) ((2.0F * (B) + 1.0F) * (1.0F/255.0F)) - -/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127] */ -#define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 ) - - -/** Convert GLushort in [0,65536] to GLfloat in [0.0,1.0] */ -#define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F)) - -/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0] */ -#define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F)) - -/** Convert GLfloat in [0.0,1.0] to GLshort in [-32768,32767] */ -#define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 ) - - -/** Convert GLuint in [0,4294967295] to GLfloat in [0.0,1.0] */ -#define UINT_TO_FLOAT(U) ((GLfloat) (U) * (1.0F / 4294967295.0F)) - -/** Convert GLfloat in [0.0,1.0] to GLuint in [0,4294967295] */ -#define FLOAT_TO_UINT(X) ((GLuint) ((X) * 4294967295.0)) - - -/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0] */ -#define INT_TO_FLOAT(I) ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0F)) - -/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647] */ -/* causes overflow: -#define FLOAT_TO_INT(X) ( (((GLint) (4294967294.0F * (X))) - 1) / 2 ) -*/ -/* a close approximation: */ -#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) ) - - -#define BYTE_TO_UBYTE(b) ((GLubyte) ((b) < 0 ? 0 : (GLubyte) (b))) -#define SHORT_TO_UBYTE(s) ((GLubyte) ((s) < 0 ? 0 : (GLubyte) ((s) >> 7))) -#define USHORT_TO_UBYTE(s) ((GLubyte) ((s) >> 8)) -#define INT_TO_UBYTE(i) ((GLubyte) ((i) < 0 ? 0 : (GLubyte) ((i) >> 23))) -#define UINT_TO_UBYTE(i) ((GLubyte) ((i) >> 24)) - - -#define BYTE_TO_USHORT(b) ((b) < 0 ? 0 : ((GLushort) (((b) * 65535) / 255))) -#define UBYTE_TO_USHORT(b) (((GLushort) (b) << 8) | (GLushort) (b)) -#define SHORT_TO_USHORT(s) ((s) < 0 ? 0 : ((GLushort) (((s) * 65535 / 32767)))) -#define INT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 15))) -#define UINT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 16))) -#define UNCLAMPED_FLOAT_TO_USHORT(us, f) \ - us = ( (GLushort) IROUND( CLAMP((f), 0.0, 1.0) * 65535.0F) ) -#define CLAMPED_FLOAT_TO_USHORT(us, f) \ - us = ( (GLushort) IROUND( (f) * 65535.0F) ) - -/*@}*/ - - -/** Stepping a GLfloat pointer by a byte stride */ -#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i)) -/** Stepping a GLuint pointer by a byte stride */ -#define STRIDE_UI(p, i) (p = (GLuint *)((GLubyte *)p + i)) -/** Stepping a GLubyte[4] pointer by a byte stride */ -#define STRIDE_4UB(p, i) (p = (GLubyte (*)[4])((GLubyte *)p + i)) -/** Stepping a GLfloat[4] pointer by a byte stride */ -#define STRIDE_4F(p, i) (p = (GLfloat (*)[4])((GLubyte *)p + i)) -/** Stepping a GLchan[4] pointer by a byte stride */ -#define STRIDE_4CHAN(p, i) (p = (GLchan (*)[4])((GLubyte *)p + i)) -/** Stepping a GLchan pointer by a byte stride */ -#define STRIDE_CHAN(p, i) (p = (GLchan *)((GLubyte *)p + i)) -/** Stepping a \p t pointer by a byte stride */ -#define STRIDE_T(p, t, i) (p = (t)((GLubyte *)p + i)) - - -/**********************************************************************/ -/** \name 4-element vector operations */ -/*@{*/ - -/** Zero */ -#define ZERO_4V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = (DST)[3] = 0 - -/** Test for equality */ -#define TEST_EQ_4V(a,b) ((a)[0] == (b)[0] && \ - (a)[1] == (b)[1] && \ - (a)[2] == (b)[2] && \ - (a)[3] == (b)[3]) - -/** Test for equality (unsigned bytes) */ -#if defined(__i386__) -#define TEST_EQ_4UBV(DST, SRC) *((GLuint*)(DST)) == *((GLuint*)(SRC)) -#else -#define TEST_EQ_4UBV(DST, SRC) TEST_EQ_4V(DST, SRC) -#endif - -/** Copy a 4-element vector */ -#define COPY_4V( DST, SRC ) \ -do { \ - (DST)[0] = (SRC)[0]; \ - (DST)[1] = (SRC)[1]; \ - (DST)[2] = (SRC)[2]; \ - (DST)[3] = (SRC)[3]; \ -} while (0) - -/** Copy a 4-element vector with cast */ -#define COPY_4V_CAST( DST, SRC, CAST ) \ -do { \ - (DST)[0] = (CAST)(SRC)[0]; \ - (DST)[1] = (CAST)(SRC)[1]; \ - (DST)[2] = (CAST)(SRC)[2]; \ - (DST)[3] = (CAST)(SRC)[3]; \ -} while (0) - -/** Copy a 4-element unsigned byte vector */ -#if defined(__i386__) -#define COPY_4UBV(DST, SRC) \ -do { \ - *((GLuint*)(DST)) = *((GLuint*)(SRC)); \ -} while (0) -#else -/* The GLuint cast might fail if DST or SRC are not dword-aligned (RISC) */ -#define COPY_4UBV(DST, SRC) \ -do { \ - (DST)[0] = (SRC)[0]; \ - (DST)[1] = (SRC)[1]; \ - (DST)[2] = (SRC)[2]; \ - (DST)[3] = (SRC)[3]; \ -} while (0) -#endif - -/** - * Copy a 4-element float vector (avoid using FPU registers) - * XXX Could use two 64-bit moves on 64-bit systems - */ -#define COPY_4FV( DST, SRC ) \ -do { \ - const GLuint *_s = (const GLuint *) (SRC); \ - GLuint *_d = (GLuint *) (DST); \ - _d[0] = _s[0]; \ - _d[1] = _s[1]; \ - _d[2] = _s[2]; \ - _d[3] = _s[3]; \ -} while (0) - -/** Copy \p SZ elements into a 4-element vector */ -#define COPY_SZ_4V(DST, SZ, SRC) \ -do { \ - switch (SZ) { \ - case 4: (DST)[3] = (SRC)[3]; \ - case 3: (DST)[2] = (SRC)[2]; \ - case 2: (DST)[1] = (SRC)[1]; \ - case 1: (DST)[0] = (SRC)[0]; \ - } \ -} while(0) - -/** Copy \p SZ elements into a homegeneous (4-element) vector, giving - * default values to the remaining */ -#define COPY_CLEAN_4V(DST, SZ, SRC) \ -do { \ - ASSIGN_4V( DST, 0, 0, 0, 1 ); \ - COPY_SZ_4V( DST, SZ, SRC ); \ -} while (0) - -/** Subtraction */ -#define SUB_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]; \ -} while (0) - -/** Addition */ -#define ADD_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]; \ -} while (0) - -/** Element-wise multiplication */ -#define 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]; \ -} while (0) - -/** In-place addition */ -#define ACC_4V( DST, SRC ) \ -do { \ - (DST)[0] += (SRC)[0]; \ - (DST)[1] += (SRC)[1]; \ - (DST)[2] += (SRC)[2]; \ - (DST)[3] += (SRC)[3]; \ -} while (0) - -/** Element-wise multiplication and addition */ -#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]; \ -} while (0) - -/** In-place scalar multiplication and addition */ -#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]; \ -} while (0) - -/** Scalar multiplication */ -#define 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]; \ -} while (0) - -/** In-place scalar multiplication */ -#define SELF_SCALE_SCALAR_4V( DST, S ) \ -do { \ - (DST)[0] *= S; \ - (DST)[1] *= S; \ - (DST)[2] *= S; \ - (DST)[3] *= S; \ -} while (0) - -/** Assignment */ -#define ASSIGN_4V( V, V0, V1, V2, V3 ) \ -do { \ - V[0] = V0; \ - V[1] = V1; \ - V[2] = V2; \ - V[3] = V3; \ -} while(0) - -/*@}*/ - - -/**********************************************************************/ -/** \name 3-element vector operations*/ -/*@{*/ - -/** Zero */ -#define ZERO_3V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = 0 - -/** Test for equality */ -#define TEST_EQ_3V(a,b) \ - ((a)[0] == (b)[0] && \ - (a)[1] == (b)[1] && \ - (a)[2] == (b)[2]) - -/** Copy a 3-element vector */ -#define COPY_3V( DST, SRC ) \ -do { \ - (DST)[0] = (SRC)[0]; \ - (DST)[1] = (SRC)[1]; \ - (DST)[2] = (SRC)[2]; \ -} while (0) - -/** Copy a 3-element vector with cast */ -#define COPY_3V_CAST( DST, SRC, CAST ) \ -do { \ - (DST)[0] = (CAST)(SRC)[0]; \ - (DST)[1] = (CAST)(SRC)[1]; \ - (DST)[2] = (CAST)(SRC)[2]; \ -} while (0) - -/** Copy a 3-element float vector */ -#define COPY_3FV( DST, SRC ) \ -do { \ - const GLfloat *_tmp = (SRC); \ - (DST)[0] = _tmp[0]; \ - (DST)[1] = _tmp[1]; \ - (DST)[2] = _tmp[2]; \ -} while (0) - -/** Subtraction */ -#define SUB_3V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] - (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] - (SRCB)[1]; \ - (DST)[2] = (SRCA)[2] - (SRCB)[2]; \ -} while (0) - -/** Addition */ -#define ADD_3V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] + (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] + (SRCB)[1]; \ - (DST)[2] = (SRCA)[2] + (SRCB)[2]; \ -} while (0) - -/** In-place scalar multiplication */ -#define SCALE_3V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] * (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] * (SRCB)[1]; \ - (DST)[2] = (SRCA)[2] * (SRCB)[2]; \ -} while (0) - -/** In-place element-wise multiplication */ -#define SELF_SCALE_3V( DST, SRC ) \ -do { \ - (DST)[0] *= (SRC)[0]; \ - (DST)[1] *= (SRC)[1]; \ - (DST)[2] *= (SRC)[2]; \ -} while (0) - -/** In-place addition */ -#define ACC_3V( DST, SRC ) \ -do { \ - (DST)[0] += (SRC)[0]; \ - (DST)[1] += (SRC)[1]; \ - (DST)[2] += (SRC)[2]; \ -} while (0) - -/** Element-wise multiplication and addition */ -#define ACC_SCALE_3V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ - (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ - (DST)[2] += (SRCA)[2] * (SRCB)[2]; \ -} while (0) - -/** Scalar multiplication */ -#define SCALE_SCALAR_3V( DST, S, SRCB ) \ -do { \ - (DST)[0] = S * (SRCB)[0]; \ - (DST)[1] = S * (SRCB)[1]; \ - (DST)[2] = S * (SRCB)[2]; \ -} while (0) - -/** In-place scalar multiplication and addition */ -#define ACC_SCALE_SCALAR_3V( DST, S, SRCB ) \ -do { \ - (DST)[0] += S * (SRCB)[0]; \ - (DST)[1] += S * (SRCB)[1]; \ - (DST)[2] += S * (SRCB)[2]; \ -} while (0) - -/** In-place scalar multiplication */ -#define SELF_SCALE_SCALAR_3V( DST, S ) \ -do { \ - (DST)[0] *= S; \ - (DST)[1] *= S; \ - (DST)[2] *= S; \ -} while (0) - -/** In-place scalar addition */ -#define ACC_SCALAR_3V( DST, S ) \ -do { \ - (DST)[0] += S; \ - (DST)[1] += S; \ - (DST)[2] += S; \ -} while (0) - -/** Assignment */ -#define ASSIGN_3V( V, V0, V1, V2 ) \ -do { \ - V[0] = V0; \ - V[1] = V1; \ - V[2] = V2; \ -} while(0) - -/*@}*/ - - -/**********************************************************************/ -/** \name 2-element vector operations*/ -/*@{*/ - -/** Zero */ -#define ZERO_2V( DST ) (DST)[0] = (DST)[1] = 0 - -/** Copy a 2-element vector */ -#define COPY_2V( DST, SRC ) \ -do { \ - (DST)[0] = (SRC)[0]; \ - (DST)[1] = (SRC)[1]; \ -} while (0) - -/** Copy a 2-element vector with cast */ -#define COPY_2V_CAST( DST, SRC, CAST ) \ -do { \ - (DST)[0] = (CAST)(SRC)[0]; \ - (DST)[1] = (CAST)(SRC)[1]; \ -} while (0) - -/** Copy a 2-element float vector */ -#define COPY_2FV( DST, SRC ) \ -do { \ - const GLfloat *_tmp = (SRC); \ - (DST)[0] = _tmp[0]; \ - (DST)[1] = _tmp[1]; \ -} while (0) - -/** Subtraction */ -#define SUB_2V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] - (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] - (SRCB)[1]; \ -} while (0) - -/** Addition */ -#define ADD_2V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] + (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] + (SRCB)[1]; \ -} while (0) - -/** In-place scalar multiplication */ -#define SCALE_2V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] = (SRCA)[0] * (SRCB)[0]; \ - (DST)[1] = (SRCA)[1] * (SRCB)[1]; \ -} while (0) - -/** In-place addition */ -#define ACC_2V( DST, SRC ) \ -do { \ - (DST)[0] += (SRC)[0]; \ - (DST)[1] += (SRC)[1]; \ -} while (0) - -/** Element-wise multiplication and addition */ -#define ACC_SCALE_2V( DST, SRCA, SRCB ) \ -do { \ - (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ - (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ -} while (0) - -/** Scalar multiplication */ -#define SCALE_SCALAR_2V( DST, S, SRCB ) \ -do { \ - (DST)[0] = S * (SRCB)[0]; \ - (DST)[1] = S * (SRCB)[1]; \ -} while (0) - -/** In-place scalar multiplication and addition */ -#define ACC_SCALE_SCALAR_2V( DST, S, SRCB ) \ -do { \ - (DST)[0] += S * (SRCB)[0]; \ - (DST)[1] += S * (SRCB)[1]; \ -} while (0) - -/** In-place scalar multiplication */ -#define SELF_SCALE_SCALAR_2V( DST, S ) \ -do { \ - (DST)[0] *= S; \ - (DST)[1] *= S; \ -} while (0) - -/** In-place scalar addition */ -#define ACC_SCALAR_2V( DST, S ) \ -do { \ - (DST)[0] += S; \ - (DST)[1] += S; \ -} while (0) - -/** Assign scalers to short vectors */ -#define ASSIGN_2V( V, V0, V1 ) \ -do { \ - V[0] = V0; \ - V[1] = V1; \ -} while(0) - -/*@}*/ - - -/** \name Linear interpolation macros */ -/*@{*/ - -/** - * Linear interpolation - * - * \note \p OUT argument is evaluated twice! - * \note Be wary of using *coord++ as an argument to any of these macros! - */ -#define LINTERP(T, OUT, IN) ((OUT) + (T) * ((IN) - (OUT))) - -/* Can do better with integer math - */ -#define INTERP_UB( t, dstub, outub, inub ) \ -do { \ - GLfloat inf = UBYTE_TO_FLOAT( inub ); \ - GLfloat outf = UBYTE_TO_FLOAT( outub ); \ - GLfloat dstf = LINTERP( t, outf, inf ); \ - UNCLAMPED_FLOAT_TO_UBYTE( dstub, dstf ); \ -} while (0) - -#define INTERP_CHAN( t, dstc, outc, inc ) \ -do { \ - GLfloat inf = CHAN_TO_FLOAT( inc ); \ - GLfloat outf = CHAN_TO_FLOAT( outc ); \ - GLfloat dstf = LINTERP( t, outf, inf ); \ - UNCLAMPED_FLOAT_TO_CHAN( dstc, dstf ); \ -} while (0) - -#define INTERP_UI( t, dstui, outui, inui ) \ - dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) ) - -#define INTERP_F( t, dstf, outf, inf ) \ - dstf = LINTERP( t, outf, inf ) - -#define INTERP_4F( t, dst, out, in ) \ -do { \ - dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \ - dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \ - dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \ - dst[3] = LINTERP( (t), (out)[3], (in)[3] ); \ -} while (0) - -#define INTERP_3F( t, dst, out, in ) \ -do { \ - dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \ - dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \ - dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \ -} while (0) - -#define INTERP_4CHAN( t, dst, out, in ) \ -do { \ - INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \ - INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \ - INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \ - INTERP_CHAN( (t), (dst)[3], (out)[3], (in)[3] ); \ -} while (0) - -#define INTERP_3CHAN( t, dst, out, in ) \ -do { \ - INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \ - INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \ - INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \ -} while (0) - -#define INTERP_SZ( t, vec, to, out, in, sz ) \ -do { \ - switch (sz) { \ - case 4: vec[to][3] = LINTERP( (t), (vec)[out][3], (vec)[in][3] ); \ - case 3: vec[to][2] = LINTERP( (t), (vec)[out][2], (vec)[in][2] ); \ - case 2: vec[to][1] = LINTERP( (t), (vec)[out][1], (vec)[in][1] ); \ - case 1: vec[to][0] = LINTERP( (t), (vec)[out][0], (vec)[in][0] ); \ - } \ -} while(0) - -/*@}*/ - - - -/** Clamp X to [MIN,MAX] */ -#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) ) - -/** Assign X to CLAMP(X, MIN, MAX) */ -#define CLAMP_SELF(x, mn, mx) \ - ( (x)<(mn) ? ((x) = (mn)) : ((x)>(mx) ? ((x)=(mx)) : (x)) ) - - - -/** Minimum of two values: */ -#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) ) - -/** Maximum of two values: */ -#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) - -/** Dot product of two 2-element vectors */ -#define DOT2( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] ) - -/** Dot product of two 3-element vectors */ -#define DOT3( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] ) - -/** Dot product of two 4-element vectors */ -#define DOT4( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + \ - (a)[2]*(b)[2] + (a)[3]*(b)[3] ) - -/** Dot product of two 4-element vectors */ -#define DOT4V(v,a,b,c,d) (v[0]*(a) + v[1]*(b) + v[2]*(c) + v[3]*(d)) - - -/** Cross product of two 3-element vectors */ -#define CROSS3(n, u, v) \ -do { \ - (n)[0] = (u)[1]*(v)[2] - (u)[2]*(v)[1]; \ - (n)[1] = (u)[2]*(v)[0] - (u)[0]*(v)[2]; \ - (n)[2] = (u)[0]*(v)[1] - (u)[1]*(v)[0]; \ -} while (0) - - -/* Normalize a 3-element vector to unit length. */ -#define NORMALIZE_3FV( V ) \ -do { \ - GLfloat len = (GLfloat) LEN_SQUARED_3FV(V); \ - if (len) { \ - len = INV_SQRTF(len); \ - (V)[0] = (GLfloat) ((V)[0] * len); \ - (V)[1] = (GLfloat) ((V)[1] * len); \ - (V)[2] = (GLfloat) ((V)[2] * len); \ - } \ -} while(0) - -#define LEN_3FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2])) -#define LEN_2FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1])) - -#define LEN_SQUARED_3FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2]) -#define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]) - - -/** casts to silence warnings with some compilers */ -#define ENUM_TO_INT(E) ((GLint)(E)) -#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E)) -#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E)) -#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE) - - -#endif diff --git a/src/libs/mesa/mesa/main/matrix.c b/src/libs/mesa/mesa/main/matrix.c deleted file mode 100644 index 7cfa2dd124..0000000000 --- a/src/libs/mesa/mesa/main/matrix.c +++ /dev/null @@ -1,933 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file matrix.c - * Matrix operations. - * - * \note - * -# 4x4 transformation matrices are stored in memory in column major order. - * -# Points/vertices are to be thought of as column vectors. - * -# Transformation of a point p by a matrix M is: p' = M * p - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "matrix.h" -#include "mtypes.h" -#include "math/m_matrix.h" -#include "math/m_xform.h" - - -/** - * Apply a perspective projection matrix. - * - * \param left left clipping plane coordinate. - * \param right right clipping plane coordinate. - * \param bottom bottom clipping plane coordinate. - * \param top top clipping plane coordinate. - * \param nearval distance to the near clipping plane. - * \param farval distance to the far clipping plane. - * - * \sa glFrustum(). - * - * Flushes vertices and validates parameters. Calls _math_matrix_frustum() with - * the top matrix of the current matrix stack and sets - * __GLcontextRec::NewState. - */ -void GLAPIENTRY -_mesa_Frustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (nearval <= 0.0 || - farval <= 0.0 || - nearval == farval || - left == right || - top == bottom) - { - _mesa_error( ctx, GL_INVALID_VALUE, "glFrustum" ); - return; - } - - _math_matrix_frustum( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, - (GLfloat) nearval, (GLfloat) farval ); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Apply an orthographic projection matrix. - * - * \param left left clipping plane coordinate. - * \param right right clipping plane coordinate. - * \param bottom bottom clipping plane coordinate. - * \param top top clipping plane coordinate. - * \param nearval distance to the near clipping plane. - * \param farval distance to the far clipping plane. - * - * \sa glOrtho(). - * - * Flushes vertices and validates parameters. Calls _math_matrix_ortho() with - * the top matrix of the current matrix stack and sets - * __GLcontextRec::NewState. - */ -void GLAPIENTRY -_mesa_Ortho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n", - left, right, bottom, top, nearval, farval); - - if (left == right || - bottom == top || - nearval == farval) - { - _mesa_error( ctx, GL_INVALID_VALUE, "glOrtho" ); - return; - } - - _math_matrix_ortho( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, - (GLfloat) nearval, (GLfloat) farval ); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Set the current matrix stack. - * - * \param mode matrix stack. - * - * \sa glMatrixMode(). - * - * Flushes the vertices, validates the parameter and updates - * __GLcontextRec::CurrentStack and gl_transform_attrib::MatrixMode with the - * specified matrix stack. - */ -void GLAPIENTRY -_mesa_MatrixMode( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Transform.MatrixMode == mode && mode != GL_TEXTURE) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - - switch (mode) { - case GL_MODELVIEW: - ctx->CurrentStack = &ctx->ModelviewMatrixStack; - break; - case GL_PROJECTION: - ctx->CurrentStack = &ctx->ProjectionMatrixStack; - break; - case GL_TEXTURE: - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMatrixMode(texcoord unit)"); - return; - } - ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; - break; - case GL_COLOR: - ctx->CurrentStack = &ctx->ColorMatrixStack; - break; - case GL_MATRIX0_NV: - case GL_MATRIX1_NV: - case GL_MATRIX2_NV: - case GL_MATRIX3_NV: - case GL_MATRIX4_NV: - case GL_MATRIX5_NV: - case GL_MATRIX6_NV: - case GL_MATRIX7_NV: - if (ctx->Extensions.NV_vertex_program) { - ctx->CurrentStack = &ctx->ProgramMatrixStack[mode - GL_MATRIX0_NV]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" ); - return; - } - break; - case GL_MATRIX0_ARB: - case GL_MATRIX1_ARB: - case GL_MATRIX2_ARB: - case GL_MATRIX3_ARB: - case GL_MATRIX4_ARB: - case GL_MATRIX5_ARB: - case GL_MATRIX6_ARB: - case GL_MATRIX7_ARB: - if (ctx->Extensions.ARB_vertex_program || - ctx->Extensions.ARB_fragment_program) { - const GLuint m = mode - GL_MATRIX0_ARB; - if (m > ctx->Const.MaxProgramMatrices) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glMatrixMode(GL_MATRIX%d_ARB)", m); - return; - } - ctx->CurrentStack = &ctx->ProgramMatrixStack[m]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" ); - return; - } - - ctx->Transform.MatrixMode = mode; -} - - -/** - * Push the current matrix stack. - * - * \sa glPushMatrix(). - * - * Verifies the current matrix stack is not full, and duplicates the top-most - * matrix in the stack. Marks __GLcontextRec::NewState with the stack dirty - * flag. - */ -void GLAPIENTRY -_mesa_PushMatrix( void ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_matrix_stack *stack = ctx->CurrentStack; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glPushMatrix %s\n", - _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); - - if (stack->Depth + 1 >= stack->MaxDepth) { - if (ctx->Transform.MatrixMode == GL_TEXTURE) { - _mesa_error(ctx, GL_STACK_OVERFLOW, - "glPushMatrix(mode=GL_TEXTURE, unit=%d)", - ctx->Texture.CurrentUnit); - } - else { - _mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)", - _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); - } - return; - } - _math_matrix_copy( &stack->Stack[stack->Depth + 1], - &stack->Stack[stack->Depth] ); - stack->Depth++; - stack->Top = &(stack->Stack[stack->Depth]); - ctx->NewState |= stack->DirtyFlag; -} - - -/** - * Pop the current matrix stack. - * - * \sa glPopMatrix(). - * - * Flushes the vertices, verifies the current matrix stack is not empty, and - * moves the stack head down. Marks __GLcontextRec::NewState with the dirty - * stack flag. - */ -void GLAPIENTRY -_mesa_PopMatrix( void ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_matrix_stack *stack = ctx->CurrentStack; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glPopMatrix %s\n", - _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); - - if (stack->Depth == 0) { - if (ctx->Transform.MatrixMode == GL_TEXTURE) { - _mesa_error(ctx, GL_STACK_UNDERFLOW, - "glPopMatrix(mode=GL_TEXTURE, unit=%d)", - ctx->Texture.CurrentUnit); - } - else { - _mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)", - _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); - } - return; - } - stack->Depth--; - stack->Top = &(stack->Stack[stack->Depth]); - ctx->NewState |= stack->DirtyFlag; -} - - -/** - * Replace the current matrix with the identity matrix. - * - * \sa glLoadIdentity(). - * - * Flushes the vertices and calls _math_matrix_set_identity() with the top-most - * matrix in the current stack. Marks __GLcontextRec::NewState with the stack - * dirty flag. - */ -void GLAPIENTRY -_mesa_LoadIdentity( void ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glLoadIdentity()"); - - _math_matrix_set_identity( ctx->CurrentStack->Top ); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Replace the current matrix with a given matrix. - * - * \param m matrix. - * - * \sa glLoadMatrixf(). - * - * Flushes the vertices and calls _math_matrix_loadf() with the top-most matrix - * in the current stack and the given matrix. Marks __GLcontextRec::NewState - * with the dirty stack flag. - */ -void GLAPIENTRY -_mesa_LoadMatrixf( const GLfloat *m ) -{ - GET_CURRENT_CONTEXT(ctx); - if (!m) return; - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, - "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n", - m[0], m[4], m[8], m[12], - m[1], m[5], m[9], m[13], - m[2], m[6], m[10], m[14], - m[3], m[7], m[11], m[15]); - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _math_matrix_loadf( ctx->CurrentStack->Top, m ); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Multiply the current matrix with a given matrix. - * - * \param m matrix. - * - * \sa glMultMatrixf(). - * - * Flushes the vertices and calls _math_matrix_mul_floats() with the top-most - * matrix in the current stack and the given matrix. Marks - * __GLcontextRec::NewState with the dirty stack flag. - */ -void GLAPIENTRY -_mesa_MultMatrixf( const GLfloat *m ) -{ - GET_CURRENT_CONTEXT(ctx); - if (!m) return; - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, - "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n", - m[0], m[4], m[8], m[12], - m[1], m[5], m[9], m[13], - m[2], m[6], m[10], m[14], - m[3], m[7], m[11], m[15]); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _math_matrix_mul_floats( ctx->CurrentStack->Top, m ); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Multiply the current matrix with a rotation matrix. - * - * \param angle angle of rotation, in degrees. - * \param x rotation vector x coordinate. - * \param y rotation vector y coordinate. - * \param z rotation vector z coordinate. - * - * \sa glRotatef(). - * - * Flushes the vertices and calls _math_matrix_rotate() with the top-most - * matrix in the current stack and the given parameters. Marks - * __GLcontextRec::NewState with the dirty stack flag. - */ -void GLAPIENTRY -_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (angle != 0.0F) { - _math_matrix_rotate( ctx->CurrentStack->Top, angle, x, y, z); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; - } -} - - -/** - * Multiply the current matrix with a general scaling matrix. - * - * \param x x axis scale factor. - * \param y y axis scale factor. - * \param z z axis scale factor. - * - * \sa glScalef(). - * - * Flushes the vertices and calls _math_matrix_scale() with the top-most - * matrix in the current stack and the given parameters. Marks - * __GLcontextRec::NewState with the dirty stack flag. - */ -void GLAPIENTRY -_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _math_matrix_scale( ctx->CurrentStack->Top, x, y, z); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -/** - * Multiply the current matrix with a translation matrix. - * - * \param x translation vector x coordinate. - * \param y translation vector y coordinate. - * \param z translation vector z coordinate. - * - * \sa glTranslatef(). - * - * Flushes the vertices and calls _math_matrix_translate() with the top-most - * matrix in the current stack and the given parameters. Marks - * __GLcontextRec::NewState with the dirty stack flag. - */ -void GLAPIENTRY -_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _math_matrix_translate( ctx->CurrentStack->Top, x, y, z); - ctx->NewState |= ctx->CurrentStack->DirtyFlag; -} - - -#if _HAVE_FULL_GL -void GLAPIENTRY -_mesa_LoadMatrixd( const GLdouble *m ) -{ - GLint i; - GLfloat f[16]; - if (!m) return; - for (i = 0; i < 16; i++) - f[i] = (GLfloat) m[i]; - _mesa_LoadMatrixf(f); -} - -void GLAPIENTRY -_mesa_MultMatrixd( const GLdouble *m ) -{ - GLint i; - GLfloat f[16]; - if (!m) return; - for (i = 0; i < 16; i++) - f[i] = (GLfloat) m[i]; - _mesa_MultMatrixf( f ); -} - - -void GLAPIENTRY -_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) -{ - _mesa_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z); -} - - -void GLAPIENTRY -_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) -{ - _mesa_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z); -} - - -void GLAPIENTRY -_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) -{ - _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z); -} -#endif - - -#if _HAVE_FULL_GL -void GLAPIENTRY -_mesa_LoadTransposeMatrixfARB( const GLfloat *m ) -{ - GLfloat tm[16]; - if (!m) return; - _math_transposef(tm, m); - _mesa_LoadMatrixf(tm); -} - - -void GLAPIENTRY -_mesa_LoadTransposeMatrixdARB( const GLdouble *m ) -{ - GLfloat tm[16]; - if (!m) return; - _math_transposefd(tm, m); - _mesa_LoadMatrixf(tm); -} - - -void GLAPIENTRY -_mesa_MultTransposeMatrixfARB( const GLfloat *m ) -{ - GLfloat tm[16]; - if (!m) return; - _math_transposef(tm, m); - _mesa_MultMatrixf(tm); -} - - -void GLAPIENTRY -_mesa_MultTransposeMatrixdARB( const GLdouble *m ) -{ - GLfloat tm[16]; - if (!m) return; - _math_transposefd(tm, m); - _mesa_MultMatrixf(tm); -} -#endif - -/** - * Set the viewport. - * - * \param x, y coordinates of the lower-left corner of the viewport rectangle. - * \param width width of the viewport rectangle. - * \param height height of the viewport rectangle. - * - * \sa Called via glViewport() or display list execution. - * - * Flushes the vertices and calls _mesa_set_viewport() with the given - * parameters. - */ -void GLAPIENTRY -_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_set_viewport(ctx, x, y, width, height); -} - - -/** - * Set new viewport parameters and update derived state (the _WindowMap - * matrix). Usually called from _mesa_Viewport(). - * - * \param ctx GL context. - * \param x, y coordinates of the lower left corner of the viewport rectangle. - * \param width width of the viewport rectangle. - * \param height height of the viewport rectangle. - */ -void -_mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glViewport(%d, %d, %d, %d)", x, y, width, height ); - return; - } - - /* clamp width and height to the implementation dependent range */ - width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth); - height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight); - - ctx->Viewport.X = x; - ctx->Viewport.Width = width; - ctx->Viewport.Y = y; - ctx->Viewport.Height = height; - ctx->NewState |= _NEW_VIEWPORT; - -#if 1 - /* XXX remove this someday. Currently the DRI drivers rely on - * the WindowMap matrix being up to date in the driver's Viewport - * and DepthRange functions. - */ - _math_matrix_viewport(&ctx->Viewport._WindowMap, - ctx->Viewport.X, ctx->Viewport.Y, - ctx->Viewport.Width, ctx->Viewport.Height, - ctx->Viewport.Near, ctx->Viewport.Far, - ctx->DrawBuffer->_DepthMaxF); -#endif - - if (ctx->Driver.Viewport) { - /* Many drivers will use this call to check for window size changes - * and reallocate the z/stencil/accum/etc buffers if needed. - */ - (*ctx->Driver.Viewport)( ctx, x, y, width, height ); - } -} - - -#if _HAVE_FULL_GL -/** - * Called by glDepthRange - * - * \param nearval specifies the Z buffer value which should correspond to - * the near clip plane - * \param farval specifies the Z buffer value which should correspond to - * the far clip plane - */ -void GLAPIENTRY -_mesa_DepthRange( GLclampd nearval, GLclampd farval ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval); - - ctx->Viewport.Near = (GLfloat) CLAMP( nearval, 0.0, 1.0 ); - ctx->Viewport.Far = (GLfloat) CLAMP( farval, 0.0, 1.0 ); - ctx->NewState |= _NEW_VIEWPORT; - -#if 1 - /* XXX remove this someday. Currently the DRI drivers rely on - * the WindowMap matrix being up to date in the driver's Viewport - * and DepthRange functions. - */ - _math_matrix_viewport(&ctx->Viewport._WindowMap, - ctx->Viewport.X, ctx->Viewport.Y, - ctx->Viewport.Width, ctx->Viewport.Height, - ctx->Viewport.Near, ctx->Viewport.Far, - ctx->DrawBuffer->_DepthMaxF); -#endif - - if (ctx->Driver.DepthRange) { - (*ctx->Driver.DepthRange)( ctx, nearval, farval ); - } -} -#endif - - - -/**********************************************************************/ -/** \name State management */ -/*@{*/ - - -/** - * Update the projection matrix stack. - * - * \param ctx GL context. - * - * Calls _math_matrix_analyse() with the top-matrix of the projection matrix - * stack, and recomputes user clip positions if necessary. - * - * \note This routine references __GLcontextRec::Tranform attribute values to - * compute userclip positions in clip space, but is only called on - * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values up to - * date across changes to the __GLcontextRec::Transform attributes. - */ -static void -update_projection( GLcontext *ctx ) -{ - _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); - -#if FEATURE_userclip - /* Recompute clip plane positions in clipspace. This is also done - * in _mesa_ClipPlane(). - */ - if (ctx->Transform.ClipPlanesEnabled) { - GLuint p; - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - _mesa_transform_vector( ctx->Transform._ClipUserPlane[p], - ctx->Transform.EyeUserPlane[p], - ctx->ProjectionMatrixStack.Top->inv ); - } - } - } -#endif -} - - -/** - * Calculate the combined modelview-projection matrix. - * - * \param ctx GL context. - * - * Multiplies the top matrices of the projection and model view stacks into - * __GLcontextRec::_ModelProjectMatrix via _math_matrix_mul_matrix() and - * analyzes the resulting matrix via _math_matrix_analyse(). - */ -static void -calculate_model_project_matrix( GLcontext *ctx ) -{ - _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix, - ctx->ProjectionMatrixStack.Top, - ctx->ModelviewMatrixStack.Top ); - - _math_matrix_analyse( &ctx->_ModelProjectMatrix ); -} - - -/** - * Updates the combined modelview-projection matrix. - * - * \param ctx GL context. - * \param new_state new state bit mask. - * - * If there is a new model view matrix then analyzes it. If there is a new - * projection matrix, updates it. Finally calls - * calculate_model_project_matrix() to recalculate the modelview-projection - * matrix. - */ -void _mesa_update_modelview_project( GLcontext *ctx, GLuint new_state ) -{ - if (new_state & _NEW_MODELVIEW) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - - /* Bring cull position uptodate. - */ - TRANSFORM_POINT3( ctx->Transform.CullObjPos, - ctx->ModelviewMatrixStack.Top->inv, - ctx->Transform.CullEyePos ); - } - - - if (new_state & _NEW_PROJECTION) - update_projection( ctx ); - - /* Keep ModelviewProject uptodate always to allow tnl - * implementations that go model->clip even when eye is required. - */ - calculate_model_project_matrix(ctx); -} - -/*@}*/ - - -/**********************************************************************/ -/** Matrix stack initialization */ -/*@{*/ - - -/** - * Initialize a matrix stack. - * - * \param stack matrix stack. - * \param maxDepth maximum stack depth. - * \param dirtyFlag dirty flag. - * - * Allocates an array of \p maxDepth elements for the matrix stack and calls - * _math_matrix_ctr() and _math_matrix_alloc_inv() for each element to - * initialize it. - */ -static void -init_matrix_stack( struct gl_matrix_stack *stack, - GLuint maxDepth, GLuint dirtyFlag ) -{ - GLuint i; - - stack->Depth = 0; - stack->MaxDepth = maxDepth; - stack->DirtyFlag = dirtyFlag; - /* The stack */ - stack->Stack = (GLmatrix *) CALLOC(maxDepth * sizeof(GLmatrix)); - for (i = 0; i < maxDepth; i++) { - _math_matrix_ctr(&stack->Stack[i]); - _math_matrix_alloc_inv(&stack->Stack[i]); - } - stack->Top = stack->Stack; -} - -/** - * Free matrix stack. - * - * \param stack matrix stack. - * - * Calls _math_matrix_dtr() for each element of the matrix stack and - * frees the array. - */ -static void -free_matrix_stack( struct gl_matrix_stack *stack ) -{ - GLuint i; - for (i = 0; i < stack->MaxDepth; i++) { - _math_matrix_dtr(&stack->Stack[i]); - } - FREE(stack->Stack); - stack->Stack = stack->Top = NULL; -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Initialization */ -/*@{*/ - - -/** - * Initialize the context matrix data. - * - * \param ctx GL context. - * - * Initializes each of the matrix stacks and the combined modelview-projection - * matrix. - */ -void _mesa_init_matrix( GLcontext * ctx ) -{ - GLint i; - - /* Initialize matrix stacks */ - init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH, - _NEW_MODELVIEW); - init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH, - _NEW_PROJECTION); - init_matrix_stack(&ctx->ColorMatrixStack, MAX_COLOR_STACK_DEPTH, - _NEW_COLOR_MATRIX); - for (i = 0; i < MAX_TEXTURE_UNITS; i++) - init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH, - _NEW_TEXTURE_MATRIX); - for (i = 0; i < MAX_PROGRAM_MATRICES; i++) - init_matrix_stack(&ctx->ProgramMatrixStack[i], - MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX); - ctx->CurrentStack = &ctx->ModelviewMatrixStack; - - /* Init combined Modelview*Projection matrix */ - _math_matrix_ctr( &ctx->_ModelProjectMatrix ); -} - - -/** - * Free the context matrix data. - * - * \param ctx GL context. - * - * Frees each of the matrix stacks and the combined modelview-projection - * matrix. - */ -void _mesa_free_matrix_data( GLcontext *ctx ) -{ - GLint i; - - free_matrix_stack(&ctx->ModelviewMatrixStack); - free_matrix_stack(&ctx->ProjectionMatrixStack); - free_matrix_stack(&ctx->ColorMatrixStack); - for (i = 0; i < MAX_TEXTURE_UNITS; i++) - free_matrix_stack(&ctx->TextureMatrixStack[i]); - for (i = 0; i < MAX_PROGRAM_MATRICES; i++) - free_matrix_stack(&ctx->ProgramMatrixStack[i]); - /* combined Modelview*Projection matrix */ - _math_matrix_dtr( &ctx->_ModelProjectMatrix ); - -} - - -/** - * Initialize the context transform attribute group. - * - * \param ctx GL context. - * - * \todo Move this to a new file with other 'transform' routines. - */ -void _mesa_init_transform( GLcontext *ctx ) -{ - GLint i; - - /* Transformation group */ - ctx->Transform.MatrixMode = GL_MODELVIEW; - ctx->Transform.Normalize = GL_FALSE; - ctx->Transform.RescaleNormals = GL_FALSE; - ctx->Transform.RasterPositionUnclipped = GL_FALSE; - for (i=0;iTransform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 ); - } - ctx->Transform.ClipPlanesEnabled = 0; - - ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 ); - ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 ); -} - - -/** - * Initialize the context viewport attribute group. - * - * \param ctx GL context. - * - * \todo Move this to a new file with other 'viewport' routines. - */ -void _mesa_init_viewport( GLcontext *ctx ) -{ - GLfloat depthMax = 65535.0F; /* sorf of arbitrary */ - - /* 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; - _math_matrix_ctr(&ctx->Viewport._WindowMap); - - _math_matrix_viewport(&ctx->Viewport._WindowMap, 0, 0, 0, 0, - 0.0F, 1.0F, depthMax); -} - - -/** - * Free the context viewport attribute group data. - * - * \param ctx GL context. - * - * \todo Move this to a new file with other 'viewport' routines. - */ -void _mesa_free_viewport_data( GLcontext *ctx ) -{ - _math_matrix_dtr(&ctx->Viewport._WindowMap); -} - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/matrix.h b/src/libs/mesa/mesa/main/matrix.h deleted file mode 100644 index 38769867a7..0000000000 --- a/src/libs/mesa/mesa/main/matrix.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * \file matrix.h - * Matrix operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 MATRIX_H -#define MATRIX_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_Frustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ); - -extern void GLAPIENTRY -_mesa_Ortho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ); - -extern void GLAPIENTRY -_mesa_PushMatrix( void ); - -extern void GLAPIENTRY -_mesa_PopMatrix( void ); - -extern void GLAPIENTRY -_mesa_LoadIdentity( void ); - -extern void GLAPIENTRY -_mesa_LoadMatrixf( const GLfloat *m ); - -extern void GLAPIENTRY -_mesa_LoadMatrixd( const GLdouble *m ); - -extern void GLAPIENTRY -_mesa_MatrixMode( GLenum mode ); - -extern void GLAPIENTRY -_mesa_MultMatrixf( const GLfloat *m ); - -extern void GLAPIENTRY -_mesa_MultMatrixd( const GLdouble *m ); - -extern void GLAPIENTRY -_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); - -extern void GLAPIENTRY -_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); - -extern void GLAPIENTRY -_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ); - -extern void GLAPIENTRY -_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ); - -extern void GLAPIENTRY -_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ); - -extern void GLAPIENTRY -_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ); - -extern void GLAPIENTRY -_mesa_LoadTransposeMatrixfARB( const GLfloat *m ); - -extern void GLAPIENTRY -_mesa_LoadTransposeMatrixdARB( const GLdouble *m ); - -extern void GLAPIENTRY -_mesa_MultTransposeMatrixfARB( const GLfloat *m ); - -extern void GLAPIENTRY -_mesa_MultTransposeMatrixdARB( const GLdouble *m ); - -extern void GLAPIENTRY -_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ); - -extern void -_mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ); - -extern void GLAPIENTRY -_mesa_DepthRange( GLclampd nearval, GLclampd farval ); - - -extern void -_mesa_init_matrix( GLcontext * ctx ); - -extern void -_mesa_init_transform( GLcontext *ctx ); - -extern void -_mesa_init_viewport( GLcontext *ctx ); - -extern void -_mesa_free_matrix_data( GLcontext *ctx ); - -extern void -_mesa_free_viewport_data( GLcontext *ctx ); - -extern void -_mesa_update_modelview_project( GLcontext *ctx, GLuint newstate ); - - -#endif diff --git a/src/libs/mesa/mesa/main/mfeatures.h b/src/libs/mesa/mesa/main/mfeatures.h deleted file mode 100644 index 3819da3d68..0000000000 --- a/src/libs/mesa/mesa/main/mfeatures.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file mfeatures.h - * Flags to enable/disable specific parts of the API. - */ - -#ifndef FEATURES_H -#define FEATURES_H - - -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - -#define FEATURE_accum _HAVE_FULL_GL -#define FEATURE_attrib_stack _HAVE_FULL_GL -#define FEATURE_colortable _HAVE_FULL_GL -#define FEATURE_convolve _HAVE_FULL_GL -#define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist _HAVE_FULL_GL -#define FEATURE_draw_read_buffer _HAVE_FULL_GL -#define FEATURE_drawpix _HAVE_FULL_GL -#define FEATURE_evaluators _HAVE_FULL_GL -#define FEATURE_feedback _HAVE_FULL_GL -#define FEATURE_fixedpt 0 -#define FEATURE_histogram _HAVE_FULL_GL -#define FEATURE_pixel_transfer _HAVE_FULL_GL -#define FEATURE_point_size_array 0 -#define FEATURE_texgen _HAVE_FULL_GL -#define FEATURE_texture_fxt1 _HAVE_FULL_GL -#define FEATURE_texture_s3tc _HAVE_FULL_GL -#define FEATURE_userclip _HAVE_FULL_GL -#define FEATURE_vertex_array_byte 0 -#define FEATURE_windowpos _HAVE_FULL_GL -#define FEATURE_es2_glsl 0 - -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL -#define FEATURE_ARB_fragment_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL -#define FEATURE_ARB_vertex_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL -#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects - -#define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL -#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL -#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL -#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL -#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL -#define FEATURE_MESA_program_debug _HAVE_FULL_GL -#define FEATURE_NV_fence _HAVE_FULL_GL -#define FEATURE_NV_fragment_program _HAVE_FULL_GL -#define FEATURE_NV_vertex_program _HAVE_FULL_GL - - -#endif /* FEATURES_H */ diff --git a/src/libs/mesa/mesa/main/mipmap.c b/src/libs/mesa/mesa/main/mipmap.c deleted file mode 100644 index 3dd4b3391b..0000000000 --- a/src/libs/mesa/mesa/main/mipmap.c +++ /dev/null @@ -1,1692 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file mipmap.c mipmap generation and teximage resizing functions. - */ - -#include "imports.h" -#include "mipmap.h" -#include "texcompress.h" -#include "texformat.h" -#include "teximage.h" -#include "image.h" - - - -static GLint -bytes_per_pixel(GLenum datatype, GLuint comps) -{ - GLint b = _mesa_sizeof_packed_type(datatype); - assert(b >= 0); - - if (_mesa_type_is_packed(datatype)) - return b; - else - return b * comps; -} - - -/** - * \name Support macros for do_row and do_row_3d - * - * The macro madness is here for two reasons. First, it compacts the code - * slightly. Second, it makes it much easier to adjust the specifics of the - * filter to tune the rounding characteristics. - */ -/*@{*/ -#define DECLARE_ROW_POINTERS(t, e) \ - const t(*rowA)[e] = (const t(*)[e]) srcRowA; \ - const t(*rowB)[e] = (const t(*)[e]) srcRowB; \ - const t(*rowC)[e] = (const t(*)[e]) srcRowC; \ - const t(*rowD)[e] = (const t(*)[e]) srcRowD; \ - t(*dst)[e] = (t(*)[e]) dstRow - -#define DECLARE_ROW_POINTERS0(t) \ - const t *rowA = (const t *) srcRowA; \ - const t *rowB = (const t *) srcRowB; \ - const t *rowC = (const t *) srcRowC; \ - const t *rowD = (const t *) srcRowD; \ - t *dst = (t *) dstRow - -#define FILTER_SUM_3D(Aj, Ak, Bj, Bk, Cj, Ck, Dj, Dk) \ - ((unsigned) Aj + (unsigned) Ak \ - + (unsigned) Bj + (unsigned) Bk \ - + (unsigned) Cj + (unsigned) Ck \ - + (unsigned) Dj + (unsigned) Dk \ - + 4) >> 3 - -#define FILTER_3D(e) \ - do { \ - dst[i][e] = FILTER_SUM_3D(rowA[j][e], rowA[k][e], \ - rowB[j][e], rowB[k][e], \ - rowC[j][e], rowC[k][e], \ - rowD[j][e], rowD[k][e]); \ - } while(0) - -#define FILTER_F_3D(e) \ - do { \ - dst[i][e] = (rowA[j][e] + rowA[k][e] \ - + rowB[j][e] + rowB[k][e] \ - + rowC[j][e] + rowC[k][e] \ - + rowD[j][e] + rowD[k][e]) * 0.125F; \ - } while(0) - -#define FILTER_HF_3D(e) \ - do { \ - const GLfloat aj = _mesa_half_to_float(rowA[j][e]); \ - const GLfloat ak = _mesa_half_to_float(rowA[k][e]); \ - const GLfloat bj = _mesa_half_to_float(rowB[j][e]); \ - const GLfloat bk = _mesa_half_to_float(rowB[k][e]); \ - const GLfloat cj = _mesa_half_to_float(rowC[j][e]); \ - const GLfloat ck = _mesa_half_to_float(rowC[k][e]); \ - const GLfloat dj = _mesa_half_to_float(rowD[j][e]); \ - const GLfloat dk = _mesa_half_to_float(rowD[k][e]); \ - dst[i][e] = _mesa_float_to_half((aj + ak + bj + bk + cj + ck + dj + dk) \ - * 0.125F); \ - } while(0) -/*@}*/ - - -/** - * Average together two rows of a source image to produce a single new - * row in the dest image. It's legal for the two source rows to point - * to the same data. The source width must be equal to either the - * dest width or two times the dest width. - * \param datatype GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_FLOAT, etc. - * \param comps number of components per pixel (1..4) - */ -static void -do_row(GLenum datatype, GLuint comps, GLint srcWidth, - const GLvoid *srcRowA, const GLvoid *srcRowB, - GLint dstWidth, GLvoid *dstRow) -{ - const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; - const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; - - ASSERT(comps >= 1); - ASSERT(comps <= 4); - - /* This assertion is no longer valid with non-power-of-2 textures - assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth); - */ - - if (datatype == GL_UNSIGNED_BYTE && comps == 4) { - GLuint i, j, k; - const GLubyte(*rowA)[4] = (const GLubyte(*)[4]) srcRowA; - const GLubyte(*rowB)[4] = (const GLubyte(*)[4]) srcRowB; - GLubyte(*dst)[4] = (GLubyte(*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; - dst[i][3] = (rowA[j][3] + rowA[k][3] + rowB[j][3] + rowB[k][3]) / 4; - } - } - else if (datatype == GL_UNSIGNED_BYTE && comps == 3) { - GLuint i, j, k; - const GLubyte(*rowA)[3] = (const GLubyte(*)[3]) srcRowA; - const GLubyte(*rowB)[3] = (const GLubyte(*)[3]) srcRowB; - GLubyte(*dst)[3] = (GLubyte(*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; - } - } - else if (datatype == GL_UNSIGNED_BYTE && comps == 2) { - GLuint i, j, k; - const GLubyte(*rowA)[2] = (const GLubyte(*)[2]) srcRowA; - const GLubyte(*rowB)[2] = (const GLubyte(*)[2]) srcRowB; - GLubyte(*dst)[2] = (GLubyte(*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) >> 2; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) >> 2; - } - } - else if (datatype == GL_UNSIGNED_BYTE && comps == 1) { - GLuint i, j, k; - const GLubyte *rowA = (const GLubyte *) srcRowA; - const GLubyte *rowB = (const GLubyte *) srcRowB; - GLubyte *dst = (GLubyte *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2; - } - } - - else if (datatype == GL_UNSIGNED_SHORT && comps == 4) { - GLuint i, j, k; - const GLushort(*rowA)[4] = (const GLushort(*)[4]) srcRowA; - const GLushort(*rowB)[4] = (const GLushort(*)[4]) srcRowB; - GLushort(*dst)[4] = (GLushort(*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; - dst[i][3] = (rowA[j][3] + rowA[k][3] + rowB[j][3] + rowB[k][3]) / 4; - } - } - else if (datatype == GL_UNSIGNED_SHORT && comps == 3) { - GLuint i, j, k; - const GLushort(*rowA)[3] = (const GLushort(*)[3]) srcRowA; - const GLushort(*rowB)[3] = (const GLushort(*)[3]) srcRowB; - GLushort(*dst)[3] = (GLushort(*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; - } - } - else if (datatype == GL_UNSIGNED_SHORT && comps == 2) { - GLuint i, j, k; - const GLushort(*rowA)[2] = (const GLushort(*)[2]) srcRowA; - const GLushort(*rowB)[2] = (const GLushort(*)[2]) srcRowB; - GLushort(*dst)[2] = (GLushort(*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; - } - } - else if (datatype == GL_UNSIGNED_SHORT && comps == 1) { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; - } - } - - else if (datatype == GL_FLOAT && comps == 4) { - GLuint i, j, k; - const GLfloat(*rowA)[4] = (const GLfloat(*)[4]) srcRowA; - const GLfloat(*rowB)[4] = (const GLfloat(*)[4]) srcRowB; - GLfloat(*dst)[4] = (GLfloat(*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) * 0.25F; - dst[i][3] = (rowA[j][3] + rowA[k][3] + - rowB[j][3] + rowB[k][3]) * 0.25F; - } - } - else if (datatype == GL_FLOAT && comps == 3) { - GLuint i, j, k; - const GLfloat(*rowA)[3] = (const GLfloat(*)[3]) srcRowA; - const GLfloat(*rowB)[3] = (const GLfloat(*)[3]) srcRowB; - GLfloat(*dst)[3] = (GLfloat(*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) * 0.25F; - } - } - else if (datatype == GL_FLOAT && comps == 2) { - GLuint i, j, k; - const GLfloat(*rowA)[2] = (const GLfloat(*)[2]) srcRowA; - const GLfloat(*rowB)[2] = (const GLfloat(*)[2]) srcRowB; - GLfloat(*dst)[2] = (GLfloat(*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - } - } - else if (datatype == GL_FLOAT && comps == 1) { - GLuint i, j, k; - const GLfloat *rowA = (const GLfloat *) srcRowA; - const GLfloat *rowB = (const GLfloat *) srcRowB; - GLfloat *dst = (GLfloat *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) * 0.25F; - } - } - - else if (datatype == GL_HALF_FLOAT_ARB && comps == 4) { - GLuint i, j, k, comp; - const GLhalfARB(*rowA)[4] = (const GLhalfARB(*)[4]) srcRowA; - const GLhalfARB(*rowB)[4] = (const GLhalfARB(*)[4]) srcRowB; - GLhalfARB(*dst)[4] = (GLhalfARB(*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 4; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - else if (datatype == GL_HALF_FLOAT_ARB && comps == 3) { - GLuint i, j, k, comp; - const GLhalfARB(*rowA)[3] = (const GLhalfARB(*)[3]) srcRowA; - const GLhalfARB(*rowB)[3] = (const GLhalfARB(*)[3]) srcRowB; - GLhalfARB(*dst)[3] = (GLhalfARB(*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 3; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - else if (datatype == GL_HALF_FLOAT_ARB && comps == 2) { - GLuint i, j, k, comp; - const GLhalfARB(*rowA)[2] = (const GLhalfARB(*)[2]) srcRowA; - const GLhalfARB(*rowB)[2] = (const GLhalfARB(*)[2]) srcRowB; - GLhalfARB(*dst)[2] = (GLhalfARB(*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 2; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - else if (datatype == GL_HALF_FLOAT_ARB && comps == 1) { - GLuint i, j, k; - const GLhalfARB *rowA = (const GLhalfARB *) srcRowA; - const GLhalfARB *rowB = (const GLhalfARB *) srcRowB; - GLhalfARB *dst = (GLhalfARB *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j]); - ak = _mesa_half_to_float(rowA[k]); - bj = _mesa_half_to_float(rowB[j]); - bk = _mesa_half_to_float(rowB[k]); - dst[i] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - - else if (datatype == GL_UNSIGNED_INT && comps == 1) { - GLuint i, j, k; - const GLuint *rowA = (const GLuint *) srcRowA; - const GLuint *rowB = (const GLuint *) srcRowB; - GLfloat *dst = (GLfloat *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (GLfloat)(rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4); - } - } - - else if (datatype == GL_UNSIGNED_SHORT_5_6_5 && comps == 3) { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0x1f; - const GLint rowAg0 = (rowA[j] >> 5) & 0x3f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x3f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x3f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x3f; - const GLint rowAb0 = (rowA[j] >> 11) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 11) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 11) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 11) & 0x1f; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - dst[i] = (blue << 11) | (green << 5) | red; - } - } - else if (datatype == GL_UNSIGNED_SHORT_4_4_4_4 && comps == 4) { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0xf; - const GLint rowAr1 = rowA[k] & 0xf; - const GLint rowBr0 = rowB[j] & 0xf; - const GLint rowBr1 = rowB[k] & 0xf; - const GLint rowAg0 = (rowA[j] >> 4) & 0xf; - const GLint rowAg1 = (rowA[k] >> 4) & 0xf; - const GLint rowBg0 = (rowB[j] >> 4) & 0xf; - const GLint rowBg1 = (rowB[k] >> 4) & 0xf; - const GLint rowAb0 = (rowA[j] >> 8) & 0xf; - const GLint rowAb1 = (rowA[k] >> 8) & 0xf; - const GLint rowBb0 = (rowB[j] >> 8) & 0xf; - const GLint rowBb1 = (rowB[k] >> 8) & 0xf; - const GLint rowAa0 = (rowA[j] >> 12) & 0xf; - const GLint rowAa1 = (rowA[k] >> 12) & 0xf; - const GLint rowBa0 = (rowB[j] >> 12) & 0xf; - const GLint rowBa1 = (rowB[k] >> 12) & 0xf; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; - dst[i] = (alpha << 12) | (blue << 8) | (green << 4) | red; - } - } - else if (datatype == GL_UNSIGNED_SHORT_1_5_5_5_REV && comps == 4) { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0x1f; - const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x1f; - const GLint rowAb0 = (rowA[j] >> 10) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 10) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 10) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 10) & 0x1f; - const GLint rowAa0 = (rowA[j] >> 15) & 0x1; - const GLint rowAa1 = (rowA[k] >> 15) & 0x1; - const GLint rowBa0 = (rowB[j] >> 15) & 0x1; - const GLint rowBa1 = (rowB[k] >> 15) & 0x1; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; - dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red; - } - } - else if (datatype == GL_UNSIGNED_BYTE_3_3_2 && comps == 3) { - GLuint i, j, k; - const GLubyte *rowA = (const GLubyte *) srcRowA; - const GLubyte *rowB = (const GLubyte *) srcRowB; - GLubyte *dst = (GLubyte *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x3; - const GLint rowAr1 = rowA[k] & 0x3; - const GLint rowBr0 = rowB[j] & 0x3; - const GLint rowBr1 = rowB[k] & 0x3; - const GLint rowAg0 = (rowA[j] >> 2) & 0x7; - const GLint rowAg1 = (rowA[k] >> 2) & 0x7; - const GLint rowBg0 = (rowB[j] >> 2) & 0x7; - const GLint rowBg1 = (rowB[k] >> 2) & 0x7; - const GLint rowAb0 = (rowA[j] >> 5) & 0x7; - const GLint rowAb1 = (rowA[k] >> 5) & 0x7; - const GLint rowBb0 = (rowB[j] >> 5) & 0x7; - const GLint rowBb1 = (rowB[k] >> 5) & 0x7; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - dst[i] = (blue << 5) | (green << 2) | red; - } - } - else { - _mesa_problem(NULL, "bad format in do_row()"); - } -} - - -/** - * Average together four rows of a source image to produce a single new - * row in the dest image. It's legal for the two source rows to point - * to the same data. The source width must be equal to either the - * dest width or two times the dest width. - * - * \param datatype GL pixel type \c GL_UNSIGNED_BYTE, \c GL_UNSIGNED_SHORT, - * \c GL_FLOAT, etc. - * \param comps number of components per pixel (1..4) - * \param srcWidth Width of a row in the source data - * \param srcRowA Pointer to one of the rows of source data - * \param srcRowB Pointer to one of the rows of source data - * \param srcRowC Pointer to one of the rows of source data - * \param srcRowD Pointer to one of the rows of source data - * \param dstWidth Width of a row in the destination data - * \param srcRowA Pointer to the row of destination data - */ -static void -do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, - const GLvoid *srcRowA, const GLvoid *srcRowB, - const GLvoid *srcRowC, const GLvoid *srcRowD, - GLint dstWidth, GLvoid *dstRow) -{ - const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; - const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; - GLuint i, j, k; - - ASSERT(comps >= 1); - ASSERT(comps <= 4); - - if ((datatype == GL_UNSIGNED_BYTE) && (comps == 4)) { - DECLARE_ROW_POINTERS(GLubyte, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - FILTER_3D(2); - FILTER_3D(3); - } - } - else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 3)) { - DECLARE_ROW_POINTERS(GLubyte, 3); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - FILTER_3D(2); - } - } - else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 2)) { - DECLARE_ROW_POINTERS(GLubyte, 2); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - } - } - else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 1)) { - DECLARE_ROW_POINTERS(GLubyte, 1); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - } - } - else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 4)) { - DECLARE_ROW_POINTERS(GLushort, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - FILTER_3D(2); - FILTER_3D(3); - } - } - else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 3)) { - DECLARE_ROW_POINTERS(GLushort, 3); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - FILTER_3D(2); - } - } - else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 2)) { - DECLARE_ROW_POINTERS(GLushort, 2); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - FILTER_3D(1); - } - } - else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 1)) { - DECLARE_ROW_POINTERS(GLushort, 1); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_3D(0); - } - } - else if ((datatype == GL_FLOAT) && (comps == 4)) { - DECLARE_ROW_POINTERS(GLfloat, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_F_3D(0); - FILTER_F_3D(1); - FILTER_F_3D(2); - FILTER_F_3D(3); - } - } - else if ((datatype == GL_FLOAT) && (comps == 3)) { - DECLARE_ROW_POINTERS(GLfloat, 3); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_F_3D(0); - FILTER_F_3D(1); - FILTER_F_3D(2); - } - } - else if ((datatype == GL_FLOAT) && (comps == 2)) { - DECLARE_ROW_POINTERS(GLfloat, 2); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_F_3D(0); - FILTER_F_3D(1); - } - } - else if ((datatype == GL_FLOAT) && (comps == 1)) { - DECLARE_ROW_POINTERS(GLfloat, 1); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_F_3D(0); - } - } - else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 4)) { - DECLARE_ROW_POINTERS(GLhalfARB, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_HF_3D(0); - FILTER_HF_3D(1); - FILTER_HF_3D(2); - FILTER_HF_3D(3); - } - } - else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 3)) { - DECLARE_ROW_POINTERS(GLhalfARB, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_HF_3D(0); - FILTER_HF_3D(1); - FILTER_HF_3D(2); - } - } - else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 2)) { - DECLARE_ROW_POINTERS(GLhalfARB, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_HF_3D(0); - FILTER_HF_3D(1); - } - } - else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 1)) { - DECLARE_ROW_POINTERS(GLhalfARB, 4); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - FILTER_HF_3D(0); - } - } - else if ((datatype == GL_UNSIGNED_INT) && (comps == 1)) { - const GLuint *rowA = (const GLuint *) srcRowA; - const GLuint *rowB = (const GLuint *) srcRowB; - const GLuint *rowC = (const GLuint *) srcRowC; - const GLuint *rowD = (const GLuint *) srcRowD; - GLfloat *dst = (GLfloat *) dstRow; - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const uint64_t tmp = (((uint64_t) rowA[j] + (uint64_t) rowA[k]) - + ((uint64_t) rowB[j] + (uint64_t) rowB[k]) - + ((uint64_t) rowC[j] + (uint64_t) rowC[k]) - + ((uint64_t) rowD[j] + (uint64_t) rowD[k])); - dst[i] = (GLfloat)((double) tmp * 0.125); - } - } - else if ((datatype == GL_UNSIGNED_SHORT_5_6_5) && (comps == 3)) { - DECLARE_ROW_POINTERS0(GLushort); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0x1f; - const GLint rowCr0 = rowC[j] & 0x1f; - const GLint rowCr1 = rowC[k] & 0x1f; - const GLint rowDr0 = rowD[j] & 0x1f; - const GLint rowDr1 = rowD[k] & 0x1f; - const GLint rowAg0 = (rowA[j] >> 5) & 0x3f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x3f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x3f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x3f; - const GLint rowCg0 = (rowC[j] >> 5) & 0x3f; - const GLint rowCg1 = (rowC[k] >> 5) & 0x3f; - const GLint rowDg0 = (rowD[j] >> 5) & 0x3f; - const GLint rowDg1 = (rowD[k] >> 5) & 0x3f; - const GLint rowAb0 = (rowA[j] >> 11) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 11) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 11) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 11) & 0x1f; - const GLint rowCb0 = (rowC[j] >> 11) & 0x1f; - const GLint rowCb1 = (rowC[k] >> 11) & 0x1f; - const GLint rowDb0 = (rowD[j] >> 11) & 0x1f; - const GLint rowDb1 = (rowD[k] >> 11) & 0x1f; - const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, - rowCr0, rowCr1, rowDr0, rowDr1); - const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, - rowCg0, rowCg1, rowDg0, rowDg1); - const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, - rowCb0, rowCb1, rowDb0, rowDb1); - dst[i] = (b << 11) | (g << 5) | r; - } - } - else if ((datatype == GL_UNSIGNED_SHORT_4_4_4_4) && (comps == 4)) { - DECLARE_ROW_POINTERS0(GLushort); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0xf; - const GLint rowAr1 = rowA[k] & 0xf; - const GLint rowBr0 = rowB[j] & 0xf; - const GLint rowBr1 = rowB[k] & 0xf; - const GLint rowCr0 = rowC[j] & 0xf; - const GLint rowCr1 = rowC[k] & 0xf; - const GLint rowDr0 = rowD[j] & 0xf; - const GLint rowDr1 = rowD[k] & 0xf; - const GLint rowAg0 = (rowA[j] >> 4) & 0xf; - const GLint rowAg1 = (rowA[k] >> 4) & 0xf; - const GLint rowBg0 = (rowB[j] >> 4) & 0xf; - const GLint rowBg1 = (rowB[k] >> 4) & 0xf; - const GLint rowCg0 = (rowC[j] >> 4) & 0xf; - const GLint rowCg1 = (rowC[k] >> 4) & 0xf; - const GLint rowDg0 = (rowD[j] >> 4) & 0xf; - const GLint rowDg1 = (rowD[k] >> 4) & 0xf; - const GLint rowAb0 = (rowA[j] >> 8) & 0xf; - const GLint rowAb1 = (rowA[k] >> 8) & 0xf; - const GLint rowBb0 = (rowB[j] >> 8) & 0xf; - const GLint rowBb1 = (rowB[k] >> 8) & 0xf; - const GLint rowCb0 = (rowC[j] >> 8) & 0xf; - const GLint rowCb1 = (rowC[k] >> 8) & 0xf; - const GLint rowDb0 = (rowD[j] >> 8) & 0xf; - const GLint rowDb1 = (rowD[k] >> 8) & 0xf; - const GLint rowAa0 = (rowA[j] >> 12) & 0xf; - const GLint rowAa1 = (rowA[k] >> 12) & 0xf; - const GLint rowBa0 = (rowB[j] >> 12) & 0xf; - const GLint rowBa1 = (rowB[k] >> 12) & 0xf; - const GLint rowCa0 = (rowC[j] >> 12) & 0xf; - const GLint rowCa1 = (rowC[k] >> 12) & 0xf; - const GLint rowDa0 = (rowD[j] >> 12) & 0xf; - const GLint rowDa1 = (rowD[k] >> 12) & 0xf; - const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, - rowCr0, rowCr1, rowDr0, rowDr1); - const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, - rowCg0, rowCg1, rowDg0, rowDg1); - const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, - rowCb0, rowCb1, rowDb0, rowDb1); - const GLint a = FILTER_SUM_3D(rowAa0, rowAa1, rowBa0, rowBa1, - rowCa0, rowCa1, rowDa0, rowDa1); - - dst[i] = (a << 12) | (b << 8) | (g << 4) | r; - } - } - else if ((datatype == GL_UNSIGNED_SHORT_1_5_5_5_REV) && (comps == 4)) { - DECLARE_ROW_POINTERS0(GLushort); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0x1f; - const GLint rowCr0 = rowC[j] & 0x1f; - const GLint rowCr1 = rowC[k] & 0x1f; - const GLint rowDr0 = rowD[j] & 0x1f; - const GLint rowDr1 = rowD[k] & 0x1f; - const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x1f; - const GLint rowCg0 = (rowC[j] >> 5) & 0x1f; - const GLint rowCg1 = (rowC[k] >> 5) & 0x1f; - const GLint rowDg0 = (rowD[j] >> 5) & 0x1f; - const GLint rowDg1 = (rowD[k] >> 5) & 0x1f; - const GLint rowAb0 = (rowA[j] >> 10) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 10) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 10) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 10) & 0x1f; - const GLint rowCb0 = (rowC[j] >> 10) & 0x1f; - const GLint rowCb1 = (rowC[k] >> 10) & 0x1f; - const GLint rowDb0 = (rowD[j] >> 10) & 0x1f; - const GLint rowDb1 = (rowD[k] >> 10) & 0x1f; - const GLint rowAa0 = (rowA[j] >> 15) & 0x1; - const GLint rowAa1 = (rowA[k] >> 15) & 0x1; - const GLint rowBa0 = (rowB[j] >> 15) & 0x1; - const GLint rowBa1 = (rowB[k] >> 15) & 0x1; - const GLint rowCa0 = (rowC[j] >> 15) & 0x1; - const GLint rowCa1 = (rowC[k] >> 15) & 0x1; - const GLint rowDa0 = (rowD[j] >> 15) & 0x1; - const GLint rowDa1 = (rowD[k] >> 15) & 0x1; - const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, - rowCr0, rowCr1, rowDr0, rowDr1); - const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, - rowCg0, rowCg1, rowDg0, rowDg1); - const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, - rowCb0, rowCb1, rowDb0, rowDb1); - const GLint a = FILTER_SUM_3D(rowAa0, rowAa1, rowBa0, rowBa1, - rowCa0, rowCa1, rowDa0, rowDa1); - - dst[i] = (a << 15) | (b << 10) | (g << 5) | r; - } - } - else if ((datatype == GL_UNSIGNED_BYTE_3_3_2) && (comps == 3)) { - DECLARE_ROW_POINTERS0(GLushort); - - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x3; - const GLint rowAr1 = rowA[k] & 0x3; - const GLint rowBr0 = rowB[j] & 0x3; - const GLint rowBr1 = rowB[k] & 0x3; - const GLint rowCr0 = rowC[j] & 0x3; - const GLint rowCr1 = rowC[k] & 0x3; - const GLint rowDr0 = rowD[j] & 0x3; - const GLint rowDr1 = rowD[k] & 0x3; - const GLint rowAg0 = (rowA[j] >> 2) & 0x7; - const GLint rowAg1 = (rowA[k] >> 2) & 0x7; - const GLint rowBg0 = (rowB[j] >> 2) & 0x7; - const GLint rowBg1 = (rowB[k] >> 2) & 0x7; - const GLint rowCg0 = (rowC[j] >> 2) & 0x7; - const GLint rowCg1 = (rowC[k] >> 2) & 0x7; - const GLint rowDg0 = (rowD[j] >> 2) & 0x7; - const GLint rowDg1 = (rowD[k] >> 2) & 0x7; - const GLint rowAb0 = (rowA[j] >> 5) & 0x7; - const GLint rowAb1 = (rowA[k] >> 5) & 0x7; - const GLint rowBb0 = (rowB[j] >> 5) & 0x7; - const GLint rowBb1 = (rowB[k] >> 5) & 0x7; - const GLint rowCb0 = (rowC[j] >> 5) & 0x7; - const GLint rowCb1 = (rowC[k] >> 5) & 0x7; - const GLint rowDb0 = (rowD[j] >> 5) & 0x7; - const GLint rowDb1 = (rowD[k] >> 5) & 0x7; - const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, - rowCr0, rowCr1, rowDr0, rowDr1); - const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, - rowCg0, rowCg1, rowDg0, rowDg1); - const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, - rowCb0, rowCb1, rowDb0, rowDb1); - dst[i] = (b << 5) | (g << 2) | r; - } - } - else { - _mesa_problem(NULL, "bad format in do_row()"); - } -} - - -/* - * These functions generate a 1/2-size mipmap image from a source image. - * Texture borders are handled by copying or averaging the source image's - * border texels, depending on the scale-down factor. - */ - -static void -make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, const GLubyte *srcPtr, - GLint dstWidth, GLubyte *dstPtr) -{ - const GLint bpt = bytes_per_pixel(datatype, comps); - const GLubyte *src; - GLubyte *dst; - - /* skip the border pixel, if any */ - src = srcPtr + border * bpt; - dst = dstPtr + border * bpt; - - /* we just duplicate the input row, kind of hack, saves code */ - do_row(datatype, comps, srcWidth - 2 * border, src, src, - dstWidth - 2 * border, dst); - - if (border) { - /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); - /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, - bpt); - } -} - - -static void -make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, GLint srcHeight, - const GLubyte *srcPtr, GLint srcRowStride, - GLint dstWidth, GLint dstHeight, - GLubyte *dstPtr, GLint dstRowStride) -{ - const GLint bpt = bytes_per_pixel(datatype, comps); - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint srcRowBytes = bpt * srcRowStride; - const GLint dstRowBytes = bpt * dstRowStride; - const GLubyte *srcA, *srcB; - GLubyte *dst; - GLint row; - - /* Compute src and dst pointers, skipping any border */ - srcA = srcPtr + border * ((srcWidth + 1) * bpt); - if (srcHeight > 1) - srcB = srcA + srcRowBytes; - else - srcB = srcA; - dst = dstPtr + border * ((dstWidth + 1) * bpt); - - for (row = 0; row < dstHeightNB; row++) { - do_row(datatype, comps, srcWidthNB, srcA, srcB, - dstWidthNB, dst); - srcA += 2 * srcRowBytes; - srcB += 2 * srcRowBytes; - dst += dstRowBytes; - } - - /* This is ugly but probably won't be used much */ - if (border > 0) { - /* fill in dest border */ - /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); - /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, bpt); - /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, - srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); - /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, - srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); - /* lower border */ - do_row(datatype, comps, srcWidthNB, - srcPtr + bpt, - srcPtr + bpt, - dstWidthNB, dstPtr + bpt); - /* upper border */ - do_row(datatype, comps, srcWidthNB, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - dstWidthNB, - dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt); - /* left and right borders */ - if (srcHeight == dstHeight) { - /* copy border pixel from src to dst */ - for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, - srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, - srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); - } - } - else { - /* average two src pixels each dest pixel */ - for (row = 0; row < dstHeightNB; row += 2) { - do_row(datatype, comps, 1, - srcPtr + (srcWidth * (row * 2 + 1)) * bpt, - srcPtr + (srcWidth * (row * 2 + 2)) * bpt, - 1, dstPtr + (dstWidth * row + 1) * bpt); - do_row(datatype, comps, 1, - srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt, - srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt, - 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt); - } - } - } -} - - -static void -make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - const GLubyte *srcPtr, GLint srcRowStride, - GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLubyte *dstPtr, GLint dstRowStride) -{ - const GLint bpt = bytes_per_pixel(datatype, comps); - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint srcDepthNB = srcDepth - 2 * border; - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint dstDepthNB = dstDepth - 2 * border; - GLint img, row; - GLint bytesPerSrcImage, bytesPerDstImage; - GLint bytesPerSrcRow, bytesPerDstRow; - GLint srcImageOffset, srcRowOffset; - - (void) srcDepthNB; /* silence warnings */ - - - bytesPerSrcImage = srcWidth * srcHeight * bpt; - bytesPerDstImage = dstWidth * dstHeight * bpt; - - bytesPerSrcRow = srcWidth * bpt; - bytesPerDstRow = dstWidth * bpt; - - /* Offset between adjacent src images to be averaged together */ - srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage; - - /* Offset between adjacent src rows to be averaged together */ - srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt; - - /* - * Need to average together up to 8 src pixels for each dest pixel. - * Break that down into 3 operations: - * 1. take two rows from source image and average them together. - * 2. take two rows from next source image and average them together. - * 3. take the two averaged rows and average them for the final dst row. - */ - - /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", - srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); - */ - - for (img = 0; img < dstDepthNB; img++) { - /* first source image pointer, skipping border */ - const GLubyte *imgSrcA = srcPtr - + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border - + img * (bytesPerSrcImage + srcImageOffset); - /* second source image pointer, skipping border */ - const GLubyte *imgSrcB = imgSrcA + srcImageOffset; - /* address of the dest image, skipping border */ - GLubyte *imgDst = dstPtr - + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border - + img * bytesPerDstImage; - - /* setup the four source row pointers and the dest row pointer */ - const GLubyte *srcImgARowA = imgSrcA; - const GLubyte *srcImgARowB = imgSrcA + srcRowOffset; - const GLubyte *srcImgBRowA = imgSrcB; - const GLubyte *srcImgBRowB = imgSrcB + srcRowOffset; - GLubyte *dstImgRow = imgDst; - - for (row = 0; row < dstHeightNB; row++) { - do_row_3D(datatype, comps, srcWidthNB, - srcImgARowA, srcImgARowB, - srcImgBRowA, srcImgBRowB, - dstWidthNB, dstImgRow); - - /* advance to next rows */ - srcImgARowA += bytesPerSrcRow + srcRowOffset; - srcImgARowB += bytesPerSrcRow + srcRowOffset; - srcImgBRowA += bytesPerSrcRow + srcRowOffset; - srcImgBRowB += bytesPerSrcRow + srcRowOffset; - dstImgRow += bytesPerDstRow; - } - } - - - /* Luckily we can leverage the make_2d_mipmap() function here! */ - if (border > 0) { - /* do front border image */ - make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, srcPtr, srcRowStride, - dstWidth, dstHeight, dstPtr, dstRowStride); - /* do back border image */ - make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, - srcPtr + bytesPerSrcImage * (srcDepth - 1), srcRowStride, - dstWidth, dstHeight, - dstPtr + bytesPerDstImage * (dstDepth - 1), dstRowStride); - /* do four remaining border edges that span the image slices */ - if (srcDepth == dstDepth) { - /* just copy border pixels from src to dst */ - for (img = 0; img < dstDepthNB; img++) { - const GLubyte *src; - GLubyte *dst; - - /* do border along [img][row=0][col=0] */ - src = srcPtr + (img + 1) * bytesPerSrcImage; - dst = dstPtr + (img + 1) * bytesPerDstImage; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=dstHeight-1][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * bytesPerSrcRow; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * bytesPerDstRow; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=0][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcWidth - 1) * bpt; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstWidth - 1) * bpt; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (bytesPerSrcImage - bpt); - dst = dstPtr + (img + 1) * bytesPerDstImage - + (bytesPerDstImage - bpt); - MEMCPY(dst, src, bpt); - } - } - else { - /* average border pixels from adjacent src image pairs */ - ASSERT(srcDepthNB == 2 * dstDepthNB); - for (img = 0; img < dstDepthNB; img++) { - const GLubyte *src; - GLubyte *dst; - - /* do border along [img][row=0][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage; - dst = dstPtr + (img + 1) * bytesPerDstImage; - do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=dstHeight-1][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * bytesPerSrcRow; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * bytesPerDstRow; - do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=0][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcWidth - 1) * bpt; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstWidth - 1) * bpt; - do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (bytesPerSrcImage - bpt); - dst = dstPtr + (img + 1) * bytesPerDstImage - + (bytesPerDstImage - bpt); - do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); - } - } - } -} - - -static void -make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, const GLubyte *srcPtr, GLuint srcRowStride, - GLint dstWidth, GLint dstHeight, - GLubyte *dstPtr, GLuint dstRowStride ) -{ - const GLint bpt = bytes_per_pixel(datatype, comps); - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint srcRowBytes = bpt * srcRowStride; - const GLint dstRowBytes = bpt * dstRowStride; - const GLubyte *src; - GLubyte *dst; - GLint row; - - /* Compute src and dst pointers, skipping any border */ - src = srcPtr + border * ((srcWidth + 1) * bpt); - dst = dstPtr + border * ((dstWidth + 1) * bpt); - - for (row = 0; row < dstHeightNB; row++) { - do_row(datatype, comps, srcWidthNB, src, src, - dstWidthNB, dst); - src += srcRowBytes; - dst += dstRowBytes; - } - - if (border) { - /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); - /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, - bpt); - } -} - - -/** - * \bugs - * There is quite a bit of refactoring that could be done with this function - * and \c make_2d_mipmap. - */ -static void -make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, GLint srcHeight, - const GLubyte *srcPtr, GLint srcRowStride, - GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLubyte *dstPtr, GLint dstRowStride) -{ - const GLint bpt = bytes_per_pixel(datatype, comps); - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint dstDepthNB = dstDepth - 2 * border; - const GLint srcRowBytes = bpt * srcRowStride; - const GLint dstRowBytes = bpt * dstRowStride; - const GLubyte *srcA, *srcB; - GLubyte *dst; - GLint layer; - GLint row; - - /* Compute src and dst pointers, skipping any border */ - srcA = srcPtr + border * ((srcWidth + 1) * bpt); - if (srcHeight > 1) - srcB = srcA + srcRowBytes; - else - srcB = srcA; - dst = dstPtr + border * ((dstWidth + 1) * bpt); - - for (layer = 0; layer < dstDepthNB; layer++) { - for (row = 0; row < dstHeightNB; row++) { - do_row(datatype, comps, srcWidthNB, srcA, srcB, - dstWidthNB, dst); - srcA += 2 * srcRowBytes; - srcB += 2 * srcRowBytes; - dst += dstRowBytes; - } - - /* This is ugly but probably won't be used much */ - if (border > 0) { - /* fill in dest border */ - /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); - /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, bpt); - /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, - srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); - /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, - srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); - /* lower border */ - do_row(datatype, comps, srcWidthNB, - srcPtr + bpt, - srcPtr + bpt, - dstWidthNB, dstPtr + bpt); - /* upper border */ - do_row(datatype, comps, srcWidthNB, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - dstWidthNB, - dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt); - /* left and right borders */ - if (srcHeight == dstHeight) { - /* copy border pixel from src to dst */ - for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, - srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, - srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); - } - } - else { - /* average two src pixels each dest pixel */ - for (row = 0; row < dstHeightNB; row += 2) { - do_row(datatype, comps, 1, - srcPtr + (srcWidth * (row * 2 + 1)) * bpt, - srcPtr + (srcWidth * (row * 2 + 2)) * bpt, - 1, dstPtr + (dstWidth * row + 1) * bpt); - do_row(datatype, comps, 1, - srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt, - srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt, - 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt); - } - } - } - } -} - - -/** - * Down-sample a texture image to produce the next lower mipmap level. - */ -void -_mesa_generate_mipmap_level(GLenum target, - GLenum datatype, GLuint comps, - GLint border, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - const GLubyte *srcData, - GLint srcRowStride, - GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLubyte *dstData, - GLint dstRowStride) -{ - /* - * We use simple 2x2 averaging to compute the next mipmap level. - */ - switch (target) { - case GL_TEXTURE_1D: - make_1d_mipmap(datatype, comps, border, - srcWidth, srcData, - dstWidth, dstData); - break; - case GL_TEXTURE_2D: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - make_2d_mipmap(datatype, comps, border, - srcWidth, srcHeight, srcData, srcRowStride, - dstWidth, dstHeight, dstData, dstRowStride); - break; - case GL_TEXTURE_3D: - make_3d_mipmap(datatype, comps, border, - srcWidth, srcHeight, srcDepth, - srcData, srcRowStride, - dstWidth, dstHeight, dstDepth, - dstData, dstRowStride); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - make_1d_stack_mipmap(datatype, comps, border, - srcWidth, srcData, srcRowStride, - dstWidth, dstHeight, - dstData, dstRowStride); - break; - case GL_TEXTURE_2D_ARRAY_EXT: - make_2d_stack_mipmap(datatype, comps, border, - srcWidth, srcHeight, - srcData, srcRowStride, - dstWidth, dstHeight, - dstDepth, dstData, dstRowStride); - break; - case GL_TEXTURE_RECTANGLE_NV: - /* no mipmaps, do nothing */ - break; - default: - _mesa_problem(NULL, "bad dimensions in _mesa_generate_mipmaps"); - return; - } -} - - -/** - * compute next (level+1) image size - * \return GL_FALSE if no smaller size can be generated (eg. src is 1x1x1 size) - */ -static GLboolean -next_mipmap_level_size(GLenum target, GLint border, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLint *dstWidth, GLint *dstHeight, GLint *dstDepth) -{ - if (srcWidth - 2 * border > 1) { - *dstWidth = (srcWidth - 2 * border) / 2 + 2 * border; - } - else { - *dstWidth = srcWidth; /* can't go smaller */ - } - - if ((srcHeight - 2 * border > 1) && - (target != GL_TEXTURE_1D_ARRAY_EXT)) { - *dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; - } - else { - *dstHeight = srcHeight; /* can't go smaller */ - } - - if ((srcDepth - 2 * border > 1) && - (target != GL_TEXTURE_2D_ARRAY_EXT)) { - *dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; - } - else { - *dstDepth = srcDepth; /* can't go smaller */ - } - - if (*dstWidth == srcWidth && - *dstHeight == srcHeight && - *dstDepth == srcDepth) { - return GL_FALSE; - } - else { - return GL_TRUE; - } -} - - - - -/** - * For GL_SGIX_generate_mipmap: - * Generate a complete set of mipmaps from texObj's base-level image. - * Stop at texObj's MaxLevel or when we get to the 1x1 texture. - */ -void -_mesa_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj) -{ - const struct gl_texture_image *srcImage; - const struct gl_texture_format *convertFormat; - const GLubyte *srcData = NULL; - GLubyte *dstData = NULL; - GLint level, maxLevels; - GLenum datatype; - GLuint comps; - - ASSERT(texObj); - /* XXX choose cube map face here??? */ - srcImage = texObj->Image[0][texObj->BaseLevel]; - ASSERT(srcImage); - - maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - ASSERT(maxLevels > 0); /* bad target */ - - /* Find convertFormat - the format that do_row() will process */ - if (srcImage->IsCompressed) { - /* setup for compressed textures */ - GLuint row; - GLint components, size; - GLchan *dst; - - assert(texObj->Target == GL_TEXTURE_2D || - texObj->Target == GL_TEXTURE_CUBE_MAP_ARB); - - if (srcImage->_BaseFormat == GL_RGB) { - convertFormat = &_mesa_texformat_rgb; - components = 3; - } - else if (srcImage->_BaseFormat == GL_RGBA) { - convertFormat = &_mesa_texformat_rgba; - components = 4; - } - else { - _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps"); - return; - } - - /* allocate storage for uncompressed GL_RGB or GL_RGBA images */ - size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE) - * srcImage->Width * srcImage->Height * srcImage->Depth + 20; - /* 20 extra bytes, just be safe when calling last FetchTexel */ - srcData = (GLubyte *) _mesa_malloc(size); - if (!srcData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - return; - } - dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */ - if (!dstData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - _mesa_free((void *) srcData); - return; - } - - /* decompress base image here */ - dst = (GLchan *) srcData; - for (row = 0; row < srcImage->Height; row++) { - GLuint col; - for (col = 0; col < srcImage->Width; col++) { - srcImage->FetchTexelc(srcImage, col, row, 0, dst); - dst += components; - } - } - } - else { - /* uncompressed */ - convertFormat = srcImage->TexFormat; - } - - _mesa_format_to_type_and_comps(convertFormat, &datatype, &comps); - - for (level = texObj->BaseLevel; level < texObj->MaxLevel - && level < maxLevels - 1; level++) { - /* generate image[level+1] from image[level] */ - const struct gl_texture_image *srcImage; - struct gl_texture_image *dstImage; - GLint srcWidth, srcHeight, srcDepth; - GLint dstWidth, dstHeight, dstDepth; - GLint border, bytesPerTexel; - GLboolean nextLevel; - - /* get src image parameters */ - srcImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(srcImage); - srcWidth = srcImage->Width; - srcHeight = srcImage->Height; - srcDepth = srcImage->Depth; - border = srcImage->Border; - - nextLevel = next_mipmap_level_size(target, border, - srcWidth, srcHeight, srcDepth, - &dstWidth, &dstHeight, &dstDepth); - if (!nextLevel) { - /* all done */ - if (srcImage->IsCompressed) { - _mesa_free((void *) srcData); - _mesa_free(dstData); - } - return; - } - - /* get dest gl_texture_image */ - dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1); - if (!dstImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - - if (dstImage->ImageOffsets) - _mesa_free(dstImage->ImageOffsets); - - /* Free old image data */ - if (dstImage->Data) - ctx->Driver.FreeTexImageData(ctx, dstImage); - - /* initialize new image */ - _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, - dstDepth, border, srcImage->InternalFormat); - dstImage->DriverData = NULL; - dstImage->TexFormat = srcImage->TexFormat; - dstImage->FetchTexelc = srcImage->FetchTexelc; - dstImage->FetchTexelf = srcImage->FetchTexelf; - dstImage->IsCompressed = srcImage->IsCompressed; - if (dstImage->IsCompressed) { - dstImage->CompressedSize - = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, - dstImage->Height, - dstImage->Depth, - dstImage->TexFormat->MesaFormat); - ASSERT(dstImage->CompressedSize > 0); - } - - ASSERT(dstImage->TexFormat); - ASSERT(dstImage->FetchTexelc); - ASSERT(dstImage->FetchTexelf); - - /* Alloc new teximage data buffer. - * Setup src and dest data pointers. - */ - if (dstImage->IsCompressed) { - dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); - if (!dstImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - /* srcData and dstData are already set */ - ASSERT(srcData); - ASSERT(dstData); - } - else { - bytesPerTexel = dstImage->TexFormat->TexelBytes; - ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); - dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight - * dstDepth * bytesPerTexel); - if (!dstImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - srcData = (const GLubyte *) srcImage->Data; - dstData = (GLubyte *) dstImage->Data; - } - - _mesa_generate_mipmap_level(target, datatype, comps, border, - srcWidth, srcHeight, srcDepth, - srcData, srcImage->RowStride, - dstWidth, dstHeight, dstDepth, - dstData, dstImage->RowStride); - - - if (dstImage->IsCompressed) { - GLubyte *temp; - /* compress image from dstData into dstImage->Data */ - const GLenum srcFormat = convertFormat->BaseFormat; - GLint dstRowStride - = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); - ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); - dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat, - dstImage->TexFormat, - dstImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, 0, /* strides */ - dstWidth, dstHeight, 1, /* size */ - srcFormat, CHAN_TYPE, - dstData, /* src data, actually */ - &ctx->DefaultPacking); - /* swap src and dest pointers */ - temp = (GLubyte *) srcData; - srcData = dstData; - dstData = temp; - } - - } /* loop over mipmap levels */ -} - - -/** - * Helper function for drivers which need to rescale texture images to - * certain aspect ratios. - * Nearest filtering only (for broken hardware that can't support - * all aspect ratios). This can be made a lot faster, but I don't - * really care enough... - */ -void -_mesa_rescale_teximage2d(GLuint bytesPerPixel, - GLuint srcStrideInPixels, - GLuint dstRowStride, - GLint srcWidth, GLint srcHeight, - GLint dstWidth, GLint dstHeight, - const GLvoid *srcImage, GLvoid *dstImage) -{ - GLint row, col; - -#define INNER_LOOP( TYPE, HOP, WOP ) \ - for ( row = 0 ; row < dstHeight ; row++ ) { \ - GLint srcRow = row HOP hScale; \ - for ( col = 0 ; col < dstWidth ; col++ ) { \ - GLint srcCol = col WOP wScale; \ - dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \ - } \ - dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \ - } \ - -#define RESCALE_IMAGE( TYPE ) \ -do { \ - const TYPE *src = (const TYPE *)srcImage; \ - TYPE *dst = (TYPE *)dstImage; \ - \ - if ( srcHeight < dstHeight ) { \ - const GLint hScale = dstHeight / srcHeight; \ - if ( srcWidth < dstWidth ) { \ - const GLint wScale = dstWidth / srcWidth; \ - INNER_LOOP( TYPE, /, / ); \ - } \ - else { \ - const GLint wScale = srcWidth / dstWidth; \ - INNER_LOOP( TYPE, /, * ); \ - } \ - } \ - else { \ - const GLint hScale = srcHeight / dstHeight; \ - if ( srcWidth < dstWidth ) { \ - const GLint wScale = dstWidth / srcWidth; \ - INNER_LOOP( TYPE, *, / ); \ - } \ - else { \ - const GLint wScale = srcWidth / dstWidth; \ - INNER_LOOP( TYPE, *, * ); \ - } \ - } \ -} while (0) - - switch ( bytesPerPixel ) { - case 4: - RESCALE_IMAGE( GLuint ); - break; - - case 2: - RESCALE_IMAGE( GLushort ); - break; - - case 1: - RESCALE_IMAGE( GLubyte ); - break; - default: - _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d"); - } -} - - -/** - * Upscale an image by replication, not (typical) stretching. - * We use this when the image width or height is less than a - * certain size (4, 8) and we need to upscale an image. - */ -void -_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, - GLsizei outWidth, GLsizei outHeight, - GLint comps, const GLchan *src, GLint srcRowStride, - GLchan *dest ) -{ - GLint i, j, k; - - ASSERT(outWidth >= inWidth); - ASSERT(outHeight >= inHeight); -#if 0 - ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2); - ASSERT((outWidth & 3) == 0); - ASSERT((outHeight & 3) == 0); -#endif - - for (i = 0; i < outHeight; i++) { - const GLint ii = i % inHeight; - for (j = 0; j < outWidth; j++) { - const GLint jj = j % inWidth; - for (k = 0; k < comps; k++) { - dest[(i * outWidth + j) * comps + k] - = src[ii * srcRowStride + jj * comps + k]; - } - } - } -} - diff --git a/src/libs/mesa/mesa/main/mipmap.h b/src/libs/mesa/mesa/main/mipmap.h deleted file mode 100644 index 22094c3437..0000000000 --- a/src/libs/mesa/mesa/main/mipmap.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 MIPMAP_H -#define MIPMAP_H - -#include "mtypes.h" - - -extern void -_mesa_generate_mipmap_level(GLenum target, - GLenum datatype, GLuint comps, - GLint border, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - const GLubyte *srcData, - GLint srcRowStride, - GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLubyte *dstData, - GLint dstRowStride); - - -extern void -_mesa_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj); - - -extern void -_mesa_rescale_teximage2d(GLuint bytesPerPixel, - GLuint srcStrideInPixels, - GLuint dstRowStride, - GLint srcWidth, GLint srcHeight, - GLint dstWidth, GLint dstHeight, - const GLvoid *srcImage, GLvoid *dstImage); - -extern void -_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, - GLsizei outWidth, GLsizei outHeight, - GLint comps, const GLchan *src, GLint srcRowStride, - GLchan *dest); - - -#endif /* MIPMAP_H */ diff --git a/src/libs/mesa/mesa/main/mm.c b/src/libs/mesa/mesa/main/mm.c deleted file mode 100644 index d430bcdb84..0000000000 --- a/src/libs/mesa/mesa/main/mm.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * GLX Hardware Device Driver common code - * Copyright (C) 1999 Wittawat Yamwong - * - * 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 - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#include "mm.h" - - -void -mmDumpMemInfo(const struct mem_block *heap) -{ - fprintf(stderr, "Memory heap %p:\n", (void *)heap); - if (heap == 0) { - fprintf(stderr, " heap == 0\n"); - } else { - const struct mem_block *p; - - for(p = heap->next; p != heap; p = p->next) { - fprintf(stderr, " Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size, - p->free ? 'F':'.', - p->reserved ? 'R':'.'); - } - - fprintf(stderr, "\nFree list:\n"); - - for(p = heap->next_free; p != heap; p = p->next_free) { - fprintf(stderr, " FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size, - p->free ? 'F':'.', - p->reserved ? 'R':'.'); - } - - } - fprintf(stderr, "End of memory blocks\n"); -} - -struct mem_block * -mmInit(unsigned ofs, unsigned size) -{ - struct mem_block *heap, *block; - - if (!size) - return NULL; - - heap = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); - if (!heap) - return NULL; - - block = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); - if (!block) { - _mesa_free(heap); - return NULL; - } - - heap->next = block; - heap->prev = block; - heap->next_free = block; - heap->prev_free = block; - - block->heap = heap; - block->next = heap; - block->prev = heap; - block->next_free = heap; - block->prev_free = heap; - - block->ofs = ofs; - block->size = size; - block->free = 1; - - return heap; -} - - -static struct mem_block * -SliceBlock(struct mem_block *p, - unsigned startofs, unsigned size, - unsigned reserved, unsigned alignment) -{ - struct mem_block *newblock; - - /* break left [p, newblock, p->next], then p = newblock */ - if (startofs > p->ofs) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); - if (!newblock) - return NULL; - newblock->ofs = startofs; - newblock->size = p->size - (startofs - p->ofs); - newblock->free = 1; - newblock->heap = p->heap; - - newblock->next = p->next; - newblock->prev = p; - p->next->prev = newblock; - p->next = newblock; - - newblock->next_free = p->next_free; - newblock->prev_free = p; - p->next_free->prev_free = newblock; - p->next_free = newblock; - - p->size -= newblock->size; - p = newblock; - } - - /* break right, also [p, newblock, p->next] */ - if (size < p->size) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); - if (!newblock) - return NULL; - newblock->ofs = startofs + size; - newblock->size = p->size - size; - newblock->free = 1; - newblock->heap = p->heap; - - newblock->next = p->next; - newblock->prev = p; - p->next->prev = newblock; - p->next = newblock; - - newblock->next_free = p->next_free; - newblock->prev_free = p; - p->next_free->prev_free = newblock; - p->next_free = newblock; - - p->size = size; - } - - /* p = middle block */ - p->free = 0; - - /* Remove p from the free list: - */ - p->next_free->prev_free = p->prev_free; - p->prev_free->next_free = p->next_free; - - p->next_free = 0; - p->prev_free = 0; - - p->reserved = reserved; - return p; -} - - -struct mem_block * -mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch) -{ - struct mem_block *p; - const unsigned mask = (1 << align2)-1; - unsigned startofs = 0; - unsigned endofs; - - if (!heap || !size) - return NULL; - - for (p = heap->next_free; p != heap; p = p->next_free) { - assert(p->free); - - startofs = (p->ofs + mask) & ~mask; - if ( startofs < startSearch ) { - startofs = startSearch; - } - endofs = startofs+size; - if (endofs <= (p->ofs+p->size)) - break; - } - - if (p == heap) - return NULL; - - assert(p->free); - p = SliceBlock(p,startofs,size,0,mask+1); - - return p; -} - - -struct mem_block * -mmFindBlock(struct mem_block *heap, unsigned start) -{ - struct mem_block *p; - - for (p = heap->next; p != heap; p = p->next) { - if (p->ofs == start) - return p; - } - - return NULL; -} - - -static INLINE int -Join2Blocks(struct mem_block *p) -{ - /* XXX there should be some assertions here */ - - /* NOTE: heap->free == 0 */ - - if (p->free && p->next->free) { - struct mem_block *q = p->next; - - assert(p->ofs + p->size == q->ofs); - p->size += q->size; - - p->next = q->next; - q->next->prev = p; - - q->next_free->prev_free = q->prev_free; - q->prev_free->next_free = q->next_free; - - _mesa_free(q); - return 1; - } - return 0; -} - -int -mmFreeMem(struct mem_block *b) -{ - if (!b) - return 0; - - if (b->free) { - fprintf(stderr, "block already free\n"); - return -1; - } - if (b->reserved) { - fprintf(stderr, "block is reserved\n"); - return -1; - } - - b->free = 1; - b->next_free = b->heap->next_free; - b->prev_free = b->heap; - b->next_free->prev_free = b; - b->prev_free->next_free = b; - - Join2Blocks(b); - if (b->prev != b->heap) - Join2Blocks(b->prev); - - return 0; -} - - -void -mmDestroy(struct mem_block *heap) -{ - struct mem_block *p; - - if (!heap) - return; - - for (p = heap->next; p != heap; ) { - struct mem_block *next = p->next; - _mesa_free(p); - p = next; - } - - _mesa_free(heap); -} diff --git a/src/libs/mesa/mesa/main/mm.h b/src/libs/mesa/mesa/main/mm.h deleted file mode 100644 index df340808ac..0000000000 --- a/src/libs/mesa/mesa/main/mm.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * GLX Hardware Device Driver common code - * Copyright (C) 1999 Wittawat Yamwong - * - * 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 - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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 manager code. Primarily used by device drivers to manage texture - * heaps, etc. - */ - - -#ifndef MM_H -#define MM_H - - -#include "imports.h" - - -struct mem_block { - struct mem_block *next, *prev; - struct mem_block *next_free, *prev_free; - struct mem_block *heap; - unsigned ofs; - unsigned size; - unsigned free:1; - unsigned reserved:1; -}; - - - -/** - * input: total size in bytes - * return: a heap pointer if OK, NULL if error - */ -extern struct mem_block *mmInit(unsigned ofs, unsigned size); - -/** - * Allocate 'size' bytes with 2^align2 bytes alignment, - * restrict the search to free memory after 'startSearch' - * depth and back buffers should be in different 4mb banks - * to get better page hits if possible - * input: size = size of block - * align2 = 2^align2 bytes alignment - * startSearch = linear offset from start of heap to begin search - * return: pointer to the allocated block, 0 if error - */ -extern struct mem_block *mmAllocMem(struct mem_block *heap, unsigned size, - unsigned align2, unsigned startSearch); - -/** - * Free block starts at offset - * input: pointer to a block - * return: 0 if OK, -1 if error - */ -extern int mmFreeMem(struct mem_block *b); - -/** - * Free block starts at offset - * input: pointer to a heap, start offset - * return: pointer to a block - */ -extern struct mem_block *mmFindBlock(struct mem_block *heap, unsigned start); - -/** - * destroy MM - */ -extern void mmDestroy(struct mem_block *mmInit); - -/** - * For debuging purpose. - */ -extern void mmDumpMemInfo(const struct mem_block *mmInit); - -#endif diff --git a/src/libs/mesa/mesa/main/mtypes.h b/src/libs/mesa/mesa/main/mtypes.h deleted file mode 100644 index f5826cad0a..0000000000 --- a/src/libs/mesa/mesa/main/mtypes.h +++ /dev/null @@ -1,3166 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright (C) 1999-2008 VMware, Inc. 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. - */ - -/** - * \file mtypes.h - * Main Mesa data structures. - * - * Please try to mark derived values with a leading underscore ('_'). - */ - -#ifndef TYPES_H -#define TYPES_H - - -#include "glheader.h" -#include /* __GLcontextModes (GLvisual) */ -#include "config.h" /* Hardwired parameters */ -#include "glapi/glapi.h" -#include "math/m_matrix.h" /* GLmatrix */ -#include "bitset.h" - - -/** - * Special, internal token - */ -#define GL_SHADER_PROGRAM_MESA 0x9999 - - -/** - * Color channel data type. - */ -#if CHAN_BITS == 8 - typedef GLubyte GLchan; -#define CHAN_MAX 255 -#define CHAN_MAXF 255.0F -#define CHAN_TYPE GL_UNSIGNED_BYTE -#elif CHAN_BITS == 16 - typedef GLushort GLchan; -#define CHAN_MAX 65535 -#define CHAN_MAXF 65535.0F -#define CHAN_TYPE GL_UNSIGNED_SHORT -#elif CHAN_BITS == 32 - typedef GLfloat GLchan; -#define CHAN_MAX 1.0 -#define CHAN_MAXF 1.0F -#define CHAN_TYPE GL_FLOAT -#else -#error "illegal number of color channel bits" -#endif - - -/** - * Stencil buffer data type. - */ -#if STENCIL_BITS==8 - typedef GLubyte GLstencil; -#elif STENCIL_BITS==16 - typedef GLushort GLstencil; -#else -# error "illegal number of stencil bits" -#endif - - -/** - * Fixed point data type. - */ -typedef int GLfixed; -/* - * Fixed point arithmetic macros - */ -#ifndef FIXED_FRAC_BITS -#define FIXED_FRAC_BITS 11 -#endif - -#define FIXED_SHIFT FIXED_FRAC_BITS -#define FIXED_ONE (1 << FIXED_SHIFT) -#define FIXED_HALF (1 << (FIXED_SHIFT-1)) -#define FIXED_FRAC_MASK (FIXED_ONE - 1) -#define FIXED_INT_MASK (~FIXED_FRAC_MASK) -#define FIXED_EPSILON 1 -#define FIXED_SCALE ((float) FIXED_ONE) -#define FIXED_DBL_SCALE ((double) FIXED_ONE) -#define FloatToFixed(X) (IROUND((X) * FIXED_SCALE)) -#define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE)) -#define IntToFixed(I) ((I) << FIXED_SHIFT) -#define FixedToInt(X) ((X) >> FIXED_SHIFT) -#define FixedToUns(X) (((unsigned int)(X)) >> FIXED_SHIFT) -#define FixedCeil(X) (((X) + FIXED_ONE - FIXED_EPSILON) & FIXED_INT_MASK) -#define FixedFloor(X) ((X) & FIXED_INT_MASK) -#define FixedToFloat(X) ((X) * (1.0F / FIXED_SCALE)) -#define PosFloatToFixed(X) FloatToFixed(X) -#define SignedFloatToFixed(X) FloatToFixed(X) - - - -/** - * \name Some forward type declarations - */ -/*@{*/ -struct _mesa_HashTable; -struct gl_pixelstore_attrib; -struct gl_program_cache; -struct gl_texture_format; -struct gl_texture_image; -struct gl_texture_object; -typedef struct __GLcontextRec GLcontext; -typedef struct __GLcontextModesRec GLvisual; -typedef struct gl_framebuffer GLframebuffer; -/*@}*/ - - - -/** - * Indexes for vertex program attributes. - * GL_NV_vertex_program aliases generic attributes over the conventional - * attributes. In GL_ARB_vertex_program shader the aliasing is optional. - * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the - * generic attributes are distinct/separate). - */ -enum -{ - VERT_ATTRIB_POS = 0, - VERT_ATTRIB_WEIGHT = 1, - VERT_ATTRIB_NORMAL = 2, - VERT_ATTRIB_COLOR0 = 3, - VERT_ATTRIB_COLOR1 = 4, - VERT_ATTRIB_FOG = 5, - VERT_ATTRIB_COLOR_INDEX = 6, - VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ - VERT_ATTRIB_EDGEFLAG = 7, - VERT_ATTRIB_TEX0 = 8, - VERT_ATTRIB_TEX1 = 9, - VERT_ATTRIB_TEX2 = 10, - VERT_ATTRIB_TEX3 = 11, - VERT_ATTRIB_TEX4 = 12, - VERT_ATTRIB_TEX5 = 13, - VERT_ATTRIB_TEX6 = 14, - VERT_ATTRIB_TEX7 = 15, - VERT_ATTRIB_GENERIC0 = 16, - VERT_ATTRIB_GENERIC1 = 17, - VERT_ATTRIB_GENERIC2 = 18, - VERT_ATTRIB_GENERIC3 = 19, - VERT_ATTRIB_GENERIC4 = 20, - VERT_ATTRIB_GENERIC5 = 21, - VERT_ATTRIB_GENERIC6 = 22, - VERT_ATTRIB_GENERIC7 = 23, - VERT_ATTRIB_GENERIC8 = 24, - VERT_ATTRIB_GENERIC9 = 25, - VERT_ATTRIB_GENERIC10 = 26, - VERT_ATTRIB_GENERIC11 = 27, - VERT_ATTRIB_GENERIC12 = 28, - VERT_ATTRIB_GENERIC13 = 29, - VERT_ATTRIB_GENERIC14 = 30, - VERT_ATTRIB_GENERIC15 = 31, - VERT_ATTRIB_MAX = 32 -}; - -/** - * Bitflags for vertex attributes. - * These are used in bitfields in many places. - */ -/*@{*/ -#define VERT_BIT_POS (1 << VERT_ATTRIB_POS) -#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT) -#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL) -#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0) -#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1) -#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG) -#define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX) -#define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG) -#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0) -#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1) -#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2) -#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3) -#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4) -#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5) -#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6) -#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7) -#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0) -#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1) -#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2) -#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3) -#define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4) -#define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5) -#define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6) -#define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7) -#define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8) -#define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9) -#define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10) -#define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11) -#define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12) -#define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13) -#define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14) -#define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15) - -#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u))) -#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g))) -/*@}*/ - - -/** - * Indexes for vertex program result attributes - */ -/*@{*/ -#define VERT_RESULT_HPOS 0 -#define VERT_RESULT_COL0 1 -#define VERT_RESULT_COL1 2 -#define VERT_RESULT_FOGC 3 -#define VERT_RESULT_TEX0 4 -#define VERT_RESULT_TEX1 5 -#define VERT_RESULT_TEX2 6 -#define VERT_RESULT_TEX3 7 -#define VERT_RESULT_TEX4 8 -#define VERT_RESULT_TEX5 9 -#define VERT_RESULT_TEX6 10 -#define VERT_RESULT_TEX7 11 -#define VERT_RESULT_PSIZ 12 -#define VERT_RESULT_BFC0 13 -#define VERT_RESULT_BFC1 14 -#define VERT_RESULT_EDGE 15 -#define VERT_RESULT_VAR0 16 /**< shader varying */ -#define VERT_RESULT_MAX (VERT_RESULT_VAR0 + MAX_VARYING) -/*@}*/ - - -/** - * Indexes for fragment program input attributes. - */ -enum -{ - FRAG_ATTRIB_WPOS = 0, - FRAG_ATTRIB_COL0 = 1, - FRAG_ATTRIB_COL1 = 2, - FRAG_ATTRIB_FOGC = 3, - FRAG_ATTRIB_TEX0 = 4, - FRAG_ATTRIB_TEX1 = 5, - FRAG_ATTRIB_TEX2 = 6, - FRAG_ATTRIB_TEX3 = 7, - FRAG_ATTRIB_TEX4 = 8, - FRAG_ATTRIB_TEX5 = 9, - FRAG_ATTRIB_TEX6 = 10, - FRAG_ATTRIB_TEX7 = 11, - FRAG_ATTRIB_VAR0 = 12, /**< shader varying */ - FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING) -}; - -/** - * Bitflags for fragment program input attributes. - */ -/*@{*/ -#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS) -#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0) -#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1) -#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC) -#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0) -#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1) -#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2) -#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3) -#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4) -#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5) -#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6) -#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7) -#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0) - -#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U)) -#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V)) - -#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \ - FRAG_BIT_TEX1| \ - FRAG_BIT_TEX2| \ - FRAG_BIT_TEX3| \ - FRAG_BIT_TEX4| \ - FRAG_BIT_TEX5| \ - FRAG_BIT_TEX6| \ - FRAG_BIT_TEX7) -/*@}*/ - - -/** - * Fragment program results - */ -enum -{ - FRAG_RESULT_COLR = 0, - FRAG_RESULT_COLH = 1, - FRAG_RESULT_DEPR = 2, - FRAG_RESULT_DATA0 = 3, - FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) -}; - - -/** - * Indexes for all renderbuffers - */ -enum { - BUFFER_FRONT_LEFT = 0, /* the four standard color buffers */ - BUFFER_BACK_LEFT = 1, - BUFFER_FRONT_RIGHT = 2, - BUFFER_BACK_RIGHT = 3, - BUFFER_AUX0 = 4, /* optional aux buffer */ - BUFFER_AUX1 = 5, - BUFFER_AUX2 = 6, - BUFFER_AUX3 = 7, - BUFFER_DEPTH = 8, - BUFFER_STENCIL = 9, - BUFFER_ACCUM = 10, - BUFFER_COLOR0 = 11, /* generic renderbuffers */ - BUFFER_COLOR1 = 12, - BUFFER_COLOR2 = 13, - BUFFER_COLOR3 = 14, - BUFFER_COLOR4 = 15, - BUFFER_COLOR5 = 16, - BUFFER_COLOR6 = 17, - BUFFER_COLOR7 = 18, - BUFFER_COUNT = 19 -}; - -/** - * Bit flags for all renderbuffers - */ -#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT) -#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT) -#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT) -#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT) -#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0) -#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1) -#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2) -#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3) -#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH) -#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL) -#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM) -#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0) -#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1) -#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2) -#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3) -#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4) -#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5) -#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6) -#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7) - -/** - * Mask of all the color buffer bits (but not accum). - */ -#define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \ - BUFFER_BIT_BACK_LEFT | \ - BUFFER_BIT_FRONT_RIGHT | \ - BUFFER_BIT_BACK_RIGHT | \ - BUFFER_BIT_AUX0 | \ - BUFFER_BIT_AUX1 | \ - BUFFER_BIT_AUX2 | \ - BUFFER_BIT_AUX3 | \ - BUFFER_BIT_COLOR0 | \ - BUFFER_BIT_COLOR1 | \ - BUFFER_BIT_COLOR2 | \ - BUFFER_BIT_COLOR3 | \ - BUFFER_BIT_COLOR4 | \ - BUFFER_BIT_COLOR5 | \ - BUFFER_BIT_COLOR6 | \ - BUFFER_BIT_COLOR7) - - -/** The pixel transfer path has three color tables: */ -/*@{*/ -#define COLORTABLE_PRECONVOLUTION 0 -#define COLORTABLE_POSTCONVOLUTION 1 -#define COLORTABLE_POSTCOLORMATRIX 2 -#define COLORTABLE_MAX 3 -/*@}*/ - - -/** - * Data structure for color tables - */ -struct gl_color_table -{ - GLenum InternalFormat; /**< The user-specified format */ - GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */ - GLuint Size; /**< number of entries in table */ - GLfloat *TableF; /**< Color table, floating point values */ - GLubyte *TableUB; /**< Color table, ubyte values */ - GLubyte RedSize; - GLubyte GreenSize; - GLubyte BlueSize; - GLubyte AlphaSize; - GLubyte LuminanceSize; - GLubyte IntensitySize; -}; - - -/** - * \name Bit flags used for updating material values. - */ -/*@{*/ -#define MAT_ATTRIB_FRONT_AMBIENT 0 -#define MAT_ATTRIB_BACK_AMBIENT 1 -#define MAT_ATTRIB_FRONT_DIFFUSE 2 -#define MAT_ATTRIB_BACK_DIFFUSE 3 -#define MAT_ATTRIB_FRONT_SPECULAR 4 -#define MAT_ATTRIB_BACK_SPECULAR 5 -#define MAT_ATTRIB_FRONT_EMISSION 6 -#define MAT_ATTRIB_BACK_EMISSION 7 -#define MAT_ATTRIB_FRONT_SHININESS 8 -#define MAT_ATTRIB_BACK_SHININESS 9 -#define MAT_ATTRIB_FRONT_INDEXES 10 -#define MAT_ATTRIB_BACK_INDEXES 11 -#define MAT_ATTRIB_MAX 12 - -#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) -#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) -#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) -#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) -#define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f)) -#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) - -#define MAT_INDEX_AMBIENT 0 -#define MAT_INDEX_DIFFUSE 1 -#define MAT_INDEX_SPECULAR 2 - -#define MAT_BIT_FRONT_AMBIENT (1< ) */ - GLfloat _NormDirection[4]; /**< normalized spotlight direction */ - GLfloat _VP_inf_spot_attenuation; - - GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ - GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */ - GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */ - GLfloat _MatSpecular[2][3]; /**< material spec * light specular */ - GLfloat _dli; /**< CI diffuse light intensity */ - GLfloat _sli; /**< CI specular light intensity */ - /*@}*/ -}; - - -/** - * Light model state. - */ -struct gl_lightmodel -{ - GLfloat Ambient[4]; /**< ambient color */ - GLboolean LocalViewer; /**< Local (or infinite) view point? */ - GLboolean TwoSide; /**< Two (or one) sided lighting? */ - GLenum ColorControl; /**< either GL_SINGLE_COLOR - * or GL_SEPARATE_SPECULAR_COLOR */ -}; - - -/** - * Material state. - */ -struct gl_material -{ - GLfloat Attrib[MAT_ATTRIB_MAX][4]; -}; - - -/** - * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT) - */ -struct gl_accum_attrib -{ - GLfloat ClearColor[4]; /**< Accumulation buffer clear color */ -}; - - -/** - * Color buffer attribute group (GL_COLOR_BUFFER_BIT). - */ -struct gl_colorbuffer_attrib -{ - GLuint ClearIndex; /**< Index to use for glClear */ - GLclampf ClearColor[4]; /**< Color to use for glClear */ - - GLuint IndexMask; /**< Color index write mask */ - GLubyte ColorMask[4]; /**< Each flag is 0xff or 0x0 */ - - GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ - - /** - * \name alpha testing - */ - /*@{*/ - GLboolean AlphaEnabled; /**< Alpha test enabled flag */ - GLenum AlphaFunc; /**< Alpha test function */ - GLclampf AlphaRef; /**< Alpha reference value */ - /*@}*/ - - /** - * \name Blending - */ - /*@{*/ - GLboolean BlendEnabled; /**< Blending enabled flag */ - GLenum BlendSrcRGB; /**< Blending source operator */ - GLenum BlendDstRGB; /**< Blending destination operator */ - GLenum BlendSrcA; /**< GL_INGR_blend_func_separate */ - GLenum BlendDstA; /**< GL_INGR_blend_func_separate */ - GLenum BlendEquationRGB; /**< Blending equation */ - GLenum BlendEquationA; /**< GL_EXT_blend_equation_separate */ - GLfloat BlendColor[4]; /**< Blending color */ - /*@}*/ - - /** - * \name Logic op - */ - /*@{*/ - GLenum LogicOp; /**< Logic operator */ - GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */ - GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */ - GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */ - /*@}*/ - - GLboolean DitherFlag; /**< Dither enable flag */ - - GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ - GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ -}; - - -/** - * Current attribute group (GL_CURRENT_BIT). - */ -struct gl_current_attrib -{ - /** - * \name Current vertex attributes. - * \note Values are valid only after FLUSH_VERTICES has been called. - * \note Index and Edgeflag current values are stored as floats in the - * SIX and SEVEN attribute slots. - */ - /*@{*/ - GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */ - /*@}*/ - - /** - * \name Current raster position attributes (always valid). - * \note This set of attributes is very similar to the SWvertex struct. - */ - /*@{*/ - GLfloat RasterPos[4]; - GLfloat RasterDistance; - GLfloat RasterColor[4]; - GLfloat RasterSecondaryColor[4]; - GLfloat RasterIndex; - GLfloat RasterTexCoords[MAX_TEXTURE_UNITS][4]; - GLboolean RasterPosValid; - /*@}*/ -}; - - -/** - * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT). - */ -struct gl_depthbuffer_attrib -{ - GLenum Func; /**< Function for depth buffer compare */ - GLclampd Clear; /**< Value to clear depth buffer to */ - GLboolean Test; /**< Depth buffering enabled flag */ - GLboolean Mask; /**< Depth buffer writable? */ - GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */ - GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */ -}; - - -/** - * glEnable()/glDisable() attribute group (GL_ENABLE_BIT). - */ -struct gl_enable_attrib -{ - GLboolean AlphaTest; - GLboolean AutoNormal; - GLboolean Blend; - GLbitfield ClipPlanes; - GLboolean ColorMaterial; - GLboolean ColorTable[COLORTABLE_MAX]; - GLboolean Convolution1D; - GLboolean Convolution2D; - GLboolean Separable2D; - GLboolean CullFace; - GLboolean DepthTest; - GLboolean Dither; - GLboolean Fog; - GLboolean Histogram; - GLboolean Light[MAX_LIGHTS]; - GLboolean Lighting; - GLboolean LineSmooth; - GLboolean LineStipple; - GLboolean IndexLogicOp; - GLboolean ColorLogicOp; - GLboolean Map1Color4; - GLboolean Map1Index; - GLboolean Map1Normal; - GLboolean Map1TextureCoord1; - GLboolean Map1TextureCoord2; - GLboolean Map1TextureCoord3; - GLboolean Map1TextureCoord4; - GLboolean Map1Vertex3; - GLboolean Map1Vertex4; - GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ - GLboolean Map2Color4; - GLboolean Map2Index; - GLboolean Map2Normal; - GLboolean Map2TextureCoord1; - GLboolean Map2TextureCoord2; - GLboolean Map2TextureCoord3; - GLboolean Map2TextureCoord4; - GLboolean Map2Vertex3; - GLboolean Map2Vertex4; - GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ - GLboolean MinMax; - GLboolean Normalize; - GLboolean PixelTexture; - GLboolean PointSmooth; - GLboolean PolygonOffsetPoint; - GLboolean PolygonOffsetLine; - GLboolean PolygonOffsetFill; - GLboolean PolygonSmooth; - GLboolean PolygonStipple; - GLboolean RescaleNormals; - GLboolean Scissor; - GLboolean Stencil; - GLboolean StencilTwoSide; /* GL_EXT_stencil_two_side */ - GLboolean MultisampleEnabled; /* GL_ARB_multisample */ - GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */ - GLboolean SampleAlphaToOne; /* GL_ARB_multisample */ - GLboolean SampleCoverage; /* GL_ARB_multisample */ - GLboolean SampleCoverageInvert; /* GL_ARB_multisample */ - GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */ - GLuint Texture[MAX_TEXTURE_UNITS]; - GLuint TexGen[MAX_TEXTURE_UNITS]; - /* SGI_texture_color_table */ - GLboolean TextureColorTable[MAX_TEXTURE_UNITS]; - /* GL_ARB_vertex_program / GL_NV_vertex_program */ - GLboolean VertexProgram; - GLboolean VertexProgramPointSize; - GLboolean VertexProgramTwoSide; - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - GLboolean PointSprite; - GLboolean FragmentShaderATI; -}; - - -/** - * Evaluator attribute group (GL_EVAL_BIT). - */ -struct gl_eval_attrib -{ - /** - * \name Enable bits - */ - /*@{*/ - GLboolean Map1Color4; - GLboolean Map1Index; - GLboolean Map1Normal; - GLboolean Map1TextureCoord1; - GLboolean Map1TextureCoord2; - GLboolean Map1TextureCoord3; - GLboolean Map1TextureCoord4; - GLboolean Map1Vertex3; - GLboolean Map1Vertex4; - GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ - GLboolean Map2Color4; - GLboolean Map2Index; - GLboolean Map2Normal; - GLboolean Map2TextureCoord1; - GLboolean Map2TextureCoord2; - GLboolean Map2TextureCoord3; - GLboolean Map2TextureCoord4; - GLboolean Map2Vertex3; - GLboolean Map2Vertex4; - GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ - GLboolean AutoNormal; - /*@}*/ - - /** - * \name Map Grid endpoints and divisions and calculated du values - */ - /*@{*/ - GLint MapGrid1un; - GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du; - GLint MapGrid2un, MapGrid2vn; - GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du; - GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv; - /*@}*/ -}; - - -/** - * Fog attribute group (GL_FOG_BIT). - */ -struct gl_fog_attrib -{ - GLboolean Enabled; /**< Fog enabled flag */ - GLfloat Color[4]; /**< Fog color */ - GLfloat Density; /**< Density >= 0.0 */ - GLfloat Start; /**< Start distance in eye coords */ - GLfloat End; /**< End distance in eye coords */ - GLfloat Index; /**< Fog index */ - GLenum Mode; /**< Fog mode */ - GLboolean ColorSumEnabled; - GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ - GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */ -}; - - -/** - * Hint attribute group (GL_HINT_BIT). - * - * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. - */ -struct gl_hint_attrib -{ - GLenum PerspectiveCorrection; - GLenum PointSmooth; - GLenum LineSmooth; - GLenum PolygonSmooth; - GLenum Fog; - GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */ - GLenum TextureCompression; /**< GL_ARB_texture_compression */ - GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */ -}; - - -/** - * Histogram attributes. - */ -struct gl_histogram_attrib -{ - GLuint Width; /**< number of table entries */ - GLint Format; /**< GL_ALPHA, GL_RGB, etc */ - GLuint Count[HISTOGRAM_TABLE_SIZE][4]; /**< the histogram */ - GLboolean Sink; /**< terminate image transfer? */ - GLubyte RedSize; /**< Bits per counter */ - GLubyte GreenSize; - GLubyte BlueSize; - GLubyte AlphaSize; - GLubyte LuminanceSize; -}; - - -/** - * Color Min/max state. - */ -struct gl_minmax_attrib -{ - GLenum Format; - GLboolean Sink; - GLfloat Min[4], Max[4]; /**< RGBA */ -}; - - -/** - * Image convolution state. - */ -struct gl_convolution_attrib -{ - GLenum Format; - GLenum InternalFormat; - GLuint Width; - GLuint Height; - GLfloat Filter[MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_HEIGHT * 4]; -}; - - -/** - * Light state flags. - */ -/*@{*/ -#define LIGHT_SPOT 0x1 -#define LIGHT_LOCAL_VIEWER 0x2 -#define LIGHT_POSITIONAL 0x4 -#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER) -/*@}*/ - - -/** - * Lighting attribute group (GL_LIGHT_BIT). - */ -struct gl_light_attrib -{ - struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */ - struct gl_lightmodel Model; /**< Lighting model */ - - /** - * Must flush FLUSH_VERTICES before referencing: - */ - /*@{*/ - struct gl_material Material; /**< Includes front & back values */ - /*@}*/ - - GLboolean Enabled; /**< Lighting enabled flag */ - GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */ - GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */ - GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ - GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */ - GLboolean ColorMaterialEnabled; - GLenum ClampVertexColor; - - struct gl_light EnabledList; /**< List sentinel */ - - /** - * Derived state for optimizations: - */ - /*@{*/ - GLboolean _NeedEyeCoords; - GLboolean _NeedVertices; /**< Use fast shader? */ - GLbitfield _Flags; /**< LIGHT_* flags, see above */ - GLfloat _BaseColor[2][3]; - /*@}*/ -}; - - -/** - * Line attribute group (GL_LINE_BIT). - */ -struct gl_line_attrib -{ - GLboolean SmoothFlag; /**< GL_LINE_SMOOTH enabled? */ - GLboolean StippleFlag; /**< GL_LINE_STIPPLE enabled? */ - GLushort StipplePattern; /**< Stipple pattern */ - GLint StippleFactor; /**< Stipple repeat factor */ - GLfloat Width; /**< Line width */ -}; - - -/** - * Display list attribute group (GL_LIST_BIT). - */ -struct gl_list_attrib -{ - GLuint ListBase; -}; - - -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_instruction -{ - GLuint Size; - void (*Execute)( GLcontext *ctx, void *data ); - void (*Destroy)( GLcontext *ctx, void *data ); - void (*Print)( GLcontext *ctx, void *data ); -}; - -#define MAX_DLIST_EXT_OPCODES 16 - -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_extensions -{ - struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES]; - GLuint NumOpcodes; -}; - - -/** - * Multisample attribute group (GL_MULTISAMPLE_BIT). - */ -struct gl_multisample_attrib -{ - GLboolean Enabled; - GLboolean _Enabled; /**< true if Enabled and multisample buffer */ - GLboolean SampleAlphaToCoverage; - GLboolean SampleAlphaToOne; - GLboolean SampleCoverage; - GLfloat SampleCoverageValue; - GLboolean SampleCoverageInvert; -}; - - -/** - * A pixelmap (see glPixelMap) - */ -struct gl_pixelmap -{ - GLint Size; - GLfloat Map[MAX_PIXEL_MAP_TABLE]; - GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */ -}; - - -/** - * Collection of all pixelmaps - */ -struct gl_pixelmaps -{ - struct gl_pixelmap RtoR; /**< i.e. GL_PIXEL_MAP_R_TO_R */ - struct gl_pixelmap GtoG; - struct gl_pixelmap BtoB; - struct gl_pixelmap AtoA; - struct gl_pixelmap ItoR; - struct gl_pixelmap ItoG; - struct gl_pixelmap ItoB; - struct gl_pixelmap ItoA; - struct gl_pixelmap ItoI; - struct gl_pixelmap StoS; -}; - - -/** - * Pixel attribute group (GL_PIXEL_MODE_BIT). - */ -struct gl_pixel_attrib -{ - GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */ - - /*--- Begin Pixel Transfer State ---*/ - /* Fields are in the order in which they're applied... */ - - /* Scale & Bias (index shift, offset) */ - GLfloat RedBias, RedScale; - GLfloat GreenBias, GreenScale; - GLfloat BlueBias, BlueScale; - GLfloat AlphaBias, AlphaScale; - GLfloat DepthBias, DepthScale; - GLint IndexShift, IndexOffset; - - /* Pixel Maps */ - /* Note: actual pixel maps are not part of this attrib group */ - GLboolean MapColorFlag; - GLboolean MapStencilFlag; - - /* There are multiple color table stages: */ - GLboolean ColorTableEnabled[COLORTABLE_MAX]; - GLfloat ColorTableScale[COLORTABLE_MAX][4]; /**< RGBA */ - GLfloat ColorTableBias[COLORTABLE_MAX][4]; /**< RGBA */ - - /* Convolution (GL_EXT_convolution) */ - GLboolean Convolution1DEnabled; - GLboolean Convolution2DEnabled; - GLboolean Separable2DEnabled; - GLfloat ConvolutionBorderColor[3][4]; - GLenum ConvolutionBorderMode[3]; - GLfloat ConvolutionFilterScale[3][4]; /**< RGBA */ - GLfloat ConvolutionFilterBias[3][4]; /**< RGBA */ - GLfloat PostConvolutionScale[4]; /**< RGBA */ - GLfloat PostConvolutionBias[4]; /**< RGBA */ - - /* Color matrix (GL_SGI_color_matrix) */ - /* Note: the color matrix is not part of this attrib group */ - GLfloat PostColorMatrixScale[4]; /**< RGBA */ - GLfloat PostColorMatrixBias[4]; /**< RGBA */ - - /* Histogram & minmax (GL_EXT_histogram) */ - /* Note: histogram and minmax data are not part of this attrib group */ - GLboolean HistogramEnabled; - GLboolean MinMaxEnabled; - - /*--- End Pixel Transfer State ---*/ - - /* Pixel Zoom */ - GLfloat ZoomX, ZoomY; - - /** GL_SGI_texture_color_table */ - GLfloat TextureColorTableScale[4]; - GLfloat TextureColorTableBias[4]; -}; - - -/** - * Point attribute group (GL_POINT_BIT). - */ -struct gl_point_attrib -{ - GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */ - GLfloat Size; /**< User-specified point size */ - GLfloat Params[3]; /**< GL_EXT_point_parameters */ - GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */ - GLfloat Threshold; /**< GL_EXT_point_parameters */ - GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */ - GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */ - GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /**< GL_ARB_point_sprite */ - GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */ - GLenum SpriteOrigin; /**< GL_ARB_point_sprite */ -}; - - -/** - * Polygon attribute group (GL_POLYGON_BIT). - */ -struct gl_polygon_attrib -{ - GLenum FrontFace; /**< Either GL_CW or GL_CCW */ - GLenum FrontMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ - GLenum BackMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ - GLboolean _FrontBit; /**< 0=GL_CCW, 1=GL_CW */ - GLboolean CullFlag; /**< Culling on/off flag */ - GLboolean SmoothFlag; /**< True if GL_POLYGON_SMOOTH is enabled */ - GLboolean StippleFlag; /**< True if GL_POLYGON_STIPPLE is enabled */ - GLenum CullFaceMode; /**< Culling mode GL_FRONT or GL_BACK */ - GLfloat OffsetFactor; /**< Polygon offset factor, from user */ - GLfloat OffsetUnits; /**< Polygon offset units, from user */ - GLboolean OffsetPoint; /**< Offset in GL_POINT mode */ - GLboolean OffsetLine; /**< Offset in GL_LINE mode */ - GLboolean OffsetFill; /**< Offset in GL_FILL mode */ -}; - - -/** - * Scissor attributes (GL_SCISSOR_BIT). - */ -struct gl_scissor_attrib -{ - GLboolean Enabled; /**< Scissor test enabled? */ - GLint X, Y; /**< Lower left corner of box */ - GLsizei Width, Height; /**< Size of box */ -}; - - -/** - * Stencil attribute group (GL_STENCIL_BUFFER_BIT). - * - * Three sets of stencil data are tracked so that OpenGL 2.0, - * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported - * simultaneously. In each of the stencil state arrays, element 0 corresponds - * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / - * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the - * GL_EXT_stencil_two_side GL_BACK state. - * - * The derived value \c _BackFace is either 1 or 2 depending on whether or - * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. - * - * The derived value \c _TestTwoSide is set when the front-face and back-face - * stencil state are different. - */ -struct gl_stencil_attrib -{ - GLboolean Enabled; /**< Enabled flag */ - GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ - GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ - GLboolean _TestTwoSide; - GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ - GLenum Function[3]; /**< Stencil function */ - GLenum FailFunc[3]; /**< Fail function */ - GLenum ZPassFunc[3]; /**< Depth buffer pass function */ - GLenum ZFailFunc[3]; /**< Depth buffer fail function */ - GLint Ref[3]; /**< Reference value */ - GLuint ValueMask[3]; /**< Value mask */ - GLuint WriteMask[3]; /**< Write mask */ - GLuint Clear; /**< Clear value */ -}; - - -#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ - -/** - * An index for each type of texture object - */ -/*@{*/ -#define TEXTURE_1D_INDEX 0 -#define TEXTURE_2D_INDEX 1 -#define TEXTURE_3D_INDEX 2 -#define TEXTURE_CUBE_INDEX 3 -#define TEXTURE_RECT_INDEX 4 -#define TEXTURE_1D_ARRAY_INDEX 5 -#define TEXTURE_2D_ARRAY_INDEX 6 -/*@}*/ - -/** - * Bit flags for each type of texture object - * Used for Texture.Unit[]._ReallyEnabled flags. - */ -/*@{*/ -#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) -#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) -#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) -#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) -#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX) -#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) -#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) -/*@}*/ - - -/** - * TexGenEnabled flags. - */ -/*@{*/ -#define S_BIT 1 -#define T_BIT 2 -#define R_BIT 4 -#define Q_BIT 8 -/*@}*/ - - -/** - * Bit flag versions of the corresponding GL_ constants. - */ -/*@{*/ -#define TEXGEN_SPHERE_MAP 0x1 -#define TEXGEN_OBJ_LINEAR 0x2 -#define TEXGEN_EYE_LINEAR 0x4 -#define TEXGEN_REFLECTION_MAP_NV 0x8 -#define TEXGEN_NORMAL_MAP_NV 0x10 - -#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \ - TEXGEN_REFLECTION_MAP_NV | \ - TEXGEN_NORMAL_MAP_NV) -#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \ - TEXGEN_REFLECTION_MAP_NV | \ - TEXGEN_NORMAL_MAP_NV | \ - TEXGEN_EYE_LINEAR) -/*@}*/ - - -/* A selection of state flags to make driver and module's lives easier. */ -#define ENABLE_TEXGEN0 0x1 -#define ENABLE_TEXGEN1 0x2 -#define ENABLE_TEXGEN2 0x4 -#define ENABLE_TEXGEN3 0x8 -#define ENABLE_TEXGEN4 0x10 -#define ENABLE_TEXGEN5 0x20 -#define ENABLE_TEXGEN6 0x40 -#define ENABLE_TEXGEN7 0x80 - -#define ENABLE_TEXMAT0 0x1 /* Ie. not the identity matrix */ -#define ENABLE_TEXMAT1 0x2 -#define ENABLE_TEXMAT2 0x4 -#define ENABLE_TEXMAT3 0x8 -#define ENABLE_TEXMAT4 0x10 -#define ENABLE_TEXMAT5 0x20 -#define ENABLE_TEXMAT6 0x40 -#define ENABLE_TEXMAT7 0x80 - -#define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i)) -#define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i)) - - -/** - * Texel fetch function prototype. We use texel fetch functions to - * extract RGBA, color indexes and depth components out of 1D, 2D and 3D - * texture images. These functions help to isolate us from the gritty - * details of all the various texture image encodings. - * - * \param texImage texture image. - * \param col texel column. - * \param row texel row. - * \param img texel image level/layer. - * \param texelOut output texel (up to 4 GLchans) - */ -typedef void (*FetchTexelFuncC)( const struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - GLchan *texelOut ); - -/** - * As above, but returns floats. - * Used for depth component images and for upcoming signed/float - * texture images. - */ -typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - GLfloat *texelOut ); - - -typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - const void *texel); - - -/** - * This macro defines the (many) parameters to the texstore functions. - * \param dims either 1 or 2 or 3 - * \param baseInternalFormat user-specified base internal format - * \param dstFormat destination Mesa texture format - * \param dstAddr destination image address - * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels - * \param dstRowStride destination image row stride, in bytes - * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels - * \param srcWidth/Height/Depth source image size, in pixels - * \param srcFormat incoming image format - * \param srcType incoming image data type - * \param srcAddr source image address - * \param srcPacking source image packing parameters - */ -#define TEXSTORE_PARAMS \ - GLcontext *ctx, GLuint dims, \ - GLenum baseInternalFormat, \ - const struct gl_texture_format *dstFormat, \ - GLvoid *dstAddr, \ - GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \ - GLint dstRowStride, const GLuint *dstImageOffsets, \ - GLint srcWidth, GLint srcHeight, GLint srcDepth, \ - GLenum srcFormat, GLenum srcType, \ - const GLvoid *srcAddr, \ - const struct gl_pixelstore_attrib *srcPacking - - - -/** - * Texture image storage function. - */ -typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); - - -/** - * Texture format record - */ -struct gl_texture_format -{ - GLint MesaFormat; /**< One of the MESA_FORMAT_* values */ - - GLenum BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, - * GL_LUMINANCE, GL_LUMINANCE_ALPHA, - * GL_INTENSITY, GL_COLOR_INDEX or - * GL_DEPTH_COMPONENT. - */ - GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */ - - /** - * Bits per texel component. These are just rough approximations - * for compressed texture formats. - */ - /*@{*/ - GLubyte RedBits; - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte LuminanceBits; - GLubyte IntensityBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; /**< GL_EXT_packed_depth_stencil */ - /*@}*/ - - GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ - - StoreTexImageFunc StoreImage; - - /** - * \name Texel fetch function pointers - */ - /*@{*/ - FetchTexelFuncC FetchTexel1D; - FetchTexelFuncC FetchTexel2D; - FetchTexelFuncC FetchTexel3D; - FetchTexelFuncF FetchTexel1Df; - FetchTexelFuncF FetchTexel2Df; - FetchTexelFuncF FetchTexel3Df; - /*@}*/ - - StoreTexelFunc StoreTexel; -}; - - -/** - * Texture image state. Describes the dimensions of a texture image, - * the texel format and pointers to Texel Fetch functions. - */ -struct gl_texture_image -{ - GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, - * GL_LUMINANCE, GL_LUMINANCE_ALPHA, - * GL_INTENSITY, GL_COLOR_INDEX, - * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT - * only. Used for choosing TexEnv arithmetic. - */ - GLint InternalFormat; /**< Internal format as given by the user */ - GLuint Border; /**< 0 or 1 */ - GLuint Width; /**< = 2^WidthLog2 + 2*Border */ - GLuint Height; /**< = 2^HeightLog2 + 2*Border */ - GLuint Depth; /**< = 2^DepthLog2 + 2*Border */ - GLuint Width2; /**< = Width - 2*Border */ - GLuint Height2; /**< = Height - 2*Border */ - GLuint Depth2; /**< = Depth - 2*Border */ - GLuint WidthLog2; /**< = log2(Width2) */ - GLuint HeightLog2; /**< = log2(Height2) */ - GLuint DepthLog2; /**< = log2(Depth2) */ - GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */ - GLfloat WidthScale; /**< used for mipmap LOD computation */ - GLfloat HeightScale; /**< used for mipmap LOD computation */ - GLfloat DepthScale; /**< used for mipmap LOD computation */ - GLboolean IsClientData; /**< Data owned by client? */ - GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ - - const struct gl_texture_format *TexFormat; - - struct gl_texture_object *TexObject; /**< Pointer back to parent object */ - - FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ - FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ - - GLboolean IsCompressed; /**< GL_ARB_texture_compression */ - GLuint CompressedSize; /**< GL_ARB_texture_compression */ - - GLuint RowStride; /**< Padded width in units of texels */ - GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to - each 2D slice in 'Data', in texels */ - GLvoid *Data; /**< Image data, accessed via FetchTexel() */ - - /** - * \name For device driver: - */ - /*@{*/ - void *DriverData; /**< Arbitrary device driver data */ - /*@}*/ -}; - - -/** - * Indexes for cube map faces. - */ -/*@{*/ -#define FACE_POS_X 0 -#define FACE_NEG_X 1 -#define FACE_POS_Y 2 -#define FACE_NEG_Y 3 -#define FACE_POS_Z 4 -#define FACE_NEG_Z 5 -#define MAX_FACES 6 -/*@}*/ - - -/** - * Texture object state. Contains the array of mipmap images, border color, - * wrap modes, filter modes, shadow/texcompare state, and the per-texture - * color palette. - */ -struct gl_texture_object -{ - _glthread_Mutex Mutex; /**< for thread safety */ - GLint RefCount; /**< reference count */ - GLuint Name; /**< the user-visible texture object ID */ - GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ - GLfloat Priority; /**< in [0,1] */ - GLfloat BorderColor[4]; /**< unclamped */ - GLchan _BorderChan[4]; /**< clamped, as GLchan */ - GLenum WrapS; /**< S-axis texture image wrap mode */ - GLenum WrapT; /**< T-axis texture image wrap mode */ - GLenum WrapR; /**< R-axis texture image wrap mode */ - GLenum MinFilter; /**< minification filter */ - GLenum MagFilter; /**< magnification filter */ - GLfloat MinLod; /**< min lambda, OpenGL 1.2 */ - GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */ - GLfloat LodBias; /**< OpenGL 1.4 */ - GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ - GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ - GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLboolean CompareFlag; /**< GL_SGIX_shadow */ - GLenum CompareOperator; /**< GL_SGIX_shadow */ - GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ - GLenum CompareMode; /**< GL_ARB_shadow */ - GLenum CompareFunc; /**< GL_ARB_shadow */ - GLenum _Function; /**< Comparison function derived from - * \c CompareOperator, \c CompareMode, and - * \c CompareFunc. - */ - GLenum DepthMode; /**< GL_ARB_depth_texture */ - GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ - GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ - GLint CropRect[4]; /**< GL_OES_draw_texture */ - GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLboolean _Complete; /**< Is texture object complete? */ - - /** Actual texture images, indexed by [cube face] and [mipmap level] */ - struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; - - /** GL_EXT_paletted_texture */ - struct gl_color_table Palette; - - /** - * \name For device driver. - * Note: instead of attaching driver data to this pointer, it's preferable - * to instead use this struct as a base class for your own texture object - * class. Driver->NewTextureObject() can be used to implement the - * allocation. - */ - void *DriverData; /**< Arbitrary device driver data */ -}; - - -/** - * Texture combine environment state. - * - * \todo - * If GL_NV_texture_env_combine4 is ever supported, the arrays in this - * structure will need to be expanded for 4 elements. - */ -struct gl_tex_env_combine_state -{ - GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum SourceRGB[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum SourceA[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum OperandRGB[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ - GLenum OperandA[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ - GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ - GLuint ScaleShiftA; /**< 0, 1 or 2 */ - GLuint _NumArgsRGB; /**< Number of inputs used for the combine mode. */ - GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */ -}; - - -/** - * Texture unit state. Contains enable flags, texture environment/function/ - * combiners, texgen state, pointers to current texture objects and - * post-filter color tables. - */ -struct gl_texture_unit -{ - GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */ - GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */ - - GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ - GLfloat EnvColor[4]; - GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ - /** \name Tex coord generation mode - * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */ - /*@{*/ - GLenum GenModeS; - GLenum GenModeT; - GLenum GenModeR; - GLenum GenModeQ; - /*@}*/ - GLbitfield _GenBitS; - GLbitfield _GenBitT; - GLbitfield _GenBitR; - GLbitfield _GenBitQ; - GLbitfield _GenFlags; /**< bitwise or of _GenBit[STRQ] */ - GLfloat ObjectPlaneS[4]; - GLfloat ObjectPlaneT[4]; - GLfloat ObjectPlaneR[4]; - GLfloat ObjectPlaneQ[4]; - GLfloat EyePlaneS[4]; - GLfloat EyePlaneT[4]; - GLfloat EyePlaneR[4]; - GLfloat EyePlaneQ[4]; - GLfloat LodBias; /**< for biasing mipmap levels */ - - /** - * \name GL_EXT_texture_env_combine - */ - struct gl_tex_env_combine_state Combine; - - /** - * Derived state based on \c EnvMode and the \c BaseFormat of the - * currently enabled texture. - */ - struct gl_tex_env_combine_state _EnvMode; - - /** - * Currently enabled combiner state. This will point to either - * \c Combine or \c _EnvMode. - */ - struct gl_tex_env_combine_state *_CurrentCombine; - - /** Current texture object pointers */ - struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS]; - - /** Points to highest priority, complete and enabled texture object */ - struct gl_texture_object *_Current; - - /** GL_SGI_texture_color_table */ - /*@{*/ - struct gl_color_table ColorTable; - struct gl_color_table ProxyColorTable; - GLboolean ColorTableEnabled; - /*@}*/ -}; - - - -/** - * Texture attribute group (GL_TEXTURE_BIT). - */ -struct gl_texture_attrib -{ - /** - * name multitexture - */ - /**@{*/ - GLuint CurrentUnit; /**< Active texture unit [0, MaxTextureImageUnits-1] */ - GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */ - GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */ - GLbitfield _GenFlags; /**< for texgen */ - GLbitfield _TexGenEnabled; - GLbitfield _TexMatEnabled; - /**@}*/ - - struct gl_texture_unit Unit[MAX_TEXTURE_UNITS]; - - /** Proxy texture objects */ - struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; - - /** GL_EXT_shared_texture_palette */ - GLboolean SharedPalette; - struct gl_color_table Palette; -}; - - -/** - * Transformation attribute group (GL_TRANSFORM_BIT). - */ -struct gl_transform_attrib -{ - GLenum MatrixMode; /**< Matrix mode */ - GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */ - GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */ - GLbitfield ClipPlanesEnabled; /**< on/off bitmask */ - GLboolean Normalize; /**< Normalize all normals? */ - GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ - GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ - - GLboolean CullVertexFlag; /**< True if GL_CULL_VERTEX_EXT is enabled */ - GLfloat CullEyePos[4]; - GLfloat CullObjPos[4]; -}; - - -/** - * Viewport attribute group (GL_VIEWPORT_BIT). - */ -struct gl_viewport_attrib -{ - GLint X, Y; /**< position */ - GLsizei Width, Height; /**< size */ - GLfloat Near, Far; /**< Depth buffer range */ - GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */ -}; - - -/** - * Node for the attribute stack. - */ -struct gl_attrib_node -{ - GLbitfield kind; - void *data; - struct gl_attrib_node *next; -}; - - -/** - * GL_ARB_vertex/pixel_buffer_object buffer object - */ -struct gl_buffer_object -{ - GLint RefCount; - GLuint Name; - GLenum Usage; - GLenum Access; - GLvoid *Pointer; /**< Only valid while buffer is mapped */ - GLsizeiptrARB Size; /**< Size of storage in bytes */ - GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ - GLboolean OnCard; /**< Is buffer in VRAM? (hardware drivers) */ -}; - - - -/** - * Client pixel packing/unpacking attributes - */ -struct gl_pixelstore_attrib -{ - GLint Alignment; - GLint RowLength; - GLint SkipPixels; - GLint SkipRows; - GLint ImageHeight; /**< for GL_EXT_texture3D */ - GLint SkipImages; /**< for GL_EXT_texture3D */ - GLboolean SwapBytes; - GLboolean LsbFirst; - GLboolean ClientStorage; /**< GL_APPLE_client_storage */ - GLboolean Invert; /**< GL_MESA_pack_invert */ - struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */ -}; - - - -/** - * Client vertex array attributes - */ -struct gl_client_array -{ - GLint Size; /**< components per element (1,2,3,4) */ - GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ - GLsizei Stride; /**< user-specified stride */ - GLsizei StrideB; /**< actual stride in bytes */ - const GLubyte *Ptr; /**< Points to array data */ - GLboolean Enabled; /**< Enabled flag is a boolean */ - GLboolean Normalized; /**< GL_ARB_vertex_program */ - - /**< GL_ARB_vertex_buffer_object */ - struct gl_buffer_object *BufferObj; - GLuint _MaxElement; -}; - - -/** - * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object - * extension, but a nice encapsulation in any case. - */ -struct gl_array_object -{ - /** Name of the array object as received from glGenVertexArrayAPPLE. */ - GLuint Name; - - /** Conventional vertex arrays */ - /*@{*/ - struct gl_client_array Vertex; - struct gl_client_array Normal; - struct gl_client_array Color; - struct gl_client_array SecondaryColor; - struct gl_client_array FogCoord; - struct gl_client_array Index; - struct gl_client_array EdgeFlag; - struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; - struct gl_client_array PointSize; - /*@}*/ - - /** Generic arrays for vertex programs/shaders */ - struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; - - /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */ - GLbitfield _Enabled; -}; - - -/** - * Vertex array state - */ -struct gl_array_attrib -{ - struct gl_array_object *ArrayObj; - struct gl_array_object *DefaultArrayObj; - - GLint ActiveTexture; /**< Client Active Texture */ - GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ - GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ - - GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */ - -#if FEATURE_ARB_vertex_buffer_object - struct gl_buffer_object *NullBufferObj; - struct gl_buffer_object *ArrayBufferObj; - struct gl_buffer_object *ElementArrayBufferObj; -#endif - GLuint _MaxElement; /* Min of all enabled array's maxes */ -}; - - -/** - * Feedback buffer state - */ -struct gl_feedback -{ - GLenum Type; - GLbitfield _Mask; /* FB_* bits */ - GLfloat *Buffer; - GLuint BufferSize; - GLuint Count; -}; - - -/** - * Selection buffer state - */ -struct gl_selection -{ - GLuint *Buffer; /**< selection buffer */ - GLuint BufferSize; /**< size of the selection buffer */ - GLuint BufferCount; /**< number of values in the selection buffer */ - GLuint Hits; /**< number of records in the selection buffer */ - GLuint NameStackDepth; /**< name stack depth */ - GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */ - GLboolean HitFlag; /**< hit flag */ - GLfloat HitMinZ; /**< minimum hit depth */ - GLfloat HitMaxZ; /**< maximum hit depth */ -}; - - -/** - * 1-D Evaluator control points - */ -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 */ -}; - - -/** - * 2-D Evaluator control points - */ -struct gl_2d_map -{ - GLuint Uorder; /**< Number of control points in U dimension */ - GLuint Vorder; /**< Number of control points in V dimension */ - GLfloat u1, u2, du; - GLfloat v1, v2, dv; - GLfloat *Points; /**< Points to contiguous control points */ -}; - - -/** - * All evaluator control point state - */ -struct gl_evaluators -{ - /** - * \name 1-D maps - */ - /*@{*/ - struct gl_1d_map Map1Vertex3; - struct gl_1d_map Map1Vertex4; - struct gl_1d_map Map1Index; - struct gl_1d_map Map1Color4; - struct gl_1d_map Map1Normal; - struct gl_1d_map Map1Texture1; - struct gl_1d_map Map1Texture2; - struct gl_1d_map Map1Texture3; - struct gl_1d_map Map1Texture4; - struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ - /*@}*/ - - /** - * \name 2-D maps - */ - /*@{*/ - struct gl_2d_map Map2Vertex3; - struct gl_2d_map Map2Vertex4; - struct gl_2d_map Map2Index; - struct gl_2d_map Map2Color4; - struct gl_2d_map Map2Normal; - struct gl_2d_map Map2Texture1; - struct gl_2d_map Map2Texture2; - struct gl_2d_map Map2Texture3; - struct gl_2d_map Map2Texture4; - struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */ - /*@}*/ -}; - - -/** - * Names of the various vertex/fragment program register files, etc. - * - * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) - * All values should fit in a 4-bit field. - * - * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, - * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to - * be "uniform" variables since they can only be set outside glBegin/End. - * They're also all stored in the same Parameters array. - */ -enum register_file -{ - PROGRAM_TEMPORARY = 0, /**< machine->Temporary[] */ - PROGRAM_LOCAL_PARAM = 1, /**< gl_program->LocalParams[] */ - PROGRAM_ENV_PARAM = 2, /**< gl_program->Parameters[] */ - PROGRAM_STATE_VAR = 3, /**< gl_program->Parameters[] */ - PROGRAM_INPUT = 4, /**< machine->Inputs[] */ - PROGRAM_OUTPUT = 5, /**< machine->Outputs[] */ - PROGRAM_NAMED_PARAM = 6, /**< gl_program->Parameters[] */ - PROGRAM_CONSTANT = 7, /**< gl_program->Parameters[] */ - PROGRAM_UNIFORM = 8, /**< gl_program->Parameters[] */ - PROGRAM_VARYING = 9, /**< machine->Inputs[]/Outputs[] */ - PROGRAM_WRITE_ONLY = 10, /**< A dummy, write-only register */ - PROGRAM_ADDRESS = 11, /**< machine->AddressReg */ - PROGRAM_SAMPLER = 12, /**< for shader samplers, compile-time only */ - PROGRAM_UNDEFINED = 13, /**< Invalid value */ - PROGRAM_FILE_MAX -}; - - -/** Vertex and fragment instructions */ -struct prog_instruction; -struct gl_program_parameter_list; -struct gl_uniform_list; - - -/** - * Base class for any kind of program object - */ -struct gl_program -{ - GLuint Id; - GLubyte *String; /**< Null-terminated program text */ - GLint RefCount; - GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */ - GLenum Format; /**< String encoding format */ - GLboolean Resident; - - struct prog_instruction *Instructions; - - GLbitfield InputsRead; /**< Bitmask of which input regs are read */ - GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ - GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */ - GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */ - GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */ - GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */ - GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ - - - /** Named parameters, constants, etc. from program text */ - struct gl_program_parameter_list *Parameters; - /** Numbered local parameters */ - GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; - - /** Vertex/fragment shader varying vars */ - struct gl_program_parameter_list *Varying; - /** Vertex program user-defined attributes */ - struct gl_program_parameter_list *Attributes; - - /** Map from sampler unit to texture unit (set by glUniform1i()) */ - GLubyte SamplerUnits[MAX_SAMPLERS]; - /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ - GLubyte SamplerTargets[MAX_SAMPLERS]; - - /** Logical counts */ - /*@{*/ - GLuint NumInstructions; - GLuint NumTemporaries; - GLuint NumParameters; - GLuint NumAttributes; - GLuint NumAddressRegs; - GLuint NumAluInstructions; - GLuint NumTexInstructions; - GLuint NumTexIndirections; - /*@}*/ - /** Native, actual h/w counts */ - /*@{*/ - GLuint NumNativeInstructions; - GLuint NumNativeTemporaries; - GLuint NumNativeParameters; - GLuint NumNativeAttributes; - GLuint NumNativeAddressRegs; - GLuint NumNativeAluInstructions; - GLuint NumNativeTexInstructions; - GLuint NumNativeTexIndirections; - /*@}*/ -}; - - -/** Vertex program object */ -struct gl_vertex_program -{ - struct gl_program Base; /**< base class */ - GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ - GLboolean IsPositionInvariant; - void *TnlData; /**< should probably use Base.DriverData */ -}; - - -/** Fragment program object */ -struct gl_fragment_program -{ - struct gl_program Base; /**< base class */ - GLenum FogOption; - GLboolean UsesKill; /**< shader uses KIL instruction */ - GLboolean UsesPointCoord; /**< shader uses gl_PointCoord */ - GLboolean UsesFrontFacing; /**< shader used gl_FrontFacing */ - GLboolean UsesFogFragCoord; /**< shader used gl_FogFragCoord */ -}; - - -/** - * State common to vertex and fragment programs. - */ -struct gl_program_state -{ - GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */ - const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */ -}; - - -/** - * Context state for vertex programs. - */ -struct gl_vertex_program_state -{ - GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */ - GLboolean _Enabled; /**< Enabled and _valid_ user program? */ - GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ - GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ - struct gl_vertex_program *Current; /**< User-bound vertex program */ - - /** Currently enabled and valid vertex program (including internal programs, - * user-defined vertex programs and GLSL vertex shaders). - * This is the program we must use when rendering. - */ - struct gl_vertex_program *_Current; - - GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - - /* For GL_NV_vertex_program only: */ - GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4]; - GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4]; - - /** Should fixed-function T&L be implemented with a vertex prog? */ - GLboolean _MaintainTnlProgram; - - /** Program to emulate fixed-function T&L (see above) */ - struct gl_vertex_program *_TnlProgram; - - /** Cache of fixed-function programs */ - struct gl_program_cache *Cache; - -#if FEATURE_MESA_program_debug - GLprogramcallbackMESA Callback; - GLvoid *CallbackData; - GLboolean CallbackEnabled; - GLuint CurrentPosition; -#endif -}; - - -/** - * Context state for fragment programs. - */ -struct gl_fragment_program_state -{ - GLboolean Enabled; /**< User-set fragment program enable flag */ - GLboolean _Enabled; /**< Enabled and _valid_ user program? */ - struct gl_fragment_program *Current; /**< User-bound fragment program */ - - /** Currently enabled and valid fragment program (including internal programs, - * user-defined fragment programs and GLSL fragment shaders). - * This is the program we must use when rendering. - */ - struct gl_fragment_program *_Current; - - GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - - /** Should fixed-function texturing be implemented with a fragment prog? */ - GLboolean _MaintainTexEnvProgram; - - /** Program to emulate fixed-function texture env/combine (see above) */ - struct gl_fragment_program *_TexEnvProgram; - - /** Cache of fixed-function programs */ - struct gl_program_cache *Cache; - -#if FEATURE_MESA_program_debug - GLprogramcallbackMESA Callback; - GLvoid *CallbackData; - GLboolean CallbackEnabled; - GLuint CurrentPosition; -#endif -}; - - -/** - * ATI_fragment_shader runtime state - */ -#define ATI_FS_INPUT_PRIMARY 0 -#define ATI_FS_INPUT_SECONDARY 1 - -struct atifs_instruction; -struct atifs_setupinst; - -/** - * ATI fragment shader - */ -struct ati_fragment_shader -{ - GLuint Id; - GLint RefCount; - struct atifs_instruction *Instructions[2]; - struct atifs_setupinst *SetupInst[2]; - GLfloat Constants[8][4]; - GLbitfield LocalConstDef; /** Indicates which constants have been set */ - GLubyte numArithInstr[2]; - GLubyte regsAssigned[2]; - GLubyte NumPasses; /** 1 or 2 */ - GLubyte cur_pass; - GLubyte last_optype; - GLboolean interpinp1; - GLboolean isValid; - GLuint swizzlerq; -}; - -/** - * Context state for GL_ATI_fragment_shader - */ -struct gl_ati_fragment_shader_state -{ - GLboolean Enabled; - GLboolean _Enabled; /** enabled and valid shader? */ - GLboolean Compiling; - GLfloat GlobalConstants[8][4]; - struct ati_fragment_shader *Current; -}; - - -/** - * Occlusion/timer query object. - */ -struct gl_query_object -{ - GLenum Target; /**< The query target, when active */ - GLuint Id; /**< hash table ID/name */ - GLuint64EXT Result; /**< the counter */ - GLboolean Active; /**< inside Begin/EndQuery */ - GLboolean Ready; /**< result is ready? */ -}; - - -/** - * Context state for query objects. - */ -struct gl_query_state -{ - struct _mesa_HashTable *QueryObjects; - struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */ - struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */ -}; - - -/** Set by #pragma directives */ -struct gl_sl_pragmas -{ - GLboolean Optimize; /**< defaults on */ - GLboolean Debug; /**< defaults off */ -}; - - -/** - * A GLSL vertex or fragment shader object. - */ -struct gl_shader -{ - GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER (first field!) */ - GLuint Name; /**< AKA the handle */ - GLint RefCount; /**< Reference count */ - GLboolean DeletePending; - GLboolean CompileStatus; - GLboolean Main; /**< shader defines main() */ - const GLchar *Source; /**< Source code string */ - struct gl_program *Program; /**< Post-compile assembly code */ - GLchar *InfoLog; - struct gl_sl_pragmas Pragmas; -}; - - -/** - * A GLSL program object. - * Basically a linked collection of vertex and fragment shaders. - */ -struct gl_shader_program -{ - GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */ - GLuint Name; /**< aka handle or ID */ - GLint RefCount; /**< Reference count */ - GLboolean DeletePending; - - GLuint NumShaders; /**< number of attached shaders */ - struct gl_shader **Shaders; /**< List of attached the shaders */ - - /** User-defined attribute bindings (glBindAttribLocation) */ - struct gl_program_parameter_list *Attributes; - - /* post-link info: */ - struct gl_vertex_program *VertexProgram; /**< Linked vertex program */ - struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */ - struct gl_uniform_list *Uniforms; - struct gl_program_parameter_list *Varying; - GLboolean LinkStatus; /**< GL_LINK_STATUS */ - GLboolean Validated; - GLchar *InfoLog; -}; - - -/** - * Context state for GLSL vertex/fragment shaders. - */ -struct gl_shader_state -{ - struct gl_shader_program *CurrentProgram; /**< The user-bound program */ - /** Driver-selectable options: */ - GLboolean EmitHighLevelInstructions; /**< IF/ELSE/ENDIF vs. BRA, etc. */ - GLboolean EmitCondCodes; /**< Use condition codes? */ - GLboolean EmitComments; /**< Annotated instructions */ - void *MemPool; -}; - - -/** - * State which can be shared by multiple contexts: - */ -struct gl_shared_state -{ - _glthread_Mutex Mutex; /**< for thread safety */ - GLint RefCount; /**< Reference count */ - struct _mesa_HashTable *DisplayList; /**< Display lists hash table */ - struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */ - - /** Default texture objects (shared by all texture units) */ - struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; - - /** - * \name Thread safety and statechange notification for texture - * objects. - * - * \todo Improve the granularity of locking. - */ - /*@{*/ - _glthread_Mutex TexMutex; /**< texobj thread safety */ - GLuint TextureStateStamp; /**< state notification for shared tex */ - /*@}*/ - - - /** - * \name Vertex/fragment programs - */ - /*@{*/ - struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */ -#if FEATURE_ARB_vertex_program - struct gl_vertex_program *DefaultVertexProgram; -#endif -#if FEATURE_ARB_fragment_program - struct gl_fragment_program *DefaultFragmentProgram; -#endif - /*@}*/ - -#if FEATURE_ATI_fragment_shader - struct _mesa_HashTable *ATIShaders; - struct ati_fragment_shader *DefaultFragmentShader; -#endif - -#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object - struct _mesa_HashTable *BufferObjects; -#endif - -#if FEATURE_ARB_shader_objects - /** Table of both gl_shader and gl_shader_program objects */ - struct _mesa_HashTable *ShaderObjects; -#endif - -#if FEATURE_EXT_framebuffer_object - struct _mesa_HashTable *RenderBuffers; - struct _mesa_HashTable *FrameBuffers; -#endif - - /** Objects associated with the GL_APPLE_vertex_array_object extension. */ - struct _mesa_HashTable *ArrayObjects; - - void *DriverData; /**< Device driver shared state */ -}; - - - - -/** - * A renderbuffer stores colors or depth values or stencil values. - * A framebuffer object will have a collection of these. - * Data are read/written to the buffer with a handful of Get/Put functions. - * - * Instances of this object are allocated with the Driver's NewRenderbuffer - * hook. Drivers will likely wrap this class inside a driver-specific - * class to simulate inheritance. - */ -struct gl_renderbuffer -{ -#define RB_MAGIC 0xaabbccdd - int Magic; /** XXX TEMPORARY DEBUG INFO */ - _glthread_Mutex Mutex; /**< for thread safety */ - GLuint ClassID; /**< Useful for drivers */ - GLuint Name; - GLint RefCount; - GLuint Width, Height; - GLenum InternalFormat; /**< The user-specified format */ - GLenum _ActualFormat; /**< The driver-chosen format */ - GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or - GL_STENCIL_INDEX. */ - GLenum DataType; /**< Type of values passed to the Get/Put functions */ - GLubyte RedBits; /**< Bits of red per pixel */ - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; - GLvoid *Data; /**< This may not be used by some kinds of RBs */ - - /* Used to wrap one renderbuffer around another: */ - struct gl_renderbuffer *Wrapped; - - /* Delete this renderbuffer */ - void (*Delete)(struct gl_renderbuffer *rb); - - /* Allocate new storage for this renderbuffer */ - GLboolean (*AllocStorage)(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, - GLuint width, GLuint height); - - /* Lock/Unlock are called before/after calling the Get/Put functions. - * Not sure this is the right place for these yet. - void (*Lock)(GLcontext *ctx, struct gl_renderbuffer *rb); - void (*Unlock)(GLcontext *ctx, struct gl_renderbuffer *rb); - */ - - /* Return a pointer to the element/pixel at (x,y). - * Should return NULL if the buffer memory can't be directly addressed. - */ - void *(*GetPointer)(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y); - - /* Get/Read a row of values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values); - - /* Get/Read values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetValues)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values); - - /* Put/Write a row of values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask); - - /* Put/Write a row of RGB values. This is a special-case routine that's - * only used for RGBA renderbuffers when the source data is GL_RGB. That's - * a common case for glDrawPixels and some triangle routines. - * The values will be of format GL_RGB and type DataType. - */ - void (*PutRowRGB)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask); - - - /* Put/Write a row of identical values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutMonoRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask); - - /* Put/Write values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutValues)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask); - /* Put/Write identical values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutMonoValues)(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask); -}; - - -/** - * A renderbuffer attachment point points to either a texture object - * (and specifies a mipmap level, cube face or 3D texture slice) or - * points to a renderbuffer. - */ -struct gl_renderbuffer_attachment -{ - GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */ - GLboolean Complete; - - /** - * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the - * application supplied renderbuffer object. - */ - struct gl_renderbuffer *Renderbuffer; - - /** - * If \c Type is \c GL_TEXTURE, this stores a pointer to the application - * supplied texture object. - */ - struct gl_texture_object *Texture; - GLuint TextureLevel; /**< Attached mipmap level. */ - GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ - GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D - * and 2D array textures */ -}; - - -/** - * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc). - * In C++ terms, think of this as a base class from which device drivers - * will make derived classes. - */ -struct gl_framebuffer -{ - _glthread_Mutex Mutex; /**< for thread safety */ - /** - * If zero, this is a window system framebuffer. If non-zero, this - * is a FBO framebuffer; note that for some devices (i.e. those with - * a natural pixel coordinate system for FBOs that differs from the - * OpenGL/Mesa coordinate system), this means that the viewport, - * polygon face orientation, and polygon stipple will have to be inverted. - */ - GLuint Name; - - GLint RefCount; - GLboolean DeletePending; - - GLvisual Visual; /**< The framebuffer's visual. - Immutable if this is a window system buffer. - Computed from attachments if user-made FBO. */ - - GLboolean Initialized; - - GLuint Width, Height; /**< size of frame buffer in pixels */ - - /** \name Drawing bounds (Intersection of buffer size and scissor box) */ - /*@{*/ - GLint _Xmin, _Xmax; /**< inclusive */ - GLint _Ymin, _Ymax; /**< exclusive */ - /*@}*/ - - /** \name Derived Z buffer stuff */ - /*@{*/ - GLuint _DepthMax; /**< Max depth buffer value */ - GLfloat _DepthMaxF; /**< Float max depth buffer value */ - GLfloat _MRD; /**< minimum resolvable difference in Z values */ - /*@}*/ - - GLenum _Status; /* One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ - - /* Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */ - struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT]; - - /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER - * attribute group and GL_PIXEL attribute group, respectively. - */ - GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS]; - GLenum ColorReadBuffer; - - /** Computed from ColorDraw/ReadBuffer above */ - GLuint _NumColorDrawBuffers; - GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */ - GLint _ColorReadBufferIndex; /* -1 = None */ - struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS]; - struct gl_renderbuffer *_ColorReadBuffer; - - /** The Actual depth/stencil buffers to use. May be wrappers around the - * depth/stencil buffers attached above. */ - struct gl_renderbuffer *_DepthBuffer; - struct gl_renderbuffer *_StencilBuffer; - - /** Delete this framebuffer */ - void (*Delete)(struct gl_framebuffer *fb); -}; - - -/** - * Limits for vertex and fragment programs. - */ -struct gl_program_constants -{ - /* logical limits */ - GLuint MaxInstructions; - GLuint MaxAluInstructions; /* fragment programs only, for now */ - GLuint MaxTexInstructions; /* fragment programs only, for now */ - GLuint MaxTexIndirections; /* fragment programs only, for now */ - GLuint MaxAttribs; - GLuint MaxTemps; - GLuint MaxAddressRegs; /* vertex program only, for now */ - GLuint MaxParameters; - GLuint MaxLocalParams; - GLuint MaxEnvParams; - /* native/hardware limits */ - GLuint MaxNativeInstructions; - GLuint MaxNativeAluInstructions; /* fragment programs only, for now */ - GLuint MaxNativeTexInstructions; /* fragment programs only, for now */ - GLuint MaxNativeTexIndirections; /* fragment programs only, for now */ - GLuint MaxNativeAttribs; - GLuint MaxNativeTemps; - GLuint MaxNativeAddressRegs; /* vertex program only, for now */ - GLuint MaxNativeParameters; - /* For shaders */ - GLuint MaxUniformComponents; -}; - - -/** - * Constants which may be overridden by device driver during context creation - * but are never changed after that. - */ -struct gl_constants -{ - GLint MaxTextureLevels; /**< Maximum number of allowed mipmap levels. */ - GLint Max3DTextureLevels; /**< Maximum number of allowed mipmap levels for 3D texture targets. */ - GLint MaxCubeTextureLevels; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */ - GLint MaxArrayTextureLayers; /**< Maximum number of layers in an array texture. */ - GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */ - GLuint MaxTextureCoordUnits; - GLuint MaxTextureImageUnits; - GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ - GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ - GLuint MaxArrayLockSize; - GLint SubPixelBits; - GLfloat MinPointSize, MaxPointSize; /* aliased */ - GLfloat MinPointSizeAA, MaxPointSizeAA; /* antialiased */ - GLfloat PointSizeGranularity; - GLfloat MinLineWidth, MaxLineWidth; /* aliased */ - GLfloat MinLineWidthAA, MaxLineWidthAA; /* antialiased */ - GLfloat LineWidthGranularity; - GLuint MaxColorTableSize; - GLuint MaxConvolutionWidth; - GLuint MaxConvolutionHeight; - GLuint MaxClipPlanes; - GLuint MaxLights; - GLfloat MaxShininess; /* GL_NV_light_max_exponent */ - GLfloat MaxSpotExponent; /* GL_NV_light_max_exponent */ - GLuint MaxViewportWidth, MaxViewportHeight; - struct gl_program_constants VertexProgram; /* GL_ARB_vertex_program */ - struct gl_program_constants FragmentProgram; /* GL_ARB_fragment_program */ - /* shared by vertex and fragment program: */ - GLuint MaxProgramMatrices; - GLuint MaxProgramMatrixStackDepth; - /* vertex array / buffer object bounds checking */ - GLboolean CheckArrayBounds; - /* GL_ARB_draw_buffers */ - GLuint MaxDrawBuffers; - /* GL_OES_read_format */ - GLenum ColorReadFormat; - GLenum ColorReadType; - /* GL_EXT_framebuffer_object */ - GLuint MaxColorAttachments; - GLuint MaxRenderbufferSize; - /* GL_ARB_vertex_shader */ - GLuint MaxVertexTextureImageUnits; - GLuint MaxVarying; /**< Number of float[4] vectors */ -}; - - -/** - * Enable flag for each OpenGL extension. Different device drivers will - * enable different extensions at runtime. - */ -struct gl_extensions -{ - /** - * \name Flags to quickly test if certain extensions are available. - * - * Not every extension needs to have such a flag, but it's encouraged. - */ - /*@{*/ - GLboolean dummy; /* don't remove this! */ - GLboolean ARB_depth_texture; - GLboolean ARB_draw_buffers; - GLboolean ARB_fragment_program; - GLboolean ARB_fragment_program_shadow; - GLboolean ARB_fragment_shader; - GLboolean ARB_half_float_pixel; - GLboolean ARB_imaging; - GLboolean ARB_multisample; - GLboolean ARB_multitexture; - GLboolean ARB_occlusion_query; - GLboolean ARB_point_sprite; - GLboolean ARB_shader_objects; - GLboolean ARB_shading_language_100; - GLboolean ARB_shading_language_120; - GLboolean ARB_shadow; - GLboolean ARB_texture_border_clamp; - GLboolean ARB_texture_compression; - GLboolean ARB_texture_cube_map; - GLboolean ARB_texture_env_combine; - GLboolean ARB_texture_env_crossbar; - GLboolean ARB_texture_env_dot3; - GLboolean ARB_texture_float; - GLboolean ARB_texture_mirrored_repeat; - GLboolean ARB_texture_non_power_of_two; - GLboolean ARB_transpose_matrix; - GLboolean ARB_vertex_buffer_object; - GLboolean ARB_vertex_program; - GLboolean ARB_vertex_shader; - GLboolean ARB_window_pos; - GLboolean EXT_abgr; - GLboolean EXT_bgra; - GLboolean EXT_blend_color; - GLboolean EXT_blend_equation_separate; - GLboolean EXT_blend_func_separate; - GLboolean EXT_blend_logic_op; - GLboolean EXT_blend_minmax; - GLboolean EXT_blend_subtract; - GLboolean EXT_clip_volume_hint; - GLboolean EXT_cull_vertex; - GLboolean EXT_convolution; - GLboolean EXT_compiled_vertex_array; - GLboolean EXT_copy_texture; - GLboolean EXT_depth_bounds_test; - GLboolean EXT_draw_range_elements; - GLboolean EXT_framebuffer_object; - GLboolean EXT_fog_coord; - GLboolean EXT_framebuffer_blit; - GLboolean EXT_gpu_program_parameters; - GLboolean EXT_histogram; - GLboolean EXT_multi_draw_arrays; - GLboolean EXT_paletted_texture; - GLboolean EXT_packed_depth_stencil; - GLboolean EXT_packed_pixels; - GLboolean EXT_pixel_buffer_object; - GLboolean EXT_point_parameters; - GLboolean EXT_polygon_offset; - GLboolean EXT_rescale_normal; - GLboolean EXT_shadow_funcs; - GLboolean EXT_secondary_color; - GLboolean EXT_separate_specular_color; - GLboolean EXT_shared_texture_palette; - GLboolean EXT_stencil_wrap; - GLboolean EXT_stencil_two_side; - GLboolean EXT_subtexture; - GLboolean EXT_texture; - GLboolean EXT_texture_object; - GLboolean EXT_texture3D; - GLboolean EXT_texture_compression_s3tc; - GLboolean EXT_texture_env_add; - GLboolean EXT_texture_env_combine; - GLboolean EXT_texture_env_dot3; - GLboolean EXT_texture_filter_anisotropic; - GLboolean EXT_texture_lod_bias; - GLboolean EXT_texture_mirror_clamp; - GLboolean EXT_texture_sRGB; - GLboolean EXT_timer_query; - GLboolean EXT_vertex_array; - GLboolean EXT_vertex_array_set; - /* vendor extensions */ - GLboolean APPLE_client_storage; - GLboolean APPLE_packed_pixels; - GLboolean APPLE_vertex_array_object; - GLboolean ATI_texture_mirror_once; - GLboolean ATI_texture_env_combine3; - GLboolean ATI_fragment_shader; - GLboolean ATI_separate_stencil; - GLboolean IBM_rasterpos_clip; - GLboolean IBM_multimode_draw_arrays; - GLboolean MESA_pack_invert; - GLboolean MESA_packed_depth_stencil; - GLboolean MESA_program_debug; - GLboolean MESA_resize_buffers; - GLboolean MESA_ycbcr_texture; - GLboolean MESA_texture_array; - GLboolean NV_blend_square; - GLboolean NV_fragment_program; - GLboolean NV_light_max_exponent; - GLboolean NV_point_sprite; - GLboolean NV_texgen_reflection; - GLboolean NV_texture_rectangle; - GLboolean NV_vertex_program; - GLboolean NV_vertex_program1_1; - GLboolean OES_read_format; - GLboolean SGI_color_matrix; - GLboolean SGI_color_table; - GLboolean SGI_texture_color_table; - GLboolean SGIS_generate_mipmap; - GLboolean SGIS_texture_edge_clamp; - GLboolean SGIS_texture_lod; - GLboolean SGIX_shadow; - GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */ - GLboolean TDFX_texture_compression_FXT1; - GLboolean S3_s3tc; - /*@}*/ - /* The extension string */ - const GLubyte *String; -}; - - -/** - * A stack of matrices (projection, modelview, color, texture, etc). - */ -struct gl_matrix_stack -{ - GLmatrix *Top; /**< points into Stack */ - GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */ - GLuint Depth; /**< 0 <= Depth < MaxDepth */ - GLuint MaxDepth; /**< size of Stack[] array */ - GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */ -}; - - -/** - * \name Bits for image transfer operations - * - * \sa __GLcontextRec::ImageTransferState. - */ -/*@{*/ -#define IMAGE_SCALE_BIAS_BIT 0x1 -#define IMAGE_SHIFT_OFFSET_BIT 0x2 -#define IMAGE_MAP_COLOR_BIT 0x4 -#define IMAGE_COLOR_TABLE_BIT 0x8 -#define IMAGE_CONVOLUTION_BIT 0x10 -#define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20 -#define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40 -#define IMAGE_COLOR_MATRIX_BIT 0x80 -#define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100 -#define IMAGE_HISTOGRAM_BIT 0x200 -#define IMAGE_MIN_MAX_BIT 0x400 -#define IMAGE_CLAMP_BIT 0x800 /* extra */ - - -/** Pixel Transfer ops up to convolution */ -#define IMAGE_PRE_CONVOLUTION_BITS (IMAGE_SCALE_BIAS_BIT | \ - IMAGE_SHIFT_OFFSET_BIT | \ - IMAGE_MAP_COLOR_BIT | \ - IMAGE_COLOR_TABLE_BIT) - -/** Pixel transfer ops after convolution */ -#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \ - IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \ - IMAGE_COLOR_MATRIX_BIT | \ - IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT |\ - IMAGE_HISTOGRAM_BIT | \ - IMAGE_MIN_MAX_BIT) -/*@}*/ - - -/** - * \name Bits to indicate what state has changed. - * - * 4 unused flags. - */ -/*@{*/ -#define _NEW_MODELVIEW 0x1 /**< __GLcontextRec::ModelView */ -#define _NEW_PROJECTION 0x2 /**< __GLcontextRec::Projection */ -#define _NEW_TEXTURE_MATRIX 0x4 /**< __GLcontextRec::TextureMatrix */ -#define _NEW_COLOR_MATRIX 0x8 /**< __GLcontextRec::ColorMatrix */ -#define _NEW_ACCUM 0x10 /**< __GLcontextRec::Accum */ -#define _NEW_COLOR 0x20 /**< __GLcontextRec::Color */ -#define _NEW_DEPTH 0x40 /**< __GLcontextRec::Depth */ -#define _NEW_EVAL 0x80 /**< __GLcontextRec::Eval, __GLcontextRec::EvalMap */ -#define _NEW_FOG 0x100 /**< __GLcontextRec::Fog */ -#define _NEW_HINT 0x200 /**< __GLcontextRec::Hint */ -#define _NEW_LIGHT 0x400 /**< __GLcontextRec::Light */ -#define _NEW_LINE 0x800 /**< __GLcontextRec::Line */ -#define _NEW_PIXEL 0x1000 /**< __GLcontextRec::Pixel */ -#define _NEW_POINT 0x2000 /**< __GLcontextRec::Point */ -#define _NEW_POLYGON 0x4000 /**< __GLcontextRec::Polygon */ -#define _NEW_POLYGONSTIPPLE 0x8000 /**< __GLcontextRec::PolygonStipple */ -#define _NEW_SCISSOR 0x10000 /**< __GLcontextRec::Scissor */ -#define _NEW_STENCIL 0x20000 /**< __GLcontextRec::Stencil */ -#define _NEW_TEXTURE 0x40000 /**< __GLcontextRec::Texture */ -#define _NEW_TRANSFORM 0x80000 /**< __GLcontextRec::Transform */ -#define _NEW_VIEWPORT 0x100000 /**< __GLcontextRec::Viewport */ -#define _NEW_PACKUNPACK 0x200000 /**< __GLcontextRec::Pack, __GLcontextRec::Unpack */ -#define _NEW_ARRAY 0x400000 /**< __GLcontextRec::Array */ -#define _NEW_RENDERMODE 0x800000 /**< __GLcontextRec::RenderMode, __GLcontextRec::Feedback, __GLcontextRec::Select */ -#define _NEW_BUFFERS 0x1000000 /**< __GLcontextRec::Visual, __GLcontextRec::DrawBuffer, */ -#define _NEW_MULTISAMPLE 0x2000000 /**< __GLcontextRec::Multisample */ -#define _NEW_TRACK_MATRIX 0x4000000 /**< __GLcontextRec::VertexProgram */ -#define _NEW_PROGRAM 0x8000000 /**< __GLcontextRec::VertexProgram */ -#define _NEW_ALL ~0 -/*@}*/ - - -/** - * \name Bits to track array state changes - * - * Also used to summarize array enabled. - */ -/*@{*/ -#define _NEW_ARRAY_VERTEX VERT_BIT_POS -#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT -#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL -#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0 -#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1 -#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG -#define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX -#define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG -#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */ -#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0 -#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1 -#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2 -#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3 -#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4 -#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5 -#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6 -#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7 -#define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */ -#define _NEW_ARRAY_ALL 0xffffffff - - -#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i)) -#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i)) -/*@}*/ - - - -/** - * \name A bunch of flags that we think might be useful to drivers. - * - * Set in the __GLcontextRec::_TriangleCaps bitfield. - */ -/*@{*/ -#define DD_FLATSHADE 0x1 -#define DD_SEPARATE_SPECULAR 0x2 -#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */ -#define DD_TRI_LIGHT_TWOSIDE 0x8 -#define DD_TRI_UNFILLED 0x10 -#define DD_TRI_SMOOTH 0x20 -#define DD_TRI_STIPPLE 0x40 -#define DD_TRI_OFFSET 0x80 -#define DD_LINE_SMOOTH 0x100 -#define DD_LINE_STIPPLE 0x200 -#define DD_LINE_WIDTH 0x400 -#define DD_POINT_SMOOTH 0x800 -#define DD_POINT_SIZE 0x1000 -#define DD_POINT_ATTEN 0x2000 -#define DD_TRI_TWOSTENCIL 0x4000 -/*@}*/ - - -/** - * \name Define the state changes under which each of these bits might change - */ -/*@{*/ -#define _DD_NEW_FLATSHADE _NEW_LIGHT -#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM) -#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON -#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT -#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON -#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON -#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON -#define _DD_NEW_TRI_OFFSET _NEW_POLYGON -#define _DD_NEW_LINE_SMOOTH _NEW_LINE -#define _DD_NEW_LINE_STIPPLE _NEW_LINE -#define _DD_NEW_LINE_WIDTH _NEW_LINE -#define _DD_NEW_POINT_SMOOTH _NEW_POINT -#define _DD_NEW_POINT_SIZE _NEW_POINT -#define _DD_NEW_POINT_ATTEN _NEW_POINT -/*@}*/ - - -#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ - _NEW_TEXTURE | \ - _NEW_POINT | \ - _NEW_PROGRAM | \ - _NEW_MODELVIEW) - -#define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ - _NEW_TEXTURE) - -#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX) - - - - -/* - * Forward declaration of display list data types: - */ -union node; -typedef union node Node; - - -/* This has to be included here. */ -#include "dd.h" - - -#define NUM_VERTEX_FORMAT_ENTRIES (sizeof(GLvertexformat) / sizeof(void *)) - -/** - * Core Mesa's support for tnl modules: - */ -struct gl_tnl_module -{ - /** - * Vertex format to be lazily swapped into current dispatch. - */ - const GLvertexformat *Current; - - /** - * \name Record of functions swapped out. - * On restore, only need to swap these functions back in. - */ - /*@{*/ - struct { - _glapi_proc * location; - _glapi_proc function; - } Swapped[NUM_VERTEX_FORMAT_ENTRIES]; - GLuint SwapCount; - /*@}*/ -}; - -/* Strictly this is a tnl/ private concept, but it doesn't seem - * worthwhile adding a tnl private structure just to hold this one bit - * of information: - */ -#define MESA_DLIST_DANGLING_REFS 0x1 - -/* Provide a location where information about a display list can be - * collected. Could be extended with driverPrivate structures, - * etc. in the future. - */ -struct mesa_display_list -{ - Node *node; - GLuint id; - GLbitfield flags; -}; - - -/** - * State used during display list compilation and execution. - */ -struct gl_dlist_state -{ - GLuint CallDepth; /**< Current recursion calling depth */ - - struct mesa_display_list *CurrentList; - Node *CurrentListPtr; /**< Head of list being compiled */ - GLuint CurrentListNum; /**< Number of the list being compiled */ - Node *CurrentBlock; /**< Pointer to current block of nodes */ - GLuint CurrentPos; /**< Index into current block of nodes */ - - GLvertexformat ListVtxfmt; - - GLubyte ActiveAttribSize[VERT_ATTRIB_MAX]; - GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4]; - - GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX]; - GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4]; - - GLubyte ActiveIndex; - GLfloat CurrentIndex; - - GLubyte ActiveEdgeFlag; - GLboolean CurrentEdgeFlag; -}; - - -/** - * Mesa rendering context. - * - * This is the central context data structure for Mesa. Almost all - * OpenGL state is contained in this structure. - * Think of this as a base class from which device drivers will derive - * sub classes. - * - * The GLcontext typedef names this structure. - */ -struct __GLcontextRec -{ - /** State possibly shared with other contexts in the address space */ - struct gl_shared_state *Shared; - - /** \name API function pointer tables */ - /*@{*/ - struct _glapi_table *Save; /**< Display list save functions */ - struct _glapi_table *Exec; /**< Execute functions */ - struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */ - /*@}*/ - - GLvisual Visual; - GLframebuffer *DrawBuffer; /**< buffer for writing */ - GLframebuffer *ReadBuffer; /**< buffer for reading */ - GLframebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */ - GLframebuffer *WinSysReadBuffer; /**< set with MakeCurrent */ - - /** - * Device driver function pointer table - */ - struct dd_function_table Driver; - - void *DriverCtx; /**< Points to device driver context/state */ - - /** Core/Driver constants */ - struct gl_constants Const; - - /** \name The various 4x4 matrix stacks */ - /*@{*/ - struct gl_matrix_stack ModelviewMatrixStack; - struct gl_matrix_stack ProjectionMatrixStack; - struct gl_matrix_stack ColorMatrixStack; - struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; - struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; - struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ - /*@}*/ - - /** Combined modelview and projection matrix */ - GLmatrix _ModelProjectMatrix; - - /** \name Display lists */ - struct gl_dlist_state ListState; - - GLboolean ExecuteFlag; /**< Execute GL commands? */ - GLboolean CompileFlag; /**< Compile GL commands into display list? */ - - /** Extension information */ - struct gl_extensions Extensions; - - /** \name State attribute stack (for glPush/PopAttrib) */ - /*@{*/ - GLuint AttribStackDepth; - struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH]; - /*@}*/ - - /** \name Renderer attribute groups - * - * We define a struct for each attribute group to make pushing and popping - * attributes easy. Also it's a good organization. - */ - /*@{*/ - struct gl_accum_attrib Accum; /**< Accum buffer attributes */ - struct gl_colorbuffer_attrib Color; /**< Color buffer attributes */ - struct gl_current_attrib Current; /**< Current attributes */ - struct gl_depthbuffer_attrib Depth; /**< Depth buffer attributes */ - struct gl_eval_attrib Eval; /**< Eval attributes */ - struct gl_fog_attrib Fog; /**< Fog attributes */ - struct gl_hint_attrib Hint; /**< Hint attributes */ - struct gl_light_attrib Light; /**< Light attributes */ - struct gl_line_attrib Line; /**< Line attributes */ - struct gl_list_attrib List; /**< List attributes */ - struct gl_multisample_attrib Multisample; - struct gl_pixel_attrib Pixel; /**< Pixel attributes */ - struct gl_point_attrib Point; /**< Point attributes */ - struct gl_polygon_attrib Polygon; /**< Polygon attributes */ - GLuint PolygonStipple[32]; /**< Polygon stipple */ - struct gl_scissor_attrib Scissor; /**< Scissor attributes */ - struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */ - struct gl_texture_attrib Texture; /**< Texture attributes */ - struct gl_transform_attrib Transform; /**< Transformation attributes */ - struct gl_viewport_attrib Viewport; /**< Viewport attributes */ - /*@}*/ - - /** \name Client attribute stack */ - /*@{*/ - GLuint ClientAttribStackDepth; - struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH]; - /*@}*/ - - /** \name Client attribute groups */ - /*@{*/ - struct gl_array_attrib Array; /**< Vertex arrays */ - struct gl_pixelstore_attrib Pack; /**< Pixel packing */ - struct gl_pixelstore_attrib Unpack; /**< Pixel unpacking */ - struct gl_pixelstore_attrib DefaultPacking; /**< Default params */ - /*@}*/ - - /** \name Other assorted state (not pushed/popped on attribute stack) */ - /*@{*/ - struct gl_pixelmaps PixelMaps; - struct gl_histogram_attrib Histogram; - struct gl_minmax_attrib MinMax; - struct gl_convolution_attrib Convolution1D; - struct gl_convolution_attrib Convolution2D; - struct gl_convolution_attrib Separable2D; - - struct gl_evaluators EvalMap; /**< All evaluators */ - struct gl_feedback Feedback; /**< Feedback */ - struct gl_selection Select; /**< Selection */ - - struct gl_color_table ColorTable[COLORTABLE_MAX]; - struct gl_color_table ProxyColorTable[COLORTABLE_MAX]; -#if 0 - struct gl_color_table PostConvolutionColorTable; - struct gl_color_table ProxyPostConvolutionColorTable; - struct gl_color_table PostColorMatrixColorTable; - struct gl_color_table ProxyPostColorMatrixColorTable; -#endif - - struct gl_program_state Program; /**< for vertex or fragment progs */ - struct gl_vertex_program_state VertexProgram; /**< GL_ARB/NV_vertex_program */ - struct gl_fragment_program_state FragmentProgram; /**< GL_ARB/NV_vertex_program */ - struct gl_ati_fragment_shader_state ATIFragmentShader; /**< GL_ATI_fragment_shader */ - - struct gl_query_state Query; /**< GL_ARB_occlusion_query */ - - struct gl_shader_state Shader; /**< GLSL shader object state */ - /*@}*/ - -#if FEATURE_EXT_framebuffer_object - struct gl_renderbuffer *CurrentRenderbuffer; -#endif - - GLenum ErrorValue; /**< Last error code */ - GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ - GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ - - GLboolean ViewportInitialized; /**< has viewport size been initialized? */ - - /** \name Derived state */ - /*@{*/ - /** Bitwise-or of DD_* flags. Note that this bitfield may be used before - * state validation so they need to always be current. - */ - GLbitfield _TriangleCaps; - GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ - GLfloat _EyeZDir[3]; - GLfloat _ModelViewInvScale; - GLboolean _NeedEyeCoords; - GLboolean _ForceEyeCoords; - GLenum _CurrentProgram; /* currently executing program */ - - GLuint TextureStateTimestamp; /* detect changes to shared state */ - - struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */ - struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ - /**@}*/ - - struct gl_list_extensions ListExt; /**< driver dlist extensions */ - - /** \name For debugging/development only */ - /*@{*/ - GLboolean FirstTimeCurrent; - /*@}*/ - - /** Dither disable via MESA_NO_DITHER env var */ - GLboolean NoDither; - - /** software compression/decompression supported or not */ - GLboolean Mesa_DXTn; - - /** Core tnl module support */ - struct gl_tnl_module TnlModule; - - /** - * \name Hooks for module contexts. - * - * These will eventually live in the driver or elsewhere. - */ - /*@{*/ - void *swrast_context; - void *swsetup_context; - void *swtnl_context; - void *swtnl_im; - void *acache_context; - void *aelt_context; - /*@}*/ -}; - - -/** The string names for GL_POINT, GL_LINE_LOOP, etc */ -extern const char *_mesa_prim_name[GL_POLYGON+4]; - - -#ifdef DEBUG -extern int MESA_VERBOSE; -extern int MESA_DEBUG_FLAGS; -# define MESA_FUNCTION __FUNCTION__ -#else -# define MESA_VERBOSE 0 -# define MESA_DEBUG_FLAGS 0 -# define MESA_FUNCTION "a function" -# ifndef NDEBUG -# define NDEBUG -# endif -#endif - - -enum _verbose -{ - VERBOSE_VARRAY = 0x0001, - VERBOSE_TEXTURE = 0x0002, - VERBOSE_IMMEDIATE = 0x0004, - VERBOSE_PIPELINE = 0x0008, - VERBOSE_DRIVER = 0x0010, - VERBOSE_STATE = 0x0020, - VERBOSE_API = 0x0040, - VERBOSE_DISPLAY_LIST = 0x0100, - VERBOSE_LIGHTING = 0x0200, - VERBOSE_PRIMS = 0x0400, - VERBOSE_VERTS = 0x0800, - VERBOSE_DISASSEM = 0x1000, - VERBOSE_GLSL = 0x2000, - VERBOSE_GLSL_DUMP = 0x4000 -}; - - -enum _debug -{ - DEBUG_ALWAYS_FLUSH = 0x1 -}; - - - -#define Elements(x) sizeof(x)/sizeof(*(x)) - - -#endif /* TYPES_H */ diff --git a/src/libs/mesa/mesa/main/multisample.c b/src/libs/mesa/mesa/main/multisample.c deleted file mode 100644 index b9cfad9216..0000000000 --- a/src/libs/mesa/mesa/main/multisample.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/multisample.h" - - -/** - * Called via glSampleCoverageARB - */ -void GLAPIENTRY -_mesa_SampleCoverageARB(GLclampf value, GLboolean invert) -{ - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->Extensions.ARB_multisample) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB"); - return; - } - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); - - ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0); - ctx->Multisample.SampleCoverageInvert = invert; - ctx->NewState |= _NEW_MULTISAMPLE; -} - - -/** - * Initialize the context's multisample state. - * \param ctx the GL context. - */ -void -_mesa_init_multisample(GLcontext *ctx) -{ - ctx->Multisample.Enabled = GL_TRUE; - ctx->Multisample.SampleAlphaToCoverage = GL_FALSE; - ctx->Multisample.SampleAlphaToOne = GL_FALSE; - ctx->Multisample.SampleCoverage = GL_FALSE; - ctx->Multisample.SampleCoverageValue = 1.0; - ctx->Multisample.SampleCoverageInvert = GL_FALSE; -} diff --git a/src/libs/mesa/mesa/main/multisample.h b/src/libs/mesa/mesa/main/multisample.h deleted file mode 100644 index 4305900cc4..0000000000 --- a/src/libs/mesa/mesa/main/multisample.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 MULTISAMPLE_H -#define MULTISAMPLE_H - - -extern void GLAPIENTRY -_mesa_SampleCoverageARB(GLclampf value, GLboolean invert); - - -extern void -_mesa_init_multisample(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/main/pixel.c b/src/libs/mesa/mesa/main/pixel.c deleted file mode 100644 index 8d24a201f0..0000000000 --- a/src/libs/mesa/mesa/main/pixel.c +++ /dev/null @@ -1,922 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file pixel.c - * Pixel transfer functions (glPixelZoom, glPixelMap, glPixelTransfer) - */ - -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "context.h" -#include "image.h" -#include "macros.h" -#include "pixel.h" -#include "mtypes.h" - - -/**********************************************************************/ -/***** glPixelZoom *****/ -/**********************************************************************/ - -void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) -{ - GET_CURRENT_CONTEXT(ctx); - - if (ctx->Pixel.ZoomX == xfactor && - ctx->Pixel.ZoomY == yfactor) - return; - - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.ZoomX = xfactor; - ctx->Pixel.ZoomY = yfactor; -} - - - -/**********************************************************************/ -/***** glPixelMap *****/ -/**********************************************************************/ - -/** - * Return pointer to a pixelmap by name. - */ -static struct gl_pixelmap * -get_pixelmap(GLcontext *ctx, GLenum map) -{ - switch (map) { - case GL_PIXEL_MAP_I_TO_I: - return &ctx->PixelMaps.ItoI; - case GL_PIXEL_MAP_S_TO_S: - return &ctx->PixelMaps.StoS; - case GL_PIXEL_MAP_I_TO_R: - return &ctx->PixelMaps.ItoR; - case GL_PIXEL_MAP_I_TO_G: - return &ctx->PixelMaps.ItoG; - case GL_PIXEL_MAP_I_TO_B: - return &ctx->PixelMaps.ItoB; - case GL_PIXEL_MAP_I_TO_A: - return &ctx->PixelMaps.ItoA; - case GL_PIXEL_MAP_R_TO_R: - return &ctx->PixelMaps.RtoR; - case GL_PIXEL_MAP_G_TO_G: - return &ctx->PixelMaps.GtoG; - case GL_PIXEL_MAP_B_TO_B: - return &ctx->PixelMaps.BtoB; - case GL_PIXEL_MAP_A_TO_A: - return &ctx->PixelMaps.AtoA; - default: - return NULL; - } -} - - -/** - * Helper routine used by the other _mesa_PixelMap() functions. - */ -static void -store_pixelmap(GLcontext *ctx, GLenum map, GLsizei mapsize, - const GLfloat *values) -{ - GLint i; - struct gl_pixelmap *pm = get_pixelmap(ctx, map); - if (!pm) { - _mesa_error(ctx, GL_INVALID_ENUM, "glPixelMap(map)"); - return; - } - - switch (map) { - case GL_PIXEL_MAP_S_TO_S: - /* special case */ - ctx->PixelMaps.StoS.Size = mapsize; - for (i = 0; i < mapsize; i++) { - ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]); - } - break; - case GL_PIXEL_MAP_I_TO_I: - /* special case */ - ctx->PixelMaps.ItoI.Size = mapsize; - for (i = 0; i < mapsize; i++) { - ctx->PixelMaps.ItoI.Map[i] = values[i]; - } - break; - default: - /* general case */ - pm->Size = mapsize; - for (i = 0; i < mapsize; i++) { - GLfloat val = CLAMP(values[i], 0.0F, 1.0F); - pm->Map[i] = val; - pm->Map8[i] = (GLint) (val * 255.0F); - } - } -} - - -void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - /* XXX someday, test against ctx->Const.MaxPixelMapTableSize */ - if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); - return; - } - - if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { - /* test that mapsize is a power of two */ - if (!_mesa_is_pow_two(mapsize)) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); - return; - } - } - - FLUSH_VERTICES(ctx, _NEW_PIXEL); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack pixelmap from PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Unpack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Unpack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_FLOAT, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapfv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapfv(PBO is mapped)"); - return; - } - values = (const GLfloat *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - store_pixelmap(ctx, map, mapsize, values); - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } -} - - -void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) -{ - GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); - return; - } - - if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { - /* test that mapsize is a power of two */ - if (!_mesa_is_pow_two(mapsize)) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); - return; - } - } - - FLUSH_VERTICES(ctx, _NEW_PIXEL); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack pixelmap from PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Unpack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Unpack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_UNSIGNED_INT, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapuiv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapuiv(PBO is mapped)"); - return; - } - values = (const GLuint *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - /* convert to floats */ - if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) { - GLint i; - for (i = 0; i < mapsize; i++) { - fvalues[i] = (GLfloat) values[i]; - } - } - else { - GLint i; - for (i = 0; i < mapsize; i++) { - fvalues[i] = UINT_TO_FLOAT( values[i] ); - } - } - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - store_pixelmap(ctx, map, mapsize, fvalues); -} - - -void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) -{ - GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" ); - return; - } - - if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { - /* test that mapsize is a power of two */ - if (!_mesa_is_pow_two(mapsize)) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); - return; - } - } - - FLUSH_VERTICES(ctx, _NEW_PIXEL); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack pixelmap from PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Unpack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Unpack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_UNSIGNED_SHORT, - values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapusv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapusv(PBO is mapped)"); - return; - } - values = (const GLushort *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - /* convert to floats */ - if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) { - GLint i; - for (i = 0; i < mapsize; i++) { - fvalues[i] = (GLfloat) values[i]; - } - } - else { - GLint i; - for (i = 0; i < mapsize; i++) { - fvalues[i] = USHORT_TO_FLOAT( values[i] ); - } - } - - if (ctx->Unpack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - - store_pixelmap(ctx, map, mapsize, fvalues); -} - - -void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint mapsize, i; - const struct gl_pixelmap *pm; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - pm = get_pixelmap(ctx, map); - if (!pm) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)"); - return; - } - - mapsize = pm->Size; - - if (ctx->Pack.BufferObj->Name) { - /* pack pixelmap into PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Pack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Pack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_FLOAT, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapfv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapfv(PBO is mapped)"); - return; - } - values = (GLfloat *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - if (map == GL_PIXEL_MAP_S_TO_S) { - /* special case */ - for (i = 0; i < mapsize; i++) { - values[i] = (GLfloat) ctx->PixelMaps.StoS.Map[i]; - } - } - else { - MEMCPY(values, pm->Map, mapsize * sizeof(GLfloat)); - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - -void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint mapsize, i; - const struct gl_pixelmap *pm; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - pm = get_pixelmap(ctx, map); - if (!pm) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)"); - return; - } - mapsize = pm->Size; - - if (ctx->Pack.BufferObj->Name) { - /* pack pixelmap into PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Pack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Pack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_UNSIGNED_INT, values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapuiv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapuiv(PBO is mapped)"); - return; - } - values = (GLuint *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - if (map == GL_PIXEL_MAP_S_TO_S) { - /* special case */ - MEMCPY(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); - } - else { - for (i = 0; i < mapsize; i++) { - values[i] = FLOAT_TO_UINT( pm->Map[i] ); - } - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - -void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint mapsize, i; - const struct gl_pixelmap *pm; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - pm = get_pixelmap(ctx, map); - if (!pm) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)"); - return; - } - mapsize = pm ? pm->Size : 0; - - if (ctx->Pack.BufferObj->Name) { - /* pack pixelmap into PBO */ - GLubyte *buf; - /* Note, need to use DefaultPacking and Pack's buffer object */ - ctx->DefaultPacking.BufferObj = ctx->Pack.BufferObj; - if (!_mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - GL_INTENSITY, GL_UNSIGNED_SHORT, - values)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapusv(invalid PBO access)"); - return; - } - /* restore */ - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapusv(PBO is mapped)"); - return; - } - values = (GLushort *) ADD_POINTERS(buf, values); - } - else if (!values) { - return; - } - - switch (map) { - /* special cases */ - case GL_PIXEL_MAP_I_TO_I: - for (i = 0; i < mapsize; i++) { - values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.); - } - break; - case GL_PIXEL_MAP_S_TO_S: - for (i = 0; i < mapsize; i++) { - values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.); - } - break; - default: - for (i = 0; i < mapsize; i++) { - CLAMPED_FLOAT_TO_USHORT(values[i], pm->Map[i] ); - } - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - - -/**********************************************************************/ -/***** glPixelTransfer *****/ -/**********************************************************************/ - - -/* - * Implements glPixelTransfer[fi] whether called immediately or from a - * display list. - */ -void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (pname) { - case GL_MAP_COLOR: - if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE)) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE; - break; - case GL_MAP_STENCIL: - if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE)) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE; - break; - case GL_INDEX_SHIFT: - if (ctx->Pixel.IndexShift == (GLint) param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.IndexShift = (GLint) param; - break; - case GL_INDEX_OFFSET: - if (ctx->Pixel.IndexOffset == (GLint) param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.IndexOffset = (GLint) param; - break; - case GL_RED_SCALE: - if (ctx->Pixel.RedScale == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.RedScale = param; - break; - case GL_RED_BIAS: - if (ctx->Pixel.RedBias == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.RedBias = param; - break; - case GL_GREEN_SCALE: - if (ctx->Pixel.GreenScale == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.GreenScale = param; - break; - case GL_GREEN_BIAS: - if (ctx->Pixel.GreenBias == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.GreenBias = param; - break; - case GL_BLUE_SCALE: - if (ctx->Pixel.BlueScale == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.BlueScale = param; - break; - case GL_BLUE_BIAS: - if (ctx->Pixel.BlueBias == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.BlueBias = param; - break; - case GL_ALPHA_SCALE: - if (ctx->Pixel.AlphaScale == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.AlphaScale = param; - break; - case GL_ALPHA_BIAS: - if (ctx->Pixel.AlphaBias == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.AlphaBias = param; - break; - case GL_DEPTH_SCALE: - if (ctx->Pixel.DepthScale == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.DepthScale = param; - break; - case GL_DEPTH_BIAS: - if (ctx->Pixel.DepthBias == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.DepthBias = param; - break; - case GL_POST_COLOR_MATRIX_RED_SCALE: - if (ctx->Pixel.PostColorMatrixScale[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[0] = param; - break; - case GL_POST_COLOR_MATRIX_RED_BIAS: - if (ctx->Pixel.PostColorMatrixBias[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[0] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE: - if (ctx->Pixel.PostColorMatrixScale[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[1] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS: - if (ctx->Pixel.PostColorMatrixBias[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[1] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE: - if (ctx->Pixel.PostColorMatrixScale[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[2] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS: - if (ctx->Pixel.PostColorMatrixBias[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[2] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE: - if (ctx->Pixel.PostColorMatrixScale[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[3] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS: - if (ctx->Pixel.PostColorMatrixBias[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[3] = param; - break; - case GL_POST_CONVOLUTION_RED_SCALE: - if (ctx->Pixel.PostConvolutionScale[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[0] = param; - break; - case GL_POST_CONVOLUTION_RED_BIAS: - if (ctx->Pixel.PostConvolutionBias[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[0] = param; - break; - case GL_POST_CONVOLUTION_GREEN_SCALE: - if (ctx->Pixel.PostConvolutionScale[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[1] = param; - break; - case GL_POST_CONVOLUTION_GREEN_BIAS: - if (ctx->Pixel.PostConvolutionBias[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[1] = param; - break; - case GL_POST_CONVOLUTION_BLUE_SCALE: - if (ctx->Pixel.PostConvolutionScale[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[2] = param; - break; - case GL_POST_CONVOLUTION_BLUE_BIAS: - if (ctx->Pixel.PostConvolutionBias[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[2] = param; - break; - case GL_POST_CONVOLUTION_ALPHA_SCALE: - if (ctx->Pixel.PostConvolutionScale[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionScale[3] = param; - break; - case GL_POST_CONVOLUTION_ALPHA_BIAS: - if (ctx->Pixel.PostConvolutionBias[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostConvolutionBias[3] = param; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ) -{ - _mesa_PixelTransferf( pname, (GLfloat) param ); -} - - - -/**********************************************************************/ -/***** State Management *****/ -/**********************************************************************/ - -/* - * Return a bitmask of IMAGE_*_BIT flags which to indicate which - * pixel transfer operations are enabled. - */ -static void -update_image_transfer_state(GLcontext *ctx) -{ - GLuint mask = 0; - - if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F || - ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F || - ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F || - ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F) - mask |= IMAGE_SCALE_BIAS_BIT; - - if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) - mask |= IMAGE_SHIFT_OFFSET_BIT; - - if (ctx->Pixel.MapColorFlag) - mask |= IMAGE_MAP_COLOR_BIT; - - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]) - mask |= IMAGE_COLOR_TABLE_BIT; - - if (ctx->Pixel.Convolution1DEnabled || - ctx->Pixel.Convolution2DEnabled || - ctx->Pixel.Separable2DEnabled) { - mask |= IMAGE_CONVOLUTION_BIT; - if (ctx->Pixel.PostConvolutionScale[0] != 1.0F || - ctx->Pixel.PostConvolutionScale[1] != 1.0F || - ctx->Pixel.PostConvolutionScale[2] != 1.0F || - ctx->Pixel.PostConvolutionScale[3] != 1.0F || - ctx->Pixel.PostConvolutionBias[0] != 0.0F || - ctx->Pixel.PostConvolutionBias[1] != 0.0F || - ctx->Pixel.PostConvolutionBias[2] != 0.0F || - ctx->Pixel.PostConvolutionBias[3] != 0.0F) { - mask |= IMAGE_POST_CONVOLUTION_SCALE_BIAS; - } - } - - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]) - mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT; - - if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY || - ctx->Pixel.PostColorMatrixScale[0] != 1.0F || - ctx->Pixel.PostColorMatrixBias[0] != 0.0F || - ctx->Pixel.PostColorMatrixScale[1] != 1.0F || - ctx->Pixel.PostColorMatrixBias[1] != 0.0F || - ctx->Pixel.PostColorMatrixScale[2] != 1.0F || - ctx->Pixel.PostColorMatrixBias[2] != 0.0F || - ctx->Pixel.PostColorMatrixScale[3] != 1.0F || - ctx->Pixel.PostColorMatrixBias[3] != 0.0F) - mask |= IMAGE_COLOR_MATRIX_BIT; - - if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]) - mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT; - - if (ctx->Pixel.HistogramEnabled) - mask |= IMAGE_HISTOGRAM_BIT; - - if (ctx->Pixel.MinMaxEnabled) - mask |= IMAGE_MIN_MAX_BIT; - - ctx->_ImageTransferState = mask; -} - - -/** - * Update meas pixel transfer derived state. - */ -void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) -{ - if (new_state & _NEW_COLOR_MATRIX) - _math_matrix_analyse( ctx->ColorMatrixStack.Top ); - - /* References ColorMatrix.type (derived above). - */ - if (new_state & _IMAGE_NEW_TRANSFER_STATE) - update_image_transfer_state(ctx); -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -static void -init_pixelmap(struct gl_pixelmap *map) -{ - map->Size = 1; - map->Map[0] = 0.0; - map->Map8[0] = 0; -} - - -/** - * Initialize the context's PIXEL attribute group. - */ -void -_mesa_init_pixel( GLcontext *ctx ) -{ - int i; - - /* 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.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; - init_pixelmap(&ctx->PixelMaps.StoS); - init_pixelmap(&ctx->PixelMaps.ItoI); - init_pixelmap(&ctx->PixelMaps.ItoR); - init_pixelmap(&ctx->PixelMaps.ItoG); - init_pixelmap(&ctx->PixelMaps.ItoB); - init_pixelmap(&ctx->PixelMaps.ItoA); - init_pixelmap(&ctx->PixelMaps.RtoR); - init_pixelmap(&ctx->PixelMaps.GtoG); - init_pixelmap(&ctx->PixelMaps.BtoB); - init_pixelmap(&ctx->PixelMaps.AtoA); - ctx->Pixel.HistogramEnabled = GL_FALSE; - ctx->Pixel.MinMaxEnabled = GL_FALSE; - ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0); - for (i = 0; i < COLORTABLE_MAX; i++) { - ASSIGN_4V(ctx->Pixel.ColorTableScale[i], 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.ColorTableBias[i], 0.0, 0.0, 0.0, 0.0); - ctx->Pixel.ColorTableEnabled[i] = GL_FALSE; - } - ctx->Pixel.Convolution1DEnabled = GL_FALSE; - ctx->Pixel.Convolution2DEnabled = GL_FALSE; - ctx->Pixel.Separable2DEnabled = GL_FALSE; - for (i = 0; i < 3; i++) { - ASSIGN_4V(ctx->Pixel.ConvolutionBorderColor[i], 0.0, 0.0, 0.0, 0.0); - ctx->Pixel.ConvolutionBorderMode[i] = GL_REDUCE; - ASSIGN_4V(ctx->Pixel.ConvolutionFilterScale[i], 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.ConvolutionFilterBias[i], 0.0, 0.0, 0.0, 0.0); - } - for (i = 0; i < MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_WIDTH * 4; i++) { - ctx->Convolution1D.Filter[i] = 0.0; - ctx->Convolution2D.Filter[i] = 0.0; - ctx->Separable2D.Filter[i] = 0.0; - } - ASSIGN_4V(ctx->Pixel.PostConvolutionScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.PostConvolutionBias, 0.0, 0.0, 0.0, 0.0); - /* GL_SGI_texture_color_table */ - ASSIGN_4V(ctx->Pixel.TextureColorTableScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.TextureColorTableBias, 0.0, 0.0, 0.0, 0.0); - - if (ctx->Visual.doubleBufferMode) { - ctx->Pixel.ReadBuffer = GL_BACK; - } - else { - ctx->Pixel.ReadBuffer = GL_FRONT; - } - - /* Miscellaneous */ - ctx->_ImageTransferState = 0; -} diff --git a/src/libs/mesa/mesa/main/pixel.h b/src/libs/mesa/mesa/main/pixel.h deleted file mode 100644 index cb6c5262a3..0000000000 --- a/src/libs/mesa/mesa/main/pixel.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file pixel.h - * Pixel operations. - */ - - -#ifndef PIXEL_H -#define PIXEL_H - - -#include "mtypes.h" - - -/** \name API functions */ -/*@{*/ - -extern void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); - -extern void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); - -extern void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); - -/*@}*/ - - -extern void -_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); - -extern void -_mesa_init_pixel( GLcontext * ctx ); - -/*@}*/ - -#endif diff --git a/src/libs/mesa/mesa/main/pixelstore.c b/src/libs/mesa/mesa/main/pixelstore.c deleted file mode 100644 index ff1a6344cc..0000000000 --- a/src/libs/mesa/mesa/main/pixelstore.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file pixelstore.c - * glPixelStore functions. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "context.h" -#include "image.h" -#include "macros.h" -#include "pixelstore.h" -#include "mtypes.h" - - -void GLAPIENTRY -_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(ctx); - - switch (pname) { - case GL_PACK_SWAP_BYTES: - if (param == (GLint)ctx->Pack.SwapBytes) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; - break; - case GL_PACK_LSB_FIRST: - if (param == (GLint)ctx->Pack.LsbFirst) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE; - break; - case GL_PACK_ROW_LENGTH: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.RowLength == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.RowLength = param; - break; - case GL_PACK_IMAGE_HEIGHT: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.ImageHeight == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.ImageHeight = param; - break; - case GL_PACK_SKIP_PIXELS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipPixels == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipPixels = param; - break; - case GL_PACK_SKIP_ROWS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipRows == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipRows = param; - break; - case GL_PACK_SKIP_IMAGES: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipImages == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipImages = param; - break; - case GL_PACK_ALIGNMENT: - if (param!=1 && param!=2 && param!=4 && param!=8) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.Alignment == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.Alignment = param; - break; - case GL_PACK_INVERT_MESA: - if (!ctx->Extensions.MESA_pack_invert) { - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" ); - return; - } - if (ctx->Pack.Invert == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.Invert = param; - break; - - case GL_UNPACK_SWAP_BYTES: - if (param == (GLint)ctx->Unpack.SwapBytes) - return; - if ((GLint)ctx->Unpack.SwapBytes == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE; - break; - case GL_UNPACK_LSB_FIRST: - if (param == (GLint)ctx->Unpack.LsbFirst) - return; - if ((GLint)ctx->Unpack.LsbFirst == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE; - break; - case GL_UNPACK_ROW_LENGTH: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.RowLength == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.RowLength = param; - break; - case GL_UNPACK_IMAGE_HEIGHT: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.ImageHeight == param) - return; - - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.ImageHeight = param; - break; - case GL_UNPACK_SKIP_PIXELS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipPixels == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipPixels = param; - break; - case GL_UNPACK_SKIP_ROWS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipRows == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipRows = param; - break; - case GL_UNPACK_SKIP_IMAGES: - if (param < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipImages == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipImages = param; - break; - case GL_UNPACK_ALIGNMENT: - if (param!=1 && param!=2 && param!=4 && param!=8) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore" ); - return; - } - if (ctx->Unpack.Alignment == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.Alignment = param; - break; - case GL_UNPACK_CLIENT_STORAGE_APPLE: - if (param == (GLint)ctx->Unpack.ClientStorage) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" ); - return; - } -} - - -void GLAPIENTRY -_mesa_PixelStoref( GLenum pname, GLfloat param ) -{ - _mesa_PixelStorei( pname, (GLint) param ); -} - - - -/** - * Initialize the context's pixel store state. - */ -void -_mesa_init_pixelstore( GLcontext *ctx ) -{ - /* 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->Pack.ClientStorage = GL_FALSE; - ctx->Pack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Pack.BufferObj = ctx->Array.NullBufferObj; -#endif - 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; - ctx->Unpack.ClientStorage = GL_FALSE; - ctx->Unpack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; -#endif - - /* - * _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 parameters to these values! - */ - ctx->DefaultPacking.Alignment = 1; - ctx->DefaultPacking.RowLength = 0; - ctx->DefaultPacking.SkipPixels = 0; - ctx->DefaultPacking.SkipRows = 0; - ctx->DefaultPacking.ImageHeight = 0; - ctx->DefaultPacking.SkipImages = 0; - ctx->DefaultPacking.SwapBytes = GL_FALSE; - ctx->DefaultPacking.LsbFirst = GL_FALSE; - ctx->DefaultPacking.ClientStorage = GL_FALSE; - ctx->DefaultPacking.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; -#endif -} diff --git a/src/libs/mesa/mesa/main/pixelstore.h b/src/libs/mesa/mesa/main/pixelstore.h deleted file mode 100644 index ee963f9ba3..0000000000 --- a/src/libs/mesa/mesa/main/pixelstore.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file pixelstore.h - * glPixelStore functions. - */ - - -#ifndef PIXELSTORE_H -#define PIXELSTORE_H - - -#include "glheader.h" - - -extern void GLAPIENTRY -_mesa_PixelStorei( GLenum pname, GLint param ); - - -extern void GLAPIENTRY -_mesa_PixelStoref( GLenum pname, GLfloat param ); - - -extern void -_mesa_init_pixelstore( GLcontext *ctx ); - - -#endif diff --git a/src/libs/mesa/mesa/main/points.c b/src/libs/mesa/mesa/main/points.c deleted file mode 100644 index 4c8fc1f72e..0000000000 --- a/src/libs/mesa/mesa/main/points.c +++ /dev/null @@ -1,263 +0,0 @@ -/** - * \file points.c - * Point operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "points.h" -#include "texstate.h" -#include "mtypes.h" - - -/** - * Set current point size. - * \param size point diameter in pixels - * \sa glPointSize(). - */ -void GLAPIENTRY -_mesa_PointSize( GLfloat size ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (size <= 0.0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPointSize" ); - return; - } - - if (ctx->Point.Size == size) - return; - - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.Size = size; - - if (ctx->Driver.PointSize) - ctx->Driver.PointSize(ctx, size); -} - - -#if _HAVE_FULL_GL - - -void GLAPIENTRY -_mesa_PointParameteri( GLenum pname, GLint param ) -{ - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); -} - - -void GLAPIENTRY -_mesa_PointParameteriv( GLenum pname, const GLint *params ) -{ - GLfloat p[3]; - p[0] = (GLfloat) params[0]; - if (pname == GL_DISTANCE_ATTENUATION_EXT) { - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - } - _mesa_PointParameterfv(pname, p); -} - - -void GLAPIENTRY -_mesa_PointParameterf( GLenum pname, GLfloat param) -{ - _mesa_PointParameterfv(pname, ¶m); -} - - -void GLAPIENTRY -_mesa_PointParameterfv( GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (pname) { - case GL_DISTANCE_ATTENUATION_EXT: - if (ctx->Extensions.EXT_point_parameters) { - if (TEST_EQ_3V(ctx->Point.Params, params)) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - COPY_3V(ctx->Point.Params, params); - ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || - ctx->Point.Params[1] != 0.0 || - ctx->Point.Params[2] != 0.0); - - if (ctx->Point._Attenuated) - ctx->_TriangleCaps |= DD_POINT_ATTEN; - else - ctx->_TriangleCaps &= ~DD_POINT_ATTEN; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - case GL_POINT_SIZE_MIN_EXT: - if (ctx->Extensions.EXT_point_parameters) { - if (params[0] < 0.0F) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glPointParameterf[v]{EXT,ARB}(param)" ); - return; - } - if (ctx->Point.MinSize == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.MinSize = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - case GL_POINT_SIZE_MAX_EXT: - if (ctx->Extensions.EXT_point_parameters) { - if (params[0] < 0.0F) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glPointParameterf[v]{EXT,ARB}(param)" ); - return; - } - if (ctx->Point.MaxSize == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.MaxSize = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - if (ctx->Extensions.EXT_point_parameters) { - if (params[0] < 0.0F) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glPointParameterf[v]{EXT,ARB}(param)" ); - return; - } - if (ctx->Point.Threshold == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.Threshold = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - case GL_POINT_SPRITE_R_MODE_NV: - /* This is one area where ARB_point_sprite and NV_point_sprite - * differ. In ARB_point_sprite the POINT_SPRITE_R_MODE is - * always ZERO. NV_point_sprite adds the S and R modes. - */ - if (ctx->Extensions.NV_point_sprite) { - GLenum value = (GLenum) params[0]; - if (value != GL_ZERO && value != GL_S && value != GL_R) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glPointParameterf[v]{EXT,ARB}(param)"); - return; - } - if (ctx->Point.SpriteRMode == value) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.SpriteRMode = value; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - case GL_POINT_SPRITE_COORD_ORIGIN: - if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) { - GLenum value = (GLenum) params[0]; - if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glPointParameterf[v]{EXT,ARB}(param)"); - return; - } - if (ctx->Point.SpriteOrigin == value) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.SpriteOrigin = value; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)"); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, - "glPointParameterf[v]{EXT,ARB}(pname)" ); - return; - } - - if (ctx->Driver.PointParameterfv) - (*ctx->Driver.PointParameterfv)(ctx, pname, params); -} -#endif - - - -/** - * Initialize the context point state. - * - * \param ctx GL context. - * - * Initializes __GLcontextRec::Point and point related constants in - * __GLcontextRec::Const. - */ -void -_mesa_init_point(GLcontext *ctx) -{ - GLuint i; - - 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 - = MAX2(ctx->Const.MaxPointSize, ctx->Const.MaxPointSizeAA); - ctx->Point.Threshold = 1.0; - ctx->Point.PointSprite = GL_FALSE; /* GL_ARB/NV_point_sprite */ - ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */ - ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */ - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB/NV_point_sprite */ - } -} diff --git a/src/libs/mesa/mesa/main/points.h b/src/libs/mesa/mesa/main/points.h deleted file mode 100644 index 156641eab9..0000000000 --- a/src/libs/mesa/mesa/main/points.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * \file points.h - * Point operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 POINTS_H -#define POINTS_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_PointSize( GLfloat size ); - -extern void GLAPIENTRY -_mesa_PointParameteri( GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_PointParameteriv( GLenum pname, const GLint *params ); - -extern void GLAPIENTRY -_mesa_PointParameterf( GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_PointParameterfv( GLenum pname, const GLfloat *params ); - -extern void -_mesa_init_point( GLcontext * ctx ); - - -#endif diff --git a/src/libs/mesa/mesa/main/polygon.c b/src/libs/mesa/mesa/main/polygon.c deleted file mode 100644 index 564250b881..0000000000 --- a/src/libs/mesa/mesa/main/polygon.c +++ /dev/null @@ -1,357 +0,0 @@ -/** - * \file polygon.c - * Polygon operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "bufferobj.h" -#include "context.h" -#include "image.h" -#include "enums.h" -#include "macros.h" -#include "polygon.h" -#include "mtypes.h" - - -/** - * Specify whether to cull front- or back-facing facets. - * - * \param mode culling mode. - * - * \sa glCullFace(). - * - * Verifies the parameter and updates gl_polygon_attrib::CullFaceMode. On - * change, flushes the vertices and notifies the driver via - * the dd_function_table::CullFace callback. - */ -void GLAPIENTRY -_mesa_CullFace( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode)); - - if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" ); - return; - } - - if (ctx->Polygon.CullFaceMode == mode) - return; - - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.CullFaceMode = mode; - - if (ctx->Driver.CullFace) - ctx->Driver.CullFace( ctx, mode ); -} - - -/** - * Define front- and back-facing - * - * \param mode orientation of front-facing polygons. - * - * \sa glFrontFace(). - * - * Verifies the parameter and updates gl_polygon_attrib::FrontFace. On change - * flushes the vertices and notifies the driver via - * the dd_function_table::FrontFace callback. - */ -void GLAPIENTRY -_mesa_FrontFace( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode)); - - if (mode!=GL_CW && mode!=GL_CCW) { - _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" ); - return; - } - - if (ctx->Polygon.FrontFace == mode) - return; - - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.FrontFace = mode; - - ctx->Polygon._FrontBit = (GLboolean) (mode == GL_CW); - - if (ctx->Driver.FrontFace) - ctx->Driver.FrontFace( ctx, mode ); -} - - -/** - * Set the polygon rasterization mode. - * - * \param face the polygons which \p mode applies to. - * \param mode how polygons should be rasterized. - * - * \sa glPolygonMode(). - * - * Verifies the parameters and updates gl_polygon_attrib::FrontMode and - * gl_polygon_attrib::BackMode. On change flushes the vertices and notifies the - * driver via the dd_function_table::PolygonMode callback. - */ -void GLAPIENTRY -_mesa_PolygonMode( GLenum face, GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glPolygonMode %s %s\n", - _mesa_lookup_enum_by_nr(face), - _mesa_lookup_enum_by_nr(mode)); - - if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) { - _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" ); - return; - } - - switch (face) { - case GL_FRONT: - if (ctx->Polygon.FrontMode == mode) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.FrontMode = mode; - break; - case GL_FRONT_AND_BACK: - if (ctx->Polygon.FrontMode == mode && - ctx->Polygon.BackMode == mode) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.FrontMode = mode; - ctx->Polygon.BackMode = mode; - break; - case GL_BACK: - if (ctx->Polygon.BackMode == mode) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.BackMode = mode; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" ); - return; - } - - if (ctx->Polygon.FrontMode == GL_FILL && ctx->Polygon.BackMode == GL_FILL) - ctx->_TriangleCaps &= ~DD_TRI_UNFILLED; - else - ctx->_TriangleCaps |= DD_TRI_UNFILLED; - - if (ctx->Driver.PolygonMode) - ctx->Driver.PolygonMode(ctx, face, mode); -} - -#if _HAVE_FULL_GL - - -/** - * This routine updates the ctx->Polygon.Stipple state. - * If we're getting the stipple data from a PBO, we map the buffer - * in order to access the data. - * In any case, we obey the current pixel unpacking parameters when fetching - * the stipple data. - * - * In the future, this routine should be used as a fallback, called via - * ctx->Driver.PolygonStipple(). We'll have to update all the DRI drivers - * too. - */ -void -_mesa_polygon_stipple(GLcontext *ctx, const GLubyte *pattern) -{ - if (ctx->Unpack.BufferObj->Name) { - /* Get/unpack the stipple pattern from a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, pattern)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPolygonStipple(bad PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - ctx->Unpack.BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPolygonStipple(PBO mapped)"); - return; - } - buf = ADD_POINTERS(buf, pattern); - _mesa_unpack_polygon_stipple(buf, ctx->PolygonStipple, &ctx->Unpack); - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - ctx->Unpack.BufferObj); - } - else { - /* Get/unpack the stipple pattern from user memory */ - _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); - } -} - - -/** - * Called by glPolygonStipple. - */ -void GLAPIENTRY -_mesa_PolygonStipple( const GLubyte *pattern ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glPolygonStipple\n"); - - FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE); - - _mesa_polygon_stipple(ctx, pattern); - - if (ctx->Driver.PolygonStipple) - ctx->Driver.PolygonStipple(ctx, pattern); -} - - -/** - * Called by glPolygonStipple. - */ -void GLAPIENTRY -_mesa_GetPolygonStipple( GLubyte *dest ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glGetPolygonStipple\n"); - - /* XXX someday we may put this code into a separate function and call - * it with ctx->Driver.GetPolygonStipple(). - */ - if (ctx->Pack.BufferObj->Name) { - /* Put/pack the stipple pattern into a PBO */ - GLubyte *buf; - if (!_mesa_validate_pbo_access(2, &ctx->Pack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, dest)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPolygonStipple(bad PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPolygonStipple(PBO mapped)"); - return; - } - buf = ADD_POINTERS(buf, dest); - _mesa_pack_polygon_stipple(ctx->PolygonStipple, buf, &ctx->Pack); - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } - else { - /* Put/pack the stipple pattern into user memory */ - _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack); - } -} - - -void GLAPIENTRY -_mesa_PolygonOffset( GLfloat factor, GLfloat units ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&VERBOSE_API) - _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units); - - if (ctx->Polygon.OffsetFactor == factor && - ctx->Polygon.OffsetUnits == units) - return; - - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetFactor = factor; - ctx->Polygon.OffsetUnits = units; - - if (ctx->Driver.PolygonOffset) - ctx->Driver.PolygonOffset( ctx, factor, units ); -} - - -void GLAPIENTRY -_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) -{ - GET_CURRENT_CONTEXT(ctx); - /* XXX mult by DepthMaxF here??? */ - _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF ); -} - -#endif - - -/**********************************************************************/ -/** \name Initialization */ -/*@{*/ - -/** - * Initialize the context polygon state. - * - * \param ctx GL context. - * - * Initializes __GLcontextRec::Polygon and __GLcontextRec::PolygonStipple - * attribute groups. - */ -void _mesa_init_polygon( GLcontext * ctx ) -{ - /* 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.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) ); -} - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/polygon.h b/src/libs/mesa/mesa/main/polygon.h deleted file mode 100644 index 78e8394d05..0000000000 --- a/src/libs/mesa/mesa/main/polygon.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * \file polygon.h - * Polygon operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 POLYGON_H -#define POLYGON_H - - -#include "mtypes.h" - - -extern void -_mesa_polygon_stipple(GLcontext *ctx, const GLubyte *pattern); - - -extern void GLAPIENTRY -_mesa_CullFace( GLenum mode ); - -extern void GLAPIENTRY -_mesa_FrontFace( GLenum mode ); - -extern void GLAPIENTRY -_mesa_PolygonMode( GLenum face, GLenum mode ); - -extern void GLAPIENTRY -_mesa_PolygonOffset( GLfloat factor, GLfloat units ); - -extern void GLAPIENTRY -_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ); - -extern void GLAPIENTRY -_mesa_PolygonStipple( const GLubyte *mask ); - -extern void GLAPIENTRY -_mesa_GetPolygonStipple( GLubyte *mask ); - -extern void -_mesa_init_polygon( GLcontext * ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/queryobj.c b/src/libs/mesa/mesa/main/queryobj.c deleted file mode 100644 index 554e0b0d18..0000000000 --- a/src/libs/mesa/mesa/main/queryobj.c +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "queryobj.h" -#include "mtypes.h" - - -/** - * Allocate a new query object. This is a fallback routine called via - * ctx->Driver.NewQueryObject(). - * \param ctx - rendering context - * \param id - the new object's ID - * \return pointer to new query_object object or NULL if out of memory. - */ -struct gl_query_object * -_mesa_new_query_object(GLcontext *ctx, GLuint id) -{ - struct gl_query_object *q = MALLOC_STRUCT(gl_query_object); - (void) ctx; - if (q) { - q->Id = id; - q->Result = 0; - q->Active = GL_FALSE; - q->Ready = GL_TRUE; /* correct, see spec */ - } - return q; -} - - -/** - * Begin a query. Software driver fallback. - * Called via ctx->Driver.BeginQuery(). - */ -void -_mesa_begin_query(GLcontext *ctx, struct gl_query_object *q) -{ - /* no-op */ -} - - -/** - * End a query. Software driver fallback. - * Called via ctx->Driver.EndQuery(). - */ -void -_mesa_end_query(GLcontext *ctx, struct gl_query_object *q) -{ - q->Ready = GL_TRUE; -} - - -/** - * Wait for query to complete. Software driver fallback. - * Called via ctx->Driver.WaitQuery(). - */ -void -_mesa_wait_query(GLcontext *ctx, struct gl_query_object *q) -{ - /* For software drivers, _mesa_end_query() should have completed the query. - * For real hardware, implement a proper WaitQuery() driver function. - */ - assert(q->Ready); -} - - -/** - * Delete a query object. Called via ctx->Driver.DeleteQuery(). - * Not removed from hash table here. - */ -void -_mesa_delete_query(GLcontext *ctx, struct gl_query_object *q) -{ - _mesa_free(q); -} - - -static struct gl_query_object * -lookup_query_object(GLcontext *ctx, GLuint id) -{ - return (struct gl_query_object *) - _mesa_HashLookup(ctx->Query.QueryObjects, id); -} - - - -void GLAPIENTRY -_mesa_GenQueriesARB(GLsizei n, GLuint *ids) -{ - GLuint first; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)"); - return; - } - - /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB"); - return; - } - - first = _mesa_HashFindFreeKeyBlock(ctx->Query.QueryObjects, n); - if (first) { - GLsizei i; - for (i = 0; i < n; i++) { - struct gl_query_object *q - = ctx->Driver.NewQueryObject(ctx, first + i); - if (!q) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB"); - return; - } - ids[i] = first + i; - _mesa_HashInsert(ctx->Query.QueryObjects, first + i, q); - } - } -} - - -void GLAPIENTRY -_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)"); - return; - } - - /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB"); - return; - } - - for (i = 0; i < n; i++) { - if (ids[i] > 0) { - struct gl_query_object *q = lookup_query_object(ctx, ids[i]); - if (q) { - ASSERT(!q->Active); /* should be caught earlier */ - _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]); - ctx->Driver.DeleteQuery(ctx, q); - } - } - } -} - - -GLboolean GLAPIENTRY -_mesa_IsQueryARB(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id && lookup_query_object(ctx, id)) - return GL_TRUE; - else - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - if (ctx->Query.CurrentOcclusionObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); - return; - } - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - if (ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); - return; - } - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - - if (id == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(id==0)"); - return; - } - - q = lookup_query_object(ctx, id); - if (!q) { - /* create new object */ - q = ctx->Driver.NewQueryObject(ctx, id); - if (!q) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQueryARB"); - return; - } - _mesa_HashInsert(ctx->Query.QueryObjects, id, q); - } - else { - /* pre-existing object */ - if (q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBeginQueryARB(query already active)"); - return; - } - } - - q->Target = target; - q->Active = GL_TRUE; - q->Result = 0; - q->Ready = GL_FALSE; - - if (target == GL_SAMPLES_PASSED_ARB) { - ctx->Query.CurrentOcclusionObject = q; - } -#if FEATURE_EXT_timer_query - else if (target == GL_TIME_ELAPSED_EXT) { - ctx->Query.CurrentTimerObject = q; - } -#endif - - ctx->Driver.BeginQuery(ctx, q); -} - - -void GLAPIENTRY -_mesa_EndQueryARB(GLenum target) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentOcclusionObject; - ctx->Query.CurrentOcclusionObject = NULL; - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentTimerObject; - ctx->Query.CurrentTimerObject = NULL; - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - - if (!q || !q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glEndQueryARB(no matching glBeginQueryARB)"); - return; - } - - q->Active = GL_FALSE; - ctx->Driver.EndQuery(ctx, q); -} - - -void GLAPIENTRY -_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentOcclusionObject; - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentTimerObject; - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); - return; - } - - switch (pname) { - case GL_QUERY_COUNTER_BITS_ARB: - *params = 8 * sizeof(q->Result); - break; - case GL_CURRENT_QUERY_ARB: - *params = q ? q->Id : 0; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectivARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0x7fffffff) { - *params = 0x7fffffff; - } - else { - *params = (GLint)q->Result; - } - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectivARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuivARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0xffffffff) { - *params = 0xffffffff; - } - else { - *params = (GLuint)q->Result; - } - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectuivARB(pname)"); - return; - } -} - - -#if FEATURE_EXT_timer_query - -/** - * New with GL_EXT_timer_query - */ -void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)"); - return; - } -} - - -/** - * New with GL_EXT_timer_query - */ -void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)"); - return; - } -} - -#endif /* FEATURE_EXT_timer_query */ - - -/** - * Allocate/init the context state related to query objects. - */ -void -_mesa_init_query(GLcontext *ctx) -{ -#if FEATURE_ARB_occlusion_query - ctx->Query.QueryObjects = _mesa_NewHashTable(); - ctx->Query.CurrentOcclusionObject = NULL; -#endif -} - - -/** - * Callback for deleting a query object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_queryobj_cb(GLuint id, void *data, void *userData) -{ - struct gl_query_object *q= (struct gl_query_object *) data; - GLcontext *ctx = (GLcontext *)userData; - ctx->Driver.DeleteQuery(ctx, q); -} - - -/** - * Free the context state related to query objects. - */ -void -_mesa_free_query_data(GLcontext *ctx) -{ - _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); - _mesa_DeleteHashTable(ctx->Query.QueryObjects); -} diff --git a/src/libs/mesa/mesa/main/queryobj.h b/src/libs/mesa/mesa/main/queryobj.h deleted file mode 100644 index 9a9774641b..0000000000 --- a/src/libs/mesa/mesa/main/queryobj.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 OCCLUDE_H -#define OCCLUDE_H - - -extern struct gl_query_object * -_mesa_new_query_object(GLcontext *ctx, GLuint id); - -extern void -_mesa_init_query(GLcontext *ctx); - -extern void -_mesa_free_query_data(GLcontext *ctx); - -extern void -_mesa_delete_query(GLcontext *ctx, struct gl_query_object *q); - -extern void -_mesa_begin_query(GLcontext *ctx, struct gl_query_object *q); - -extern void -_mesa_end_query(GLcontext *ctx, struct gl_query_object *q); - -extern void -_mesa_wait_query(GLcontext *ctx, struct gl_query_object *q); - - -extern void GLAPIENTRY -_mesa_GenQueriesARB(GLsizei n, GLuint *ids); - -extern void GLAPIENTRY -_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); - -extern GLboolean GLAPIENTRY -_mesa_IsQueryARB(GLuint id); - -extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - -extern void GLAPIENTRY -_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); - - -#endif /* OCCLUDE_H */ diff --git a/src/libs/mesa/mesa/main/rastpos.c b/src/libs/mesa/mesa/main/rastpos.c deleted file mode 100644 index 9f309d6ab8..0000000000 --- a/src/libs/mesa/mesa/main/rastpos.c +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file rastpos.c - * Raster position operations. - */ - -#include "glheader.h" -#include "context.h" -#include "feedback.h" -#include "macros.h" -#include "rastpos.h" -#include "state.h" - - -/** - * Helper function for all the RasterPos functions. - */ -static void -rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat p[4]; - - p[0] = x; - p[1] = y; - p[2] = z; - p[3] = w; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - FLUSH_CURRENT(ctx, 0); - - if (ctx->NewState) - _mesa_update_state( ctx ); - - ctx->Driver.RasterPos(ctx, p); -} - - -void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y) -{ - rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); -} - -void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y) -{ - rasterpos(x, y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y) -{ - rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y) -{ - rasterpos(x, y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) -{ - rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) -{ - rasterpos(x, y, z, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z) -{ - rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) -{ - rasterpos(x, y, z, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - rasterpos(x, y, z, w); -} - -void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) -{ - rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) -{ - rasterpos(x, y, z, w); -} - -void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v) -{ - rasterpos(v[0], v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v) -{ - rasterpos(v[0], v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v) -{ - rasterpos(v[0], v[1], v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v) -{ - rasterpos(v[0], v[1], v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v) -{ - rasterpos(v[0], v[1], v[2], v[3]); -} - -void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v) -{ - rasterpos((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v) -{ - rasterpos(v[0], v[1], v[2], v[3]); -} - - -/**********************************************************************/ -/*** GL_ARB_window_pos / GL_MESA_window_pos ***/ -/**********************************************************************/ - -#if FEATURE_drawpix -/** - * All glWindowPosMESA and glWindowPosARB commands call this function to - * update the current raster position. - */ -static void -window_pos3f(GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat z2; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - FLUSH_CURRENT(ctx, 0); - - z2 = CLAMP(z, 0.0F, 1.0F) * (ctx->Viewport.Far - ctx->Viewport.Near) - + ctx->Viewport.Near; - - /* set raster position */ - ctx->Current.RasterPos[0] = x; - ctx->Current.RasterPos[1] = y; - ctx->Current.RasterPos[2] = z2; - ctx->Current.RasterPos[3] = 1.0F; - - ctx->Current.RasterPosValid = GL_TRUE; - - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) - ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; - else - ctx->Current.RasterDistance = 0.0; - - /* raster color = current color or index */ - if (ctx->Visual.rgbMode) { - ctx->Current.RasterColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F); - ctx->Current.RasterColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F); - ctx->Current.RasterColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F); - ctx->Current.RasterColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F); - } - else { - ctx->Current.RasterIndex - = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } - - /* raster texcoord = current texcoord */ - { - GLuint texSet; - for (texSet = 0; texSet < ctx->Const.MaxTextureCoordUnits; texSet++) { - COPY_4FV( ctx->Current.RasterTexCoords[texSet], - ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] ); - } - } - - if (ctx->RenderMode==GL_SELECT) { - _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); - } -} - - -/* This is just to support the GL_MESA_window_pos version */ -static void -window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - window_pos3f(x, y, z); - ctx->Current.RasterPos[3] = w; -} - - -void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y) -{ - window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y) -{ - window_pos4f(x, y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y) -{ - window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y) -{ - window_pos4f(x, y, 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) -{ - window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) -{ - window_pos4f(x, y, z, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) -{ - window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) -{ - window_pos4f(x, y, z, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - window_pos4f(x, y, z, w); -} - -void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) -{ - window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); -} - -void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) -{ - window_pos4f(x, y, z, w); -} - -void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v) -{ - window_pos4f(v[0], v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v) -{ - window_pos4f(v[0], v[1], 0.0F, 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v) -{ - window_pos4f(v[0], v[1], v[2], 1.0); -} - -void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v) -{ - window_pos4f(v[0], v[1], v[2], 1.0F); -} - -void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v) -{ - window_pos4f(v[0], v[1], v[2], v[3]); -} - -void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v) -{ - window_pos4f((GLfloat) v[0], (GLfloat) v[1], - (GLfloat) v[2], (GLfloat) v[3]); -} - -void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v) -{ - window_pos4f(v[0], v[1], v[2], v[3]); -} - -#endif - -#if 0 - -/* - * OpenGL implementation of glWindowPos*MESA() - */ -void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - GLfloat fx, fy; - - /* Push current matrix mode and viewport attributes */ - glPushAttrib( GL_TRANSFORM_BIT | GL_VIEWPORT_BIT ); - - /* Setup projection parameters */ - glMatrixMode( GL_PROJECTION ); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - glLoadIdentity(); - - glDepthRange( z, z ); - glViewport( (int) x - 1, (int) y - 1, 2, 2 ); - - /* set the raster (window) position */ - fx = x - (int) x; - fy = y - (int) y; - glRasterPos4f( fx, fy, 0.0, w ); - - /* restore matrices, viewport and matrix mode */ - glPopMatrix(); - glMatrixMode( GL_PROJECTION ); - glPopMatrix(); - - glPopAttrib(); -} - -#endif - - -/**********************************************************************/ -/** \name Initialization */ -/**********************************************************************/ -/*@{*/ - -/** - * Initialize the context current raster position information. - * - * \param ctx GL context. - * - * Initialize the current raster position information in - * __GLcontextRec::Current, and adds the extension entry points to the - * dispatcher. - */ -void _mesa_init_rastpos( GLcontext * ctx ) -{ - int i; - - 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 ); - ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 ); - ctx->Current.RasterIndex = 1.0; - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) - ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 ); - ctx->Current.RasterPosValid = GL_TRUE; -} - -/*@}*/ diff --git a/src/libs/mesa/mesa/main/rastpos.h b/src/libs/mesa/mesa/main/rastpos.h deleted file mode 100644 index 363f86ad87..0000000000 --- a/src/libs/mesa/mesa/main/rastpos.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * \file rastpos.h - * Raster position operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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 RASTPOS_H -#define RASTPOS_H - - -#include "glheader.h" - - -extern void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v); - - -/**********************************************************************/ -/** \name GL_MESA_window_pos */ -/**********************************************************************/ -/*@{*/ - -extern void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v); - -extern void -_mesa_init_rastpos( GLcontext * ctx ); - -/*@}*/ - -#endif diff --git a/src/libs/mesa/mesa/main/rbadaptors.c b/src/libs/mesa/mesa/main/rbadaptors.c deleted file mode 100644 index c1ac0606c8..0000000000 --- a/src/libs/mesa/mesa/main/rbadaptors.c +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * Renderbuffer adaptors. - * These fuctions are used to convert rendering from core Mesa's GLchan - * colors to 8 or 16-bit color channels in RGBA renderbuffers. - * This means Mesa can be compiled for 16 or 32-bit color processing - * and still render into 8 and 16-bit/channel renderbuffers. - */ - - -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "renderbuffer.h" -#include "rbadaptors.h" - - -static void -Delete_wrapper(struct gl_renderbuffer *rb) -{ - /* Decrement reference count on the buffer we're wrapping and delete - * it if refcount hits zero. - */ - _mesa_reference_renderbuffer(&rb->Wrapped, NULL); - - /* delete myself */ - _mesa_delete_renderbuffer(rb); -} - - -static GLboolean -AllocStorage_wrapper(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, GLuint width, GLuint height) -{ - GLboolean b = rb->Wrapped->AllocStorage(ctx, rb->Wrapped, internalFormat, - width, height); - if (b) { - rb->Width = width; - rb->Height = height; - } - return b; -} - - -static void * -GetPointer_wrapper(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - (void) ctx; - (void) rb; - (void) x; - (void) y; - return NULL; -} - - -static void -GetRow_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLushort *values16 = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - ASSERT(count <= MAX_WIDTH); - - /* get 8bpp values */ - rb->Wrapped->GetRow(ctx, rb->Wrapped, count, x, y, values8); - - /* convert 8bpp to 16bpp */ - for (i = 0; i < 4 * count; i++) { - values16[i] = (values8[i] << 8) | values8[i]; - } -} - - -static void -GetValues_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLushort *values16 = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - - rb->Wrapped->GetValues(ctx, rb->Wrapped, count, x, y, values8); - - for (i = 0; i < 4 * count; i++) { - values16[i] = (values8[i] << 8) | values8[i]; - } -} - - -static void -PutRow_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLushort *values16 = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 4 * count; i++) { - values8[i] = values16[i] >> 8; - } - rb->Wrapped->PutRow(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutRowRGB_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 3]; - GLushort *values16 = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 3 * count; i++) { - values8[i] = values16[i] >> 8; - } - rb->Wrapped->PutRowRGB(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutMonoRow_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - GLubyte value8[4]; - GLushort *value16 = (GLushort *) value; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - value8[0] = value16[0] >> 8; - value8[1] = value16[1] >> 8; - value8[2] = value16[2] >> 8; - value8[3] = value16[3] >> 8; - rb->Wrapped->PutMonoRow(ctx, rb->Wrapped, count, x, y, value8, mask); -} - - -static void -PutValues_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLushort *values16 = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 4 * count; i++) { - values8[i] = values16[i] >> 8; - } - rb->Wrapped->PutValues(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutMonoValues_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - GLubyte value8[4]; - GLushort *value16 = (GLushort *) value; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - value8[0] = value16[0] >> 8; - value8[1] = value16[1] >> 8; - value8[2] = value16[2] >> 8; - value8[3] = value16[3] >> 8; - rb->Wrapped->PutMonoValues(ctx, rb->Wrapped, count, x, y, value8, mask); -} - - -/** - * Wrap an 8-bit/channel renderbuffer with a 16-bit/channel - * renderbuffer adaptor. - */ -struct gl_renderbuffer * -_mesa_new_renderbuffer_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) -{ - struct gl_renderbuffer *rb16; - - rb16 = _mesa_new_renderbuffer(ctx, rb8->Name); - if (rb16) { - ASSERT(rb8->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb8->_BaseFormat == GL_RGBA); - - _glthread_LOCK_MUTEX(rb8->Mutex); - rb8->RefCount++; - _glthread_UNLOCK_MUTEX(rb8->Mutex); - - rb16->InternalFormat = rb8->InternalFormat; - rb16->_ActualFormat = rb8->_ActualFormat; - rb16->_BaseFormat = rb8->_BaseFormat; - rb16->DataType = GL_UNSIGNED_SHORT; - /* Note: passing through underlying bits/channel */ - rb16->RedBits = rb8->RedBits; - rb16->GreenBits = rb8->GreenBits; - rb16->BlueBits = rb8->BlueBits; - rb16->AlphaBits = rb8->AlphaBits; - rb16->Wrapped = rb8; - - rb16->AllocStorage = AllocStorage_wrapper; - rb16->Delete = Delete_wrapper; - rb16->GetPointer = GetPointer_wrapper; - rb16->GetRow = GetRow_16wrap8; - rb16->GetValues = GetValues_16wrap8; - rb16->PutRow = PutRow_16wrap8; - rb16->PutRowRGB = PutRowRGB_16wrap8; - rb16->PutMonoRow = PutMonoRow_16wrap8; - rb16->PutValues = PutValues_16wrap8; - rb16->PutMonoValues = PutMonoValues_16wrap8; - } - return rb16; -} - - - - -static void -GetRow_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - ASSERT(count <= MAX_WIDTH); - - /* get 8bpp values */ - rb->Wrapped->GetRow(ctx, rb->Wrapped, count, x, y, values8); - - /* convert 8bpp to 32bpp */ - for (i = 0; i < 4 * count; i++) { - values32[i] = UBYTE_TO_FLOAT(values8[i]); - } -} - - -static void -GetValues_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - - rb->Wrapped->GetValues(ctx, rb->Wrapped, count, x, y, values8); - - for (i = 0; i < 4 * count; i++) { - values32[i] = UBYTE_TO_FLOAT(values8[i]); - } -} - - -static void -PutRow_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 4 * count; i++) { - UNCLAMPED_FLOAT_TO_UBYTE(values8[i], values32[i]); - } - rb->Wrapped->PutRow(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutRowRGB_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 3]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 3 * count; i++) { - UNCLAMPED_FLOAT_TO_UBYTE(values8[i], values32[i]); - } - rb->Wrapped->PutRowRGB(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutMonoRow_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - GLubyte value8[4]; - GLfloat *value32 = (GLfloat *) value; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - UNCLAMPED_FLOAT_TO_UBYTE(value8[0], value32[0]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[1], value32[1]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[2], value32[2]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[3], value32[3]); - rb->Wrapped->PutMonoRow(ctx, rb->Wrapped, count, x, y, value8, mask); -} - - -static void -PutValues_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - GLubyte values8[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < 4 * count; i++) { - UNCLAMPED_FLOAT_TO_UBYTE(values8[i], values32[i]); - } - rb->Wrapped->PutValues(ctx, rb->Wrapped, count, x, y, values8, mask); -} - - -static void -PutMonoValues_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - GLubyte value8[4]; - GLfloat *value32 = (GLfloat *) value; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_BYTE); - UNCLAMPED_FLOAT_TO_UBYTE(value8[0], value32[0]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[1], value32[1]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[2], value32[2]); - UNCLAMPED_FLOAT_TO_UBYTE(value8[3], value32[3]); - rb->Wrapped->PutMonoValues(ctx, rb->Wrapped, count, x, y, value8, mask); -} - - -/** - * Wrap an 8-bit/channel renderbuffer with a 32-bit/channel - * renderbuffer adaptor. - */ -struct gl_renderbuffer * -_mesa_new_renderbuffer_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) -{ - struct gl_renderbuffer *rb32; - - rb32 = _mesa_new_renderbuffer(ctx, rb8->Name); - if (rb32) { - ASSERT(rb8->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb8->_BaseFormat == GL_RGBA); - - _glthread_LOCK_MUTEX(rb8->Mutex); - rb8->RefCount++; - _glthread_UNLOCK_MUTEX(rb8->Mutex); - - rb32->InternalFormat = rb8->InternalFormat; - rb32->_ActualFormat = rb8->_ActualFormat; - rb32->_BaseFormat = rb8->_BaseFormat; - rb32->DataType = GL_FLOAT; - /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb8->RedBits; - rb32->GreenBits = rb8->GreenBits; - rb32->BlueBits = rb8->BlueBits; - rb32->AlphaBits = rb8->AlphaBits; - rb32->Wrapped = rb8; - - rb32->AllocStorage = AllocStorage_wrapper; - rb32->Delete = Delete_wrapper; - rb32->GetPointer = GetPointer_wrapper; - rb32->GetRow = GetRow_32wrap8; - rb32->GetValues = GetValues_32wrap8; - rb32->PutRow = PutRow_32wrap8; - rb32->PutRowRGB = PutRowRGB_32wrap8; - rb32->PutMonoRow = PutMonoRow_32wrap8; - rb32->PutValues = PutValues_32wrap8; - rb32->PutMonoValues = PutMonoValues_32wrap8; - } - return rb32; -} - - - - -static void -GetRow_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - GLushort values16[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - ASSERT(count <= MAX_WIDTH); - - /* get 16bpp values */ - rb->Wrapped->GetRow(ctx, rb->Wrapped, count, x, y, values16); - - /* convert 16bpp to 32bpp */ - for (i = 0; i < 4 * count; i++) { - values32[i] = USHORT_TO_FLOAT(values16[i]); - } -} - - -static void -GetValues_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLushort values16[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - - rb->Wrapped->GetValues(ctx, rb->Wrapped, count, x, y, values16); - - for (i = 0; i < 4 * count; i++) { - values32[i] = USHORT_TO_FLOAT(values16[i]); - } -} - - -static void -PutRow_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLushort values16[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < 4 * count; i++) { - UNCLAMPED_FLOAT_TO_USHORT(values16[i], values32[i]); - } - rb->Wrapped->PutRow(ctx, rb->Wrapped, count, x, y, values16, mask); -} - - -static void -PutRowRGB_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - GLushort values16[MAX_WIDTH * 3]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < 3 * count; i++) { - UNCLAMPED_FLOAT_TO_USHORT(values16[i], values32[i]); - } - rb->Wrapped->PutRowRGB(ctx, rb->Wrapped, count, x, y, values16, mask); -} - - -static void -PutMonoRow_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - GLushort value16[4]; - GLfloat *value32 = (GLfloat *) value; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - UNCLAMPED_FLOAT_TO_USHORT(value16[0], value32[0]); - UNCLAMPED_FLOAT_TO_USHORT(value16[1], value32[1]); - UNCLAMPED_FLOAT_TO_USHORT(value16[2], value32[2]); - UNCLAMPED_FLOAT_TO_USHORT(value16[3], value32[3]); - rb->Wrapped->PutMonoRow(ctx, rb->Wrapped, count, x, y, value16, mask); -} - - -static void -PutValues_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - GLushort values16[MAX_WIDTH * 4]; - GLfloat *values32 = (GLfloat *) values; - GLuint i; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < 4 * count; i++) { - UNCLAMPED_FLOAT_TO_USHORT(values16[i], values32[i]); - } - rb->Wrapped->PutValues(ctx, rb->Wrapped, count, x, y, values16, mask); -} - - -static void -PutMonoValues_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - GLushort value16[4]; - GLfloat *value32 = (GLfloat *) value; - ASSERT(rb->DataType == GL_FLOAT); - ASSERT(rb->Wrapped->DataType == GL_UNSIGNED_SHORT); - UNCLAMPED_FLOAT_TO_USHORT(value16[0], value32[0]); - UNCLAMPED_FLOAT_TO_USHORT(value16[1], value32[1]); - UNCLAMPED_FLOAT_TO_USHORT(value16[2], value32[2]); - UNCLAMPED_FLOAT_TO_USHORT(value16[3], value32[3]); - rb->Wrapped->PutMonoValues(ctx, rb->Wrapped, count, x, y, value16, mask); -} - - -/** - * Wrap an 16-bit/channel renderbuffer with a 32-bit/channel - * renderbuffer adaptor. - */ -struct gl_renderbuffer * -_mesa_new_renderbuffer_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb16) -{ - struct gl_renderbuffer *rb32; - - rb32 = _mesa_new_renderbuffer(ctx, rb16->Name); - if (rb32) { - ASSERT(rb16->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb16->_BaseFormat == GL_RGBA); - - _glthread_LOCK_MUTEX(rb16->Mutex); - rb16->RefCount++; - _glthread_UNLOCK_MUTEX(rb16->Mutex); - - rb32->InternalFormat = rb16->InternalFormat; - rb32->_ActualFormat = rb16->_ActualFormat; - rb32->_BaseFormat = rb16->_BaseFormat; - rb32->DataType = GL_FLOAT; - /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb16->RedBits; - rb32->GreenBits = rb16->GreenBits; - rb32->BlueBits = rb16->BlueBits; - rb32->AlphaBits = rb16->AlphaBits; - rb32->Wrapped = rb16; - - rb32->AllocStorage = AllocStorage_wrapper; - rb32->Delete = Delete_wrapper; - rb32->GetPointer = GetPointer_wrapper; - rb32->GetRow = GetRow_32wrap16; - rb32->GetValues = GetValues_32wrap16; - rb32->PutRow = PutRow_32wrap16; - rb32->PutRowRGB = PutRowRGB_32wrap16; - rb32->PutMonoRow = PutMonoRow_32wrap16; - rb32->PutValues = PutValues_32wrap16; - rb32->PutMonoValues = PutMonoValues_32wrap16; - } - return rb32; -} diff --git a/src/libs/mesa/mesa/main/rbadaptors.h b/src/libs/mesa/mesa/main/rbadaptors.h deleted file mode 100644 index 1d45b287dd..0000000000 --- a/src/libs/mesa/mesa/main/rbadaptors.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 RBADAPTORS_H -#define RBADAPTORS_H - - -extern struct gl_renderbuffer * -_mesa_new_renderbuffer_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8); - -extern struct gl_renderbuffer * -_mesa_new_renderbuffer_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8); - -extern struct gl_renderbuffer * -_mesa_new_renderbuffer_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb16); - - -#endif /* RBADAPTORS_H */ diff --git a/src/libs/mesa/mesa/main/readpix.c b/src/libs/mesa/mesa/main/readpix.c deleted file mode 100644 index 2326776ecb..0000000000 --- a/src/libs/mesa/mesa/main/readpix.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -#include "glheader.h" -#include "imports.h" -#include "bufferobj.h" -#include "context.h" -#include "readpix.h" -#include "framebuffer.h" -#include "image.h" -#include "state.h" - - -/** - * Do error checking of the format/type parameters to glReadPixels and - * glDrawPixels. - * \param drawing if GL_TRUE do checking for DrawPixels, else do checking - * for ReadPixels. - * \return GL_TRUE if error detected, GL_FALSE if no errors - */ -GLboolean -_mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, - GLboolean drawing) -{ - const char *readDraw = drawing ? "Draw" : "Read"; - - if (ctx->Extensions.EXT_packed_depth_stencil - && type == GL_UNSIGNED_INT_24_8_EXT - && format != GL_DEPTH_STENCIL_EXT) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw); - return GL_TRUE; - } - - /* basic combinations test */ - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "gl%sPixels(format or type)", readDraw); - return GL_TRUE; - } - - /* additional checks */ - switch (format) { - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - if (drawing && !ctx->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(drawing RGB pixels into color index buffer)"); - return GL_TRUE; - } - if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(no color buffer)"); - return GL_TRUE; - } - break; - case GL_COLOR_INDEX: - if (!drawing && ctx->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(reading color index format from RGB buffer)"); - return GL_TRUE; - } - if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(no color buffer)"); - return GL_TRUE; - } - break; - case GL_STENCIL_INDEX: - if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || - (!drawing && !_mesa_source_buffer_exists(ctx, format))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no stencil buffer)", readDraw); - return GL_TRUE; - } - break; - case GL_DEPTH_COMPONENT: - if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no depth buffer)", readDraw); - return GL_TRUE; - } - break; - case GL_DEPTH_STENCIL_EXT: - if (!ctx->Extensions.EXT_packed_depth_stencil || - type != GL_UNSIGNED_INT_24_8_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw); - return GL_TRUE; - } - if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || - (!drawing && !_mesa_source_buffer_exists(ctx, format))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no depth or stencil buffer)", readDraw); - return GL_TRUE; - } - break; - default: - /* this should have been caught in _mesa_is_legal_format_type() */ - _mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw); - return GL_TRUE; - } - - /* no errors */ - return GL_FALSE; -} - - - -void GLAPIENTRY -_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); - - FLUSH_CURRENT(ctx, 0); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glReadPixels(width=%d height=%d)", width, height ); - return; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (_mesa_error_check_format_type(ctx, format, type, GL_FALSE)) { - /* found an error */ - return; - } - - if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glReadPixels(incomplete framebuffer)" ); - return; - } - - if (!_mesa_source_buffer_exists(ctx, format)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)"); - return; - } - - if (width == 0 || height == 0) - return; /* nothing to do */ - - if (ctx->Pack.BufferObj->Name) { - if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(invalid PBO access)"); - return; - } - - if (ctx->Pack.BufferObj->Pointer) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)"); - return; - } - } - - ctx->Driver.ReadPixels(ctx, x, y, width, height, - format, type, &ctx->Pack, pixels); -} diff --git a/src/libs/mesa/mesa/main/readpix.h b/src/libs/mesa/mesa/main/readpix.h deleted file mode 100644 index 1bf02fb8e4..0000000000 --- a/src/libs/mesa/mesa/main/readpix.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 READPIXELS_H -#define READPIXELS_H - - -#include "main/mtypes.h" - - -extern GLboolean -_mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, - GLboolean drawing); - -extern void GLAPIENTRY -_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid *pixels ); - - -#endif diff --git a/src/libs/mesa/mesa/main/renderbuffer.c b/src/libs/mesa/mesa/main/renderbuffer.c deleted file mode 100644 index 6f1d7c3960..0000000000 --- a/src/libs/mesa/mesa/main/renderbuffer.c +++ /dev/null @@ -1,2203 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * Functions for allocating/managing renderbuffers. - * Also, routines for reading/writing software-based renderbuffer data as - * ubytes, ushorts, uints, etc. - * - * The 'alpha8' renderbuffer is interesting. It's used to add a software-based - * alpha channel to RGB renderbuffers. This is done by wrapping the RGB - * renderbuffer with the alpha renderbuffer. We can do this because of the - * OO-nature of renderbuffers. - * - * Down the road we'll use this for run-time support of 8, 16 and 32-bit - * color channels. For example, Mesa may use 32-bit/float color channels - * internally (swrast) and use wrapper renderbuffers to convert 32-bit - * values down to 16 or 8-bit values for whatever kind of framebuffer we have. - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "mtypes.h" -#include "fbobject.h" -#include "renderbuffer.h" - -#include "rbadaptors.h" - - -/* 32-bit color index format. Not a public format. */ -#define COLOR_INDEX32 0x424243 - - -/* - * Routines for get/put values in common buffer formats follow. - * Someday add support for arbitrary row stride to make them more - * flexible. - */ - -/********************************************************************** - * Functions for buffers of 1 X GLubyte values. - * Typically stencil. - */ - -static void * -get_pointer_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - if (!rb->Data) - return NULL; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - /* Can't assert _ActualFormat since these funcs may be used for serveral - * different formats (GL_ALPHA8, GL_STENCIL_INDEX8, etc). - */ - return (GLubyte *) rb->Data + y * rb->Width + x; -} - - -static void -get_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const GLubyte *src = (const GLubyte *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - _mesa_memcpy(values, src, count * sizeof(GLubyte)); -} - - -static void -get_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLubyte *dst = (GLubyte *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - const GLubyte *src = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; - dst[i] = *src; - } -} - - -static void -put_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = src[i]; - } - } - } - else { - _mesa_memcpy(dst, values, count * sizeof(GLubyte)); - } -} - - -static void -put_mono_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLubyte val = *((const GLubyte *) value); - GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void -put_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], - const void *values, const GLubyte *mask) -{ - const GLubyte *src = (const GLubyte *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; - *dst = src[i]; - } - } -} - - -static void -put_mono_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLubyte val = *((const GLubyte *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; - *dst = val; - } - } -} - - -/********************************************************************** - * Functions for buffers of 1 X GLushort values. - * Typically depth/Z. - */ - -static void * -get_pointer_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - if (!rb->Data) - return NULL; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - ASSERT(rb->Width > 0); - return (GLushort *) rb->Data + y * rb->Width + x; -} - - -static void -get_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const void *src = rb->GetPointer(ctx, rb, x, y); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - _mesa_memcpy(values, src, count * sizeof(GLushort)); -} - - -static void -get_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLushort *dst = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < count; i++) { - const GLushort *src = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; - dst[i] = *src; - } -} - - -static void -put_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLushort *src = (const GLushort *) values; - GLushort *dst = (GLushort *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = src[i]; - } - } - } - else { - _mesa_memcpy(dst, src, count * sizeof(GLushort)); - } -} - - -static void -put_mono_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLushort val = *((const GLushort *) value); - GLushort *dst = (GLushort *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void -put_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - const GLushort *src = (const GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; - *dst = src[i]; - } - } -} - - -static void -put_mono_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLushort val = *((const GLushort *) value); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; - *dst = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; - *dst = val; - } - } -} - - -/********************************************************************** - * Functions for buffers of 1 X GLuint values. - * Typically depth/Z or color index. - */ - -static void * -get_pointer_uint(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - if (!rb->Data) - return NULL; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - return (GLuint *) rb->Data + y * rb->Width + x; -} - - -static void -get_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const void *src = rb->GetPointer(ctx, rb, x, y); - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - _mesa_memcpy(values, src, count * sizeof(GLuint)); -} - - -static void -get_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLuint *dst = (GLuint *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - for (i = 0; i < count; i++) { - const GLuint *src = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; - dst[i] = *src; - } -} - - -static void -put_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLuint *src = (const GLuint *) values; - GLuint *dst = (GLuint *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = src[i]; - } - } - } - else { - _mesa_memcpy(dst, src, count * sizeof(GLuint)); - } -} - - -static void -put_mono_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLuint val = *((const GLuint *) value); - GLuint *dst = (GLuint *) rb->Data + y * rb->Width + x; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void -put_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - const GLuint *src = (const GLuint *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; - *dst = src[i]; - } - } -} - - -static void -put_mono_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *value, - const GLubyte *mask) -{ - const GLuint val = *((const GLuint *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; - *dst = val; - } - } -} - - -/********************************************************************** - * Functions for buffers of 3 X GLubyte (or GLbyte) values. - * Typically color buffers. - * NOTE: the incoming and outgoing colors are RGBA! We ignore incoming - * alpha values and return 255 for outgoing alpha values. - */ - -static void * -get_pointer_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - ASSERT(rb->_ActualFormat == GL_RGB8); - /* No direct access since this buffer is RGB but caller will be - * treating it as if it were RGBA. - */ - return NULL; -} - - -static void -get_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const GLubyte *src = (const GLubyte *) rb->Data + 3 * (y * rb->Width + x); - GLubyte *dst = (GLubyte *) values; - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - dst[i * 4 + 0] = src[i * 3 + 0]; - dst[i * 4 + 1] = src[i * 3 + 1]; - dst[i * 4 + 2] = src[i * 3 + 2]; - dst[i * 4 + 3] = 255; - } -} - - -static void -get_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLubyte *dst = (GLubyte *) values; - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - const GLubyte *src - = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); - dst[i * 4 + 0] = src[0]; - dst[i * 4 + 1] = src[1]; - dst[i * 4 + 2] = src[2]; - dst[i * 4 + 3] = 255; - } -} - - -static void -put_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - /* note: incoming values are RGB+A! */ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 3 + 0] = src[i * 4 + 0]; - dst[i * 3 + 1] = src[i * 4 + 1]; - dst[i * 3 + 2] = src[i * 4 + 2]; - } - } -} - - -static void -put_row_rgb_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - /* note: incoming values are RGB+A! */ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 3 + 0] = src[i * 3 + 0]; - dst[i * 3 + 1] = src[i * 3 + 1]; - dst[i * 3 + 2] = src[i * 3 + 2]; - } - } -} - - -static void -put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - /* note: incoming value is RGB+A! */ - const GLubyte val0 = ((const GLubyte *) value)[0]; - const GLubyte val1 = ((const GLubyte *) value)[1]; - const GLubyte val2 = ((const GLubyte *) value)[2]; - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - if (!mask && val0 == val1 && val1 == val2) { - /* optimized case */ - _mesa_memset(dst, val0, 3 * count); - } - else { - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 3 + 0] = val0; - dst[i * 3 + 1] = val1; - dst[i * 3 + 2] = val2; - } - } - } -} - - -static void -put_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - /* note: incoming values are RGB+A! */ - const GLubyte *src = (const GLubyte *) values; - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); - dst[0] = src[i * 4 + 0]; - dst[1] = src[i * 4 + 1]; - dst[2] = src[i * 4 + 2]; - } - } -} - - -static void -put_mono_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - /* note: incoming value is RGB+A! */ - const GLubyte val0 = ((const GLubyte *) value)[0]; - const GLubyte val1 = ((const GLubyte *) value)[1]; - const GLubyte val2 = ((const GLubyte *) value)[2]; - GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); - dst[0] = val0; - dst[1] = val1; - dst[2] = val2; - } - } -} - - -/********************************************************************** - * Functions for buffers of 4 X GLubyte (or GLbyte) values. - * Typically color buffers. - */ - -static void * -get_pointer_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - if (!rb->Data) - return NULL; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - return (GLubyte *) rb->Data + 4 * (y * rb->Width + x); -} - - -static void -get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const GLubyte *src = (const GLubyte *) rb->Data + 4 * (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - _mesa_memcpy(values, src, 4 * count * sizeof(GLubyte)); -} - - -static void -get_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - /* treat 4*GLubyte as 1*GLuint */ - GLuint *dst = (GLuint *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - for (i = 0; i < count; i++) { - const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); - dst[i] = *src; - } -} - - -static void -put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint *src = (const GLuint *) values; - GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = src[i]; - } - } - } - else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLubyte)); - } -} - - -static void -put_row_rgb_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - /* Store RGB values in RGBA buffer */ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->Width + x); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 4 + 0] = src[i * 3 + 0]; - dst[i * 4 + 1] = src[i * 3 + 1]; - dst[i * 4 + 2] = src[i * 3 + 2]; - dst[i * 4 + 3] = 0xff; - } - } -} - - -static void -put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint val = *((const GLuint *) value); - GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - if (!mask && val == 0) { - /* common case */ - _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); - } - else { - /* general case */ - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } - } -} - - -static void -put_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint *src = (const GLuint *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); - *dst = src[i]; - } - } -} - - -static void -put_mono_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint val = *((const GLuint *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); - *dst = val; - } - } -} - - -/********************************************************************** - * Functions for buffers of 4 X GLushort (or GLshort) values. - * Typically accum buffer. - */ - -static void * -get_pointer_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - if (!rb->Data) - return NULL; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - return (GLushort *) rb->Data + 4 * (y * rb->Width + x); -} - - -static void -get_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const GLshort *src = (const GLshort *) rb->Data + 4 * (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - _mesa_memcpy(values, src, 4 * count * sizeof(GLshort)); -} - - -static void -get_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLushort *dst = (GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - for (i = 0; i < count; i++) { - const GLushort *src - = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); - dst[i] = *src; - } -} - - -static void -put_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLushort *src = (const GLushort *) values; - GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i * 4 + 0] = src[i * 4 + 0]; - dst[i * 4 + 1] = src[i * 4 + 1]; - dst[i * 4 + 2] = src[i * 4 + 2]; - dst[i * 4 + 3] = src[i * 4 + 3]; - } - } - } - else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); - } -} - - -static void -put_row_rgb_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - /* Put RGB values in RGBA buffer */ - const GLushort *src = (const GLushort *) values; - GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i * 4 + 0] = src[i * 3 + 0]; - dst[i * 4 + 1] = src[i * 3 + 1]; - dst[i * 4 + 2] = src[i * 3 + 2]; - dst[i * 4 + 3] = 0xffff; - } - } - } - else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); - } -} - - -static void -put_mono_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLushort val0 = ((const GLushort *) value)[0]; - const GLushort val1 = ((const GLushort *) value)[1]; - const GLushort val2 = ((const GLushort *) value)[2]; - const GLushort val3 = ((const GLushort *) value)[3]; - GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) { - /* common case for clearing accum buffer */ - _mesa_bzero(dst, count * 4 * sizeof(GLushort)); - } - else { - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 4 + 0] = val0; - dst[i * 4 + 1] = val1; - dst[i * 4 + 2] = val2; - dst[i * 4 + 3] = val3; - } - } - } -} - - -static void -put_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - const GLushort *src = (const GLushort *) values; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLushort *dst = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); - dst[0] = src[i * 4 + 0]; - dst[1] = src[i * 4 + 1]; - dst[2] = src[i * 4 + 2]; - dst[3] = src[i * 4 + 3]; - } - } -} - - -static void -put_mono_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLushort val0 = ((const GLushort *) value)[0]; - const GLushort val1 = ((const GLushort *) value)[1]; - const GLushort val2 = ((const GLushort *) value)[2]; - const GLushort val3 = ((const GLushort *) value)[3]; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLushort *dst = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); - dst[0] = val0; - dst[1] = val1; - dst[2] = val2; - dst[3] = val3; - } - } -} - - - -/** - * This is a software fallback for the gl_renderbuffer->AllocStorage - * function. - * Device drivers will typically override this function for the buffers - * which it manages (typically color buffers, Z and stencil). - * Other buffers (like software accumulation and aux buffers) which the driver - * doesn't manage can be handled with this function. - * - * This one multi-purpose function can allocate stencil, depth, accum, color - * or color-index buffers! - * - * This function also plugs in the appropriate GetPointer, Get/PutRow and - * Get/PutValues functions. - */ -GLboolean -_mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, - GLuint width, GLuint height) -{ - GLuint pixelSize; - - /* first clear these fields */ - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; - - switch (internalFormat) { - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - rb->_ActualFormat = GL_RGB8; - rb->_BaseFormat = GL_RGB; - rb->DataType = GL_UNSIGNED_BYTE; - rb->GetPointer = get_pointer_ubyte3; - rb->GetRow = get_row_ubyte3; - rb->GetValues = get_values_ubyte3; - rb->PutRow = put_row_ubyte3; - rb->PutRowRGB = put_row_rgb_ubyte3; - rb->PutMonoRow = put_mono_row_ubyte3; - rb->PutValues = put_values_ubyte3; - rb->PutMonoValues = put_mono_values_ubyte3; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 0; - pixelSize = 3 * sizeof(GLubyte); - break; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - rb->_ActualFormat = GL_RGBA8; - rb->_BaseFormat = GL_RGBA; - rb->DataType = GL_UNSIGNED_BYTE; - rb->GetPointer = get_pointer_ubyte4; - rb->GetRow = get_row_ubyte4; - rb->GetValues = get_values_ubyte4; - rb->PutRow = put_row_ubyte4; - rb->PutRowRGB = put_row_rgb_ubyte4; - rb->PutMonoRow = put_mono_row_ubyte4; - rb->PutValues = put_values_ubyte4; - rb->PutMonoValues = put_mono_values_ubyte4; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 8 * sizeof(GLubyte); - pixelSize = 4 * sizeof(GLubyte); - break; - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - rb->_ActualFormat = GL_RGBA16; - rb->_BaseFormat = GL_RGBA; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort4; - rb->GetRow = get_row_ushort4; - rb->GetValues = get_values_ushort4; - rb->PutRow = put_row_ushort4; - rb->PutRowRGB = put_row_rgb_ushort4; - rb->PutMonoRow = put_mono_row_ushort4; - rb->PutValues = put_values_ushort4; - rb->PutMonoValues = put_mono_values_ushort4; - rb->RedBits = 8 * sizeof(GLushort); - rb->GreenBits = 8 * sizeof(GLushort); - rb->BlueBits = 8 * sizeof(GLushort); - rb->AlphaBits = 8 * sizeof(GLushort); - pixelSize = 4 * sizeof(GLushort); - break; -#if 00 - case GL_ALPHA8: - rb->_ActualFormat = GL_ALPHA8; - rb->_BaseFormat = GL_RGBA; /* Yes, not GL_ALPHA! */ - rb->DataType = GL_UNSIGNED_BYTE; - rb->GetPointer = get_pointer_alpha8; - rb->GetRow = get_row_alpha8; - rb->GetValues = get_values_alpha8; - rb->PutRow = put_row_alpha8; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_alpha8; - rb->PutValues = put_values_alpha8; - rb->PutMonoValues = put_mono_values_alpha8; - rb->RedBits = 0; /*red*/ - rb->GreenBits = 0; /*green*/ - rb->BlueBits = 0; /*blue*/ - rb->AlphaBits = 8 * sizeof(GLubyte); - pixelSize = sizeof(GLubyte); - break; -#endif - case GL_STENCIL_INDEX: - case GL_STENCIL_INDEX1_EXT: - case GL_STENCIL_INDEX4_EXT: - case GL_STENCIL_INDEX8_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; - rb->DataType = GL_UNSIGNED_BYTE; - rb->GetPointer = get_pointer_ubyte; - rb->GetRow = get_row_ubyte; - rb->GetValues = get_values_ubyte; - rb->PutRow = put_row_ubyte; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ubyte; - rb->PutValues = put_values_ubyte; - rb->PutMonoValues = put_mono_values_ubyte; - rb->StencilBits = 8 * sizeof(GLubyte); - pixelSize = sizeof(GLubyte); - break; - case GL_STENCIL_INDEX16_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - rb->GetValues = get_values_ushort; - rb->PutRow = put_row_ushort; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; - rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; - rb->StencilBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - rb->_ActualFormat = GL_DEPTH_COMPONENT16; - rb->_BaseFormat = GL_DEPTH_COMPONENT; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - rb->GetValues = get_values_ushort; - rb->PutRow = put_row_ushort; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; - rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; - rb->DepthBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - rb->_BaseFormat = GL_DEPTH_COMPONENT; - rb->DataType = GL_UNSIGNED_INT; - rb->GetPointer = get_pointer_uint; - rb->GetRow = get_row_uint; - rb->GetValues = get_values_uint; - rb->PutRow = put_row_uint; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; - rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; - if (internalFormat == GL_DEPTH_COMPONENT24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; - rb->DepthBits = 24; - } - else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; - rb->DepthBits = 32; - } - pixelSize = sizeof(GLuint); - break; - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; - rb->_BaseFormat = GL_DEPTH_STENCIL_EXT; - rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->GetPointer = get_pointer_uint; - rb->GetRow = get_row_uint; - rb->GetValues = get_values_uint; - rb->PutRow = put_row_uint; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; - rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; - rb->DepthBits = 24; - rb->StencilBits = 8; - pixelSize = sizeof(GLuint); - break; - case GL_COLOR_INDEX8_EXT: - rb->_ActualFormat = GL_COLOR_INDEX8_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_BYTE; - rb->GetPointer = get_pointer_ubyte; - rb->GetRow = get_row_ubyte; - rb->GetValues = get_values_ubyte; - rb->PutRow = put_row_ubyte; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ubyte; - rb->PutValues = put_values_ubyte; - rb->PutMonoValues = put_mono_values_ubyte; - rb->IndexBits = 8 * sizeof(GLubyte); - pixelSize = sizeof(GLubyte); - break; - case GL_COLOR_INDEX16_EXT: - rb->_ActualFormat = GL_COLOR_INDEX16_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - rb->GetValues = get_values_ushort; - rb->PutRow = put_row_ushort; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; - rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; - rb->IndexBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; - case COLOR_INDEX32: - rb->_ActualFormat = COLOR_INDEX32; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_INT; - rb->GetPointer = get_pointer_uint; - rb->GetRow = get_row_uint; - rb->GetValues = get_values_uint; - rb->PutRow = put_row_uint; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; - rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; - rb->IndexBits = 8 * sizeof(GLuint); - pixelSize = sizeof(GLuint); - break; - default: - _mesa_problem(ctx, "Bad internalFormat in _mesa_soft_renderbuffer_storage"); - return GL_FALSE; - } - - ASSERT(rb->DataType); - ASSERT(rb->GetPointer); - ASSERT(rb->GetRow); - ASSERT(rb->GetValues); - ASSERT(rb->PutRow); - ASSERT(rb->PutMonoRow); - ASSERT(rb->PutValues); - ASSERT(rb->PutMonoValues); - - /* free old buffer storage */ - if (rb->Data) { - _mesa_free(rb->Data); - rb->Data = NULL; - } - - if (width > 0 && height > 0) { - /* allocate new buffer storage */ - rb->Data = _mesa_malloc(width * height * pixelSize); - if (rb->Data == NULL) { - rb->Width = 0; - rb->Height = 0; - _mesa_error(ctx, GL_OUT_OF_MEMORY, - "software renderbuffer allocation (%d x %d x %d)", - width, height, pixelSize); - return GL_FALSE; - } - } - - rb->Width = width; - rb->Height = height; - - return GL_TRUE; -} - - - -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ - - -/** - * Here we utilize the gl_renderbuffer->Wrapper field to put an alpha - * buffer wrapper around an existing RGB renderbuffer (hw or sw). - * - * When PutRow is called (for example), we store the alpha values in - * this buffer, then pass on the PutRow call to the wrapped RGB - * buffer. - */ - - -static GLboolean -alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, - GLenum internalFormat, GLuint width, GLuint height) -{ - ASSERT(arb != arb->Wrapped); - ASSERT(arb->_ActualFormat == GL_ALPHA8); - - /* first, pass the call to the wrapped RGB buffer */ - if (!arb->Wrapped->AllocStorage(ctx, arb->Wrapped, internalFormat, - width, height)) { - return GL_FALSE; - } - - /* next, resize my alpha buffer */ - if (arb->Data) { - _mesa_free(arb->Data); - } - - arb->Data = _mesa_malloc(width * height * sizeof(GLubyte)); - if (arb->Data == NULL) { - arb->Width = 0; - arb->Height = 0; - _mesa_error(ctx, GL_OUT_OF_MEMORY, "software alpha buffer allocation"); - return GL_FALSE; - } - - arb->Width = width; - arb->Height = height; - - return GL_TRUE; -} - - -/** - * Delete an alpha_renderbuffer object, as well as the wrapped RGB buffer. - */ -static void -delete_renderbuffer_alpha8(struct gl_renderbuffer *arb) -{ - if (arb->Data) { - _mesa_free(arb->Data); - } - ASSERT(arb->Wrapped); - ASSERT(arb != arb->Wrapped); - arb->Wrapped->Delete(arb->Wrapped); - arb->Wrapped = NULL; - _mesa_free(arb); -} - - -static void * -get_pointer_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, - GLint x, GLint y) -{ - return NULL; /* don't allow direct access! */ -} - - -static void -get_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - GLint x, GLint y, void *values) -{ - /* NOTE: 'values' is RGBA format! */ - const GLubyte *src = (const GLubyte *) arb->Data + y * arb->Width + x; - GLubyte *dst = (GLubyte *) values; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->GetRow(ctx, arb->Wrapped, count, x, y, values); - /* second, fill in alpha values from this buffer! */ - for (i = 0; i < count; i++) { - dst[i * 4 + 3] = src[i]; - } -} - - -static void -get_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - GLubyte *dst = (GLubyte *) values; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->GetValues(ctx, arb->Wrapped, count, x, y, values); - /* second, fill in alpha values from this buffer! */ - for (i = 0; i < count; i++) { - const GLubyte *src = (GLubyte *) arb->Data + y[i] * arb->Width + x[i]; - dst[i * 4 + 3] = *src; - } -} - - -static void -put_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) arb->Data + y * arb->Width + x; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->PutRow(ctx, arb->Wrapped, count, x, y, values, mask); - /* second, store alpha in our buffer */ - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = src[i * 4 + 3]; - } - } -} - - -static void -put_row_rgb_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const GLubyte *src = (const GLubyte *) values; - GLubyte *dst = (GLubyte *) arb->Data + y * arb->Width + x; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->PutRowRGB(ctx, arb->Wrapped, count, x, y, values, mask); - /* second, store alpha in our buffer */ - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = src[i * 4 + 3]; - } - } -} - - -static void -put_mono_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLubyte val = ((const GLubyte *) value)[3]; - GLubyte *dst = (GLubyte *) arb->Data + y * arb->Width + x; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->PutMonoRow(ctx, arb->Wrapped, count, x, y, value, mask); - /* second, store alpha in our buffer */ - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - _mesa_memset(dst, val, count); - } -} - - -static void -put_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, - const GLint x[], const GLint y[], - const void *values, const GLubyte *mask) -{ - const GLubyte *src = (const GLubyte *) values; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, values, mask); - /* second, store alpha in our buffer */ - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->Width + x[i]; - *dst = src[i * 4 + 3]; - } - } -} - - -static void -put_mono_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLubyte val = ((const GLubyte *) value)[3]; - GLuint i; - ASSERT(arb != arb->Wrapped); - ASSERT(arb->DataType == GL_UNSIGNED_BYTE); - /* first, pass the call to the wrapped RGB buffer */ - arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, value, mask); - /* second, store alpha in our buffer */ - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->Width + x[i]; - *dst = val; - } - } -} - - -static void -copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src) -{ - ASSERT(dst->_ActualFormat == GL_ALPHA8); - ASSERT(src->_ActualFormat == GL_ALPHA8); - ASSERT(dst->Width == src->Width); - ASSERT(dst->Height == src->Height); - - _mesa_memcpy(dst->Data, src->Data, dst->Width * dst->Height * sizeof(GLubyte)); -} - - -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ - - -/** - * Default GetPointer routine. Always return NULL to indicate that - * direct buffer access is not supported. - */ -static void * -nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) -{ - return NULL; -} - - -/** - * Initialize the fields of a gl_renderbuffer to default values. - */ -void -_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) -{ - _glthread_INIT_MUTEX(rb->Mutex); - - rb->Magic = RB_MAGIC; - rb->ClassID = 0; - rb->Name = name; - rb->RefCount = 0; - rb->Delete = _mesa_delete_renderbuffer; - - /* The rest of these should be set later by the caller of this function or - * the AllocStorage method: - */ - rb->AllocStorage = NULL; - - rb->Width = 0; - rb->Height = 0; - rb->InternalFormat = GL_NONE; - rb->_ActualFormat = GL_NONE; - rb->_BaseFormat = GL_NONE; - rb->DataType = GL_NONE; - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0; - rb->IndexBits = 0; - rb->DepthBits = 0; - rb->StencilBits = 0; - rb->Data = NULL; - - /* Point back to ourself so that we don't have to check for Wrapped==NULL - * all over the drivers. - */ - rb->Wrapped = rb; - - rb->GetPointer = nop_get_pointer; - rb->GetRow = NULL; - rb->GetValues = NULL; - rb->PutRow = NULL; - rb->PutRowRGB = NULL; - rb->PutMonoRow = NULL; - rb->PutValues = NULL; - rb->PutMonoValues = NULL; -} - - -/** - * Allocate a new gl_renderbuffer object. This can be used for user-created - * renderbuffers or window-system renderbuffers. - */ -struct gl_renderbuffer * -_mesa_new_renderbuffer(GLcontext *ctx, GLuint name) -{ - struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer); - if (rb) { - _mesa_init_renderbuffer(rb, name); - } - return rb; -} - - -/** - * Delete a gl_framebuffer. - * This is the default function for renderbuffer->Delete(). - */ -void -_mesa_delete_renderbuffer(struct gl_renderbuffer *rb) -{ - if (rb->Data) { - _mesa_free(rb->Data); - } - _mesa_free(rb); -} - - -/** - * Allocate a software-based renderbuffer. This is called via the - * ctx->Driver.NewRenderbuffer() function when the user creates a new - * renderbuffer. - * This would not be used for hardware-based renderbuffers. - */ -struct gl_renderbuffer * -_mesa_new_soft_renderbuffer(GLcontext *ctx, GLuint name) -{ - struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name); - if (rb) { - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - /* Normally, one would setup the PutRow, GetRow, etc functions here. - * But we're doing that in the _mesa_soft_renderbuffer_storage() function - * instead. - */ - } - return rb; -} - - -/** - * Add software-based color renderbuffers to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint rgbBits, GLuint alphaBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight) -{ - GLuint b; - - if (rgbBits > 16 || alphaBits > 16) { - _mesa_problem(ctx, - "Unsupported bit depth in _mesa_add_color_renderbuffers"); - return GL_FALSE; - } - - assert(MAX_COLOR_ATTACHMENTS >= 4); - - for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { - struct gl_renderbuffer *rb; - - if (b == BUFFER_FRONT_LEFT && !frontLeft) - continue; - else if (b == BUFFER_BACK_LEFT && !backLeft) - continue; - else if (b == BUFFER_FRONT_RIGHT && !frontRight) - continue; - else if (b == BUFFER_BACK_RIGHT && !backRight) - continue; - - assert(fb->Attachment[b].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer"); - return GL_FALSE; - } - - if (rgbBits <= 8) { - if (alphaBits) - rb->_ActualFormat = GL_RGBA8; - else - rb->_ActualFormat = GL_RGB8; - } - else { - assert(rgbBits <= 16); - if (alphaBits) - rb->_ActualFormat = GL_RGBA16; - else - rb->_ActualFormat = GL_RGBA16; /* don't really have RGB16 yet */ - } - rb->InternalFormat = rb->_ActualFormat; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, b, rb); - } - - return GL_TRUE; -} - - -/** - * Add software-based color index renderbuffers to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint indexBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight) -{ - GLuint b; - - if (indexBits > 8) { - _mesa_problem(ctx, - "Unsupported bit depth in _mesa_add_color_index_renderbuffers"); - return GL_FALSE; - } - - assert(MAX_COLOR_ATTACHMENTS >= 4); - - for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { - struct gl_renderbuffer *rb; - - if (b == BUFFER_FRONT_LEFT && !frontLeft) - continue; - else if (b == BUFFER_BACK_LEFT && !backLeft) - continue; - else if (b == BUFFER_FRONT_RIGHT && !frontRight) - continue; - else if (b == BUFFER_BACK_RIGHT && !backRight) - continue; - - assert(fb->Attachment[b].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer"); - return GL_FALSE; - } - - if (indexBits <= 8) { - /* only support GLuint for now */ - /*rb->InternalFormat = GL_COLOR_INDEX8_EXT;*/ - rb->_ActualFormat = COLOR_INDEX32; - } - else { - rb->_ActualFormat = COLOR_INDEX32; - } - rb->InternalFormat = rb->_ActualFormat; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, b, rb); - } - - return GL_TRUE; -} - - -/** - * Add software-based alpha renderbuffers to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint alphaBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight) -{ - GLuint b; - - /* for window system framebuffers only! */ - assert(fb->Name == 0); - - if (alphaBits > 8) { - _mesa_problem(ctx, - "Unsupported bit depth in _mesa_add_alpha_renderbuffers"); - return GL_FALSE; - } - - assert(MAX_COLOR_ATTACHMENTS >= 4); - - /* Wrap each of the RGB color buffers with an alpha renderbuffer. - */ - for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { - struct gl_renderbuffer *arb; - - if (b == BUFFER_FRONT_LEFT && !frontLeft) - continue; - else if (b == BUFFER_BACK_LEFT && !backLeft) - continue; - else if (b == BUFFER_FRONT_RIGHT && !frontRight) - continue; - else if (b == BUFFER_BACK_RIGHT && !backRight) - continue; - - /* the RGB buffer to wrap must already exist!! */ - assert(fb->Attachment[b].Renderbuffer); - - /* only GLubyte supported for now */ - assert(fb->Attachment[b].Renderbuffer->DataType == GL_UNSIGNED_BYTE); - - /* allocate alpha renderbuffer */ - arb = _mesa_new_renderbuffer(ctx, 0); - if (!arb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating alpha buffer"); - return GL_FALSE; - } - - /* wrap the alpha renderbuffer around the RGB renderbuffer */ - arb->Wrapped = fb->Attachment[b].Renderbuffer; - - /* Set up my alphabuffer fields and plug in my functions. - * The functions will put/get the alpha values from/to RGBA arrays - * and then call the wrapped buffer's functions to handle the RGB - * values. - */ - arb->InternalFormat = arb->Wrapped->InternalFormat; - arb->_ActualFormat = GL_ALPHA8; - arb->_BaseFormat = arb->Wrapped->_BaseFormat; - arb->DataType = arb->Wrapped->DataType; - arb->AllocStorage = alloc_storage_alpha8; - arb->Delete = delete_renderbuffer_alpha8; - arb->GetPointer = get_pointer_alpha8; - arb->GetRow = get_row_alpha8; - arb->GetValues = get_values_alpha8; - arb->PutRow = put_row_alpha8; - arb->PutRowRGB = put_row_rgb_alpha8; - arb->PutMonoRow = put_mono_row_alpha8; - arb->PutValues = put_values_alpha8; - arb->PutMonoValues = put_mono_values_alpha8; - - /* clear the pointer to avoid assertion/sanity check failure later */ - fb->Attachment[b].Renderbuffer = NULL; - - /* plug the alpha renderbuffer into the colorbuffer attachment */ - _mesa_add_renderbuffer(fb, b, arb); - } - - return GL_TRUE; -} - - -/** - * For framebuffers that use a software alpha channel wrapper - * created by _mesa_add_alpha_renderbuffer or _mesa_add_soft_renderbuffers, - * copy the back buffer alpha channel into the front buffer alpha channel. - */ -void -_mesa_copy_soft_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb) -{ - if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer && - fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer) - copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer, - fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer); - - - if (fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer && - fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer) - copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer, - fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer); -} - - -/** - * Add a software-based depth renderbuffer to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint depthBits) -{ - struct gl_renderbuffer *rb; - - if (depthBits > 32) { - _mesa_problem(ctx, - "Unsupported depthBits in _mesa_add_depth_renderbuffer"); - return GL_FALSE; - } - - assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating depth buffer"); - return GL_FALSE; - } - - if (depthBits <= 16) { - rb->_ActualFormat = GL_DEPTH_COMPONENT16; - } - else if (depthBits <= 24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; - } - else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; - } - rb->InternalFormat = rb->_ActualFormat; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); - - return GL_TRUE; -} - - -/** - * Add a software-based stencil renderbuffer to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint stencilBits) -{ - struct gl_renderbuffer *rb; - - if (stencilBits > 16) { - _mesa_problem(ctx, - "Unsupported stencilBits in _mesa_add_stencil_renderbuffer"); - return GL_FALSE; - } - - assert(fb->Attachment[BUFFER_STENCIL].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating stencil buffer"); - return GL_FALSE; - } - - if (stencilBits <= 8) { - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - } - else { - /* not really supported (see s_stencil.c code) */ - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - } - rb->InternalFormat = rb->_ActualFormat; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb); - - return GL_TRUE; -} - - -/** - * Add a software-based accumulation renderbuffer to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint redBits, GLuint greenBits, - GLuint blueBits, GLuint alphaBits) -{ - struct gl_renderbuffer *rb; - - if (redBits > 16 || greenBits > 16 || blueBits > 16 || alphaBits > 16) { - _mesa_problem(ctx, - "Unsupported accumBits in _mesa_add_accum_renderbuffer"); - return GL_FALSE; - } - - assert(fb->Attachment[BUFFER_ACCUM].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer"); - return GL_FALSE; - } - - rb->_ActualFormat = GL_RGBA16; - rb->InternalFormat = GL_RGBA16; - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb); - - return GL_TRUE; -} - - - -/** - * Add a software-based accumulation renderbuffer to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - * - * NOTE: color-index aux buffers not supported. - */ -GLboolean -_mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint colorBits, GLuint numBuffers) -{ - GLuint i; - - if (colorBits > 16) { - _mesa_problem(ctx, - "Unsupported accumBits in _mesa_add_aux_renderbuffers"); - return GL_FALSE; - } - - assert(numBuffers < MAX_AUX_BUFFERS); - - for (i = 0; i < numBuffers; i++) { - struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0); - - assert(fb->Attachment[BUFFER_AUX0 + i].Renderbuffer == NULL); - - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer"); - return GL_FALSE; - } - - if (colorBits <= 8) { - rb->_ActualFormat = GL_RGBA8; - } - else { - rb->_ActualFormat = GL_RGBA16; - } - rb->InternalFormat = rb->_ActualFormat; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb); - } - return GL_TRUE; -} - - -/** - * Create/attach software-based renderbuffers to the given framebuffer. - * This is a helper routine for device drivers. Drivers can just as well - * call the individual _mesa_add_*_renderbuffer() routines directly. - */ -void -_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, - GLboolean color, - GLboolean depth, - GLboolean stencil, - GLboolean accum, - GLboolean alpha, - GLboolean aux) -{ - GLboolean frontLeft = GL_TRUE; - GLboolean backLeft = fb->Visual.doubleBufferMode; - GLboolean frontRight = fb->Visual.stereoMode; - GLboolean backRight = fb->Visual.stereoMode && fb->Visual.doubleBufferMode; - - if (color) { - if (fb->Visual.rgbMode) { - assert(fb->Visual.redBits == fb->Visual.greenBits); - assert(fb->Visual.redBits == fb->Visual.blueBits); - _mesa_add_color_renderbuffers(NULL, fb, - fb->Visual.redBits, - fb->Visual.alphaBits, - frontLeft, backLeft, - frontRight, backRight); - } - else { - _mesa_add_color_index_renderbuffers(NULL, fb, - fb->Visual.indexBits, - frontLeft, backLeft, - frontRight, backRight); - } - } - - if (depth) { - assert(fb->Visual.depthBits > 0); - _mesa_add_depth_renderbuffer(NULL, fb, fb->Visual.depthBits); - } - - if (stencil) { - assert(fb->Visual.stencilBits > 0); - _mesa_add_stencil_renderbuffer(NULL, fb, fb->Visual.stencilBits); - } - - if (accum) { - assert(fb->Visual.rgbMode); - assert(fb->Visual.accumRedBits > 0); - assert(fb->Visual.accumGreenBits > 0); - assert(fb->Visual.accumBlueBits > 0); - _mesa_add_accum_renderbuffer(NULL, fb, - fb->Visual.accumRedBits, - fb->Visual.accumGreenBits, - fb->Visual.accumBlueBits, - fb->Visual.accumAlphaBits); - } - - if (aux) { - assert(fb->Visual.rgbMode); - assert(fb->Visual.numAuxBuffers > 0); - _mesa_add_aux_renderbuffers(NULL, fb, fb->Visual.redBits, - fb->Visual.numAuxBuffers); - } - - if (alpha) { - assert(fb->Visual.rgbMode); - assert(fb->Visual.alphaBits > 0); - _mesa_add_alpha_renderbuffers(NULL, fb, fb->Visual.alphaBits, - frontLeft, backLeft, - frontRight, backRight); - } - -#if 0 - if (multisample) { - /* maybe someday */ - } -#endif -} - - -/** - * Attach a renderbuffer to a framebuffer. - */ -void -_mesa_add_renderbuffer(struct gl_framebuffer *fb, - GLuint bufferName, struct gl_renderbuffer *rb) -{ - assert(fb); - assert(rb); - assert(bufferName < BUFFER_COUNT); - - /* There should be no previous renderbuffer on this attachment point, - * with the exception of depth/stencil since the same renderbuffer may - * be used for both. - */ - assert(bufferName == BUFFER_DEPTH || - bufferName == BUFFER_STENCIL || - fb->Attachment[bufferName].Renderbuffer == NULL); - - /* winsys vs. user-created buffer cross check */ - if (fb->Name) { - assert(rb->Name); - } - else { - assert(!rb->Name); - } - - /* If Mesa's compiled with deep color channels (16 or 32 bits / channel) - * and the device driver is expecting 8-bit values (GLubyte), we can - * use a "renderbuffer adaptor/wrapper" to do the necessary conversions. - */ - if (rb->_BaseFormat == GL_RGBA) { - if (CHAN_BITS == 16 && rb->DataType == GL_UNSIGNED_BYTE) { - GET_CURRENT_CONTEXT(ctx); - rb = _mesa_new_renderbuffer_16wrap8(ctx, rb); - } - else if (CHAN_BITS == 32 && rb->DataType == GL_UNSIGNED_BYTE) { - GET_CURRENT_CONTEXT(ctx); - rb = _mesa_new_renderbuffer_32wrap8(ctx, rb); - } - else if (CHAN_BITS == 32 && rb->DataType == GL_UNSIGNED_SHORT) { - GET_CURRENT_CONTEXT(ctx); - rb = _mesa_new_renderbuffer_32wrap16(ctx, rb); - } - } - - fb->Attachment[bufferName].Type = GL_RENDERBUFFER_EXT; - fb->Attachment[bufferName].Complete = GL_TRUE; - _mesa_reference_renderbuffer(&fb->Attachment[bufferName].Renderbuffer, rb); -} - - -/** - * Remove the named renderbuffer from the given framebuffer. - */ -void -_mesa_remove_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName) -{ - struct gl_renderbuffer *rb; - - assert(bufferName < BUFFER_COUNT); - - rb = fb->Attachment[bufferName].Renderbuffer; - if (!rb) - return; - - _mesa_reference_renderbuffer(&rb, NULL); - - fb->Attachment[bufferName].Renderbuffer = NULL; -} - - -/** - * Set *ptr to point to rb. If *ptr points to another renderbuffer, - * dereference that buffer first. The new renderbuffer's refcount will - * be incremented. The old renderbuffer's refcount will be decremented. - */ -void -_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr, - struct gl_renderbuffer *rb) -{ - assert(ptr); - if (*ptr == rb) { - /* no change */ - return; - } - - if (*ptr) { - /* Unreference the old renderbuffer */ - GLboolean deleteFlag = GL_FALSE; - struct gl_renderbuffer *oldRb = *ptr; - - assert(oldRb->Magic == RB_MAGIC); - _glthread_LOCK_MUTEX(oldRb->Mutex); - assert(oldRb->Magic == RB_MAGIC); - ASSERT(oldRb->RefCount > 0); - oldRb->RefCount--; - /*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/ - deleteFlag = (oldRb->RefCount == 0); - _glthread_UNLOCK_MUTEX(oldRb->Mutex); - - if (deleteFlag) { - oldRb->Magic = 0; /* now invalid memory! */ - oldRb->Delete(oldRb); - } - - *ptr = NULL; - } - assert(!*ptr); - - if (rb) { - assert(rb->Magic == RB_MAGIC); - /* reference new renderbuffer */ - _glthread_LOCK_MUTEX(rb->Mutex); - rb->RefCount++; - /*printf("RB INCR %p (%d) to %d\n", (void*) rb, rb->Name, rb->RefCount);*/ - _glthread_UNLOCK_MUTEX(rb->Mutex); - *ptr = rb; - } -} - - -/** - * Create a new combined depth/stencil renderbuffer for implementing - * the GL_EXT_packed_depth_stencil extension. - * \return new depth/stencil renderbuffer - */ -struct gl_renderbuffer * -_mesa_new_depthstencil_renderbuffer(GLcontext *ctx, GLuint name) -{ - struct gl_renderbuffer *dsrb; - - dsrb = _mesa_new_renderbuffer(ctx, name); - if (!dsrb) - return NULL; - - /* init fields not covered by _mesa_new_renderbuffer() */ - dsrb->InternalFormat = GL_DEPTH24_STENCIL8_EXT; - dsrb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; - dsrb->AllocStorage = _mesa_soft_renderbuffer_storage; - - return dsrb; -} diff --git a/src/libs/mesa/mesa/main/renderbuffer.h b/src/libs/mesa/mesa/main/renderbuffer.h deleted file mode 100644 index c9bf888548..0000000000 --- a/src/libs/mesa/mesa/main/renderbuffer.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 RENDERBUFFER_H -#define RENDERBUFFER_H - - -extern void -_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name); - -extern struct gl_renderbuffer * -_mesa_new_renderbuffer(GLcontext *ctx, GLuint name); - -extern void -_mesa_delete_renderbuffer(struct gl_renderbuffer *rb); - - -extern struct gl_renderbuffer * -_mesa_new_soft_renderbuffer(GLcontext *ctx, GLuint name); - - -extern GLboolean -_mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, - GLuint width, GLuint height); - -extern GLboolean -_mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint rgbBits, GLuint alphaBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight); - -extern GLboolean -_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint indexBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight); - -extern GLboolean -_mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint alphaBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight); - -extern void -_mesa_copy_soft_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb); - -extern GLboolean -_mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint depthBits); - -extern GLboolean -_mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint stencilBits); - - -extern GLboolean -_mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint redBits, GLuint greenBits, - GLuint blueBits, GLuint alphaBits); - -extern GLboolean -_mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint bits, GLuint numBuffers); - -extern void -_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, - GLboolean color, - GLboolean depth, - GLboolean stencil, - GLboolean accum, - GLboolean alpha, - GLboolean aux); - -extern void -_mesa_add_renderbuffer(struct gl_framebuffer *fb, - GLuint bufferName, struct gl_renderbuffer *rb); - -extern void -_mesa_remove_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName); - -extern void -_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr, - struct gl_renderbuffer *rb); - -extern struct gl_renderbuffer * -_mesa_new_depthstencil_renderbuffer(GLcontext *ctx, GLuint name); - - -#endif /* RENDERBUFFER_H */ diff --git a/src/libs/mesa/mesa/main/scissor.c b/src/libs/mesa/mesa/main/scissor.c deleted file mode 100644 index b5f4cde789..0000000000 --- a/src/libs/mesa/mesa/main/scissor.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/scissor.h" - - -/** - * Called via glScissor - */ -void GLAPIENTRY -_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" ); - return; - } - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); - - _mesa_set_scissor(ctx, x, y, width, height); -} - - -/** - * Define the scissor box. - * - * \param x, y coordinates of the scissor box lower-left corner. - * \param width width of the scissor box. - * \param height height of the scissor box. - * - * \sa glScissor(). - * - * Verifies the parameters and updates __GLcontextRec::Scissor. On a - * change flushes the vertices and notifies the driver via - * the dd_function_table::Scissor callback. - */ -void -_mesa_set_scissor(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - if (x == ctx->Scissor.X && - y == ctx->Scissor.Y && - width == ctx->Scissor.Width && - height == ctx->Scissor.Height) - return; - - FLUSH_VERTICES(ctx, _NEW_SCISSOR); - ctx->Scissor.X = x; - ctx->Scissor.Y = y; - ctx->Scissor.Width = width; - ctx->Scissor.Height = height; - - if (ctx->Driver.Scissor) - ctx->Driver.Scissor( ctx, x, y, width, height ); -} - - -/** - * Initialize the context's scissor state. - * \param ctx the GL context. - */ -void -_mesa_init_scissor(GLcontext *ctx) -{ - /* Scissor group */ - ctx->Scissor.Enabled = GL_FALSE; - ctx->Scissor.X = 0; - ctx->Scissor.Y = 0; - ctx->Scissor.Width = 0; - ctx->Scissor.Height = 0; -} diff --git a/src/libs/mesa/mesa/main/scissor.h b/src/libs/mesa/mesa/main/scissor.h deleted file mode 100644 index b852a2122d..0000000000 --- a/src/libs/mesa/mesa/main/scissor.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SCISSOR_H -#define SCISSOR_H - - -#include "main/mtypes.h" - - -extern void GLAPIENTRY -_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); - - -extern void -_mesa_set_scissor(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height); - - -extern void -_mesa_init_scissor(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/main/shaders.c b/src/libs/mesa/mesa/main/shaders.c deleted file mode 100644 index 7491d00c35..0000000000 --- a/src/libs/mesa/mesa/main/shaders.c +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 2004-2008 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "shaders.h" - - -/** - * These are basically just wrappers/adaptors for calling the - * ctx->Driver.foobar() GLSL-related functions. - * - * Things are biased toward the OpenGL 2.0 functions rather than the - * ARB extensions (i.e. the ARB functions are layered on the 2.0 functions). - * - * The general idea here is to allow enough modularity such that a - * completely different GLSL implemenation can be plugged in and co-exist - * with Mesa's native GLSL code. - */ - - - -void GLAPIENTRY -_mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.AttachShader(ctx, program, shader); -} - - -void GLAPIENTRY -_mesa_AttachShader(GLuint program, GLuint shader) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.AttachShader(ctx, program, shader); -} - - -void GLAPIENTRY -_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index, - const GLcharARB *name) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.BindAttribLocation(ctx, program, index, name); -} - - -void GLAPIENTRY -_mesa_CompileShaderARB(GLhandleARB shaderObj) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.CompileShader(ctx, shaderObj); -} - - -GLuint GLAPIENTRY -_mesa_CreateShader(GLenum type) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.CreateShader(ctx, type); -} - - -GLhandleARB GLAPIENTRY -_mesa_CreateShaderObjectARB(GLenum type) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.CreateShader(ctx, type); -} - - -GLuint GLAPIENTRY -_mesa_CreateProgram(void) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.CreateProgram(ctx); -} - - -GLhandleARB GLAPIENTRY -_mesa_CreateProgramObjectARB(void) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.CreateProgram(ctx); -} - - -void GLAPIENTRY -_mesa_DeleteObjectARB(GLhandleARB obj) -{ - if (obj) { - GET_CURRENT_CONTEXT(ctx); - if (ctx->Driver.IsProgram(ctx, obj)) { - ctx->Driver.DeleteProgram2(ctx, obj); - } - else if (ctx->Driver.IsShader(ctx, obj)) { - ctx->Driver.DeleteShader(ctx, obj); - } - else { - /* error? */ - } - } -} - - -void GLAPIENTRY -_mesa_DeleteProgram(GLuint name) -{ - if (name) { - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DeleteProgram2(ctx, name); - } -} - - -void GLAPIENTRY -_mesa_DeleteShader(GLuint name) -{ - if (name) { - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DeleteShader(ctx, name); - } -} - - -void GLAPIENTRY -_mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DetachShader(ctx, program, shader); -} - - -void GLAPIENTRY -_mesa_DetachShader(GLuint program, GLuint shader) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DetachShader(ctx, program, shader); -} - - -void GLAPIENTRY -_mesa_GetActiveAttribARB(GLhandleARB program, GLuint index, - GLsizei maxLength, GLsizei * length, GLint * size, - GLenum * type, GLcharARB * name) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetActiveAttrib(ctx, program, index, maxLength, length, size, - type, name); -} - - -void GLAPIENTRY -_mesa_GetActiveUniformARB(GLhandleARB program, GLuint index, - GLsizei maxLength, GLsizei * length, GLint * size, - GLenum * type, GLcharARB * name) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetActiveUniform(ctx, program, index, maxLength, length, size, - type, name); -} - - -void GLAPIENTRY -_mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount, - GLsizei * count, GLhandleARB * obj) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetAttachedShaders(ctx, container, maxCount, count, obj); -} - - -void GLAPIENTRY -_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetAttachedShaders(ctx, program, maxCount, count, obj); -} - - -GLint GLAPIENTRY -_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.GetAttribLocation(ctx, program, name); -} - - -void GLAPIENTRY -_mesa_GetInfoLogARB(GLhandleARB object, GLsizei maxLength, GLsizei * length, - GLcharARB * infoLog) -{ - GET_CURRENT_CONTEXT(ctx); - /* Implement in terms of GetProgramInfoLog, GetShaderInfoLog */ - if (ctx->Driver.IsProgram(ctx, object)) { - ctx->Driver.GetProgramInfoLog(ctx, object, maxLength, length, infoLog); - } - else if (ctx->Driver.IsShader(ctx, object)) { - ctx->Driver.GetShaderInfoLog(ctx, object, maxLength, length, infoLog); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetInfoLogARB"); - } -} - - -void GLAPIENTRY -_mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - /* Implement in terms of GetProgramiv, GetShaderiv */ - if (ctx->Driver.IsProgram(ctx, object)) { - if (pname == GL_OBJECT_TYPE_ARB) { - *params = GL_PROGRAM_OBJECT_ARB; - } - else { - ctx->Driver.GetProgramiv(ctx, object, pname, params); - } - } - else if (ctx->Driver.IsShader(ctx, object)) { - if (pname == GL_OBJECT_TYPE_ARB) { - *params = GL_SHADER_OBJECT_ARB; - } - else { - ctx->Driver.GetShaderiv(ctx, object, pname, params); - } - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB"); - } -} - - -void GLAPIENTRY -_mesa_GetObjectParameterfvARB(GLhandleARB object, GLenum pname, - GLfloat *params) -{ - GLint iparams[1]; /* XXX is one element enough? */ - _mesa_GetObjectParameterivARB(object, pname, iparams); - params[0] = (GLfloat) iparams[0]; -} - - -void GLAPIENTRY -_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetProgramiv(ctx, program, pname, params); -} - - -void GLAPIENTRY -_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetShaderiv(ctx, shader, pname, params); -} - - -void GLAPIENTRY -_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize, - GLsizei *length, GLchar *infoLog) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetProgramInfoLog(ctx, program, bufSize, length, infoLog); -} - - -void GLAPIENTRY -_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize, - GLsizei *length, GLchar *infoLog) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetShaderInfoLog(ctx, shader, bufSize, length, infoLog); -} - - -void GLAPIENTRY -_mesa_GetShaderSourceARB(GLhandleARB shader, GLsizei maxLength, - GLsizei *length, GLcharARB *sourceOut) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetShaderSource(ctx, shader, maxLength, length, sourceOut); -} - - -void GLAPIENTRY -_mesa_GetUniformfvARB(GLhandleARB program, GLint location, GLfloat * params) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetUniformfv(ctx, program, location, params); -} - - -void GLAPIENTRY -_mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint * params) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.GetUniformiv(ctx, program, location, params); -} - - - -#if 0 -GLint GLAPIENTRY -_mesa_GetUniformLocation(GLuint program, const GLcharARB *name) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.GetUniformLocation(ctx, program, name); -} -#endif - - -GLhandleARB GLAPIENTRY -_mesa_GetHandleARB(GLenum pname) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.GetHandle(ctx, pname); -} - - -GLint GLAPIENTRY -_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.GetUniformLocation(ctx, programObj, name); -} - - -GLboolean GLAPIENTRY -_mesa_IsProgram(GLuint name) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.IsProgram(ctx, name); -} - - -GLboolean GLAPIENTRY -_mesa_IsShader(GLuint name) -{ - GET_CURRENT_CONTEXT(ctx); - return ctx->Driver.IsShader(ctx, name); -} - - -void GLAPIENTRY -_mesa_LinkProgramARB(GLhandleARB programObj) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.LinkProgram(ctx, programObj); -} - - -/** - * Called via glShaderSource() and glShaderSourceARB() API functions. - * Basically, concatenate the source code strings into one long string - * and pass it to ctx->Driver.ShaderSource(). - */ -void GLAPIENTRY -_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, - const GLcharARB ** string, const GLint * length) -{ - GET_CURRENT_CONTEXT(ctx); - GLint *offsets; - GLsizei i, totalLength; - GLcharARB *source; - - if (!shaderObj || string == NULL) { - _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB"); - return; - } - - /* - * This array holds offsets of where the appropriate string ends, thus the - * last element will be set to the total length of the source code. - */ - offsets = (GLint *) _mesa_malloc(count * sizeof(GLint)); - if (offsets == NULL) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); - return; - } - - for (i = 0; i < count; i++) { - if (string[i] == NULL) { - _mesa_free((GLvoid *) offsets); - _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderSourceARB(null string)"); - return; - } - if (length == NULL || length[i] < 0) - offsets[i] = _mesa_strlen(string[i]); - else - offsets[i] = length[i]; - /* accumulate string lengths */ - if (i > 0) - offsets[i] += offsets[i - 1]; - } - - /* Total length of source string is sum off all strings plus two. - * One extra byte for terminating zero, another extra byte to silence - * valgrind warnings in the parser/grammer code. - */ - totalLength = offsets[count - 1] + 2; - source = (GLcharARB *) _mesa_malloc(totalLength * sizeof(GLcharARB)); - if (source == NULL) { - _mesa_free((GLvoid *) offsets); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); - return; - } - - for (i = 0; i < count; i++) { - GLint start = (i > 0) ? offsets[i - 1] : 0; - _mesa_memcpy(source + start, string[i], - (offsets[i] - start) * sizeof(GLcharARB)); - } - source[totalLength - 1] = '\0'; - source[totalLength - 2] = '\0'; - - ctx->Driver.ShaderSource(ctx, shaderObj, source); - - _mesa_free(offsets); -} - - -void GLAPIENTRY -_mesa_Uniform1fARB(GLint location, GLfloat v0) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, 1, &v0, GL_FLOAT); -} - -void GLAPIENTRY -_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat v[2]; - v[0] = v0; - v[1] = v1; - ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC2); -} - -void GLAPIENTRY -_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat v[3]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC3); -} - -void GLAPIENTRY -_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, - GLfloat v3) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat v[4]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - v[3] = v3; - ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC4); -} - -void GLAPIENTRY -_mesa_Uniform1iARB(GLint location, GLint v0) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, 1, &v0, GL_INT); -} - -void GLAPIENTRY -_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1) -{ - GET_CURRENT_CONTEXT(ctx); - GLint v[2]; - v[0] = v0; - v[1] = v1; - ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC2); -} - -void GLAPIENTRY -_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2) -{ - GET_CURRENT_CONTEXT(ctx); - GLint v[3]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC3); -} - -void GLAPIENTRY -_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - GET_CURRENT_CONTEXT(ctx); - GLint v[4]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - v[3] = v3; - ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC4); -} - -void GLAPIENTRY -_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT); -} - -void GLAPIENTRY -_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC2); -} - -void GLAPIENTRY -_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC3); -} - -void GLAPIENTRY -_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC4); -} - -void GLAPIENTRY -_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_INT); -} - -void GLAPIENTRY -_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC2); -} - -void GLAPIENTRY -_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC3); -} - -void GLAPIENTRY -_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC4); -} - - -void GLAPIENTRY -_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, - const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 2, 2, GL_FLOAT_MAT2, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, - const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 3, 3, GL_FLOAT_MAT3, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, - const GLfloat * value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 4, 4, GL_FLOAT_MAT4, - location, count, transpose, value); -} - - -/** - * Non-square UniformMatrix are OpenGL 2.1 - */ -void GLAPIENTRY -_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 2, 3, GL_FLOAT_MAT2x3, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 3, 2, GL_FLOAT_MAT3x2, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 2, 4, GL_FLOAT_MAT2x4, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 4, 2, GL_FLOAT_MAT4x2, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 3, 4, GL_FLOAT_MAT3x4, - location, count, transpose, value); -} - -void GLAPIENTRY -_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.UniformMatrix(ctx, 4, 3, GL_FLOAT_MAT4x3, - location, count, transpose, value); -} - - -void GLAPIENTRY -_mesa_UseProgramObjectARB(GLhandleARB program) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->Driver.UseProgram(ctx, program); -} - - -void GLAPIENTRY -_mesa_ValidateProgramARB(GLhandleARB program) -{ - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.ValidateProgram(ctx, program); -} - diff --git a/src/libs/mesa/mesa/main/shaders.h b/src/libs/mesa/mesa/main/shaders.h deleted file mode 100644 index 17339ccf62..0000000000 --- a/src/libs/mesa/mesa/main/shaders.h +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2004-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SHADERS_H -#define SHADERS_H - - -#include "glheader.h" -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_DeleteObjectARB(GLhandleARB obj); - -extern GLhandleARB GLAPIENTRY -_mesa_GetHandleARB(GLenum pname); - -extern void GLAPIENTRY -_mesa_DetachObjectARB (GLhandleARB, GLhandleARB); - -extern GLhandleARB GLAPIENTRY -_mesa_CreateShaderObjectARB (GLenum); - -extern void GLAPIENTRY -_mesa_ShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); - -extern void GLAPIENTRY -_mesa_CompileShaderARB (GLhandleARB); - -extern GLhandleARB GLAPIENTRY -_mesa_CreateProgramObjectARB (void); - -extern void GLAPIENTRY -_mesa_AttachObjectARB (GLhandleARB, GLhandleARB); - -extern void GLAPIENTRY -_mesa_LinkProgramARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_UseProgramObjectARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_ValidateProgramARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_Uniform1fARB (GLint, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform2fARB (GLint, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform3fARB (GLint, GLfloat, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform1iARB (GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform2iARB (GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform3iARB (GLint, GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform4iARB (GLint, GLint, GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform1fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform2fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform3fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform4fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform1ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform2ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform3ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform4ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_UniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_UniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_UniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_GetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); - -extern void GLAPIENTRY -_mesa_GetObjectParameterivARB (GLhandleARB, GLenum, GLint *); - -extern void GLAPIENTRY -_mesa_GetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); - -extern GLint GLAPIENTRY -_mesa_GetUniformLocationARB (GLhandleARB, const GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetUniformfvARB (GLhandleARB, GLint, GLfloat *); - -extern void GLAPIENTRY -_mesa_GetUniformivARB (GLhandleARB, GLint, GLint *); - -extern void GLAPIENTRY -_mesa_GetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); - -#if FEATURE_ARB_vertex_shader - -extern void GLAPIENTRY -_mesa_BindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); - -extern GLint GLAPIENTRY -_mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *); - -#endif /* FEATURE_ARB_vertex_shader */ - - -/* 2.0 */ -extern void GLAPIENTRY -_mesa_AttachShader(GLuint program, GLuint shader); - -extern GLuint GLAPIENTRY -_mesa_CreateShader(GLenum); - -extern GLuint GLAPIENTRY -_mesa_CreateProgram(void); - -extern void GLAPIENTRY -_mesa_DeleteProgram(GLuint program); - -extern void GLAPIENTRY -_mesa_DeleteShader(GLuint shader); - -extern void GLAPIENTRY -_mesa_DetachShader(GLuint program, GLuint shader); - -extern void GLAPIENTRY -_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj); - -extern void GLAPIENTRY -_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize, - GLsizei *length, GLchar *infoLog); - -extern void GLAPIENTRY -_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize, - GLsizei *length, GLchar *infoLog); - -extern GLboolean GLAPIENTRY -_mesa_IsProgram(GLuint program); - -extern GLboolean GLAPIENTRY -_mesa_IsShader(GLuint shader); - - - -/* 2.1 */ -extern void GLAPIENTRY -_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - -extern void GLAPIENTRY -_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - -extern void GLAPIENTRY -_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - -extern void GLAPIENTRY -_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - -extern void GLAPIENTRY -_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - -extern void GLAPIENTRY -_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, - const GLfloat *value); - - -#endif /* SHADERS_H */ diff --git a/src/libs/mesa/mesa/main/simple_list.h b/src/libs/mesa/mesa/main/simple_list.h deleted file mode 100644 index 63475f6f74..0000000000 --- a/src/libs/mesa/mesa/main/simple_list.h +++ /dev/null @@ -1,197 +0,0 @@ -/** - * \file simple_list.h - * Simple macros for type-safe, intrusive lists. - * - * Intended to work with a list sentinal which is created as an empty - * list. Insert & delete are O(1). - * - * \author - * (C) 1997, Keith Whitwell - */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 _SIMPLE_LIST_H -#define _SIMPLE_LIST_H - -/** - * Remove an element from list. - * - * \param elem element to remove. - */ -#define remove_from_list(elem) \ -do { \ - (elem)->next->prev = (elem)->prev; \ - (elem)->prev->next = (elem)->next; \ -} while (0) - -/** - * Insert an element to the list head. - * - * \param list list. - * \param elem element to insert. - */ -#define insert_at_head(list, elem) \ -do { \ - (elem)->prev = list; \ - (elem)->next = (list)->next; \ - (list)->next->prev = elem; \ - (list)->next = elem; \ -} while(0) - -/** - * Insert an element to the list tail. - * - * \param list list. - * \param elem element to insert. - */ -#define insert_at_tail(list, elem) \ -do { \ - (elem)->next = list; \ - (elem)->prev = (list)->prev; \ - (list)->prev->next = elem; \ - (list)->prev = elem; \ -} while(0) - -/** - * Move an element to the list head. - * - * \param list list. - * \param elem element to move. - */ -#define move_to_head(list, elem) \ -do { \ - remove_from_list(elem); \ - insert_at_head(list, elem); \ -} while (0) - -/** - * Move an element to the list tail. - * - * \param list list. - * \param elem element to move. - */ -#define move_to_tail(list, elem) \ -do { \ - remove_from_list(elem); \ - insert_at_tail(list, elem); \ -} while (0) - -/** - * Make a empty list empty. - * - * \param sentinal list (sentinal element). - */ -#define make_empty_list(sentinal) \ -do { \ - (sentinal)->next = sentinal; \ - (sentinal)->prev = sentinal; \ -} while (0) - -/** - * Get list first element. - * - * \param list list. - * - * \return pointer to first element. - */ -#define first_elem(list) ((list)->next) - -/** - * Get list last element. - * - * \param list list. - * - * \return pointer to last element. - */ -#define last_elem(list) ((list)->prev) - -/** - * Get next element. - * - * \param elem element. - * - * \return pointer to next element. - */ -#define next_elem(elem) ((elem)->next) - -/** - * Get previous element. - * - * \param elem element. - * - * \return pointer to previous element. - */ -#define prev_elem(elem) ((elem)->prev) - -/** - * Test whether element is at end of the list. - * - * \param list list. - * \param elem element. - * - * \return non-zero if element is at end of list, or zero otherwise. - */ -#define at_end(list, elem) ((elem) == (list)) - -/** - * Test if a list is empty. - * - * \param list list. - * - * \return non-zero if list empty, or zero otherwise. - */ -#define is_empty_list(list) ((list)->next == (list)) - -/** - * Walk through the elements of a list. - * - * \param ptr pointer to the current element. - * \param list list. - * - * \note It should be followed by a { } block or a single statement, as in a \c - * for loop. - */ -#define foreach(ptr, list) \ - for( ptr=(list)->next ; ptr!=list ; ptr=(ptr)->next ) - -/** - * Walk through the elements of a list. - * - * Same as #foreach but lets you unlink the current value during a list - * traversal. Useful for freeing a list, element by element. - * - * \param ptr pointer to the current element. - * \param t temporary pointer. - * \param list list. - * - * \note It should be followed by a { } block or a single statement, as in a \c - * for loop. - */ -#define foreach_s(ptr, t, list) \ - for(ptr=(list)->next,t=(ptr)->next; list != ptr; ptr=t, t=(t)->next) - -#endif diff --git a/src/libs/mesa/mesa/main/state.c b/src/libs/mesa/mesa/main/state.c deleted file mode 100644 index 0c977d4531..0000000000 --- a/src/libs/mesa/mesa/main/state.c +++ /dev/null @@ -1,576 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file state.c - * State management. - * - * This file manages recalculation of derived values in GLcontext. - */ - - -#include "glheader.h" -#include "mtypes.h" -#include "context.h" -#include "debug.h" -#include "macros.h" -#include "ffvertex_prog.h" -#include "framebuffer.h" -#include "light.h" -#include "matrix.h" -#if FEATURE_pixel_transfer -#include "pixel.h" -#endif -#include "shader/program.h" -#include "state.h" -#include "stencil.h" -#include "texenvprogram.h" -#include "texobj.h" -#include "texstate.h" - - -static void -update_separate_specular(GLcontext *ctx) -{ - if (NEED_SECONDARY_COLOR(ctx)) - ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - else - ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR; -} - - -/** - * Update state dependent on vertex arrays. - */ -static void -update_arrays( GLcontext *ctx ) -{ - GLuint i, min; - - /* find min of _MaxElement values for all enabled arrays */ - - /* 0 */ - if (ctx->VertexProgram._Current - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) { - min = ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS]._MaxElement; - } - else if (ctx->Array.ArrayObj->Vertex.Enabled) { - min = ctx->Array.ArrayObj->Vertex._MaxElement; - } - else { - /* can't draw anything without vertex positions! */ - min = 0; - } - - /* 1 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT]._MaxElement); - } - /* no conventional vertex weight array */ - - /* 2 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]._MaxElement); - } - else if (ctx->Array.ArrayObj->Normal.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->Normal._MaxElement); - } - - /* 3 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]._MaxElement); - } - else if (ctx->Array.ArrayObj->Color.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->Color._MaxElement); - } - - /* 4 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]._MaxElement); - } - else if (ctx->Array.ArrayObj->SecondaryColor.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->SecondaryColor._MaxElement); - } - - /* 5 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG]._MaxElement); - } - else if (ctx->Array.ArrayObj->FogCoord.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->FogCoord._MaxElement); - } - - /* 6 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]._MaxElement); - } - else if (ctx->Array.ArrayObj->Index.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->Index._MaxElement); - } - - - /* 7 */ - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]._MaxElement); - } - - /* 8..15 */ - for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) { - if (ctx->VertexProgram._Enabled - && ctx->Array.ArrayObj->VertexAttrib[i].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement); - } - else if (i - VERT_ATTRIB_TEX0 < ctx->Const.MaxTextureCoordUnits - && ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0]._MaxElement); - } - } - - /* 16..31 */ - if (ctx->VertexProgram._Current) { - for (i = 0; i < Elements(ctx->Array.ArrayObj->VertexAttrib); i++) { - if (ctx->Array.ArrayObj->VertexAttrib[i].Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement); - } - } - } - - if (ctx->Array.ArrayObj->EdgeFlag.Enabled) { - min = MIN2(min, ctx->Array.ArrayObj->EdgeFlag._MaxElement); - } - - /* _MaxElement is one past the last legal array element */ - ctx->Array._MaxElement = min; -} - - -/** - * Update the following fields: - * ctx->VertexProgram._Enabled - * ctx->FragmentProgram._Enabled - * ctx->ATIFragmentShader._Enabled - * This needs to be done before texture state validation. - */ -static void -update_program_enables(GLcontext *ctx) -{ - /* These _Enabled flags indicate if the program is enabled AND valid. */ - ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled - && ctx->VertexProgram.Current->Base.Instructions; - ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled - && ctx->FragmentProgram.Current->Base.Instructions; - ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled - && ctx->ATIFragmentShader.Current->Instructions[0]; -} - - -/** - * Update vertex/fragment program state. In particular, update these fields: - * ctx->VertexProgram._Current - * ctx->VertexProgram._TnlProgram, - * These point to the highest priority enabled vertex/fragment program or are - * NULL if fixed-function processing is to be done. - * - * This function needs to be called after texture state validation in case - * we're generating a fragment program from fixed-function texture state. - * - * \return bitfield which will indicate _NEW_PROGRAM state if a new vertex - * or fragment program is being used. - */ -static GLbitfield -update_program(GLcontext *ctx) -{ - const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; - const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; - GLbitfield new_state = 0x0; - - /* - * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current - * pointers to the programs that should be used for rendering. If either - * is NULL, use fixed-function code paths. - * - * These programs may come from several sources. The priority is as - * follows: - * 1. OpenGL 2.0/ARB vertex/fragment shaders - * 2. ARB/NV vertex/fragment programs - * 3. Programs derived from fixed-function state. - * - * Note: it's possible for a vertex shader to get used with a fragment - * program (and vice versa) here, but in practice that shouldn't ever - * come up, or matter. - */ - - if (shProg && shProg->LinkStatus && shProg->FragmentProgram) { - /* Use shader programs */ - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, - shProg->FragmentProgram); - } - else if (ctx->FragmentProgram._Enabled) { - /* use user-defined vertex program */ - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, - ctx->FragmentProgram.Current); - } - else if (ctx->FragmentProgram._MaintainTexEnvProgram) { - /* Use fragment program generated from fixed-function state. - */ - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, - _mesa_get_fixed_func_fragment_program(ctx)); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, - ctx->FragmentProgram._Current); - } - else { - /* no fragment program */ - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); - } - - /* Examine vertex program after fragment program as - * _mesa_get_fixed_func_vertex_program() needs to know active - * fragprog inputs. - */ - if (shProg && shProg->LinkStatus && shProg->VertexProgram) { - /* Use shader programs */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, - shProg->VertexProgram); - } - else if (ctx->VertexProgram._Enabled) { - /* use user-defined vertex program */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, - ctx->VertexProgram.Current); - } - else if (ctx->VertexProgram._MaintainTnlProgram) { - /* Use vertex program generated from fixed-function state. - */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, - _mesa_get_fixed_func_vertex_program(ctx)); - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, - ctx->VertexProgram._Current); - } - else { - /* no vertex program */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); - } - - /* Let the driver know what's happening: - */ - if (ctx->FragmentProgram._Current != prevFP) { - new_state |= _NEW_PROGRAM; - if (ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct gl_program *) ctx->FragmentProgram._Current); - } - } - - if (ctx->VertexProgram._Current != prevVP) { - new_state |= _NEW_PROGRAM; - if (ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, - (struct gl_program *) ctx->VertexProgram._Current); - } - } - - return new_state; -} - - -static void -update_viewport_matrix(GLcontext *ctx) -{ - const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; - - ASSERT(depthMax > 0); - - /* Compute scale and bias values. This is really driver-specific - * and should be maintained elsewhere if at all. - * NOTE: RasterPos uses this. - */ - _math_matrix_viewport(&ctx->Viewport._WindowMap, - ctx->Viewport.X, ctx->Viewport.Y, - ctx->Viewport.Width, ctx->Viewport.Height, - ctx->Viewport.Near, ctx->Viewport.Far, - depthMax); -} - - -/** - * Update derived multisample state. - */ -static void -update_multisample(GLcontext *ctx) -{ - ctx->Multisample._Enabled = GL_FALSE; - if (ctx->Multisample.Enabled && - ctx->DrawBuffer && - ctx->DrawBuffer->Visual.sampleBuffers) - ctx->Multisample._Enabled = GL_TRUE; -} - - -/** - * Update derived color/blend/logicop state. - */ -static void -update_color(GLcontext *ctx) -{ - /* This is needed to support 1.1's RGB logic ops AND - * 1.0's blending logicops. - */ - ctx->Color._LogicOpEnabled = RGBA_LOGICOP_ENABLED(ctx); -} - - -/* - * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET - * in ctx->_TriangleCaps if needed. - */ -static void -update_polygon(GLcontext *ctx) -{ - ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET); - - if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK; - - if ( ctx->Polygon.OffsetPoint - || ctx->Polygon.OffsetLine - || ctx->Polygon.OffsetFill) - ctx->_TriangleCaps |= DD_TRI_OFFSET; -} - - -/** - * Update the ctx->_TriangleCaps bitfield. - * XXX that bitfield should really go away someday! - * This function must be called after other update_*() functions since - * there are dependencies on some other derived values. - */ -#if 0 -static void -update_tricaps(GLcontext *ctx, GLbitfield new_state) -{ - ctx->_TriangleCaps = 0; - - /* - * Points - */ - if (1/*new_state & _NEW_POINT*/) { - if (ctx->Point.SmoothFlag) - ctx->_TriangleCaps |= DD_POINT_SMOOTH; - if (ctx->Point.Size != 1.0F) - ctx->_TriangleCaps |= DD_POINT_SIZE; - if (ctx->Point._Attenuated) - ctx->_TriangleCaps |= DD_POINT_ATTEN; - } - - /* - * Lines - */ - if (1/*new_state & _NEW_LINE*/) { - if (ctx->Line.SmoothFlag) - ctx->_TriangleCaps |= DD_LINE_SMOOTH; - if (ctx->Line.StippleFlag) - ctx->_TriangleCaps |= DD_LINE_STIPPLE; - if (ctx->Line.Width != 1.0) - ctx->_TriangleCaps |= DD_LINE_WIDTH; - } - - /* - * Polygons - */ - if (1/*new_state & _NEW_POLYGON*/) { - if (ctx->Polygon.SmoothFlag) - ctx->_TriangleCaps |= DD_TRI_SMOOTH; - if (ctx->Polygon.StippleFlag) - ctx->_TriangleCaps |= DD_TRI_STIPPLE; - if (ctx->Polygon.FrontMode != GL_FILL - || ctx->Polygon.BackMode != GL_FILL) - ctx->_TriangleCaps |= DD_TRI_UNFILLED; - if (ctx->Polygon.CullFlag - && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK; - if (ctx->Polygon.OffsetPoint || - ctx->Polygon.OffsetLine || - ctx->Polygon.OffsetFill) - ctx->_TriangleCaps |= DD_TRI_OFFSET; - } - - /* - * Lighting and shading - */ - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - if (ctx->Light.ShadeModel == GL_FLAT) - ctx->_TriangleCaps |= DD_FLATSHADE; - if (NEED_SECONDARY_COLOR(ctx)) - ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - - /* - * Stencil - */ - if (ctx->Stencil._TestTwoSide) - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; -} -#endif - - -/** - * Compute derived GL state. - * If __GLcontextRec::NewState is non-zero then this function \b must - * be called before rendering anything. - * - * Calls dd_function_table::UpdateState to perform any internal state - * management necessary. - * - * \sa _mesa_update_modelview_project(), _mesa_update_texture(), - * _mesa_update_buffer_bounds(), - * _mesa_update_lighting() and _mesa_update_tnl_spaces(). - */ -void -_mesa_update_state_locked( GLcontext *ctx ) -{ - GLbitfield new_state = ctx->NewState; - GLbitfield prog_flags = _NEW_PROGRAM; - GLbitfield new_prog_state = 0x0; - - if (MESA_VERBOSE & VERBOSE_STATE) - _mesa_print_state("_mesa_update_state", new_state); - - /* Determine which state flags effect vertex/fragment program state */ - if (ctx->FragmentProgram._MaintainTexEnvProgram) { - prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); - } - if (ctx->VertexProgram._MaintainTnlProgram) { - prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | - _NEW_TRANSFORM | _NEW_POINT | - _NEW_FOG | _NEW_LIGHT | - _MESA_NEW_NEED_EYE_COORDS); - } - - /* - * Now update derived state info - */ - - if (new_state & prog_flags) - update_program_enables( ctx ); - - if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION)) - _mesa_update_modelview_project( ctx, new_state ); - - if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX)) - _mesa_update_texture( ctx, new_state ); - - if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) - _mesa_update_framebuffer(ctx); - - if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT)) - _mesa_update_draw_buffer_bounds( ctx ); - - if (new_state & _NEW_POLYGON) - update_polygon( ctx ); - - if (new_state & _NEW_LIGHT) - _mesa_update_lighting( ctx ); - - if (new_state & _NEW_STENCIL) - _mesa_update_stencil( ctx ); - -#if FEATURE_pixel_transfer - if (new_state & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_pixel( ctx, new_state ); -#endif - - if (new_state & _DD_NEW_SEPARATE_SPECULAR) - update_separate_specular( ctx ); - - if (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) - update_arrays( ctx ); - - if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT)) - update_viewport_matrix(ctx); - - if (new_state & _NEW_MULTISAMPLE) - update_multisample( ctx ); - - if (new_state & _NEW_COLOR) - update_color( ctx ); - -#if 0 - if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT - | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR)) - update_tricaps( ctx, new_state ); -#endif - - /* ctx->_NeedEyeCoords is now up to date. - * - * If the truth value of this variable has changed, update for the - * new lighting space and recompute the positions of lights and the - * normal transform. - * - * If the lighting space hasn't changed, may still need to recompute - * light positions & normal transforms for other reasons. - */ - if (new_state & _MESA_NEW_NEED_EYE_COORDS) - _mesa_update_tnl_spaces( ctx, new_state ); - - if (new_state & prog_flags) { - /* When we generate programs from fixed-function vertex/fragment state - * this call may generate/bind a new program. If so, we need to - * propogate the _NEW_PROGRAM flag to the driver. - */ - new_prog_state |= update_program( ctx ); - } - - /* - * Give the driver a chance to act upon the new_state flags. - * The driver might plug in different span functions, for example. - * Also, this is where the driver can invalidate the state of any - * active modules (such as swrast_setup, swrast, tnl, etc). - * - * Set ctx->NewState to zero to avoid recursion if - * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?) - */ - new_state = ctx->NewState | new_prog_state; - ctx->NewState = 0; - ctx->Driver.UpdateState(ctx, new_state); - ctx->Array.NewState = 0; -} - - -/* This is the usual entrypoint for state updates: - */ -void -_mesa_update_state( GLcontext *ctx ) -{ - _mesa_lock_context_textures(ctx); - _mesa_update_state_locked(ctx); - _mesa_unlock_context_textures(ctx); -} diff --git a/src/libs/mesa/mesa/main/state.h b/src/libs/mesa/mesa/main/state.h deleted file mode 100644 index bb7cb8f32a..0000000000 --- a/src/libs/mesa/mesa/main/state.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 STATE_H -#define STATE_H - -#include "mtypes.h" - -extern void -_mesa_update_state( GLcontext *ctx ); - -/* As above but can only be called between _mesa_lock_context_textures() and - * _mesa_unlock_context_textures(). - */ -extern void -_mesa_update_state_locked( GLcontext *ctx ); - - -#endif diff --git a/src/libs/mesa/mesa/main/stencil.c b/src/libs/mesa/mesa/main/stencil.c deleted file mode 100644 index e4a255d0a7..0000000000 --- a/src/libs/mesa/mesa/main/stencil.c +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file stencil.c - * Stencil operations. - * - * Note: There's some conflict between GL_EXT_stencil_two_side and - * OpenGL 2.0's two-sided stencil feature. - * - * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the - * front OR back face state (as set by glActiveStencilFaceEXT) is set. - * - * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the - * front AND back state. - * - * Also, note that GL_ATI_separate_stencil is different as well: - * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. - * glStencilFuncSeparate(GLenum face, GLenum func, ...). - * - * This problem is solved by keeping three sets of stencil state: - * state[0] = GL_FRONT state. - * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state. - * state[2] = GL_EXT_stencil_two_side GL_BACK state. - */ - - -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "stencil.h" -#include "mtypes.h" - - -static GLboolean -validate_stencil_op(GLcontext *ctx, GLenum op) -{ - switch (op) { - case GL_KEEP: - case GL_ZERO: - case GL_REPLACE: - case GL_INCR: - case GL_DECR: - case GL_INVERT: - return GL_TRUE; - case GL_INCR_WRAP_EXT: - case GL_DECR_WRAP_EXT: - if (ctx->Extensions.EXT_stencil_wrap) { - return GL_TRUE; - } - /* FALL-THROUGH */ - default: - return GL_FALSE; - } -} - - -static GLboolean -validate_stencil_func(GLcontext *ctx, GLenum func) -{ - switch (func) { - case GL_NEVER: - case GL_LESS: - case GL_LEQUAL: - case GL_GREATER: - case GL_GEQUAL: - case GL_EQUAL: - case GL_NOTEQUAL: - case GL_ALWAYS: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Set the clear value for the stencil buffer. - * - * \param s clear value. - * - * \sa glClearStencil(). - * - * Updates gl_stencil_attrib::Clear. On change - * flushes the vertices and notifies the driver via - * the dd_function_table::ClearStencil callback. - */ -void GLAPIENTRY -_mesa_ClearStencil( GLint s ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Stencil.Clear == (GLuint) s) - return; - - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Clear = (GLuint) s; - - if (ctx->Driver.ClearStencil) { - ctx->Driver.ClearStencil( ctx, s ); - } -} - - -/** - * Set the function and reference value for stencil testing. - * - * \param frontfunc front test function. - * \param backfunc back test function. - * \param ref front and back reference value. - * \param mask front and back bitmask. - * - * \sa glStencilFunc(). - * - * Verifies the parameters and updates the respective values in - * __GLcontextRec::Stencil. On change flushes the vertices and notifies the - * driver via the dd_function_table::StencilFunc callback. - */ -void GLAPIENTRY -_mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!validate_stencil_func(ctx, frontfunc)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glStencilFuncSeparateATI(frontfunc)"); - return; - } - if (!validate_stencil_func(ctx, backfunc)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glStencilFuncSeparateATI(backfunc)"); - return; - } - - ref = CLAMP( ref, 0, stencilMax ); - - /* set both front and back state */ - if (ctx->Stencil.Function[0] == frontfunc && - ctx->Stencil.Function[1] == backfunc && - ctx->Stencil.ValueMask[0] == mask && - ctx->Stencil.ValueMask[1] == mask && - ctx->Stencil.Ref[0] == ref && - ctx->Stencil.Ref[1] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[0] = frontfunc; - ctx->Stencil.Function[1] = backfunc; - ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, - frontfunc, ref, mask); - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, - backfunc, ref, mask); - } -} - - -/** - * Set the function and reference value for stencil testing. - * - * \param func test function. - * \param ref reference value. - * \param mask bitmask. - * - * \sa glStencilFunc(). - * - * Verifies the parameters and updates the respective values in - * __GLcontextRec::Stencil. On change flushes the vertices and notifies the - * driver via the dd_function_table::StencilFunc callback. - */ -void GLAPIENTRY -_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - const GLint face = ctx->Stencil.ActiveFace; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!validate_stencil_func(ctx, func)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)"); - return; - } - - ref = CLAMP( ref, 0, stencilMax ); - - if (face != 0) { - if (ctx->Stencil.Function[face] == func && - ctx->Stencil.ValueMask[face] == mask && - ctx->Stencil.Ref[face] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[face] = func; - ctx->Stencil.Ref[face] = ref; - ctx->Stencil.ValueMask[face] = mask; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.Function[0] == func && - ctx->Stencil.Function[1] == func && - ctx->Stencil.ValueMask[0] == mask && - ctx->Stencil.ValueMask[1] == mask && - ctx->Stencil.Ref[0] == ref && - ctx->Stencil.Ref[1] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func; - ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - func, ref, mask); - } - } -} - - -/** - * Set the stencil writing mask. - * - * \param mask bit-mask to enable/disable writing of individual bits in the - * stencil planes. - * - * \sa glStencilMask(). - * - * Updates gl_stencil_attrib::WriteMask. On change flushes the vertices and - * notifies the driver via the dd_function_table::StencilMask callback. - */ -void GLAPIENTRY -_mesa_StencilMask( GLuint mask ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint face = ctx->Stencil.ActiveFace; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (face != 0) { - /* Only modify the EXT_stencil_two_side back-face state. - */ - if (ctx->Stencil.WriteMask[face] == mask) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.WriteMask[face] = mask; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.WriteMask[0] == mask && - ctx->Stencil.WriteMask[1] == mask) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - mask); - } - } -} - - -/** - * Set the stencil test actions. - * - * \param fail action to take when stencil test fails. - * \param zfail action to take when stencil test passes, but depth test fails. - * \param zpass action to take when stencil test passes and the depth test - * passes (or depth testing is not enabled). - * - * \sa glStencilOp(). - * - * Verifies the parameters and updates the respective fields in - * __GLcontextRec::Stencil. On change flushes the vertices and notifies the - * driver via the dd_function_table::StencilOp callback. - */ -void GLAPIENTRY -_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint face = ctx->Stencil.ActiveFace; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!validate_stencil_op(ctx, fail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)"); - return; - } - if (!validate_stencil_op(ctx, zfail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zfail)"); - return; - } - if (!validate_stencil_op(ctx, zpass)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zpass)"); - return; - } - - if (face != 0) { - /* only set active face state */ - if (ctx->Stencil.ZFailFunc[face] == zfail && - ctx->Stencil.ZPassFunc[face] == zpass && - ctx->Stencil.FailFunc[face] == fail) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[face] = zfail; - ctx->Stencil.ZPassFunc[face] = zpass; - ctx->Stencil.FailFunc[face] = fail; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.ZFailFunc[0] == zfail && - ctx->Stencil.ZFailFunc[1] == zfail && - ctx->Stencil.ZPassFunc[0] == zpass && - ctx->Stencil.ZPassFunc[1] == zpass && - ctx->Stencil.FailFunc[0] == fail && - ctx->Stencil.FailFunc[1] == fail) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail; - ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass; - ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail; - if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - fail, zfail, zpass); - } - } -} - - - -#if _HAVE_FULL_GL -/* GL_EXT_stencil_two_side */ -void GLAPIENTRY -_mesa_ActiveStencilFaceEXT(GLenum face) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_stencil_two_side) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveStencilFaceEXT"); - return; - } - - if (face == GL_FRONT || face == GL_BACK) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); - } -} -#endif - - - -/** - * OpenGL 2.0 function. - * \todo Make StencilOp() call this function. And eventually remove the - * ctx->Driver.StencilOp function and use ctx->Driver.StencilOpSeparate - * instead. - */ -void GLAPIENTRY -_mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - GLboolean set = GL_FALSE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!validate_stencil_op(ctx, sfail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(sfail)"); - return; - } - if (!validate_stencil_op(ctx, zfail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zfail)"); - return; - } - if (!validate_stencil_op(ctx, zpass)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zpass)"); - return; - } - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(face)"); - return; - } - - if (face != GL_BACK) { - /* set front */ - if (ctx->Stencil.ZFailFunc[0] != zfail || - ctx->Stencil.ZPassFunc[0] != zpass || - ctx->Stencil.FailFunc[0] != sfail){ - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[0] = zfail; - ctx->Stencil.ZPassFunc[0] = zpass; - ctx->Stencil.FailFunc[0] = sfail; - set = GL_TRUE; - } - } - if (face != GL_FRONT) { - /* set back */ - if (ctx->Stencil.ZFailFunc[1] != zfail || - ctx->Stencil.ZPassFunc[1] != zpass || - ctx->Stencil.FailFunc[1] != sfail) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[1] = zfail; - ctx->Stencil.ZPassFunc[1] = zpass; - ctx->Stencil.FailFunc[1] = sfail; - set = GL_TRUE; - } - } - if (set && ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, face, sfail, zfail, zpass); - } -} - - -/* OpenGL 2.0 */ -void GLAPIENTRY -_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)"); - return; - } - if (!validate_stencil_func(ctx, func)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)"); - return; - } - - ref = CLAMP(ref, 0, stencilMax); - - FLUSH_VERTICES(ctx, _NEW_STENCIL); - - if (face != GL_BACK) { - /* set front */ - ctx->Stencil.Function[0] = func; - ctx->Stencil.Ref[0] = ref; - ctx->Stencil.ValueMask[0] = mask; - } - if (face != GL_FRONT) { - /* set back */ - ctx->Stencil.Function[1] = func; - ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[1] = mask; - } - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask); - } -} - - -/* OpenGL 2.0 */ -void GLAPIENTRY -_mesa_StencilMaskSeparate(GLenum face, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilaMaskSeparate(face)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_STENCIL); - - if (face != GL_BACK) { - ctx->Stencil.WriteMask[0] = mask; - } - if (face != GL_FRONT) { - ctx->Stencil.WriteMask[1] = mask; - } - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, face, mask); - } -} - - -/** - * Update derived stencil state. - */ -void -_mesa_update_stencil(GLcontext *ctx) -{ - const GLint face = ctx->Stencil._BackFace; - - ctx->Stencil._TestTwoSide = - (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] || - ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] || - ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] || - ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] || - ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] || - ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] || - ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]); -} - - -/** - * Initialize the context stipple state. - * - * \param ctx GL context. - * - * Initializes __GLcontextRec::Stencil attribute group. - */ -void -_mesa_init_stencil(GLcontext *ctx) -{ - ctx->Stencil.Enabled = GL_FALSE; - ctx->Stencil.TestTwoSide = GL_FALSE; - ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */ - ctx->Stencil.Function[0] = GL_ALWAYS; - ctx->Stencil.Function[1] = GL_ALWAYS; - ctx->Stencil.Function[2] = GL_ALWAYS; - ctx->Stencil.FailFunc[0] = GL_KEEP; - ctx->Stencil.FailFunc[1] = GL_KEEP; - ctx->Stencil.FailFunc[2] = GL_KEEP; - ctx->Stencil.ZPassFunc[0] = GL_KEEP; - ctx->Stencil.ZPassFunc[1] = GL_KEEP; - ctx->Stencil.ZPassFunc[2] = GL_KEEP; - ctx->Stencil.ZFailFunc[0] = GL_KEEP; - ctx->Stencil.ZFailFunc[1] = GL_KEEP; - ctx->Stencil.ZFailFunc[2] = GL_KEEP; - ctx->Stencil.Ref[0] = 0; - ctx->Stencil.Ref[1] = 0; - ctx->Stencil.Ref[2] = 0; - ctx->Stencil.ValueMask[0] = ~0U; - ctx->Stencil.ValueMask[1] = ~0U; - ctx->Stencil.ValueMask[2] = ~0U; - ctx->Stencil.WriteMask[0] = ~0U; - ctx->Stencil.WriteMask[1] = ~0U; - ctx->Stencil.WriteMask[2] = ~0U; - ctx->Stencil.Clear = 0; - ctx->Stencil._BackFace = 1; -} diff --git a/src/libs/mesa/mesa/main/stencil.h b/src/libs/mesa/mesa/main/stencil.h deleted file mode 100644 index 252ac932ac..0000000000 --- a/src/libs/mesa/mesa/main/stencil.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * \file stencil.h - * Stencil operations. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 STENCIL_H -#define STENCIL_H - - -#include "mtypes.h" - - -extern void GLAPIENTRY -_mesa_ClearStencil( GLint s ); - - -extern void GLAPIENTRY -_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ); - - -extern void GLAPIENTRY -_mesa_StencilMask( GLuint mask ); - - -extern void GLAPIENTRY -_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - - -extern void GLAPIENTRY -_mesa_ActiveStencilFaceEXT(GLenum face); - - -extern void GLAPIENTRY -_mesa_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); - - -extern void GLAPIENTRY -_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); - - -extern void GLAPIENTRY -_mesa_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - -extern void GLAPIENTRY -_mesa_StencilMaskSeparate(GLenum face, GLuint mask); - - -extern void -_mesa_update_stencil(GLcontext *ctx); - - -extern void -_mesa_init_stencil( GLcontext * ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/texcompress.c b/src/libs/mesa/mesa/main/texcompress.c deleted file mode 100644 index 3ff633acd2..0000000000 --- a/src/libs/mesa/mesa/main/texcompress.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file texcompress.c - * Helper functions for texture compression. - */ - - -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "image.h" -#include "mipmap.h" -#include "texcompress.h" -#include "texformat.h" -#include "texstore.h" - - -/** - * Return list of (and count of) all specific texture compression - * formats that are supported. - * - * \param ctx the GL context - * \param formats the resulting format list (may be NULL). - * \param all if true return all formats, even those with some kind - * of restrictions/limitations (See GL_ARB_texture_compression - * spec for more info). - * - * \return number of formats. - */ -GLuint -_mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) -{ - GLuint n = 0; - if (ctx->Extensions.ARB_texture_compression) { - if (ctx->Extensions.TDFX_texture_compression_FXT1) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX; - formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX; - } - else { - n += 2; - } - } - if (ctx->Extensions.EXT_texture_compression_s3tc) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; - /* This format has some restrictions/limitations and so should - * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query. - * Specifically, all transparent pixels become black. NVIDIA - * omits this format too. - */ - if (all) - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - } - else { - n += 3; - if (all) - n += 1; - } - } - if (ctx->Extensions.S3_s3tc) { - if (formats) { - formats[n++] = GL_RGB_S3TC; - formats[n++] = GL_RGB4_S3TC; - formats[n++] = GL_RGBA_S3TC; - formats[n++] = GL_RGBA4_S3TC; - } - else { - n += 4; - } - } -#if FEATURE_EXT_texture_sRGB - if (ctx->Extensions.EXT_texture_sRGB) { - if (formats) { - formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - } - else { - n += 4; - } - } -#endif /* FEATURE_EXT_texture_sRGB */ - } - return n; -} - - - -/** - * Return number of bytes needed to store a texture of the given size - * using the specified compressed format. - * This is called via the ctx->Driver.CompressedTextureSize function, - * unless a device driver overrides it. - * - * \param width texture width in texels. - * \param height texture height in texels. - * \param depth texture depth in texels. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * - * \return size in bytes, or zero if bad format - */ -GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ) -{ - GLuint size; - - ASSERT(depth == 1); - (void) depth; - - switch (mesaFormat) { - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - /* round up width to next multiple of 8, height to next multiple of 4 */ - width = (width + 7) & ~7; - height = (height + 3) & ~3; - /* 16 bytes per 8x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 8x4 will effectively be made into 8x4 and - * take 16 bytes. - */ - return size; - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 8 bytes per 4x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 8 bytes. - */ - return size; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 16 bytes per 4x4 tile of RGBA texels */ - size = width * height; /* simple! */ - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 16 bytes. - */ - return size; - default: - _mesa_problem(ctx, "bad mesaFormat in _mesa_compressed_texture_size"); - return 0; - } -} - - -/** - * As above, but format is specified by a GLenum (GL_COMPRESSED_*) token. - * - * Note: This function CAN NOT return a padded hardware texture size. - * That's why we don't call the ctx->Driver.CompressedTextureSize() function. - * - * We use this function to validate the parameter - * of glCompressedTex[Sub]Image1/2/3D(), which must be an exact match. - */ -GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat) -{ - GLuint mesaFormat; - - switch (glformat) { - case GL_COMPRESSED_RGB_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGB_FXT1; - break; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGBA_FXT1; - break; - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - case GL_RGB_S3TC: - mesaFormat = MESA_FORMAT_RGB_DXT1; - break; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - case GL_RGB4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT1; - break; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_RGBA_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT3; - break; - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case GL_RGBA4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT5; - break; - default: - return 0; - } - - return _mesa_compressed_texture_size(ctx, width, height, depth, mesaFormat); -} - - -/* - * Compute the bytes per row in a compressed texture image. - * We use this for computing the destination address for sub-texture updates. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * \param width image width in pixels - * \return stride, in bytes, between rows for compressed image - */ -GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) -{ - GLint stride; - - switch (mesaFormat) { - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - stride = ((width + 7) / 8) * 16; /* 16 bytes per 8x4 tile */ - break; - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - stride = ((width + 3) / 4) * 8; /* 8 bytes per 4x4 tile */ - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - stride = ((width + 3) / 4) * 16; /* 16 bytes per 4x4 tile */ - break; - default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_row_stride"); - return 0; - } - - return stride; -} - - -/* - * Return the address of the pixel at (col, row, img) in a - * compressed texture image. - * \param col, row, img - image position (3D) - * \param format - compressed image format - * \param width - image width - * \param image - the image address - * \return address of pixel at (row, col) - */ -GLubyte * -_mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, - GLsizei width, const GLubyte *image) -{ - GLubyte *addr; - - (void) img; - - /* We try to spot a "complete" subtexture "above" ROW, COL; - * this texture is given by appropriate rounding of WIDTH x ROW. - * Then we just add the amount left (usually on the left). - * - * Example for X*Y microtiles (Z bytes each) - * offset = Z * (((width + X - 1) / X) * (row / Y) + col / X); - */ - - switch (mesaFormat) { - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - addr = (GLubyte *) image + 16 * (((width + 7) / 8) * (row / 4) + col / 8); - break; - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - addr = (GLubyte *) image + 8 * (((width + 3) / 4) * (row / 4) + col / 4); - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - addr = (GLubyte *) image + 16 * (((width + 3) / 4) * (row / 4) + col / 4); - break; - default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_image_address"); - addr = NULL; - } - - return addr; -} diff --git a/src/libs/mesa/mesa/main/texcompress.h b/src/libs/mesa/mesa/main/texcompress.h deleted file mode 100644 index 44f3338222..0000000000 --- a/src/libs/mesa/mesa/main/texcompress.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 TEXCOMPRESS_H -#define TEXCOMPRESS_H - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern GLuint -_mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); - -extern GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ); - -extern GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat); - -extern GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width); - - -extern GLubyte * -_mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, - GLsizei width, const GLubyte *image); - - -extern void -_mesa_init_texture_s3tc( GLcontext *ctx ); - -extern void -_mesa_init_texture_fxt1( GLcontext *ctx ); - - -#else /* _HAVE_FULL_GL */ - -/* no-op macros */ -#define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_texture_size( c, w, h, d, f ) 0 -#define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 -#define _mesa_compressed_row_stride( f, w) 0 -#define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 -#define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) - -#endif /* _HAVE_FULL_GL */ - -#endif /* TEXCOMPRESS_H */ diff --git a/src/libs/mesa/mesa/main/texcompress_fxt1.c b/src/libs/mesa/mesa/main/texcompress_fxt1.c deleted file mode 100644 index 45f344b0c5..0000000000 --- a/src/libs/mesa/mesa/main/texcompress_fxt1.c +++ /dev/null @@ -1,1724 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file texcompress_fxt1.c - * GL_EXT_texture_compression_fxt1 support. - */ - - -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "convolve.h" -#include "image.h" -#include "mipmap.h" -#include "texcompress.h" -#include "texformat.h" -#include "texstore.h" - - -static void -fxt1_encode (GLuint width, GLuint height, GLint comps, - const void *source, GLint srcRowStride, - void *dest, GLint destRowStride); - -void -fxt1_decode_1 (const void *texture, GLint stride, - GLint i, GLint j, GLchan *rgba); - - -/** - * Called during context initialization. - */ -void -_mesa_init_texture_fxt1( GLcontext *ctx ) -{ - (void) ctx; -} - - -/** - * Called via TexFormat->StoreImage to store an RGB_FXT1 texture. - */ -static GLboolean -texstore_rgb_fxt1(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - const GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgb_fxt1); - ASSERT(dstXoffset % 8 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGB || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGB/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 3 * srcWidth; - srcFormat = GL_RGB; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - - fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride, - dst, dstRowStride); - - if (tempImage) - _mesa_free((void*) tempImage); - - return GL_TRUE; -} - - -/** - * Called via TexFormat->StoreImage to store an RGBA_FXT1 texture. - */ -static GLboolean -texstore_rgba_fxt1(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgba_fxt1); - ASSERT(dstXoffset % 8 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGBA || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGBA/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 4 * srcWidth; - srcFormat = GL_RGBA; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - - fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride, - dst, dstRowStride); - - if (tempImage) - _mesa_free((void*) tempImage); - - return GL_TRUE; -} - - -static void -fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); -} - - -static void -fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); -} - - -static void -fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); - texel[ACOMP] = 255; -} - - -static void -fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = 1.0F; -} - - - -const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { - MESA_FORMAT_RGB_FXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_fxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { - MESA_FORMAT_RGBA_FXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_fxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - - -/***************************************************************************\ - * FXT1 encoder - * - * The encoder was built by reversing the decoder, - * and is vaguely based on Texus2 by 3dfx. Note that this code - * is merely a proof of concept, since it is highly UNoptimized; - * moreover, it is sub-optimal due to initial conditions passed - * to Lloyd's algorithm (the interpolation modes are even worse). -\***************************************************************************/ - - -#define MAX_COMP 4 /* ever needed maximum number of components in texel */ -#define MAX_VECT 4 /* ever needed maximum number of base vectors to find */ -#define N_TEXELS 32 /* number of texels in a block (always 32) */ -#define LL_N_REP 50 /* number of iterations in lloyd's vq */ -#define LL_RMS_D 10 /* fault tolerance (maximum delta) */ -#define LL_RMS_E 255 /* fault tolerance (maximum error) */ -#define ALPHA_TS 2 /* alpha threshold: (255 - ALPHA_TS) deemed opaque */ -#define ISTBLACK(v) (*((GLuint *)(v)) == 0) - - -/* - * Define a 64-bit unsigned integer type and macros - */ -#ifdef GL_EXT_timer_query /* this extensions defines the GLuint64EXT type */ - -#define FX64_NATIVE 1 - -typedef GLuint64EXT Fx64; - -#define FX64_MOV32(a, b) a = b -#define FX64_OR32(a, b) a |= b -#define FX64_SHL(a, c) a <<= c - -#else /* !GL_EXT_timer_query */ - -#define FX64_NATIVE 0 - -typedef struct { - GLuint lo, hi; -} Fx64; - -#define FX64_MOV32(a, b) a.lo = b -#define FX64_OR32(a, b) a.lo |= b - -#define FX64_SHL(a, c) \ - do { \ - if ((c) >= 32) { \ - a.hi = a.lo << ((c) - 32); \ - a.lo = 0; \ - } else { \ - a.hi = (a.hi << (c)) | (a.lo >> (32 - (c))); \ - a.lo <<= (c); \ - } \ - } while (0) - -#endif /* !GL_EXT_timer_query */ - - -#define F(i) (GLfloat)1 /* can be used to obtain an oblong metric: 0.30 / 0.59 / 0.11 */ -#define SAFECDOT 1 /* for paranoids */ - -#define MAKEIVEC(NV, NC, IV, B, V0, V1) \ - do { \ - /* compute interpolation vector */ \ - GLfloat d2 = 0.0F; \ - GLfloat rd2; \ - \ - for (i = 0; i < NC; i++) { \ - IV[i] = (V1[i] - V0[i]) * F(i); \ - d2 += IV[i] * IV[i]; \ - } \ - rd2 = (GLfloat)NV / d2; \ - B = 0; \ - for (i = 0; i < NC; i++) { \ - IV[i] *= F(i); \ - B -= IV[i] * V0[i]; \ - IV[i] *= rd2; \ - } \ - B = B * rd2 + 0.5f; \ - } while (0) - -#define CALCCDOT(TEXEL, NV, NC, IV, B, V)\ - do { \ - GLfloat dot = 0.0F; \ - for (i = 0; i < NC; i++) { \ - dot += V[i] * IV[i]; \ - } \ - TEXEL = (GLint)(dot + B); \ - if (SAFECDOT) { \ - if (TEXEL < 0) { \ - TEXEL = 0; \ - } else if (TEXEL > NV) { \ - TEXEL = NV; \ - } \ - } \ - } while (0) - - -static GLint -fxt1_bestcol (GLfloat vec[][MAX_COMP], GLint nv, - GLubyte input[MAX_COMP], GLint nc) -{ - GLint i, j, best = -1; - GLfloat err = 1e9; /* big enough */ - - for (j = 0; j < nv; j++) { - GLfloat e = 0.0F; - for (i = 0; i < nc; i++) { - e += (vec[j][i] - input[i]) * (vec[j][i] - input[i]); - } - if (e < err) { - err = e; - best = j; - } - } - - return best; -} - - -static GLint -fxt1_worst (GLfloat vec[MAX_COMP], - GLubyte input[N_TEXELS][MAX_COMP], GLint nc, GLint n) -{ - GLint i, k, worst = -1; - GLfloat err = -1.0F; /* small enough */ - - for (k = 0; k < n; k++) { - GLfloat e = 0.0F; - for (i = 0; i < nc; i++) { - e += (vec[i] - input[k][i]) * (vec[i] - input[k][i]); - } - if (e > err) { - err = e; - worst = k; - } - } - - return worst; -} - - -static GLint -fxt1_variance (GLdouble variance[MAX_COMP], - GLubyte input[N_TEXELS][MAX_COMP], GLint nc, GLint n) -{ - GLint i, k, best = 0; - GLint sx, sx2; - GLdouble var, maxvar = -1; /* small enough */ - GLdouble teenth = 1.0 / n; - - for (i = 0; i < nc; i++) { - sx = sx2 = 0; - for (k = 0; k < n; k++) { - GLint t = input[k][i]; - sx += t; - sx2 += t * t; - } - var = sx2 * teenth - sx * sx * teenth * teenth; - if (maxvar < var) { - maxvar = var; - best = i; - } - if (variance) { - variance[i] = var; - } - } - - return best; -} - - -static GLint -fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv, - GLubyte input[N_TEXELS][MAX_COMP], GLint nc, GLint n) -{ -#if 0 - /* Choose colors from a grid. - */ - GLint i, j; - - for (j = 0; j < nv; j++) { - GLint m = j * (n - 1) / (nv - 1); - for (i = 0; i < nc; i++) { - vec[j][i] = input[m][i]; - } - } -#else - /* Our solution here is to find the darkest and brightest colors in - * the 8x4 tile and use those as the two representative colors. - * There are probably better algorithms to use (histogram-based). - */ - GLint i, j, k; - GLint minSum = 2000; /* big enough */ - GLint maxSum = -1; /* small enough */ - GLint minCol = 0; /* phoudoin: silent compiler! */ - GLint maxCol = 0; /* phoudoin: silent compiler! */ - - struct { - GLint flag; - GLint key; - GLint freq; - GLint idx; - } hist[N_TEXELS]; - GLint lenh = 0; - - _mesa_memset(hist, 0, sizeof(hist)); - - for (k = 0; k < n; k++) { - GLint l; - GLint key = 0; - GLint sum = 0; - for (i = 0; i < nc; i++) { - key <<= 8; - key |= input[k][i]; - sum += input[k][i]; - } - for (l = 0; l < n; l++) { - if (!hist[l].flag) { - /* alloc new slot */ - hist[l].flag = !0; - hist[l].key = key; - hist[l].freq = 1; - hist[l].idx = k; - lenh = l + 1; - break; - } else if (hist[l].key == key) { - hist[l].freq++; - break; - } - } - if (minSum > sum) { - minSum = sum; - minCol = k; - } - if (maxSum < sum) { - maxSum = sum; - maxCol = k; - } - } - - if (lenh <= nv) { - for (j = 0; j < lenh; j++) { - for (i = 0; i < nc; i++) { - vec[j][i] = (GLfloat)input[hist[j].idx][i]; - } - } - for (; j < nv; j++) { - for (i = 0; i < nc; i++) { - vec[j][i] = vec[0][i]; - } - } - return 0; - } - - for (j = 0; j < nv; j++) { - for (i = 0; i < nc; i++) { - vec[j][i] = ((nv - 1 - j) * input[minCol][i] + j * input[maxCol][i] + (nv - 1) / 2) / (GLfloat)(nv - 1); - } - } -#endif - - return !0; -} - - -static GLint -fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv, - GLubyte input[N_TEXELS][MAX_COMP], GLint nc, GLint n) -{ - /* Use the generalized lloyd's algorithm for VQ: - * find 4 color vectors. - * - * for each sample color - * sort to nearest vector. - * - * replace each vector with the centroid of it's matching colors. - * - * repeat until RMS doesn't improve. - * - * if a color vector has no samples, or becomes the same as another - * vector, replace it with the color which is farthest from a sample. - * - * vec[][MAX_COMP] initial vectors and resulting colors - * nv number of resulting colors required - * input[N_TEXELS][MAX_COMP] input texels - * nc number of components in input / vec - * n number of input samples - */ - - GLint sum[MAX_VECT][MAX_COMP]; /* used to accumulate closest texels */ - GLint cnt[MAX_VECT]; /* how many times a certain vector was chosen */ - GLfloat error, lasterror = 1e9; - - GLint i, j, k, rep; - - /* the quantizer */ - for (rep = 0; rep < LL_N_REP; rep++) { - /* reset sums & counters */ - for (j = 0; j < nv; j++) { - for (i = 0; i < nc; i++) { - sum[j][i] = 0; - } - cnt[j] = 0; - } - error = 0; - - /* scan whole block */ - for (k = 0; k < n; k++) { -#if 1 - GLint best = -1; - GLfloat err = 1e9; /* big enough */ - /* determine best vector */ - for (j = 0; j < nv; j++) { - GLfloat e = (vec[j][0] - input[k][0]) * (vec[j][0] - input[k][0]) + - (vec[j][1] - input[k][1]) * (vec[j][1] - input[k][1]) + - (vec[j][2] - input[k][2]) * (vec[j][2] - input[k][2]); - if (nc == 4) { - e += (vec[j][3] - input[k][3]) * (vec[j][3] - input[k][3]); - } - if (e < err) { - err = e; - best = j; - } - } -#else - GLint best = fxt1_bestcol(vec, nv, input[k], nc, &err); -#endif - /* add in closest color */ - for (i = 0; i < nc; i++) { - sum[best][i] += input[k][i]; - } - /* mark this vector as used */ - cnt[best]++; - /* accumulate error */ - error += err; - } - - /* check RMS */ - if ((error < LL_RMS_E) || - ((error < lasterror) && ((lasterror - error) < LL_RMS_D))) { - return !0; /* good match */ - } - lasterror = error; - - /* move each vector to the barycenter of its closest colors */ - for (j = 0; j < nv; j++) { - if (cnt[j]) { - GLfloat div = 1.0F / cnt[j]; - for (i = 0; i < nc; i++) { - vec[j][i] = div * sum[j][i]; - } - } else { - /* this vec has no samples or is identical with a previous vec */ - GLint worst = fxt1_worst(vec[j], input, nc, n); - for (i = 0; i < nc; i++) { - vec[j][i] = input[worst][i]; - } - } - } - } - - return 0; /* could not converge fast enough */ -} - - -static void -fxt1_quantize_CHROMA (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP]) -{ - const GLint n_vect = 4; /* 4 base vectors to find */ - const GLint n_comp = 3; /* 3 components: R, G, B */ - GLfloat vec[MAX_VECT][MAX_COMP]; - GLint i, j, k; - Fx64 hi; /* high quadword */ - GLuint lohi, lolo; /* low quadword: hi dword, lo dword */ - - if (fxt1_choose(vec, n_vect, input, n_comp, N_TEXELS) != 0) { - fxt1_lloyd(vec, n_vect, input, n_comp, N_TEXELS); - } - - FX64_MOV32(hi, 4); /* cc-chroma = "010" + unused bit */ - for (j = n_vect - 1; j >= 0; j--) { - for (i = 0; i < n_comp; i++) { - /* add in colors */ - FX64_SHL(hi, 5); - FX64_OR32(hi, (GLuint)(vec[j][i] / 8.0F)); - } - } - ((Fx64 *)cc)[1] = hi; - - lohi = lolo = 0; - /* right microtile */ - for (k = N_TEXELS - 1; k >= N_TEXELS/2; k--) { - lohi <<= 2; - lohi |= fxt1_bestcol(vec, n_vect, input[k], n_comp); - } - /* left microtile */ - for (; k >= 0; k--) { - lolo <<= 2; - lolo |= fxt1_bestcol(vec, n_vect, input[k], n_comp); - } - cc[1] = lohi; - cc[0] = lolo; -} - - -static void -fxt1_quantize_ALPHA0 (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP], - GLubyte reord[N_TEXELS][MAX_COMP], GLint n) -{ - const GLint n_vect = 3; /* 3 base vectors to find */ - const GLint n_comp = 4; /* 4 components: R, G, B, A */ - GLfloat vec[MAX_VECT][MAX_COMP]; - GLint i, j, k; - Fx64 hi; /* high quadword */ - GLuint lohi, lolo; /* low quadword: hi dword, lo dword */ - - /* the last vector indicates zero */ - for (i = 0; i < n_comp; i++) { - vec[n_vect][i] = 0; - } - - /* the first n texels in reord are guaranteed to be non-zero */ - if (fxt1_choose(vec, n_vect, reord, n_comp, n) != 0) { - fxt1_lloyd(vec, n_vect, reord, n_comp, n); - } - - FX64_MOV32(hi, 6); /* alpha = "011" + lerp = 0 */ - for (j = n_vect - 1; j >= 0; j--) { - /* add in alphas */ - FX64_SHL(hi, 5); - FX64_OR32(hi, (GLuint)(vec[j][ACOMP] / 8.0F)); - } - for (j = n_vect - 1; j >= 0; j--) { - for (i = 0; i < n_comp - 1; i++) { - /* add in colors */ - FX64_SHL(hi, 5); - FX64_OR32(hi, (GLuint)(vec[j][i] / 8.0F)); - } - } - ((Fx64 *)cc)[1] = hi; - - lohi = lolo = 0; - /* right microtile */ - for (k = N_TEXELS - 1; k >= N_TEXELS/2; k--) { - lohi <<= 2; - lohi |= fxt1_bestcol(vec, n_vect + 1, input[k], n_comp); - } - /* left microtile */ - for (; k >= 0; k--) { - lolo <<= 2; - lolo |= fxt1_bestcol(vec, n_vect + 1, input[k], n_comp); - } - cc[1] = lohi; - cc[0] = lolo; -} - - -static void -fxt1_quantize_ALPHA1 (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP]) -{ - const GLint n_vect = 3; /* highest vector number in each microtile */ - const GLint n_comp = 4; /* 4 components: R, G, B, A */ - GLfloat vec[1 + 1 + 1][MAX_COMP]; /* 1.5 extrema for each sub-block */ - GLfloat b, iv[MAX_COMP]; /* interpolation vector */ - GLint i, j, k; - Fx64 hi; /* high quadword */ - GLuint lohi, lolo; /* low quadword: hi dword, lo dword */ - - GLint minSum; - GLint maxSum; - GLint minColL = 0, maxColL = 0; - GLint minColR = 0, maxColR = 0; - GLint sumL = 0, sumR = 0; - GLint nn_comp; - /* Our solution here is to find the darkest and brightest colors in - * the 4x4 tile and use those as the two representative colors. - * There are probably better algorithms to use (histogram-based). - */ - nn_comp = n_comp; - while ((minColL == maxColL) && nn_comp) { - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (k = 0; k < N_TEXELS / 2; k++) { - GLint sum = 0; - for (i = 0; i < nn_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColL = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColL = k; - } - sumL += sum; - } - - nn_comp--; - } - - nn_comp = n_comp; - while ((minColR == maxColR) && nn_comp) { - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (k = N_TEXELS / 2; k < N_TEXELS; k++) { - GLint sum = 0; - for (i = 0; i < nn_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColR = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColR = k; - } - sumR += sum; - } - - nn_comp--; - } - - /* choose the common vector (yuck!) */ - { - GLint j1, j2; - GLint v1 = 0, v2 = 0; - GLfloat err = 1e9; /* big enough */ - GLfloat tv[2 * 2][MAX_COMP]; /* 2 extrema for each sub-block */ - for (i = 0; i < n_comp; i++) { - tv[0][i] = input[minColL][i]; - tv[1][i] = input[maxColL][i]; - tv[2][i] = input[minColR][i]; - tv[3][i] = input[maxColR][i]; - } - for (j1 = 0; j1 < 2; j1++) { - for (j2 = 2; j2 < 4; j2++) { - GLfloat e = 0.0F; - for (i = 0; i < n_comp; i++) { - e += (tv[j1][i] - tv[j2][i]) * (tv[j1][i] - tv[j2][i]); - } - if (e < err) { - err = e; - v1 = j1; - v2 = j2; - } - } - } - for (i = 0; i < n_comp; i++) { - vec[0][i] = tv[1 - v1][i]; - vec[1][i] = (tv[v1][i] * sumL + tv[v2][i] * sumR) / (sumL + sumR); - vec[2][i] = tv[5 - v2][i]; - } - } - - /* left microtile */ - cc[0] = 0; - if (minColL != maxColL) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[0], vec[1]); - - /* add in texels */ - lolo = 0; - for (k = N_TEXELS / 2 - 1; k >= 0; k--) { - GLint texel; - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - /* add in texel */ - lolo <<= 2; - lolo |= texel; - } - - cc[0] = lolo; - } - - /* right microtile */ - cc[1] = 0; - if (minColR != maxColR) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[2], vec[1]); - - /* add in texels */ - lohi = 0; - for (k = N_TEXELS - 1; k >= N_TEXELS / 2; k--) { - GLint texel; - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - /* add in texel */ - lohi <<= 2; - lohi |= texel; - } - - cc[1] = lohi; - } - - FX64_MOV32(hi, 7); /* alpha = "011" + lerp = 1 */ - for (j = n_vect - 1; j >= 0; j--) { - /* add in alphas */ - FX64_SHL(hi, 5); - FX64_OR32(hi, (GLuint)(vec[j][ACOMP] / 8.0F)); - } - for (j = n_vect - 1; j >= 0; j--) { - for (i = 0; i < n_comp - 1; i++) { - /* add in colors */ - FX64_SHL(hi, 5); - FX64_OR32(hi, (GLuint)(vec[j][i] / 8.0F)); - } - } - ((Fx64 *)cc)[1] = hi; -} - - -static void -fxt1_quantize_HI (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP], - GLubyte reord[N_TEXELS][MAX_COMP], GLint n) -{ - const GLint n_vect = 6; /* highest vector number */ - const GLint n_comp = 3; /* 3 components: R, G, B */ - GLfloat b = 0.0F; /* phoudoin: silent compiler! */ - GLfloat iv[MAX_COMP]; /* interpolation vector */ - GLint i, k; - GLuint hihi; /* high quadword: hi dword */ - - GLint minSum = 2000; /* big enough */ - GLint maxSum = -1; /* small enough */ - GLint minCol = 0; /* phoudoin: silent compiler! */ - GLint maxCol = 0; /* phoudoin: silent compiler! */ - - /* Our solution here is to find the darkest and brightest colors in - * the 8x4 tile and use those as the two representative colors. - * There are probably better algorithms to use (histogram-based). - */ - for (k = 0; k < n; k++) { - GLint sum = 0; - for (i = 0; i < n_comp; i++) { - sum += reord[k][i]; - } - if (minSum > sum) { - minSum = sum; - minCol = k; - } - if (maxSum < sum) { - maxSum = sum; - maxCol = k; - } - } - - hihi = 0; /* cc-hi = "00" */ - for (i = 0; i < n_comp; i++) { - /* add in colors */ - hihi <<= 5; - hihi |= reord[maxCol][i] >> 3; - } - for (i = 0; i < n_comp; i++) { - /* add in colors */ - hihi <<= 5; - hihi |= reord[minCol][i] >> 3; - } - cc[3] = hihi; - cc[0] = cc[1] = cc[2] = 0; - - /* compute interpolation vector */ - if (minCol != maxCol) { - MAKEIVEC(n_vect, n_comp, iv, b, reord[minCol], reord[maxCol]); - } - - /* add in texels */ - for (k = N_TEXELS - 1; k >= 0; k--) { - GLint t = k * 3; - GLuint *kk = (GLuint *)((char *)cc + t / 8); - GLint texel = n_vect + 1; /* transparent black */ - - if (!ISTBLACK(input[k])) { - if (minCol != maxCol) { - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - /* add in texel */ - kk[0] |= texel << (t & 7); - } - } else { - /* add in texel */ - kk[0] |= texel << (t & 7); - } - } -} - - -static void -fxt1_quantize_MIXED1 (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP]) -{ - const GLint n_vect = 2; /* highest vector number in each microtile */ - const GLint n_comp = 3; /* 3 components: R, G, B */ - GLubyte vec[2 * 2][MAX_COMP]; /* 2 extrema for each sub-block */ - GLfloat b, iv[MAX_COMP]; /* interpolation vector */ - GLint i, j, k; - Fx64 hi; /* high quadword */ - GLuint lohi, lolo; /* low quadword: hi dword, lo dword */ - - GLint minSum; - GLint maxSum; - GLint minColL = 0, maxColL = -1; - GLint minColR = 0, maxColR = -1; - - /* Our solution here is to find the darkest and brightest colors in - * the 4x4 tile and use those as the two representative colors. - * There are probably better algorithms to use (histogram-based). - */ - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (k = 0; k < N_TEXELS / 2; k++) { - if (!ISTBLACK(input[k])) { - GLint sum = 0; - for (i = 0; i < n_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColL = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColL = k; - } - } - } - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (; k < N_TEXELS; k++) { - if (!ISTBLACK(input[k])) { - GLint sum = 0; - for (i = 0; i < n_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColR = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColR = k; - } - } - } - - /* left microtile */ - if (maxColL == -1) { - /* all transparent black */ - cc[0] = ~0u; - for (i = 0; i < n_comp; i++) { - vec[0][i] = 0; - vec[1][i] = 0; - } - } else { - cc[0] = 0; - for (i = 0; i < n_comp; i++) { - vec[0][i] = input[minColL][i]; - vec[1][i] = input[maxColL][i]; - } - if (minColL != maxColL) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[0], vec[1]); - - /* add in texels */ - lolo = 0; - for (k = N_TEXELS / 2 - 1; k >= 0; k--) { - GLint texel = n_vect + 1; /* transparent black */ - if (!ISTBLACK(input[k])) { - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - } - /* add in texel */ - lolo <<= 2; - lolo |= texel; - } - cc[0] = lolo; - } - } - - /* right microtile */ - if (maxColR == -1) { - /* all transparent black */ - cc[1] = ~0u; - for (i = 0; i < n_comp; i++) { - vec[2][i] = 0; - vec[3][i] = 0; - } - } else { - cc[1] = 0; - for (i = 0; i < n_comp; i++) { - vec[2][i] = input[minColR][i]; - vec[3][i] = input[maxColR][i]; - } - if (minColR != maxColR) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[2], vec[3]); - - /* add in texels */ - lohi = 0; - for (k = N_TEXELS - 1; k >= N_TEXELS / 2; k--) { - GLint texel = n_vect + 1; /* transparent black */ - if (!ISTBLACK(input[k])) { - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - } - /* add in texel */ - lohi <<= 2; - lohi |= texel; - } - cc[1] = lohi; - } - } - - FX64_MOV32(hi, 9 | (vec[3][GCOMP] & 4) | ((vec[1][GCOMP] >> 1) & 2)); /* chroma = "1" */ - for (j = 2 * 2 - 1; j >= 0; j--) { - for (i = 0; i < n_comp; i++) { - /* add in colors */ - FX64_SHL(hi, 5); - FX64_OR32(hi, vec[j][i] >> 3); - } - } - ((Fx64 *)cc)[1] = hi; -} - - -static void -fxt1_quantize_MIXED0 (GLuint *cc, - GLubyte input[N_TEXELS][MAX_COMP]) -{ - const GLint n_vect = 3; /* highest vector number in each microtile */ - const GLint n_comp = 3; /* 3 components: R, G, B */ - GLubyte vec[2 * 2][MAX_COMP]; /* 2 extrema for each sub-block */ - GLfloat b, iv[MAX_COMP]; /* interpolation vector */ - GLint i, j, k; - Fx64 hi; /* high quadword */ - GLuint lohi, lolo; /* low quadword: hi dword, lo dword */ - - GLint minColL = 0, maxColL = 0; - GLint minColR = 0, maxColR = 0; -#if 0 - GLint minSum; - GLint maxSum; - - /* Our solution here is to find the darkest and brightest colors in - * the 4x4 tile and use those as the two representative colors. - * There are probably better algorithms to use (histogram-based). - */ - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (k = 0; k < N_TEXELS / 2; k++) { - GLint sum = 0; - for (i = 0; i < n_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColL = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColL = k; - } - } - minSum = 2000; /* big enough */ - maxSum = -1; /* small enough */ - for (; k < N_TEXELS; k++) { - GLint sum = 0; - for (i = 0; i < n_comp; i++) { - sum += input[k][i]; - } - if (minSum > sum) { - minSum = sum; - minColR = k; - } - if (maxSum < sum) { - maxSum = sum; - maxColR = k; - } - } -#else - GLint minVal; - GLint maxVal; - GLint maxVarL = fxt1_variance(NULL, input, n_comp, N_TEXELS / 2); - GLint maxVarR = fxt1_variance(NULL, &input[N_TEXELS / 2], n_comp, N_TEXELS / 2); - - /* Scan the channel with max variance for lo & hi - * and use those as the two representative colors. - */ - minVal = 2000; /* big enough */ - maxVal = -1; /* small enough */ - for (k = 0; k < N_TEXELS / 2; k++) { - GLint t = input[k][maxVarL]; - if (minVal > t) { - minVal = t; - minColL = k; - } - if (maxVal < t) { - maxVal = t; - maxColL = k; - } - } - minVal = 2000; /* big enough */ - maxVal = -1; /* small enough */ - for (; k < N_TEXELS; k++) { - GLint t = input[k][maxVarR]; - if (minVal > t) { - minVal = t; - minColR = k; - } - if (maxVal < t) { - maxVal = t; - maxColR = k; - } - } -#endif - - /* left microtile */ - cc[0] = 0; - for (i = 0; i < n_comp; i++) { - vec[0][i] = input[minColL][i]; - vec[1][i] = input[maxColL][i]; - } - if (minColL != maxColL) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[0], vec[1]); - - /* add in texels */ - lolo = 0; - for (k = N_TEXELS / 2 - 1; k >= 0; k--) { - GLint texel; - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - /* add in texel */ - lolo <<= 2; - lolo |= texel; - } - - /* funky encoding for LSB of green */ - if ((GLint)((lolo >> 1) & 1) != (((vec[1][GCOMP] ^ vec[0][GCOMP]) >> 2) & 1)) { - for (i = 0; i < n_comp; i++) { - vec[1][i] = input[minColL][i]; - vec[0][i] = input[maxColL][i]; - } - lolo = ~lolo; - } - - cc[0] = lolo; - } - - /* right microtile */ - cc[1] = 0; - for (i = 0; i < n_comp; i++) { - vec[2][i] = input[minColR][i]; - vec[3][i] = input[maxColR][i]; - } - if (minColR != maxColR) { - /* compute interpolation vector */ - MAKEIVEC(n_vect, n_comp, iv, b, vec[2], vec[3]); - - /* add in texels */ - lohi = 0; - for (k = N_TEXELS - 1; k >= N_TEXELS / 2; k--) { - GLint texel; - /* interpolate color */ - CALCCDOT(texel, n_vect, n_comp, iv, b, input[k]); - /* add in texel */ - lohi <<= 2; - lohi |= texel; - } - - /* funky encoding for LSB of green */ - if ((GLint)((lohi >> 1) & 1) != (((vec[3][GCOMP] ^ vec[2][GCOMP]) >> 2) & 1)) { - for (i = 0; i < n_comp; i++) { - vec[3][i] = input[minColR][i]; - vec[2][i] = input[maxColR][i]; - } - lohi = ~lohi; - } - - cc[1] = lohi; - } - - FX64_MOV32(hi, 8 | (vec[3][GCOMP] & 4) | ((vec[1][GCOMP] >> 1) & 2)); /* chroma = "1" */ - for (j = 2 * 2 - 1; j >= 0; j--) { - for (i = 0; i < n_comp; i++) { - /* add in colors */ - FX64_SHL(hi, 5); - FX64_OR32(hi, vec[j][i] >> 3); - } - } - ((Fx64 *)cc)[1] = hi; -} - - -static void -fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps) -{ - GLint trualpha; - GLubyte reord[N_TEXELS][MAX_COMP]; - - GLubyte input[N_TEXELS][MAX_COMP]; - GLint i, k, l; - - if (comps == 3) { - /* make the whole block opaque */ - _mesa_memset(input, -1, sizeof(input)); - } - - /* 8 texels each line */ - for (l = 0; l < 4; l++) { - for (k = 0; k < 4; k++) { - for (i = 0; i < comps; i++) { - input[k + l * 4][i] = *lines[l]++; - } - } - for (; k < 8; k++) { - for (i = 0; i < comps; i++) { - input[k + l * 4 + 12][i] = *lines[l]++; - } - } - } - - /* block layout: - * 00, 01, 02, 03, 08, 09, 0a, 0b - * 10, 11, 12, 13, 18, 19, 1a, 1b - * 04, 05, 06, 07, 0c, 0d, 0e, 0f - * 14, 15, 16, 17, 1c, 1d, 1e, 1f - */ - - /* [dBorca] - * stupidity flows forth from this - */ - l = N_TEXELS; - trualpha = 0; - if (comps == 4) { - /* skip all transparent black texels */ - l = 0; - for (k = 0; k < N_TEXELS; k++) { - /* test all components against 0 */ - if (!ISTBLACK(input[k])) { - /* texel is not transparent black */ - COPY_4UBV(reord[l], input[k]); - if (reord[l][ACOMP] < (255 - ALPHA_TS)) { - /* non-opaque texel */ - trualpha = !0; - } - l++; - } - } - } - -#if 0 - if (trualpha) { - fxt1_quantize_ALPHA0(cc, input, reord, l); - } else if (l == 0) { - cc[0] = cc[1] = cc[2] = -1; - cc[3] = 0; - } else if (l < N_TEXELS) { - fxt1_quantize_HI(cc, input, reord, l); - } else { - fxt1_quantize_CHROMA(cc, input); - } - (void)fxt1_quantize_ALPHA1; - (void)fxt1_quantize_MIXED1; - (void)fxt1_quantize_MIXED0; -#else - if (trualpha) { - fxt1_quantize_ALPHA1(cc, input); - } else if (l == 0) { - cc[0] = cc[1] = cc[2] = ~0u; - cc[3] = 0; - } else if (l < N_TEXELS) { - fxt1_quantize_MIXED1(cc, input); - } else { - fxt1_quantize_MIXED0(cc, input); - } - (void)fxt1_quantize_ALPHA0; - (void)fxt1_quantize_HI; - (void)fxt1_quantize_CHROMA; -#endif -} - - -static void -fxt1_encode (GLuint width, GLuint height, GLint comps, - const void *source, GLint srcRowStride, - void *dest, GLint destRowStride) -{ - GLuint x, y; - const GLubyte *data; - GLuint *encoded = (GLuint *)dest; - void *newSource = NULL; - - assert(comps == 3 || comps == 4); - - /* Replicate image if width is not M8 or height is not M4 */ - if ((width & 7) | (height & 3)) { - GLint newWidth = (width + 7) & ~7; - GLint newHeight = (height + 3) & ~3; - newSource = _mesa_malloc(comps * newWidth * newHeight * sizeof(GLchan)); - if (!newSource) { - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression"); - goto cleanUp; - } - _mesa_upscale_teximage2d(width, height, newWidth, newHeight, - comps, (const GLchan *) source, - srcRowStride, (GLchan *) newSource); - source = newSource; - width = newWidth; - height = newHeight; - srcRowStride = comps * newWidth; - } - - /* convert from 16/32-bit channels to GLubyte if needed */ - if (CHAN_TYPE != GL_UNSIGNED_BYTE) { - const GLuint n = width * height * comps; - const GLchan *src = (const GLchan *) source; - GLubyte *dest = (GLubyte *) _mesa_malloc(n * sizeof(GLubyte)); - GLuint i; - if (!dest) { - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression"); - goto cleanUp; - } - for (i = 0; i < n; i++) { - dest[i] = CHAN_TO_UBYTE(src[i]); - } - if (newSource != NULL) { - _mesa_free(newSource); - } - newSource = dest; /* we'll free this buffer before returning */ - source = dest; /* the new, GLubyte incoming image */ - } - - data = (const GLubyte *) source; - destRowStride = (destRowStride - width * 2) / 4; - for (y = 0; y < height; y += 4) { - GLuint offs = 0 + (y + 0) * srcRowStride; - for (x = 0; x < width; x += 8) { - const GLubyte *lines[4]; - lines[0] = &data[offs]; - lines[1] = lines[0] + srcRowStride; - lines[2] = lines[1] + srcRowStride; - lines[3] = lines[2] + srcRowStride; - offs += 8 * comps; - fxt1_quantize(encoded, lines, comps); - /* 128 bits per 8x4 block */ - encoded += 4; - } - encoded += destRowStride; - } - - cleanUp: - if (newSource != NULL) { - _mesa_free(newSource); - } -} - - -/***************************************************************************\ - * FXT1 decoder - * - * The decoder is based on GL_3DFX_texture_compression_FXT1 - * specification and serves as a concept for the encoder. -\***************************************************************************/ - - -/* lookup table for scaling 5 bit colors up to 8 bits */ -static const GLubyte _rgb_scale_5[] = { - 0, 8, 16, 25, 33, 41, 49, 58, - 66, 74, 82, 90, 99, 107, 115, 123, - 132, 140, 148, 156, 165, 173, 181, 189, - 197, 206, 214, 222, 230, 239, 247, 255 -}; - -/* lookup table for scaling 6 bit colors up to 8 bits */ -static const GLubyte _rgb_scale_6[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 45, 49, 53, 57, 61, - 65, 69, 73, 77, 81, 85, 89, 93, - 97, 101, 105, 109, 113, 117, 121, 125, - 130, 134, 138, 142, 146, 150, 154, 158, - 162, 166, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 255 -}; - - -#define CC_SEL(cc, which) (((GLuint *)(cc))[(which) / 32] >> ((which) & 31)) -#define UP5(c) _rgb_scale_5[(c) & 31] -#define UP6(c, b) _rgb_scale_6[(((c) & 31) << 1) | ((b) & 1)] -#define LERP(n, t, c0, c1) (((n) - (t)) * (c0) + (t) * (c1) + (n) / 2) / (n) - - -static void -fxt1_decode_1HI (const GLubyte *code, GLint t, GLchan *rgba) -{ - const GLuint *cc; - - t *= 3; - cc = (const GLuint *)(code + t / 8); - t = (cc[0] >> (t & 7)) & 7; - - if (t == 7) { - rgba[RCOMP] = rgba[GCOMP] = rgba[BCOMP] = rgba[ACOMP] = 0; - } else { - GLubyte r, g, b; - cc = (const GLuint *)(code + 12); - if (t == 0) { - b = UP5(CC_SEL(cc, 0)); - g = UP5(CC_SEL(cc, 5)); - r = UP5(CC_SEL(cc, 10)); - } else if (t == 6) { - b = UP5(CC_SEL(cc, 15)); - g = UP5(CC_SEL(cc, 20)); - r = UP5(CC_SEL(cc, 25)); - } else { - b = LERP(6, t, UP5(CC_SEL(cc, 0)), UP5(CC_SEL(cc, 15))); - g = LERP(6, t, UP5(CC_SEL(cc, 5)), UP5(CC_SEL(cc, 20))); - r = LERP(6, t, UP5(CC_SEL(cc, 10)), UP5(CC_SEL(cc, 25))); - } - rgba[RCOMP] = UBYTE_TO_CHAN(r); - rgba[GCOMP] = UBYTE_TO_CHAN(g); - rgba[BCOMP] = UBYTE_TO_CHAN(b); - rgba[ACOMP] = CHAN_MAX; - } -} - - -static void -fxt1_decode_1CHROMA (const GLubyte *code, GLint t, GLchan *rgba) -{ - const GLuint *cc; - GLuint kk; - - cc = (const GLuint *)code; - if (t & 16) { - cc++; - t &= 15; - } - t = (cc[0] >> (t * 2)) & 3; - - t *= 15; - cc = (const GLuint *)(code + 8 + t / 8); - kk = cc[0] >> (t & 7); - rgba[BCOMP] = UBYTE_TO_CHAN( UP5(kk) ); - rgba[GCOMP] = UBYTE_TO_CHAN( UP5(kk >> 5) ); - rgba[RCOMP] = UBYTE_TO_CHAN( UP5(kk >> 10) ); - rgba[ACOMP] = CHAN_MAX; -} - - -static void -fxt1_decode_1MIXED (const GLubyte *code, GLint t, GLchan *rgba) -{ - const GLuint *cc; - GLuint col[2][3]; - GLint glsb, selb; - - cc = (const GLuint *)code; - if (t & 16) { - t &= 15; - t = (cc[1] >> (t * 2)) & 3; - /* col 2 */ - col[0][BCOMP] = (*(const GLuint *)(code + 11)) >> 6; - col[0][GCOMP] = CC_SEL(cc, 99); - col[0][RCOMP] = CC_SEL(cc, 104); - /* col 3 */ - col[1][BCOMP] = CC_SEL(cc, 109); - col[1][GCOMP] = CC_SEL(cc, 114); - col[1][RCOMP] = CC_SEL(cc, 119); - glsb = CC_SEL(cc, 126); - selb = CC_SEL(cc, 33); - } else { - t = (cc[0] >> (t * 2)) & 3; - /* col 0 */ - col[0][BCOMP] = CC_SEL(cc, 64); - col[0][GCOMP] = CC_SEL(cc, 69); - col[0][RCOMP] = CC_SEL(cc, 74); - /* col 1 */ - col[1][BCOMP] = CC_SEL(cc, 79); - col[1][GCOMP] = CC_SEL(cc, 84); - col[1][RCOMP] = CC_SEL(cc, 89); - glsb = CC_SEL(cc, 125); - selb = CC_SEL(cc, 1); - } - - if (CC_SEL(cc, 124) & 1) { - /* alpha[0] == 1 */ - - if (t == 3) { - /* zero */ - rgba[RCOMP] = rgba[BCOMP] = rgba[GCOMP] = rgba[ACOMP] = 0; - } else { - GLubyte r, g, b; - if (t == 0) { - b = UP5(col[0][BCOMP]); - g = UP5(col[0][GCOMP]); - r = UP5(col[0][RCOMP]); - } else if (t == 2) { - b = UP5(col[1][BCOMP]); - g = UP6(col[1][GCOMP], glsb); - r = UP5(col[1][RCOMP]); - } else { - b = (UP5(col[0][BCOMP]) + UP5(col[1][BCOMP])) / 2; - g = (UP5(col[0][GCOMP]) + UP6(col[1][GCOMP], glsb)) / 2; - r = (UP5(col[0][RCOMP]) + UP5(col[1][RCOMP])) / 2; - } - rgba[RCOMP] = UBYTE_TO_CHAN(r); - rgba[GCOMP] = UBYTE_TO_CHAN(g); - rgba[BCOMP] = UBYTE_TO_CHAN(b); - rgba[ACOMP] = CHAN_MAX; - } - } else { - /* alpha[0] == 0 */ - GLubyte r, g, b; - if (t == 0) { - b = UP5(col[0][BCOMP]); - g = UP6(col[0][GCOMP], glsb ^ selb); - r = UP5(col[0][RCOMP]); - } else if (t == 3) { - b = UP5(col[1][BCOMP]); - g = UP6(col[1][GCOMP], glsb); - r = UP5(col[1][RCOMP]); - } else { - b = LERP(3, t, UP5(col[0][BCOMP]), UP5(col[1][BCOMP])); - g = LERP(3, t, UP6(col[0][GCOMP], glsb ^ selb), - UP6(col[1][GCOMP], glsb)); - r = LERP(3, t, UP5(col[0][RCOMP]), UP5(col[1][RCOMP])); - } - rgba[RCOMP] = UBYTE_TO_CHAN(r); - rgba[GCOMP] = UBYTE_TO_CHAN(g); - rgba[BCOMP] = UBYTE_TO_CHAN(b); - rgba[ACOMP] = CHAN_MAX; - } -} - - -static void -fxt1_decode_1ALPHA (const GLubyte *code, GLint t, GLchan *rgba) -{ - const GLuint *cc; - GLubyte r, g, b, a; - - cc = (const GLuint *)code; - if (CC_SEL(cc, 124) & 1) { - /* lerp == 1 */ - GLuint col0[4]; - - if (t & 16) { - t &= 15; - t = (cc[1] >> (t * 2)) & 3; - /* col 2 */ - col0[BCOMP] = (*(const GLuint *)(code + 11)) >> 6; - col0[GCOMP] = CC_SEL(cc, 99); - col0[RCOMP] = CC_SEL(cc, 104); - col0[ACOMP] = CC_SEL(cc, 119); - } else { - t = (cc[0] >> (t * 2)) & 3; - /* col 0 */ - col0[BCOMP] = CC_SEL(cc, 64); - col0[GCOMP] = CC_SEL(cc, 69); - col0[RCOMP] = CC_SEL(cc, 74); - col0[ACOMP] = CC_SEL(cc, 109); - } - - if (t == 0) { - b = UP5(col0[BCOMP]); - g = UP5(col0[GCOMP]); - r = UP5(col0[RCOMP]); - a = UP5(col0[ACOMP]); - } else if (t == 3) { - b = UP5(CC_SEL(cc, 79)); - g = UP5(CC_SEL(cc, 84)); - r = UP5(CC_SEL(cc, 89)); - a = UP5(CC_SEL(cc, 114)); - } else { - b = LERP(3, t, UP5(col0[BCOMP]), UP5(CC_SEL(cc, 79))); - g = LERP(3, t, UP5(col0[GCOMP]), UP5(CC_SEL(cc, 84))); - r = LERP(3, t, UP5(col0[RCOMP]), UP5(CC_SEL(cc, 89))); - a = LERP(3, t, UP5(col0[ACOMP]), UP5(CC_SEL(cc, 114))); - } - } else { - /* lerp == 0 */ - - if (t & 16) { - cc++; - t &= 15; - } - t = (cc[0] >> (t * 2)) & 3; - - if (t == 3) { - /* zero */ - r = g = b = a = 0; - } else { - GLuint kk; - cc = (const GLuint *)code; - a = UP5(cc[3] >> (t * 5 + 13)); - t *= 15; - cc = (const GLuint *)(code + 8 + t / 8); - kk = cc[0] >> (t & 7); - b = UP5(kk); - g = UP5(kk >> 5); - r = UP5(kk >> 10); - } - } - rgba[RCOMP] = UBYTE_TO_CHAN(r); - rgba[GCOMP] = UBYTE_TO_CHAN(g); - rgba[BCOMP] = UBYTE_TO_CHAN(b); - rgba[ACOMP] = UBYTE_TO_CHAN(a); -} - - -void -fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ - GLint i, GLint j, GLchan *rgba) -{ - static void (*decode_1[]) (const GLubyte *, GLint, GLchan *) = { - fxt1_decode_1HI, /* cc-high = "00?" */ - fxt1_decode_1HI, /* cc-high = "00?" */ - fxt1_decode_1CHROMA, /* cc-chroma = "010" */ - fxt1_decode_1ALPHA, /* alpha = "011" */ - fxt1_decode_1MIXED, /* mixed = "1??" */ - fxt1_decode_1MIXED, /* mixed = "1??" */ - fxt1_decode_1MIXED, /* mixed = "1??" */ - fxt1_decode_1MIXED /* mixed = "1??" */ - }; - - const GLubyte *code = (const GLubyte *)texture + - ((j / 4) * (stride / 8) + (i / 8)) * 16; - GLint mode = CC_SEL(code, 125); - GLint t = i & 7; - - if (t & 4) { - t += 12; - } - t += (j & 3) * 4; - - decode_1[mode](code, t, rgba); -} diff --git a/src/libs/mesa/mesa/main/texcompress_s3tc.c b/src/libs/mesa/mesa/main/texcompress_s3tc.c deleted file mode 100644 index a19c161b2c..0000000000 --- a/src/libs/mesa/mesa/main/texcompress_s3tc.c +++ /dev/null @@ -1,607 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file texcompress_s3tc.c - * GL_EXT_texture_compression_s3tc support. - */ - -#ifndef USE_EXTERNAL_DXTN_LIB -#define USE_EXTERNAL_DXTN_LIB 1 -#endif - -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "convolve.h" -#include "dlopen.h" -#include "image.h" -#include "texcompress.h" -#include "texformat.h" -#include "texstore.h" - -#ifdef __MINGW32__ -#define DXTN_LIBNAME "dxtn.dll" -#define RTLD_LAZY 0 -#define RTLD_GLOBAL 0 -#elif defined(__DJGPP__) -#define DXTN_LIBNAME "dxtn.dxe" -#else -#define DXTN_LIBNAME "libtxc_dxtn.so" -#endif - - -typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut ); - -dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL; - -typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width, - GLint height, const GLchan *srcPixData, - GLenum destformat, GLubyte *dest, - GLint dstRowStride); - -static dxtCompressTexFuncExt ext_tx_compress_dxtn = NULL; - -static void *dxtlibhandle = NULL; - - -void -_mesa_init_texture_s3tc( GLcontext *ctx ) -{ - /* called during context initialization */ - ctx->Mesa_DXTn = GL_FALSE; -#if USE_EXTERNAL_DXTN_LIB - if (!dxtlibhandle) { - dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, 0); - if (!dxtlibhandle) { - _mesa_warning(ctx, "couldn't open " DXTN_LIBNAME ", software DXTn " - "compression/decompression unavailable"); - } - else { - /* the fetch functions are not per context! Might be problematic... */ - fetch_ext_rgb_dxt1 = (dxtFetchTexelFuncExt) - _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgb_dxt1"); - fetch_ext_rgba_dxt1 = (dxtFetchTexelFuncExt) - _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt1"); - fetch_ext_rgba_dxt3 = (dxtFetchTexelFuncExt) - _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt3"); - fetch_ext_rgba_dxt5 = (dxtFetchTexelFuncExt) - _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt5"); - ext_tx_compress_dxtn = (dxtCompressTexFuncExt) - _mesa_dlsym(dxtlibhandle, "tx_compress_dxtn"); - - if (!fetch_ext_rgb_dxt1 || - !fetch_ext_rgba_dxt1 || - !fetch_ext_rgba_dxt3 || - !fetch_ext_rgba_dxt5 || - !ext_tx_compress_dxtn) { - _mesa_warning(ctx, "couldn't reference all symbols in " - DXTN_LIBNAME ", software DXTn compression/decompression " - "unavailable"); - fetch_ext_rgb_dxt1 = NULL; - fetch_ext_rgba_dxt1 = NULL; - fetch_ext_rgba_dxt3 = NULL; - fetch_ext_rgba_dxt5 = NULL; - ext_tx_compress_dxtn = NULL; - _mesa_dlclose(dxtlibhandle); - dxtlibhandle = NULL; - } - } - } - if (dxtlibhandle) { - ctx->Mesa_DXTn = GL_TRUE; - _mesa_warning(ctx, "software DXTn compression/decompression available"); - } -#else - (void) ctx; -#endif -} - -/** - * Called via TexFormat->StoreImage to store an RGB_DXT1 texture. - */ -static GLboolean -texstore_rgb_dxt1(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgb_dxt1); - ASSERT(dstXoffset % 4 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset % 4 == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGB || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGB/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 3 * srcWidth; - srcFormat = GL_RGB; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - - if (ext_tx_compress_dxtn) { - (*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels, - GL_COMPRESSED_RGB_S3TC_DXT1_EXT, - dst, dstRowStride); - } - else { - _mesa_warning(ctx, "external dxt library not available"); - } - - if (tempImage) - _mesa_free((void *) tempImage); - - return GL_TRUE; -} - - -/** - * Called via TexFormat->StoreImage to store an RGBA_DXT1 texture. - */ -static GLboolean -texstore_rgba_dxt1(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt1); - ASSERT(dstXoffset % 4 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset % 4 == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGBA || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGBA/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 4 * srcWidth; - srcFormat = GL_RGBA; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - if (ext_tx_compress_dxtn) { - (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, - GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, - dst, dstRowStride); - } - else { - _mesa_warning(ctx, "external dxt library not available"); - } - - if (tempImage) - _mesa_free((void*) tempImage); - - return GL_TRUE; -} - - -/** - * Called via TexFormat->StoreImage to store an RGBA_DXT3 texture. - */ -static GLboolean -texstore_rgba_dxt3(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt3); - ASSERT(dstXoffset % 4 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset % 4 == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGBA || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGBA/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 4 * srcWidth; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - if (ext_tx_compress_dxtn) { - (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, - GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, - dst, dstRowStride); - } - else { - _mesa_warning(ctx, "external dxt library not available"); - } - - if (tempImage) - _mesa_free((void *) tempImage); - - return GL_TRUE; -} - - -/** - * Called via TexFormat->StoreImage to store an RGBA_DXT5 texture. - */ -static GLboolean -texstore_rgba_dxt5(TEXSTORE_PARAMS) -{ - const GLchan *pixels; - GLint srcRowStride; - GLubyte *dst; - const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ - const GLchan *tempImage = NULL; - - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt5); - ASSERT(dstXoffset % 4 == 0); - ASSERT(dstYoffset % 4 == 0); - ASSERT(dstZoffset % 4 == 0); - (void) dstZoffset; - (void) dstImageOffsets; - - if (srcFormat != GL_RGBA || - srcType != CHAN_TYPE || - ctx->_ImageTransferState || - srcPacking->SwapBytes) { - /* convert image to RGBA/GLchan */ - tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - if (!tempImage) - return GL_FALSE; /* out of memory */ - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - pixels = tempImage; - srcRowStride = 4 * srcWidth; - } - else { - pixels = (const GLchan *) srcAddr; - srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, - srcType) / sizeof(GLchan); - } - - dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, - texWidth, (GLubyte *) dstAddr); - if (ext_tx_compress_dxtn) { - (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, - GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, - dst, dstRowStride); - } - else { - _mesa_warning(ctx, "external dxt library not available"); - } - - if (tempImage) - _mesa_free((void *) tempImage); - - return GL_TRUE; -} - - -static void -fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - if (fetch_ext_rgb_dxt1) { - ASSERT (sizeof(GLchan) == sizeof(GLubyte)); - fetch_ext_rgb_dxt1(texImage->RowStride, - (GLubyte *)(texImage)->Data, i, j, texel); - } - else - _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n"); -} - - -static void -fetch_texel_2d_f_rgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); -} - - -static void -fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - if (fetch_ext_rgba_dxt1) { - fetch_ext_rgba_dxt1(texImage->RowStride, - (GLubyte *)(texImage)->Data, i, j, texel); - } - else - _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n"); -} - - -static void -fetch_texel_2d_f_rgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); -} - - -static void -fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - if (fetch_ext_rgba_dxt3) { - ASSERT (sizeof(GLchan) == sizeof(GLubyte)); - fetch_ext_rgba_dxt3(texImage->RowStride, (GLubyte *)(texImage)->Data, - i, j, texel); - } - else - _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n"); -} - - -static void -fetch_texel_2d_f_rgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); -} - - -static void -fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - if (fetch_ext_rgba_dxt5) { - fetch_ext_rgba_dxt5(texImage->RowStride, (GLubyte *)(texImage)->Data, - i, j, texel); - } - else - _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n"); -} - - -static void -fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; - fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba); - texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); - texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); - texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); - texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); -} - - -const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { - MESA_FORMAT_RGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_dxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -#if FEATURE_EXT_texture_sRGB -const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { - MESA_FORMAT_SRGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_dxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; -#endif - -const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { - MESA_FORMAT_RGBA_DXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { - MESA_FORMAT_RGBA_DXT3, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 4, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt3, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt3, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt3, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { - MESA_FORMAT_RGBA_DXT5, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4,/*approx*/ /* RedBits */ - 4,/*approx*/ /* GreenBits */ - 4,/*approx*/ /* BlueBits */ - 4,/*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt5, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt5, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt5, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; diff --git a/src/libs/mesa/mesa/main/texenv.c b/src/libs/mesa/mesa/main/texenv.c deleted file mode 100644 index 76ec0a1d2e..0000000000 --- a/src/libs/mesa/mesa/main/texenv.c +++ /dev/null @@ -1,772 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file texenv.c - * - * glTexEnv-related functions - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/macros.h" -#include "main/texenv.h" -#include "math/m_xform.h" - - - -void GLAPIENTRY -_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) -{ - GLuint maxUnit; - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - -#define TE_ERROR(errCode, msg, value) \ - _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); - - if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - { - GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE_EXT) - mode = GL_REPLACE; - if (texUnit->EnvMode == mode) - return; - if (mode == GL_MODULATE || - mode == GL_BLEND || - mode == GL_DECAL || - mode == GL_REPLACE || - (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE && - (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->EnvMode = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - } - break; - case GL_TEXTURE_ENV_COLOR: - { - GLfloat tmp[4]; - tmp[0] = CLAMP( param[0], 0.0F, 1.0F ); - tmp[1] = CLAMP( param[1], 0.0F, 1.0F ); - tmp[2] = CLAMP( param[2], 0.0F, 1.0F ); - tmp[3] = CLAMP( param[3], 0.0F, 1.0F ); - if (TEST_EQ_4V(tmp, texUnit->EnvColor)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EnvColor, tmp); - } - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeRGB == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - if (!ctx->Extensions.EXT_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - if (!ctx->Extensions.ARB_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeRGB = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeA == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB; - if (texUnit->Combine.SourceRGB[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceRGB[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA; - if (texUnit->Combine.SourceA[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceA[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB; - if (texUnit->Combine.OperandRGB[s] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[s] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_RGB: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: /* ARB combine only */ - case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */ - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftRGB == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftRGB = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftA == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftA = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" ); - return; - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - if (texUnit->LodBias == param[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->LodBias = param[0]; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - const GLenum value = (GLenum) param[0]; - if (value == GL_TRUE || value == GL_FALSE) { - /* It's kind of weird to set point state via glTexEnv, - * but that's what the spec calls for. - */ - const GLboolean state = (GLboolean) value; - if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", value); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n", - _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(pname), - *param, - _mesa_lookup_enum_by_nr((GLenum) (GLint) *param)); - - /* Tell device driver about the new texture environment */ - if (ctx->Driver.TexEnv) { - (*ctx->Driver.TexEnv)( ctx, target, pname, param ); - } -} - - -void GLAPIENTRY -_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) -{ - _mesa_TexEnvfv( target, pname, ¶m ); -} - - - -void GLAPIENTRY -_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 GLAPIENTRY -_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) -{ - GLfloat p[4]; - if (pname == GL_TEXTURE_ENV_COLOR) { - 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] ); - } - else { - p[0] = (GLfloat) param[0]; - p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */ - } - _mesa_TexEnvfv( target, pname, p ); -} - - - -/** - * Helper for glGetTexEnvi/f() - * \return value of queried pname or -1 if error. - */ -static GLint -get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, - GLenum pname) -{ - switch (pname) { - case GL_TEXTURE_ENV_MODE: - return texUnit->EnvMode; - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - return texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - return texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - return texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - return texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - return texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - return texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - return 1 << texUnit->Combine.ScaleShiftRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - return 1 << texUnit->Combine.ScaleShiftA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - default: - ; - } - - return -1; /* error */ -} - - - -void GLAPIENTRY -_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) -{ - GLuint maxUnit; - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - if (target == GL_TEXTURE_ENV) { - if (pname == GL_TEXTURE_ENV_COLOR) { - COPY_4FV( params, texUnit->EnvColor ); - } - else { - GLint val = get_texenvi(ctx, texUnit, pname); - if (val >= 0) { - *params = (GLfloat) val; - } - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - *params = texUnit->LodBias; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) -{ - GLuint maxUnit; - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - if (target == GL_TEXTURE_ENV) { - if (pname == GL_TEXTURE_ENV_COLOR) { - params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); - params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); - params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); - params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); - } - else { - GLint val = get_texenvi(ctx, texUnit, pname); - if (val >= 0) { - *params = val; - } - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - *params = (GLint) texUnit->LodBias; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } -} - - diff --git a/src/libs/mesa/mesa/main/texenv.h b/src/libs/mesa/mesa/main/texenv.h deleted file mode 100644 index bdff7fdb82..0000000000 --- a/src/libs/mesa/mesa/main/texenv.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 TEXENV_H -#define TEXENV_H - - -#include "main/glheader.h" - - -extern void GLAPIENTRY -_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); - -extern void GLAPIENTRY -_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); - - -#endif /* TEXENV_H */ diff --git a/src/libs/mesa/mesa/main/texenvprogram.c b/src/libs/mesa/mesa/main/texenvprogram.c deleted file mode 100644 index 6a57d50193..0000000000 --- a/src/libs/mesa/mesa/main/texenvprogram.c +++ /dev/null @@ -1,1240 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include "glheader.h" -#include "macros.h" -#include "enums.h" -#include "shader/program.h" -#include "shader/prog_parameter.h" -#include "shader/prog_cache.h" -#include "shader/prog_instruction.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" -#include "shader/programopt.h" -#include "texenvprogram.h" - - -/* - * Note on texture units: - * - * The number of texture units supported by fixed-function fragment - * processing is MAX_TEXTURE_COORD_UNITS, not MAX_TEXTURE_IMAGE_UNITS. - * That's because there's a one-to-one correspondence between texture - * coordinates and samplers in fixed-function processing. - * - * Since fixed-function vertex processing is limited to MAX_TEXTURE_COORD_UNITS - * sets of texcoords, so is fixed-function fragment processing. - * - * We can safely use ctx->Const.MaxTextureUnits for loop bounds. - */ - - -struct texenvprog_cache_item -{ - GLuint hash; - void *key; - struct gl_fragment_program *data; - struct texenvprog_cache_item *next; -}; - - -/** - * This MAX is probably a bit generous, but that's OK. There can be - * up to four instructions per texture unit (TEX + 3 for combine), - * then there's fog and specular add. - */ -#define MAX_INSTRUCTIONS ((MAX_TEXTURE_COORD_UNITS * 4) + 12) - -#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM) - -struct mode_opt { - GLuint Source:4; - GLuint Operand:3; -}; - -struct state_key { - GLbitfield enabled_units; - GLuint separate_specular:1; - GLuint fog_enabled:1; - GLuint fog_mode:2; - - struct { - GLuint enabled:1; - GLuint source_index:3; /* one of TEXTURE_1D/2D/3D/CUBE/RECT_INDEX */ - GLuint shadow:1; - GLuint ScaleShiftRGB:2; - GLuint ScaleShiftA:2; - - GLuint NumArgsRGB:2; - GLuint ModeRGB:4; - struct mode_opt OptRGB[3]; - - GLuint NumArgsA:2; - GLuint ModeA:4; - struct mode_opt OptA[3]; - } unit[8]; -}; - -#define FOG_LINEAR 0 -#define FOG_EXP 1 -#define FOG_EXP2 2 -#define FOG_UNKNOWN 3 - -static GLuint translate_fog_mode( GLenum mode ) -{ - switch (mode) { - case GL_LINEAR: return FOG_LINEAR; - case GL_EXP: return FOG_EXP; - case GL_EXP2: return FOG_EXP2; - default: return FOG_UNKNOWN; - } -} - -#define OPR_SRC_COLOR 0 -#define OPR_ONE_MINUS_SRC_COLOR 1 -#define OPR_SRC_ALPHA 2 -#define OPR_ONE_MINUS_SRC_ALPHA 3 -#define OPR_ZERO 4 -#define OPR_ONE 5 -#define OPR_UNKNOWN 7 - -static GLuint translate_operand( GLenum operand ) -{ - switch (operand) { - case GL_SRC_COLOR: return OPR_SRC_COLOR; - case GL_ONE_MINUS_SRC_COLOR: return OPR_ONE_MINUS_SRC_COLOR; - case GL_SRC_ALPHA: return OPR_SRC_ALPHA; - case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA; - case GL_ZERO: return OPR_ZERO; - case GL_ONE: return OPR_ONE; - default: return OPR_UNKNOWN; - } -} - -#define SRC_TEXTURE 0 -#define SRC_TEXTURE0 1 -#define SRC_TEXTURE1 2 -#define SRC_TEXTURE2 3 -#define SRC_TEXTURE3 4 -#define SRC_TEXTURE4 5 -#define SRC_TEXTURE5 6 -#define SRC_TEXTURE6 7 -#define SRC_TEXTURE7 8 -#define SRC_CONSTANT 9 -#define SRC_PRIMARY_COLOR 10 -#define SRC_PREVIOUS 11 -#define SRC_UNKNOWN 15 - -static GLuint translate_source( GLenum src ) -{ - switch (src) { - case GL_TEXTURE: return SRC_TEXTURE; - case GL_TEXTURE0: - case GL_TEXTURE1: - case GL_TEXTURE2: - case GL_TEXTURE3: - case GL_TEXTURE4: - case GL_TEXTURE5: - case GL_TEXTURE6: - case GL_TEXTURE7: return SRC_TEXTURE0 + (src - GL_TEXTURE0); - case GL_CONSTANT: return SRC_CONSTANT; - case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR; - case GL_PREVIOUS: return SRC_PREVIOUS; - default: return SRC_UNKNOWN; - } -} - -#define MODE_REPLACE 0 -#define MODE_MODULATE 1 -#define MODE_ADD 2 -#define MODE_ADD_SIGNED 3 -#define MODE_INTERPOLATE 4 -#define MODE_SUBTRACT 5 -#define MODE_DOT3_RGB 6 -#define MODE_DOT3_RGB_EXT 7 -#define MODE_DOT3_RGBA 8 -#define MODE_DOT3_RGBA_EXT 9 -#define MODE_MODULATE_ADD_ATI 10 -#define MODE_MODULATE_SIGNED_ADD_ATI 11 -#define MODE_MODULATE_SUBTRACT_ATI 12 -#define MODE_UNKNOWN 15 - -static GLuint translate_mode( GLenum mode ) -{ - switch (mode) { - case GL_REPLACE: return MODE_REPLACE; - case GL_MODULATE: return MODE_MODULATE; - case GL_ADD: return MODE_ADD; - case GL_ADD_SIGNED: return MODE_ADD_SIGNED; - case GL_INTERPOLATE: return MODE_INTERPOLATE; - case GL_SUBTRACT: return MODE_SUBTRACT; - case GL_DOT3_RGB: return MODE_DOT3_RGB; - case GL_DOT3_RGB_EXT: return MODE_DOT3_RGB_EXT; - case GL_DOT3_RGBA: return MODE_DOT3_RGBA; - case GL_DOT3_RGBA_EXT: return MODE_DOT3_RGBA_EXT; - case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI; - case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI; - case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI; - default: return MODE_UNKNOWN; - } -} - -#define TEXTURE_UNKNOWN_INDEX 7 -static GLuint translate_tex_src_bit( GLbitfield bit ) -{ - switch (bit) { - case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX; - case TEXTURE_2D_BIT: return TEXTURE_2D_INDEX; - case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX; - case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX; - case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX; - default: return TEXTURE_UNKNOWN_INDEX; - } -} - -/** - * Examine current texture environment state and generate a unique - * key to identify it. - */ -static void make_state_key( GLcontext *ctx, struct state_key *key ) -{ - GLuint i, j; - - memset(key, 0, sizeof(*key)); - - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - GLenum format; - - if (!texUnit->_ReallyEnabled || !texUnit->Enabled) - continue; - - format = texUnit->_Current->Image[0][texUnit->_Current->BaseLevel]->_BaseFormat; - - key->unit[i].enabled = 1; - key->enabled_units |= (1<unit[i].source_index = - translate_tex_src_bit(texUnit->_ReallyEnabled); - key->unit[i].shadow = ((texUnit->_Current->CompareMode == GL_COMPARE_R_TO_TEXTURE) && - ((format == GL_DEPTH_COMPONENT) || - (format == GL_DEPTH_STENCIL_EXT))); - - key->unit[i].NumArgsRGB = texUnit->_CurrentCombine->_NumArgsRGB; - key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA; - - key->unit[i].ModeRGB = - translate_mode(texUnit->_CurrentCombine->ModeRGB); - key->unit[i].ModeA = - translate_mode(texUnit->_CurrentCombine->ModeA); - - key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; - key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA; - - for (j=0;j<3;j++) { - key->unit[i].OptRGB[j].Operand = - translate_operand(texUnit->_CurrentCombine->OperandRGB[j]); - key->unit[i].OptA[j].Operand = - translate_operand(texUnit->_CurrentCombine->OperandA[j]); - key->unit[i].OptRGB[j].Source = - translate_source(texUnit->_CurrentCombine->SourceRGB[j]); - key->unit[i].OptA[j].Source = - translate_source(texUnit->_CurrentCombine->SourceA[j]); - } - } - - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - key->separate_specular = 1; - - if (ctx->Fog.Enabled) { - key->fog_enabled = 1; - key->fog_mode = translate_fog_mode(ctx->Fog.Mode); - } -} - -/* Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. - * - * NOTE: These are passed by value extensively in this file rather - * than as usual by pointer reference. If this disturbs you, try - * remembering they are just 32bits in size. - * - * GCC is smart enough to deal with these dword-sized structures in - * much the same way as if I had defined them as dwords and was using - * macros to access and set the fields. This is much nicer and easier - * to evolve. - */ -struct ureg { - GLuint file:4; - GLuint idx:8; - GLuint negatebase:1; - GLuint abs:1; - GLuint negateabs:1; - GLuint swz:12; - GLuint pad:5; -}; - -static const struct ureg undef = { - PROGRAM_UNDEFINED, - ~0, - 0, - 0, - 0, - 0, - 0 -}; - - -/* State used to build the fragment program: - */ -struct texenv_fragment_program { - struct gl_fragment_program *program; - GLcontext *ctx; - struct state_key *state; - - GLbitfield alu_temps; /* Track texture indirections, see spec. */ - GLbitfield temps_output; /* Track texture indirections, see spec. */ - GLbitfield temp_in_use; /* Tracks temporary regs which are in use. */ - GLboolean error; - - struct ureg src_texture[MAX_TEXTURE_COORD_UNITS]; - /* Reg containing each texture unit's sampled texture color, - * else undef. - */ - - struct ureg src_previous; /* Reg containing color from previous - * stage. May need to be decl'd. - */ - - GLuint last_tex_stage; /* Number of last enabled texture unit */ - - struct ureg half; - struct ureg one; - struct ureg zero; -}; - - - -static struct ureg make_ureg(GLuint file, GLuint idx) -{ - struct ureg reg; - reg.file = file; - reg.idx = idx; - reg.negatebase = 0; - reg.abs = 0; - reg.negateabs = 0; - reg.swz = SWIZZLE_NOOP; - reg.pad = 0; - return reg; -} - -static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) -{ - reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x), - GET_SWZ(reg.swz, y), - GET_SWZ(reg.swz, z), - GET_SWZ(reg.swz, w)); - - return reg; -} - -static struct ureg swizzle1( struct ureg reg, int x ) -{ - return swizzle(reg, x, x, x, x); -} - -static struct ureg negate( struct ureg reg ) -{ - reg.negatebase ^= 1; - return reg; -} - -static GLboolean is_undef( struct ureg reg ) -{ - return reg.file == PROGRAM_UNDEFINED; -} - - -static struct ureg get_temp( struct texenv_fragment_program *p ) -{ - GLint bit; - - /* First try and reuse temps which have been used already: - */ - bit = _mesa_ffs( ~p->temp_in_use & p->alu_temps ); - - /* Then any unused temporary: - */ - if (!bit) - bit = _mesa_ffs( ~p->temp_in_use ); - - if (!bit) { - _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); - _mesa_exit(1); - } - - if ((GLuint) bit > p->program->Base.NumTemporaries) - p->program->Base.NumTemporaries = bit; - - p->temp_in_use |= 1<<(bit-1); - return make_ureg(PROGRAM_TEMPORARY, (bit-1)); -} - -static struct ureg get_tex_temp( struct texenv_fragment_program *p ) -{ - int bit; - - /* First try to find availble temp not previously used (to avoid - * starting a new texture indirection). According to the spec, the - * ~p->temps_output isn't necessary, but will keep it there for - * now: - */ - bit = _mesa_ffs( ~p->temp_in_use & ~p->alu_temps & ~p->temps_output ); - - /* Then any unused temporary: - */ - if (!bit) - bit = _mesa_ffs( ~p->temp_in_use ); - - if (!bit) { - _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); - _mesa_exit(1); - } - - if ((GLuint) bit > p->program->Base.NumTemporaries) - p->program->Base.NumTemporaries = bit; - - p->temp_in_use |= 1<<(bit-1); - return make_ureg(PROGRAM_TEMPORARY, (bit-1)); -} - - -static void release_temps(GLcontext *ctx, struct texenv_fragment_program *p ) -{ - GLuint max_temp = ctx->Const.FragmentProgram.MaxTemps; - - /* KW: To support tex_env_crossbar, don't release the registers in - * temps_output. - */ - if (max_temp >= sizeof(int) * 8) - p->temp_in_use = p->temps_output; - else - p->temp_in_use = ~((1<temps_output; -} - - -static struct ureg register_param5( struct texenv_fragment_program *p, - GLint s0, - GLint s1, - GLint s2, - GLint s3, - GLint s4) -{ - gl_state_index tokens[STATE_LENGTH]; - GLuint idx; - tokens[0] = s0; - tokens[1] = s1; - tokens[2] = s2; - tokens[3] = s3; - tokens[4] = s4; - idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens ); - return make_ureg(PROGRAM_STATE_VAR, idx); -} - - -#define register_param1(p,s0) register_param5(p,s0,0,0,0,0) -#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0) -#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0) -#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0) - - -static struct ureg register_input( struct texenv_fragment_program *p, GLuint input ) -{ - p->program->Base.InputsRead |= (1 << input); - return make_ureg(PROGRAM_INPUT, input); -} - - -static void emit_arg( struct prog_src_register *reg, - struct ureg ureg ) -{ - reg->File = ureg.file; - reg->Index = ureg.idx; - reg->Swizzle = ureg.swz; - reg->NegateBase = ureg.negatebase ? 0xf : 0x0; - reg->Abs = ureg.abs; - reg->NegateAbs = ureg.negateabs; -} - -static void emit_dst( struct prog_dst_register *dst, - struct ureg ureg, GLuint mask ) -{ - dst->File = ureg.file; - dst->Index = ureg.idx; - dst->WriteMask = mask; - dst->CondMask = COND_TR; /* always pass cond test */ - dst->CondSwizzle = SWIZZLE_NOOP; -} - -static struct prog_instruction * -emit_op(struct texenv_fragment_program *p, - enum prog_opcode op, - struct ureg dest, - GLuint mask, - GLboolean saturate, - struct ureg src0, - struct ureg src1, - struct ureg src2 ) -{ - GLuint nr = p->program->Base.NumInstructions++; - struct prog_instruction *inst = &p->program->Base.Instructions[nr]; - - assert(nr < MAX_INSTRUCTIONS); - - _mesa_init_instructions(inst, 1); - inst->Opcode = op; - - emit_arg( &inst->SrcReg[0], src0 ); - emit_arg( &inst->SrcReg[1], src1 ); - emit_arg( &inst->SrcReg[2], src2 ); - - inst->SaturateMode = saturate ? SATURATE_ZERO_ONE : SATURATE_OFF; - - emit_dst( &inst->DstReg, dest, mask ); - - /* Accounting for indirection tracking: - */ - if (dest.file == PROGRAM_TEMPORARY) - p->temps_output |= 1 << dest.idx; - - return inst; -} - - -static struct ureg emit_arith( struct texenv_fragment_program *p, - enum prog_opcode op, - struct ureg dest, - GLuint mask, - GLboolean saturate, - struct ureg src0, - struct ureg src1, - struct ureg src2 ) -{ - emit_op(p, op, dest, mask, saturate, src0, src1, src2); - - /* Accounting for indirection tracking: - */ - if (src0.file == PROGRAM_TEMPORARY) - p->alu_temps |= 1 << src0.idx; - - if (!is_undef(src1) && src1.file == PROGRAM_TEMPORARY) - p->alu_temps |= 1 << src1.idx; - - if (!is_undef(src2) && src2.file == PROGRAM_TEMPORARY) - p->alu_temps |= 1 << src2.idx; - - if (dest.file == PROGRAM_TEMPORARY) - p->alu_temps |= 1 << dest.idx; - - p->program->Base.NumAluInstructions++; - return dest; -} - -static struct ureg emit_texld( struct texenv_fragment_program *p, - enum prog_opcode op, - struct ureg dest, - GLuint destmask, - GLuint tex_unit, - GLuint tex_idx, - struct ureg coord ) -{ - struct prog_instruction *inst = emit_op( p, op, - dest, destmask, - GL_FALSE, /* don't saturate? */ - coord, /* arg 0? */ - undef, - undef); - - inst->TexSrcTarget = tex_idx; - inst->TexSrcUnit = tex_unit; - - p->program->Base.NumTexInstructions++; - - /* Is this a texture indirection? - */ - if ((coord.file == PROGRAM_TEMPORARY && - (p->temps_output & (1<alu_temps & (1<program->Base.NumTexIndirections++; - p->temps_output = 1<alu_temps = 0; - assert(0); /* KW: texture env crossbar */ - } - - return dest; -} - - -static struct ureg register_const4f( struct texenv_fragment_program *p, - GLfloat s0, - GLfloat s1, - GLfloat s2, - GLfloat s3) -{ - GLfloat values[4]; - GLuint idx, swizzle; - values[0] = s0; - values[1] = s1; - values[2] = s2; - values[3] = s3; - idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4, - &swizzle ); - ASSERT(swizzle == SWIZZLE_NOOP); - return make_ureg(PROGRAM_CONSTANT, idx); -} - -#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0) -#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1) -#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1) -#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1) - - -static struct ureg get_one( struct texenv_fragment_program *p ) -{ - if (is_undef(p->one)) - p->one = register_scalar_const(p, 1.0); - return p->one; -} - -static struct ureg get_half( struct texenv_fragment_program *p ) -{ - if (is_undef(p->half)) - p->half = register_scalar_const(p, 0.5); - return p->half; -} - -static struct ureg get_zero( struct texenv_fragment_program *p ) -{ - if (is_undef(p->zero)) - p->zero = register_scalar_const(p, 0.0); - return p->zero; -} - - -static void program_error( struct texenv_fragment_program *p, const char *msg ) -{ - _mesa_problem(NULL, msg); - p->error = 1; -} - -static struct ureg get_source( struct texenv_fragment_program *p, - GLuint src, GLuint unit ) -{ - switch (src) { - case SRC_TEXTURE: - assert(!is_undef(p->src_texture[unit])); - return p->src_texture[unit]; - - case SRC_TEXTURE0: - case SRC_TEXTURE1: - case SRC_TEXTURE2: - case SRC_TEXTURE3: - case SRC_TEXTURE4: - case SRC_TEXTURE5: - case SRC_TEXTURE6: - case SRC_TEXTURE7: - assert(!is_undef(p->src_texture[src - SRC_TEXTURE0])); - return p->src_texture[src - SRC_TEXTURE0]; - - case SRC_CONSTANT: - return register_param2(p, STATE_TEXENV_COLOR, unit); - - case SRC_PRIMARY_COLOR: - return register_input(p, FRAG_ATTRIB_COL0); - - case SRC_PREVIOUS: - default: - if (is_undef(p->src_previous)) - return register_input(p, FRAG_ATTRIB_COL0); - else - return p->src_previous; - } -} - -static struct ureg emit_combine_source( struct texenv_fragment_program *p, - GLuint mask, - GLuint unit, - GLuint source, - GLuint operand ) -{ - struct ureg arg, src, one; - - src = get_source(p, source, unit); - - switch (operand) { - case OPR_ONE_MINUS_SRC_COLOR: - /* Get unused tmp, - * Emit tmp = 1.0 - arg.xyzw - */ - arg = get_temp( p ); - one = get_one( p ); - return emit_arith( p, OPCODE_SUB, arg, mask, 0, one, src, undef); - - case OPR_SRC_ALPHA: - if (mask == WRITEMASK_W) - return src; - else - return swizzle1( src, SWIZZLE_W ); - case OPR_ONE_MINUS_SRC_ALPHA: - /* Get unused tmp, - * Emit tmp = 1.0 - arg.wwww - */ - arg = get_temp(p); - one = get_one(p); - return emit_arith(p, OPCODE_SUB, arg, mask, 0, - one, swizzle1(src, SWIZZLE_W), undef); - case OPR_ZERO: - return get_zero(p); - case OPR_ONE: - return get_one(p); - case OPR_SRC_COLOR: - default: - return src; - } -} - -static GLboolean args_match( struct state_key *key, GLuint unit ) -{ - GLuint i, nr = key->unit[unit].NumArgsRGB; - - for (i = 0 ; i < nr ; i++) { - if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source) - return GL_FALSE; - - switch(key->unit[unit].OptA[i].Operand) { - case OPR_SRC_ALPHA: - switch(key->unit[unit].OptRGB[i].Operand) { - case OPR_SRC_COLOR: - case OPR_SRC_ALPHA: - break; - default: - return GL_FALSE; - } - break; - case OPR_ONE_MINUS_SRC_ALPHA: - switch(key->unit[unit].OptRGB[i].Operand) { - case OPR_ONE_MINUS_SRC_COLOR: - case OPR_ONE_MINUS_SRC_ALPHA: - break; - default: - return GL_FALSE; - } - break; - default: - return GL_FALSE; /* impossible */ - } - } - - return GL_TRUE; -} - -static struct ureg emit_combine( struct texenv_fragment_program *p, - struct ureg dest, - GLuint mask, - GLboolean saturate, - GLuint unit, - GLuint nr, - GLuint mode, - const struct mode_opt *opt) -{ - struct ureg src[3]; - struct ureg tmp, half; - GLuint i; - - tmp = undef; /* silence warning (bug 5318) */ - - for (i = 0; i < nr; i++) - src[i] = emit_combine_source( p, mask, unit, opt[i].Source, opt[i].Operand ); - - switch (mode) { - case MODE_REPLACE: - if (mask == WRITEMASK_XYZW && !saturate) - return src[0]; - else - return emit_arith( p, OPCODE_MOV, dest, mask, saturate, src[0], undef, undef ); - case MODE_MODULATE: - return emit_arith( p, OPCODE_MUL, dest, mask, saturate, - src[0], src[1], undef ); - case MODE_ADD: - return emit_arith( p, OPCODE_ADD, dest, mask, saturate, - src[0], src[1], undef ); - case MODE_ADD_SIGNED: - /* tmp = arg0 + arg1 - * result = tmp - .5 - */ - half = get_half(p); - tmp = get_temp( p ); - emit_arith( p, OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef ); - emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp, half, undef ); - return dest; - case MODE_INTERPOLATE: - /* Arg0 * (Arg2) + Arg1 * (1-Arg2) -- note arguments are reordered: - */ - return emit_arith( p, OPCODE_LRP, dest, mask, saturate, src[2], src[0], src[1] ); - - case MODE_SUBTRACT: - return emit_arith( p, OPCODE_SUB, dest, mask, saturate, src[0], src[1], undef ); - - case MODE_DOT3_RGBA: - case MODE_DOT3_RGBA_EXT: - case MODE_DOT3_RGB_EXT: - case MODE_DOT3_RGB: { - struct ureg tmp0 = get_temp( p ); - struct ureg tmp1 = get_temp( p ); - struct ureg neg1 = register_scalar_const(p, -1); - struct ureg two = register_scalar_const(p, 2); - - /* tmp0 = 2*src0 - 1 - * tmp1 = 2*src1 - 1 - * - * dst = tmp0 dot3 tmp1 - */ - emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, - two, src[0], neg1); - - if (_mesa_memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0) - tmp1 = tmp0; - else - emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, - two, src[1], neg1); - emit_arith( p, OPCODE_DP3, dest, mask, saturate, tmp0, tmp1, undef); - return dest; - } - case MODE_MODULATE_ADD_ATI: - /* Arg0 * Arg2 + Arg1 */ - return emit_arith( p, OPCODE_MAD, dest, mask, saturate, - src[0], src[2], src[1] ); - case MODE_MODULATE_SIGNED_ADD_ATI: { - /* Arg0 * Arg2 + Arg1 - 0.5 */ - struct ureg tmp0 = get_temp(p); - half = get_half(p); - emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[0], src[2], src[1] ); - emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef ); - return dest; - } - case MODE_MODULATE_SUBTRACT_ATI: - /* Arg0 * Arg2 - Arg1 */ - emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) ); - return dest; - default: - return src[0]; - } -} - - -/** - * Generate instructions for one texture unit's env/combiner mode. - */ -static struct ureg -emit_texenv(struct texenv_fragment_program *p, GLuint unit) -{ - struct state_key *key = p->state; - GLboolean saturate = (unit < p->last_tex_stage); - GLuint rgb_shift, alpha_shift; - struct ureg out, shift; - struct ureg dest; - - if (!key->unit[unit].enabled) { - return get_source(p, SRC_PREVIOUS, 0); - } - - switch (key->unit[unit].ModeRGB) { - case MODE_DOT3_RGB_EXT: - alpha_shift = key->unit[unit].ScaleShiftA; - rgb_shift = 0; - break; - case MODE_DOT3_RGBA_EXT: - alpha_shift = 0; - rgb_shift = 0; - break; - default: - rgb_shift = key->unit[unit].ScaleShiftRGB; - alpha_shift = key->unit[unit].ScaleShiftA; - break; - } - - /* If this is the very last calculation, emit direct to output reg: - */ - if (key->separate_specular || - unit != p->last_tex_stage || - alpha_shift || - rgb_shift) - dest = get_temp( p ); - else - dest = make_ureg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); - - /* Emit the RGB and A combine ops - */ - if (key->unit[unit].ModeRGB == key->unit[unit].ModeA && - args_match(key, unit)) { - out = emit_combine( p, dest, WRITEMASK_XYZW, saturate, - unit, - key->unit[unit].NumArgsRGB, - key->unit[unit].ModeRGB, - key->unit[unit].OptRGB); - } - else if (key->unit[unit].ModeRGB == MODE_DOT3_RGBA_EXT || - key->unit[unit].ModeRGB == MODE_DOT3_RGBA) { - - out = emit_combine( p, dest, WRITEMASK_XYZW, saturate, - unit, - key->unit[unit].NumArgsRGB, - key->unit[unit].ModeRGB, - key->unit[unit].OptRGB); - } - else { - /* Need to do something to stop from re-emitting identical - * argument calculations here: - */ - out = emit_combine( p, dest, WRITEMASK_XYZ, saturate, - unit, - key->unit[unit].NumArgsRGB, - key->unit[unit].ModeRGB, - key->unit[unit].OptRGB); - out = emit_combine( p, dest, WRITEMASK_W, saturate, - unit, - key->unit[unit].NumArgsA, - key->unit[unit].ModeA, - key->unit[unit].OptA); - } - - /* Deal with the final shift: - */ - if (alpha_shift || rgb_shift) { - if (rgb_shift == alpha_shift) { - shift = register_scalar_const(p, (GLfloat)(1<src_texture[unit])) { - GLuint dim = p->state->unit[unit].source_index; - struct ureg texcoord = register_input(p, FRAG_ATTRIB_TEX0+unit); - struct ureg tmp = get_tex_temp( p ); - - if (dim == TEXTURE_UNKNOWN_INDEX) - program_error(p, "TexSrcBit"); - - /* TODO: Use D0_MASK_XY where possible. - */ - if (p->state->unit[unit].enabled) { - p->src_texture[unit] = emit_texld( p, OPCODE_TXP, - tmp, WRITEMASK_XYZW, - unit, dim, texcoord ); - if (p->state->unit[unit].shadow) - p->program->Base.ShadowSamplers |= 1 << unit; - - p->program->Base.SamplersUsed |= (1 << unit); - /* This identity mapping should already be in place - * (see _mesa_init_program_struct()) but let's be safe. - */ - p->program->Base.SamplerUnits[unit] = unit; - } - else - p->src_texture[unit] = get_zero(p); - } -} - -static GLboolean load_texenv_source( struct texenv_fragment_program *p, - GLuint src, GLuint unit ) -{ - switch (src) { - case SRC_TEXTURE: - load_texture(p, unit); - break; - - case SRC_TEXTURE0: - case SRC_TEXTURE1: - case SRC_TEXTURE2: - case SRC_TEXTURE3: - case SRC_TEXTURE4: - case SRC_TEXTURE5: - case SRC_TEXTURE6: - case SRC_TEXTURE7: - load_texture(p, src - SRC_TEXTURE0); - break; - - default: - break; - } - - return GL_TRUE; -} - - -/** - * Generate instructions for loading all texture source terms. - */ -static GLboolean -load_texunit_sources( struct texenv_fragment_program *p, int unit ) -{ - struct state_key *key = p->state; - GLuint i; - - for (i = 0; i < key->unit[unit].NumArgsRGB; i++) { - load_texenv_source( p, key->unit[unit].OptRGB[i].Source, unit); - } - - for (i = 0; i < key->unit[unit].NumArgsA; i++) { - load_texenv_source( p, key->unit[unit].OptA[i].Source, unit ); - } - - return GL_TRUE; -} - - -/** - * Generate a new fragment program which implements the context's - * current texture env/combine mode. - */ -static void -create_new_program(GLcontext *ctx, struct state_key *key, - struct gl_fragment_program *program) -{ - struct prog_instruction instBuffer[MAX_INSTRUCTIONS]; - struct texenv_fragment_program p; - GLuint unit; - struct ureg cf, out; - - _mesa_memset(&p, 0, sizeof(p)); - p.ctx = ctx; - p.state = key; - p.program = program; - - /* During code generation, use locally-allocated instruction buffer, - * then alloc dynamic storage below. - */ - p.program->Base.Instructions = instBuffer; - p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB; - p.program->Base.NumTexIndirections = 1; /* correct? */ - p.program->Base.NumTexInstructions = 0; - p.program->Base.NumAluInstructions = 0; - p.program->Base.String = NULL; - p.program->Base.NumInstructions = - p.program->Base.NumTemporaries = - p.program->Base.NumParameters = - p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0; - p.program->Base.Parameters = _mesa_new_parameter_list(); - - p.program->Base.InputsRead = 0; - p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLR; - - for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) - p.src_texture[unit] = undef; - - p.src_previous = undef; - p.half = undef; - p.zero = undef; - p.one = undef; - - p.last_tex_stage = 0; - release_temps(ctx, &p); - - if (key->enabled_units) { - /* First pass - to support texture_env_crossbar, first identify - * all referenced texture sources and emit texld instructions - * for each: - */ - for (unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++) - if (key->unit[unit].enabled) { - load_texunit_sources( &p, unit ); - p.last_tex_stage = unit; - } - - /* Second pass - emit combine instructions to build final color: - */ - for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) - if (key->enabled_units & (1<separate_specular) { - /* Emit specular add. - */ - struct ureg s = register_input(&p, FRAG_ATTRIB_COL1); - emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef ); - emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef ); - } - else if (_mesa_memcmp(&cf, &out, sizeof(cf)) != 0) { - /* Will wind up in here if no texture enabled or a couple of - * other scenarios (GL_REPLACE for instance). - */ - emit_arith( &p, OPCODE_MOV, out, WRITEMASK_XYZW, 0, cf, undef, undef ); - } - - /* Finish up: - */ - emit_arith( &p, OPCODE_END, undef, WRITEMASK_XYZW, 0, undef, undef, undef); - - if (key->fog_enabled) { - /* Pull fog mode from GLcontext, the value in the state key is - * a reduced value and not what is expected in FogOption - */ - p.program->FogOption = ctx->Fog.Mode; - p.program->Base.InputsRead |= FRAG_BIT_FOGC; /* XXX new */ - } else - p.program->FogOption = GL_NONE; - - if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections) - program_error(&p, "Exceeded max nr indirect texture lookups"); - - if (p.program->Base.NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions) - program_error(&p, "Exceeded max TEX instructions"); - - if (p.program->Base.NumAluInstructions > ctx->Const.FragmentProgram.MaxAluInstructions) - program_error(&p, "Exceeded max ALU instructions"); - - ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS); - - /* Allocate final instruction array */ - p.program->Base.Instructions - = _mesa_alloc_instructions(p.program->Base.NumInstructions); - if (!p.program->Base.Instructions) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, - "generating tex env program"); - return; - } - _mesa_copy_instructions(p.program->Base.Instructions, instBuffer, - p.program->Base.NumInstructions); - - if (p.program->FogOption) { - _mesa_append_fog_code(ctx, p.program); - p.program->FogOption = GL_NONE; - } - - - /* Notify driver the fragment program has (actually) changed. - */ - if (ctx->Driver.ProgramStringNotify) { - ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB, - &p.program->Base ); - } - - if (DISASSEM) { - _mesa_print_program(&p.program->Base); - _mesa_printf("\n"); - } -} - - -/** - * Return a fragment program which implements the current - * fixed-function texture, fog and color-sum operations. - */ -struct gl_fragment_program * -_mesa_get_fixed_func_fragment_program(GLcontext *ctx) -{ - struct gl_fragment_program *prog; - struct state_key key; - - make_state_key(ctx, &key); - - prog = (struct gl_fragment_program *) - _mesa_search_program_cache(ctx->FragmentProgram.Cache, - &key, sizeof(key)); - - if (!prog) { - prog = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - - create_new_program(ctx, &key, prog); - - _mesa_program_cache_insert(ctx, ctx->FragmentProgram.Cache, - &key, sizeof(key), &prog->Base); - } - - return prog; -} - - - -/** - * If _MaintainTexEnvProgram is set we'll generate a fragment program that - * implements the current texture env/combine mode. - * This function generates that program and puts it into effect. - */ -void -_mesa_UpdateTexEnvProgram( GLcontext *ctx ) -{ - const struct gl_fragment_program *prev = ctx->FragmentProgram._Current; - - ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram); - - /* If a conventional fragment program/shader isn't in effect... */ - if (!ctx->FragmentProgram._Enabled && - (!ctx->Shader.CurrentProgram || - !ctx->Shader.CurrentProgram->FragmentProgram) ) - { - struct gl_fragment_program *newProg; - - newProg = _mesa_get_fixed_func_fragment_program(ctx); - - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, newProg); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, newProg); - } - - /* Tell the driver about the change. Could define a new target for - * this? - */ - if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct gl_program *) ctx->FragmentProgram._Current); - } -} diff --git a/src/libs/mesa/mesa/main/texenvprogram.h b/src/libs/mesa/mesa/main/texenvprogram.h deleted file mode 100644 index a7aa60cf37..0000000000 --- a/src/libs/mesa/mesa/main/texenvprogram.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 TEXENVPROGRAM_H -#define TEXENVPROGRAM_H - - -#include "mtypes.h" - -extern struct gl_fragment_program * -_mesa_get_fixed_func_fragment_program(GLcontext *ctx); - -extern void _mesa_UpdateTexEnvProgram( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/texformat.c b/src/libs/mesa/mesa/main/texformat.c deleted file mode 100644 index 08725846c6..0000000000 --- a/src/libs/mesa/mesa/main/texformat.c +++ /dev/null @@ -1,1823 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file texformat.c - * Texture formats. - * - * \author Gareth Hughes - */ - - -#include "colormac.h" -#include "context.h" -#include "texformat.h" -#include "texstore.h" - - -#if FEATURE_EXT_texture_sRGB - -/** - * Convert an 8-bit sRGB value from non-linear space to a - * linear RGB value in [0, 1]. - * Implemented with a 256-entry lookup table. - */ -static INLINE GLfloat -nonlinear_to_linear(GLubyte cs8) -{ - static GLfloat table[256]; - static GLboolean tableReady = GL_FALSE; - if (!tableReady) { - /* compute lookup table now */ - GLuint i; - for (i = 0; i < 256; i++) { - const GLfloat cs = UBYTE_TO_FLOAT(i); - if (cs <= 0.04045) { - table[i] = cs / 12.92f; - } - else { - table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4); - } - } - tableReady = GL_TRUE; - } - return table[cs8]; -} - - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/* Texel fetch routines for all supported formats - */ -#define DIM 1 -#include "texformat_tmp.h" - -#define DIM 2 -#include "texformat_tmp.h" - -#define DIM 3 -#include "texformat_tmp.h" - -/** - * Null texel fetch function. - * - * Have to have this so the FetchTexel function pointer is never NULL. - */ -static void fetch_null_texel( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0; - texel[GCOMP] = 0; - texel[BCOMP] = 0; - texel[ACOMP] = 0; - _mesa_warning(NULL, "fetch_null_texel() called!"); -} - -static void fetch_null_texelf( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0.0; - texel[GCOMP] = 0.0; - texel[BCOMP] = 0.0; - texel[ACOMP] = 0.0; - _mesa_warning(NULL, "fetch_null_texelf() called!"); -} - -static void store_null_texel(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* no-op */ -} - - -/** - * Notes about the predefined gl_texture_formats: - * - * 1. There are 1D, 2D and 3D functions for fetching texels from texture - * images, returning both GLchan values and GLfloat values. (six - * functions in total) - * You don't have to provide both the GLchan and GLfloat functions; - * just one or the other is OK. Mesa will use an "adaptor" to convert - * between GLchan/GLfloat when needed. - * Since the adaptors have small performance penalty, we provide both - * GLchan and GLfloat functions for some common formats like RGB, RGBA. - */ - - -/***************************************************************/ -/** \name Default GLchan-based formats */ -/*@{*/ - -const struct gl_texture_format _mesa_texformat_rgba = { - MESA_FORMAT_RGBA, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba, /* StoreTexImageFunc */ - fetch_texel_1d_rgba, /* FetchTexel1D */ - fetch_texel_2d_rgba, /* FetchTexel2D */ - fetch_texel_3d_rgba, /* FetchTexel3D */ - fetch_texel_1d_f_rgba, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba, /* FetchTexel3Df */ - store_texel_rgba /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb = { - MESA_FORMAT_RGB, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_rgb, /* FetchTexel1D */ - fetch_texel_2d_rgb, /* FetchTexel2D */ - fetch_texel_3d_rgb, /* FetchTexel3D */ - fetch_texel_1d_f_rgb, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb, /* FetchTexel3Df */ - store_texel_rgb /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha = { - MESA_FORMAT_ALPHA, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_alpha, /* FetchTexel1D */ - fetch_texel_2d_alpha, /* FetchTexel2D */ - fetch_texel_3d_alpha, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_alpha /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance = { - MESA_FORMAT_LUMINANCE, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_luminance, /* FetchTexel1D */ - fetch_texel_2d_luminance, /* FetchTexel2D */ - fetch_texel_3d_luminance, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_luminance /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha = { - MESA_FORMAT_LUMINANCE_ALPHA, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_luminance_alpha, /* FetchTexel1D */ - fetch_texel_2d_luminance_alpha, /* FetchTexel2D */ - fetch_texel_3d_luminance_alpha, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_luminance_alpha /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity = { - MESA_FORMAT_INTENSITY, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - CHAN_BITS, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_intensity, /* FetchTexel1D */ - fetch_texel_2d_intensity, /* FetchTexel2D */ - fetch_texel_3d_intensity, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_intensity /* StoreTexel */ -}; - - -#if FEATURE_EXT_texture_sRGB - -const struct gl_texture_format _mesa_texformat_srgb8 = { - MESA_FORMAT_SRGB8, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_srgb8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_srgb8, /* FetchTexel1Df */ - fetch_texel_2d_srgb8, /* FetchTexel2Df */ - fetch_texel_3d_srgb8, /* FetchTexel3Df */ - store_texel_srgb8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_srgba8 = { - MESA_FORMAT_SRGBA8, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_srgba8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_srgba8, /* FetchTexel1Df */ - fetch_texel_2d_srgba8, /* FetchTexel2Df */ - fetch_texel_3d_srgba8, /* FetchTexel3Df */ - store_texel_srgba8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_sl8 = { - MESA_FORMAT_SL8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_sl8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_sl8, /* FetchTexel1Df */ - fetch_texel_2d_sl8, /* FetchTexel2Df */ - fetch_texel_3d_sl8, /* FetchTexel3Df */ - store_texel_sl8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_sla8 = { - MESA_FORMAT_SLA8, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_sla8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_sla8, /* FetchTexel1Df */ - fetch_texel_2d_sla8, /* FetchTexel2Df */ - fetch_texel_3d_sla8, /* FetchTexel3Df */ - store_texel_sla8 /* StoreTexel */ -}; - -#endif /* FEATURE_EXT_texture_sRGB */ - -const struct gl_texture_format _mesa_texformat_rgba_float32 = { - MESA_FORMAT_RGBA_FLOAT32, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f32, /* FetchTexel3Df */ - store_texel_rgba_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_float16 = { - MESA_FORMAT_RGBA_FLOAT16, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f16, /* FetchTexel3Df */ - store_texel_rgba_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float32 = { - MESA_FORMAT_RGB_FLOAT32, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f32, /* FetchTexel3Df */ - store_texel_rgb_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float16 = { - MESA_FORMAT_RGB_FLOAT16, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f16, /* FetchTexel3Df */ - store_texel_rgb_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float32 = { - MESA_FORMAT_ALPHA_FLOAT32, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f32, /* FetchTexel3Df */ - store_texel_alpha_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float16 = { - MESA_FORMAT_ALPHA_FLOAT16, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f16, /* FetchTexel3Df */ - store_texel_alpha_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float32 = { - MESA_FORMAT_LUMINANCE_FLOAT32, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f32, /* FetchTexel3Df */ - store_texel_luminance_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float16 = { - MESA_FORMAT_LUMINANCE_FLOAT16, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f16, /* FetchTexel3Df */ - store_texel_luminance_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f32,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f32,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f32,/* FetchTexel3Df */ - store_texel_luminance_alpha_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f16,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f16,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f16,/* FetchTexel3Df */ - store_texel_luminance_alpha_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float32 = { - MESA_FORMAT_INTENSITY_FLOAT32, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLfloat), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f32, /* FetchTexel3Df */ - store_texel_intensity_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float16 = { - MESA_FORMAT_INTENSITY_FLOAT16, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLhalfARB), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f16, /* FetchTexel3Df */ - store_texel_intensity_f16 /* StoreTexel */ -}; - - -/*@}*/ - - -/***************************************************************/ -/** \name Hardware formats */ -/*@{*/ - -const struct gl_texture_format _mesa_texformat_rgba8888 = { - MESA_FORMAT_RGBA8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - fetch_texel_1d_rgba8888, /* FetchTexel1D */ - fetch_texel_2d_rgba8888, /* FetchTexel2D */ - fetch_texel_3d_rgba8888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgba8888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba8888_rev = { - MESA_FORMAT_RGBA8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - fetch_texel_1d_rgba8888_rev, /* FetchTexel1D */ - fetch_texel_2d_rgba8888_rev, /* FetchTexel2D */ - fetch_texel_3d_rgba8888_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgba8888_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - fetch_texel_1d_argb8888, /* FetchTexel1D */ - fetch_texel_2d_argb8888, /* FetchTexel2D */ - fetch_texel_3d_argb8888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb8888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888_rev = { - MESA_FORMAT_ARGB8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - fetch_texel_1d_argb8888_rev, /* FetchTexel1D */ - fetch_texel_2d_argb8888_rev, /* FetchTexel2D */ - fetch_texel_3d_argb8888_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb8888_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb888 = { - MESA_FORMAT_RGB888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_rgb888, /* StoreTexImageFunc */ - fetch_texel_1d_rgb888, /* FetchTexel1D */ - fetch_texel_2d_rgb888, /* FetchTexel2D */ - fetch_texel_3d_rgb888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgb888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_bgr888 = { - MESA_FORMAT_BGR888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_bgr888, /* StoreTexImageFunc */ - fetch_texel_1d_bgr888, /* FetchTexel1D */ - fetch_texel_2d_bgr888, /* FetchTexel2D */ - fetch_texel_3d_bgr888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_bgr888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565 = { - MESA_FORMAT_RGB565, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ - fetch_texel_1d_rgb565, /* FetchTexel1D */ - fetch_texel_2d_rgb565, /* FetchTexel2D */ - fetch_texel_3d_rgb565, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgb565 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565_rev = { - MESA_FORMAT_RGB565_REV, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ - fetch_texel_1d_rgb565_rev, /* FetchTexel1D */ - fetch_texel_2d_rgb565_rev, /* FetchTexel2D */ - fetch_texel_3d_rgb565_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgb565_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba4444 = { - MESA_FORMAT_RGBA4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgba4444, /* StoreTexImageFunc */ - fetch_texel_1d_rgba4444, /* FetchTexel1D */ - fetch_texel_2d_rgba4444, /* FetchTexel2D */ - fetch_texel_3d_rgba4444, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgba4444 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - fetch_texel_1d_argb4444, /* FetchTexel1D */ - fetch_texel_2d_argb4444, /* FetchTexel2D */ - fetch_texel_3d_argb4444, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb4444 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444_rev = { - MESA_FORMAT_ARGB4444_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - fetch_texel_1d_argb4444_rev, /* FetchTexel1D */ - fetch_texel_2d_argb4444_rev, /* FetchTexel2D */ - fetch_texel_3d_argb4444_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb4444_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba5551 = { - MESA_FORMAT_RGBA5551, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgba5551, /* StoreTexImageFunc */ - fetch_texel_1d_rgba5551, /* FetchTexel1D */ - fetch_texel_2d_rgba5551, /* FetchTexel2D */ - fetch_texel_3d_rgba5551, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgba5551 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - fetch_texel_1d_argb1555, /* FetchTexel1D */ - fetch_texel_2d_argb1555, /* FetchTexel2D */ - fetch_texel_3d_argb1555, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb1555 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555_rev = { - MESA_FORMAT_ARGB1555_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - fetch_texel_1d_argb1555_rev, /* FetchTexel1D */ - fetch_texel_2d_argb1555_rev, /* FetchTexel2D */ - fetch_texel_3d_argb1555_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_argb1555_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_al88 = { - MESA_FORMAT_AL88, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ - fetch_texel_1d_al88, /* FetchTexel1D */ - fetch_texel_2d_al88, /* FetchTexel2D */ - fetch_texel_3d_al88, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_al88 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_al88_rev = { - MESA_FORMAT_AL88_REV, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ - fetch_texel_1d_al88_rev, /* FetchTexel1D */ - fetch_texel_2d_al88_rev, /* FetchTexel2D */ - fetch_texel_3d_al88_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_al88_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb332 = { - MESA_FORMAT_RGB332, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 3, /* RedBits */ - 3, /* GreenBits */ - 2, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_rgb332, /* StoreTexImageFunc */ - fetch_texel_1d_rgb332, /* FetchTexel1D */ - fetch_texel_2d_rgb332, /* FetchTexel2D */ - fetch_texel_3d_rgb332, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_rgb332 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_a8 = { - MESA_FORMAT_A8, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8, /* StoreTexImageFunc */ - fetch_texel_1d_a8, /* FetchTexel1D */ - fetch_texel_2d_a8, /* FetchTexel2D */ - fetch_texel_3d_a8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_a8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_l8 = { - MESA_FORMAT_L8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_l8, /* FetchTexel1D */ - fetch_texel_2d_l8, /* FetchTexel2D */ - fetch_texel_3d_l8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_l8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_i8 = { - MESA_FORMAT_I8, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_i8, /* FetchTexel1D */ - fetch_texel_2d_i8, /* FetchTexel2D */ - fetch_texel_3d_i8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_i8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ci8 = { - MESA_FORMAT_CI8, /* MesaFormat */ - GL_COLOR_INDEX, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 8, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_ci8, /* StoreTexImageFunc */ - fetch_texel_1d_ci8, /* FetchTexel1D */ - fetch_texel_2d_ci8, /* FetchTexel2D */ - fetch_texel_3d_ci8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_ci8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr = { - MESA_FORMAT_YCBCR, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - fetch_texel_1d_ycbcr, /* FetchTexel1D */ - fetch_texel_2d_ycbcr, /* FetchTexel2D */ - fetch_texel_3d_ycbcr, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_ycbcr /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr_rev = { - MESA_FORMAT_YCBCR_REV, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - fetch_texel_1d_ycbcr_rev, /* FetchTexel1D */ - fetch_texel_2d_ycbcr_rev, /* FetchTexel2D */ - fetch_texel_3d_ycbcr_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - store_texel_ycbcr_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z24_s8 = { - MESA_FORMAT_Z24_S8, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_z24_s8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_z24_s8, /* FetchTexel1Df */ - fetch_texel_2d_f_z24_s8, /* FetchTexel2Df */ - fetch_texel_3d_f_z24_s8, /* FetchTexel3Df */ - store_texel_z24_s8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_s8_z24 = { - MESA_FORMAT_S8_Z24, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_s8_z24, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_s8_z24, /* FetchTexel1Df */ - fetch_texel_2d_f_s8_z24, /* FetchTexel2Df */ - fetch_texel_3d_f_s8_z24, /* FetchTexel3Df */ - store_texel_s8_z24 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z16 = { - MESA_FORMAT_Z16, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLushort) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLushort), /* TexelBytes */ - _mesa_texstore_z16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z16, /* FetchTexel1Df */ - fetch_texel_2d_f_z16, /* FetchTexel2Df */ - fetch_texel_3d_f_z16, /* FetchTexel3Df */ - store_texel_z16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z32 = { - MESA_FORMAT_Z32, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLuint) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLuint), /* TexelBytes */ - _mesa_texstore_z32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z32, /* FetchTexel1Df */ - fetch_texel_2d_f_z32, /* FetchTexel2Df */ - fetch_texel_3d_f_z32, /* FetchTexel3Df */ - store_texel_z32 /* StoreTexel */ -}; - -/*@}*/ - - -/***************************************************************/ -/** \name Null format (useful for proxy textures) */ -/*@{*/ - -const struct gl_texture_format _mesa_null_texformat = { - -1, /* MesaFormat */ - 0, /* BaseFormat */ - GL_NONE, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - fetch_null_texel, /* FetchTexel1D */ - fetch_null_texel, /* FetchTexel2D */ - fetch_null_texel, /* FetchTexel3D */ - fetch_null_texelf, /* FetchTexel1Df */ - fetch_null_texelf, /* FetchTexel2Df */ - fetch_null_texelf, /* FetchTexel3Df */ - store_null_texel /* StoreTexel */ -}; - -/*@}*/ - - -/** - * Choose an appropriate texture format given the format, type and - * internalFormat parameters passed to glTexImage(). - * - * \param ctx the GL context. - * \param internalFormat user's prefered internal texture format. - * \param format incoming image pixel format. - * \param type incoming image data type. - * - * \return a pointer to a gl_texture_format object which describes the - * choosen texture format, or NULL on failure. - * - * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers - * will typically override this function with a specialized version. - */ -const struct gl_texture_format * -_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, - GLenum format, GLenum type ) -{ - (void) format; - (void) type; - - switch (internalFormat) { - /* RGBA formats */ - case 4: - case GL_RGBA: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return &_mesa_texformat_rgba; - case GL_RGBA8: - return &_mesa_texformat_rgba8888; - case GL_RGB5_A1: - return &_mesa_texformat_argb1555; - case GL_RGBA2: - return &_mesa_texformat_argb4444_rev; /* just to test another format*/ - case GL_RGBA4: - return &_mesa_texformat_argb4444; - - /* RGB formats */ - case 3: - case GL_RGB: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return &_mesa_texformat_rgb; - case GL_RGB8: - return &_mesa_texformat_rgb888; - case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; - case GL_RGB4: - return &_mesa_texformat_rgb565_rev; /* just to test another format */ - case GL_RGB5: - return &_mesa_texformat_rgb565; - - /* Alpha formats */ - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA12: - case GL_ALPHA16: - return &_mesa_texformat_alpha; - case GL_ALPHA8: - return &_mesa_texformat_a8; - - /* Luminance formats */ - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return &_mesa_texformat_luminance; - case GL_LUMINANCE8: - return &_mesa_texformat_l8; - - /* Luminance/Alpha formats */ - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return &_mesa_texformat_luminance_alpha; - case GL_LUMINANCE8_ALPHA8: - return &_mesa_texformat_al88; - - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY12: - case GL_INTENSITY16: - return &_mesa_texformat_intensity; - case GL_INTENSITY8: - return &_mesa_texformat_i8; - - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX12_EXT: - case GL_COLOR_INDEX16_EXT: - case GL_COLOR_INDEX8_EXT: - return &_mesa_texformat_ci8; - - default: - ; /* fallthrough */ - } - - if (ctx->Extensions.ARB_depth_texture) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return &_mesa_texformat_z32; - case GL_DEPTH_COMPONENT16: - return &_mesa_texformat_z16; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA_ARB: - return &_mesa_texformat_alpha; - case GL_COMPRESSED_LUMINANCE_ARB: - return &_mesa_texformat_luminance; - case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return &_mesa_texformat_luminance_alpha; - case GL_COMPRESSED_INTENSITY_ARB: - return &_mesa_texformat_intensity; - case GL_COMPRESSED_RGB_ARB: -#if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgb_fxt1; -#endif -#if FEATURE_texture_s3tc - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgb_dxt1; -#endif - return &_mesa_texformat_rgb; - case GL_COMPRESSED_RGBA_ARB: -#if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgba_fxt1; -#endif -#if FEATURE_texture_s3tc - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ -#endif - return &_mesa_texformat_rgba; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.MESA_ycbcr_texture) { - if (internalFormat == GL_YCBCR_MESA) { - if (type == GL_UNSIGNED_SHORT_8_8_MESA) - return &_mesa_texformat_ycbcr; - else - return &_mesa_texformat_ycbcr_rev; - } - } - -#if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) { - switch (internalFormat) { - case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; - default: - ; /* fallthrough */ - } - } -#endif - -#if FEATURE_texture_s3tc - if (ctx->Extensions.EXT_texture_compression_s3tc) { - switch (internalFormat) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.S3_s3tc) { - switch (internalFormat) { - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - return &_mesa_texformat_rgb_dxt1; - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - return &_mesa_texformat_rgba_dxt3; - default: - ; /* fallthrough */ - } - } -#endif - - if (ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_ALPHA16F_ARB: - return &_mesa_texformat_alpha_float16; - case GL_ALPHA32F_ARB: - return &_mesa_texformat_alpha_float32; - case GL_LUMINANCE16F_ARB: - return &_mesa_texformat_luminance_float16; - case GL_LUMINANCE32F_ARB: - return &_mesa_texformat_luminance_float32; - case GL_LUMINANCE_ALPHA16F_ARB: - return &_mesa_texformat_luminance_alpha_float16; - case GL_LUMINANCE_ALPHA32F_ARB: - return &_mesa_texformat_luminance_alpha_float32; - case GL_INTENSITY16F_ARB: - return &_mesa_texformat_intensity_float16; - case GL_INTENSITY32F_ARB: - return &_mesa_texformat_intensity_float32; - case GL_RGB16F_ARB: - return &_mesa_texformat_rgb_float16; - case GL_RGB32F_ARB: - return &_mesa_texformat_rgb_float32; - case GL_RGBA16F_ARB: - return &_mesa_texformat_rgba_float16; - case GL_RGBA32F_ARB: - return &_mesa_texformat_rgba_float32; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_depth_stencil) { - switch (internalFormat) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_z24_s8; - default: - ; /* fallthrough */ - } - } - -#if FEATURE_EXT_texture_sRGB - if (ctx->Extensions.EXT_texture_sRGB) { - switch (internalFormat) { - case GL_SRGB_EXT: - case GL_SRGB8_EXT: - return &_mesa_texformat_srgb8; - case GL_SRGB_ALPHA_EXT: - case GL_SRGB8_ALPHA8_EXT: - return &_mesa_texformat_srgba8; - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - return &_mesa_texformat_sl8; - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: - return &_mesa_texformat_sla8; - /* NOTE: not supporting any compression of sRGB at this time */ - case GL_COMPRESSED_SRGB_EXT: - return &_mesa_texformat_srgb8; - case GL_COMPRESSED_SRGB_ALPHA_EXT: - return &_mesa_texformat_srgba8; - case GL_COMPRESSED_SLUMINANCE_EXT: - return &_mesa_texformat_sl8; - case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_sla8; - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - return &_mesa_texformat_srgb8; - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return &_mesa_texformat_srgba8; - default: - ; /* fallthrough */ - } - } -#endif /* FEATURE_EXT_texture_sRGB */ - - _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); - return NULL; -} - - - -/** - * Return datatype and number of components per texel for the - * given gl_texture_format. - */ -void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, - GLenum *datatype, GLuint *comps) -{ - switch (format->MesaFormat) { - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_RGBA8888_REV: - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_ARGB8888_REV: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - *datatype = GL_UNSIGNED_SHORT_5_6_5; - *comps = 3; - return; - - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - *datatype = GL_UNSIGNED_SHORT_4_4_4_4; - *comps = 4; - return; - - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB1555_REV: - *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; - *comps = 4; - return; - - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; - case MESA_FORMAT_RGB332: - *datatype = GL_UNSIGNED_BYTE_3_3_2; - *comps = 3; - return; - - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_CI8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - - case MESA_FORMAT_YCBCR: - case MESA_FORMAT_YCBCR_REV: - *datatype = GL_UNSIGNED_SHORT; - *comps = 2; - return; - - case MESA_FORMAT_Z24_S8: - *datatype = GL_UNSIGNED_INT; - *comps = 1; /* XXX OK? */ - return; - - case MESA_FORMAT_Z16: - *datatype = GL_UNSIGNED_SHORT; - *comps = 1; - return; - - case MESA_FORMAT_Z32: - *datatype = GL_UNSIGNED_INT; - *comps = 1; - return; - - case MESA_FORMAT_SRGB8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_SRGBA8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 4; - return; - case MESA_FORMAT_SL8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - case MESA_FORMAT_SLA8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; - - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - /* XXX generate error instead? */ - *datatype = GL_UNSIGNED_BYTE; - *comps = 0; - return; - - case MESA_FORMAT_RGBA: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB: - *datatype = CHAN_TYPE; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA: - *datatype = CHAN_TYPE; - *comps = 2; - return; - case MESA_FORMAT_ALPHA: - case MESA_FORMAT_LUMINANCE: - case MESA_FORMAT_INTENSITY: - *datatype = CHAN_TYPE; - *comps = 1; - return; - - case MESA_FORMAT_RGBA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 4; - return; - case MESA_FORMAT_RGBA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 4; - return; - case MESA_FORMAT_RGB_FLOAT32: - *datatype = GL_FLOAT; - *comps = 3; - return; - case MESA_FORMAT_RGB_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 2; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 2; - return; - case MESA_FORMAT_ALPHA_FLOAT32: - case MESA_FORMAT_LUMINANCE_FLOAT32: - case MESA_FORMAT_INTENSITY_FLOAT32: - *datatype = GL_FLOAT; - *comps = 1; - return; - case MESA_FORMAT_ALPHA_FLOAT16: - case MESA_FORMAT_LUMINANCE_FLOAT16: - case MESA_FORMAT_INTENSITY_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 1; - return; - - default: - _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); - *datatype = 0; - *comps = 1; - } -} diff --git a/src/libs/mesa/mesa/main/texformat.h b/src/libs/mesa/mesa/main/texformat.h deleted file mode 100644 index b1604d4a49..0000000000 --- a/src/libs/mesa/mesa/main/texformat.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file texformat.h - * Texture formats definitions. - * - * \author Gareth Hughes - */ - - -#ifndef TEXFORMAT_H -#define TEXFORMAT_H - - -#include "mtypes.h" - - -/** - * Mesa internal texture image formats. - * All texture images are stored in one of these formats. - * - * NOTE: when you add a new format, be sure to update the do_row() - * function in texstore.c used for auto mipmap generation. - */ -enum _format { - /** - * \name Hardware-friendly formats. - * - * Drivers can override the default formats and convert texture images to - * one of these as required. The driver's - * dd_function_table::ChooseTextureFormat function will choose one of these - * formats. - * - * \note In the default case, some of these formats will be duplicates of - * the generic formats listed below. However, these formats guarantee their - * internal component sizes, while GLchan may vary between GLubyte, GLushort - * and GLfloat. - */ - /*@{*/ - /* msb <------ TEXEL BITS -----------> lsb */ - /* ---- ---- ---- ---- ---- ---- ---- ---- */ - MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ - MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ - MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ - MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ - MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ - MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ - MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ - MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ - MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ - MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ - MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ - MESA_FORMAT_RGB332, /* RRRG GGBB */ - MESA_FORMAT_A8, /* AAAA AAAA */ - MESA_FORMAT_L8, /* LLLL LLLL */ - MESA_FORMAT_I8, /* IIII IIII */ - MESA_FORMAT_CI8, /* CCCC CCCC */ - MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ - MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ - MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ - MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - /*@}*/ - -#if FEATURE_EXT_texture_sRGB - /** - * \name 8-bit/channel sRGB formats - */ - /*@{*/ - MESA_FORMAT_SRGB8, - MESA_FORMAT_SRGBA8, - MESA_FORMAT_SL8, - MESA_FORMAT_SLA8, - MESA_FORMAT_SRGB_DXT1, - /*@}*/ -#endif - - /** - * \name Compressed texture formats. - */ - /*@{*/ - MESA_FORMAT_RGB_FXT1, - MESA_FORMAT_RGBA_FXT1, - MESA_FORMAT_RGB_DXT1, - MESA_FORMAT_RGBA_DXT1, - MESA_FORMAT_RGBA_DXT3, - MESA_FORMAT_RGBA_DXT5, - /*@}*/ - - /** - * \name Generic GLchan-based formats. - * - * Software-oriented texture formats. Texels are arrays of GLchan - * values so there are no byte order issues. - * - * \note Because these are based on the GLchan data type, one cannot assume - * 8 bits per channel with these formats. If you require GLubyte channels, - * use one of the hardware formats above. - */ - /*@{*/ - MESA_FORMAT_RGBA, - MESA_FORMAT_RGB, - MESA_FORMAT_ALPHA, - MESA_FORMAT_LUMINANCE, - MESA_FORMAT_LUMINANCE_ALPHA, - MESA_FORMAT_INTENSITY, - /*@}*/ - - /** - * \name Floating point texture formats. - */ - /*@{*/ - MESA_FORMAT_RGBA_FLOAT32, - MESA_FORMAT_RGBA_FLOAT16, - MESA_FORMAT_RGB_FLOAT32, - MESA_FORMAT_RGB_FLOAT16, - MESA_FORMAT_ALPHA_FLOAT32, - MESA_FORMAT_ALPHA_FLOAT16, - MESA_FORMAT_LUMINANCE_FLOAT32, - MESA_FORMAT_LUMINANCE_FLOAT16, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - MESA_FORMAT_INTENSITY_FLOAT32, - MESA_FORMAT_INTENSITY_FLOAT16 - /*@}*/ -}; - - -/** GLchan-valued formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba; -extern const struct gl_texture_format _mesa_texformat_rgb; -extern const struct gl_texture_format _mesa_texformat_alpha; -extern const struct gl_texture_format _mesa_texformat_luminance; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha; -extern const struct gl_texture_format _mesa_texformat_intensity; -/*@}*/ - -#if FEATURE_EXT_texture_sRGB -/** sRGB (nonlinear) formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_srgb8; -extern const struct gl_texture_format _mesa_texformat_srgba8; -extern const struct gl_texture_format _mesa_texformat_sl8; -extern const struct gl_texture_format _mesa_texformat_sla8; -extern const struct gl_texture_format _mesa_texformat_srgb_dxt1; -/*@}*/ -#endif - -/** Floating point texture formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba_float32; -extern const struct gl_texture_format _mesa_texformat_rgba_float16; -extern const struct gl_texture_format _mesa_texformat_rgb_float32; -extern const struct gl_texture_format _mesa_texformat_rgb_float16; -extern const struct gl_texture_format _mesa_texformat_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_intensity_float32; -extern const struct gl_texture_format _mesa_texformat_intensity_float16; -/*@}*/ - -/** \name Assorted hardware-friendly formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba8888; -extern const struct gl_texture_format _mesa_texformat_rgba8888_rev; -extern const struct gl_texture_format _mesa_texformat_argb8888; -extern const struct gl_texture_format _mesa_texformat_argb8888_rev; -extern const struct gl_texture_format _mesa_texformat_rgb888; -extern const struct gl_texture_format _mesa_texformat_bgr888; -extern const struct gl_texture_format _mesa_texformat_rgb565; -extern const struct gl_texture_format _mesa_texformat_rgb565_rev; -extern const struct gl_texture_format _mesa_texformat_rgba4444; -extern const struct gl_texture_format _mesa_texformat_argb4444; -extern const struct gl_texture_format _mesa_texformat_argb4444_rev; -extern const struct gl_texture_format _mesa_texformat_argb1555; -extern const struct gl_texture_format _mesa_texformat_argb1555_rev; -extern const struct gl_texture_format _mesa_texformat_rgba5551; -extern const struct gl_texture_format _mesa_texformat_al88; -extern const struct gl_texture_format _mesa_texformat_al88_rev; -extern const struct gl_texture_format _mesa_texformat_rgb332; -extern const struct gl_texture_format _mesa_texformat_a8; -extern const struct gl_texture_format _mesa_texformat_l8; -extern const struct gl_texture_format _mesa_texformat_i8; -extern const struct gl_texture_format _mesa_texformat_ci8; -extern const struct gl_texture_format _mesa_texformat_z24_s8; -extern const struct gl_texture_format _mesa_texformat_s8_z24; -extern const struct gl_texture_format _mesa_texformat_z16; -extern const struct gl_texture_format _mesa_texformat_z32; -/*@}*/ - -/** \name YCbCr formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_ycbcr; -extern const struct gl_texture_format _mesa_texformat_ycbcr_rev; -/*@}*/ - -/** \name Compressed formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgb_fxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_fxt1; -extern const struct gl_texture_format _mesa_texformat_rgb_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt3; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt5; -/*@}*/ - -/** \name The null format */ -/*@{*/ -extern const struct gl_texture_format _mesa_null_texformat; -/*@}*/ - - -extern const struct gl_texture_format * -_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, - GLenum format, GLenum type ); - - -extern void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, - GLenum *datatype, GLuint *comps); - - -#endif diff --git a/src/libs/mesa/mesa/main/texformat_tmp.h b/src/libs/mesa/mesa/main/texformat_tmp.h deleted file mode 100644 index ae144a0b51..0000000000 --- a/src/libs/mesa/mesa/main/texformat_tmp.h +++ /dev/null @@ -1,1443 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file texformat_tmp.h - * Texel fetch functions template. - * - * This template file is used by texformat.c to generate texel fetch functions - * for 1-D, 2-D and 3-D texture images. - * - * It should be expanded by defining \p DIM as the number texture dimensions - * (1, 2 or 3). According to the value of \p DIM a series of macros is defined - * for the texel lookup in the gl_texture_image::Data. - * - * \sa texformat.c and FetchTexel. - * - * \author Gareth Hughes - * \author Brian Paul - */ - - -#if DIM == 1 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size))) - -#define FETCH(x) fetch_texel_1d_##x - -#elif DIM == 2 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (k), \ - ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size))) - -#define FETCH(x) fetch_texel_2d_##x - -#elif DIM == 3 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((type *)(image)->Data + ((image)->ImageOffsets[k] \ - + (image)->RowStride * (j) + (i)) * (size)) - -#define FETCH(x) fetch_texel_3d_##x - -#else -#error illegal number of texture dimensions -#endif - - -/* MESA_FORMAT_RGBA **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLchans */ -static void FETCH(rgba)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - COPY_CHAN4( texel, src ); -} - -/* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLfloats */ -static void FETCH(f_rgba)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = CHAN_TO_FLOAT(src[3]); -} - -#if DIM == 3 -/* Store a GLchan RGBA texel */ -static void store_texel_rgba(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; - dst[3] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_RGB ***********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLchans */ -static void FETCH(rgb)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = CHAN_MAX; -} - -/* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLfloats */ -static void FETCH(f_rgb)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - -/* MESA_FORMAT_ALPHA *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA texture, returning 4 GLchans */ -static void FETCH(alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMIN texture, returning 4 GLchans */ -static void FETCH(luminance)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_luminance(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE_ALPHA ***********************************************/ - -/* Fetch texel from 1D, 2D or 3D L_A texture, returning 4 GLchans */ -static void FETCH(luminance_alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[0]; - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; -} - -#if DIM == 3 -static void store_texel_luminance_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_INTENSITY *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D INT. texture, returning 4 GLchans */ -static void FETCH(intensity)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[0]; - texel[BCOMP] = src[0]; - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_intensity(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_Z32 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 0xffffffff); -} - -#if DIM == 3 -static void store_texel_z32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLuint *depth = (const GLuint *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_Z16 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z16)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 65535.0F); -} - -#if DIM == 3 -static void store_texel_z16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLushort *depth = (const GLushort *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGBA_F32 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. - */ -static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = src[3]; -} - -#if DIM == 3 -static void store_texel_rgba_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = depth[RCOMP]; - dst[1] = depth[GCOMP]; - dst[2] = depth[BCOMP]; - dst[3] = depth[ACOMP]; -} -#endif - - -/* MESA_FORMAT_RGBA_F16 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = _mesa_half_to_float(src[3]); -} - -#if DIM == 3 -static void store_texel_rgba_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - -/* MESA_FORMAT_RGB_F32 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGB_F16 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = _mesa_half_to_float(src[1]); -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); - dst[1] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_INTENSITY_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_intensity_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_INTENSITY_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_intensity_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - - - -/* - * Begin Hardware formats - */ - -/* MESA_FORMAT_RGBA8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLchans */ -static void FETCH(rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 24) ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_rgba8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGBA888_REV ***************************************************/ - -/* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ -static void FETCH(rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ -static void FETCH(argb8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_argb8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLchans */ -static void FETCH(argb8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 24) ); - texel[ACOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_argb8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ -static void FETCH(rgb888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_CHAN( src[2] ); - texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); - texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_rgb888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[BCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_BGR888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ -static void FETCH(bgr888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); - texel[BCOMP] = UBYTE_TO_CHAN( src[2] ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_bgr888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - - -/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) - instead of slow (g << 2) * 255 / 252 (always rounds down) */ - -/* MESA_FORMAT_RGB565 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ -static void FETCH(rgb565)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_rgb565(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_RGB565_REV ****************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ -static void FETCH(rgb565_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_rgb565_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - -/* MESA_FORMAT_RGBA4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(rgba4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); -} - -#if DIM == 3 -static void store_texel_rgba4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(argb4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); -} - -#if DIM == 3 -static void store_texel_argb4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ -static void FETCH(argb4444_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); -} - -#if DIM == 3 -static void store_texel_argb4444_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - -/* MESA_FORMAT_RGBA5551 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(rgba5551)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xf8) | ((s >> 8) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 2) & 0xf8) | ((s >> 3) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s) & 0x01) ? 255 : 0); -} - -#if DIM == 3 -static void store_texel_rgba5551(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -/* MESA_FORMAT_ARGB1555 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(argb1555)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 ); -} - -#if DIM == 3 -static void store_texel_argb1555(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB1555_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ -static void FETCH(argb1555_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 ); -} - -#if DIM == 3 -static void store_texel_argb1555_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88 **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ -static void FETCH(al88)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( s & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( s >> 8 ); -} - -#if DIM == 3 -static void store_texel_al88(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88_REV ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ -static void FETCH(al88_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( s >> 8 ); - texel[ACOMP] = UBYTE_TO_CHAN( s & 0xff ); -} - -#if DIM == 3 -static void store_texel_al88_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB332 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ -static void FETCH(rgb332)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - static const GLubyte lut2to8[4] = {0, 85, 170, 255}; - static const GLubyte lut3to8[8] = {0, 36, 73, 109, 146, 182, 219, 255}; - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const GLubyte s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( lut3to8[(s >> 5) & 0x7] ); - texel[GCOMP] = UBYTE_TO_CHAN( lut3to8[(s >> 2) & 0x7] ); - texel[BCOMP] = UBYTE_TO_CHAN( lut2to8[(s ) & 0x3] ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_rgb332(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_A8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ -static void FETCH(a8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = UBYTE_TO_CHAN( src[0] ); -} - -#if DIM == 3 -static void store_texel_a8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_L8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ -static void FETCH(l8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_l8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_I8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ -static void FETCH(i8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = UBYTE_TO_CHAN( src[0] ); -} - -#if DIM == 3 -static void store_texel_i8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_CI8 ***********************************************************/ - -/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a - * color table, and return 4 GLchans. - */ -static void FETCH(ci8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const struct gl_color_table *palette; - GLubyte texelUB[4]; - GLuint index; - GET_CURRENT_CONTEXT(ctx); - - if (ctx->Texture.SharedPalette) { - palette = &ctx->Texture.Palette; - } - else { - palette = &texImage->TexObject->Palette; - } - if (palette->Size == 0) - return; /* undefined results */ - - /* Mask the index against size of palette to avoid going out of bounds */ - index = (*src) & (palette->Size - 1); - - { - const GLubyte *table = palette->TableUB; - switch (palette->_BaseFormat) { - case GL_ALPHA: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = 0; - texelUB[ACOMP] = table[index]; - break;; - case GL_LUMINANCE: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = table[index]; - texelUB[ACOMP] = 255; - break; - case GL_INTENSITY: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = - texelUB[ACOMP] = table[index]; - break;; - case GL_LUMINANCE_ALPHA: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = table[index * 2 + 0]; - texelUB[ACOMP] = table[index * 2 + 1]; - break;; - case GL_RGB: - texelUB[RCOMP] = table[index * 3 + 0]; - texelUB[GCOMP] = table[index * 3 + 1]; - texelUB[BCOMP] = table[index * 3 + 2]; - texelUB[ACOMP] = 255; - break;; - case GL_RGBA: - texelUB[RCOMP] = table[index * 4 + 0]; - texelUB[GCOMP] = table[index * 4 + 1]; - texelUB[BCOMP] = table[index * 4 + 2]; - texelUB[ACOMP] = table[index * 4 + 3]; - break;; - default: - _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); - return; - } -#if CHAN_TYPE == GL_UNSIGNED_BYTE - COPY_4UBV(texel, texelUB); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - texel[0] = UBYTE_TO_USHORT(texelUB[0]); - texel[1] = UBYTE_TO_USHORT(texelUB[1]); - texel[2] = UBYTE_TO_USHORT(texelUB[2]); - texel[3] = UBYTE_TO_USHORT(texelUB[3]); -#else - texel[0] = UBYTE_TO_FLOAT(texelUB[0]); - texel[1] = UBYTE_TO_FLOAT(texelUB[1]); - texel[2] = UBYTE_TO_FLOAT(texelUB[2]); - texel[3] = UBYTE_TO_FLOAT(texelUB[3]); -#endif - } -} - -#if DIM == 3 -static void store_texel_ci8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *index = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = *index; -} -#endif - - -#if FEATURE_EXT_texture_sRGB - -/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ -static void FETCH(srgb8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = nonlinear_to_linear(src[0]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[2]); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_srgb8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; /* no conversion */ - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */ -static void FETCH(srgba8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - texel[RCOMP] = nonlinear_to_linear(src[0]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[2]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[3]); /* linear! */ -} - -#if DIM == 3 -static void store_texel_srgba8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ -static void FETCH(sl8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_sl8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */ -static void FETCH(sla8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ -} - -#if DIM == 3 -static void store_texel_sla8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - - - -#endif /* FEATURE_EXT_texture_sRGB */ - - - -/* MESA_FORMAT_YCBCR *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLchans */ -/* We convert YCbCr to RGB here */ -/* XXX this may break if GLchan != GLubyte */ -static void FETCH(ycbcr)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ - const GLubyte cb = *src0 & 0xff; /* chroma U */ - const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ - const GLubyte cr = *src1 & 0xff; /* chroma V */ - GLint r, g, b; - if (i & 1) { - /* odd pixel: use y1,cr,cb */ - r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128)); - } - else { - /* even pixel: use y0,cr,cb */ - r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128)); - } - texel[RCOMP] = CLAMP(r, 0, CHAN_MAX); - texel[GCOMP] = CLAMP(g, 0, CHAN_MAX); - texel[BCOMP] = CLAMP(b, 0, CHAN_MAX); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_ycbcr(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_FORMAT_YCBCR_REV *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLchans */ -/* We convert YCbCr to RGB here */ -/* XXX this may break if GLchan != GLubyte */ -static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = *src0 & 0xff; /* luminance */ - const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ - const GLubyte y1 = *src1 & 0xff; /* luminance */ - const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - GLint r, g, b; - if (i & 1) { - /* odd pixel: use y1,cr,cb */ - r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128)); - } - else { - /* even pixel: use y0,cr,cb */ - r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128)); - } - texel[RCOMP] = CLAMP(r, 0, CHAN_MAX); - texel[GCOMP] = CLAMP(g, 0, CHAN_MAX); - texel[BCOMP] = CLAMP(b, 0, CHAN_MAX); - texel[ACOMP] = CHAN_MAX; -} - -#if DIM == 3 -static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ - -static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) >> 8) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_z24_s8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; - *dst = zi | (*dst & 0xff); -} -#endif - - -/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ - -static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) & 0x00ffffff) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_S8_Z24); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_s8_z24(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = (GLuint) (depth * 0xffffff); - *dst = zi | (*dst & 0xff000000); -} -#endif - - -#undef TEXEL_ADDR -#undef DIM -#undef FETCH diff --git a/src/libs/mesa/mesa/main/texgen.c b/src/libs/mesa/mesa/main/texgen.c deleted file mode 100644 index 244c7aaafc..0000000000 --- a/src/libs/mesa/mesa/main/texgen.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file texgen.c - * - * glTexGen-related functions - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/macros.h" -#include "main/texgen.h" -#include "math/m_xform.h" - - - -void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n", - _mesa_lookup_enum_by_nr(coord), - _mesa_lookup_enum_by_nr(pname), - *params, - _mesa_lookup_enum_by_nr((GLenum) (GLint) *params)); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bits; - switch (mode) { - case GL_OBJECT_LINEAR: - bits = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bits = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bits = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bits = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bits = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeS == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeS = mode; - texUnit->_GenBitS = bits; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneS, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneS, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneS, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneS, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitt; - switch (mode) { - case GL_OBJECT_LINEAR: - bitt = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitt = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitt = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitt = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bitt = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeT == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeT = mode; - texUnit->_GenBitT = bitt; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneT, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneT, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneT, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneT, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitr; - switch (mode) { - case GL_OBJECT_LINEAR: - bitr = TEXGEN_OBJ_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitr = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitr = TEXGEN_NORMAL_MAP_NV; - break; - case GL_EYE_LINEAR: - bitr = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeR == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeR = mode; - texUnit->_GenBitR = bitr; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneR, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneR, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneR, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneR, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitq; - switch (mode) { - case GL_OBJECT_LINEAR: - bitq = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitq = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeQ == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeQ = mode; - texUnit->_GenBitQ = bitq; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneQ, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneQ, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneQ, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneQ, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" ); - return; - } - - if (ctx->Driver.TexGen) - ctx->Driver.TexGen( ctx, coord, pname, params ); -} - - -void GLAPIENTRY -_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - if (pname == GL_TEXTURE_GEN_MODE) { - p[1] = p[2] = p[3] = 0.0F; - } - else { - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - } - _mesa_TexGenfv(coord, pname, p); -} - - -void GLAPIENTRY -_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) -{ - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); -} - - -void GLAPIENTRY -_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - if (pname == GL_TEXTURE_GEN_MODE) { - p[1] = p[2] = p[3] = 0.0F; - } - else { - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - } - _mesa_TexGenfv( coord, pname, p ); -} - - -void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) -{ - _mesa_TexGenfv(coord, pname, ¶m); -} - - -void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -{ - _mesa_TexGeniv( coord, pname, ¶m ); -} - - - -void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGendv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(coord)" ); - return; - } -} - - - -void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGenfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(coord)" ); - return; - } -} - - - -void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGeniv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeS; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneS[0]; - params[1] = (GLint) texUnit->ObjectPlaneS[1]; - params[2] = (GLint) texUnit->ObjectPlaneS[2]; - params[3] = (GLint) texUnit->ObjectPlaneS[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneS[0]; - params[1] = (GLint) texUnit->EyePlaneS[1]; - params[2] = (GLint) texUnit->EyePlaneS[2]; - params[3] = (GLint) texUnit->EyePlaneS[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeT; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneT[0]; - params[1] = (GLint) texUnit->ObjectPlaneT[1]; - params[2] = (GLint) texUnit->ObjectPlaneT[2]; - params[3] = (GLint) texUnit->ObjectPlaneT[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneT[0]; - params[1] = (GLint) texUnit->EyePlaneT[1]; - params[2] = (GLint) texUnit->EyePlaneT[2]; - params[3] = (GLint) texUnit->EyePlaneT[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeR; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneR[0]; - params[1] = (GLint) texUnit->ObjectPlaneR[1]; - params[2] = (GLint) texUnit->ObjectPlaneR[2]; - params[3] = (GLint) texUnit->ObjectPlaneR[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneR[0]; - params[1] = (GLint) texUnit->EyePlaneR[1]; - params[2] = (GLint) texUnit->EyePlaneR[2]; - params[3] = (GLint) texUnit->EyePlaneR[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeQ; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneQ[0]; - params[1] = (GLint) texUnit->ObjectPlaneQ[1]; - params[2] = (GLint) texUnit->ObjectPlaneQ[2]; - params[3] = (GLint) texUnit->ObjectPlaneQ[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneQ[0]; - params[1] = (GLint) texUnit->EyePlaneQ[1]; - params[2] = (GLint) texUnit->EyePlaneQ[2]; - params[3] = (GLint) texUnit->EyePlaneQ[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(coord)" ); - return; - } -} - - diff --git a/src/libs/mesa/mesa/main/texgen.h b/src/libs/mesa/mesa/main/texgen.h deleted file mode 100644 index 073588efcd..0000000000 --- a/src/libs/mesa/mesa/main/texgen.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 TEXGEN_H -#define TEXGEN_H - - -#include "main/glheader.h" - - -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); - -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); - -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); - -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); - - - -#endif /* TEXGEN_H */ diff --git a/src/libs/mesa/mesa/main/teximage.c b/src/libs/mesa/mesa/main/teximage.c deleted file mode 100644 index cd3edb2e07..0000000000 --- a/src/libs/mesa/mesa/main/teximage.c +++ /dev/null @@ -1,3923 +0,0 @@ -/* - * mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file teximage.c - * Texture image-related functions. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "context.h" -#if FEATURE_convolve -#include "convolve.h" -#endif -#include "fbobject.h" -#include "framebuffer.h" -#include "image.h" -#include "imports.h" -#include "macros.h" -#include "state.h" -#include "texcompress.h" -#include "texformat.h" -#include "teximage.h" -#include "texstate.h" -#include "texstore.h" -#include "mtypes.h" - - -/** - * State changes which we care about for glCopyTex[Sub]Image() calls. - * In particular, we care about pixel transfer state and buffer state - * (such as glReadBuffer to make sure we read from the right renderbuffer). - */ -#define NEW_COPY_TEX_STATE (_IMAGE_NEW_TRANSFER_STATE | \ - _NEW_BUFFERS | \ - _NEW_PIXEL) - - - -/** - * We allocate texture memory on 512-byte boundaries so we can use MMX/SSE - * elsewhere. - */ -void * -_mesa_alloc_texmemory(GLsizei bytes) -{ - return _mesa_align_malloc(bytes, 512); -} - - -/** - * Free texture memory allocated with _mesa_alloc_texmemory() - */ -void -_mesa_free_texmemory(void *m) -{ - _mesa_align_free(m); -} - - - - -#if 0 -static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) -{ -#if CHAN_TYPE != GL_UNSIGNED_BYTE - _mesa_problem(NULL, "PrintTexture not supported"); -#else - GLuint i, j, c; - const GLubyte *data = (const GLubyte *) img->Data; - - if (!data) { - _mesa_printf("No texture data\n"); - return; - } - - switch (img->Format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - case GL_COLOR_INDEX: - c = 1; - break; - case GL_LUMINANCE_ALPHA: - c = 2; - break; - case GL_RGB: - c = 3; - break; - case GL_RGBA: - c = 4; - break; - default: - _mesa_problem(NULL, "error in PrintTexture\n"); - return; - } - - for (i = 0; i < img->Height; i++) { - for (j = 0; j < img->Width; j++) { - if (c==1) - _mesa_printf("%02x ", data[0]); - else if (c==2) - _mesa_printf("%02x%02x ", data[0], data[1]); - else if (c==3) - _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); - else if (c==4) - _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); - data += (img->RowStride - img->Width) * c; - } - /* XXX use img->ImageStride here */ - _mesa_printf("\n"); - } -#endif -} -#endif - - -/* - * Compute floor(log_base_2(n)). - * If n < 0 return -1. - */ -static int -logbase2( int n ) -{ - GLint i = 1; - GLint log2 = 0; - - if (n < 0) - return -1; - - if (n == 0) - return 0; - - while ( n > i ) { - i *= 2; - log2++; - } - if (i != n) { - return log2 - 1; - } - else { - return log2; - } -} - - - -/** - * Return the simple base format for a given internal texture format. - * For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA. - * - * \param ctx GL context. - * \param internalFormat the internal texture format token or 1, 2, 3, or 4. - * - * \return the corresponding \u base internal format (GL_ALPHA, GL_LUMINANCE, - * GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA), or -1 if invalid enum. - * - * This is the format which is used during texture application (i.e. the - * texture format and env mode determine the arithmetic used. - */ -GLint -_mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) -{ - switch (internalFormat) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return GL_ALPHA; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return GL_LUMINANCE; - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return GL_LUMINANCE_ALPHA; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return GL_INTENSITY; - case 3: - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return GL_RGB; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return GL_RGBA; - default: - ; /* fallthrough */ - } - - if (ctx->Extensions.EXT_paletted_texture) { - switch (internalFormat) { - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX8_EXT: - case GL_COLOR_INDEX12_EXT: - case GL_COLOR_INDEX16_EXT: - return GL_COLOR_INDEX; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.ARB_depth_texture) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_DEPTH_COMPONENT; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA: - return GL_ALPHA; - case GL_COMPRESSED_LUMINANCE: - return GL_LUMINANCE; - case GL_COMPRESSED_LUMINANCE_ALPHA: - return GL_LUMINANCE_ALPHA; - case GL_COMPRESSED_INTENSITY: - return GL_INTENSITY; - case GL_COMPRESSED_RGB: - return GL_RGB; - case GL_COMPRESSED_RGBA: - return GL_RGBA; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.TDFX_texture_compression_FXT1) { - switch (internalFormat) { - case GL_COMPRESSED_RGB_FXT1_3DFX: - return GL_RGB; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - return GL_RGBA; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_texture_compression_s3tc) { - switch (internalFormat) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return GL_RGB; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return GL_RGBA; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.S3_s3tc) { - switch (internalFormat) { - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - return GL_RGB; - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - return GL_RGBA; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.MESA_ycbcr_texture) { - if (internalFormat == GL_YCBCR_MESA) - return GL_YCBCR_MESA; - } - - if (ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_ALPHA16F_ARB: - case GL_ALPHA32F_ARB: - return GL_ALPHA; - case GL_RGBA16F_ARB: - case GL_RGBA32F_ARB: - return GL_RGBA; - case GL_RGB16F_ARB: - case GL_RGB32F_ARB: - return GL_RGB; - case GL_INTENSITY16F_ARB: - case GL_INTENSITY32F_ARB: - return GL_INTENSITY; - case GL_LUMINANCE16F_ARB: - case GL_LUMINANCE32F_ARB: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA16F_ARB: - case GL_LUMINANCE_ALPHA32F_ARB: - return GL_LUMINANCE_ALPHA; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_depth_stencil) { - switch (internalFormat) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_DEPTH_STENCIL_EXT; - default: - ; /* fallthrough */ - } - } - -#if FEATURE_EXT_texture_sRGB - if (ctx->Extensions.EXT_texture_sRGB) { - switch (internalFormat) { - case GL_SRGB_EXT: - case GL_SRGB8_EXT: - case GL_COMPRESSED_SRGB_EXT: - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - return GL_RGB; - case GL_SRGB_ALPHA_EXT: - case GL_SRGB8_ALPHA8_EXT: - case GL_COMPRESSED_SRGB_ALPHA_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return GL_RGBA; - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: - case GL_COMPRESSED_SLUMINANCE_EXT: - case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return GL_LUMINANCE_ALPHA; - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - return GL_LUMINANCE; - default: - ; /* fallthrough */ - } - } - -#endif /* FEATURE_EXT_texture_sRGB */ - - return -1; /* error */ -} - - -/** - * Test if the given image format is a color/RGBA format (i.e., not color - * index, depth, stencil, etc). - * \param format the image format value (may by an internal texture format) - * \return GL_TRUE if its a color/RGBA format, GL_FALSE otherwise. - * XXX maybe move this func to image.c - */ -GLboolean -_mesa_is_color_format(GLenum format) -{ - switch (format) { - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - case 3: - case GL_RGB: - case GL_BGR: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - case 4: - case GL_ABGR_EXT: - case GL_RGBA: - case GL_BGRA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - /* float texture formats */ - case GL_ALPHA16F_ARB: - case GL_ALPHA32F_ARB: - case GL_LUMINANCE16F_ARB: - case GL_LUMINANCE32F_ARB: - case GL_LUMINANCE_ALPHA16F_ARB: - case GL_LUMINANCE_ALPHA32F_ARB: - case GL_INTENSITY16F_ARB: - case GL_INTENSITY32F_ARB: - case GL_RGB16F_ARB: - case GL_RGB32F_ARB: - case GL_RGBA16F_ARB: - case GL_RGBA32F_ARB: - /* compressed formats */ - case GL_COMPRESSED_ALPHA: - case GL_COMPRESSED_LUMINANCE: - case GL_COMPRESSED_LUMINANCE_ALPHA: - case GL_COMPRESSED_INTENSITY: - case GL_COMPRESSED_RGB: - case GL_COMPRESSED_RGBA: - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case GL_COMPRESSED_RGB_FXT1_3DFX: - case GL_COMPRESSED_RGBA_FXT1_3DFX: -#if FEATURE_EXT_texture_sRGB - case GL_SRGB_EXT: - case GL_SRGB8_EXT: - case GL_SRGB_ALPHA_EXT: - case GL_SRGB8_ALPHA8_EXT: - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - case GL_COMPRESSED_SRGB_EXT: - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - case GL_COMPRESSED_SLUMINANCE_EXT: - case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: -#endif /* FEATURE_EXT_texture_sRGB */ - return GL_TRUE; - case GL_YCBCR_MESA: /* not considered to be RGB */ - /* fall-through */ - default: - return GL_FALSE; - } -} - - -/** - * Test if the given image format is a color index format. - */ -static GLboolean -is_index_format(GLenum format) -{ - switch (format) { - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX8_EXT: - case GL_COLOR_INDEX12_EXT: - case GL_COLOR_INDEX16_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Test if the given image format is a depth component format. - */ -static GLboolean -is_depth_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - case GL_DEPTH_COMPONENT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Test if the given image format is a YCbCr format. - */ -static GLboolean -is_ycbcr_format(GLenum format) -{ - switch (format) { - case GL_YCBCR_MESA: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Test if the given image format is a Depth/Stencil format. - */ -static GLboolean -is_depthstencil_format(GLenum format) -{ - switch (format) { - case GL_DEPTH24_STENCIL8_EXT: - case GL_DEPTH_STENCIL_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - - -/** - * Test if it is a supported compressed format. - * - * \param internalFormat the internal format token provided by the user. - * - * \ret GL_TRUE if \p internalFormat is a supported compressed format, or - * GL_FALSE otherwise. - * - * Currently only GL_COMPRESSED_RGB_FXT1_3DFX and GL_COMPRESSED_RGBA_FXT1_3DFX - * are supported. - */ -static GLboolean -is_compressed_format(GLcontext *ctx, GLenum internalFormat) -{ - GLint supported[100]; /* 100 should be plenty */ - GLuint i, n; - - n = _mesa_get_compressed_formats(ctx, supported, GL_TRUE); - ASSERT(n < 100); - for (i = 0; i < n; i++) { - if ((GLint) internalFormat == supported[i]) { - return GL_TRUE; - } - } - return GL_FALSE; -} - - -/** - * For cube map faces, return a face index in [0,5]. - * For other targets return 0; - */ -GLuint -_mesa_tex_target_to_face(GLenum target) -{ - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) - return (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; - else - return 0; -} - - - -/** - * Store a gl_texture_image pointer in a gl_texture_object structure - * according to the target and level parameters. - * - * \param tObj texture object. - * \param target texture target. - * \param level image level. - * \param texImage texture image. - * - * This was basically prompted by the introduction of cube maps. - */ -void -_mesa_set_tex_image(struct gl_texture_object *tObj, - GLenum target, GLint level, - struct gl_texture_image *texImage) -{ - ASSERT(tObj); - ASSERT(texImage); - /* XXX simplify this with _mesa_tex_target_to_face() */ - switch (target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: - tObj->Image[0][level] = texImage; - break; - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - { - GLuint face = ((GLuint) target - - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); - tObj->Image[face][level] = texImage; - } - break; - case GL_TEXTURE_RECTANGLE_NV: - ASSERT(level == 0); - tObj->Image[0][level] = texImage; - break; - default: - _mesa_problem(NULL, "bad target in _mesa_set_tex_image()"); - return; - } - /* Set the 'back' pointer */ - texImage->TexObject = tObj; -} - - -/** - * Allocate a texture image structure. - * - * Called via ctx->Driver.NewTextureImage() unless overriden by a device - * driver. - * - * \return a pointer to gl_texture_image struct with all fields initialized to - * zero. - */ -struct gl_texture_image * -_mesa_new_texture_image( GLcontext *ctx ) -{ - (void) ctx; - return CALLOC_STRUCT(gl_texture_image); -} - - -/** - * Free texture image data. - * This function is a fallback called via ctx->Driver.FreeTexImageData(). - * - * \param teximage texture image. - * - * Free the texture image data if it's not marked as client data. - */ -void -_mesa_free_texture_image_data(GLcontext *ctx, - struct gl_texture_image *texImage) -{ - (void) ctx; - - if (texImage->Data && !texImage->IsClientData) { - /* free the old texture data */ - _mesa_free_texmemory(texImage->Data); - } - - texImage->Data = NULL; -} - - -/** - * Free texture image. - * - * \param teximage texture image. - * - * Free the texture image structure and the associated image data. - */ -void -_mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage ) -{ - /* Free texImage->Data and/or any other driver-specific texture - * image storage. - */ - ASSERT(ctx->Driver.FreeTexImageData); - ctx->Driver.FreeTexImageData( ctx, texImage ); - - ASSERT(texImage->Data == NULL); - if (texImage->ImageOffsets) - _mesa_free(texImage->ImageOffsets); - _mesa_free(texImage); -} - - -/** - * Test if a target is a proxy target. - * - * \param target texture target. - * - * \return GL_TRUE if the target is a proxy target, GL_FALSE otherwise. - */ -GLboolean -_mesa_is_proxy_texture(GLenum target) -{ - return (target == GL_PROXY_TEXTURE_1D || - target == GL_PROXY_TEXTURE_2D || - target == GL_PROXY_TEXTURE_3D || - target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || - target == GL_PROXY_TEXTURE_RECTANGLE_NV || - target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || - target == GL_PROXY_TEXTURE_2D_ARRAY_EXT); -} - - -/** - * Get the texture object that corresponds to the target of the given texture unit. - * - * \param ctx GL context. - * \param texUnit texture unit. - * \param target texture target. - * - * \return pointer to the texture object on success, or NULL on failure. - * - * \sa gl_texture_unit. - */ -struct gl_texture_object * -_mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, - GLenum target) -{ - switch (target) { - case GL_TEXTURE_1D: - return texUnit->CurrentTex[TEXTURE_1D_INDEX]; - case GL_PROXY_TEXTURE_1D: - return ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]; - case GL_TEXTURE_2D: - return texUnit->CurrentTex[TEXTURE_2D_INDEX]; - case GL_PROXY_TEXTURE_2D: - return ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; - case GL_TEXTURE_3D: - return texUnit->CurrentTex[TEXTURE_3D_INDEX]; - case GL_PROXY_TEXTURE_3D: - return ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_ARB: - return ctx->Extensions.ARB_texture_cube_map - ? texUnit->CurrentTex[TEXTURE_CUBE_INDEX] : NULL; - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - return ctx->Extensions.ARB_texture_cube_map - ? ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX] : NULL; - case GL_TEXTURE_RECTANGLE_NV: - return ctx->Extensions.NV_texture_rectangle - ? texUnit->CurrentTex[TEXTURE_RECT_INDEX] : NULL; - case GL_PROXY_TEXTURE_RECTANGLE_NV: - return ctx->Extensions.NV_texture_rectangle - ? ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX] : NULL; - case GL_TEXTURE_1D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array - ? texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX] : NULL; - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array - ? ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX] : NULL; - case GL_TEXTURE_2D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array - ? texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX] : NULL; - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array - ? ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX] : NULL; - default: - _mesa_problem(NULL, "bad target in _mesa_select_tex_object()"); - return NULL; - } -} - - -/** - * Get the texture image struct which corresponds to target and level - * of the given texture unit. - * - * \param ctx GL context. - * \param texUnit texture unit. - * \param target texture target. - * \param level image level. - * - * \return pointer to the texture image structure on success, or NULL on failure. - * - * \sa gl_texture_unit. - */ -struct gl_texture_image * -_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, - GLenum target, GLint level) -{ - ASSERT(texObj); - - if (level < 0 || level >= MAX_TEXTURE_LEVELS) - return NULL; - - /* XXX simplify this with _mesa_tex_target_to_face() */ - switch (target) { - case GL_TEXTURE_1D: - case GL_PROXY_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_PROXY_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return texObj->Image[0][level]; - - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - if (ctx->Extensions.ARB_texture_cube_map) { - GLuint face = ((GLuint) target - - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); - return texObj->Image[face][level]; - } - else - return NULL; - - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - if (ctx->Extensions.ARB_texture_cube_map) - return texObj->Image[0][level]; - else - return NULL; - - case GL_TEXTURE_RECTANGLE_NV: - case GL_PROXY_TEXTURE_RECTANGLE_NV: - if (ctx->Extensions.NV_texture_rectangle && level == 0) - return texObj->Image[0][level]; - else - return NULL; - - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return (ctx->Extensions.MESA_texture_array) - ? texObj->Image[0][level] : NULL; - - default: - return NULL; - } -} - - -/** - * Like _mesa_select_tex_image() but if the image doesn't exist, allocate - * it and install it. Only return NULL if passed a bad parameter or run - * out of memory. - */ -struct gl_texture_image * -_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj, - GLenum target, GLint level) -{ - struct gl_texture_image *texImage; - - if (!texObj) - return NULL; - - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture image allocation"); - return NULL; - } - - _mesa_set_tex_image(texObj, target, level, texImage); - } - - return texImage; -} - - -/** - * Return pointer to the specified proxy texture image. - * Note that proxy textures are per-context, not per-texture unit. - * \return pointer to texture image or NULL if invalid target, invalid - * level, or out of memory. - */ -struct gl_texture_image * -_mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) -{ - struct gl_texture_image *texImage; - - if (level < 0 ) - return NULL; - - switch (target) { - case GL_PROXY_TEXTURE_1D: - if (level >= ctx->Const.MaxTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_2D: - if (level >= ctx->Const.MaxTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_3D: - if (level >= ctx->Const.Max3DTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_CUBE_MAP: - if (level >= ctx->Const.MaxCubeTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_RECTANGLE_NV: - if (level > 0) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - if (level >= ctx->Const.MaxTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]; - } - return texImage; - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - if (level >= ctx->Const.MaxTextureLevels) - return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]; - } - return texImage; - default: - return NULL; - } -} - - -/** - * Get the maximum number of allowed mipmap levels. - * - * \param ctx GL context. - * \param target texture target. - * - * \return the maximum number of allowed mipmap levels for the given - * texture target, or zero if passed a bad target. - * - * \sa gl_constants. - */ -GLint -_mesa_max_texture_levels(GLcontext *ctx, GLenum target) -{ - switch (target) { - case GL_TEXTURE_1D: - case GL_PROXY_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_PROXY_TEXTURE_2D: - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return ctx->Const.MaxTextureLevels; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return ctx->Const.Max3DTextureLevels; - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - return ctx->Const.MaxCubeTextureLevels; - case GL_TEXTURE_RECTANGLE_NV: - case GL_PROXY_TEXTURE_RECTANGLE_NV: - return 1; - default: - return 0; /* bad target */ - } -} - - - -#if 000 /* not used anymore */ -/* - * glTexImage[123]D can accept a NULL image pointer. In this case we - * create a texture image with unspecified image contents per the OpenGL - * spec. - */ -static GLubyte * -make_null_texture(GLint width, GLint height, GLint depth, GLenum format) -{ - const GLint components = _mesa_components_in_format(format); - const GLint numPixels = width * height * depth; - GLubyte *data = (GLubyte *) MALLOC(numPixels * components * sizeof(GLubyte)); - -#ifdef DEBUG - /* - * Let's see if anyone finds this. If glTexImage2D() is called with - * a NULL image pointer then load the texture image with something - * interesting instead of leaving it indeterminate. - */ - if (data) { - static const char message[8][32] = { - " X X XXXXX XXX X ", - " XX XX X X X X X ", - " X X X X X X X ", - " X X XXXX XXX XXXXX ", - " X X X X X X ", - " X X X X X X X ", - " X X XXXXX XXX X X ", - " " - }; - - GLubyte *imgPtr = data; - GLint h, i, j, k; - for (h = 0; h < depth; h++) { - for (i = 0; i < height; i++) { - GLint srcRow = 7 - (i % 8); - for (j = 0; j < width; j++) { - GLint srcCol = j % 32; - GLubyte texel = (message[srcRow][srcCol]=='X') ? 255 : 70; - for (k = 0; k < components; k++) { - *imgPtr++ = texel; - } - } - } - } - } -#endif - - return data; -} -#endif - - - -/** - * Reset the fields of a gl_texture_image struct to zero. - * - * \param img texture image structure. - * - * This is called when a proxy texture test fails, we set all the - * image members (except DriverData) to zero. - * It's also used in glTexImage[123]D as a safeguard to be sure all - * required fields get initialized properly by the Driver.TexImage[123]D - * functions. - */ -static void -clear_teximage_fields(struct gl_texture_image *img) -{ - ASSERT(img); - img->_BaseFormat = 0; - img->InternalFormat = 0; - img->Border = 0; - img->Width = 0; - img->Height = 0; - img->Depth = 0; - img->RowStride = 0; - if (img->ImageOffsets) { - _mesa_free(img->ImageOffsets); - img->ImageOffsets = NULL; - } - img->Width2 = 0; - img->Height2 = 0; - img->Depth2 = 0; - img->WidthLog2 = 0; - img->HeightLog2 = 0; - img->DepthLog2 = 0; - img->Data = NULL; - img->TexFormat = &_mesa_null_texformat; - img->FetchTexelc = NULL; - img->FetchTexelf = NULL; - img->IsCompressed = 0; - img->CompressedSize = 0; -} - - -/** - * Initialize basic fields of the gl_texture_image struct. - * - * \param ctx GL context. - * \param target texture target (GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, etc). - * \param img texture image structure to be initialized. - * \param width image width. - * \param height image height. - * \param depth image depth. - * \param border image border. - * \param internalFormat internal format. - * - * Fills in the fields of \p img with the given information. - * Note: width, height and depth include the border. - */ -void -_mesa_init_teximage_fields(GLcontext *ctx, GLenum target, - struct gl_texture_image *img, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum internalFormat) -{ - GLint i; - - ASSERT(img); - ASSERT(width >= 0); - ASSERT(height >= 0); - ASSERT(depth >= 0); - - img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat ); - ASSERT(img->_BaseFormat > 0); - img->InternalFormat = internalFormat; - img->Border = border; - img->Width = width; - img->Height = height; - img->Depth = depth; - img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */ - img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */ - img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */ - img->WidthLog2 = logbase2(img->Width2); - if (height == 1) /* 1-D texture */ - img->HeightLog2 = 0; - else - img->HeightLog2 = logbase2(img->Height2); - if (depth == 1) /* 2-D texture */ - img->DepthLog2 = 0; - else - img->DepthLog2 = logbase2(img->Depth2); - img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2); - img->IsCompressed = GL_FALSE; - img->CompressedSize = 0; - - if ((width == 1 || _mesa_is_pow_two(img->Width2)) && - (height == 1 || _mesa_is_pow_two(img->Height2)) && - (depth == 1 || _mesa_is_pow_two(img->Depth2))) - img->_IsPowerOfTwo = GL_TRUE; - else - img->_IsPowerOfTwo = GL_FALSE; - - /* RowStride and ImageOffsets[] describe how to address texels in 'Data' */ - img->RowStride = width; - /* Allocate the ImageOffsets array and initialize to typical values. - * We allocate the array for 1D/2D textures too in order to avoid special- - * case code in the texstore routines. - */ - img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint)); - for (i = 0; i < depth; i++) { - img->ImageOffsets[i] = i * width * height; - } - - /* Compute Width/Height/DepthScale for mipmap lod computation */ - if (target == GL_TEXTURE_RECTANGLE_NV) { - /* scale = 1.0 since texture coords directly map to texels */ - img->WidthScale = 1.0; - img->HeightScale = 1.0; - img->DepthScale = 1.0; - } - else { - img->WidthScale = (GLfloat) img->Width; - img->HeightScale = (GLfloat) img->Height; - img->DepthScale = (GLfloat) img->Depth; - } -} - - -/** - * This is the fallback for Driver.TestProxyTexImage(). Test the texture - * level, width, height and depth against the ctx->Const limits for textures. - * - * A hardware driver might override this function if, for example, the - * max 3D texture size is 512x512x64 (i.e. not a cube). - * - * Note that width, height, depth == 0 is not an error. However, a - * texture with zero width/height/depth will be considered "incomplete" - * and texturing will effectively be disabled. - * - * \param target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D, - * GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV, - * GL_PROXY_TEXTURE_CUBE_MAP_ARB. - * \param level as passed to glTexImage - * \param internalFormat as passed to glTexImage - * \param format as passed to glTexImage - * \param type as passed to glTexImage - * \param width as passed to glTexImage - * \param height as passed to glTexImage - * \param depth as passed to glTexImage - * \param border as passed to glTexImage - * \return GL_TRUE if the image is acceptable, GL_FALSE if not acceptable. - */ -GLboolean -_mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, GLenum format, GLenum type, - GLint width, GLint height, GLint depth, GLint border) -{ - GLint maxSize; - - (void) internalFormat; - (void) format; - (void) type; - - switch (target) { - case GL_PROXY_TEXTURE_1D: - maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width >0 && !_mesa_is_pow_two(width - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or level */ - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_2D: - maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or height or level */ - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_3D: - maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - depth < 2 * border || depth > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - depth > 0 && !_mesa_is_pow_two(depth - 2 * border)) || - level >= ctx->Const.Max3DTextureLevels) { - /* bad width or height or depth or level */ - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_RECTANGLE_NV: - if (width < 0 || width > ctx->Const.MaxTextureRectSize || - height < 0 || height > ctx->Const.MaxTextureRectSize || - level != 0) { - /* bad width or height or level */ - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxCubeTextureLevels) { - /* bad width or height */ - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or level */ - return GL_FALSE; - } - - if (height < 1 || height > ctx->Const.MaxArrayTextureLayers) { - return GL_FALSE; - } - return GL_TRUE; - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - if (width < 2 * border || width > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && !_mesa_is_pow_two(width - 2 * border)) || - height < 2 * border || height > 2 + maxSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && !_mesa_is_pow_two(height - 2 * border)) || - level >= ctx->Const.MaxTextureLevels) { - /* bad width or height or level */ - return GL_FALSE; - } - if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers) { - return GL_FALSE; - } - return GL_TRUE; - default: - _mesa_problem(ctx, "Invalid target in _mesa_test_proxy_teximage"); - return GL_FALSE; - } -} - - -/** - * Helper function to determine whether a target supports compressed textures - */ -static GLboolean -target_can_be_compressed(GLcontext *ctx, GLenum target) -{ - return (((target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D)) - || ((ctx->Extensions.ARB_texture_cube_map && - (target == GL_PROXY_TEXTURE_CUBE_MAP || - (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)))) - || ((ctx->Extensions.MESA_texture_array && - ((target == GL_PROXY_TEXTURE_2D_ARRAY_EXT) || - (target == GL_TEXTURE_2D_ARRAY_EXT))))); -} - - -/** - * Test the glTexImage[123]D() parameters for errors. - * - * \param ctx GL context. - * \param target texture target given by the user. - * \param level image level given by the user. - * \param internalFormat internal format given by the user. - * \param format pixel data format given by the user. - * \param type pixel data type given by the user. - * \param dimensions texture image dimensions (must be 1, 2 or 3). - * \param width image width given by the user. - * \param height image height given by the user. - * \param depth image depth given by the user. - * \param border image border given by the user. - * - * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * - * Verifies each of the parameters against the constants specified in - * __GLcontextRec::Const and the supported extensions, and according to the - * OpenGL specification. - */ -static GLboolean -texture_error_check( GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLenum format, GLenum type, - GLuint dimensions, - GLint width, GLint height, - GLint depth, GLint border ) -{ - const GLboolean isProxy = _mesa_is_proxy_texture(target); - GLboolean sizeOK = GL_TRUE; - GLboolean colorFormat, indexFormat; - GLenum proxy_target; - - /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ - if (level < 0 || level >= MAX_TEXTURE_LEVELS) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(level=%d)", dimensions, level); - } - return GL_TRUE; - } - - /* Check border */ - if (border < 0 || border > 1 || - ((target == GL_TEXTURE_RECTANGLE_NV || - target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(border=%d)", dimensions, border); - } - return GL_TRUE; - } - - if (width < 0 || height < 0 || depth < 0) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(width, height or depth < 0)", dimensions); - } - return GL_TRUE; - } - - /* Check target and call ctx->Driver.TestProxyTexImage() to check the - * level, width, height and depth. - */ - if (dimensions == 1) { - if (target == GL_PROXY_TEXTURE_1D || target == GL_TEXTURE_1D) { - proxy_target = GL_PROXY_TEXTURE_1D; - height = 1; - depth = 1; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - depth = 1; - if (target == GL_PROXY_TEXTURE_2D || target == GL_TEXTURE_2D) { - proxy_target = GL_PROXY_TEXTURE_2D; - } - else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || - (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - proxy_target = GL_PROXY_TEXTURE_CUBE_MAP_ARB; - sizeOK = (width == height); - } - else if (target == GL_PROXY_TEXTURE_RECTANGLE_NV || - target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV; - } - else if (target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || - target == GL_TEXTURE_1D_ARRAY_EXT) { - proxy_target = GL_PROXY_TEXTURE_1D_ARRAY_EXT; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (target == GL_PROXY_TEXTURE_3D || target == GL_TEXTURE_3D) { - proxy_target = GL_PROXY_TEXTURE_3D; - } - else if (target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || - target == GL_TEXTURE_2D_ARRAY_EXT) { - proxy_target = GL_PROXY_TEXTURE_2D_ARRAY_EXT; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem( ctx, "bad dims in texture_error_check" ); - return GL_TRUE; - } - - sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxy_target, level, - internalFormat, format, - type, width, height, - depth, border); - if (!sizeOK) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(level=%d, width=%d, height=%d, depth=%d)", - dimensions, level, width, height, depth); - } - return GL_TRUE; - } - - /* Check internalFormat */ - if (_mesa_base_tex_format(ctx, internalFormat) < 0) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(internalFormat=0x%x)", - dimensions, internalFormat); - } - return GL_TRUE; - } - - /* Check incoming image format and type */ - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - /* Yes, generate GL_INVALID_OPERATION, not GL_INVALID_ENUM, if there - * is a type/format mismatch. See 1.2 spec page 94, sec 3.6.4. - */ - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage%dD(format or type)", dimensions); - } - return GL_TRUE; - } - - /* make sure internal format and format basically agree */ - colorFormat = _mesa_is_color_format(format); - indexFormat = is_index_format(format); - if ((_mesa_is_color_format(internalFormat) && !colorFormat && !indexFormat) || - (is_index_format(internalFormat) && !indexFormat) || - (is_depth_format(internalFormat) != is_depth_format(format)) || - (is_ycbcr_format(internalFormat) != is_ycbcr_format(format)) || - (is_depthstencil_format(internalFormat) != is_depthstencil_format(format))) { - if (!isProxy) - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage(internalFormat/format)"); - return GL_TRUE; - } - - /* additional checks for ycbcr textures */ - if (internalFormat == GL_YCBCR_MESA) { - ASSERT(ctx->Extensions.MESA_ycbcr_texture); - if (type != GL_UNSIGNED_SHORT_8_8_MESA && - type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { - char message[100]; - _mesa_sprintf(message, - "glTexImage%d(format/type YCBCR mismatch", dimensions); - _mesa_error(ctx, GL_INVALID_ENUM, message); - return GL_TRUE; /* error */ - } - if (target != GL_TEXTURE_2D && - target != GL_PROXY_TEXTURE_2D && - target != GL_TEXTURE_RECTANGLE_NV && - target != GL_PROXY_TEXTURE_RECTANGLE_NV) { - if (!isProxy) - _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target)"); - return GL_TRUE; - } - if (border != 0) { - if (!isProxy) { - char message[100]; - _mesa_sprintf(message, - "glTexImage%d(format=GL_YCBCR_MESA and border=%d)", - dimensions, border); - _mesa_error(ctx, GL_INVALID_VALUE, message); - } - return GL_TRUE; - } - } - - /* additional checks for depth textures */ - if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D and rectangular textures supported, not 3D or cubes */ - if (target != GL_TEXTURE_1D && - target != GL_PROXY_TEXTURE_1D && - target != GL_TEXTURE_2D && - target != GL_PROXY_TEXTURE_2D && - target != GL_TEXTURE_RECTANGLE_ARB && - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { - if (!isProxy) - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexImage(target/internalFormat)"); - return GL_TRUE; - } - } - - /* additional checks for compressed textures */ - if (is_compressed_format(ctx, internalFormat)) { - if (!target_can_be_compressed(ctx, target) && !isProxy) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexImage%d(target)", dimensions); - return GL_TRUE; - } - if (border != 0) { - if (!isProxy) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage%D(border!=0)", dimensions); - } - return GL_TRUE; - } - } - - /* if we get here, the parameters are OK */ - return GL_FALSE; -} - - -/** - * Test glTexSubImage[123]D() parameters for errors. - * - * \param ctx GL context. - * \param dimensions texture image dimensions (must be 1, 2 or 3). - * \param target texture target given by the user. - * \param level image level given by the user. - * \param xoffset sub-image x offset given by the user. - * \param yoffset sub-image y offset given by the user. - * \param zoffset sub-image z offset given by the user. - * \param format pixel data format given by the user. - * \param type pixel data type given by the user. - * \param width image width given by the user. - * \param height image height given by the user. - * \param depth image depth given by the user. - * - * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * - * Verifies each of the parameters against the constants specified in - * __GLcontextRec::Const and the supported extensions, and according to the - * OpenGL specification. - */ -static GLboolean -subtexture_error_check( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type ) -{ - /* Check target */ - if (dimensions == 1) { - if (target != GL_TEXTURE_1D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_2D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (target == GL_TEXTURE_2D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_3D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage3D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem( ctx, "invalid dims in texture_error_check" ); - return GL_TRUE; - } - - /* Basic level check */ - if (level < 0 || level >= MAX_TEXTURE_LEVELS) { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level); - return GL_TRUE; - } - - if (width < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexSubImage%dD(width=%d)", dimensions, width); - return GL_TRUE; - } - if (height < 0 && dimensions > 1) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexSubImage%dD(height=%d)", dimensions, height); - return GL_TRUE; - } - if (depth < 0 && dimensions > 2) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glTexSubImage%dD(depth=%d)", dimensions, depth); - return GL_TRUE; - } - - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%dD(format or type)", dimensions); - return GL_TRUE; - } - - return GL_FALSE; -} - -static GLboolean -subtexture_error_check2( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, - const struct gl_texture_image *destTex ) -{ - if (!destTex) { - /* undefined image level */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD", dimensions); - return GL_TRUE; - } - - if (xoffset < -((GLint)destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset)", - dimensions); - return GL_TRUE; - } - if (xoffset + width > (GLint) (destTex->Width + destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset+width)", - dimensions); - return GL_TRUE; - } - if (dimensions > 1) { - if (yoffset < -((GLint)destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset)", - dimensions); - return GL_TRUE; - } - if (yoffset + height > (GLint) (destTex->Height + destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset+height)", - dimensions); - return GL_TRUE; - } - } - if (dimensions > 2) { - if (zoffset < -((GLint)destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset)"); - return GL_TRUE; - } - if (zoffset + depth > (GLint) (destTex->Depth + destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset+depth)"); - return GL_TRUE; - } - } - -#if FEATURE_EXT_texture_sRGB - if (destTex->InternalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) { - if ((width & 0x3) || (height & 0x3) || - (xoffset & 0x3) || (yoffset & 0x3)) - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%dD(size or offset not multiple of 4)", - dimensions); - return GL_TRUE; - } -#endif - - if (destTex->IsCompressed) { - if (!target_can_be_compressed(ctx, target)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%D(target)", dimensions); - return GL_TRUE; - } - /* offset must be multiple of 4 */ - if ((xoffset & 3) || (yoffset & 3)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(xoffset or yoffset)", dimensions); - return GL_TRUE; - } - /* size must be multiple of 4 or equal to whole texture size */ - if ((width & 3) && (GLuint) width != destTex->Width) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(width)", dimensions); - return GL_TRUE; - } - if ((height & 3) && (GLuint) height != destTex->Height) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(width)", dimensions); - return GL_TRUE; - } - } - - return GL_FALSE; -} - - -/** - * Test glCopyTexImage[12]D() parameters for errors. - * - * \param ctx GL context. - * \param dimensions texture image dimensions (must be 1, 2 or 3). - * \param target texture target given by the user. - * \param level image level given by the user. - * \param internalFormat internal format given by the user. - * \param width image width given by the user. - * \param height image height given by the user. - * \param depth image depth given by the user. - * \param border texture border. - * - * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * - * Verifies each of the parameters against the constants specified in - * __GLcontextRec::Const and the supported extensions, and according to the - * OpenGL specification. - */ -static GLboolean -copytexture_error_check( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level, GLint internalFormat, - GLint width, GLint height, GLint border ) -{ - GLenum type; - GLboolean sizeOK; - GLint format; - - /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ - if (level < 0 || level >= MAX_TEXTURE_LEVELS) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexImage%dD(level=%d)", dimensions, level); - return GL_TRUE; - } - - /* Check that the source buffer is complete */ - if (ctx->ReadBuffer->Name) { - _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer); - if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glCopyTexImage%dD(invalid readbuffer)", dimensions); - return GL_TRUE; - } - } - - /* Check border */ - if (border < 0 || border > 1 || - ((target == GL_TEXTURE_RECTANGLE_NV || - target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) { - return GL_TRUE; - } - - format = _mesa_base_tex_format(ctx, internalFormat); - if (format < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexImage%dD(internalFormat)", dimensions); - return GL_TRUE; - } - - /* NOTE: the format and type aren't really significant for - * TestProxyTexImage(). Only the internalformat really matters. - if (!_mesa_source_buffer_exists(ctx, format)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexImage%dD(missing readbuffer)", dimensions); - return GL_TRUE; - } - - */ - type = GL_FLOAT; - - /* Check target and call ctx->Driver.TestProxyTexImage() to check the - * level, width, height and depth. - */ - if (dimensions == 1) { - if (target == GL_TEXTURE_1D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_1D, - level, internalFormat, - format, type, - width, 1, 1, border); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target == GL_TEXTURE_2D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_2D, - level, internalFormat, - format, type, - width, height, 1, border); - } - else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - sizeOK = (width == height) && - ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_CUBE_MAP_ARB, - level, internalFormat, format, type, - width, height, 1, border); - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, - GL_PROXY_TEXTURE_RECTANGLE_NV, - level, internalFormat, - format, type, - width, height, 1, border); - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)"); - return GL_TRUE; - } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, - GL_PROXY_TEXTURE_1D_ARRAY_EXT, - level, internalFormat, - format, type, - width, height, 1, border); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); - return GL_TRUE; - } - } - else { - _mesa_problem(ctx, "invalid dimensions in copytexture_error_check"); - return GL_TRUE; - } - - if (!sizeOK) { - if (dimensions == 1) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexImage1D(width=%d)", width); - } - else { - ASSERT(dimensions == 2); - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexImage2D(width=%d, height=%d)", width, height); - } - return GL_TRUE; - } - - if (is_compressed_format(ctx, internalFormat)) { - if (!target_can_be_compressed(ctx, target)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glCopyTexImage%d(target)", dimensions); - return GL_TRUE; - } - if (border != 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexImage%D(border!=0)", dimensions); - return GL_TRUE; - } - } - else if (is_depth_format(internalFormat)) { - /* make sure we have depth/stencil buffers */ - if (!ctx->ReadBuffer->_DepthBuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexImage%D(no depth)", dimensions); - return GL_TRUE; - } - } - else if (is_depthstencil_format(internalFormat)) { - /* make sure we have depth/stencil buffers */ - if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexImage%D(no depth/stencil buffer)", dimensions); - return GL_TRUE; - } - } - - /* if we get here, the parameters are OK */ - return GL_FALSE; -} - - -/** - * Test glCopyTexSubImage[12]D() parameters for errors. - * Note that this is the first part of error checking. - * See also copytexsubimage_error_check2() below for the second part. - * - * \param ctx GL context. - * \param dimensions texture image dimensions (must be 1, 2 or 3). - * \param target texture target given by the user. - * \param level image level given by the user. - * - * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - */ -static GLboolean -copytexsubimage_error_check1( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level) -{ - /* Check that the source buffer is complete */ - if (ctx->ReadBuffer->Name) { - _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer); - if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glCopyTexImage%dD(invalid readbuffer)", dimensions); - return GL_TRUE; - } - } - - /* Check target */ - if (dimensions == 1) { - if (target != GL_TEXTURE_1D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage1D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 2) { - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_RECTANGLE_NV) { - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target == GL_TEXTURE_1D_ARRAY_EXT) { - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (target != GL_TEXTURE_2D) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); - return GL_TRUE; - } - } - else if (dimensions == 3) { - if (((target != GL_TEXTURE_2D_ARRAY_EXT) || - (!ctx->Extensions.MESA_texture_array)) - && (target != GL_TEXTURE_3D)) { - _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage3D(target)" ); - return GL_TRUE; - } - } - - /* Check level */ - if (level < 0 || level >= MAX_TEXTURE_LEVELS) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(level=%d)", dimensions, level); - return GL_TRUE; - } - - return GL_FALSE; -} - - -/** - * Second part of error checking for glCopyTexSubImage[12]D(). - * \param xoffset sub-image x offset given by the user. - * \param yoffset sub-image y offset given by the user. - * \param zoffset sub-image z offset given by the user. - * \param width image width given by the user. - * \param height image height given by the user. - */ -static GLboolean -copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, - const struct gl_texture_image *teximage ) -{ - /* check that dest tex image exists */ - if (!teximage) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%dD(undefined texture level: %d)", - dimensions, level); - return GL_TRUE; - } - - /* Check size */ - if (width < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(width=%d)", dimensions, width); - return GL_TRUE; - } - if (dimensions > 1 && height < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(height=%d)", dimensions, height); - return GL_TRUE; - } - - /* check x/y offsets */ - if (xoffset < -((GLint)teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset); - return GL_TRUE; - } - if (xoffset + width > (GLint) (teximage->Width + teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(xoffset+width)", dimensions); - return GL_TRUE; - } - if (dimensions > 1) { - if (yoffset < -((GLint)teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(yoffset=%d)", dimensions, yoffset); - return GL_TRUE; - } - /* NOTE: we're adding the border here, not subtracting! */ - if (yoffset + height > (GLint) (teximage->Height + teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(yoffset+height)", dimensions); - return GL_TRUE; - } - } - - /* check z offset */ - if (dimensions > 2) { - if (zoffset < -((GLint)teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(zoffset)", dimensions); - return GL_TRUE; - } - if (zoffset > (GLint) (teximage->Depth + teximage->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(zoffset+depth)", dimensions); - return GL_TRUE; - } - } - - if (teximage->IsCompressed) { - if (!target_can_be_compressed(ctx, target)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glCopyTexSubImage%d(target)", dimensions); - return GL_TRUE; - } - /* offset must be multiple of 4 */ - if ((xoffset & 3) || (yoffset & 3)) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%D(xoffset or yoffset)", dimensions); - return GL_TRUE; - } - /* size must be multiple of 4 */ - if ((width & 3) != 0 && (GLuint) width != teximage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%D(width)", dimensions); - return GL_TRUE; - } - if ((height & 3) != 0 && (GLuint) height != teximage->Height) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%D(height)", dimensions); - return GL_TRUE; - } - } - - if (teximage->InternalFormat == GL_YCBCR_MESA) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2D"); - return GL_TRUE; - } - - if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)", - dimensions, teximage->_BaseFormat); - return GL_TRUE; - } - - if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) { - if (!ctx->ReadBuffer->_DepthBuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%D(no depth buffer)", - dimensions); - return GL_TRUE; - } - } - else if (teximage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%D(no depth/stencil buffer)", - dimensions); - return GL_TRUE; - } - } - - /* if we get here, the parameters are OK */ - return GL_FALSE; -} - - -/** - * Get texture image. Called by glGetTexImage. - * - * \param target texture target. - * \param level image level. - * \param format pixel data format for returned image. - * \param type pixel data type for returned image. - * \param pixels returned pixel data. - */ -void GLAPIENTRY -_mesa_GetTexImage( GLenum target, GLint level, GLenum format, - GLenum type, GLvoid *pixels ) -{ - const struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLint maxLevels = 0; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - texUnit = &(ctx->Texture.Unit[ctx->Texture.CurrentUnit]); - texObj = _mesa_select_tex_object(ctx, texUnit, target); - if (!texObj || _mesa_is_proxy_texture(target)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target)"); - return; - } - - maxLevels = _mesa_max_texture_levels(ctx, target); - ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */ - - if (level < 0 || level >= maxLevels) { - _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexImage(level)" ); - return; - } - - if (_mesa_sizeof_packed_type(type) <= 0) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(type)" ); - return; - } - - if (_mesa_components_in_format(format) <= 0 || - format == GL_STENCIL_INDEX) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" ); - return; - } - - if (!ctx->Extensions.EXT_paletted_texture && is_index_format(format)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); - return; - } - - if (!ctx->Extensions.ARB_depth_texture && is_depth_format(format)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); - return; - } - - if (!ctx->Extensions.MESA_ycbcr_texture && is_ycbcr_format(format)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); - return; - } - - if (!ctx->Extensions.EXT_packed_depth_stencil - && is_depthstencil_format(format)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); - return; - } - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (!texImage) { - /* invalid mipmap level, not an error */ - goto out; - } - - - /* Make sure the requested image format is compatible with the - * texture's format. Note that a color index texture can be converted - * to RGBA so that combo is allowed. - */ - if (_mesa_is_color_format(format) - && !_mesa_is_color_format(texImage->TexFormat->BaseFormat) - && !is_index_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - goto out; - } - else if (is_index_format(format) - && !is_index_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - goto out; - } - else if (is_depth_format(format) - && !is_depth_format(texImage->TexFormat->BaseFormat) - && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - goto out; - } - else if (is_ycbcr_format(format) - && !is_ycbcr_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - goto out; - } - else if (is_depthstencil_format(format) - && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - goto out; - } - - if (ctx->Pack.BufferObj->Name) { - /* packing texture image into a PBO */ - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; - if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, - texImage->Height, texImage->Depth, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(invalid PBO access)"); - goto out; - } - } - - /* typically, this will call _mesa_get_teximage() */ - ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, - texObj, texImage); - - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -/** - * Check if the given texture image is bound to any framebuffer objects - * and update/invalidate them. - * XXX We're only checking the currently bound framebuffer object for now. - * In the future, perhaps struct gl_texture_image should have a pointer (or - * list of pointers (yikes)) to the gl_framebuffer(s) which it's bound to. - */ -static void -update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, - GLuint face, GLuint level) -{ - if (ctx->DrawBuffer->Name) { - GLuint i; - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = - ctx->DrawBuffer->Attachment + i; - if (att->Type == GL_TEXTURE && - att->Texture == texObj && - att->TextureLevel == level && - att->CubeMapFace == face) { - ASSERT(att->Texture->Image[att->CubeMapFace][att->TextureLevel]); - /* Tell driver about the new renderbuffer texture */ - ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att); - } - } - } -} - - - -/* - * Called from the API. Note that width includes the border. - */ -void GLAPIENTRY -_mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, - GLsizei width, GLint border, GLenum format, - GLenum type, const GLvoid *pixels ) -{ - GLsizei postConvWidth = width; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - - if (target == GL_TEXTURE_1D) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - - if (texture_error_check(ctx, target, level, internalFormat, - format, type, 1, postConvWidth, 1, 1, border)) { - return; /* error was recorded */ - } - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, 1, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage1D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat, - width, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_1D) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, target, level, internalFormat, - format, type, 1, postConvWidth, 1, 1, border)) { - /* when error, clear all proxy texture image parameters */ - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* no error, set the tex image parameters */ - ASSERT(texImage); - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, 1, 1, - border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GLsizei postConvWidth = width, postConvHeight = height; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - - if (target == GL_TEXTURE_2D || - (ctx->Extensions.ARB_texture_cube_map && - target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) || - (ctx->Extensions.NV_texture_rectangle && - target == GL_TEXTURE_RECTANGLE_NV) || - (ctx->Extensions.MESA_texture_array && - target == GL_TEXTURE_1D_ARRAY_EXT)) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - - if (texture_error_check(ctx, target, level, internalFormat, - format, type, 2, postConvWidth, postConvHeight, - 1, border)) { - return; /* error was recorded */ - } - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage2D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat, - width, height, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_2D || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && - ctx->Extensions.ARB_texture_cube_map) || - (target == GL_PROXY_TEXTURE_RECTANGLE_NV && - ctx->Extensions.NV_texture_rectangle) || - (ctx->Extensions.MESA_texture_array && - target == GL_PROXY_TEXTURE_1D_ARRAY_EXT)) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, target, level, internalFormat, - format, type, 2, postConvWidth, postConvHeight, - 1, border)) { - /* when error, clear all proxy texture image parameters */ - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* no error, set the tex image parameters */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage2D(target)" ); - return; - } -} - - -/* - * Called by the API or display list executor. - * Note that width and height include the border. - */ -void GLAPIENTRY -_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); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target == GL_TEXTURE_3D || - (ctx->Extensions.MESA_texture_array && - target == GL_TEXTURE_2D_ARRAY_EXT)) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - const GLuint face = _mesa_tex_target_to_face(target); - - if (texture_error_check(ctx, target, level, (GLint) internalFormat, - format, type, 3, width, height, depth, border)) { - return; /* error was recorded */ - } - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage3D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, - width, height, depth, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_3D || - (ctx->Extensions.MESA_texture_array && - target == GL_PROXY_TEXTURE_2D_ARRAY_EXT)) { - /* Proxy texture: check for errors and update proxy state */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texture_error_check(ctx, target, level, internalFormat, - format, type, 3, width, height, depth, border)) { - /* when error, clear all proxy texture image parameters */ - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* no error, set the tex image parameters */ - _mesa_init_teximage_fields(ctx, target, texImage, width, height, - depth, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ) -{ - _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height, - depth, border, format, type, pixels); -} - - - -void GLAPIENTRY -_mesa_TexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GLsizei postConvWidth = width; - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - -#if FEATURE_convolve - /* XXX should test internal format */ - if (_mesa_is_color_format(format)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - - if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, - postConvWidth, 1, 1, format, type)) { - return; /* error was detected */ - } - - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - assert(texObj); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0, - postConvWidth, 1, 1, format, type, texImage)) { - goto out; /* error was detected */ - } - - if (width == 0) - goto out; /* no-op, not an error */ - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage1D); - (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width, - format, type, pixels, &ctx->Unpack, - texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - -void GLAPIENTRY -_mesa_TexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GLsizei postConvWidth = width, postConvHeight = height; - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - -#if FEATURE_convolve - /* XXX should test internal format */ - if (_mesa_is_color_format(format)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - - if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, 1, format, type)) { - return; /* error was detected */ - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (subtexture_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, 1, format, type, - texImage)) { - goto out; /* error was detected */ - } - - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage2D); - (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels, - &ctx->Unpack, texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_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 ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type)) { - return; /* error was detected */ - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (subtexture_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type, texImage)) { - goto out; /* error was detected */ - } - - if (width == 0 || height == 0 || height == 0) - goto out; /* no-op, not an error */ - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage3D); - (*ctx->Driver.TexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_mesa_CopyTexImage1D( GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLsizei postConvWidth = width; - const GLuint face = _mesa_tex_target_to_face(target); - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - - if (copytexture_error_check(ctx, 1, target, level, internalFormat, - postConvWidth, 1, border)) - return; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, - border, internalFormat); - - - ASSERT(ctx->Driver.CopyTexImage1D); - (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat, - x, y, width, border); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLsizei postConvWidth = width, postConvHeight = height; - const GLuint face = _mesa_tex_target_to_face(target); - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - -#if FEATURE_convolve - if (_mesa_is_color_format(internalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } -#endif - - if (copytexture_error_check(ctx, 2, target, level, internalFormat, - postConvWidth, postConvHeight, border)) - return; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CopyTexImage2D); - (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat, - x, y, width, height, border); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - -void GLAPIENTRY -_mesa_CopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLsizei postConvWidth = width; - GLint yoffset = 0; - GLsizei height = 1; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexsubimage_error_check1(ctx, 1, target, level)) - return; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } -#endif - - if (copytexsubimage_error_check2(ctx, 1, target, level, - xoffset, 0, 0, postConvWidth, 1, - texImage)) - goto out; - - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage1D); - ctx->Driver.CopyTexSubImage1D(ctx, target, level, - xoffset, x, y, width); - } - - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_mesa_CopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLsizei postConvWidth = width, postConvHeight = height; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexsubimage_error_check1(ctx, 2, target, level)) - return; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, - &postConvWidth, &postConvHeight); - } -#endif - - if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, texImage)) - goto out; - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage2D); - ctx->Driver.CopyTexSubImage2D(ctx, target, level, - xoffset, yoffset, x, y, width, height); - } - - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_mesa_CopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLsizei postConvWidth = width, postConvHeight = height; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (ctx->NewState & NEW_COPY_TEX_STATE) - _mesa_update_state(ctx); - - if (copytexsubimage_error_check1(ctx, 3, target, level)) - return; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - -#if FEATURE_convolve - if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { - _mesa_adjust_image_for_convolution(ctx, 2, - &postConvWidth, &postConvHeight); - } -#endif - - if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, - zoffset, postConvWidth, postConvHeight, - texImage)) - goto out; - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage3D); - ctx->Driver.CopyTexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - x, y, width, height); - } - - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - - - -/**********************************************************************/ -/****** Compressed Textures ******/ -/**********************************************************************/ - - -/** - * Error checking for glCompressedTexImage[123]D(). - * \return error code or GL_NO_ERROR. - */ -static GLenum -compressed_texture_error_check(GLcontext *ctx, GLint dimensions, - GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLsizei depth, GLint border, - GLsizei imageSize) -{ - GLint expectedSize, maxLevels = 0, maxTextureSize; - - if (dimensions == 1) { - /* 1D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - else if (dimensions == 2) { - if (target == GL_PROXY_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else { - return GL_INVALID_ENUM; /*target*/ - } - } - else if (dimensions == 3) { - /* 3D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - - maxTextureSize = 1 << (maxLevels - 1); - - /* This will detect any invalid internalFormat value */ - if (!is_compressed_format(ctx, internalFormat)) - return GL_INVALID_ENUM; - - /* This should really never fail */ - if (_mesa_base_tex_format(ctx, internalFormat) < 0) - return GL_INVALID_ENUM; - - if (border != 0) - return GL_INVALID_VALUE; - - /* - * XXX We should probably use the proxy texture error check function here. - */ - if (width < 1 || width > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(width))) - return GL_INVALID_VALUE; - - if ((height < 1 || height > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(height))) - && dimensions > 1) - return GL_INVALID_VALUE; - - if ((depth < 1 || depth > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(depth))) - && dimensions > 2) - return GL_INVALID_VALUE; - - /* For cube map, width must equal height */ - if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB && width != height) - return GL_INVALID_VALUE; - - if (level < 0 || level >= maxLevels) - return GL_INVALID_VALUE; - - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, internalFormat); - if (expectedSize != imageSize) - return GL_INVALID_VALUE; - -#if FEATURE_EXT_texture_sRGB - if ((internalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || - internalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) - && border != 0) { - return GL_INVALID_OPERATION; - } -#endif - - return GL_NO_ERROR; -} - - -/** - * Error checking for glCompressedTexSubImage[123]D(). - * \warning There are some bad assumptions here about the size of compressed - * texture tiles (multiple of 4) used to test the validity of the - * offset and size parameters. - * \return error code or GL_NO_ERROR. - */ -static GLenum -compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLsizei imageSize) -{ - GLint expectedSize, maxLevels = 0, maxTextureSize; - (void) zoffset; - - if (dimensions == 1) { - /* 1D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - else if (dimensions == 2) { - if (target == GL_PROXY_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_TEXTURE_2D) { - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { - if (!ctx->Extensions.ARB_texture_cube_map) - return GL_INVALID_ENUM; /*target*/ - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else { - return GL_INVALID_ENUM; /*target*/ - } - } - else if (dimensions == 3) { - /* 3D compressed textures not allowed */ - return GL_INVALID_ENUM; - } - - maxTextureSize = 1 << (maxLevels - 1); - - /* this will catch any invalid compressed format token */ - if (!is_compressed_format(ctx, format)) - return GL_INVALID_ENUM; - - if (width < 1 || width > maxTextureSize) - return GL_INVALID_VALUE; - - if ((height < 1 || height > maxTextureSize) - && dimensions > 1) - return GL_INVALID_VALUE; - - if (level < 0 || level >= maxLevels) - return GL_INVALID_VALUE; - - /* XXX these tests are specific to the compressed format. - * this code should be generalized in some way. - */ - if ((xoffset & 3) != 0 || (yoffset & 3) != 0) - return GL_INVALID_VALUE; - - if ((width & 3) != 0 && width != 2 && width != 1) - return GL_INVALID_VALUE; - - if ((height & 3) != 0 && height != 2 && height != 1) - return GL_INVALID_VALUE; - - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, format); - if (expectedSize != imageSize) - return GL_INVALID_VALUE; - - return GL_NO_ERROR; -} - - - -void GLAPIENTRY -_mesa_CompressedTexImage1DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLint border, GLsizei imageSize, - const GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target == GL_TEXTURE_1D) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 1, target, level, - internalFormat, width, 1, 1, border, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexImage1D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage1D); - (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, - internalFormat, width, border, - imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_1D) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 1, target, level, - internalFormat, width, 1, 1, border, imageSize); - if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, 1, 1, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* store the teximage parameters */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); - } - _mesa_unlock_texture(ctx, texObj); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1D(target)"); - return; - } -} - - -void GLAPIENTRY -_mesa_CompressedTexImage2DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLint border, GLsizei imageSize, - const GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target == GL_TEXTURE_2D || - (ctx->Extensions.ARB_texture_cube_map && - target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 2, target, level, - internalFormat, width, height, 1, border, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexImage2D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage2D); - (*ctx->Driver.CompressedTexImage2D)(ctx, target, level, - internalFormat, width, height, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_2D || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && - ctx->Extensions.ARB_texture_cube_map)) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 2, target, level, - internalFormat, width, height, 1, border, imageSize); - if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, height, 1, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* store the teximage parameters */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); - } - _mesa_unlock_texture(ctx, texObj); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2D(target)"); - return; - } -} - - -void GLAPIENTRY -_mesa_CompressedTexImage3DARB(GLenum target, GLint level, - GLenum internalFormat, GLsizei width, - GLsizei height, GLsizei depth, GLint border, - GLsizei imageSize, const GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (target == GL_TEXTURE_3D) { - /* non-proxy target */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error = compressed_texture_error_check(ctx, 3, target, level, - internalFormat, width, height, depth, border, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexImage3D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_get_tex_image(ctx, texObj, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage3D); - (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, - internalFormat, - width, height, depth, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); - } - else if (target == GL_PROXY_TEXTURE_3D) { - /* Proxy texture: check for errors and update proxy state */ - GLenum error = compressed_texture_error_check(ctx, 3, target, level, - internalFormat, width, height, depth, border, imageSize); - if (!error) { - ASSERT(ctx->Driver.TestProxyTexImage); - error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, - internalFormat, GL_NONE, GL_NONE, - width, height, depth, border); - } - if (error) { - /* if error, clear all proxy texture image parameters */ - struct gl_texture_image *texImage; - texImage = _mesa_get_proxy_tex_image(ctx, target, level); - if (texImage) - clear_teximage_fields(texImage); - } - else { - /* store the teximage parameters */ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, - depth, border, internalFormat); - } - _mesa_unlock_texture(ctx, texObj); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3D(target)"); - return; - } -} - - -void GLAPIENTRY -_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, - GLsizei imageSize, const GLvoid *data) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - error = compressed_subtexture_error_check(ctx, 1, target, level, - xoffset, 0, 0, /* pos */ - width, 1, 1, /* size */ - format, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage1D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage1D(format)"); - goto out; - } - - if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); - goto out; - } - - if (width == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage1D) { - (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level, - xoffset, width, - format, imageSize, data, - texObj, texImage); - } - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - -void GLAPIENTRY -_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLsizei imageSize, - const GLvoid *data) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - error = compressed_subtexture_error_check(ctx, 2, target, level, - xoffset, yoffset, 0, /* pos */ - width, height, 1, /* size */ - format, imageSize); - if (error) { - /* XXX proxy target? */ - _mesa_error(ctx, error, "glCompressedTexSubImage2D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage2D(format)"); - goto out; - } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); - goto out; - } - - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage2D) { - (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level, - xoffset, yoffset, width, height, - format, imageSize, data, - texObj, texImage); - } - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - -void GLAPIENTRY -_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, GLenum format, - GLsizei imageSize, const GLvoid *data) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - error = compressed_subtexture_error_check(ctx, 3, target, level, - xoffset, yoffset, zoffset,/*pos*/ - width, height, depth, /*size*/ - format, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage3D"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage3D(format)"); - goto out; - } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height) || - ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); - goto out; - } - - if (width == 0 || height == 0 || depth == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage3D) { - (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, imageSize, data, - texObj, texImage); - } - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); -} - - -void GLAPIENTRY -_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) -{ - const struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLint maxLevels; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - if (!texObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB"); - return; - } - - maxLevels = _mesa_max_texture_levels(ctx, target); - ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */ - - if (level < 0 || level >= maxLevels) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); - return; - } - - if (_mesa_is_proxy_texture(target)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); - return; - } - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (texImage) { - if (texImage->IsCompressed) { - /* this typically calls _mesa_get_compressed_teximage() */ - ctx->Driver.GetCompressedTexImage(ctx, target, level, img, - texObj, texImage); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImageARB"); - } - } - else { - /* probably invalid mipmap level */ - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetCompressedTexImageARB(level)"); - } - } - _mesa_unlock_texture(ctx, texObj); -} diff --git a/src/libs/mesa/mesa/main/teximage.h b/src/libs/mesa/mesa/main/teximage.h deleted file mode 100644 index eb60a1fa8f..0000000000 --- a/src/libs/mesa/mesa/main/teximage.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * \file teximage.h - * Texture images manipulation functions. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 TEXIMAGE_H -#define TEXIMAGE_H - - -#include "mtypes.h" - - -extern void * -_mesa_alloc_texmemory(GLsizei bytes); - -extern void -_mesa_free_texmemory(void *m); - - -/** \name Internal functions */ -/*@{*/ - -extern GLint -_mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ); - - -extern GLboolean -_mesa_is_proxy_texture(GLenum target); - - -extern struct gl_texture_image * -_mesa_new_texture_image( GLcontext *ctx ); - - -extern void -_mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *teximage ); - -extern void -_mesa_free_texture_image_data( GLcontext *ctx, - struct gl_texture_image *texImage ); - - -extern void -_mesa_init_teximage_fields(GLcontext *ctx, GLenum target, - struct gl_texture_image *img, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum internalFormat); - - -extern void -_mesa_set_tex_image(struct gl_texture_object *tObj, - GLenum target, GLint level, - struct gl_texture_image *texImage); - - -extern struct gl_texture_object * -_mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, - GLenum target); - - -extern struct gl_texture_image * -_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, - GLenum target, GLint level); - - -extern struct gl_texture_image * -_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj, - GLenum target, GLint level); - - -extern struct gl_texture_image * -_mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level); - - -extern GLint -_mesa_max_texture_levels(GLcontext *ctx, GLenum target); - - -extern GLboolean -_mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, GLenum format, GLenum type, - GLint width, GLint height, GLint depth, GLint border); - - -extern GLuint -_mesa_tex_target_to_face(GLenum target); - - -extern GLboolean -_mesa_is_color_format(GLenum format); - - -/** - * Lock a texture for updating. See also _mesa_lock_context_textures(). - */ -static INLINE void -_mesa_lock_texture(GLcontext *ctx, struct gl_texture_object *texObj) -{ - _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); - ctx->Shared->TextureStateStamp++; - (void) texObj; -} - -static INLINE void -_mesa_unlock_texture(GLcontext *ctx, struct gl_texture_object *texObj) -{ - _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); -} - -/*@}*/ - - -/** \name API entry point functions */ -/*@{*/ - -extern void GLAPIENTRY -_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, - GLsizei width, GLint border, - GLenum format, GLenum type, const GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels ); - - -extern void GLAPIENTRY -_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 GLAPIENTRY -_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_GetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, - GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_TexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -extern void GLAPIENTRY -_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 GLAPIENTRY -_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLint border ); - - -extern void GLAPIENTRY -_mesa_CopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, GLint x, GLint y, - GLsizei width, GLsizei height, GLint border ); - - -extern void GLAPIENTRY -_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, - GLint x, GLint y, GLsizei width ); - - -extern void GLAPIENTRY -_mesa_CopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ); - - -extern void GLAPIENTRY -_mesa_CopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ); - - - -extern void GLAPIENTRY -_mesa_CompressedTexImage1DARB(GLenum target, GLint level, - GLenum internalformat, GLsizei width, - GLint border, GLsizei imageSize, - const GLvoid *data); - -extern void GLAPIENTRY -_mesa_CompressedTexImage2DARB(GLenum target, GLint level, - GLenum internalformat, GLsizei width, - GLsizei height, GLint border, GLsizei imageSize, - const GLvoid *data); - -extern void GLAPIENTRY -_mesa_CompressedTexImage3DARB(GLenum target, GLint level, - GLenum internalformat, GLsizei width, - GLsizei height, GLsizei depth, GLint border, - GLsizei imageSize, const GLvoid *data); - -#ifdef VMS -#define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR -#define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR -#define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR -#endif -extern void GLAPIENTRY -_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, - GLsizei imageSize, const GLvoid *data); - -extern void GLAPIENTRY -_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLsizei imageSize, - const GLvoid *data); - -extern void GLAPIENTRY -_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, GLenum format, - GLsizei imageSize, const GLvoid *data); - -extern void GLAPIENTRY -_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); - -/*@}*/ - -#endif diff --git a/src/libs/mesa/mesa/main/texobj.c b/src/libs/mesa/mesa/main/texobj.c deleted file mode 100644 index dae761bdb8..0000000000 --- a/src/libs/mesa/mesa/main/texobj.c +++ /dev/null @@ -1,1126 +0,0 @@ -/** - * \file texobj.c - * Texture object management. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "glheader.h" -#if FEATURE_colortable -#include "colortab.h" -#endif -#include "context.h" -#include "enums.h" -#include "fbobject.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "teximage.h" -#include "texstate.h" -#include "texobj.h" -#include "mtypes.h" - - -/**********************************************************************/ -/** \name Internal functions */ -/*@{*/ - - -/** - * Return the gl_texture_object for a given ID. - */ -struct gl_texture_object * -_mesa_lookup_texture(GLcontext *ctx, GLuint id) -{ - return (struct gl_texture_object *) - _mesa_HashLookup(ctx->Shared->TexObjects, id); -} - - - -/** - * Allocate and initialize a new texture object. But don't put it into the - * texture object hash table. - * - * Called via ctx->Driver.NewTextureObject, unless overridden by a device - * driver. - * - * \param shared the shared GL state structure to contain the texture object - * \param name integer name for the texture object - * \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, - * GL_TEXTURE_CUBE_MAP_ARB or GL_TEXTURE_RECTANGLE_NV. zero is ok for the sake - * of GenTextures() - * - * \return pointer to new texture object. - */ -struct gl_texture_object * -_mesa_new_texture_object( GLcontext *ctx, GLuint name, GLenum target ) -{ - struct gl_texture_object *obj; - (void) ctx; - obj = MALLOC_STRUCT(gl_texture_object); - _mesa_initialize_texture_object(obj, name, target); - return obj; -} - - -/** - * Initialize a new texture object to default values. - * \param obj the texture object - * \param name the texture name - * \param target the texture target - */ -void -_mesa_initialize_texture_object( struct gl_texture_object *obj, - GLuint name, GLenum target ) -{ - ASSERT(target == 0 || - target == GL_TEXTURE_1D || - target == GL_TEXTURE_2D || - target == GL_TEXTURE_3D || - target == GL_TEXTURE_CUBE_MAP_ARB || - target == GL_TEXTURE_RECTANGLE_NV || - target == GL_TEXTURE_1D_ARRAY_EXT || - target == GL_TEXTURE_2D_ARRAY_EXT); - - _mesa_bzero(obj, sizeof(*obj)); - /* init the non-zero fields */ - _glthread_INIT_MUTEX(obj->Mutex); - obj->RefCount = 1; - obj->Name = name; - obj->Target = target; - obj->Priority = 1.0F; - if (target == GL_TEXTURE_RECTANGLE_NV) { - obj->WrapS = GL_CLAMP_TO_EDGE; - obj->WrapT = GL_CLAMP_TO_EDGE; - obj->WrapR = GL_CLAMP_TO_EDGE; - obj->MinFilter = GL_LINEAR; - } - else { - obj->WrapS = GL_REPEAT; - obj->WrapT = GL_REPEAT; - obj->WrapR = GL_REPEAT; - obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR; - } - obj->MagFilter = GL_LINEAR; - obj->MinLod = -1000.0; - obj->MaxLod = 1000.0; - obj->LodBias = 0.0; - obj->BaseLevel = 0; - obj->MaxLevel = 1000; - obj->MaxAnisotropy = 1.0; - obj->CompareFlag = GL_FALSE; /* SGIX_shadow */ - obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */ - obj->CompareMode = GL_NONE; /* ARB_shadow */ - obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ - obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ - obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ -} - - -/** - * Some texture initialization can't be finished until we know which - * target it's getting bound to (GL_TEXTURE_1D/2D/etc). - */ -static void -finish_texture_init(GLcontext *ctx, GLenum target, - struct gl_texture_object *obj) -{ - assert(obj->Target == 0); - - if (target == GL_TEXTURE_RECTANGLE_NV) { - /* have to init wrap and filter state here - kind of klunky */ - obj->WrapS = GL_CLAMP_TO_EDGE; - obj->WrapT = GL_CLAMP_TO_EDGE; - obj->WrapR = GL_CLAMP_TO_EDGE; - obj->MinFilter = GL_LINEAR; - if (ctx->Driver.TexParameter) { - static const GLfloat fparam_wrap[1] = {(GLfloat) GL_CLAMP_TO_EDGE}; - static const GLfloat fparam_filter[1] = {(GLfloat) GL_LINEAR}; - ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_S, fparam_wrap); - ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_T, fparam_wrap); - ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_R, fparam_wrap); - ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_MIN_FILTER, fparam_filter); - } - } -} - - -/** - * Deallocate a texture object struct. It should have already been - * removed from the texture object pool. - * Called via ctx->Driver.DeleteTexture() if not overriden by a driver. - * - * \param shared the shared GL state to which the object belongs. - * \param texOjb the texture object to delete. - */ -void -_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) -{ - GLuint i, face; - - (void) ctx; - - /* Set Target to an invalid value. With some assertions elsewhere - * we can try to detect possible use of deleted textures. - */ - texObj->Target = 0x99; - -#if FEATURE_colortable - _mesa_free_colortable_data(&texObj->Palette); -#endif - - /* free the texture images */ - for (face = 0; face < 6; face++) { - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { - if (texObj->Image[face][i]) { - _mesa_delete_texture_image( ctx, texObj->Image[face][i] ); - } - } - } - - /* destroy the mutex -- it may have allocated memory (eg on bsd) */ - _glthread_DESTROY_MUTEX(texObj->Mutex); - - /* free this object */ - _mesa_free(texObj); -} - - - - -/** - * Copy texture object state from one texture object to another. - * Use for glPush/PopAttrib. - * - * \param dest destination texture object. - * \param src source texture object. - */ -void -_mesa_copy_texture_object( struct gl_texture_object *dest, - const struct gl_texture_object *src ) -{ - dest->Target = src->Target; - dest->Name = src->Name; - dest->Priority = src->Priority; - dest->BorderColor[0] = src->BorderColor[0]; - dest->BorderColor[1] = src->BorderColor[1]; - dest->BorderColor[2] = src->BorderColor[2]; - dest->BorderColor[3] = src->BorderColor[3]; - dest->WrapS = src->WrapS; - dest->WrapT = src->WrapT; - dest->WrapR = src->WrapR; - dest->MinFilter = src->MinFilter; - dest->MagFilter = src->MagFilter; - dest->MinLod = src->MinLod; - dest->MaxLod = src->MaxLod; - dest->LodBias = src->LodBias; - dest->BaseLevel = src->BaseLevel; - dest->MaxLevel = src->MaxLevel; - dest->MaxAnisotropy = src->MaxAnisotropy; - dest->CompareFlag = src->CompareFlag; - dest->CompareOperator = src->CompareOperator; - dest->ShadowAmbient = src->ShadowAmbient; - dest->CompareMode = src->CompareMode; - dest->CompareFunc = src->CompareFunc; - dest->DepthMode = src->DepthMode; - dest->_MaxLevel = src->_MaxLevel; - dest->_MaxLambda = src->_MaxLambda; - dest->GenerateMipmap = src->GenerateMipmap; - dest->Palette = src->Palette; - dest->_Complete = src->_Complete; -} - - -/** - * Check if the given texture object is valid by examining its Target field. - * For debugging only. - */ -static GLboolean -valid_texture_object(const struct gl_texture_object *tex) -{ - switch (tex->Target) { - case 0: - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_CUBE_MAP_ARB: - case GL_TEXTURE_RECTANGLE_NV: - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: - return GL_TRUE; - case 0x99: - _mesa_problem(NULL, "invalid reference to a deleted texture object"); - return GL_FALSE; - default: - _mesa_problem(NULL, "invalid texture object Target value"); - return GL_FALSE; - } -} - - -/** - * Reference (or unreference) a texture object. - * If '*ptr', decrement *ptr's refcount (and delete if it becomes zero). - * If 'tex' is non-null, increment its refcount. - */ -void -_mesa_reference_texobj(struct gl_texture_object **ptr, - struct gl_texture_object *tex) -{ - assert(ptr); - if (*ptr == tex) { - /* no change */ - return; - } - - if (*ptr) { - /* Unreference the old texture */ - GLboolean deleteFlag = GL_FALSE; - struct gl_texture_object *oldTex = *ptr; - - assert(valid_texture_object(oldTex)); - - _glthread_LOCK_MUTEX(oldTex->Mutex); - ASSERT(oldTex->RefCount > 0); - oldTex->RefCount--; - - deleteFlag = (oldTex->RefCount == 0); - _glthread_UNLOCK_MUTEX(oldTex->Mutex); - - if (deleteFlag) { - GET_CURRENT_CONTEXT(ctx); - if (ctx) - ctx->Driver.DeleteTexture(ctx, oldTex); - else - _mesa_problem(NULL, "Unable to delete texture, no context"); - } - - *ptr = NULL; - } - assert(!*ptr); - - if (tex) { - /* reference new texture */ - assert(valid_texture_object(tex)); - _glthread_LOCK_MUTEX(tex->Mutex); - if (tex->RefCount == 0) { - /* this texture's being deleted (look just above) */ - /* Not sure this can every really happen. Warn if it does. */ - _mesa_problem(NULL, "referencing deleted texture object"); - *ptr = NULL; - } - else { - tex->RefCount++; - *ptr = tex; - } - _glthread_UNLOCK_MUTEX(tex->Mutex); - } -} - - - -/** - * Report why a texture object is incomplete. - * - * \param t texture object. - * \param why string describing why it's incomplete. - * - * \note For debug purposes only. - */ -#if 0 -static void -incomplete(const struct gl_texture_object *t, const char *why) -{ - _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why); -} -#else -#define incomplete(t, why) -#endif - - -/** - * Examine a texture object to determine if it is complete. - * - * The gl_texture_object::Complete flag will be set to GL_TRUE or GL_FALSE - * accordingly. - * - * \param ctx GL context. - * \param t texture object. - * - * According to the texture target, verifies that each of the mipmaps is - * present and has the expected size. - */ -void -_mesa_test_texobj_completeness( const GLcontext *ctx, - struct gl_texture_object *t ) -{ - const GLint baseLevel = t->BaseLevel; - GLint maxLog2 = 0, maxLevels = 0; - - t->_Complete = GL_TRUE; /* be optimistic */ - - /* Detect cases where the application set the base level to an invalid - * value. - */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { - char s[100]; - _mesa_sprintf(s, "obj %p (%d) base level = %d is invalid", - (void *) t, t->Name, baseLevel); - incomplete(t, s); - t->_Complete = GL_FALSE; - return; - } - - /* Always need the base level image */ - if (!t->Image[0][baseLevel]) { - char s[100]; - _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL", - (void *) t, t->Name, baseLevel); - incomplete(t, s); - t->_Complete = GL_FALSE; - return; - } - - /* Check width/height/depth for zero */ - if (t->Image[0][baseLevel]->Width == 0 || - t->Image[0][baseLevel]->Height == 0 || - t->Image[0][baseLevel]->Depth == 0) { - incomplete(t, "texture width = 0"); - t->_Complete = GL_FALSE; - return; - } - - /* Compute _MaxLevel */ - if ((t->Target == GL_TEXTURE_1D) || - (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) { - maxLog2 = t->Image[0][baseLevel]->WidthLog2; - maxLevels = ctx->Const.MaxTextureLevels; - } - else if ((t->Target == GL_TEXTURE_2D) || - (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) { - maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLevels = ctx->Const.MaxTextureLevels; - } - else if (t->Target == GL_TEXTURE_3D) { - GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2)); - maxLevels = ctx->Const.Max3DTextureLevels; - } - else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { - maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLevels = ctx->Const.MaxCubeTextureLevels; - } - else if (t->Target == GL_TEXTURE_RECTANGLE_NV) { - maxLog2 = 0; /* not applicable */ - maxLevels = 1; /* no mipmapping */ - } - else { - _mesa_problem(ctx, "Bad t->Target in _mesa_test_texobj_completeness"); - return; - } - - ASSERT(maxLevels > 0); - - t->_MaxLevel = baseLevel + maxLog2; - t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel); - t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1); - - /* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */ - t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel); - - if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { - /* make sure that all six cube map level 0 images are the same size */ - const GLuint w = t->Image[0][baseLevel]->Width2; - const GLuint h = t->Image[0][baseLevel]->Height2; - GLuint face; - for (face = 1; face < 6; face++) { - if (t->Image[face][baseLevel] == NULL || - t->Image[face][baseLevel]->Width2 != w || - t->Image[face][baseLevel]->Height2 != h) { - t->_Complete = GL_FALSE; - incomplete(t, "Non-quare cubemap image"); - return; - } - } - } - - /* extra checking for mipmaps */ - if (t->MinFilter != GL_NEAREST && t->MinFilter != GL_LINEAR) { - /* - * Mipmapping: determine if we have a complete set of mipmaps - */ - GLint i; - GLint minLevel = baseLevel; - GLint maxLevel = t->_MaxLevel; - - if (minLevel > maxLevel) { - t->_Complete = GL_FALSE; - incomplete(t, "minLevel > maxLevel"); - return; - } - - /* Test dimension-independent attributes */ - for (i = minLevel; i <= maxLevel; i++) { - if (t->Image[0][i]) { - if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) { - t->_Complete = GL_FALSE; - incomplete(t, "Format[i] != Format[baseLevel]"); - return; - } - if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) { - t->_Complete = GL_FALSE; - incomplete(t, "Border[i] != Border[baseLevel]"); - return; - } - } - } - - /* Test things which depend on number of texture image dimensions */ - if ((t->Target == GL_TEXTURE_1D) || - (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) { - /* Test 1-D mipmaps */ - GLuint width = t->Image[0][baseLevel]->Width2; - for (i = baseLevel + 1; i < maxLevels; i++) { - if (width > 1) { - width /= 2; - } - if (i >= minLevel && i <= maxLevel) { - if (!t->Image[0][i]) { - t->_Complete = GL_FALSE; - incomplete(t, "1D Image[0][i] == NULL"); - return; - } - if (t->Image[0][i]->Width2 != width ) { - t->_Complete = GL_FALSE; - incomplete(t, "1D Image[0][i] bad width"); - return; - } - } - if (width == 1) { - return; /* found smallest needed mipmap, all done! */ - } - } - } - else if ((t->Target == GL_TEXTURE_2D) || - (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) { - /* Test 2-D mipmaps */ - GLuint width = t->Image[0][baseLevel]->Width2; - GLuint height = t->Image[0][baseLevel]->Height2; - for (i = baseLevel + 1; i < maxLevels; i++) { - if (width > 1) { - width /= 2; - } - if (height > 1) { - height /= 2; - } - if (i >= minLevel && i <= maxLevel) { - if (!t->Image[0][i]) { - t->_Complete = GL_FALSE; - incomplete(t, "2D Image[0][i] == NULL"); - return; - } - if (t->Image[0][i]->Width2 != width) { - t->_Complete = GL_FALSE; - incomplete(t, "2D Image[0][i] bad width"); - return; - } - if (t->Image[0][i]->Height2 != height) { - t->_Complete = GL_FALSE; - incomplete(t, "2D Image[0][i] bad height"); - return; - } - if (width==1 && height==1) { - return; /* found smallest needed mipmap, all done! */ - } - } - } - } - else if (t->Target == GL_TEXTURE_3D) { - /* Test 3-D mipmaps */ - GLuint width = t->Image[0][baseLevel]->Width2; - GLuint height = t->Image[0][baseLevel]->Height2; - GLuint depth = t->Image[0][baseLevel]->Depth2; - for (i = baseLevel + 1; i < maxLevels; i++) { - if (width > 1) { - width /= 2; - } - if (height > 1) { - height /= 2; - } - if (depth > 1) { - depth /= 2; - } - if (i >= minLevel && i <= maxLevel) { - if (!t->Image[0][i]) { - incomplete(t, "3D Image[0][i] == NULL"); - t->_Complete = GL_FALSE; - return; - } - if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->_Complete = GL_FALSE; - incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); - return; - } - if (t->Image[0][i]->Width2 != width) { - t->_Complete = GL_FALSE; - incomplete(t, "3D Image[0][i] bad width"); - return; - } - if (t->Image[0][i]->Height2 != height) { - t->_Complete = GL_FALSE; - incomplete(t, "3D Image[0][i] bad height"); - return; - } - if (t->Image[0][i]->Depth2 != depth) { - t->_Complete = GL_FALSE; - incomplete(t, "3D Image[0][i] bad depth"); - return; - } - } - if (width == 1 && height == 1 && depth == 1) { - return; /* found smallest needed mipmap, all done! */ - } - } - } - else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { - /* make sure 6 cube faces are consistant */ - GLuint width = t->Image[0][baseLevel]->Width2; - GLuint height = t->Image[0][baseLevel]->Height2; - for (i = baseLevel + 1; i < maxLevels; i++) { - if (width > 1) { - width /= 2; - } - if (height > 1) { - height /= 2; - } - if (i >= minLevel && i <= maxLevel) { - GLuint face; - for (face = 0; face < 6; face++) { - /* check that we have images defined */ - if (!t->Image[face][i]) { - t->_Complete = GL_FALSE; - incomplete(t, "CubeMap Image[n][i] == NULL"); - return; - } - /* Don't support GL_DEPTH_COMPONENT for cube maps */ - if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) { - t->_Complete = GL_FALSE; - incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); - return; - } - /* check that all six images have same size */ - if (t->Image[face][i]->Width2!=width || - t->Image[face][i]->Height2!=height) { - t->_Complete = GL_FALSE; - incomplete(t, "CubeMap Image[n][i] bad size"); - return; - } - } - } - if (width == 1 && height == 1) { - return; /* found smallest needed mipmap, all done! */ - } - } - } - else if (t->Target == GL_TEXTURE_RECTANGLE_NV) { - /* XXX special checking? */ - } - else { - /* Target = ??? */ - _mesa_problem(ctx, "Bug in gl_test_texture_object_completeness\n"); - } - } -} - -/*@}*/ - - -/***********************************************************************/ -/** \name API functions */ -/*@{*/ - - -/** - * Generate texture names. - * - * \param n number of texture names to be generated. - * \param textures an array in which will hold the generated texture names. - * - * \sa glGenTextures(). - * - * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture - * IDs which are stored in \p textures. Corresponding empty texture - * objects are also generated. - */ -void GLAPIENTRY -_mesa_GenTextures( GLsizei n, GLuint *textures ) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glGenTextures" ); - return; - } - - if (!textures) - return; - - /* - * This must be atomic (generation and allocation of texture IDs) - */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n); - - /* Allocate new, empty texture objects */ - for (i = 0; i < n; i++) { - struct gl_texture_object *texObj; - GLuint name = first + i; - GLenum target = 0; - texObj = (*ctx->Driver.NewTextureObject)( ctx, name, target); - if (!texObj) { - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTextures"); - return; - } - - /* insert into hash table */ - _mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj); - - textures[i] = name; - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -/** - * Check if the given texture object is bound to the current draw or - * read framebuffer. If so, Unbind it. - */ -static void -unbind_texobj_from_fbo(GLcontext *ctx, struct gl_texture_object *texObj) -{ - const GLuint n = (ctx->DrawBuffer == ctx->ReadBuffer) ? 1 : 2; - GLuint i; - - for (i = 0; i < n; i++) { - struct gl_framebuffer *fb = (i == 0) ? ctx->DrawBuffer : ctx->ReadBuffer; - if (fb->Name) { - GLuint j; - for (j = 0; j < BUFFER_COUNT; j++) { - if (fb->Attachment[j].Type == GL_TEXTURE && - fb->Attachment[j].Texture == texObj) { - _mesa_remove_attachment(ctx, fb->Attachment + j); - } - } - } - } -} - - -/** - * Check if the given texture object is bound to any texture image units and - * unbind it if so (revert to default textures). - */ -static void -unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) -{ - GLuint u, tex; - - for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) { - struct gl_texture_unit *unit = &ctx->Texture.Unit[u]; - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - if (texObj == unit->CurrentTex[tex]) { - _mesa_reference_texobj(&unit->CurrentTex[tex], - ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]); - ASSERT(unit->CurrentTex[tex]); - break; - } - } - } -} - - -/** - * Delete named textures. - * - * \param n number of textures to be deleted. - * \param textures array of texture IDs to be deleted. - * - * \sa glDeleteTextures(). - * - * If we're about to delete a texture that's currently bound to any - * texture unit, unbind the texture first. Decrement the reference - * count on the texture object and delete it if it's zero. - * Recall that texture objects can be shared among several rendering - * contexts. - */ -void GLAPIENTRY -_mesa_DeleteTextures( GLsizei n, const GLuint *textures) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */ - - if (!textures) - return; - - for (i = 0; i < n; i++) { - if (textures[i] > 0) { - struct gl_texture_object *delObj - = _mesa_lookup_texture(ctx, textures[i]); - - if (delObj) { - _mesa_lock_texture(ctx, delObj); - - /* Check if texture is bound to any framebuffer objects. - * If so, unbind. - * See section 4.4.2.3 of GL_EXT_framebuffer_object. - */ - unbind_texobj_from_fbo(ctx, delObj); - - /* Check if this texture is currently bound to any texture units. - * If so, unbind it. - */ - unbind_texobj_from_texunits(ctx, delObj); - - _mesa_unlock_texture(ctx, delObj); - - ctx->NewState |= _NEW_TEXTURE; - - /* The texture _name_ is now free for re-use. - * Remove it from the hash table now. - */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - - /* Unreference the texobj. If refcount hits zero, the texture - * will be deleted. - */ - _mesa_reference_texobj(&delObj, NULL); - } - } - } -} - - -/** - * Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D - * into the corresponding Mesa texture target index. - * Return -1 if target is invalid. - */ -static GLint -target_enum_to_index(GLenum target) -{ - switch (target) { - case GL_TEXTURE_1D: - return TEXTURE_1D_INDEX; - case GL_TEXTURE_2D: - return TEXTURE_2D_INDEX; - case GL_TEXTURE_3D: - return TEXTURE_3D_INDEX; - case GL_TEXTURE_CUBE_MAP_ARB: - return TEXTURE_CUBE_INDEX; - case GL_TEXTURE_RECTANGLE_NV: - return TEXTURE_RECT_INDEX; - case GL_TEXTURE_1D_ARRAY_EXT: - return TEXTURE_1D_ARRAY_INDEX; - case GL_TEXTURE_2D_ARRAY_EXT: - return TEXTURE_2D_ARRAY_INDEX; - default: - return -1; - } -} - - -/** - * Bind a named texture to a texturing target. - * - * \param target texture target. - * \param texName texture name. - * - * \sa glBindTexture(). - * - * Determines the old texture object bound and returns immediately if rebinding - * the same texture. Get the current texture which is either a default texture - * if name is null, a named texture from the hash, or a new texture if the - * given texture name is new. Increments its reference count, binds it, and - * calls dd_function_table::BindTexture. Decrements the old texture reference - * count and deletes it if it reaches zero. - */ -void GLAPIENTRY -_mesa_BindTexture( GLenum target, GLuint texName ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint unit = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - struct gl_texture_object *newTexObj = NULL, *defaultTexObj = NULL; - GLint targetIndex; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glBindTexture %s %d\n", - _mesa_lookup_enum_by_nr(target), (GLint) texName); - - targetIndex = target_enum_to_index(target); - if (targetIndex < 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)"); - return; - } - assert(targetIndex < NUM_TEXTURE_TARGETS); - defaultTexObj = ctx->Shared->DefaultTex[targetIndex]; - - /* - * Get pointer to new texture object (newTexObj) - */ - if (texName == 0) { - newTexObj = defaultTexObj; - } - else { - /* non-default texture object */ - newTexObj = _mesa_lookup_texture(ctx, texName); - if (newTexObj) { - /* error checking */ - if (newTexObj->Target != 0 && newTexObj->Target != target) { - /* the named texture object's target doesn't match the given target */ - _mesa_error( ctx, GL_INVALID_OPERATION, - "glBindTexture(target mismatch)" ); - return; - } - if (newTexObj->Target == 0) { - finish_texture_init(ctx, target, newTexObj); - } - } - else { - /* if this is a new texture id, allocate a texture object now */ - newTexObj = (*ctx->Driver.NewTextureObject)(ctx, texName, target); - if (!newTexObj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindTexture"); - return; - } - - /* and insert it into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashInsert(ctx->Shared->TexObjects, texName, newTexObj); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - } - newTexObj->Target = target; - } - - assert(valid_texture_object(newTexObj)); - - /* flush before changing binding */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - - /* Do the actual binding. The refcount on the previously bound - * texture object will be decremented. It'll be deleted if the - * count hits zero. - */ - _mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj); - ASSERT(texUnit->CurrentTex[targetIndex]); - - /* Pass BindTexture call to device driver */ - if (ctx->Driver.BindTexture) - (*ctx->Driver.BindTexture)( ctx, target, newTexObj ); -} - - -/** - * Set texture priorities. - * - * \param n number of textures. - * \param texName texture names. - * \param priorities corresponding texture priorities. - * - * \sa glPrioritizeTextures(). - * - * Looks up each texture in the hash, clamps the corresponding priority between - * 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture. - */ -void GLAPIENTRY -_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, - const GLclampf *priorities ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (n < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPrioritizeTextures" ); - return; - } - - if (!priorities) - return; - - for (i = 0; i < n; i++) { - if (texName[i] > 0) { - struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]); - if (t) { - t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); - if (ctx->Driver.PrioritizeTexture) - ctx->Driver.PrioritizeTexture( ctx, t, t->Priority ); - } - } - } - - ctx->NewState |= _NEW_TEXTURE; -} - -/** - * See if textures are loaded in texture memory. - * - * \param n number of textures to query. - * \param texName array with the texture names. - * \param residences array which will hold the residence status. - * - * \return GL_TRUE if all textures are resident and \p residences is left unchanged, - * - * \sa glAreTexturesResident(). - * - * Looks up each texture in the hash and calls - * dd_function_table::IsTextureResident. - */ -GLboolean GLAPIENTRY -_mesa_AreTexturesResident(GLsizei n, const GLuint *texName, - GLboolean *residences) -{ - GET_CURRENT_CONTEXT(ctx); - GLboolean allResident = GL_TRUE; - GLint i, j; - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)"); - return GL_FALSE; - } - - if (!texName || !residences) - return GL_FALSE; - - for (i = 0; i < n; i++) { - struct gl_texture_object *t; - if (texName[i] == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident"); - return GL_FALSE; - } - t = _mesa_lookup_texture(ctx, texName[i]); - if (!t) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident"); - return GL_FALSE; - } - if (!ctx->Driver.IsTextureResident || - ctx->Driver.IsTextureResident(ctx, t)) { - /* The texture is resident */ - if (!allResident) - residences[i] = GL_TRUE; - } - else { - /* The texture is not resident */ - if (allResident) { - allResident = GL_FALSE; - for (j = 0; j < i; j++) - residences[j] = GL_TRUE; - } - residences[i] = GL_FALSE; - } - } - - return allResident; -} - -/** - * See if a name corresponds to a texture. - * - * \param texture texture name. - * - * \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE - * otherwise. - * - * \sa glIsTexture(). - * - * Calls _mesa_HashLookup(). - */ -GLboolean GLAPIENTRY -_mesa_IsTexture( GLuint texture ) -{ - struct gl_texture_object *t; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (!texture) - return GL_FALSE; - - t = _mesa_lookup_texture(ctx, texture); - - /* IsTexture is true only after object has been bound once. */ - return t && t->Target; -} - - -/** - * Simplest implementation of texture locking: Grab the a new mutex in - * the shared context. Examine the shared context state timestamp and - * if there has been a change, set the appropriate bits in - * ctx->NewState. - * - * This is used to deal with synchronizing things when a texture object - * is used/modified by different contexts (or threads) which are sharing - * the texture. - * - * See also _mesa_lock/unlock_texture() in teximage.h - */ -void -_mesa_lock_context_textures( GLcontext *ctx ) -{ - _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); - - if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) { - ctx->NewState |= _NEW_TEXTURE; - ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp; - } -} - - -void -_mesa_unlock_context_textures( GLcontext *ctx ) -{ - assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp); - _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); -} - -/*@}*/ - - diff --git a/src/libs/mesa/mesa/main/texobj.h b/src/libs/mesa/mesa/main/texobj.h deleted file mode 100644 index d5374c5d6c..0000000000 --- a/src/libs/mesa/mesa/main/texobj.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * \file texobj.h - * Texture object management. - */ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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 TEXTOBJ_H -#define TEXTOBJ_H - - -#include "mtypes.h" - - -/** - * \name Internal functions - */ -/*@{*/ - -extern struct gl_texture_object * -_mesa_lookup_texture(GLcontext *ctx, GLuint id); - -extern struct gl_texture_object * -_mesa_new_texture_object( GLcontext *ctx, GLuint name, GLenum target ); - -extern void -_mesa_initialize_texture_object( struct gl_texture_object *obj, - GLuint name, GLenum target ); - -extern void -_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *obj ); - -extern void -_mesa_copy_texture_object( struct gl_texture_object *dest, - const struct gl_texture_object *src ); - -extern void -_mesa_reference_texobj(struct gl_texture_object **ptr, - struct gl_texture_object *tex); - -extern void -_mesa_test_texobj_completeness( const GLcontext *ctx, - struct gl_texture_object *obj ); - -extern void -_mesa_unlock_context_textures( GLcontext *ctx ); - -extern void -_mesa_lock_context_textures( GLcontext *ctx ); - -/*@}*/ - - -/** - * \name API functions - */ -/*@{*/ - -extern void GLAPIENTRY -_mesa_GenTextures( GLsizei n, GLuint *textures ); - - -extern void GLAPIENTRY -_mesa_DeleteTextures( GLsizei n, const GLuint *textures ); - - -extern void GLAPIENTRY -_mesa_BindTexture( GLenum target, GLuint texture ); - - -extern void GLAPIENTRY -_mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, - const GLclampf *priorities ); - - -extern GLboolean GLAPIENTRY -_mesa_AreTexturesResident( GLsizei n, const GLuint *textures, - GLboolean *residences ); - -extern GLboolean GLAPIENTRY -_mesa_IsTexture( GLuint texture ); - -/*@}*/ - - -#endif diff --git a/src/libs/mesa/mesa/main/texparam.c b/src/libs/mesa/mesa/main/texparam.c deleted file mode 100644 index e89bc5fb9d..0000000000 --- a/src/libs/mesa/mesa/main/texparam.c +++ /dev/null @@ -1,1240 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.5 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -/** - * \file texparam.c - * - * glTexParameter-related functions - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/texcompress.h" -#include "main/texparam.h" -#include "main/teximage.h" - - -/** - * Check if a coordinate wrap mode is supported for the texture target. - * \return GL_TRUE if legal, GL_FALSE otherwise - */ -static GLboolean -validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) -{ - const struct gl_extensions * const e = & ctx->Extensions; - - if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE || - (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { - /* any texture target */ - return GL_TRUE; - } - else if (target != GL_TEXTURE_RECTANGLE_NV && - (wrap == GL_REPEAT || - (wrap == GL_MIRRORED_REPEAT && - e->ARB_texture_mirrored_repeat) || - (wrap == GL_MIRROR_CLAMP_EXT && - (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT && - (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT && - (e->EXT_texture_mirror_clamp)))) { - /* non-rectangle texture */ - return GL_TRUE; - } - - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return GL_FALSE; -} - - -/** - * Get current texture object for given target. - * Return NULL if any error. - */ -static struct gl_texture_object * -get_texobj(GLcontext *ctx, GLenum target) -{ - struct gl_texture_unit *texUnit; - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(current unit)"); - return NULL; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (target) { - case GL_TEXTURE_1D: - return texUnit->CurrentTex[TEXTURE_1D_INDEX]; - case GL_TEXTURE_2D: - return texUnit->CurrentTex[TEXTURE_2D_INDEX]; - case GL_TEXTURE_3D: - return texUnit->CurrentTex[TEXTURE_3D_INDEX]; - case GL_TEXTURE_CUBE_MAP: - if (ctx->Extensions.ARB_texture_cube_map) { - return texUnit->CurrentTex[TEXTURE_CUBE_INDEX]; - } - break; - case GL_TEXTURE_RECTANGLE_NV: - if (ctx->Extensions.NV_texture_rectangle) { - return texUnit->CurrentTex[TEXTURE_RECT_INDEX]; - } - break; - case GL_TEXTURE_1D_ARRAY_EXT: - if (ctx->Extensions.MESA_texture_array) { - return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX]; - } - break; - case GL_TEXTURE_2D_ARRAY_EXT: - if (ctx->Extensions.MESA_texture_array) { - return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX]; - } - break; - default: - ; - } - - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(target)"); - return NULL; -} - - -/** - * This is called just prior to changing any texture object state. - * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE - * state flag and then mark the texture object as 'incomplete' so that any - * per-texture derived state gets recomputed. - */ -static INLINE void -flush(GLcontext *ctx, struct gl_texture_object *texObj) -{ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->_Complete = GL_FALSE; -} - - -/** - * Set an integer-valued texture parameter - * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise - */ -static GLboolean -set_tex_parameteri(GLcontext *ctx, - struct gl_texture_object *texObj, - GLenum pname, const GLint *params) -{ - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - if (texObj->MinFilter == params[0]) - return GL_FALSE; - switch (params[0]) { - case GL_NEAREST: - case GL_LINEAR: - flush(ctx, texObj); - texObj->MinFilter = params[0]; - return GL_TRUE; - case GL_NEAREST_MIPMAP_NEAREST: - case GL_LINEAR_MIPMAP_NEAREST: - case GL_NEAREST_MIPMAP_LINEAR: - case GL_LINEAR_MIPMAP_LINEAR: - if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) { - flush(ctx, texObj); - texObj->MinFilter = params[0]; - return GL_TRUE; - } - /* fall-through */ - default: - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - } - return GL_FALSE; - - case GL_TEXTURE_MAG_FILTER: - if (texObj->MagFilter == params[0]) - return GL_FALSE; - switch (params[0]) { - case GL_NEAREST: - case GL_LINEAR: - flush(ctx, texObj); - texObj->MagFilter = params[0]; - return GL_TRUE; - default: - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - } - return GL_FALSE; - - case GL_TEXTURE_WRAP_S: - if (texObj->WrapS == params[0]) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - flush(ctx, texObj); - texObj->WrapS = params[0]; - return GL_TRUE; - } - return GL_FALSE; - - case GL_TEXTURE_WRAP_T: - if (texObj->WrapT == params[0]) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - flush(ctx, texObj); - texObj->WrapT = params[0]; - return GL_TRUE; - } - return GL_FALSE; - - case GL_TEXTURE_WRAP_R: - if (texObj->WrapR == params[0]) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { - flush(ctx, texObj); - texObj->WrapR = params[0]; - return GL_TRUE; - } - return GL_FALSE; - - case GL_TEXTURE_BASE_LEVEL: - if (texObj->BaseLevel == params[0]) - return GL_FALSE; - if (params[0] < 0 || - (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return GL_FALSE; - } - flush(ctx, texObj); - texObj->BaseLevel = params[0]; - return GL_TRUE; - - case GL_TEXTURE_MAX_LEVEL: - if (texObj->MaxLevel == params[0]) - return GL_FALSE; - if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); - return GL_FALSE; - } - flush(ctx, texObj); - texObj->MaxLevel = params[0]; - return GL_TRUE; - - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); - } - return GL_TRUE; - - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow && - (params[0] == GL_TEXTURE_LEQUAL_R_SGIX || - params[0] == GL_TEXTURE_GEQUAL_R_SGIX)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - } - return GL_TRUE; - - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - if (texObj->GenerateMipmap != params[0]) { - flush(ctx, texObj); - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; - return GL_TRUE; - } - return GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); - } - return GL_FALSE; - - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow && - (params[0] == GL_NONE || - params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) { - if (texObj->CompareMode != params[0]) { - flush(ctx, texObj); - texObj->CompareMode = params[0]; - return GL_TRUE; - } - return GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)"); - } - return GL_FALSE; - - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - if (texObj->CompareFunc == params[0]) - return GL_FALSE; - switch (params[0]) { - case GL_LEQUAL: - case GL_GEQUAL: - flush(ctx, texObj); - texObj->CompareFunc = params[0]; - return GL_TRUE; - case GL_EQUAL: - case GL_NOTEQUAL: - case GL_LESS: - case GL_GREATER: - case GL_ALWAYS: - case GL_NEVER: - if (ctx->Extensions.EXT_shadow_funcs) { - flush(ctx, texObj); - texObj->CompareFunc = params[0]; - return GL_TRUE; - } - /* fall-through */ - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_TEXTURE_COMPARE_FUNC_ARB)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); - } - return GL_FALSE; - - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture && - (params[0] == GL_LUMINANCE || - params[0] == GL_INTENSITY || - params[0] == GL_ALPHA)) { - if (texObj->DepthMode != params[0]) { - flush(ctx, texObj); - texObj->DepthMode = params[0]; - return GL_TRUE; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)"); - } - return GL_FALSE; - -#ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - texObj->CropRect[0] = params[0]; - texObj->CropRect[1] = params[1]; - texObj->CropRect[2] = params[2]; - texObj->CropRect[3] = params[3]; - return GL_TRUE; -#endif - - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); - } - return GL_FALSE; -} - - -/** - * Set a float-valued texture parameter - * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise - */ -static GLboolean -set_tex_parameterf(GLcontext *ctx, - struct gl_texture_object *texObj, - GLenum pname, const GLfloat *params) -{ - switch (pname) { - case GL_TEXTURE_MIN_LOD: - if (texObj->MinLod == params[0]) - return GL_FALSE; - flush(ctx, texObj); - texObj->MinLod = params[0]; - return GL_TRUE; - - case GL_TEXTURE_MAX_LOD: - if (texObj->MaxLod == params[0]) - return GL_FALSE; - flush(ctx, texObj); - texObj->MaxLod = params[0]; - return GL_TRUE; - - case GL_TEXTURE_PRIORITY: - flush(ctx, texObj); - texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); - return GL_TRUE; - - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - if (texObj->MaxAnisotropy == params[0]) - return GL_FALSE; - if (params[0] < 1.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return GL_FALSE; - } - flush(ctx, texObj); - /* clamp to max, that's what NVIDIA does */ - texObj->MaxAnisotropy = MIN2(params[0], - ctx->Const.MaxTextureMaxAnisotropy); - return GL_TRUE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); - } - return GL_FALSE; - - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: - if (ctx->Extensions.SGIX_shadow_ambient) { - if (texObj->ShadowAmbient != params[0]) { - flush(ctx, texObj); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); - return GL_TRUE; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); - } - return GL_FALSE; - - case GL_TEXTURE_LOD_BIAS: - /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ - if (ctx->Extensions.EXT_texture_lod_bias) { - if (texObj->LodBias != params[0]) { - flush(ctx, texObj); - texObj->LodBias = params[0]; - return GL_TRUE; - } - return GL_FALSE; - } - break; - - case GL_TEXTURE_BORDER_COLOR: - flush(ctx, texObj); - texObj->BorderColor[RCOMP] = params[0]; - texObj->BorderColor[GCOMP] = params[1]; - texObj->BorderColor[BCOMP] = params[2]; - texObj->BorderColor[ACOMP] = params[3]; - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); - return GL_TRUE; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); - } - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GLboolean need_update; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - texObj = get_texobj(ctx, target); - if (!texObj) - return; - - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - case GL_TEXTURE_WRAP_R: - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - case GL_GENERATE_MIPMAP_SGIS: - case GL_TEXTURE_COMPARE_MODE_ARB: - case GL_TEXTURE_COMPARE_FUNC_ARB: - case GL_DEPTH_TEXTURE_MODE_ARB: - { - /* convert float param to int */ - GLint p = (GLint) param; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); - } - break; - default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); - } - - if (ctx->Driver.TexParameter && need_update) { - ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m); - } -} - - -void GLAPIENTRY -_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GLboolean need_update; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - texObj = get_texobj(ctx, target); - if (!texObj) - return; - - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - case GL_TEXTURE_WRAP_R: - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - case GL_GENERATE_MIPMAP_SGIS: - case GL_TEXTURE_COMPARE_MODE_ARB: - case GL_TEXTURE_COMPARE_FUNC_ARB: - case GL_DEPTH_TEXTURE_MODE_ARB: - { - /* convert float param to int */ - GLint p = (GLint) params[0]; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); - } - break; - -#ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - { - /* convert float params to int */ - GLint iparams[4]; - iparams[0] = (GLint) params[0]; - iparams[1] = (GLint) params[1]; - iparams[2] = (GLint) params[2]; - iparams[3] = (GLint) params[3]; - need_update = set_tex_parameteri(ctx, target, iparams); - } - break; -#endif - - default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, params); - } - - if (ctx->Driver.TexParameter && need_update) { - ctx->Driver.TexParameter(ctx, target, texObj, pname, params); - } -} - - -void GLAPIENTRY -_mesa_TexParameteri(GLenum target, GLenum pname, GLint param) -{ - GLboolean need_update; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - texObj = get_texobj(ctx, target); - if (!texObj) - return; - - switch (pname) { - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { - GLfloat fparam = (GLfloat) param; - /* convert int param to float */ - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); - } - break; - default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); - } - - if (ctx->Driver.TexParameter && need_update) { - GLfloat fparam = (GLfloat) param; - ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam); - } -} - - -void GLAPIENTRY -_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GLboolean need_update; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - texObj = get_texobj(ctx, target); - if (!texObj) - return; - - switch (pname) { - case GL_TEXTURE_BORDER_COLOR: - { - /* convert int params to float */ - GLfloat fparams[4]; - fparams[0] = INT_TO_FLOAT(params[0]); - fparams[1] = INT_TO_FLOAT(params[1]); - fparams[2] = INT_TO_FLOAT(params[2]); - fparams[3] = INT_TO_FLOAT(params[3]); - need_update = set_tex_parameterf(ctx, texObj, pname, fparams); - } - break; - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { - /* convert int param to float */ - GLfloat fparam = (GLfloat) params[0]; - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); - } - break; - default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, params); - } - - if (ctx->Driver.TexParameter && need_update) { - GLfloat fparams[4]; - fparams[0] = INT_TO_FLOAT(params[0]); - if (pname == GL_TEXTURE_BORDER_COLOR || - pname == GL_TEXTURE_CROP_RECT_OES) { - fparams[1] = INT_TO_FLOAT(params[1]); - fparams[2] = INT_TO_FLOAT(params[2]); - fparams[3] = INT_TO_FLOAT(params[3]); - } - ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams); - } -} - - -void GLAPIENTRY -_mesa_GetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ) -{ - GLint iparam; - _mesa_GetTexLevelParameteriv( target, level, pname, &iparam ); - *params = (GLfloat) iparam; -} - - -static GLuint -tex_image_dimensions(GLcontext *ctx, GLenum target) -{ - switch (target) { - case GL_TEXTURE_1D: - case GL_PROXY_TEXTURE_1D: - return 1; - case GL_TEXTURE_2D: - case GL_PROXY_TEXTURE_2D: - return 2; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return 3; - case GL_TEXTURE_CUBE_MAP: - case GL_PROXY_TEXTURE_CUBE_MAP: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - return ctx->Extensions.ARB_texture_cube_map ? 2 : 0; - case GL_TEXTURE_RECTANGLE_NV: - case GL_PROXY_TEXTURE_RECTANGLE_NV: - return ctx->Extensions.NV_texture_rectangle ? 2 : 0; - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array ? 2 : 0; - case GL_TEXTURE_2D_ARRAY_EXT: - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array ? 3 : 0; - default: - _mesa_problem(ctx, "bad target in _mesa_tex_target_dimensions()"); - return 0; - } -} - - -void GLAPIENTRY -_mesa_GetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ) -{ - const struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - const struct gl_texture_image *img = NULL; - GLuint dimensions; - GLboolean isProxy; - GLint maxLevels; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameteriv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - /* this will catch bad target values */ - dimensions = tex_image_dimensions(ctx, target); /* 1, 2 or 3 */ - if (dimensions == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(target)"); - return; - } - - maxLevels = _mesa_max_texture_levels(ctx, target); - if (maxLevels == 0) { - /* should not happen since was just checked above */ - _mesa_problem(ctx, "maxLevels=0 in _mesa_GetTexLevelParameter"); - return; - } - - if (level < 0 || level >= maxLevels) { - _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" ); - return; - } - - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - - img = _mesa_select_tex_image(ctx, texObj, target, level); - if (!img || !img->TexFormat) { - /* undefined texture image */ - if (pname == GL_TEXTURE_COMPONENTS) - *params = 1; - else - *params = 0; - goto out; - } - - isProxy = _mesa_is_proxy_texture(target); - - switch (pname) { - case GL_TEXTURE_WIDTH: - *params = img->Width; - break; - case GL_TEXTURE_HEIGHT: - *params = img->Height; - break; - case GL_TEXTURE_DEPTH: - *params = img->Depth; - break; - case GL_TEXTURE_INTERNAL_FORMAT: - *params = img->InternalFormat; - break; - case GL_TEXTURE_BORDER: - *params = img->Border; - break; - case GL_TEXTURE_RED_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->RedBits; - else - *params = 0; - break; - case GL_TEXTURE_GREEN_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->GreenBits; - else - *params = 0; - break; - case GL_TEXTURE_BLUE_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->BlueBits; - else - *params = 0; - break; - case GL_TEXTURE_ALPHA_SIZE: - if (img->_BaseFormat == GL_ALPHA || - img->_BaseFormat == GL_LUMINANCE_ALPHA || - img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->AlphaBits; - else - *params = 0; - break; - case GL_TEXTURE_INTENSITY_SIZE: - if (img->_BaseFormat != GL_INTENSITY) - *params = 0; - else if (img->TexFormat->IntensityBits > 0) - *params = img->TexFormat->IntensityBits; - else /* intensity probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - break; - case GL_TEXTURE_LUMINANCE_SIZE: - if (img->_BaseFormat != GL_LUMINANCE && - img->_BaseFormat != GL_LUMINANCE_ALPHA) - *params = 0; - else if (img->TexFormat->LuminanceBits > 0) - *params = img->TexFormat->LuminanceBits; - else /* luminance probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - break; - case GL_TEXTURE_INDEX_SIZE_EXT: - if (img->_BaseFormat == GL_COLOR_INDEX) - *params = img->TexFormat->IndexBits; - else - *params = 0; - break; - case GL_TEXTURE_DEPTH_SIZE_ARB: - if (ctx->Extensions.ARB_depth_texture) - *params = img->TexFormat->DepthBits; - else - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - break; - case GL_TEXTURE_STENCIL_SIZE_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil) { - *params = img->TexFormat->StencilBits; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - /* GL_ARB_texture_compression */ - case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (ctx->Extensions.ARB_texture_compression) { - if (img->IsCompressed && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - img->TexFormat->MesaFormat); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameter[if]v(pname)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_COMPRESSED: - if (ctx->Extensions.ARB_texture_compression) { - *params = (GLint) img->IsCompressed; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - /* GL_ARB_texture_float */ - case GL_TEXTURE_RED_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->RedBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_GREEN_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_BLUE_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_ALPHA_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_LUMINANCE_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_INTENSITY_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_DEPTH_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *obj; - GLboolean error = GL_FALSE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexParameterfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - obj = _mesa_select_tex_object(ctx, texUnit, target); - if (!obj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(target)"); - return; - } - - _mesa_lock_texture(ctx, obj); - switch (pname) { - case GL_TEXTURE_MAG_FILTER: - *params = ENUM_TO_FLOAT(obj->MagFilter); - break; - case GL_TEXTURE_MIN_FILTER: - *params = ENUM_TO_FLOAT(obj->MinFilter); - break; - case GL_TEXTURE_WRAP_S: - *params = ENUM_TO_FLOAT(obj->WrapS); - break; - case GL_TEXTURE_WRAP_T: - *params = ENUM_TO_FLOAT(obj->WrapT); - break; - case GL_TEXTURE_WRAP_R: - *params = ENUM_TO_FLOAT(obj->WrapR); - break; - case GL_TEXTURE_BORDER_COLOR: - params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); - params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); - params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); - params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); - break; - case GL_TEXTURE_RESIDENT: - { - GLboolean resident; - if (ctx->Driver.IsTextureResident) - resident = ctx->Driver.IsTextureResident(ctx, obj); - else - resident = GL_TRUE; - *params = ENUM_TO_FLOAT(resident); - } - break; - case GL_TEXTURE_PRIORITY: - *params = obj->Priority; - break; - case GL_TEXTURE_MIN_LOD: - *params = obj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = obj->MaxLod; - break; - case GL_TEXTURE_BASE_LEVEL: - *params = (GLfloat) obj->BaseLevel; - break; - case GL_TEXTURE_MAX_LEVEL: - *params = (GLfloat) obj->MaxLevel; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - *params = obj->MaxAnisotropy; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareFlag; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareOperator; - } - else - error = 1; - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = obj->ShadowAmbient; - } - else - error = 1; - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLfloat) obj->GenerateMipmap; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLfloat) obj->CompareMode; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLfloat) obj->CompareFunc; - } - else - error = 1; - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - *params = (GLfloat) obj->DepthMode; - } - else - error = 1; - break; - case GL_TEXTURE_LOD_BIAS: - if (ctx->Extensions.EXT_texture_lod_bias) { - *params = obj->LodBias; - } - else - error = 1; - break; -#ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - params[0] = obj->CropRect[0]; - params[1] = obj->CropRect[1]; - params[2] = obj->CropRect[2]; - params[3] = obj->CropRect[3]; - break; -#endif - default: - error = 1; - break; - } - if (error) - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", - pname); - - _mesa_unlock_texture(ctx, obj); -} - - -void GLAPIENTRY -_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *obj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexParameteriv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - obj = _mesa_select_tex_object(ctx, texUnit, target); - if (!obj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(target)"); - return; - } - - switch (pname) { - case GL_TEXTURE_MAG_FILTER: - *params = (GLint) obj->MagFilter; - return; - case GL_TEXTURE_MIN_FILTER: - *params = (GLint) obj->MinFilter; - return; - case GL_TEXTURE_WRAP_S: - *params = (GLint) obj->WrapS; - return; - case GL_TEXTURE_WRAP_T: - *params = (GLint) obj->WrapT; - return; - case GL_TEXTURE_WRAP_R: - *params = (GLint) obj->WrapR; - return; - case GL_TEXTURE_BORDER_COLOR: - { - GLfloat b[4]; - b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); - b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); - b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); - b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); - params[0] = FLOAT_TO_INT(b[0]); - params[1] = FLOAT_TO_INT(b[1]); - params[2] = FLOAT_TO_INT(b[2]); - params[3] = FLOAT_TO_INT(b[3]); - } - return; - case GL_TEXTURE_RESIDENT: - { - GLboolean resident; - if (ctx->Driver.IsTextureResident) - resident = ctx->Driver.IsTextureResident(ctx, obj); - else - resident = GL_TRUE; - *params = (GLint) resident; - } - return; - case GL_TEXTURE_PRIORITY: - *params = FLOAT_TO_INT(obj->Priority); - return; - case GL_TEXTURE_MIN_LOD: - *params = (GLint) obj->MinLod; - return; - case GL_TEXTURE_MAX_LOD: - *params = (GLint) obj->MaxLod; - return; - case GL_TEXTURE_BASE_LEVEL: - *params = obj->BaseLevel; - return; - case GL_TEXTURE_MAX_LEVEL: - *params = obj->MaxLevel; - return; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - *params = (GLint) obj->MaxAnisotropy; - return; - } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareFlag; - return; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareOperator; - return; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); - return; - } - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLint) obj->GenerateMipmap; - return; - } - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLint) obj->CompareMode; - return; - } - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLint) obj->CompareFunc; - return; - } - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - *params = (GLint) obj->DepthMode; - return; - } - break; - case GL_TEXTURE_LOD_BIAS: - if (ctx->Extensions.EXT_texture_lod_bias) { - *params = (GLint) obj->LodBias; - return; - } - break; -#ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - params[0] = obj->CropRect[0]; - params[1] = obj->CropRect[1]; - params[2] = obj->CropRect[2]; - params[3] = obj->CropRect[3]; - break; -#endif - default: - ; /* silence warnings */ - } - /* If we get here, pname was an unrecognized enum */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname); -} diff --git a/src/libs/mesa/mesa/main/texparam.h b/src/libs/mesa/mesa/main/texparam.h deleted file mode 100644 index 454b96350e..0000000000 --- a/src/libs/mesa/mesa/main/texparam.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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 TEXPARAM_H -#define TEXPARAM_H - - -#include "main/glheader.h" - - -extern void GLAPIENTRY -_mesa_GetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); - - - -extern void GLAPIENTRY -_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); - - -extern void GLAPIENTRY -_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); - - -#endif /* TEXPARAM_H */ diff --git a/src/libs/mesa/mesa/main/texrender.c b/src/libs/mesa/mesa/main/texrender.c deleted file mode 100644 index cc74d58fbd..0000000000 --- a/src/libs/mesa/mesa/main/texrender.c +++ /dev/null @@ -1,556 +0,0 @@ - -#include "context.h" -#include "fbobject.h" -#include "texformat.h" -#include "texrender.h" -#include "renderbuffer.h" - - -/* - * Render-to-texture code for GL_EXT_framebuffer_object - */ - - -/** - * Derived from gl_renderbuffer class - */ -struct texture_renderbuffer -{ - struct gl_renderbuffer Base; /**< Base class object */ - struct gl_texture_image *TexImage; - StoreTexelFunc Store; - GLint Yoffset; /**< Layer for 1D array textures. */ - GLint Zoffset; /**< Layer for 2D array textures, or slice - * for 3D textures - */ -}; - - -/** - * Get row of values from the renderbuffer that wraps a texture image. - */ -static void -texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - ASSERT(trb->TexImage->Width == rb->Width); - ASSERT(trb->TexImage->Height == rb->Height); - - y += trb->Yoffset; - - if (rb->DataType == CHAN_TYPE) { - GLchan *rgbaOut = (GLchan *) values; - for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i); - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort *zValues = (GLushort *) values; - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); - zValues[i] = (GLushort) (flt * 0xffff); - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - GLuint *zValues = (GLuint *) values; - /* - const GLdouble scale = (GLdouble) 0xffffffff; - */ - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); -#if 0 - /* this should work, but doesn't (overflow due to low precision) */ - zValues[i] = (GLuint) (flt * scale); -#else - /* temporary hack */ - zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; -#endif - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - GLuint *zValues = (GLuint *) values; - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); - zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_get_row"); - } -} - - -static void -texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - if (rb->DataType == CHAN_TYPE) { - GLchan *rgbaOut = (GLchan *) values; - for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, rgbaOut + 4 * i); - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort *zValues = (GLushort *) values; - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, &flt); - zValues[i] = (GLushort) (flt * 0xffff); - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - GLuint *zValues = (GLuint *) values; - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, &flt); -#if 0 - zValues[i] = (GLuint) (flt * 0xffffffff); -#else - zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; -#endif - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - GLuint *zValues = (GLuint *) values; - for (i = 0; i < count; i++) { - GLfloat flt; - trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, &flt); - zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_get_values"); - } -} - - -/** - * Put row of values into a renderbuffer that wraps a texture image. - */ -static void -texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - y += trb->Yoffset; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, rgba); - } - rgba += 4; - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort *zValues = (const GLushort *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); - trb->Store(trb->TexImage, x + i, y, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); - } -} - -/** - * Put row of RGB values into a renderbuffer that wraps a texture image. - */ -static void -texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - y += trb->Yoffset; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgb = (const GLchan *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, rgb); - } - rgb += 3; - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort *zValues = (const GLushort *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); - trb->Store(trb->TexImage, x + i, y, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); - } -} - - -static void -texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - y += trb->Yoffset; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) value; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, rgba); - } - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort zValue = *((const GLushort *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint zValue = *((const GLuint *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row"); - } -} - - -static void -texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); - } - rgba += 4; - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort *zValues = (const GLushort *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint *zValues = (const GLuint *) values; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_values"); - } -} - - -static void -texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const struct texture_renderbuffer *trb - = (const struct texture_renderbuffer *) rb; - const GLint z = trb->Zoffset; - GLuint i; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) value; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint zValue = *((const GLuint *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort zValue = *((const GLushort *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values"); - } -} - - -static void -delete_texture_wrapper(struct gl_renderbuffer *rb) -{ - ASSERT(rb->RefCount == 0); - _mesa_free(rb); -} - - -/** - * This function creates a renderbuffer object which wraps a texture image. - * The new renderbuffer is plugged into the given attachment point. - * This allows rendering into the texture as if it were a renderbuffer. - */ -static void -wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) -{ - struct texture_renderbuffer *trb; - const GLuint name = 0; - - ASSERT(att->Type == GL_TEXTURE); - ASSERT(att->Renderbuffer == NULL); - - trb = CALLOC_STRUCT(texture_renderbuffer); - if (!trb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "wrap_texture"); - return; - } - - /* init base gl_renderbuffer fields */ - _mesa_init_renderbuffer(&trb->Base, name); - /* plug in our texture_renderbuffer-specific functions */ - trb->Base.Delete = delete_texture_wrapper; - trb->Base.AllocStorage = NULL; /* illegal! */ - trb->Base.GetRow = texture_get_row; - trb->Base.GetValues = texture_get_values; - trb->Base.PutRow = texture_put_row; - trb->Base.PutRowRGB = texture_put_row_rgb; - trb->Base.PutMonoRow = texture_put_mono_row; - trb->Base.PutValues = texture_put_values; - trb->Base.PutMonoValues = texture_put_mono_values; - - /* update attachment point */ - _mesa_reference_renderbuffer(&att->Renderbuffer, &(trb->Base)); -} - - - -/** - * Update the renderbuffer wrapper for rendering to a texture. - * For example, update the width, height of the RB based on the texture size, - * update the internal format info, etc. - */ -static void -update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) -{ - struct texture_renderbuffer *trb - = (struct texture_renderbuffer *) att->Renderbuffer; - - (void) ctx; - ASSERT(trb); - - trb->TexImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - ASSERT(trb->TexImage); - - trb->Store = trb->TexImage->TexFormat->StoreTexel; - ASSERT(trb->Store); - - if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) { - trb->Yoffset = att->Zoffset; - trb->Zoffset = 0; - } - else { - trb->Yoffset = 0; - trb->Zoffset = att->Zoffset; - } - - trb->Base.Width = trb->TexImage->Width; - trb->Base.Height = trb->TexImage->Height; - trb->Base.InternalFormat = trb->TexImage->InternalFormat; - /* XXX may need more special cases here */ - if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8) { - trb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z16) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; - trb->Base.DataType = GL_UNSIGNED_SHORT; - } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z32) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; - trb->Base.DataType = GL_UNSIGNED_INT; - } - else { - trb->Base._ActualFormat = trb->TexImage->InternalFormat; - trb->Base.DataType = CHAN_TYPE; - } - trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; -#if 0 - /* fix/avoid this assertion someday */ - ASSERT(trb->Base._BaseFormat == GL_RGB || - trb->Base._BaseFormat == GL_RGBA || - trb->Base._BaseFormat == GL_DEPTH_COMPONENT); -#endif - trb->Base.Data = trb->TexImage->Data; - - trb->Base.RedBits = trb->TexImage->TexFormat->RedBits; - trb->Base.GreenBits = trb->TexImage->TexFormat->GreenBits; - trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits; - trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits; - trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits; - trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits; -} - - - -/** - * Called when rendering to a texture image begins, or when changing - * the dest mipmap level, cube face, etc. - * This is a fallback routine for software render-to-texture. - * - * Called via the glRenderbufferTexture1D/2D/3D() functions - * and elsewhere (such as glTexImage2D). - * - * The image we're rendering into is - * att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - * It'll never be NULL. - * - * \param fb the framebuffer object the texture is being bound to - * \param att the fb attachment point of the texture - * - * \sa _mesa_framebuffer_renderbuffer - */ -void -_mesa_render_texture(GLcontext *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att) -{ - (void) fb; - - if (!att->Renderbuffer) { - wrap_texture(ctx, att); - } - update_wrapper(ctx, att); -} - - -void -_mesa_finish_render_texture(GLcontext *ctx, - struct gl_renderbuffer_attachment *att) -{ - /* do nothing */ - /* The renderbuffer texture wrapper will get deleted by the - * normal mechanism for deleting renderbuffers. - */ - (void) ctx; - (void) att; -} diff --git a/src/libs/mesa/mesa/main/texrender.h b/src/libs/mesa/mesa/main/texrender.h deleted file mode 100644 index 7c3fb0871b..0000000000 --- a/src/libs/mesa/mesa/main/texrender.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef TEXRENDER_H -#define TEXRENDER_H - - -extern void -_mesa_render_texture(GLcontext *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att); - -extern void -_mesa_finish_render_texture(GLcontext *ctx, - struct gl_renderbuffer_attachment *att); - - -#endif /* TEXRENDER_H */ diff --git a/src/libs/mesa/mesa/main/texstate.c b/src/libs/mesa/mesa/main/texstate.c deleted file mode 100644 index 71851e1b7b..0000000000 --- a/src/libs/mesa/mesa/main/texstate.c +++ /dev/null @@ -1,843 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file texstate.c - * - * Texture state handling. - */ - -#include "glheader.h" -#include "colormac.h" -#if FEATURE_colortable -#include "colortab.h" -#endif -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "texcompress.h" -#include "texobj.h" -#include "teximage.h" -#include "texstate.h" -#include "texenvprogram.h" -#include "mtypes.h" -#include "math/m_xform.h" - - - -/** - * Default texture combine environment state. This is used to initialize - * a context's texture units and as the basis for converting "classic" - * texture environmnets to ARB_texture_env_combine style values. - */ -static const struct gl_tex_env_combine_state default_combine_state = { - GL_MODULATE, GL_MODULATE, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA }, - { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, - 0, 0, - 2, 2 -}; - - - -/** - * Used by glXCopyContext to copy texture state from one context to another. - */ -void -_mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) -{ - GLuint i, tex; - - ASSERT(src); - ASSERT(dst); - - dst->Texture.CurrentUnit = src->Texture.CurrentUnit; - dst->Texture._GenFlags = src->Texture._GenFlags; - dst->Texture._TexGenEnabled = src->Texture._TexGenEnabled; - dst->Texture._TexMatEnabled = src->Texture._TexMatEnabled; - dst->Texture.SharedPalette = src->Texture.SharedPalette; - - /* per-unit state */ - for (i = 0; i < src->Const.MaxTextureImageUnits; i++) { - dst->Texture.Unit[i].Enabled = src->Texture.Unit[i].Enabled; - dst->Texture.Unit[i].EnvMode = src->Texture.Unit[i].EnvMode; - COPY_4V(dst->Texture.Unit[i].EnvColor, src->Texture.Unit[i].EnvColor); - dst->Texture.Unit[i].TexGenEnabled = src->Texture.Unit[i].TexGenEnabled; - dst->Texture.Unit[i].GenModeS = src->Texture.Unit[i].GenModeS; - dst->Texture.Unit[i].GenModeT = src->Texture.Unit[i].GenModeT; - dst->Texture.Unit[i].GenModeR = src->Texture.Unit[i].GenModeR; - dst->Texture.Unit[i].GenModeQ = src->Texture.Unit[i].GenModeQ; - dst->Texture.Unit[i]._GenBitS = src->Texture.Unit[i]._GenBitS; - dst->Texture.Unit[i]._GenBitT = src->Texture.Unit[i]._GenBitT; - dst->Texture.Unit[i]._GenBitR = src->Texture.Unit[i]._GenBitR; - dst->Texture.Unit[i]._GenBitQ = src->Texture.Unit[i]._GenBitQ; - dst->Texture.Unit[i]._GenFlags = src->Texture.Unit[i]._GenFlags; - COPY_4V(dst->Texture.Unit[i].ObjectPlaneS, src->Texture.Unit[i].ObjectPlaneS); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneT, src->Texture.Unit[i].ObjectPlaneT); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneR, src->Texture.Unit[i].ObjectPlaneR); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneQ, src->Texture.Unit[i].ObjectPlaneQ); - COPY_4V(dst->Texture.Unit[i].EyePlaneS, src->Texture.Unit[i].EyePlaneS); - COPY_4V(dst->Texture.Unit[i].EyePlaneT, src->Texture.Unit[i].EyePlaneT); - COPY_4V(dst->Texture.Unit[i].EyePlaneR, src->Texture.Unit[i].EyePlaneR); - COPY_4V(dst->Texture.Unit[i].EyePlaneQ, src->Texture.Unit[i].EyePlaneQ); - dst->Texture.Unit[i].LodBias = src->Texture.Unit[i].LodBias; - - /* GL_EXT_texture_env_combine */ - dst->Texture.Unit[i].Combine.ModeRGB = src->Texture.Unit[i].Combine.ModeRGB; - dst->Texture.Unit[i].Combine.ModeA = src->Texture.Unit[i].Combine.ModeA; - COPY_3V(dst->Texture.Unit[i].Combine.SourceRGB, src->Texture.Unit[i].Combine.SourceRGB); - COPY_3V(dst->Texture.Unit[i].Combine.SourceA, src->Texture.Unit[i].Combine.SourceA); - COPY_3V(dst->Texture.Unit[i].Combine.OperandRGB, src->Texture.Unit[i].Combine.OperandRGB); - COPY_3V(dst->Texture.Unit[i].Combine.OperandA, src->Texture.Unit[i].Combine.OperandA); - dst->Texture.Unit[i].Combine.ScaleShiftRGB = src->Texture.Unit[i].Combine.ScaleShiftRGB; - dst->Texture.Unit[i].Combine.ScaleShiftA = src->Texture.Unit[i].Combine.ScaleShiftA; - - /* copy texture object bindings, not contents of texture objects */ - _mesa_lock_context_textures(dst); - - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&dst->Texture.Unit[i].CurrentTex[tex], - src->Texture.Unit[i].CurrentTex[tex]); - } - - _mesa_unlock_context_textures(dst); - } -} - - -/* - * For debugging - */ -void -_mesa_print_texunit_state( GLcontext *ctx, GLuint unit ) -{ - const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit; - _mesa_printf("Texture Unit %d\n", unit); - _mesa_printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); - _mesa_printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); - _mesa_printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); - _mesa_printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); - _mesa_printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); - _mesa_printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); - _mesa_printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); - _mesa_printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); - _mesa_printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); - _mesa_printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); - _mesa_printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); - _mesa_printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); - _mesa_printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); - _mesa_printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); - _mesa_printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); - _mesa_printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); - _mesa_printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); - _mesa_printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]); -} - - - -/**********************************************************************/ -/* Texture Environment */ -/**********************************************************************/ - -/** - * Convert "classic" texture environment to ARB_texture_env_combine style - * environments. - * - * \param state texture_env_combine state vector to be filled-in. - * \param mode Classic texture environment mode (i.e., \c GL_REPLACE, - * \c GL_BLEND, \c GL_DECAL, etc.). - * \param texBaseFormat Base format of the texture associated with the - * texture unit. - */ -static void -calculate_derived_texenv( struct gl_tex_env_combine_state *state, - GLenum mode, GLenum texBaseFormat ) -{ - GLenum mode_rgb; - GLenum mode_a; - - *state = default_combine_state; - - switch (texBaseFormat) { - case GL_ALPHA: - state->SourceRGB[0] = GL_PREVIOUS; - break; - - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - case GL_RGBA: - break; - - case GL_LUMINANCE: - case GL_RGB: - case GL_YCBCR_MESA: - state->SourceA[0] = GL_PREVIOUS; - break; - - default: - _mesa_problem(NULL, "Invalid texBaseFormat in calculate_derived_texenv"); - return; - } - - if (mode == GL_REPLACE_EXT) - mode = GL_REPLACE; - - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : mode; - mode_a = mode; - break; - - case GL_DECAL: - mode_rgb = GL_INTERPOLATE; - mode_a = GL_REPLACE; - - state->SourceA[0] = GL_PREVIOUS; - - /* Having alpha / luminance / intensity textures replace using the - * incoming fragment color matches the definition in NV_texture_shader. - * The 1.5 spec simply marks these as "undefined". - */ - switch (texBaseFormat) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - state->SourceRGB[0] = GL_PREVIOUS; - break; - case GL_RGB: - case GL_YCBCR_MESA: - mode_rgb = GL_REPLACE; - break; - case GL_RGBA: - state->SourceRGB[2] = GL_TEXTURE; - break; - } - break; - - case GL_BLEND: - mode_rgb = GL_INTERPOLATE; - mode_a = GL_MODULATE; - - switch (texBaseFormat) { - case GL_ALPHA: - mode_rgb = GL_REPLACE; - break; - case GL_INTENSITY: - mode_a = GL_INTERPOLATE; - state->SourceA[0] = GL_CONSTANT; - state->OperandA[2] = GL_SRC_ALPHA; - /* FALLTHROUGH */ - case GL_LUMINANCE: - case GL_RGB: - case GL_LUMINANCE_ALPHA: - case GL_RGBA: - case GL_YCBCR_MESA: - state->SourceRGB[2] = GL_TEXTURE; - state->SourceA[2] = GL_TEXTURE; - state->SourceRGB[0] = GL_CONSTANT; - state->OperandRGB[2] = GL_SRC_COLOR; - break; - } - break; - - case GL_ADD: - mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : GL_ADD; - mode_a = (texBaseFormat == GL_INTENSITY) ? GL_ADD : GL_MODULATE; - break; - - default: - _mesa_problem(NULL, - "Invalid texture env mode in calculate_derived_texenv"); - return; - } - - state->ModeRGB = (state->SourceRGB[0] != GL_PREVIOUS) - ? mode_rgb : GL_REPLACE; - state->ModeA = (state->SourceA[0] != GL_PREVIOUS) - ? mode_a : GL_REPLACE; -} - - - - -/* GL_ARB_multitexture */ -void GLAPIENTRY -_mesa_ActiveTextureARB(GLenum texture) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint texUnit = texture - GL_TEXTURE0; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glActiveTexture %s\n", - _mesa_lookup_enum_by_nr(texture)); - - if (texUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture)"); - return; - } - - if (ctx->Texture.CurrentUnit == texUnit) - return; - - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - - ctx->Texture.CurrentUnit = texUnit; - if (ctx->Transform.MatrixMode == GL_TEXTURE) { - /* update current stack pointer */ - ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit]; - } - - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit ); - } -} - - -/* GL_ARB_multitexture */ -void GLAPIENTRY -_mesa_ClientActiveTextureARB(GLenum texture) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint texUnit = texture - GL_TEXTURE0; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (texUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_ARRAY); - ctx->Array.ActiveTexture = texUnit; -} - - - -/**********************************************************************/ -/***** State management *****/ -/**********************************************************************/ - - -/** - * \note This routine refers to derived texture attribute values to - * compute the ENABLE_TEXMAT flags, but is only called on - * _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT - * flags are updated by _mesa_update_textures(), below. - * - * \param ctx GL context. - */ -static void -update_texture_matrices( GLcontext *ctx ) -{ - GLuint i; - - ctx->Texture._TexMatEnabled = 0; - - for (i=0; i < ctx->Const.MaxTextureCoordUnits; i++) { - if (_math_matrix_is_dirty(ctx->TextureMatrixStack[i].Top)) { - _math_matrix_analyse( ctx->TextureMatrixStack[i].Top ); - - if (ctx->Texture.Unit[i]._ReallyEnabled && - ctx->TextureMatrixStack[i].Top->type != MATRIX_IDENTITY) - ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i); - - if (ctx->Driver.TextureMatrix) - ctx->Driver.TextureMatrix( ctx, i, ctx->TextureMatrixStack[i].Top); - } - } -} - - -/** - * Update texture object's _Function field. We need to do this - * whenever any of the texture object's shadow-related fields change - * or when we start/stop using a fragment program. - * - * This function could be expanded someday to update additional per-object - * fields that depend on assorted state changes. - */ -static void -update_texture_compare_function(GLcontext *ctx, - struct gl_texture_object *tObj) -{ - /* XXX temporarily disable this test since it breaks the GLSL - * shadow2D(), etc. functions. - */ - if (0 /*ctx->FragmentProgram._Current*/) { - /* Texel/coordinate comparison is ignored for programs. - * See GL_ARB_fragment_program/shader spec for details. - */ - tObj->_Function = GL_NONE; - } - else if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - tObj->_Function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - tObj->_Function = GL_GEQUAL; - } - } - else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { - /* GL_ARB_shadow */ - tObj->_Function = tObj->CompareFunc; - } - else { - tObj->_Function = GL_NONE; /* pass depth through as grayscale */ - } -} - - -/** - * Helper function for determining which texture object (1D, 2D, cube, etc) - * should actually be used. - */ -static void -texture_override(GLcontext *ctx, - struct gl_texture_unit *texUnit, GLbitfield enableBits, - struct gl_texture_object *texObj, GLuint textureBit) -{ - if (!texUnit->_ReallyEnabled && (enableBits & textureBit)) { - if (!texObj->_Complete) { - _mesa_test_texobj_completeness(ctx, texObj); - } - if (texObj->_Complete) { - texUnit->_ReallyEnabled = textureBit; - _mesa_reference_texobj(&texUnit->_Current, texObj); - update_texture_compare_function(ctx, texObj); - } - } -} - - -/** - * \note This routine refers to derived texture matrix values to - * compute the ENABLE_TEXMAT flags, but is only called on - * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT - * flags are updated by _mesa_update_texture_matrices, above. - * - * \param ctx GL context. - */ -static void -update_texture_state( GLcontext *ctx ) -{ - GLuint unit; - struct gl_fragment_program *fprog = NULL; - struct gl_vertex_program *vprog = NULL; - - if (ctx->Shader.CurrentProgram && - ctx->Shader.CurrentProgram->LinkStatus) { - fprog = ctx->Shader.CurrentProgram->FragmentProgram; - vprog = ctx->Shader.CurrentProgram->VertexProgram; - } - else { - if (ctx->FragmentProgram._Enabled) { - fprog = ctx->FragmentProgram.Current; - } - if (ctx->VertexProgram._Enabled) { - /* XXX enable this if/when non-shader vertex programs get - * texture fetches: - vprog = ctx->VertexProgram.Current; - */ - } - } - - ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are - * actual changes. - */ - - ctx->Texture._EnabledUnits = 0; - ctx->Texture._GenFlags = 0; - ctx->Texture._TexMatEnabled = 0; - ctx->Texture._TexGenEnabled = 0; - - /* - * Update texture unit state. - */ - for (unit = 0; unit < ctx->Const.MaxTextureImageUnits; unit++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLbitfield enableBits; - GLuint tex; - - texUnit->_ReallyEnabled = 0; - texUnit->_GenFlags = 0; - - /* Get the bitmask of texture target enables. - * enableBits will be a mask of the TEXTURE_*_BIT flags indicating - * which texture targets are enabled (fixed function) or referenced - * by a fragment shader/program. When multiple flags are set, we'll - * settle on the one with highest priority (see texture_override below). - */ - enableBits = 0x0; - if (vprog) { - enableBits |= vprog->Base.TexturesUsed[unit]; - } - if (fprog) { - enableBits |= fprog->Base.TexturesUsed[unit]; - } - else { - /* fixed-function fragment program */ - enableBits |= texUnit->Enabled; - } - - if (enableBits == 0x0) - continue; - - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - ASSERT(texUnit->CurrentTex[tex]); - } - - /* Look for the highest-priority texture target that's enabled and - * complete. That's the one we'll use for texturing. If we're using - * a fragment program we're guaranteed that bitcount(enabledBits) <= 1. - */ - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - /* texture indexes from highest to lowest priority */ - static const GLuint targets[NUM_TEXTURE_TARGETS] = { - TEXTURE_2D_ARRAY_INDEX, - TEXTURE_1D_ARRAY_INDEX, - TEXTURE_CUBE_INDEX, - TEXTURE_3D_INDEX, - TEXTURE_RECT_INDEX, - TEXTURE_2D_INDEX, - TEXTURE_1D_INDEX - }; - GLuint texIndex = targets[tex]; - texture_override(ctx, texUnit, enableBits, - texUnit->CurrentTex[texIndex], 1 << texIndex); - } - - if (!texUnit->_ReallyEnabled) { - continue; - } - - if (texUnit->_ReallyEnabled) - ctx->Texture._EnabledUnits |= (1 << unit); - - if (texUnit->EnvMode == GL_COMBINE) { - texUnit->_CurrentCombine = & texUnit->Combine; - } - else { - const struct gl_texture_object *texObj = texUnit->_Current; - GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; - if (format == GL_COLOR_INDEX) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT - || format == GL_DEPTH_STENCIL_EXT) { - format = texObj->DepthMode; - } - calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); - texUnit->_CurrentCombine = & texUnit->_EnvMode; - } - - switch (texUnit->_CurrentCombine->ModeRGB) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsRGB = 1; - break; - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - texUnit->_CurrentCombine->_NumArgsRGB = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsRGB = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsRGB = 0; - _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state"); - return; - } - - switch (texUnit->_CurrentCombine->ModeA) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsA = 1; - break; - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - texUnit->_CurrentCombine->_NumArgsA = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsA = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsA = 0; - _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state"); - break; - } - } - - /* Determine which texture coordinate sets are actually needed */ - if (fprog) { - const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1; - ctx->Texture._EnabledCoordUnits - = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask; - } - else { - ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits; - } - - /* Setup texgen for those texture coordinate sets that are in use */ - for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - - if (!(ctx->Texture._EnabledCoordUnits & (1 << unit))) - continue; - - if (texUnit->TexGenEnabled) { - if (texUnit->TexGenEnabled & S_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitS; - } - if (texUnit->TexGenEnabled & T_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitT; - } - if (texUnit->TexGenEnabled & Q_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitQ; - } - if (texUnit->TexGenEnabled & R_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitR; - } - - ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit); - ctx->Texture._GenFlags |= texUnit->_GenFlags; - } - - if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) - ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit); - } -} - - -/** - * Update texture-related derived state. - */ -void -_mesa_update_texture( GLcontext *ctx, GLuint new_state ) -{ - if (new_state & _NEW_TEXTURE_MATRIX) - update_texture_matrices( ctx ); - - if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM)) - update_texture_state( ctx ); -} - - -/**********************************************************************/ -/***** Initialization *****/ -/**********************************************************************/ - -/** - * Allocate the proxy textures for the given context. - * - * \param ctx the context to allocate proxies for. - * - * \return GL_TRUE on success, or GL_FALSE on failure - * - * If run out of memory part way through the allocations, clean up and return - * GL_FALSE. - */ -static GLboolean -alloc_proxy_textures( GLcontext *ctx ) -{ - static const GLenum targets[] = { - GL_TEXTURE_1D, - GL_TEXTURE_2D, - GL_TEXTURE_3D, - GL_TEXTURE_CUBE_MAP_ARB, - GL_TEXTURE_RECTANGLE_NV, - GL_TEXTURE_1D_ARRAY_EXT, - GL_TEXTURE_2D_ARRAY_EXT - }; - GLint tgt; - - ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS); - - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { - if (!(ctx->Texture.ProxyTex[tgt] - = ctx->Driver.NewTextureObject(ctx, 0, targets[tgt]))) { - /* out of memory, free what we did allocate */ - while (--tgt >= 0) { - ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); - } - return GL_FALSE; - } - } - - assert(ctx->Texture.ProxyTex[0]->RefCount == 1); /* sanity check */ - return GL_TRUE; -} - - -/** - * Initialize a texture unit. - * - * \param ctx GL context. - * \param unit texture unit number to be initialized. - */ -static void -init_texture_unit( GLcontext *ctx, GLuint unit ) -{ - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint tex; - - texUnit->EnvMode = GL_MODULATE; - ASSIGN_4V( texUnit->EnvColor, 0.0, 0.0, 0.0, 0.0 ); - - texUnit->Combine = default_combine_state; - texUnit->_EnvMode = default_combine_state; - texUnit->_CurrentCombine = & texUnit->_EnvMode; - - texUnit->TexGenEnabled = 0; - texUnit->GenModeS = GL_EYE_LINEAR; - texUnit->GenModeT = GL_EYE_LINEAR; - texUnit->GenModeR = GL_EYE_LINEAR; - texUnit->GenModeQ = GL_EYE_LINEAR; - texUnit->_GenBitS = TEXGEN_EYE_LINEAR; - texUnit->_GenBitT = TEXGEN_EYE_LINEAR; - texUnit->_GenBitR = TEXGEN_EYE_LINEAR; - texUnit->_GenBitQ = TEXGEN_EYE_LINEAR; - - /* Yes, these plane coefficients are correct! */ - ASSIGN_4V( texUnit->ObjectPlaneS, 1.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneT, 0.0, 1.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneR, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneQ, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneS, 1.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneT, 0.0, 1.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneR, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneQ, 0.0, 0.0, 0.0, 0.0 ); - - /* initialize current texture object ptrs to the shared default objects */ - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&texUnit->CurrentTex[tex], - ctx->Shared->DefaultTex[tex]); - } -} - - -/** - * Initialize texture state for the given context. - */ -GLboolean -_mesa_init_texture(GLcontext *ctx) -{ - GLuint i; - - assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS); - assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS); - - /* Texture group */ - ctx->Texture.CurrentUnit = 0; /* multitexture */ - ctx->Texture._EnabledUnits = 0; - ctx->Texture.SharedPalette = GL_FALSE; -#if FEATURE_colortable - _mesa_init_colortable(&ctx->Texture.Palette); -#endif - - for (i = 0; i < MAX_TEXTURE_UNITS; i++) - init_texture_unit( ctx, i ); - - /* After we're done initializing the context's texture state the default - * texture objects' refcounts should be at least MAX_TEXTURE_UNITS + 1. - */ - assert(ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount - >= MAX_TEXTURE_UNITS + 1); - - /* Allocate proxy textures */ - if (!alloc_proxy_textures( ctx )) - return GL_FALSE; - - return GL_TRUE; -} - - -/** - * Free dynamically-allocted texture data attached to the given context. - */ -void -_mesa_free_texture_data(GLcontext *ctx) -{ - GLuint u, tgt; - - /* unreference current textures */ - for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) { - struct gl_texture_unit *unit = ctx->Texture.Unit + u; - /* The _Current texture could account for another reference */ - _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL); - - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { - _mesa_reference_texobj(&unit->CurrentTex[tgt], NULL); - } - } - - /* Free proxy texture objects */ - for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) - ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); - -#if FEATURE_colortable - { - GLuint i; - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) - _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); - } -#endif -} - - -/** - * Update the default texture objects in the given context to reference those - * specified in the shared state and release those referencing the old - * shared state. - */ -void -_mesa_update_default_objects_texture(GLcontext *ctx) -{ - GLuint i, tex; - - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&texUnit->CurrentTex[tex], - ctx->Shared->DefaultTex[tex]); - } - } -} diff --git a/src/libs/mesa/mesa/main/texstate.h b/src/libs/mesa/mesa/main/texstate.h deleted file mode 100644 index a7d7088c62..0000000000 --- a/src/libs/mesa/mesa/main/texstate.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * \file texstate.h - * Texture state management. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 TEXSTATE_H -#define TEXSTATE_H - - -#include "mtypes.h" - - -extern void -_mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ); - -extern void -_mesa_print_texunit_state( GLcontext *ctx, GLuint unit ); - - - -/** - * \name Called from API - */ -/*@{*/ - - -/* - * GL_ARB_multitexture - */ -extern void GLAPIENTRY -_mesa_ActiveTextureARB( GLenum target ); - -extern void GLAPIENTRY -_mesa_ClientActiveTextureARB( GLenum target ); - - -/** - * \name Initialization, state maintenance - */ -/*@{*/ - -extern void -_mesa_update_texture( GLcontext *ctx, GLuint new_state ); - -extern GLboolean -_mesa_init_texture( GLcontext *ctx ); - -extern void -_mesa_free_texture_data( GLcontext *ctx ); - -extern void -_mesa_update_default_objects_texture(GLcontext *ctx); - -/*@}*/ - -#endif diff --git a/src/libs/mesa/mesa/main/texstore.c b/src/libs/mesa/mesa/main/texstore.c deleted file mode 100644 index 67cfca2565..0000000000 --- a/src/libs/mesa/mesa/main/texstore.c +++ /dev/null @@ -1,3924 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/* - * Authors: - * Brian Paul - */ - -/** - * The GL texture image functions in teximage.c basically just do - * error checking and data structure allocation. They in turn call - * device driver functions which actually copy/convert/store the user's - * texture image data. - * - * However, most device drivers will be able to use the fallback functions - * in this file. That is, most drivers will have the following bit of - * code: - * ctx->Driver.TexImage1D = _mesa_store_teximage1d; - * ctx->Driver.TexImage2D = _mesa_store_teximage2d; - * ctx->Driver.TexImage3D = _mesa_store_teximage3d; - * etc... - * - * Texture image processing is actually kind of complicated. We have to do: - * Format/type conversions - * pixel unpacking - * pixel transfer (scale, bais, lookup, convolution!, etc) - * - * These functions can handle most everything, including processing full - * images and sub-images. - */ - - -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "context.h" -#if FEATURE_convolve -#include "convolve.h" -#endif -#include "image.h" -#include "macros.h" -#include "mipmap.h" -#include "imports.h" -#include "texcompress.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "enums.h" - - -enum { - ZERO = 4, - ONE = 5 -}; - - -/** - * Return GL_TRUE if the given image format is one that be converted - * to another format by swizzling. - */ -static GLboolean -can_swizzle(GLenum logicalBaseFormat) -{ - switch (logicalBaseFormat) { - case GL_RGBA: - case GL_RGB: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_BGR: - case GL_BGRA: - case GL_ABGR_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - - -enum { - IDX_LUMINANCE = 0, - IDX_ALPHA, - IDX_INTENSITY, - IDX_LUMINANCE_ALPHA, - IDX_RGB, - IDX_RGBA, - IDX_RED, - IDX_GREEN, - IDX_BLUE, - IDX_BGR, - IDX_BGRA, - IDX_ABGR, - MAX_IDX -}; - -#define MAP1(x) MAP4(x, ZERO, ZERO, ZERO) -#define MAP2(x,y) MAP4(x, y, ZERO, ZERO) -#define MAP3(x,y,z) MAP4(x, y, z, ZERO) -#define MAP4(x,y,z,w) { x, y, z, w, ZERO, ONE } - - -static const struct { - GLubyte format_idx; - GLubyte to_rgba[6]; - GLubyte from_rgba[6]; -} mappings[MAX_IDX] = -{ - { - IDX_LUMINANCE, - MAP4(0,0,0,ONE), - MAP1(0) - }, - - { - IDX_ALPHA, - MAP4(ZERO, ZERO, ZERO, 0), - MAP1(3) - }, - - { - IDX_INTENSITY, - MAP4(0, 0, 0, 0), - MAP1(0), - }, - - { - IDX_LUMINANCE_ALPHA, - MAP4(0,0,0,1), - MAP2(0,3) - }, - - { - IDX_RGB, - MAP4(0,1,2,ONE), - MAP3(0,1,2) - }, - - { - IDX_RGBA, - MAP4(0,1,2,3), - MAP4(0,1,2,3), - }, - - - { - IDX_RED, - MAP4(0, ZERO, ZERO, ONE), - MAP1(0), - }, - - { - IDX_GREEN, - MAP4(ZERO, 0, ZERO, ONE), - MAP1(1), - }, - - { - IDX_BLUE, - MAP4(ZERO, ZERO, 0, ONE), - MAP1(2), - }, - - { - IDX_BGR, - MAP4(2,1,0,ONE), - MAP3(2,1,0) - }, - - { - IDX_BGRA, - MAP4(2,1,0,3), - MAP4(2,1,0,3) - }, - - { - IDX_ABGR, - MAP4(3,2,1,0), - MAP4(3,2,1,0) - }, -}; - - - -/** - * Convert a GL image format enum to an IDX_* value (see above). - */ -static int -get_map_idx(GLenum value) -{ - switch (value) { - case GL_LUMINANCE: return IDX_LUMINANCE; - case GL_ALPHA: return IDX_ALPHA; - case GL_INTENSITY: return IDX_INTENSITY; - case GL_LUMINANCE_ALPHA: return IDX_LUMINANCE_ALPHA; - case GL_RGB: return IDX_RGB; - case GL_RGBA: return IDX_RGBA; - case GL_RED: return IDX_RED; - case GL_GREEN: return IDX_GREEN; - case GL_BLUE: return IDX_BLUE; - case GL_BGR: return IDX_BGR; - case GL_BGRA: return IDX_BGRA; - case GL_ABGR_EXT: return IDX_ABGR; - default: - _mesa_problem(NULL, "Unexpected inFormat"); - return 0; - } -} - - -/** - * When promoting texture formats (see below) we need to compute the - * mapping of dest components back to source components. - * This function does that. - * \param inFormat the incoming format of the texture - * \param outFormat the final texture format - * \return map[6] a full 6-component map - */ -static void -compute_component_mapping(GLenum inFormat, GLenum outFormat, - GLubyte *map) -{ - const int inFmt = get_map_idx(inFormat); - const int outFmt = get_map_idx(outFormat); - const GLubyte *in2rgba = mappings[inFmt].to_rgba; - const GLubyte *rgba2out = mappings[outFmt].from_rgba; - int i; - - for (i = 0; i < 4; i++) - map[i] = in2rgba[rgba2out[i]]; - - map[ZERO] = ZERO; - map[ONE] = ONE; - -/* - _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", - inFormat, _mesa_lookup_enum_by_nr(inFormat), - outFormat, _mesa_lookup_enum_by_nr(outFormat), - map[0], - map[1], - map[2], - map[3], - map[4], - map[5]); -*/ -} - - -#if !FEATURE_convolve -static void -_mesa_adjust_image_for_convolution(GLcontext *ctx, GLuint dims, - GLsizei *srcWidth, GLsizei *srcHeight) -{ - /* no-op */ -} -#endif - - -/** - * Make a temporary (color) texture image with GLfloat components. - * Apply all needed pixel unpacking and pixel transfer operations. - * Note that there are both logicalBaseFormat and textureBaseFormat parameters. - * Suppose the user specifies GL_LUMINANCE as the internal texture format - * but the graphics hardware doesn't support luminance textures. So, might - * use an RGB hardware format instead. - * If logicalBaseFormat != textureBaseFormat we have some extra work to do. - * - * \param ctx the rendering context - * \param dims image dimensions: 1, 2 or 3 - * \param logicalBaseFormat basic texture derived from the user's - * internal texture format value - * \param textureBaseFormat the actual basic format of the texture - * \param srcWidth source image width - * \param srcHeight source image height - * \param srcDepth source image depth - * \param srcFormat source image format - * \param srcType source image type - * \param srcAddr source image address - * \param srcPacking source image pixel packing - * \return resulting image with format = textureBaseFormat and type = GLfloat. - */ -static GLfloat * -make_temp_float_image(GLcontext *ctx, GLuint dims, - GLenum logicalBaseFormat, - GLenum textureBaseFormat, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLenum srcFormat, GLenum srcType, - const GLvoid *srcAddr, - const struct gl_pixelstore_attrib *srcPacking) -{ - GLuint transferOps = ctx->_ImageTransferState; - GLfloat *tempImage; - - ASSERT(dims >= 1 && dims <= 3); - - ASSERT(logicalBaseFormat == GL_RGBA || - logicalBaseFormat == GL_RGB || - logicalBaseFormat == GL_LUMINANCE_ALPHA || - logicalBaseFormat == GL_LUMINANCE || - logicalBaseFormat == GL_ALPHA || - logicalBaseFormat == GL_INTENSITY || - logicalBaseFormat == GL_COLOR_INDEX || - logicalBaseFormat == GL_DEPTH_COMPONENT); - - ASSERT(textureBaseFormat == GL_RGBA || - textureBaseFormat == GL_RGB || - textureBaseFormat == GL_LUMINANCE_ALPHA || - textureBaseFormat == GL_LUMINANCE || - textureBaseFormat == GL_ALPHA || - textureBaseFormat == GL_INTENSITY || - textureBaseFormat == GL_COLOR_INDEX || - textureBaseFormat == GL_DEPTH_COMPONENT); - - /* conventional color image */ - - if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || - (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || - (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { - /* need image convolution */ - const GLuint preConvTransferOps - = (transferOps & IMAGE_PRE_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; - const GLuint postConvTransferOps - = (transferOps & IMAGE_POST_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; - GLint img, row; - GLint convWidth, convHeight; - GLfloat *convImage; - - /* pre-convolution image buffer (3D) */ - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth - * 4 * sizeof(GLfloat)); - if (!tempImage) - return NULL; - - /* post-convolution image buffer (2D) */ - convImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight - * 4 * sizeof(GLfloat)); - if (!convImage) { - _mesa_free(tempImage); - return NULL; - } - - /* loop over 3D image slices */ - for (img = 0; img < srcDepth; img++) { - GLfloat *dst = tempImage + img * (srcWidth * srcHeight * 4); - - /* unpack and do transfer ops up to convolution */ - for (row = 0; row < srcHeight; row++) { - const GLvoid *src = _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, - srcFormat, srcType, img, row, 0); - _mesa_unpack_color_span_float(ctx, srcWidth, GL_RGBA, dst, - srcFormat, srcType, src, - srcPacking, - preConvTransferOps); - dst += srcWidth * 4; - } - - /* size after optional convolution */ - convWidth = srcWidth; - convHeight = srcHeight; - -#if FEATURE_convolve - /* do convolution */ - { - GLfloat *src = tempImage + img * (srcWidth * srcHeight * 4); - if (dims == 1) { - ASSERT(ctx->Pixel.Convolution1DEnabled); - _mesa_convolve_1d_image(ctx, &convWidth, src, convImage); - } - else { - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &convWidth, &convHeight, - src, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &convWidth, &convHeight, - src, convImage); - } - } - } -#endif - /* do post-convolution transfer and pack into tempImage */ - { - const GLint logComponents - = _mesa_components_in_format(logicalBaseFormat); - const GLfloat *src = convImage; - GLfloat *dst = tempImage + img * (convWidth * convHeight * 4); - for (row = 0; row < convHeight; row++) { - _mesa_pack_rgba_span_float(ctx, convWidth, - (GLfloat (*)[4]) src, - logicalBaseFormat, GL_FLOAT, - dst, &ctx->DefaultPacking, - postConvTransferOps); - src += convWidth * 4; - dst += convWidth * logComponents; - } - } - } /* loop over 3D image slices */ - - _mesa_free(convImage); - - /* might need these below */ - srcWidth = convWidth; - srcHeight = convHeight; - } - else { - /* no convolution */ - const GLint components = _mesa_components_in_format(logicalBaseFormat); - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLfloat *dst; - GLint img, row; - - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth - * components * sizeof(GLfloat)); - if (!tempImage) - return NULL; - - dst = tempImage; - for (img = 0; img < srcDepth; img++) { - const GLubyte *src - = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - _mesa_unpack_color_span_float(ctx, srcWidth, logicalBaseFormat, - dst, srcFormat, srcType, src, - srcPacking, transferOps); - dst += srcWidth * components; - src += srcStride; - } - } - } - - if (logicalBaseFormat != textureBaseFormat) { - /* more work */ - GLint texComponents = _mesa_components_in_format(textureBaseFormat); - GLint logComponents = _mesa_components_in_format(logicalBaseFormat); - GLfloat *newImage; - GLint i, n; - GLubyte map[6]; - - /* we only promote up to RGB, RGBA and LUMINANCE_ALPHA formats for now */ - ASSERT(textureBaseFormat == GL_RGB || textureBaseFormat == GL_RGBA || - textureBaseFormat == GL_LUMINANCE_ALPHA); - - /* The actual texture format should have at least as many components - * as the logical texture format. - */ - ASSERT(texComponents >= logComponents); - - newImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth - * texComponents * sizeof(GLfloat)); - if (!newImage) { - _mesa_free(tempImage); - return NULL; - } - - compute_component_mapping(logicalBaseFormat, textureBaseFormat, map); - - n = srcWidth * srcHeight * srcDepth; - for (i = 0; i < n; i++) { - GLint k; - for (k = 0; k < texComponents; k++) { - GLint j = map[k]; - if (j == ZERO) - newImage[i * texComponents + k] = 0.0F; - else if (j == ONE) - newImage[i * texComponents + k] = 1.0F; - else - newImage[i * texComponents + k] = tempImage[i * logComponents + j]; - } - } - - _mesa_free(tempImage); - tempImage = newImage; - } - - return tempImage; -} - - -/** - * Make a temporary (color) texture image with GLchan components. - * Apply all needed pixel unpacking and pixel transfer operations. - * Note that there are both logicalBaseFormat and textureBaseFormat parameters. - * Suppose the user specifies GL_LUMINANCE as the internal texture format - * but the graphics hardware doesn't support luminance textures. So, might - * use an RGB hardware format instead. - * If logicalBaseFormat != textureBaseFormat we have some extra work to do. - * - * \param ctx the rendering context - * \param dims image dimensions: 1, 2 or 3 - * \param logicalBaseFormat basic texture derived from the user's - * internal texture format value - * \param textureBaseFormat the actual basic format of the texture - * \param srcWidth source image width - * \param srcHeight source image height - * \param srcDepth source image depth - * \param srcFormat source image format - * \param srcType source image type - * \param srcAddr source image address - * \param srcPacking source image pixel packing - * \return resulting image with format = textureBaseFormat and type = GLchan. - */ -GLchan * -_mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, - GLenum logicalBaseFormat, - GLenum textureBaseFormat, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLenum srcFormat, GLenum srcType, - const GLvoid *srcAddr, - const struct gl_pixelstore_attrib *srcPacking) -{ - GLuint transferOps = ctx->_ImageTransferState; - const GLint components = _mesa_components_in_format(logicalBaseFormat); - GLboolean freeSrcImage = GL_FALSE; - GLint img, row; - GLchan *tempImage, *dst; - - ASSERT(dims >= 1 && dims <= 3); - - ASSERT(logicalBaseFormat == GL_RGBA || - logicalBaseFormat == GL_RGB || - logicalBaseFormat == GL_LUMINANCE_ALPHA || - logicalBaseFormat == GL_LUMINANCE || - logicalBaseFormat == GL_ALPHA || - logicalBaseFormat == GL_INTENSITY); - - ASSERT(textureBaseFormat == GL_RGBA || - textureBaseFormat == GL_RGB || - textureBaseFormat == GL_LUMINANCE_ALPHA || - textureBaseFormat == GL_LUMINANCE || - textureBaseFormat == GL_ALPHA || - textureBaseFormat == GL_INTENSITY); - -#if FEATURE_convolve - if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || - (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || - (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { - /* get convolved image */ - GLfloat *convImage = make_temp_float_image(ctx, dims, - logicalBaseFormat, - logicalBaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - if (!convImage) - return NULL; - /* the convolved image is our new source image */ - srcAddr = convImage; - srcFormat = logicalBaseFormat; - srcType = GL_FLOAT; - srcPacking = &ctx->DefaultPacking; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - transferOps = 0; - freeSrcImage = GL_TRUE; - } -#endif - - /* unpack and transfer the source image */ - tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth - * components * sizeof(GLchan)); - if (!tempImage) - return NULL; - - dst = tempImage; - for (img = 0; img < srcDepth; img++) { - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, - srcType); - const GLubyte *src - = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat, dst, - srcFormat, srcType, src, srcPacking, - transferOps); - dst += srcWidth * components; - src += srcStride; - } - } - - /* If we made a temporary image for convolution, free it here */ - if (freeSrcImage) { - _mesa_free((void *) srcAddr); - } - - if (logicalBaseFormat != textureBaseFormat) { - /* one more conversion step */ - GLint texComponents = _mesa_components_in_format(textureBaseFormat); - GLint logComponents = _mesa_components_in_format(logicalBaseFormat); - GLchan *newImage; - GLint i, n; - GLubyte map[6]; - - /* we only promote up to RGB, RGBA and LUMINANCE_ALPHA formats for now */ - ASSERT(textureBaseFormat == GL_RGB || textureBaseFormat == GL_RGBA || - textureBaseFormat == GL_LUMINANCE_ALPHA); - - /* The actual texture format should have at least as many components - * as the logical texture format. - */ - ASSERT(texComponents >= logComponents); - - newImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth - * texComponents * sizeof(GLchan)); - if (!newImage) { - _mesa_free(tempImage); - return NULL; - } - - compute_component_mapping(logicalBaseFormat, textureBaseFormat, map); - - n = srcWidth * srcHeight * srcDepth; - for (i = 0; i < n; i++) { - GLint k; - for (k = 0; k < texComponents; k++) { - GLint j = map[k]; - if (j == ZERO) - newImage[i * texComponents + k] = 0; - else if (j == ONE) - newImage[i * texComponents + k] = CHAN_MAX; - else - newImage[i * texComponents + k] = tempImage[i * logComponents + j]; - } - } - - _mesa_free(tempImage); - tempImage = newImage; - } - - return tempImage; -} - - -/** - * Copy GLubyte pixels from to with swizzling. - * \param dst destination pixels - * \param dstComponents number of color components in destination pixels - * \param src source pixels - * \param srcComponents number of color components in source pixels - * \param map the swizzle mapping. map[X] says where to find the X component - * in the source image's pixels. For example, if the source image - * is GL_BGRA and X = red, map[0] yields 2. - * \param count number of pixels to copy/swizzle. - */ -static void -swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, - GLuint srcComponents, const GLubyte *map, GLuint count) -{ -#define SWZ_CPY(dst, src, count, dstComps, srcComps) \ - do { \ - GLuint i; \ - for (i = 0; i < count; i++) { \ - GLuint j; \ - if (srcComps == 4) { \ - COPY_4UBV(tmp, src); \ - } \ - else { \ - for (j = 0; j < srcComps; j++) { \ - tmp[j] = src[j]; \ - } \ - } \ - src += srcComps; \ - for (j = 0; j < dstComps; j++) { \ - dst[j] = tmp[map[j]]; \ - } \ - dst += dstComps; \ - } \ - } while (0) - - GLubyte tmp[6]; - - tmp[ZERO] = 0x0; - tmp[ONE] = 0xff; - - ASSERT(srcComponents <= 4); - ASSERT(dstComponents <= 4); - - switch (dstComponents) { - case 4: - switch (srcComponents) { - case 4: - SWZ_CPY(dst, src, count, 4, 4); - break; - case 3: - SWZ_CPY(dst, src, count, 4, 3); - break; - case 2: - SWZ_CPY(dst, src, count, 4, 2); - break; - case 1: - SWZ_CPY(dst, src, count, 4, 1); - break; - default: - ; - } - break; - case 3: - switch (srcComponents) { - case 4: - SWZ_CPY(dst, src, count, 3, 4); - break; - case 3: - SWZ_CPY(dst, src, count, 3, 3); - break; - case 2: - SWZ_CPY(dst, src, count, 3, 2); - break; - case 1: - SWZ_CPY(dst, src, count, 3, 1); - break; - default: - ; - } - break; - case 2: - switch (srcComponents) { - case 4: - SWZ_CPY(dst, src, count, 2, 4); - break; - case 3: - SWZ_CPY(dst, src, count, 2, 3); - break; - case 2: - SWZ_CPY(dst, src, count, 2, 2); - break; - case 1: - SWZ_CPY(dst, src, count, 2, 1); - break; - default: - ; - } - break; - case 1: - switch (srcComponents) { - case 4: - SWZ_CPY(dst, src, count, 1, 4); - break; - case 3: - SWZ_CPY(dst, src, count, 1, 3); - break; - case 2: - SWZ_CPY(dst, src, count, 1, 2); - break; - case 1: - SWZ_CPY(dst, src, count, 1, 1); - break; - default: - ; - } - break; - default: - ; - } -#undef SWZ_CPY -} - - - -static const GLubyte map_identity[6] = { 0, 1, 2, 3, ZERO, ONE }; -static const GLubyte map_3210[6] = { 3, 2, 1, 0, ZERO, ONE }; - -/* Deal with the _REV input types: - */ -static const GLubyte * -type_mapping( GLenum srcType ) -{ - switch (srcType) { - case GL_UNSIGNED_BYTE: - return map_identity; - case GL_UNSIGNED_INT_8_8_8_8: - return _mesa_little_endian() ? map_3210 : map_identity; - case GL_UNSIGNED_INT_8_8_8_8_REV: - return _mesa_little_endian() ? map_identity : map_3210; - default: - return NULL; - } -} - -/* Mapping required if input type is - */ -static const GLubyte * -byteswap_mapping( GLboolean swapBytes, - GLenum srcType ) -{ - if (!swapBytes) - return map_identity; - - switch (srcType) { - case GL_UNSIGNED_BYTE: - return map_identity; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - return map_3210; - default: - return NULL; - } -} - - - -/** - * Transfer a GLubyte texture image with component swizzling. - */ -static void -_mesa_swizzle_ubyte_image(GLcontext *ctx, - GLuint dimensions, - GLenum srcFormat, - GLenum srcType, - - GLenum baseInternalFormat, - - const GLubyte *rgba2dst, - GLuint dstComponents, - - GLvoid *dstAddr, - GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, - GLint dstRowStride, - const GLuint *dstImageOffsets, - - GLint srcWidth, GLint srcHeight, GLint srcDepth, - const GLvoid *srcAddr, - const struct gl_pixelstore_attrib *srcPacking ) -{ - GLint srcComponents = _mesa_components_in_format(srcFormat); - const GLubyte *srctype2ubyte, *swap; - GLubyte map[4], src2base[6], base2rgba[6]; - GLint i; - const GLint srcRowStride = - _mesa_image_row_stride(srcPacking, srcWidth, - srcFormat, GL_UNSIGNED_BYTE); - const GLint srcImageStride - = _mesa_image_image_stride(srcPacking, srcWidth, srcHeight, srcFormat, - GL_UNSIGNED_BYTE); - const GLubyte *srcImage - = (const GLubyte *) _mesa_image_address(dimensions, srcPacking, srcAddr, - srcWidth, srcHeight, srcFormat, - GL_UNSIGNED_BYTE, 0, 0, 0); - - (void) ctx; - - /* Translate from src->baseInternal->GL_RGBA->dst. This will - * correctly deal with RGBA->RGB->RGBA conversions where the final - * A value must be 0xff regardless of the incoming alpha values. - */ - compute_component_mapping(srcFormat, baseInternalFormat, src2base); - compute_component_mapping(baseInternalFormat, GL_RGBA, base2rgba); - swap = byteswap_mapping(srcPacking->SwapBytes, srcType); - srctype2ubyte = type_mapping(srcType); - - - for (i = 0; i < 4; i++) - map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]]; - -/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ - - if (srcRowStride == dstRowStride && - srcComponents == dstComponents && - srcRowStride == srcWidth * srcComponents && - dimensions < 3) { - /* 1 and 2D images only */ - GLubyte *dstImage = (GLubyte *) dstAddr - + dstYoffset * dstRowStride - + dstXoffset * dstComponents; - swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map, - srcWidth * srcHeight); - } - else { - GLint img, row; - for (img = 0; img < srcDepth; img++) { - const GLubyte *srcRow = srcImage; - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstComponents - + dstYoffset * dstRowStride - + dstXoffset * dstComponents; - for (row = 0; row < srcHeight; row++) { - swizzle_copy(dstRow, dstComponents, srcRow, srcComponents, map, srcWidth); - dstRow += dstRowStride; - srcRow += srcRowStride; - } - srcImage += srcImageStride; - } - } -} - - -/** - * Teximage storage routine for when a simple memcpy will do. - * No pixel transfer operations or special texel encodings allowed. - * 1D, 2D and 3D images supported. - */ -static void -memcpy_texture(GLcontext *ctx, - GLuint dimensions, - const struct gl_texture_format *dstFormat, - GLvoid *dstAddr, - GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, - GLint dstRowStride, - const GLuint *dstImageOffsets, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLenum srcFormat, GLenum srcType, - const GLvoid *srcAddr, - const struct gl_pixelstore_attrib *srcPacking) -{ - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, - srcFormat, srcType); - const GLint srcImageStride = _mesa_image_image_stride(srcPacking, - srcWidth, srcHeight, srcFormat, srcType); - const GLubyte *srcImage = (const GLubyte *) _mesa_image_address(dimensions, - srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); - const GLint bytesPerRow = srcWidth * dstFormat->TexelBytes; - -#if 0 - /* XXX update/re-enable for dstImageOffsets array */ - const GLint bytesPerImage = srcHeight * bytesPerRow; - const GLint bytesPerTexture = srcDepth * bytesPerImage; - GLubyte *dstImage = (GLubyte *) dstAddr - + dstZoffset * dstImageStride - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - - if (dstRowStride == srcRowStride && - dstRowStride == bytesPerRow && - ((dstImageStride == srcImageStride && - dstImageStride == bytesPerImage) || - (srcDepth == 1))) { - /* one big memcpy */ - ctx->Driver.TextureMemCpy(dstImage, srcImage, bytesPerTexture); - } - else - { - GLint img, row; - for (img = 0; img < srcDepth; img++) { - const GLubyte *srcRow = srcImage; - GLubyte *dstRow = dstImage; - for (row = 0; row < srcHeight; row++) { - ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow); - dstRow += dstRowStride; - srcRow += srcRowStride; - } - srcImage += srcImageStride; - dstImage += dstImageStride; - } - } -#endif - - GLint img, row; - for (img = 0; img < srcDepth; img++) { - const GLubyte *srcRow = srcImage; - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow); - dstRow += dstRowStride; - srcRow += srcRowStride; - } - srcImage += srcImageStride; - } -} - - - -/** - * Store an image in any of the formats: - * _mesa_texformat_rgba - * _mesa_texformat_rgb - * _mesa_texformat_alpha - * _mesa_texformat_luminance - * _mesa_texformat_luminance_alpha - * _mesa_texformat_intensity - * - */ -GLboolean -_mesa_texstore_rgba(TEXSTORE_PARAMS) -{ - const GLint components = _mesa_components_in_format(baseInternalFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba || - dstFormat == &_mesa_texformat_rgb || - dstFormat == &_mesa_texformat_alpha || - dstFormat == &_mesa_texformat_luminance || - dstFormat == &_mesa_texformat_luminance_alpha || - dstFormat == &_mesa_texformat_intensity); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLchan)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == CHAN_TYPE) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb && - srcFormat == GL_RGBA && - srcType == CHAN_TYPE) { - /* extract RGB from RGBA */ - GLint img, row, col; - for (img = 0; img < srcDepth; img++) { - GLchan *dstImage = (GLchan *) - ((GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes); - - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLchan *srcRow = (GLchan *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLchan *dstRow = dstImage; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + RCOMP] = srcRow[col * 4 + RCOMP]; - dstRow[col * 3 + GCOMP] = srcRow[col * 4 + GCOMP]; - dstRow[col * 3 + BCOMP] = srcRow[col * 4 + BCOMP]; - } - dstRow += dstRowStride / sizeof(GLchan); - srcRow = (GLchan *) ((GLubyte *) srcRow + srcRowStride); - } - } - } - else if (!ctx->_ImageTransferState && - CHAN_TYPE == GL_UNSIGNED_BYTE && - (srcType == GL_UNSIGNED_BYTE || - srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - const GLubyte *dstmap; - GLuint components; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if (dstFormat == &_mesa_texformat_rgba) { - dstmap = mappings[IDX_RGBA].from_rgba; - components = 4; - } - else if (dstFormat == &_mesa_texformat_rgb) { - dstmap = mappings[IDX_RGB].from_rgba; - components = 3; - } - else if (dstFormat == &_mesa_texformat_alpha) { - dstmap = mappings[IDX_ALPHA].from_rgba; - components = 1; - } - else if (dstFormat == &_mesa_texformat_luminance) { - dstmap = mappings[IDX_LUMINANCE].from_rgba; - components = 1; - } - else if (dstFormat == &_mesa_texformat_luminance_alpha) { - dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba; - components = 2; - } - else if (dstFormat == &_mesa_texformat_intensity) { - dstmap = mappings[IDX_INTENSITY].from_rgba; - components = 1; - } - else { - _mesa_problem(ctx, "Unexpected dstFormat in _mesa_texstore_rgba"); - return GL_FALSE; - } - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, components, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint bytesPerRow; - GLint img, row; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - bytesPerRow = srcWidth * components * sizeof(GLchan); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, src, bytesPerRow); - dstRow += dstRowStride; - src += srcWidth * components; - } - } - - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -/** - * Store a 32-bit integer depth component texture image. - */ -GLboolean -_mesa_texstore_z32(TEXSTORE_PARAMS) -{ - const GLuint depthScale = 0xffffffff; - (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z32); - ASSERT(dstFormat->TexelBytes == sizeof(GLuint)); - - if (ctx->Pixel.DepthScale == 1.0f && - ctx->Pixel.DepthBias == 0.0f && - !srcPacking->SwapBytes && - baseInternalFormat == GL_DEPTH_COMPONENT && - srcFormat == GL_DEPTH_COMPONENT && - srcType == GL_UNSIGNED_INT) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - GLint img, row; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - const GLvoid *src = _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); - _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_INT, (GLuint *) dstRow, - depthScale, srcType, src, srcPacking); - dstRow += dstRowStride; - } - } - } - return GL_TRUE; -} - -#define STRIDE_3D 0 - -/** - * Store a 16-bit integer depth component texture image. - */ -GLboolean -_mesa_texstore_z16(TEXSTORE_PARAMS) -{ - const GLuint depthScale = 0xffff; - (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z16); - ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); - - if (ctx->Pixel.DepthScale == 1.0f && - ctx->Pixel.DepthBias == 0.0f && - !srcPacking->SwapBytes && - baseInternalFormat == GL_DEPTH_COMPONENT && - srcFormat == GL_DEPTH_COMPONENT && - srcType == GL_UNSIGNED_SHORT) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - GLint img, row; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - const GLvoid *src = _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); - GLushort *dst16 = (GLushort *) dstRow; - _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_SHORT, dst16, depthScale, - srcType, src, srcPacking); - dstRow += dstRowStride; - } - } - } - return GL_TRUE; -} - - -/** - * Store an rgb565 or rgb565_rev texture image. - */ -GLboolean -_mesa_texstore_rgb565(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_rgb565 || - dstFormat == &_mesa_texformat_rgb565_rev); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb565 && - baseInternalFormat == GL_RGB && - srcFormat == GL_RGB && - srcType == GL_UNSIGNED_SHORT_5_6_5) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == GL_RGB && - srcFormat == GL_RGB && - srcType == GL_UNSIGNED_BYTE && - dims == 2) { - /* do optimized tex store */ - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, - srcFormat, srcType); - const GLubyte *src = (const GLubyte *) - _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, - srcFormat, srcType, 0, 0, 0); - GLubyte *dst = (GLubyte *) dstAddr - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - GLint row, col; - for (row = 0; row < srcHeight; row++) { - const GLubyte *srcUB = (const GLubyte *) src; - GLushort *dstUS = (GLushort *) dst; - /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_565( srcUB[0], srcUB[1], srcUB[2] ); - srcUB += 3; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_565_REV( srcUB[0], srcUB[1], srcUB[2] ); - srcUB += 3; - } - } - dst += dstRowStride; - src += srcRowStride; - } - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_565( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 3; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_565_REV( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 3; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -/** - * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV. - */ -GLboolean -_mesa_texstore_rgba8888(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - - ASSERT(dstFormat == &_mesa_texformat_rgba8888 || - dstFormat == &_mesa_texformat_rgba8888_rev); - ASSERT(dstFormat->TexelBytes == 4); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888 && - baseInternalFormat == GL_RGBA && - ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || - (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || - (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || - (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian))) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888_rev && - baseInternalFormat == GL_RGBA && - ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || - (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || - (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) || - (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian))) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - (srcType == GL_UNSIGNED_BYTE || - srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) || - (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) { - dstmap[3] = 0; - dstmap[2] = 1; - dstmap[1] = 2; - dstmap[0] = 3; - } - else { - dstmap[3] = 3; - dstmap[2] = 2; - dstmap[1] = 1; - dstmap[0] = 0; - } - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, 4, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_rgba8888) { - for (col = 0; col < srcWidth; col++) { - dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -GLboolean -_mesa_texstore_argb8888(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - - ASSERT(dstFormat == &_mesa_texformat_argb8888 || - dstFormat == &_mesa_texformat_argb8888_rev); - ASSERT(dstFormat->TexelBytes == 4); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_BGRA && - ((srcType == GL_UNSIGNED_BYTE && littleEndian) || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) { - /* simple memcpy path (little endian) */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888_rev && - baseInternalFormat == GL_RGBA && - srcFormat == GL_BGRA && - ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || - srcType == GL_UNSIGNED_INT_8_8_8_8)) { - /* simple memcpy path (big endian) */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - srcFormat == GL_RGB && - (baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB) && - srcType == GL_UNSIGNED_BYTE) { - int img, row, col; - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLuint *d4 = (GLuint *) dstRow; - for (col = 0; col < srcWidth; col++) { - d4[col] = PACK_COLOR_8888(0xff, - srcRow[col * 3 + RCOMP], - srcRow[col * 3 + GCOMP], - srcRow[col * 3 + BCOMP]); - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - srcFormat == GL_RGBA && - baseInternalFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE) { - /* same as above case, but src data has alpha too */ - GLint img, row, col; - /* For some reason, streaming copies to write-combined regions - * are extremely sensitive to the characteristics of how the - * source data is retrieved. By reordering the source reads to - * be in-order, the speed of this operation increases by half. - * Strangely the same isn't required for the RGB path, above. - */ - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLuint *d4 = (GLuint *) dstRow; - for (col = 0; col < srcWidth; col++) { - d4[col] = PACK_COLOR_8888(srcRow[col * 4 + ACOMP], - srcRow[col * 4 + RCOMP], - srcRow[col * 4 + GCOMP], - srcRow[col * 4 + BCOMP]); - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - (srcType == GL_UNSIGNED_BYTE || - srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) { - dstmap[3] = 3; /* alpha */ - dstmap[2] = 0; /* red */ - dstmap[1] = 1; /* green */ - dstmap[0] = 2; /* blue */ - } - else { - assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888)); - dstmap[3] = 2; - dstmap[2] = 1; - dstmap[1] = 0; - dstmap[0] = 3; - } - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - - baseInternalFormat, - dstmap, 4, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_argb8888) { - for (col = 0; col < srcWidth; col++) { - dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -GLboolean -_mesa_texstore_rgb888(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - - ASSERT(dstFormat == &_mesa_texformat_rgb888); - ASSERT(dstFormat->TexelBytes == 3); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == GL_RGB && - srcFormat == GL_BGR && - srcType == GL_UNSIGNED_BYTE && - littleEndian) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE) { - /* extract RGB from RGBA */ - GLint img, row, col; - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = srcRow[col * 4 + BCOMP]; - dstRow[col * 3 + 1] = srcRow[col * 4 + GCOMP]; - dstRow[col * 3 + 2] = srcRow[col * 4 + RCOMP]; - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - srcType == GL_UNSIGNED_BYTE && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - dstmap[0] = 2; - dstmap[1] = 1; - dstmap[2] = 0; - dstmap[3] = ONE; /* ? */ - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, 3, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = (const GLchan *) tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { -#if 0 - if (littleEndian) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]); - dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]); - dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[BCOMP]); - srcUB += 3; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = srcUB[BCOMP]; - dstRow[col * 3 + 1] = srcUB[GCOMP]; - dstRow[col * 3 + 2] = srcUB[RCOMP]; - srcUB += 3; - } - } -#else - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[BCOMP]); - dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]); - dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[RCOMP]); - src += 3; - } -#endif - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -GLboolean -_mesa_texstore_bgr888(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - - ASSERT(dstFormat == &_mesa_texformat_bgr888); - ASSERT(dstFormat->TexelBytes == 3); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == GL_RGB && - srcFormat == GL_RGB && - srcType == GL_UNSIGNED_BYTE && - littleEndian) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE) { - /* extract BGR from RGBA */ - int img, row, col; - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = srcRow[col * 4 + RCOMP]; - dstRow[col * 3 + 1] = srcRow[col * 4 + GCOMP]; - dstRow[col * 3 + 2] = srcRow[col * 4 + BCOMP]; - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - srcType == GL_UNSIGNED_BYTE && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - dstmap[0] = 0; - dstmap[1] = 1; - dstmap[2] = 2; - dstmap[3] = ONE; /* ? */ - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, 3, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = (const GLchan *) tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]); - dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]); - dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[BCOMP]); - src += 3; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - -GLboolean -_mesa_texstore_rgba4444(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_rgba4444); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba4444 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_SHORT_4_4_4_4){ - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - -GLboolean -_mesa_texstore_argb4444(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_argb4444 || - dstFormat == &_mesa_texformat_argb4444_rev); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb4444 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_BGRA && - srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb4444) { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_4444_REV( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - -GLboolean -_mesa_texstore_rgba5551(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_rgba5551); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba5551 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_SHORT_5_5_5_1) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src =tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_5551( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - -GLboolean -_mesa_texstore_argb1555(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_argb1555 || - dstFormat == &_mesa_texformat_argb1555_rev); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb1555 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_BGRA && - srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src =tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb1555) { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_1555( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - else { - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_1555_REV( CHAN_TO_UBYTE(src[ACOMP]), - CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 4; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -GLboolean -_mesa_texstore_al88(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - - ASSERT(dstFormat == &_mesa_texformat_al88 || - dstFormat == &_mesa_texformat_al88_rev); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_al88 && - baseInternalFormat == GL_LUMINANCE_ALPHA && - srcFormat == GL_LUMINANCE_ALPHA && - srcType == GL_UNSIGNED_BYTE && - littleEndian) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - littleEndian && - srcType == GL_UNSIGNED_BYTE && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if ((littleEndian && dstFormat == &_mesa_texformat_al88) || - (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) { - dstmap[0] = 0; - dstmap[1] = 3; - } - else { - dstmap[0] = 3; - dstmap[1] = 0; - } - dstmap[2] = ZERO; /* ? */ - dstmap[3] = ONE; /* ? */ - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, 2, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_al88) { - for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUS[col] = PACK_COLOR_88( CHAN_TO_UBYTE(src[1]), - CHAN_TO_UBYTE(src[0]) ); - src += 2; - } - } - else { - for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUS[col] = PACK_COLOR_88_REV( CHAN_TO_UBYTE(src[1]), - CHAN_TO_UBYTE(src[0]) ); - src += 2; - } - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -GLboolean -_mesa_texstore_rgb332(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_rgb332); - ASSERT(dstFormat->TexelBytes == 1); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == GL_RGB && - srcFormat == GL_RGB && srcType == GL_UNSIGNED_BYTE_3_3_2) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col] = PACK_COLOR_332( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]) ); - src += 3; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -/** - * Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8. - */ -GLboolean -_mesa_texstore_a8(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_a8 || - dstFormat == &_mesa_texformat_l8 || - dstFormat == &_mesa_texformat_i8); - ASSERT(dstFormat->TexelBytes == 1); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == GL_UNSIGNED_BYTE) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - srcType == GL_UNSIGNED_BYTE && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - GLubyte dstmap[4]; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if (dstFormat == &_mesa_texformat_a8) { - dstmap[0] = 3; - } - else { - dstmap[0] = 0; - } - dstmap[1] = ZERO; /* ? */ - dstmap[2] = ZERO; /* ? */ - dstmap[3] = ONE; /* ? */ - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, 1, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col] = CHAN_TO_UBYTE(src[col]); - } - dstRow += dstRowStride; - src += srcWidth; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - - -GLboolean -_mesa_texstore_ci8(TEXSTORE_PARAMS) -{ - (void) dims; (void) baseInternalFormat; - ASSERT(dstFormat == &_mesa_texformat_ci8); - ASSERT(dstFormat->TexelBytes == 1); - ASSERT(baseInternalFormat == GL_COLOR_INDEX); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcFormat == GL_COLOR_INDEX && - srcType == GL_UNSIGNED_BYTE) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - GLint img, row; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - const GLvoid *src = _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); - _mesa_unpack_index_span(ctx, srcWidth, GL_UNSIGNED_BYTE, dstRow, - srcType, src, srcPacking, - ctx->_ImageTransferState); - dstRow += dstRowStride; - } - } - } - return GL_TRUE; -} - - -/** - * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev. - */ -GLboolean -_mesa_texstore_ycbcr(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - (void) ctx; (void) dims; (void) baseInternalFormat; - - ASSERT((dstFormat == &_mesa_texformat_ycbcr) || - (dstFormat == &_mesa_texformat_ycbcr_rev)); - ASSERT(dstFormat->TexelBytes == 2); - ASSERT(ctx->Extensions.MESA_ycbcr_texture); - ASSERT(srcFormat == GL_YCBCR_MESA); - ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || - (srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA)); - ASSERT(baseInternalFormat == GL_YCBCR_MESA); - - /* always just memcpy since no pixel transfer ops apply */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - - /* Check if we need byte swapping */ - /* XXX the logic here _might_ be wrong */ - if (srcPacking->SwapBytes ^ - (srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA) ^ - (dstFormat == &_mesa_texformat_ycbcr_rev) ^ - !littleEndian) { - GLint img, row; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - _mesa_swap2((GLushort *) dstRow, srcWidth); - dstRow += dstRowStride; - } - } - } - return GL_TRUE; -} - - - -/** - * Store a combined depth/stencil texture image. - */ -GLboolean -_mesa_texstore_z24_s8(TEXSTORE_PARAMS) -{ - const GLfloat depthScale = (GLfloat) 0xffffff; - - ASSERT(dstFormat == &_mesa_texformat_z24_s8); - ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT); - ASSERT(srcType == GL_UNSIGNED_INT_24_8_EXT); - - if (ctx->Pixel.DepthScale == 1.0f && - ctx->Pixel.DepthBias == 0.0f && - !srcPacking->SwapBytes) { - /* simple path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLint srcRowStride - = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType) - / sizeof(GLuint); - GLint img, row; - - for (img = 0; img < srcDepth; img++) { - GLuint *dstRow = (GLuint *) dstAddr - + dstImageOffsets[dstZoffset + img] - + dstYoffset * dstRowStride / sizeof(GLuint) - + dstXoffset; - const GLuint *src - = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - GLubyte stencil[MAX_WIDTH]; - GLint i; - /* the 24 depth bits will be in the high position: */ - _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_INT_24_8_EXT, /* dst type */ - dstRow, /* dst addr */ - (GLuint) depthScale, - srcType, src, srcPacking); - /* get the 8-bit stencil values */ - _mesa_unpack_stencil_span(ctx, srcWidth, - GL_UNSIGNED_BYTE, /* dst type */ - stencil, /* dst addr */ - srcType, src, srcPacking, - ctx->_ImageTransferState); - /* merge stencil values into depth values */ - for (i = 0; i < srcWidth; i++) - dstRow[i] |= stencil[i]; - - src += srcRowStride; - dstRow += dstRowStride / sizeof(GLuint); - } - } - } - return GL_TRUE; -} - - -/** - * Store a combined depth/stencil texture image. - */ -GLboolean -_mesa_texstore_s8_z24(TEXSTORE_PARAMS) -{ - const GLuint depthScale = 0xffffff; - const GLint srcRowStride - = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType) - / sizeof(GLuint); - GLint img, row; - - ASSERT(dstFormat == &_mesa_texformat_s8_z24); - ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); - ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); - - /* In case we only upload depth we need to preserve the stencil */ - if (srcFormat == GL_DEPTH_COMPONENT) { - for (img = 0; img < srcDepth; img++) { - GLuint *dstRow = (GLuint *) dstAddr - + dstImageOffsets[dstZoffset + img] - + dstYoffset * dstRowStride / sizeof(GLuint) - + dstXoffset; - const GLuint *src - = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - GLuint depth[MAX_WIDTH]; - GLint i; - _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_INT, /* dst type */ - depth, /* dst addr */ - depthScale, - srcType, src, srcPacking); - - for (i = 0; i < srcWidth; i++) - dstRow[i] = depth[i] | (dstRow[i] & 0xFF000000); - - src += srcRowStride; - dstRow += dstRowStride / sizeof(GLuint); - } - } - } - else { - for (img = 0; img < srcDepth; img++) { - GLuint *dstRow = (GLuint *) dstAddr - + dstImageOffsets[dstZoffset + img] - + dstYoffset * dstRowStride / sizeof(GLuint) - + dstXoffset; - const GLuint *src - = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); - for (row = 0; row < srcHeight; row++) { - GLubyte stencil[MAX_WIDTH]; - GLint i; - /* the 24 depth bits will be in the low position: */ - _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_INT, /* dst type */ - dstRow, /* dst addr */ - depthScale, - srcType, src, srcPacking); - /* get the 8-bit stencil values */ - _mesa_unpack_stencil_span(ctx, srcWidth, - GL_UNSIGNED_BYTE, /* dst type */ - stencil, /* dst addr */ - srcType, src, srcPacking, - ctx->_ImageTransferState); - /* merge stencil values into depth values */ - for (i = 0; i < srcWidth; i++) - dstRow[i] |= stencil[i] << 24; - - src += srcRowStride; - dstRow += dstRowStride / sizeof(GLuint); - } - } - } - return GL_TRUE; -} - -/** - * Store an image in any of the formats: - * _mesa_texformat_rgba_float32 - * _mesa_texformat_rgb_float32 - * _mesa_texformat_alpha_float32 - * _mesa_texformat_luminance_float32 - * _mesa_texformat_luminance_alpha_float32 - * _mesa_texformat_intensity_float32 - */ -GLboolean -_mesa_texstore_rgba_float32(TEXSTORE_PARAMS) -{ - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba_float32 || - dstFormat == &_mesa_texformat_rgb_float32 || - dstFormat == &_mesa_texformat_alpha_float32 || - dstFormat == &_mesa_texformat_luminance_float32 || - dstFormat == &_mesa_texformat_luminance_alpha_float32 || - dstFormat == &_mesa_texformat_intensity_float32); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLfloat)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == GL_FLOAT) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = make_temp_float_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLfloat *srcRow = tempImage; - GLint bytesPerRow; - GLint img, row; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - bytesPerRow = srcWidth * components * sizeof(GLfloat); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, srcRow, bytesPerRow); - dstRow += dstRowStride; - srcRow += srcWidth * components; - } - } - - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -/** - * As above, but store 16-bit floats. - */ -GLboolean -_mesa_texstore_rgba_float16(TEXSTORE_PARAMS) -{ - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba_float16 || - dstFormat == &_mesa_texformat_rgb_float16 || - dstFormat == &_mesa_texformat_alpha_float16 || - dstFormat == &_mesa_texformat_luminance_float16 || - dstFormat == &_mesa_texformat_luminance_alpha_float16 || - dstFormat == &_mesa_texformat_intensity_float16); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLhalfARB)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == GL_HALF_FLOAT_ARB) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = make_temp_float_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLfloat *src = tempImage; - GLint img, row; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLhalfARB *dstTexel = (GLhalfARB *) dstRow; - GLint i; - for (i = 0; i < srcWidth * components; i++) { - dstTexel[i] = _mesa_float_to_half(src[i]); - } - dstRow += dstRowStride; - src += srcWidth * components; - } - } - - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - -#if FEATURE_EXT_texture_sRGB -GLboolean -_mesa_texstore_srgb8(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - const struct gl_texture_format *newDstFormat; - StoreTexImageFunc store; - GLboolean k; - - ASSERT(dstFormat == &_mesa_texformat_srgb8); - - /* reuse normal rgb texstore code */ - if (littleEndian) { - newDstFormat = &_mesa_texformat_bgr888; - store = _mesa_texstore_bgr888; - } - else { - newDstFormat = &_mesa_texformat_rgb888; - store = _mesa_texstore_rgb888; - } - - k = store(ctx, dims, baseInternalFormat, - newDstFormat, dstAddr, - dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - return k; -} - - -GLboolean -_mesa_texstore_srgba8(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - const struct gl_texture_format *newDstFormat; - GLboolean k; - - ASSERT(dstFormat == &_mesa_texformat_srgba8); - - /* reuse normal rgba texstore code */ - if (littleEndian) - newDstFormat = &_mesa_texformat_rgba8888_rev; - else - newDstFormat = &_mesa_texformat_rgba8888; - - k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat, - newDstFormat, dstAddr, - dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - return k; -} - - -GLboolean -_mesa_texstore_sl8(TEXSTORE_PARAMS) -{ - const struct gl_texture_format *newDstFormat; - GLboolean k; - - ASSERT(dstFormat == &_mesa_texformat_sl8); - - newDstFormat = &_mesa_texformat_l8; - - /* _mesa_textore_a8 handles luminance8 too */ - k = _mesa_texstore_a8(ctx, dims, baseInternalFormat, - newDstFormat, dstAddr, - dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - return k; -} - - -GLboolean -_mesa_texstore_sla8(TEXSTORE_PARAMS) -{ - const GLboolean littleEndian = _mesa_little_endian(); - const struct gl_texture_format *newDstFormat; - GLboolean k; - - ASSERT(dstFormat == &_mesa_texformat_sla8); - - /* reuse normal luminance/alpha texstore code */ - if (littleEndian) - newDstFormat = &_mesa_texformat_al88; - else - newDstFormat = &_mesa_texformat_al88_rev; - - k = _mesa_texstore_al88(ctx, dims, baseInternalFormat, - newDstFormat, dstAddr, - dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, - srcAddr, srcPacking); - return k; -} - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/** - * Check if an unpack PBO is active prior to fetching a texture image. - * If so, do bounds checking and map the buffer into main memory. - * Any errors detected will be recorded. - * The caller _must_ call _mesa_unmap_teximage_pbo() too! - */ -const GLvoid * -_mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack, - const char *funcName) -{ - GLubyte *buf; - - if (unpack->BufferObj->Name == 0) { - /* no PBO */ - return pixels; - } - if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access"); - return NULL; - } - - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, unpack->BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped"); - return NULL; - } - - return ADD_POINTERS(buf, pixels); -} - - -/** - * Check if an unpack PBO is active prior to fetching a compressed texture - * image. - * If so, do bounds checking and map the buffer into main memory. - * Any errors detected will be recorded. - * The caller _must_ call _mesa_unmap_teximage_pbo() too! - */ -const GLvoid * -_mesa_validate_pbo_compressed_teximage(GLcontext *ctx, - GLsizei imageSize, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - const char *funcName) -{ - GLubyte *buf; - - if (packing->BufferObj->Name == 0) { - /* not using a PBO - return pointer unchanged */ - return pixels; - } - if ((const GLubyte *) pixels + imageSize > - ((const GLubyte *) 0) + packing->BufferObj->Size) { - /* out of bounds read! */ - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access"); - return NULL; - } - - buf = (GLubyte*) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, packing->BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped"); - return NULL; - } - - return ADD_POINTERS(buf, pixels); -} - - -/** - * This function must be called after either of the validate_pbo_*_teximage() - * functions. It unmaps the PBO buffer if it was mapped earlier. - */ -void -_mesa_unmap_teximage_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack) -{ - if (unpack->BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - unpack->BufferObj); - } -} - - - -/** - * Adaptor for fetching a GLchan texel from a float-valued texture. - */ -static void -fetch_texel_float_to_chan(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texelOut) -{ - GLfloat temp[4]; - ASSERT(texImage->FetchTexelf); - texImage->FetchTexelf(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - } - else { - /* four channels */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]); - } -} - - -/** - * Adaptor for fetching a float texel from a GLchan-valued texture. - */ -static void -fetch_texel_chan_to_float(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texelOut) -{ - GLchan temp[4]; - ASSERT(texImage->FetchTexelc); - texImage->FetchTexelc(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - } - else { - /* four channels */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - texelOut[1] = CHAN_TO_FLOAT(temp[1]); - texelOut[2] = CHAN_TO_FLOAT(temp[2]); - texelOut[3] = CHAN_TO_FLOAT(temp[3]); - } -} - - -/** - * Initialize the texture image's FetchTexelc and FetchTexelf methods. - */ -void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) -{ - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(texImage->TexFormat); - - switch (dims) { - case 1: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - break; - case 2: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - break; - case 3: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df; - break; - default: - ; - } - - /* now check if we need to use a float/chan adaptor */ - if (!texImage->FetchTexelc) { - texImage->FetchTexelc = fetch_texel_float_to_chan; - } - else if (!texImage->FetchTexelf) { - texImage->FetchTexelf = fetch_texel_chan_to_float; - } - - - ASSERT(texImage->FetchTexelc); - ASSERT(texImage->FetchTexelf); -} - - -/** - * Choose the actual storage format for a new texture image. - * Mainly, this is a wrapper for the driver's ChooseTextureFormat() function. - * Also set some other texImage fields related to texture compression, etc. - * \param ctx rendering context - * \param texImage the gl_texture_image - * \param dims texture dimensions (1, 2 or 3) - * \param format the user-specified format parameter - * \param type the user-specified type parameter - * \param internalFormat the user-specified internal format hint - */ -static void -choose_texture_format(GLcontext *ctx, struct gl_texture_image *texImage, - GLuint dims, - GLenum format, GLenum type, GLint internalFormat) -{ - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(ctx->Driver.ChooseTextureFormat); - - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - - ASSERT(texImage->TexFormat); - - _mesa_set_fetch_functions(texImage, dims); - - if (texImage->TexFormat->TexelBytes == 0) { - /* must be a compressed format */ - texImage->IsCompressed = GL_TRUE; - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); - } - else { - /* non-compressed format */ - texImage->IsCompressed = GL_FALSE; - texImage->CompressedSize = 0; - } -} - - - -/** - * This is the software fallback for Driver.TexImage1D() - * and Driver.CopyTexImage1D(). - * \sa _mesa_store_teximage2d() - * Note that the width may not be the actual texture width since it may - * be changed by convolution w/ GL_REDUCE. The texImage->Width field will - * have the actual texture size. - */ -void -_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLint sizeInBytes; - (void) border; - - choose_texture_format(ctx, texImage, 1, format, type, internalFormat); - - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * texImage->TexFormat->TexelBytes; - texImage->Data = _mesa_alloc_texmemory(sizeInBytes); - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - return; - } - - pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, - pixels, packing, "glTexImage1D"); - if (!pixels) { - /* Note: we check for a NULL image pointer here, _after_ we allocated - * memory for the texture. That's what the GL spec calls for. - */ - return; - } - else { - const GLint dstRowStride = 0; - GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - -/** - * This is the software fallback for Driver.TexImage2D() - * and Driver.CopyTexImage2D(). - * - * This function is oriented toward storing images in main memory, rather - * than VRAM. Device driver's can easily plug in their own replacement. - * - * Note: width and height may be pre-convolved dimensions, but - * texImage->Width and texImage->Height will be post-convolved dimensions. - */ -void -_mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLint texelBytes, sizeInBytes; - (void) border; - - choose_texture_format(ctx, texImage, 2, format, type, internalFormat); - - texelBytes = texImage->TexFormat->TexelBytes; - - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * texImage->Height * texelBytes; - texImage->Data = _mesa_alloc_texmemory(sizeInBytes); - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - - pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1, format, type, - pixels, packing, "glTexImage2D"); - if (!pixels) { - /* Note: we check for a NULL image pointer here, _after_ we allocated - * memory for the texture. That's what the GL spec calls for. - */ - return; - } - else { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - - -/** - * This is the software fallback for Driver.TexImage3D() - * and Driver.CopyTexImage3D(). - * \sa _mesa_store_teximage2d() - */ -void -_mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLint texelBytes, sizeInBytes; - (void) border; - - choose_texture_format(ctx, texImage, 3, format, type, internalFormat); - - texelBytes = texImage->TexFormat->TexelBytes; - - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = width * height * depth * texelBytes; - texImage->Data = _mesa_alloc_texmemory(sizeInBytes); - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - return; - } - - pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, - type, pixels, packing, "glTexImage3D"); - if (!pixels) { - /* Note: we check for a NULL image pointer here, _after_ we allocated - * memory for the texture. That's what the GL spec calls for. - */ - return; - } - else { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - - - -/* - * This is the software fallback for Driver.TexSubImage1D() - * and Driver.CopyTexSubImage1D(). - */ -void -_mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint width, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* get pointer to src pixels (may be in a pbo which we'll map here) */ - pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, - pixels, packing, "glTexSubImage1D"); - if (!pixels) - return; - - { - const GLint dstRowStride = 0; - GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, 0, 0, /* offsets */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - - -/** - * This is the software fallback for Driver.TexSubImage2D() - * and Driver.CopyTexSubImage2D(). - */ -void -_mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint width, GLint height, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* get pointer to src pixels (may be in a pbo which we'll map here) */ - pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1, format, type, - pixels, packing, "glTexSubImage2D"); - if (!pixels) - return; - - { - GLint dstRowStride = 0; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - -/* - * This is the software fallback for Driver.TexSubImage3D(). - * and Driver.CopyTexSubImage3D(). - */ -void -_mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* get pointer to src pixels (may be in a pbo which we'll map here) */ - pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, - type, pixels, packing, - "glTexSubImage3D"); - if (!pixels) - return; - - { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); - if (!success) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); - } - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, packing); -} - - -/* - * Fallback for Driver.CompressedTexImage1D() - */ -void -_mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* this space intentionally left blank */ - (void) ctx; - (void) target; (void) level; - (void) internalFormat; - (void) width; (void) border; - (void) imageSize; (void) data; - (void) texObj; - (void) texImage; -} - - - -/** - * Fallback for Driver.CompressedTexImage2D() - */ -void -_mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - (void) width; (void) height; (void) border; - - /* This is pretty simple, basically just do a memcpy without worrying - * about the usual image unpacking or image transfer operations. - */ - ASSERT(texObj); - ASSERT(texImage); - ASSERT(texImage->Width > 0); - ASSERT(texImage->Height > 0); - ASSERT(texImage->Depth == 1); - ASSERT(texImage->Data == NULL); /* was freed in glCompressedTexImage2DARB */ - - choose_texture_format(ctx, texImage, 2, 0, 0, internalFormat); - - /* allocate storage */ - texImage->Data = _mesa_alloc_texmemory(imageSize); - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); - return; - } - - data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, - &ctx->Unpack, - "glCompressedTexImage2D"); - if (!data) - return; - - /* copy the data */ - ASSERT(texImage->CompressedSize == (GLuint) imageSize); - MEMCPY(texImage->Data, data, imageSize); - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); -} - - - -/* - * Fallback for Driver.CompressedTexImage3D() - */ -void -_mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* this space intentionally left blank */ - (void) ctx; - (void) target; (void) level; - (void) internalFormat; - (void) width; (void) height; (void) depth; - (void) border; - (void) imageSize; (void) data; - (void) texObj; - (void) texImage; -} - - - -/** - * Fallback for Driver.CompressedTexSubImage1D() - */ -void -_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLsizei width, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* there are no compressed 1D texture formats yet */ - (void) ctx; - (void) target; (void) level; - (void) xoffset; (void) width; - (void) format; - (void) imageSize; (void) data; - (void) texObj; - (void) texImage; -} - - -/** - * Fallback for Driver.CompressedTexSubImage2D() - */ -void -_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLint bytesPerRow, destRowStride, srcRowStride; - GLint i, rows; - GLubyte *dest; - const GLubyte *src; - const GLuint mesaFormat = texImage->TexFormat->MesaFormat; - - (void) format; - - /* these should have been caught sooner */ - ASSERT((width & 3) == 0 || width == 2 || width == 1); - ASSERT((height & 3) == 0 || height == 2 || height == 1); - ASSERT((xoffset & 3) == 0); - ASSERT((yoffset & 3) == 0); - - /* get pointer to src pixels (may be in a pbo which we'll map here) */ - data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, - &ctx->Unpack, - "glCompressedTexSubImage2D"); - if (!data) - return; - - srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); - src = (const GLubyte *) data; - - destRowStride = _mesa_compressed_row_stride(mesaFormat, texImage->Width); - dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->TexFormat->MesaFormat, - texImage->Width, - (GLubyte *) texImage->Data); - - bytesPerRow = srcRowStride; - rows = height / 4; - - for (i = 0; i < rows; i++) { - MEMCPY(dest, src, bytesPerRow); - dest += destRowStride; - src += srcRowStride; - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); -} - - -/** - * Fallback for Driver.CompressedTexSubImage3D() - */ -void -_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - /* there are no compressed 3D texture formats yet */ - (void) ctx; - (void) target; (void) level; - (void) xoffset; (void) yoffset; (void) zoffset; - (void) width; (void) height; (void) depth; - (void) format; - (void) imageSize; (void) data; - (void) texObj; - (void) texImage; -} - - - - -#if FEATURE_EXT_texture_sRGB - -/** - * Test if given texture image is an sRGB format. - */ -static GLboolean -is_srgb_teximage(const struct gl_texture_image *texImage) -{ - switch (texImage->TexFormat->MesaFormat) { - case MESA_FORMAT_SRGB8: - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SL8: - case MESA_FORMAT_SLA8: - return GL_TRUE; - default: - return GL_FALSE; - } -} - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/** - * This is the software fallback for Driver.GetTexImage(). - * All error checking will have been done before this routine is called. - */ -void -_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; - - if (ctx->Pack.BufferObj->Name) { - /* Packing texture image into a PBO. - * Map the (potentially) VRAM-based buffer into our process space so - * we can write into it with the code below. - * A hardware driver might use a sophisticated blit to move the - * texture data to the PBO if the PBO is in VRAM along with the texture. - */ - GLubyte *buf = (GLubyte *) - ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION,"glGetTexImage(PBO is mapped)"); - return; - } - /* was an offset into the PBO. - * Now make it a real, client-side pointer inside the mapped region. - */ - pixels = ADD_POINTERS(buf, pixels); - } - else if (!pixels) { - /* not an error */ - return; - } - - { - const GLint width = texImage->Width; - const GLint height = texImage->Height; - const GLint depth = texImage->Depth; - GLint img, row; - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - /* compute destination address in client memory */ - GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, - width, height, format, type, - img, row, 0); - assert(dest); - - if (format == GL_COLOR_INDEX) { - GLuint indexRow[MAX_WIDTH]; - GLint col; - /* Can't use FetchTexel here because that returns RGBA */ - if (texImage->TexFormat->IndexBits == 8) { - const GLubyte *src = (const GLubyte *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else if (texImage->TexFormat->IndexBits == 16) { - const GLushort *src = (const GLushort *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else { - _mesa_problem(ctx, - "Color index problem in _mesa_GetTexImage"); - } - _mesa_pack_index_span(ctx, width, type, dest, - indexRow, &ctx->Pack, - 0 /* no image transfer */); - } - else if (format == GL_DEPTH_COMPONENT) { - GLfloat depthRow[MAX_WIDTH]; - GLint col; - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, - depthRow + col); - } - _mesa_pack_depth_span(ctx, width, dest, type, - depthRow, &ctx->Pack); - } - else if (format == GL_DEPTH_STENCIL_EXT) { - /* XXX Note: we're bypassing texImage->FetchTexel()! */ - const GLuint *src = (const GLuint *) texImage->Data; - src += width * row + width * height * img; - _mesa_memcpy(dest, src, width * sizeof(GLuint)); - if (ctx->Pack.SwapBytes) { - _mesa_swap4((GLuint *) dest, width); - } - } - else if (format == GL_YCBCR_MESA) { - /* No pixel transfer */ - const GLint rowstride = texImage->RowStride; - MEMCPY(dest, - (const GLushort *) texImage->Data + row * rowstride, - width * sizeof(GLushort)); - /* check for byte swapping */ - if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR - && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || - (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV - && type == GL_UNSIGNED_SHORT_8_8_MESA)) { - if (!ctx->Pack.SwapBytes) - _mesa_swap2((GLushort *) dest, width); - } - else if (ctx->Pack.SwapBytes) { - _mesa_swap2((GLushort *) dest, width); - } - } -#if FEATURE_EXT_texture_sRGB - else if (is_srgb_teximage(texImage)) { - /* no pixel transfer and no non-linear to linear conversion */ - const GLint comps = texImage->TexFormat->TexelBytes; - const GLint rowstride = comps * texImage->RowStride; - MEMCPY(dest, - (const GLubyte *) texImage->Data + row * rowstride, - comps * width * sizeof(GLubyte)); - } -#endif /* FEATURE_EXT_texture_sRGB */ - else { - /* general case: convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - if (type == GL_FLOAT && - ((ctx->Color.ClampReadColor == GL_TRUE) || - (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB && - texImage->TexFormat->DataType != GL_FLOAT))) - transferOps |= IMAGE_CLAMP_BIT; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->TexFormat->BaseFormat == GL_ALPHA) { - rgba[col][RCOMP] = 0.0; - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_INTENSITY) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps /*image xfer ops*/); - } /* format */ - } /* row */ - } /* img */ - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - - -/** - * This is the software fallback for Driver.GetCompressedTexImage(). - * All error checking will have been done before this routine is called. - */ -void -_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, - GLvoid *img, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLuint size; - - if (ctx->Pack.BufferObj->Name) { - /* pack texture image into a PBO */ - GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > - (const GLubyte *) ctx->Pack.BufferObj->Size) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(PBO is mapped)"); - return; - } - img = ADD_POINTERS(buf, img); - } - else if (!img) { - /* not an error */ - return; - } - - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat->MesaFormat); - - /* just memcpy, no pixelstore or pixel transfer */ - _mesa_memcpy(img, texImage->Data, size); - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} diff --git a/src/libs/mesa/mesa/main/texstore.h b/src/libs/mesa/mesa/main/texstore.h deleted file mode 100644 index 951d0a112b..0000000000 --- a/src/libs/mesa/mesa/main/texstore.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/** - * \file texstore.h - * Texture image storage routines. - * - * \author Brian Paul - */ - - -#ifndef TEXSTORE_H -#define TEXSTORE_H - - -#include "mtypes.h" - - -extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); -#if FEATURE_EXT_texture_sRGB -extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); -#endif - - -extern GLchan * -_mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, - GLenum logicalBaseFormat, - GLenum textureBaseFormat, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLenum srcFormat, GLenum srcType, - const GLvoid *srcAddr, - const struct gl_pixelstore_attrib *srcPacking); - - -extern void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); - - -extern void -_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint width, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint width, GLint height, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - -extern void -_mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - -extern void -_mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLsizei width, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - -extern void -_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - -extern void -_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, - GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, - GLvoid *img, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - -extern const GLvoid * -_mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack, - const char *funcName); - -extern const GLvoid * -_mesa_validate_pbo_compressed_teximage(GLcontext *ctx, - GLsizei imageSize, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - const char *funcName); - -extern void -_mesa_unmap_teximage_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); - - -#endif diff --git a/src/libs/mesa/mesa/main/varray.c b/src/libs/mesa/mesa/main/varray.c deleted file mode 100644 index 9d9b28b518..0000000000 --- a/src/libs/mesa/mesa/main/varray.c +++ /dev/null @@ -1,1006 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - */ - - -#include "glheader.h" -#include "imports.h" -#include "bufferobj.h" -#include "context.h" -#include "enable.h" -#include "enums.h" -#include "mtypes.h" -#include "varray.h" -#include "arrayobj.h" -#include "glapi/dispatch.h" - - -/** - * Update the fields of a vertex array object. - * We need to do a few special things for arrays that live in - * vertex buffer objects. - * - * \param array the array to update - * \param dirtyBit which bit to set in ctx->Array.NewState for this array - * \param elementSize size of each array element, in bytes - * \param size components per element (1, 2, 3 or 4) - * \param type datatype of each component (GL_FLOAT, GL_INT, etc) - * \param stride stride between elements, in elements - * \param normalized are integer types converted to floats in [-1, 1]? - * \param ptr the address (or offset inside VBO) of the array data - */ -static void -update_array(GLcontext *ctx, struct gl_client_array *array, - GLbitfield dirtyBit, GLsizei elementSize, - GLint size, GLenum type, - GLsizei stride, GLboolean normalized, const GLvoid *ptr) -{ - array->Size = size; - array->Type = type; - array->Stride = stride; - array->StrideB = stride ? stride : elementSize; - array->Normalized = normalized; - array->Ptr = (const GLubyte *) ptr; -#if FEATURE_ARB_vertex_buffer_object - _mesa_reference_buffer_object(ctx, &array->BufferObj, - ctx->Array.ArrayBufferObj); - - /* Compute the index of the last array element that's inside the buffer. - * Later in glDrawArrays we'll check if start + count > _MaxElement to - * be sure we won't go out of bounds. - */ - if (ctx->Array.ArrayBufferObj->Name) - array->_MaxElement = ((GLsizeiptrARB) ctx->Array.ArrayBufferObj->Size - - (GLsizeiptrARB) array->Ptr + array->StrideB - - elementSize) / array->StrideB; - else -#endif - array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */ - - ctx->NewState |= _NEW_ARRAY; - ctx->Array.NewState |= dirtyBit; -} - - -void GLAPIENTRY -_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (size < 2 || size > 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexPointer(size)" ); - return; - } - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glVertexPointer(stride)" ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) - _mesa_debug(ctx, "glVertexPointer( sz %d type %s stride %d )\n", size, - _mesa_lookup_enum_by_nr( type ), stride); - - /* always need to check that is legal */ - switch (type) { - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_INT: - elementSize = size * sizeof(GLint); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = size * sizeof(GLfixed); - break; -#endif -#if FEATURE_vertex_array_byte - case GL_BYTE: - elementSize = size * sizeof(GLbyte); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glVertexPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, - elementSize, size, type, stride, GL_FALSE, ptr); - - if (ctx->Driver.VertexPointer) - ctx->Driver.VertexPointer( ctx, size, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glNormalPointer(stride)" ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) - _mesa_debug(ctx, "glNormalPointer( type %s stride %d )\n", - _mesa_lookup_enum_by_nr( type ), stride); - - switch (type) { - case GL_BYTE: - elementSize = 3 * sizeof(GLbyte); - break; - case GL_SHORT: - elementSize = 3 * sizeof(GLshort); - break; - case GL_INT: - elementSize = 3 * sizeof(GLint); - break; - case GL_FLOAT: - elementSize = 3 * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = 3 * sizeof(GLdouble); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = 3 * sizeof(GLfixed); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glNormalPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, - elementSize, 3, type, stride, GL_TRUE, ptr); - - if (ctx->Driver.NormalPointer) - ctx->Driver.NormalPointer( ctx, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (size < 3 || size > 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" ); - return; - } - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(stride)" ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) - _mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size, - _mesa_lookup_enum_by_nr( type ), stride); - - switch (type) { - case GL_BYTE: - elementSize = size * sizeof(GLbyte); - break; - case GL_UNSIGNED_BYTE: - elementSize = size * sizeof(GLubyte); - break; - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_UNSIGNED_SHORT: - elementSize = size * sizeof(GLushort); - break; - case GL_INT: - elementSize = size * sizeof(GLint); - break; - case GL_UNSIGNED_INT: - elementSize = size * sizeof(GLuint); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = size * sizeof(GLfixed); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glColorPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, - elementSize, size, type, stride, GL_TRUE, ptr); - - if (ctx->Driver.ColorPointer) - ctx->Driver.ColorPointer( ctx, size, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GLint elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glFogCoordPointer(stride)" ); - return; - } - - switch (type) { - case GL_FLOAT: - elementSize = sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = sizeof(GLdouble); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glFogCoordPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, - elementSize, 1, type, stride, GL_FALSE, ptr); - - if (ctx->Driver.FogCoordPointer) - ctx->Driver.FogCoordPointer( ctx, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glIndexPointer(stride)" ); - return; - } - - switch (type) { - case GL_UNSIGNED_BYTE: - elementSize = sizeof(GLubyte); - break; - case GL_SHORT: - elementSize = sizeof(GLshort); - break; - case GL_INT: - elementSize = sizeof(GLint); - break; - case GL_FLOAT: - elementSize = sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = sizeof(GLdouble); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glIndexPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, - elementSize, 1, type, stride, GL_FALSE, ptr); - - if (ctx->Driver.IndexPointer) - ctx->Driver.IndexPointer( ctx, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (size != 3 && size != 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)" ); - return; - } - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(stride)" ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) - _mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n", - size, _mesa_lookup_enum_by_nr( type ), stride); - - switch (type) { - case GL_BYTE: - elementSize = size * sizeof(GLbyte); - break; - case GL_UNSIGNED_BYTE: - elementSize = size * sizeof(GLubyte); - break; - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_UNSIGNED_SHORT: - elementSize = size * sizeof(GLushort); - break; - case GL_INT: - elementSize = size * sizeof(GLint); - break; - case GL_UNSIGNED_INT: - elementSize = size * sizeof(GLuint); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glSecondaryColorPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, - elementSize, size, type, stride, GL_TRUE, ptr); - - if (ctx->Driver.SecondaryColorPointer) - ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr) -{ - GLint elementSize; - GET_CURRENT_CONTEXT(ctx); - const GLuint unit = ctx->Array.ActiveTexture; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (size < 1 || size > 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexCoordPointer(size)" ); - return; - } - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexCoordPointer(stride)" ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) - _mesa_debug(ctx, "glTexCoordPointer(unit %u sz %d type %s stride %d)\n", - unit, size, _mesa_lookup_enum_by_nr( type ), stride); - - /* always need to check that is legal */ - switch (type) { - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_INT: - elementSize = size * sizeof(GLint); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = size * sizeof(GLfixed); - break; -#endif -#if FEATURE_vertex_array_byte - case GL_BYTE: - elementSize = size * sizeof(GLbyte); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexCoordPointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], - _NEW_ARRAY_TEXCOORD(unit), - elementSize, size, type, stride, GL_FALSE, ptr); - - if (ctx->Driver.TexCoordPointer) - ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glEdgeFlagPointer(stride)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, - sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, stride, GL_FALSE, ptr); - - if (ctx->Driver.EdgeFlagPointer) - ctx->Driver.EdgeFlagPointer( ctx, stride, ptr ); -} - - -void GLAPIENTRY -_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPointSizePointer(stride)" ); - return; - } - - switch (type) { - case GL_FLOAT: - elementSize = sizeof(GLfloat); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = sizeof(GLfixed); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPointSizePointer(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE, - elementSize, 1, type, stride, GL_FALSE, ptr); -} - - -#if FEATURE_NV_vertex_program -void GLAPIENTRY -_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - GLboolean normalized = GL_FALSE; - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(index)"); - return; - } - - if (size < 1 || size > 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(size)"); - return; - } - - if (stride < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(stride)"); - return; - } - - if (type == GL_UNSIGNED_BYTE && size != 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(size!=4)"); - return; - } - - /* check for valid 'type' and compute StrideB right away */ - switch (type) { - case GL_UNSIGNED_BYTE: - normalized = GL_TRUE; - elementSize = size * sizeof(GLubyte); - break; - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttribPointerNV(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); -} -#endif - - -#if FEATURE_ARB_vertex_program -void GLAPIENTRY -_mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, - GLboolean normalized, - GLsizei stride, const GLvoid *ptr) -{ - GLsizei elementSize; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= ctx->Const.VertexProgram.MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(index)"); - return; - } - - if (size < 1 || size > 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)"); - return; - } - - if (stride < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(stride)"); - return; - } - - /* check for valid 'type' and compute StrideB right away */ - /* NOTE: more types are supported here than in the NV extension */ - switch (type) { - case GL_BYTE: - elementSize = size * sizeof(GLbyte); - break; - case GL_UNSIGNED_BYTE: - elementSize = size * sizeof(GLubyte); - break; - case GL_SHORT: - elementSize = size * sizeof(GLshort); - break; - case GL_UNSIGNED_SHORT: - elementSize = size * sizeof(GLushort); - break; - case GL_INT: - elementSize = size * sizeof(GLint); - break; - case GL_UNSIGNED_INT: - elementSize = size * sizeof(GLuint); - break; - case GL_FLOAT: - elementSize = size * sizeof(GLfloat); - break; - case GL_DOUBLE: - elementSize = size * sizeof(GLdouble); - break; -#if FEATURE_fixedpt - case GL_FIXED: - elementSize = size * sizeof(GLfixed); - break; -#endif - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttribPointerARB(type)" ); - return; - } - - update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr); -} -#endif - - -void GLAPIENTRY -_mesa_VertexPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr) -{ - (void) count; - _mesa_VertexPointer(size, type, stride, ptr); -} - - -void GLAPIENTRY -_mesa_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr) -{ - (void) count; - _mesa_NormalPointer(type, stride, ptr); -} - - -void GLAPIENTRY -_mesa_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr) -{ - (void) count; - _mesa_ColorPointer(size, type, stride, ptr); -} - - -void GLAPIENTRY -_mesa_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr) -{ - (void) count; - _mesa_IndexPointer(type, stride, ptr); -} - - -void GLAPIENTRY -_mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr) -{ - (void) count; - _mesa_TexCoordPointer(size, type, stride, ptr); -} - - -void GLAPIENTRY -_mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr) -{ - (void) count; - _mesa_EdgeFlagPointer(stride, ptr); -} - - -void GLAPIENTRY -_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) -{ - GET_CURRENT_CONTEXT(ctx); - GLboolean tflag, cflag, nflag; /* enable/disable flags */ - GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ - GLenum ctype = 0; /* color type */ - GLint coffset = 0, noffset = 0, voffset;/* color, normal, vertex offsets */ - const GLint toffset = 0; /* always zero */ - GLint defstride; /* default stride */ - GLint c, f; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - f = sizeof(GLfloat); - c = f * ((4 * sizeof(GLubyte) + (f - 1)) / f); - - if (stride < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glInterleavedArrays(stride)" ); - return; - } - - switch (format) { - case GL_V2F: - tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_FALSE; - tcomps = 0; ccomps = 0; vcomps = 2; - voffset = 0; - defstride = 2*f; - break; - case GL_V3F: - tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_FALSE; - tcomps = 0; ccomps = 0; vcomps = 3; - voffset = 0; - defstride = 3*f; - break; - case GL_C4UB_V2F: - tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; - tcomps = 0; ccomps = 4; vcomps = 2; - ctype = GL_UNSIGNED_BYTE; - coffset = 0; - voffset = c; - defstride = c + 2*f; - break; - case GL_C4UB_V3F: - tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; - tcomps = 0; ccomps = 4; vcomps = 3; - ctype = GL_UNSIGNED_BYTE; - coffset = 0; - voffset = c; - defstride = c + 3*f; - break; - case GL_C3F_V3F: - tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; - tcomps = 0; ccomps = 3; vcomps = 3; - ctype = GL_FLOAT; - coffset = 0; - voffset = 3*f; - defstride = 6*f; - break; - case GL_N3F_V3F: - tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_TRUE; - tcomps = 0; ccomps = 0; vcomps = 3; - noffset = 0; - voffset = 3*f; - defstride = 6*f; - break; - case GL_C4F_N3F_V3F: - tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_TRUE; - tcomps = 0; ccomps = 4; vcomps = 3; - ctype = GL_FLOAT; - coffset = 0; - noffset = 4*f; - voffset = 7*f; - defstride = 10*f; - break; - case GL_T2F_V3F: - tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_FALSE; - tcomps = 2; ccomps = 0; vcomps = 3; - voffset = 2*f; - defstride = 5*f; - break; - case GL_T4F_V4F: - tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_FALSE; - tcomps = 4; ccomps = 0; vcomps = 4; - voffset = 4*f; - defstride = 8*f; - break; - case GL_T2F_C4UB_V3F: - tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_FALSE; - tcomps = 2; ccomps = 4; vcomps = 3; - ctype = GL_UNSIGNED_BYTE; - coffset = 2*f; - voffset = c+2*f; - defstride = c+5*f; - break; - case GL_T2F_C3F_V3F: - tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_FALSE; - tcomps = 2; ccomps = 3; vcomps = 3; - ctype = GL_FLOAT; - coffset = 2*f; - voffset = 5*f; - defstride = 8*f; - break; - case GL_T2F_N3F_V3F: - tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_TRUE; - tcomps = 2; ccomps = 0; vcomps = 3; - noffset = 2*f; - voffset = 5*f; - defstride = 8*f; - break; - case GL_T2F_C4F_N3F_V3F: - tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_TRUE; - tcomps = 2; ccomps = 4; vcomps = 3; - ctype = GL_FLOAT; - coffset = 2*f; - noffset = 6*f; - voffset = 9*f; - defstride = 12*f; - break; - case GL_T4F_C4F_N3F_V4F: - tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_TRUE; - tcomps = 4; ccomps = 4; vcomps = 4; - ctype = GL_FLOAT; - coffset = 4*f; - noffset = 8*f; - voffset = 11*f; - defstride = 15*f; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glInterleavedArrays(format)" ); - return; - } - - if (stride==0) { - stride = defstride; - } - - _mesa_DisableClientState( GL_EDGE_FLAG_ARRAY ); - _mesa_DisableClientState( GL_INDEX_ARRAY ); - /* XXX also disable secondary color and generic arrays? */ - - /* Texcoords */ - if (tflag) { - _mesa_EnableClientState( GL_TEXTURE_COORD_ARRAY ); - _mesa_TexCoordPointer( tcomps, GL_FLOAT, stride, - (GLubyte *) pointer + toffset ); - } - else { - _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY ); - } - - /* Color */ - if (cflag) { - _mesa_EnableClientState( GL_COLOR_ARRAY ); - _mesa_ColorPointer( ccomps, ctype, stride, - (GLubyte *) pointer + coffset ); - } - else { - _mesa_DisableClientState( GL_COLOR_ARRAY ); - } - - - /* Normals */ - if (nflag) { - _mesa_EnableClientState( GL_NORMAL_ARRAY ); - _mesa_NormalPointer( GL_FLOAT, stride, (GLubyte *) pointer + noffset ); - } - else { - _mesa_DisableClientState( GL_NORMAL_ARRAY ); - } - - /* Vertices */ - _mesa_EnableClientState( GL_VERTEX_ARRAY ); - _mesa_VertexPointer( vcomps, GL_FLOAT, stride, - (GLubyte *) pointer + voffset ); -} - - -void GLAPIENTRY -_mesa_LockArraysEXT(GLint first, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glLockArrays %d %d\n", first, count); - - if (first < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" ); - return; - } - if (count <= 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(count)" ); - return; - } - if (ctx->Array.LockCount != 0) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glLockArraysEXT(reentry)" ); - return; - } - - ctx->Array.LockFirst = first; - ctx->Array.LockCount = count; - - ctx->NewState |= _NEW_ARRAY; - ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.LockArraysEXT) - ctx->Driver.LockArraysEXT( ctx, first, count ); -} - - -void GLAPIENTRY -_mesa_UnlockArraysEXT( void ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glUnlockArrays\n"); - - if (ctx->Array.LockCount == 0) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glUnlockArraysEXT(reexit)" ); - return; - } - - ctx->Array.LockFirst = 0; - ctx->Array.LockCount = 0; - ctx->NewState |= _NEW_ARRAY; - ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.UnlockArraysEXT) - ctx->Driver.UnlockArraysEXT( ctx ); -} - - -/* GL_EXT_multi_draw_arrays */ -/* Somebody forgot to spec the first and count parameters as const! */ -void GLAPIENTRY -_mesa_MultiDrawArraysEXT( GLenum mode, GLint *first, - GLsizei *count, GLsizei primcount ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (count[i] > 0) { - CALL_DrawArrays(ctx->Exec, (mode, first[i], count[i])); - } - } -} - - -/* GL_EXT_multi_draw_arrays */ -void GLAPIENTRY -_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (count[i] > 0) { - CALL_DrawElements(ctx->Exec, (mode, count[i], type, indices[i])); - } - } -} - - -/* GL_IBM_multimode_draw_arrays */ -void GLAPIENTRY -_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, - const GLsizei * count, - GLsizei primcount, GLint modestride ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for ( i = 0 ; i < primcount ; i++ ) { - if ( count[i] > 0 ) { - GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride)); - CALL_DrawArrays(ctx->Exec, ( m, first[i], count[i] )); - } - } -} - - -/* GL_IBM_multimode_draw_arrays */ -void GLAPIENTRY -_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, - GLenum type, const GLvoid * const * indices, - GLsizei primcount, GLint modestride ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - /* XXX not sure about ARB_vertex_buffer_object handling here */ - - for ( i = 0 ; i < primcount ; i++ ) { - if ( count[i] > 0 ) { - GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride)); - CALL_DrawElements(ctx->Exec, ( m, count[i], type, indices[i] )); - } - } -} - - -/** - * Initialize vertex array state for given context. - */ -void -_mesa_init_varray(GLcontext *ctx) -{ - ctx->Array.DefaultArrayObj = _mesa_new_array_object(ctx, 0); - ctx->Array.ArrayObj = ctx->Array.DefaultArrayObj; - - ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */ -} diff --git a/src/libs/mesa/mesa/main/varray.h b/src/libs/mesa/mesa/main/varray.h deleted file mode 100644 index 6385689fcc..0000000000 --- a/src/libs/mesa/mesa/main/varray.h +++ /dev/null @@ -1,169 +0,0 @@ -/** - * \file varray.h - * Vertex arrays. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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 VARRAY_H -#define VARRAY_H - - -#include "mtypes.h" - -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr); - -extern void GLAPIENTRY -_mesa_UnlockArraysEXT( void ); - -extern void GLAPIENTRY -_mesa_LockArraysEXT(GLint first, GLsizei count); - - -extern void GLAPIENTRY -_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_VertexPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, - const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr); - - -extern void GLAPIENTRY -_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr); - - -extern void GLAPIENTRY -_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, - GLsizei stride, const GLvoid *pointer); - - -extern void GLAPIENTRY -_mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, - GLboolean normalized, GLsizei stride, - const GLvoid *pointer); - - -extern void GLAPIENTRY -_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); - - -extern void GLAPIENTRY -_mesa_MultiDrawArraysEXT( GLenum mode, GLint *first, - GLsizei *count, GLsizei primcount ); - -extern void GLAPIENTRY -_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount ); - - -extern void GLAPIENTRY -_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, - const GLsizei * count, - GLsizei primcount, GLint modestride ); - - -extern void GLAPIENTRY -_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, - GLenum type, const GLvoid * const * indices, - GLsizei primcount, GLint modestride ); - -extern void GLAPIENTRY -_mesa_LockArraysEXT(GLint first, GLsizei count); - -extern void GLAPIENTRY -_mesa_UnlockArraysEXT( void ); - -extern void -_mesa_init_varray( GLcontext * ctx ); - -#else - -/** No-op */ -#define _mesa_init_varray( c ) ((void)0) - -#endif - -#endif diff --git a/src/libs/mesa/mesa/main/version.h b/src/libs/mesa/mesa/main/version.h deleted file mode 100644 index f52f5c6932..0000000000 --- a/src/libs/mesa/mesa/main/version.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.4.4 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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 VERSION_H -#define VERSION_H - - -/* Mesa version */ -#define MESA_MAJOR 7 -#define MESA_MINOR 4 -#define MESA_PATCH 4 -#define MESA_VERSION_STRING "7.4.4" - -/* To make version comparison easy */ -#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define MESA_VERSION_CODE MESA_VERSION(MESA_MAJOR, MESA_MINOR, MESA_PATCH) - - -/* OpenGL API version */ -#define OPENGL_MAJOR 2 -#define OPENGL_MINOR 1 -#define OPENGL_PATCH 0 -#define OPENGL_VERSION_STRING "2.1" - -/* To make version comparison easy */ -#define OPENGL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define OPENGL_VERSION_CODE OPENGL_VERSION(OPENGL_MAJOR, OPENGL_MINOR, OPENGL_PATCH) - - -#endif /* VERSION_H */ diff --git a/src/libs/mesa/mesa/main/vsnprintf.c b/src/libs/mesa/mesa/main/vsnprintf.c deleted file mode 100644 index ab6c740d77..0000000000 --- a/src/libs/mesa/mesa/main/vsnprintf.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Revision 12: http://theos.com/~deraadt/snprintf.c - * - * Copyright (c) 1997 Theo de Raadt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __VMS -# include -#endif -#include -#include -#include -#include -#if __STDC__ -#include -#include -#else -#include -#endif -#include -#include -#include - -#ifndef roundup -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) -#endif - -#ifdef __sgi -#define size_t ssize_t -#endif - -static int pgsize; -static char *curobj; -static int caught; -static sigjmp_buf bail; - -#define EXTRABYTES 2 /* XXX: why 2? you don't want to know */ - -static char * -msetup(str, n) - char *str; - size_t n; -{ - char *e; - - if (n == 0) - return NULL; - if (pgsize == 0) - pgsize = getpagesize(); - curobj = (char *)malloc(n + EXTRABYTES + pgsize * 2); - if (curobj == NULL) - return NULL; - e = curobj + n + EXTRABYTES; - e = (char *)roundup((unsigned long)e, pgsize); - if (mprotect(e, pgsize, PROT_NONE) == -1) { - free(curobj); - curobj = NULL; - return NULL; - } - e = e - n - EXTRABYTES; - *e = '\0'; - return (e); -} - -static void - mcatch( int a ) -{ - siglongjmp(bail, 1); -} - -static void -mcleanup(str, n, p) - char *str; - size_t n; - char *p; -{ - strncpy(str, p, n-1); - str[n-1] = '\0'; - if (mprotect((caddr_t)(p + n + EXTRABYTES), pgsize, - PROT_READ|PROT_WRITE|PROT_EXEC) == -1) - mprotect((caddr_t)(p + n + EXTRABYTES), pgsize, - PROT_READ|PROT_WRITE); - free(curobj); -} - -int -#if __STDC__ -vsnprintf(char *str, size_t n, char const *fmt, va_list ap) -#else -vsnprintf(str, n, fmt, ap) - char *str; - size_t n; - char *fmt; - char *ap; -#endif -{ - struct sigaction osa, nsa; - char *p; - int ret = n + 1; /* if we bail, indicated we overflowed */ - - memset(&nsa, 0, sizeof nsa); - nsa.sa_handler = mcatch; - sigemptyset(&nsa.sa_mask); - - p = msetup(str, n); - if (p == NULL) { - *str = '\0'; - return 0; - } - if (sigsetjmp(bail, 1) == 0) { - if (sigaction(SIGSEGV, &nsa, &osa) == -1) { - mcleanup(str, n, p); - return (0); - } - ret = vsprintf(p, fmt, ap); - } - mcleanup(str, n, p); - (void) sigaction(SIGSEGV, &osa, NULL); - return (ret); -} - -int -#if __STDC__ -snprintf(char *str, size_t n, char const *fmt, ...) -#else -snprintf(str, n, fmt, va_alist) - char *str; - size_t n; - char *fmt; - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - - return (vsnprintf(str, n, fmt, ap)); - va_end(ap); -} - - - diff --git a/src/libs/mesa/mesa/main/vtxfmt.c b/src/libs/mesa/mesa/main/vtxfmt.c deleted file mode 100644 index 0204979003..0000000000 --- a/src/libs/mesa/mesa/main/vtxfmt.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - * - * Authors: - * Keith Whitwell - * Gareth Hughes - */ - -#include "glheader.h" -#include "api_loopback.h" -#include "context.h" -#include "imports.h" -#include "mtypes.h" -#include "state.h" -#include "vtxfmt.h" - - -/* The neutral vertex format. This wraps all tnl module functions, - * verifying that the currently-installed module is valid and then - * installing the function pointers in a lazy fashion. It records the - * function pointers that have been swapped out, which allows a fast - * restoration of the neutral module in almost all cases -- a typical - * app might only require 4-6 functions to be modified from the neutral - * baseline, and only restoring these is certainly preferable to doing - * the entire module's 60 or so function pointers. - */ - -#define PRE_LOOPBACK( FUNC ) \ -{ \ - GET_CURRENT_CONTEXT(ctx); \ - struct gl_tnl_module * const tnl = &(ctx->TnlModule); \ - const int tmp_offset = _gloffset_ ## FUNC ; \ - \ - ASSERT( tnl->Current ); \ - ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \ - ASSERT( tmp_offset >= 0 ); \ - \ - /* Save the swapped function's dispatch entry so it can be */ \ - /* restored later. */ \ - tnl->Swapped[tnl->SwapCount].location = & (((_glapi_proc *)ctx->Exec)[tmp_offset]); \ - tnl->Swapped[tnl->SwapCount].function = (_glapi_proc)TAG(FUNC); \ - tnl->SwapCount++; \ - \ - if ( 0 ) \ - _mesa_debug(ctx, " swapping gl" #FUNC"...\n" ); \ - \ - /* Install the tnl function pointer. */ \ - SET_ ## FUNC(ctx->Exec, tnl->Current->FUNC); \ -} - -#define TAG(x) neutral_##x -#include "vtxfmt_tmp.h" - - -/** - * Use the per-vertex functions found in to initialze the given - * API dispatch table. - */ -static void -install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) -{ - SET_ArrayElement(tab, vfmt->ArrayElement); - SET_Color3f(tab, vfmt->Color3f); - SET_Color3fv(tab, vfmt->Color3fv); - SET_Color4f(tab, vfmt->Color4f); - SET_Color4fv(tab, vfmt->Color4fv); - SET_EdgeFlag(tab, vfmt->EdgeFlag); - SET_EvalCoord1f(tab, vfmt->EvalCoord1f); - SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); - SET_EvalCoord2f(tab, vfmt->EvalCoord2f); - SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); - SET_EvalPoint1(tab, vfmt->EvalPoint1); - SET_EvalPoint2(tab, vfmt->EvalPoint2); - SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); - SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); - SET_Indexf(tab, vfmt->Indexf); - SET_Indexfv(tab, vfmt->Indexfv); - SET_Materialfv(tab, vfmt->Materialfv); - SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB); - SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB); - SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB); - SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB); - SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB); - SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB); - SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB); - SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB); - SET_Normal3f(tab, vfmt->Normal3f); - SET_Normal3fv(tab, vfmt->Normal3fv); - SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT); - SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT); - SET_TexCoord1f(tab, vfmt->TexCoord1f); - SET_TexCoord1fv(tab, vfmt->TexCoord1fv); - SET_TexCoord2f(tab, vfmt->TexCoord2f); - SET_TexCoord2fv(tab, vfmt->TexCoord2fv); - SET_TexCoord3f(tab, vfmt->TexCoord3f); - SET_TexCoord3fv(tab, vfmt->TexCoord3fv); - SET_TexCoord4f(tab, vfmt->TexCoord4f); - SET_TexCoord4fv(tab, vfmt->TexCoord4fv); - SET_Vertex2f(tab, vfmt->Vertex2f); - SET_Vertex2fv(tab, vfmt->Vertex2fv); - SET_Vertex3f(tab, vfmt->Vertex3f); - SET_Vertex3fv(tab, vfmt->Vertex3fv); - SET_Vertex4f(tab, vfmt->Vertex4f); - SET_Vertex4fv(tab, vfmt->Vertex4fv); - SET_CallList(tab, vfmt->CallList); - SET_CallLists(tab, vfmt->CallLists); - SET_Begin(tab, vfmt->Begin); - SET_End(tab, vfmt->End); - SET_Rectf(tab, vfmt->Rectf); - SET_DrawArrays(tab, vfmt->DrawArrays); - SET_DrawElements(tab, vfmt->DrawElements); - SET_DrawRangeElements(tab, vfmt->DrawRangeElements); - SET_EvalMesh1(tab, vfmt->EvalMesh1); - SET_EvalMesh2(tab, vfmt->EvalMesh2); - ASSERT(tab->EvalMesh2); - - /* GL_NV_vertex_program */ - SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); - SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); - SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); - SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV); - SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV); - SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV); - SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV); - SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); -#if FEATURE_ARB_vertex_program - SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB); - SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB); - SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB); - SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB); - SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB); - SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB); - SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB); - SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB); -#endif -} - - -void _mesa_init_exec_vtxfmt( GLcontext *ctx ) -{ - install_vtxfmt( ctx->Exec, &neutral_vtxfmt ); - ctx->TnlModule.SwapCount = 0; -} - - -void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) -{ - ctx->TnlModule.Current = vfmt; - _mesa_restore_exec_vtxfmt( ctx ); -} - - -void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) -{ - install_vtxfmt( ctx->Save, vfmt ); -} - - -void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) -{ - struct gl_tnl_module *tnl = &(ctx->TnlModule); - GLuint i; - - /* Restore the neutral tnl module wrapper. - */ - for ( i = 0 ; i < tnl->SwapCount ; i++ ) { - *(tnl->Swapped[i].location) = tnl->Swapped[i].function; - } - - tnl->SwapCount = 0; -} diff --git a/src/libs/mesa/mesa/main/vtxfmt.h b/src/libs/mesa/mesa/main/vtxfmt.h deleted file mode 100644 index 76f108e023..0000000000 --- a/src/libs/mesa/mesa/main/vtxfmt.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * \file vtxfmt.h - * - * \author Keith Whitwell - * \author Gareth Hughes - */ - -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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 _VTXFMT_H_ -#define _VTXFMT_H_ - -extern void _mesa_init_exec_vtxfmt( GLcontext *ctx ); - -extern void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); -extern void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); - -extern void _mesa_restore_exec_vtxfmt( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/main/vtxfmt_tmp.h b/src/libs/mesa/mesa/main/vtxfmt_tmp.h deleted file mode 100644 index 6f5d01e40f..0000000000 --- a/src/libs/mesa/mesa/main/vtxfmt_tmp.h +++ /dev/null @@ -1,530 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - * - * Authors: - * Gareth Hughes - */ - -#ifndef PRE_LOOPBACK -#define PRE_LOOPBACK( FUNC ) -#endif - -#include "glapi/dispatch.h" -#include "glapi/glapioffsets.h" - -static void GLAPIENTRY TAG(ArrayElement)( GLint i ) -{ - PRE_LOOPBACK( ArrayElement ); - CALL_ArrayElement(GET_DISPATCH(), ( i )); -} - -static void GLAPIENTRY TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b ) -{ - PRE_LOOPBACK( Color3f ); - CALL_Color3f(GET_DISPATCH(), ( r, g, b )); -} - -static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Color3fv ); - CALL_Color3fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) -{ - PRE_LOOPBACK( Color4f ); - CALL_Color4f(GET_DISPATCH(), ( r, g, b, a )); -} - -static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Color4fv ); - CALL_Color4fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(EdgeFlag)( GLboolean e ) -{ - PRE_LOOPBACK( EdgeFlag ); - CALL_EdgeFlag(GET_DISPATCH(), ( e )); -} - -static void GLAPIENTRY TAG(EvalCoord1f)( GLfloat s ) -{ - PRE_LOOPBACK( EvalCoord1f ); - CALL_EvalCoord1f(GET_DISPATCH(), ( s )); -} - -static void GLAPIENTRY TAG(EvalCoord1fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( EvalCoord1fv ); - CALL_EvalCoord1fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(EvalCoord2f)( GLfloat s, GLfloat t ) -{ - PRE_LOOPBACK( EvalCoord2f ); - CALL_EvalCoord2f(GET_DISPATCH(), ( s, t )); -} - -static void GLAPIENTRY TAG(EvalCoord2fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( EvalCoord2fv ); - CALL_EvalCoord2fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(EvalPoint1)( GLint i ) -{ - PRE_LOOPBACK( EvalPoint1 ); - CALL_EvalPoint1(GET_DISPATCH(), ( i )); -} - -static void GLAPIENTRY TAG(EvalPoint2)( GLint i, GLint j ) -{ - PRE_LOOPBACK( EvalPoint2 ); - CALL_EvalPoint2(GET_DISPATCH(), ( i, j )); -} - -static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat f ) -{ - PRE_LOOPBACK( FogCoordfEXT ); - CALL_FogCoordfEXT(GET_DISPATCH(), ( f )); -} - -static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v ) -{ - PRE_LOOPBACK( FogCoordfvEXT ); - CALL_FogCoordfvEXT(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(Indexf)( GLfloat f ) -{ - PRE_LOOPBACK( Indexf ); - CALL_Indexf(GET_DISPATCH(), ( f )); -} - -static void GLAPIENTRY TAG(Indexfv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Indexfv ); - CALL_Indexfv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v ) -{ - PRE_LOOPBACK( Materialfv ); - CALL_Materialfv(GET_DISPATCH(), ( face, pname, v )); -} - -static void GLAPIENTRY TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a ) -{ - PRE_LOOPBACK( MultiTexCoord1fARB ); - CALL_MultiTexCoord1fARB(GET_DISPATCH(), ( target, a )); -} - -static void GLAPIENTRY TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc ) -{ - PRE_LOOPBACK( MultiTexCoord1fvARB ); - CALL_MultiTexCoord1fvARB(GET_DISPATCH(), ( target, tc )); -} - -static void GLAPIENTRY TAG(MultiTexCoord2fARB)( GLenum target, GLfloat s, GLfloat t ) -{ - PRE_LOOPBACK( MultiTexCoord2fARB ); - CALL_MultiTexCoord2fARB(GET_DISPATCH(), ( target, s, t )); -} - -static void GLAPIENTRY TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc ) -{ - PRE_LOOPBACK( MultiTexCoord2fvARB ); - CALL_MultiTexCoord2fvARB(GET_DISPATCH(), ( target, tc )); -} - -static void GLAPIENTRY TAG(MultiTexCoord3fARB)( GLenum target, GLfloat s, - GLfloat t, GLfloat r ) -{ - PRE_LOOPBACK( MultiTexCoord3fARB ); - CALL_MultiTexCoord3fARB(GET_DISPATCH(), ( target, s, t, r )); -} - -static void GLAPIENTRY TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc ) -{ - PRE_LOOPBACK( MultiTexCoord3fvARB ); - CALL_MultiTexCoord3fvARB(GET_DISPATCH(), ( target, tc )); -} - -static void GLAPIENTRY TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s, - GLfloat t, GLfloat r, GLfloat q ) -{ - PRE_LOOPBACK( MultiTexCoord4fARB ); - CALL_MultiTexCoord4fARB(GET_DISPATCH(), ( target, s, t, r, q )); -} - -static void GLAPIENTRY TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc ) -{ - PRE_LOOPBACK( MultiTexCoord4fvARB ); - CALL_MultiTexCoord4fvARB(GET_DISPATCH(), ( target, tc )); -} - -static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - PRE_LOOPBACK( Normal3f ); - CALL_Normal3f(GET_DISPATCH(), ( x, y, z )); -} - -static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Normal3fv ); - CALL_Normal3fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat r, GLfloat g, GLfloat b ) -{ - PRE_LOOPBACK( SecondaryColor3fEXT ); - CALL_SecondaryColor3fEXT(GET_DISPATCH(), ( r, g, b )); -} - -static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v ) -{ - PRE_LOOPBACK( SecondaryColor3fvEXT ); - CALL_SecondaryColor3fvEXT(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(TexCoord1f)( GLfloat s ) -{ - PRE_LOOPBACK( TexCoord1f ); - CALL_TexCoord1f(GET_DISPATCH(), ( s )); -} - -static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *tc ) -{ - PRE_LOOPBACK( TexCoord1fv ); - CALL_TexCoord1fv(GET_DISPATCH(), ( tc )); -} - -static void GLAPIENTRY TAG(TexCoord2f)( GLfloat s, GLfloat t ) -{ - PRE_LOOPBACK( TexCoord2f ); - CALL_TexCoord2f(GET_DISPATCH(), ( s, t )); -} - -static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *tc ) -{ - PRE_LOOPBACK( TexCoord2fv ); - CALL_TexCoord2fv(GET_DISPATCH(), ( tc )); -} - -static void GLAPIENTRY TAG(TexCoord3f)( GLfloat s, GLfloat t, GLfloat r ) -{ - PRE_LOOPBACK( TexCoord3f ); - CALL_TexCoord3f(GET_DISPATCH(), ( s, t, r )); -} - -static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *tc ) -{ - PRE_LOOPBACK( TexCoord3fv ); - CALL_TexCoord3fv(GET_DISPATCH(), ( tc )); -} - -static void GLAPIENTRY TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) -{ - PRE_LOOPBACK( TexCoord4f ); - CALL_TexCoord4f(GET_DISPATCH(), ( s, t, r, q )); -} - -static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *tc ) -{ - PRE_LOOPBACK( TexCoord4fv ); - CALL_TexCoord4fv(GET_DISPATCH(), ( tc )); -} - -static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y ) -{ - PRE_LOOPBACK( Vertex2f ); - CALL_Vertex2f(GET_DISPATCH(), ( x, y )); -} - -static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Vertex2fv ); - CALL_Vertex2fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - PRE_LOOPBACK( Vertex3f ); - CALL_Vertex3f(GET_DISPATCH(), ( x, y, z )); -} - -static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Vertex3fv ); - CALL_Vertex3fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - PRE_LOOPBACK( Vertex4f ); - CALL_Vertex4f(GET_DISPATCH(), ( x, y, z, w )); -} - -static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v ) -{ - PRE_LOOPBACK( Vertex4fv ); - CALL_Vertex4fv(GET_DISPATCH(), ( v )); -} - -static void GLAPIENTRY TAG(CallList)( GLuint i ) -{ - PRE_LOOPBACK( CallList ); - CALL_CallList(GET_DISPATCH(), ( i )); -} - -static void GLAPIENTRY TAG(CallLists)( GLsizei sz, GLenum type, const GLvoid *v ) -{ - PRE_LOOPBACK( CallLists ); - CALL_CallLists(GET_DISPATCH(), ( sz, type, v )); -} - -static void GLAPIENTRY TAG(Begin)( GLenum mode ) -{ - PRE_LOOPBACK( Begin ); - CALL_Begin(GET_DISPATCH(), ( mode )); -} - -static void GLAPIENTRY TAG(End)( void ) -{ - PRE_LOOPBACK( End ); - CALL_End(GET_DISPATCH(), ()); -} - -static void GLAPIENTRY TAG(Rectf)( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - PRE_LOOPBACK( Rectf ); - CALL_Rectf(GET_DISPATCH(), ( x1, y1, x2, y2 )); -} - -static void GLAPIENTRY TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count ) -{ - PRE_LOOPBACK( DrawArrays ); - CALL_DrawArrays(GET_DISPATCH(), ( mode, start, count )); -} - -static void GLAPIENTRY TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices ) -{ - PRE_LOOPBACK( DrawElements ); - CALL_DrawElements(GET_DISPATCH(), ( mode, count, type, indices )); -} - -static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ) -{ - PRE_LOOPBACK( DrawRangeElements ); - CALL_DrawRangeElements(GET_DISPATCH(), ( mode, start, end, count, type, indices )); -} - -static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 ) -{ - PRE_LOOPBACK( EvalMesh1 ); - CALL_EvalMesh1(GET_DISPATCH(), ( mode, i1, i2 )); -} - -static void GLAPIENTRY TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2, - GLint j1, GLint j2 ) -{ - PRE_LOOPBACK( EvalMesh2 ); - CALL_EvalMesh2(GET_DISPATCH(), ( mode, i1, i2, j1, j2 )); -} - -static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x ) -{ - PRE_LOOPBACK( VertexAttrib1fNV ); - CALL_VertexAttrib1fNV(GET_DISPATCH(), ( index, x )); -} - -static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib1fvNV ); - CALL_VertexAttrib1fvNV(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y ) -{ - PRE_LOOPBACK( VertexAttrib2fNV ); - CALL_VertexAttrib2fNV(GET_DISPATCH(), ( index, x, y )); -} - -static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib2fvNV ); - CALL_VertexAttrib2fvNV(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z ) -{ - PRE_LOOPBACK( VertexAttrib3fNV ); - CALL_VertexAttrib3fNV(GET_DISPATCH(), ( index, x, y, z )); -} - -static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib3fvNV ); - CALL_VertexAttrib3fvNV(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - PRE_LOOPBACK( VertexAttrib4fNV ); - CALL_VertexAttrib4fNV(GET_DISPATCH(), ( index, x, y, z, w )); -} - -static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib4fvNV ); - CALL_VertexAttrib4fvNV(GET_DISPATCH(), ( index, v )); -} - - -static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x ) -{ - PRE_LOOPBACK( VertexAttrib1fARB ); - CALL_VertexAttrib1fARB(GET_DISPATCH(), ( index, x )); -} - -static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib1fvARB ); - CALL_VertexAttrib1fvARB(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y ) -{ - PRE_LOOPBACK( VertexAttrib2fARB ); - CALL_VertexAttrib2fARB(GET_DISPATCH(), ( index, x, y )); -} - -static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib2fvARB ); - CALL_VertexAttrib2fvARB(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z ) -{ - PRE_LOOPBACK( VertexAttrib3fARB ); - CALL_VertexAttrib3fARB(GET_DISPATCH(), ( index, x, y, z )); -} - -static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib3fvARB ); - CALL_VertexAttrib3fvARB(GET_DISPATCH(), ( index, v )); -} - -static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - PRE_LOOPBACK( VertexAttrib4fARB ); - CALL_VertexAttrib4fARB(GET_DISPATCH(), ( index, x, y, z, w )); -} - -static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index, const GLfloat *v ) -{ - PRE_LOOPBACK( VertexAttrib4fvARB ); - CALL_VertexAttrib4fvARB(GET_DISPATCH(), ( index, v )); -} - - -static GLvertexformat TAG(vtxfmt) = { - TAG(ArrayElement), - TAG(Color3f), - TAG(Color3fv), - TAG(Color4f), - TAG(Color4fv), - TAG(EdgeFlag), - TAG(EvalCoord1f), - TAG(EvalCoord1fv), - TAG(EvalCoord2f), - TAG(EvalCoord2fv), - TAG(EvalPoint1), - TAG(EvalPoint2), - TAG(FogCoordfEXT), - TAG(FogCoordfvEXT), - TAG(Indexf), - TAG(Indexfv), - TAG(Materialfv), - TAG(MultiTexCoord1fARB), - TAG(MultiTexCoord1fvARB), - TAG(MultiTexCoord2fARB), - TAG(MultiTexCoord2fvARB), - TAG(MultiTexCoord3fARB), - TAG(MultiTexCoord3fvARB), - TAG(MultiTexCoord4fARB), - TAG(MultiTexCoord4fvARB), - TAG(Normal3f), - TAG(Normal3fv), - TAG(SecondaryColor3fEXT), - TAG(SecondaryColor3fvEXT), - TAG(TexCoord1f), - TAG(TexCoord1fv), - TAG(TexCoord2f), - TAG(TexCoord2fv), - TAG(TexCoord3f), - TAG(TexCoord3fv), - TAG(TexCoord4f), - TAG(TexCoord4fv), - TAG(Vertex2f), - TAG(Vertex2fv), - TAG(Vertex3f), - TAG(Vertex3fv), - TAG(Vertex4f), - TAG(Vertex4fv), - TAG(CallList), - TAG(CallLists), - TAG(Begin), - TAG(End), - TAG(VertexAttrib1fNV), - TAG(VertexAttrib1fvNV), - TAG(VertexAttrib2fNV), - TAG(VertexAttrib2fvNV), - TAG(VertexAttrib3fNV), - TAG(VertexAttrib3fvNV), - TAG(VertexAttrib4fNV), - TAG(VertexAttrib4fvNV), - TAG(VertexAttrib1fARB), - TAG(VertexAttrib1fvARB), - TAG(VertexAttrib2fARB), - TAG(VertexAttrib2fvARB), - TAG(VertexAttrib3fARB), - TAG(VertexAttrib3fvARB), - TAG(VertexAttrib4fARB), - TAG(VertexAttrib4fvARB), - TAG(Rectf), - TAG(DrawArrays), - TAG(DrawElements), - TAG(DrawRangeElements), - TAG(EvalMesh1), - TAG(EvalMesh2) -}; - -#undef TAG -#undef PRE_LOOPBACK diff --git a/src/libs/mesa/mesa/math/m_clip_tmp.h b/src/libs/mesa/mesa/math/m_clip_tmp.h deleted file mode 100644 index f3a589be05..0000000000 --- a/src/libs/mesa/mesa/math/m_clip_tmp.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -/* KW: a clever asm implementation would nestle integer versions - * of the outcode calculation underneath the division. Gcc won't - * do this, strangely enough, so I only do the divide in - * the case where the cliptest passes. This isn't essential, - * and an asm implementation needn't replicate that behaviour. - * - * \param clip_vec vector of incoming clip-space coords - * \param proj_vec vector of resultant NDC-space projected coords - * \param clipMask resulting array of clip flags - * \param orMask bitwise-OR of clipMask values - * \param andMask bitwise-AND of clipMask values - * \return proj_vec pointer - */ -static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLfloat *from = (GLfloat *)clip_vec->start; - const GLuint count = clip_vec->count; - GLuint c = 0; - GLfloat (*vProj)[4] = (GLfloat (*)[4])proj_vec->start; - GLubyte tmpAndMask = *andMask; - GLubyte tmpOrMask = *orMask; - GLuint i; - STRIDE_LOOP { - const GLfloat cx = from[0]; - const GLfloat cy = from[1]; - const GLfloat cz = from[2]; - const GLfloat cw = from[3]; -#if defined(macintosh) || defined(__powerpc__) - /* on powerpc cliptest is 17% faster in this way. */ - GLuint mask; - mask = (((cw < cx) << CLIP_RIGHT_SHIFT)); - mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); - mask |= (((cw < cy) << CLIP_TOP_SHIFT)); - mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); -#else /* !defined(macintosh)) */ - GLubyte mask = 0; - if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; - if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; - if (-cy + cw < 0) mask |= CLIP_TOP_BIT; - if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; -#endif /* defined(macintosh) */ - - clipMask[i] = mask; - if (mask) { - c++; - tmpAndMask &= mask; - tmpOrMask |= mask; - vProj[i][0] = 0; - vProj[i][1] = 0; - vProj[i][2] = 0; - vProj[i][3] = 1; - } else { - GLfloat oow = 1.0F / cw; - vProj[i][0] = cx * oow; - vProj[i][1] = cy * oow; - vProj[i][2] = cz * oow; - vProj[i][3] = oow; - } - } - - *orMask = tmpOrMask; - *andMask = (GLubyte) (c < count ? 0 : tmpAndMask); - - proj_vec->flags |= VEC_SIZE_4; - proj_vec->size = 4; - proj_vec->count = clip_vec->count; - return proj_vec; -} - - - -/* - * \param clip_vec vector of incoming clip-space coords - * \param proj_vec vector of resultant NDC-space projected coords - * \param clipMask resulting array of clip flags - * \param orMask bitwise-OR of clipMask values - * \param andMask bitwise-AND of clipMask values - * \return clip_vec pointer - */ -static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - GLuint c = 0; - GLubyte tmpAndMask = *andMask; - GLubyte tmpOrMask = *orMask; - GLuint i; - (void) proj_vec; - STRIDE_LOOP { - const GLfloat cx = from[0]; - const GLfloat cy = from[1]; - const GLfloat cz = from[2]; - const GLfloat cw = from[3]; -#if defined(macintosh) || defined(__powerpc__) - /* on powerpc cliptest is 17% faster in this way. */ - GLuint mask; - mask = (((cw < cx) << CLIP_RIGHT_SHIFT)); - mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); - mask |= (((cw < cy) << CLIP_TOP_SHIFT)); - mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); -#else /* !defined(macintosh)) */ - GLubyte mask = 0; - if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; - if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; - if (-cy + cw < 0) mask |= CLIP_TOP_BIT; - if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; -#endif /* defined(macintosh) */ - - clipMask[i] = mask; - if (mask) { - c++; - tmpAndMask &= mask; - tmpOrMask |= mask; - } - } - - *orMask = tmpOrMask; - *andMask = (GLubyte) (c < count ? 0 : tmpAndMask); - return clip_vec; -} - - -static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - GLubyte tmpOrMask = *orMask; - GLubyte tmpAndMask = *andMask; - GLuint i; - (void) proj_vec; - STRIDE_LOOP { - const GLfloat cx = from[0], cy = from[1], cz = from[2]; - GLubyte mask = 0; - if (cx > 1.0) mask |= CLIP_RIGHT_BIT; - else if (cx < -1.0) mask |= CLIP_LEFT_BIT; - if (cy > 1.0) mask |= CLIP_TOP_BIT; - else if (cy < -1.0) mask |= CLIP_BOTTOM_BIT; - if (cz > 1.0) mask |= CLIP_FAR_BIT; - else if (cz < -1.0) mask |= CLIP_NEAR_BIT; - clipMask[i] = mask; - tmpOrMask |= mask; - tmpAndMask &= mask; - } - - *orMask = tmpOrMask; - *andMask = tmpAndMask; - return clip_vec; -} - - -static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - GLubyte tmpOrMask = *orMask; - GLubyte tmpAndMask = *andMask; - GLuint i; - (void) proj_vec; - STRIDE_LOOP { - const GLfloat cx = from[0], cy = from[1]; - GLubyte mask = 0; - if (cx > 1.0) mask |= CLIP_RIGHT_BIT; - else if (cx < -1.0) mask |= CLIP_LEFT_BIT; - if (cy > 1.0) mask |= CLIP_TOP_BIT; - else if (cy < -1.0) mask |= CLIP_BOTTOM_BIT; - clipMask[i] = mask; - tmpOrMask |= mask; - tmpAndMask &= mask; - } - - *orMask = tmpOrMask; - *andMask = tmpAndMask; - return clip_vec; -} - - -static void TAG(init_c_cliptest)( void ) -{ - _mesa_clip_tab[4] = TAG(cliptest_points4); - _mesa_clip_tab[3] = TAG(cliptest_points3); - _mesa_clip_tab[2] = TAG(cliptest_points2); - - _mesa_clip_np_tab[4] = TAG(cliptest_np_points4); - _mesa_clip_np_tab[3] = TAG(cliptest_points3); - _mesa_clip_np_tab[2] = TAG(cliptest_points2); -} diff --git a/src/libs/mesa/mesa/math/m_copy_tmp.h b/src/libs/mesa/mesa/math/m_copy_tmp.h deleted file mode 100644 index 07ab1f7b2a..0000000000 --- a/src/libs/mesa/mesa/math/m_copy_tmp.h +++ /dev/null @@ -1,86 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -#define COPY_FUNC( BITS ) \ -static void TAG2(copy, BITS)( GLvector4f *to, const GLvector4f *f ) \ -{ \ - GLfloat (*t)[4] = (GLfloat (*)[4])to->start; \ - GLfloat *from = f->start; \ - GLuint stride = f->stride; \ - GLuint count = to->count; \ - GLuint i; \ - \ - if (BITS) \ - STRIDE_LOOP { \ - if (BITS&1) t[i][0] = from[0]; \ - if (BITS&2) t[i][1] = from[1]; \ - if (BITS&4) t[i][2] = from[2]; \ - if (BITS&8) t[i][3] = from[3]; \ - } \ -} - -/* We got them all here: - */ -COPY_FUNC( 0x0 ) /* noop */ -COPY_FUNC( 0x1 ) -COPY_FUNC( 0x2 ) -COPY_FUNC( 0x3 ) -COPY_FUNC( 0x4 ) -COPY_FUNC( 0x5 ) -COPY_FUNC( 0x6 ) -COPY_FUNC( 0x7 ) -COPY_FUNC( 0x8 ) -COPY_FUNC( 0x9 ) -COPY_FUNC( 0xa ) -COPY_FUNC( 0xb ) -COPY_FUNC( 0xc ) -COPY_FUNC( 0xd ) -COPY_FUNC( 0xe ) -COPY_FUNC( 0xf ) - -static void TAG2(init_copy, 0)( void ) -{ - _mesa_copy_tab[0x0] = TAG2(copy, 0x0); - _mesa_copy_tab[0x1] = TAG2(copy, 0x1); - _mesa_copy_tab[0x2] = TAG2(copy, 0x2); - _mesa_copy_tab[0x3] = TAG2(copy, 0x3); - _mesa_copy_tab[0x4] = TAG2(copy, 0x4); - _mesa_copy_tab[0x5] = TAG2(copy, 0x5); - _mesa_copy_tab[0x6] = TAG2(copy, 0x6); - _mesa_copy_tab[0x7] = TAG2(copy, 0x7); - _mesa_copy_tab[0x8] = TAG2(copy, 0x8); - _mesa_copy_tab[0x9] = TAG2(copy, 0x9); - _mesa_copy_tab[0xa] = TAG2(copy, 0xa); - _mesa_copy_tab[0xb] = TAG2(copy, 0xb); - _mesa_copy_tab[0xc] = TAG2(copy, 0xc); - _mesa_copy_tab[0xd] = TAG2(copy, 0xd); - _mesa_copy_tab[0xe] = TAG2(copy, 0xe); - _mesa_copy_tab[0xf] = TAG2(copy, 0xf); -} diff --git a/src/libs/mesa/mesa/math/m_debug.h b/src/libs/mesa/mesa/math/m_debug.h deleted file mode 100644 index 6476b6de28..0000000000 --- a/src/libs/mesa/mesa/math/m_debug.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - */ - -#ifndef __M_DEBUG_H__ -#define __M_DEBUG_H__ - -extern void _math_test_all_transform_functions( char *description ); -extern void _math_test_all_normal_transform_functions( char *description ); -extern void _math_test_all_cliptest_functions( char *description ); - -/* Deprecated? - */ -extern void _math_test_all_vertex_functions( char *description ); - -extern char *mesa_profile; - -#endif diff --git a/src/libs/mesa/mesa/math/m_debug_clip.c b/src/libs/mesa/mesa/math/m_debug_clip.c deleted file mode 100644 index 460fed4a75..0000000000 --- a/src/libs/mesa/mesa/math/m_debug_clip.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2005 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. - * - * Authors: - * Gareth Hughes - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "m_matrix.h" -#include "m_xform.h" - -#include "m_debug.h" -#include "m_debug_util.h" - -#ifdef __UNIXOS2__ -/* The linker doesn't like empty files */ -static char dummy; -#endif - -#ifdef DEBUG_MATH /* This code only used for debugging */ - -static clip_func *clip_tab[2] = { - _mesa_clip_tab, - _mesa_clip_np_tab -}; -static char *cnames[2] = { - "_mesa_clip_tab", - "_mesa_clip_np_tab" -}; -#ifdef RUN_DEBUG_BENCHMARK -static char *cstrings[2] = { - "clip, perspective divide", - "clip, no divide" -}; -#endif - - -/* ============================================================= - * Reference cliptests - */ - -static GLvector4f *ref_cliptest_points4( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - GLuint c = 0; - GLfloat (*vProj)[4] = (GLfloat (*)[4])proj_vec->start; - GLubyte tmpAndMask = *andMask; - GLubyte tmpOrMask = *orMask; - GLuint i; - for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) { - const GLfloat cx = from[0]; - const GLfloat cy = from[1]; - const GLfloat cz = from[2]; - const GLfloat cw = from[3]; - GLubyte mask = 0; - if ( -cx + cw < 0 ) mask |= CLIP_RIGHT_BIT; - if ( cx + cw < 0 ) mask |= CLIP_LEFT_BIT; - if ( -cy + cw < 0 ) mask |= CLIP_TOP_BIT; - if ( cy + cw < 0 ) mask |= CLIP_BOTTOM_BIT; - if ( -cz + cw < 0 ) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0 ) mask |= CLIP_NEAR_BIT; - clipMask[i] = mask; - if ( mask ) { - c++; - tmpAndMask &= mask; - tmpOrMask |= mask; - vProj[i][0] = 0; - vProj[i][1] = 0; - vProj[i][2] = 0; - vProj[i][3] = 1; - } else { - GLfloat oow = 1.0F / cw; - vProj[i][0] = cx * oow; - vProj[i][1] = cy * oow; - vProj[i][2] = cz * oow; - vProj[i][3] = oow; - } - } - - *orMask = tmpOrMask; - *andMask = (GLubyte) (c < count ? 0 : tmpAndMask); - - proj_vec->flags |= VEC_SIZE_4; - proj_vec->size = 4; - proj_vec->count = clip_vec->count; - return proj_vec; -} - -/* Keep these here for now, even though we don't use them... - */ -static GLvector4f *ref_cliptest_points3( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - - GLubyte tmpOrMask = *orMask; - GLubyte tmpAndMask = *andMask; - GLuint i; - for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) { - const GLfloat cx = from[0], cy = from[1], cz = from[2]; - GLubyte mask = 0; - if ( cx > 1.0 ) mask |= CLIP_RIGHT_BIT; - else if ( cx < -1.0 ) mask |= CLIP_LEFT_BIT; - if ( cy > 1.0 ) mask |= CLIP_TOP_BIT; - else if ( cy < -1.0 ) mask |= CLIP_BOTTOM_BIT; - if ( cz > 1.0 ) mask |= CLIP_FAR_BIT; - else if ( cz < -1.0 ) mask |= CLIP_NEAR_BIT; - clipMask[i] = mask; - tmpOrMask |= mask; - tmpAndMask &= mask; - } - - *orMask = tmpOrMask; - *andMask = tmpAndMask; - return clip_vec; -} - -static GLvector4f * ref_cliptest_points2( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ) -{ - const GLuint stride = clip_vec->stride; - const GLuint count = clip_vec->count; - const GLfloat *from = (GLfloat *)clip_vec->start; - - GLubyte tmpOrMask = *orMask; - GLubyte tmpAndMask = *andMask; - GLuint i; - for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) { - const GLfloat cx = from[0], cy = from[1]; - GLubyte mask = 0; - if ( cx > 1.0 ) mask |= CLIP_RIGHT_BIT; - else if ( cx < -1.0 ) mask |= CLIP_LEFT_BIT; - if ( cy > 1.0 ) mask |= CLIP_TOP_BIT; - else if ( cy < -1.0 ) mask |= CLIP_BOTTOM_BIT; - clipMask[i] = mask; - tmpOrMask |= mask; - tmpAndMask &= mask; - } - - *orMask = tmpOrMask; - *andMask = tmpAndMask; - return clip_vec; -} - -static clip_func ref_cliptest[5] = { - 0, - 0, - ref_cliptest_points2, - ref_cliptest_points3, - ref_cliptest_points4 -}; - - -/* ============================================================= - * Cliptest tests - */ - -ALIGN16(static GLfloat, s[TEST_COUNT][4]); -ALIGN16(static GLfloat, d[TEST_COUNT][4]); -ALIGN16(static GLfloat, r[TEST_COUNT][4]); - - -static int test_cliptest_function( clip_func func, int np, - int psize, long *cycles ) -{ - GLvector4f source[1], dest[1], ref[1]; - GLubyte dm[TEST_COUNT], dco, dca; - GLubyte rm[TEST_COUNT], rco, rca; - int i, j; -#ifdef RUN_DEBUG_BENCHMARK - int cycle_i; /* the counter for the benchmarks we run */ -#endif - - (void) cycles; - - if ( psize > 4 ) { - _mesa_problem( NULL, "test_cliptest_function called with psize > 4\n" ); - return 0; - } - - for ( i = 0 ; i < TEST_COUNT ; i++) { - ASSIGN_4V( d[i], 0.0, 0.0, 0.0, 1.0 ); - ASSIGN_4V( s[i], 0.0, 0.0, 0.0, 1.0 ); - for ( j = 0 ; j < psize ; j++ ) - s[i][j] = rnd(); - } - - source->data = (GLfloat(*)[4])s; - source->start = (GLfloat *)s; - source->count = TEST_COUNT; - source->stride = sizeof(s[0]); - source->size = 4; - source->flags = 0; - - dest->data = (GLfloat(*)[4])d; - dest->start = (GLfloat *)d; - dest->count = TEST_COUNT; - dest->stride = sizeof(float[4]); - dest->size = 0; - dest->flags = 0; - - ref->data = (GLfloat(*)[4])r; - ref->start = (GLfloat *)r; - ref->count = TEST_COUNT; - ref->stride = sizeof(float[4]); - ref->size = 0; - ref->flags = 0; - - dco = rco = 0; - dca = rca = CLIP_FRUSTUM_BITS; - - ref_cliptest[psize]( source, ref, rm, &rco, &rca ); - - if ( mesa_profile ) { - BEGIN_RACE( *cycles ); - func( source, dest, dm, &dco, &dca ); - END_RACE( *cycles ); - } - else { - func( source, dest, dm, &dco, &dca ); - } - - if ( dco != rco ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco ); - return 0; - } - if ( dca != rca ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca ); - return 0; - } - for ( i = 0 ; i < TEST_COUNT ; i++ ) { - if ( dm[i] != rm[i] ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i)\n", i ); - _mesa_printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); - return 0; - } - } - - /* Only verify output on projected points4 case. FIXME: Do we need - * to test other cases? - */ - if ( np || psize < 4 ) - return 1; - - for ( i = 0 ; i < TEST_COUNT ; i++ ) { - for ( j = 0 ; j < 4 ; j++ ) { - if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n", - i, j, dm[i], rm[i] ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][0], r[i][0], r[i][0]-d[i][0], - MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][1], r[i][1], r[i][1]-d[i][1], - MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][2], r[i][2], r[i][2]-d[i][2], - MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][3], r[i][3], r[i][3]-d[i][3], - MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); - return 0; - } - } - } - - return 1; -} - -void _math_test_all_cliptest_functions( char *description ) -{ - int np, psize; - long benchmark_tab[2][4]; - static int first_time = 1; - - if ( first_time ) { - first_time = 0; - mesa_profile = _mesa_getenv( "MESA_PROFILE" ); - } - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - if ( !counter_overhead ) { - INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); - } - _mesa_printf( "cliptest results after hooking in %s functions:\n", description ); - } -#endif - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - _mesa_printf( "\n\t" ); - for ( psize = 2 ; psize <= 4 ; psize++ ) { - _mesa_printf( " p%d\t", psize ); - } - _mesa_printf( "\n--------------------------------------------------------\n\t" ); - } -#endif - - for ( np = 0 ; np < 2 ; np++ ) { - for ( psize = 2 ; psize <= 4 ; psize++ ) { - clip_func func = clip_tab[np][psize]; - long *cycles = &(benchmark_tab[np][psize-1]); - - if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) { - char buf[100]; - _mesa_sprintf( buf, "%s[%d] failed test (%s)", - cnames[np], psize, description ); - _mesa_problem( NULL, buf ); - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf( " %li\t", benchmark_tab[np][psize-1] ); -#endif - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf( " | [%s]\n\t", cstrings[np] ); -#endif - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf( "\n" ); -#endif -} - - -#endif /* DEBUG_MATH */ diff --git a/src/libs/mesa/mesa/math/m_debug_norm.c b/src/libs/mesa/mesa/math/m_debug_norm.c deleted file mode 100644 index 89c632e7d5..0000000000 --- a/src/libs/mesa/mesa/math/m_debug_norm.c +++ /dev/null @@ -1,383 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - * - * Authors: - * Gareth Hughes - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "m_matrix.h" -#include "m_xform.h" - -#include "m_debug.h" -#include "m_debug_util.h" - - -#ifdef __UNIXOS2__ -/* The linker doesn't like empty files */ -static char dummy; -#endif - -#ifdef DEBUG_MATH /* This code only used for debugging */ - - -static int m_norm_identity[16] = { - ONE, NIL, NIL, NIL, - NIL, ONE, NIL, NIL, - NIL, NIL, ONE, NIL, - NIL, NIL, NIL, NIL -}; -static int m_norm_general[16] = { - VAR, VAR, VAR, NIL, - VAR, VAR, VAR, NIL, - VAR, VAR, VAR, NIL, - NIL, NIL, NIL, NIL -}; -static int m_norm_no_rot[16] = { - VAR, NIL, NIL, NIL, - NIL, VAR, NIL, NIL, - NIL, NIL, VAR, NIL, - NIL, NIL, NIL, NIL -}; -static int *norm_templates[8] = { - m_norm_no_rot, - m_norm_no_rot, - m_norm_no_rot, - m_norm_general, - m_norm_general, - m_norm_general, - m_norm_identity, - m_norm_identity -}; -static int norm_types[8] = { - NORM_TRANSFORM_NO_ROT, - NORM_TRANSFORM_NO_ROT | NORM_RESCALE, - NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE, - NORM_TRANSFORM, - NORM_TRANSFORM | NORM_RESCALE, - NORM_TRANSFORM | NORM_NORMALIZE, - NORM_RESCALE, - NORM_NORMALIZE -}; -static int norm_scale_types[8] = { /* rescale factor */ - NIL, /* NIL disables rescaling */ - VAR, - NIL, - NIL, - VAR, - NIL, - VAR, - NIL -}; -static int norm_normalize_types[8] = { /* normalizing ?? (no = 0) */ - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1 -}; -static char *norm_strings[8] = { - "NORM_TRANSFORM_NO_ROT", - "NORM_TRANSFORM_NO_ROT | NORM_RESCALE", - "NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE", - "NORM_TRANSFORM", - "NORM_TRANSFORM | NORM_RESCALE", - "NORM_TRANSFORM | NORM_NORMALIZE", - "NORM_RESCALE", - "NORM_NORMALIZE" -}; - - -/* ============================================================= - * Reference transformations - */ - -static void ref_norm_transform_rescale( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLuint i; - const GLfloat *s = in->start; - const GLfloat *m = mat->inv; - GLfloat (*out)[4] = (GLfloat (*)[4]) dest->start; - - (void) lengths; - - for ( i = 0 ; i < in->count ; i++ ) { - GLfloat t[3]; - - TRANSFORM_NORMAL( t, s, m ); - SCALE_SCALAR_3V( out[i], scale, t ); - - s = (GLfloat *)((char *)s + in->stride); - } -} - -static void ref_norm_transform_normalize( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLuint i; - const GLfloat *s = in->start; - const GLfloat *m = mat->inv; - GLfloat (*out)[4] = (GLfloat (*)[4]) dest->start; - - for ( i = 0 ; i < in->count ; i++ ) { - GLfloat t[3]; - - TRANSFORM_NORMAL( t, s, m ); - - if ( !lengths ) { - GLfloat len = LEN_SQUARED_3FV( t ); - if ( len > 1e-20 ) { - /* Hmmm, don't know how we could test the precalculated - * length case... - */ - scale = 1.0 / SQRTF( len ); - SCALE_SCALAR_3V( out[i], scale, t ); - } else { - out[i][0] = out[i][1] = out[i][2] = 0; - } - } else { - scale = lengths[i];; - SCALE_SCALAR_3V( out[i], scale, t ); - } - - s = (GLfloat *)((char *)s + in->stride); - } -} - - -/* ============================================================= - * Normal transformation tests - */ - -static void init_matrix( GLfloat *m ) -{ - m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0; - m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] = 7.0; - m[2] = 44.0; m[6] = 9.0; m[10] = 7.0; m[14] = 3.0; - m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0; -} - - -static int test_norm_function( normal_func func, int mtype, long *cycles ) -{ - GLvector4f source[1], dest[1], dest2[1], ref[1], ref2[1]; - GLmatrix mat[1]; - GLfloat s[TEST_COUNT][5], d[TEST_COUNT][4], r[TEST_COUNT][4]; - GLfloat d2[TEST_COUNT][4], r2[TEST_COUNT][4], length[TEST_COUNT]; - GLfloat scale; - GLfloat *m; - int i, j; -#ifdef RUN_DEBUG_BENCHMARK - int cycle_i; /* the counter for the benchmarks we run */ -#endif - - (void) cycles; - - mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); - mat->inv = m = mat->m; - - init_matrix( m ); - - scale = 1.0F + rnd () * norm_scale_types[mtype]; - - for ( i = 0 ; i < 4 ; i++ ) { - for ( j = 0 ; j < 4 ; j++ ) { - switch ( norm_templates[mtype][i * 4 + j] ) { - case NIL: - m[j * 4 + i] = 0.0; - break; - case ONE: - m[j * 4 + i] = 1.0; - break; - case NEG: - m[j * 4 + i] = -1.0; - break; - case VAR: - break; - default: - _mesa_exit(1); - } - } - } - - for ( i = 0 ; i < TEST_COUNT ; i++ ) { - ASSIGN_3V( d[i], 0.0, 0.0, 0.0 ); - ASSIGN_3V( s[i], 0.0, 0.0, 0.0 ); - ASSIGN_3V( d2[i], 0.0, 0.0, 0.0 ); - for ( j = 0 ; j < 3 ; j++ ) - s[i][j] = rnd(); - length[i] = 1 / SQRTF( LEN_SQUARED_3FV( s[i] ) ); - } - - source->data = (GLfloat(*)[4]) s; - source->start = (GLfloat *) s; - source->count = TEST_COUNT; - source->stride = sizeof(s[0]); - source->flags = 0; - - dest->data = d; - dest->start = (GLfloat *) d; - dest->count = TEST_COUNT; - dest->stride = sizeof(float[4]); - dest->flags = 0; - - dest2->data = d2; - dest2->start = (GLfloat *) d2; - dest2->count = TEST_COUNT; - dest2->stride = sizeof(float[4]); - dest2->flags = 0; - - ref->data = r; - ref->start = (GLfloat *) r; - ref->count = TEST_COUNT; - ref->stride = sizeof(float[4]); - ref->flags = 0; - - ref2->data = r2; - ref2->start = (GLfloat *) r2; - ref2->count = TEST_COUNT; - ref2->stride = sizeof(float[4]); - ref2->flags = 0; - - if ( norm_normalize_types[mtype] == 0 ) { - ref_norm_transform_rescale( mat, scale, source, NULL, ref ); - } else { - ref_norm_transform_normalize( mat, scale, source, NULL, ref ); - ref_norm_transform_normalize( mat, scale, source, length, ref2 ); - } - - if ( mesa_profile ) { - BEGIN_RACE( *cycles ); - func( mat, scale, source, NULL, dest ); - END_RACE( *cycles ); - func( mat, scale, source, length, dest2 ); - } else { - func( mat, scale, source, NULL, dest ); - func( mat, scale, source, length, dest2 ); - } - - for ( i = 0 ; i < TEST_COUNT ; i++ ) { - for ( j = 0 ; j < 3 ; j++ ) { - if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d[i][0], r[i][0], r[i][0]/d[i][0], - MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d[i][1], r[i][1], r[i][1]/d[i][1], - MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d[i][2], r[i][2], r[i][2]/d[i][2], - MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - return 0; - } - - if ( norm_normalize_types[mtype] != 0 ) { - if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "------------------- precalculated length case ------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d2[i][0], r2[i][0], r2[i][0]/d2[i][0], - MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d2[i][1], r2[i][1], r2[i][1]/d2[i][1], - MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", - d2[i][2], r2[i][2], r2[i][2]/d2[i][2], - MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) ); - return 0; - } - } - } - } - - ALIGN_FREE( mat->m ); - return 1; -} - -void _math_test_all_normal_transform_functions( char *description ) -{ - int mtype; - long benchmark_tab[0xf]; - static int first_time = 1; - - if ( first_time ) { - first_time = 0; - mesa_profile = _mesa_getenv( "MESA_PROFILE" ); - } - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - if ( !counter_overhead ) { - INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); - } - _mesa_printf( "normal transform results after hooking in %s functions:\n", - description ); - _mesa_printf( "\n-------------------------------------------------------\n" ); - } -#endif - - for ( mtype = 0 ; mtype < 8 ; mtype++ ) { - normal_func func = _mesa_normal_tab[norm_types[mtype]]; - long *cycles = &benchmark_tab[mtype]; - - if ( test_norm_function( func, mtype, cycles ) == 0 ) { - char buf[100]; - _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", - norm_strings[mtype], description ); - _mesa_problem( NULL, buf ); - } - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - _mesa_printf( " %li\t", benchmark_tab[mtype] ); - _mesa_printf( " | [%s]\n", norm_strings[mtype] ); - } -#endif - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - _mesa_printf( "\n" ); - } -#endif -} - - -#endif /* DEBUG_MATH */ diff --git a/src/libs/mesa/mesa/math/m_debug_util.h b/src/libs/mesa/mesa/math/m_debug_util.h deleted file mode 100644 index 7abe6f2565..0000000000 --- a/src/libs/mesa/mesa/math/m_debug_util.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - * - * Authors: - * Gareth Hughes - */ - -#ifndef __M_DEBUG_UTIL_H__ -#define __M_DEBUG_UTIL_H__ - - -#ifdef DEBUG_MATH /* This code only used for debugging */ - - -/* Comment this out to deactivate the cycle counter. - * NOTE: it works only on CPUs which know the 'rdtsc' command (586 or higher) - * (hope, you don't try to debug Mesa on a 386 ;) - */ -#if defined(__GNUC__) && \ - ((defined(__i386__) && defined(USE_X86_ASM)) || \ - (defined(__sparc__) && defined(USE_SPARC_ASM))) -#define RUN_DEBUG_BENCHMARK -#endif - -#define TEST_COUNT 128 /* size of the tested vector array */ - -#define REQUIRED_PRECISION 10 /* allow 4 bits to miss */ -#define MAX_PRECISION 24 /* max. precision possible */ - - -#ifdef RUN_DEBUG_BENCHMARK -/* Overhead of profiling counter in cycles. Automatically adjusted to - * your machine at run time - counter initialization should give very - * consistent results. - */ -extern long counter_overhead; - -/* This is the value of the environment variable MESA_PROFILE, and is - * used to determine if we should benchmark the functions as well as - * verify their correctness. - */ -extern char *mesa_profile; - -/* Modify the the number of tests if you like. - * We take the minimum of all results, because every error should be - * positive (time used by other processes, task switches etc). - * It is assumed that all calculations are done in the cache. - */ - -#if defined(__i386__) - -#if 1 /* PPro, PII, PIII version */ - -/* Profiling on the P6 architecture requires a little more work, due to - * the internal out-of-order execution. We must perform a serializing - * 'cpuid' instruction before and after the 'rdtsc' instructions to make - * sure no other uops are executed when we sample the timestamp counter. - */ -#define INIT_COUNTER() \ - do { \ - int cycle_i; \ - counter_overhead = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 8 ; cycle_i++ ) { \ - long cycle_tmp1 = 0, cycle_tmp2 = 0; \ - __asm__ __volatile__ ( "push %%ebx \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "rdtsc \n" \ - "mov %%eax, %0 \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "pop %%ebx \n" \ - "push %%ebx \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "rdtsc \n" \ - "mov %%eax, %1 \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "pop %%ebx \n" \ - : "=m" (cycle_tmp1), "=m" (cycle_tmp2) \ - : : "eax", "ecx", "edx" ); \ - if ( counter_overhead > (cycle_tmp2 - cycle_tmp1) ) { \ - counter_overhead = cycle_tmp2 - cycle_tmp1; \ - } \ - } \ - } while (0) - -#define BEGIN_RACE(x) \ - x = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 10 ; cycle_i++ ) { \ - long cycle_tmp1 = 0, cycle_tmp2 = 0; \ - __asm__ __volatile__ ( "push %%ebx \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "rdtsc \n" \ - "mov %%eax, %0 \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "pop %%ebx \n" \ - : "=m" (cycle_tmp1) \ - : : "eax", "ecx", "edx" ); - -#define END_RACE(x) \ - __asm__ __volatile__ ( "push %%ebx \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "rdtsc \n" \ - "mov %%eax, %0 \n" \ - "xor %%eax, %%eax \n" \ - "cpuid \n" \ - "pop %%ebx \n" \ - : "=m" (cycle_tmp2) \ - : : "eax", "ecx", "edx" ); \ - if ( x > (cycle_tmp2 - cycle_tmp1) ) { \ - x = cycle_tmp2 - cycle_tmp1; \ - } \ - } \ - x -= counter_overhead; - -#else /* PPlain, PMMX version */ - -/* To ensure accurate results, we stall the pipelines with the - * non-pairable 'cdq' instruction. This ensures all the code being - * profiled is complete when the 'rdtsc' instruction executes. - */ -#define INIT_COUNTER(x) \ - do { \ - int cycle_i; \ - x = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 32 ; cycle_i++ ) { \ - long cycle_tmp1, cycle_tmp2, dummy; \ - __asm__ ( "mov %%eax, %0" : "=a" (cycle_tmp1) ); \ - __asm__ ( "mov %%eax, %0" : "=a" (cycle_tmp2) ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "rdtsc" : "=a" (cycle_tmp1), "=d" (dummy) ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "rdtsc" : "=a" (cycle_tmp2), "=d" (dummy) ); \ - if ( x > (cycle_tmp2 - cycle_tmp1) ) \ - x = cycle_tmp2 - cycle_tmp1; \ - } \ - } while (0) - -#define BEGIN_RACE(x) \ - x = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 16 ; cycle_i++ ) { \ - long cycle_tmp1, cycle_tmp2, dummy; \ - __asm__ ( "mov %%eax, %0" : "=a" (cycle_tmp1) ); \ - __asm__ ( "mov %%eax, %0" : "=a" (cycle_tmp2) ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "rdtsc" : "=a" (cycle_tmp1), "=d" (dummy) ); - - -#define END_RACE(x) \ - __asm__ ( "cdq" ); \ - __asm__ ( "cdq" ); \ - __asm__ ( "rdtsc" : "=a" (cycle_tmp2), "=d" (dummy) ); \ - if ( x > (cycle_tmp2 - cycle_tmp1) ) \ - x = cycle_tmp2 - cycle_tmp1; \ - } \ - x -= counter_overhead; - -#endif - -#elif defined(__x86_64__) - -#define rdtscll(val) do { \ - unsigned int a,d; \ - __asm__ volatile("rdtsc" : "=a" (a), "=d" (d)); \ - (val) = ((unsigned long)a) | (((unsigned long)d)<<32); \ -} while(0) - -/* Copied from i386 PIII version */ -#define INIT_COUNTER() \ - do { \ - int cycle_i; \ - counter_overhead = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 16 ; cycle_i++ ) { \ - unsigned long cycle_tmp1, cycle_tmp2; \ - rdtscll(cycle_tmp1); \ - rdtscll(cycle_tmp2); \ - if ( counter_overhead > (cycle_tmp2 - cycle_tmp1) ) { \ - counter_overhead = cycle_tmp2 - cycle_tmp1; \ - } \ - } \ - } while (0) - - -#define BEGIN_RACE(x) \ - x = LONG_MAX; \ - for ( cycle_i = 0 ; cycle_i < 10 ; cycle_i++ ) { \ - unsigned long cycle_tmp1, cycle_tmp2; \ - rdtscll(cycle_tmp1); \ - -#define END_RACE(x) \ - rdtscll(cycle_tmp2); \ - if ( x > (cycle_tmp2 - cycle_tmp1) ) { \ - x = cycle_tmp2 - cycle_tmp1; \ - } \ - } \ - x -= counter_overhead; - -#elif defined(__sparc__) - -#define INIT_COUNTER() \ - do { counter_overhead = 5; } while(0) - -#define BEGIN_RACE(x) \ -x = LONG_MAX; \ -for (cycle_i = 0; cycle_i <10; cycle_i++) { \ - register long cycle_tmp1 asm("l0"); \ - register long cycle_tmp2 asm("l1"); \ - /* rd %tick, %l0 */ \ - __asm__ __volatile__ (".word 0xa1410000" : "=r" (cycle_tmp1)); /* save timestamp */ - -#define END_RACE(x) \ - /* rd %tick, %l1 */ \ - __asm__ __volatile__ (".word 0xa3410000" : "=r" (cycle_tmp2)); \ - if (x > (cycle_tmp2-cycle_tmp1)) x = cycle_tmp2 - cycle_tmp1; \ -} \ -x -= counter_overhead; - -#else -#error Your processor is not supported for RUN_XFORM_BENCHMARK -#endif - -#else - -#define BEGIN_RACE(x) -#define END_RACE(x) - -#endif - - -/* ============================================================= - * Helper functions - */ - -static GLfloat rnd( void ) -{ - GLfloat f = (GLfloat)rand() / (GLfloat)RAND_MAX; - GLfloat gran = (GLfloat)(1 << 13); - - f = (GLfloat)(GLint)(f * gran) / gran; - - return f * 2.0 - 1.0; -} - -static int significand_match( GLfloat a, GLfloat b ) -{ - GLfloat d = a - b; - int a_ex, b_ex, d_ex; - - if ( d == 0.0F ) { - return MAX_PRECISION; /* Exact match */ - } - - if ( a == 0.0F || b == 0.0F ) { - /* It would probably be better to check if the - * non-zero number is denormalized and return - * the index of the highest set bit here. - */ - return 0; - } - - FREXPF( a, &a_ex ); - FREXPF( b, &b_ex ); - FREXPF( d, &d_ex ); - - if ( a_ex < b_ex ) { - return a_ex - d_ex; - } else { - return b_ex - d_ex; - } -} - -enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 }; - -/* Ensure our arrays are correctly aligned. - */ -#if defined(__GNUC__) -# define ALIGN16(type, array) type array __attribute__ ((aligned (16))) -#elif defined(_MSC_VER) -# define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ -#elif defined(__WATCOMC__) -# define ALIGN16(type, array) /* Watcom does not support this */ -#elif defined(__xlC__) -# define ALIGN16(type, array) type __align (16) array -#else -# warning "ALIGN16 will not 16-byte align!\n" -# define ALIGN16 -#endif - - -#endif /* DEBUG_MATH */ - -#endif /* __M_DEBUG_UTIL_H__ */ diff --git a/src/libs/mesa/mesa/math/m_debug_xform.c b/src/libs/mesa/mesa/math/m_debug_xform.c deleted file mode 100644 index ec22c7052d..0000000000 --- a/src/libs/mesa/mesa/math/m_debug_xform.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - -/* - * Updated for P6 architecture by Gareth Hughes. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "m_matrix.h" -#include "m_xform.h" - -#include "m_debug.h" -#include "m_debug_util.h" - -#ifdef __UNIXOS2__ -/* The linker doesn't like empty files */ -static char dummy; -#endif - -#ifdef DEBUG_MATH /* This code only used for debugging */ - - -/* Overhead of profiling counter in cycles. Automatically adjusted to - * your machine at run time - counter initialization should give very - * consistent results. - */ -long counter_overhead = 0; - -/* This is the value of the environment variable MESA_PROFILE, and is - * used to determine if we should benchmark the functions as well as - * verify their correctness. - */ -char *mesa_profile = NULL; - - -static int m_general[16] = { - VAR, VAR, VAR, VAR, - VAR, VAR, VAR, VAR, - VAR, VAR, VAR, VAR, - VAR, VAR, VAR, VAR -}; -static int m_identity[16] = { - ONE, NIL, NIL, NIL, - NIL, ONE, NIL, NIL, - NIL, NIL, ONE, NIL, - NIL, NIL, NIL, ONE -}; -static int m_2d[16] = { - VAR, VAR, NIL, VAR, - VAR, VAR, NIL, VAR, - NIL, NIL, ONE, NIL, - NIL, NIL, NIL, ONE -}; -static int m_2d_no_rot[16] = { - VAR, NIL, NIL, VAR, - NIL, VAR, NIL, VAR, - NIL, NIL, ONE, NIL, - NIL, NIL, NIL, ONE -}; -static int m_3d[16] = { - VAR, VAR, VAR, VAR, - VAR, VAR, VAR, VAR, - VAR, VAR, VAR, VAR, - NIL, NIL, NIL, ONE -}; -static int m_3d_no_rot[16] = { - VAR, NIL, NIL, VAR, - NIL, VAR, NIL, VAR, - NIL, NIL, VAR, VAR, - NIL, NIL, NIL, ONE -}; -static int m_perspective[16] = { - VAR, NIL, VAR, NIL, - NIL, VAR, VAR, NIL, - NIL, NIL, VAR, VAR, - NIL, NIL, NEG, NIL -}; -static int *templates[7] = { - m_general, - m_identity, - m_3d_no_rot, - m_perspective, - m_2d, - m_2d_no_rot, - m_3d -}; -static enum GLmatrixtype mtypes[7] = { - MATRIX_GENERAL, - MATRIX_IDENTITY, - MATRIX_3D_NO_ROT, - MATRIX_PERSPECTIVE, - MATRIX_2D, - MATRIX_2D_NO_ROT, - MATRIX_3D -}; -static char *mstrings[7] = { - "MATRIX_GENERAL", - "MATRIX_IDENTITY", - "MATRIX_3D_NO_ROT", - "MATRIX_PERSPECTIVE", - "MATRIX_2D", - "MATRIX_2D_NO_ROT", - "MATRIX_3D" -}; - - -/* ============================================================= - * Reference transformations - */ - -static void ref_transform( GLvector4f *dst, - const GLmatrix *mat, - const GLvector4f *src ) -{ - GLuint i; - GLfloat *s = (GLfloat *)src->start; - GLfloat (*d)[4] = (GLfloat (*)[4])dst->start; - const GLfloat *m = mat->m; - - for ( i = 0 ; i < src->count ; i++ ) { - TRANSFORM_POINT( d[i], m, s ); - s = (GLfloat *)((char *)s + src->stride); - } -} - - -/* ============================================================= - * Vertex transformation tests - */ - -static void init_matrix( GLfloat *m ) -{ - m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0; - m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] = 7.0; - m[2] = 44.0; m[6] = 9.0; m[10] = 7.0; m[14] = 3.0; - m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0; -} - -ALIGN16(static GLfloat, s[TEST_COUNT][4]); -ALIGN16(static GLfloat, d[TEST_COUNT][4]); -ALIGN16(static GLfloat, r[TEST_COUNT][4]); - -static int test_transform_function( transform_func func, int psize, - int mtype, unsigned long *cycles ) -{ - GLvector4f source[1], dest[1], ref[1]; - GLmatrix mat[1]; - GLfloat *m; - int i, j; -#ifdef RUN_DEBUG_BENCHMARK - int cycle_i; /* the counter for the benchmarks we run */ -#endif - - (void) cycles; - - if ( psize > 4 ) { - _mesa_problem( NULL, "test_transform_function called with psize > 4\n" ); - return 0; - } - - mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); - mat->type = mtypes[mtype]; - - m = mat->m; - ASSERT( ((long)m & 15) == 0 ); - - init_matrix( m ); - - for ( i = 0 ; i < 4 ; i++ ) { - for ( j = 0 ; j < 4 ; j++ ) { - switch ( templates[mtype][i * 4 + j] ) { - case NIL: - m[j * 4 + i] = 0.0; - break; - case ONE: - m[j * 4 + i] = 1.0; - break; - case NEG: - m[j * 4 + i] = -1.0; - break; - case VAR: - break; - default: - abort(); - } - } - } - - for ( i = 0 ; i < TEST_COUNT ; i++) { - ASSIGN_4V( d[i], 0.0, 0.0, 0.0, 1.0 ); - ASSIGN_4V( s[i], 0.0, 0.0, 0.0, 1.0 ); - for ( j = 0 ; j < psize ; j++ ) - s[i][j] = rnd(); - } - - source->data = (GLfloat(*)[4])s; - source->start = (GLfloat *)s; - source->count = TEST_COUNT; - source->stride = sizeof(s[0]); - source->size = 4; - source->flags = 0; - - dest->data = (GLfloat(*)[4])d; - dest->start = (GLfloat *)d; - dest->count = TEST_COUNT; - dest->stride = sizeof(float[4]); - dest->size = 0; - dest->flags = 0; - - ref->data = (GLfloat(*)[4])r; - ref->start = (GLfloat *)r; - ref->count = TEST_COUNT; - ref->stride = sizeof(float[4]); - ref->size = 0; - ref->flags = 0; - - ref_transform( ref, mat, source ); - - if ( mesa_profile ) { - BEGIN_RACE( *cycles ); - func( dest, mat->m, source ); - END_RACE( *cycles ); - } - else { - func( dest, mat->m, source ); - } - - for ( i = 0 ; i < TEST_COUNT ; i++ ) { - for ( j = 0 ; j < 4 ; j++ ) { - if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf("-----------------------------\n" ); - _mesa_printf("(i = %i, j = %i)\n", i, j ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][0], r[i][0], r[i][0]-d[i][0], - MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][1], r[i][1], r[i][1]-d[i][1], - MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][2], r[i][2], r[i][2]-d[i][2], - MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", - d[i][3], r[i][3], r[i][3]-d[i][3], - MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); - return 0; - } - } - } - - ALIGN_FREE( mat->m ); - return 1; -} - -void _math_test_all_transform_functions( char *description ) -{ - int psize, mtype; - unsigned long benchmark_tab[4][7]; - static int first_time = 1; - - if ( first_time ) { - first_time = 0; - mesa_profile = _mesa_getenv( "MESA_PROFILE" ); - } - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - if ( !counter_overhead ) { - INIT_COUNTER(); - _mesa_printf("counter overhead: %lu cycles\n\n", counter_overhead ); - } - _mesa_printf("transform results after hooking in %s functions:\n", description ); - } -#endif - -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) { - _mesa_printf("\n" ); - for ( psize = 1 ; psize <= 4 ; psize++ ) { - _mesa_printf(" p%d\t", psize ); - } - _mesa_printf("\n--------------------------------------------------------\n" ); - } -#endif - - for ( mtype = 0 ; mtype < 7 ; mtype++ ) { - for ( psize = 1 ; psize <= 4 ; psize++ ) { - transform_func func = _mesa_transform_tab[psize][mtypes[mtype]]; - unsigned long *cycles = &(benchmark_tab[psize-1][mtype]); - - if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) { - char buf[100]; - _mesa_sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", - psize, mstrings[mtype], description ); - _mesa_problem( NULL, buf ); - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf(" %li\t", benchmark_tab[psize-1][mtype] ); -#endif - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf(" | [%s]\n", mstrings[mtype] ); -#endif - } -#ifdef RUN_DEBUG_BENCHMARK - if ( mesa_profile ) - _mesa_printf( "\n" ); -#endif -} - - -#endif /* DEBUG_MATH */ diff --git a/src/libs/mesa/mesa/math/m_dotprod_tmp.h b/src/libs/mesa/mesa/math/m_dotprod_tmp.h deleted file mode 100644 index 03e65af6c1..0000000000 --- a/src/libs/mesa/mesa/math/m_dotprod_tmp.h +++ /dev/null @@ -1,102 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -/* Note - respects the stride of the output vector. - */ -static void TAG(dotprod_vec2)( GLfloat *out, - GLuint outstride, - const GLvector4f *coord_vec, - const GLfloat plane[4] ) -{ - GLuint stride = coord_vec->stride; - GLfloat *coord = coord_vec->start; - GLuint count = coord_vec->count; - - GLuint i; - - const GLfloat plane0 = plane[0], plane1 = plane[1], plane3 = plane[3]; - - for (i=0;istride; - GLfloat *coord = coord_vec->start; - GLuint count = coord_vec->count; - - GLuint i; - - const GLfloat plane0 = plane[0], plane1 = plane[1], plane2 = plane[2]; - const GLfloat plane3 = plane[3]; - - for (i=0;istride; - GLfloat *coord = coord_vec->start; - GLuint count = coord_vec->count; - GLuint i; - - const GLfloat plane0 = plane[0], plane1 = plane[1], plane2 = plane[2]; - const GLfloat plane3 = plane[3]; - - for (i=0;i= 2) { - bincoeff = (GLfloat) (order - 1); - s = 1.0F - t; - - for (k = 0; k < dim; k++) - out[k] = s * cp[k] + bincoeff * t * cp[dim + k]; - - for (i = 2, cp += 2 * dim, powert = t * t; i < order; - i++, powert *= t, cp += dim) { - bincoeff *= (GLfloat) (order - i); - bincoeff *= inv_tab[i]; - - for (k = 0; k < dim; k++) - out[k] = s * out[k] + bincoeff * powert * cp[k]; - } - } - else { /* order=1 -> constant curve */ - - for (k = 0; k < dim; k++) - out[k] = cp[k]; - } -} - -/* - * Tensor product Bezier surfaces - * - * Again the Horner scheme is used to compute a point on a - * TP Bezier surface. First a control polygon for a curve - * on the surface in one parameter direction is computed, - * then the point on the curve for the other parameter - * direction is evaluated. - * - * To store the curve control polygon additional storage - * for max(uorder,vorder) points is needed in the - * control net cn. - */ - -void -_math_horner_bezier_surf(GLfloat * cn, GLfloat * out, GLfloat u, GLfloat v, - GLuint dim, GLuint uorder, GLuint vorder) -{ - GLfloat *cp = cn + uorder * vorder * dim; - GLuint i, uinc = vorder * dim; - - if (vorder > uorder) { - if (uorder >= 2) { - GLfloat s, poweru, bincoeff; - GLuint j, k; - - /* Compute the control polygon for the surface-curve in u-direction */ - for (j = 0; j < vorder; j++) { - GLfloat *ucp = &cn[j * dim]; - - /* Each control point is the point for parameter u on a */ - /* curve defined by the control polygons in u-direction */ - bincoeff = (GLfloat) (uorder - 1); - s = 1.0F - u; - - for (k = 0; k < dim; k++) - cp[j * dim + k] = s * ucp[k] + bincoeff * u * ucp[uinc + k]; - - for (i = 2, ucp += 2 * uinc, poweru = u * u; i < uorder; - i++, poweru *= u, ucp += uinc) { - bincoeff *= (GLfloat) (uorder - i); - bincoeff *= inv_tab[i]; - - for (k = 0; k < dim; k++) - cp[j * dim + k] = - s * cp[j * dim + k] + bincoeff * poweru * ucp[k]; - } - } - - /* Evaluate curve point in v */ - _math_horner_bezier_curve(cp, out, v, dim, vorder); - } - else /* uorder=1 -> cn defines a curve in v */ - _math_horner_bezier_curve(cn, out, v, dim, vorder); - } - else { /* vorder <= uorder */ - - if (vorder > 1) { - GLuint i; - - /* Compute the control polygon for the surface-curve in u-direction */ - for (i = 0; i < uorder; i++, cn += uinc) { - /* For constant i all cn[i][j] (j=0..vorder) are located */ - /* on consecutive memory locations, so we can use */ - /* horner_bezier_curve to compute the control points */ - - _math_horner_bezier_curve(cn, &cp[i * dim], v, dim, vorder); - } - - /* Evaluate curve point in u */ - _math_horner_bezier_curve(cp, out, u, dim, uorder); - } - else /* vorder=1 -> cn defines a curve in u */ - _math_horner_bezier_curve(cn, out, u, dim, uorder); - } -} - -/* - * The direct de Casteljau algorithm is used when a point on the - * surface and the tangent directions spanning the tangent plane - * should be computed (this is needed to compute normals to the - * surface). In this case the de Casteljau algorithm approach is - * nicer because a point and the partial derivatives can be computed - * at the same time. To get the correct tangent length du and dv - * must be multiplied with the (u2-u1)/uorder-1 and (v2-v1)/vorder-1. - * Since only the directions are needed, this scaling step is omitted. - * - * De Casteljau needs additional storage for uorder*vorder - * values in the control net cn. - */ - -void -_math_de_casteljau_surf(GLfloat * cn, GLfloat * out, GLfloat * du, - GLfloat * dv, GLfloat u, GLfloat v, GLuint dim, - GLuint uorder, GLuint vorder) -{ - GLfloat *dcn = cn + uorder * vorder * dim; - GLfloat us = 1.0F - u, vs = 1.0F - v; - GLuint h, i, j, k; - GLuint minorder = uorder < vorder ? uorder : vorder; - GLuint uinc = vorder * dim; - GLuint dcuinc = vorder; - - /* Each component is evaluated separately to save buffer space */ - /* This does not drasticaly decrease the performance of the */ - /* algorithm. If additional storage for (uorder-1)*(vorder-1) */ - /* points would be available, the components could be accessed */ - /* in the innermost loop which could lead to less cache misses. */ - -#define CN(I,J,K) cn[(I)*uinc+(J)*dim+(K)] -#define DCN(I, J) dcn[(I)*dcuinc+(J)] - if (minorder < 3) { - if (uorder == vorder) { - for (k = 0; k < dim; k++) { - /* Derivative direction in u */ - du[k] = vs * (CN(1, 0, k) - CN(0, 0, k)) + - v * (CN(1, 1, k) - CN(0, 1, k)); - - /* Derivative direction in v */ - dv[k] = us * (CN(0, 1, k) - CN(0, 0, k)) + - u * (CN(1, 1, k) - CN(1, 0, k)); - - /* bilinear de Casteljau step */ - out[k] = us * (vs * CN(0, 0, k) + v * CN(0, 1, k)) + - u * (vs * CN(1, 0, k) + v * CN(1, 1, k)); - } - } - else if (minorder == uorder) { - for (k = 0; k < dim; k++) { - /* bilinear de Casteljau step */ - DCN(1, 0) = CN(1, 0, k) - CN(0, 0, k); - DCN(0, 0) = us * CN(0, 0, k) + u * CN(1, 0, k); - - for (j = 0; j < vorder - 1; j++) { - /* for the derivative in u */ - DCN(1, j + 1) = CN(1, j + 1, k) - CN(0, j + 1, k); - DCN(1, j) = vs * DCN(1, j) + v * DCN(1, j + 1); - - /* for the `point' */ - DCN(0, j + 1) = us * CN(0, j + 1, k) + u * CN(1, j + 1, k); - DCN(0, j) = vs * DCN(0, j) + v * DCN(0, j + 1); - } - - /* remaining linear de Casteljau steps until the second last step */ - for (h = minorder; h < vorder - 1; h++) - for (j = 0; j < vorder - h; j++) { - /* for the derivative in u */ - DCN(1, j) = vs * DCN(1, j) + v * DCN(1, j + 1); - - /* for the `point' */ - DCN(0, j) = vs * DCN(0, j) + v * DCN(0, j + 1); - } - - /* derivative direction in v */ - dv[k] = DCN(0, 1) - DCN(0, 0); - - /* derivative direction in u */ - du[k] = vs * DCN(1, 0) + v * DCN(1, 1); - - /* last linear de Casteljau step */ - out[k] = vs * DCN(0, 0) + v * DCN(0, 1); - } - } - else { /* minorder == vorder */ - - for (k = 0; k < dim; k++) { - /* bilinear de Casteljau step */ - DCN(0, 1) = CN(0, 1, k) - CN(0, 0, k); - DCN(0, 0) = vs * CN(0, 0, k) + v * CN(0, 1, k); - for (i = 0; i < uorder - 1; i++) { - /* for the derivative in v */ - DCN(i + 1, 1) = CN(i + 1, 1, k) - CN(i + 1, 0, k); - DCN(i, 1) = us * DCN(i, 1) + u * DCN(i + 1, 1); - - /* for the `point' */ - DCN(i + 1, 0) = vs * CN(i + 1, 0, k) + v * CN(i + 1, 1, k); - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - } - - /* remaining linear de Casteljau steps until the second last step */ - for (h = minorder; h < uorder - 1; h++) - for (i = 0; i < uorder - h; i++) { - /* for the derivative in v */ - DCN(i, 1) = us * DCN(i, 1) + u * DCN(i + 1, 1); - - /* for the `point' */ - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - } - - /* derivative direction in u */ - du[k] = DCN(1, 0) - DCN(0, 0); - - /* derivative direction in v */ - dv[k] = us * DCN(0, 1) + u * DCN(1, 1); - - /* last linear de Casteljau step */ - out[k] = us * DCN(0, 0) + u * DCN(1, 0); - } - } - } - else if (uorder == vorder) { - for (k = 0; k < dim; k++) { - /* first bilinear de Casteljau step */ - for (i = 0; i < uorder - 1; i++) { - DCN(i, 0) = us * CN(i, 0, k) + u * CN(i + 1, 0, k); - for (j = 0; j < vorder - 1; j++) { - DCN(i, j + 1) = us * CN(i, j + 1, k) + u * CN(i + 1, j + 1, k); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* remaining bilinear de Casteljau steps until the second last step */ - for (h = 2; h < minorder - 1; h++) - for (i = 0; i < uorder - h; i++) { - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - for (j = 0; j < vorder - h; j++) { - DCN(i, j + 1) = us * DCN(i, j + 1) + u * DCN(i + 1, j + 1); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* derivative direction in u */ - du[k] = vs * (DCN(1, 0) - DCN(0, 0)) + v * (DCN(1, 1) - DCN(0, 1)); - - /* derivative direction in v */ - dv[k] = us * (DCN(0, 1) - DCN(0, 0)) + u * (DCN(1, 1) - DCN(1, 0)); - - /* last bilinear de Casteljau step */ - out[k] = us * (vs * DCN(0, 0) + v * DCN(0, 1)) + - u * (vs * DCN(1, 0) + v * DCN(1, 1)); - } - } - else if (minorder == uorder) { - for (k = 0; k < dim; k++) { - /* first bilinear de Casteljau step */ - for (i = 0; i < uorder - 1; i++) { - DCN(i, 0) = us * CN(i, 0, k) + u * CN(i + 1, 0, k); - for (j = 0; j < vorder - 1; j++) { - DCN(i, j + 1) = us * CN(i, j + 1, k) + u * CN(i + 1, j + 1, k); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* remaining bilinear de Casteljau steps until the second last step */ - for (h = 2; h < minorder - 1; h++) - for (i = 0; i < uorder - h; i++) { - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - for (j = 0; j < vorder - h; j++) { - DCN(i, j + 1) = us * DCN(i, j + 1) + u * DCN(i + 1, j + 1); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* last bilinear de Casteljau step */ - DCN(2, 0) = DCN(1, 0) - DCN(0, 0); - DCN(0, 0) = us * DCN(0, 0) + u * DCN(1, 0); - for (j = 0; j < vorder - 1; j++) { - /* for the derivative in u */ - DCN(2, j + 1) = DCN(1, j + 1) - DCN(0, j + 1); - DCN(2, j) = vs * DCN(2, j) + v * DCN(2, j + 1); - - /* for the `point' */ - DCN(0, j + 1) = us * DCN(0, j + 1) + u * DCN(1, j + 1); - DCN(0, j) = vs * DCN(0, j) + v * DCN(0, j + 1); - } - - /* remaining linear de Casteljau steps until the second last step */ - for (h = minorder; h < vorder - 1; h++) - for (j = 0; j < vorder - h; j++) { - /* for the derivative in u */ - DCN(2, j) = vs * DCN(2, j) + v * DCN(2, j + 1); - - /* for the `point' */ - DCN(0, j) = vs * DCN(0, j) + v * DCN(0, j + 1); - } - - /* derivative direction in v */ - dv[k] = DCN(0, 1) - DCN(0, 0); - - /* derivative direction in u */ - du[k] = vs * DCN(2, 0) + v * DCN(2, 1); - - /* last linear de Casteljau step */ - out[k] = vs * DCN(0, 0) + v * DCN(0, 1); - } - } - else { /* minorder == vorder */ - - for (k = 0; k < dim; k++) { - /* first bilinear de Casteljau step */ - for (i = 0; i < uorder - 1; i++) { - DCN(i, 0) = us * CN(i, 0, k) + u * CN(i + 1, 0, k); - for (j = 0; j < vorder - 1; j++) { - DCN(i, j + 1) = us * CN(i, j + 1, k) + u * CN(i + 1, j + 1, k); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* remaining bilinear de Casteljau steps until the second last step */ - for (h = 2; h < minorder - 1; h++) - for (i = 0; i < uorder - h; i++) { - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - for (j = 0; j < vorder - h; j++) { - DCN(i, j + 1) = us * DCN(i, j + 1) + u * DCN(i + 1, j + 1); - DCN(i, j) = vs * DCN(i, j) + v * DCN(i, j + 1); - } - } - - /* last bilinear de Casteljau step */ - DCN(0, 2) = DCN(0, 1) - DCN(0, 0); - DCN(0, 0) = vs * DCN(0, 0) + v * DCN(0, 1); - for (i = 0; i < uorder - 1; i++) { - /* for the derivative in v */ - DCN(i + 1, 2) = DCN(i + 1, 1) - DCN(i + 1, 0); - DCN(i, 2) = us * DCN(i, 2) + u * DCN(i + 1, 2); - - /* for the `point' */ - DCN(i + 1, 0) = vs * DCN(i + 1, 0) + v * DCN(i + 1, 1); - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - } - - /* remaining linear de Casteljau steps until the second last step */ - for (h = minorder; h < uorder - 1; h++) - for (i = 0; i < uorder - h; i++) { - /* for the derivative in v */ - DCN(i, 2) = us * DCN(i, 2) + u * DCN(i + 1, 2); - - /* for the `point' */ - DCN(i, 0) = us * DCN(i, 0) + u * DCN(i + 1, 0); - } - - /* derivative direction in u */ - du[k] = DCN(1, 0) - DCN(0, 0); - - /* derivative direction in v */ - dv[k] = us * DCN(0, 2) + u * DCN(1, 2); - - /* last linear de Casteljau step */ - out[k] = us * DCN(0, 0) + u * DCN(1, 0); - } - } -#undef DCN -#undef CN -} - - -/* - * Do one-time initialization for evaluators. - */ -void -_math_init_eval(void) -{ - GLuint i; - - /* KW: precompute 1/x for useful x. - */ - for (i = 1; i < MAX_EVAL_ORDER; i++) - inv_tab[i] = 1.0F / i; -} diff --git a/src/libs/mesa/mesa/math/m_eval.h b/src/libs/mesa/mesa/math/m_eval.h deleted file mode 100644 index d73ecaafb2..0000000000 --- a/src/libs/mesa/mesa/math/m_eval.h +++ /dev/null @@ -1,103 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 _M_EVAL_H -#define _M_EVAL_H - -#include "main/glheader.h" - -void _math_init_eval( void ); - - -/* - * Horner scheme for Bezier curves - * - * Bezier curves can be computed via a Horner scheme. - * Horner is numerically less stable than the de Casteljau - * algorithm, but it is faster. For curves of degree n - * the complexity of Horner is O(n) and de Casteljau is O(n^2). - * Since stability is not important for displaying curve - * points I decided to use the Horner scheme. - * - * A cubic Bezier curve with control points b0, b1, b2, b3 can be - * written as - * - * (([3] [3] ) [3] ) [3] - * c(t) = (([0]*s*b0 + [1]*t*b1)*s + [2]*t^2*b2)*s + [3]*t^2*b3 - * - * [n] - * where s=1-t and the binomial coefficients [i]. These can - * be computed iteratively using the identity: - * - * [n] [n ] [n] - * [i] = (n-i+1)/i * [i-1] and [0] = 1 - */ - - -void -_math_horner_bezier_curve(const GLfloat *cp, GLfloat *out, GLfloat t, - GLuint dim, GLuint order); - - -/* - * Tensor product Bezier surfaces - * - * Again the Horner scheme is used to compute a point on a - * TP Bezier surface. First a control polygon for a curve - * on the surface in one parameter direction is computed, - * then the point on the curve for the other parameter - * direction is evaluated. - * - * To store the curve control polygon additional storage - * for max(uorder,vorder) points is needed in the - * control net cn. - */ - -void -_math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v, - GLuint dim, GLuint uorder, GLuint vorder); - - -/* - * The direct de Casteljau algorithm is used when a point on the - * surface and the tangent directions spanning the tangent plane - * should be computed (this is needed to compute normals to the - * surface). In this case the de Casteljau algorithm approach is - * nicer because a point and the partial derivatives can be computed - * at the same time. To get the correct tangent length du and dv - * must be multiplied with the (u2-u1)/uorder-1 and (v2-v1)/vorder-1. - * Since only the directions are needed, this scaling step is omitted. - * - * De Casteljau needs additional storage for uorder*vorder - * values in the control net cn. - */ - -void -_math_de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv, - GLfloat u, GLfloat v, GLuint dim, - GLuint uorder, GLuint vorder); - - -#endif diff --git a/src/libs/mesa/mesa/math/m_matrix.c b/src/libs/mesa/mesa/math/m_matrix.c deleted file mode 100644 index 5f300f4173..0000000000 --- a/src/libs/mesa/mesa/math/m_matrix.c +++ /dev/null @@ -1,1621 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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. - */ - - -/** - * \file m_matrix.c - * Matrix operations. - * - * \note - * -# 4x4 transformation matrices are stored in memory in column major order. - * -# Points/vertices are to be thought of as column vectors. - * -# Transformation of a point p by a matrix M is: p' = M * p - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "m_matrix.h" - - -/** - * \defgroup MatFlags MAT_FLAG_XXX-flags - * - * Bitmasks to indicate different kinds of 4x4 matrices in GLmatrix::flags - * It would be nice to make all these flags private to m_matrix.c - */ -/*@{*/ -#define MAT_FLAG_IDENTITY 0 /**< is an identity matrix flag. - * (Not actually used - the identity - * matrix is identified by the absense - * of all other flags.) - */ -#define MAT_FLAG_GENERAL 0x1 /**< is a general matrix flag */ -#define MAT_FLAG_ROTATION 0x2 /**< is a rotation matrix flag */ -#define MAT_FLAG_TRANSLATION 0x4 /**< is a translation matrix flag */ -#define MAT_FLAG_UNIFORM_SCALE 0x8 /**< is an uniform scaling matrix flag */ -#define MAT_FLAG_GENERAL_SCALE 0x10 /**< is a general scaling matrix flag */ -#define MAT_FLAG_GENERAL_3D 0x20 /**< general 3D matrix flag */ -#define MAT_FLAG_PERSPECTIVE 0x40 /**< is a perspective proj matrix flag */ -#define MAT_FLAG_SINGULAR 0x80 /**< is a singular matrix flag */ -#define MAT_DIRTY_TYPE 0x100 /**< matrix type is dirty */ -#define MAT_DIRTY_FLAGS 0x200 /**< matrix flags are dirty */ -#define MAT_DIRTY_INVERSE 0x400 /**< matrix inverse is dirty */ - -/** angle preserving matrix flags mask */ -#define MAT_FLAGS_ANGLE_PRESERVING (MAT_FLAG_ROTATION | \ - MAT_FLAG_TRANSLATION | \ - MAT_FLAG_UNIFORM_SCALE) - -/** geometry related matrix flags mask */ -#define MAT_FLAGS_GEOMETRY (MAT_FLAG_GENERAL | \ - MAT_FLAG_ROTATION | \ - MAT_FLAG_TRANSLATION | \ - MAT_FLAG_UNIFORM_SCALE | \ - MAT_FLAG_GENERAL_SCALE | \ - MAT_FLAG_GENERAL_3D | \ - MAT_FLAG_PERSPECTIVE | \ - MAT_FLAG_SINGULAR) - -/** length preserving matrix flags mask */ -#define MAT_FLAGS_LENGTH_PRESERVING (MAT_FLAG_ROTATION | \ - MAT_FLAG_TRANSLATION) - - -/** 3D (non-perspective) matrix flags mask */ -#define MAT_FLAGS_3D (MAT_FLAG_ROTATION | \ - MAT_FLAG_TRANSLATION | \ - MAT_FLAG_UNIFORM_SCALE | \ - MAT_FLAG_GENERAL_SCALE | \ - MAT_FLAG_GENERAL_3D) - -/** dirty matrix flags mask */ -#define MAT_DIRTY (MAT_DIRTY_TYPE | \ - MAT_DIRTY_FLAGS | \ - MAT_DIRTY_INVERSE) - -/*@}*/ - - -/** - * Test geometry related matrix flags. - * - * \param mat a pointer to a GLmatrix structure. - * \param a flags mask. - * - * \returns non-zero if all geometry related matrix flags are contained within - * the mask, or zero otherwise. - */ -#define TEST_MAT_FLAGS(mat, a) \ - ((MAT_FLAGS_GEOMETRY & (~(a)) & ((mat)->flags) ) == 0) - - - -/** - * Names of the corresponding GLmatrixtype values. - */ -static const char *types[] = { - "MATRIX_GENERAL", - "MATRIX_IDENTITY", - "MATRIX_3D_NO_ROT", - "MATRIX_PERSPECTIVE", - "MATRIX_2D", - "MATRIX_2D_NO_ROT", - "MATRIX_3D" -}; - - -/** - * Identity matrix. - */ -static GLfloat Identity[16] = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 -}; - - - -/**********************************************************************/ -/** \name Matrix multiplication */ -/*@{*/ - -#define A(row,col) a[(col<<2)+row] -#define B(row,col) b[(col<<2)+row] -#define P(row,col) product[(col<<2)+row] - -/** - * Perform a full 4x4 matrix multiplication. - * - * \param a matrix. - * \param b matrix. - * \param product will receive the product of \p a and \p b. - * - * \warning Is assumed that \p product != \p b. \p product == \p a is allowed. - * - * \note KW: 4*16 = 64 multiplications - * - * \author This \c matmul was contributed by Thomas Malik - */ -static void matmul4( GLfloat *product, const GLfloat *a, const GLfloat *b ) -{ - GLint i; - for (i = 0; i < 4; i++) { - const GLfloat ai0=A(i,0), ai1=A(i,1), ai2=A(i,2), ai3=A(i,3); - P(i,0) = ai0 * B(0,0) + ai1 * B(1,0) + ai2 * B(2,0) + ai3 * B(3,0); - P(i,1) = ai0 * B(0,1) + ai1 * B(1,1) + ai2 * B(2,1) + ai3 * B(3,1); - P(i,2) = ai0 * B(0,2) + ai1 * B(1,2) + ai2 * B(2,2) + ai3 * B(3,2); - P(i,3) = ai0 * B(0,3) + ai1 * B(1,3) + ai2 * B(2,3) + ai3 * B(3,3); - } -} - -/** - * Multiply two matrices known to occupy only the top three rows, such - * as typical model matrices, and orthogonal matrices. - * - * \param a matrix. - * \param b matrix. - * \param product will receive the product of \p a and \p b. - */ -static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b ) -{ - GLint i; - for (i = 0; i < 3; i++) { - const GLfloat ai0=A(i,0), ai1=A(i,1), ai2=A(i,2), ai3=A(i,3); - P(i,0) = ai0 * B(0,0) + ai1 * B(1,0) + ai2 * B(2,0); - P(i,1) = ai0 * B(0,1) + ai1 * B(1,1) + ai2 * B(2,1); - P(i,2) = ai0 * B(0,2) + ai1 * B(1,2) + ai2 * B(2,2); - P(i,3) = ai0 * B(0,3) + ai1 * B(1,3) + ai2 * B(2,3) + ai3; - } - P(3,0) = 0; - P(3,1) = 0; - P(3,2) = 0; - P(3,3) = 1; -} - -#undef A -#undef B -#undef P - -/** - * Multiply a matrix by an array of floats with known properties. - * - * \param mat pointer to a GLmatrix structure containing the left multiplication - * matrix, and that will receive the product result. - * \param m right multiplication matrix array. - * \param flags flags of the matrix \p m. - * - * Joins both flags and marks the type and inverse as dirty. Calls matmul34() - * if both matrices are 3D, or matmul4() otherwise. - */ -static void matrix_multf( GLmatrix *mat, const GLfloat *m, GLuint flags ) -{ - mat->flags |= (flags | MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); - - if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D)) - matmul34( mat->m, mat->m, m ); - else - matmul4( mat->m, mat->m, m ); -} - -/** - * Matrix multiplication. - * - * \param dest destination matrix. - * \param a left matrix. - * \param b right matrix. - * - * Joins both flags and marks the type and inverse as dirty. Calls matmul34() - * if both matrices are 3D, or matmul4() otherwise. - */ -void -_math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ) -{ - dest->flags = (a->flags | - b->flags | - MAT_DIRTY_TYPE | - MAT_DIRTY_INVERSE); - - if (TEST_MAT_FLAGS(dest, MAT_FLAGS_3D)) - matmul34( dest->m, a->m, b->m ); - else - matmul4( dest->m, a->m, b->m ); -} - -/** - * Matrix multiplication. - * - * \param dest left and destination matrix. - * \param m right matrix array. - * - * Marks the matrix flags with general flag, and type and inverse dirty flags. - * Calls matmul4() for the multiplication. - */ -void -_math_matrix_mul_floats( GLmatrix *dest, const GLfloat *m ) -{ - dest->flags |= (MAT_FLAG_GENERAL | - MAT_DIRTY_TYPE | - MAT_DIRTY_INVERSE | - MAT_DIRTY_FLAGS); - - matmul4( dest->m, dest->m, m ); -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Matrix output */ -/*@{*/ - -/** - * Print a matrix array. - * - * \param m matrix array. - * - * Called by _math_matrix_print() to print a matrix or its inverse. - */ -static void print_matrix_floats( const GLfloat m[16] ) -{ - int i; - for (i=0;i<4;i++) { - _mesa_debug(NULL,"\t%f %f %f %f\n", m[i], m[4+i], m[8+i], m[12+i] ); - } -} - -/** - * Dumps the contents of a GLmatrix structure. - * - * \param m pointer to the GLmatrix structure. - */ -void -_math_matrix_print( const GLmatrix *m ) -{ - _mesa_debug(NULL, "Matrix type: %s, flags: %x\n", types[m->type], m->flags); - print_matrix_floats(m->m); - _mesa_debug(NULL, "Inverse: \n"); - if (m->inv) { - GLfloat prod[16]; - print_matrix_floats(m->inv); - matmul4(prod, m->m, m->inv); - _mesa_debug(NULL, "Mat * Inverse:\n"); - print_matrix_floats(prod); - } - else { - _mesa_debug(NULL, " - not available\n"); - } -} - -/*@}*/ - - -/** - * References an element of 4x4 matrix. - * - * \param m matrix array. - * \param c column of the desired element. - * \param r row of the desired element. - * - * \return value of the desired element. - * - * Calculate the linear storage index of the element and references it. - */ -#define MAT(m,r,c) (m)[(c)*4+(r)] - - -/**********************************************************************/ -/** \name Matrix inversion */ -/*@{*/ - -/** - * Swaps the values of two floating pointer variables. - * - * Used by invert_matrix_general() to swap the row pointers. - */ -#define SWAP_ROWS(a, b) { GLfloat *_tmp = a; (a)=(b); (b)=_tmp; } - -/** - * Compute inverse of 4x4 transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * \author - * Code contributed by Jacques Leroy jle@star.be - * - * Calculates the inverse matrix by performing the gaussian matrix reduction - * with partial pivoting followed by back/substitution with the loops manually - * unrolled. - */ -static GLboolean invert_matrix_general( GLmatrix *mat ) -{ - const GLfloat *m = mat->m; - GLfloat *out = mat->inv; - GLfloat wtmp[4][8]; - GLfloat m0, m1, m2, m3, s; - GLfloat *r0, *r1, *r2, *r3; - - r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; - - r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1), - r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3), - r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, - - r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1), - r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3), - r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, - - r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1), - r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3), - r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, - - r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1), - r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3), - r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; - - /* choose pivot - or die */ - if (FABSF(r3[0])>FABSF(r2[0])) SWAP_ROWS(r3, r2); - if (FABSF(r2[0])>FABSF(r1[0])) SWAP_ROWS(r2, r1); - if (FABSF(r1[0])>FABSF(r0[0])) SWAP_ROWS(r1, r0); - if (0.0 == r0[0]) return GL_FALSE; - - /* eliminate first variable */ - m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0]; - s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s; - s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s; - s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s; - s = r0[4]; - if (s != 0.0) { r1[4] -= m1 * s; r2[4] -= m2 * s; r3[4] -= m3 * s; } - s = r0[5]; - if (s != 0.0) { r1[5] -= m1 * s; r2[5] -= m2 * s; r3[5] -= m3 * s; } - s = r0[6]; - if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; } - s = r0[7]; - if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; } - - /* choose pivot - or die */ - if (FABSF(r3[1])>FABSF(r2[1])) SWAP_ROWS(r3, r2); - if (FABSF(r2[1])>FABSF(r1[1])) SWAP_ROWS(r2, r1); - if (0.0 == r1[1]) return GL_FALSE; - - /* eliminate second variable */ - m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1]; - r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2]; - r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3]; - s = r1[4]; if (0.0 != s) { r2[4] -= m2 * s; r3[4] -= m3 * s; } - s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; } - s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; } - s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; } - - /* choose pivot - or die */ - if (FABSF(r3[2])>FABSF(r2[2])) SWAP_ROWS(r3, r2); - if (0.0 == r2[2]) return GL_FALSE; - - /* eliminate third variable */ - m3 = r3[2]/r2[2]; - r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], - r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], - r3[7] -= m3 * r2[7]; - - /* last check */ - if (0.0 == r3[3]) return GL_FALSE; - - s = 1.0F/r3[3]; /* now back substitute row 3 */ - r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s; - - m2 = r2[3]; /* now back substitute row 2 */ - s = 1.0F/r2[2]; - r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), - r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); - m1 = r1[3]; - r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, - r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; - m0 = r0[3]; - r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, - r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; - - m1 = r1[2]; /* now back substitute row 1 */ - s = 1.0F/r1[1]; - r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), - r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); - m0 = r0[2]; - r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, - r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; - - m0 = r0[1]; /* now back substitute row 0 */ - s = 1.0F/r0[0]; - r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), - r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); - - MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5], - MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7], - MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5], - MAT(out,1,2) = r1[6]; MAT(out,1,3) = r1[7], - MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5], - MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7], - MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5], - MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; - - return GL_TRUE; -} -#undef SWAP_ROWS - -/** - * Compute inverse of a general 3d transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * \author Adapted from graphics gems II. - * - * Calculates the inverse of the upper left by first calculating its - * determinant and multiplying it to the symmetric adjust matrix of each - * element. Finally deals with the translation part by transforming the - * original translation vector using by the calculated submatrix inverse. - */ -static GLboolean invert_matrix_3d_general( GLmatrix *mat ) -{ - const GLfloat *in = mat->m; - GLfloat *out = mat->inv; - GLfloat pos, neg, t; - GLfloat det; - - /* Calculate the determinant of upper left 3x3 submatrix and - * determine if the matrix is singular. - */ - pos = neg = 0.0; - t = MAT(in,0,0) * MAT(in,1,1) * MAT(in,2,2); - if (t >= 0.0) pos += t; else neg += t; - - t = MAT(in,1,0) * MAT(in,2,1) * MAT(in,0,2); - if (t >= 0.0) pos += t; else neg += t; - - t = MAT(in,2,0) * MAT(in,0,1) * MAT(in,1,2); - if (t >= 0.0) pos += t; else neg += t; - - t = -MAT(in,2,0) * MAT(in,1,1) * MAT(in,0,2); - if (t >= 0.0) pos += t; else neg += t; - - t = -MAT(in,1,0) * MAT(in,0,1) * MAT(in,2,2); - if (t >= 0.0) pos += t; else neg += t; - - t = -MAT(in,0,0) * MAT(in,2,1) * MAT(in,1,2); - if (t >= 0.0) pos += t; else neg += t; - - det = pos + neg; - - if (det*det < 1e-25) - return GL_FALSE; - - det = 1.0F / det; - MAT(out,0,0) = ( (MAT(in,1,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,1,2) )*det); - MAT(out,0,1) = (- (MAT(in,0,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,0,2) )*det); - MAT(out,0,2) = ( (MAT(in,0,1)*MAT(in,1,2) - MAT(in,1,1)*MAT(in,0,2) )*det); - MAT(out,1,0) = (- (MAT(in,1,0)*MAT(in,2,2) - MAT(in,2,0)*MAT(in,1,2) )*det); - MAT(out,1,1) = ( (MAT(in,0,0)*MAT(in,2,2) - MAT(in,2,0)*MAT(in,0,2) )*det); - MAT(out,1,2) = (- (MAT(in,0,0)*MAT(in,1,2) - MAT(in,1,0)*MAT(in,0,2) )*det); - MAT(out,2,0) = ( (MAT(in,1,0)*MAT(in,2,1) - MAT(in,2,0)*MAT(in,1,1) )*det); - MAT(out,2,1) = (- (MAT(in,0,0)*MAT(in,2,1) - MAT(in,2,0)*MAT(in,0,1) )*det); - MAT(out,2,2) = ( (MAT(in,0,0)*MAT(in,1,1) - MAT(in,1,0)*MAT(in,0,1) )*det); - - /* Do the translation part */ - MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0) + - MAT(in,1,3) * MAT(out,0,1) + - MAT(in,2,3) * MAT(out,0,2) ); - MAT(out,1,3) = - (MAT(in,0,3) * MAT(out,1,0) + - MAT(in,1,3) * MAT(out,1,1) + - MAT(in,2,3) * MAT(out,1,2) ); - MAT(out,2,3) = - (MAT(in,0,3) * MAT(out,2,0) + - MAT(in,1,3) * MAT(out,2,1) + - MAT(in,2,3) * MAT(out,2,2) ); - - return GL_TRUE; -} - -/** - * Compute inverse of a 3d transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * If the matrix is not an angle preserving matrix then calls - * invert_matrix_3d_general for the actual calculation. Otherwise calculates - * the inverse matrix analyzing and inverting each of the scaling, rotation and - * translation parts. - */ -static GLboolean invert_matrix_3d( GLmatrix *mat ) -{ - const GLfloat *in = mat->m; - GLfloat *out = mat->inv; - - if (!TEST_MAT_FLAGS(mat, MAT_FLAGS_ANGLE_PRESERVING)) { - return invert_matrix_3d_general( mat ); - } - - if (mat->flags & MAT_FLAG_UNIFORM_SCALE) { - GLfloat scale = (MAT(in,0,0) * MAT(in,0,0) + - MAT(in,0,1) * MAT(in,0,1) + - MAT(in,0,2) * MAT(in,0,2)); - - if (scale == 0.0) - return GL_FALSE; - - scale = 1.0F / scale; - - /* Transpose and scale the 3 by 3 upper-left submatrix. */ - MAT(out,0,0) = scale * MAT(in,0,0); - MAT(out,1,0) = scale * MAT(in,0,1); - MAT(out,2,0) = scale * MAT(in,0,2); - MAT(out,0,1) = scale * MAT(in,1,0); - MAT(out,1,1) = scale * MAT(in,1,1); - MAT(out,2,1) = scale * MAT(in,1,2); - MAT(out,0,2) = scale * MAT(in,2,0); - MAT(out,1,2) = scale * MAT(in,2,1); - MAT(out,2,2) = scale * MAT(in,2,2); - } - else if (mat->flags & MAT_FLAG_ROTATION) { - /* Transpose the 3 by 3 upper-left submatrix. */ - MAT(out,0,0) = MAT(in,0,0); - MAT(out,1,0) = MAT(in,0,1); - MAT(out,2,0) = MAT(in,0,2); - MAT(out,0,1) = MAT(in,1,0); - MAT(out,1,1) = MAT(in,1,1); - MAT(out,2,1) = MAT(in,1,2); - MAT(out,0,2) = MAT(in,2,0); - MAT(out,1,2) = MAT(in,2,1); - MAT(out,2,2) = MAT(in,2,2); - } - else { - /* pure translation */ - MEMCPY( out, Identity, sizeof(Identity) ); - MAT(out,0,3) = - MAT(in,0,3); - MAT(out,1,3) = - MAT(in,1,3); - MAT(out,2,3) = - MAT(in,2,3); - return GL_TRUE; - } - - if (mat->flags & MAT_FLAG_TRANSLATION) { - /* Do the translation part */ - MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0) + - MAT(in,1,3) * MAT(out,0,1) + - MAT(in,2,3) * MAT(out,0,2) ); - MAT(out,1,3) = - (MAT(in,0,3) * MAT(out,1,0) + - MAT(in,1,3) * MAT(out,1,1) + - MAT(in,2,3) * MAT(out,1,2) ); - MAT(out,2,3) = - (MAT(in,0,3) * MAT(out,2,0) + - MAT(in,1,3) * MAT(out,2,1) + - MAT(in,2,3) * MAT(out,2,2) ); - } - else { - MAT(out,0,3) = MAT(out,1,3) = MAT(out,2,3) = 0.0; - } - - return GL_TRUE; -} - -/** - * Compute inverse of an identity transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return always GL_TRUE. - * - * Simply copies Identity into GLmatrix::inv. - */ -static GLboolean invert_matrix_identity( GLmatrix *mat ) -{ - MEMCPY( mat->inv, Identity, sizeof(Identity) ); - return GL_TRUE; -} - -/** - * Compute inverse of a no-rotation 3d transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * Calculates the - */ -static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) -{ - const GLfloat *in = mat->m; - GLfloat *out = mat->inv; - - if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) - return GL_FALSE; - - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - MAT(out,0,0) = 1.0F / MAT(in,0,0); - MAT(out,1,1) = 1.0F / MAT(in,1,1); - MAT(out,2,2) = 1.0F / MAT(in,2,2); - - if (mat->flags & MAT_FLAG_TRANSLATION) { - MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0)); - MAT(out,1,3) = - (MAT(in,1,3) * MAT(out,1,1)); - MAT(out,2,3) = - (MAT(in,2,3) * MAT(out,2,2)); - } - - return GL_TRUE; -} - -/** - * Compute inverse of a no-rotation 2d transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * Calculates the inverse matrix by applying the inverse scaling and - * translation to the identity matrix. - */ -static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) -{ - const GLfloat *in = mat->m; - GLfloat *out = mat->inv; - - if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) - return GL_FALSE; - - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - MAT(out,0,0) = 1.0F / MAT(in,0,0); - MAT(out,1,1) = 1.0F / MAT(in,1,1); - - if (mat->flags & MAT_FLAG_TRANSLATION) { - MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0)); - MAT(out,1,3) = - (MAT(in,1,3) * MAT(out,1,1)); - } - - return GL_TRUE; -} - -#if 0 -/* broken */ -static GLboolean invert_matrix_perspective( GLmatrix *mat ) -{ - const GLfloat *in = mat->m; - GLfloat *out = mat->inv; - - if (MAT(in,2,3) == 0) - return GL_FALSE; - - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - - MAT(out,0,0) = 1.0F / MAT(in,0,0); - MAT(out,1,1) = 1.0F / MAT(in,1,1); - - MAT(out,0,3) = MAT(in,0,2); - MAT(out,1,3) = MAT(in,1,2); - - MAT(out,2,2) = 0; - MAT(out,2,3) = -1; - - MAT(out,3,2) = 1.0F / MAT(in,2,3); - MAT(out,3,3) = MAT(in,2,2) * MAT(out,3,2); - - return GL_TRUE; -} -#endif - -/** - * Matrix inversion function pointer type. - */ -typedef GLboolean (*inv_mat_func)( GLmatrix *mat ); - -/** - * Table of the matrix inversion functions according to the matrix type. - */ -static inv_mat_func inv_mat_tab[7] = { - invert_matrix_general, - invert_matrix_identity, - invert_matrix_3d_no_rot, -#if 0 - /* Don't use this function for now - it fails when the projection matrix - * is premultiplied by a translation (ala Chromium's tilesort SPU). - */ - invert_matrix_perspective, -#else - invert_matrix_general, -#endif - invert_matrix_3d, /* lazy! */ - invert_matrix_2d_no_rot, - invert_matrix_3d -}; - -/** - * Compute inverse of a transformation matrix. - * - * \param mat pointer to a GLmatrix structure. The matrix inverse will be - * stored in the GLmatrix::inv attribute. - * - * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * - * Calls the matrix inversion function in inv_mat_tab corresponding to the - * given matrix type. In case of failure, updates the MAT_FLAG_SINGULAR flag, - * and copies the identity matrix into GLmatrix::inv. - */ -static GLboolean matrix_invert( GLmatrix *mat ) -{ - if (inv_mat_tab[mat->type](mat)) { - mat->flags &= ~MAT_FLAG_SINGULAR; - return GL_TRUE; - } else { - mat->flags |= MAT_FLAG_SINGULAR; - MEMCPY( mat->inv, Identity, sizeof(Identity) ); - return GL_FALSE; - } -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Matrix generation */ -/*@{*/ - -/** - * Generate a 4x4 transformation matrix from glRotate parameters, and - * post-multiply the input matrix by it. - * - * \author - * This function was contributed by Erich Boleyn (erich@uruk.org). - * Optimizations contributed by Rudolf Opalla (rudi@khm.de). - */ -void -_math_matrix_rotate( GLmatrix *mat, - GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) -{ - GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c, s, c; - GLfloat m[16]; - GLboolean optimized; - - s = (GLfloat) _mesa_sin( angle * DEG2RAD ); - c = (GLfloat) _mesa_cos( angle * DEG2RAD ); - - MEMCPY(m, Identity, sizeof(GLfloat)*16); - optimized = GL_FALSE; - -#define M(row,col) m[col*4+row] - - if (x == 0.0F) { - if (y == 0.0F) { - if (z != 0.0F) { - optimized = GL_TRUE; - /* rotate only around z-axis */ - M(0,0) = c; - M(1,1) = c; - if (z < 0.0F) { - M(0,1) = s; - M(1,0) = -s; - } - else { - M(0,1) = -s; - M(1,0) = s; - } - } - } - else if (z == 0.0F) { - optimized = GL_TRUE; - /* rotate only around y-axis */ - M(0,0) = c; - M(2,2) = c; - if (y < 0.0F) { - M(0,2) = -s; - M(2,0) = s; - } - else { - M(0,2) = s; - M(2,0) = -s; - } - } - } - else if (y == 0.0F) { - if (z == 0.0F) { - optimized = GL_TRUE; - /* rotate only around x-axis */ - M(1,1) = c; - M(2,2) = c; - if (x < 0.0F) { - M(1,2) = s; - M(2,1) = -s; - } - else { - M(1,2) = -s; - M(2,1) = s; - } - } - } - - if (!optimized) { - const GLfloat mag = SQRTF(x * x + y * y + z * z); - - if (mag <= 1.0e-4) { - /* no rotation, leave mat as-is */ - return; - } - - x /= mag; - y /= mag; - z /= mag; - - - /* - * Arbitrary axis rotation matrix. - * - * This is composed of 5 matrices, Rz, Ry, T, Ry', Rz', multiplied - * like so: Rz * Ry * T * Ry' * Rz'. T is the final rotation - * (which is about the X-axis), and the two composite transforms - * Ry' * Rz' and Rz * Ry are (respectively) the rotations necessary - * from the arbitrary axis to the X-axis then back. They are - * all elementary rotations. - * - * Rz' is a rotation about the Z-axis, to bring the axis vector - * into the x-z plane. Then Ry' is applied, rotating about the - * Y-axis to bring the axis vector parallel with the X-axis. The - * rotation about the X-axis is then performed. Ry and Rz are - * simply the respective inverse transforms to bring the arbitrary - * axis back to it's original orientation. The first transforms - * Rz' and Ry' are considered inverses, since the data from the - * arbitrary axis gives you info on how to get to it, not how - * to get away from it, and an inverse must be applied. - * - * The basic calculation used is to recognize that the arbitrary - * axis vector (x, y, z), since it is of unit length, actually - * represents the sines and cosines of the angles to rotate the - * X-axis to the same orientation, with theta being the angle about - * Z and phi the angle about Y (in the order described above) - * as follows: - * - * cos ( theta ) = x / sqrt ( 1 - z^2 ) - * sin ( theta ) = y / sqrt ( 1 - z^2 ) - * - * cos ( phi ) = sqrt ( 1 - z^2 ) - * sin ( phi ) = z - * - * Note that cos ( phi ) can further be inserted to the above - * formulas: - * - * cos ( theta ) = x / cos ( phi ) - * sin ( theta ) = y / sin ( phi ) - * - * ...etc. Because of those relations and the standard trigonometric - * relations, it is pssible to reduce the transforms down to what - * is used below. It may be that any primary axis chosen will give the - * same results (modulo a sign convention) using thie method. - * - * Particularly nice is to notice that all divisions that might - * have caused trouble when parallel to certain planes or - * axis go away with care paid to reducing the expressions. - * After checking, it does perform correctly under all cases, since - * in all the cases of division where the denominator would have - * been zero, the numerator would have been zero as well, giving - * the expected result. - */ - - xx = x * x; - yy = y * y; - zz = z * z; - xy = x * y; - yz = y * z; - zx = z * x; - xs = x * s; - ys = y * s; - zs = z * s; - one_c = 1.0F - c; - - /* We already hold the identity-matrix so we can skip some statements */ - M(0,0) = (one_c * xx) + c; - M(0,1) = (one_c * xy) - zs; - M(0,2) = (one_c * zx) + ys; -/* M(0,3) = 0.0F; */ - - M(1,0) = (one_c * xy) + zs; - M(1,1) = (one_c * yy) + c; - M(1,2) = (one_c * yz) - xs; -/* M(1,3) = 0.0F; */ - - M(2,0) = (one_c * zx) - ys; - M(2,1) = (one_c * yz) + xs; - M(2,2) = (one_c * zz) + c; -/* M(2,3) = 0.0F; */ - -/* - M(3,0) = 0.0F; - M(3,1) = 0.0F; - M(3,2) = 0.0F; - M(3,3) = 1.0F; -*/ - } -#undef M - - matrix_multf( mat, m, MAT_FLAG_ROTATION ); -} - -/** - * Apply a perspective projection matrix. - * - * \param mat matrix to apply the projection. - * \param left left clipping plane coordinate. - * \param right right clipping plane coordinate. - * \param bottom bottom clipping plane coordinate. - * \param top top clipping plane coordinate. - * \param nearval distance to the near clipping plane. - * \param farval distance to the far clipping plane. - * - * Creates the projection matrix and multiplies it with \p mat, marking the - * MAT_FLAG_PERSPECTIVE flag. - */ -void -_math_matrix_frustum( GLmatrix *mat, - GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, - GLfloat nearval, GLfloat farval ) -{ - GLfloat x, y, a, b, c, d; - GLfloat m[16]; - - x = (2.0F*nearval) / (right-left); - y = (2.0F*nearval) / (top-bottom); - a = (right+left) / (right-left); - b = (top+bottom) / (top-bottom); - c = -(farval+nearval) / ( farval-nearval); - d = -(2.0F*farval*nearval) / (farval-nearval); /* error? */ - -#define M(row,col) m[col*4+row] - M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; - M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F; - M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d; - M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F; -#undef M - - matrix_multf( mat, m, MAT_FLAG_PERSPECTIVE ); -} - -/** - * Apply an orthographic projection matrix. - * - * \param mat matrix to apply the projection. - * \param left left clipping plane coordinate. - * \param right right clipping plane coordinate. - * \param bottom bottom clipping plane coordinate. - * \param top top clipping plane coordinate. - * \param nearval distance to the near clipping plane. - * \param farval distance to the far clipping plane. - * - * Creates the projection matrix and multiplies it with \p mat, marking the - * MAT_FLAG_GENERAL_SCALE and MAT_FLAG_TRANSLATION flags. - */ -void -_math_matrix_ortho( GLmatrix *mat, - GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, - GLfloat nearval, GLfloat farval ) -{ - GLfloat m[16]; - -#define M(row,col) m[col*4+row] - M(0,0) = 2.0F / (right-left); - M(0,1) = 0.0F; - M(0,2) = 0.0F; - M(0,3) = -(right+left) / (right-left); - - M(1,0) = 0.0F; - M(1,1) = 2.0F / (top-bottom); - M(1,2) = 0.0F; - M(1,3) = -(top+bottom) / (top-bottom); - - M(2,0) = 0.0F; - M(2,1) = 0.0F; - M(2,2) = -2.0F / (farval-nearval); - M(2,3) = -(farval+nearval) / (farval-nearval); - - M(3,0) = 0.0F; - M(3,1) = 0.0F; - M(3,2) = 0.0F; - M(3,3) = 1.0F; -#undef M - - matrix_multf( mat, m, (MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION)); -} - -/** - * Multiply a matrix with a general scaling matrix. - * - * \param mat matrix. - * \param x x axis scale factor. - * \param y y axis scale factor. - * \param z z axis scale factor. - * - * Multiplies in-place the elements of \p mat by the scale factors. Checks if - * the scales factors are roughly the same, marking the MAT_FLAG_UNIFORM_SCALE - * flag, or MAT_FLAG_GENERAL_SCALE. Marks the MAT_DIRTY_TYPE and - * MAT_DIRTY_INVERSE dirty flags. - */ -void -_math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) -{ - GLfloat *m = mat->m; - m[0] *= x; m[4] *= y; m[8] *= z; - m[1] *= x; m[5] *= y; m[9] *= z; - m[2] *= x; m[6] *= y; m[10] *= z; - m[3] *= x; m[7] *= y; m[11] *= z; - - if (FABSF(x - y) < 1e-8 && FABSF(x - z) < 1e-8) - mat->flags |= MAT_FLAG_UNIFORM_SCALE; - else - mat->flags |= MAT_FLAG_GENERAL_SCALE; - - mat->flags |= (MAT_DIRTY_TYPE | - MAT_DIRTY_INVERSE); -} - -/** - * Multiply a matrix with a translation matrix. - * - * \param mat matrix. - * \param x translation vector x coordinate. - * \param y translation vector y coordinate. - * \param z translation vector z coordinate. - * - * Adds the translation coordinates to the elements of \p mat in-place. Marks - * the MAT_FLAG_TRANSLATION flag, and the MAT_DIRTY_TYPE and MAT_DIRTY_INVERSE - * dirty flags. - */ -void -_math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) -{ - GLfloat *m = mat->m; - m[12] = m[0] * x + m[4] * y + m[8] * z + m[12]; - m[13] = m[1] * x + m[5] * y + m[9] * z + m[13]; - m[14] = m[2] * x + m[6] * y + m[10] * z + m[14]; - m[15] = m[3] * x + m[7] * y + m[11] * z + m[15]; - - mat->flags |= (MAT_FLAG_TRANSLATION | - MAT_DIRTY_TYPE | - MAT_DIRTY_INVERSE); -} - - -/** - * Set matrix to do viewport and depthrange mapping. - * Transforms Normalized Device Coords to window/Z values. - */ -void -_math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, - GLfloat zNear, GLfloat zFar, GLfloat depthMax) -{ - m->m[MAT_SX] = (GLfloat) width / 2.0F; - m->m[MAT_TX] = m->m[MAT_SX] + x; - m->m[MAT_SY] = (GLfloat) height / 2.0F; - m->m[MAT_TY] = m->m[MAT_SY] + y; - m->m[MAT_SZ] = depthMax * ((zFar - zNear) / 2.0F); - m->m[MAT_TZ] = depthMax * ((zFar - zNear) / 2.0F + zNear); - m->flags = MAT_FLAG_GENERAL_SCALE | MAT_FLAG_TRANSLATION; - m->type = MATRIX_3D_NO_ROT; -} - - -/** - * Set a matrix to the identity matrix. - * - * \param mat matrix. - * - * Copies ::Identity into \p GLmatrix::m, and into GLmatrix::inv if not NULL. - * Sets the matrix type to identity, and clear the dirty flags. - */ -void -_math_matrix_set_identity( GLmatrix *mat ) -{ - MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) ); - - if (mat->inv) - MEMCPY( mat->inv, Identity, 16*sizeof(GLfloat) ); - - mat->type = MATRIX_IDENTITY; - mat->flags &= ~(MAT_DIRTY_FLAGS| - MAT_DIRTY_TYPE| - MAT_DIRTY_INVERSE); -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Matrix analysis */ -/*@{*/ - -#define ZERO(x) (1<m; - GLuint mask = 0; - GLuint i; - - for (i = 0 ; i < 16 ; i++) { - if (m[i] == 0.0) mask |= (1<flags &= ~MAT_FLAGS_GEOMETRY; - - /* Check for translation - no-one really cares - */ - if ((mask & MASK_NO_TRX) != MASK_NO_TRX) - mat->flags |= MAT_FLAG_TRANSLATION; - - /* Do the real work - */ - if (mask == (GLuint) MASK_IDENTITY) { - mat->type = MATRIX_IDENTITY; - } - else if ((mask & MASK_2D_NO_ROT) == (GLuint) MASK_2D_NO_ROT) { - mat->type = MATRIX_2D_NO_ROT; - - if ((mask & MASK_NO_2D_SCALE) != MASK_NO_2D_SCALE) - mat->flags |= MAT_FLAG_GENERAL_SCALE; - } - else if ((mask & MASK_2D) == (GLuint) MASK_2D) { - GLfloat mm = DOT2(m, m); - GLfloat m4m4 = DOT2(m+4,m+4); - GLfloat mm4 = DOT2(m,m+4); - - mat->type = MATRIX_2D; - - /* Check for scale */ - if (SQ(mm-1) > SQ(1e-6) || - SQ(m4m4-1) > SQ(1e-6)) - mat->flags |= MAT_FLAG_GENERAL_SCALE; - - /* Check for rotation */ - if (SQ(mm4) > SQ(1e-6)) - mat->flags |= MAT_FLAG_GENERAL_3D; - else - mat->flags |= MAT_FLAG_ROTATION; - - } - else if ((mask & MASK_3D_NO_ROT) == (GLuint) MASK_3D_NO_ROT) { - mat->type = MATRIX_3D_NO_ROT; - - /* Check for scale */ - if (SQ(m[0]-m[5]) < SQ(1e-6) && - SQ(m[0]-m[10]) < SQ(1e-6)) { - if (SQ(m[0]-1.0) > SQ(1e-6)) { - mat->flags |= MAT_FLAG_UNIFORM_SCALE; - } - } - else { - mat->flags |= MAT_FLAG_GENERAL_SCALE; - } - } - else if ((mask & MASK_3D) == (GLuint) MASK_3D) { - GLfloat c1 = DOT3(m,m); - GLfloat c2 = DOT3(m+4,m+4); - GLfloat c3 = DOT3(m+8,m+8); - GLfloat d1 = DOT3(m, m+4); - GLfloat cp[3]; - - mat->type = MATRIX_3D; - - /* Check for scale */ - if (SQ(c1-c2) < SQ(1e-6) && SQ(c1-c3) < SQ(1e-6)) { - if (SQ(c1-1.0) > SQ(1e-6)) - mat->flags |= MAT_FLAG_UNIFORM_SCALE; - /* else no scale at all */ - } - else { - mat->flags |= MAT_FLAG_GENERAL_SCALE; - } - - /* Check for rotation */ - if (SQ(d1) < SQ(1e-6)) { - CROSS3( cp, m, m+4 ); - SUB_3V( cp, cp, (m+8) ); - if (LEN_SQUARED_3FV(cp) < SQ(1e-6)) - mat->flags |= MAT_FLAG_ROTATION; - else - mat->flags |= MAT_FLAG_GENERAL_3D; - } - else { - mat->flags |= MAT_FLAG_GENERAL_3D; /* shear, etc */ - } - } - else if ((mask & MASK_PERSPECTIVE) == MASK_PERSPECTIVE && m[11]==-1.0F) { - mat->type = MATRIX_PERSPECTIVE; - mat->flags |= MAT_FLAG_GENERAL; - } - else { - mat->type = MATRIX_GENERAL; - mat->flags |= MAT_FLAG_GENERAL; - } -} - -/** - * Analyze a matrix given that its flags are accurate. - * - * This is the more common operation, hopefully. - */ -static void analyse_from_flags( GLmatrix *mat ) -{ - const GLfloat *m = mat->m; - - if (TEST_MAT_FLAGS(mat, 0)) { - mat->type = MATRIX_IDENTITY; - } - else if (TEST_MAT_FLAGS(mat, (MAT_FLAG_TRANSLATION | - MAT_FLAG_UNIFORM_SCALE | - MAT_FLAG_GENERAL_SCALE))) { - if ( m[10]==1.0F && m[14]==0.0F ) { - mat->type = MATRIX_2D_NO_ROT; - } - else { - mat->type = MATRIX_3D_NO_ROT; - } - } - else if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D)) { - if ( m[ 8]==0.0F - && m[ 9]==0.0F - && m[2]==0.0F && m[6]==0.0F && m[10]==1.0F && m[14]==0.0F) { - mat->type = MATRIX_2D; - } - else { - mat->type = MATRIX_3D; - } - } - else if ( m[4]==0.0F && m[12]==0.0F - && m[1]==0.0F && m[13]==0.0F - && m[2]==0.0F && m[6]==0.0F - && m[3]==0.0F && m[7]==0.0F && m[11]==-1.0F && m[15]==0.0F) { - mat->type = MATRIX_PERSPECTIVE; - } - else { - mat->type = MATRIX_GENERAL; - } -} - -/** - * Analyze and update a matrix. - * - * \param mat matrix. - * - * If the matrix type is dirty then calls either analyse_from_scratch() or - * analyse_from_flags() to determine its type, according to whether the flags - * are dirty or not, respectively. If the matrix has an inverse and it's dirty - * then calls matrix_invert(). Finally clears the dirty flags. - */ -void -_math_matrix_analyse( GLmatrix *mat ) -{ - if (mat->flags & MAT_DIRTY_TYPE) { - if (mat->flags & MAT_DIRTY_FLAGS) - analyse_from_scratch( mat ); - else - analyse_from_flags( mat ); - } - - if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) { - matrix_invert( mat ); - mat->flags &= ~MAT_DIRTY_INVERSE; - } - - mat->flags &= ~(MAT_DIRTY_FLAGS | MAT_DIRTY_TYPE); -} - -/*@}*/ - - -/** - * Test if the given matrix preserves vector lengths. - */ -GLboolean -_math_matrix_is_length_preserving( const GLmatrix *m ) -{ - return TEST_MAT_FLAGS( m, MAT_FLAGS_LENGTH_PRESERVING); -} - - -/** - * Test if the given matrix does any rotation. - * (or perhaps if the upper-left 3x3 is non-identity) - */ -GLboolean -_math_matrix_has_rotation( const GLmatrix *m ) -{ - if (m->flags & (MAT_FLAG_GENERAL | - MAT_FLAG_ROTATION | - MAT_FLAG_GENERAL_3D | - MAT_FLAG_PERSPECTIVE)) - return GL_TRUE; - else - return GL_FALSE; -} - - -GLboolean -_math_matrix_is_general_scale( const GLmatrix *m ) -{ - return (m->flags & MAT_FLAG_GENERAL_SCALE) ? GL_TRUE : GL_FALSE; -} - - -GLboolean -_math_matrix_is_dirty( const GLmatrix *m ) -{ - return (m->flags & MAT_DIRTY) ? GL_TRUE : GL_FALSE; -} - - -/**********************************************************************/ -/** \name Matrix setup */ -/*@{*/ - -/** - * Copy a matrix. - * - * \param to destination matrix. - * \param from source matrix. - * - * Copies all fields in GLmatrix, creating an inverse array if necessary. - */ -void -_math_matrix_copy( GLmatrix *to, const GLmatrix *from ) -{ - MEMCPY( to->m, from->m, sizeof(Identity) ); - to->flags = from->flags; - to->type = from->type; - - if (to->inv != 0) { - if (from->inv == 0) { - matrix_invert( to ); - } - else { - MEMCPY(to->inv, from->inv, sizeof(GLfloat)*16); - } - } -} - -/** - * Loads a matrix array into GLmatrix. - * - * \param m matrix array. - * \param mat matrix. - * - * Copies \p m into GLmatrix::m and marks the MAT_FLAG_GENERAL and MAT_DIRTY - * flags. - */ -void -_math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) -{ - MEMCPY( mat->m, m, 16*sizeof(GLfloat) ); - mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY); -} - -/** - * Matrix constructor. - * - * \param m matrix. - * - * Initialize the GLmatrix fields. - */ -void -_math_matrix_ctr( GLmatrix *m ) -{ - m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); - if (m->m) - MEMCPY( m->m, Identity, sizeof(Identity) ); - m->inv = NULL; - m->type = MATRIX_IDENTITY; - m->flags = 0; -} - -/** - * Matrix destructor. - * - * \param m matrix. - * - * Frees the data in a GLmatrix. - */ -void -_math_matrix_dtr( GLmatrix *m ) -{ - if (m->m) { - ALIGN_FREE( m->m ); - m->m = NULL; - } - if (m->inv) { - ALIGN_FREE( m->inv ); - m->inv = NULL; - } -} - -/** - * Allocate a matrix inverse. - * - * \param m matrix. - * - * Allocates the matrix inverse, GLmatrix::inv, and sets it to Identity. - */ -void -_math_matrix_alloc_inv( GLmatrix *m ) -{ - if (!m->inv) { - m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); - if (m->inv) - MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) ); - } -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Matrix transpose */ -/*@{*/ - -/** - * Transpose a GLfloat matrix. - * - * \param to destination array. - * \param from source array. - */ -void -_math_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]; -} - -/** - * Transpose a GLdouble matrix. - * - * \param to destination array. - * \param from source array. - */ -void -_math_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]; -} - -/** - * Transpose a GLdouble matrix and convert to GLfloat. - * - * \param to destination array. - * \param from source array. - */ -void -_math_transposefd( GLfloat to[16], const GLdouble from[16] ) -{ - to[0] = (GLfloat) from[0]; - to[1] = (GLfloat) from[4]; - to[2] = (GLfloat) from[8]; - to[3] = (GLfloat) from[12]; - to[4] = (GLfloat) from[1]; - to[5] = (GLfloat) from[5]; - to[6] = (GLfloat) from[9]; - to[7] = (GLfloat) from[13]; - to[8] = (GLfloat) from[2]; - to[9] = (GLfloat) from[6]; - to[10] = (GLfloat) from[10]; - to[11] = (GLfloat) from[14]; - to[12] = (GLfloat) from[3]; - to[13] = (GLfloat) from[7]; - to[14] = (GLfloat) from[11]; - to[15] = (GLfloat) from[15]; -} - -/*@}*/ - diff --git a/src/libs/mesa/mesa/math/m_matrix.h b/src/libs/mesa/mesa/math/m_matrix.h deleted file mode 100644 index a8d9000e89..0000000000 --- a/src/libs/mesa/mesa/math/m_matrix.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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. - */ - - -/** - * \file math/m_matrix.h - * Defines basic structures for matrix-handling. - */ - -#ifndef _M_MATRIX_H -#define _M_MATRIX_H - - - -/** - * \name Symbolic names to some of the entries in the matrix - * - * These are handy for the viewport mapping, which is expressed as a matrix. - */ -/*@{*/ -#define MAT_SX 0 -#define MAT_SY 5 -#define MAT_SZ 10 -#define MAT_TX 12 -#define MAT_TY 13 -#define MAT_TZ 14 -/*@}*/ - - -/** - * Different kinds of 4x4 transformation matrices. - * We use these to select specific optimized vertex transformation routines. - */ -enum GLmatrixtype { - MATRIX_GENERAL, /**< general 4x4 matrix */ - MATRIX_IDENTITY, /**< identity matrix */ - MATRIX_3D_NO_ROT, /**< orthogonal projection and others... */ - MATRIX_PERSPECTIVE, /**< perspective projection matrix */ - MATRIX_2D, /**< 2-D transformation */ - MATRIX_2D_NO_ROT, /**< 2-D scale & translate only */ - MATRIX_3D /**< 3-D transformation */ -} ; - -/** - * Matrix type to represent 4x4 transformation matrices. - */ -typedef struct { - GLfloat *m; /**< 16 matrix elements (16-byte aligned) */ - GLfloat *inv; /**< optional 16-element inverse (16-byte aligned) */ - GLuint flags; /**< possible values determined by (of \link - * MatFlags MAT_FLAG_* flags\endlink) - */ - enum GLmatrixtype type; -} GLmatrix; - - - - -extern void -_math_matrix_ctr( GLmatrix *m ); - -extern void -_math_matrix_dtr( GLmatrix *m ); - -extern void -_math_matrix_alloc_inv( GLmatrix *m ); - -extern void -_math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ); - -extern void -_math_matrix_mul_floats( GLmatrix *dest, const GLfloat *b ); - -extern void -_math_matrix_loadf( GLmatrix *mat, const GLfloat *m ); - -extern void -_math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); - -extern void -_math_matrix_rotate( GLmatrix *m, GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -extern void -_math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); - -extern void -_math_matrix_ortho( GLmatrix *mat, - GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, - GLfloat nearval, GLfloat farval ); - -extern void -_math_matrix_frustum( GLmatrix *mat, - GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, - GLfloat nearval, GLfloat farval ); - -extern void -_math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, - GLfloat zNear, GLfloat zFar, GLfloat depthMax); - -extern void -_math_matrix_set_identity( GLmatrix *dest ); - -extern void -_math_matrix_copy( GLmatrix *to, const GLmatrix *from ); - -extern void -_math_matrix_analyse( GLmatrix *mat ); - -extern void -_math_matrix_print( const GLmatrix *m ); - -extern GLboolean -_math_matrix_is_length_preserving( const GLmatrix *m ); - -extern GLboolean -_math_matrix_has_rotation( const GLmatrix *m ); - -extern GLboolean -_math_matrix_is_general_scale( const GLmatrix *m ); - -extern GLboolean -_math_matrix_is_dirty( const GLmatrix *m ); - - -/** - * \name Related functions that don't actually operate on GLmatrix structs - */ -/*@{*/ - -extern void -_math_transposef( GLfloat to[16], const GLfloat from[16] ); - -extern void -_math_transposed( GLdouble to[16], const GLdouble from[16] ); - -extern void -_math_transposefd( GLfloat to[16], const GLdouble from[16] ); - - -/* - * Transform a point (column vector) by a matrix: Q = M * P - */ -#define TRANSFORM_POINT( Q, M, P ) \ - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \ - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \ - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \ - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; - - -#define TRANSFORM_POINT3( Q, M, P ) \ - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; \ - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; \ - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; \ - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; - - -/* - * Transform a normal (row vector) by a matrix: [NX NY NZ] = N * MAT - */ -#define TRANSFORM_NORMAL( TO, N, MAT ) \ -do { \ - TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \ - TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \ - TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \ -} while (0) - - -/** - * Transform a direction by a matrix. - */ -#define TRANSFORM_DIRECTION( TO, DIR, MAT ) \ -do { \ - TO[0] = DIR[0] * MAT[0] + DIR[1] * MAT[4] + DIR[2] * MAT[8]; \ - TO[1] = DIR[0] * MAT[1] + DIR[1] * MAT[5] + DIR[2] * MAT[9]; \ - TO[2] = DIR[0] * MAT[2] + DIR[1] * MAT[6] + DIR[2] * MAT[10];\ -} while (0) - - - -/*@}*/ - - -#endif diff --git a/src/libs/mesa/mesa/math/m_norm_tmp.h b/src/libs/mesa/mesa/math/m_norm_tmp.h deleted file mode 100644 index a20cb05017..0000000000 --- a/src/libs/mesa/mesa/math/m_norm_tmp.h +++ /dev/null @@ -1,390 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - -/* Functions to tranform a vector of normals. This includes applying - * the transformation matrix, rescaling and normalization. - */ - -/* - * mat - the 4x4 transformation matrix - * scale - uniform scale factor of the transformation matrix (not always used) - * in - the source vector of normals - * lengths - length of each incoming normal (may be NULL) (a display list - * optimization) - * dest - the destination vector of normals - */ -static void _XFORMAPI -TAG(transform_normalize_normals)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - const GLfloat *m = mat->inv; - GLfloat m0 = m[0], m4 = m[4], m8 = m[8]; - GLfloat m1 = m[1], m5 = m[5], m9 = m[9]; - GLfloat m2 = m[2], m6 = m[6], m10 = m[10]; - GLuint i; - - if (!lengths) { - STRIDE_LOOP { - GLfloat tx, ty, tz; - { - const GLfloat ux = from[0], uy = from[1], uz = from[2]; - tx = ux * m0 + uy * m1 + uz * m2; - ty = ux * m4 + uy * m5 + uz * m6; - tz = ux * m8 + uy * m9 + uz * m10; - } - { - GLdouble len = tx*tx + ty*ty + tz*tz; - if (len > 1e-20) { - GLfloat scale = INV_SQRTF(len); - out[i][0] = tx * scale; - out[i][1] = ty * scale; - out[i][2] = tz * scale; - } - else { - out[i][0] = out[i][1] = out[i][2] = 0; - } - } - } - } - else { - if (scale != 1.0) { - m0 *= scale, m4 *= scale, m8 *= scale; - m1 *= scale, m5 *= scale, m9 *= scale; - m2 *= scale, m6 *= scale, m10 *= scale; - } - - STRIDE_LOOP { - GLfloat tx, ty, tz; - { - const GLfloat ux = from[0], uy = from[1], uz = from[2]; - tx = ux * m0 + uy * m1 + uz * m2; - ty = ux * m4 + uy * m5 + uz * m6; - tz = ux * m8 + uy * m9 + uz * m10; - } - { - GLfloat len = lengths[i]; - out[i][0] = tx * len; - out[i][1] = ty * len; - out[i][2] = tz * len; - } - } - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - const GLfloat *m = mat->inv; - GLfloat m0 = m[0]; - GLfloat m5 = m[5]; - GLfloat m10 = m[10]; - GLuint i; - - if (!lengths) { - STRIDE_LOOP { - GLfloat tx, ty, tz; - { - const GLfloat ux = from[0], uy = from[1], uz = from[2]; - tx = ux * m0 ; - ty = uy * m5 ; - tz = uz * m10; - } - { - GLdouble len = tx*tx + ty*ty + tz*tz; - if (len > 1e-20) { - GLfloat scale = INV_SQRTF(len); - out[i][0] = tx * scale; - out[i][1] = ty * scale; - out[i][2] = tz * scale; - } - else { - out[i][0] = out[i][1] = out[i][2] = 0; - } - } - } - } - else { - m0 *= scale; - m5 *= scale; - m10 *= scale; - - STRIDE_LOOP { - GLfloat tx, ty, tz; - { - const GLfloat ux = from[0], uy = from[1], uz = from[2]; - tx = ux * m0 ; - ty = uy * m5 ; - tz = uz * m10; - } - { - GLfloat len = lengths[i]; - out[i][0] = tx * len; - out[i][1] = ty * len; - out[i][2] = tz * len; - } - } - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - const GLfloat *m = mat->inv; - const GLfloat m0 = scale*m[0]; - const GLfloat m5 = scale*m[5]; - const GLfloat m10 = scale*m[10]; - GLuint i; - - (void) lengths; - - STRIDE_LOOP { - GLfloat ux = from[0], uy = from[1], uz = from[2]; - out[i][0] = ux * m0; - out[i][1] = uy * m5; - out[i][2] = uz * m10; - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(transform_rescale_normals)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - /* Since we are unlikely to have < 3 vertices in the buffer, - * it makes sense to pre-multiply by scale. - */ - const GLfloat *m = mat->inv; - const GLfloat m0 = scale*m[0], m4 = scale*m[4], m8 = scale*m[8]; - const GLfloat m1 = scale*m[1], m5 = scale*m[5], m9 = scale*m[9]; - const GLfloat m2 = scale*m[2], m6 = scale*m[6], m10 = scale*m[10]; - GLuint i; - - (void) lengths; - - STRIDE_LOOP { - GLfloat ux = from[0], uy = from[1], uz = from[2]; - out[i][0] = ux * m0 + uy * m1 + uz * m2; - out[i][1] = ux * m4 + uy * m5 + uz * m6; - out[i][2] = ux * m8 + uy * m9 + uz * m10; - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(transform_normals_no_rot)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - const GLfloat *m = mat->inv; - const GLfloat m0 = m[0]; - const GLfloat m5 = m[5]; - const GLfloat m10 = m[10]; - GLuint i; - - (void) scale; - (void) lengths; - - STRIDE_LOOP { - GLfloat ux = from[0], uy = from[1], uz = from[2]; - out[i][0] = ux * m0; - out[i][1] = uy * m5; - out[i][2] = uz * m10; - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(transform_normals)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - const GLfloat *m = mat->inv; - const GLfloat m0 = m[0], m4 = m[4], m8 = m[8]; - const GLfloat m1 = m[1], m5 = m[5], m9 = m[9]; - const GLfloat m2 = m[2], m6 = m[6], m10 = m[10]; - GLuint i; - - (void) scale; - (void) lengths; - - STRIDE_LOOP { - GLfloat ux = from[0], uy = from[1], uz = from[2]; - out[i][0] = ux * m0 + uy * m1 + uz * m2; - out[i][1] = ux * m4 + uy * m5 + uz * m6; - out[i][2] = ux * m8 + uy * m9 + uz * m10; - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(normalize_normals)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - GLuint i; - - (void) mat; - (void) scale; - - if (lengths) { - STRIDE_LOOP { - const GLfloat x = from[0], y = from[1], z = from[2]; - GLfloat invlen = lengths[i]; - out[i][0] = x * invlen; - out[i][1] = y * invlen; - out[i][2] = z * invlen; - } - } - else { - STRIDE_LOOP { - const GLfloat x = from[0], y = from[1], z = from[2]; - GLdouble len = x * x + y * y + z * z; - if (len > 1e-50) { - len = INV_SQRTF(len); - out[i][0] = (GLfloat)(x * len); - out[i][1] = (GLfloat)(y * len); - out[i][2] = (GLfloat)(z * len); - } - else { - out[i][0] = x; - out[i][1] = y; - out[i][2] = z; - } - } - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(rescale_normals)( const GLmatrix *mat, - GLfloat scale, - const GLvector4f *in, - const GLfloat *lengths, - GLvector4f *dest ) -{ - GLfloat (*out)[4] = (GLfloat (*)[4])dest->start; - const GLfloat *from = in->start; - const GLuint stride = in->stride; - const GLuint count = in->count; - GLuint i; - - (void) mat; - (void) lengths; - - STRIDE_LOOP { - SCALE_SCALAR_3V( out[i], scale, from ); - } - dest->count = in->count; -} - - -static void _XFORMAPI -TAG(init_c_norm_transform)( void ) -{ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = - TAG(transform_normals_no_rot); - - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = - TAG(transform_rescale_normals_no_rot); - - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = - TAG(transform_normalize_normals_no_rot); - - _mesa_normal_tab[NORM_TRANSFORM] = - TAG(transform_normals); - - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = - TAG(transform_rescale_normals); - - _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = - TAG(transform_normalize_normals); - - _mesa_normal_tab[NORM_RESCALE] = - TAG(rescale_normals); - - _mesa_normal_tab[NORM_NORMALIZE] = - TAG(normalize_normals); -} diff --git a/src/libs/mesa/mesa/math/m_trans_tmp.h b/src/libs/mesa/mesa/math/m_trans_tmp.h deleted file mode 100644 index 08fb4d1e9c..0000000000 --- a/src/libs/mesa/mesa/math/m_trans_tmp.h +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \brief Templates for vector conversions. - * \author Keith Whitwell. - */ - -#ifdef DEST_4F -static void DEST_4F( GLfloat (*t)[4], - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - - (void) first; - (void) start; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) t[i][0] = TRX_4F(f, 0); - if (SZ >= 2) t[i][1] = TRX_4F(f, 1); - if (SZ >= 3) t[i][2] = TRX_4F(f, 2); - if (SZ == 4) t[i][3] = TRX_4F(f, 3); else t[i][3] = 1.0; - } - } -} -#endif - - - -#ifdef DEST_4FN -static void DEST_4FN( GLfloat (*t)[4], - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - - (void) first; - (void) start; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) t[i][0] = TRX_4FN(f, 0); - if (SZ >= 2) t[i][1] = TRX_4FN(f, 1); - if (SZ >= 3) t[i][2] = TRX_4FN(f, 2); - if (SZ == 4) t[i][3] = TRX_4FN(f, 3); else t[i][3] = 1.0; - } - } -} -#endif - - -#ifdef DEST_3FN -static void DEST_3FN( GLfloat (*t)[3], - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - (void) first; - (void) start; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i][0] = TRX_3FN(f, 0); - t[i][1] = TRX_3FN(f, 1); - t[i][2] = TRX_3FN(f, 2); - } - } -} -#endif - -#ifdef DEST_1F -static void DEST_1F( GLfloat *t, - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - (void) first; - (void) start; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i] = TRX_1F(f, 0); - } - } -} -#endif - -#ifdef DEST_4UB -static void DEST_4UB( GLubyte (*t)[4], - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - (void) start; - (void) first; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) TRX_UB(t[i][0], f, 0); - if (SZ >= 2) TRX_UB(t[i][1], f, 1); - if (SZ >= 3) TRX_UB(t[i][2], f, 2); - if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255; - } - } -} -#endif - - -#ifdef DEST_4US -static void DEST_4US( GLushort (*t)[4], - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ((GLubyte *) ptr + SRC_START * stride); - const GLubyte *first = f; - GLuint i; - (void) start; - (void) first; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) TRX_US(t[i][0], f, 0); - if (SZ >= 2) TRX_US(t[i][1], f, 1); - if (SZ >= 3) TRX_US(t[i][2], f, 2); - if (SZ == 4) TRX_US(t[i][3], f, 3); else t[i][3] = 65535; - } - } -} -#endif - - -#ifdef DEST_1UB -static void DEST_1UB( GLubyte *t, - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - (void) start; - (void) first; - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - TRX_UB(t[i], f, 0); - } - } -} -#endif - - -#ifdef DEST_1UI -static void DEST_1UI( GLuint *t, - CONST void *ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) ptr + SRC_START * stride; - const GLubyte *first = f; - GLuint i; - (void) start; - (void) first; - - for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i] = TRX_UI(f, 0); - } - } -} -#endif - - -static void INIT(void) -{ -#ifdef DEST_1UI - ASSERT(SZ == 1); - TAB(_1ui)[SRC_IDX] = DEST_1UI; -#endif -#ifdef DEST_1UB - ASSERT(SZ == 1); - TAB(_1ub)[SRC_IDX] = DEST_1UB; -#endif -#ifdef DEST_1F - ASSERT(SZ == 1); - TAB(_1f)[SRC_IDX] = DEST_1F; -#endif -#ifdef DEST_3FN - ASSERT(SZ == 3); - TAB(_3fn)[SRC_IDX] = DEST_3FN; -#endif -#ifdef DEST_4UB - TAB(_4ub)[SZ][SRC_IDX] = DEST_4UB; -#endif -#ifdef DEST_4US - TAB(_4us)[SZ][SRC_IDX] = DEST_4US; -#endif -#ifdef DEST_4F - TAB(_4f)[SZ][SRC_IDX] = DEST_4F; -#endif -#ifdef DEST_4FN - TAB(_4fn)[SZ][SRC_IDX] = DEST_4FN; -#endif - -} - - -#ifdef INIT -#undef INIT -#endif -#ifdef DEST_1UI -#undef DEST_1UI -#endif -#ifdef DEST_1UB -#undef DEST_1UB -#endif -#ifdef DEST_4UB -#undef DEST_4UB -#endif -#ifdef DEST_4US -#undef DEST_4US -#endif -#ifdef DEST_3FN -#undef DEST_3FN -#endif -#ifdef DEST_4F -#undef DEST_4F -#endif -#ifdef DEST_4FN -#undef DEST_4FN -#endif -#ifdef DEST_1F -#undef DEST_1F -#endif -#ifdef SZ -#undef SZ -#endif -#ifdef TAG -#undef TAG -#endif - diff --git a/src/libs/mesa/mesa/math/m_translate.c b/src/libs/mesa/mesa/math/m_translate.c deleted file mode 100644 index 4a20f45ee4..0000000000 --- a/src/libs/mesa/mesa/math/m_translate.c +++ /dev/null @@ -1,751 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \brief Translate vectors of numbers between various types. - * \author Keith Whitwell. - */ - - -#include "main/glheader.h" -#include "main/mtypes.h" /* GLchan hack */ -#include "main/colormac.h" - -#include "m_translate.h" - - - -typedef void (*trans_1f_func)(GLfloat *to, - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_1ui_func)(GLuint *to, - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_1ub_func)(GLubyte *to, - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_4ub_func)(GLubyte (*to)[4], - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_4us_func)(GLushort (*to)[4], - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_4f_func)(GLfloat (*to)[4], - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - -typedef void (*trans_3fn_func)(GLfloat (*to)[3], - CONST void *ptr, - GLuint stride, - GLuint start, - GLuint n ); - - - - -#define TYPE_IDX(t) ((t) & 0xf) -#define MAX_TYPES TYPE_IDX(GL_DOUBLE)+1 /* 0xa + 1 */ - - -/* This macro is used on other systems, so undefine it for this module */ - -#undef CHECK - -static trans_1f_func _math_trans_1f_tab[MAX_TYPES]; -static trans_1ui_func _math_trans_1ui_tab[MAX_TYPES]; -static trans_1ub_func _math_trans_1ub_tab[MAX_TYPES]; -static trans_3fn_func _math_trans_3fn_tab[MAX_TYPES]; -static trans_4ub_func _math_trans_4ub_tab[5][MAX_TYPES]; -static trans_4us_func _math_trans_4us_tab[5][MAX_TYPES]; -static trans_4f_func _math_trans_4f_tab[5][MAX_TYPES]; -static trans_4f_func _math_trans_4fn_tab[5][MAX_TYPES]; - - -#define PTR_ELT(ptr, elt) (((SRC *)ptr)[elt]) - - -#define TAB(x) _math_trans##x##_tab -#define ARGS GLuint start, GLuint n -#define SRC_START start -#define DST_START 0 -#define STRIDE stride -#define NEXT_F f += stride -#define NEXT_F2 -#define CHECK - - - - -/** - * Translate from GL_BYTE. - */ -#define SRC GLbyte -#define SRC_IDX TYPE_IDX(GL_BYTE) -#define TRX_3FN(f,n) BYTE_TO_FLOAT( PTR_ELT(f,n) ) -#if 1 -#define TRX_4F(f,n) BYTE_TO_FLOAT( PTR_ELT(f,n) ) -#else -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#endif -#define TRX_4FN(f,n) BYTE_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_UB(ub, f,n) ub = BYTE_TO_UBYTE( PTR_ELT(f,n) ) -#define TRX_US(ch, f,n) ch = BYTE_TO_USHORT( PTR_ELT(f,n) ) -#define TRX_UI(f,n) (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n)) - - -#define SZ 4 -#define INIT init_trans_4_GLbyte_raw -#define DEST_4F trans_4_GLbyte_4f_raw -#define DEST_4FN trans_4_GLbyte_4fn_raw -#define DEST_4UB trans_4_GLbyte_4ub_raw -#define DEST_4US trans_4_GLbyte_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLbyte_raw -#define DEST_4F trans_3_GLbyte_4f_raw -#define DEST_4FN trans_3_GLbyte_4fn_raw -#define DEST_4UB trans_3_GLbyte_4ub_raw -#define DEST_4US trans_3_GLbyte_4us_raw -#define DEST_3FN trans_3_GLbyte_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLbyte_raw -#define DEST_4F trans_2_GLbyte_4f_raw -#define DEST_4FN trans_2_GLbyte_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLbyte_raw -#define DEST_4F trans_1_GLbyte_4f_raw -#define DEST_4FN trans_1_GLbyte_4fn_raw -#define DEST_1UB trans_1_GLbyte_1ub_raw -#define DEST_1UI trans_1_GLbyte_1ui_raw -#include "m_trans_tmp.h" - -#undef SRC -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI -#undef SRC_IDX - - -/** - * Translate from GL_UNSIGNED_BYTE. - */ -#define SRC GLubyte -#define SRC_IDX TYPE_IDX(GL_UNSIGNED_BYTE) -#define TRX_3FN(f,n) UBYTE_TO_FLOAT(PTR_ELT(f,n)) -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#define TRX_4FN(f,n) UBYTE_TO_FLOAT(PTR_ELT(f,n)) -#define TRX_UB(ub, f,n) ub = PTR_ELT(f,n) -#define TRX_US(us, f,n) us = UBYTE_TO_USHORT(PTR_ELT(f,n)) -#define TRX_UI(f,n) (GLuint)PTR_ELT(f,n) - -/* 4ub->4ub handled in special case below. - */ -#define SZ 4 -#define INIT init_trans_4_GLubyte_raw -#define DEST_4F trans_4_GLubyte_4f_raw -#define DEST_4FN trans_4_GLubyte_4fn_raw -#define DEST_4US trans_4_GLubyte_4us_raw -#include "m_trans_tmp.h" - - -#define SZ 3 -#define INIT init_trans_3_GLubyte_raw -#define DEST_4UB trans_3_GLubyte_4ub_raw -#define DEST_4US trans_3_GLubyte_4us_raw -#define DEST_3FN trans_3_GLubyte_3fn_raw -#define DEST_4F trans_3_GLubyte_4f_raw -#define DEST_4FN trans_3_GLubyte_4fn_raw -#include "m_trans_tmp.h" - - -#define SZ 1 -#define INIT init_trans_1_GLubyte_raw -#define DEST_1UI trans_1_GLubyte_1ui_raw -#define DEST_1UB trans_1_GLubyte_1ub_raw -#include "m_trans_tmp.h" - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -/* GL_SHORT - */ -#define SRC GLshort -#define SRC_IDX TYPE_IDX(GL_SHORT) -#define TRX_3FN(f,n) SHORT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#define TRX_4FN(f,n) SHORT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_UB(ub, f,n) ub = SHORT_TO_UBYTE(PTR_ELT(f,n)) -#define TRX_US(us, f,n) us = SHORT_TO_USHORT(PTR_ELT(f,n)) -#define TRX_UI(f,n) (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n)) - - -#define SZ 4 -#define INIT init_trans_4_GLshort_raw -#define DEST_4F trans_4_GLshort_4f_raw -#define DEST_4FN trans_4_GLshort_4fn_raw -#define DEST_4UB trans_4_GLshort_4ub_raw -#define DEST_4US trans_4_GLshort_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLshort_raw -#define DEST_4F trans_3_GLshort_4f_raw -#define DEST_4FN trans_3_GLshort_4fn_raw -#define DEST_4UB trans_3_GLshort_4ub_raw -#define DEST_4US trans_3_GLshort_4us_raw -#define DEST_3FN trans_3_GLshort_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLshort_raw -#define DEST_4F trans_2_GLshort_4f_raw -#define DEST_4FN trans_2_GLshort_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLshort_raw -#define DEST_4F trans_1_GLshort_4f_raw -#define DEST_4FN trans_1_GLshort_4fn_raw -#define DEST_1UB trans_1_GLshort_1ub_raw -#define DEST_1UI trans_1_GLshort_1ui_raw -#include "m_trans_tmp.h" - - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -/* GL_UNSIGNED_SHORT - */ -#define SRC GLushort -#define SRC_IDX TYPE_IDX(GL_UNSIGNED_SHORT) -#define TRX_3FN(f,n) USHORT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#define TRX_4FN(f,n) USHORT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_UB(ub,f,n) ub = (GLubyte) (PTR_ELT(f,n) >> 8) -#define TRX_US(us,f,n) us = PTR_ELT(f,n) -#define TRX_UI(f,n) (GLuint) PTR_ELT(f,n) - - -#define SZ 4 -#define INIT init_trans_4_GLushort_raw -#define DEST_4F trans_4_GLushort_4f_raw -#define DEST_4FN trans_4_GLushort_4fn_raw -#define DEST_4UB trans_4_GLushort_4ub_raw -#define DEST_4US trans_4_GLushort_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLushort_raw -#define DEST_4F trans_3_GLushort_4f_raw -#define DEST_4FN trans_3_GLushort_4fn_raw -#define DEST_4UB trans_3_GLushort_4ub_raw -#define DEST_4US trans_3_GLushort_4us_raw -#define DEST_3FN trans_3_GLushort_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLushort_raw -#define DEST_4F trans_2_GLushort_4f_raw -#define DEST_4FN trans_2_GLushort_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLushort_raw -#define DEST_4F trans_1_GLushort_4f_raw -#define DEST_4FN trans_1_GLushort_4fn_raw -#define DEST_1UB trans_1_GLushort_1ub_raw -#define DEST_1UI trans_1_GLushort_1ui_raw -#include "m_trans_tmp.h" - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -/* GL_INT - */ -#define SRC GLint -#define SRC_IDX TYPE_IDX(GL_INT) -#define TRX_3FN(f,n) INT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#define TRX_4FN(f,n) INT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_UB(ub, f,n) ub = INT_TO_UBYTE(PTR_ELT(f,n)) -#define TRX_US(us, f,n) us = INT_TO_USHORT(PTR_ELT(f,n)) -#define TRX_UI(f,n) (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n)) - - -#define SZ 4 -#define INIT init_trans_4_GLint_raw -#define DEST_4F trans_4_GLint_4f_raw -#define DEST_4FN trans_4_GLint_4fn_raw -#define DEST_4UB trans_4_GLint_4ub_raw -#define DEST_4US trans_4_GLint_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLint_raw -#define DEST_4F trans_3_GLint_4f_raw -#define DEST_4FN trans_3_GLint_4fn_raw -#define DEST_4UB trans_3_GLint_4ub_raw -#define DEST_4US trans_3_GLint_4us_raw -#define DEST_3FN trans_3_GLint_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLint_raw -#define DEST_4F trans_2_GLint_4f_raw -#define DEST_4FN trans_2_GLint_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLint_raw -#define DEST_4F trans_1_GLint_4f_raw -#define DEST_4FN trans_1_GLint_4fn_raw -#define DEST_1UB trans_1_GLint_1ub_raw -#define DEST_1UI trans_1_GLint_1ui_raw -#include "m_trans_tmp.h" - - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -/* GL_UNSIGNED_INT - */ -#define SRC GLuint -#define SRC_IDX TYPE_IDX(GL_UNSIGNED_INT) -#define TRX_3FN(f,n) INT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) -#define TRX_4FN(f,n) UINT_TO_FLOAT( PTR_ELT(f,n) ) -#define TRX_UB(ub, f,n) ub = (GLubyte) (PTR_ELT(f,n) >> 24) -#define TRX_US(us, f,n) us = (GLshort) (PTR_ELT(f,n) >> 16) -#define TRX_UI(f,n) PTR_ELT(f,n) - - -#define SZ 4 -#define INIT init_trans_4_GLuint_raw -#define DEST_4F trans_4_GLuint_4f_raw -#define DEST_4FN trans_4_GLuint_4fn_raw -#define DEST_4UB trans_4_GLuint_4ub_raw -#define DEST_4US trans_4_GLuint_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLuint_raw -#define DEST_4F trans_3_GLuint_4f_raw -#define DEST_4FN trans_3_GLuint_4fn_raw -#define DEST_4UB trans_3_GLuint_4ub_raw -#define DEST_4US trans_3_GLuint_4us_raw -#define DEST_3FN trans_3_GLuint_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLuint_raw -#define DEST_4F trans_2_GLuint_4f_raw -#define DEST_4FN trans_2_GLuint_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLuint_raw -#define DEST_4F trans_1_GLuint_4f_raw -#define DEST_4FN trans_1_GLuint_4fn_raw -#define DEST_1UB trans_1_GLuint_1ub_raw -#define DEST_1UI trans_1_GLuint_1ui_raw -#include "m_trans_tmp.h" - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -/* GL_DOUBLE - */ -#define SRC GLdouble -#define SRC_IDX TYPE_IDX(GL_DOUBLE) -#define TRX_3FN(f,n) (GLfloat) PTR_ELT(f,n) -#define TRX_4F(f,n) (GLfloat) PTR_ELT(f,n) -#define TRX_4FN(f,n) (GLfloat) PTR_ELT(f,n) -#define TRX_UB(ub,f,n) UNCLAMPED_FLOAT_TO_UBYTE(ub, PTR_ELT(f,n)) -#define TRX_US(us,f,n) UNCLAMPED_FLOAT_TO_USHORT(us, PTR_ELT(f,n)) -#define TRX_UI(f,n) (GLuint) (GLint) PTR_ELT(f,n) -#define TRX_1F(f,n) (GLfloat) PTR_ELT(f,n) - - -#define SZ 4 -#define INIT init_trans_4_GLdouble_raw -#define DEST_4F trans_4_GLdouble_4f_raw -#define DEST_4FN trans_4_GLdouble_4fn_raw -#define DEST_4UB trans_4_GLdouble_4ub_raw -#define DEST_4US trans_4_GLdouble_4us_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLdouble_raw -#define DEST_4F trans_3_GLdouble_4f_raw -#define DEST_4FN trans_3_GLdouble_4fn_raw -#define DEST_4UB trans_3_GLdouble_4ub_raw -#define DEST_4US trans_3_GLdouble_4us_raw -#define DEST_3FN trans_3_GLdouble_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLdouble_raw -#define DEST_4F trans_2_GLdouble_4f_raw -#define DEST_4FN trans_2_GLdouble_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLdouble_raw -#define DEST_4F trans_1_GLdouble_4f_raw -#define DEST_4FN trans_1_GLdouble_4fn_raw -#define DEST_1UB trans_1_GLdouble_1ub_raw -#define DEST_1UI trans_1_GLdouble_1ui_raw -#define DEST_1F trans_1_GLdouble_1f_raw -#include "m_trans_tmp.h" - -#undef SRC -#undef SRC_IDX - -/* GL_FLOAT - */ -#define SRC GLfloat -#define SRC_IDX TYPE_IDX(GL_FLOAT) -#define SZ 4 -#define INIT init_trans_4_GLfloat_raw -#define DEST_4UB trans_4_GLfloat_4ub_raw -#define DEST_4US trans_4_GLfloat_4us_raw -#define DEST_4F trans_4_GLfloat_4f_raw -#define DEST_4FN trans_4_GLfloat_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 3 -#define INIT init_trans_3_GLfloat_raw -#define DEST_4F trans_3_GLfloat_4f_raw -#define DEST_4FN trans_3_GLfloat_4fn_raw -#define DEST_4UB trans_3_GLfloat_4ub_raw -#define DEST_4US trans_3_GLfloat_4us_raw -#define DEST_3FN trans_3_GLfloat_3fn_raw -#include "m_trans_tmp.h" - -#define SZ 2 -#define INIT init_trans_2_GLfloat_raw -#define DEST_4F trans_2_GLfloat_4f_raw -#define DEST_4FN trans_2_GLfloat_4fn_raw -#include "m_trans_tmp.h" - -#define SZ 1 -#define INIT init_trans_1_GLfloat_raw -#define DEST_4F trans_1_GLfloat_4f_raw -#define DEST_4FN trans_1_GLfloat_4fn_raw -#define DEST_1UB trans_1_GLfloat_1ub_raw -#define DEST_1UI trans_1_GLfloat_1ui_raw -#define DEST_1F trans_1_GLfloat_1f_raw - -#include "m_trans_tmp.h" - -#undef SRC -#undef SRC_IDX -#undef TRX_3FN -#undef TRX_4F -#undef TRX_4FN -#undef TRX_UB -#undef TRX_US -#undef TRX_UI - - -static void trans_4_GLubyte_4ub_raw(GLubyte (*t)[4], - CONST void *Ptr, - GLuint stride, - ARGS ) -{ - const GLubyte *f = (GLubyte *) Ptr + SRC_START * stride; - GLuint i; - - if (((((uintptr_t) f | (uintptr_t) stride)) & 3L) == 0L) { - /* Aligned. - */ - for (i = DST_START ; i < n ; i++, f += stride) { - COPY_4UBV( t[i], f ); - } - } else { - for (i = DST_START ; i < n ; i++, f += stride) { - t[i][0] = f[0]; - t[i][1] = f[1]; - t[i][2] = f[2]; - t[i][3] = f[3]; - } - } -} - - -static void init_translate_raw(void) -{ - MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) ); - MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) ); - MEMSET( TAB(_3fn), 0, sizeof(TAB(_3fn)) ); - MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) ); - MEMSET( TAB(_4us), 0, sizeof(TAB(_4us)) ); - MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) ); - MEMSET( TAB(_4fn), 0, sizeof(TAB(_4fn)) ); - - init_trans_4_GLbyte_raw(); - init_trans_3_GLbyte_raw(); - init_trans_2_GLbyte_raw(); - init_trans_1_GLbyte_raw(); - init_trans_1_GLubyte_raw(); - init_trans_3_GLubyte_raw(); - init_trans_4_GLubyte_raw(); - init_trans_4_GLshort_raw(); - init_trans_3_GLshort_raw(); - init_trans_2_GLshort_raw(); - init_trans_1_GLshort_raw(); - init_trans_4_GLushort_raw(); - init_trans_3_GLushort_raw(); - init_trans_2_GLushort_raw(); - init_trans_1_GLushort_raw(); - init_trans_4_GLint_raw(); - init_trans_3_GLint_raw(); - init_trans_2_GLint_raw(); - init_trans_1_GLint_raw(); - init_trans_4_GLuint_raw(); - init_trans_3_GLuint_raw(); - init_trans_2_GLuint_raw(); - init_trans_1_GLuint_raw(); - init_trans_4_GLdouble_raw(); - init_trans_3_GLdouble_raw(); - init_trans_2_GLdouble_raw(); - init_trans_1_GLdouble_raw(); - init_trans_4_GLfloat_raw(); - init_trans_3_GLfloat_raw(); - init_trans_2_GLfloat_raw(); - init_trans_1_GLfloat_raw(); - - TAB(_4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub_raw; -} - - -#undef TAB -#ifdef CLASS -#undef CLASS -#endif -#undef ARGS -#undef CHECK -#undef SRC_START -#undef DST_START -#undef NEXT_F -#undef NEXT_F2 - - - - - -void _math_init_translate( void ) -{ - init_translate_raw(); -} - - -/** - * Translate vector of values to GLfloat [1]. - */ -void _math_trans_1f(GLfloat *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ) -{ - _math_trans_1f_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLuint [1]. - */ -void _math_trans_1ui(GLuint *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ) -{ - _math_trans_1ui_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLubyte [1]. - */ -void _math_trans_1ub(GLubyte *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ) -{ - _math_trans_1ub_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - - -/** - * Translate vector of values to GLubyte [4]. - */ -void _math_trans_4ub(GLubyte (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ) -{ - _math_trans_4ub_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLchan [4]. - */ -void _math_trans_4chan( GLchan (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ) -{ -#if CHAN_TYPE == GL_UNSIGNED_BYTE - _math_trans_4ub( to, ptr, stride, type, size, start, n ); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - _math_trans_4us( to, ptr, stride, type, size, start, n ); -#elif CHAN_TYPE == GL_FLOAT - _math_trans_4fn( to, ptr, stride, type, size, start, n ); -#endif -} - -/** - * Translate vector of values to GLushort [4]. - */ -void _math_trans_4us(GLushort (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ) -{ - _math_trans_4us_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLfloat [4]. - */ -void _math_trans_4f(GLfloat (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ) -{ - _math_trans_4f_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLfloat[4], normalized to [-1, 1]. - */ -void _math_trans_4fn(GLfloat (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ) -{ - _math_trans_4fn_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); -} - -/** - * Translate vector of values to GLfloat[3], normalized to [-1, 1]. - */ -void _math_trans_3fn(GLfloat (*to)[3], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ) -{ - _math_trans_3fn_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); -} diff --git a/src/libs/mesa/mesa/math/m_translate.h b/src/libs/mesa/mesa/math/m_translate.h deleted file mode 100644 index c677682d50..0000000000 --- a/src/libs/mesa/mesa/math/m_translate.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 _M_TRANSLATE_H_ -#define _M_TRANSLATE_H_ - -#include "main/config.h" -#include "main/mtypes.h" /* hack for GLchan */ - - -/** - * Array translation. - * For example, convert array of GLushort[3] to GLfloat[4]. - * The function name specifies the destination format/size. - * \param to the destination address - * \param ptr the source address - * \param stride the source stride (in bytes) between elements - * \param type the source datatype (GL_SHORT, GL_UNSIGNED_INT, etc) - * \param size number of values per element in source array (1,2,3 or 4) - * \param start first element in source array to convert - * \param n number of elements to convert - * - * Note: "element" means a tuple like GLfloat[3] or GLubyte[4]. - */ - - -extern void _math_trans_1f(GLfloat *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ); - -extern void _math_trans_1ui(GLuint *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ); - -extern void _math_trans_1ub(GLubyte *to, - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ); - -extern void _math_trans_4ub(GLubyte (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ); - -extern void _math_trans_4chan( GLchan (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ); - -extern void _math_trans_4us(GLushort (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ); - -/** Convert to floats w/out normalization (i.e. just cast) */ -extern void _math_trans_4f(GLfloat (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ); - -/** Convert to normalized floats in [0,1] or [-1, 1] */ -extern void _math_trans_4fn(GLfloat (*to)[4], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint size, - GLuint start, - GLuint n ); - -extern void _math_trans_3fn(GLfloat (*to)[3], - CONST void *ptr, - GLuint stride, - GLenum type, - GLuint start, - GLuint n ); - -extern void _math_init_translate( void ); - - -#endif diff --git a/src/libs/mesa/mesa/math/m_vector.c b/src/libs/mesa/mesa/math/m_vector.c deleted file mode 100644 index c5e2fd1de1..0000000000 --- a/src/libs/mesa/mesa/math/m_vector.c +++ /dev/null @@ -1,190 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "m_vector.h" - - - -/* - * Given a vector [count][4] of floats, set all the [][elt] values - * to 0 (if elt = 0, 1, 2) or 1.0 (if elt = 3). - */ -void _mesa_vector4f_clean_elem( GLvector4f *vec, GLuint count, GLuint elt ) -{ - static const GLubyte elem_bits[4] = { - VEC_DIRTY_0, - VEC_DIRTY_1, - VEC_DIRTY_2, - VEC_DIRTY_3 - }; - static const GLfloat clean[4] = { 0, 0, 0, 1 }; - const GLfloat v = clean[elt]; - GLfloat (*data)[4] = (GLfloat (*)[4])vec->start; - GLuint i; - - for (i = 0 ; i < count ; i++) - data[i][elt] = v; - - vec->flags &= ~elem_bits[elt]; -} - -static const GLubyte size_bits[5] = { - 0, - VEC_SIZE_1, - VEC_SIZE_2, - VEC_SIZE_3, - VEC_SIZE_4, -}; - - - -/* - * Initialize GLvector objects. - * Input: v - the vector object to initialize. - * flags - bitwise-OR of VEC_* flags - * storage - pointer to storage for the vector's data - */ - - -void _mesa_vector4f_init( GLvector4f *v, GLuint flags, GLfloat (*storage)[4] ) -{ - v->stride = 4 * sizeof(GLfloat); - v->size = 2; /* may change: 2-4 for vertices and 1-4 for texcoords */ - v->data = storage; - v->start = (GLfloat *) storage; - v->count = 0; - v->flags = size_bits[4] | flags ; -} - - - - -/* - * Initialize GLvector objects and allocate storage. - * Input: v - the vector object - * sz - unused???? - * flags - bitwise-OR of VEC_* flags - * count - number of elements to allocate in vector - * alignment - desired memory alignment for the data (in bytes) - */ - - -void _mesa_vector4f_alloc( GLvector4f *v, GLuint flags, GLuint count, - GLuint alignment ) -{ - v->stride = 4 * sizeof(GLfloat); - v->size = 2; - v->storage = ALIGN_MALLOC( count * 4 * sizeof(GLfloat), alignment ); - v->start = (GLfloat *) v->storage; - v->data = (GLfloat (*)[4]) v->storage; - v->count = 0; - v->flags = size_bits[4] | flags | VEC_MALLOC ; -} - - - - -/* - * Vector deallocation. Free whatever memory is pointed to by the - * vector's storage field if the VEC_MALLOC flag is set. - * DO NOT free the GLvector object itself, though. - */ - - -void _mesa_vector4f_free( GLvector4f *v ) -{ - if (v->flags & VEC_MALLOC) { - ALIGN_FREE( v->storage ); - v->data = NULL; - v->start = NULL; - v->storage = NULL; - v->flags &= ~VEC_MALLOC; - } -} - - -/* - * For debugging - */ -void _mesa_vector4f_print( GLvector4f *v, GLubyte *cullmask, GLboolean culling ) -{ - GLfloat c[4] = { 0, 0, 0, 1 }; - const char *templates[5] = { - "%d:\t0, 0, 0, 1\n", - "%d:\t%f, 0, 0, 1\n", - "%d:\t%f, %f, 0, 1\n", - "%d:\t%f, %f, %f, 1\n", - "%d:\t%f, %f, %f, %f\n" - }; - - const char *t = templates[v->size]; - GLfloat *d = (GLfloat *)v->data; - GLuint j, i = 0, count; - - _mesa_printf("data-start\n"); - for ( ; d != v->start ; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); - - _mesa_printf("start-count(%u)\n", v->count); - count = i + v->count; - - if (culling) { - for ( ; i < count ; STRIDE_F(d, v->stride), i++) - if (cullmask[i]) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); - } - else { - for ( ; i < count ; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); - } - - for (j = v->size ; j < 4; j++) { - if ((v->flags & (1<data ; - i < count && d[j] == c[j] ; - i++, STRIDE_F(d, v->stride)) {}; - - if (i == count) - _mesa_printf(" --> ok\n"); - else - _mesa_printf(" --> Failed at %u ******\n", i); - } - } -} - - diff --git a/src/libs/mesa/mesa/math/m_vector.h b/src/libs/mesa/mesa/math/m_vector.h deleted file mode 100644 index 647388ac7d..0000000000 --- a/src/libs/mesa/mesa/math/m_vector.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -#ifndef _M_VECTOR_H_ -#define _M_VECTOR_H_ - -#include "main/glheader.h" -#include "main/mtypes.h" /* hack for GLchan */ - - -#define VEC_DIRTY_0 0x1 -#define VEC_DIRTY_1 0x2 -#define VEC_DIRTY_2 0x4 -#define VEC_DIRTY_3 0x8 -#define VEC_MALLOC 0x10 /* storage field points to self-allocated mem*/ -#define VEC_NOT_WRITEABLE 0x40 /* writable elements to hold clipped data */ -#define VEC_BAD_STRIDE 0x100 /* matches tnl's prefered stride */ - - -#define VEC_SIZE_1 VEC_DIRTY_0 -#define VEC_SIZE_2 (VEC_DIRTY_0|VEC_DIRTY_1) -#define VEC_SIZE_3 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2) -#define VEC_SIZE_4 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3) - - - -/* Wrap all the information about vectors up in a struct. Has - * additional fields compared to the other vectors to help us track of - * different vertex sizes, and whether we need to clean columns out - * because they contain non-(0,0,0,1) values. - * - * The start field is used to reserve data for copied vertices at the - * end of _mesa_transform_vb, and avoids the need for a multiplication in - * the transformation routines. - */ -typedef struct { - GLfloat (*data)[4]; /* may be malloc'd or point to client data */ - GLfloat *start; /* points somewhere inside of */ - GLuint count; /* size of the vector (in elements) */ - GLuint stride; /* stride from one element to the next (in bytes) */ - GLuint size; /* 2-4 for vertices and 1-4 for texcoords */ - GLuint flags; /* which columns are dirty */ - void *storage; /* self-allocated storage */ -} GLvector4f; - - -extern void _mesa_vector4f_init( GLvector4f *v, GLuint flags, - GLfloat (*storage)[4] ); -extern void _mesa_vector4f_alloc( GLvector4f *v, GLuint flags, - GLuint count, GLuint alignment ); -extern void _mesa_vector4f_free( GLvector4f *v ); -extern void _mesa_vector4f_print( GLvector4f *v, GLubyte *, GLboolean ); -extern void _mesa_vector4f_clean_elem( GLvector4f *vec, GLuint nr, GLuint elt ); - - - - - -/* - * Given vector , return a pointer (cast to to the -th element. - * - * End up doing a lot of slow imuls if not careful. - */ -#define VEC_ELT( v, type, i ) \ - ( (type *) ( ((GLbyte *) ((v)->data)) + (i) * (v)->stride) ) - - -#endif diff --git a/src/libs/mesa/mesa/math/m_xform.c b/src/libs/mesa/mesa/math/m_xform.c deleted file mode 100644 index 901ae5b416..0000000000 --- a/src/libs/mesa/mesa/math/m_xform.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - - -/* - * Matrix/vertex/vector transformation stuff - * - * - * NOTES: - * 1. 4x4 transformation matrices are stored in memory in column major order. - * 2. Points/vertices are to be thought of as column vectors. - * 3. Transformation of a point p by a matrix M is: p' = M * p - */ - -#include "main/glheader.h" -#include "main/macros.h" - -#include "m_eval.h" -#include "m_matrix.h" -#include "m_translate.h" -#include "m_xform.h" -#include "mathmod.h" - - -#ifdef DEBUG_MATH -#include "m_debug.h" -#endif - -#ifdef USE_X86_ASM -#include "x86/common_x86_asm.h" -#endif - -#ifdef USE_X86_64_ASM -#include "x86-64/x86-64.h" -#endif - -#ifdef USE_SPARC_ASM -#include "sparc/sparc.h" -#endif - -#ifdef USE_PPC_ASM -#include "ppc/common_ppc_features.h" -#endif - -clip_func _mesa_clip_tab[5]; -clip_func _mesa_clip_np_tab[5]; -dotprod_func _mesa_dotprod_tab[5]; -vec_copy_func _mesa_copy_tab[0x10]; -normal_func _mesa_normal_tab[0xf]; -transform_func *_mesa_transform_tab[5]; - - -/* Raw data format used for: - * - Object-to-eye transform prior to culling, although this too - * could be culled under some circumstances. - * - Eye-to-clip transform (via the function above). - * - Cliptesting - * - And everything else too, if culling happens to be disabled. - * - * GH: It's used for everything now, as clipping/culling is done - * elsewhere (most often by the driver itself). - */ -#define TAG(x) x -#define TAG2(x,y) x##y -#define STRIDE_LOOP for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) -#define LOOP for ( i = 0 ; i < n ; i++ ) -#define ARGS -#include "m_xform_tmp.h" -#include "m_clip_tmp.h" -#include "m_norm_tmp.h" -#include "m_dotprod_tmp.h" -#include "m_copy_tmp.h" -#undef TAG -#undef TAG2 -#undef LOOP -#undef ARGS - - - - -GLvector4f *_mesa_project_points( GLvector4f *proj_vec, - const GLvector4f *clip_vec ) -{ - const GLuint stride = clip_vec->stride; - const GLfloat *from = (GLfloat *)clip_vec->start; - const GLuint count = clip_vec->count; - GLfloat (*vProj)[4] = (GLfloat (*)[4])proj_vec->start; - GLuint i; - - for (i = 0 ; i < count ; i++, STRIDE_F(from, stride)) - { - GLfloat oow = 1.0F / from[3]; - vProj[i][3] = oow; - vProj[i][0] = from[0] * oow; - vProj[i][1] = from[1] * oow; - vProj[i][2] = from[2] * oow; - } - - proj_vec->flags |= VEC_SIZE_4; - proj_vec->size = 3; - proj_vec->count = clip_vec->count; - return proj_vec; -} - - - - - - -/* - * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This - * function is used for transforming clipping plane equations and spotlight - * directions. - * Mathematically, u = v * m. - * Input: v - input vector - * m - transformation matrix - * Output: u - transformed vector - */ -void _mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[16] ) -{ - GLfloat v0=v[0], v1=v[1], v2=v[2], v3=v[3]; -#define M(row,col) m[row + col*4] - u[0] = v0 * M(0,0) + v1 * M(1,0) + v2 * M(2,0) + v3 * M(3,0); - u[1] = v0 * M(0,1) + v1 * M(1,1) + v2 * M(2,1) + v3 * M(3,1); - u[2] = v0 * M(0,2) + v1 * M(1,2) + v2 * M(2,2) + v3 * M(3,2); - u[3] = v0 * M(0,3) + v1 * M(1,3) + v2 * M(2,3) + v3 * M(3,3); -#undef M -} - - -/* Useful for one-off point transformations, as in clipping. - * Note that because the matrix isn't analysed we do too many - * multiplies, and that the result is always 4-clean. - */ -void _mesa_transform_point_sz( GLfloat Q[4], const GLfloat M[16], - const GLfloat P[4], GLuint sz ) -{ - if (Q == P) - return; - - if (sz == 4) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; - } - else if (sz == 3) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; - } - else if (sz == 2) - { - Q[0] = M[0] * P[0] + M[4] * P[1] + M[12]; - Q[1] = M[1] * P[0] + M[5] * P[1] + M[13]; - Q[2] = M[2] * P[0] + M[6] * P[1] + M[14]; - Q[3] = M[3] * P[0] + M[7] * P[1] + M[15]; - } - else if (sz == 1) - { - Q[0] = M[0] * P[0] + M[12]; - Q[1] = M[1] * P[0] + M[13]; - Q[2] = M[2] * P[0] + M[14]; - Q[3] = M[3] * P[0] + M[15]; - } -} - - -/* - * This is called only once. It initializes several tables with pointers - * to optimized transformation functions. This is where we can test for - * AMD 3Dnow! capability, Intel SSE, etc. and hook in the right code. - */ -void -_math_init_transformation( void ) -{ - init_c_transformations(); - init_c_norm_transform(); - init_c_cliptest(); - init_copy0(); - init_dotprod(); - -#ifdef DEBUG_MATH - _math_test_all_transform_functions( "default" ); - _math_test_all_normal_transform_functions( "default" ); - _math_test_all_cliptest_functions( "default" ); -#endif - -#ifdef USE_X86_ASM - _mesa_init_all_x86_transform_asm(); -#elif defined( USE_SPARC_ASM ) - _mesa_init_all_sparc_transform_asm(); -#elif defined( USE_PPC_ASM ) - _mesa_init_all_ppc_transform_asm(); -#elif defined( USE_X86_64_ASM ) - _mesa_init_all_x86_64_transform_asm(); -#endif -} - -void -_math_init( void ) -{ - _math_init_transformation(); - _math_init_translate(); - _math_init_eval(); -} diff --git a/src/libs/mesa/mesa/math/m_xform.h b/src/libs/mesa/mesa/math/m_xform.h deleted file mode 100644 index 24e8ddbd57..0000000000 --- a/src/libs/mesa/mesa/math/m_xform.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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 _M_XFORM_H -#define _M_XFORM_H - - -#include "main/glheader.h" -#include "main/config.h" -#include "math/m_vector.h" -#include "math/m_matrix.h" - -#ifdef USE_X86_ASM -#define _XFORMAPI _ASMAPI -#define _XFORMAPIP _ASMAPIP -#else -#define _XFORMAPI -#define _XFORMAPIP * -#endif - - -extern void -_mesa_transform_vector(GLfloat u[4], CONST GLfloat v[4], CONST GLfloat m[16]); - - -extern void -_math_init_transformation(void); - - -/* KW: Clip functions now do projective divide as well. The projected - * coordinates are very useful to us because they let us cull - * backfaces and eliminate vertices from lighting, fogging, etc - * calculations. Despite the fact that this divide could be done one - * day in hardware, we would still have a reason to want to do it here - * as long as those other calculations remain in software. - * - * Clipping is a convenient place to do the divide on x86 as it should be - * possible to overlap with integer outcode calculations. - * - * There are two cases where we wouldn't want to do the divide in cliptest: - * - When we aren't clipping. We still might want to cull backfaces - * so the divide should be done elsewhere. This currently never - * happens. - * - * - When culling isn't likely to help us, such as when the GL culling - * is disabled and we not lighting or are only lighting - * one-sided. In this situation, backface determination provides - * us with no useful information. A tricky case to detect is when - * all input data is already culled, although hopefully the - * application wouldn't turn on culling in such cases. - * - * We supply a buffer to hold the [x/w,y/w,z/w,1/w] values which - * are the result of the projection. This is only used in the - * 4-vector case - in other cases, we just use the clip coordinates - * as the projected coordinates - they are identical. - * - * This is doubly convenient because it means the Win[] array is now - * of the same stride as all the others, so I can now turn map_vertices - * into a straight-forward matrix transformation, with asm acceleration - * automatically available. - */ - -/* Vertex buffer clipping flags - */ -#define CLIP_RIGHT_SHIFT 0 -#define CLIP_LEFT_SHIFT 1 -#define CLIP_TOP_SHIFT 2 -#define CLIP_BOTTOM_SHIFT 3 -#define CLIP_NEAR_SHIFT 4 -#define CLIP_FAR_SHIFT 5 - -#define CLIP_RIGHT_BIT 0x01 -#define CLIP_LEFT_BIT 0x02 -#define CLIP_TOP_BIT 0x04 -#define CLIP_BOTTOM_BIT 0x08 -#define CLIP_NEAR_BIT 0x10 -#define CLIP_FAR_BIT 0x20 -#define CLIP_USER_BIT 0x40 -#define CLIP_CULL_BIT 0x80 -#define CLIP_FRUSTUM_BITS 0x3f - - -typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, - GLvector4f *vProj, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ); - -typedef void (*dotprod_func)( GLfloat *out, - GLuint out_stride, - CONST GLvector4f *coord_vec, - CONST GLfloat plane[4] ); - -typedef void (*vec_copy_func)( GLvector4f *to, - CONST GLvector4f *from ); - - - -/* - * Functions for transformation of normals in the VB. - */ -typedef void (_NORMAPIP normal_func)( CONST GLmatrix *mat, - GLfloat scale, - CONST GLvector4f *in, - CONST GLfloat lengths[], - GLvector4f *dest ); - - -/* Flags for selecting a normal transformation function. - */ -#define NORM_RESCALE 0x1 /* apply the scale factor */ -#define NORM_NORMALIZE 0x2 /* normalize */ -#define NORM_TRANSFORM 0x4 /* apply the transformation matrix */ -#define NORM_TRANSFORM_NO_ROT 0x8 /* apply the transformation matrix */ - - - - -/* KW: New versions of the transform function allow a mask array - * specifying that individual vector transform should be skipped - * when the mask byte is zero. This is always present as a - * parameter, to allow a unified interface. - */ -typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec, - CONST GLfloat m[16], - CONST GLvector4f *from_vec ); - - -extern GLvector4f *_mesa_project_points( GLvector4f *to, - CONST GLvector4f *from ); - -extern void _mesa_transform_bounds3( GLubyte *orMask, GLubyte *andMask, - CONST GLfloat m[16], - CONST GLfloat src[][3] ); - -extern void _mesa_transform_bounds2( GLubyte *orMask, GLubyte *andMask, - CONST GLfloat m[16], - CONST GLfloat src[][3] ); - - -extern dotprod_func _mesa_dotprod_tab[5]; -extern vec_copy_func _mesa_copy_tab[0x10]; -extern vec_copy_func _mesa_copy_clean_tab[5]; -extern clip_func _mesa_clip_tab[5]; -extern clip_func _mesa_clip_np_tab[5]; -extern normal_func _mesa_normal_tab[0xf]; - -/* Use of 2 layers of linked 1-dimensional arrays to reduce - * cost of lookup. - */ -extern transform_func *_mesa_transform_tab[5]; - - -extern void _mesa_transform_point_sz( GLfloat Q[4], CONST GLfloat M[16], - CONST GLfloat P[4], GLuint sz ); - - -#define TransformRaw( to, mat, from ) \ - ( _mesa_transform_tab[(from)->size][(mat)->type]( to, (mat)->m, from ), \ - (to) ) - - -#endif diff --git a/src/libs/mesa/mesa/math/m_xform_tmp.h b/src/libs/mesa/mesa/math/m_xform_tmp.h deleted file mode 100644 index e938377256..0000000000 --- a/src/libs/mesa/mesa/math/m_xform_tmp.h +++ /dev/null @@ -1,810 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * New (3.1) transformation code written by Keith Whitwell. - */ - - -/*---------------------------------------------------------------------- - * Begin Keith's new code - * - *---------------------------------------------------------------------- - */ - -/* KW: Fixed stride, now measured in bytes as is the OpenGL array stride. - */ - -/* KW: These are now parameterized to produce two versions, one - * which transforms all incoming points, and a second which - * takes notice of a cullmask array, and only transforms - * unculled vertices. - */ - -/* KW: 1-vectors can sneak into the texture pipeline via the array - * interface. These functions are here because I want consistant - * treatment of the vertex sizes and a lazy strategy for - * cleaning unused parts of the vector, and so as not to exclude - * them from the vertex array interface. - * - * Under our current analysis of matrices, there is no way that - * the product of a matrix and a 1-vector can remain a 1-vector, - * with the exception of the identity transform. - */ - -/* KW: No longer zero-pad outgoing vectors. Now that external - * vectors can get into the pipeline we cannot ever assume - * that there is more to a vector than indicated by its - * size. - */ - -/* KW: Now uses clipmask and a flag to allow us to skip both/either - * cliped and/or culled vertices. - */ - -/* GH: Not any more -- it's easier (and faster) to just process the - * entire vector. Clipping and culling are handled further down - * the pipe, most often during or after the conversion to some - * driver-specific vertex format. - */ - -static void _XFORMAPI -TAG(transform_points1_general)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m12 = m[12]; - const GLfloat m1 = m[1], m13 = m[13]; - const GLfloat m2 = m[2], m14 = m[14]; - const GLfloat m3 = m[3], m15 = m[15]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox + m12; - to[i][1] = m1 * ox + m13; - to[i][2] = m2 * ox + m14; - to[i][3] = m3 * ox + m15; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points1_identity)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLuint count = from_vec->count; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint i; - (void) m; - if (to_vec == from_vec) return; - STRIDE_LOOP { - to[i][0] = from[0]; - } - to_vec->size = 1; - to_vec->flags |= VEC_SIZE_1; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points1_2d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1]; - const GLfloat m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox + m12; - to[i][1] = m1 * ox + m13; - } - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox + m12; - to[i][1] = m13; - } - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points1_3d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m2 = m[2]; - const GLfloat m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox + m12; - to[i][1] = m1 * ox + m13; - to[i][2] = m2 * ox + m14; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - - -static void _XFORMAPI -TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0]; - const GLfloat m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox + m12; - to[i][1] = m13; - to[i][2] = m14; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points1_perspective)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0]; - to[i][0] = m0 * ox ; - to[i][1] = 0 ; - to[i][2] = m14; - to[i][3] = 0; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - - - - -/* 2-vectors, which are a lot more relevant than 1-vectors, are - * present early in the geometry pipeline and throughout the - * texture pipeline. - */ -static void _XFORMAPI -TAG(transform_points2_general)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m4 = m[4], m12 = m[12]; - const GLfloat m1 = m[1], m5 = m[5], m13 = m[13]; - const GLfloat m2 = m[2], m6 = m[6], m14 = m[14]; - const GLfloat m3 = m[3], m7 = m[7], m15 = m[15]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox + m4 * oy + m12; - to[i][1] = m1 * ox + m5 * oy + m13; - to[i][2] = m2 * ox + m6 * oy + m14; - to[i][3] = m3 * ox + m7 * oy + m15; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points2_identity)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - GLuint i; - (void) m; - if (to_vec == from_vec) return; - STRIDE_LOOP { - to[i][0] = from[0]; - to[i][1] = from[1]; - } - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points2_2d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5]; - const GLfloat m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox + m4 * oy + m12; - to[i][1] = m1 * ox + m5 * oy + m13; - } - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox + m12; - to[i][1] = m5 * oy + m13; - } - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points2_3d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m2 = m[2], m4 = m[4], m5 = m[5]; - const GLfloat m6 = m[6], m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox + m4 * oy + m12; - to[i][1] = m1 * ox + m5 * oy + m13; - to[i][2] = m2 * ox + m6 * oy + m14; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - - -/* I would actually say this was a fairly important function, from - * a texture transformation point of view. - */ -static void _XFORMAPI -TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5]; - const GLfloat m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox + m12; - to[i][1] = m5 * oy + m13; - to[i][2] = m14; - } - if (m14 == 0) { - to_vec->size = 2; - to_vec->flags |= VEC_SIZE_2; - } else { - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - } - to_vec->count = from_vec->count; -} - - -static void _XFORMAPI -TAG(transform_points2_perspective)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1]; - to[i][0] = m0 * ox ; - to[i][1] = m5 * oy ; - to[i][2] = m14; - to[i][3] = 0; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - - - -static void _XFORMAPI -TAG(transform_points3_general)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m4 = m[4], m8 = m[8], m12 = m[12]; - const GLfloat m1 = m[1], m5 = m[5], m9 = m[9], m13 = m[13]; - const GLfloat m2 = m[2], m6 = m[6], m10 = m[10], m14 = m[14]; - const GLfloat m3 = m[3], m7 = m[7], m11 = m[11], m15 = m[15]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12; - to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13; - to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14; - to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points3_identity)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - GLuint i; - (void) m; - if (to_vec == from_vec) return; - STRIDE_LOOP { - to[i][0] = from[0]; - to[i][1] = from[1]; - to[i][2] = from[2]; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points3_2d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5]; - const GLfloat m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m4 * oy + m12 ; - to[i][1] = m1 * ox + m5 * oy + m13 ; - to[i][2] = + oz ; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m12 ; - to[i][1] = m5 * oy + m13 ; - to[i][2] = + oz ; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points3_3d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m2 = m[2], m4 = m[4], m5 = m[5]; - const GLfloat m6 = m[6], m8 = m[8], m9 = m[9], m10 = m[10]; - const GLfloat m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 ; - to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 ; - to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 ; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -/* previously known as ortho... - */ -static void _XFORMAPI -TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5]; - const GLfloat m10 = m[10], m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m12 ; - to[i][1] = m5 * oy + m13 ; - to[i][2] = m10 * oz + m14 ; - } - to_vec->size = 3; - to_vec->flags |= VEC_SIZE_3; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points3_perspective)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m8 = m[8], m9 = m[9]; - const GLfloat m10 = m[10], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2]; - to[i][0] = m0 * ox + m8 * oz ; - to[i][1] = m5 * oy + m9 * oz ; - to[i][2] = m10 * oz + m14 ; - to[i][3] = -oz ; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - - - -static void _XFORMAPI -TAG(transform_points4_general)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m4 = m[4], m8 = m[8], m12 = m[12]; - const GLfloat m1 = m[1], m5 = m[5], m9 = m[9], m13 = m[13]; - const GLfloat m2 = m[2], m6 = m[6], m10 = m[10], m14 = m[14]; - const GLfloat m3 = m[3], m7 = m[7], m11 = m[11], m15 = m[15]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow; - to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow; - to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow; - to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15 * ow; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_identity)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - GLuint i; - (void) m; - if (to_vec == from_vec) return; - STRIDE_LOOP { - to[i][0] = from[0]; - to[i][1] = from[1]; - to[i][2] = from[2]; - to[i][3] = from[3]; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_2d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5]; - const GLfloat m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m4 * oy + m12 * ow; - to[i][1] = m1 * ox + m5 * oy + m13 * ow; - to[i][2] = + oz ; - to[i][3] = ow; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m12 * ow; - to[i][1] = m5 * oy + m13 * ow; - to[i][2] = + oz ; - to[i][3] = ow; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_3d)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m1 = m[1], m2 = m[2], m4 = m[4], m5 = m[5]; - const GLfloat m6 = m[6], m8 = m[8], m9 = m[9], m10 = m[10]; - const GLfloat m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow; - to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow; - to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow; - to[i][3] = ow; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5]; - const GLfloat m10 = m[10], m12 = m[12], m13 = m[13], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m12 * ow; - to[i][1] = m5 * oy + m13 * ow; - to[i][2] = m10 * oz + m14 * ow; - to[i][3] = ow; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - to_vec->count = from_vec->count; -} - -static void _XFORMAPI -TAG(transform_points4_perspective)( GLvector4f *to_vec, - const GLfloat m[16], - const GLvector4f *from_vec ) -{ - const GLuint stride = from_vec->stride; - GLfloat *from = from_vec->start; - GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; - GLuint count = from_vec->count; - const GLfloat m0 = m[0], m5 = m[5], m8 = m[8], m9 = m[9]; - const GLfloat m10 = m[10], m14 = m[14]; - GLuint i; - STRIDE_LOOP { - const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3]; - to[i][0] = m0 * ox + m8 * oz ; - to[i][1] = m5 * oy + m9 * oz ; - to[i][2] = m10 * oz + m14 * ow ; - to[i][3] = -oz ; - } - to_vec->size = 4; - to_vec->flags |= VEC_SIZE_4; - 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]; - -/* Similar functions could be called several times, with more highly - * optimized routines overwriting the arrays. This only occurs during - * startup. - */ -static void _XFORMAPI TAG(init_c_transformations)( void ) -{ -#define TAG_TAB _mesa_transform_tab -#define TAG_TAB_1 TAG(transform_tab_1) -#define TAG_TAB_2 TAG(transform_tab_2) -#define TAG_TAB_3 TAG(transform_tab_3) -#define TAG_TAB_4 TAG(transform_tab_4) - - TAG_TAB[1] = TAG_TAB_1; - TAG_TAB[2] = TAG_TAB_2; - TAG_TAB[3] = TAG_TAB_3; - TAG_TAB[4] = TAG_TAB_4; - - /* 1-D points (ie texcoords) */ - TAG_TAB_1[MATRIX_GENERAL] = TAG(transform_points1_general); - TAG_TAB_1[MATRIX_IDENTITY] = TAG(transform_points1_identity); - TAG_TAB_1[MATRIX_3D_NO_ROT] = TAG(transform_points1_3d_no_rot); - TAG_TAB_1[MATRIX_PERSPECTIVE] = TAG(transform_points1_perspective); - TAG_TAB_1[MATRIX_2D] = TAG(transform_points1_2d); - TAG_TAB_1[MATRIX_2D_NO_ROT] = TAG(transform_points1_2d_no_rot); - TAG_TAB_1[MATRIX_3D] = TAG(transform_points1_3d); - - /* 2-D points */ - TAG_TAB_2[MATRIX_GENERAL] = TAG(transform_points2_general); - TAG_TAB_2[MATRIX_IDENTITY] = TAG(transform_points2_identity); - TAG_TAB_2[MATRIX_3D_NO_ROT] = TAG(transform_points2_3d_no_rot); - TAG_TAB_2[MATRIX_PERSPECTIVE] = TAG(transform_points2_perspective); - TAG_TAB_2[MATRIX_2D] = TAG(transform_points2_2d); - TAG_TAB_2[MATRIX_2D_NO_ROT] = TAG(transform_points2_2d_no_rot); - TAG_TAB_2[MATRIX_3D] = TAG(transform_points2_3d); - - /* 3-D points */ - TAG_TAB_3[MATRIX_GENERAL] = TAG(transform_points3_general); - TAG_TAB_3[MATRIX_IDENTITY] = TAG(transform_points3_identity); - TAG_TAB_3[MATRIX_3D_NO_ROT] = TAG(transform_points3_3d_no_rot); - TAG_TAB_3[MATRIX_PERSPECTIVE] = TAG(transform_points3_perspective); - TAG_TAB_3[MATRIX_2D] = TAG(transform_points3_2d); - TAG_TAB_3[MATRIX_2D_NO_ROT] = TAG(transform_points3_2d_no_rot); - TAG_TAB_3[MATRIX_3D] = TAG(transform_points3_3d); - - /* 4-D points */ - TAG_TAB_4[MATRIX_GENERAL] = TAG(transform_points4_general); - TAG_TAB_4[MATRIX_IDENTITY] = TAG(transform_points4_identity); - TAG_TAB_4[MATRIX_3D_NO_ROT] = TAG(transform_points4_3d_no_rot); - TAG_TAB_4[MATRIX_PERSPECTIVE] = TAG(transform_points4_perspective); - TAG_TAB_4[MATRIX_2D] = TAG(transform_points4_2d); - TAG_TAB_4[MATRIX_2D_NO_ROT] = TAG(transform_points4_2d_no_rot); - TAG_TAB_4[MATRIX_3D] = TAG(transform_points4_3d); - -#undef TAG_TAB -#undef TAG_TAB_1 -#undef TAG_TAB_2 -#undef TAG_TAB_3 -#undef TAG_TAB_4 -} diff --git a/src/libs/mesa/mesa/math/mathmod.h b/src/libs/mesa/mesa/math/mathmod.h deleted file mode 100644 index 6fbaaea94b..0000000000 --- a/src/libs/mesa/mesa/math/mathmod.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - - -/** - * \mainpage Mesa Math Module - * - * This module contains math-related utility functions for transforming - * vertices, translating arrays of numbers from one data type to another, - * evaluating curved surfaces, etc. - */ - - -#ifndef _MESA_MATH_H_ -#define _MESA_MATH_H_ - -extern void _math_init( void ); - -#endif diff --git a/src/libs/mesa/mesa/ppc/common_ppc.c b/src/libs/mesa/mesa/ppc/common_ppc.c deleted file mode 100644 index 786e1817ac..0000000000 --- a/src/libs/mesa/mesa/ppc/common_ppc.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file common_ppc.c - * Check CPU capabilities & initialize optimized funtions for this particular - * processor. - * - * \author Ian Romanick - */ - -#include -#include -#include - -#ifdef USE_PPC_ASM -#include -#endif - -#include "common_ppc_features.h" - - -unsigned long _mesa_ppc_cpu_features = 0; - -/** - * Detect CPU features and install optimized transform and lighting routines. - * Currently, CPU features are only detected. The optimized routines have - * yet to be written. - * - * \bug - * This routine is highly specific to Linux kernel 2.6. I'm still waiting - * to hear back from the glibc folk on how to do this "right". - */ - -void _mesa_init_all_ppc_transform_asm( void ) -{ -#ifdef USE_PPC_ASM - const pid_t my_pid = getpid(); - char file_name[32]; - FILE * f; -#ifdef __powerpc64__ - Elf64_auxv_t v; -#else - Elf32_auxv_t v; -#endif - - sprintf( file_name, "/proc/%u/auxv", (unsigned) my_pid ); - f = fopen( file_name, "rb" ); - if ( f != NULL ) { - while( 1 ) { - ssize_t elem = fread( & v, sizeof( v ), 1, f ); - - if ( elem < 1 ) { - break; - } - - if ( v.a_type == AT_HWCAP ) { - _mesa_ppc_cpu_features = v.a_un.a_val; - break; - } - } - - fclose( f ); - } - -# ifndef USE_VMX_ASM - _mesa_ppc_cpu_features &= ~PPC_FEATURES_HAS_ALTIVEC; -# endif -#endif -} diff --git a/src/libs/mesa/mesa/ppc/common_ppc_features.h b/src/libs/mesa/mesa/ppc/common_ppc_features.h deleted file mode 100644 index 9cde422d72..0000000000 --- a/src/libs/mesa/mesa/ppc/common_ppc_features.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file common_ppc_features.h - * Interface for determining which CPU features were detected. - * - * \author Ian Romanick - */ - -#ifndef COMMON_PPC_FEATURES_H -#define COMMON_PPC_FEATURES_H - -#ifdef USE_PPC_ASM -#include - -extern unsigned long _mesa_ppc_cpu_features; - - -/* The PPC_FEATURE_* values come from asm/cputable.h. Should we define - * versions of them here if that file does not exist? This will only - * matter once these code paths are supported on non-Linux platforms. - */ - -#define cpu_has_64 ((_mesa_ppc_cpu_features & PPC_FEATURE_64) != 0) -#define cpu_has_vmx ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_ALTIVEC) != 0) -#define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0) - -#endif /* USE_PPC_ASM */ - -extern void _mesa_init_all_ppc_transform_asm( void ); - -#endif /* COMMON_PPC_FEATURES_H */ diff --git a/src/libs/mesa/mesa/shader/arbprogparse.c b/src/libs/mesa/mesa/shader/arbprogparse.c deleted file mode 100644 index 0984d88172..0000000000 --- a/src/libs/mesa/mesa/shader/arbprogparse.c +++ /dev/null @@ -1,3962 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -#define DEBUG_PARSING 0 - -/** - * \file arbprogparse.c - * ARB_*_program parser core - * \author Karl Rasche - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "shader/grammar/grammar_mesa.h" -#include "arbprogparse.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_statevars.h" -#include "prog_instruction.h" - - -/* For ARB programs, use the NV instruction limits */ -#define MAX_INSTRUCTIONS MAX2(MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS, \ - MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS) - - -/** - * This is basically a union of the vertex_program and fragment_program - * structs that we can use to parse the program into - * - * XXX we can probably get rid of this entirely someday. - */ -struct arb_program -{ - struct gl_program Base; - - GLuint Position; /* Just used for error reporting while parsing */ - GLuint MajorVersion; - GLuint MinorVersion; - - /* ARB_vertex_progmra options */ - GLboolean HintPositionInvariant; - - /* ARB_fragment_progmra options */ - GLenum PrecisionOption; /* GL_DONT_CARE, GL_NICEST or GL_FASTEST */ - GLenum FogOption; /* GL_NONE, GL_LINEAR, GL_EXP or GL_EXP2 */ - - /* ARB_fragment_program specifics */ - GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; - GLbitfield ShadowSamplers; - GLuint NumAluInstructions; - GLuint NumTexInstructions; - GLuint NumTexIndirections; - - GLboolean UsesKill; -}; - - - -/* TODO: - * Fragment Program Stuff: - * ----------------------------------------------------- - * - * - things from Michal's email - * + overflow on atoi - * + not-overflowing floats (don't use parse_integer..) - * + can remove range checking in arbparse.c - * - * - check all limits of number of various variables - * + parameters - * - * - test! test! test! - * - * Vertex Program Stuff: - * ----------------------------------------------------- - * - Optimize param array usage and count limits correctly, see spec, - * section 2.14.3.7 - * + Record if an array is reference absolutly or relatively (or both) - * + For absolute arrays, store a bitmap of accesses - * + For single parameters, store an access flag - * + After parsing, make a parameter cleanup and merging pass, where - * relative arrays are layed out first, followed by abs arrays, and - * finally single state. - * + Remap offsets for param src and dst registers - * + Now we can properly count parameter usage - * - * - Multiple state binding errors in param arrays (see spec, just before - * section 2.14.3.3) - * - grep for XXX - * - * Mesa Stuff - * ----------------------------------------------------- - * - User clipping planes vs. PositionInvariant - * - Is it sufficient to just multiply by the mvp to transform in the - * PositionInvariant case? Or do we need something more involved? - * - * - vp_src swizzle is GLubyte, fp_src swizzle is GLuint - * - fetch state listed in program_parameters list - * + WTF should this go??? - * + currently in nvvertexec.c and s_nvfragprog.c - * - * - allow for multiple address registers (and fetch address regs properly) - * - * Cosmetic Stuff - * ----------------------------------------------------- - * - remove any leftover unused grammer.c stuff (dict_ ?) - * - fix grammer.c error handling so its not static - * - #ifdef around stuff pertaining to extentions - * - * Outstanding Questions: - * ----------------------------------------------------- - * - ARB_matrix_palette / ARB_vertex_blend -- not supported - * what gets hacked off because of this: - * + VERTEX_ATTRIB_MATRIXINDEX - * + VERTEX_ATTRIB_WEIGHT - * + MATRIX_MODELVIEW - * + MATRIX_PALETTE - * - * - When can we fetch env/local params from their own register files, and - * when to we have to fetch them into the main state register file? - * (think arrays) - * - * Grammar Changes: - * ----------------------------------------------------- - */ - -/* Changes since moving the file to shader directory - -2004-III-4 ------------------------------------------------------------ -- added #include "grammar_mesa.h" -- removed grammar specific code part (it resides now in grammar.c) -- added GL_ARB_fragment_program_shadow tokens -- modified #include "arbparse_syn.h" -- major changes inside _mesa_parse_arb_program() -- check the program string for '\0' characters -- copy the program string to a one-byte-longer location to have - it null-terminated -- position invariance test (not writing to result.position) moved - to syntax part -*/ - -typedef GLubyte *production; - - -/** - * This is the text describing the rules to parse the grammar - */ -LONGSTRING static char arb_grammar_text[] = -#include "arbprogram_syn.h" -; - -/** - * These should match up with the values defined in arbprogram.syn - */ - -/* - Changes: - - changed and merged V_* and F_* opcode values to OP_*. - - added GL_ARB_fragment_program_shadow specific tokens (michal) -*/ -#define REVISION 0x0a - -/* program type */ -#define FRAGMENT_PROGRAM 0x01 -#define VERTEX_PROGRAM 0x02 - -/* program section */ -#define OPTION 0x01 -#define INSTRUCTION 0x02 -#define DECLARATION 0x03 -#define END 0x04 - -/* GL_ARB_fragment_program option */ -#define ARB_PRECISION_HINT_FASTEST 0x00 -#define ARB_PRECISION_HINT_NICEST 0x01 -#define ARB_FOG_EXP 0x02 -#define ARB_FOG_EXP2 0x03 -#define ARB_FOG_LINEAR 0x04 - -/* GL_ARB_vertex_program option */ -#define ARB_POSITION_INVARIANT 0x05 - -/* GL_ARB_fragment_program_shadow option */ -#define ARB_FRAGMENT_PROGRAM_SHADOW 0x06 - -/* GL_ARB_draw_buffers option */ -#define ARB_DRAW_BUFFERS 0x07 - -/* GL_MESA_texture_array option */ -#define MESA_TEXTURE_ARRAY 0x08 - -/* GL_ARB_fragment_program instruction class */ -#define OP_ALU_INST 0x00 -#define OP_TEX_INST 0x01 - -/* GL_ARB_vertex_program instruction class */ -/* OP_ALU_INST */ - -/* GL_ARB_fragment_program instruction type */ -#define OP_ALU_VECTOR 0x00 -#define OP_ALU_SCALAR 0x01 -#define OP_ALU_BINSC 0x02 -#define OP_ALU_BIN 0x03 -#define OP_ALU_TRI 0x04 -#define OP_ALU_SWZ 0x05 -#define OP_TEX_SAMPLE 0x06 -#define OP_TEX_KIL 0x07 - -/* GL_ARB_vertex_program instruction type */ -#define OP_ALU_ARL 0x08 -/* OP_ALU_VECTOR */ -/* OP_ALU_SCALAR */ -/* OP_ALU_BINSC */ -/* OP_ALU_BIN */ -/* OP_ALU_TRI */ -/* OP_ALU_SWZ */ - -/* GL_ARB_fragment_program instruction code */ -#define OP_ABS 0x00 -#define OP_ABS_SAT 0x1B -#define OP_FLR 0x09 -#define OP_FLR_SAT 0x26 -#define OP_FRC 0x0A -#define OP_FRC_SAT 0x27 -#define OP_LIT 0x0C -#define OP_LIT_SAT 0x2A -#define OP_MOV 0x11 -#define OP_MOV_SAT 0x30 -#define OP_COS 0x1F -#define OP_COS_SAT 0x20 -#define OP_EX2 0x07 -#define OP_EX2_SAT 0x25 -#define OP_LG2 0x0B -#define OP_LG2_SAT 0x29 -#define OP_RCP 0x14 -#define OP_RCP_SAT 0x33 -#define OP_RSQ 0x15 -#define OP_RSQ_SAT 0x34 -#define OP_SIN 0x38 -#define OP_SIN_SAT 0x39 -#define OP_SCS 0x35 -#define OP_SCS_SAT 0x36 -#define OP_POW 0x13 -#define OP_POW_SAT 0x32 -#define OP_ADD 0x01 -#define OP_ADD_SAT 0x1C -#define OP_DP3 0x03 -#define OP_DP3_SAT 0x21 -#define OP_DP4 0x04 -#define OP_DP4_SAT 0x22 -#define OP_DPH 0x05 -#define OP_DPH_SAT 0x23 -#define OP_DST 0x06 -#define OP_DST_SAT 0x24 -#define OP_MAX 0x0F -#define OP_MAX_SAT 0x2E -#define OP_MIN 0x10 -#define OP_MIN_SAT 0x2F -#define OP_MUL 0x12 -#define OP_MUL_SAT 0x31 -#define OP_SGE 0x16 -#define OP_SGE_SAT 0x37 -#define OP_SLT 0x17 -#define OP_SLT_SAT 0x3A -#define OP_SUB 0x18 -#define OP_SUB_SAT 0x3B -#define OP_XPD 0x1A -#define OP_XPD_SAT 0x43 -#define OP_CMP 0x1D -#define OP_CMP_SAT 0x1E -#define OP_LRP 0x2B -#define OP_LRP_SAT 0x2C -#define OP_MAD 0x0E -#define OP_MAD_SAT 0x2D -#define OP_SWZ 0x19 -#define OP_SWZ_SAT 0x3C -#define OP_TEX 0x3D -#define OP_TEX_SAT 0x3E -#define OP_TXB 0x3F -#define OP_TXB_SAT 0x40 -#define OP_TXP 0x41 -#define OP_TXP_SAT 0x42 -#define OP_KIL 0x28 - -/* GL_ARB_vertex_program instruction code */ -#define OP_ARL 0x02 -/* OP_ABS */ -/* OP_FLR */ -/* OP_FRC */ -/* OP_LIT */ -/* OP_MOV */ -/* OP_EX2 */ -#define OP_EXP 0x08 -/* OP_LG2 */ -#define OP_LOG 0x0D -/* OP_RCP */ -/* OP_RSQ */ -/* OP_POW */ -/* OP_ADD */ -/* OP_DP3 */ -/* OP_DP4 */ -/* OP_DPH */ -/* OP_DST */ -/* OP_MAX */ -/* OP_MIN */ -/* OP_MUL */ -/* OP_SGE */ -/* OP_SLT */ -/* OP_SUB */ -/* OP_XPD */ -/* OP_MAD */ -/* OP_SWZ */ - -/* fragment attribute binding */ -#define FRAGMENT_ATTRIB_COLOR 0x01 -#define FRAGMENT_ATTRIB_TEXCOORD 0x02 -#define FRAGMENT_ATTRIB_FOGCOORD 0x03 -#define FRAGMENT_ATTRIB_POSITION 0x04 - -/* vertex attribute binding */ -#define VERTEX_ATTRIB_POSITION 0x01 -#define VERTEX_ATTRIB_WEIGHT 0x02 -#define VERTEX_ATTRIB_NORMAL 0x03 -#define VERTEX_ATTRIB_COLOR 0x04 -#define VERTEX_ATTRIB_FOGCOORD 0x05 -#define VERTEX_ATTRIB_TEXCOORD 0x06 -#define VERTEX_ATTRIB_MATRIXINDEX 0x07 -#define VERTEX_ATTRIB_GENERIC 0x08 - -/* fragment result binding */ -#define FRAGMENT_RESULT_COLOR 0x01 -#define FRAGMENT_RESULT_DEPTH 0x02 - -/* vertex result binding */ -#define VERTEX_RESULT_POSITION 0x01 -#define VERTEX_RESULT_COLOR 0x02 -#define VERTEX_RESULT_FOGCOORD 0x03 -#define VERTEX_RESULT_POINTSIZE 0x04 -#define VERTEX_RESULT_TEXCOORD 0x05 - -/* texture target */ -#define TEXTARGET_1D 0x01 -#define TEXTARGET_2D 0x02 -#define TEXTARGET_3D 0x03 -#define TEXTARGET_RECT 0x04 -#define TEXTARGET_CUBE 0x05 -/* GL_ARB_fragment_program_shadow */ -#define TEXTARGET_SHADOW1D 0x06 -#define TEXTARGET_SHADOW2D 0x07 -#define TEXTARGET_SHADOWRECT 0x08 -/* GL_MESA_texture_array */ -#define TEXTARGET_1D_ARRAY 0x09 -#define TEXTARGET_2D_ARRAY 0x0a -#define TEXTARGET_SHADOW1D_ARRAY 0x0b -#define TEXTARGET_SHADOW2D_ARRAY 0x0c - -/* face type */ -#define FACE_FRONT 0x00 -#define FACE_BACK 0x01 - -/* color type */ -#define COLOR_PRIMARY 0x00 -#define COLOR_SECONDARY 0x01 - -/* component */ -#define COMPONENT_X 0x00 -#define COMPONENT_Y 0x01 -#define COMPONENT_Z 0x02 -#define COMPONENT_W 0x03 -#define COMPONENT_0 0x04 -#define COMPONENT_1 0x05 - -/* array index type */ -#define ARRAY_INDEX_ABSOLUTE 0x00 -#define ARRAY_INDEX_RELATIVE 0x01 - -/* matrix name */ -#define MATRIX_MODELVIEW 0x01 -#define MATRIX_PROJECTION 0x02 -#define MATRIX_MVP 0x03 -#define MATRIX_TEXTURE 0x04 -#define MATRIX_PALETTE 0x05 -#define MATRIX_PROGRAM 0x06 - -/* matrix modifier */ -#define MATRIX_MODIFIER_IDENTITY 0x00 -#define MATRIX_MODIFIER_INVERSE 0x01 -#define MATRIX_MODIFIER_TRANSPOSE 0x02 -#define MATRIX_MODIFIER_INVTRANS 0x03 - -/* constant type */ -#define CONSTANT_SCALAR 0x01 -#define CONSTANT_VECTOR 0x02 - -/* program param type */ -#define PROGRAM_PARAM_ENV 0x01 -#define PROGRAM_PARAM_LOCAL 0x02 - -/* register type */ -#define REGISTER_ATTRIB 0x01 -#define REGISTER_PARAM 0x02 -#define REGISTER_RESULT 0x03 -#define REGISTER_ESTABLISHED_NAME 0x04 - -/* param binding */ -#define PARAM_NULL 0x00 -#define PARAM_ARRAY_ELEMENT 0x01 -#define PARAM_STATE_ELEMENT 0x02 -#define PARAM_PROGRAM_ELEMENT 0x03 -#define PARAM_PROGRAM_ELEMENTS 0x04 -#define PARAM_CONSTANT 0x05 - -/* param state property */ -#define STATE_MATERIAL_PARSER 0x01 -#define STATE_LIGHT_PARSER 0x02 -#define STATE_LIGHT_MODEL 0x03 -#define STATE_LIGHT_PROD 0x04 -#define STATE_FOG 0x05 -#define STATE_MATRIX_ROWS 0x06 -/* GL_ARB_fragment_program */ -#define STATE_TEX_ENV 0x07 -#define STATE_DEPTH 0x08 -/* GL_ARB_vertex_program */ -#define STATE_TEX_GEN 0x09 -#define STATE_CLIP_PLANE 0x0A -#define STATE_POINT 0x0B - -/* state material property */ -#define MATERIAL_AMBIENT 0x01 -#define MATERIAL_DIFFUSE 0x02 -#define MATERIAL_SPECULAR 0x03 -#define MATERIAL_EMISSION 0x04 -#define MATERIAL_SHININESS 0x05 - -/* state light property */ -#define LIGHT_AMBIENT 0x01 -#define LIGHT_DIFFUSE 0x02 -#define LIGHT_SPECULAR 0x03 -#define LIGHT_POSITION 0x04 -#define LIGHT_ATTENUATION 0x05 -#define LIGHT_HALF 0x06 -#define LIGHT_SPOT_DIRECTION 0x07 - -/* state light model property */ -#define LIGHT_MODEL_AMBIENT 0x01 -#define LIGHT_MODEL_SCENECOLOR 0x02 - -/* state light product property */ -#define LIGHT_PROD_AMBIENT 0x01 -#define LIGHT_PROD_DIFFUSE 0x02 -#define LIGHT_PROD_SPECULAR 0x03 - -/* state texture environment property */ -#define TEX_ENV_COLOR 0x01 - -/* state texture generation coord property */ -#define TEX_GEN_EYE 0x01 -#define TEX_GEN_OBJECT 0x02 - -/* state fog property */ -#define FOG_COLOR 0x01 -#define FOG_PARAMS 0x02 - -/* state depth property */ -#define DEPTH_RANGE 0x01 - -/* state point parameters property */ -#define POINT_SIZE 0x01 -#define POINT_ATTENUATION 0x02 - -/* declaration */ -#define ATTRIB 0x01 -#define PARAM 0x02 -#define TEMP 0x03 -#define OUTPUT 0x04 -#define ALIAS 0x05 -/* GL_ARB_vertex_program */ -#define ADDRESS 0x06 - -/*----------------------------------------------------------------------- - * From here on down is the semantic checking portion - * - */ - -/** - * Variable Table Handling functions - */ -typedef enum -{ - vt_none, - vt_address, - vt_attrib, - vt_param, - vt_temp, - vt_output, - vt_alias -} var_type; - - -/** - * Setting an explicit field for each of the binding properties is a bit - * wasteful of space, but it should be much more clear when reading later on.. - */ -struct var_cache -{ - const GLubyte *name; /* don't free() - no need */ - var_type type; - GLuint address_binding; /* The index of the address register we should - * be using */ - GLuint attrib_binding; /* For type vt_attrib, see nvfragprog.h for values */ - GLuint attrib_is_generic; /* If the attrib was specified through a generic - * vertex attrib */ - GLuint temp_binding; /* The index of the temp register we are to use */ - GLuint output_binding; /* Output/result register number */ - struct var_cache *alias_binding; /* For type vt_alias, points to the var_cache entry - * that this is aliased to */ - GLuint param_binding_type; /* {PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, - * PROGRAM_ENV_PARAM} */ - GLuint param_binding_begin; /* This is the offset into the program_parameter_list where - * the tokens representing our bound state (or constants) - * start */ - GLuint param_binding_length; /* This is how many entries in the the program_parameter_list - * we take up with our state tokens or constants. Note that - * this is _not_ the same as the number of param registers - * we eventually use */ - struct var_cache *next; -}; - -static GLvoid -var_cache_create (struct var_cache **va) -{ - *va = (struct var_cache *) _mesa_malloc (sizeof (struct var_cache)); - if (*va) { - (**va).name = NULL; - (**va).type = vt_none; - (**va).attrib_binding = ~0; - (**va).attrib_is_generic = 0; - (**va).temp_binding = ~0; - (**va).output_binding = ~0; - (**va).param_binding_type = ~0; - (**va).param_binding_begin = ~0; - (**va).param_binding_length = ~0; - (**va).alias_binding = NULL; - (**va).next = NULL; - } -} - -static GLvoid -var_cache_destroy (struct var_cache **va) -{ - if (*va) { - var_cache_destroy (&(**va).next); - _mesa_free (*va); - *va = NULL; - } -} - -static GLvoid -var_cache_append (struct var_cache **va, struct var_cache *nv) -{ - if (*va) - var_cache_append (&(**va).next, nv); - else - *va = nv; -} - -static struct var_cache * -var_cache_find (struct var_cache *va, const GLubyte * name) -{ - /*struct var_cache *first = va;*/ - - while (va) { - if (!_mesa_strcmp ( (const char*) name, (const char*) va->name)) { - if (va->type == vt_alias) - return va->alias_binding; - return va; - } - - va = va->next; - } - - return NULL; -} - - - -/** - * Called when an error is detected while parsing/compiling a program. - * Sets the ctx->Program.ErrorString field to descript and records a - * GL_INVALID_OPERATION error. - * \param position position of error in program string - * \param descrip verbose error description - */ -static void -program_error(GLcontext *ctx, GLint position, const char *descrip) -{ - if (descrip) { - const char *prefix = "glProgramString(", *suffix = ")"; - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(prefix) + - _mesa_strlen(suffix) + 1); - if (str) { - _mesa_sprintf(str, "%s%s%s", prefix, descrip, suffix); - _mesa_error(ctx, GL_INVALID_OPERATION, str); - _mesa_free(str); - } - } - _mesa_set_program_error(ctx, position, descrip); -} - - -/** - * As above, but with an extra string parameter for more info. - */ -static void -program_error2(GLcontext *ctx, GLint position, const char *descrip, - const char *var) -{ - if (descrip) { - const char *prefix = "glProgramString(", *suffix = ")"; - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(": ") + - _mesa_strlen(var) + - _mesa_strlen(prefix) + - _mesa_strlen(suffix) + 1); - if (str) { - _mesa_sprintf(str, "%s%s: %s%s", prefix, descrip, var, suffix); - _mesa_error(ctx, GL_INVALID_OPERATION, str); - _mesa_free(str); - } - } - { - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(": ") + - _mesa_strlen(var) + 1); - if (str) { - _mesa_sprintf(str, "%s: %s", descrip, var); - } - _mesa_set_program_error(ctx, position, str); - if (str) { - _mesa_free(str); - } - } -} - - - -/** - * constructs an integer from 4 GLubytes in LE format - */ -static GLuint -parse_position (const GLubyte ** inst) -{ - GLuint value; - - value = (GLuint) (*(*inst)++); - value += (GLuint) (*(*inst)++) * 0x100; - value += (GLuint) (*(*inst)++) * 0x10000; - value += (GLuint) (*(*inst)++) * 0x1000000; - - return value; -} - -/** - * This will, given a string, lookup the string as a variable name in the - * var cache. If the name is found, the var cache node corresponding to the - * var name is returned. If it is not found, a new entry is allocated - * - * \param I Points into the binary array where the string identifier begins - * \param found 1 if the string was found in the var_cache, 0 if it was allocated - * \return The location on the var_cache corresponding the the string starting at I - */ -static struct var_cache * -parse_string (const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program, GLuint * found) -{ - const GLubyte *i = *inst; - struct var_cache *va = NULL; - (void) Program; - - *inst += _mesa_strlen ((char *) i) + 1; - - va = var_cache_find (*vc_head, i); - - if (va) { - *found = 1; - return va; - } - - *found = 0; - var_cache_create (&va); - va->name = (const GLubyte *) i; - - var_cache_append (vc_head, va); - - return va; -} - -static char * -parse_string_without_adding (const GLubyte ** inst, struct arb_program *Program) -{ - const GLubyte *i = *inst; - (void) Program; - - *inst += _mesa_strlen ((char *) i) + 1; - - return (char *) i; -} - -/** - * \return -1 if we parse '-', return 1 otherwise - */ -static GLint -parse_sign (const GLubyte ** inst) -{ - /*return *(*inst)++ != '+'; */ - - if (**inst == '-') { - (*inst)++; - return -1; - } - else if (**inst == '+') { - (*inst)++; - return 1; - } - - return 1; -} - -/** - * parses and returns signed integer - */ -static GLint -parse_integer (const GLubyte ** inst, struct arb_program *Program) -{ - GLint sign; - GLint value; - - /* check if *inst points to '+' or '-' - * if yes, grab the sign and increment *inst - */ - sign = parse_sign (inst); - - /* now check if *inst points to 0 - * if yes, increment the *inst and return the default value - */ - if (**inst == 0) { - (*inst)++; - return 0; - } - - /* parse the integer as you normally would do it */ - value = _mesa_atoi (parse_string_without_adding (inst, Program)); - - /* now, after terminating 0 there is a position - * to parse it - parse_position() - */ - Program->Position = parse_position (inst); - - return value * sign; -} - -/** - Accumulate this string of digits, and return them as - a large integer represented in floating point (for range). - If scale is not NULL, also accumulates a power-of-ten - integer scale factor that represents the number of digits - in the string. -*/ -static GLdouble -parse_float_string(const GLubyte ** inst, struct arb_program *Program, GLdouble *scale) -{ - GLdouble value = 0.0; - GLdouble oscale = 1.0; - - if (**inst == 0) { /* this string of digits is empty-- do nothing */ - (*inst)++; - } - else { /* nonempty string-- parse out the digits */ - while (**inst >= '0' && **inst <= '9') { - GLubyte digit = *((*inst)++); - value = value * 10.0 + (GLint) (digit - '0'); - oscale *= 10.0; - } - assert(**inst == 0); /* integer string should end with 0 */ - (*inst)++; /* skip over terminating 0 */ - Program->Position = parse_position(inst); /* skip position (from integer) */ - } - if (scale) - *scale = oscale; - return value; -} - -/** - Parse an unsigned floating-point number from this stream of tokenized - characters. Example floating-point formats supported: - 12.34 - 12 - 0.34 - .34 - 12.34e-4 - */ -static GLfloat -parse_float (const GLubyte ** inst, struct arb_program *Program) -{ - GLint exponent; - GLdouble whole, fraction, fracScale = 1.0; - - whole = parse_float_string(inst, Program, 0); - fraction = parse_float_string(inst, Program, &fracScale); - - /* Parse signed exponent */ - exponent = parse_integer(inst, Program); /* This is the exponent */ - - /* Assemble parts of floating-point number: */ - return (GLfloat) ((whole + fraction / fracScale) * - _mesa_pow(10.0, (GLfloat) exponent)); -} - - -/** - */ -static GLfloat -parse_signed_float (const GLubyte ** inst, struct arb_program *Program) -{ - GLint sign = parse_sign (inst); - GLfloat value = parse_float (inst, Program); - return value * sign; -} - -/** - * This picks out a constant value from the parsed array. The constant vector is r - * returned in the *values array, which should be of length 4. - * - * \param values - The 4 component vector with the constant value in it - */ -static GLvoid -parse_constant (const GLubyte ** inst, GLfloat *values, struct arb_program *Program, - GLboolean use) -{ - GLuint components, i; - - - switch (*(*inst)++) { - case CONSTANT_SCALAR: - if (use == GL_TRUE) { - values[0] = - values[1] = - values[2] = values[3] = parse_float (inst, Program); - } - else { - values[0] = - values[1] = - values[2] = values[3] = parse_signed_float (inst, Program); - } - - break; - case CONSTANT_VECTOR: - values[0] = values[1] = values[2] = 0; - values[3] = 1; - components = *(*inst)++; - for (i = 0; i < components; i++) { - values[i] = parse_signed_float (inst, Program); - } - break; - } -} - -/** - * \param offset The offset from the address register that we should - * address - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_relative_offset(GLcontext *ctx, const GLubyte **inst, - struct arb_program *Program, GLint *offset) -{ - (void) ctx; - *offset = parse_integer(inst, Program); - return 0; -} - -/** - * \param color 0 if color type is primary, 1 if color type is secondary - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_color_type (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * color) -{ - (void) ctx; (void) Program; - *color = *(*inst)++ != COLOR_PRIMARY; - return 0; -} - -/** - * Get an integer corresponding to a generic vertex attribute. - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_generic_attrib_num(GLcontext *ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint *attrib) -{ - GLint i = parse_integer(inst, Program); - - if ((i < 0) || (i >= MAX_VERTEX_PROGRAM_ATTRIBS)) - { - program_error(ctx, Program->Position, - "Invalid generic vertex attribute index"); - return 1; - } - - *attrib = (GLuint) i; - - return 0; -} - - -/** - * \param color The index of the color buffer to write into - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_output_color_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * color) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxDrawBuffers)) { - program_error(ctx, Program->Position, "Invalid draw buffer index"); - return 1; - } - - *color = (GLuint) i; - return 0; -} - - -/** - * Validate the index of a texture coordinate - * - * \param coord The texture unit index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_texcoord_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * coord) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxTextureCoordUnits)) { - program_error(ctx, Program->Position, "Invalid texture coordinate index"); - return 1; - } - - *coord = (GLuint) i; - return 0; -} - - -/** - * Validate the index of a texture image unit - * - * \param coord The texture unit index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_teximage_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * coord) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxTextureImageUnits)) { - program_error(ctx, Program->Position, "Invalid texture image index"); - return 1; - } - - *coord = (GLuint) i; - return 0; -} - - -/** - * \param coord The weight index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_weight_num (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * coord) -{ - *coord = parse_integer (inst, Program); - - if ((*coord < 0) || (*coord >= 1)) { - program_error(ctx, Program->Position, "Invalid weight index"); - return 1; - } - - return 0; -} - -/** - * \param coord The clip plane index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_clipplane_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLint * coord) -{ - *coord = parse_integer (inst, Program); - - if ((*coord < 0) || (*coord >= (GLint) ctx->Const.MaxClipPlanes)) { - program_error(ctx, Program->Position, "Invalid clip plane index"); - return 1; - } - - return 0; -} - - -/** - * \return 0 on front face, 1 on back face - */ -static GLuint -parse_face_type (const GLubyte ** inst) -{ - switch (*(*inst)++) { - case FACE_FRONT: - return 0; - - case FACE_BACK: - return 1; - } - return 0; -} - - -/** - * Given a matrix and a modifier token on the binary array, return tokens - * that _mesa_fetch_state() [program.c] can understand. - * - * \param matrix - the matrix we are talking about - * \param matrix_idx - the index of the matrix we have (for texture & program matricies) - * \param matrix_modifier - the matrix modifier (trans, inv, etc) - * \return 0 on sucess, 1 on failure - */ -static GLuint -parse_matrix (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * matrix, GLint * matrix_idx, GLint * matrix_modifier) -{ - GLubyte mat = *(*inst)++; - - *matrix_idx = 0; - - switch (mat) { - case MATRIX_MODELVIEW: - *matrix = STATE_MODELVIEW_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx > 0) { - program_error(ctx, Program->Position, - "ARB_vertex_blend not supported"); - return 1; - } - break; - - case MATRIX_PROJECTION: - *matrix = STATE_PROJECTION_MATRIX; - break; - - case MATRIX_MVP: - *matrix = STATE_MVP_MATRIX; - break; - - case MATRIX_TEXTURE: - *matrix = STATE_TEXTURE_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx >= (GLint) ctx->Const.MaxTextureUnits) { - program_error(ctx, Program->Position, "Invalid Texture Unit"); - /* bad *matrix_id */ - return 1; - } - break; - - /* This is not currently supported (ARB_matrix_palette) */ - case MATRIX_PALETTE: - *matrix_idx = parse_integer (inst, Program); - program_error(ctx, Program->Position, - "ARB_matrix_palette not supported"); - return 1; - break; - - case MATRIX_PROGRAM: - *matrix = STATE_PROGRAM_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx >= (GLint) ctx->Const.MaxProgramMatrices) { - program_error(ctx, Program->Position, "Invalid Program Matrix"); - /* bad *matrix_idx */ - return 1; - } - break; - } - - switch (*(*inst)++) { - case MATRIX_MODIFIER_IDENTITY: - *matrix_modifier = 0; - break; - case MATRIX_MODIFIER_INVERSE: - *matrix_modifier = STATE_MATRIX_INVERSE; - break; - case MATRIX_MODIFIER_TRANSPOSE: - *matrix_modifier = STATE_MATRIX_TRANSPOSE; - break; - case MATRIX_MODIFIER_INVTRANS: - *matrix_modifier = STATE_MATRIX_INVTRANS; - break; - } - - return 0; -} - - -/** - * This parses a state string (rather, the binary version of it) into - * a 6-token sequence as described in _mesa_fetch_state() [program.c] - * - * \param inst - the start in the binary arry to start working from - * \param state_tokens - the storage for the 6-token state description - * \return - 0 on sucess, 1 on error - */ -static GLuint -parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, - gl_state_index state_tokens[STATE_LENGTH]) -{ - GLubyte token = *(*inst)++; - - switch (token) { - case STATE_MATERIAL_PARSER: - state_tokens[0] = STATE_MATERIAL; - state_tokens[1] = parse_face_type (inst); - switch (*(*inst)++) { - case MATERIAL_AMBIENT: - state_tokens[2] = STATE_AMBIENT; - break; - case MATERIAL_DIFFUSE: - state_tokens[2] = STATE_DIFFUSE; - break; - case MATERIAL_SPECULAR: - state_tokens[2] = STATE_SPECULAR; - break; - case MATERIAL_EMISSION: - state_tokens[2] = STATE_EMISSION; - break; - case MATERIAL_SHININESS: - state_tokens[2] = STATE_SHININESS; - break; - } - break; - - case STATE_LIGHT_PARSER: - state_tokens[0] = STATE_LIGHT; - state_tokens[1] = parse_integer (inst, Program); - - /* Check the value of state_tokens[1] against the # of lights */ - if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) { - program_error(ctx, Program->Position, "Invalid Light Number"); - /* bad state_tokens[1] */ - return 1; - } - - switch (*(*inst)++) { - case LIGHT_AMBIENT: - state_tokens[2] = STATE_AMBIENT; - break; - case LIGHT_DIFFUSE: - state_tokens[2] = STATE_DIFFUSE; - break; - case LIGHT_SPECULAR: - state_tokens[2] = STATE_SPECULAR; - break; - case LIGHT_POSITION: - state_tokens[2] = STATE_POSITION; - break; - case LIGHT_ATTENUATION: - state_tokens[2] = STATE_ATTENUATION; - break; - case LIGHT_HALF: - state_tokens[2] = STATE_HALF_VECTOR; - break; - case LIGHT_SPOT_DIRECTION: - state_tokens[2] = STATE_SPOT_DIRECTION; - break; - } - break; - - case STATE_LIGHT_MODEL: - switch (*(*inst)++) { - case LIGHT_MODEL_AMBIENT: - state_tokens[0] = STATE_LIGHTMODEL_AMBIENT; - break; - case LIGHT_MODEL_SCENECOLOR: - state_tokens[0] = STATE_LIGHTMODEL_SCENECOLOR; - state_tokens[1] = parse_face_type (inst); - break; - } - break; - - case STATE_LIGHT_PROD: - state_tokens[0] = STATE_LIGHTPROD; - state_tokens[1] = parse_integer (inst, Program); - - /* Check the value of state_tokens[1] against the # of lights */ - if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) { - program_error(ctx, Program->Position, "Invalid Light Number"); - /* bad state_tokens[1] */ - return 1; - } - - state_tokens[2] = parse_face_type (inst); - switch (*(*inst)++) { - case LIGHT_PROD_AMBIENT: - state_tokens[3] = STATE_AMBIENT; - break; - case LIGHT_PROD_DIFFUSE: - state_tokens[3] = STATE_DIFFUSE; - break; - case LIGHT_PROD_SPECULAR: - state_tokens[3] = STATE_SPECULAR; - break; - } - break; - - - case STATE_FOG: - switch (*(*inst)++) { - case FOG_COLOR: - state_tokens[0] = STATE_FOG_COLOR; - break; - case FOG_PARAMS: - state_tokens[0] = STATE_FOG_PARAMS; - break; - } - break; - - case STATE_TEX_ENV: - state_tokens[1] = parse_integer (inst, Program); - switch (*(*inst)++) { - case TEX_ENV_COLOR: - state_tokens[0] = STATE_TEXENV_COLOR; - break; - } - break; - - case STATE_TEX_GEN: - { - GLuint type, coord; - - state_tokens[0] = STATE_TEXGEN; - /*state_tokens[1] = parse_integer (inst, Program);*/ /* Texture Unit */ - - if (parse_texcoord_num (ctx, inst, Program, &coord)) - return 1; - state_tokens[1] = coord; - - /* EYE or OBJECT */ - type = *(*inst)++; - - /* 0 - s, 1 - t, 2 - r, 3 - q */ - coord = *(*inst)++; - - if (type == TEX_GEN_EYE) { - switch (coord) { - case COMPONENT_X: - state_tokens[2] = STATE_TEXGEN_EYE_S; - break; - case COMPONENT_Y: - state_tokens[2] = STATE_TEXGEN_EYE_T; - break; - case COMPONENT_Z: - state_tokens[2] = STATE_TEXGEN_EYE_R; - break; - case COMPONENT_W: - state_tokens[2] = STATE_TEXGEN_EYE_Q; - break; - default: - _mesa_problem(ctx, "bad texgen component in " - "parse_state_single_item()"); - } - } - else { - switch (coord) { - case COMPONENT_X: - state_tokens[2] = STATE_TEXGEN_OBJECT_S; - break; - case COMPONENT_Y: - state_tokens[2] = STATE_TEXGEN_OBJECT_T; - break; - case COMPONENT_Z: - state_tokens[2] = STATE_TEXGEN_OBJECT_R; - break; - case COMPONENT_W: - state_tokens[2] = STATE_TEXGEN_OBJECT_Q; - break; - default: - _mesa_problem(ctx, "bad texgen component in " - "parse_state_single_item()"); - } - } - } - break; - - case STATE_DEPTH: - switch (*(*inst)++) { - case DEPTH_RANGE: - state_tokens[0] = STATE_DEPTH_RANGE; - break; - } - break; - - case STATE_CLIP_PLANE: - state_tokens[0] = STATE_CLIPPLANE; - if (parse_clipplane_num (ctx, inst, Program, - (GLint *) &state_tokens[1])) - return 1; - break; - - case STATE_POINT: - switch (*(*inst)++) { - case POINT_SIZE: - state_tokens[0] = STATE_POINT_SIZE; - break; - - case POINT_ATTENUATION: - state_tokens[0] = STATE_POINT_ATTENUATION; - break; - } - break; - - /* XXX: I think this is the correct format for a matrix row */ - case STATE_MATRIX_ROWS: - if (parse_matrix(ctx, inst, Program, - (GLint *) &state_tokens[0], - (GLint *) &state_tokens[1], - (GLint *) &state_tokens[4])) - return 1; - - state_tokens[2] = parse_integer (inst, Program); /* The first row to grab */ - - if ((**inst) != 0) { /* Either the last row, 0 */ - state_tokens[3] = parse_integer (inst, Program); - if (state_tokens[3] < state_tokens[2]) { - program_error(ctx, Program->Position, - "Second matrix index less than the first"); - /* state_tokens[4] vs. state_tokens[3] */ - return 1; - } - } - else { - state_tokens[3] = state_tokens[2]; - (*inst)++; - } - break; - } - - return 0; -} - -/** - * This parses a state string (rather, the binary version of it) into - * a 6-token similar for the state fetching code in program.c - * - * One might ask, why fetch these parameters into just like you fetch - * state when they are already stored in other places? - * - * Because of array offsets -> We can stick env/local parameters in the - * middle of a parameter array and then index someplace into the array - * when we execute. - * - * One optimization might be to only do this for the cases where the - * env/local parameters end up inside of an array, and leave the - * single parameters (or arrays of pure env/local pareameters) in their - * respective register files. - * - * For ENV parameters, the format is: - * state_tokens[0] = STATE_FRAGMENT_PROGRAM / STATE_VERTEX_PROGRAM - * state_tokens[1] = STATE_ENV - * state_tokens[2] = the parameter index - * - * for LOCAL parameters, the format is: - * state_tokens[0] = STATE_FRAGMENT_PROGRAM / STATE_VERTEX_PROGRAM - * state_tokens[1] = STATE_LOCAL - * state_tokens[2] = the parameter index - * - * \param inst - the start in the binary arry to start working from - * \param state_tokens - the storage for the 6-token state description - * \return - 0 on sucess, 1 on failure - */ -static GLuint -parse_program_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, - gl_state_index state_tokens[STATE_LENGTH]) -{ - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - state_tokens[0] = STATE_FRAGMENT_PROGRAM; - else - state_tokens[0] = STATE_VERTEX_PROGRAM; - - - switch (*(*inst)++) { - case PROGRAM_PARAM_ENV: - state_tokens[1] = STATE_ENV; - state_tokens[2] = parse_integer (inst, Program); - - /* Check state_tokens[2] against the number of ENV parameters available */ - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.FragmentProgram.MaxEnvParams)) - || - ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.VertexProgram.MaxEnvParams))) { - program_error(ctx, Program->Position, - "Invalid Program Env Parameter"); - /* bad state_tokens[2] */ - return 1; - } - - break; - - case PROGRAM_PARAM_LOCAL: - state_tokens[1] = STATE_LOCAL; - state_tokens[2] = parse_integer (inst, Program); - - /* Check state_tokens[2] against the number of LOCAL parameters available */ - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.FragmentProgram.MaxLocalParams)) - || - ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.VertexProgram.MaxLocalParams))) { - program_error(ctx, Program->Position, - "Invalid Program Local Parameter"); - /* bad state_tokens[2] */ - return 1; - } - break; - } - - return 0; -} - -/** - * For ARB_vertex_program, programs are not allowed to use both an explicit - * vertex attribute and a generic vertex attribute corresponding to the same - * state. See section 2.14.3.1 of the GL_ARB_vertex_program spec. - * - * This will walk our var_cache and make sure that nobody does anything fishy. - * - * \return 0 on sucess, 1 on error - */ -static GLuint -generic_attrib_check(struct var_cache *vc_head) -{ - int a; - struct var_cache *curr; - GLboolean explicitAttrib[MAX_VERTEX_PROGRAM_ATTRIBS], - genericAttrib[MAX_VERTEX_PROGRAM_ATTRIBS]; - - for (a=0; atype == vt_attrib) { - if (curr->attrib_is_generic) { - GLuint attr = (curr->attrib_binding == 0) - ? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0); - assert(attr < MAX_VERTEX_PROGRAM_ATTRIBS); - genericAttrib[attr] = GL_TRUE; - } - else { - assert(curr->attrib_binding < MAX_VERTEX_PROGRAM_ATTRIBS); - explicitAttrib[ curr->attrib_binding ] = GL_TRUE; - } - } - - curr = curr->next; - } - - for (a=0; aBase.Target == GL_FRAGMENT_PROGRAM_ARB) { - switch (*(*inst)++) { - case FRAGMENT_ATTRIB_COLOR: - { - GLint coord; - err = parse_color_type (ctx, inst, Program, &coord); - *inputReg = FRAG_ATTRIB_COL0 + coord; - } - break; - case FRAGMENT_ATTRIB_TEXCOORD: - { - GLuint texcoord = 0; - err = parse_texcoord_num (ctx, inst, Program, &texcoord); - *inputReg = FRAG_ATTRIB_TEX0 + texcoord; - } - break; - case FRAGMENT_ATTRIB_FOGCOORD: - *inputReg = FRAG_ATTRIB_FOGC; - break; - case FRAGMENT_ATTRIB_POSITION: - *inputReg = FRAG_ATTRIB_WPOS; - break; - default: - err = 1; - break; - } - } - else { - switch (*(*inst)++) { - case VERTEX_ATTRIB_POSITION: - *inputReg = VERT_ATTRIB_POS; - break; - - case VERTEX_ATTRIB_WEIGHT: - { - GLint weight; - err = parse_weight_num (ctx, inst, Program, &weight); - *inputReg = VERT_ATTRIB_WEIGHT; -#if 1 - /* hack for Warcraft (see bug 8060) */ - _mesa_warning(ctx, "Application error: vertex program uses 'vertex.weight' but GL_ARB_vertex_blend not supported."); - break; -#else - program_error(ctx, Program->Position, - "ARB_vertex_blend not supported"); - return 1; -#endif - } - - case VERTEX_ATTRIB_NORMAL: - *inputReg = VERT_ATTRIB_NORMAL; - break; - - case VERTEX_ATTRIB_COLOR: - { - GLint color; - err = parse_color_type (ctx, inst, Program, &color); - if (color) { - *inputReg = VERT_ATTRIB_COLOR1; - } - else { - *inputReg = VERT_ATTRIB_COLOR0; - } - } - break; - - case VERTEX_ATTRIB_FOGCOORD: - *inputReg = VERT_ATTRIB_FOG; - break; - - case VERTEX_ATTRIB_TEXCOORD: - { - GLuint unit = 0; - err = parse_texcoord_num (ctx, inst, Program, &unit); - *inputReg = VERT_ATTRIB_TEX0 + unit; - } - break; - - case VERTEX_ATTRIB_MATRIXINDEX: - /* Not supported at this time */ - { - const char *msg = "ARB_palette_matrix not supported"; - parse_integer (inst, Program); - program_error(ctx, Program->Position, msg); - } - return 1; - - case VERTEX_ATTRIB_GENERIC: - { - GLuint attrib; - err = parse_generic_attrib_num(ctx, inst, Program, &attrib); - if (!err) { - *is_generic = 1; - /* Add VERT_ATTRIB_GENERIC0 here because ARB_vertex_program's - * attributes do not alias the conventional vertex - * attributes. - */ - if (attrib > 0) - *inputReg = attrib + VERT_ATTRIB_GENERIC0; - else - *inputReg = 0; - } - } - break; - - default: - err = 1; - break; - } - } - - if (err) { - program_error(ctx, Program->Position, "Bad attribute binding"); - } - - return err; -} - - -/** - * This translates between a binary token for an output variable type - * and the mesa token for the same thing. - * - * \param inst The parsed tokens - * \param outputReg Returned index/number of the output register, - * one of the VERT_RESULT_* or FRAG_RESULT_* values. - */ -static GLuint -parse_result_binding(GLcontext *ctx, const GLubyte **inst, - GLuint *outputReg, struct arb_program *Program) -{ - const GLubyte token = *(*inst)++; - - switch (token) { - case FRAGMENT_RESULT_COLOR: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - GLuint out_color; - - /* This gets result of the color buffer we're supposed to - * draw into. This pertains to GL_ARB_draw_buffers. - */ - parse_output_color_num(ctx, inst, Program, &out_color); - ASSERT(out_color < MAX_DRAW_BUFFERS); - *outputReg = FRAG_RESULT_COLR; - } - else { - /* for vtx programs, this is VERTEX_RESULT_POSITION */ - *outputReg = VERT_RESULT_HPOS; - } - break; - - case FRAGMENT_RESULT_DEPTH: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* for frag programs, this is FRAGMENT_RESULT_DEPTH */ - *outputReg = FRAG_RESULT_DEPR; - } - else { - /* for vtx programs, this is VERTEX_RESULT_COLOR */ - GLint color_type; - GLuint face_type = parse_face_type(inst); - GLint err = parse_color_type(ctx, inst, Program, &color_type); - if (err) - return 1; - - if (face_type) { - /* back face */ - if (color_type) { - *outputReg = VERT_RESULT_BFC1; /* secondary color */ - } - else { - *outputReg = VERT_RESULT_BFC0; /* primary color */ - } - } - else { - /* front face */ - if (color_type) { - *outputReg = VERT_RESULT_COL1; /* secondary color */ - } - /* primary color */ - else { - *outputReg = VERT_RESULT_COL0; /* primary color */ - } - } - } - break; - - case VERTEX_RESULT_FOGCOORD: - *outputReg = VERT_RESULT_FOGC; - break; - - case VERTEX_RESULT_POINTSIZE: - *outputReg = VERT_RESULT_PSIZ; - break; - - case VERTEX_RESULT_TEXCOORD: - { - GLuint unit; - if (parse_texcoord_num (ctx, inst, Program, &unit)) - return 1; - *outputReg = VERT_RESULT_TEX0 + unit; - } - break; - } - - Program->Base.OutputsWritten |= (1 << *outputReg); - - return 0; -} - - -/** - * This handles the declaration of ATTRIB variables - * - * XXX: Still needs - * parse_vert_attrib_binding(), or something like that - * - * \return 0 on sucess, 1 on error - */ -static GLint -parse_attrib (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *attrib_var; - - attrib_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) attrib_var->name); - return 1; - } - - attrib_var->type = vt_attrib; - - if (parse_attrib_binding(ctx, inst, Program, &attrib_var->attrib_binding, - &attrib_var->attrib_is_generic)) - return 1; - - if (generic_attrib_check(*vc_head)) { - program_error(ctx, Program->Position, - "Cannot use both a generic vertex attribute " - "and a specific attribute of the same type"); - return 1; - } - - Program->Base.NumAttributes++; - return 0; -} - -/** - * \param use -- TRUE if we're called when declaring implicit parameters, - * FALSE if we're declaraing variables. This has to do with - * if we get a signed or unsigned float for scalar constants - */ -static GLuint -parse_param_elements (GLcontext * ctx, const GLubyte ** inst, - struct var_cache *param_var, - struct arb_program *Program, GLboolean use) -{ - GLint idx; - GLuint err = 0; - gl_state_index state_tokens[STATE_LENGTH] = {0, 0, 0, 0, 0}; - GLfloat const_values[4]; - - GLubyte token = *(*inst)++; - - switch (token) { - case PARAM_STATE_ELEMENT: - if (parse_state_single_item (ctx, inst, Program, state_tokens)) - return 1; - - /* If we adding STATE_MATRIX that has multiple rows, we need to - * unroll it and call _mesa_add_state_reference() for each row - */ - if ((state_tokens[0] == STATE_MODELVIEW_MATRIX || - state_tokens[0] == STATE_PROJECTION_MATRIX || - state_tokens[0] == STATE_MVP_MATRIX || - state_tokens[0] == STATE_TEXTURE_MATRIX || - state_tokens[0] == STATE_PROGRAM_MATRIX) - && (state_tokens[2] != state_tokens[3])) { - GLint row; - const GLint first_row = state_tokens[2]; - const GLint last_row = state_tokens[3]; - - for (row = first_row; row <= last_row; row++) { - state_tokens[2] = state_tokens[3] = row; - - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - } - } - else { - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - } - break; - - case PARAM_PROGRAM_ELEMENT: - if (parse_program_single_item (ctx, inst, Program, state_tokens)) - return 1; - idx = _mesa_add_state_reference (Program->Base.Parameters, state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - - /* Check if there is more: 0 -> we're done, else its an integer */ - if (**inst) { - GLuint out_of_range, new_idx; - GLuint start_idx = state_tokens[2] + 1; - GLuint end_idx = parse_integer (inst, Program); - - out_of_range = 0; - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - if (((state_tokens[1] == STATE_ENV) - && (end_idx >= ctx->Const.FragmentProgram.MaxEnvParams)) - || ((state_tokens[1] == STATE_LOCAL) - && (end_idx >= - ctx->Const.FragmentProgram.MaxLocalParams))) - out_of_range = 1; - } - else { - if (((state_tokens[1] == STATE_ENV) - && (end_idx >= ctx->Const.VertexProgram.MaxEnvParams)) - || ((state_tokens[1] == STATE_LOCAL) - && (end_idx >= - ctx->Const.VertexProgram.MaxLocalParams))) - out_of_range = 1; - } - if (out_of_range) { - program_error(ctx, Program->Position, - "Invalid Program Parameter"); /*end_idx*/ - return 1; - } - - for (new_idx = start_idx; new_idx <= end_idx; new_idx++) { - state_tokens[2] = new_idx; - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - param_var->param_binding_length++; - } - } - else { - (*inst)++; - } - break; - - case PARAM_CONSTANT: - /* parsing something like {1.0, 2.0, 3.0, 4.0} */ - parse_constant (inst, const_values, Program, use); - idx = _mesa_add_named_constant(Program->Base.Parameters, - (char *) param_var->name, - const_values, 4); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_type = PROGRAM_CONSTANT; - param_var->param_binding_length++; - break; - - default: - program_error(ctx, Program->Position, - "Unexpected token (in parse_param_elements())"); - return 1; - } - - Program->Base.NumParameters = Program->Base.Parameters->NumParameters; - - /* Make sure we haven't blown past our parameter limits */ - if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (Program->Base.NumParameters > - ctx->Const.VertexProgram.MaxLocalParams)) - || ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - && (Program->Base.NumParameters > - ctx->Const.FragmentProgram.MaxLocalParams))) { - program_error(ctx, Program->Position, "Too many parameter variables"); - return 1; - } - - return err; -} - - -/** - * This picks out PARAM program parameter bindings. - * - * XXX: This needs to be stressed & tested - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_param (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found, err; - GLint specified_length; - struct var_cache *param_var; - - err = 0; - param_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) param_var->name); - return 1; - } - - specified_length = parse_integer (inst, Program); - - if (specified_length < 0) { - program_error(ctx, Program->Position, "Negative parameter array length"); - return 1; - } - - param_var->type = vt_param; - param_var->param_binding_length = 0; - - /* Right now, everything is shoved into the main state register file. - * - * In the future, it would be nice to leave things ENV/LOCAL params - * in their respective register files, if possible - */ - param_var->param_binding_type = PROGRAM_STATE_VAR; - - /* Remember to: - * * - add each guy to the parameter list - * * - increment the param_var->param_binding_len - * * - store the param_var->param_binding_begin for the first one - * * - compare the actual len to the specified len at the end - */ - while (**inst != PARAM_NULL) { - if (parse_param_elements (ctx, inst, param_var, Program, GL_FALSE)) - return 1; - } - - /* Test array length here! */ - if (specified_length) { - if (specified_length != (int)param_var->param_binding_length) { - program_error(ctx, Program->Position, - "Declared parameter array length does not match parameter list"); - } - } - - (*inst)++; - - return 0; -} - -/** - * - */ -static GLuint -parse_param_use (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program, struct var_cache **new_var) -{ - struct var_cache *param_var; - - /* First, insert a dummy entry into the var_cache */ - var_cache_create (¶m_var); - param_var->name = (const GLubyte *) " "; - param_var->type = vt_param; - - param_var->param_binding_length = 0; - /* Don't fill in binding_begin; We use the default value of -1 - * to tell if its already initialized, elsewhere. - * - * param_var->param_binding_begin = 0; - */ - param_var->param_binding_type = PROGRAM_STATE_VAR; - - var_cache_append (vc_head, param_var); - - /* Then fill it with juicy parameter goodness */ - if (parse_param_elements (ctx, inst, param_var, Program, GL_TRUE)) - return 1; - - *new_var = param_var; - - return 0; -} - - -/** - * This handles the declaration of TEMP variables - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_temp (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - while (**inst != 0) { - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_temp; - - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (Program->Base.NumTemporaries >= - ctx->Const.FragmentProgram.MaxTemps)) - || ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) - && (Program->Base.NumTemporaries >= - ctx->Const.VertexProgram.MaxTemps))) { - program_error(ctx, Program->Position, - "Too many TEMP variables declared"); - return 1; - } - - temp_var->temp_binding = Program->Base.NumTemporaries; - Program->Base.NumTemporaries++; - } - (*inst)++; - - return 0; -} - -/** - * This handles variables of the OUTPUT variety - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_output (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *output_var; - GLuint err; - - output_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) output_var->name); - return 1; - } - - output_var->type = vt_output; - - err = parse_result_binding(ctx, inst, &output_var->output_binding, Program); - return err; -} - -/** - * This handles variables of the ALIAS kind - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_alias (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_alias; - temp_var->alias_binding = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (!found) - { - program_error2(ctx, Program->Position, - "Undefined alias value", - (char *) temp_var->alias_binding->name); - return 1; - } - - return 0; -} - -/** - * This handles variables of the ADDRESS kind - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_address (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - while (**inst != 0) { - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_address; - - if (Program->Base.NumAddressRegs >= - ctx->Const.VertexProgram.MaxAddressRegs) { - const char *msg = "Too many ADDRESS variables declared"; - program_error(ctx, Program->Position, msg); - return 1; - } - - temp_var->address_binding = Program->Base.NumAddressRegs; - Program->Base.NumAddressRegs++; - } - (*inst)++; - - return 0; -} - -/** - * Parse a program declaration - * - * \return 0 on sucess, 1 on error - */ -static GLint -parse_declaration (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLint err = 0; - - switch (*(*inst)++) { - case ADDRESS: - err = parse_address (ctx, inst, vc_head, Program); - break; - - case ALIAS: - err = parse_alias (ctx, inst, vc_head, Program); - break; - - case ATTRIB: - err = parse_attrib (ctx, inst, vc_head, Program); - break; - - case OUTPUT: - err = parse_output (ctx, inst, vc_head, Program); - break; - - case PARAM: - err = parse_param (ctx, inst, vc_head, Program); - break; - - case TEMP: - err = parse_temp (ctx, inst, vc_head, Program); - break; - } - - return err; -} - -/** - * Handle the parsing out of a masked destination register, either for a - * vertex or fragment program. - * - * If we are a vertex program, make sure we don't write to - * result.position if we have specified that the program is - * position invariant - * - * \param File - The register file we write to - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_masked_dst_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - enum register_file *File, GLuint *Index, GLint *WriteMask) -{ - GLuint tmp, result; - struct var_cache *dst; - - /* We either have a result register specified, or a - * variable that may or may not be writable - */ - switch (*(*inst)++) { - case REGISTER_RESULT: - if (parse_result_binding(ctx, inst, Index, Program)) - return 1; - *File = PROGRAM_OUTPUT; - break; - - case REGISTER_ESTABLISHED_NAME: - dst = parse_string (inst, vc_head, Program, &result); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!result) { - program_error(ctx, Program->Position, "0: Undefined variable"); - return 1; - } - - switch (dst->type) { - case vt_output: - *File = PROGRAM_OUTPUT; - *Index = dst->output_binding; - break; - - case vt_temp: - *File = PROGRAM_TEMPORARY; - *Index = dst->temp_binding; - break; - - /* If the var type is not vt_output or vt_temp, no go */ - default: - program_error(ctx, Program->Position, - "Destination register is read only"); - return 1; - } - break; - - default: - program_error(ctx, Program->Position, - "Unexpected opcode in parse_masked_dst_reg()"); - return 1; - } - - - /* Position invariance test */ - /* This test is done now in syntax portion - when position invariance OPTION - is specified, "result.position" rule is disabled so there is no way - to write the position - */ - /*if ((Program->HintPositionInvariant) && (*File == PROGRAM_OUTPUT) && - (*Index == 0)) { - program_error(ctx, Program->Position, - "Vertex program specified position invariance and wrote vertex position"); - }*/ - - /* And then the mask. - * w,a -> bit 0 - * z,b -> bit 1 - * y,g -> bit 2 - * x,r -> bit 3 - * - * ==> Need to reverse the order of bits for this! - */ - tmp = (GLint) *(*inst)++; - *WriteMask = (((tmp>>3) & 0x1) | - ((tmp>>1) & 0x2) | - ((tmp<<1) & 0x4) | - ((tmp<<3) & 0x8)); - - return 0; -} - - -/** - * Handle the parsing of a address register - * - * \param Index - The register index we write to - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, GLint * Index) -{ - struct var_cache *dst; - GLuint result; - - *Index = 0; /* XXX */ - - dst = parse_string (inst, vc_head, Program, &result); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!result) { - program_error(ctx, Program->Position, "Undefined variable"); - return 1; - } - - if (dst->type != vt_address) { - program_error(ctx, Program->Position, "Variable is not of type ADDRESS"); - return 1; - } - - return 0; -} - -#if 0 /* unused */ -/** - * Handle the parsing out of a masked address register - * - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_masked_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, GLint * Index, - GLboolean * WriteMask) -{ - if (parse_address_reg (ctx, inst, vc_head, Program, Index)) - return 1; - - /* This should be 0x8 */ - (*inst)++; - - /* Writemask of .x is implied */ - WriteMask[0] = 1; - WriteMask[1] = WriteMask[2] = WriteMask[3] = 0; - - return 0; -} -#endif - -/** - * Parse out a swizzle mask. - * - * Basically convert COMPONENT_X/Y/Z/W to SWIZZLE_X/Y/Z/W - * - * The len parameter allows us to grab 4 components for a vector - * swizzle, or just 1 component for a scalar src register selection - */ -static void -parse_swizzle_mask(const GLubyte ** inst, GLubyte *swizzle, GLint len) -{ - GLint i; - - for (i = 0; i < 4; i++) - swizzle[i] = i; - - for (i = 0; i < len; i++) { - switch (*(*inst)++) { - case COMPONENT_X: - swizzle[i] = SWIZZLE_X; - break; - case COMPONENT_Y: - swizzle[i] = SWIZZLE_Y; - break; - case COMPONENT_Z: - swizzle[i] = SWIZZLE_Z; - break; - case COMPONENT_W: - swizzle[i] = SWIZZLE_W; - break; - default: - _mesa_problem(NULL, "bad component in parse_swizzle_mask()"); - return; - } - } -} - - -/** - * Parse an extended swizzle mask which is a sequence of - * four x/y/z/w/0/1 tokens. - * \return swizzle four swizzle values - * \return negateMask four element bitfield - */ -static void -parse_extended_swizzle_mask(const GLubyte **inst, GLubyte swizzle[4], - GLubyte *negateMask) -{ - GLint i; - - *negateMask = 0x0; - for (i = 0; i < 4; i++) { - GLubyte swz; - if (parse_sign(inst) == -1) - *negateMask |= (1 << i); - - swz = *(*inst)++; - - switch (swz) { - case COMPONENT_0: - swizzle[i] = SWIZZLE_ZERO; - break; - case COMPONENT_1: - swizzle[i] = SWIZZLE_ONE; - break; - case COMPONENT_X: - swizzle[i] = SWIZZLE_X; - break; - case COMPONENT_Y: - swizzle[i] = SWIZZLE_Y; - break; - case COMPONENT_Z: - swizzle[i] = SWIZZLE_Z; - break; - case COMPONENT_W: - swizzle[i] = SWIZZLE_W; - break; - default: - _mesa_problem(NULL, "bad case in parse_extended_swizzle_mask()"); - return; - } - } -} - - -static GLuint -parse_src_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, - enum register_file * File, GLint * Index, - GLboolean *IsRelOffset ) -{ - struct var_cache *src; - GLuint binding, is_generic, found; - GLint offset; - - *IsRelOffset = 0; - - /* And the binding for the src */ - switch (*(*inst)++) { - case REGISTER_ATTRIB: - if (parse_attrib_binding - (ctx, inst, Program, &binding, &is_generic)) - return 1; - *File = PROGRAM_INPUT; - *Index = binding; - - /* We need to insert a dummy variable into the var_cache so we can - * catch generic vertex attrib aliasing errors - */ - var_cache_create(&src); - src->type = vt_attrib; - src->name = (const GLubyte *) "Dummy Attrib Variable"; - src->attrib_binding = binding; - src->attrib_is_generic = is_generic; - var_cache_append(vc_head, src); - if (generic_attrib_check(*vc_head)) { - program_error(ctx, Program->Position, - "Cannot use both a generic vertex attribute " - "and a specific attribute of the same type"); - return 1; - } - break; - - case REGISTER_PARAM: - switch (**inst) { - case PARAM_ARRAY_ELEMENT: - (*inst)++; - src = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (!found) { - program_error2(ctx, Program->Position, - "Undefined variable", - (char *) src->name); - return 1; - } - - *File = (enum register_file) src->param_binding_type; - - switch (*(*inst)++) { - case ARRAY_INDEX_ABSOLUTE: - offset = parse_integer (inst, Program); - - if ((offset < 0) - || (offset >= (int)src->param_binding_length)) { - program_error(ctx, Program->Position, - "Index out of range"); - /* offset, src->name */ - return 1; - } - - *Index = src->param_binding_begin + offset; - break; - - case ARRAY_INDEX_RELATIVE: - { - GLint addr_reg_idx, rel_off; - - /* First, grab the address regiseter */ - if (parse_address_reg (ctx, inst, vc_head, Program, &addr_reg_idx)) - return 1; - - /* And the .x */ - ((*inst)++); - ((*inst)++); - ((*inst)++); - ((*inst)++); - - /* Then the relative offset */ - if (parse_relative_offset(ctx, inst, Program, &rel_off)) return 1; - - /* And store it properly */ - *Index = src->param_binding_begin + rel_off; - *IsRelOffset = 1; - } - break; - } - break; - - default: - if (parse_param_use (ctx, inst, vc_head, Program, &src)) - return 1; - - *File = (enum register_file) src->param_binding_type; - *Index = src->param_binding_begin; - break; - } - break; - - case REGISTER_ESTABLISHED_NAME: - src = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!found) { - program_error(ctx, Program->Position, - "3: Undefined variable"); /* src->name */ - return 1; - } - - switch (src->type) { - case vt_attrib: - *File = PROGRAM_INPUT; - *Index = src->attrib_binding; - break; - - /* XXX: We have to handle offsets someplace in here! -- or are those above? */ - case vt_param: - *File = (enum register_file) src->param_binding_type; - *Index = src->param_binding_begin; - break; - - case vt_temp: - *File = PROGRAM_TEMPORARY; - *Index = src->temp_binding; - break; - - /* If the var type is vt_output no go */ - default: - program_error(ctx, Program->Position, - "destination register is read only"); - /* bad src->name */ - return 1; - } - break; - - default: - program_error(ctx, Program->Position, - "Unknown token in parse_src_reg"); - return 1; - } - - /* Add attributes to InputsRead only if they are used the program. - * This avoids the handling of unused ATTRIB declarations in the drivers. */ - if (*File == PROGRAM_INPUT) - Program->Base.InputsRead |= (1 << *Index); - - return 0; -} - - -/** - * Parse vertex/fragment program vector source register. - */ -static GLuint -parse_vector_src_reg(GLcontext *ctx, const GLubyte **inst, - struct var_cache **vc_head, - struct arb_program *program, - struct prog_src_register *reg) -{ - enum register_file file; - GLint index; - GLubyte negateMask; - GLubyte swizzle[4]; - GLboolean isRelOffset; - - /* Grab the sign */ - negateMask = (parse_sign (inst) == -1) ? NEGATE_XYZW : NEGATE_NONE; - - /* And the src reg */ - if (parse_src_reg(ctx, inst, vc_head, program, &file, &index, &isRelOffset)) - return 1; - - /* finally, the swizzle */ - parse_swizzle_mask(inst, swizzle, 4); - - reg->File = file; - reg->Index = index; - reg->Swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1], swizzle[2], swizzle[3]); - reg->NegateBase = negateMask; - reg->RelAddr = isRelOffset; - return 0; -} - - -/** - * Parse vertex/fragment program scalar source register. - */ -static GLuint -parse_scalar_src_reg(GLcontext *ctx, const GLubyte **inst, - struct var_cache **vc_head, - struct arb_program *program, - struct prog_src_register *reg) -{ - enum register_file file; - GLint index; - GLubyte negateMask; - GLubyte swizzle[4]; - GLboolean isRelOffset; - - /* Grab the sign */ - negateMask = (parse_sign (inst) == -1) ? NEGATE_XYZW : NEGATE_NONE; - - /* And the src reg */ - if (parse_src_reg(ctx, inst, vc_head, program, &file, &index, &isRelOffset)) - return 1; - - /* finally, the swizzle */ - parse_swizzle_mask(inst, swizzle, 1); - - reg->File = file; - reg->Index = index; - reg->Swizzle = (swizzle[0] << 0); - reg->NegateBase = negateMask; - reg->RelAddr = isRelOffset; - return 0; -} - - -/** - * Parse vertex/fragment program destination register. - * \return 1 if error, 0 if no error. - */ -static GLuint -parse_dst_reg(GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *program, - struct prog_dst_register *reg ) -{ - GLint mask; - GLuint idx; - enum register_file file; - - if (parse_masked_dst_reg (ctx, inst, vc_head, program, &file, &idx, &mask)) - return 1; - - reg->File = file; - reg->Index = idx; - reg->WriteMask = mask; - return 0; -} - - -/** - * This is a big mother that handles getting opcodes into the instruction - * and handling the src & dst registers for fragment program instructions - * \return 1 if error, 0 if no error - */ -static GLuint -parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - struct prog_instruction *fp) -{ - GLint a; - GLuint texcoord; - GLubyte instClass, type, code; - GLboolean rel; - GLuint shadow_tex = 0; - - _mesa_init_instructions(fp, 1); - - /* Record the position in the program string for debugging */ - fp->StringPos = Program->Position; - - /* OP_ALU_INST or OP_TEX_INST */ - instClass = *(*inst)++; - - /* OP_ALU_{VECTOR, SCALAR, BINSC, BIN, TRI, SWZ}, - * OP_TEX_{SAMPLE, KIL} - */ - type = *(*inst)++; - - /* The actual opcode name */ - code = *(*inst)++; - - /* Increment the correct count */ - switch (instClass) { - case OP_ALU_INST: - Program->NumAluInstructions++; - break; - case OP_TEX_INST: - Program->NumTexInstructions++; - break; - } - - switch (type) { - case OP_ALU_VECTOR: - switch (code) { - case OP_ABS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_ABS: - fp->Opcode = OPCODE_ABS; - break; - - case OP_FLR_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_FLR: - fp->Opcode = OPCODE_FLR; - break; - - case OP_FRC_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_FRC: - fp->Opcode = OPCODE_FRC; - break; - - case OP_LIT_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LIT: - fp->Opcode = OPCODE_LIT; - break; - - case OP_MOV_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MOV: - fp->Opcode = OPCODE_MOV; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - break; - - case OP_ALU_SCALAR: - switch (code) { - case OP_COS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_COS: - fp->Opcode = OPCODE_COS; - break; - - case OP_EX2_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_EX2: - fp->Opcode = OPCODE_EX2; - break; - - case OP_LG2_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LG2: - fp->Opcode = OPCODE_LG2; - break; - - case OP_RCP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_RCP: - fp->Opcode = OPCODE_RCP; - break; - - case OP_RSQ_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_RSQ: - fp->Opcode = OPCODE_RSQ; - break; - - case OP_SIN_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SIN: - fp->Opcode = OPCODE_SIN; - break; - - case OP_SCS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SCS: - - fp->Opcode = OPCODE_SCS; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - break; - - case OP_ALU_BINSC: - switch (code) { - case OP_POW_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_POW: - fp->Opcode = OPCODE_POW; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - - case OP_ALU_BIN: - switch (code) { - case OP_ADD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_ADD: - fp->Opcode = OPCODE_ADD; - break; - - case OP_DP3_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DP3: - fp->Opcode = OPCODE_DP3; - break; - - case OP_DP4_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DP4: - fp->Opcode = OPCODE_DP4; - break; - - case OP_DPH_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DPH: - fp->Opcode = OPCODE_DPH; - break; - - case OP_DST_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DST: - fp->Opcode = OPCODE_DST; - break; - - case OP_MAX_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MAX: - fp->Opcode = OPCODE_MAX; - break; - - case OP_MIN_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MIN: - fp->Opcode = OPCODE_MIN; - break; - - case OP_MUL_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MUL: - fp->Opcode = OPCODE_MUL; - break; - - case OP_SGE_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SGE: - fp->Opcode = OPCODE_SGE; - break; - - case OP_SLT_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SLT: - fp->Opcode = OPCODE_SLT; - break; - - case OP_SUB_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SUB: - fp->Opcode = OPCODE_SUB; - break; - - case OP_XPD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_XPD: - fp->Opcode = OPCODE_XPD; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - for (a = 0; a < 2; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_TRI: - switch (code) { - case OP_CMP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_CMP: - fp->Opcode = OPCODE_CMP; - break; - - case OP_LRP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LRP: - fp->Opcode = OPCODE_LRP; - break; - - case OP_MAD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MAD: - fp->Opcode = OPCODE_MAD; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - for (a = 0; a < 3; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_SWZ: - switch (code) { - case OP_SWZ_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SWZ: - fp->Opcode = OPCODE_SWZ; - break; - } - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - { - GLubyte swizzle[4]; - GLubyte negateMask; - enum register_file file; - GLint index; - - if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, &rel)) - return 1; - parse_extended_swizzle_mask(inst, swizzle, &negateMask); - fp->SrcReg[0].File = file; - fp->SrcReg[0].Index = index; - fp->SrcReg[0].NegateBase = negateMask; - fp->SrcReg[0].Swizzle = MAKE_SWIZZLE4(swizzle[0], - swizzle[1], - swizzle[2], - swizzle[3]); - } - break; - - case OP_TEX_SAMPLE: - switch (code) { - case OP_TEX_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TEX: - fp->Opcode = OPCODE_TEX; - break; - - case OP_TXP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TXP: - fp->Opcode = OPCODE_TXP; - break; - - case OP_TXB_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TXB: - fp->Opcode = OPCODE_TXB; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - - /* texImageUnit */ - if (parse_teximage_num (ctx, inst, Program, &texcoord)) - return 1; - fp->TexSrcUnit = texcoord; - - /* texTarget */ - switch (*(*inst)++) { - case TEXTARGET_SHADOW1D: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_1D: - fp->TexSrcTarget = TEXTURE_1D_INDEX; - break; - case TEXTARGET_SHADOW2D: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_2D: - fp->TexSrcTarget = TEXTURE_2D_INDEX; - break; - case TEXTARGET_3D: - fp->TexSrcTarget = TEXTURE_3D_INDEX; - break; - case TEXTARGET_SHADOWRECT: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_RECT: - fp->TexSrcTarget = TEXTURE_RECT_INDEX; - break; - case TEXTARGET_CUBE: - fp->TexSrcTarget = TEXTURE_CUBE_INDEX; - break; - case TEXTARGET_SHADOW1D_ARRAY: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_1D_ARRAY: - fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; - break; - case TEXTARGET_SHADOW2D_ARRAY: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_2D_ARRAY: - fp->TexSrcTarget = TEXTURE_2D_ARRAY_INDEX; - break; - } - - /* Don't test the first time a particular sampler is seen. Each time - * after that, make sure the shadow state is the same. - */ - if ((_mesa_bitcount(Program->TexturesUsed[texcoord]) > 0) - && ((Program->ShadowSamplers & (1 << texcoord)) != shadow_tex)) { - program_error(ctx, Program->Position, - "texture image unit used for shadow sampling and non-shadow sampling"); - return 1; - } - - Program->TexturesUsed[texcoord] |= (1 << fp->TexSrcTarget); - /* Check that both "2D" and "CUBE" (for example) aren't both used */ - if (_mesa_bitcount(Program->TexturesUsed[texcoord]) > 1) { - program_error(ctx, Program->Position, - "multiple targets used on one texture image unit"); - return 1; - } - - - Program->ShadowSamplers |= shadow_tex; - break; - - case OP_TEX_KIL: - Program->UsesKill = 1; - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - fp->Opcode = OPCODE_KIL; - break; - default: - _mesa_problem(ctx, "bad type 0x%x in parse_fp_instruction()", type); - return 1; - } - - return 0; -} - - -/** - * Handle the parsing out of a masked address register - * - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_vp_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, - struct prog_dst_register *reg) -{ - GLint idx; - - if (parse_address_reg (ctx, inst, vc_head, Program, &idx)) - return 1; - - /* This should be 0x8 */ - (*inst)++; - - reg->File = PROGRAM_ADDRESS; - reg->Index = idx; - - /* Writemask of .x is implied */ - reg->WriteMask = 0x1; - return 0; -} - - -/** - * This is a big mother that handles getting opcodes into the instruction - * and handling the src & dst registers for vertex program instructions - */ -static GLuint -parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - struct prog_instruction *vp) -{ - GLint a; - GLubyte type, code; - - /* OP_ALU_{ARL, VECTOR, SCALAR, BINSC, BIN, TRI, SWZ} */ - type = *(*inst)++; - - /* The actual opcode name */ - code = *(*inst)++; - - _mesa_init_instructions(vp, 1); - /* Record the position in the program string for debugging */ - vp->StringPos = Program->Position; - - switch (type) { - /* XXX: */ - case OP_ALU_ARL: - vp->Opcode = OPCODE_ARL; - - /* Remember to set SrcReg.RelAddr; */ - - /* Get the masked address register [dst] */ - if (parse_vp_address_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - vp->DstReg.File = PROGRAM_ADDRESS; - - /* Get a scalar src register */ - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - - break; - - case OP_ALU_VECTOR: - switch (code) { - case OP_ABS: - vp->Opcode = OPCODE_ABS; - break; - case OP_FLR: - vp->Opcode = OPCODE_FLR; - break; - case OP_FRC: - vp->Opcode = OPCODE_FRC; - break; - case OP_LIT: - vp->Opcode = OPCODE_LIT; - break; - case OP_MOV: - vp->Opcode = OPCODE_MOV; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - break; - - case OP_ALU_SCALAR: - switch (code) { - case OP_EX2: - vp->Opcode = OPCODE_EX2; - break; - case OP_EXP: - vp->Opcode = OPCODE_EXP; - break; - case OP_LG2: - vp->Opcode = OPCODE_LG2; - break; - case OP_LOG: - vp->Opcode = OPCODE_LOG; - break; - case OP_RCP: - vp->Opcode = OPCODE_RCP; - break; - case OP_RSQ: - vp->Opcode = OPCODE_RSQ; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - break; - - case OP_ALU_BINSC: - switch (code) { - case OP_POW: - vp->Opcode = OPCODE_POW; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_BIN: - switch (code) { - case OP_ADD: - vp->Opcode = OPCODE_ADD; - break; - case OP_DP3: - vp->Opcode = OPCODE_DP3; - break; - case OP_DP4: - vp->Opcode = OPCODE_DP4; - break; - case OP_DPH: - vp->Opcode = OPCODE_DPH; - break; - case OP_DST: - vp->Opcode = OPCODE_DST; - break; - case OP_MAX: - vp->Opcode = OPCODE_MAX; - break; - case OP_MIN: - vp->Opcode = OPCODE_MIN; - break; - case OP_MUL: - vp->Opcode = OPCODE_MUL; - break; - case OP_SGE: - vp->Opcode = OPCODE_SGE; - break; - case OP_SLT: - vp->Opcode = OPCODE_SLT; - break; - case OP_SUB: - vp->Opcode = OPCODE_SUB; - break; - case OP_XPD: - vp->Opcode = OPCODE_XPD; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_TRI: - switch (code) { - case OP_MAD: - vp->Opcode = OPCODE_MAD; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 3; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_SWZ: - switch (code) { - case OP_SWZ: - vp->Opcode = OPCODE_SWZ; - break; - } - { - GLubyte swizzle[4]; - GLubyte negateMask; - GLboolean relAddr; - enum register_file file; - GLint index; - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, &relAddr)) - return 1; - parse_extended_swizzle_mask (inst, swizzle, &negateMask); - vp->SrcReg[0].File = file; - vp->SrcReg[0].Index = index; - vp->SrcReg[0].NegateBase = negateMask; - vp->SrcReg[0].Swizzle = MAKE_SWIZZLE4(swizzle[0], - swizzle[1], - swizzle[2], - swizzle[3]); - vp->SrcReg[0].RelAddr = relAddr; - } - break; - } - return 0; -} - -#if DEBUG_PARSING - -static GLvoid -debug_variables (GLcontext * ctx, struct var_cache *vc_head, - struct arb_program *Program) -{ - struct var_cache *vc; - GLint a, b; - - fprintf (stderr, "debug_variables, vc_head: %p\n", (void*) vc_head); - - /* First of all, print out the contents of the var_cache */ - vc = vc_head; - while (vc) { - fprintf (stderr, "[%p]\n", (void*) vc); - switch (vc->type) { - case vt_none: - fprintf (stderr, "UNDEFINED %s\n", vc->name); - break; - case vt_attrib: - fprintf (stderr, "ATTRIB %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->attrib_binding); - break; - case vt_param: - fprintf (stderr, "PARAM %s begin: %d len: %d\n", vc->name, - vc->param_binding_begin, vc->param_binding_length); - b = vc->param_binding_begin; - for (a = 0; a < vc->param_binding_length; a++) { - fprintf (stderr, "%s\n", - Program->Base.Parameters->Parameters[a + b].Name); - if (Program->Base.Parameters->Parameters[a + b].Type == PROGRAM_STATE_VAR) { - const char *s; - s = _mesa_program_state_string(Program->Base.Parameters->Parameters - [a + b].StateIndexes); - fprintf(stderr, "%s\n", s); - _mesa_free((char *) s); - } - else - fprintf (stderr, "%f %f %f %f\n", - Program->Base.Parameters->ParameterValues[a + b][0], - Program->Base.Parameters->ParameterValues[a + b][1], - Program->Base.Parameters->ParameterValues[a + b][2], - Program->Base.Parameters->ParameterValues[a + b][3]); - } - break; - case vt_temp: - fprintf (stderr, "TEMP %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->temp_binding); - break; - case vt_output: - fprintf (stderr, "OUTPUT %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->output_binding); - break; - case vt_alias: - fprintf (stderr, "ALIAS %s\n", vc->name); - fprintf (stderr, " binding: 0x%p (%s)\n", - (void*) vc->alias_binding, vc->alias_binding->name); - break; - default: - /* nothing */ - ; - } - vc = vc->next; - } -} - -#endif /* DEBUG_PARSING */ - - -/** - * The main loop for parsing a fragment or vertex program - * - * \return 1 on error, 0 on success - */ -static GLint -parse_instructions(GLcontext * ctx, const GLubyte * inst, - struct var_cache **vc_head, struct arb_program *Program) -{ - const GLuint maxInst = (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - ? ctx->Const.FragmentProgram.MaxInstructions - : ctx->Const.VertexProgram.MaxInstructions; - GLint err = 0; - - ASSERT(MAX_INSTRUCTIONS >= maxInst); - - Program->MajorVersion = (GLuint) * inst++; - Program->MinorVersion = (GLuint) * inst++; - - while (*inst != END) { - switch (*inst++) { - - case OPTION: - switch (*inst++) { - case ARB_PRECISION_HINT_FASTEST: - Program->PrecisionOption = GL_FASTEST; - break; - - case ARB_PRECISION_HINT_NICEST: - Program->PrecisionOption = GL_NICEST; - break; - - case ARB_FOG_EXP: - Program->FogOption = GL_EXP; - break; - - case ARB_FOG_EXP2: - Program->FogOption = GL_EXP2; - break; - - case ARB_FOG_LINEAR: - Program->FogOption = GL_LINEAR; - break; - - case ARB_POSITION_INVARIANT: - if (Program->Base.Target == GL_VERTEX_PROGRAM_ARB) - Program->HintPositionInvariant = GL_TRUE; - break; - - case ARB_FRAGMENT_PROGRAM_SHADOW: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* TODO ARB_fragment_program_shadow code */ - } - break; - - case ARB_DRAW_BUFFERS: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* do nothing for now */ - } - break; - - case MESA_TEXTURE_ARRAY: - /* do nothing for now */ - break; - } - break; - - case INSTRUCTION: - /* check length */ - if (Program->Base.NumInstructions + 1 >= maxInst) { - program_error(ctx, Program->Position, - "Max instruction count exceeded"); - return 1; - } - Program->Position = parse_position (&inst); - /* parse the current instruction */ - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - err = parse_fp_instruction (ctx, &inst, vc_head, Program, - &Program->Base.Instructions[Program->Base.NumInstructions]); - } - else { - err = parse_vp_instruction (ctx, &inst, vc_head, Program, - &Program->Base.Instructions[Program->Base.NumInstructions]); - } - - /* increment instuction count */ - Program->Base.NumInstructions++; - break; - - case DECLARATION: - err = parse_declaration (ctx, &inst, vc_head, Program); - break; - - default: - break; - } - - if (err) - break; - } - - /* Finally, tag on an OPCODE_END instruction */ - { - const GLuint numInst = Program->Base.NumInstructions; - _mesa_init_instructions(Program->Base.Instructions + numInst, 1); - Program->Base.Instructions[numInst].Opcode = OPCODE_END; - /* YYY Wrong Position in program, whatever, at least not random -> crash - Program->Position = parse_position (&inst); - */ - Program->Base.Instructions[numInst].StringPos = Program->Position; - } - Program->Base.NumInstructions++; - - /* - * Initialize native counts to logical counts. The device driver may - * change them if program is translated into a hardware program. - */ - Program->Base.NumNativeInstructions = Program->Base.NumInstructions; - Program->Base.NumNativeTemporaries = Program->Base.NumTemporaries; - Program->Base.NumNativeParameters = Program->Base.NumParameters; - Program->Base.NumNativeAttributes = Program->Base.NumAttributes; - Program->Base.NumNativeAddressRegs = Program->Base.NumAddressRegs; - - return err; -} - - -/* XXX temporary */ -LONGSTRING static char core_grammar_text[] = -#include "shader/grammar/grammar_syn.h" -; - - -/** - * Set a grammar parameter. - * \param name the grammar parameter - * \param value the new parameter value - * \return 0 if OK, 1 if error - */ -static int -set_reg8 (GLcontext *ctx, grammar id, const char *name, GLubyte value) -{ - char error_msg[300]; - GLint error_pos; - - if (grammar_set_reg8 (id, (const byte *) name, value)) - return 0; - - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, "Grammar Register Error"); - return 1; -} - - -/** - * Enable support for the given language option in the parser. - * \return 1 if OK, 0 if error - */ -static int -enable_ext(GLcontext *ctx, grammar id, const char *name) -{ - return !set_reg8(ctx, id, name, 1); -} - - -/** - * Enable parser extensions based on which OpenGL extensions are supported - * by this rendering context. - * - * \return GL_TRUE if OK, GL_FALSE if error. - */ -static GLboolean -enable_parser_extensions(GLcontext *ctx, grammar id) -{ -#if 0 - /* These are not supported at this time */ - if ((ctx->Extensions.ARB_vertex_blend || - ctx->Extensions.EXT_vertex_weighting) - && !enable_ext(ctx, id, "vertex_blend")) - return GL_FALSE; - if (ctx->Extensions.ARB_matrix_palette - && !enable_ext(ctx, id, "matrix_palette")) - return GL_FALSE; -#endif - if (ctx->Extensions.ARB_fragment_program_shadow - && !enable_ext(ctx, id, "fragment_program_shadow")) - return GL_FALSE; - if (ctx->Extensions.EXT_point_parameters - && !enable_ext(ctx, id, "point_parameters")) - return GL_FALSE; - if (ctx->Extensions.EXT_secondary_color - && !enable_ext(ctx, id, "secondary_color")) - return GL_FALSE; - if (ctx->Extensions.EXT_fog_coord - && !enable_ext(ctx, id, "fog_coord")) - return GL_FALSE; - if (ctx->Extensions.NV_texture_rectangle - && !enable_ext(ctx, id, "texture_rectangle")) - return GL_FALSE; - if (ctx->Extensions.ARB_draw_buffers - && !enable_ext(ctx, id, "draw_buffers")) - return GL_FALSE; - if (ctx->Extensions.MESA_texture_array - && !enable_ext(ctx, id, "texture_array")) - return GL_FALSE; -#if 1 - /* hack for Warcraft (see bug 8060) */ - enable_ext(ctx, id, "vertex_blend"); -#endif - - return GL_TRUE; -} - - -/** - * This kicks everything off. - * - * \param ctx - The GL Context - * \param str - The program string - * \param len - The program string length - * \param program - The arb_program struct to return all the parsed info in - * \return GL_TRUE on sucess, GL_FALSE on error - */ -static GLboolean -_mesa_parse_arb_program(GLcontext *ctx, GLenum target, - const GLubyte *str, GLsizei len, - struct arb_program *program) -{ - GLint a, err, error_pos; - char error_msg[300]; - GLuint parsed_len; - struct var_cache *vc_head; - grammar arbprogram_syn_id; - GLubyte *parsed, *inst; - GLubyte *strz = NULL; - static int arbprogram_syn_is_ok = 0; /* XXX temporary */ - - /* set the program target before parsing */ - program->Base.Target = target; - - /* Reset error state */ - _mesa_set_program_error(ctx, -1, NULL); - - /* check if arb_grammar_text (arbprogram.syn) is syntactically correct */ - if (!arbprogram_syn_is_ok) { - /* One-time initialization of parsing system */ - grammar grammar_syn_id; - GLuint parsed_len; - - grammar_syn_id = grammar_load_from_text ((byte *) core_grammar_text); - if (grammar_syn_id == 0) { - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramStringARB(Error loading grammar rule set)"); - return GL_FALSE; - } - - err = !grammar_check(grammar_syn_id, (byte *) arb_grammar_text, - &parsed, &parsed_len); - - /* 'parsed' is unused here */ - _mesa_free (parsed); - parsed = NULL; - - /* NOTE: we can't destroy grammar_syn_id right here because - * grammar_destroy() can reset the last error - */ - if (err) { - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramString(Error loading grammar rule set"); - grammar_destroy (grammar_syn_id); - return GL_FALSE; - } - - grammar_destroy (grammar_syn_id); - - arbprogram_syn_is_ok = 1; - } - - /* create the grammar object */ - arbprogram_syn_id = grammar_load_from_text ((byte *) arb_grammar_text); - if (arbprogram_syn_id == 0) { - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - grammar_get_last_error ((GLubyte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramString(Error loading grammer rule set)"); - return GL_FALSE; - } - - /* Set program_target register value */ - if (set_reg8 (ctx, arbprogram_syn_id, "program_target", - program->Base.Target == GL_FRAGMENT_PROGRAM_ARB ? 0x10 : 0x20)) { - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - - if (!enable_parser_extensions(ctx, arbprogram_syn_id)) { - grammar_destroy(arbprogram_syn_id); - return GL_FALSE; - } - - /* check for NULL character occurences */ - { - GLint i; - for (i = 0; i < len; i++) { - if (str[i] == '\0') { - program_error(ctx, i, "illegal character"); - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - } - } - - /* copy the program string to a null-terminated string */ - strz = (GLubyte *) _mesa_malloc (len + 1); - if (!strz) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - _mesa_memcpy (strz, str, len); - strz[len] = '\0'; - - /* do a fast check on program string - initial production buffer is 4K */ - err = !grammar_fast_check(arbprogram_syn_id, strz, - &parsed, &parsed_len, 0x1000); - - /* Syntax parse error */ - if (err) { - grammar_get_last_error((GLubyte *) error_msg, 300, &error_pos); - program_error(ctx, error_pos, error_msg); - -#if DEBUG_PARSING - /* useful for debugging */ - do { - int line, col; - char *s; - fprintf(stderr, "program: %s\n", (char *) strz); - fprintf(stderr, "Error Pos: %d\n", ctx->Program.ErrorPos); - s = (char *) _mesa_find_line_column(strz, strz+ctx->Program.ErrorPos, - &line, &col); - fprintf(stderr, "line %d col %d: %s\n", line, col, s); - } while (0); -#endif - - _mesa_free(strz); - _mesa_free(parsed); - - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - - grammar_destroy (arbprogram_syn_id); - - /* - * Program string is syntactically correct at this point - * Parse the tokenized version of the program now, generating - * vertex/fragment program instructions. - */ - - /* Initialize the arb_program struct */ - program->Base.String = strz; - program->Base.Instructions = _mesa_alloc_instructions(MAX_INSTRUCTIONS); - program->Base.NumInstructions = - program->Base.NumTemporaries = - program->Base.NumParameters = - program->Base.NumAttributes = program->Base.NumAddressRegs = 0; - program->Base.Parameters = _mesa_new_parameter_list (); - program->Base.InputsRead = 0x0; - program->Base.OutputsWritten = 0x0; - program->Position = 0; - program->MajorVersion = program->MinorVersion = 0; - program->PrecisionOption = GL_DONT_CARE; - program->FogOption = GL_NONE; - program->HintPositionInvariant = GL_FALSE; - for (a = 0; a < MAX_TEXTURE_IMAGE_UNITS; a++) - program->TexturesUsed[a] = 0x0; - program->ShadowSamplers = 0x0; - program->NumAluInstructions = - program->NumTexInstructions = - program->NumTexIndirections = 0; - program->UsesKill = 0; - - vc_head = NULL; - err = GL_FALSE; - - /* Start examining the tokens in the array */ - inst = parsed; - - /* Check the grammer rev */ - if (*inst++ != REVISION) { - program_error (ctx, 0, "Grammar version mismatch"); - err = GL_TRUE; - } - else { - /* ignore program target */ - inst++; - err = parse_instructions(ctx, inst, &vc_head, program); - } - - /*debug_variables(ctx, vc_head, program); */ - - /* We're done with the parsed binary array */ - var_cache_destroy (&vc_head); - - _mesa_free (parsed); - - /* Reallocate the instruction array from size [MAX_INSTRUCTIONS] - * to size [ap.Base.NumInstructions]. - */ - program->Base.Instructions - = _mesa_realloc_instructions(program->Base.Instructions, - MAX_INSTRUCTIONS, - program->Base.NumInstructions); - - return !err; -} - - - -void -_mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, - const GLvoid *str, GLsizei len, - struct gl_fragment_program *program) -{ - struct arb_program ap; - GLuint i; - - ASSERT(target == GL_FRAGMENT_PROGRAM_ARB); - if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) { - /* Error in the program. Just return. */ - return; - } - - /* Copy the relevant contents of the arb_program struct into the - * fragment_program struct. - */ - program->Base.String = ap.Base.String; - program->Base.NumInstructions = ap.Base.NumInstructions; - program->Base.NumTemporaries = ap.Base.NumTemporaries; - program->Base.NumParameters = ap.Base.NumParameters; - program->Base.NumAttributes = ap.Base.NumAttributes; - program->Base.NumAddressRegs = ap.Base.NumAddressRegs; - program->Base.NumNativeInstructions = ap.Base.NumNativeInstructions; - program->Base.NumNativeTemporaries = ap.Base.NumNativeTemporaries; - program->Base.NumNativeParameters = ap.Base.NumNativeParameters; - program->Base.NumNativeAttributes = ap.Base.NumNativeAttributes; - program->Base.NumNativeAddressRegs = ap.Base.NumNativeAddressRegs; - program->Base.NumAluInstructions = ap.Base.NumAluInstructions; - program->Base.NumTexInstructions = ap.Base.NumTexInstructions; - program->Base.NumTexIndirections = ap.Base.NumTexIndirections; - program->Base.NumNativeAluInstructions = ap.Base.NumAluInstructions; - program->Base.NumNativeTexInstructions = ap.Base.NumTexInstructions; - program->Base.NumNativeTexIndirections = ap.Base.NumTexIndirections; - program->Base.InputsRead = ap.Base.InputsRead; - program->Base.OutputsWritten = ap.Base.OutputsWritten; - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) { - program->Base.TexturesUsed[i] = ap.TexturesUsed[i]; - if (ap.TexturesUsed[i]) - program->Base.SamplersUsed |= (1 << i); - } - program->Base.ShadowSamplers = ap.ShadowSamplers; - program->FogOption = ap.FogOption; - program->UsesKill = ap.UsesKill; - - if (program->FogOption) - program->Base.InputsRead |= FRAG_BIT_FOGC; - - if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); - program->Base.Instructions = ap.Base.Instructions; - - if (program->Base.Parameters) - _mesa_free_parameter_list(program->Base.Parameters); - program->Base.Parameters = ap.Base.Parameters; - -#if DEBUG_FP - _mesa_printf("____________Fragment program %u ________\n", program->Base.Id); - _mesa_print_program(&program->Base); -#endif -} - - - -/** - * Parse the vertex program string. If success, update the given - * vertex_program object with the new program. Else, leave the vertex_program - * object unchanged. - */ -void -_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, - const GLvoid *str, GLsizei len, - struct gl_vertex_program *program) -{ - struct arb_program ap; - - ASSERT(target == GL_VERTEX_PROGRAM_ARB); - - if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)"); - return; - } - - /* Copy the relevant contents of the arb_program struct into the - * vertex_program struct. - */ - program->Base.String = ap.Base.String; - program->Base.NumInstructions = ap.Base.NumInstructions; - program->Base.NumTemporaries = ap.Base.NumTemporaries; - program->Base.NumParameters = ap.Base.NumParameters; - program->Base.NumAttributes = ap.Base.NumAttributes; - program->Base.NumAddressRegs = ap.Base.NumAddressRegs; - program->Base.NumNativeInstructions = ap.Base.NumNativeInstructions; - program->Base.NumNativeTemporaries = ap.Base.NumNativeTemporaries; - program->Base.NumNativeParameters = ap.Base.NumNativeParameters; - program->Base.NumNativeAttributes = ap.Base.NumNativeAttributes; - program->Base.NumNativeAddressRegs = ap.Base.NumNativeAddressRegs; - program->Base.InputsRead = ap.Base.InputsRead; - program->Base.OutputsWritten = ap.Base.OutputsWritten; - program->IsPositionInvariant = ap.HintPositionInvariant; - - if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); - program->Base.Instructions = ap.Base.Instructions; - - if (program->Base.Parameters) - _mesa_free_parameter_list(program->Base.Parameters); - program->Base.Parameters = ap.Base.Parameters; - -#if DEBUG_VP - _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); - _mesa_print_program(&program->Base); -#endif -} diff --git a/src/libs/mesa/mesa/shader/arbprogparse.h b/src/libs/mesa/mesa/shader/arbprogparse.h deleted file mode 100644 index 980d39fb9f..0000000000 --- a/src/libs/mesa/mesa/shader/arbprogparse.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 ARBPROGPARSE_H -#define ARBPROGPARSE_H - -#include "main/mtypes.h" - -extern void -_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, - const GLvoid *str, GLsizei len, - struct gl_vertex_program *program); - -extern void -_mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target, - const GLvoid *str, GLsizei len, - struct gl_fragment_program *program); - -#endif diff --git a/src/libs/mesa/mesa/shader/arbprogram.c b/src/libs/mesa/mesa/shader/arbprogram.c deleted file mode 100644 index 7c2b747c43..0000000000 --- a/src/libs/mesa/mesa/shader/arbprogram.c +++ /dev/null @@ -1,1032 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file arbprogram.c - * ARB_vertex/fragment_program state management functions. - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "arbprogram.h" -#include "arbprogparse.h" -#include "program.h" - - - -/** - * Mixing ARB and NV vertex/fragment programs can be tricky. - * Note: GL_VERTEX_PROGRAM_ARB == GL_VERTEX_PROGRAM_NV - * but, GL_FRAGMENT_PROGRAM_ARB != GL_FRAGMENT_PROGRAM_NV - * The two different fragment program targets are supposed to be compatible - * to some extent (see GL_ARB_fragment_program spec). - * This function does the compatibility check. - */ -static GLboolean -compatible_program_targets(GLenum t1, GLenum t2) -{ - if (t1 == t2) - return GL_TRUE; - if (t1 == GL_FRAGMENT_PROGRAM_ARB && t2 == GL_FRAGMENT_PROGRAM_NV) - return GL_TRUE; - if (t1 == GL_FRAGMENT_PROGRAM_NV && t2 == GL_FRAGMENT_PROGRAM_ARB) - return GL_TRUE; - return GL_FALSE; -} - - -/** - * Bind a program (make it current) - * \note Called from the GL API dispatcher by both glBindProgramNV - * and glBindProgramARB. - */ -void GLAPIENTRY -_mesa_BindProgram(GLenum target, GLuint id) -{ - struct gl_program *curProg, *newProg; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - /* Error-check target and get curProg */ - if ((target == GL_VERTEX_PROGRAM_ARB) && /* == GL_VERTEX_PROGRAM_NV */ - (ctx->Extensions.NV_vertex_program || - ctx->Extensions.ARB_vertex_program)) { - curProg = &ctx->VertexProgram.Current->Base; - } - else if ((target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) || - (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program)) { - curProg = &ctx->FragmentProgram.Current->Base; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindProgramNV/ARB(target)"); - return; - } - - /* - * Get pointer to new program to bind. - * NOTE: binding to a non-existant program is not an error. - * That's supposed to be caught in glBegin. - */ - if (id == 0) { - /* Bind a default program */ - newProg = NULL; - if (target == GL_VERTEX_PROGRAM_ARB) /* == GL_VERTEX_PROGRAM_NV */ - newProg = &ctx->Shared->DefaultVertexProgram->Base; - else - newProg = &ctx->Shared->DefaultFragmentProgram->Base; - } - else { - /* Bind a user program */ - newProg = _mesa_lookup_program(ctx, id); - if (!newProg || newProg == &_mesa_DummyProgram) { - /* allocate a new program now */ - newProg = ctx->Driver.NewProgram(ctx, target, id); - if (!newProg) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindProgramNV/ARB"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, newProg); - } - else if (!compatible_program_targets(newProg->Target, target)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindProgramNV/ARB(target mismatch)"); - return; - } - } - - /** All error checking is complete now **/ - - if (curProg->Id == id) { - /* binding same program - no change */ - return; - } - - /* bind newProg */ - if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, - (struct gl_vertex_program *) newProg); - } - else if (target == GL_FRAGMENT_PROGRAM_NV || - target == GL_FRAGMENT_PROGRAM_ARB) { - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, - (struct gl_fragment_program *) newProg); - } - - /* Never null pointers */ - ASSERT(ctx->VertexProgram.Current); - ASSERT(ctx->FragmentProgram.Current); - - if (ctx->Driver.BindProgram) - ctx->Driver.BindProgram(ctx, target, newProg); -} - - -/** - * Delete a list of programs. - * \note Not compiled into display lists. - * \note Called by both glDeleteProgramsNV and glDeleteProgramsARB. - */ -void GLAPIENTRY -_mesa_DeletePrograms(GLsizei n, const GLuint *ids) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (n < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glDeleteProgramsNV" ); - return; - } - - for (i = 0; i < n; i++) { - if (ids[i] != 0) { - struct gl_program *prog = _mesa_lookup_program(ctx, ids[i]); - if (prog == &_mesa_DummyProgram) { - _mesa_HashRemove(ctx->Shared->Programs, ids[i]); - } - else if (prog) { - /* Unbind program if necessary */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB || /* == GL_VERTEX_PROGRAM_NV */ - prog->Target == GL_VERTEX_STATE_PROGRAM_NV) { - if (ctx->VertexProgram.Current && - ctx->VertexProgram.Current->Base.Id == ids[i]) { - /* unbind this currently bound program */ - _mesa_BindProgram(prog->Target, 0); - } - } - else if (prog->Target == GL_FRAGMENT_PROGRAM_NV || - prog->Target == GL_FRAGMENT_PROGRAM_ARB) { - if (ctx->FragmentProgram.Current && - ctx->FragmentProgram.Current->Base.Id == ids[i]) { - /* unbind this currently bound program */ - _mesa_BindProgram(prog->Target, 0); - } - } - else { - _mesa_problem(ctx, "bad target in glDeleteProgramsNV"); - return; - } - /* The ID is immediately available for re-use now */ - _mesa_HashRemove(ctx->Shared->Programs, ids[i]); - _mesa_reference_program(ctx, &prog, NULL); - } - } - } -} - - -/** - * Generate a list of new program identifiers. - * \note Not compiled into display lists. - * \note Called by both glGenProgramsNV and glGenProgramsARB. - */ -void GLAPIENTRY -_mesa_GenPrograms(GLsizei n, GLuint *ids) -{ - GLuint first; - GLuint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenPrograms"); - return; - } - - if (!ids) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->Programs, n); - - /* Insert pointer to dummy program as placeholder */ - for (i = 0; i < (GLuint) n; i++) { - _mesa_HashInsert(ctx->Shared->Programs, first + i, &_mesa_DummyProgram); - } - - /* Return the program names */ - for (i = 0; i < (GLuint) n; i++) { - ids[i] = first + i; - } -} - - -void GLAPIENTRY -_mesa_EnableVertexAttribArrayARB(GLuint index) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= ctx->Const.VertexProgram.MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glEnableVertexAttribArrayARB(index)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_ARRAY); - ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_TRUE; - ctx->Array.ArrayObj->_Enabled |= _NEW_ARRAY_ATTRIB(index); - ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index); -} - - -void GLAPIENTRY -_mesa_DisableVertexAttribArrayARB(GLuint index) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= ctx->Const.VertexProgram.MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glEnableVertexAttribArrayARB(index)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_ARRAY); - ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_FALSE; - ctx->Array.ArrayObj->_Enabled &= ~_NEW_ARRAY_ATTRIB(index); - ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index); -} - - -void GLAPIENTRY -_mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble *params) -{ - GLfloat fparams[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_GetVertexAttribfvARB(index, pname, fparams); - if (ctx->ErrorValue == GL_NO_ERROR) { - if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) { - COPY_4V(params, fparams); - } - else { - params[0] = fparams[0]; - } - } -} - - -void GLAPIENTRY -_mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)"); - return; - } - - switch (pname) { - case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Enabled; - break; - case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Size; - break; - case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Stride; - break; - case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type; - break; - case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized; - break; - case GL_CURRENT_VERTEX_ATTRIB_ARB: - if (index == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetVertexAttribfvARB(index==0)"); - return; - } - FLUSH_CURRENT(ctx, 0); - COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]); - break; - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - if (!ctx->Extensions.ARB_vertex_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribfvARB(pname)"); - return; - } - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribfvARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetVertexAttribivARB(GLuint index, GLenum pname, GLint *params) -{ - GLfloat fparams[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_GetVertexAttribfvARB(index, pname, fparams); - if (ctx->ErrorValue == GL_NO_ERROR) { - if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) { - COPY_4V_CAST(params, fparams, GLint); /* float to int */ - } - else { - params[0] = (GLint) fparams[0]; - } - } -} - - -void GLAPIENTRY -_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= ctx->Const.VertexProgram.MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerARB(index)"); - return; - } - - if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribPointerARB(pname)"); - return; - } - - *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[index].Ptr; -} - - -/** - * Determine if id names a vertex or fragment program. - * \note Not compiled into display lists. - * \note Called from both glIsProgramNV and glIsProgramARB. - * \param id is the program identifier - * \return GL_TRUE if id is a program, else GL_FALSE. - */ -GLboolean GLAPIENTRY -_mesa_IsProgramARB(GLuint id) -{ - struct gl_program *prog = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id == 0) - return GL_FALSE; - - prog = _mesa_lookup_program(ctx, id); - if (prog && (prog != &_mesa_DummyProgram)) - return GL_TRUE; - else - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, - const GLvoid *string) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (format != GL_PROGRAM_FORMAT_ASCII_ARB) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)"); - return; - } - - if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - struct gl_vertex_program *prog = ctx->VertexProgram.Current; - _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); - - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); - } - else if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - struct gl_fragment_program *prog = ctx->FragmentProgram.Current; - _mesa_parse_arb_fragment_program(ctx, target, string, len, prog); - - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)"); - return; - } -} - - -/** - * Set a program env parameter register. - * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterdNV) - */ -void GLAPIENTRY -_mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, - (GLfloat) z, (GLfloat) w); -} - - -/** - * Set a program env parameter register. - * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterdvNV) - */ -void GLAPIENTRY -_mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params) -{ - _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0], - (GLfloat) params[1], (GLfloat) params[2], - (GLfloat) params[3]); -} - - -/** - * Set a program env parameter register. - * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterfNV) - */ -void GLAPIENTRY -_mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - if (index >= ctx->Const.FragmentProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)"); - return; - } - ASSIGN_4V(ctx->FragmentProgram.Parameters[index], x, y, z, w); - } - else if (target == GL_VERTEX_PROGRAM_ARB /* == GL_VERTEX_PROGRAM_NV */ - && (ctx->Extensions.ARB_vertex_program || ctx->Extensions.NV_vertex_program)) { - if (index >= ctx->Const.VertexProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)"); - return; - } - ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameter(target)"); - return; - } -} - -/** - * Set a program env parameter register. - * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterfvNV) - */ -void GLAPIENTRY -_mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) -{ - _mesa_ProgramEnvParameter4fARB(target, index, params[0], params[1], - params[2], params[3]); -} - - -void GLAPIENTRY -_mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - GLfloat * dest; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (count <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(count)"); - } - - if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)"); - return; - } - dest = ctx->FragmentProgram.Parameters[index]; - } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)"); - return; - } - dest = ctx->VertexProgram.Parameters[index]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameters4fv(target)"); - return; - } - - for ( i = 0 ; i < count ; i++ ) { - COPY_4V(dest, params); - params += 4; - dest += 4; - } -} - - -void GLAPIENTRY -_mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, - GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat fparams[4]; - - _mesa_GetProgramEnvParameterfvARB(target, index, fparams); - if (ctx->ErrorValue == GL_NO_ERROR) { - params[0] = fparams[0]; - params[1] = fparams[1]; - params[2] = fparams[2]; - params[3] = fparams[3]; - } -} - - -void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, - GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - if (index >= ctx->Const.FragmentProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)"); - return; - } - COPY_4V(params, ctx->FragmentProgram.Parameters[index]); - } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - if (index >= ctx->Const.VertexProgram.MaxEnvParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)"); - return; - } - COPY_4V(params, ctx->VertexProgram.Parameters[index]); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramEnvParameter(target)"); - return; - } -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_program *prog; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if ((target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) || - (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program)) { - if (index >= ctx->Const.FragmentProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameterARB"); - return; - } - prog = &(ctx->FragmentProgram.Current->Base); - } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - if (index >= ctx->Const.VertexProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameterARB"); - return; - } - prog = &(ctx->VertexProgram.Current->Base); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameterARB"); - return; - } - - ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS); - prog->LocalParams[index][0] = x; - prog->LocalParams[index][1] = y; - prog->LocalParams[index][2] = z; - prog->LocalParams[index][3] = w; -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) -{ - _mesa_ProgramLocalParameter4fARB(target, index, params[0], params[1], - params[2], params[3]); -} - - -void GLAPIENTRY -_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_program *prog; - GLint i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (count <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fv(count)"); - } - - if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - if ((index + count) > ctx->Const.FragmentProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); - return; - } - prog = &(ctx->FragmentProgram.Current->Base); - } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - if ((index + count) > ctx->Const.VertexProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); - return; - } - prog = &(ctx->VertexProgram.Current->Base); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameters4fvEXT(target)"); - return; - } - - for (i = 0; i < count; i++) { - ASSERT((index + i) < MAX_PROGRAM_LOCAL_PARAMS); - COPY_4V(prog->LocalParams[index + i], params); - params += 4; - } -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, - GLdouble z, GLdouble w) -{ - _mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, - (GLfloat) z, (GLfloat) w); -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params) -{ - _mesa_ProgramLocalParameter4fARB(target, index, - (GLfloat) params[0], (GLfloat) params[1], - (GLfloat) params[2], (GLfloat) params[3]); -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, - GLfloat *params) -{ - const struct gl_program *prog; - GLuint maxParams; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - prog = &(ctx->VertexProgram.Current->Base); - maxParams = ctx->Const.VertexProgram.MaxLocalParams; - } - else if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - prog = &(ctx->FragmentProgram.Current->Base); - maxParams = ctx->Const.FragmentProgram.MaxLocalParams; - } - else if (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) { - prog = &(ctx->FragmentProgram.Current->Base); - maxParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramLocalParameterARB(target)"); - return; - } - - if (index >= maxParams) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramLocalParameterARB(index)"); - return; - } - - ASSERT(prog); - ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS); - COPY_4V(params, prog->LocalParams[index]); -} - - -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ -void GLAPIENTRY -_mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, - GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat floatParams[4]; - ASSIGN_4V(floatParams, 0.0F, 0.0F, 0.0F, 0.0F); - _mesa_GetProgramLocalParameterfvARB(target, index, floatParams); - if (ctx->ErrorValue == GL_NO_ERROR) { - COPY_4V(params, floatParams); - } -} - - -void GLAPIENTRY -_mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) -{ - const struct gl_program_constants *limits; - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - prog = &(ctx->VertexProgram.Current->Base); - limits = &ctx->Const.VertexProgram; - } - else if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - prog = &(ctx->FragmentProgram.Current->Base); - limits = &ctx->Const.FragmentProgram; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(target)"); - return; - } - - ASSERT(prog); - ASSERT(limits); - - /* Queries supported for both vertex and fragment programs */ - switch (pname) { - case GL_PROGRAM_LENGTH_ARB: - *params - = prog->String ? (GLint) _mesa_strlen((char *) prog->String) : 0; - return; - case GL_PROGRAM_FORMAT_ARB: - *params = prog->Format; - return; - case GL_PROGRAM_BINDING_ARB: - *params = prog->Id; - return; - case GL_PROGRAM_INSTRUCTIONS_ARB: - *params = prog->NumInstructions; - return; - case GL_MAX_PROGRAM_INSTRUCTIONS_ARB: - *params = limits->MaxInstructions; - return; - case GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB: - *params = prog->NumNativeInstructions; - return; - case GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB: - *params = limits->MaxNativeInstructions; - return; - case GL_PROGRAM_TEMPORARIES_ARB: - *params = prog->NumTemporaries; - return; - case GL_MAX_PROGRAM_TEMPORARIES_ARB: - *params = limits->MaxTemps; - return; - case GL_PROGRAM_NATIVE_TEMPORARIES_ARB: - *params = prog->NumNativeTemporaries; - return; - case GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB: - *params = limits->MaxNativeTemps; - return; - case GL_PROGRAM_PARAMETERS_ARB: - *params = prog->NumParameters; - return; - case GL_MAX_PROGRAM_PARAMETERS_ARB: - *params = limits->MaxParameters; - return; - case GL_PROGRAM_NATIVE_PARAMETERS_ARB: - *params = prog->NumNativeParameters; - return; - case GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB: - *params = limits->MaxNativeParameters; - return; - case GL_PROGRAM_ATTRIBS_ARB: - *params = prog->NumAttributes; - return; - case GL_MAX_PROGRAM_ATTRIBS_ARB: - *params = limits->MaxAttribs; - return; - case GL_PROGRAM_NATIVE_ATTRIBS_ARB: - *params = prog->NumNativeAttributes; - return; - case GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB: - *params = limits->MaxNativeAttribs; - return; - case GL_PROGRAM_ADDRESS_REGISTERS_ARB: - *params = prog->NumAddressRegs; - return; - case GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB: - *params = limits->MaxAddressRegs; - return; - case GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: - *params = prog->NumNativeAddressRegs; - return; - case GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: - *params = limits->MaxNativeAddressRegs; - return; - case GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB: - *params = limits->MaxLocalParams; - return; - case GL_MAX_PROGRAM_ENV_PARAMETERS_ARB: - *params = limits->MaxEnvParams; - return; - case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: - /* - * XXX we may not really need a driver callback here. - * If the number of native instructions, registers, etc. used - * are all below the maximums, we could return true. - * The spec says that even if this query returns true, there's - * no guarantee that the program will run in hardware. - */ - if (prog->Id == 0) { - /* default/null program */ - *params = GL_FALSE; - } - else if (ctx->Driver.IsProgramNative) { - /* ask the driver */ - *params = ctx->Driver.IsProgramNative( ctx, target, prog ); - } - else { - /* probably running in software */ - *params = GL_TRUE; - } - return; - default: - /* continue with fragment-program only queries below */ - break; - } - - /* - * The following apply to fragment programs only (at this time) - */ - if (target == GL_FRAGMENT_PROGRAM_ARB) { - const struct gl_fragment_program *fp = ctx->FragmentProgram.Current; - switch (pname) { - case GL_PROGRAM_ALU_INSTRUCTIONS_ARB: - *params = fp->Base.NumNativeAluInstructions; - return; - case GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: - *params = fp->Base.NumAluInstructions; - return; - case GL_PROGRAM_TEX_INSTRUCTIONS_ARB: - *params = fp->Base.NumTexInstructions; - return; - case GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: - *params = fp->Base.NumNativeTexInstructions; - return; - case GL_PROGRAM_TEX_INDIRECTIONS_ARB: - *params = fp->Base.NumTexIndirections; - return; - case GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: - *params = fp->Base.NumNativeTexIndirections; - return; - case GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB: - *params = limits->MaxAluInstructions; - return; - case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: - *params = limits->MaxNativeAluInstructions; - return; - case GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB: - *params = limits->MaxTexInstructions; - return; - case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: - *params = limits->MaxNativeTexInstructions; - return; - case GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB: - *params = limits->MaxTexIndirections; - return; - case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: - *params = limits->MaxNativeTexIndirections; - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(pname)"); - return; - } - } -} - - -void GLAPIENTRY -_mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) -{ - const struct gl_program *prog; - char *dst = (char *) string; - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_ARB) { - prog = &(ctx->VertexProgram.Current->Base); - } - else if (target == GL_FRAGMENT_PROGRAM_ARB) { - prog = &(ctx->FragmentProgram.Current->Base); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(target)"); - return; - } - - ASSERT(prog); - - if (pname != GL_PROGRAM_STRING_ARB) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(pname)"); - return; - } - - if (prog->String) - _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String)); - else - *dst = '\0'; -} diff --git a/src/libs/mesa/mesa/shader/arbprogram.h b/src/libs/mesa/mesa/shader/arbprogram.h deleted file mode 100644 index 6fe76267be..0000000000 --- a/src/libs/mesa/mesa/shader/arbprogram.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 ARBPROGRAM_H -#define ARBPROGRAM_H - - -extern void GLAPIENTRY -_mesa_BindProgram(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_DeletePrograms(GLsizei n, const GLuint *ids); - -extern void GLAPIENTRY -_mesa_GenPrograms(GLsizei n, GLuint *ids); - - -extern void GLAPIENTRY -_mesa_EnableVertexAttribArrayARB(GLuint index); - - -extern void GLAPIENTRY -_mesa_DisableVertexAttribArrayARB(GLuint index); - - -extern void GLAPIENTRY -_mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble *params); - - -extern void GLAPIENTRY -_mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params); - - -extern void GLAPIENTRY -_mesa_GetVertexAttribivARB(GLuint index, GLenum pname, GLint *params); - - -extern void GLAPIENTRY -_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer); - - -extern GLboolean GLAPIENTRY -_mesa_IsProgramARB(GLuint id); - - -extern void GLAPIENTRY -_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, - const GLvoid *string); - - -extern void GLAPIENTRY -_mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w); - - -extern void GLAPIENTRY -_mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params); - - -extern void GLAPIENTRY -_mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); - - -extern void GLAPIENTRY -_mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params); - - -extern void GLAPIENTRY -_mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params); - - -extern void GLAPIENTRY -_mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, - GLdouble z, GLdouble w); - - -extern void GLAPIENTRY -_mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params); - - -extern void GLAPIENTRY -_mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); - - -extern void GLAPIENTRY -_mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params); - - -extern void GLAPIENTRY -_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params); - - -extern void GLAPIENTRY -_mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, - GLdouble *params); - - -extern void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, - GLfloat *params); - - -extern void GLAPIENTRY -_mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, - GLdouble *params); - - -extern void GLAPIENTRY -_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, - GLfloat *params); - - -extern void GLAPIENTRY -_mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params); - - -extern void GLAPIENTRY -_mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string); - - -#endif diff --git a/src/libs/mesa/mesa/shader/arbprogram_syn.h b/src/libs/mesa/mesa/shader/arbprogram_syn.h deleted file mode 100644 index d95a5dede4..0000000000 --- a/src/libs/mesa/mesa/shader/arbprogram_syn.h +++ /dev/null @@ -1,1350 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -" \n" -".syntax program;\n" -".emtcode REVISION 0x0a\n" -".emtcode FRAGMENT_PROGRAM 0x01\n" -".emtcode VERTEX_PROGRAM 0x02\n" -".emtcode OPTION 0x01\n" -".emtcode INSTRUCTION 0x02\n" -".emtcode DECLARATION 0x03\n" -".emtcode END 0x04\n" -".emtcode ARB_PRECISION_HINT_FASTEST 0x00\n" -".emtcode ARB_PRECISION_HINT_NICEST 0x01\n" -".emtcode ARB_FOG_EXP 0x02\n" -".emtcode ARB_FOG_EXP2 0x03\n" -".emtcode ARB_FOG_LINEAR 0x04\n" -".emtcode ARB_POSITION_INVARIANT 0x05\n" -".emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x06\n" -".emtcode ARB_DRAW_BUFFERS 0x07\n" -".emtcode MESA_TEXTURE_ARRAY 0x08\n" -".emtcode OP_ALU_INST 0x00\n" -".emtcode OP_TEX_INST 0x01\n" -".emtcode OP_ALU_VECTOR 0x00\n" -".emtcode OP_ALU_SCALAR 0x01\n" -".emtcode OP_ALU_BINSC 0x02\n" -".emtcode OP_ALU_BIN 0x03\n" -".emtcode OP_ALU_TRI 0x04\n" -".emtcode OP_ALU_SWZ 0x05\n" -".emtcode OP_TEX_SAMPLE 0x06\n" -".emtcode OP_TEX_KIL 0x07\n" -".emtcode OP_ALU_ARL 0x08\n" -".emtcode OP_ABS 0x00\n" -".emtcode OP_ABS_SAT 0x1B\n" -".emtcode OP_FLR 0x09\n" -".emtcode OP_FLR_SAT 0x26\n" -".emtcode OP_FRC 0x0A\n" -".emtcode OP_FRC_SAT 0x27\n" -".emtcode OP_LIT 0x0C\n" -".emtcode OP_LIT_SAT 0x2A\n" -".emtcode OP_MOV 0x11\n" -".emtcode OP_MOV_SAT 0x30\n" -".emtcode OP_COS 0x1F\n" -".emtcode OP_COS_SAT 0x20\n" -".emtcode OP_EX2 0x07\n" -".emtcode OP_EX2_SAT 0x25\n" -".emtcode OP_LG2 0x0B\n" -".emtcode OP_LG2_SAT 0x29\n" -".emtcode OP_RCP 0x14\n" -".emtcode OP_RCP_SAT 0x33\n" -".emtcode OP_RSQ 0x15\n" -".emtcode OP_RSQ_SAT 0x34\n" -".emtcode OP_SIN 0x38\n" -".emtcode OP_SIN_SAT 0x39\n" -".emtcode OP_SCS 0x35\n" -".emtcode OP_SCS_SAT 0x36\n" -".emtcode OP_POW 0x13\n" -".emtcode OP_POW_SAT 0x32\n" -".emtcode OP_ADD 0x01\n" -".emtcode OP_ADD_SAT 0x1C\n" -".emtcode OP_DP3 0x03\n" -".emtcode OP_DP3_SAT 0x21\n" -".emtcode OP_DP4 0x04\n" -".emtcode OP_DP4_SAT 0x22\n" -".emtcode OP_DPH 0x05\n" -".emtcode OP_DPH_SAT 0x23\n" -".emtcode OP_DST 0x06\n" -".emtcode OP_DST_SAT 0x24\n" -".emtcode OP_MAX 0x0F\n" -".emtcode OP_MAX_SAT 0x2E\n" -".emtcode OP_MIN 0x10\n" -".emtcode OP_MIN_SAT 0x2F\n" -".emtcode OP_MUL 0x12\n" -".emtcode OP_MUL_SAT 0x31\n" -".emtcode OP_SGE 0x16\n" -".emtcode OP_SGE_SAT 0x37\n" -".emtcode OP_SLT 0x17\n" -".emtcode OP_SLT_SAT 0x3A\n" -".emtcode OP_SUB 0x18\n" -".emtcode OP_SUB_SAT 0x3B\n" -".emtcode OP_XPD 0x1A\n" -".emtcode OP_XPD_SAT 0x43\n" -".emtcode OP_CMP 0x1D\n" -".emtcode OP_CMP_SAT 0x1E\n" -".emtcode OP_LRP 0x2B\n" -".emtcode OP_LRP_SAT 0x2C\n" -".emtcode OP_MAD 0x0E\n" -".emtcode OP_MAD_SAT 0x2D\n" -".emtcode OP_SWZ 0x19\n" -".emtcode OP_SWZ_SAT 0x3C\n" -".emtcode OP_TEX 0x3D\n" -".emtcode OP_TEX_SAT 0x3E\n" -".emtcode OP_TXB 0x3F\n" -".emtcode OP_TXB_SAT 0x40\n" -".emtcode OP_TXP 0x41\n" -".emtcode OP_TXP_SAT 0x42\n" -".emtcode OP_KIL 0x28\n" -".emtcode OP_ARL 0x02\n" -".emtcode OP_EXP 0x08\n" -".emtcode OP_LOG 0x0D\n" -".emtcode FRAGMENT_ATTRIB_COLOR 0x01\n" -".emtcode FRAGMENT_ATTRIB_TEXCOORD 0x02\n" -".emtcode FRAGMENT_ATTRIB_FOGCOORD 0x03\n" -".emtcode FRAGMENT_ATTRIB_POSITION 0x04\n" -".emtcode VERTEX_ATTRIB_POSITION 0x01\n" -".emtcode VERTEX_ATTRIB_WEIGHT 0x02\n" -".emtcode VERTEX_ATTRIB_NORMAL 0x03\n" -".emtcode VERTEX_ATTRIB_COLOR 0x04\n" -".emtcode VERTEX_ATTRIB_FOGCOORD 0x05\n" -".emtcode VERTEX_ATTRIB_TEXCOORD 0x06\n" -".emtcode VERTEX_ATTRIB_MATRIXINDEX 0x07\n" -".emtcode VERTEX_ATTRIB_GENERIC 0x08\n" -".emtcode FRAGMENT_RESULT_COLOR 0x01\n" -".emtcode FRAGMENT_RESULT_DEPTH 0x02\n" -".emtcode VERTEX_RESULT_POSITION 0x01\n" -".emtcode VERTEX_RESULT_COLOR 0x02\n" -".emtcode VERTEX_RESULT_FOGCOORD 0x03\n" -".emtcode VERTEX_RESULT_POINTSIZE 0x04\n" -".emtcode VERTEX_RESULT_TEXCOORD 0x05\n" -".emtcode TEXTARGET_1D 0x01\n" -".emtcode TEXTARGET_2D 0x02\n" -".emtcode TEXTARGET_3D 0x03\n" -".emtcode TEXTARGET_RECT 0x04\n" -".emtcode TEXTARGET_CUBE 0x05\n" -".emtcode TEXTARGET_SHADOW1D 0x06\n" -".emtcode TEXTARGET_SHADOW2D 0x07\n" -".emtcode TEXTARGET_SHADOWRECT 0x08\n" -".emtcode TEXTARGET_1D_ARRAY 0x09\n" -".emtcode TEXTARGET_2D_ARRAY 0x0a\n" -".emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b\n" -".emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c\n" -".emtcode FACE_FRONT 0x00\n" -".emtcode FACE_BACK 0x01\n" -".emtcode COLOR_PRIMARY 0x00\n" -".emtcode COLOR_SECONDARY 0x01\n" -".emtcode COMPONENT_X 0x00\n" -".emtcode COMPONENT_Y 0x01\n" -".emtcode COMPONENT_Z 0x02\n" -".emtcode COMPONENT_W 0x03\n" -".emtcode COMPONENT_0 0x04\n" -".emtcode COMPONENT_1 0x05\n" -".emtcode ARRAY_INDEX_ABSOLUTE 0x00\n" -".emtcode ARRAY_INDEX_RELATIVE 0x01\n" -".emtcode MATRIX_MODELVIEW 0x01\n" -".emtcode MATRIX_PROJECTION 0x02\n" -".emtcode MATRIX_MVP 0x03\n" -".emtcode MATRIX_TEXTURE 0x04\n" -".emtcode MATRIX_PALETTE 0x05\n" -".emtcode MATRIX_PROGRAM 0x06\n" -".emtcode MATRIX_MODIFIER_IDENTITY 0x00\n" -".emtcode MATRIX_MODIFIER_INVERSE 0x01\n" -".emtcode MATRIX_MODIFIER_TRANSPOSE 0x02\n" -".emtcode MATRIX_MODIFIER_INVTRANS 0x03\n" -".emtcode CONSTANT_SCALAR 0x01\n" -".emtcode CONSTANT_VECTOR 0x02\n" -".emtcode PROGRAM_PARAM_ENV 0x01\n" -".emtcode PROGRAM_PARAM_LOCAL 0x02\n" -".emtcode REGISTER_ATTRIB 0x01\n" -".emtcode REGISTER_PARAM 0x02\n" -".emtcode REGISTER_RESULT 0x03\n" -".emtcode REGISTER_ESTABLISHED_NAME 0x04\n" -".emtcode PARAM_NULL 0x00\n" -".emtcode PARAM_ARRAY_ELEMENT 0x01\n" -".emtcode PARAM_STATE_ELEMENT 0x02\n" -".emtcode PARAM_PROGRAM_ELEMENT 0x03\n" -".emtcode PARAM_PROGRAM_ELEMENTS 0x04\n" -".emtcode PARAM_CONSTANT 0x05\n" -".emtcode STATE_MATERIAL 0x01\n" -".emtcode STATE_LIGHT 0x02\n" -".emtcode STATE_LIGHT_MODEL 0x03\n" -".emtcode STATE_LIGHT_PROD 0x04\n" -".emtcode STATE_FOG 0x05\n" -".emtcode STATE_MATRIX_ROWS 0x06\n" -".emtcode STATE_TEX_ENV 0x07\n" -".emtcode STATE_DEPTH 0x08\n" -".emtcode STATE_TEX_GEN 0x09\n" -".emtcode STATE_CLIP_PLANE 0x0A\n" -".emtcode STATE_POINT 0x0B\n" -".emtcode MATERIAL_AMBIENT 0x01\n" -".emtcode MATERIAL_DIFFUSE 0x02\n" -".emtcode MATERIAL_SPECULAR 0x03\n" -".emtcode MATERIAL_EMISSION 0x04\n" -".emtcode MATERIAL_SHININESS 0x05\n" -".emtcode LIGHT_AMBIENT 0x01\n" -".emtcode LIGHT_DIFFUSE 0x02\n" -".emtcode LIGHT_SPECULAR 0x03\n" -".emtcode LIGHT_POSITION 0x04\n" -".emtcode LIGHT_ATTENUATION 0x05\n" -".emtcode LIGHT_HALF 0x06\n" -".emtcode LIGHT_SPOT_DIRECTION 0x07\n" -".emtcode LIGHT_MODEL_AMBIENT 0x01\n" -".emtcode LIGHT_MODEL_SCENECOLOR 0x02\n" -".emtcode LIGHT_PROD_AMBIENT 0x01\n" -".emtcode LIGHT_PROD_DIFFUSE 0x02\n" -".emtcode LIGHT_PROD_SPECULAR 0x03\n" -".emtcode TEX_ENV_COLOR 0x01\n" -".emtcode TEX_GEN_EYE 0x01\n" -".emtcode TEX_GEN_OBJECT 0x02\n" -".emtcode FOG_COLOR 0x01\n" -".emtcode FOG_PARAMS 0x02\n" -".emtcode DEPTH_RANGE 0x01\n" -".emtcode POINT_SIZE 0x01\n" -".emtcode POINT_ATTENUATION 0x02\n" -".emtcode ATTRIB 0x01\n" -".emtcode PARAM 0x02\n" -".emtcode TEMP 0x03\n" -".emtcode OUTPUT 0x04\n" -".emtcode ALIAS 0x05\n" -".emtcode ADDRESS 0x06\n" -".errtext UNKNOWN_PROGRAM_SIGNATURE \"1001: '$e_signature$': unknown program signature\"\n" -".errtext MISSING_END_OR_INVALID_STATEMENT \"1002: '$e_statement$': invalid statement\"\n" -".errtext CODE_AFTER_END \"1003: '$e_statement$': code after 'END' keyword\"\n" -".errtext INVALID_PROGRAM_OPTION \"1004: '$e_identifier$': invalid program option\"\n" -".errtext EXT_SWIZ_COMP_EXPECTED \"1005: extended swizzle component expected but '$e_token$' found\"\n" -".errtext TEX_TARGET_EXPECTED \"1006: texture target expected but '$e_token$' found\"\n" -".errtext TEXTURE_EXPECTED \"1007: 'texture' expected but '$e_identifier$' found\"\n" -".errtext SOURCE_REGISTER_EXPECTED \"1008: source register expected but '$e_token$' found\"\n" -".errtext DESTINATION_REGISTER_EXPECTED \"1009: destination register expected but '$e_token$' found\"\n" -".errtext INVALID_ADDRESS_COMPONENT \"1010: '$e_identifier$': invalid address component\"\n" -".errtext INVALID_ADDRESS_WRITEMASK \"1011: '$e_identifier$': invalid address writemask\"\n" -".errtext INVALID_COMPONENT \"1012: '$e_charordigit$': invalid component\"\n" -".errtext INVALID_SUFFIX \"1013: '$e_identifier$': invalid suffix\"\n" -".errtext INVALID_WRITEMASK \"1014: '$e_identifier$': invalid writemask\"\n" -".errtext FRAGMENT_EXPECTED \"1015: 'fragment' expected but '$e_identifier$' found\"\n" -".errtext VERTEX_EXPECTED \"1016: 'vertex' expected but '$e_identifier$' found\"\n" -".errtext INVALID_FRAGMENT_PROPERTY \"1017: '$e_identifier$': invalid fragment property\"\n" -".errtext INVALID_VERTEX_PROPERTY \"1018: '$e_identifier$': invalid vertex property\"\n" -".errtext INVALID_STATE_PROPERTY \"1019: '$e_identifier$': invalid state property\"\n" -".errtext INVALID_MATERIAL_PROPERTY \"1020: '$e_identifier$': invalid material property\"\n" -".errtext INVALID_LIGHT_PROPERTY \"1021: '$e_identifier$': invalid light property\"\n" -".errtext INVALID_SPOT_PROPERTY \"1022: '$e_identifier$': invalid spot property\"\n" -".errtext INVALID_LIGHTMODEL_PROPERTY \"1023: '$e_identifier$': invalid light model property\"\n" -".errtext INVALID_LIGHTPROD_PROPERTY \"1024: '$e_identifier$': invalid light product property\"\n" -".errtext INVALID_TEXENV_PROPERTY \"1025: '$e_identifier$': invalid texture environment property\"\n" -".errtext INVALID_TEXGEN_PROPERTY \"1026: '$e_identifier$': invalid texture generating property\"\n" -".errtext INVALID_TEXGEN_COORD \"1027: '$e_identifier$': invalid texture generating coord\"\n" -".errtext INVALID_FOG_PROPERTY \"1028: '$e_identifier$': invalid fog property\"\n" -".errtext INVALID_DEPTH_PROPERTY \"1029: '$e_identifier$': invalid depth property\"\n" -".errtext INVALID_CLIPPLANE_PROPERTY \"1030: '$e_identifier$': invalid clip plane property\"\n" -".errtext INVALID_POINT_PROPERTY \"1031: '$e_identifier$': invalid point property\"\n" -".errtext MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED \"1032: matrix row selector or modifier expected but '$e_token$' found\"\n" -".errtext INVALID_MATRIX_NAME \"1033: '$e_identifier$': invalid matrix name\"\n" -".errtext INVALID_PROGRAM_PROPERTY \"1034: '$e_identifier$': invalid program property\"\n" -".errtext RESULT_EXPECTED \"1035: 'result' expected but '$e_token$' found\"\n" -".errtext INVALID_RESULT_PROPERTY \"1036: '$e_identifier$': invalid result property\"\n" -".errtext INVALID_FACE_PROPERTY \"1037: '$e_identifier$': invalid face property\"\n" -".errtext INVALID_COLOR_PROPERTY \"1038: '$e_identifier$': invalid color property\"\n" -".errtext IDENTIFIER_EXPECTED \"1039: identifier expected but '$e_token$' found\"\n" -".errtext RESERVED_KEYWORD \"1040: use of reserved keyword as an identifier\"\n" -".errtext INTEGER_EXPECTED \"1041: integer value expected but '$e_token$' found\"\n" -".errtext MISSING_SEMICOLON \"1042: ';' expected but '$e_token$' found\"\n" -".errtext MISSING_COMMA \"1043: ',' expected but '$e_token$' found\"\n" -".errtext MISSING_LBRACKET \"1044: '[' expected but '$e_token$' found\"\n" -".errtext MISSING_RBRACKET \"1045: ']' expected but '$e_token$' found\"\n" -".errtext MISSING_DOT \"1046: '.' expected but '$e_token$' found\"\n" -".errtext MISSING_EQUAL \"1047: '=' expected but '$e_token$' found\"\n" -".errtext MISSING_LBRACE \"1048: '{' expected but '$e_token$' found\"\n" -".errtext MISSING_RBRACE \"1049: '}' expected but '$e_token$' found\"\n" -".errtext MISSING_DOTDOT \"1050: '..' expected but '$e_token$' found\"\n" -".errtext MISSING_FRACTION_OR_EXPONENT \"1051: missing fraction part or exponent\"\n" -".errtext MISSING_DOT_OR_EXPONENT \"1052: missing '.' or exponent\"\n" -".errtext EXPONENT_VALUE_EXPECTED \"1053: exponent value expected\"\n" -".errtext INTEGER_OUT_OF_RANGE \"1054: integer value out of range\"\n" -".errtext OPERATION_NEEDS_DESTINATION_VARIABLE \"1055: operation needs destination variable\"\n" -".errtext OPERATION_NEEDS_SOURCE_VARIABLE \"1056: operation needs source variable\"\n" -".errtext ADDRESS_REGISTER_EXPECTED \"1057: address register expected but '$e_token$' found\"\n" -".errtext ADDRESS_REGISTER_OR_INTEGER_EXPECTED \"1058: address register or integer literal expected but '$e_token$' found\"\n" -".regbyte vertex_blend 0x00\n" -".regbyte matrix_palette 0x00\n" -".regbyte point_parameters 0x00\n" -".regbyte secondary_color 0x00\n" -".regbyte fog_coord 0x00\n" -".regbyte texture_rectangle 0x00\n" -".regbyte fragment_program_shadow 0x00\n" -".regbyte draw_buffers 0x00\n" -".regbyte texture_array 0x00\n" -".regbyte ARB_precision_hint_fastest 0x00\n" -".regbyte ARB_precision_hint_nicest 0x00\n" -".regbyte ARB_fog_exp 0x00\n" -".regbyte ARB_fog_exp2 0x00\n" -".regbyte ARB_fog_linear 0x00\n" -".regbyte ARB_position_invariant 0x00\n" -".regbyte ARB_fragment_program_shadow 0x00\n" -".regbyte ARB_draw_buffers 0x00\n" -".regbyte MESA_texture_array 0x00\n" -".regbyte program_target 0x00\n" -"program\n" -" programs .error UNKNOWN_PROGRAM_SIGNATURE .emit REVISION;\n" -"programs\n" -" .if (program_target == 0x10) frag_program_1_0 .emit FRAGMENT_PROGRAM .emit 0x01 .emit 0x00 .or\n" -" .if (program_target == 0x20) vert_program_1_0 .emit VERTEX_PROGRAM .emit 0x01 .emit 0x00;\n" -"frag_program_1_0\n" -" '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'f' .and 'p' .and '1' .and '.' .and '0' .and\n" -" optional_space .and fp_optionSequence .and fp_statementSequence .and\n" -" \"END\" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and\n" -" '\\0' .error CODE_AFTER_END;\n" -"vert_program_1_0\n" -" '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'v' .and 'p' .and '1' .and '.' .and '0' .and\n" -" optional_space .and vp_optionSequence .and vp_statementSequence .and\n" -" \"END\" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and\n" -" '\\0' .error CODE_AFTER_END;\n" -"fp_optionSequence\n" -" .loop fp_option;\n" -"vp_optionSequence\n" -" .loop vp_option;\n" -"fp_option\n" -" \"OPTION\" .emit OPTION .and space .error IDENTIFIER_EXPECTED .and\n" -" fp_optionString .error INVALID_PROGRAM_OPTION .and semicolon;\n" -"vp_option\n" -" \"OPTION\" .emit OPTION .and space .error IDENTIFIER_EXPECTED .and\n" -" vp_optionString .error INVALID_PROGRAM_OPTION .and semicolon;\n" -"fp_optionString\n" -" .if (ARB_precision_hint_nicest == 0x00) \"ARB_precision_hint_fastest\"\n" -" .emit ARB_PRECISION_HINT_FASTEST .load ARB_precision_hint_fastest 0x01 .or\n" -" .if (ARB_precision_hint_fastest == 0x00) \"ARB_precision_hint_nicest\"\n" -" .emit ARB_PRECISION_HINT_NICEST .load ARB_precision_hint_nicest 0x01 .or\n" -" fp_ARB_fog_exp .emit ARB_FOG_EXP .load ARB_fog_exp 0x01 .or\n" -" fp_ARB_fog_exp2 .emit ARB_FOG_EXP2 .load ARB_fog_exp2 0x01 .or\n" -" fp_ARB_fog_linear .emit ARB_FOG_LINEAR .load ARB_fog_linear 0x01 .or\n" -" .if (fragment_program_shadow != 0x00) \"ARB_fragment_program_shadow\"\n" -" .emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01 .or\n" -" .if (draw_buffers != 0x00) \"ARB_draw_buffers\" .emit ARB_DRAW_BUFFERS\n" -" .load ARB_draw_buffers 0x01 .or\n" -" .if (texture_array != 0x00) \"MESA_texture_array\" .emit MESA_TEXTURE_ARRAY\n" -" .load MESA_texture_array 0x01;\n" -"vp_optionString\n" -" \"ARB_position_invariant\" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01;\n" -"fp_ARB_fog_exp\n" -" .if (ARB_fog_exp2 == 0x00) .true .and .if (ARB_fog_linear == 0x00) \"ARB_fog_exp\";\n" -"fp_ARB_fog_exp2\n" -" .if (ARB_fog_exp == 0x00) .true .and .if (ARB_fog_linear == 0x00) \"ARB_fog_exp2\";\n" -"fp_ARB_fog_linear\n" -" .if (ARB_fog_exp == 0x00) .true .and .if (ARB_fog_exp2 == 0x00) \"ARB_fog_linear\";\n" -"fp_statementSequence\n" -" .loop fp_statement;\n" -"vp_statementSequence\n" -" .loop vp_statement;\n" -"fp_statement\n" -" fp_statement_1 .or fp_statement_2;\n" -"vp_statement\n" -" vp_statement_1 .or vp_statement_2;\n" -"fp_statement_1\n" -" fp_instruction .emit INSTRUCTION .emit $ .and semicolon;\n" -"fp_statement_2\n" -" fp_namingStatement .emit DECLARATION .and semicolon;\n" -"vp_statement_1\n" -" vp_instruction .emit INSTRUCTION .emit $ .and semicolon;\n" -"vp_statement_2\n" -" vp_namingStatement .emit DECLARATION .and semicolon;\n" -"fp_instruction\n" -" ALUInstruction .emit OP_ALU_INST .or\n" -" TexInstruction .emit OP_TEX_INST;\n" -"vp_instruction\n" -" ARL_instruction .emit OP_ALU_ARL .or\n" -" vp_VECTORop_instruction .emit OP_ALU_VECTOR .or\n" -" vp_SCALARop_instruction .emit OP_ALU_SCALAR .or\n" -" vp_BINSCop_instruction .emit OP_ALU_BINSC .or\n" -" vp_BINop_instruction .emit OP_ALU_BIN .or\n" -" vp_TRIop_instruction .emit OP_ALU_TRI .or\n" -" vp_SWZ_instruction .emit OP_ALU_SWZ;\n" -"ALUInstruction\n" -" fp_VECTORop_instruction .emit OP_ALU_VECTOR .or\n" -" fp_SCALARop_instruction .emit OP_ALU_SCALAR .or\n" -" fp_BINSCop_instruction .emit OP_ALU_BINSC .or\n" -" fp_BINop_instruction .emit OP_ALU_BIN .or\n" -" fp_TRIop_instruction .emit OP_ALU_TRI .or\n" -" fp_SWZ_instruction .emit OP_ALU_SWZ;\n" -"TexInstruction\n" -" SAMPLE_instruction .emit OP_TEX_SAMPLE .or\n" -" KIL_instruction .emit OP_TEX_KIL;\n" -"ARL_instruction\n" -" \"ARL\" .emit OP_ARL .and space_dst .and maskedAddrReg .and comma .and vp_scalarSrcReg;\n" -"fp_VECTORop_instruction\n" -" fp_VECTORop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg;\n" -"vp_VECTORop_instruction\n" -" vp_VECTORop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg;\n" -"fp_VECTORop\n" -" \"ABS\" .emit OP_ABS .or \"ABS_SAT\" .emit OP_ABS_SAT .or\n" -" \"FLR\" .emit OP_FLR .or \"FLR_SAT\" .emit OP_FLR_SAT .or\n" -" \"FRC\" .emit OP_FRC .or \"FRC_SAT\" .emit OP_FRC_SAT .or\n" -" \"LIT\" .emit OP_LIT .or \"LIT_SAT\" .emit OP_LIT_SAT .or\n" -" \"MOV\" .emit OP_MOV .or \"MOV_SAT\" .emit OP_MOV_SAT;\n" -"vp_VECTORop\n" -" \"ABS\" .emit OP_ABS .or\n" -" \"FLR\" .emit OP_FLR .or\n" -" \"FRC\" .emit OP_FRC .or\n" -" \"LIT\" .emit OP_LIT .or\n" -" \"MOV\" .emit OP_MOV;\n" -"fp_SCALARop_instruction\n" -" fp_SCALARop .and space_dst .and fp_maskedDstReg .and comma .and fp_scalarSrcReg;\n" -"vp_SCALARop_instruction\n" -" vp_SCALARop .and space_dst .and vp_maskedDstReg .and comma .and vp_scalarSrcReg;\n" -"fp_SCALARop\n" -" \"COS\" .emit OP_COS .or \"COS_SAT\" .emit OP_COS_SAT .or\n" -" \"EX2\" .emit OP_EX2 .or \"EX2_SAT\" .emit OP_EX2_SAT .or\n" -" \"LG2\" .emit OP_LG2 .or \"LG2_SAT\" .emit OP_LG2_SAT .or\n" -" \"RCP\" .emit OP_RCP .or \"RCP_SAT\" .emit OP_RCP_SAT .or\n" -" \"RSQ\" .emit OP_RSQ .or \"RSQ_SAT\" .emit OP_RSQ_SAT .or\n" -" \"SIN\" .emit OP_SIN .or \"SIN_SAT\" .emit OP_SIN_SAT .or\n" -" \"SCS\" .emit OP_SCS .or \"SCS_SAT\" .emit OP_SCS_SAT;\n" -"vp_SCALARop\n" -" \"EX2\" .emit OP_EX2 .or\n" -" \"EXP\" .emit OP_EXP .or\n" -" \"LG2\" .emit OP_LG2 .or\n" -" \"LOG\" .emit OP_LOG .or\n" -" \"RCP\" .emit OP_RCP .or\n" -" \"RSQ\" .emit OP_RSQ;\n" -"fp_BINSCop_instruction\n" -" fp_BINSCop .and space_dst .and fp_maskedDstReg .and comma .and fp_scalarSrcReg .and comma .and\n" -" fp_scalarSrcReg;\n" -"vp_BINSCop_instruction\n" -" vp_BINSCop .and space_dst .and vp_maskedDstReg .and comma .and vp_scalarSrcReg .and comma .and\n" -" vp_scalarSrcReg;\n" -"fp_BINSCop\n" -" \"POW\" .emit OP_POW .or \"POW_SAT\" .emit OP_POW_SAT;\n" -"vp_BINSCop\n" -" \"POW\" .emit OP_POW;\n" -"fp_BINop_instruction\n" -" fp_BINop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and\n" -" vectorSrcReg;\n" -"vp_BINop_instruction\n" -" vp_BINop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg .and comma .and\n" -" swizzleSrcReg;\n" -"fp_BINop\n" -" \"ADD\" .emit OP_ADD .or \"ADD_SAT\" .emit OP_ADD_SAT .or\n" -" \"DP3\" .emit OP_DP3 .or \"DP3_SAT\" .emit OP_DP3_SAT .or\n" -" \"DP4\" .emit OP_DP4 .or \"DP4_SAT\" .emit OP_DP4_SAT .or\n" -" \"DPH\" .emit OP_DPH .or \"DPH_SAT\" .emit OP_DPH_SAT .or\n" -" \"DST\" .emit OP_DST .or \"DST_SAT\" .emit OP_DST_SAT .or\n" -" \"MAX\" .emit OP_MAX .or \"MAX_SAT\" .emit OP_MAX_SAT .or\n" -" \"MIN\" .emit OP_MIN .or \"MIN_SAT\" .emit OP_MIN_SAT .or\n" -" \"MUL\" .emit OP_MUL .or \"MUL_SAT\" .emit OP_MUL_SAT .or\n" -" \"SGE\" .emit OP_SGE .or \"SGE_SAT\" .emit OP_SGE_SAT .or\n" -" \"SLT\" .emit OP_SLT .or \"SLT_SAT\" .emit OP_SLT_SAT .or\n" -" \"SUB\" .emit OP_SUB .or \"SUB_SAT\" .emit OP_SUB_SAT .or\n" -" \"XPD\" .emit OP_XPD .or \"XPD_SAT\" .emit OP_XPD_SAT;\n" -"vp_BINop\n" -" \"ADD\" .emit OP_ADD .or\n" -" \"DP3\" .emit OP_DP3 .or\n" -" \"DP4\" .emit OP_DP4 .or\n" -" \"DPH\" .emit OP_DPH .or\n" -" \"DST\" .emit OP_DST .or\n" -" \"MAX\" .emit OP_MAX .or\n" -" \"MIN\" .emit OP_MIN .or\n" -" \"MUL\" .emit OP_MUL .or\n" -" \"SGE\" .emit OP_SGE .or\n" -" \"SLT\" .emit OP_SLT .or\n" -" \"SUB\" .emit OP_SUB .or\n" -" \"XPD\" .emit OP_XPD;\n" -"fp_TRIop_instruction\n" -" fp_TRIop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and\n" -" vectorSrcReg .and comma .and vectorSrcReg;\n" -"vp_TRIop_instruction\n" -" vp_TRIop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg .and comma .and\n" -" swizzleSrcReg .and comma .and swizzleSrcReg;\n" -"fp_TRIop\n" -" \"CMP\" .emit OP_CMP .or \"CMP_SAT\" .emit OP_CMP_SAT .or\n" -" \"LRP\" .emit OP_LRP .or \"LRP_SAT\" .emit OP_LRP_SAT .or\n" -" \"MAD\" .emit OP_MAD .or \"MAD_SAT\" .emit OP_MAD_SAT;\n" -"vp_TRIop\n" -" \"MAD\" .emit OP_MAD;\n" -"fp_SWZ_instruction\n" -" SWZop .and space_dst .and fp_maskedDstReg .and comma .and fp_srcReg .and comma .and\n" -" fp_extendedSwizzle .error EXT_SWIZ_COMP_EXPECTED;\n" -"vp_SWZ_instruction\n" -" \"SWZ\" .emit OP_SWZ .and space_dst .and vp_maskedDstReg .and comma .and vp_srcReg .and comma .and\n" -" vp_extendedSwizzle .error EXT_SWIZ_COMP_EXPECTED;\n" -"SWZop\n" -" \"SWZ\" .emit OP_SWZ .or \"SWZ_SAT\" .emit OP_SWZ_SAT;\n" -"SAMPLE_instruction\n" -" SAMPLEop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and\n" -" texImageUnit .and comma .and texTarget .error TEX_TARGET_EXPECTED;\n" -"SAMPLEop\n" -" \"TEX\" .emit OP_TEX .or \"TEX_SAT\" .emit OP_TEX_SAT .or\n" -" \"TXB\" .emit OP_TXB .or \"TXB_SAT\" .emit OP_TXB_SAT .or\n" -" \"TXP\" .emit OP_TXP .or \"TXP_SAT\" .emit OP_TXP_SAT;\n" -"KIL_instruction\n" -" \"KIL\" .emit OP_KIL .and space_src .and vectorSrcReg;\n" -"texImageUnit\n" -" \"texture\" .error TEXTURE_EXPECTED .and optTexImageUnitNum;\n" -"texTarget\n" -" \"1D\" .emit TEXTARGET_1D .or\n" -" \"2D\" .emit TEXTARGET_2D .or\n" -" \"3D\" .emit TEXTARGET_3D .or\n" -" .if (texture_rectangle != 0x00) \"RECT\" .emit TEXTARGET_RECT .or\n" -" \"CUBE\" .emit TEXTARGET_CUBE .or\n" -" .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or\n" -" .if (MESA_texture_array != 0x00) arrayTarget;\n" -"shadowTarget\n" -" \"SHADOW1D\" .emit TEXTARGET_SHADOW1D .or\n" -" \"SHADOW2D\" .emit TEXTARGET_SHADOW2D .or\n" -" .if (texture_rectangle != 0x00) \"SHADOWRECT\" .emit TEXTARGET_SHADOWRECT .or\n" -" .if (MESA_texture_array != 0x00) shadowArrayTarget;\n" -"arrayTarget\n" -" \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" -" \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" -"shadowArrayTarget\n" -" \"SHADOWARRAY1D\" .emit TEXTARGET_SHADOW1D_ARRAY .or\n" -" \"SHADOWARRAY2D\" .emit TEXTARGET_SHADOW2D_ARRAY;\n" -"optTexImageUnitNum\n" -" optTexImageUnitNum_1 .or .true .emit 0x00;\n" -"optTexImageUnitNum_1\n" -" lbracket_ne .and texImageUnitNum .and rbracket;\n" -"texImageUnitNum\n" -" integer;\n" -"fp_scalarSrcReg\n" -" optionalSign .and fp_srcReg .and fp_scalarSuffix;\n" -"vp_scalarSrcReg\n" -" optionalSign .and vp_srcReg .and vp_scalarSuffix;\n" -"swizzleSrcReg\n" -" optionalSign .and vp_srcReg .and swizzleSuffix;\n" -"vectorSrcReg\n" -" optionalSign .and fp_srcReg .and optionalSuffix;\n" -"fp_maskedDstReg\n" -" fp_dstReg .and fp_optionalMask;\n" -"vp_maskedDstReg\n" -" vp_dstReg .and vp_optionalMask;\n" -"maskedAddrReg\n" -" addrReg .error ADDRESS_REGISTER_EXPECTED .and addrWriteMask;\n" -"fp_extendedSwizzle\n" -" rgbaExtendedSwizzle .or xyzwExtendedSwizzle;\n" -"vp_extendedSwizzle\n" -" extSwizComp .and comma .and\n" -" extSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" extSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" extSwizComp .error EXT_SWIZ_COMP_EXPECTED;\n" -"xyzwExtendedSwizzle\n" -" xyzwExtSwizComp .and comma .and\n" -" xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;\n" -"rgbaExtendedSwizzle\n" -" rgbaExtendedSwizzle_1 .or rgbaExtendedSwizzle_2 .or rgbaExtendedSwizzle_3 .or\n" -" rgbaExtendedSwizzle_4;\n" -"rgbaExtendedSwizzle_1\n" -" rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_digit .and comma .and\n" -" rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp;\n" -"rgbaExtendedSwizzle_2\n" -" rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_digit .and comma .and\n" -" rgbaExtSwizComp_alpha .and comma .and rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;\n" -"rgbaExtendedSwizzle_3\n" -" rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_alpha .and comma .and\n" -" rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;\n" -"rgbaExtendedSwizzle_4\n" -" rgbaExtSwizComp_alpha .and comma .and \n" -"rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and\n" -" rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;\n" -"xyzwExtSwizComp\n" -" optionalSign .and xyzwExtSwizSel;\n" -"rgbaExtSwizComp\n" -" optionalSign .and rgbaExtSwizSel;\n" -"rgbaExtSwizComp_digit\n" -" optionalSign .and rgbaExtSwizSel_digit;\n" -"rgbaExtSwizComp_alpha\n" -" optionalSign .and rgbaExtSwizSel_alpha;\n" -"extSwizComp\n" -" optionalSign .and extSwizSel;\n" -"xyzwExtSwizSel\n" -" \"0\" .emit COMPONENT_0 .or \"1\" .emit COMPONENT_1 .or xyzwComponent_single;\n" -"rgbaExtSwizSel\n" -" rgbaExtSwizSel_digit .or rgbaExtSwizSel_alpha;\n" -"rgbaExtSwizSel_digit\n" -" \"0\" .emit COMPONENT_0 .or \"1\" .emit COMPONENT_1;\n" -"rgbaExtSwizSel_alpha\n" -" rgbaComponent_single;\n" -"extSwizSel\n" -" \"0\" .emit COMPONENT_0 .or \"1\" .emit COMPONENT_1 .or vp_component_single;\n" -"fp_srcReg\n" -" fp_srcReg_1 .error SOURCE_REGISTER_EXPECTED;\n" -"vp_srcReg\n" -" vp_srcReg_1 .error SOURCE_REGISTER_EXPECTED;\n" -"fp_srcReg_1\n" -" fragmentAttribReg .emit REGISTER_ATTRIB .or\n" -" fp_progParamReg .emit REGISTER_PARAM .or\n" -" fp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;\n" -"vp_srcReg_1\n" -" vertexAttribReg .emit REGISTER_ATTRIB .or\n" -" vp_progParamReg .emit REGISTER_PARAM .or\n" -" vp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;\n" -"fp_dstReg\n" -" fp_dstReg_1 .error DESTINATION_REGISTER_EXPECTED;\n" -"vp_dstReg\n" -" vp_dstReg_1 .error DESTINATION_REGISTER_EXPECTED;\n" -"fp_dstReg_1\n" -" fragmentResultReg .emit REGISTER_RESULT .or\n" -" fp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;\n" -"vp_dstReg_1\n" -" vertexResultReg .emit REGISTER_RESULT .or\n" -" vp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;\n" -"fragmentAttribReg\n" -" fragAttribBinding;\n" -"vertexAttribReg\n" -" vtxAttribBinding;\n" -"fp_temporaryReg\n" -" fp_establishedName_no_error_on_identifier;\n" -"vp_temporaryReg\n" -" vp_establishedName_no_error_on_identifier;\n" -"fp_progParamReg\n" -" fp_paramSingleItemUse .or fp_progParamReg_1 .or fp_progParamSingle;\n" -"vp_progParamReg\n" -" vp_paramSingleItemUse .or vp_progParamReg_1 .or vp_progParamSingle;\n" -"fp_progParamReg_1\n" -" fp_progParamArray .emit PARAM_ARRAY_ELEMENT .and lbracket_ne .and progParamArrayAbs .and\n" -" rbracket;\n" -"vp_progParamReg_1\n" -" vp_progParamArray .emit PARAM_ARRAY_ELEMENT .and lbracket_ne .and progParamArrayMem .and\n" -" rbracket;\n" -"fp_progParamSingle\n" -" .false;\n" -"vp_progParamSingle\n" -" .false;\n" -"fp_progParamArray\n" -" fp_establishedName_no_error_on_identifier;\n" -"vp_progParamArray\n" -" vp_establishedName_no_error_on_identifier;\n" -"progParamArrayMem\n" -" progParamArrayAbs .or progParamArrayRel;\n" -"progParamArrayAbs\n" -" integer_ne .emit ARRAY_INDEX_ABSOLUTE;\n" -"progParamArrayRel\n" -" addrReg .error ADDRESS_REGISTER_OR_INTEGER_EXPECTED .emit ARRAY_INDEX_RELATIVE .and\n" -" addrComponent .and addrRegRelOffset;\n" -"addrRegRelOffset\n" -" addrRegRelOffset_1 .or addrRegRelOffset_2 .or .true .emit 0x00;\n" -"addrRegRelOffset_1\n" -" plus_ne .and addrRegPosOffset;\n" -"addrRegRelOffset_2\n" -" minus_ne .and addrRegNegOffset;\n" -"addrRegPosOffset\n" -" integer_0_63;\n" -"addrRegNegOffset\n" -" integer_0_64;\n" -"fragmentResultReg\n" -" fp_resultBinding;\n" -"vertexResultReg\n" -" vp_resultBinding;\n" -"addrReg\n" -" vp_establishedName_no_error_on_identifier;\n" -"addrComponent\n" -" dot .and \"x\" .error INVALID_ADDRESS_COMPONENT .emit COMPONENT_X .emit COMPONENT_X\n" -" .emit COMPONENT_X .emit COMPONENT_X;\n" -"addrWriteMask\n" -" dot .and \"x\" .error INVALID_ADDRESS_WRITEMASK .emit 0x08;\n" -"fp_scalarSuffix\n" -" dot .and fp_component_single .error INVALID_COMPONENT;\n" -"vp_scalarSuffix\n" -" dot .and vp_component_single .error INVALID_COMPONENT;\n" -"swizzleSuffix\n" -" swizzleSuffix_1 .or\n" -" .true .emit COMPONENT_X .emit COMPONENT_Y .emit COMPONENT_Z .emit COMPONENT_W;\n" -"swizzleSuffix_1\n" -" dot_ne .and swizzleSuffix_2 .error INVALID_SUFFIX;\n" -"swizzleSuffix_2\n" -" swizzleSuffix_3 .or swizzleSuffix_4;\n" -"swizzleSuffix_3\n" -" vp_component_multi .and vp_component_multi .and vp_component_multi .error INVALID_COMPONENT .and\n" -" vp_component_multi .error INVALID_COMPONENT;\n" -"swizzleSuffix_4\n" -" \"x\" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or\n" -" \"y\" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or\n" -" \"z\" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or\n" -" \"w\" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W;\n" -"optionalSuffix\n" -" optionalSuffix_1 .or\n" -" .true .emit COMPONENT_X .emit COMPONENT_Y .emit COMPONENT_Z .emit COMPONENT_W;\n" -"optionalSuffix_1\n" -" dot_ne .and optionalSuffix_2 .error INVALID_SUFFIX;\n" -"optionalSuffix_2\n" -" optionalSuffix_3 .or optionalSuffix_4 .or optionalSuffix_5;\n" -"optionalSuffix_3\n" -" xyzwComponent_multi .and xyzwComponent_multi .and\n" -" xyzwComponent_multi .error INVALID_COMPONENT .and xyzwComponent_multi .error INVALID_COMPONENT;\n" -"optionalSuffix_4\n" -" rgbaComponent_multi .and rgbaComponent_multi .and\n" -" rgbaComponent_multi .error INVALID_COMPONENT .and rgbaComponent_multi .error INVALID_COMPONENT;\n" -"optionalSuffix_5\n" -" \"x\" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or\n" -" \"y\" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or\n" -" \"z\" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or\n" -" \"w\" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .or\n" -" \"r\" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or\n" -" \"g\" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or\n" -" \"b\" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or\n" -" \"a\" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W;\n" -"fp_component_single\n" -" xyzwComponent_single .or rgbaComponent_single;\n" -"vp_component_multi\n" -" 'x' .emit COMPONENT_X .or 'y' .emit COMPONENT_Y .or 'z' .emit COMPONENT_Z .or\n" -" 'w' .emit COMPONENT_W;\n" -"vp_component_single\n" -" \"x\" .emit COMPONENT_X .or \"y\" .emit COMPONENT_Y .or \"z\" .emit COMPONENT_Z .or\n" -" \"w\" .emit COMPONENT_W;\n" -"xyzwComponent_multi\n" -" 'x' .emit COMPONENT_X .or 'y' .emit COMPONENT_Y .or 'z' .emit COMPONENT_Z .or\n" -" 'w' .emit COMPONENT_W;\n" -"xyzwComponent_single\n" -" \"x\" .emit COMPONENT_X .or \"y\" .emit COMPONENT_Y .or \"z\" .emit COMPONENT_Z .or\n" -" \"w\" .emit COMPONENT_W;\n" -"rgbaComponent_multi\n" -" 'r' .emit COMPONENT_X .or 'g' .emit COMPONENT_Y .or 'b' .emit COMPONENT_Z .or\n" -" 'a' .emit COMPONENT_W;\n" -"rgbaComponent_single\n" -" \"r\" .emit COMPONENT_X .or \"g\" .emit COMPONENT_Y .or \"b\" .emit COMPONENT_Z .or\n" -" \"a\" .emit COMPONENT_W;\n" -"fp_optionalMask\n" -" rgbaMask .or xyzwMask .or .true .emit 0x0F;\n" -"vp_optionalMask\n" -" xyzwMask .or .true .emit 0x0F;\n" -"xyzwMask\n" -" dot_ne .and xyzwMask_1 .error INVALID_WRITEMASK;\n" -"xyzwMask_1\n" -" \"xyzw\" .emit 0x0F .or \"xyz\" .emit 0x0E .or \"xyw\" .emit 0x0D .or \"xy\" .emit 0x0C .or\n" -" \"xzw\" .emit 0x0B .or \"xz\" .emit 0x0A .or \"xw\" .emit 0x09 .or \"x\" .emit 0x08 .or\n" -" \"yzw\" .emit 0x07 .or \"yz\" .emit 0x06 .or \"yw\" .emit 0x05 .or \"y\" .emit 0x04 .or\n" -" \"zw\" .emit 0x03 .or \"z\" .emit 0x02 .or \"w\" .emit 0x01;\n" -"rgbaMask\n" -" dot_ne .and rgbaMask_1;\n" -"rgbaMask_1\n" -" \"rgba\" .emit 0x0F .or \"rgb\" .emit 0x0E .or \"rga\" .emit 0x0D .or \"rg\" .emit 0x0C .or\n" -" \"rba\" .emit 0x0B .or \"rb\" .emit 0x0A .or \"ra\" .emit 0x09 .or \"r\" .emit 0x08 .or\n" -" \"gba\" .emit 0x07 .or \"gb\" .emit 0x06 .or \"ga\" .emit 0x05 .or \"g\" .emit 0x04 .or\n" -" \"ba\" .emit 0x03 .or \"b\" .emit 0x02 .or \"a\" .emit 0x01;\n" -"fp_namingStatement\n" -" fp_ATTRIB_statement .emit ATTRIB .or\n" -" fp_PARAM_statement .emit PARAM .or\n" -" fp_TEMP_statement .emit TEMP .or\n" -" fp_OUTPUT_statement .emit OUTPUT .or\n" -" fp_ALIAS_statement .emit ALIAS;\n" -"vp_namingStatement\n" -" vp_ATTRIB_statement .emit ATTRIB .or\n" -" vp_PARAM_statement .emit PARAM .or\n" -" vp_TEMP_statement .emit TEMP .or\n" -" ADDRESS_statement .emit ADDRESS .or\n" -" vp_OUTPUT_statement .emit OUTPUT .or\n" -" vp_ALIAS_statement .emit ALIAS;\n" -"fp_ATTRIB_statement\n" -" \"ATTRIB\" .and space .and fp_establishName .and equal .and\n" -" fragAttribBinding .error FRAGMENT_EXPECTED;\n" -"vp_ATTRIB_statement\n" -" \"ATTRIB\" .and space .and vp_establishName .and equal .and\n" -" vtxAttribBinding .error VERTEX_EXPECTED;\n" -"fragAttribBinding\n" -" \"fragment\" .and dot .and fragAttribItem .error INVALID_FRAGMENT_PROPERTY;\n" -"vtxAttribBinding\n" -" \"vertex\" .and dot .and vtxAttribItem .error INVALID_VERTEX_PROPERTY;\n" -"fragAttribItem\n" -" fragAttribItem_1 .emit FRAGMENT_ATTRIB_COLOR .or\n" -" fragAttribItem_2 .emit FRAGMENT_ATTRIB_TEXCOORD .or\n" -" .if (fog_coord != 0x00) \"fogcoord\" .emit FRAGMENT_ATTRIB_FOGCOORD .or\n" -" \"position\" .emit FRAGMENT_ATTRIB_POSITION;\n" -"fragAttribItem_1\n" -" \"color\" .and optColorType;\n" -"fragAttribItem_2\n" -" \"texcoord\" .and optTexCoordNum;\n" -"vtxAttribItem\n" -" \"position\" .emit VERTEX_ATTRIB_POSITION .or\n" -" .if (vertex_blend != 0x00) vtxAttribItem_1 .emit VERTEX_ATTRIB_WEIGHT .or\n" -" \"normal\" .emit VERTEX_ATTRIB_NORMAL .or\n" -" vtxAttribItem_2 .emit VERTEX_ATTRIB_COLOR .or\n" -" \"fogcoord\" .emit VERTEX_ATTRIB_FOGCOORD .or\n" -" vtxAttribItem_3 .emit VERTEX_ATTRIB_TEXCOORD .or\n" -" .if (matrix_palette != 0x00) vtxAttribItem_4 .emit VERTEX_ATTRIB_MATRIXINDEX .or\n" -" vtxAttribItem_5 .emit VERTEX_ATTRIB_GENERIC;\n" -"vtxAttribItem_1\n" -" \"weight\" .and vtxOptWeightNum;\n" -"vtxAttribItem_2\n" -" \"color\" .and optColorType;\n" -"vtxAttribItem_3\n" -" \"texcoord\" .and optTexCoordNum;\n" -"vtxAttribItem_4\n" -" \"matrixindex\" .and lbracket .and vtxWeightNum .and rbracket;\n" -"vtxAttribItem_5\n" -" \"attrib\" .and lbracket .and vtxAttribNum .and rbracket;\n" -"vtxAttribNum\n" -" integer;\n" -"vtxOptWeightNum\n" -" vtxOptWeightNum_1 .or .true .emit 0x00;\n" -"vtxOptWeightNum_1\n" -" lbracket_ne .and vtxWeightNum .and rbracket;\n" -"vtxWeightNum\n" -" integer;\n" -"fp_PARAM_statement\n" -" fp_PARAM_multipleStmt .or fp_PARAM_singleStmt;\n" -"vp_PARAM_statement\n" -" vp_PARAM_multipleStmt .or vp_PARAM_singleStmt;\n" -"fp_PARAM_singleStmt\n" -" \"PARAM\" .and space .and fp_establishName .and .true .emit 0x00 .and fp_paramSingleInit .and\n" -" .true .emit PARAM_NULL;\n" -"vp_PARAM_singleStmt\n" -" \"PARAM\" .and space .and vp_establishName .and .true .emit 0x00 .and vp_paramSingleInit .and\n" -" .true .emit PARAM_NULL;\n" -"fp_PARAM_multipleStmt\n" -" \"PARAM\" .and space .and fp_establishName .and lbracket_ne .and optArraySize .and rbracket .and\n" -" fp_paramMultipleInit .and .true .emit PARAM_NULL;\n" -"vp_PARAM_multipleStmt\n" -" \"PARAM\" .and space .and vp_establishName .and lbracket_ne .and optArraySize .and rbracket .and\n" -" vp_paramMultipleInit .and .true .emit PARAM_NULL;\n" -"optArraySize\n" -" optional_integer;\n" -"fp_paramSingleInit\n" -" equal .and fp_paramSingleItemDecl;\n" -"vp_paramSingleInit\n" -" equal .and vp_paramSingleItemDecl;\n" -"fp_paramMultipleInit\n" -" equal .and lbrace .and fp_paramMultInitList .and rbrace;\n" -"vp_paramMultipleInit\n" -" equal .and lbrace .and vp_paramMultInitList .and rbrace;\n" -"fp_paramMultInitList\n" -" fp_paramMultInitList_1 .or fp_paramMultipleItem;\n" -"vp_paramMultInitList\n" -" vp_paramMultInitList_1 .or vp_paramMultipleItem;\n" -"fp_paramMultInitList_1\n" -" fp_paramMultipleItem .and comma_ne .and fp_paramMultInitList;\n" -"vp_paramMultInitList_1\n" -" vp_paramMultipleItem .and comma_ne .and vp_paramMultInitList;\n" -"fp_paramSingleItemDecl\n" -" fp_stateSingleItem .emit PARAM_STATE_ELEMENT .or\n" -" programSingleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstDecl .emit PARAM_CONSTANT;\n" -"vp_paramSingleItemDecl\n" -" vp_stateSingleItem .emit PARAM_STATE_ELEMENT .or\n" -" programSingleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstDecl .emit PARAM_CONSTANT;\n" -"fp_paramSingleItemUse\n" -" fp_stateSingleItem .emit PARAM_STATE_ELEMENT .or\n" -" programSingleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstUse .emit PARAM_CONSTANT;\n" -"vp_paramSingleItemUse\n" -" vp_stateSingleItem .emit PARAM_STATE_ELEMENT .or\n" -" programSingleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstUse .emit PARAM_CONSTANT;\n" -"fp_paramMultipleItem\n" -" fp_stateMultipleItem .emit PARAM_STATE_ELEMENT .or\n" -" programMultipleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstDecl .emit PARAM_CONSTANT;\n" -"vp_paramMultipleItem\n" -" vp_stateMultipleItem .emit PARAM_STATE_ELEMENT .or\n" -" programMultipleItem .emit PARAM_PROGRAM_ELEMENT .or\n" -" paramConstDecl .emit PARAM_CONSTANT;\n" -"fp_stateMultipleItem\n" -" stateMultipleItem_1 .or fp_stateSingleItem;\n" -"vp_stateMultipleItem\n" -" stateMultipleItem_1 .or vp_stateSingleItem;\n" -"stateMultipleItem_1\n" -" \"state\" .and dot .and stateMatrixRows .emit STATE_MATRIX_ROWS;\n" -"fp_stateSingleItem\n" -" \"state\" .and dot .and fp_stateSingleItem_1 .error INVALID_STATE_PROPERTY;\n" -"vp_stateSingleItem\n" -" \"state\" .and dot .and vp_stateSingleItem_1 .error INVALID_STATE_PROPERTY;\n" -"fp_stateSingleItem_1\n" -" stateSingleItem_1 .or stateSingleItem_2 .or stateSingleItem_3 .or stateSingleItem_4 .or\n" -" stateSingleItem_5 .or stateSingleItem_7 .or stateSingleItem_8 .or stateSingleItem_11;\n" -"vp_stateSingleItem_1\n" -" stateSingleItem_1 .or stateSingleItem_2 .or stateSingleItem_3 .or stateSingleItem_4 .or\n" -" stateSingleItem_6 .or stateSingleItem_7 .or stateSingleItem_9 .or stateSingleItem_10 .or\n" -" stateSingleItem_11;\n" -"stateSingleItem_1\n" -" stateMaterialItem .emit STATE_MATERIAL;\n" -"stateSingleItem_2\n" -" stateLightItem .emit STATE_LIGHT;\n" -"stateSingleItem_3\n" -" stateLightModelItem .emit STATE_LIGHT_MODEL;\n" -"stateSingleItem_4\n" -" stateLightProdItem .emit STATE_LIGHT_PROD;\n" -"stateSingleItem_5\n" -" stateTexEnvItem .emit STATE_TEX_ENV;\n" -"stateSingleItem_6\n" -" stateTexGenItem .emit STATE_TEX_GEN;\n" -"stateSingleItem_7\n" -" stateFogItem .emit STATE_FOG;\n" -"stateSingleItem_8\n" -" stateDepthItem .emit STATE_DEPTH;\n" -"stateSingleItem_9\n" -" stateClipPlaneItem .emit STATE_CLIP_PLANE;\n" -"stateSingleItem_10\n" -" statePointItem .emit STATE_POINT;\n" -"stateSingleItem_11\n" -" stateMatrixRow .emit STATE_MATRIX_ROWS;\n" -"stateMaterialItem\n" -" \"material\" .and optFaceType .and dot .and stateMatProperty .error INVALID_MATERIAL_PROPERTY;\n" -"stateMatProperty\n" -" \"ambient\" .emit MATERIAL_AMBIENT .or\n" -" \"diffuse\" .emit MATERIAL_DIFFUSE .or\n" -" \"specular\" .emit MATERIAL_SPECULAR .or\n" -" \"emission\" .emit MATERIAL_EMISSION .or\n" -" \"shininess\" .emit MATERIAL_SHININESS;\n" -"stateLightItem\n" -" \"light\" .and lbracket .and stateLightNumber .and rbracket .and dot .and\n" -" stateLightProperty .error INVALID_LIGHT_PROPERTY;\n" -"stateLightProperty\n" -" \"ambient\" .emit LIGHT_AMBIENT .or\n" -" \"diffuse\" .emit LIGHT_DIFFUSE .or\n" -" \"specular\" .emit LIGHT_SPECULAR .or\n" -" \"position\" .emit LIGHT_POSITION .or\n" -" \"attenuation\" .emit LIGHT_ATTENUATION .or\n" -" stateLightProperty_1 .emit LIGHT_SPOT_DIRECTION .or\n" -" \"half\" .emit LIGHT_HALF;\n" -"stateLightProperty_1\n" -" \"spot\" .and dot .and stateSpotProperty .error INVALID_SPOT_PROPERTY;\n" -"stateSpotProperty\n" -" \"direction\";\n" -"stateLightModelItem\n" -" \"lightmodel\" .and stateLModProperty .error INVALID_LIGHTMODEL_PROPERTY;\n" -"stateLModProperty\n" -" stateLModProperty_1 .or stateLModProperty_2;\n" -"stateLModProperty_1\n" -" dot .and \"ambient\" .emit LIGHT_MODEL_AMBIENT;\n" -"stateLModProperty_2\n" -" stateLModProperty_3 .emit LIGHT_MODEL_SCENECOLOR;\n" -"stateLModProperty_3\n" -" optFaceType .and dot .and \"scenecolor\";\n" -"stateLightProdItem\n" -" \"lightprod\" .and lbracket .and stateLightNumber .and rbracket .and optFaceType .and dot .and\n" -" stateLProdProperty .error INVALID_LIGHTPROD_PROPERTY;\n" -"stateLProdProperty\n" -" \"ambient\" .emit LIGHT_PROD_AMBIENT .or\n" -" \"diffuse\" .emit LIGHT_PROD_DIFFUSE .or\n" -" \"specular\" .emit LIGHT_PROD_SPECULAR;\n" -"stateLightNumber\n" -" integer;\n" -"stateTexEnvItem\n" -" \"texenv\" .and optLegacyTexUnitNum .and dot .and\n" -" stateTexEnvProperty .error INVALID_TEXENV_PROPERTY;\n" -"stateTexEnvProperty\n" -" \"color\" .emit TEX_ENV_COLOR;\n" -"optLegacyTexUnitNum\n" -" optLegacyTexUnitNum_1 .or .true .emit 0x00;\n" -"optLegacyTexUnitNum_1\n" -" lbracket_ne .and legacyTexUnitNum .and rbracket;\n" -"legacyTexUnitNum\n" -" integer;\n" -"stateTexGenItem\n" -" \"texgen\" .and optTexCoordNum .and dot .and stateTexGenType .error INVALID_TEXGEN_PROPERTY .and\n" -" dot .and stateTexGenCoord .error INVALID_TEXGEN_COORD;\n" -"stateTexGenType\n" -" \"eye\" .emit TEX_GEN_EYE .or\n" -" \"object\" .emit TEX_GEN_OBJECT;\n" -"stateTexGenCoord\n" -" \"s\" .emit COMPONENT_X .or\n" -" \"t\" .emit COMPONENT_Y .or\n" -" \"r\" .emit COMPONENT_Z .or\n" -" \"q\" .emit COMPONENT_W;\n" -"stateFogItem\n" -" \"fog\" .and dot .and stateFogProperty .error INVALID_FOG_PROPERTY;\n" -"stateFogProperty\n" -" \"color\" .emit FOG_COLOR .or\n" -" \"params\" .emit FOG_PARAMS;\n" -"stateDepthItem\n" -" \"depth\" .and dot .and stateDepthProperty .error INVALID_DEPTH_PROPERTY;\n" -"stateDepthProperty\n" -" \"range\" .emit DEPTH_RANGE;\n" -"stateClipPlaneItem\n" -" \"clip\" .and lbracket .and stateClipPlaneNum .and rbracket .and dot .and\n" -" \"plane\" .error INVALID_CLIPPLANE_PROPERTY;\n" -"stateClipPlaneNum\n" -" integer;\n" -"statePointItem\n" -" \"point\" .and dot .and statePointProperty .error INVALID_POINT_PROPERTY;\n" -"statePointProperty\n" -" \"size\" .emit POINT_SIZE .or\n" -" .if (point_parameters != 0x00) \"attenuation\" .emit POINT_ATTENUATION;\n" -"stateMatrixRow\n" -" stateMatrixItem .and dot .and \"row\" .error MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED .and\n" -" lbracket .and stateMatrixRowNum .and rbracket .emit 0x0;\n" -"stateMatrixRows\n" -" stateMatrixItem .and optMatrixRows;\n" -"optMatrixRows\n" -" optMatrixRows_1 .or .true .emit 0x0 .emit '3' .emit 0x0 .emit $;\n" -"optMatrixRows_1\n" -" dot_ne .and \"row\" .error MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED .and lbracket .and\n" -" stateMatrixRowNum .and dotdot .and stateMatrixRowNum .and rbracket;\n" -"stateMatrixItem\n" -" \"matrix\" .and dot .and stateMatrixName .error INVALID_MATRIX_NAME .and stateOptMatModifier;\n" -"stateOptMatModifier\n" -" stateOptMatModifier_1 .or .true .emit MATRIX_MODIFIER_IDENTITY;\n" -"stateOptMatModifier_1\n" -" dot_ne .and stateMatModifier;\n" -"stateMatModifier\n" -" \"inverse\" .emit MATRIX_MODIFIER_INVERSE .or\n" -" \"transpose\" .emit MATRIX_MODIFIER_TRANSPOSE .or\n" -" \"invtrans\" .emit MATRIX_MODIFIER_INVTRANS;\n" -"stateMatrixRowNum\n" -" integer_0_3;\n" -"stateMatrixName\n" -" stateMatrixName_1_1 .emit MATRIX_MODELVIEW .or\n" -" \"projection\" .emit MATRIX_PROJECTION .or\n" -" \"mvp\" .emit MATRIX_MVP .or\n" -" stateMatrixName_1_2 .emit MATRIX_TEXTURE .or\n" -" .if (matrix_palette != 0x00) stateMatrixName_1_3 .emit MATRIX_PALETTE .or\n" -" stateMatrixName_1_4 .emit MATRIX_PROGRAM;\n" -"stateMatrixName_1_1\n" -" \"modelview\" .and stateOptModMatNum;\n" -"stateMatrixName_1_2\n" -" \"texture\" .and optTexCoordNum;\n" -"stateMatrixName_1_3\n" -" \"palette\" .and lbracket .and statePaletteMatNum .and rbracket;\n" -"stateMatrixName_1_4\n" -" \"program\" .and lbracket .and stateProgramMatNum .and rbracket;\n" -"stateOptModMatNum\n" -" .if (vertex_blend != 0x00) stateOptModMatNum_1 .or\n" -" .true .emit 0x00;\n" -"stateOptModMatNum_1\n" -" lbracket_ne .and stateModMatNum .and rbracket;\n" -"stateModMatNum\n" -" integer;\n" -"optTexCoordNum\n" -" optTexCoordNum_1 .or .true .emit 0x00;\n" -"optTexCoordNum_1\n" -" lbracket_ne .and texCoordNum .and rbracket;\n" -"texCoordNum\n" -" integer;\n" -"statePaletteMatNum\n" -" integer;\n" -"stateProgramMatNum\n" -" integer;\n" -"programSingleItem\n" -" \"program\" .and dot .and programSingleItem_1 .error INVALID_PROGRAM_PROPERTY;\n" -"programSingleItem_1\n" -" progEnvParam .or progLocalParam;\n" -"programMultipleItem\n" -" \"program\" .and dot .and programMultipleItem_1 .error INVALID_PROGRAM_PROPERTY;\n" -"programMultipleItem_1\n" -" progEnvParams .or progLocalParams;\n" -"progEnvParams\n" -" \"env\" .emit PROGRAM_PARAM_ENV .and lbracket .and progEnvParamNums .and rbracket;\n" -"progEnvParamNums\n" -" progEnvParamNums_1 .or progEnvParamNums_2;\n" -"progEnvParamNums_1\n" -" progEnvParamNum .and dotdot_ne .and progEnvParamNum;\n" -"progEnvParamNums_2\n" -" progEnvParamNum .and .true .emit 0x00;\n" -"progEnvParam\n" -" \"env\" .emit PROGRAM_PARAM_ENV .and lbracket .and progEnvParamNum .and rbracket .emit 0x00;\n" -"progLocalParams\n" -" \"local\" .emit PROGRAM_PARAM_LOCAL .and lbracket .and progLocalParamNums .and rbracket;\n" -"progLocalParamNums\n" -" progLocalParamNums_1 .or progLocalParamNums_2;\n" -"progLocalParamNums_1\n" -" progLocalParamNum .and dotdot_ne .and progLocalParamNum;\n" -"progLocalParamNums_2\n" -" progLocalParamNum .and .true .emit 0x00;\n" -"progLocalParam\n" -" \"local\" .emit PROGRAM_PARAM_LOCAL .and lbracket .and progLocalParamNum .and rbracket .emit 0x00;\n" -"progEnvParamNum\n" -" integer;\n" -"progLocalParamNum\n" -" integer;\n" -"paramConstDecl\n" -" paramConstScalarDecl .emit CONSTANT_SCALAR .or paramConstVector .emit CONSTANT_VECTOR;\n" -"paramConstUse\n" -" paramConstScalarUse .emit CONSTANT_SCALAR .or paramConstVector .emit CONSTANT_VECTOR;\n" -"paramConstScalarDecl\n" -" signedFloatConstant;\n" -"paramConstScalarUse\n" -" floatConstant;\n" -"paramConstVector\n" -" paramConstVector_4 .emit 0x04 .or paramConstVector_3 .emit 0x03 .or\n" -" paramConstVector_2 .emit 0x02 .or paramConstVector_1 .emit 0x01;\n" -"paramConstVector_1\n" -" lbrace_ne .and signedFloatConstant .and rbrace;\n" -"paramConstVector_2\n" -" lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and rbrace;\n" -"paramConstVector_3\n" -" lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and comma_ne .and\n" -" signedFloatConstant .and rbrace;\n" -"paramConstVector_4\n" -" lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and comma_ne .and\n" -" signedFloatConstant .and comma_ne .and signedFloatConstant .and rbrace;\n" -"signedFloatConstant\n" -" optionalSign .and floatConstant;\n" -"floatConstant\n" -" float;\n" -"optionalSign\n" -" optional_sign_ne;\n" -"fp_TEMP_statement\n" -" \"TEMP\" .and space .and fp_varNameList .and .true .emit 0x00;\n" -"vp_TEMP_statement\n" -" \"TEMP\" .and space .and vp_varNameList .and .true .emit 0x00;\n" -"ADDRESS_statement\n" -" \"ADDRESS\" .and space .and vp_varNameList .and .true .emit 0x00;\n" -"fp_varNameList\n" -" fp_varNameList_1 .or fp_establishName;\n" -"vp_varNameList\n" -" vp_varNameList_1 .or vp_establishName;\n" -"fp_varNameList_1\n" -" fp_establishName .and comma_ne .and fp_varNameList;\n" -"vp_varNameList_1\n" -" vp_establishName .and comma_ne .and vp_varNameList;\n" -"fp_OUTPUT_statement\n" -" \"OUTPUT\" .and space .and fp_establishName .and equal .and\n" -" fp_resultBinding .error RESULT_EXPECTED;\n" -"vp_OUTPUT_statement\n" -" \"OUTPUT\" .and space .and vp_establishName .and equal .and\n" -" vp_resultBinding .error RESULT_EXPECTED;\n" -"fp_resultBinding\n" -" \"result\" .and dot .and fp_resultBinding_1 .error INVALID_RESULT_PROPERTY;\n" -"vp_resultBinding\n" -" \"result\" .and dot .and vp_resultBinding_1 .error INVALID_RESULT_PROPERTY;\n" -"fp_resultBinding_1\n" -" fp_resultBinding_2 .emit FRAGMENT_RESULT_COLOR .or\n" -" \"depth\" .emit FRAGMENT_RESULT_DEPTH;\n" -"fp_resultBinding_2\n" -" \"color\" .and optOutputColorNum;\n" -"vp_resultBinding_1\n" -" .if (ARB_position_invariant == 0x00) \"position\" .emit VERTEX_RESULT_POSITION .or\n" -" resultColBinding .emit VERTEX_RESULT_COLOR .or\n" -" \"fogcoord\" .emit VERTEX_RESULT_FOGCOORD .or\n" -" \"pointsize\" .emit VERTEX_RESULT_POINTSIZE .or\n" -" vp_resultBinding_2 .emit VERTEX_RESULT_TEXCOORD;\n" -"vp_resultBinding_2\n" -" \"texcoord\" .and optTexCoordNum;\n" -"optOutputColorNum\n" -" .if (ARB_draw_buffers != 0x00) optOutputColorNum_1 .or .true .emit 0x00;\n" -"optOutputColorNum_1\n" -" lbracket_ne .and outputColorNum .and rbracket;\n" -"outputColorNum\n" -" integer;\n" -"resultColBinding\n" -" \"color\" .and optFaceType .and optColorType;\n" -"optFaceType\n" -" FaceType .or .true .emit FACE_FRONT;\n" -"FaceType\n" -" dot_ne .and FaceProperty;\n" -"FaceProperty\n" -" \"front\" .emit FACE_FRONT .or \"back\" .emit FACE_BACK;\n" -"optColorType\n" -" ColorType .or .true .emit COLOR_PRIMARY;\n" -"ColorType\n" -" dot_ne .and ColorProperty;\n" -"ColorProperty\n" -" \"primary\" .emit COLOR_PRIMARY .or\n" -" .if (secondary_color != 0x00) \"secondary\" .emit COLOR_SECONDARY;\n" -"fp_ALIAS_statement\n" -" \"ALIAS\" .and fp_ALIAS_statement_1 .error IDENTIFIER_EXPECTED .and equal .and fp_establishedName;\n" -"vp_ALIAS_statement\n" -" \"ALIAS\" .and vp_ALIAS_statement_1 .error IDENTIFIER_EXPECTED .and equal .and vp_establishedName;\n" -"fp_ALIAS_statement_1\n" -" space .and fp_establishName;\n" -"vp_ALIAS_statement_1\n" -" space .and vp_establishName;\n" -"fp_establishName\n" -" fp_identifier;\n" -"vp_establishName\n" -" vp_identifier;\n" -"fp_establishedName\n" -" fp_identifier;\n" -"vp_establishedName\n" -" vp_identifier;\n" -"fp_establishedName_no_error_on_identifier\n" -" fp_identifier_ne;\n" -"vp_establishedName_no_error_on_identifier\n" -" vp_identifier_ne;\n" -"fp_identifier\n" -" fp_identifier_ne .error IDENTIFIER_EXPECTED;\n" -"vp_identifier\n" -" vp_identifier_ne .error IDENTIFIER_EXPECTED;\n" -"fp_identifier_ne\n" -" fp_not_reserved_identifier .and identifier_ne;\n" -"vp_identifier_ne\n" -" vp_not_reserved_identifier .and identifier_ne;\n" -"fp_not_reserved_identifier\n" -" fp_not_reserved_identifier_1 .or .true;\n" -"fp_not_reserved_identifier_1\n" -" fp_reserved_identifier .and .false .error RESERVED_KEYWORD;\n" -"vp_not_reserved_identifier\n" -" vp_not_reserved_identifier_1 .or .true;\n" -"vp_not_reserved_identifier_1\n" -" vp_reserved_identifier .and .false .error RESERVED_KEYWORD;\n" -"fp_reserved_identifier\n" -" \"ABS\" .or \"ABS_SAT\" .or \"ADD\" .or \"ADD_SAT\" .or \"ALIAS\" .or \"ATTRIB\" .or \"CMP\" .or \"CMP_SAT\" .or\n" -" \"COS\" .or \"COS_SAT\" .or \"DP3\" .or \"DP3_SAT\" .or \"DP4\" .or \"DP4_SAT\" .or \"DPH\" .or \"DPH_SAT\" .or\n" -" \"DST\" .or \"DST_SAT\" .or \"END\" .or \"EX2\" .or \"EX2_SAT\" .or \"FLR\" .or \"FLR_SAT\" .or \"FRC\" .or\n" -" \"FRC_SAT\" .or \"KIL\" .or \"LG2\" .or \"LG2_SAT\" .or \"LIT\" .or \"LIT_SAT\" .or \"LRP\" .or \"LRP_SAT\" .or\n" -" \"MAD\" .or \"MAD_SAT\" .or \"MAX\" .or \"MAX_SAT\" .or \"MIN\" .or \"MIN_SAT\" .or \"MOV\" .or \"MOV_SAT\" .or\n" -" \"MUL\" .or \"MUL_SAT\" .or \"OPTION\" .or \"OUTPUT\" .or \"PARAM\" .or \"POW\" .or \"POW_SAT\" .or \"RCP\" .or\n" -" \"RCP_SAT\" .or \"RSQ\" .or \"RSQ_SAT\" .or \"SIN\" .or \"SIN_SAT\" .or \"SCS\" .or \"SCS_SAT\" .or \"SGE\" .or\n" -" \"SGE_SAT\" .or \"SLT\" .or \"SLT_SAT\" .or \"SUB\" .or \"SUB_SAT\" .or \"SWZ\" .or \"SWZ_SAT\" .or \"TEMP\" .or\n" -" \"TEX\" .or \"TEX_SAT\" .or \"TXB\" .or \"TXB_SAT\" .or \"TXP\" .or \"TXP_SAT\" .or \"XPD\" .or \"XPD_SAT\" .or\n" -" \"fragment\" .or \"program\" .or \"result\" .or \"state\" .or \"texture\";\n" -"vp_reserved_identifier\n" -" \"ABS\" .or \"ADD\" .or \"ADDRESS\" .or \"ALIAS\" .or \"ARL\" .or \"ATTRIB\" .or \"DP3\" .or \"DP4\" .or\n" -" \"DPH\" .or \"DST\" .or \"END\" .or \"EX2\" .or \"EXP\" .or \"FLR\" .or \"FRC\" .or \"LG2\" .or \"LIT\" .or\n" -" \"LOG\" .or \"MAD\" .or \"MAX\" .or \"MIN\" .or \"MOV\" .or \"MUL\" .or \"OPTION\" .or \"OUTPUT\" .or\n" -" \"PARAM\" .or \"POW\" .or \"RCP\" .or \"RSQ\" .or \"SGE\" .or \"SLT\" .or \"SUB\" .or \"SWZ\" .or \"TEMP\" .or\n" -" \"XPD\" .or \"program\" .or \"result\" .or \"state\" .or \"vertex\";\n" -"integer\n" -" integer_ne .error INTEGER_EXPECTED;\n" -"zero\n" -" '0';\n" -"leading_zeroes\n" -" .loop zero;\n" -"no_digit\n" -" no_digit_1 .or .true;\n" -"no_digit_1\n" -" digit10 .and .false .error INTEGER_OUT_OF_RANGE;\n" -"all_zeroes\n" -" all_zeroes_1 .or no_digit_1;\n" -"all_zeroes_1\n" -" '0' .and .loop zero .and no_digit;\n" -"integer_0_3\n" -" integer_0_3_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;\n" -"integer_0_3_1\n" -" integer_0_3_2 .or all_zeroes .emit '0';\n" -"integer_0_3_2 \n" -" leading_zeroes .and '1'-'3' .emit * .and no_digit;\n" -"integer_0_63\n" -" integer_0_63_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;\n" -"integer_0_63_1\n" -" integer_0_63_2 .or integer_0_63_3 .or integer_0_63_4 .or integer_0_63_5 .or\n" -" all_zeroes .emit '0';\n" -"integer_0_63_2 \n" -" leading_zeroes .and '7'-'9' .emit * .and no_digit;\n" -"integer_0_63_3 \n" -" leading_zeroes .and '1'-'5' .emit * .and '0'-'9' .emit * .and no_digit;\n" -"integer_0_63_4 \n" -" leading_zeroes .and '6' .emit * .and '0'-'3' .emit * .and no_digit;\n" -"integer_0_63_5 \n" -" leading_zeroes .and '1'-'6' .emit * .and no_digit;\n" -"integer_0_64\n" -" integer_0_64_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;\n" -"integer_0_64_1\n" -" integer_0_64_2 .or integer_0_64_3 .or integer_0_64_4 .or integer_0_64_5 .or\n" -" all_zeroes .emit '0';\n" -"integer_0_64_2 \n" -" leading_zeroes .and '7'-'9' .emit * .and no_digit;\n" -"integer_0_64_3 \n" -" leading_zeroes .and '1'-'5' .emit * .and '0'-'9' .emit * .and no_digit;\n" -"integer_0_64_4 \n" -" leading_zeroes .and '6' .emit * .and '0'-'4' .emit * .and no_digit;\n" -"integer_0_64_5 \n" -" leading_zeroes .and '1'-'6' .emit * .and no_digit;\n" -"optional_space\n" -" space .or .true;\n" -"space_dst\n" -" space .error OPERATION_NEEDS_DESTINATION_VARIABLE;\n" -"space_src\n" -" space .error OPERATION_NEEDS_SOURCE_VARIABLE;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" white_char .or comment_block;\n" -"white_char\n" -" ' ' .or '\\t' .or '\\n' .or '\\r';\n" -"comment_block\n" -" '#' .and .loop comment_char .and optional_new_line;\n" -"comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"optional_new_line\n" -" '\\n' .or crlf .or .true;\n" -"crlf\n" -" '\\r' .and '\\n';\n" -"semicolon\n" -" optional_space .and ';' .error MISSING_SEMICOLON .and optional_space;\n" -"comma\n" -" optional_space .and ',' .error MISSING_COMMA .and optional_space;\n" -"comma_ne\n" -" optional_space .and ',' .and optional_space;\n" -"lbracket\n" -" optional_space .and '[' .error MISSING_LBRACKET .and optional_space;\n" -"lbracket_ne\n" -" optional_space .and '[' .and optional_space;\n" -"rbracket\n" -" optional_space .and ']' .error MISSING_RBRACKET .and optional_space;\n" -"dot\n" -" optional_space .and '.' .error MISSING_DOT .and optional_space;\n" -"dot_ne\n" -" optional_space .and '.' .and optional_space;\n" -"equal\n" -" optional_space .and '=' .error MISSING_EQUAL .and optional_space;\n" -"lbrace\n" -" optional_space .and '{' .error MISSING_LBRACE .and optional_space;\n" -"lbrace_ne\n" -" optional_space .and '{' .and optional_space;\n" -"rbrace\n" -" optional_space .and '}' .error MISSING_RBRACE .and optional_space;\n" -"dotdot\n" -" optional_space .and '.' .and '.' .error MISSING_DOTDOT .and optional_space;\n" -"dotdot_ne\n" -" optional_space .and '.' .and '.' .and optional_space;\n" -"float\n" -" float_1 .or float_2 .or float_legacy;\n" -"float_1\n" -" '.' .emit 0x00 .and integer_ne .error MISSING_FRACTION_OR_EXPONENT .and optional_exponent;\n" -"float_2\n" -" integer_ne .and float_3;\n" -"float_3\n" -" float_4 .or float_5;\n" -"float_4\n" -" '.' .and optional_integer .and optional_exponent;\n" -"float_5\n" -" exponent .emit 0x00;\n" -"float_legacy\n" -" integer_ne .and .true .emit 0x00 .emit 0x00;\n" -"integer_ne\n" -" integer_ne_1 .and .true .emit 0x00 .emit $;\n" -"integer_ne_1\n" -" digit10 .emit * .and .loop digit10 .emit *;\n" -"optional_integer\n" -" integer_ne .or .true .emit 0x00;\n" -"optional_exponent\n" -" exponent .or .true .emit 0x00;\n" -"exponent\n" -" exponent_1 .and optional_sign_ne .and integer_ne .error EXPONENT_VALUE_EXPECTED;\n" -"exponent_1\n" -" 'e' .or 'E';\n" -"optional_sign_ne\n" -" minus_ne .or plus_ne .or .true;\n" -"plus_ne\n" -" optional_space .and '+' .and optional_space;\n" -"minus_ne\n" -" optional_space .and '-' .emit '-' .and optional_space;\n" -"identifier_ne\n" -" first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit 0x00 .emit $;\n" -"follow_idchar\n" -" first_idchar .or digit10;\n" -"first_idchar\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '$';\n" -"digit10\n" -" '0'-'9';\n" -".string __string_filter;\n" -"__string_filter\n" -" .loop __identifier_char;\n" -"__identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '$' .or '0'-'9';\n" -"e_signature\n" -" e_signature_char .and .loop e_signature_char;\n" -"e_signature_char\n" -" '!' .or '.' .or 'A'-'Z' .or 'a'-'z' .or '0'-'9';\n" -"e_statement\n" -" .loop e_statement_not_term;\n" -"e_statement_not_term\n" -" '\\x3C'-'\\xFF' .or '\\x0E'-'\\x3A' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"e_identifier\n" -" e_identifier_first .and .loop e_identifier_next;\n" -"e_identifier_first\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '$';\n" -"e_identifier_next\n" -" e_identifier_first .or '0'-'9';\n" -"e_token\n" -" e_identifier .or e_token_number .or '[' .or ']' .or '.' .or '{' .or '}' .or '=' .or '+' .or\n" -" '-' .or ',' .or ';';\n" -"e_token_number\n" -" e_token_digit .and .loop e_token_digit;\n" -"e_token_digit\n" -" '0'-'9';\n" -"e_charordigit\n" -" 'A'-'Z' .or 'a'-'z' .or '0'-'9';\n" -"" diff --git a/src/libs/mesa/mesa/shader/atifragshader.c b/src/libs/mesa/mesa/shader/atifragshader.c deleted file mode 100644 index ac087d415c..0000000000 --- a/src/libs/mesa/mesa/shader/atifragshader.c +++ /dev/null @@ -1,759 +0,0 @@ -/** - * \file atifragshader.c - * \author David Airlie - * Copyright (C) 2004 David Airlie 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 - * DAVID AIRLIE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/enums.h" -#include "main/mtypes.h" -#include "atifragshader.h" - -#define MESA_DEBUG_ATI_FS 0 - -static struct ati_fragment_shader DummyShader; - - -/** - * Allocate and initialize a new ATI fragment shader object. - */ -struct ati_fragment_shader * -_mesa_new_ati_fragment_shader(GLcontext *ctx, GLuint id) -{ - struct ati_fragment_shader *s = CALLOC_STRUCT(ati_fragment_shader); - (void) ctx; - if (s) { - s->Id = id; - s->RefCount = 1; - } - return s; -} - - -/** - * Delete the given ati fragment shader - */ -void -_mesa_delete_ati_fragment_shader(GLcontext *ctx, struct ati_fragment_shader *s) -{ - GLuint i; - for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { - if (s->Instructions[i]) - _mesa_free(s->Instructions[i]); - if (s->SetupInst[i]) - _mesa_free(s->SetupInst[i]); - } - _mesa_free(s); -} - - - -static void -new_arith_inst(struct ati_fragment_shader *prog) -{ -/* set "default" instruction as not all may get defined. - there is no specified way to express a nop with ati fragment shaders we use - GL_NONE as the op enum and just set some params to 0 - so nothing to do here */ - prog->numArithInstr[prog->cur_pass >> 1]++; -} - -static void -new_tex_inst(struct ati_fragment_shader *prog) -{ -} - -static void match_pair_inst(struct ati_fragment_shader *curProg, GLuint optype) -{ - if (optype == curProg->last_optype) { - curProg->last_optype = 1; - } -} - -#if MESA_DEBUG_ATI_FS -static char * -create_dst_mod_str(GLuint mod) -{ - static char ret_str[1024]; - - _mesa_memset(ret_str, 0, 1024); - if (mod & GL_2X_BIT_ATI) - _mesa_strncat(ret_str, "|2X", 1024); - - if (mod & GL_4X_BIT_ATI) - _mesa_strncat(ret_str, "|4X", 1024); - - if (mod & GL_8X_BIT_ATI) - _mesa_strncat(ret_str, "|8X", 1024); - if (mod & GL_HALF_BIT_ATI) - _mesa_strncat(ret_str, "|HA", 1024); - if (mod & GL_QUARTER_BIT_ATI) - _mesa_strncat(ret_str, "|QU", 1024); - if (mod & GL_EIGHTH_BIT_ATI) - _mesa_strncat(ret_str, "|EI", 1024); - - if (mod & GL_SATURATE_BIT_ATI) - _mesa_strncat(ret_str, "|SAT", 1024); - - if (_mesa_strlen(ret_str) == 0) - _mesa_strncat(ret_str, "NONE", 1024); - return ret_str; -} - -static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI", - "AlphaFragmentOp1ATI", "AlphaFragmentOp2ATI", "AlphaFragmentOp3ATI" }; - -static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst, - GLuint dstMask, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, - GLuint arg3Rep, GLuint arg3Mod) -{ - char *op_name; - - op_name = atifs_ops[(arg_count-1)+(optype?3:0)]; - - fprintf(stderr, "%s(%s, %s", op_name, _mesa_lookup_enum_by_nr(op), - _mesa_lookup_enum_by_nr(dst)); - if (!optype) - fprintf(stderr, ", %d", dstMask); - - fprintf(stderr, ", %s", create_dst_mod_str(dstMod)); - - fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg1), - _mesa_lookup_enum_by_nr(arg1Rep), arg1Mod); - if (arg_count>1) - fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg2), - _mesa_lookup_enum_by_nr(arg2Rep), arg2Mod); - if (arg_count>2) - fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg3), - _mesa_lookup_enum_by_nr(arg3Rep), arg3Mod); - - fprintf(stderr,")\n"); - -} -#endif - -static int check_arith_arg(struct ati_fragment_shader *curProg, - GLuint optype, GLuint arg, GLuint argRep) -{ - GET_CURRENT_CONTEXT(ctx); - - if (((arg < GL_CON_0_ATI) || (arg > GL_CON_7_ATI)) && - ((arg < GL_REG_0_ATI) || (arg > GL_REG_5_ATI)) && - (arg != GL_ZERO) && (arg != GL_ONE) && - (arg != GL_PRIMARY_COLOR_ARB) && (arg != GL_SECONDARY_INTERPOLATOR_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "C/AFragmentOpATI(arg)"); - return 0; - } - if ((arg == GL_SECONDARY_INTERPOLATOR_ATI) && (((optype == 0) && (argRep == GL_ALPHA)) || - ((optype == 1) && ((arg == GL_ALPHA) || (argRep == GL_NONE))))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)"); - return 0; - } - if ((arg == GL_SECONDARY_INTERPOLATOR_ATI) && (((optype == 0) && (argRep == GL_ALPHA)) || - ((optype == 1) && ((arg == GL_ALPHA) || (argRep == GL_NONE))))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)"); - return 0; - } - if ((curProg->cur_pass == 1) && - ((arg == GL_PRIMARY_COLOR_ARB) || (arg == GL_SECONDARY_INTERPOLATOR_ATI))) { - curProg->interpinp1 = GL_TRUE; - } - return 1; -} - -GLuint GLAPIENTRY -_mesa_GenFragmentShadersATI(GLuint range) -{ - GLuint first; - GLuint i; - GET_CURRENT_CONTEXT(ctx); - - if (range == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenFragmentShadersATI(range)"); - return 0; - } - - if (ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGenFragmentShadersATI(insideShader)"); - return 0; - } - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->ATIShaders, range); - for (i = 0; i < range; i++) { - _mesa_HashInsert(ctx->Shared->ATIShaders, first + i, &DummyShader); - } - - return first; -} - -void GLAPIENTRY -_mesa_BindFragmentShaderATI(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; - struct ati_fragment_shader *newProg; - - if (ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFragmentShaderATI(insideShader)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (curProg->Id == id) { - return; - } - - /* unbind current */ - if (curProg->Id != 0) { - curProg->RefCount--; - if (curProg->RefCount <= 0) { - _mesa_HashRemove(ctx->Shared->ATIShaders, id); - } - } - - /* find new shader */ - if (id == 0) { - newProg = ctx->Shared->DefaultFragmentShader; - } - else { - newProg = (struct ati_fragment_shader *) - _mesa_HashLookup(ctx->Shared->ATIShaders, id); - if (!newProg || newProg == &DummyShader) { - /* allocate a new program now */ - newProg = _mesa_new_ati_fragment_shader(ctx, id); - if (!newProg) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFragmentShaderATI"); - return; - } - _mesa_HashInsert(ctx->Shared->ATIShaders, id, newProg); - } - - } - - /* do actual bind */ - ctx->ATIFragmentShader.Current = newProg; - - ASSERT(ctx->ATIFragmentShader.Current); - if (newProg) - newProg->RefCount++; - - /*if (ctx->Driver.BindProgram) - ctx->Driver.BindProgram(ctx, target, prog); */ -} - -void GLAPIENTRY -_mesa_DeleteFragmentShaderATI(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - - if (ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteFragmentShaderATI(insideShader)"); - return; - } - - if (id != 0) { - struct ati_fragment_shader *prog = (struct ati_fragment_shader *) - _mesa_HashLookup(ctx->Shared->ATIShaders, id); - if (prog == &DummyShader) { - _mesa_HashRemove(ctx->Shared->ATIShaders, id); - } - else if (prog) { - if (ctx->ATIFragmentShader.Current && - ctx->ATIFragmentShader.Current->Id == id) { - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - _mesa_BindFragmentShaderATI(0); - } - } - - /* The ID is immediately available for re-use now */ - _mesa_HashRemove(ctx->Shared->ATIShaders, id); - prog->RefCount--; - if (prog->RefCount <= 0) { - _mesa_free(prog); - } - } -} - - -void GLAPIENTRY -_mesa_BeginFragmentShaderATI(void) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - - if (ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginFragmentShaderATI(insideShader)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - /* if the shader was already defined free instructions and get new ones - (or, could use the same mem but would need to reinitialize) */ - /* no idea if it's allowed to redefine a shader */ - for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { - if (ctx->ATIFragmentShader.Current->Instructions[i]) - _mesa_free(ctx->ATIFragmentShader.Current->Instructions[i]); - if (ctx->ATIFragmentShader.Current->SetupInst[i]) - _mesa_free(ctx->ATIFragmentShader.Current->SetupInst[i]); - } - - /* malloc the instructions here - not sure if the best place but its - a start */ - for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { - ctx->ATIFragmentShader.Current->Instructions[i] = - (struct atifs_instruction *) - _mesa_calloc(sizeof(struct atifs_instruction) * - (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI)); - ctx->ATIFragmentShader.Current->SetupInst[i] = - (struct atifs_setupinst *) - _mesa_calloc(sizeof(struct atifs_setupinst) * - (MAX_NUM_FRAGMENT_REGISTERS_ATI)); - } - -/* can't rely on calloc for initialization as it's possible to redefine a shader (?) */ - ctx->ATIFragmentShader.Current->LocalConstDef = 0; - ctx->ATIFragmentShader.Current->numArithInstr[0] = 0; - ctx->ATIFragmentShader.Current->numArithInstr[1] = 0; - ctx->ATIFragmentShader.Current->regsAssigned[0] = 0; - ctx->ATIFragmentShader.Current->regsAssigned[1] = 0; - ctx->ATIFragmentShader.Current->NumPasses = 0; - ctx->ATIFragmentShader.Current->cur_pass = 0; - ctx->ATIFragmentShader.Current->last_optype = 0; - ctx->ATIFragmentShader.Current->interpinp1 = GL_FALSE; - ctx->ATIFragmentShader.Current->isValid = GL_FALSE; - ctx->ATIFragmentShader.Current->swizzlerq = 0; - ctx->ATIFragmentShader.Compiling = 1; -} - -void GLAPIENTRY -_mesa_EndFragmentShaderATI(void) -{ - GET_CURRENT_CONTEXT(ctx); - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; -#if MESA_DEBUG_ATI_FS - GLint i, j; -#endif - - if (!ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEndFragmentShaderATI(outsideShader)"); - return; - } - if (curProg->interpinp1 && (ctx->ATIFragmentShader.Current->cur_pass > 1)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEndFragmentShaderATI(interpinfirstpass)"); - /* according to spec, DON'T return here */ - } - - match_pair_inst(curProg, 0); - ctx->ATIFragmentShader.Compiling = 0; - ctx->ATIFragmentShader.Current->isValid = GL_TRUE; - if ((ctx->ATIFragmentShader.Current->cur_pass == 0) || - (ctx->ATIFragmentShader.Current->cur_pass == 2)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEndFragmentShaderATI(noarithinst)"); - } - if (ctx->ATIFragmentShader.Current->cur_pass > 1) - ctx->ATIFragmentShader.Current->NumPasses = 2; - else ctx->ATIFragmentShader.Current->NumPasses = 1; - ctx->ATIFragmentShader.Current->cur_pass=0; -#if MESA_DEBUG_ATI_FS - for (j = 0; j < MAX_NUM_PASSES_ATI; j++) { - for (i = 0; i < MAX_NUM_FRAGMENT_REGISTERS_ATI; i++) { - GLuint op = curProg->SetupInst[j][i].Opcode; - const char *op_enum = op > 5 ? _mesa_lookup_enum_by_nr(op) : "0"; - GLuint src = curProg->SetupInst[j][i].src; - GLuint swizzle = curProg->SetupInst[j][i].swizzle; - fprintf(stderr, "%2d %04X %s %d %04X\n", i, op, op_enum, src, - swizzle); - } - for (i = 0; i < curProg->numArithInstr[j]; i++) { - GLuint op0 = curProg->Instructions[j][i].Opcode[0]; - GLuint op1 = curProg->Instructions[j][i].Opcode[1]; - const char *op0_enum = op0 > 5 ? _mesa_lookup_enum_by_nr(op0) : "0"; - const char *op1_enum = op1 > 5 ? _mesa_lookup_enum_by_nr(op1) : "0"; - GLuint count0 = curProg->Instructions[j][i].ArgCount[0]; - GLuint count1 = curProg->Instructions[j][i].ArgCount[1]; - fprintf(stderr, "%2d %04X %s %d %04X %s %d\n", i, op0, op0_enum, count0, - op1, op1_enum, count1); - } - } -#endif - if (ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_SHADER_ATI, NULL ); -} - -void GLAPIENTRY -_mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) -{ - GET_CURRENT_CONTEXT(ctx); - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; - struct atifs_setupinst *curI; - - if (!ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(outsideShader)"); - return; - } - - if (curProg->cur_pass == 1) { - match_pair_inst(curProg, 0); - curProg->cur_pass = 2; - } - if ((curProg->cur_pass > 2) || - ((1 << (dst - GL_REG_0_ATI)) & curProg->regsAssigned[curProg->cur_pass >> 1])) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoord(pass)"); - return; - } - if ((dst < GL_REG_0_ATI) || (dst > GL_REG_5_ATI) || - ((dst - GL_REG_0_ATI) >= ctx->Const.MaxTextureUnits)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glPassTexCoordATI(dst)"); - return; - } - if (((coord < GL_REG_0_ATI) || (coord > GL_REG_5_ATI)) && - ((coord < GL_TEXTURE0_ARB) || (coord > GL_TEXTURE7_ARB) || - ((coord - GL_TEXTURE0_ARB) >= ctx->Const.MaxTextureUnits))) { - _mesa_error(ctx, GL_INVALID_ENUM, "glPassTexCoordATI(coord)"); - return; - } - if ((curProg->cur_pass == 0) && (coord >= GL_REG_0_ATI)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(coord)"); - return; - } - if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glPassTexCoordATI(swizzle)"); - return; - } - if ((swizzle & 1) && (coord >= GL_REG_0_ATI)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(swizzle)"); - return; - } - if (coord <= GL_TEXTURE7_ARB) { - GLuint tmp = coord - GL_TEXTURE0_ARB; - if ((((curProg->swizzlerq >> (tmp * 2)) & 3) != 0) && - (((swizzle & 1) + 1) != ((curProg->swizzlerq >> (tmp * 2)) & 3))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(swizzle)"); - return; - } else { - curProg->swizzlerq |= (((swizzle & 1) + 1) << (tmp * 2)); - } - } - - curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); - new_tex_inst(curProg); - - /* add the instructions */ - curI = &curProg->SetupInst[curProg->cur_pass >> 1][dst - GL_REG_0_ATI]; - - curI->Opcode = ATI_FRAGMENT_SHADER_PASS_OP; - curI->src = coord; - curI->swizzle = swizzle; - -#if MESA_DEBUG_ATI_FS - _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__, - _mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(coord), - _mesa_lookup_enum_by_nr(swizzle)); -#endif -} - -void GLAPIENTRY -_mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle) -{ - GET_CURRENT_CONTEXT(ctx); - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; - struct atifs_setupinst *curI; - - if (!ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(outsideShader)"); - return; - } - - if (curProg->cur_pass == 1) { - match_pair_inst(curProg, 0); - curProg->cur_pass = 2; - } - if ((curProg->cur_pass > 2) || - ((1 << (dst - GL_REG_0_ATI)) & curProg->regsAssigned[curProg->cur_pass >> 1])) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(pass)"); - return; - } - if ((dst < GL_REG_0_ATI) || (dst > GL_REG_5_ATI) || - ((dst - GL_REG_0_ATI) >= ctx->Const.MaxTextureUnits)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSampleMapATI(dst)"); - return; - } - if (((interp < GL_REG_0_ATI) || (interp > GL_REG_5_ATI)) && - ((interp < GL_TEXTURE0_ARB) || (interp > GL_TEXTURE7_ARB) || - ((interp - GL_TEXTURE0_ARB) >= ctx->Const.MaxTextureUnits))) { - /* is this texture5 or texture7? spec is a bit unclear there */ - _mesa_error(ctx, GL_INVALID_ENUM, "glSampleMapATI(interp)"); - return; - } - if ((curProg->cur_pass == 0) && (interp >= GL_REG_0_ATI)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(interp)"); - return; - } - if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glSampleMapATI(swizzle)"); - return; - } - if ((swizzle & 1) && (interp >= GL_REG_0_ATI)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(swizzle)"); - return; - } - if (interp <= GL_TEXTURE7_ARB) { - GLuint tmp = interp - GL_TEXTURE0_ARB; - if ((((curProg->swizzlerq >> (tmp * 2)) & 3) != 0) && - (((swizzle & 1) + 1) != ((curProg->swizzlerq >> (tmp * 2)) & 3))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(swizzle)"); - return; - } else { - curProg->swizzlerq |= (((swizzle & 1) + 1) << (tmp * 2)); - } - } - - curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); - new_tex_inst(curProg); - - /* add the instructions */ - curI = &curProg->SetupInst[curProg->cur_pass >> 1][dst - GL_REG_0_ATI]; - - curI->Opcode = ATI_FRAGMENT_SHADER_SAMPLE_OP; - curI->src = interp; - curI->swizzle = swizzle; - -#if MESA_DEBUG_ATI_FS - _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__, - _mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(interp), - _mesa_lookup_enum_by_nr(swizzle)); -#endif -} - -static void -_mesa_FragmentOpXATI(GLint optype, GLuint arg_count, GLenum op, GLuint dst, - GLuint dstMask, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, - GLuint arg3Rep, GLuint arg3Mod) -{ - GET_CURRENT_CONTEXT(ctx); - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; - GLint ci; - struct atifs_instruction *curI; - GLuint modtemp = dstMod & ~GL_SATURATE_BIT_ATI; - - if (!ctx->ATIFragmentShader.Compiling) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(outsideShader)"); - return; - } - - if (curProg->cur_pass==0) - curProg->cur_pass=1; - - else if (curProg->cur_pass==2) - curProg->cur_pass=3; - - /* decide whether this is a new instruction or not ... all color instructions are new, - and alpha instructions might also be new if there was no preceding color inst */ - if ((optype == 0) || (curProg->last_optype == optype)) { - if (curProg->numArithInstr[curProg->cur_pass >> 1] > 7) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(instrCount)"); - return; - } - /* easier to do that here slight side effect invalid instr will still be inserted as nops */ - match_pair_inst(curProg, optype); - new_arith_inst(curProg); - } - curProg->last_optype = optype; - ci = curProg->numArithInstr[curProg->cur_pass >> 1] - 1; - - /* add the instructions */ - curI = &curProg->Instructions[curProg->cur_pass >> 1][ci]; - - /* error checking */ - if ((dst < GL_REG_0_ATI) || (dst > GL_REG_5_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "C/AFragmentOpATI(dst)"); - return; - } - if ((modtemp != GL_NONE) && (modtemp != GL_2X_BIT_ATI) && - (modtemp != GL_4X_BIT_ATI) && (modtemp != GL_8X_BIT_ATI) && - (modtemp != GL_HALF_BIT_ATI) && !(modtemp != GL_QUARTER_BIT_ATI) && - (modtemp != GL_EIGHTH_BIT_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "C/AFragmentOpATI(dstMod)%x", modtemp); - return; - } - /* op checking? Actually looks like that's missing in the spec but we'll do it anyway */ - if (((op < GL_ADD_ATI) || (op > GL_DOT2_ADD_ATI)) && !(op == GL_MOV_ATI)) { - _mesa_error(ctx, GL_INVALID_ENUM, "C/AFragmentOpATI(op)"); - return; - } - if (optype == 1) { - if (((op == GL_DOT2_ADD_ATI) && (curI->Opcode[0] != GL_DOT2_ADD_ATI)) || - ((op == GL_DOT3_ATI) && (curI->Opcode[0] != GL_DOT3_ATI)) || - ((op == GL_DOT4_ATI) && (curI->Opcode[0] != GL_DOT4_ATI)) || - ((op != GL_DOT4_ATI) && (curI->Opcode[0] == GL_DOT4_ATI))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "AFragmentOpATI(op)"); - return; - } - } - if ((op == GL_DOT4_ATI) && - (((arg1 == GL_SECONDARY_INTERPOLATOR_ATI) && ((arg1Rep == GL_ALPHA) || (arg1Rep == GL_NONE))) || - (((arg2 == GL_SECONDARY_INTERPOLATOR_ATI) && ((arg2Rep == GL_ALPHA) || (arg2Rep == GL_NONE)))))) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(sec_interp)"); - } - - if (!check_arith_arg(curProg, optype, arg1, arg1Rep)) { - return; - } - if (arg2) { - if (!check_arith_arg(curProg, optype, arg2, arg2Rep)) { - return; - } - } - if (arg3) { - if (!check_arith_arg(curProg, optype, arg3, arg3Rep)) { - return; - } - if ((arg1 >= GL_CON_0_ATI) && (arg1 <= GL_CON_7_ATI) && - (arg2 >= GL_CON_0_ATI) && (arg2 <= GL_CON_7_ATI) && - (arg3 >= GL_CON_0_ATI) && (arg3 <= GL_CON_7_ATI) && - (arg1 != arg2) && (arg1 != arg3) && (arg2 != arg3)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "C/AFragmentOpATI(3Consts)"); - return; - } - } - - /* all ok - not all fully validated though (e.g. argNMod - spec doesn't say anything) */ - - curI->Opcode[optype] = op; - curI->SrcReg[optype][0].Index = arg1; - curI->SrcReg[optype][0].argRep = arg1Rep; - curI->SrcReg[optype][0].argMod = arg1Mod; - curI->ArgCount[optype] = arg_count; - - if (arg2) { - curI->SrcReg[optype][1].Index = arg2; - curI->SrcReg[optype][1].argRep = arg2Rep; - curI->SrcReg[optype][1].argMod = arg2Mod; - } - - if (arg3) { - curI->SrcReg[optype][2].Index = arg3; - curI->SrcReg[optype][2].argRep = arg3Rep; - curI->SrcReg[optype][2].argMod = arg3Mod; - } - - curI->DstReg[optype].Index = dst; - curI->DstReg[optype].dstMod = dstMod; - curI->DstReg[optype].dstMask = dstMask; - -#if MESA_DEBUG_ATI_FS - debug_op(optype, arg_count, op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); -#endif - -} - -void GLAPIENTRY -_mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_COLOR_OP, 1, op, dst, dstMask, - dstMod, arg1, arg1Rep, arg1Mod, 0, 0, 0, 0, 0, 0); -} - -void GLAPIENTRY -_mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, - GLuint arg2Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_COLOR_OP, 2, op, dst, dstMask, - dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, - arg2Mod, 0, 0, 0); -} - -void GLAPIENTRY -_mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, - GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, - GLuint arg3Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_COLOR_OP, 3, op, dst, dstMask, - dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, - arg2Mod, arg3, arg3Rep, arg3Mod); -} - -void GLAPIENTRY -_mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_ALPHA_OP, 1, op, dst, 0, dstMod, - arg1, arg1Rep, arg1Mod, 0, 0, 0, 0, 0, 0); -} - -void GLAPIENTRY -_mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_ALPHA_OP, 2, op, dst, 0, dstMod, - arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, 0, 0, - 0); -} - -void GLAPIENTRY -_mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, - GLuint arg3Rep, GLuint arg3Mod) -{ - _mesa_FragmentOpXATI(ATI_FRAGMENT_SHADER_ALPHA_OP, 3, op, dst, 0, dstMod, - arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, - arg3Rep, arg3Mod); -} - -void GLAPIENTRY -_mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value) -{ - GLuint dstindex; - GET_CURRENT_CONTEXT(ctx); - - if ((dst < GL_CON_0_ATI) || (dst > GL_CON_7_ATI)) { - /* spec says nothing about what should happen here but we can't just segfault...*/ - _mesa_error(ctx, GL_INVALID_ENUM, "glSetFragmentShaderConstantATI(dst)"); - return; - } - - dstindex = dst - GL_CON_0_ATI; - if (ctx->ATIFragmentShader.Compiling) { - struct ati_fragment_shader *curProg = ctx->ATIFragmentShader.Current; - COPY_4V(curProg->Constants[dstindex], value); - curProg->LocalConstDef |= 1 << dstindex; - } - else { - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - COPY_4V(ctx->ATIFragmentShader.GlobalConstants[dstindex], value); - } -} diff --git a/src/libs/mesa/mesa/shader/atifragshader.h b/src/libs/mesa/mesa/shader/atifragshader.h deleted file mode 100644 index 32fb3a8019..0000000000 --- a/src/libs/mesa/mesa/shader/atifragshader.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Mesa 3-D graphics library ATI Fragment Shader - * - * Copyright (C) 2004 David Airlie All Rights Reserved. - * - */ - -#ifndef ATIFRAGSHADER_H -#define ATIFRAGSHADER_H - -#define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8 -#define MAX_NUM_PASSES_ATI 2 -#define MAX_NUM_FRAGMENT_REGISTERS_ATI 6 - -struct ati_fs_opcode_st -{ - GLenum opcode; - GLint num_src_args; -}; - -extern struct ati_fs_opcode_st ati_fs_opcodes[]; - -struct atifragshader_src_register -{ - GLuint Index; - GLuint argRep; - GLuint argMod; -}; - -struct atifragshader_dst_register -{ - GLuint Index; - GLuint dstMod; - GLuint dstMask; -}; - -#define ATI_FRAGMENT_SHADER_COLOR_OP 0 -#define ATI_FRAGMENT_SHADER_ALPHA_OP 1 -#define ATI_FRAGMENT_SHADER_PASS_OP 2 -#define ATI_FRAGMENT_SHADER_SAMPLE_OP 3 - -/* two opcodes - one for color/one for alpha */ -/* up to three source registers for most ops */ -struct atifs_instruction -{ - GLenum Opcode[2]; - GLuint ArgCount[2]; - struct atifragshader_src_register SrcReg[2][3]; - struct atifragshader_dst_register DstReg[2]; -}; - -/* different from arithmetic shader instruction */ -struct atifs_setupinst -{ - GLenum Opcode; - GLuint src; - GLenum swizzle; -}; - - -extern struct ati_fragment_shader * -_mesa_new_ati_fragment_shader(GLcontext *ctx, GLuint id); - -extern void -_mesa_delete_ati_fragment_shader(GLcontext *ctx, - struct ati_fragment_shader *s); - - -extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range); - -extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id); - -extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id); - -extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void); - -extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void); - -extern void GLAPIENTRY -_mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle); - -extern void GLAPIENTRY -_mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle); - -extern void GLAPIENTRY -_mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod); - -extern void GLAPIENTRY -_mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, - GLuint arg2Mod); - -extern void GLAPIENTRY -_mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, - GLuint dstMod, GLuint arg1, GLuint arg1Rep, - GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, - GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, - GLuint arg3Mod); - -extern void GLAPIENTRY -_mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod); - -extern void GLAPIENTRY -_mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod); - -extern void GLAPIENTRY -_mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, - GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, - GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, - GLuint arg3Rep, GLuint arg3Mod); - -extern void GLAPIENTRY -_mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value); - -#endif diff --git a/src/libs/mesa/mesa/shader/grammar/grammar.c b/src/libs/mesa/mesa/shader/grammar/grammar.c deleted file mode 100644 index a9775961d3..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar.c +++ /dev/null @@ -1,3178 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file grammar.c - * syntax parsing engine - * \author Michal Krol - */ - -#ifndef GRAMMAR_PORT_BUILD -#error Do not build this file directly, build your grammar_XXX.c instead, which includes this file -#endif - -/* -*/ - -/* - INTRODUCTION - ------------ - - The task is to check the syntax of an input string. Input string is a stream of ASCII - characters terminated with a null-character ('\0'). Checking it using C language is - difficult and hard to implement without bugs. It is hard to maintain and make changes when - the syntax changes. - - This is because of a high redundancy of the C code. Large blocks of code are duplicated with - only small changes. Even use of macros does not solve the problem because macros cannot - erase the complexity of the problem. - - The resolution is to create a new language that will be highly oriented to our task. Once - we describe a particular syntax, we are done. We can then focus on the code that implements - the language. The size and complexity of it is relatively small than the code that directly - checks the syntax. - - First, we must implement our new language. Here, the language is implemented in C, but it - could also be implemented in any other language. The code is listed below. We must take - a good care that it is bug free. This is simple because the code is simple and clean. - - Next, we must describe the syntax of our new language in itself. Once created and checked - manually that it is correct, we can use it to check another scripts. - - Note that our new language loading code does not have to check the syntax. It is because we - assume that the script describing itself is correct, and other scripts can be syntactically - checked by the former script. The loading code must only do semantic checking which leads us to - simple resolving references. - - THE LANGUAGE - ------------ - - Here I will describe the syntax of the new language (further called "Synek"). It is mainly a - sequence of declarations terminated by a semicolon. The declaration consists of a symbol, - which is an identifier, and its definition. A definition is in turn a sequence of specifiers - connected with ".and" or ".or" operator. These operators cannot be mixed together in a one - definition. Specifier can be a symbol, string, character, character range or a special - keyword ".true" or ".false". - - On the very beginning of the script there is a declaration of a root symbol and is in the form: - .syntax ; - The must be on of the symbols in declaration sequence. The syntax is correct if - the root symbol evaluates to true. A symbol evaluates to true if the definition associated with - the symbol evaluates to true. Definition evaluation depends on the operator used to connect - specifiers in the definition. If ".and" operator is used, definition evaluates to true if and - only if all the specifiers evaluate to true. If ".or" operator is used, definition evalutes to - true if any of the specifiers evaluates to true. If definition contains only one specifier, - it is evaluated as if it was connected with ".true" keyword by ".and" operator. - - If specifier is a ".true" keyword, it always evaluates to true. - - If specifier is a ".false" keyword, it always evaluates to false. Specifier evaluates to false - when it does not evaluate to true. - - Character range specifier is in the form: - '' - '' - If specifier is a character range, it evaluates to true if character in the stream is greater - or equal to and less or equal to . In that situation - the stream pointer is advanced to point to next character in the stream. All C-style escape - sequences are supported although trigraph sequences are not. The comparisions are performed - on 8-bit unsigned integers. - - Character specifier is in the form: - '' - It evaluates to true if the following character range specifier evaluates to true: - '' - '' - - String specifier is in the form: - "" - Let N be the number of characters in . Let [i] designate i-th character in - . Then the string specifier evaluates to true if and only if for i in the range [0, N) - the following character specifier evaluates to true: - '[i]' - If [i] is a quotation mark, '[i]' is replaced with '\[i]'. - - Symbol specifier can be optionally preceded by a ".loop" keyword in the form: - .loop (1) - where is defined as follows: - ; (2) - Construction (1) is replaced by the following code: - - and declaration (2) is replaced by the following: - .or .true; - .and ; - ; - - Synek supports also a register mechanizm. User can, in its SYN file, declare a number of - registers that can be accessed in the syn body. Each reg has its name and a default value. - The register is one byte wide. The C code can change the default value by calling - grammar_set_reg8() with grammar id, register name and a new value. As we know, each rule is - a sequence of specifiers joined with .and or .or operator. And now each specifier can be - prefixed with a condition expression in a form ".if ( )" - where can be == or !=. If the condition evaluates to false, the specifier - evaluates to .false. Otherwise it evalutes to the specifier. - - ESCAPE SEQUENCES - ---------------- - - Synek supports all escape sequences in character specifiers. The mapping table is listed below. - All occurences of the characters in the first column are replaced with the corresponding - character in the second column. - - Escape sequence Represents - ------------------------------------------------------------------------------------------------ - \a Bell (alert) - \b Backspace - \f Formfeed - \n New line - \r Carriage return - \t Horizontal tab - \v Vertical tab - \' Single quotation mark - \" Double quotation mark - \\ Backslash - \? Literal question mark - \ooo ASCII character in octal notation - \xhhh ASCII character in hexadecimal notation - ------------------------------------------------------------------------------------------------ - - RAISING ERRORS - -------------- - - Any specifier can be followed by a special construction that is executed when the specifier - evaluates to false. The construction is in the form: - .error - is an identifier declared earlier by error text declaration. The declaration is - in the form: - .errtext "" - When specifier evaluates to false and this construction is present, parsing is stopped - immediately and is returned as a result of parsing. The error position is also - returned and it is meant as an offset from the beggining of the stream to the character that - was valid so far. Example: - - (**** syntax script ****) - - .syntax program; - .errtext MISSING_SEMICOLON "missing ';'" - program declaration .and .loop space .and ';' .error MISSING_SEMICOLON .and - .loop space .and '\0'; - declaration "declare" .and .loop space .and identifier; - space ' '; - - (**** sample code ****) - - declare foo , - - In the example above checking the sample code will result in error message "missing ';'" and - error position 12. The sample code is not correct. Note the presence of '\0' specifier to - assure that there is no code after semicolon - only spaces. - can optionally contain identifier surrounded by dollar signs $. In such a case, - the identifier and dollar signs are replaced by a string retrieved by invoking symbol with - the identifier name. The starting position is the error position. The lenght of the resulting - string is the position after invoking the symbol. - - PRODUCTION - ---------- - - Synek not only checks the syntax but it can also produce (emit) bytes associated with specifiers - that evaluate to true. That is, every specifier and optional error construction can be followed - by a number of emit constructions that are in the form: - .emit - can be a HEX number, identifier, a star * or a dollar $. HEX number is preceded by - 0x or 0X. If is an identifier, it must be earlier declared by emit code declaration - in the form: - .emtcode - - When given specifier evaluates to true, all emits associated with the specifier are output - in order they were declared. A star means that last-read character should be output instead - of constant value. Example: - - (**** syntax script ****) - - .syntax foobar; - .emtcode WORD_FOO 0x01 - .emtcode WORD_BAR 0x02 - foobar FOO .emit WORD_FOO .or BAR .emit WORD_BAR .or .true .emit 0x00; - FOO "foo" .and SPACE; - BAR "bar" .and SPACE; - SPACE ' ' .or '\0'; - - (**** sample text 1 ****) - - foo - - (**** sample text 2 ****) - - foobar - - For both samples the result will be one-element array. For first sample text it will be - value 1, for second - 0. Note that every text will be accepted because of presence of - .true as an alternative. - - Another example: - - (**** syntax script ****) - - .syntax declaration; - .emtcode VARIABLE 0x01 - declaration "declare" .and .loop space .and - identifier .emit VARIABLE .and (1) - .true .emit 0x00 .and (2) - .loop space .and ';'; - space ' ' .or '\t'; - identifier .loop id_char .emit *; (3) - id_char 'a'-'z' .or 'A'-'Z' .or '_'; - - (**** sample code ****) - - declare fubar; - - In specifier (1) symbol is followed by .emit VARIABLE. If it evaluates to - true, VARIABLE constant and then production of the symbol is output. Specifier (2) is used - to terminate the string with null to signal when the string ends. Specifier (3) outputs - all characters that make declared identifier. The result of sample code will be the - following array: - { 1, 'f', 'u', 'b', 'a', 'r', 0 } - - If .emit is followed by dollar $, it means that current position should be output. Current - position is a 32-bit unsigned integer distance from the very beginning of the parsed string to - first character consumed by the specifier associated with the .emit instruction. Current - position is stored in the output buffer in Little-Endian convention (the lowest byte comes - first). -*/ - -#include - -static void mem_free (void **); - -/* - internal error messages -*/ -static const byte *OUT_OF_MEMORY = (byte *) "internal error 1001: out of physical memory"; -static const byte *UNRESOLVED_REFERENCE = (byte *) "internal error 1002: unresolved reference '$'"; -static const byte *INVALID_GRAMMAR_ID = (byte *) "internal error 1003: invalid grammar object"; -static const byte *INVALID_REGISTER_NAME = (byte *) "internal error 1004: invalid register name: '$'"; -/*static const byte *DUPLICATE_IDENTIFIER = (byte *) "internal error 1005: identifier '$' already defined";*/ -static const byte *UNREFERENCED_IDENTIFIER =(byte *) "internal error 1006: unreferenced identifier '$'"; - -static const byte *error_message = NULL; /* points to one of the error messages above */ -static byte *error_param = NULL; /* this is inserted into error_message in place of $ */ -static int error_position = -1; - -static byte *unknown = (byte *) "???"; - -static void clear_last_error (void) -{ - /* reset error message */ - error_message = NULL; - - /* free error parameter - if error_param is a "???" don't free it - it's static */ - if (error_param != unknown) - mem_free ((void **) (void *) &error_param); - else - error_param = NULL; - - /* reset error position */ - error_position = -1; -} - -static void set_last_error (const byte *msg, byte *param, int pos) -{ - /* error message can be set only once */ - if (error_message != NULL) - { - mem_free ((void **) (void *) ¶m); - return; - } - - error_message = msg; - - /* if param is NULL, set error_param to unknown ("???") */ - /* note: do not try to strdup the "???" - it may be that we are here because of */ - /* out of memory error so strdup can fail */ - if (param != NULL) - error_param = param; - else - error_param = unknown; - - error_position = pos; -} - -/* - memory management routines -*/ -static void *mem_alloc (size_t size) -{ - void *ptr = grammar_alloc_malloc (size); - if (ptr == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return ptr; -} - -static void *mem_copy (void *dst, const void *src, size_t size) -{ - return grammar_memory_copy (dst, src, size); -} - -static void mem_free (void **ptr) -{ - grammar_alloc_free (*ptr); - *ptr = NULL; -} - -static void *mem_realloc (void *ptr, size_t old_size, size_t new_size) -{ - void *ptr2 = grammar_alloc_realloc (ptr, old_size, new_size); - if (ptr2 == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return ptr2; -} - -static byte *str_copy_n (byte *dst, const byte *src, size_t max_len) -{ - return grammar_string_copy_n (dst, src, max_len); -} - -static byte *str_duplicate (const byte *str) -{ - byte *new_str = grammar_string_duplicate (str); - if (new_str == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return new_str; -} - -static int str_equal (const byte *str1, const byte *str2) -{ - return grammar_string_compare (str1, str2) == 0; -} - -static int str_equal_n (const byte *str1, const byte *str2, unsigned int n) -{ - return grammar_string_compare_n (str1, str2, n) == 0; -} - -static int -str_length (const byte *str) -{ - return (int) (grammar_string_length (str)); -} - -/* - useful macros -*/ -#define GRAMMAR_IMPLEMENT_LIST_APPEND(_Ty)\ - static void _Ty##_append (_Ty **x, _Ty *nx) {\ - while (*x) x = &(**x).next;\ - *x = nx;\ - } - -/* - string to byte map typedef -*/ -typedef struct map_byte_ -{ - byte *key; - byte data; - struct map_byte_ *next; -} map_byte; - -static void map_byte_create (map_byte **ma) -{ - *ma = (map_byte *) mem_alloc (sizeof (map_byte)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = '\0'; - (**ma).next = NULL; - } -} - -static void map_byte_destroy (map_byte **ma) -{ - if (*ma) - { - map_byte_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_byte) - -/* - searches the map for the specified key, - returns pointer to the element with the specified key if it exists - returns NULL otherwise -*/ -static map_byte *map_byte_locate (map_byte **ma, const byte *key) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - return *ma; - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return NULL; -} - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the key is matched, - returns 1 otherwise -*/ -static int map_byte_find (map_byte **ma, const byte *key, byte *data) -{ - map_byte *found = map_byte_locate (ma, key); - if (found != NULL) - { - *data = found->data; - - return 0; - } - - return 1; -} - -/* - regbyte context typedef - - Each regbyte consists of its name and a default value. These are static and created at - grammar script compile-time, for example the following line: - .regbyte vertex_blend 0x00 - adds a new regbyte named "vertex_blend" to the static list and initializes it to 0. - When the script is executed, this regbyte can be accessed by name for read and write. When a - particular regbyte is written, a new regbyte_ctx entry is added to the top of the regbyte_ctx - stack. The new entry contains information abot which regbyte it references and its new value. - When a given regbyte is accessed for read, the stack is searched top-down to find an - entry that references the regbyte. The first matching entry is used to return the current - value it holds. If no entry is found, the default value is returned. -*/ -typedef struct regbyte_ctx_ -{ - map_byte *m_regbyte; - byte m_current_value; - struct regbyte_ctx_ *m_prev; -} regbyte_ctx; - -static void regbyte_ctx_create (regbyte_ctx **re) -{ - *re = (regbyte_ctx *) mem_alloc (sizeof (regbyte_ctx)); - if (*re) - { - (**re).m_regbyte = NULL; - (**re).m_prev = NULL; - } -} - -static void regbyte_ctx_destroy (regbyte_ctx **re) -{ - if (*re) - { - mem_free ((void **) re); - } -} - -static byte regbyte_ctx_extract (regbyte_ctx **re, map_byte *reg) -{ - /* first lookup in the register stack */ - while (*re != NULL) - { - if ((**re).m_regbyte == reg) - return (**re).m_current_value; - - re = &(**re).m_prev; - } - - /* if not found - return the default value */ - return reg->data; -} - -/* - emit type typedef -*/ -typedef enum emit_type_ -{ - et_byte, /* explicit number */ - et_stream, /* eaten character */ - et_position /* current position */ -} emit_type; - -/* - emit destination typedef -*/ -typedef enum emit_dest_ -{ - ed_output, /* write to the output buffer */ - ed_regbyte /* write a particular regbyte */ -} emit_dest; - -/* - emit typedef -*/ -typedef struct emit_ -{ - emit_dest m_emit_dest; - emit_type m_emit_type; /* ed_output */ - byte m_byte; /* et_byte */ - map_byte *m_regbyte; /* ed_regbyte */ - byte *m_regname; /* ed_regbyte - temporary */ - struct emit_ *m_next; -} emit; - -static void emit_create (emit **em) -{ - *em = (emit *) mem_alloc (sizeof (emit)); - if (*em) - { - (**em).m_emit_dest = ed_output; - (**em).m_emit_type = et_byte; - (**em).m_byte = '\0'; - (**em).m_regbyte = NULL; - (**em).m_regname = NULL; - (**em).m_next = NULL; - } -} - -static void emit_destroy (emit **em) -{ - if (*em) - { - emit_destroy (&(**em).m_next); - mem_free ((void **) &(**em).m_regname); - mem_free ((void **) em); - } -} - -static unsigned int emit_size (emit *_E) -{ - unsigned int n = 0; - - while (_E != NULL) - { - if (_E->m_emit_dest == ed_output) - { - if (_E->m_emit_type == et_position) - n += 4; /* position is a 32-bit unsigned integer */ - else - n++; - } - _E = _E->m_next; - } - - return n; -} - -static int emit_push (emit *_E, byte *_P, byte c, unsigned int _Pos, regbyte_ctx **_Ctx) -{ - while (_E != NULL) - { - if (_E->m_emit_dest == ed_output) - { - if (_E->m_emit_type == et_byte) - *_P++ = _E->m_byte; - else if (_E->m_emit_type == et_stream) - *_P++ = c; - else /* _Em->type == et_position */ - { - *_P++ = (byte) (_Pos); - *_P++ = (byte) (_Pos >> 8); - *_P++ = (byte) (_Pos >> 16); - *_P++ = (byte) (_Pos >> 24); - } - } - else - { - regbyte_ctx *new_rbc; - regbyte_ctx_create (&new_rbc); - if (new_rbc == NULL) - return 1; - - new_rbc->m_prev = *_Ctx; - new_rbc->m_regbyte = _E->m_regbyte; - *_Ctx = new_rbc; - - if (_E->m_emit_type == et_byte) - new_rbc->m_current_value = _E->m_byte; - else if (_E->m_emit_type == et_stream) - new_rbc->m_current_value = c; - } - - _E = _E->m_next; - } - - return 0; -} - -/* - error typedef -*/ -typedef struct error_ -{ - byte *m_text; - byte *m_token_name; - struct rule_ *m_token; -} error; - -static void error_create (error **er) -{ - *er = (error *) mem_alloc (sizeof (error)); - if (*er) - { - (**er).m_text = NULL; - (**er).m_token_name = NULL; - (**er).m_token = NULL; - } -} - -static void error_destroy (error **er) -{ - if (*er) - { - mem_free ((void **) &(**er).m_text); - mem_free ((void **) &(**er).m_token_name); - mem_free ((void **) er); - } -} - -struct dict_; - -static byte * -error_get_token (error *, struct dict_ *, const byte *, int); - -/* - condition operand type typedef -*/ -typedef enum cond_oper_type_ -{ - cot_byte, /* constant 8-bit unsigned integer */ - cot_regbyte /* pointer to byte register containing the current value */ -} cond_oper_type; - -/* - condition operand typedef -*/ -typedef struct cond_oper_ -{ - cond_oper_type m_type; - byte m_byte; /* cot_byte */ - map_byte *m_regbyte; /* cot_regbyte */ - byte *m_regname; /* cot_regbyte - temporary */ -} cond_oper; - -/* - condition type typedef -*/ -typedef enum cond_type_ -{ - ct_equal, - ct_not_equal -} cond_type; - -/* - condition typedef -*/ -typedef struct cond_ -{ - cond_type m_type; - cond_oper m_operands[2]; -} cond; - -static void cond_create (cond **co) -{ - *co = (cond *) mem_alloc (sizeof (cond)); - if (*co) - { - (**co).m_operands[0].m_regname = NULL; - (**co).m_operands[1].m_regname = NULL; - } -} - -static void cond_destroy (cond **co) -{ - if (*co) - { - mem_free ((void **) &(**co).m_operands[0].m_regname); - mem_free ((void **) &(**co).m_operands[1].m_regname); - mem_free ((void **) co); - } -} - -/* - specifier type typedef -*/ -typedef enum spec_type_ -{ - st_false, - st_true, - st_byte, - st_byte_range, - st_string, - st_identifier, - st_identifier_loop, - st_debug -} spec_type; - -/* - specifier typedef -*/ -typedef struct spec_ -{ - spec_type m_spec_type; - byte m_byte[2]; /* st_byte, st_byte_range */ - byte *m_string; /* st_string */ - struct rule_ *m_rule; /* st_identifier, st_identifier_loop */ - emit *m_emits; - error *m_errtext; - cond *m_cond; - struct spec_ *next; -} spec; - -static void spec_create (spec **sp) -{ - *sp = (spec *) mem_alloc (sizeof (spec)); - if (*sp) - { - (**sp).m_spec_type = st_false; - (**sp).m_byte[0] = '\0'; - (**sp).m_byte[1] = '\0'; - (**sp).m_string = NULL; - (**sp).m_rule = NULL; - (**sp).m_emits = NULL; - (**sp).m_errtext = NULL; - (**sp).m_cond = NULL; - (**sp).next = NULL; - } -} - -static void spec_destroy (spec **sp) -{ - if (*sp) - { - spec_destroy (&(**sp).next); - emit_destroy (&(**sp).m_emits); - error_destroy (&(**sp).m_errtext); - mem_free ((void **) &(**sp).m_string); - cond_destroy (&(**sp).m_cond); - mem_free ((void **) sp); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(spec) - -/* - operator typedef -*/ -typedef enum oper_ -{ - op_none, - op_and, - op_or -} oper; - -/* - rule typedef -*/ -typedef struct rule_ -{ - oper m_oper; - spec *m_specs; - struct rule_ *next; - int m_referenced; -} rule; - -static void rule_create (rule **ru) -{ - *ru = (rule *) mem_alloc (sizeof (rule)); - if (*ru) - { - (**ru).m_oper = op_none; - (**ru).m_specs = NULL; - (**ru).next = NULL; - (**ru).m_referenced = 0; - } -} - -static void rule_destroy (rule **ru) -{ - if (*ru) - { - rule_destroy (&(**ru).next); - spec_destroy (&(**ru).m_specs); - mem_free ((void **) ru); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(rule) - -/* - returns unique grammar id -*/ -static grammar next_valid_grammar_id (void) -{ - static grammar id = 0; - - return ++id; -} - -/* - dictionary typedef -*/ -typedef struct dict_ -{ - rule *m_rulez; - rule *m_syntax; - rule *m_string; - map_byte *m_regbytes; - grammar m_id; - struct dict_ *next; -} dict; - -static void dict_create (dict **di) -{ - *di = (dict *) mem_alloc (sizeof (dict)); - if (*di) - { - (**di).m_rulez = NULL; - (**di).m_syntax = NULL; - (**di).m_string = NULL; - (**di).m_regbytes = NULL; - (**di).m_id = next_valid_grammar_id (); - (**di).next = NULL; - } -} - -static void dict_destroy (dict **di) -{ - if (*di) - { - rule_destroy (&(**di).m_rulez); - map_byte_destroy (&(**di).m_regbytes); - mem_free ((void **) di); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(dict) - -static void dict_find (dict **di, grammar key, dict **data) -{ - while (*di) - { - if ((**di).m_id == key) - { - *data = *di; - return; - } - - di = &(**di).next; - } - - *data = NULL; -} - -static dict *g_dicts = NULL; - -/* - byte array typedef -*/ -typedef struct barray_ -{ - byte *data; - unsigned int len; -} barray; - -static void barray_create (barray **ba) -{ - *ba = (barray *) mem_alloc (sizeof (barray)); - if (*ba) - { - (**ba).data = NULL; - (**ba).len = 0; - } -} - -static void barray_destroy (barray **ba) -{ - if (*ba) - { - mem_free ((void **) &(**ba).data); - mem_free ((void **) ba); - } -} - -/* - reallocates byte array to requested size, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_resize (barray **ba, unsigned int nlen) -{ - byte *new_pointer; - - if (nlen == 0) - { - mem_free ((void **) &(**ba).data); - (**ba).data = NULL; - (**ba).len = 0; - - return 0; - } - else - { - new_pointer = (byte *) mem_realloc ((**ba).data, (**ba).len * sizeof (byte), - nlen * sizeof (byte)); - if (new_pointer) - { - (**ba).data = new_pointer; - (**ba).len = nlen; - - return 0; - } - } - - return 1; -} - -/* - adds byte array pointed by *nb to the end of array pointed by *ba, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_append (barray **ba, barray **nb) -{ - const unsigned int len = (**ba).len; - - if (barray_resize (ba, (**ba).len + (**nb).len)) - return 1; - - mem_copy ((**ba).data + len, (**nb).data, (**nb).len); - - return 0; -} - -/* - adds emit chain pointed by em to the end of array pointed by *ba, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_push (barray **ba, emit *em, byte c, unsigned int pos, regbyte_ctx **rbc) -{ - unsigned int count = emit_size (em); - - if (barray_resize (ba, (**ba).len + count)) - return 1; - - return emit_push (em, (**ba).data + ((**ba).len - count), c, pos, rbc); -} - -/* - byte pool typedef -*/ -typedef struct bytepool_ -{ - byte *_F; - unsigned int _Siz; -} bytepool; - -static void bytepool_destroy (bytepool **by) -{ - if (*by != NULL) - { - mem_free ((void **) &(**by)._F); - mem_free ((void **) by); - } -} - -static void bytepool_create (bytepool **by, int len) -{ - *by = (bytepool *) (mem_alloc (sizeof (bytepool))); - if (*by != NULL) - { - (**by)._F = (byte *) (mem_alloc (sizeof (byte) * len)); - (**by)._Siz = len; - - if ((**by)._F == NULL) - bytepool_destroy (by); - } -} - -static int bytepool_reserve (bytepool *by, unsigned int n) -{ - byte *_P; - - if (n <= by->_Siz) - return 0; - - /* byte pool can only grow and at least by doubling its size */ - n = n >= by->_Siz * 2 ? n : by->_Siz * 2; - - /* reallocate the memory and adjust pointers to the new memory location */ - _P = (byte *) (mem_realloc (by->_F, sizeof (byte) * by->_Siz, sizeof (byte) * n)); - if (_P != NULL) - { - by->_F = _P; - by->_Siz = n; - return 0; - } - - return 1; -} - -/* - string to string map typedef -*/ -typedef struct map_str_ -{ - byte *key; - byte *data; - struct map_str_ *next; -} map_str; - -static void map_str_create (map_str **ma) -{ - *ma = (map_str *) mem_alloc (sizeof (map_str)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = NULL; - (**ma).next = NULL; - } -} - -static void map_str_destroy (map_str **ma) -{ - if (*ma) - { - map_str_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) &(**ma).data); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_str) - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the key is matched, - returns 1 otherwise -*/ -static int map_str_find (map_str **ma, const byte *key, byte **data) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - { - *data = str_duplicate ((**ma).data); - if (*data == NULL) - return 1; - - return 0; - } - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return 1; -} - -/* - string to rule map typedef -*/ -typedef struct map_rule_ -{ - byte *key; - rule *data; - struct map_rule_ *next; -} map_rule; - -static void map_rule_create (map_rule **ma) -{ - *ma = (map_rule *) mem_alloc (sizeof (map_rule)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = NULL; - (**ma).next = NULL; - } -} - -static void map_rule_destroy (map_rule **ma) -{ - if (*ma) - { - map_rule_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_rule) - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the is matched, - returns 1 otherwise -*/ -static int map_rule_find (map_rule **ma, const byte *key, rule **data) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - { - *data = (**ma).data; - - return 0; - } - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return 1; -} - -/* - returns 1 if given character is a white space, - returns 0 otherwise -*/ -static int is_space (byte c) -{ - return c == ' ' || c == '\t' || c == '\n' || c == '\r'; -} - -/* - advances text pointer by 1 if character pointed by *text is a space, - returns 1 if a space has been eaten, - returns 0 otherwise -*/ -static int eat_space (const byte **text) -{ - if (is_space (**text)) - { - (*text)++; - - return 1; - } - - return 0; -} - -/* - returns 1 if text points to C-style comment start string, - returns 0 otherwise -*/ -static int is_comment_start (const byte *text) -{ - return text[0] == '/' && text[1] == '*'; -} - -/* - advances text pointer to first character after C-style comment block - if any, - returns 1 if C-style comment block has been encountered and eaten, - returns 0 otherwise -*/ -static int eat_comment (const byte **text) -{ - if (is_comment_start (*text)) - { - /* *text points to comment block - skip two characters to enter comment body */ - *text += 2; - /* skip any character except consecutive '*' and '/' */ - while (!((*text)[0] == '*' && (*text)[1] == '/')) - (*text)++; - /* skip those two terminating characters */ - *text += 2; - - return 1; - } - - return 0; -} - -/* - advances text pointer to first character that is neither space nor C-style comment block -*/ -static void eat_spaces (const byte **text) -{ - while (eat_space (text) || eat_comment (text)) - ; -} - -/* - resizes string pointed by *ptr to successfully add character c to the end of the string, - returns 0 on success, - returns 1 otherwise -*/ -static int string_grow (byte **ptr, unsigned int *len, byte c) -{ - /* reallocate the string in 16-byte increments */ - if ((*len & 0x0F) == 0x0F || *ptr == NULL) - { - byte *tmp = (byte *) mem_realloc (*ptr, ((*len + 1) & ~0x0F) * sizeof (byte), - ((*len + 1 + 0x10) & ~0x0F) * sizeof (byte)); - if (tmp == NULL) - return 1; - - *ptr = tmp; - } - - if (c) - { - /* append given character */ - (*ptr)[*len] = c; - (*len)++; - } - (*ptr)[*len] = '\0'; - - return 0; -} - -/* - returns 1 if given character is a valid identifier character a-z, A-Z, 0-9 or _ - returns 0 otherwise -*/ -static int is_identifier (byte c) -{ - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; -} - -/* - copies characters from *text to *id until non-identifier character is encountered, - assumes that *id points to NULL object - caller is responsible for later freeing the string, - text pointer is advanced to point past the copied identifier, - returns 0 if identifier was successfully copied, - returns 1 otherwise -*/ -static int get_identifier (const byte **text, byte **id) -{ - const byte *t = *text; - byte *p = NULL; - unsigned int len = 0; - - if (string_grow (&p, &len, '\0')) - return 1; - - /* loop while next character in buffer is valid for identifiers */ - while (is_identifier (*t)) - { - if (string_grow (&p, &len, *t++)) - { - mem_free ((void **) (void *) &p); - return 1; - } - } - - *text = t; - *id = p; - - return 0; -} - -/* - converts sequence of DEC digits pointed by *text until non-DEC digit is encountered, - advances text pointer past the converted sequence, - returns the converted value -*/ -static unsigned int dec_convert (const byte **text) -{ - unsigned int value = 0; - - while (**text >= '0' && **text <= '9') - { - value = value * 10 + **text - '0'; - (*text)++; - } - - return value; -} - -/* - returns 1 if given character is HEX digit 0-9, A-F or a-f, - returns 0 otherwise -*/ -static int is_hex (byte c) -{ - return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); -} - -/* - returns value of passed character as if it was HEX digit -*/ -static unsigned int hex2dec (byte c) -{ - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - return c - 'a' + 10; -} - -/* - converts sequence of HEX digits pointed by *text until non-HEX digit is encountered, - advances text pointer past the converted sequence, - returns the converted value -*/ -static unsigned int hex_convert (const byte **text) -{ - unsigned int value = 0; - - while (is_hex (**text)) - { - value = value * 0x10 + hex2dec (**text); - (*text)++; - } - - return value; -} - -/* - returns 1 if given character is OCT digit 0-7, - returns 0 otherwise -*/ -static int is_oct (byte c) -{ - return c >= '0' && c <= '7'; -} - -/* - returns value of passed character as if it was OCT digit -*/ -static int oct2dec (byte c) -{ - return c - '0'; -} - -static byte get_escape_sequence (const byte **text) -{ - int value = 0; - - /* skip '\' character */ - (*text)++; - - switch (*(*text)++) - { - case '\'': - return '\''; - case '"': - return '\"'; - case '?': - return '\?'; - case '\\': - return '\\'; - case 'a': - return '\a'; - case 'b': - return '\b'; - case 'f': - return '\f'; - case 'n': - return '\n'; - case 'r': - return '\r'; - case 't': - return '\t'; - case 'v': - return '\v'; - case 'x': - return (byte) hex_convert (text); - } - - (*text)--; - if (is_oct (**text)) - { - value = oct2dec (*(*text)++); - if (is_oct (**text)) - { - value = value * 010 + oct2dec (*(*text)++); - if (is_oct (**text)) - value = value * 010 + oct2dec (*(*text)++); - } - } - - return (byte) value; -} - -/* - copies characters from *text to *str until " or ' character is encountered, - assumes that *str points to NULL object - caller is responsible for later freeing the string, - assumes that *text points to " or ' character that starts the string, - text pointer is advanced to point past the " or ' character, - returns 0 if string was successfully copied, - returns 1 otherwise -*/ -static int get_string (const byte **text, byte **str) -{ - const byte *t = *text; - byte *p = NULL; - unsigned int len = 0; - byte term_char; - - if (string_grow (&p, &len, '\0')) - return 1; - - /* read " or ' character that starts the string */ - term_char = *t++; - /* while next character is not the terminating character */ - while (*t && *t != term_char) - { - byte c; - - if (*t == '\\') - c = get_escape_sequence (&t); - else - c = *t++; - - if (string_grow (&p, &len, c)) - { - mem_free ((void **) (void *) &p); - return 1; - } - } - /* skip " or ' character that ends the string */ - t++; - - *text = t; - *str = p; - return 0; -} - -/* - gets emit code, the syntax is: - ".emtcode" " " " " (("0x" | "0X") ) | | - assumes that *text already points to , - returns 0 if emit code is successfully read, - returns 1 otherwise -*/ -static int get_emtcode (const byte **text, map_byte **ma) -{ - const byte *t = *text; - map_byte *m = NULL; - - map_byte_create (&m); - if (m == NULL) - return 1; - - if (get_identifier (&t, &m->key)) - { - map_byte_destroy (&m); - return 1; - } - eat_spaces (&t); - - if (*t == '\'') - { - byte *c; - - if (get_string (&t, &c)) - { - map_byte_destroy (&m); - return 1; - } - - m->data = (byte) c[0]; - mem_free ((void **) (void *) &c); - } - else if (t[0] == '0' && (t[1] == 'x' || t[1] == 'X')) - { - /* skip HEX "0x" or "0X" prefix */ - t += 2; - m->data = (byte) hex_convert (&t); - } - else - { - m->data = (byte) dec_convert (&t); - } - - eat_spaces (&t); - - *text = t; - *ma = m; - return 0; -} - -/* - gets regbyte declaration, the syntax is: - ".regbyte" " " " " (("0x" | "0X") ) | | - assumes that *text already points to , - returns 0 if regbyte is successfully read, - returns 1 otherwise -*/ -static int get_regbyte (const byte **text, map_byte **ma) -{ - /* pass it to the emtcode parser as it has the same syntax starting at */ - return get_emtcode (text, ma); -} - -/* - returns 0 on success, - returns 1 otherwise -*/ -static int get_errtext (const byte **text, map_str **ma) -{ - const byte *t = *text; - map_str *m = NULL; - - map_str_create (&m); - if (m == NULL) - return 1; - - if (get_identifier (&t, &m->key)) - { - map_str_destroy (&m); - return 1; - } - eat_spaces (&t); - - if (get_string (&t, &m->data)) - { - map_str_destroy (&m); - return 1; - } - eat_spaces (&t); - - *text = t; - *ma = m; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_error (const byte **text, error **er, map_str *maps) -{ - const byte *t = *text; - byte *temp = NULL; - - if (*t != '.') - return 0; - - t++; - if (get_identifier (&t, &temp)) - return 1; - eat_spaces (&t); - - if (!str_equal ((byte *) "error", temp)) - { - mem_free ((void **) (void *) &temp); - return 0; - } - - mem_free ((void **) (void *) &temp); - - error_create (er); - if (*er == NULL) - return 1; - - if (*t == '\"') - { - if (get_string (&t, &(**er).m_text)) - { - error_destroy (er); - return 1; - } - eat_spaces (&t); - } - else - { - if (get_identifier (&t, &temp)) - { - error_destroy (er); - return 1; - } - eat_spaces (&t); - - if (map_str_find (&maps, temp, &(**er).m_text)) - { - mem_free ((void **) (void *) &temp); - error_destroy (er); - return 1; - } - - mem_free ((void **) (void *) &temp); - } - - /* try to extract "token" from "...$token$..." */ - { - byte *processed = NULL; - unsigned int len = 0; - int i = 0; - - if (string_grow (&processed, &len, '\0')) - { - error_destroy (er); - return 1; - } - - while (i < str_length ((**er).m_text)) - { - /* check if the dollar sign is repeated - if so skip it */ - if ((**er).m_text[i] == '$' && (**er).m_text[i + 1] == '$') - { - if (string_grow (&processed, &len, '$')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i += 2; - } - else if ((**er).m_text[i] != '$') - { - if (string_grow (&processed, &len, (**er).m_text[i])) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i++; - } - else - { - if (string_grow (&processed, &len, '$')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - { - /* length of token being extracted */ - unsigned int tlen = 0; - - if (string_grow (&(**er).m_token_name, &tlen, '\0')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - /* skip the dollar sign */ - i++; - - while ((**er).m_text[i] != '$') - { - if (string_grow (&(**er).m_token_name, &tlen, (**er).m_text[i])) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i++; - } - - /* skip the dollar sign */ - i++; - } - } - } - - mem_free ((void **) &(**er).m_text); - (**er).m_text = processed; - } - - *text = t; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_emits (const byte **text, emit **em, map_byte *mapb) -{ - const byte *t = *text; - byte *temp = NULL; - emit *e = NULL; - emit_dest dest; - - if (*t != '.') - return 0; - - t++; - if (get_identifier (&t, &temp)) - return 1; - eat_spaces (&t); - - /* .emit */ - if (str_equal ((byte *) "emit", temp)) - dest = ed_output; - /* .load */ - else if (str_equal ((byte *) "load", temp)) - dest = ed_regbyte; - else - { - mem_free ((void **) (void *) &temp); - return 0; - } - - mem_free ((void **) (void *) &temp); - - emit_create (&e); - if (e == NULL) - return 1; - - e->m_emit_dest = dest; - - if (dest == ed_regbyte) - { - if (get_identifier (&t, &e->m_regname)) - { - emit_destroy (&e); - return 1; - } - eat_spaces (&t); - } - - /* 0xNN */ - if (*t == '0' && (t[1] == 'x' || t[1] == 'X')) - { - t += 2; - e->m_byte = (byte) hex_convert (&t); - - e->m_emit_type = et_byte; - } - /* NNN */ - else if (*t >= '0' && *t <= '9') - { - e->m_byte = (byte) dec_convert (&t); - - e->m_emit_type = et_byte; - } - /* * */ - else if (*t == '*') - { - t++; - - e->m_emit_type = et_stream; - } - /* $ */ - else if (*t == '$') - { - t++; - - e->m_emit_type = et_position; - } - /* 'c' */ - else if (*t == '\'') - { - if (get_string (&t, &temp)) - { - emit_destroy (&e); - return 1; - } - e->m_byte = (byte) temp[0]; - - mem_free ((void **) (void *) &temp); - - e->m_emit_type = et_byte; - } - else - { - if (get_identifier (&t, &temp)) - { - emit_destroy (&e); - return 1; - } - - if (map_byte_find (&mapb, temp, &e->m_byte)) - { - mem_free ((void **) (void *) &temp); - emit_destroy (&e); - return 1; - } - - mem_free ((void **) (void *) &temp); - - e->m_emit_type = et_byte; - } - - eat_spaces (&t); - - if (get_emits (&t, &e->m_next, mapb)) - { - emit_destroy (&e); - return 1; - } - - *text = t; - *em = e; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb) -{ - const byte *t = *text; - spec *s = NULL; - - spec_create (&s); - if (s == NULL) - return 1; - - /* first - read optional .if statement */ - if (*t == '.') - { - const byte *u = t; - byte *keyword = NULL; - - /* skip the dot */ - u++; - - if (get_identifier (&u, &keyword)) - { - spec_destroy (&s); - return 1; - } - - /* .if */ - if (str_equal ((byte *) "if", keyword)) - { - cond_create (&s->m_cond); - if (s->m_cond == NULL) - { - spec_destroy (&s); - return 1; - } - - /* skip the left paren */ - eat_spaces (&u); - u++; - - /* get the left operand */ - eat_spaces (&u); - if (get_identifier (&u, &s->m_cond->m_operands[0].m_regname)) - { - spec_destroy (&s); - return 1; - } - s->m_cond->m_operands[0].m_type = cot_regbyte; - - /* get the operator (!= or ==) */ - eat_spaces (&u); - if (*u == '!') - s->m_cond->m_type = ct_not_equal; - else - s->m_cond->m_type = ct_equal; - u += 2; - eat_spaces (&u); - - if (u[0] == '0' && (u[1] == 'x' || u[1] == 'X')) - { - /* skip the 0x prefix */ - u += 2; - - /* get the right operand */ - s->m_cond->m_operands[1].m_byte = hex_convert (&u); - s->m_cond->m_operands[1].m_type = cot_byte; - } - else /*if (*u >= '0' && *u <= '9')*/ - { - /* get the right operand */ - s->m_cond->m_operands[1].m_byte = dec_convert (&u); - s->m_cond->m_operands[1].m_type = cot_byte; - } - - /* skip the right paren */ - eat_spaces (&u); - u++; - - eat_spaces (&u); - - t = u; - } - - mem_free ((void **) (void *) &keyword); - } - - if (*t == '\'') - { - byte *temp = NULL; - - if (get_string (&t, &temp)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - if (*t == '-') - { - byte *temp2 = NULL; - - /* skip the '-' character */ - t++; - eat_spaces (&t); - - if (get_string (&t, &temp2)) - { - mem_free ((void **) (void *) &temp); - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_byte_range; - s->m_byte[0] = *temp; - s->m_byte[1] = *temp2; - - mem_free ((void **) (void *) &temp2); - } - else - { - s->m_spec_type = st_byte; - *s->m_byte = *temp; - } - - mem_free ((void **) (void *) &temp); - } - else if (*t == '"') - { - if (get_string (&t, &s->m_string)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_string; - } - else if (*t == '.') - { - byte *keyword = NULL; - - /* skip the dot */ - t++; - - if (get_identifier (&t, &keyword)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - /* .true */ - if (str_equal ((byte *) "true", keyword)) - { - s->m_spec_type = st_true; - } - /* .false */ - else if (str_equal ((byte *) "false", keyword)) - { - s->m_spec_type = st_false; - } - /* .debug */ - else if (str_equal ((byte *) "debug", keyword)) - { - s->m_spec_type = st_debug; - } - /* .loop */ - else if (str_equal ((byte *) "loop", keyword)) - { - if (get_identifier (&t, &s->m_string)) - { - mem_free ((void **) (void *) &keyword); - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_identifier_loop; - } - mem_free ((void **) (void *) &keyword); - } - else - { - if (get_identifier (&t, &s->m_string)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_identifier; - } - - if (get_error (&t, &s->m_errtext, maps)) - { - spec_destroy (&s); - return 1; - } - - if (get_emits (&t, &s->m_emits, mapb)) - { - spec_destroy (&s); - return 1; - } - - *text = t; - *sp = s; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_rule (const byte **text, rule **ru, map_str *maps, map_byte *mapb) -{ - const byte *t = *text; - rule *r = NULL; - - rule_create (&r); - if (r == NULL) - return 1; - - if (get_spec (&t, &r->m_specs, maps, mapb)) - { - rule_destroy (&r); - return 1; - } - - while (*t != ';') - { - byte *op = NULL; - spec *sp = NULL; - - /* skip the dot that precedes "and" or "or" */ - t++; - - /* read "and" or "or" keyword */ - if (get_identifier (&t, &op)) - { - rule_destroy (&r); - return 1; - } - eat_spaces (&t); - - if (r->m_oper == op_none) - { - /* .and */ - if (str_equal ((byte *) "and", op)) - r->m_oper = op_and; - /* .or */ - else - r->m_oper = op_or; - } - - mem_free ((void **) (void *) &op); - - if (get_spec (&t, &sp, maps, mapb)) - { - rule_destroy (&r); - return 1; - } - - spec_append (&r->m_specs, sp); - } - - /* skip the semicolon */ - t++; - eat_spaces (&t); - - *text = t; - *ru = r; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int update_dependency (map_rule *mapr, byte *symbol, rule **ru) -{ - if (map_rule_find (&mapr, symbol, ru)) - return 1; - - (**ru).m_referenced = 1; - - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int update_dependencies (dict *di, map_rule *mapr, byte **syntax_symbol, - byte **string_symbol, map_byte *regbytes) -{ - rule *rulez = di->m_rulez; - - /* update dependecies for the root and lexer symbols */ - if (update_dependency (mapr, *syntax_symbol, &di->m_syntax) || - (*string_symbol != NULL && update_dependency (mapr, *string_symbol, &di->m_string))) - return 1; - - mem_free ((void **) syntax_symbol); - mem_free ((void **) string_symbol); - - /* update dependecies for the rest of the rules */ - while (rulez) - { - spec *sp = rulez->m_specs; - - /* iterate through all the specifiers */ - while (sp) - { - /* update dependency for identifier */ - if (sp->m_spec_type == st_identifier || sp->m_spec_type == st_identifier_loop) - { - if (update_dependency (mapr, sp->m_string, &sp->m_rule)) - return 1; - - mem_free ((void **) &sp->m_string); - } - - /* some errtexts reference to a rule */ - if (sp->m_errtext && sp->m_errtext->m_token_name) - { - if (update_dependency (mapr, sp->m_errtext->m_token_name, &sp->m_errtext->m_token)) - return 1; - - mem_free ((void **) &sp->m_errtext->m_token_name); - } - - /* update dependency for condition */ - if (sp->m_cond) - { - int i; - for (i = 0; i < 2; i++) - if (sp->m_cond->m_operands[i].m_type == cot_regbyte) - { - sp->m_cond->m_operands[i].m_regbyte = map_byte_locate (®bytes, - sp->m_cond->m_operands[i].m_regname); - - if (sp->m_cond->m_operands[i].m_regbyte == NULL) - return 1; - - mem_free ((void **) &sp->m_cond->m_operands[i].m_regname); - } - } - - /* update dependency for all .load instructions */ - if (sp->m_emits) - { - emit *em = sp->m_emits; - while (em != NULL) - { - if (em->m_emit_dest == ed_regbyte) - { - em->m_regbyte = map_byte_locate (®bytes, em->m_regname); - - if (em->m_regbyte == NULL) - return 1; - - mem_free ((void **) &em->m_regname); - } - - em = em->m_next; - } - } - - sp = sp->next; - } - - rulez = rulez->next; - } - - /* check for unreferenced symbols */ - rulez = di->m_rulez; - while (rulez != NULL) - { - if (!rulez->m_referenced) - { - map_rule *ma = mapr; - while (ma) - { - if (ma->data == rulez) - { - set_last_error (UNREFERENCED_IDENTIFIER, str_duplicate (ma->key), -1); - return 1; - } - ma = ma->next; - } - } - rulez = rulez->next; - } - - return 0; -} - -static int satisfies_condition (cond *co, regbyte_ctx *ctx) -{ - byte values[2]; - int i; - - if (co == NULL) - return 1; - - for (i = 0; i < 2; i++) - switch (co->m_operands[i].m_type) - { - case cot_byte: - values[i] = co->m_operands[i].m_byte; - break; - case cot_regbyte: - values[i] = regbyte_ctx_extract (&ctx, co->m_operands[i].m_regbyte); - break; - } - - switch (co->m_type) - { - case ct_equal: - return values[0] == values[1]; - case ct_not_equal: - return values[0] != values[1]; - } - - return 0; -} - -static void free_regbyte_ctx_stack (regbyte_ctx *top, regbyte_ctx *limit) -{ - while (top != limit) - { - regbyte_ctx *rbc = top->m_prev; - regbyte_ctx_destroy (&top); - top = rbc; - } -} - -typedef enum match_result_ -{ - mr_not_matched, /* the examined string does not match */ - mr_matched, /* the examined string matches */ - mr_error_raised, /* mr_not_matched + error has been raised */ - mr_dont_emit, /* used by identifier loops only */ - mr_internal_error /* an internal error has occured such as out of memory */ -} match_result; - -/* - * This function does the main job. It parses the text and generates output data. - */ -static match_result -match (dict *di, const byte *text, int *index, rule *ru, barray **ba, int filtering_string, - regbyte_ctx **rbc) -{ - int ind = *index; - match_result status = mr_not_matched; - spec *sp = ru->m_specs; - regbyte_ctx *ctx = *rbc; - - /* for every specifier in the rule */ - while (sp) - { - int i, len, save_ind = ind; - barray *array = NULL; - - if (satisfies_condition (sp->m_cond, ctx)) - { - switch (sp->m_spec_type) - { - case st_identifier: - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - status = match (di, text, &ind, sp->m_rule, &array, filtering_string, &ctx); - - if (status == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - break; - case st_string: - len = str_length (sp->m_string); - - /* prefilter the stream */ - if (!filtering_string && di->m_string) - { - barray *ba; - int filter_index = 0; - match_result result; - regbyte_ctx *null_ctx = NULL; - - barray_create (&ba); - if (ba == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - result = match (di, text + ind, &filter_index, di->m_string, &ba, 1, &null_ctx); - - if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&ba); - return mr_internal_error; - } - - if (result != mr_matched) - { - barray_destroy (&ba); - status = mr_not_matched; - break; - } - - barray_destroy (&ba); - - if (filter_index != len || !str_equal_n (sp->m_string, text + ind, len)) - { - status = mr_not_matched; - break; - } - - status = mr_matched; - ind += len; - } - else - { - status = mr_matched; - for (i = 0; status == mr_matched && i < len; i++) - if (text[ind + i] != sp->m_string[i]) - status = mr_not_matched; - - if (status == mr_matched) - ind += len; - } - break; - case st_byte: - status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_byte_range: - status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? - mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_true: - status = mr_matched; - break; - case st_false: - status = mr_not_matched; - break; - case st_debug: - status = ru->m_oper == op_and ? mr_matched : mr_not_matched; - break; - case st_identifier_loop: - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - status = mr_dont_emit; - for (;;) - { - match_result result; - - save_ind = ind; - result = match (di, text, &ind, sp->m_rule, &array, filtering_string, &ctx); - - if (result == mr_error_raised) - { - status = result; - break; - } - else if (result == mr_matched) - { - if (barray_push (ba, sp->m_emits, text[ind - 1], save_ind, &ctx) || - barray_append (ba, &array)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - barray_destroy (&array); - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - else if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - else - break; - } - break; - } - } - else - { - status = mr_not_matched; - } - - if (status == mr_error_raised) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - - return mr_error_raised; - } - - if (ru->m_oper == op_and && status != mr_matched && status != mr_dont_emit) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - - if (sp->m_errtext) - { - set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, - ind), ind); - - return mr_error_raised; - } - - return mr_not_matched; - } - - if (status == mr_matched) - { - if (sp->m_emits) - if (barray_push (ba, sp->m_emits, text[ind - 1], save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - - if (array) - if (barray_append (ba, &array)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - } - - barray_destroy (&array); - - /* if the rule operator is a logical or, we pick up the first matching specifier */ - if (ru->m_oper == op_or && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - return mr_matched; - } - - sp = sp->next; - } - - /* everything went fine - all specifiers match up */ - if (ru->m_oper == op_and && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - return mr_matched; - } - - free_regbyte_ctx_stack (ctx, *rbc); - return mr_not_matched; -} - -static match_result -fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool *_BP, - int filtering_string, regbyte_ctx **rbc) -{ - int ind = *index; - int _P = filtering_string ? 0 : *_PP; - int _P2; - match_result status = mr_not_matched; - spec *sp = ru->m_specs; - regbyte_ctx *ctx = *rbc; - - /* for every specifier in the rule */ - while (sp) - { - int i, len, save_ind = ind; - - _P2 = _P + (sp->m_emits ? emit_size (sp->m_emits) : 0); - if (bytepool_reserve (_BP, _P2)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - if (satisfies_condition (sp->m_cond, ctx)) - { - switch (sp->m_spec_type) - { - case st_identifier: - status = fast_match (di, text, &ind, sp->m_rule, &_P2, _BP, filtering_string, &ctx); - - if (status == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - break; - case st_string: - len = str_length (sp->m_string); - - /* prefilter the stream */ - if (!filtering_string && di->m_string) - { - int filter_index = 0; - match_result result; - regbyte_ctx *null_ctx = NULL; - - result = fast_match (di, text + ind, &filter_index, di->m_string, NULL, _BP, 1, &null_ctx); - - if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - if (result != mr_matched) - { - status = mr_not_matched; - break; - } - - if (filter_index != len || !str_equal_n (sp->m_string, text + ind, len)) - { - status = mr_not_matched; - break; - } - - status = mr_matched; - ind += len; - } - else - { - status = mr_matched; - for (i = 0; status == mr_matched && i < len; i++) - if (text[ind + i] != sp->m_string[i]) - status = mr_not_matched; - - if (status == mr_matched) - ind += len; - } - break; - case st_byte: - status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_byte_range: - status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? - mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_true: - status = mr_matched; - break; - case st_false: - status = mr_not_matched; - break; - case st_debug: - status = ru->m_oper == op_and ? mr_matched : mr_not_matched; - break; - case st_identifier_loop: - status = mr_dont_emit; - for (;;) - { - match_result result; - - save_ind = ind; - result = fast_match (di, text, &ind, sp->m_rule, &_P2, _BP, filtering_string, &ctx); - - if (result == mr_error_raised) - { - status = result; - break; - } - else if (result == mr_matched) - { - if (!filtering_string) - { - if (sp->m_emits != NULL) - { - if (emit_push (sp->m_emits, _BP->_F + _P, text[ind - 1], save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - - _P = _P2; - _P2 += sp->m_emits ? emit_size (sp->m_emits) : 0; - if (bytepool_reserve (_BP, _P2)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - } - else if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - else - break; - } - break; - } - } - else - { - status = mr_not_matched; - } - - if (status == mr_error_raised) - { - free_regbyte_ctx_stack (ctx, *rbc); - - return mr_error_raised; - } - - if (ru->m_oper == op_and && status != mr_matched && status != mr_dont_emit) - { - free_regbyte_ctx_stack (ctx, *rbc); - - if (sp->m_errtext) - { - set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, - ind), ind); - - return mr_error_raised; - } - - return mr_not_matched; - } - - if (status == mr_matched) - { - if (sp->m_emits != NULL) { - const byte ch = (ind <= 0) ? 0 : text[ind - 1]; - if (emit_push (sp->m_emits, _BP->_F + _P, ch, save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - } - _P = _P2; - } - - /* if the rule operator is a logical or, we pick up the first matching specifier */ - if (ru->m_oper == op_or && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - if (!filtering_string) - *_PP = _P; - return mr_matched; - } - - sp = sp->next; - } - - /* everything went fine - all specifiers match up */ - if (ru->m_oper == op_and && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - if (!filtering_string) - *_PP = _P; - return mr_matched; - } - - free_regbyte_ctx_stack (ctx, *rbc); - return mr_not_matched; -} - -static byte * -error_get_token (error *er, dict *di, const byte *text, int ind) -{ - byte *str = NULL; - - if (er->m_token) - { - barray *ba; - int filter_index = 0; - regbyte_ctx *ctx = NULL; - - barray_create (&ba); - if (ba != NULL) - { - if (match (di, text + ind, &filter_index, er->m_token, &ba, 0, &ctx) == mr_matched && - filter_index) - { - str = (byte *) mem_alloc (filter_index + 1); - if (str != NULL) - { - str_copy_n (str, text + ind, filter_index); - str[filter_index] = '\0'; - } - } - barray_destroy (&ba); - } - } - - return str; -} - -typedef struct grammar_load_state_ -{ - dict *di; - byte *syntax_symbol; - byte *string_symbol; - map_str *maps; - map_byte *mapb; - map_rule *mapr; -} grammar_load_state; - -static void grammar_load_state_create (grammar_load_state **gr) -{ - *gr = (grammar_load_state *) mem_alloc (sizeof (grammar_load_state)); - if (*gr) - { - (**gr).di = NULL; - (**gr).syntax_symbol = NULL; - (**gr).string_symbol = NULL; - (**gr).maps = NULL; - (**gr).mapb = NULL; - (**gr).mapr = NULL; - } -} - -static void grammar_load_state_destroy (grammar_load_state **gr) -{ - if (*gr) - { - dict_destroy (&(**gr).di); - mem_free ((void **) &(**gr).syntax_symbol); - mem_free ((void **) &(**gr).string_symbol); - map_str_destroy (&(**gr).maps); - map_byte_destroy (&(**gr).mapb); - map_rule_destroy (&(**gr).mapr); - mem_free ((void **) gr); - } -} - - -static void error_msg(int line, const char *msg) -{ - fprintf(stderr, "Error in grammar_load_from_text() at line %d: %s\n", line, msg); -} - - -/* - the API -*/ -grammar grammar_load_from_text (const byte *text) -{ - grammar_load_state *g = NULL; - grammar id = 0; - - clear_last_error (); - - grammar_load_state_create (&g); - if (g == NULL) { - error_msg(__LINE__, ""); - return 0; - } - - dict_create (&g->di); - if (g->di == NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - eat_spaces (&text); - - /* skip ".syntax" keyword */ - text += 7; - eat_spaces (&text); - - /* retrieve root symbol */ - if (get_identifier (&text, &g->syntax_symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - eat_spaces (&text); - - /* skip semicolon */ - text++; - eat_spaces (&text); - - while (*text) - { - byte *symbol = NULL; - int is_dot = *text == '.'; - - if (is_dot) - text++; - - if (get_identifier (&text, &symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - eat_spaces (&text); - - /* .emtcode */ - if (is_dot && str_equal (symbol, (byte *) "emtcode")) - { - map_byte *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_emtcode (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_byte_append (&g->mapb, ma); - } - /* .regbyte */ - else if (is_dot && str_equal (symbol, (byte *) "regbyte")) - { - map_byte *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_regbyte (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_byte_append (&g->di->m_regbytes, ma); - } - /* .errtext */ - else if (is_dot && str_equal (symbol, (byte *) "errtext")) - { - map_str *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_errtext (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_str_append (&g->maps, ma); - } - /* .string */ - else if (is_dot && str_equal (symbol, (byte *) "string")) - { - mem_free ((void **) (void *) &symbol); - - if (g->di->m_string != NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - if (get_identifier (&text, &g->string_symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - /* skip semicolon */ - eat_spaces (&text); - text++; - eat_spaces (&text); - } - else - { - rule *ru = NULL; - map_rule *ma = NULL; - - if (get_rule (&text, &ru, g->maps, g->mapb)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - rule_append (&g->di->m_rulez, ru); - - /* if a rule consist of only one specifier, give it an ".and" operator */ - if (ru->m_oper == op_none) - ru->m_oper = op_and; - - map_rule_create (&ma); - if (ma == NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - ma->key = symbol; - ma->data = ru; - map_rule_append (&g->mapr, ma); - } - } - - if (update_dependencies (g->di, g->mapr, &g->syntax_symbol, &g->string_symbol, - g->di->m_regbytes)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, "update_dependencies() failed"); - return 0; - } - - dict_append (&g_dicts, g->di); - id = g->di->m_id; - g->di = NULL; - - grammar_load_state_destroy (&g); - - return id; -} - -int grammar_set_reg8 (grammar id, const byte *name, byte value) -{ - dict *di = NULL; - map_byte *reg = NULL; - - clear_last_error (); - - dict_find (&g_dicts, id, &di); - if (di == NULL) - { - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; - } - - reg = map_byte_locate (&di->m_regbytes, name); - if (reg == NULL) - { - set_last_error (INVALID_REGISTER_NAME, str_duplicate (name), -1); - return 0; - } - - reg->data = value; - return 1; -} - -/* - internal checking function used by both grammar_check and grammar_fast_check functions -*/ -static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size, int use_fast_path) -{ - dict *di = NULL; - int index = 0; - - clear_last_error (); - - dict_find (&g_dicts, id, &di); - if (di == NULL) - { - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; - } - - *prod = NULL; - *size = 0; - - if (use_fast_path) - { - regbyte_ctx *rbc = NULL; - bytepool *bp = NULL; - int _P = 0; - - bytepool_create (&bp, estimate_prod_size); - if (bp == NULL) - return 0; - - if (fast_match (di, text, &index, di->m_syntax, &_P, bp, 0, &rbc) != mr_matched) - { - bytepool_destroy (&bp); - free_regbyte_ctx_stack (rbc, NULL); - return 0; - } - - free_regbyte_ctx_stack (rbc, NULL); - - *prod = bp->_F; - *size = _P; - bp->_F = NULL; - bytepool_destroy (&bp); - } - else - { - regbyte_ctx *rbc = NULL; - barray *ba = NULL; - - barray_create (&ba); - if (ba == NULL) - return 0; - - if (match (di, text, &index, di->m_syntax, &ba, 0, &rbc) != mr_matched) - { - barray_destroy (&ba); - free_regbyte_ctx_stack (rbc, NULL); - return 0; - } - - free_regbyte_ctx_stack (rbc, NULL); - - *prod = (byte *) mem_alloc (ba->len * sizeof (byte)); - if (*prod == NULL) - { - barray_destroy (&ba); - return 0; - } - - mem_copy (*prod, ba->data, ba->len * sizeof (byte)); - *size = ba->len; - barray_destroy (&ba); - } - - return 1; -} - -int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size) -{ - return _grammar_check (id, text, prod, size, 0, 0); -} - -int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size) -{ - return _grammar_check (id, text, prod, size, estimate_prod_size, 1); -} - -int grammar_destroy (grammar id) -{ - dict **di = &g_dicts; - - clear_last_error (); - - while (*di != NULL) - { - if ((**di).m_id == id) - { - dict *tmp = *di; - *di = (**di).next; - dict_destroy (&tmp); - return 1; - } - - di = &(**di).next; - } - - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; -} - -static void append_character (const char x, byte *text, int *dots_made, int *len, int size) -{ - if (*dots_made == 0) - { - if (*len < size - 1) - { - text[(*len)++] = x; - text[*len] = '\0'; - } - else - { - int i; - for (i = 0; i < 3; i++) - if (--(*len) >= 0) - text[*len] = '.'; - *dots_made = 1; - } - } -} - -void grammar_get_last_error (byte *text, unsigned int size, int *pos) -{ - int len = 0, dots_made = 0; - const byte *p = error_message; - - *text = '\0'; - - if (p) - { - while (*p) - { - if (*p == '$') - { - const byte *r = error_param; - - while (*r) - { - append_character (*r++, text, &dots_made, &len, (int) size); - } - - p++; - } - else - { - append_character (*p++, text, &dots_made, &len, size); - } - } - } - - *pos = error_position; -} diff --git a/src/libs/mesa/mesa/shader/grammar/grammar.h b/src/libs/mesa/mesa/shader/grammar/grammar.h deleted file mode 100644 index 591e38aefa..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 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 GRAMMAR_H -#define GRAMMAR_H - - -#ifndef GRAMMAR_PORT_INCLUDE -#error Do not include this file directly, include your grammar_XXX.h instead -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -void grammar_alloc_free (void *); -void *grammar_alloc_malloc (size_t); -void *grammar_alloc_realloc (void *, size_t, size_t); -void *grammar_memory_copy (void *, const void *, size_t); -int grammar_string_compare (const byte *, const byte *); -int grammar_string_compare_n (const byte *, const byte *, size_t); -byte *grammar_string_copy (byte *, const byte *); -byte *grammar_string_copy_n (byte *, const byte *, size_t); -byte *grammar_string_duplicate (const byte *); -unsigned int grammar_string_length (const byte *); - -/* - loads grammar script from null-terminated ASCII - returns unique grammar id to grammar object - returns 0 if an error occurs (call grammar_get_last_error to retrieve the error text) -*/ -grammar grammar_load_from_text (const byte *text); - -/* - sets a new to a register for grammar - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success -*/ -int grammar_set_reg8 (grammar id, const byte *name, byte value); - -/* - this function is obsolete, use only for debugging purposes - - checks if a null-terminated matches given grammar - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success, the points to newly allocated buffer with production and - is filled with the production size - call grammar_alloc_free to free the memory block pointed by -*/ -int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size); - -/* - does the same what grammar_check does but much more (approx. 4 times) faster - use this function instead of grammar_check - is a hint - the initial production buffer size will be of this size, - but if more room is needed it will be safely resized; set it to 0x1000 or so -*/ -int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size); - -/* - destroys grammar object identified by - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success -*/ -int grammar_destroy (grammar id); - -/* - retrieves last grammar error reported either by grammar_load_from_text, grammar_check - or grammar_destroy - the user allocated buffer receives error description, points to error position, - is the size of the text buffer to fill in - it must be at least 4 bytes long, -*/ -void grammar_get_last_error (byte *text, unsigned int size, int *pos); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/libs/mesa/mesa/shader/grammar/grammar_crt.c b/src/libs/mesa/mesa/shader/grammar/grammar_crt.c deleted file mode 100755 index d2c95d1c8e..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar_crt.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "grammar_crt.h" - -#define GRAMMAR_PORT_BUILD 1 -#include "grammar.c" -#undef GRAMMAR_PORT_BUILD - - -void grammar_alloc_free (void *ptr) -{ - free (ptr); -} - -void *grammar_alloc_malloc (size_t size) -{ - return malloc (size); -} - -void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size) -{ - return realloc (ptr, size); -} - -void *grammar_memory_copy (void *dst, const void * src, size_t size) -{ - return memcpy (dst, src, size); -} - -int grammar_string_compare (const byte *str1, const byte *str2) -{ - return strcmp ((const char *) str1, (const char *) str2); -} - -int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n) -{ - return strncmp ((const char *) str1, (const char *) str2, n); -} - -byte *grammar_string_copy (byte *dst, const byte *src) -{ - return (byte *) strcpy ((char *) dst, (const char *) src); -} - -byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n) -{ - return (byte *) strncpy ((char *) dst, (const char *) src, n); -} - -unsigned int grammar_string_length (const byte *str) -{ - return strlen ((const char *) str); -} - -byte *grammar_string_duplicate (const byte *src) -{ - const unsigned int size = grammar_string_length (src); - byte *str = grammar_alloc_malloc (size + 1); - if (str != NULL) - { - grammar_memory_copy (str, src, size); - str[size] = '\0'; - } - return str; -} - diff --git a/src/libs/mesa/mesa/shader/grammar/grammar_crt.h b/src/libs/mesa/mesa/shader/grammar/grammar_crt.h deleted file mode 100755 index 492711e96a..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar_crt.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef GRAMMAR_CRT_H -#define GRAMMAR_CRT_H - - -#include -#include -#include - - -typedef unsigned long grammar; -typedef unsigned char byte; - - -#define GRAMMAR_PORT_INCLUDE 1 -#include "grammar.h" -#undef GRAMMAR_PORT_INCLUDE - - -#endif - diff --git a/src/libs/mesa/mesa/shader/grammar/grammar_mesa.c b/src/libs/mesa/mesa/shader/grammar/grammar_mesa.c deleted file mode 100644 index eb962505bf..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar_mesa.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - -/** - * \file grammar_mesa.c - * mesa3d port to syntax parsing engine - * \author Michal Krol - */ - -#include "grammar_mesa.h" - -#define GRAMMAR_PORT_BUILD 1 -#include "grammar.c" -#undef GRAMMAR_PORT_BUILD - - -void grammar_alloc_free (void *ptr) -{ - _mesa_free (ptr); -} - -void *grammar_alloc_malloc (size_t size) -{ - return _mesa_malloc (size); -} - -void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size) -{ - return _mesa_realloc (ptr, old_size, size); -} - -void *grammar_memory_copy (void *dst, const void * src, size_t size) -{ - return _mesa_memcpy (dst, src, size); -} - -int grammar_string_compare (const byte *str1, const byte *str2) -{ - return _mesa_strcmp ((const char *) str1, (const char *) str2); -} - -int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n) -{ - return _mesa_strncmp ((const char *) str1, (const char *) str2, n); -} - -byte *grammar_string_copy (byte *dst, const byte *src) -{ - return (byte *) _mesa_strcpy ((char *) dst, (const char *) src); -} - -byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n) -{ - return (byte *) _mesa_strncpy ((char *) dst, (const char *) src, n); -} - -byte *grammar_string_duplicate (const byte *src) -{ - return (byte *) _mesa_strdup ((const char *) src); -} - -unsigned int grammar_string_length (const byte *str) -{ - return (unsigned int)_mesa_strlen ((const char *) str); -} - diff --git a/src/libs/mesa/mesa/shader/grammar/grammar_mesa.h b/src/libs/mesa/mesa/shader/grammar/grammar_mesa.h deleted file mode 100644 index 6c92c5812d..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar_mesa.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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 GRAMMAR_MESA_H -#define GRAMMAR_MESA_H - - -#include "main/imports.h" -/* NOTE: include Mesa 3-D specific headers here */ - - -typedef GLuint grammar; -typedef GLubyte byte; - - -#define GRAMMAR_PORT_INCLUDE 1 -#include "grammar.h" -#undef GRAMMAR_PORT_INCLUDE - - -#endif - diff --git a/src/libs/mesa/mesa/shader/grammar/grammar_syn.h b/src/libs/mesa/mesa/shader/grammar/grammar_syn.h deleted file mode 100644 index 840a1ab62c..0000000000 --- a/src/libs/mesa/mesa/shader/grammar/grammar_syn.h +++ /dev/null @@ -1,202 +0,0 @@ -".syntax grammar;\n" -".emtcode DECLARATION_END 0\n" -".emtcode DECLARATION_EMITCODE 1\n" -".emtcode DECLARATION_ERRORTEXT 2\n" -".emtcode DECLARATION_REGBYTE 3\n" -".emtcode DECLARATION_LEXER 4\n" -".emtcode DECLARATION_RULE 5\n" -".emtcode SPECIFIER_END 0\n" -".emtcode SPECIFIER_AND_TAG 1\n" -".emtcode SPECIFIER_OR_TAG 2\n" -".emtcode SPECIFIER_CHARACTER_RANGE 3\n" -".emtcode SPECIFIER_CHARACTER 4\n" -".emtcode SPECIFIER_STRING 5\n" -".emtcode SPECIFIER_IDENTIFIER 6\n" -".emtcode SPECIFIER_TRUE 7\n" -".emtcode SPECIFIER_FALSE 8\n" -".emtcode SPECIFIER_DEBUG 9\n" -".emtcode IDENTIFIER_SIMPLE 0\n" -".emtcode IDENTIFIER_LOOP 1\n" -".emtcode ERROR_NOT_PRESENT 0\n" -".emtcode ERROR_PRESENT 1\n" -".emtcode EMIT_NULL 0\n" -".emtcode EMIT_INTEGER 1\n" -".emtcode EMIT_IDENTIFIER 2\n" -".emtcode EMIT_CHARACTER 3\n" -".emtcode EMIT_LAST_CHARACTER 4\n" -".emtcode EMIT_CURRENT_POSITION 5\n" -".errtext INVALID_GRAMMAR \"internal error 2001: invalid grammar script\"\n" -".errtext SYNTAX_EXPECTED \"internal error 2002: '.syntax' keyword expected\"\n" -".errtext IDENTIFIER_EXPECTED \"internal error 2003: identifier expected\"\n" -".errtext MISSING_SEMICOLON \"internal error 2004: missing ';'\"\n" -".errtext INTEGER_EXPECTED \"internal error 2005: integer value expected\"\n" -".errtext STRING_EXPECTED \"internal error 2006: string expected\"\n" -"grammar\n" -" grammar_1 .error INVALID_GRAMMAR;\n" -"grammar_1\n" -" optional_space .and \".syntax\" .error SYNTAX_EXPECTED .and space .and identifier .and\n" -" semicolon .and declaration_list .and optional_space .and '\\0' .emit DECLARATION_END;\n" -"optional_space\n" -" space .or .true;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" white_char .or comment_block;\n" -"white_char\n" -" ' ' .or '\\t' .or '\\n' .or '\\r';\n" -"comment_block\n" -" '/' .and '*' .and comment_rest;\n" -"comment_rest\n" -" .loop comment_char_no_star .and comment_rest_1;\n" -"comment_rest_1\n" -" comment_end .or comment_rest_2;\n" -"comment_rest_2\n" -" '*' .and comment_rest;\n" -"comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"comment_end\n" -" '*' .and '/';\n" -"identifier\n" -" identifier_ne .error IDENTIFIER_EXPECTED;\n" -"identifier_ne\n" -" first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\\0';\n" -"first_idchar\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"follow_idchar\n" -" first_idchar .or digit_dec;\n" -"digit_dec\n" -" '0'-'9';\n" -"semicolon\n" -" optional_space .and ';' .error MISSING_SEMICOLON .and optional_space;\n" -"declaration_list\n" -" declaration .and .loop declaration;\n" -"declaration\n" -" emitcode_definition .emit DECLARATION_EMITCODE .or\n" -" errortext_definition .emit DECLARATION_ERRORTEXT .or\n" -" regbyte_definition .emit DECLARATION_REGBYTE .or\n" -" lexer_definition .emit DECLARATION_LEXER .or\n" -" rule_definition .emit DECLARATION_RULE;\n" -"emitcode_definition\n" -" \".emtcode\" .and space .and identifier .and space .and integer .and space_or_null;\n" -"integer\n" -" integer_ne .error INTEGER_EXPECTED;\n" -"integer_ne\n" -" hex_integer .emit 0x10 .or dec_integer .emit 10;\n" -"hex_integer\n" -" hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\\0';\n" -"hex_prefix\n" -" '0' .and hex_prefix_1;\n" -"hex_prefix_1\n" -" 'x' .or 'X';\n" -"digit_hex\n" -" '0'-'9' .or 'a'-'f' .or 'A'-'F';\n" -"dec_integer\n" -" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"space_or_null\n" -" space .or '\\0';\n" -"errortext_definition\n" -" \".errtext\" .and space .and identifier .and space .and string .and space_or_null;\n" -"string\n" -" string_ne .error STRING_EXPECTED;\n" -"string_ne\n" -" '\"' .and .loop string_char_double_quotes .and '\"' .emit '\\0';\n" -"string_char_double_quotes\n" -" escape_sequence .or string_char .emit * .or '\\'' .emit *;\n" -"string_char\n" -" '\\x5D'-'\\xFF' .or '\\x28'-'\\x5B' .or '\\x23'-'\\x26' .or '\\x0E'-'\\x21' .or '\\x0B'-'\\x0C' .or\n" -" '\\x01'-'\\x09';\n" -"escape_sequence\n" -" '\\\\' .emit * .and escape_code;\n" -"escape_code\n" -" simple_escape_code .emit * .or hex_escape_code .or oct_escape_code;\n" -"simple_escape_code\n" -" '\\'' .or '\"' .or '?' .or '\\\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v';\n" -"hex_escape_code\n" -" 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *;\n" -"oct_escape_code\n" -" digit_oct .emit * .and optional_digit_oct .and optional_digit_oct;\n" -"digit_oct\n" -" '0'-'7';\n" -"optional_digit_oct\n" -" digit_oct .emit * .or .true;\n" -"regbyte_definition\n" -" \".regbyte\" .and space .and identifier .and space .and integer .and space_or_null;\n" -"lexer_definition\n" -" \".string\" .and space .and identifier .and semicolon;\n" -"rule_definition\n" -" identifier_ne .and space .and definition;\n" -"definition\n" -" specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END;\n" -"optional_specifiers_and_or\n" -" and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true;\n" -"specifier\n" -" specifier_condition .and optional_space .and specifier_rule;\n" -"specifier_condition\n" -" specifier_condition_1 .or .true;\n" -"specifier_condition_1\n" -" \".if\" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and\n" -" right_operand .and optional_space .and ')';\n" -"left_operand\n" -" identifier;\n" -"operator\n" -" operator_1 .or operator_2;\n" -"operator_1\n" -" optional_space .and '!' .and '=' .and optional_space;\n" -"operator_2\n" -" optional_space .and '=' .and '=' .and optional_space;\n" -"right_operand\n" -" integer;\n" -"specifier_rule\n" -" specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL;\n" -"specifier_rule_1\n" -" character_range .emit SPECIFIER_CHARACTER_RANGE .or\n" -" character .emit SPECIFIER_CHARACTER .or\n" -" string_ne .emit SPECIFIER_STRING .or\n" -" \".true\" .emit SPECIFIER_TRUE .or\n" -" \".false\" .emit SPECIFIER_FALSE .or\n" -" \".debug\" .emit SPECIFIER_DEBUG .or\n" -" advanced_identifier .emit SPECIFIER_IDENTIFIER;\n" -"character\n" -" '\\'' .and string_char_single_quotes .and '\\'' .emit '\\0';\n" -"string_char_single_quotes\n" -" escape_sequence .or string_char .emit * .or '\"' .emit *;\n" -"character_range\n" -" character .and optional_space .and '-' .and optional_space .and character;\n" -"advanced_identifier\n" -" optional_loop .and identifier;\n" -"optional_loop\n" -" optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE;\n" -"optional_loop_1\n" -" \".loop\" .and space;\n" -"optional_error\n" -" error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT;\n" -"error\n" -" space .and \".error\" .and space .and identifier;\n" -"emit\n" -" emit_output .or emit_regbyte;\n" -"emit_output\n" -" space .and \".emit\" .and space .and emit_param;\n" -"emit_param\n" -" integer_ne .emit EMIT_INTEGER .or\n" -" identifier_ne .emit EMIT_IDENTIFIER .or\n" -" character .emit EMIT_CHARACTER .or\n" -" '*' .emit EMIT_LAST_CHARACTER .or\n" -" '$' .emit EMIT_CURRENT_POSITION;\n" -"emit_regbyte\n" -" space .and \".load\" .and space .and identifier .and space .and emit_param;\n" -"and_specifiers\n" -" and_specifier .and .loop and_specifier;\n" -"or_specifiers\n" -" or_specifier .and .loop or_specifier;\n" -"and_specifier\n" -" space .and \".and\" .and space .and specifier;\n" -"or_specifier\n" -" space .and \".or\" .and space .and specifier;\n" -".string __string_filter;\n" -"__string_filter\n" -" __first_identifier_char .and .loop __next_identifier_char;\n" -"__first_identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '.';\n" -"__next_identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n" -"" diff --git a/src/libs/mesa/mesa/shader/nvfragparse.c b/src/libs/mesa/mesa/shader/nvfragparse.c deleted file mode 100644 index 20e4781372..0000000000 --- a/src/libs/mesa/mesa/shader/nvfragparse.c +++ /dev/null @@ -1,1835 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -/** - * \file nvfragparse.c - * NVIDIA fragment program parser. - * \author Brian Paul - */ - -/* - * Regarding GL_NV_fragment_program: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/macros.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_instruction.h" -#include "nvfragparse.h" - - -#define INPUT_1V 1 -#define INPUT_2V 2 -#define INPUT_3V 3 -#define INPUT_1S 4 -#define INPUT_2S 5 -#define INPUT_CC 6 -#define INPUT_1V_T 7 /* one source vector, plus textureId */ -#define INPUT_3V_T 8 /* one source vector, plus textureId */ -#define INPUT_NONE 9 -#define INPUT_1V_S 10 /* a string and a vector register */ -#define OUTPUT_V 20 -#define OUTPUT_S 21 -#define OUTPUT_NONE 22 - -/* IRIX defines some of these */ -#undef _R -#undef _H -#undef _X -#undef _C -#undef _S - -/* Optional suffixes */ -#define _R FLOAT32 /* float */ -#define _H FLOAT16 /* half-float */ -#define _X FIXED12 /* fixed */ -#define _C 0x08 /* set cond codes */ -#define _S 0x10 /* saturate, clamp result to [0,1] */ - -struct instruction_pattern { - const char *name; - enum prog_opcode opcode; - GLuint inputs; - GLuint outputs; - GLuint suffixes; -}; - -static const struct instruction_pattern Instructions[] = { - { "ADD", OPCODE_ADD, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "COS", OPCODE_COS, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "DDX", OPCODE_DDX, INPUT_1V, OUTPUT_V, _R | _H | _C | _S }, - { "DDY", OPCODE_DDY, INPUT_1V, OUTPUT_V, _R | _H | _C | _S }, - { "DP3", OPCODE_DP3, INPUT_2V, OUTPUT_S, _R | _H | _X | _C | _S }, - { "DP4", OPCODE_DP4, INPUT_2V, OUTPUT_S, _R | _H | _X | _C | _S }, - { "DST", OPCODE_DP4, INPUT_2V, OUTPUT_V, _R | _H | _C | _S }, - { "EX2", OPCODE_DP4, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "FLR", OPCODE_FLR, INPUT_1V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "FRC", OPCODE_FRC, INPUT_1V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "KIL", OPCODE_KIL_NV, INPUT_CC, OUTPUT_NONE, 0 }, - { "LG2", OPCODE_LG2, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "LIT", OPCODE_LIT, INPUT_1V, OUTPUT_V, _R | _H | _C | _S }, - { "LRP", OPCODE_LRP, INPUT_3V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "MAD", OPCODE_MAD, INPUT_3V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "MAX", OPCODE_MAX, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "MIN", OPCODE_MIN, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "MOV", OPCODE_MOV, INPUT_1V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "MUL", OPCODE_MUL, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "PK2H", OPCODE_PK2H, INPUT_1V, OUTPUT_S, 0 }, - { "PK2US", OPCODE_PK2US, INPUT_1V, OUTPUT_S, 0 }, - { "PK4B", OPCODE_PK4B, INPUT_1V, OUTPUT_S, 0 }, - { "PK4UB", OPCODE_PK4UB, INPUT_1V, OUTPUT_S, 0 }, - { "POW", OPCODE_POW, INPUT_2S, OUTPUT_S, _R | _H | _C | _S }, - { "RCP", OPCODE_RCP, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "RFL", OPCODE_RFL, INPUT_2V, OUTPUT_V, _R | _H | _C | _S }, - { "RSQ", OPCODE_RSQ, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "SEQ", OPCODE_SEQ, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SFL", OPCODE_SFL, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SGE", OPCODE_SGE, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SGT", OPCODE_SGT, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SIN", OPCODE_SIN, INPUT_1S, OUTPUT_S, _R | _H | _C | _S }, - { "SLE", OPCODE_SLE, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SLT", OPCODE_SLT, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SNE", OPCODE_SNE, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "STR", OPCODE_STR, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "SUB", OPCODE_SUB, INPUT_2V, OUTPUT_V, _R | _H | _X | _C | _S }, - { "TEX", OPCODE_TEX, INPUT_1V_T, OUTPUT_V, _C | _S }, - { "TXD", OPCODE_TXD, INPUT_3V_T, OUTPUT_V, _C | _S }, - { "TXP", OPCODE_TXP_NV, INPUT_1V_T, OUTPUT_V, _C | _S }, - { "UP2H", OPCODE_UP2H, INPUT_1S, OUTPUT_V, _C | _S }, - { "UP2US", OPCODE_UP2US, INPUT_1S, OUTPUT_V, _C | _S }, - { "UP4B", OPCODE_UP4B, INPUT_1S, OUTPUT_V, _C | _S }, - { "UP4UB", OPCODE_UP4UB, INPUT_1S, OUTPUT_V, _C | _S }, - { "X2D", OPCODE_X2D, INPUT_3V, OUTPUT_V, _R | _H | _C | _S }, - { "PRINT", OPCODE_PRINT, INPUT_1V_S, OUTPUT_NONE, 0 }, - { NULL, (enum prog_opcode) -1, 0, 0, 0 } -}; - - -/* - * Information needed or computed during parsing. - * Remember, we can't modify the target program object until we've - * _successfully_ parsed the program text. - */ -struct parse_state { - GLcontext *ctx; - const GLubyte *start; /* start of program string */ - const GLubyte *pos; /* current position */ - const GLubyte *curLine; - struct gl_fragment_program *program; /* current program */ - - struct gl_program_parameter_list *parameters; - - GLuint numInst; /* number of instructions parsed */ - GLuint inputsRead; /* bitmask of input registers used */ - GLuint outputsWritten; /* bitmask of 1 << FRAG_OUTPUT_* bits */ - GLuint texturesUsed[MAX_TEXTURE_IMAGE_UNITS]; -}; - - - -/* - * Called whenever we find an error during parsing. - */ -static void -record_error(struct parse_state *parseState, const char *msg, int lineNo) -{ -#ifdef DEBUG - GLint line, column; - const GLubyte *lineStr; - lineStr = _mesa_find_line_column(parseState->start, - parseState->pos, &line, &column); - _mesa_debug(parseState->ctx, - "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", - lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); -#else - (void) lineNo; -#endif - - /* Check that no error was already recorded. Only record the first one. */ - if (parseState->ctx->Program.ErrorString[0] == 0) { - _mesa_set_program_error(parseState->ctx, - parseState->pos - parseState->start, - msg); - } -} - - -#define RETURN_ERROR \ -do { \ - record_error(parseState, "Unexpected end of input.", __LINE__); \ - return GL_FALSE; \ -} while(0) - -#define RETURN_ERROR1(msg) \ -do { \ - record_error(parseState, msg, __LINE__); \ - return GL_FALSE; \ -} while(0) - -#define RETURN_ERROR2(msg1, msg2) \ -do { \ - char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ - record_error(parseState, err, __LINE__); \ - return GL_FALSE; \ -} while(0) - - - - -/* - * Search a list of instruction structures for a match. - */ -static struct instruction_pattern -MatchInstruction(const GLubyte *token) -{ - const struct instruction_pattern *inst; - struct instruction_pattern result; - - for (inst = Instructions; inst->name; inst++) { - if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { - /* matched! */ - int i = 3; - result = *inst; - result.suffixes = 0; - /* look at suffix */ - if (token[i] == 'R') { - result.suffixes |= _R; - i++; - } - else if (token[i] == 'H') { - result.suffixes |= _H; - i++; - } - else if (token[i] == 'X') { - result.suffixes |= _X; - i++; - } - if (token[i] == 'C') { - result.suffixes |= _C; - i++; - } - if (token[i] == '_' && token[i+1] == 'S' && - token[i+2] == 'A' && token[i+3] == 'T') { - result.suffixes |= _S; - } - return result; - } - } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ - return result; -} - - - - -/**********************************************************************/ - - -static GLboolean IsLetter(GLubyte b) -{ - return (b >= 'a' && b <= 'z') || - (b >= 'A' && b <= 'Z') || - (b == '_') || - (b == '$'); -} - - -static GLboolean IsDigit(GLubyte b) -{ - return b >= '0' && b <= '9'; -} - - -static GLboolean IsWhitespace(GLubyte b) -{ - return b == ' ' || b == '\t' || b == '\n' || b == '\r'; -} - - -/** - * Starting at 'str' find the next token. A token can be an integer, - * an identifier or punctuation symbol. - * \return <= 0 we found an error, else, return number of characters parsed. - */ -static GLint -GetToken(struct parse_state *parseState, GLubyte *token) -{ - const GLubyte *str = parseState->pos; - GLint i = 0, j = 0; - - token[0] = 0; - - /* skip whitespace and comments */ - while (str[i] && (IsWhitespace(str[i]) || str[i] == '#')) { - if (str[i] == '#') { - /* skip comment */ - while (str[i] && (str[i] != '\n' && str[i] != '\r')) { - i++; - } - if (str[i] == '\n' || str[i] == '\r') - parseState->curLine = str + i + 1; - } - else { - /* skip whitespace */ - if (str[i] == '\n' || str[i] == '\r') - parseState->curLine = str + i + 1; - i++; - } - } - - if (str[i] == 0) - return -i; - - /* try matching an integer */ - while (str[i] && IsDigit(str[i])) { - token[j++] = str[i++]; - } - if (j > 0 || !str[i]) { - token[j] = 0; - return i; - } - - /* try matching an identifier */ - if (IsLetter(str[i])) { - while (str[i] && (IsLetter(str[i]) || IsDigit(str[i]))) { - token[j++] = str[i++]; - } - token[j] = 0; - return i; - } - - /* punctuation character */ - if (str[i]) { - token[0] = str[i++]; - token[1] = 0; - return i; - } - - /* end of input */ - token[0] = 0; - return i; -} - - -/** - * Get next token from input stream and increment stream pointer past token. - */ -static GLboolean -Parse_Token(struct parse_state *parseState, GLubyte *token) -{ - GLint i; - i = GetToken(parseState, token); - if (i <= 0) { - parseState->pos += (-i); - return GL_FALSE; - } - parseState->pos += i; - return GL_TRUE; -} - - -/** - * Get next token from input stream but don't increment stream pointer. - */ -static GLboolean -Peek_Token(struct parse_state *parseState, GLubyte *token) -{ - GLint i, len; - i = GetToken(parseState, token); - if (i <= 0) { - parseState->pos += (-i); - return GL_FALSE; - } - len = (GLint)_mesa_strlen((const char *) token); - parseState->pos += (i - len); - return GL_TRUE; -} - - -/**********************************************************************/ - -static const char *InputRegisters[MAX_NV_FRAGMENT_PROGRAM_INPUTS + 1] = { - "WPOS", "COL0", "COL1", "FOGC", - "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL -}; - -static const char *OutputRegisters[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS + 1] = { - "COLR", "COLH", - /* These are only allows for register combiners */ - /* - "TEX0", "TEX1", "TEX2", "TEX3", - */ - "DEPR", NULL -}; - - - - -/**********************************************************************/ - -/** - * Try to match 'pattern' as the next token after any whitespace/comments. - */ -static GLboolean -Parse_String(struct parse_state *parseState, const char *pattern) -{ - const GLubyte *m; - GLint i; - - /* skip whitespace and comments */ - while (IsWhitespace(*parseState->pos) || *parseState->pos == '#') { - if (*parseState->pos == '#') { - while (*parseState->pos && (*parseState->pos != '\n' && *parseState->pos != '\r')) { - parseState->pos += 1; - } - if (*parseState->pos == '\n' || *parseState->pos == '\r') - parseState->curLine = parseState->pos + 1; - } - else { - /* skip whitespace */ - if (*parseState->pos == '\n' || *parseState->pos == '\r') - parseState->curLine = parseState->pos + 1; - parseState->pos += 1; - } - } - - /* Try to match the pattern */ - m = parseState->pos; - for (i = 0; pattern[i]; i++) { - if (*m != (GLubyte) pattern[i]) - return GL_FALSE; - m += 1; - } - parseState->pos = m; - - return GL_TRUE; /* success */ -} - - -static GLboolean -Parse_Identifier(struct parse_state *parseState, GLubyte *ident) -{ - if (!Parse_Token(parseState, ident)) - RETURN_ERROR; - if (IsLetter(ident[0])) - return GL_TRUE; - else - RETURN_ERROR1("Expected an identfier"); -} - - -/** - * Parse a floating point constant, or a defined symbol name. - * [+/-]N[.N[eN]] - * Output: number[0 .. 3] will get the value. - */ -static GLboolean -Parse_ScalarConstant(struct parse_state *parseState, GLfloat *number) -{ - char *end = NULL; - - *number = (GLfloat) _mesa_strtod((const char *) parseState->pos, &end); - - if (end && end > (char *) parseState->pos) { - /* got a number */ - parseState->pos = (GLubyte *) end; - number[1] = *number; - number[2] = *number; - number[3] = *number; - return GL_TRUE; - } - else { - /* should be an identifier */ - GLubyte ident[100]; - const GLfloat *constant; - if (!Parse_Identifier(parseState, ident)) - RETURN_ERROR1("Expected an identifier"); - constant = _mesa_lookup_parameter_value(parseState->parameters, - -1, (const char *) ident); - /* XXX Check that it's a constant and not a parameter */ - if (!constant) { - RETURN_ERROR1("Undefined symbol"); - } - else { - COPY_4V(number, constant); - return GL_TRUE; - } - } -} - - - -/** - * Parse a vector constant, one of: - * { float } - * { float, float } - * { float, float, float } - * { float, float, float, float } - */ -static GLboolean -Parse_VectorConstant(struct parse_state *parseState, GLfloat *vec) -{ - /* "{" was already consumed */ - - ASSIGN_4V(vec, 0.0, 0.0, 0.0, 1.0); - - if (!Parse_ScalarConstant(parseState, vec+0)) /* X */ - return GL_FALSE; - - if (Parse_String(parseState, "}")) { - return GL_TRUE; - } - - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected comma in vector constant"); - - if (!Parse_ScalarConstant(parseState, vec+1)) /* Y */ - return GL_FALSE; - - if (Parse_String(parseState, "}")) { - return GL_TRUE; - } - - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected comma in vector constant"); - - if (!Parse_ScalarConstant(parseState, vec+2)) /* Z */ - return GL_FALSE; - - if (Parse_String(parseState, "}")) { - return GL_TRUE; - } - - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected comma in vector constant"); - - if (!Parse_ScalarConstant(parseState, vec+3)) /* W */ - return GL_FALSE; - - if (!Parse_String(parseState, "}")) - RETURN_ERROR1("Expected closing brace in vector constant"); - - return GL_TRUE; -} - - -/** - * Parse , or {a, b, c, d}. - * Return number of values in the vector or scalar, or zero if parse error. - */ -static GLuint -Parse_VectorOrScalarConstant(struct parse_state *parseState, GLfloat *vec) -{ - if (Parse_String(parseState, "{")) { - return Parse_VectorConstant(parseState, vec); - } - else { - GLboolean b = Parse_ScalarConstant(parseState, vec); - if (b) { - vec[1] = vec[2] = vec[3] = vec[0]; - } - return b; - } -} - - -/** - * Parse a texture image source: - * [TEX0 | TEX1 | .. | TEX15] , [1D | 2D | 3D | CUBE | RECT] - */ -static GLboolean -Parse_TextureImageId(struct parse_state *parseState, - GLubyte *texUnit, GLubyte *texTargetBit) -{ - GLubyte imageSrc[100]; - GLint unit; - - if (!Parse_Token(parseState, imageSrc)) - RETURN_ERROR; - - if (imageSrc[0] != 'T' || - imageSrc[1] != 'E' || - imageSrc[2] != 'X') { - RETURN_ERROR1("Expected TEX# source"); - } - unit = _mesa_atoi((const char *) imageSrc + 3); - if ((unit < 0 || unit > MAX_TEXTURE_IMAGE_UNITS) || - (unit == 0 && (imageSrc[3] != '0' || imageSrc[4] != 0))) { - RETURN_ERROR1("Invalied TEX# source index"); - } - *texUnit = unit; - - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - - if (Parse_String(parseState, "1D")) { - *texTargetBit = TEXTURE_1D_BIT; - } - else if (Parse_String(parseState, "2D")) { - *texTargetBit = TEXTURE_2D_BIT; - } - else if (Parse_String(parseState, "3D")) { - *texTargetBit = TEXTURE_3D_BIT; - } - else if (Parse_String(parseState, "CUBE")) { - *texTargetBit = TEXTURE_CUBE_BIT; - } - else if (Parse_String(parseState, "RECT")) { - *texTargetBit = TEXTURE_RECT_BIT; - } - else { - RETURN_ERROR1("Invalid texture target token"); - } - - /* update record of referenced texture units */ - parseState->texturesUsed[*texUnit] |= *texTargetBit; - if (_mesa_bitcount(parseState->texturesUsed[*texUnit]) > 1) { - RETURN_ERROR1("Only one texture target can be used per texture unit."); - } - - return GL_TRUE; -} - - -/** - * Parse a scalar suffix like .x, .y, .z or .w or parse a swizzle suffix - * like .wxyz, .xxyy, etc and return the swizzle indexes. - */ -static GLboolean -Parse_SwizzleSuffix(const GLubyte *token, GLuint swizzle[4]) -{ - if (token[1] == 0) { - /* single letter swizzle (scalar) */ - if (token[0] == 'x') - ASSIGN_4V(swizzle, 0, 0, 0, 0); - else if (token[0] == 'y') - ASSIGN_4V(swizzle, 1, 1, 1, 1); - else if (token[0] == 'z') - ASSIGN_4V(swizzle, 2, 2, 2, 2); - else if (token[0] == 'w') - ASSIGN_4V(swizzle, 3, 3, 3, 3); - else - return GL_FALSE; - } - else { - /* 4-component swizzle (vector) */ - GLint k; - for (k = 0; token[k] && k < 4; k++) { - if (token[k] == 'x') - swizzle[k] = 0; - else if (token[k] == 'y') - swizzle[k] = 1; - else if (token[k] == 'z') - swizzle[k] = 2; - else if (token[k] == 'w') - swizzle[k] = 3; - else - return GL_FALSE; - } - if (k != 4) - return GL_FALSE; - } - return GL_TRUE; -} - - -static GLboolean -Parse_CondCodeMask(struct parse_state *parseState, - struct prog_dst_register *dstReg) -{ - if (Parse_String(parseState, "EQ")) - dstReg->CondMask = COND_EQ; - else if (Parse_String(parseState, "GE")) - dstReg->CondMask = COND_GE; - else if (Parse_String(parseState, "GT")) - dstReg->CondMask = COND_GT; - else if (Parse_String(parseState, "LE")) - dstReg->CondMask = COND_LE; - else if (Parse_String(parseState, "LT")) - dstReg->CondMask = COND_LT; - else if (Parse_String(parseState, "NE")) - dstReg->CondMask = COND_NE; - else if (Parse_String(parseState, "TR")) - dstReg->CondMask = COND_TR; - else if (Parse_String(parseState, "FL")) - dstReg->CondMask = COND_FL; - else - RETURN_ERROR1("Invalid condition code mask"); - - /* look for optional .xyzw swizzle */ - if (Parse_String(parseState, ".")) { - GLubyte token[100]; - GLuint swz[4]; - - if (!Parse_Token(parseState, token)) /* get xyzw suffix */ - RETURN_ERROR; - - if (!Parse_SwizzleSuffix(token, swz)) - RETURN_ERROR1("Invalid swizzle suffix"); - - dstReg->CondSwizzle = MAKE_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]); - } - - return GL_TRUE; -} - - -/** - * Parse a temporary register: Rnn or Hnn - */ -static GLboolean -Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) -{ - GLubyte token[100]; - - /* Should be 'R##' or 'H##' */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - if (token[0] != 'R' && token[0] != 'H') - RETURN_ERROR1("Expected R## or H##"); - - if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((const char *) (token + 1)); - if (token[0] == 'H') - reg += 32; - if (reg >= MAX_NV_FRAGMENT_PROGRAM_TEMPS) - RETURN_ERROR1("Invalid temporary register name"); - *tempRegNum = reg; - } - else { - RETURN_ERROR1("Invalid temporary register name"); - } - - return GL_TRUE; -} - - -/** - * Parse a write-only dummy register: RC or HC. - */ -static GLboolean -Parse_DummyReg(struct parse_state *parseState, GLint *regNum) -{ - if (Parse_String(parseState, "RC")) { - *regNum = 0; - } - else if (Parse_String(parseState, "HC")) { - *regNum = 1; - } - else { - RETURN_ERROR1("Invalid write-only register name"); - } - - return GL_TRUE; -} - - -/** - * Parse a program local parameter register "p[##]" - */ -static GLboolean -Parse_ProgramParamReg(struct parse_state *parseState, GLint *regNum) -{ - GLubyte token[100]; - - if (!Parse_String(parseState, "p[")) - RETURN_ERROR1("Expected p["); - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (IsDigit(token[0])) { - /* a numbered program parameter register */ - GLint reg = _mesa_atoi((const char *) token); - if (reg >= MAX_NV_FRAGMENT_PROGRAM_PARAMS) - RETURN_ERROR1("Invalid constant program number"); - *regNum = reg; - } - else { - RETURN_ERROR; - } - - if (!Parse_String(parseState, "]")) - RETURN_ERROR1("Expected ]"); - - return GL_TRUE; -} - - -/** - * Parse f[name] - fragment input register - */ -static GLboolean -Parse_FragReg(struct parse_state *parseState, GLint *tempRegNum) -{ - GLubyte token[100]; - GLint j; - - /* Match 'f[' */ - if (!Parse_String(parseState, "f[")) - RETURN_ERROR1("Expected f["); - - /* get and look for match */ - if (!Parse_Token(parseState, token)) { - RETURN_ERROR; - } - for (j = 0; InputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { - *tempRegNum = j; - parseState->inputsRead |= (1 << j); - break; - } - } - if (!InputRegisters[j]) { - /* unknown input register label */ - RETURN_ERROR2("Invalid register name", token); - } - - /* Match '[' */ - if (!Parse_String(parseState, "]")) - RETURN_ERROR1("Expected ]"); - - return GL_TRUE; -} - - -static GLboolean -Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) -{ - GLubyte token[100]; - GLint j; - - /* Match "o[" */ - if (!Parse_String(parseState, "o[")) - RETURN_ERROR1("Expected o["); - - /* Get output reg name */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - /* try to match an output register name */ - for (j = 0; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { - static GLuint bothColors = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_COLH); - *outputRegNum = j; - parseState->outputsWritten |= (1 << j); - if ((parseState->outputsWritten & bothColors) == bothColors) { - RETURN_ERROR1("Illegal to write to both o[COLR] and o[COLH]"); - } - break; - } - } - if (!OutputRegisters[j]) - RETURN_ERROR1("Invalid output register name"); - - /* Match ']' */ - if (!Parse_String(parseState, "]")) - RETURN_ERROR1("Expected ]"); - - return GL_TRUE; -} - - -static GLboolean -Parse_MaskedDstReg(struct parse_state *parseState, - struct prog_dst_register *dstReg) -{ - GLubyte token[100]; - GLint idx; - - /* Dst reg can be R, H, o[n], RC or HC */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - if (_mesa_strcmp((const char *) token, "RC") == 0 || - _mesa_strcmp((const char *) token, "HC") == 0) { - /* a write-only register */ - dstReg->File = PROGRAM_WRITE_ONLY; - if (!Parse_DummyReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else if (token[0] == 'R' || token[0] == 'H') { - /* a temporary register */ - dstReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else if (token[0] == 'o') { - /* an output register */ - dstReg->File = PROGRAM_OUTPUT; - if (!Parse_OutputReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else { - RETURN_ERROR1("Invalid destination register name"); - } - - /* Parse optional write mask */ - if (Parse_String(parseState, ".")) { - /* got a mask */ - GLint k = 0; - - if (!Parse_Token(parseState, token)) /* get xyzw writemask */ - RETURN_ERROR; - - dstReg->WriteMask = 0; - - if (token[k] == 'x') { - dstReg->WriteMask |= WRITEMASK_X; - k++; - } - if (token[k] == 'y') { - dstReg->WriteMask |= WRITEMASK_Y; - k++; - } - if (token[k] == 'z') { - dstReg->WriteMask |= WRITEMASK_Z; - k++; - } - if (token[k] == 'w') { - dstReg->WriteMask |= WRITEMASK_W; - k++; - } - if (k == 0) { - RETURN_ERROR1("Invalid writemask character"); - } - - } - else { - dstReg->WriteMask = WRITEMASK_XYZW; - } - - /* optional condition code mask */ - if (Parse_String(parseState, "(")) { - /* ("EQ" | "GE" | "GT" | "LE" | "LT" | "NE" | "TR" | "FL".x|y|z|w) */ - /* ("EQ" | "GE" | "GT" | "LE" | "LT" | "NE" | "TR" | "FL".[xyzw]) */ - if (!Parse_CondCodeMask(parseState, dstReg)) - RETURN_ERROR; - - if (!Parse_String(parseState, ")")) /* consume ")" */ - RETURN_ERROR1("Expected )"); - - return GL_TRUE; - } - else { - /* no cond code mask */ - dstReg->CondMask = COND_TR; - dstReg->CondSwizzle = SWIZZLE_NOOP; - return GL_TRUE; - } -} - - -/** - * Parse a vector source (register, constant, etc): - * ::= - * | - * ::= "|" "|" - */ -static GLboolean -Parse_VectorSrc(struct parse_state *parseState, - struct prog_src_register *srcReg) -{ - GLfloat sign = 1.0F; - GLubyte token[100]; - GLint idx; - - /* - * First, take care of +/- and absolute value stuff. - */ - if (Parse_String(parseState, "-")) - sign = -1.0F; - else if (Parse_String(parseState, "+")) - sign = +1.0F; - - if (Parse_String(parseState, "|")) { - srcReg->Abs = GL_TRUE; - srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE; - - if (Parse_String(parseState, "-")) - srcReg->NegateBase = NEGATE_XYZW; - else if (Parse_String(parseState, "+")) - srcReg->NegateBase = NEGATE_NONE; - else - srcReg->NegateBase = NEGATE_NONE; - } - else { - srcReg->Abs = GL_FALSE; - srcReg->NegateAbs = GL_FALSE; - srcReg->NegateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE; - } - - /* This should be the real src vector/register name */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - /* Src reg can be Rn, Hn, f[n], p[n], a named parameter, a scalar - * literal or vector literal. - */ - if (token[0] == 'R' || token[0] == 'H') { - srcReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'f') { - /* XXX this might be an identifier! */ - srcReg->File = PROGRAM_INPUT; - if (!Parse_FragReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'p') { - /* XXX this might be an identifier! */ - srcReg->File = PROGRAM_LOCAL_PARAM; - if (!Parse_ProgramParamReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (IsLetter(token[0])){ - GLubyte ident[100]; - GLint paramIndex; - if (!Parse_Identifier(parseState, ident)) - RETURN_ERROR; - paramIndex = _mesa_lookup_parameter_index(parseState->parameters, - -1, (const char *) ident); - if (paramIndex < 0) { - RETURN_ERROR2("Undefined constant or parameter: ", ident); - } - srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; - } - else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){ - /* literal scalar constant */ - GLfloat values[4]; - GLuint paramIndex; - if (!Parse_ScalarConstant(parseState, values)) - RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, - values, 4, NULL); - srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; - } - else if (token[0] == '{'){ - /* literal vector constant */ - GLfloat values[4]; - GLuint paramIndex; - (void) Parse_String(parseState, "{"); - if (!Parse_VectorConstant(parseState, values)) - RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, - values, 4, NULL); - srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; - } - else { - RETURN_ERROR2("Invalid source register name", token); - } - - /* init swizzle fields */ - srcReg->Swizzle = SWIZZLE_NOOP; - - /* Look for optional swizzle suffix */ - if (Parse_String(parseState, ".")) { - GLuint swz[4]; - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (!Parse_SwizzleSuffix(token, swz)) - RETURN_ERROR1("Invalid swizzle suffix"); - - srcReg->Swizzle = MAKE_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]); - } - - /* Finish absolute value */ - if (srcReg->Abs && !Parse_String(parseState, "|")) { - RETURN_ERROR1("Expected |"); - } - - return GL_TRUE; -} - - -static GLboolean -Parse_ScalarSrcReg(struct parse_state *parseState, - struct prog_src_register *srcReg) -{ - GLubyte token[100]; - GLfloat sign = 1.0F; - GLboolean needSuffix = GL_TRUE; - GLint idx; - - /* - * First, take care of +/- and absolute value stuff. - */ - if (Parse_String(parseState, "-")) - sign = -1.0F; - else if (Parse_String(parseState, "+")) - sign = +1.0F; - - if (Parse_String(parseState, "|")) { - srcReg->Abs = GL_TRUE; - srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE; - - if (Parse_String(parseState, "-")) - srcReg->NegateBase = NEGATE_XYZW; - else if (Parse_String(parseState, "+")) - srcReg->NegateBase = NEGATE_NONE; - else - srcReg->NegateBase = NEGATE_NONE; - } - else { - srcReg->Abs = GL_FALSE; - srcReg->NegateAbs = GL_FALSE; - srcReg->NegateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE; - } - - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - /* Src reg can be R, H or a named fragment attrib */ - if (token[0] == 'R' || token[0] == 'H') { - srcReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'f') { - srcReg->File = PROGRAM_INPUT; - if (!Parse_FragReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == '{') { - /* vector literal */ - GLfloat values[4]; - GLuint paramIndex; - (void) Parse_String(parseState, "{"); - if (!Parse_VectorConstant(parseState, values)) - RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, - values, 4, NULL); - srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; - } - else if (IsLetter(token[0])){ - /* named param/constant */ - GLubyte ident[100]; - GLint paramIndex; - if (!Parse_Identifier(parseState, ident)) - RETURN_ERROR; - paramIndex = _mesa_lookup_parameter_index(parseState->parameters, - -1, (const char *) ident); - if (paramIndex < 0) { - RETURN_ERROR2("Undefined constant or parameter: ", ident); - } - srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; - } - else if (IsDigit(token[0])) { - /* scalar literal */ - GLfloat values[4]; - GLuint paramIndex; - if (!Parse_ScalarConstant(parseState, values)) - RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, - values, 4, NULL); - srcReg->Index = paramIndex; - srcReg->File = PROGRAM_NAMED_PARAM; - needSuffix = GL_FALSE; - } - else { - RETURN_ERROR2("Invalid scalar source argument", token); - } - - srcReg->Swizzle = 0; - if (needSuffix) { - /* parse .[xyzw] suffix */ - if (!Parse_String(parseState, ".")) - RETURN_ERROR1("Expected ."); - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (token[0] == 'x' && token[1] == 0) { - srcReg->Swizzle = 0; - } - else if (token[0] == 'y' && token[1] == 0) { - srcReg->Swizzle = 1; - } - else if (token[0] == 'z' && token[1] == 0) { - srcReg->Swizzle = 2; - } - else if (token[0] == 'w' && token[1] == 0) { - srcReg->Swizzle = 3; - } - else { - RETURN_ERROR1("Invalid scalar source suffix"); - } - } - - /* Finish absolute value */ - if (srcReg->Abs && !Parse_String(parseState, "|")) { - RETURN_ERROR1("Expected |"); - } - - return GL_TRUE; -} - - -static GLboolean -Parse_PrintInstruction(struct parse_state *parseState, - struct prog_instruction *inst) -{ - const GLubyte *str; - GLubyte *msg; - GLuint len; - GLint idx; - - /* The first argument is a literal string 'just like this' */ - if (!Parse_String(parseState, "'")) - RETURN_ERROR1("Expected '"); - - str = parseState->pos; - for (len = 0; str[len] != '\''; len++) /* find closing quote */ - ; - parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); - - _mesa_memcpy(msg, str, len); - msg[len] = 0; - inst->Data = msg; - - if (Parse_String(parseState, ",")) { - /* got an optional register to print */ - GLubyte token[100]; - GetToken(parseState, token); - if (token[0] == 'o') { - /* dst reg */ - if (!Parse_OutputReg(parseState, &idx)) - RETURN_ERROR; - inst->SrcReg[0].Index = idx; - inst->SrcReg[0].File = PROGRAM_OUTPUT; - } - else { - /* src reg */ - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - } - } - else { - inst->SrcReg[0].File = PROGRAM_UNDEFINED; - } - - inst->SrcReg[0].Swizzle = SWIZZLE_NOOP; - inst->SrcReg[0].NegateBase = NEGATE_NONE; - inst->SrcReg[0].Abs = GL_FALSE; - inst->SrcReg[0].NegateAbs = GL_FALSE; - - return GL_TRUE; -} - - -static GLboolean -Parse_InstructionSequence(struct parse_state *parseState, - struct prog_instruction program[]) -{ - while (1) { - struct prog_instruction *inst = program + parseState->numInst; - struct instruction_pattern instMatch; - GLubyte token[100]; - - /* Initialize the instruction */ - _mesa_init_instructions(inst, 1); - - /* special instructions */ - if (Parse_String(parseState, "DEFINE")) { - GLubyte id[100]; - GLfloat value[7]; /* yes, 7 to be safe */ - if (!Parse_Identifier(parseState, id)) - RETURN_ERROR; - /* XXX make sure id is not a reserved identifer, like R9 */ - if (!Parse_String(parseState, "=")) - RETURN_ERROR1("Expected ="); - if (!Parse_VectorOrScalarConstant(parseState, value)) - RETURN_ERROR; - if (!Parse_String(parseState, ";")) - RETURN_ERROR1("Expected ;"); - if (_mesa_lookup_parameter_index(parseState->parameters, - -1, (const char *) id) >= 0) { - RETURN_ERROR2(id, "already defined"); - } - _mesa_add_named_parameter(parseState->parameters, - (const char *) id, value); - } - else if (Parse_String(parseState, "DECLARE")) { - GLubyte id[100]; - GLfloat value[7] = {0, 0, 0, 0, 0, 0, 0}; /* yes, to be safe */ - if (!Parse_Identifier(parseState, id)) - RETURN_ERROR; - /* XXX make sure id is not a reserved identifer, like R9 */ - if (Parse_String(parseState, "=")) { - if (!Parse_VectorOrScalarConstant(parseState, value)) - RETURN_ERROR; - } - if (!Parse_String(parseState, ";")) - RETURN_ERROR1("Expected ;"); - if (_mesa_lookup_parameter_index(parseState->parameters, - -1, (const char *) id) >= 0) { - RETURN_ERROR2(id, "already declared"); - } - _mesa_add_named_parameter(parseState->parameters, - (const char *) id, value); - } - else if (Parse_String(parseState, "END")) { - inst->Opcode = OPCODE_END; - inst->StringPos = parseState->curLine - parseState->start; - assert(inst->StringPos >= 0); - parseState->numInst++; - if (Parse_Token(parseState, token)) { - RETURN_ERROR1("Code after END opcode."); - } - break; - } - else { - /* general/arithmetic instruction */ - - /* get token */ - if (!Parse_Token(parseState, token)) { - RETURN_ERROR1("Missing END instruction."); - } - - /* try to find matching instuction */ - instMatch = MatchInstruction(token); - if (instMatch.opcode >= MAX_OPCODE) { - /* bad instruction name */ - RETURN_ERROR2("Unexpected token: ", token); - } - - inst->Opcode = instMatch.opcode; - inst->Precision = instMatch.suffixes & (_R | _H | _X); - inst->SaturateMode = (instMatch.suffixes & (_S)) - ? SATURATE_ZERO_ONE : SATURATE_OFF; - inst->CondUpdate = (instMatch.suffixes & (_C)) ? GL_TRUE : GL_FALSE; - inst->StringPos = parseState->curLine - parseState->start; - assert(inst->StringPos >= 0); - - /* - * parse the input and output operands - */ - if (instMatch.outputs == OUTPUT_S || instMatch.outputs == OUTPUT_V) { - if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - } - else if (instMatch.outputs == OUTPUT_NONE) { - if (instMatch.opcode == OPCODE_KIL_NV) { - /* This is a little weird, the cond code info is in - * the dest register. - */ - if (!Parse_CondCodeMask(parseState, &inst->DstReg)) - RETURN_ERROR; - } - else { - ASSERT(instMatch.opcode == OPCODE_PRINT); - } - } - - if (instMatch.inputs == INPUT_1V) { - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - } - else if (instMatch.inputs == INPUT_2V) { - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_VectorSrc(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - } - else if (instMatch.inputs == INPUT_3V) { - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_VectorSrc(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_VectorSrc(parseState, &inst->SrcReg[2])) - RETURN_ERROR; - } - else if (instMatch.inputs == INPUT_1S) { - if (!Parse_ScalarSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - } - else if (instMatch.inputs == INPUT_2S) { - if (!Parse_ScalarSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_ScalarSrcReg(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - } - else if (instMatch.inputs == INPUT_CC) { - /* XXX to-do */ - } - else if (instMatch.inputs == INPUT_1V_T) { - GLubyte unit, idx; - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_TextureImageId(parseState, &unit, &idx)) - RETURN_ERROR; - inst->TexSrcUnit = unit; - inst->TexSrcTarget = idx; - } - else if (instMatch.inputs == INPUT_3V_T) { - GLubyte unit, idx; - if (!Parse_VectorSrc(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_VectorSrc(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_VectorSrc(parseState, &inst->SrcReg[2])) - RETURN_ERROR; - if (!Parse_String(parseState, ",")) - RETURN_ERROR1("Expected ,"); - if (!Parse_TextureImageId(parseState, &unit, &idx)) - RETURN_ERROR; - inst->TexSrcUnit = unit; - inst->TexSrcTarget = idx; - } - else if (instMatch.inputs == INPUT_1V_S) { - if (!Parse_PrintInstruction(parseState, inst)) - RETURN_ERROR; - } - - /* end of statement semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR1("Expected ;"); - - parseState->numInst++; - - if (parseState->numInst >= MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS) - RETURN_ERROR1("Program too long"); - } - } - return GL_TRUE; -} - - - -/** - * Parse/compile the 'str' returning the compiled 'program'. - * ctx->Program.ErrorPos will be -1 if successful. Otherwise, ErrorPos - * indicates the position of the error in 'str'. - */ -void -_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, - const GLubyte *str, GLsizei len, - struct gl_fragment_program *program) -{ - struct parse_state parseState; - struct prog_instruction instBuffer[MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS]; - struct prog_instruction *newInst; - GLenum target; - GLubyte *programString; - - /* Make a null-terminated copy of the program string */ - programString = (GLubyte *) MALLOC(len + 1); - if (!programString) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - MEMCPY(programString, str, len); - programString[len] = 0; - - /* Get ready to parse */ - _mesa_bzero(&parseState, sizeof(struct parse_state)); - parseState.ctx = ctx; - parseState.start = programString; - parseState.program = program; - parseState.numInst = 0; - parseState.curLine = programString; - parseState.parameters = _mesa_new_parameter_list(); - - /* Reset error state */ - _mesa_set_program_error(ctx, -1, NULL); - - /* check the program header */ - if (_mesa_strncmp((const char *) programString, "!!FP1.0", 7) == 0) { - target = GL_FRAGMENT_PROGRAM_NV; - parseState.pos = programString + 7; - } - else if (_mesa_strncmp((const char *) programString, "!!FCP1.0", 8) == 0) { - /* fragment / register combiner program - not supported */ - _mesa_set_program_error(ctx, 0, "Invalid fragment program header"); - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(bad header)"); - return; - } - else { - /* invalid header */ - _mesa_set_program_error(ctx, 0, "Invalid fragment program header"); - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(bad header)"); - return; - } - - /* make sure target and header match */ - if (target != dstTarget) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glLoadProgramNV(target mismatch 0x%x != 0x%x)", - target, dstTarget); - return; - } - - if (Parse_InstructionSequence(&parseState, instBuffer)) { - GLuint u; - /* successful parse! */ - - if (parseState.outputsWritten == 0) { - /* must write at least one output! */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "Invalid fragment program - no outputs written."); - return; - } - - /* copy the compiled instructions */ - assert(parseState.numInst <= MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS); - newInst = _mesa_alloc_instructions(parseState.numInst); - if (!newInst) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; /* out of memory */ - } - _mesa_copy_instructions(newInst, instBuffer, parseState.numInst); - - /* install the program */ - program->Base.Target = target; - if (program->Base.String) { - FREE(program->Base.String); - } - program->Base.String = programString; - program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; - if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); - } - program->Base.Instructions = newInst; - program->Base.NumInstructions = parseState.numInst; - program->Base.InputsRead = parseState.inputsRead; - program->Base.OutputsWritten = parseState.outputsWritten; - for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) - program->Base.TexturesUsed[u] = parseState.texturesUsed[u]; - - /* save program parameters */ - program->Base.Parameters = parseState.parameters; - - /* allocate registers for declared program parameters */ -#if 00 - _mesa_assign_program_registers(&(program->SymbolTable)); -#endif - -#ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id); - _mesa_print_nv_fragment_program(program); - _mesa_printf("----------------------------------\n"); -#endif - } - else { - /* Error! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV"); - /* NOTE: _mesa_set_program_error would have been called already */ - } -} - - -static void -PrintSrcReg(const struct gl_fragment_program *program, - const struct prog_src_register *src) -{ - static const char comps[5] = "xyzw"; - - if (src->NegateAbs) { - _mesa_printf("-"); - } - if (src->Abs) { - _mesa_printf("|"); - } - if (src->NegateBase) { - _mesa_printf("-"); - } - if (src->File == PROGRAM_NAMED_PARAM) { - if (program->Base.Parameters->Parameters[src->Index].Type - == PROGRAM_CONSTANT) { - const GLfloat *v; - v = program->Base.Parameters->ParameterValues[src->Index]; - _mesa_printf("{%g, %g, %g, %g}", v[0], v[1], v[2], v[3]); - } - else { - ASSERT(program->Base.Parameters->Parameters[src->Index].Type - == PROGRAM_NAMED_PARAM); - _mesa_printf("%s", program->Base.Parameters->Parameters[src->Index].Name); - } - } - else if (src->File == PROGRAM_OUTPUT) { - _mesa_printf("o[%s]", OutputRegisters[src->Index]); - } - else if (src->File == PROGRAM_INPUT) { - _mesa_printf("f[%s]", InputRegisters[src->Index]); - } - else if (src->File == PROGRAM_LOCAL_PARAM) { - _mesa_printf("p[%d]", src->Index); - } - else if (src->File == PROGRAM_TEMPORARY) { - if (src->Index >= 32) - _mesa_printf("H%d", src->Index); - else - _mesa_printf("R%d", src->Index); - } - else if (src->File == PROGRAM_WRITE_ONLY) { - _mesa_printf("%cC", "HR"[src->Index]); - } - else { - _mesa_problem(NULL, "Invalid fragment register %d", src->Index); - return; - } - if (GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 1) && - GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 2) && - GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 3)) { - _mesa_printf(".%c", comps[GET_SWZ(src->Swizzle, 0)]); - } - else if (src->Swizzle != SWIZZLE_NOOP) { - _mesa_printf(".%c%c%c%c", - comps[GET_SWZ(src->Swizzle, 0)], - comps[GET_SWZ(src->Swizzle, 1)], - comps[GET_SWZ(src->Swizzle, 2)], - comps[GET_SWZ(src->Swizzle, 3)]); - } - if (src->Abs) { - _mesa_printf("|"); - } -} - -static void -PrintTextureSrc(const struct prog_instruction *inst) -{ - _mesa_printf("TEX%d, ", inst->TexSrcUnit); - switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: - _mesa_printf("1D"); - break; - case TEXTURE_2D_INDEX: - _mesa_printf("2D"); - break; - case TEXTURE_3D_INDEX: - _mesa_printf("3D"); - break; - case TEXTURE_RECT_INDEX: - _mesa_printf("RECT"); - break; - case TEXTURE_CUBE_INDEX: - _mesa_printf("CUBE"); - break; - default: - _mesa_problem(NULL, "Invalid textue target in PrintTextureSrc"); - } -} - -static void -PrintCondCode(const struct prog_dst_register *dst) -{ - static const char *comps = "xyzw"; - static const char *ccString[] = { - "??", "GT", "EQ", "LT", "UN", "GE", "LE", "NE", "TR", "FL", "??" - }; - - _mesa_printf("%s", ccString[dst->CondMask]); - if (GET_SWZ(dst->CondSwizzle, 0) == GET_SWZ(dst->CondSwizzle, 1) && - GET_SWZ(dst->CondSwizzle, 0) == GET_SWZ(dst->CondSwizzle, 2) && - GET_SWZ(dst->CondSwizzle, 0) == GET_SWZ(dst->CondSwizzle, 3)) { - _mesa_printf(".%c", comps[GET_SWZ(dst->CondSwizzle, 0)]); - } - else if (dst->CondSwizzle != SWIZZLE_NOOP) { - _mesa_printf(".%c%c%c%c", - comps[GET_SWZ(dst->CondSwizzle, 0)], - comps[GET_SWZ(dst->CondSwizzle, 1)], - comps[GET_SWZ(dst->CondSwizzle, 2)], - comps[GET_SWZ(dst->CondSwizzle, 3)]); - } -} - - -static void -PrintDstReg(const struct prog_dst_register *dst) -{ - if (dst->File == PROGRAM_OUTPUT) { - _mesa_printf("o[%s]", OutputRegisters[dst->Index]); - } - else if (dst->File == PROGRAM_TEMPORARY) { - if (dst->Index >= 32) - _mesa_printf("H%d", dst->Index); - else - _mesa_printf("R%d", dst->Index); - } - else if (dst->File == PROGRAM_LOCAL_PARAM) { - _mesa_printf("p[%d]", dst->Index); - } - else if (dst->File == PROGRAM_WRITE_ONLY) { - _mesa_printf("%cC", "HR"[dst->Index]); - } - else { - _mesa_printf("???"); - } - - if (dst->WriteMask != 0 && dst->WriteMask != WRITEMASK_XYZW) { - _mesa_printf("."); - if (dst->WriteMask & WRITEMASK_X) - _mesa_printf("x"); - if (dst->WriteMask & WRITEMASK_Y) - _mesa_printf("y"); - if (dst->WriteMask & WRITEMASK_Z) - _mesa_printf("z"); - if (dst->WriteMask & WRITEMASK_W) - _mesa_printf("w"); - } - - if (dst->CondMask != COND_TR || - dst->CondSwizzle != SWIZZLE_NOOP) { - _mesa_printf(" ("); - PrintCondCode(dst); - _mesa_printf(")"); - } -} - - -/** - * Print (unparse) the given vertex program. Just for debugging. - */ -void -_mesa_print_nv_fragment_program(const struct gl_fragment_program *program) -{ - const struct prog_instruction *inst; - - for (inst = program->Base.Instructions; inst->Opcode != OPCODE_END; inst++) { - int i; - for (i = 0; Instructions[i].name; i++) { - if (inst->Opcode == Instructions[i].opcode) { - /* print instruction name */ - _mesa_printf("%s", Instructions[i].name); - if (inst->Precision == FLOAT16) - _mesa_printf("H"); - else if (inst->Precision == FIXED12) - _mesa_printf("X"); - if (inst->CondUpdate) - _mesa_printf("C"); - if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - _mesa_printf(" "); - - if (Instructions[i].inputs == INPUT_CC) { - PrintCondCode(&inst->DstReg); - } - else if (Instructions[i].outputs == OUTPUT_V || - Instructions[i].outputs == OUTPUT_S) { - /* print dest register */ - PrintDstReg(&inst->DstReg); - _mesa_printf(", "); - } - - /* print source register(s) */ - if (Instructions[i].inputs == INPUT_1V || - Instructions[i].inputs == INPUT_1S) { - PrintSrcReg(program, &inst->SrcReg[0]); - } - else if (Instructions[i].inputs == INPUT_2V || - Instructions[i].inputs == INPUT_2S) { - PrintSrcReg(program, &inst->SrcReg[0]); - _mesa_printf(", "); - PrintSrcReg(program, &inst->SrcReg[1]); - } - else if (Instructions[i].inputs == INPUT_3V) { - PrintSrcReg(program, &inst->SrcReg[0]); - _mesa_printf(", "); - PrintSrcReg(program, &inst->SrcReg[1]); - _mesa_printf(", "); - PrintSrcReg(program, &inst->SrcReg[2]); - } - else if (Instructions[i].inputs == INPUT_1V_T) { - PrintSrcReg(program, &inst->SrcReg[0]); - _mesa_printf(", "); - PrintTextureSrc(inst); - } - else if (Instructions[i].inputs == INPUT_3V_T) { - PrintSrcReg(program, &inst->SrcReg[0]); - _mesa_printf(", "); - PrintSrcReg(program, &inst->SrcReg[1]); - _mesa_printf(", "); - PrintSrcReg(program, &inst->SrcReg[2]); - _mesa_printf(", "); - PrintTextureSrc(inst); - } - _mesa_printf(";\n"); - break; - } - } - if (!Instructions[i].name) { - _mesa_printf("Invalid opcode %d\n", inst->Opcode); - } - } - _mesa_printf("END\n"); -} - - -const char * -_mesa_nv_fragment_input_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_FRAGMENT_PROGRAM_INPUTS); - return InputRegisters[i]; -} - - -const char * -_mesa_nv_fragment_output_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); - return OutputRegisters[i]; -} diff --git a/src/libs/mesa/mesa/shader/nvfragparse.h b/src/libs/mesa/mesa/shader/nvfragparse.h deleted file mode 100644 index de45cf543d..0000000000 --- a/src/libs/mesa/mesa/shader/nvfragparse.h +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2002 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. - * - * Authors: - * Brian Paul - */ - - -#ifndef NVFRAGPARSE_H -#define NVFRAGPARSE_H - - -extern void -_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum target, - const GLubyte *str, GLsizei len, - struct gl_fragment_program *program); - - -extern void -_mesa_print_nv_fragment_program(const struct gl_fragment_program *program); - - -extern const char * -_mesa_nv_fragment_input_register_name(GLuint i); - - -extern const char * -_mesa_nv_fragment_output_register_name(GLuint i); - - -#endif diff --git a/src/libs/mesa/mesa/shader/nvprogram.c b/src/libs/mesa/mesa/shader/nvprogram.c deleted file mode 100644 index 88272fff3f..0000000000 --- a/src/libs/mesa/mesa/shader/nvprogram.c +++ /dev/null @@ -1,816 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file nvprogram.c - * NVIDIA vertex/fragment program state management functions. - * \author Brian Paul - */ - -/* - * Regarding GL_NV_fragment/vertex_program, GL_NV_vertex_program1_1, etc: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/imports.h" -#include "main/macros.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_instruction.h" -#include "nvfragparse.h" -#include "nvvertparse.h" -#include "nvprogram.h" - - - -/** - * Execute a vertex state program. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) -{ - struct gl_vertex_program *vprog; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_VERTEX_STATE_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glExecuteProgramNV"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - vprog = (struct gl_vertex_program *) _mesa_lookup_program(ctx, id); - - if (!vprog || vprog->Base.Target != GL_VERTEX_STATE_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glExecuteProgramNV"); - return; - } - - _mesa_problem(ctx, "glExecuteProgramNV() not supported"); -} - - -/** - * Determine if a set of programs is resident in hardware. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -GLboolean GLAPIENTRY -_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, - GLboolean *residences) -{ - GLint i, j; - GLboolean allResident = GL_TRUE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV(n)"); - return GL_FALSE; - } - - for (i = 0; i < n; i++) { - const struct gl_program *prog; - if (ids[i] == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); - return GL_FALSE; - } - prog = _mesa_lookup_program(ctx, ids[i]); - if (!prog) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); - return GL_FALSE; - } - if (prog->Resident) { - if (!allResident) - residences[i] = GL_TRUE; - } - else { - if (allResident) { - allResident = GL_FALSE; - for (j = 0; j < i; j++) - residences[j] = GL_TRUE; - } - residences[i] = GL_FALSE; - } - } - - return allResident; -} - - -/** - * Request that a set of programs be resident in hardware. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(n)"); - return; - } - - /* just error checking for now */ - for (i = 0; i < n; i++) { - struct gl_program *prog; - - if (ids[i] == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); - return; - } - - prog = _mesa_lookup_program(ctx, ids[i]); - if (!prog) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); - return; - } - - /* XXX this is really a hardware thing we should hook out */ - prog->Resident = GL_TRUE; - } -} - - -/** - * Get a program parameter register. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramParameterfvNV(GLenum target, GLuint index, - GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV) { - if (pname == GL_PROGRAM_PARAMETER_NV) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - COPY_4V(params, ctx->VertexProgram.Parameters[index]); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramParameterfvNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterfvNV(pname)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterfvNV(target)"); - return; - } -} - - -/** - * Get a program parameter register. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramParameterdvNV(GLenum target, GLuint index, - GLenum pname, GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV) { - if (pname == GL_PROGRAM_PARAMETER_NV) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - COPY_4V(params, ctx->VertexProgram.Parameters[index]); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramParameterdvNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterdvNV(pname)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterdvNV(target)"); - return; - } -} - - -/** - * Get a program attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - prog = _mesa_lookup_program(ctx, id); - if (!prog) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramivNV"); - return; - } - - switch (pname) { - case GL_PROGRAM_TARGET_NV: - *params = prog->Target; - return; - case GL_PROGRAM_LENGTH_NV: - *params = prog->String ?(GLint)_mesa_strlen((char *) prog->String) : 0; - return; - case GL_PROGRAM_RESIDENT_NV: - *params = prog->Resident; - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivNV(pname)"); - return; - } -} - - -/** - * Get the program source code. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (pname != GL_PROGRAM_STRING_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringNV(pname)"); - return; - } - - prog = _mesa_lookup_program(ctx, id); - if (!prog) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramStringNV"); - return; - } - - if (prog->String) { - MEMCPY(program, prog->String, _mesa_strlen((char *) prog->String)); - } - else { - program[0] = 0; - } -} - - -/** - * Get matrix tracking information. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetTrackMatrixivNV(GLenum target, GLuint address, - GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV - && ctx->Extensions.NV_vertex_program) { - GLuint i; - - if ((address & 0x3) || address >= MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetTrackMatrixivNV(address)"); - return; - } - - i = address / 4; - - switch (pname) { - case GL_TRACK_MATRIX_NV: - params[0] = (GLint) ctx->VertexProgram.TrackMatrix[i]; - return; - case GL_TRACK_MATRIX_TRANSFORM_NV: - params[0] = (GLint) ctx->VertexProgram.TrackMatrixTransform[i]; - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTrackMatrixivNV"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTrackMatrixivNV"); - return; - } -} - - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type; - break; - case GL_CURRENT_ATTRIB_NV: - if (index == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetVertexAttribdvNV(index == 0)"); - return; - } - FLUSH_CURRENT(ctx, 0); - COPY_4V(params, ctx->Current.Attrib[index]); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type; - break; - case GL_CURRENT_ATTRIB_NV: - if (index == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetVertexAttribfvNV(index == 0)"); - return; - } - FLUSH_CURRENT(ctx, 0); - COPY_4V(params, ctx->Current.Attrib[index]); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type; - break; - case GL_CURRENT_ATTRIB_NV: - if (index == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetVertexAttribivNV(index == 0)"); - return; - } - FLUSH_CURRENT(ctx, 0); - params[0] = (GLint) ctx->Current.Attrib[index][0]; - params[1] = (GLint) ctx->Current.Attrib[index][1]; - params[2] = (GLint) ctx->Current.Attrib[index][2]; - params[3] = (GLint) ctx->Current.Attrib[index][3]; - break; - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - if (!ctx->Extensions.ARB_vertex_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - - -/** - * Get a vertex array attribute pointer. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerNV(index)"); - return; - } - - if (pname != GL_ATTRIB_ARRAY_POINTER_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribPointerNV(pname)"); - return; - } - - *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[index].Ptr; -} - - - -/** - * Load/parse/compile a program. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, - const GLubyte *program) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(id)"); - return; - } - - if (len < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(len)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - prog = _mesa_lookup_program(ctx, id); - - if (prog && prog->Target != 0 && prog->Target != target) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(target)"); - return; - } - - if ((target == GL_VERTEX_PROGRAM_NV || - target == GL_VERTEX_STATE_PROGRAM_NV) - && ctx->Extensions.NV_vertex_program) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (!vprog || prog == &_mesa_DummyProgram) { - vprog = (struct gl_vertex_program *) - ctx->Driver.NewProgram(ctx, target, id); - if (!vprog) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, vprog); - } - _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); - } - else if (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) { - struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; - if (!fprog || prog == &_mesa_DummyProgram) { - fprog = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, target, id); - if (!fprog) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, fprog); - } - _mesa_parse_nv_fragment_program(ctx, target, program, len, fprog); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glLoadProgramNV(target)"); - } -} - - - -/** - * Set a sequence of program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameters4dvNV(GLenum target, GLuint index, - GLuint num, const GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - GLuint i; - if (index + num > MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameters4dvNV"); - return; - } - for (i = 0; i < num; i++) { - ctx->VertexProgram.Parameters[index + i][0] = (GLfloat) params[0]; - ctx->VertexProgram.Parameters[index + i][1] = (GLfloat) params[1]; - ctx->VertexProgram.Parameters[index + i][2] = (GLfloat) params[2]; - ctx->VertexProgram.Parameters[index + i][3] = (GLfloat) params[3]; - params += 4; - }; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameters4dvNV"); - return; - } -} - - -/** - * Set a sequence of program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameters4fvNV(GLenum target, GLuint index, - GLuint num, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - GLuint i; - if (index + num > MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameters4fvNV"); - return; - } - for (i = 0; i < num; i++) { - COPY_4V(ctx->VertexProgram.Parameters[index + i], params); - params += 4; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameters4fvNV"); - return; - } -} - - - -/** - * Setup tracking of matrices into program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_TrackMatrixNV(GLenum target, GLuint address, - GLenum matrix, GLenum transform) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - if (address & 0x3) { - /* addr must be multiple of four */ - _mesa_error(ctx, GL_INVALID_VALUE, "glTrackMatrixNV(address)"); - return; - } - - switch (matrix) { - case GL_NONE: - case GL_MODELVIEW: - case GL_PROJECTION: - case GL_TEXTURE: - case GL_COLOR: - case GL_MODELVIEW_PROJECTION_NV: - case GL_MATRIX0_NV: - case GL_MATRIX1_NV: - case GL_MATRIX2_NV: - case GL_MATRIX3_NV: - case GL_MATRIX4_NV: - case GL_MATRIX5_NV: - case GL_MATRIX6_NV: - case GL_MATRIX7_NV: - /* OK, fallthrough */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(matrix)"); - return; - } - - switch (transform) { - case GL_IDENTITY_NV: - case GL_INVERSE_NV: - case GL_TRANSPOSE_NV: - case GL_INVERSE_TRANSPOSE_NV: - /* OK, fallthrough */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(transform)"); - return; - } - - ctx->VertexProgram.TrackMatrix[address / 4] = matrix; - ctx->VertexProgram.TrackMatrixTransform[address / 4] = transform; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(target)"); - return; - } -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - struct gl_program *prog; - struct gl_fragment_program *fragProg; - GLfloat *v; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - prog = _mesa_lookup_program(ctx, id); - if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramNamedParameterNV"); - return; - } - - if (len <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(len)"); - return; - } - - fragProg = (struct gl_fragment_program *) prog; - v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len, - (char *) name); - if (v) { - v[0] = x; - v[1] = y; - v[2] = z; - v[3] = w; - return; - } - - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(name)"); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, - const float v[]) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, - (GLfloat)z, (GLfloat)w); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, - const double v[]) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, - (GLfloat)v[0], (GLfloat)v[1], - (GLfloat)v[2], (GLfloat)v[3]); -} - - -void GLAPIENTRY -_mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat *params) -{ - struct gl_program *prog; - struct gl_fragment_program *fragProg; - const GLfloat *v; - - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); - - prog = _mesa_lookup_program(ctx, id); - if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramNamedParameterNV"); - return; - } - - if (len <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramNamedParameterNV"); - return; - } - - fragProg = (struct gl_fragment_program *) prog; - v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, - len, (char *) name); - if (v) { - params[0] = v[0]; - params[1] = v[1]; - params[2] = v[2]; - params[3] = v[3]; - return; - } - - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramNamedParameterNV"); -} - - -void GLAPIENTRY -_mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble *params) -{ - GLfloat floatParams[4]; - _mesa_GetProgramNamedParameterfvNV(id, len, name, floatParams); - COPY_4V(params, floatParams); -} diff --git a/src/libs/mesa/mesa/shader/nvprogram.h b/src/libs/mesa/mesa/shader/nvprogram.h deleted file mode 100644 index bfac165b5e..0000000000 --- a/src/libs/mesa/mesa/shader/nvprogram.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - * - * Authors: - * Brian Paul - */ - - -#ifndef NVPROGRAM_H -#define NVPROGRAM_H - - -extern void GLAPIENTRY -_mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params); - -extern GLboolean GLAPIENTRY -_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, GLboolean *residences); - -extern void GLAPIENTRY -_mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids); - -extern void GLAPIENTRY -_mesa_GetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble *params); - -extern void GLAPIENTRY -_mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program); - -extern void GLAPIENTRY -_mesa_GetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer); - -extern void GLAPIENTRY -_mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program); - -extern void GLAPIENTRY -_mesa_ProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble *params); - -extern void GLAPIENTRY -_mesa_ProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat *params); - -extern void GLAPIENTRY -_mesa_TrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform); - - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, - const float v[]); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, - const double v[]); - -extern void GLAPIENTRY -_mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble *params); - - -#endif diff --git a/src/libs/mesa/mesa/shader/nvvertparse.c b/src/libs/mesa/mesa/shader/nvvertparse.c deleted file mode 100644 index 08538c0ee4..0000000000 --- a/src/libs/mesa/mesa/shader/nvvertparse.c +++ /dev/null @@ -1,1589 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file nvvertparse.c - * NVIDIA vertex program parser. - * \author Brian Paul - */ - -/* - * Regarding GL_NV_vertex_program, GL_NV_vertex_program1_1: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/macros.h" -#include "nvprogram.h" -#include "nvvertparse.h" -#include "prog_instruction.h" -#include "program.h" - - -/** - * Current parsing state. This structure is passed among the parsing - * functions and keeps track of the current parser position and various - * program attributes. - */ -struct parse_state { - GLcontext *ctx; - const GLubyte *start; - const GLubyte *pos; - const GLubyte *curLine; - GLboolean isStateProgram; - GLboolean isPositionInvariant; - GLboolean isVersion1_1; - GLbitfield inputsRead; - GLbitfield outputsWritten; - GLboolean anyProgRegsWritten; - GLuint numInst; /* number of instructions parsed */ -}; - - -/* - * Called whenever we find an error during parsing. - */ -static void -record_error(struct parse_state *parseState, const char *msg, int lineNo) -{ -#ifdef DEBUG - GLint line, column; - const GLubyte *lineStr; - lineStr = _mesa_find_line_column(parseState->start, - parseState->pos, &line, &column); - _mesa_debug(parseState->ctx, - "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", - lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); -#else - (void) lineNo; -#endif - - /* Check that no error was already recorded. Only record the first one. */ - if (parseState->ctx->Program.ErrorString[0] == 0) { - _mesa_set_program_error(parseState->ctx, - parseState->pos - parseState->start, - msg); - } -} - - -#define RETURN_ERROR \ -do { \ - record_error(parseState, "Unexpected end of input.", __LINE__); \ - return GL_FALSE; \ -} while(0) - -#define RETURN_ERROR1(msg) \ -do { \ - record_error(parseState, msg, __LINE__); \ - return GL_FALSE; \ -} while(0) - -#define RETURN_ERROR2(msg1, msg2) \ -do { \ - char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ - record_error(parseState, err, __LINE__); \ - return GL_FALSE; \ -} while(0) - - - - - -static GLboolean IsLetter(GLubyte b) -{ - return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z'); -} - - -static GLboolean IsDigit(GLubyte b) -{ - return b >= '0' && b <= '9'; -} - - -static GLboolean IsWhitespace(GLubyte b) -{ - return b == ' ' || b == '\t' || b == '\n' || b == '\r'; -} - - -/** - * Starting at 'str' find the next token. A token can be an integer, - * an identifier or punctuation symbol. - * \return <= 0 we found an error, else, return number of characters parsed. - */ -static GLint -GetToken(struct parse_state *parseState, GLubyte *token) -{ - const GLubyte *str = parseState->pos; - GLint i = 0, j = 0; - - token[0] = 0; - - /* skip whitespace and comments */ - while (str[i] && (IsWhitespace(str[i]) || str[i] == '#')) { - if (str[i] == '#') { - /* skip comment */ - while (str[i] && (str[i] != '\n' && str[i] != '\r')) { - i++; - } - if (str[i] == '\n' || str[i] == '\r') - parseState->curLine = str + i + 1; - } - else { - /* skip whitespace */ - if (str[i] == '\n' || str[i] == '\r') - parseState->curLine = str + i + 1; - i++; - } - } - - if (str[i] == 0) - return -i; - - /* try matching an integer */ - while (str[i] && IsDigit(str[i])) { - token[j++] = str[i++]; - } - if (j > 0 || !str[i]) { - token[j] = 0; - return i; - } - - /* try matching an identifier */ - if (IsLetter(str[i])) { - while (str[i] && (IsLetter(str[i]) || IsDigit(str[i]))) { - token[j++] = str[i++]; - } - token[j] = 0; - return i; - } - - /* punctuation character */ - if (str[i]) { - token[0] = str[i++]; - token[1] = 0; - return i; - } - - /* end of input */ - token[0] = 0; - return i; -} - - -/** - * Get next token from input stream and increment stream pointer past token. - */ -static GLboolean -Parse_Token(struct parse_state *parseState, GLubyte *token) -{ - GLint i; - i = GetToken(parseState, token); - if (i <= 0) { - parseState->pos += (-i); - return GL_FALSE; - } - parseState->pos += i; - return GL_TRUE; -} - - -/** - * Get next token from input stream but don't increment stream pointer. - */ -static GLboolean -Peek_Token(struct parse_state *parseState, GLubyte *token) -{ - GLint i, len; - i = GetToken(parseState, token); - if (i <= 0) { - parseState->pos += (-i); - return GL_FALSE; - } - len = (GLint)_mesa_strlen((const char *) token); - parseState->pos += (i - len); - return GL_TRUE; -} - - -/** - * Try to match 'pattern' as the next token after any whitespace/comments. - * Advance the current parsing position only if we match the pattern. - * \return GL_TRUE if pattern is matched, GL_FALSE otherwise. - */ -static GLboolean -Parse_String(struct parse_state *parseState, const char *pattern) -{ - const GLubyte *m; - GLint i; - - /* skip whitespace and comments */ - while (IsWhitespace(*parseState->pos) || *parseState->pos == '#') { - if (*parseState->pos == '#') { - while (*parseState->pos && (*parseState->pos != '\n' && *parseState->pos != '\r')) { - parseState->pos += 1; - } - if (*parseState->pos == '\n' || *parseState->pos == '\r') - parseState->curLine = parseState->pos + 1; - } - else { - /* skip whitespace */ - if (*parseState->pos == '\n' || *parseState->pos == '\r') - parseState->curLine = parseState->pos + 1; - parseState->pos += 1; - } - } - - /* Try to match the pattern */ - m = parseState->pos; - for (i = 0; pattern[i]; i++) { - if (*m != (GLubyte) pattern[i]) - return GL_FALSE; - m += 1; - } - parseState->pos = m; - - return GL_TRUE; /* success */ -} - - -/**********************************************************************/ - -static const char *InputRegisters[MAX_NV_VERTEX_PROGRAM_INPUTS + 1] = { - "OPOS", "WGHT", "NRML", "COL0", "COL1", "FOGC", "6", "7", - "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL -}; - -static const char *OutputRegisters[MAX_NV_VERTEX_PROGRAM_OUTPUTS + 1] = { - "HPOS", "COL0", "COL1", "FOGC", - "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", - "PSIZ", "BFC0", "BFC1", NULL -}; - - - -/** - * Parse a temporary register: Rnn - */ -static GLboolean -Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) -{ - GLubyte token[100]; - - /* Should be 'R##' */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - if (token[0] != 'R') - RETURN_ERROR1("Expected R##"); - - if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((char *) (token + 1)); - if (reg >= MAX_NV_VERTEX_PROGRAM_TEMPS) - RETURN_ERROR1("Bad temporary register name"); - *tempRegNum = reg; - } - else { - RETURN_ERROR1("Bad temporary register name"); - } - - return GL_TRUE; -} - - -/** - * Parse address register "A0.x" - */ -static GLboolean -Parse_AddrReg(struct parse_state *parseState) -{ - /* match 'A0' */ - if (!Parse_String(parseState, "A0")) - RETURN_ERROR; - - /* match '.' */ - if (!Parse_String(parseState, ".")) - RETURN_ERROR; - - /* match 'x' */ - if (!Parse_String(parseState, "x")) - RETURN_ERROR; - - return GL_TRUE; -} - - -/** - * Parse absolute program parameter register "c[##]" - */ -static GLboolean -Parse_AbsParamReg(struct parse_state *parseState, GLint *regNum) -{ - GLubyte token[100]; - - if (!Parse_String(parseState, "c")) - RETURN_ERROR; - - if (!Parse_String(parseState, "[")) - RETURN_ERROR; - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (IsDigit(token[0])) { - /* a numbered program parameter register */ - GLint reg = _mesa_atoi((char *) token); - if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) - RETURN_ERROR1("Bad program parameter number"); - *regNum = reg; - } - else { - RETURN_ERROR; - } - - if (!Parse_String(parseState, "]")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) -{ - GLubyte token[100]; - - if (!Parse_String(parseState, "c")) - RETURN_ERROR; - - if (!Parse_String(parseState, "[")) - RETURN_ERROR; - - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - if (IsDigit(token[0])) { - /* a numbered program parameter register */ - GLint reg; - (void) Parse_Token(parseState, token); - reg = _mesa_atoi((char *) token); - if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) - RETURN_ERROR1("Bad program parameter number"); - srcReg->File = PROGRAM_ENV_PARAM; - srcReg->Index = reg; - } - else if (_mesa_strcmp((const char *) token, "A0") == 0) { - /* address register "A0.x" */ - if (!Parse_AddrReg(parseState)) - RETURN_ERROR; - - srcReg->RelAddr = GL_TRUE; - srcReg->File = PROGRAM_ENV_PARAM; - /* Look for +/-N offset */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - if (token[0] == '-' || token[0] == '+') { - const GLubyte sign = token[0]; - (void) Parse_Token(parseState, token); /* consume +/- */ - - /* an integer should be next */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (IsDigit(token[0])) { - const GLint k = _mesa_atoi((char *) token); - if (sign == '-') { - if (k > 64) - RETURN_ERROR1("Bad address offset"); - srcReg->Index = -k; - } - else { - if (k > 63) - RETURN_ERROR1("Bad address offset"); - srcReg->Index = k; - } - } - else { - RETURN_ERROR; - } - } - else { - /* probably got a ']', catch it below */ - } - } - else { - RETURN_ERROR; - } - - /* Match closing ']' */ - if (!Parse_String(parseState, "]")) - RETURN_ERROR; - - return GL_TRUE; -} - - -/** - * Parse v[#] or v[] - */ -static GLboolean -Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum) -{ - GLubyte token[100]; - GLint j; - - /* Match 'v' */ - if (!Parse_String(parseState, "v")) - RETURN_ERROR; - - /* Match '[' */ - if (!Parse_String(parseState, "[")) - RETURN_ERROR; - - /* match number or named register */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (parseState->isStateProgram && token[0] != '0') - RETURN_ERROR1("Only v[0] accessible in vertex state programs"); - - if (IsDigit(token[0])) { - GLint reg = _mesa_atoi((char *) token); - if (reg >= MAX_NV_VERTEX_PROGRAM_INPUTS) - RETURN_ERROR1("Bad vertex attribute register name"); - *tempRegNum = reg; - } - else { - for (j = 0; InputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { - *tempRegNum = j; - break; - } - } - if (!InputRegisters[j]) { - /* unknown input register label */ - RETURN_ERROR2("Bad register name", token); - } - } - - /* Match '[' */ - if (!Parse_String(parseState, "]")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) -{ - GLubyte token[100]; - GLint start, j; - - /* Match 'o' */ - if (!Parse_String(parseState, "o")) - RETURN_ERROR; - - /* Match '[' */ - if (!Parse_String(parseState, "[")) - RETURN_ERROR; - - /* Get output reg name */ - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (parseState->isPositionInvariant) - start = 1; /* skip HPOS register name */ - else - start = 0; - - /* try to match an output register name */ - for (j = start; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { - *outputRegNum = j; - break; - } - } - if (!OutputRegisters[j]) - RETURN_ERROR1("Unrecognized output register name"); - - /* Match ']' */ - if (!Parse_String(parseState, "]")) - RETURN_ERROR1("Expected ]"); - - return GL_TRUE; -} - - -static GLboolean -Parse_MaskedDstReg(struct parse_state *parseState, struct prog_dst_register *dstReg) -{ - GLubyte token[100]; - GLint idx; - - /* Dst reg can be R or o[n] */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - if (token[0] == 'R') { - /* a temporary register */ - dstReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else if (!parseState->isStateProgram && token[0] == 'o') { - /* an output register */ - dstReg->File = PROGRAM_OUTPUT; - if (!Parse_OutputReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else if (parseState->isStateProgram && token[0] == 'c' && - parseState->isStateProgram) { - /* absolute program parameter register */ - /* Only valid for vertex state programs */ - dstReg->File = PROGRAM_ENV_PARAM; - if (!Parse_AbsParamReg(parseState, &idx)) - RETURN_ERROR; - dstReg->Index = idx; - } - else { - RETURN_ERROR1("Bad destination register name"); - } - - /* Parse optional write mask */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - if (token[0] == '.') { - /* got a mask */ - GLint k = 0; - - if (!Parse_String(parseState, ".")) - RETURN_ERROR; - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - dstReg->WriteMask = 0; - - if (token[k] == 'x') { - dstReg->WriteMask |= WRITEMASK_X; - k++; - } - if (token[k] == 'y') { - dstReg->WriteMask |= WRITEMASK_Y; - k++; - } - if (token[k] == 'z') { - dstReg->WriteMask |= WRITEMASK_Z; - k++; - } - if (token[k] == 'w') { - dstReg->WriteMask |= WRITEMASK_W; - k++; - } - if (k == 0) { - RETURN_ERROR1("Bad writemask character"); - } - return GL_TRUE; - } - else { - dstReg->WriteMask = WRITEMASK_XYZW; - return GL_TRUE; - } -} - - -static GLboolean -Parse_SwizzleSrcReg(struct parse_state *parseState, struct prog_src_register *srcReg) -{ - GLubyte token[100]; - GLint idx; - - srcReg->RelAddr = GL_FALSE; - - /* check for '-' */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - if (token[0] == '-') { - (void) Parse_String(parseState, "-"); - srcReg->NegateBase = NEGATE_XYZW; - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - } - else { - srcReg->NegateBase = NEGATE_NONE; - } - - /* Src reg can be R, c[n], c[n +/- offset], or a named vertex attrib */ - if (token[0] == 'R') { - srcReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'c') { - if (!Parse_ParamReg(parseState, srcReg)) - RETURN_ERROR; - } - else if (token[0] == 'v') { - srcReg->File = PROGRAM_INPUT; - if (!Parse_AttribReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else { - RETURN_ERROR2("Bad source register name", token); - } - - /* init swizzle fields */ - srcReg->Swizzle = SWIZZLE_NOOP; - - /* Look for optional swizzle suffix */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - if (token[0] == '.') { - (void) Parse_String(parseState, "."); /* consume . */ - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (token[1] == 0) { - /* single letter swizzle */ - if (token[0] == 'x') - srcReg->Swizzle = SWIZZLE_XXXX; - else if (token[0] == 'y') - srcReg->Swizzle = SWIZZLE_YYYY; - else if (token[0] == 'z') - srcReg->Swizzle = SWIZZLE_ZZZZ; - else if (token[0] == 'w') - srcReg->Swizzle = SWIZZLE_WWWW; - else - RETURN_ERROR1("Expected x, y, z, or w"); - } - else { - /* 2, 3 or 4-component swizzle */ - GLint k; - - srcReg->Swizzle = 0; - - for (k = 0; token[k] && k < 5; k++) { - if (token[k] == 'x') - srcReg->Swizzle |= 0 << (k*3); - else if (token[k] == 'y') - srcReg->Swizzle |= 1 << (k*3); - else if (token[k] == 'z') - srcReg->Swizzle |= 2 << (k*3); - else if (token[k] == 'w') - srcReg->Swizzle |= 3 << (k*3); - else - RETURN_ERROR; - } - if (k >= 5) - RETURN_ERROR; - } - } - - return GL_TRUE; -} - - -static GLboolean -Parse_ScalarSrcReg(struct parse_state *parseState, struct prog_src_register *srcReg) -{ - GLubyte token[100]; - GLint idx; - - srcReg->RelAddr = GL_FALSE; - - /* check for '-' */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - if (token[0] == '-') { - srcReg->NegateBase = NEGATE_XYZW; - (void) Parse_String(parseState, "-"); /* consume '-' */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - } - else { - srcReg->NegateBase = NEGATE_NONE; - } - - /* Src reg can be R, c[n], c[n +/- offset], or a named vertex attrib */ - if (token[0] == 'R') { - srcReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'c') { - if (!Parse_ParamReg(parseState, srcReg)) - RETURN_ERROR; - } - else if (token[0] == 'v') { - srcReg->File = PROGRAM_INPUT; - if (!Parse_AttribReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else { - RETURN_ERROR2("Bad source register name", token); - } - - /* Look for .[xyzw] suffix */ - if (!Parse_String(parseState, ".")) - RETURN_ERROR; - - if (!Parse_Token(parseState, token)) - RETURN_ERROR; - - if (token[0] == 'x' && token[1] == 0) { - srcReg->Swizzle = 0; - } - else if (token[0] == 'y' && token[1] == 0) { - srcReg->Swizzle = 1; - } - else if (token[0] == 'z' && token[1] == 0) { - srcReg->Swizzle = 2; - } - else if (token[0] == 'w' && token[1] == 0) { - srcReg->Swizzle = 3; - } - else { - RETURN_ERROR1("Bad scalar source suffix"); - } - - return GL_TRUE; -} - - -static GLint -Parse_UnaryOpInstruction(struct parse_state *parseState, - struct prog_instruction *inst, - enum prog_opcode opcode) -{ - if (opcode == OPCODE_ABS && !parseState->isVersion1_1) - RETURN_ERROR1("ABS illegal for vertex program 1.0"); - - inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; - - /* dest reg */ - if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_BiOpInstruction(struct parse_state *parseState, - struct prog_instruction *inst, - enum prog_opcode opcode) -{ - if (opcode == OPCODE_DPH && !parseState->isVersion1_1) - RETURN_ERROR1("DPH illegal for vertex program 1.0"); - if (opcode == OPCODE_SUB && !parseState->isVersion1_1) - RETURN_ERROR1("SUB illegal for vertex program 1.0"); - - inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; - - /* dest reg */ - if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* first src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* second src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - /* make sure we don't reference more than one program parameter register */ - if (inst->SrcReg[0].File == PROGRAM_ENV_PARAM && - inst->SrcReg[1].File == PROGRAM_ENV_PARAM && - inst->SrcReg[0].Index != inst->SrcReg[1].Index) - RETURN_ERROR1("Can't reference two program parameter registers"); - - /* make sure we don't reference more than one vertex attribute register */ - if (inst->SrcReg[0].File == PROGRAM_INPUT && - inst->SrcReg[1].File == PROGRAM_INPUT && - inst->SrcReg[0].Index != inst->SrcReg[1].Index) - RETURN_ERROR1("Can't reference two vertex attribute registers"); - - return GL_TRUE; -} - - -static GLboolean -Parse_TriOpInstruction(struct parse_state *parseState, - struct prog_instruction *inst, - enum prog_opcode opcode) -{ - inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; - - /* dest reg */ - if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* first src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* second src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[1])) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* third src arg */ - if (!Parse_SwizzleSrcReg(parseState, &inst->SrcReg[2])) - RETURN_ERROR; - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - /* make sure we don't reference more than one program parameter register */ - if ((inst->SrcReg[0].File == PROGRAM_ENV_PARAM && - inst->SrcReg[1].File == PROGRAM_ENV_PARAM && - inst->SrcReg[0].Index != inst->SrcReg[1].Index) || - (inst->SrcReg[0].File == PROGRAM_ENV_PARAM && - inst->SrcReg[2].File == PROGRAM_ENV_PARAM && - inst->SrcReg[0].Index != inst->SrcReg[2].Index) || - (inst->SrcReg[1].File == PROGRAM_ENV_PARAM && - inst->SrcReg[2].File == PROGRAM_ENV_PARAM && - inst->SrcReg[1].Index != inst->SrcReg[2].Index)) - RETURN_ERROR1("Can only reference one program register"); - - /* make sure we don't reference more than one vertex attribute register */ - if ((inst->SrcReg[0].File == PROGRAM_INPUT && - inst->SrcReg[1].File == PROGRAM_INPUT && - inst->SrcReg[0].Index != inst->SrcReg[1].Index) || - (inst->SrcReg[0].File == PROGRAM_INPUT && - inst->SrcReg[2].File == PROGRAM_INPUT && - inst->SrcReg[0].Index != inst->SrcReg[2].Index) || - (inst->SrcReg[1].File == PROGRAM_INPUT && - inst->SrcReg[2].File == PROGRAM_INPUT && - inst->SrcReg[1].Index != inst->SrcReg[2].Index)) - RETURN_ERROR1("Can only reference one input register"); - - return GL_TRUE; -} - - -static GLboolean -Parse_ScalarInstruction(struct parse_state *parseState, - struct prog_instruction *inst, - enum prog_opcode opcode) -{ - if (opcode == OPCODE_RCC && !parseState->isVersion1_1) - RETURN_ERROR1("RCC illegal for vertex program 1.0"); - - inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; - - /* dest reg */ - if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* first src arg */ - if (!Parse_ScalarSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_AddressInstruction(struct parse_state *parseState, struct prog_instruction *inst) -{ - inst->Opcode = OPCODE_ARL; - inst->StringPos = parseState->curLine - parseState->start; - - /* Make ARB_vp backends happy */ - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.WriteMask = WRITEMASK_X; - inst->DstReg.Index = 0; - - /* dest A0 reg */ - if (!Parse_AddrReg(parseState)) - RETURN_ERROR; - - /* comma */ - if (!Parse_String(parseState, ",")) - RETURN_ERROR; - - /* parse src reg */ - if (!Parse_ScalarSrcReg(parseState, &inst->SrcReg[0])) - RETURN_ERROR; - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_EndInstruction(struct parse_state *parseState, struct prog_instruction *inst) -{ - GLubyte token[100]; - - inst->Opcode = OPCODE_END; - inst->StringPos = parseState->curLine - parseState->start; - - /* this should fail! */ - if (Parse_Token(parseState, token)) - RETURN_ERROR2("Unexpected token after END:", token); - else - return GL_TRUE; -} - - -/** - * The PRINT instruction is Mesa-specific and is meant as a debugging aid for - * the vertex program developer. - * The NV_vertex_program extension grammar is modified as follows: - * - * ::= - * | ... - * | - * - * ::= "PRINT" - * | "PRINT" "," - * | "PRINT" "," - */ -static GLboolean -Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction *inst) -{ - const GLubyte *str; - GLubyte *msg; - GLuint len; - GLubyte token[100]; - struct prog_src_register *srcReg = &inst->SrcReg[0]; - GLint idx; - - inst->Opcode = OPCODE_PRINT; - inst->StringPos = parseState->curLine - parseState->start; - - /* The first argument is a literal string 'just like this' */ - if (!Parse_String(parseState, "'")) - RETURN_ERROR; - - str = parseState->pos; - for (len = 0; str[len] != '\''; len++) /* find closing quote */ - ; - parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); - - _mesa_memcpy(msg, str, len); - msg[len] = 0; - inst->Data = msg; - - /* comma */ - if (Parse_String(parseState, ",")) { - - /* The second argument is a register name */ - if (!Peek_Token(parseState, token)) - RETURN_ERROR; - - srcReg->RelAddr = GL_FALSE; - srcReg->NegateBase = NEGATE_NONE; - srcReg->Swizzle = SWIZZLE_NOOP; - - /* Register can be R, c[n], c[n +/- offset], a named vertex attrib, - * or an o[n] output register. - */ - if (token[0] == 'R') { - srcReg->File = PROGRAM_TEMPORARY; - if (!Parse_TempReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'c') { - srcReg->File = PROGRAM_ENV_PARAM; - if (!Parse_ParamReg(parseState, srcReg)) - RETURN_ERROR; - } - else if (token[0] == 'v') { - srcReg->File = PROGRAM_INPUT; - if (!Parse_AttribReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else if (token[0] == 'o') { - srcReg->File = PROGRAM_OUTPUT; - if (!Parse_OutputReg(parseState, &idx)) - RETURN_ERROR; - srcReg->Index = idx; - } - else { - RETURN_ERROR2("Bad source register name", token); - } - } - else { - srcReg->File = 0; - } - - /* semicolon */ - if (!Parse_String(parseState, ";")) - RETURN_ERROR; - - return GL_TRUE; -} - - -static GLboolean -Parse_OptionSequence(struct parse_state *parseState, - struct prog_instruction program[]) -{ - (void) program; - while (1) { - if (!Parse_String(parseState, "OPTION")) - return GL_TRUE; /* ok, not an OPTION statement */ - if (Parse_String(parseState, "NV_position_invariant")) { - parseState->isPositionInvariant = GL_TRUE; - } - else { - RETURN_ERROR1("unexpected OPTION statement"); - } - if (!Parse_String(parseState, ";")) - return GL_FALSE; - } -} - - -static GLboolean -Parse_InstructionSequence(struct parse_state *parseState, - struct prog_instruction program[]) -{ - while (1) { - struct prog_instruction *inst = program + parseState->numInst; - - /* Initialize the instruction */ - _mesa_init_instructions(inst, 1); - - if (Parse_String(parseState, "MOV")) { - if (!Parse_UnaryOpInstruction(parseState, inst, OPCODE_MOV)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "LIT")) { - if (!Parse_UnaryOpInstruction(parseState, inst, OPCODE_LIT)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "ABS")) { - if (!Parse_UnaryOpInstruction(parseState, inst, OPCODE_ABS)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "MUL")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_MUL)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "ADD")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_ADD)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "DP3")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_DP3)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "DP4")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_DP4)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "DST")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_DST)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "MIN")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_MIN)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "MAX")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_MAX)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "SLT")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_SLT)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "SGE")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_SGE)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "DPH")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_DPH)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "SUB")) { - if (!Parse_BiOpInstruction(parseState, inst, OPCODE_SUB)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "MAD")) { - if (!Parse_TriOpInstruction(parseState, inst, OPCODE_MAD)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "RCP")) { - if (!Parse_ScalarInstruction(parseState, inst, OPCODE_RCP)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "RSQ")) { - if (!Parse_ScalarInstruction(parseState, inst, OPCODE_RSQ)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "EXP")) { - if (!Parse_ScalarInstruction(parseState, inst, OPCODE_EXP)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "LOG")) { - if (!Parse_ScalarInstruction(parseState, inst, OPCODE_LOG)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "RCC")) { - if (!Parse_ScalarInstruction(parseState, inst, OPCODE_RCC)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "ARL")) { - if (!Parse_AddressInstruction(parseState, inst)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "PRINT")) { - if (!Parse_PrintInstruction(parseState, inst)) - RETURN_ERROR; - } - else if (Parse_String(parseState, "END")) { - if (!Parse_EndInstruction(parseState, inst)) - RETURN_ERROR; - else { - parseState->numInst++; - return GL_TRUE; /* all done */ - } - } - else { - /* bad instruction name */ - RETURN_ERROR1("Unexpected token"); - } - - /* examine input/output registers */ - if (inst->DstReg.File == PROGRAM_OUTPUT) - parseState->outputsWritten |= (1 << inst->DstReg.Index); - else if (inst->DstReg.File == PROGRAM_ENV_PARAM) - parseState->anyProgRegsWritten = GL_TRUE; - - if (inst->SrcReg[0].File == PROGRAM_INPUT) - parseState->inputsRead |= (1 << inst->SrcReg[0].Index); - if (inst->SrcReg[1].File == PROGRAM_INPUT) - parseState->inputsRead |= (1 << inst->SrcReg[1].Index); - if (inst->SrcReg[2].File == PROGRAM_INPUT) - parseState->inputsRead |= (1 << inst->SrcReg[2].Index); - - parseState->numInst++; - - if (parseState->numInst >= MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS) - RETURN_ERROR1("Program too long"); - } - - RETURN_ERROR; -} - - -static GLboolean -Parse_Program(struct parse_state *parseState, - struct prog_instruction instBuffer[]) -{ - if (parseState->isVersion1_1) { - if (!Parse_OptionSequence(parseState, instBuffer)) { - return GL_FALSE; - } - } - return Parse_InstructionSequence(parseState, instBuffer); -} - - -/** - * Parse/compile the 'str' returning the compiled 'program'. - * ctx->Program.ErrorPos will be -1 if successful. Otherwise, ErrorPos - * indicates the position of the error in 'str'. - */ -void -_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, - const GLubyte *str, GLsizei len, - struct gl_vertex_program *program) -{ - struct parse_state parseState; - struct prog_instruction instBuffer[MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS]; - struct prog_instruction *newInst; - GLenum target; - GLubyte *programString; - - /* Make a null-terminated copy of the program string */ - programString = (GLubyte *) MALLOC(len + 1); - if (!programString) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - MEMCPY(programString, str, len); - programString[len] = 0; - - /* Get ready to parse */ - parseState.ctx = ctx; - parseState.start = programString; - parseState.isPositionInvariant = GL_FALSE; - parseState.isVersion1_1 = GL_FALSE; - parseState.numInst = 0; - parseState.inputsRead = 0; - parseState.outputsWritten = 0; - parseState.anyProgRegsWritten = GL_FALSE; - - /* Reset error state */ - _mesa_set_program_error(ctx, -1, NULL); - - /* check the program header */ - if (_mesa_strncmp((const char *) programString, "!!VP1.0", 7) == 0) { - target = GL_VERTEX_PROGRAM_NV; - parseState.pos = programString + 7; - parseState.isStateProgram = GL_FALSE; - } - else if (_mesa_strncmp((const char *) programString, "!!VP1.1", 7) == 0) { - target = GL_VERTEX_PROGRAM_NV; - parseState.pos = programString + 7; - parseState.isStateProgram = GL_FALSE; - parseState.isVersion1_1 = GL_TRUE; - } - else if (_mesa_strncmp((const char *) programString, "!!VSP1.0", 8) == 0) { - target = GL_VERTEX_STATE_PROGRAM_NV; - parseState.pos = programString + 8; - parseState.isStateProgram = GL_TRUE; - } - else { - /* invalid header */ - ctx->Program.ErrorPos = 0; - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(bad header)"); - return; - } - - /* make sure target and header match */ - if (target != dstTarget) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glLoadProgramNV(target mismatch)"); - return; - } - - - if (Parse_Program(&parseState, instBuffer)) { - /* successful parse! */ - - if (parseState.isStateProgram) { - if (!parseState.anyProgRegsWritten) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glLoadProgramNV(c[#] not written)"); - return; - } - } - else { - if (!parseState.isPositionInvariant && - !(parseState.outputsWritten & (1 << VERT_RESULT_HPOS))) { - /* bit 1 = HPOS register */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glLoadProgramNV(HPOS not written)"); - return; - } - } - - /* copy the compiled instructions */ - assert(parseState.numInst <= MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS); - newInst = _mesa_alloc_instructions(parseState.numInst); - if (!newInst) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - _mesa_free(programString); - return; /* out of memory */ - } - _mesa_copy_instructions(newInst, instBuffer, parseState.numInst); - - /* install the program */ - program->Base.Target = target; - if (program->Base.String) { - _mesa_free(program->Base.String); - } - program->Base.String = programString; - program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; - if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); - } - program->Base.Instructions = newInst; - program->Base.InputsRead = parseState.inputsRead; - if (parseState.isPositionInvariant) - program->Base.InputsRead |= VERT_BIT_POS; - program->Base.NumInstructions = parseState.numInst; - program->Base.OutputsWritten = parseState.outputsWritten; - program->IsPositionInvariant = parseState.isPositionInvariant; - program->IsNVProgram = GL_TRUE; - -#ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV result ---\n"); - _mesa_print_nv_vertex_program(program); - _mesa_printf("------------------------------\n"); -#endif - } - else { - /* Error! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV"); - /* NOTE: _mesa_set_program_error would have been called already */ - /* GL_NV_vertex_program isn't supposed to set the error string - * so we reset it here. - */ - _mesa_set_program_error(ctx, ctx->Program.ErrorPos, NULL); - } -} - - -static void -PrintSrcReg(const struct prog_src_register *src) -{ - static const char comps[5] = "xyzw"; - if (src->NegateBase) - _mesa_printf("-"); - if (src->RelAddr) { - if (src->Index > 0) - _mesa_printf("c[A0.x + %d]", src->Index); - else if (src->Index < 0) - _mesa_printf("c[A0.x - %d]", -src->Index); - else - _mesa_printf("c[A0.x]"); - } - else if (src->File == PROGRAM_OUTPUT) { - _mesa_printf("o[%s]", OutputRegisters[src->Index]); - } - else if (src->File == PROGRAM_INPUT) { - _mesa_printf("v[%s]", InputRegisters[src->Index]); - } - else if (src->File == PROGRAM_ENV_PARAM) { - _mesa_printf("c[%d]", src->Index); - } - else { - ASSERT(src->File == PROGRAM_TEMPORARY); - _mesa_printf("R%d", src->Index); - } - - if (GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 1) && - GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 2) && - GET_SWZ(src->Swizzle, 0) == GET_SWZ(src->Swizzle, 3)) { - _mesa_printf(".%c", comps[GET_SWZ(src->Swizzle, 0)]); - } - else if (src->Swizzle != SWIZZLE_NOOP) { - _mesa_printf(".%c%c%c%c", - comps[GET_SWZ(src->Swizzle, 0)], - comps[GET_SWZ(src->Swizzle, 1)], - comps[GET_SWZ(src->Swizzle, 2)], - comps[GET_SWZ(src->Swizzle, 3)]); - } -} - - -static void -PrintDstReg(const struct prog_dst_register *dst) -{ - if (dst->File == PROGRAM_OUTPUT) { - _mesa_printf("o[%s]", OutputRegisters[dst->Index]); - } - else if (dst->File == PROGRAM_INPUT) { - _mesa_printf("v[%s]", InputRegisters[dst->Index]); - } - else if (dst->File == PROGRAM_ENV_PARAM) { - _mesa_printf("c[%d]", dst->Index); - } - else { - ASSERT(dst->File == PROGRAM_TEMPORARY); - _mesa_printf("R%d", dst->Index); - } - - if (dst->WriteMask != 0 && dst->WriteMask != WRITEMASK_XYZW) { - _mesa_printf("."); - if (dst->WriteMask & WRITEMASK_X) - _mesa_printf("x"); - if (dst->WriteMask & WRITEMASK_Y) - _mesa_printf("y"); - if (dst->WriteMask & WRITEMASK_Z) - _mesa_printf("z"); - if (dst->WriteMask & WRITEMASK_W) - _mesa_printf("w"); - } -} - - -/** - * Print a single NVIDIA vertex program instruction. - */ -void -_mesa_print_nv_vertex_instruction(const struct prog_instruction *inst) -{ - GLuint i, n; - - switch (inst->Opcode) { - case OPCODE_MOV: - case OPCODE_LIT: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_EXP: - case OPCODE_LOG: - case OPCODE_RCC: - case OPCODE_ABS: - case OPCODE_MUL: - case OPCODE_ADD: - case OPCODE_DP3: - case OPCODE_DP4: - case OPCODE_DST: - case OPCODE_MIN: - case OPCODE_MAX: - case OPCODE_SLT: - case OPCODE_SGE: - case OPCODE_DPH: - case OPCODE_SUB: - case OPCODE_MAD: - _mesa_printf("%s ", _mesa_opcode_string(inst->Opcode)); - PrintDstReg(&inst->DstReg); - _mesa_printf(", "); - n = _mesa_num_inst_src_regs(inst->Opcode); - for (i = 0; i < n; i++) { - PrintSrcReg(&inst->SrcReg[i]); - if (i + 1 < n) - _mesa_printf(", "); - } - _mesa_printf(";\n"); - break; - case OPCODE_ARL: - _mesa_printf("ARL A0.x, "); - PrintSrcReg(&inst->SrcReg[0]); - _mesa_printf(";\n"); - break; - case OPCODE_PRINT: - _mesa_printf("PRINT '%s'", inst->Data); - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - _mesa_printf(", "); - PrintSrcReg(&inst->SrcReg[0]); - _mesa_printf(";\n"); - } - else { - _mesa_printf("\n"); - } - break; - case OPCODE_END: - _mesa_printf("END\n"); - break; - default: - _mesa_printf("BAD INSTRUCTION\n"); - } -} - - -/** - * Print (unparse) the given vertex program. Just for debugging. - */ -void -_mesa_print_nv_vertex_program(const struct gl_vertex_program *program) -{ - const struct prog_instruction *inst; - - for (inst = program->Base.Instructions; ; inst++) { - _mesa_print_nv_vertex_instruction(inst); - if (inst->Opcode == OPCODE_END) - return; - } -} - - -const char * -_mesa_nv_vertex_input_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_VERTEX_PROGRAM_INPUTS); - return InputRegisters[i]; -} - - -const char * -_mesa_nv_vertex_output_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_VERTEX_PROGRAM_OUTPUTS); - return OutputRegisters[i]; -} - diff --git a/src/libs/mesa/mesa/shader/nvvertparse.h b/src/libs/mesa/mesa/shader/nvvertparse.h deleted file mode 100644 index 15fb03cd4e..0000000000 --- a/src/libs/mesa/mesa/shader/nvvertparse.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - * - * Authors: - * Brian Paul - */ - - -#ifndef NVVERTPARSE_H -#define NVVERTPARSE_H - - -extern void -_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum target, - const GLubyte *str, GLsizei len, - struct gl_vertex_program *program); - -extern void -_mesa_print_nv_vertex_instruction(const struct prog_instruction *inst); - -extern void -_mesa_print_nv_vertex_program(const struct gl_vertex_program *program); - -extern const char * -_mesa_nv_vertex_input_register_name(GLuint i); - -extern const char * -_mesa_nv_vertex_output_register_name(GLuint i); - -#endif diff --git a/src/libs/mesa/mesa/shader/prog_cache.c b/src/libs/mesa/mesa/shader/prog_cache.c deleted file mode 100644 index 36a25377c5..0000000000 --- a/src/libs/mesa/mesa/shader/prog_cache.c +++ /dev/null @@ -1,193 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/imports.h" -#include "shader/prog_cache.h" -#include "shader/program.h" - - -struct cache_item -{ - GLuint hash; - void *key; - struct gl_program *program; - struct cache_item *next; -}; - -struct gl_program_cache -{ - struct cache_item **items; - GLuint size, n_items; -}; - - - -/** - * Compute hash index from state key. - */ -static GLuint -hash_key(const void *key, GLuint key_size) -{ - const GLuint *ikey = (const GLuint *) key; - GLuint hash = 0, i; - - assert(key_size >= 4); - - /* Make a slightly better attempt at a hash function: - */ - for (i = 0; i < key_size / sizeof(*ikey); i++) - { - hash += ikey[i]; - hash += (hash << 10); - hash ^= (hash >> 6); - } - - return hash; -} - - -/** - * Rebuild/expand the hash table to accomodate more entries - */ -static void -rehash(struct gl_program_cache *cache) -{ - struct cache_item **items; - struct cache_item *c, *next; - GLuint size, i; - - size = cache->size * 3; - items = (struct cache_item**) _mesa_malloc(size * sizeof(*items)); - _mesa_memset(items, 0, size * sizeof(*items)); - - for (i = 0; i < cache->size; i++) - for (c = cache->items[i]; c; c = next) { - next = c->next; - c->next = items[c->hash % size]; - items[c->hash % size] = c; - } - - _mesa_free(cache->items); - cache->items = items; - cache->size = size; -} - - -static void -clear_cache(GLcontext *ctx, struct gl_program_cache *cache) -{ - struct cache_item *c, *next; - GLuint i; - - for (i = 0; i < cache->size; i++) { - for (c = cache->items[i]; c; c = next) { - next = c->next; - _mesa_free(c->key); - _mesa_reference_program(ctx, &c->program, NULL); - _mesa_free(c); - } - cache->items[i] = NULL; - } - - - cache->n_items = 0; -} - - - -struct gl_program_cache * -_mesa_new_program_cache(void) -{ - struct gl_program_cache *cache = CALLOC_STRUCT(gl_program_cache); - if (cache) { - cache->size = 17; - cache->items = (struct cache_item **) - _mesa_calloc(cache->size * sizeof(struct cache_item)); - if (!cache->items) { - _mesa_free(cache); - return NULL; - } - } - return cache; -} - - -void -_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache) -{ - clear_cache(ctx, cache); - _mesa_free(cache->items); - _mesa_free(cache); -} - - -struct gl_program * -_mesa_search_program_cache(const struct gl_program_cache *cache, - const void *key, GLuint keysize) -{ - const GLuint hash = hash_key(key, keysize); - struct cache_item *c; - - for (c = cache->items[hash % cache->size]; c; c = c->next) { - if (c->hash == hash && memcmp(c->key, key, keysize) == 0) - return c->program; - } - - return NULL; -} - - -void -_mesa_program_cache_insert(GLcontext *ctx, - struct gl_program_cache *cache, - const void *key, GLuint keysize, - struct gl_program *program) -{ - const GLuint hash = hash_key(key, keysize); - struct cache_item *c = CALLOC_STRUCT(cache_item); - - c->hash = hash; - - c->key = _mesa_malloc(keysize); - memcpy(c->key, key, keysize); - - c->program = program; /* no refcount change */ - - if (cache->n_items > cache->size * 1.5) { - if (cache->size < 1000) - rehash(cache); - else - clear_cache(ctx, cache); - } - - cache->n_items++; - c->next = cache->items[hash % cache->size]; - cache->items[hash % cache->size] = c; -} diff --git a/src/libs/mesa/mesa/shader/prog_cache.h b/src/libs/mesa/mesa/shader/prog_cache.h deleted file mode 100644 index a8c91fba01..0000000000 --- a/src/libs/mesa/mesa/shader/prog_cache.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef PROG_CACHE_H -#define PROG_CACHE_H - - -/** Opaque type */ -struct gl_program_cache; - - -extern struct gl_program_cache * -_mesa_new_program_cache(void); - -extern void -_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *pc); - - -extern struct gl_program * -_mesa_search_program_cache(const struct gl_program_cache *cache, - const void *key, GLuint keysize); - -extern void -_mesa_program_cache_insert(GLcontext *ctx, - struct gl_program_cache *cache, - const void *key, GLuint keysize, - struct gl_program *program); - - -#endif /* PROG_CACHE_H */ diff --git a/src/libs/mesa/mesa/shader/prog_debug.c b/src/libs/mesa/mesa/shader/prog_debug.c deleted file mode 100644 index 7bcb2ef734..0000000000 --- a/src/libs/mesa/mesa/shader/prog_debug.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "nvfragparse.h" -#include "nvvertparse.h" -#include "program.h" -#include "prog_debug.h" -#include "prog_parameter.h" -#include "prog_instruction.h" - - - -/** - * Functions for the experimental GL_MESA_program_debug extension. - */ - - -/* XXX temporary */ -GLAPI void GLAPIENTRY -glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data) -{ - _mesa_ProgramCallbackMESA(target, callback, data); -} - - -void -_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - - switch (target) { - case GL_FRAGMENT_PROGRAM_ARB: - if (!ctx->Extensions.ARB_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->FragmentProgram.Callback = callback; - ctx->FragmentProgram.CallbackData = data; - break; - case GL_FRAGMENT_PROGRAM_NV: - if (!ctx->Extensions.NV_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->FragmentProgram.Callback = callback; - ctx->FragmentProgram.CallbackData = data; - break; - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - if (!ctx->Extensions.ARB_vertex_program && - !ctx->Extensions.NV_vertex_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->VertexProgram.Callback = callback; - ctx->VertexProgram.CallbackData = data; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } -} - - -/* XXX temporary */ -GLAPI void GLAPIENTRY -glGetProgramRegisterfvMESA(GLenum target, - GLsizei len, const GLubyte *registerName, - GLfloat *v) -{ - _mesa_GetProgramRegisterfvMESA(target, len, registerName, v); -} - - -void -_mesa_GetProgramRegisterfvMESA(GLenum target, - GLsizei len, const GLubyte *registerName, - GLfloat *v) -{ - char reg[1000]; - GET_CURRENT_CONTEXT(ctx); - - /* We _should_ be inside glBegin/glEnd */ -#if 0 - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramRegisterfvMESA"); - return; - } -#endif - - /* make null-terminated copy of registerName */ - len = MIN2((unsigned int) len, sizeof(reg) - 1); - _mesa_memcpy(reg, registerName, len); - reg[len] = 0; - - switch (target) { - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - if (!ctx->Extensions.ARB_vertex_program && - !ctx->Extensions.NV_vertex_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->VertexProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - /* GL_NV_vertex_program */ - if (reg[0] == 'R') { - /* Temp register */ - GLint i = _mesa_atoi(reg + 1); - if (i >= (GLint)ctx->Const.VertexProgram.MaxTemps) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - ctx->Driver.GetProgramRegister(ctx, PROGRAM_TEMPORARY, i, v); - } - else if (reg[0] == 'v' && reg[1] == '[') { - /* Vertex Input attribute */ - GLuint i; - for (i = 0; i < ctx->Const.VertexProgram.MaxAttribs; i++) { - const char *name = _mesa_nv_vertex_input_register_name(i); - char number[10]; - _mesa_sprintf(number, "%d", i); - if (_mesa_strncmp(reg + 2, name, 4) == 0 || - _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) { - ctx->Driver.GetProgramRegister(ctx, PROGRAM_INPUT, i, v); - return; - } - } - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - else if (reg[0] == 'o' && reg[1] == '[') { - /* Vertex output attribute */ - } - /* GL_ARB_vertex_program */ - else if (_mesa_strncmp(reg, "vertex.", 7) == 0) { - - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - break; - case GL_FRAGMENT_PROGRAM_ARB: - if (!ctx->Extensions.ARB_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - /* XXX to do */ - break; - case GL_FRAGMENT_PROGRAM_NV: - if (!ctx->Extensions.NV_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - if (reg[0] == 'R') { - /* Temp register */ - GLint i = _mesa_atoi(reg + 1); - if (i >= (GLint)ctx->Const.FragmentProgram.MaxTemps) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - ctx->Driver.GetProgramRegister(ctx, PROGRAM_TEMPORARY, - i, v); - } - else if (reg[0] == 'f' && reg[1] == '[') { - /* Fragment input attribute */ - GLuint i; - for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) { - const char *name = _mesa_nv_fragment_input_register_name(i); - if (_mesa_strncmp(reg + 2, name, 4) == 0) { - ctx->Driver.GetProgramRegister(ctx, PROGRAM_INPUT, i, v); - return; - } - } - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - else if (_mesa_strcmp(reg, "o[COLR]") == 0) { - /* Fragment output color */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLR, v); - } - else if (_mesa_strcmp(reg, "o[COLH]") == 0) { - /* Fragment output color */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLH, v); - } - else if (_mesa_strcmp(reg, "o[DEPR]") == 0) { - /* Fragment output depth */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_DEPR, v); - } - else { - /* try user-defined identifiers */ - const GLfloat *value = _mesa_lookup_parameter_value( - ctx->FragmentProgram.Current->Base.Parameters, -1, reg); - if (value) { - COPY_4V(v, value); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } -} diff --git a/src/libs/mesa/mesa/shader/prog_debug.h b/src/libs/mesa/mesa/shader/prog_debug.h deleted file mode 100644 index fc400e19de..0000000000 --- a/src/libs/mesa/mesa/shader/prog_debug.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 PROG_DEBUG_H -#define PROG_DEBUG_H 1 - - -/* - * GL_MESA_program_debug - */ - -extern void -_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data); - -extern void -_mesa_GetProgramRegisterfvMESA(GLenum target, GLsizei len, - const GLubyte *registerName, GLfloat *v); - - - -#endif /* PROG_DEBUG_H */ diff --git a/src/libs/mesa/mesa/shader/prog_execute.c b/src/libs/mesa/mesa/shader/prog_execute.c deleted file mode 100644 index 9c25a9eb43..0000000000 --- a/src/libs/mesa/mesa/shader/prog_execute.c +++ /dev/null @@ -1,1788 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_execute.c - * Software interpreter for vertex/fragment programs. - * \author Brian Paul - */ - -/* - * NOTE: we do everything in single-precision floating point; we don't - * currently observe the single/half/fixed-precision qualifiers. - * - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "program.h" -#include "prog_execute.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_print.h" -#include "prog_noise.h" - - -/* debug predicate */ -#define DEBUG_PROG 0 - - -/** - * Set x to positive or negative infinity. - */ -#if defined(USE_IEEE) || defined(_WIN32) -#define SET_POS_INFINITY(x) ( *((GLuint *) (void *)&x) = 0x7F800000 ) -#define SET_NEG_INFINITY(x) ( *((GLuint *) (void *)&x) = 0xFF800000 ) -#elif defined(VMS) -#define SET_POS_INFINITY(x) x = __MAXFLOAT -#define SET_NEG_INFINITY(x) x = -__MAXFLOAT -#else -#define SET_POS_INFINITY(x) x = (GLfloat) HUGE_VAL -#define SET_NEG_INFINITY(x) x = (GLfloat) -HUGE_VAL -#endif - -#define SET_FLOAT_BITS(x, bits) ((fi_type *) (void *) &(x))->i = bits - - -static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F }; - - - -/** - * Return a pointer to the 4-element float vector specified by the given - * source register. - */ -static INLINE const GLfloat * -get_src_register_pointer(const struct prog_src_register *source, - const struct gl_program_machine *machine) -{ - const struct gl_program *prog = machine->CurProgram; - GLint reg = source->Index; - - if (source->RelAddr) { - /* add address register value to src index/offset */ - reg += machine->AddressReg[0][0]; - if (reg < 0) { - return ZeroVec; - } - } - - switch (source->File) { - case PROGRAM_TEMPORARY: - if (reg >= MAX_PROGRAM_TEMPS) - return ZeroVec; - return machine->Temporaries[reg]; - - case PROGRAM_INPUT: - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - if (reg >= VERT_ATTRIB_MAX) - return ZeroVec; - return machine->VertAttribs[reg]; - } - else { - if (reg >= FRAG_ATTRIB_MAX) - return ZeroVec; - return machine->Attribs[reg][machine->CurElement]; - } - - case PROGRAM_OUTPUT: - if (reg >= MAX_PROGRAM_OUTPUTS) - return ZeroVec; - return machine->Outputs[reg]; - - case PROGRAM_LOCAL_PARAM: - if (reg >= MAX_PROGRAM_LOCAL_PARAMS) - return ZeroVec; - return machine->CurProgram->LocalParams[reg]; - - case PROGRAM_ENV_PARAM: - if (reg >= MAX_PROGRAM_ENV_PARAMS) - return ZeroVec; - return machine->EnvParams[reg]; - - case PROGRAM_STATE_VAR: - /* Fallthrough */ - case PROGRAM_CONSTANT: - /* Fallthrough */ - case PROGRAM_UNIFORM: - /* Fallthrough */ - case PROGRAM_NAMED_PARAM: - if (reg >= (GLint) prog->Parameters->NumParameters) - return ZeroVec; - return prog->Parameters->ParameterValues[reg]; - - default: - _mesa_problem(NULL, - "Invalid src register file %d in get_src_register_pointer()", - source->File); - return NULL; - } -} - - -/** - * Return a pointer to the 4-element float vector specified by the given - * destination register. - */ -static INLINE GLfloat * -get_dst_register_pointer(const struct prog_dst_register *dest, - struct gl_program_machine *machine) -{ - static GLfloat dummyReg[4]; - GLint reg = dest->Index; - - if (dest->RelAddr) { - /* add address register value to src index/offset */ - reg += machine->AddressReg[0][0]; - if (reg < 0) { - return dummyReg; - } - } - - switch (dest->File) { - case PROGRAM_TEMPORARY: - if (reg >= MAX_PROGRAM_TEMPS) - return dummyReg; - return machine->Temporaries[reg]; - - case PROGRAM_OUTPUT: - if (reg >= MAX_PROGRAM_OUTPUTS) - return dummyReg; - return machine->Outputs[reg]; - - case PROGRAM_WRITE_ONLY: - return dummyReg; - - default: - _mesa_problem(NULL, - "Invalid dest register file %d in get_dst_register_pointer()", - dest->File); - return NULL; - } -} - - - -#if FEATURE_MESA_program_debug -static struct gl_program_machine *CurrentMachine = NULL; - -/** - * For GL_MESA_program_debug. - * Return current value (4*GLfloat) of a program register. - * Called via ctx->Driver.GetProgramRegister(). - */ -void -_mesa_get_program_register(GLcontext *ctx, enum register_file file, - GLuint index, GLfloat val[4]) -{ - if (CurrentMachine) { - struct prog_src_register srcReg; - const GLfloat *src; - srcReg.File = file; - srcReg.Index = index; - src = get_src_register_pointer(&srcReg, CurrentMachine); - COPY_4V(val, src); - } -} -#endif /* FEATURE_MESA_program_debug */ - - -/** - * Fetch a 4-element float vector from the given source register. - * Apply swizzling and negating as needed. - */ -static void -fetch_vector4(const struct prog_src_register *source, - const struct gl_program_machine *machine, GLfloat result[4]) -{ - const GLfloat *src = get_src_register_pointer(source, machine); - ASSERT(src); - - if (source->Swizzle == SWIZZLE_NOOP) { - /* no swizzling */ - COPY_4V(result, src); - } - else { - ASSERT(GET_SWZ(source->Swizzle, 0) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 1) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 2) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 3) <= 3); - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; - } - - if (source->NegateBase) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; - } - if (source->Abs) { - result[0] = FABSF(result[0]); - result[1] = FABSF(result[1]); - result[2] = FABSF(result[2]); - result[3] = FABSF(result[3]); - } - if (source->NegateAbs) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; - } -} - - -/** - * Fetch a 4-element uint vector from the given source register. - * Apply swizzling but not negation/abs. - */ -static void -fetch_vector4ui(const struct prog_src_register *source, - const struct gl_program_machine *machine, GLuint result[4]) -{ - const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); - ASSERT(src); - - if (source->Swizzle == SWIZZLE_NOOP) { - /* no swizzling */ - COPY_4V(result, src); - } - else { - ASSERT(GET_SWZ(source->Swizzle, 0) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 1) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 2) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 3) <= 3); - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; - } - - /* Note: no NegateBase, Abs, NegateAbs here */ -} - - - -/** - * Fetch the derivative with respect to X or Y for the given register. - * XXX this currently only works for fragment program input attribs. - */ -static void -fetch_vector4_deriv(GLcontext * ctx, - const struct prog_src_register *source, - const struct gl_program_machine *machine, - char xOrY, GLfloat result[4]) -{ - if (source->File == PROGRAM_INPUT && - source->Index < (GLint) machine->NumDeriv) { - const GLint col = machine->CurElement; - const GLfloat w = machine->Attribs[FRAG_ATTRIB_WPOS][col][3]; - const GLfloat invQ = 1.0f / w; - GLfloat deriv[4]; - - if (xOrY == 'X') { - deriv[0] = machine->DerivX[source->Index][0] * invQ; - deriv[1] = machine->DerivX[source->Index][1] * invQ; - deriv[2] = machine->DerivX[source->Index][2] * invQ; - deriv[3] = machine->DerivX[source->Index][3] * invQ; - } - else { - deriv[0] = machine->DerivY[source->Index][0] * invQ; - deriv[1] = machine->DerivY[source->Index][1] * invQ; - deriv[2] = machine->DerivY[source->Index][2] * invQ; - deriv[3] = machine->DerivY[source->Index][3] * invQ; - } - - result[0] = deriv[GET_SWZ(source->Swizzle, 0)]; - result[1] = deriv[GET_SWZ(source->Swizzle, 1)]; - result[2] = deriv[GET_SWZ(source->Swizzle, 2)]; - result[3] = deriv[GET_SWZ(source->Swizzle, 3)]; - - if (source->NegateBase) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; - } - if (source->Abs) { - result[0] = FABSF(result[0]); - result[1] = FABSF(result[1]); - result[2] = FABSF(result[2]); - result[3] = FABSF(result[3]); - } - if (source->NegateAbs) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; - } - } - else { - ASSIGN_4V(result, 0.0, 0.0, 0.0, 0.0); - } -} - - -/** - * As above, but only return result[0] element. - */ -static void -fetch_vector1(const struct prog_src_register *source, - const struct gl_program_machine *machine, GLfloat result[4]) -{ - const GLfloat *src = get_src_register_pointer(source, machine); - ASSERT(src); - - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - - if (source->NegateBase) { - result[0] = -result[0]; - } - if (source->Abs) { - result[0] = FABSF(result[0]); - } - if (source->NegateAbs) { - result[0] = -result[0]; - } -} - - -/** - * Fetch texel from texture. Use partial derivatives when possible. - */ -static INLINE void -fetch_texel(GLcontext *ctx, - const struct gl_program_machine *machine, - const struct prog_instruction *inst, - const GLfloat texcoord[4], GLfloat lodBias, - GLfloat color[4]) -{ - const GLuint unit = machine->Samplers[inst->TexSrcUnit]; - - /* Note: we only have the right derivatives for fragment input attribs. - */ - if (machine->NumDeriv > 0 && - inst->SrcReg[0].File == PROGRAM_INPUT && - inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit) { - /* simple texture fetch for which we should have derivatives */ - GLuint attr = inst->SrcReg[0].Index; - machine->FetchTexelDeriv(ctx, texcoord, - machine->DerivX[attr], - machine->DerivY[attr], - lodBias, unit, color); - } - else { - machine->FetchTexelLod(ctx, texcoord, lodBias, unit, color); - } -} - - -/** - * Test value against zero and return GT, LT, EQ or UN if NaN. - */ -static INLINE GLuint -generate_cc(float value) -{ - if (value != value) - return COND_UN; /* NaN */ - if (value > 0.0F) - return COND_GT; - if (value < 0.0F) - return COND_LT; - return COND_EQ; -} - - -/** - * Test if the ccMaskRule is satisfied by the given condition code. - * Used to mask destination writes according to the current condition code. - */ -static INLINE GLboolean -test_cc(GLuint condCode, GLuint ccMaskRule) -{ - switch (ccMaskRule) { - case COND_EQ: return (condCode == COND_EQ); - case COND_NE: return (condCode != COND_EQ); - case COND_LT: return (condCode == COND_LT); - case COND_GE: return (condCode == COND_GT || condCode == COND_EQ); - case COND_LE: return (condCode == COND_LT || condCode == COND_EQ); - case COND_GT: return (condCode == COND_GT); - case COND_TR: return GL_TRUE; - case COND_FL: return GL_FALSE; - default: return GL_TRUE; - } -} - - -/** - * Evaluate the 4 condition codes against a predicate and return GL_TRUE - * or GL_FALSE to indicate result. - */ -static INLINE GLboolean -eval_condition(const struct gl_program_machine *machine, - const struct prog_instruction *inst) -{ - const GLuint swizzle = inst->DstReg.CondSwizzle; - const GLuint condMask = inst->DstReg.CondMask; - if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) || - test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) || - test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) || - test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - - -/** - * Store 4 floats into a register. Observe the instructions saturate and - * set-condition-code flags. - */ -static void -store_vector4(const struct prog_instruction *inst, - struct gl_program_machine *machine, const GLfloat value[4]) -{ - const struct prog_dst_register *dstReg = &(inst->DstReg); - const GLboolean clamp = inst->SaturateMode == SATURATE_ZERO_ONE; - GLuint writeMask = dstReg->WriteMask; - GLfloat clampedValue[4]; - GLfloat *dst = get_dst_register_pointer(dstReg, machine); - -#if 0 - if (value[0] > 1.0e10 || - IS_INF_OR_NAN(value[0]) || - IS_INF_OR_NAN(value[1]) || - IS_INF_OR_NAN(value[2]) || IS_INF_OR_NAN(value[3])) - printf("store %g %g %g %g\n", value[0], value[1], value[2], value[3]); -#endif - - if (clamp) { - clampedValue[0] = CLAMP(value[0], 0.0F, 1.0F); - clampedValue[1] = CLAMP(value[1], 0.0F, 1.0F); - clampedValue[2] = CLAMP(value[2], 0.0F, 1.0F); - clampedValue[3] = CLAMP(value[3], 0.0F, 1.0F); - value = clampedValue; - } - - if (dstReg->CondMask != COND_TR) { - /* condition codes may turn off some writes */ - if (writeMask & WRITEMASK_X) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 0)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_X; - } - if (writeMask & WRITEMASK_Y) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 1)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_Y; - } - if (writeMask & WRITEMASK_Z) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 2)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_Z; - } - if (writeMask & WRITEMASK_W) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 3)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_W; - } - } - - if (writeMask & WRITEMASK_X) - dst[0] = value[0]; - if (writeMask & WRITEMASK_Y) - dst[1] = value[1]; - if (writeMask & WRITEMASK_Z) - dst[2] = value[2]; - if (writeMask & WRITEMASK_W) - dst[3] = value[3]; - - if (inst->CondUpdate) { - if (writeMask & WRITEMASK_X) - machine->CondCodes[0] = generate_cc(value[0]); - if (writeMask & WRITEMASK_Y) - machine->CondCodes[1] = generate_cc(value[1]); - if (writeMask & WRITEMASK_Z) - machine->CondCodes[2] = generate_cc(value[2]); - if (writeMask & WRITEMASK_W) - machine->CondCodes[3] = generate_cc(value[3]); -#if DEBUG_PROG - printf("CondCodes=(%s,%s,%s,%s) for:\n", - _mesa_condcode_string(machine->CondCodes[0]), - _mesa_condcode_string(machine->CondCodes[1]), - _mesa_condcode_string(machine->CondCodes[2]), - _mesa_condcode_string(machine->CondCodes[3])); -#endif - } -} - - -/** - * Store 4 uints into a register. Observe the set-condition-code flags. - */ -static void -store_vector4ui(const struct prog_instruction *inst, - struct gl_program_machine *machine, const GLuint value[4]) -{ - const struct prog_dst_register *dstReg = &(inst->DstReg); - GLuint writeMask = dstReg->WriteMask; - GLuint *dst = (GLuint *) get_dst_register_pointer(dstReg, machine); - - if (dstReg->CondMask != COND_TR) { - /* condition codes may turn off some writes */ - if (writeMask & WRITEMASK_X) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 0)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_X; - } - if (writeMask & WRITEMASK_Y) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 1)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_Y; - } - if (writeMask & WRITEMASK_Z) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 2)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_Z; - } - if (writeMask & WRITEMASK_W) { - if (!test_cc(machine->CondCodes[GET_SWZ(dstReg->CondSwizzle, 3)], - dstReg->CondMask)) - writeMask &= ~WRITEMASK_W; - } - } - - if (writeMask & WRITEMASK_X) - dst[0] = value[0]; - if (writeMask & WRITEMASK_Y) - dst[1] = value[1]; - if (writeMask & WRITEMASK_Z) - dst[2] = value[2]; - if (writeMask & WRITEMASK_W) - dst[3] = value[3]; - - if (inst->CondUpdate) { - if (writeMask & WRITEMASK_X) - machine->CondCodes[0] = generate_cc(value[0]); - if (writeMask & WRITEMASK_Y) - machine->CondCodes[1] = generate_cc(value[1]); - if (writeMask & WRITEMASK_Z) - machine->CondCodes[2] = generate_cc(value[2]); - if (writeMask & WRITEMASK_W) - machine->CondCodes[3] = generate_cc(value[3]); -#if DEBUG_PROG - printf("CondCodes=(%s,%s,%s,%s) for:\n", - _mesa_condcode_string(machine->CondCodes[0]), - _mesa_condcode_string(machine->CondCodes[1]), - _mesa_condcode_string(machine->CondCodes[2]), - _mesa_condcode_string(machine->CondCodes[3])); -#endif - } -} - - - -/** - * Execute the given vertex/fragment program. - * - * \param ctx rendering context - * \param program the program to execute - * \param machine machine state (must be initialized) - * \return GL_TRUE if program completed or GL_FALSE if program executed KIL. - */ -GLboolean -_mesa_execute_program(GLcontext * ctx, - const struct gl_program *program, - struct gl_program_machine *machine) -{ - const GLuint numInst = program->NumInstructions; - const GLuint maxExec = 10000; - GLuint pc, numExec = 0; - - machine->CurProgram = program; - - if (DEBUG_PROG) { - printf("execute program %u --------------------\n", program->Id); - } - -#if FEATURE_MESA_program_debug - CurrentMachine = machine; -#endif - - if (program->Target == GL_VERTEX_PROGRAM_ARB) { - machine->EnvParams = ctx->VertexProgram.Parameters; - } - else { - machine->EnvParams = ctx->FragmentProgram.Parameters; - } - - for (pc = 0; pc < numInst; pc++) { - const struct prog_instruction *inst = program->Instructions + pc; - -#if FEATURE_MESA_program_debug - if (ctx->FragmentProgram.CallbackEnabled && - ctx->FragmentProgram.Callback) { - ctx->FragmentProgram.CurrentPosition = inst->StringPos; - ctx->FragmentProgram.Callback(program->Target, - ctx->FragmentProgram.CallbackData); - } -#endif - - if (DEBUG_PROG) { - _mesa_print_instruction(inst); - } - - switch (inst->Opcode) { - case OPCODE_ABS: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = FABSF(a[0]); - result[1] = FABSF(a[1]); - result[2] = FABSF(a[2]); - result[3] = FABSF(a[3]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_ADD: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = a[0] + b[0]; - result[1] = a[1] + b[1]; - result[2] = a[2] + b[2]; - result[3] = a[3] + b[3]; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("ADD (%g %g %g %g) = (%g %g %g %g) + (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_AND: /* bitwise AND */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] & b[0]; - result[1] = a[1] & b[1]; - result[2] = a[2] & b[2]; - result[3] = a[3] & b[3]; - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_ARL: - { - GLfloat t[4]; - fetch_vector4(&inst->SrcReg[0], machine, t); - machine->AddressReg[0][0] = IFLOOR(t[0]); - } - break; - case OPCODE_BGNLOOP: - /* no-op */ - break; - case OPCODE_ENDLOOP: - /* subtract 1 here since pc is incremented by for(pc) loop */ - pc = inst->BranchTarget - 1; /* go to matching BNGLOOP */ - break; - case OPCODE_BGNSUB: /* begin subroutine */ - break; - case OPCODE_ENDSUB: /* end subroutine */ - break; - case OPCODE_BRA: /* branch (conditional) */ - /* fall-through */ - case OPCODE_BRK: /* break out of loop (conditional) */ - /* fall-through */ - case OPCODE_CONT: /* continue loop (conditional) */ - if (eval_condition(machine, inst)) { - /* take branch */ - /* Subtract 1 here since we'll do pc++ at end of for-loop */ - pc = inst->BranchTarget - 1; - } - break; - case OPCODE_CAL: /* Call subroutine (conditional) */ - if (eval_condition(machine, inst)) { - /* call the subroutine */ - if (machine->StackDepth >= MAX_PROGRAM_CALL_DEPTH) { - return GL_TRUE; /* Per GL_NV_vertex_program2 spec */ - } - machine->CallStack[machine->StackDepth++] = pc + 1; /* next inst */ - /* Subtract 1 here since we'll do pc++ at end of for-loop */ - pc = inst->BranchTarget - 1; - } - break; - case OPCODE_CMP: - { - GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector4(&inst->SrcReg[2], machine, c); - result[0] = a[0] < 0.0F ? b[0] : c[0]; - result[1] = a[1] < 0.0F ? b[1] : c[1]; - result[2] = a[2] < 0.0F ? b[2] : c[2]; - result[3] = a[3] < 0.0F ? b[3] : c[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_COS: - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = result[1] = result[2] = result[3] - = (GLfloat) _mesa_cos(a[0]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_DDX: /* Partial derivative with respect to X */ - { - GLfloat result[4]; - fetch_vector4_deriv(ctx, &inst->SrcReg[0], machine, - 'X', result); - store_vector4(inst, machine, result); - } - break; - case OPCODE_DDY: /* Partial derivative with respect to Y */ - { - GLfloat result[4]; - fetch_vector4_deriv(ctx, &inst->SrcReg[0], machine, - 'Y', result); - store_vector4(inst, machine, result); - } - break; - case OPCODE_DP2: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = result[1] = result[2] = result[3] = DOT2(a, b); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("DP2 %g = (%g %g) . (%g %g)\n", - result[0], a[0], a[1], b[0], b[1]); - } - } - break; - case OPCODE_DP2A: - { - GLfloat a[4], b[4], c, result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector1(&inst->SrcReg[1], machine, &c); - result[0] = result[1] = result[2] = result[3] = DOT2(a, b) + c; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("DP2A %g = (%g %g) . (%g %g) + %g\n", - result[0], a[0], a[1], b[0], b[1], c); - } - } - break; - case OPCODE_DP3: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = result[1] = result[2] = result[3] = DOT3(a, b); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("DP3 %g = (%g %g %g) . (%g %g %g)\n", - result[0], a[0], a[1], a[2], b[0], b[1], b[2]); - } - } - break; - case OPCODE_DP4: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = result[1] = result[2] = result[3] = DOT4(a, b); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n", - result[0], a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_DPH: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = result[1] = result[2] = result[3] = DOT3(a, b) + b[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_DST: /* Distance vector */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = 1.0F; - result[1] = a[1] * b[1]; - result[2] = a[2]; - result[3] = b[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_EXP: - { - GLfloat t[4], q[4], floor_t0; - fetch_vector1(&inst->SrcReg[0], machine, t); - floor_t0 = FLOORF(t[0]); - if (floor_t0 > FLT_MAX_EXP) { - SET_POS_INFINITY(q[0]); - SET_POS_INFINITY(q[2]); - } - else if (floor_t0 < FLT_MIN_EXP) { - q[0] = 0.0F; - q[2] = 0.0F; - } - else { - q[0] = LDEXPF(1.0, (int) floor_t0); - /* Note: GL_NV_vertex_program expects - * result.z = result.x * APPX(result.y) - * We do what the ARB extension says. - */ - q[2] = (GLfloat) _mesa_pow(2.0, t[0]); - } - q[1] = t[0] - floor_t0; - q[3] = 1.0F; - store_vector4( inst, machine, q ); - } - break; - case OPCODE_EX2: /* Exponential base 2 */ - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = result[1] = result[2] = result[3] = - (GLfloat) _mesa_pow(2.0, a[0]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_FLR: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = FLOORF(a[0]); - result[1] = FLOORF(a[1]); - result[2] = FLOORF(a[2]); - result[3] = FLOORF(a[3]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_FRC: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = a[0] - FLOORF(a[0]); - result[1] = a[1] - FLOORF(a[1]); - result[2] = a[2] - FLOORF(a[2]); - result[3] = a[3] - FLOORF(a[3]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_IF: - { - GLboolean cond; - /* eval condition */ - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - GLfloat a[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - cond = (a[0] != 0.0); - } - else { - cond = eval_condition(machine, inst); - } - if (DEBUG_PROG) { - printf("IF: %d\n", cond); - } - /* do if/else */ - if (cond) { - /* do if-clause (just continue execution) */ - } - else { - /* go to the instruction after ELSE or ENDIF */ - assert(inst->BranchTarget >= 0); - pc = inst->BranchTarget - 1; - } - } - break; - case OPCODE_ELSE: - /* goto ENDIF */ - assert(inst->BranchTarget >= 0); - pc = inst->BranchTarget - 1; - break; - case OPCODE_ENDIF: - /* nothing */ - break; - case OPCODE_KIL_NV: /* NV_f_p only (conditional) */ - if (eval_condition(machine, inst)) { - return GL_FALSE; - } - break; - case OPCODE_KIL: /* ARB_f_p only */ - { - GLfloat a[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - if (a[0] < 0.0F || a[1] < 0.0F || a[2] < 0.0F || a[3] < 0.0F) { - return GL_FALSE; - } - } - break; - case OPCODE_LG2: /* log base 2 */ - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - /* The fast LOG2 macro doesn't meet the precision requirements. - */ - result[0] = result[1] = result[2] = result[3] = - (log(a[0]) * 1.442695F); - store_vector4(inst, machine, result); - } - break; - case OPCODE_LIT: - { - const GLfloat epsilon = 1.0F / 256.0F; /* from NV VP spec */ - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - a[0] = MAX2(a[0], 0.0F); - a[1] = MAX2(a[1], 0.0F); - /* XXX ARB version clamps a[3], NV version doesn't */ - a[3] = CLAMP(a[3], -(128.0F - epsilon), (128.0F - epsilon)); - result[0] = 1.0F; - result[1] = a[0]; - /* XXX we could probably just use pow() here */ - if (a[0] > 0.0F) { - if (a[1] == 0.0 && a[3] == 0.0) - result[2] = 1.0; - else - result[2] = (GLfloat) _mesa_pow(a[1], a[3]); - } - else { - result[2] = 0.0; - } - result[3] = 1.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("LIT (%g %g %g %g) : (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3]); - } - } - break; - case OPCODE_LOG: - { - GLfloat t[4], q[4], abs_t0; - fetch_vector1(&inst->SrcReg[0], machine, t); - abs_t0 = FABSF(t[0]); - if (abs_t0 != 0.0F) { - /* Since we really can't handle infinite values on VMS - * like other OSes we'll use __MAXFLOAT to represent - * infinity. This may need some tweaking. - */ -#ifdef VMS - if (abs_t0 == __MAXFLOAT) -#else - if (IS_INF_OR_NAN(abs_t0)) -#endif - { - SET_POS_INFINITY(q[0]); - q[1] = 1.0F; - SET_POS_INFINITY(q[2]); - } - else { - int exponent; - GLfloat mantissa = FREXPF(t[0], &exponent); - q[0] = (GLfloat) (exponent - 1); - q[1] = (GLfloat) (2.0 * mantissa); /* map [.5, 1) -> [1, 2) */ - - /* The fast LOG2 macro doesn't meet the precision - * requirements. - */ - q[2] = (log(t[0]) * 1.442695F); - } - } - else { - SET_NEG_INFINITY(q[0]); - q[1] = 1.0F; - SET_NEG_INFINITY(q[2]); - } - q[3] = 1.0; - store_vector4(inst, machine, q); - } - break; - case OPCODE_LRP: - { - GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector4(&inst->SrcReg[2], machine, c); - result[0] = a[0] * b[0] + (1.0F - a[0]) * c[0]; - result[1] = a[1] * b[1] + (1.0F - a[1]) * c[1]; - result[2] = a[2] * b[2] + (1.0F - a[2]) * c[2]; - result[3] = a[3] * b[3] + (1.0F - a[3]) * c[3]; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("LRP (%g %g %g %g) = (%g %g %g %g), " - "(%g %g %g %g), (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3], c[0], c[1], c[2], c[3]); - } - } - break; - case OPCODE_MAD: - { - GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector4(&inst->SrcReg[2], machine, c); - result[0] = a[0] * b[0] + c[0]; - result[1] = a[1] * b[1] + c[1]; - result[2] = a[2] * b[2] + c[2]; - result[3] = a[3] * b[3] + c[3]; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("MAD (%g %g %g %g) = (%g %g %g %g) * " - "(%g %g %g %g) + (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3], c[0], c[1], c[2], c[3]); - } - } - break; - case OPCODE_MAX: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = MAX2(a[0], b[0]); - result[1] = MAX2(a[1], b[1]); - result[2] = MAX2(a[2], b[2]); - result[3] = MAX2(a[3], b[3]); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_MIN: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = MIN2(a[0], b[0]); - result[1] = MIN2(a[1], b[1]); - result[2] = MIN2(a[2], b[2]); - result[3] = MIN2(a[3], b[3]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_MOV: - { - GLfloat result[4]; - fetch_vector4(&inst->SrcReg[0], machine, result); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("MOV (%g %g %g %g)\n", - result[0], result[1], result[2], result[3]); - } - } - break; - case OPCODE_MUL: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = a[0] * b[0]; - result[1] = a[1] * b[1]; - result[2] = a[2] * b[2]; - result[3] = a[3] * b[3]; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_NOISE1: - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = - result[1] = - result[2] = - result[3] = _mesa_noise1(a[0]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_NOISE2: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = - result[1] = - result[2] = result[3] = _mesa_noise2(a[0], a[1]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_NOISE3: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = - result[1] = - result[2] = - result[3] = _mesa_noise3(a[0], a[1], a[2]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_NOISE4: - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = - result[1] = - result[2] = - result[3] = _mesa_noise4(a[0], a[1], a[2], a[3]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_NOP: - break; - case OPCODE_NOT: /* bitwise NOT */ - { - GLuint a[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - result[0] = ~a[0]; - result[1] = ~a[1]; - result[2] = ~a[2]; - result[3] = ~a[3]; - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_NRM3: /* 3-component normalization */ - { - GLfloat a[4], result[4]; - GLfloat tmp; - fetch_vector4(&inst->SrcReg[0], machine, a); - tmp = a[0] * a[0] + a[1] * a[1] + a[2] * a[2]; - if (tmp != 0.0F) - tmp = INV_SQRTF(tmp); - result[0] = tmp * a[0]; - result[1] = tmp * a[1]; - result[2] = tmp * a[2]; - result[3] = 0.0; /* undefined, but prevent valgrind warnings */ - store_vector4(inst, machine, result); - } - break; - case OPCODE_NRM4: /* 4-component normalization */ - { - GLfloat a[4], result[4]; - GLfloat tmp; - fetch_vector4(&inst->SrcReg[0], machine, a); - tmp = a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]; - if (tmp != 0.0F) - tmp = INV_SQRTF(tmp); - result[0] = tmp * a[0]; - result[1] = tmp * a[1]; - result[2] = tmp * a[2]; - result[3] = tmp * a[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_OR: /* bitwise OR */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] | b[0]; - result[1] = a[1] | b[1]; - result[2] = a[2] | b[2]; - result[3] = a[3] | b[3]; - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_PK2H: /* pack two 16-bit floats in one 32-bit float */ - { - GLfloat a[4]; - GLuint result[4]; - GLhalfNV hx, hy; - fetch_vector4(&inst->SrcReg[0], machine, a); - hx = _mesa_float_to_half(a[0]); - hy = _mesa_float_to_half(a[1]); - result[0] = - result[1] = - result[2] = - result[3] = hx | (hy << 16); - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_PK2US: /* pack two GLushorts into one 32-bit float */ - { - GLfloat a[4]; - GLuint result[4], usx, usy; - fetch_vector4(&inst->SrcReg[0], machine, a); - a[0] = CLAMP(a[0], 0.0F, 1.0F); - a[1] = CLAMP(a[1], 0.0F, 1.0F); - usx = IROUND(a[0] * 65535.0F); - usy = IROUND(a[1] * 65535.0F); - result[0] = - result[1] = - result[2] = - result[3] = usx | (usy << 16); - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_PK4B: /* pack four GLbytes into one 32-bit float */ - { - GLfloat a[4]; - GLuint result[4], ubx, uby, ubz, ubw; - fetch_vector4(&inst->SrcReg[0], machine, a); - a[0] = CLAMP(a[0], -128.0F / 127.0F, 1.0F); - a[1] = CLAMP(a[1], -128.0F / 127.0F, 1.0F); - a[2] = CLAMP(a[2], -128.0F / 127.0F, 1.0F); - a[3] = CLAMP(a[3], -128.0F / 127.0F, 1.0F); - ubx = IROUND(127.0F * a[0] + 128.0F); - uby = IROUND(127.0F * a[1] + 128.0F); - ubz = IROUND(127.0F * a[2] + 128.0F); - ubw = IROUND(127.0F * a[3] + 128.0F); - result[0] = - result[1] = - result[2] = - result[3] = ubx | (uby << 8) | (ubz << 16) | (ubw << 24); - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_PK4UB: /* pack four GLubytes into one 32-bit float */ - { - GLfloat a[4]; - GLuint result[4], ubx, uby, ubz, ubw; - fetch_vector4(&inst->SrcReg[0], machine, a); - a[0] = CLAMP(a[0], 0.0F, 1.0F); - a[1] = CLAMP(a[1], 0.0F, 1.0F); - a[2] = CLAMP(a[2], 0.0F, 1.0F); - a[3] = CLAMP(a[3], 0.0F, 1.0F); - ubx = IROUND(255.0F * a[0]); - uby = IROUND(255.0F * a[1]); - ubz = IROUND(255.0F * a[2]); - ubw = IROUND(255.0F * a[3]); - result[0] = - result[1] = - result[2] = - result[3] = ubx | (uby << 8) | (ubz << 16) | (ubw << 24); - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_POW: - { - GLfloat a[4], b[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - fetch_vector1(&inst->SrcReg[1], machine, b); - result[0] = result[1] = result[2] = result[3] - = (GLfloat) _mesa_pow(a[0], b[0]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_RCP: - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - if (DEBUG_PROG) { - if (a[0] == 0) - printf("RCP(0)\n"); - else if (IS_INF_OR_NAN(a[0])) - printf("RCP(inf)\n"); - } - result[0] = result[1] = result[2] = result[3] = 1.0F / a[0]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_RET: /* return from subroutine (conditional) */ - if (eval_condition(machine, inst)) { - if (machine->StackDepth == 0) { - return GL_TRUE; /* Per GL_NV_vertex_program2 spec */ - } - /* subtract one because of pc++ in the for loop */ - pc = machine->CallStack[--machine->StackDepth] - 1; - } - break; - case OPCODE_RFL: /* reflection vector */ - { - GLfloat axis[4], dir[4], result[4], tmpX, tmpW; - fetch_vector4(&inst->SrcReg[0], machine, axis); - fetch_vector4(&inst->SrcReg[1], machine, dir); - tmpW = DOT3(axis, axis); - tmpX = (2.0F * DOT3(axis, dir)) / tmpW; - result[0] = tmpX * axis[0] - dir[0]; - result[1] = tmpX * axis[1] - dir[1]; - result[2] = tmpX * axis[2] - dir[2]; - /* result[3] is never written! XXX enforce in parser! */ - store_vector4(inst, machine, result); - } - break; - case OPCODE_RSQ: /* 1 / sqrt() */ - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - a[0] = FABSF(a[0]); - result[0] = result[1] = result[2] = result[3] = INV_SQRTF(a[0]); - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]); - } - } - break; - case OPCODE_SCS: /* sine and cos */ - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = (GLfloat) _mesa_cos(a[0]); - result[1] = (GLfloat) _mesa_sin(a[0]); - result[2] = 0.0; /* undefined! */ - result[3] = 0.0; /* undefined! */ - store_vector4(inst, machine, result); - } - break; - case OPCODE_SEQ: /* set on equal */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] == b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] == b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] == b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] == b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SEQ (%g %g %g %g) = (%g %g %g %g) == (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SFL: /* set false, operands ignored */ - { - static const GLfloat result[4] = { 0.0F, 0.0F, 0.0F, 0.0F }; - store_vector4(inst, machine, result); - } - break; - case OPCODE_SGE: /* set on greater or equal */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] >= b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] >= b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] >= b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] >= b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SGE (%g %g %g %g) = (%g %g %g %g) >= (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SGT: /* set on greater */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] > b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] > b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] > b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] > b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SGT (%g %g %g %g) = (%g %g %g %g) > (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SIN: - { - GLfloat a[4], result[4]; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = result[1] = result[2] = result[3] - = (GLfloat) _mesa_sin(a[0]); - store_vector4(inst, machine, result); - } - break; - case OPCODE_SLE: /* set on less or equal */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] <= b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] <= b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] <= b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] <= b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SLE (%g %g %g %g) = (%g %g %g %g) <= (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SLT: /* set on less */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] < b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] < b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] < b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] < b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SLT (%g %g %g %g) = (%g %g %g %g) < (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SNE: /* set on not equal */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = (a[0] != b[0]) ? 1.0F : 0.0F; - result[1] = (a[1] != b[1]) ? 1.0F : 0.0F; - result[2] = (a[2] != b[2]) ? 1.0F : 0.0F; - result[3] = (a[3] != b[3]) ? 1.0F : 0.0F; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SNE (%g %g %g %g) = (%g %g %g %g) != (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SSG: /* set sign (-1, 0 or +1) */ - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = (GLfloat) ((a[0] > 0.0F) - (a[0] < 0.0F)); - result[1] = (GLfloat) ((a[1] > 0.0F) - (a[1] < 0.0F)); - result[2] = (GLfloat) ((a[2] > 0.0F) - (a[2] < 0.0F)); - result[3] = (GLfloat) ((a[3] > 0.0F) - (a[3] < 0.0F)); - store_vector4(inst, machine, result); - } - break; - case OPCODE_STR: /* set true, operands ignored */ - { - static const GLfloat result[4] = { 1.0F, 1.0F, 1.0F, 1.0F }; - store_vector4(inst, machine, result); - } - break; - case OPCODE_SUB: - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = a[0] - b[0]; - result[1] = a[1] - b[1]; - result[2] = a[2] - b[2]; - result[3] = a[3] - b[3]; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("SUB (%g %g %g %g) = (%g %g %g %g) - (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); - } - } - break; - case OPCODE_SWZ: /* extended swizzle */ - { - const struct prog_src_register *source = &inst->SrcReg[0]; - const GLfloat *src = get_src_register_pointer(source, machine); - GLfloat result[4]; - GLuint i; - for (i = 0; i < 4; i++) { - const GLuint swz = GET_SWZ(source->Swizzle, i); - if (swz == SWIZZLE_ZERO) - result[i] = 0.0; - else if (swz == SWIZZLE_ONE) - result[i] = 1.0; - else { - ASSERT(swz >= 0); - ASSERT(swz <= 3); - result[i] = src[swz]; - } - if (source->NegateBase & (1 << i)) - result[i] = -result[i]; - } - store_vector4(inst, machine, result); - } - break; - case OPCODE_TEX: /* Both ARB and NV frag prog */ - /* Simple texel lookup */ - { - GLfloat texcoord[4], color[4]; - fetch_vector4(&inst->SrcReg[0], machine, texcoord); - - fetch_texel(ctx, machine, inst, texcoord, 0.0, color); - - if (DEBUG_PROG) { - printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g]\n", - color[0], color[1], color[2], color[3], - inst->TexSrcUnit, - texcoord[0], texcoord[1], texcoord[2], texcoord[3]); - } - store_vector4(inst, machine, color); - } - break; - case OPCODE_TXB: /* GL_ARB_fragment_program only */ - /* Texel lookup with LOD bias */ - { - const GLuint unit = machine->Samplers[inst->TexSrcUnit]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLfloat texcoord[4], color[4], lodBias; - - fetch_vector4(&inst->SrcReg[0], machine, texcoord); - - /* texcoord[3] is the bias to add to lambda */ - lodBias = texUnit->LodBias + texcoord[3]; - if (texUnit->_Current) { - lodBias += texUnit->_Current->LodBias; - } - - fetch_texel(ctx, machine, inst, texcoord, lodBias, color); - - store_vector4(inst, machine, color); - } - break; - case OPCODE_TXD: /* GL_NV_fragment_program only */ - /* Texture lookup w/ partial derivatives for LOD */ - { - GLfloat texcoord[4], dtdx[4], dtdy[4], color[4]; - fetch_vector4(&inst->SrcReg[0], machine, texcoord); - fetch_vector4(&inst->SrcReg[1], machine, dtdx); - fetch_vector4(&inst->SrcReg[2], machine, dtdy); - machine->FetchTexelDeriv(ctx, texcoord, dtdx, dtdy, - 0.0, /* lodBias */ - inst->TexSrcUnit, color); - store_vector4(inst, machine, color); - } - break; - case OPCODE_TXP: /* GL_ARB_fragment_program only */ - /* Texture lookup w/ projective divide */ - { - GLfloat texcoord[4], color[4]; - - fetch_vector4(&inst->SrcReg[0], machine, texcoord); - /* Not so sure about this test - if texcoord[3] is - * zero, we'd probably be fine except for an ASSERT in - * IROUND_POS() which gets triggered by the inf values created. - */ - if (texcoord[3] != 0.0) { - texcoord[0] /= texcoord[3]; - texcoord[1] /= texcoord[3]; - texcoord[2] /= texcoord[3]; - } - - fetch_texel(ctx, machine, inst, texcoord, 0.0, color); - - store_vector4(inst, machine, color); - } - break; - case OPCODE_TXP_NV: /* GL_NV_fragment_program only */ - /* Texture lookup w/ projective divide, as above, but do not - * do the divide by w if sampling from a cube map. - */ - { - GLfloat texcoord[4], color[4]; - - fetch_vector4(&inst->SrcReg[0], machine, texcoord); - if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX && - texcoord[3] != 0.0) { - texcoord[0] /= texcoord[3]; - texcoord[1] /= texcoord[3]; - texcoord[2] /= texcoord[3]; - } - - fetch_texel(ctx, machine, inst, texcoord, 0.0, color); - - store_vector4(inst, machine, color); - } - break; - case OPCODE_TRUNC: /* truncate toward zero */ - { - GLfloat a[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - result[0] = (GLfloat) (GLint) a[0]; - result[1] = (GLfloat) (GLint) a[1]; - result[2] = (GLfloat) (GLint) a[2]; - result[3] = (GLfloat) (GLint) a[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_UP2H: /* unpack two 16-bit floats */ - { - GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; - GLhalfNV hx, hy; - fetch_vector1(&inst->SrcReg[0], machine, a); - hx = rawBits[0] & 0xffff; - hy = rawBits[0] >> 16; - result[0] = result[2] = _mesa_half_to_float(hx); - result[1] = result[3] = _mesa_half_to_float(hy); - store_vector4(inst, machine, result); - } - break; - case OPCODE_UP2US: /* unpack two GLushorts */ - { - GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; - GLushort usx, usy; - fetch_vector1(&inst->SrcReg[0], machine, a); - usx = rawBits[0] & 0xffff; - usy = rawBits[0] >> 16; - result[0] = result[2] = usx * (1.0f / 65535.0f); - result[1] = result[3] = usy * (1.0f / 65535.0f); - store_vector4(inst, machine, result); - } - break; - case OPCODE_UP4B: /* unpack four GLbytes */ - { - GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = (((rawBits[0] >> 0) & 0xff) - 128) / 127.0F; - result[1] = (((rawBits[0] >> 8) & 0xff) - 128) / 127.0F; - result[2] = (((rawBits[0] >> 16) & 0xff) - 128) / 127.0F; - result[3] = (((rawBits[0] >> 24) & 0xff) - 128) / 127.0F; - store_vector4(inst, machine, result); - } - break; - case OPCODE_UP4UB: /* unpack four GLubytes */ - { - GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; - fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = ((rawBits[0] >> 0) & 0xff) / 255.0F; - result[1] = ((rawBits[0] >> 8) & 0xff) / 255.0F; - result[2] = ((rawBits[0] >> 16) & 0xff) / 255.0F; - result[3] = ((rawBits[0] >> 24) & 0xff) / 255.0F; - store_vector4(inst, machine, result); - } - break; - case OPCODE_XOR: /* bitwise XOR */ - { - GLuint a[4], b[4], result[4]; - fetch_vector4ui(&inst->SrcReg[0], machine, a); - fetch_vector4ui(&inst->SrcReg[1], machine, b); - result[0] = a[0] ^ b[0]; - result[1] = a[1] ^ b[1]; - result[2] = a[2] ^ b[2]; - result[3] = a[3] ^ b[3]; - store_vector4ui(inst, machine, result); - } - break; - case OPCODE_XPD: /* cross product */ - { - GLfloat a[4], b[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - result[0] = a[1] * b[2] - a[2] * b[1]; - result[1] = a[2] * b[0] - a[0] * b[2]; - result[2] = a[0] * b[1] - a[1] * b[0]; - result[3] = 1.0; - store_vector4(inst, machine, result); - if (DEBUG_PROG) { - printf("XPD (%g %g %g %g) = (%g %g %g) X (%g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], b[0], b[1], b[2]); - } - } - break; - case OPCODE_X2D: /* 2-D matrix transform */ - { - GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - fetch_vector4(&inst->SrcReg[1], machine, b); - fetch_vector4(&inst->SrcReg[2], machine, c); - result[0] = a[0] + b[0] * c[0] + b[1] * c[1]; - result[1] = a[1] + b[0] * c[2] + b[1] * c[3]; - result[2] = a[2] + b[0] * c[0] + b[1] * c[1]; - result[3] = a[3] + b[0] * c[2] + b[1] * c[3]; - store_vector4(inst, machine, result); - } - break; - case OPCODE_PRINT: - { - if (inst->SrcReg[0].File != -1) { - GLfloat a[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, - a[0], a[1], a[2], a[3]); - } - else { - _mesa_printf("%s\n", (const char *) inst->Data); - } - } - break; - case OPCODE_END: - return GL_TRUE; - default: - _mesa_problem(ctx, "Bad opcode %d in _mesa_execute_program", - inst->Opcode); - return GL_TRUE; /* return value doesn't matter */ - } - - numExec++; - if (numExec > maxExec) { - _mesa_problem(ctx, "Infinite loop detected in fragment program"); - return GL_TRUE; - } - - } /* for pc */ - -#if FEATURE_MESA_program_debug - CurrentMachine = NULL; -#endif - - return GL_TRUE; -} diff --git a/src/libs/mesa/mesa/shader/prog_execute.h b/src/libs/mesa/mesa/shader/prog_execute.h deleted file mode 100644 index 8ceb7b092e..0000000000 --- a/src/libs/mesa/mesa/shader/prog_execute.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 PROG_EXECUTE_H -#define PROG_EXECUTE_H - -#include "main/config.h" - - -typedef void (*FetchTexelLodFunc)(GLcontext *ctx, const GLfloat texcoord[4], - GLfloat lambda, GLuint unit, GLfloat color[4]); - -typedef void (*FetchTexelDerivFunc)(GLcontext *ctx, const GLfloat texcoord[4], - const GLfloat texdx[4], - const GLfloat texdy[4], - GLfloat lodBias, - GLuint unit, GLfloat color[4]); - - -/** - * Virtual machine state used during execution of vertex/fragment programs. - */ -struct gl_program_machine -{ - const struct gl_program *CurProgram; - - /** Fragment Input attributes */ - GLfloat (*Attribs)[MAX_WIDTH][4]; - GLfloat (*DerivX)[4]; - GLfloat (*DerivY)[4]; - GLuint NumDeriv; /**< Max index into DerivX/Y arrays */ - GLuint CurElement; /**< Index into Attribs arrays */ - - /** Vertex Input attribs */ - GLfloat VertAttribs[VERT_ATTRIB_MAX][4]; - - GLfloat Temporaries[MAX_PROGRAM_TEMPS][4]; - GLfloat Outputs[MAX_PROGRAM_OUTPUTS][4]; - GLfloat (*EnvParams)[4]; /**< Vertex or Fragment env parameters */ - GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */ - GLint AddressReg[MAX_PROGRAM_ADDRESS_REGS][4]; - - const GLubyte *Samplers; /** Array mapping sampler var to tex unit */ - - GLuint CallStack[MAX_PROGRAM_CALL_DEPTH]; /**< For CAL/RET instructions */ - GLuint StackDepth; /**< Index/ptr to top of CallStack[] */ - - /** Texture fetch functions */ - FetchTexelLodFunc FetchTexelLod; - FetchTexelDerivFunc FetchTexelDeriv; -}; - - -extern void -_mesa_get_program_register(GLcontext *ctx, enum register_file file, - GLuint index, GLfloat val[4]); - -extern GLboolean -_mesa_execute_program(GLcontext *ctx, - const struct gl_program *program, - struct gl_program_machine *machine); - - -#endif /* PROG_EXECUTE_H */ diff --git a/src/libs/mesa/mesa/shader/prog_instruction.c b/src/libs/mesa/mesa/shader/prog_instruction.c deleted file mode 100644 index 4a6d0d670a..0000000000 --- a/src/libs/mesa/mesa/shader/prog_instruction.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 1999-2009 VMware, Inc. 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. - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/mtypes.h" -#include "prog_instruction.h" - - -/** - * Initialize program instruction fields to defaults. - * \param inst first instruction to initialize - * \param count number of instructions to initialize - */ -void -_mesa_init_instructions(struct prog_instruction *inst, GLuint count) -{ - GLuint i; - - _mesa_bzero(inst, count * sizeof(struct prog_instruction)); - - for (i = 0; i < count; i++) { - inst[i].SrcReg[0].File = PROGRAM_UNDEFINED; - inst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP; - inst[i].SrcReg[1].File = PROGRAM_UNDEFINED; - inst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP; - inst[i].SrcReg[2].File = PROGRAM_UNDEFINED; - inst[i].SrcReg[2].Swizzle = SWIZZLE_NOOP; - - inst[i].DstReg.File = PROGRAM_UNDEFINED; - inst[i].DstReg.WriteMask = WRITEMASK_XYZW; - inst[i].DstReg.CondMask = COND_TR; - inst[i].DstReg.CondSwizzle = SWIZZLE_NOOP; - - inst[i].SaturateMode = SATURATE_OFF; - inst[i].Precision = FLOAT32; - } -} - - -/** - * Allocate an array of program instructions. - * \param numInst number of instructions - * \return pointer to instruction memory - */ -struct prog_instruction * -_mesa_alloc_instructions(GLuint numInst) -{ - return (struct prog_instruction *) - _mesa_calloc(numInst * sizeof(struct prog_instruction)); -} - - -/** - * Reallocate memory storing an array of program instructions. - * This is used when we need to append additional instructions onto an - * program. - * \param oldInst pointer to first of old/src instructions - * \param numOldInst number of instructions at - * \param numNewInst desired size of new instruction array. - * \return pointer to start of new instruction array. - */ -struct prog_instruction * -_mesa_realloc_instructions(struct prog_instruction *oldInst, - GLuint numOldInst, GLuint numNewInst) -{ - struct prog_instruction *newInst; - - newInst = (struct prog_instruction *) - _mesa_realloc(oldInst, - numOldInst * sizeof(struct prog_instruction), - numNewInst * sizeof(struct prog_instruction)); - - return newInst; -} - - -/** - * Copy an array of program instructions. - * \param dest pointer to destination. - * \param src pointer to source. - * \param n number of instructions to copy. - * \return pointer to destination. - */ -struct prog_instruction * -_mesa_copy_instructions(struct prog_instruction *dest, - const struct prog_instruction *src, GLuint n) -{ - GLuint i; - _mesa_memcpy(dest, src, n * sizeof(struct prog_instruction)); - for (i = 0; i < n; i++) { - if (src[i].Comment) - dest[i].Comment = _mesa_strdup(src[i].Comment); - } - return dest; -} - - -/** - * Free an array of instructions - */ -void -_mesa_free_instructions(struct prog_instruction *inst, GLuint count) -{ - GLuint i; - for (i = 0; i < count; i++) { - if (inst[i].Data) - _mesa_free(inst[i].Data); - if (inst[i].Comment) - _mesa_free((char *) inst[i].Comment); - } - _mesa_free(inst); -} - - -/** - * Basic info about each instruction - */ -struct instruction_info -{ - gl_inst_opcode Opcode; - const char *Name; - GLuint NumSrcRegs; - GLuint NumDstRegs; -}; - -/** - * Instruction info - * \note Opcode should equal array index! - */ -static const struct instruction_info InstInfo[MAX_OPCODE] = { - { OPCODE_NOP, "NOP", 0, 0 }, - { OPCODE_ABS, "ABS", 1, 1 }, - { OPCODE_ADD, "ADD", 2, 1 }, - { OPCODE_AND, "AND", 2, 1 }, - { OPCODE_ARA, "ARA", 1, 1 }, - { OPCODE_ARL, "ARL", 1, 1 }, - { OPCODE_ARL_NV, "ARL_NV", 1, 1 }, - { OPCODE_ARR, "ARL", 1, 1 }, - { OPCODE_BGNLOOP,"BGNLOOP", 0, 0 }, - { OPCODE_BGNSUB, "BGNSUB", 0, 0 }, - { OPCODE_BRA, "BRA", 0, 0 }, - { OPCODE_BRK, "BRK", 0, 0 }, - { OPCODE_CAL, "CAL", 0, 0 }, - { OPCODE_CMP, "CMP", 3, 1 }, - { OPCODE_CONT, "CONT", 0, 0 }, - { OPCODE_COS, "COS", 1, 1 }, - { OPCODE_DDX, "DDX", 1, 1 }, - { OPCODE_DDY, "DDY", 1, 1 }, - { OPCODE_DP2, "DP2", 2, 1 }, - { OPCODE_DP2A, "DP2A", 3, 1 }, - { OPCODE_DP3, "DP3", 2, 1 }, - { OPCODE_DP4, "DP4", 2, 1 }, - { OPCODE_DPH, "DPH", 2, 1 }, - { OPCODE_DST, "DST", 2, 1 }, - { OPCODE_ELSE, "ELSE", 0, 0 }, - { OPCODE_END, "END", 0, 0 }, - { OPCODE_ENDIF, "ENDIF", 0, 0 }, - { OPCODE_ENDLOOP,"ENDLOOP", 0, 0 }, - { OPCODE_ENDSUB, "ENDSUB", 0, 0 }, - { OPCODE_EX2, "EX2", 1, 1 }, - { OPCODE_EXP, "EXP", 1, 1 }, - { OPCODE_FLR, "FLR", 1, 1 }, - { OPCODE_FRC, "FRC", 1, 1 }, - { OPCODE_IF, "IF", 1, 0 }, - { OPCODE_KIL, "KIL", 1, 0 }, - { OPCODE_KIL_NV, "KIL_NV", 0, 0 }, - { OPCODE_LG2, "LG2", 1, 1 }, - { OPCODE_LIT, "LIT", 1, 1 }, - { OPCODE_LOG, "LOG", 1, 1 }, - { OPCODE_LRP, "LRP", 3, 1 }, - { OPCODE_MAD, "MAD", 3, 1 }, - { OPCODE_MAX, "MAX", 2, 1 }, - { OPCODE_MIN, "MIN", 2, 1 }, - { OPCODE_MOV, "MOV", 1, 1 }, - { OPCODE_MUL, "MUL", 2, 1 }, - { OPCODE_NOISE1, "NOISE1", 1, 1 }, - { OPCODE_NOISE2, "NOISE2", 1, 1 }, - { OPCODE_NOISE3, "NOISE3", 1, 1 }, - { OPCODE_NOISE4, "NOISE4", 1, 1 }, - { OPCODE_NOT, "NOT", 1, 1 }, - { OPCODE_NRM3, "NRM3", 1, 1 }, - { OPCODE_NRM4, "NRM4", 1, 1 }, - { OPCODE_OR, "OR", 2, 1 }, - { OPCODE_PK2H, "PK2H", 1, 1 }, - { OPCODE_PK2US, "PK2US", 1, 1 }, - { OPCODE_PK4B, "PK4B", 1, 1 }, - { OPCODE_PK4UB, "PK4UB", 1, 1 }, - { OPCODE_POW, "POW", 2, 1 }, - { OPCODE_POPA, "POPA", 0, 0 }, - { OPCODE_PRINT, "PRINT", 1, 0 }, - { OPCODE_PUSHA, "PUSHA", 0, 0 }, - { OPCODE_RCC, "RCC", 1, 1 }, - { OPCODE_RCP, "RCP", 1, 1 }, - { OPCODE_RET, "RET", 0, 0 }, - { OPCODE_RFL, "RFL", 1, 1 }, - { OPCODE_RSQ, "RSQ", 1, 1 }, - { OPCODE_SCS, "SCS", 1, 1 }, - { OPCODE_SEQ, "SEQ", 2, 1 }, - { OPCODE_SFL, "SFL", 0, 1 }, - { OPCODE_SGE, "SGE", 2, 1 }, - { OPCODE_SGT, "SGT", 2, 1 }, - { OPCODE_SIN, "SIN", 1, 1 }, - { OPCODE_SLE, "SLE", 2, 1 }, - { OPCODE_SLT, "SLT", 2, 1 }, - { OPCODE_SNE, "SNE", 2, 1 }, - { OPCODE_SSG, "SSG", 1, 1 }, - { OPCODE_STR, "STR", 0, 1 }, - { OPCODE_SUB, "SUB", 2, 1 }, - { OPCODE_SWZ, "SWZ", 1, 1 }, - { OPCODE_TEX, "TEX", 1, 1 }, - { OPCODE_TXB, "TXB", 1, 1 }, - { OPCODE_TXD, "TXD", 3, 1 }, - { OPCODE_TXL, "TXL", 1, 1 }, - { OPCODE_TXP, "TXP", 1, 1 }, - { OPCODE_TXP_NV, "TXP_NV", 1, 1 }, - { OPCODE_TRUNC, "TRUNC", 1, 1 }, - { OPCODE_UP2H, "UP2H", 1, 1 }, - { OPCODE_UP2US, "UP2US", 1, 1 }, - { OPCODE_UP4B, "UP4B", 1, 1 }, - { OPCODE_UP4UB, "UP4UB", 1, 1 }, - { OPCODE_X2D, "X2D", 3, 1 }, - { OPCODE_XOR, "XOR", 2, 1 }, - { OPCODE_XPD, "XPD", 2, 1 } -}; - - -/** - * Return the number of src registers for the given instruction/opcode. - */ -GLuint -_mesa_num_inst_src_regs(gl_inst_opcode opcode) -{ - ASSERT(opcode == InstInfo[opcode].Opcode); - ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); - return InstInfo[opcode].NumSrcRegs; -} - - -/** - * Return the number of dst registers for the given instruction/opcode. - */ -GLuint -_mesa_num_inst_dst_regs(gl_inst_opcode opcode) -{ - ASSERT(opcode == InstInfo[opcode].Opcode); - ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); - return InstInfo[opcode].NumDstRegs; -} - - -GLboolean -_mesa_is_tex_instruction(gl_inst_opcode opcode) -{ - return (opcode == OPCODE_TEX || - opcode == OPCODE_TXB || - opcode == OPCODE_TXD || - opcode == OPCODE_TXL || - opcode == OPCODE_TXP); -} - - -/** - * Return string name for given program opcode. - */ -const char * -_mesa_opcode_string(gl_inst_opcode opcode) -{ - ASSERT(opcode < MAX_OPCODE); - return InstInfo[opcode].Name; -} - diff --git a/src/libs/mesa/mesa/shader/prog_instruction.h b/src/libs/mesa/mesa/shader/prog_instruction.h deleted file mode 100644 index 0ef0251951..0000000000 --- a/src/libs/mesa/mesa/shader/prog_instruction.h +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file prog_instruction.h - * - * Vertex/fragment program instruction datatypes and constants. - * - * \author Brian Paul - * \author Keith Whitwell - * \author Ian Romanick - */ - - -#ifndef PROG_INSTRUCTION_H -#define PROG_INSTRUCTION_H - - -/** - * Swizzle indexes. - * Do not change! - */ -/*@{*/ -#define SWIZZLE_X 0 -#define SWIZZLE_Y 1 -#define SWIZZLE_Z 2 -#define SWIZZLE_W 3 -#define SWIZZLE_ZERO 4 /**< For SWZ instruction only */ -#define SWIZZLE_ONE 5 /**< For SWZ instruction only */ -#define SWIZZLE_NIL 7 /**< used during shader code gen (undefined value) */ -/*@}*/ - -#define MAKE_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) -#define SWIZZLE_NOOP MAKE_SWIZZLE4(0,1,2,3) -#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) -#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) - -#define SWIZZLE_XYZW MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W) -#define SWIZZLE_XXXX MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X) -#define SWIZZLE_YYYY MAKE_SWIZZLE4(SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y) -#define SWIZZLE_ZZZZ MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z) -#define SWIZZLE_WWWW MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W) - - -/** - * Writemask values, 1 bit per component. - */ -/*@{*/ -#define WRITEMASK_X 0x1 -#define WRITEMASK_Y 0x2 -#define WRITEMASK_XY 0x3 -#define WRITEMASK_Z 0x4 -#define WRITEMASK_XZ 0x5 -#define WRITEMASK_YZ 0x6 -#define WRITEMASK_XYZ 0x7 -#define WRITEMASK_W 0x8 -#define WRITEMASK_XW 0x9 -#define WRITEMASK_YW 0xa -#define WRITEMASK_XYW 0xb -#define WRITEMASK_ZW 0xc -#define WRITEMASK_XZW 0xd -#define WRITEMASK_YZW 0xe -#define WRITEMASK_XYZW 0xf -/*@}*/ - - -/** - * Condition codes - */ -/*@{*/ -#define COND_GT 1 /**< greater than zero */ -#define COND_EQ 2 /**< equal to zero */ -#define COND_LT 3 /**< less than zero */ -#define COND_UN 4 /**< unordered (NaN) */ -#define COND_GE 5 /**< greater then or equal to zero */ -#define COND_LE 6 /**< less then or equal to zero */ -#define COND_NE 7 /**< not equal to zero */ -#define COND_TR 8 /**< always true */ -#define COND_FL 9 /**< always false */ -/*@}*/ - - -/** - * Instruction precision for GL_NV_fragment_program - */ -/*@{*/ -#define FLOAT32 0x1 -#define FLOAT16 0x2 -#define FIXED12 0x4 -/*@}*/ - - -/** - * Saturation modes when storing values. - */ -/*@{*/ -#define SATURATE_OFF 0 -#define SATURATE_ZERO_ONE 1 -#define SATURATE_PLUS_MINUS_ONE 2 -/*@}*/ - - -/** - * Per-component negation masks - */ -/*@{*/ -#define NEGATE_X 0x1 -#define NEGATE_Y 0x2 -#define NEGATE_Z 0x4 -#define NEGATE_W 0x8 -#define NEGATE_XYZW 0xf -#define NEGATE_NONE 0x0 -/*@}*/ - - -/** - * Program instruction opcodes, for both vertex and fragment programs. - * \note changes to this opcode list must be reflected in t_vb_arbprogram.c - */ -typedef enum prog_opcode { - /* ARB_vp ARB_fp NV_vp NV_fp GLSL */ - /*------------------------------------------*/ - OPCODE_NOP = 0, /* X */ - OPCODE_ABS, /* X X 1.1 X */ - OPCODE_ADD, /* X X X X X */ - OPCODE_AND, /* */ - OPCODE_ARA, /* 2 */ - OPCODE_ARL, /* X X */ - OPCODE_ARL_NV, /* 2 */ - OPCODE_ARR, /* 2 */ - OPCODE_BGNLOOP, /* opt */ - OPCODE_BGNSUB, /* opt */ - OPCODE_BRA, /* 2 X */ - OPCODE_BRK, /* 2 opt */ - OPCODE_CAL, /* 2 2 */ - OPCODE_CMP, /* X */ - OPCODE_CONT, /* opt */ - OPCODE_COS, /* X 2 X X */ - OPCODE_DDX, /* X X */ - OPCODE_DDY, /* X X */ - OPCODE_DP2, /* 2 */ - OPCODE_DP2A, /* 2 */ - OPCODE_DP3, /* X X X X X */ - OPCODE_DP4, /* X X X X X */ - OPCODE_DPH, /* X X 1.1 */ - OPCODE_DST, /* X X X X */ - OPCODE_ELSE, /* X */ - OPCODE_END, /* X X X X opt */ - OPCODE_ENDIF, /* opt */ - OPCODE_ENDLOOP, /* opt */ - OPCODE_ENDSUB, /* opt */ - OPCODE_EX2, /* X X 2 X X */ - OPCODE_EXP, /* X X X */ - OPCODE_FLR, /* X X 2 X X */ - OPCODE_FRC, /* X X 2 X X */ - OPCODE_IF, /* opt */ - OPCODE_KIL, /* X */ - OPCODE_KIL_NV, /* X X */ - OPCODE_LG2, /* X X 2 X X */ - OPCODE_LIT, /* X X X X */ - OPCODE_LOG, /* X X X */ - OPCODE_LRP, /* X X */ - OPCODE_MAD, /* X X X X X */ - OPCODE_MAX, /* X X X X X */ - OPCODE_MIN, /* X X X X X */ - OPCODE_MOV, /* X X X X X */ - OPCODE_MUL, /* X X X X X */ - OPCODE_NOISE1, /* X */ - OPCODE_NOISE2, /* X */ - OPCODE_NOISE3, /* X */ - OPCODE_NOISE4, /* X */ - OPCODE_NOT, /* */ - OPCODE_NRM3, /* */ - OPCODE_NRM4, /* */ - OPCODE_OR, /* */ - OPCODE_PK2H, /* X */ - OPCODE_PK2US, /* X */ - OPCODE_PK4B, /* X */ - OPCODE_PK4UB, /* X */ - OPCODE_POW, /* X X X X */ - OPCODE_POPA, /* 3 */ - OPCODE_PRINT, /* X X */ - OPCODE_PUSHA, /* 3 */ - OPCODE_RCC, /* 1.1 */ - OPCODE_RCP, /* X X X X X */ - OPCODE_RET, /* 2 2 */ - OPCODE_RFL, /* X X */ - OPCODE_RSQ, /* X X X X X */ - OPCODE_SCS, /* X */ - OPCODE_SEQ, /* 2 X X */ - OPCODE_SFL, /* 2 X */ - OPCODE_SGE, /* X X X X X */ - OPCODE_SGT, /* 2 X X */ - OPCODE_SIN, /* X 2 X X */ - OPCODE_SLE, /* 2 X X */ - OPCODE_SLT, /* X X X X X */ - OPCODE_SNE, /* 2 X X */ - OPCODE_SSG, /* 2 */ - OPCODE_STR, /* 2 X */ - OPCODE_SUB, /* X X 1.1 X X */ - OPCODE_SWZ, /* X X */ - OPCODE_TEX, /* X 3 X X */ - OPCODE_TXB, /* X 3 X */ - OPCODE_TXD, /* X X */ - OPCODE_TXL, /* 3 2 X */ - OPCODE_TXP, /* X X */ - OPCODE_TXP_NV, /* 3 X */ - OPCODE_TRUNC, /* X */ - OPCODE_UP2H, /* X */ - OPCODE_UP2US, /* X */ - OPCODE_UP4B, /* X */ - OPCODE_UP4UB, /* X */ - OPCODE_X2D, /* X */ - OPCODE_XOR, /* */ - OPCODE_XPD, /* X X X */ - MAX_OPCODE -} gl_inst_opcode; - - -/** - * Number of bits for the src/dst register Index field. - * This limits the size of temp/uniform register files. - */ -#define INST_INDEX_BITS 10 - - -/** - * Instruction source register. - */ -struct prog_src_register -{ - GLuint File:4; /**< One of the PROGRAM_* register file values. */ - GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit. - * May be negative for relative addressing. - */ - GLuint Swizzle:12; - GLuint RelAddr:1; - - /** - * \name Source register "sign" control. - * - * The ARB and NV extensions allow varrying degrees of control over the - * sign of the source vector components. These values allow enough control - * for all flavors of the extensions. - */ - /*@{*/ - /** - * Per-component negation for the SWZ instruction. For non-SWZ - * instructions the only possible values are NEGATE_XYZW and NEGATE_NONE. - * - * \since - * ARB_vertex_program, ARB_fragment_program - */ - GLuint NegateBase:4; - - /** - * Take the component-wise absolute value. - * - * \since - * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, - * NV_vertex_program2_option. - */ - GLuint Abs:1; - - /** - * Post-absolute value negation (all components). - */ - GLuint NegateAbs:1; - /*@}*/ -}; - - -/** - * Instruction destination register. - */ -struct prog_dst_register -{ - GLuint File:4; /**< One of the PROGRAM_* register file values */ - GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */ - GLuint WriteMask:4; - GLuint RelAddr:1; - - /** - * \name Conditional destination update control. - * - * \since - * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, - * NV_vertex_program2_option. - */ - /*@{*/ - /** - * Takes one of the 9 possible condition values (EQ, FL, GT, GE, LE, LT, - * NE, TR, or UN). Dest reg is only written to if the matching - * (swizzled) condition code value passes. When a conditional update mask - * is not specified, this will be \c COND_TR. - */ - GLuint CondMask:4; - - /** - * Condition code swizzle value. - */ - GLuint CondSwizzle:12; - - /** - * Selects the condition code register to use for conditional destination - * update masking. In NV_fragmnet_program or NV_vertex_program2 mode, only - * condition code register 0 is available. In NV_vertex_program3 mode, - * condition code registers 0 and 1 are available. - */ - GLuint CondSrc:1; - /*@}*/ - GLuint pad:28; -}; - - -/** - * Vertex/fragment program instruction. - */ -struct prog_instruction -{ - gl_inst_opcode Opcode; -#if FEATURE_MESA_program_debug - GLshort StringPos; -#endif - /** - * Arbitrary data. Used for the PRINT, CAL, and BRA instructions. - */ - void *Data; - - struct prog_src_register SrcReg[3]; - struct prog_dst_register DstReg; - - /** - * Indicates that the instruction should update the condition code - * register. - * - * \since - * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, - * NV_vertex_program2_option. - */ - GLuint CondUpdate:1; - - /** - * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the - * condition code register that is to be updated. - * - * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition - * code register 0 is available. In GL_NV_vertex_program3 mode, condition - * code registers 0 and 1 are available. - * - * \since - * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, - * NV_vertex_program2_option. - */ - GLuint CondDst:1; - - /** - * Saturate each value of the vectored result to the range [0,1] or the - * range [-1,1]. \c SSAT mode (i.e., saturation to the range [-1,1]) is - * only available in NV_fragment_program2 mode. - * Value is one of the SATURATE_* tokens. - * - * \since - * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3. - */ - GLuint SaturateMode:2; - - /** - * Per-instruction selectable precision. - * - * \since - * NV_fragment_program, NV_fragment_program_option. - */ - GLuint Precision:3; - - /** - * \name Texture source controls. - * - * The texture source controls are only used with the \c TEX, \c TXD, - * \c TXL, and \c TXP instructions. - * - * \since - * ARB_fragment_program, NV_fragment_program, NV_vertex_program3. - */ - /*@{*/ - /** - * Source texture unit. OpenGL supports a maximum of 32 texture - * units. - */ - GLuint TexSrcUnit:5; - - /** - * Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX. - */ - GLuint TexSrcTarget:3; - /*@}*/ - - /** - * For BRA and CAL instructions, the location to jump to. - * For BGNLOOP, points to ENDLOOP (and vice-versa). - * For BRK, points to BGNLOOP (which points to ENDLOOP). - * For IF, points to else or endif. - * For ELSE, points to endif. - */ - GLint BranchTarget; - - /** - * For TEX instructions in shaders, the sampler to use for the - * texture lookup. - */ - GLint Sampler; - - const char *Comment; -}; - - -extern void -_mesa_init_instructions(struct prog_instruction *inst, GLuint count); - -extern struct prog_instruction * -_mesa_alloc_instructions(GLuint numInst); - -extern struct prog_instruction * -_mesa_realloc_instructions(struct prog_instruction *oldInst, - GLuint numOldInst, GLuint numNewInst); - -extern struct prog_instruction * -_mesa_copy_instructions(struct prog_instruction *dest, - const struct prog_instruction *src, GLuint n); - -extern void -_mesa_free_instructions(struct prog_instruction *inst, GLuint count); - -extern GLuint -_mesa_num_inst_src_regs(gl_inst_opcode opcode); - -extern GLuint -_mesa_num_inst_dst_regs(gl_inst_opcode opcode); - -extern GLboolean -_mesa_is_tex_instruction(gl_inst_opcode opcode); - -extern const char * -_mesa_opcode_string(gl_inst_opcode opcode); - - -#endif /* PROG_INSTRUCTION_H */ diff --git a/src/libs/mesa/mesa/shader/prog_noise.c b/src/libs/mesa/mesa/shader/prog_noise.c deleted file mode 100644 index 1713ddb5f3..0000000000 --- a/src/libs/mesa/mesa/shader/prog_noise.c +++ /dev/null @@ -1,638 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -/* - * SimplexNoise1234 - * Copyright (c) 2003-2005, Stefan Gustavson - * - * Contact: stegu@itn.liu.se - */ - -/** - * \file - * \brief C implementation of Perlin Simplex Noise over 1, 2, 3 and 4 dims. - * \author Stefan Gustavson (stegu@itn.liu.se) - * - * - * This implementation is "Simplex Noise" as presented by - * Ken Perlin at a relatively obscure and not often cited course - * session "Real-Time Shading" at Siggraph 2001 (before real - * time shading actually took on), under the title "hardware noise". - * The 3D function is numerically equivalent to his Java reference - * code available in the PDF course notes, although I re-implemented - * it from scratch to get more readable code. The 1D, 2D and 4D cases - * were implemented from scratch by me from Ken Perlin's text. - * - * This file has no dependencies on any other file, not even its own - * header file. The header file is made for use by external code only. - */ - - -#include "main/imports.h" -#include "prog_noise.h" - -#define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) ) - -/* - * --------------------------------------------------------------------- - * Static data - */ - -/** - * Permutation table. This is just a random jumble of all numbers 0-255, - * repeated twice to avoid wrapping the index at 255 for each lookup. - * This needs to be exactly the same for all instances on all platforms, - * so it's easiest to just keep it as static explicit data. - * This also removes the need for any initialisation of this class. - * - * Note that making this an int[] instead of a char[] might make the - * code run faster on platforms with a high penalty for unaligned single - * byte addressing. Intel x86 is generally single-byte-friendly, but - * some other CPUs are faster with 4-aligned reads. - * However, a char[] is smaller, which avoids cache trashing, and that - * is probably the most important aspect on most architectures. - * This array is accessed a *lot* by the noise functions. - * A vector-valued noise over 3D accesses it 96 times, and a - * float-valued 4D noise 64 times. We want this to fit in the cache! - */ -unsigned char perm[512] = { 151, 160, 137, 91, 90, 15, - 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, - 99, 37, 240, 21, 10, 23, - 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, - 11, 32, 57, 177, 33, - 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, - 134, 139, 48, 27, 166, - 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, - 55, 46, 245, 40, 244, - 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, - 18, 169, 200, 196, - 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, - 226, 250, 124, 123, - 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, - 17, 182, 189, 28, 42, - 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, - 167, 43, 172, 9, - 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, - 218, 246, 97, 228, - 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, - 249, 14, 239, 107, - 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, - 127, 4, 150, 254, - 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, - 215, 61, 156, 180, - 151, 160, 137, 91, 90, 15, - 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, - 99, 37, 240, 21, 10, 23, - 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, - 11, 32, 57, 177, 33, - 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, - 134, 139, 48, 27, 166, - 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, - 55, 46, 245, 40, 244, - 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, - 18, 169, 200, 196, - 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, - 226, 250, 124, 123, - 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, - 17, 182, 189, 28, 42, - 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, - 167, 43, 172, 9, - 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, - 218, 246, 97, 228, - 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, - 249, 14, 239, 107, - 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, - 127, 4, 150, 254, - 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, - 215, 61, 156, 180 -}; - -/* - * --------------------------------------------------------------------- - */ - -/* - * Helper functions to compute gradients-dot-residualvectors (1D to 4D) - * Note that these generate gradients of more than unit length. To make - * a close match with the value range of classic Perlin noise, the final - * noise values need to be rescaled to fit nicely within [-1,1]. - * (The simplex noise functions as such also have different scaling.) - * Note also that these noise functions are the most practical and useful - * signed version of Perlin noise. To return values according to the - * RenderMan specification from the SL noise() and pnoise() functions, - * the noise values need to be scaled and offset to [0,1], like this: - * float SLnoise = (SimplexNoise1234::noise(x,y,z) + 1.0) * 0.5; - */ - -static float -grad1(int hash, float x) -{ - int h = hash & 15; - float grad = 1.0f + (h & 7); /* Gradient value 1.0, 2.0, ..., 8.0 */ - if (h & 8) - grad = -grad; /* Set a random sign for the gradient */ - return (grad * x); /* Multiply the gradient with the distance */ -} - -static float -grad2(int hash, float x, float y) -{ - int h = hash & 7; /* Convert low 3 bits of hash code */ - float u = h < 4 ? x : y; /* into 8 simple gradient directions, */ - float v = h < 4 ? y : x; /* and compute the dot product with (x,y). */ - return ((h & 1) ? -u : u) + ((h & 2) ? -2.0f * v : 2.0f * v); -} - -static float -grad3(int hash, float x, float y, float z) -{ - int h = hash & 15; /* Convert low 4 bits of hash code into 12 simple */ - float u = h < 8 ? x : y; /* gradient directions, and compute dot product. */ - float v = h < 4 ? y : h == 12 || h == 14 ? x : z; /* Fix repeats at h = 12 to 15 */ - return ((h & 1) ? -u : u) + ((h & 2) ? -v : v); -} - -static float -grad4(int hash, float x, float y, float z, float t) -{ - int h = hash & 31; /* Convert low 5 bits of hash code into 32 simple */ - float u = h < 24 ? x : y; /* gradient directions, and compute dot product. */ - float v = h < 16 ? y : z; - float w = h < 8 ? z : t; - return ((h & 1) ? -u : u) + ((h & 2) ? -v : v) + ((h & 4) ? -w : w); -} - -/** - * A lookup table to traverse the simplex around a given point in 4D. - * Details can be found where this table is used, in the 4D noise method. - * TODO: This should not be required, backport it from Bill's GLSL code! - */ -static unsigned char simplex[64][4] = { - {0, 1, 2, 3}, {0, 1, 3, 2}, {0, 0, 0, 0}, {0, 2, 3, 1}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 2, 3, 0}, - {0, 2, 1, 3}, {0, 0, 0, 0}, {0, 3, 1, 2}, {0, 3, 2, 1}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 3, 2, 0}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {1, 2, 0, 3}, {0, 0, 0, 0}, {1, 3, 0, 2}, {0, 0, 0, 0}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {2, 3, 0, 1}, {2, 3, 1, 0}, - {1, 0, 2, 3}, {1, 0, 3, 2}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {0, 0, 0, 0}, {2, 0, 3, 1}, {0, 0, 0, 0}, {2, 1, 3, 0}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {2, 0, 1, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {3, 0, 1, 2}, {3, 0, 2, 1}, {0, 0, 0, 0}, {3, 1, 2, 0}, - {2, 1, 0, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, - {3, 1, 0, 2}, {0, 0, 0, 0}, {3, 2, 0, 1}, {3, 2, 1, 0} -}; - - -/** 1D simplex noise */ -GLfloat -_mesa_noise1(GLfloat x) -{ - int i0 = FASTFLOOR(x); - int i1 = i0 + 1; - float x0 = x - i0; - float x1 = x0 - 1.0f; - float t1 = 1.0f - x1 * x1; - float n0, n1; - - float t0 = 1.0f - x0 * x0; -/* if(t0 < 0.0f) t0 = 0.0f; // this never happens for the 1D case */ - t0 *= t0; - n0 = t0 * t0 * grad1(perm[i0 & 0xff], x0); - -/* if(t1 < 0.0f) t1 = 0.0f; // this never happens for the 1D case */ - t1 *= t1; - n1 = t1 * t1 * grad1(perm[i1 & 0xff], x1); - /* The maximum value of this noise is 8*(3/4)^4 = 2.53125 */ - /* A factor of 0.395 would scale to fit exactly within [-1,1], but */ - /* we want to match PRMan's 1D noise, so we scale it down some more. */ - return 0.25f * (n0 + n1); -} - - -/** 2D simplex noise */ -GLfloat -_mesa_noise2(GLfloat x, GLfloat y) -{ -#define F2 0.366025403f /* F2 = 0.5*(sqrt(3.0)-1.0) */ -#define G2 0.211324865f /* G2 = (3.0-Math.sqrt(3.0))/6.0 */ - - float n0, n1, n2; /* Noise contributions from the three corners */ - - /* Skew the input space to determine which simplex cell we're in */ - float s = (x + y) * F2; /* Hairy factor for 2D */ - float xs = x + s; - float ys = y + s; - int i = FASTFLOOR(xs); - int j = FASTFLOOR(ys); - - float t = (float) (i + j) * G2; - float X0 = i - t; /* Unskew the cell origin back to (x,y) space */ - float Y0 = j - t; - float x0 = x - X0; /* The x,y distances from the cell origin */ - float y0 = y - Y0; - - float x1, y1, x2, y2; - int ii, jj; - float t0, t1, t2; - - /* For the 2D case, the simplex shape is an equilateral triangle. */ - /* Determine which simplex we are in. */ - int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */ - if (x0 > y0) { - i1 = 1; - j1 = 0; - } /* lower triangle, XY order: (0,0)->(1,0)->(1,1) */ - else { - i1 = 0; - j1 = 1; - } /* upper triangle, YX order: (0,0)->(0,1)->(1,1) */ - - /* A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and */ - /* a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where */ - /* c = (3-sqrt(3))/6 */ - - x1 = x0 - i1 + G2; /* Offsets for middle corner in (x,y) unskewed coords */ - y1 = y0 - j1 + G2; - x2 = x0 - 1.0f + 2.0f * G2; /* Offsets for last corner in (x,y) unskewed coords */ - y2 = y0 - 1.0f + 2.0f * G2; - - /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */ - ii = i % 256; - jj = j % 256; - - /* Calculate the contribution from the three corners */ - t0 = 0.5f - x0 * x0 - y0 * y0; - if (t0 < 0.0f) - n0 = 0.0f; - else { - t0 *= t0; - n0 = t0 * t0 * grad2(perm[ii + perm[jj]], x0, y0); - } - - t1 = 0.5f - x1 * x1 - y1 * y1; - if (t1 < 0.0f) - n1 = 0.0f; - else { - t1 *= t1; - n1 = t1 * t1 * grad2(perm[ii + i1 + perm[jj + j1]], x1, y1); - } - - t2 = 0.5f - x2 * x2 - y2 * y2; - if (t2 < 0.0f) - n2 = 0.0f; - else { - t2 *= t2; - n2 = t2 * t2 * grad2(perm[ii + 1 + perm[jj + 1]], x2, y2); - } - - /* Add contributions from each corner to get the final noise value. */ - /* The result is scaled to return values in the interval [-1,1]. */ - return 40.0f * (n0 + n1 + n2); /* TODO: The scale factor is preliminary! */ -} - - -/** 3D simplex noise */ -GLfloat -_mesa_noise3(GLfloat x, GLfloat y, GLfloat z) -{ -/* Simple skewing factors for the 3D case */ -#define F3 0.333333333f -#define G3 0.166666667f - - float n0, n1, n2, n3; /* Noise contributions from the four corners */ - - /* Skew the input space to determine which simplex cell we're in */ - float s = (x + y + z) * F3; /* Very nice and simple skew factor for 3D */ - float xs = x + s; - float ys = y + s; - float zs = z + s; - int i = FASTFLOOR(xs); - int j = FASTFLOOR(ys); - int k = FASTFLOOR(zs); - - float t = (float) (i + j + k) * G3; - float X0 = i - t; /* Unskew the cell origin back to (x,y,z) space */ - float Y0 = j - t; - float Z0 = k - t; - float x0 = x - X0; /* The x,y,z distances from the cell origin */ - float y0 = y - Y0; - float z0 = z - Z0; - - float x1, y1, z1, x2, y2, z2, x3, y3, z3; - int ii, jj, kk; - float t0, t1, t2, t3; - - /* For the 3D case, the simplex shape is a slightly irregular tetrahedron. */ - /* Determine which simplex we are in. */ - int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */ - int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */ - -/* This code would benefit from a backport from the GLSL version! */ - if (x0 >= y0) { - if (y0 >= z0) { - i1 = 1; - j1 = 0; - k1 = 0; - i2 = 1; - j2 = 1; - k2 = 0; - } /* X Y Z order */ - else if (x0 >= z0) { - i1 = 1; - j1 = 0; - k1 = 0; - i2 = 1; - j2 = 0; - k2 = 1; - } /* X Z Y order */ - else { - i1 = 0; - j1 = 0; - k1 = 1; - i2 = 1; - j2 = 0; - k2 = 1; - } /* Z X Y order */ - } - else { /* x0 y0) ? 32 : 0; - int c2 = (x0 > z0) ? 16 : 0; - int c3 = (y0 > z0) ? 8 : 0; - int c4 = (x0 > w0) ? 4 : 0; - int c5 = (y0 > w0) ? 2 : 0; - int c6 = (z0 > w0) ? 1 : 0; - int c = c1 + c2 + c3 + c4 + c5 + c6; - - int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */ - int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */ - int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */ - - float x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4; - int ii, jj, kk, ll; - float t0, t1, t2, t3, t4; - - /* - * simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some - * order. Many values of c will never occur, since e.g. x>y>z>w - * makes x= 3 ? 1 : 0; - j1 = simplex[c][1] >= 3 ? 1 : 0; - k1 = simplex[c][2] >= 3 ? 1 : 0; - l1 = simplex[c][3] >= 3 ? 1 : 0; - /* The number 2 in the "simplex" array is at the second largest coordinate. */ - i2 = simplex[c][0] >= 2 ? 1 : 0; - j2 = simplex[c][1] >= 2 ? 1 : 0; - k2 = simplex[c][2] >= 2 ? 1 : 0; - l2 = simplex[c][3] >= 2 ? 1 : 0; - /* The number 1 in the "simplex" array is at the second smallest coordinate. */ - i3 = simplex[c][0] >= 1 ? 1 : 0; - j3 = simplex[c][1] >= 1 ? 1 : 0; - k3 = simplex[c][2] >= 1 ? 1 : 0; - l3 = simplex[c][3] >= 1 ? 1 : 0; - /* The fifth corner has all coordinate offsets = 1, so no need to look that up. */ - - x1 = x0 - i1 + G4; /* Offsets for second corner in (x,y,z,w) coords */ - y1 = y0 - j1 + G4; - z1 = z0 - k1 + G4; - w1 = w0 - l1 + G4; - x2 = x0 - i2 + 2.0f * G4; /* Offsets for third corner in (x,y,z,w) coords */ - y2 = y0 - j2 + 2.0f * G4; - z2 = z0 - k2 + 2.0f * G4; - w2 = w0 - l2 + 2.0f * G4; - x3 = x0 - i3 + 3.0f * G4; /* Offsets for fourth corner in (x,y,z,w) coords */ - y3 = y0 - j3 + 3.0f * G4; - z3 = z0 - k3 + 3.0f * G4; - w3 = w0 - l3 + 3.0f * G4; - x4 = x0 - 1.0f + 4.0f * G4; /* Offsets for last corner in (x,y,z,w) coords */ - y4 = y0 - 1.0f + 4.0f * G4; - z4 = z0 - 1.0f + 4.0f * G4; - w4 = w0 - 1.0f + 4.0f * G4; - - /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */ - ii = i % 256; - jj = j % 256; - kk = k % 256; - ll = l % 256; - - /* Calculate the contribution from the five corners */ - t0 = 0.6f - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; - if (t0 < 0.0f) - n0 = 0.0f; - else { - t0 *= t0; - n0 = - t0 * t0 * grad4(perm[ii + perm[jj + perm[kk + perm[ll]]]], x0, y0, - z0, w0); - } - - t1 = 0.6f - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; - if (t1 < 0.0f) - n1 = 0.0f; - else { - t1 *= t1; - n1 = - t1 * t1 * - grad4(perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]], - x1, y1, z1, w1); - } - - t2 = 0.6f - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; - if (t2 < 0.0f) - n2 = 0.0f; - else { - t2 *= t2; - n2 = - t2 * t2 * - grad4(perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]], - x2, y2, z2, w2); - } - - t3 = 0.6f - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; - if (t3 < 0.0f) - n3 = 0.0f; - else { - t3 *= t3; - n3 = - t3 * t3 * - grad4(perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]], - x3, y3, z3, w3); - } - - t4 = 0.6f - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; - if (t4 < 0.0f) - n4 = 0.0f; - else { - t4 *= t4; - n4 = - t4 * t4 * - grad4(perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]], x4, - y4, z4, w4); - } - - /* Sum up and scale the result to cover the range [-1,1] */ - return 27.0f * (n0 + n1 + n2 + n3 + n4); /* TODO: The scale factor is preliminary! */ -} diff --git a/src/libs/mesa/mesa/shader/prog_noise.h b/src/libs/mesa/mesa/shader/prog_noise.h deleted file mode 100644 index c4779479f9..0000000000 --- a/src/libs/mesa/mesa/shader/prog_noise.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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 PROG_NOISE -#define PROG_NOISE - -extern GLfloat _mesa_noise1(GLfloat); -extern GLfloat _mesa_noise2(GLfloat, GLfloat); -extern GLfloat _mesa_noise3(GLfloat, GLfloat, GLfloat); -extern GLfloat _mesa_noise4(GLfloat, GLfloat, GLfloat, GLfloat); - -#endif - diff --git a/src/libs/mesa/mesa/shader/prog_parameter.c b/src/libs/mesa/mesa/shader/prog_parameter.c deleted file mode 100644 index b8202b56e7..0000000000 --- a/src/libs/mesa/mesa/shader/prog_parameter.c +++ /dev/null @@ -1,720 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_parameter.c - * Program parameter lists and functions. - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_statevars.h" - - -struct gl_program_parameter_list * -_mesa_new_parameter_list(void) -{ - return CALLOC_STRUCT(gl_program_parameter_list); -} - - -/** - * Free a parameter list and all its parameters - */ -void -_mesa_free_parameter_list(struct gl_program_parameter_list *paramList) -{ - GLuint i; - for (i = 0; i < paramList->NumParameters; i++) { - if (paramList->Parameters[i].Name) - _mesa_free((void *) paramList->Parameters[i].Name); - } - _mesa_free(paramList->Parameters); - if (paramList->ParameterValues) - _mesa_align_free(paramList->ParameterValues); - _mesa_free(paramList); -} - - -/** - * Add a new parameter to a parameter list. - * Note that parameter values are usually 4-element GLfloat vectors. - * When size > 4 we'll allocate a sequential block of parameters to - * store all the values (in blocks of 4). - * - * \param paramList the list to add the parameter to - * \param type type of parameter, such as - * \param name the parameter name, will be duplicated/copied! - * \param size number of elements in 'values' vector (1..4, or more) - * \param values initial parameter value, up to 4 GLfloats, or NULL - * \param state state indexes, or NULL - * \return index of new parameter in the list, or -1 if error (out of mem) - */ -GLint -_mesa_add_parameter(struct gl_program_parameter_list *paramList, - enum register_file type, const char *name, - GLuint size, GLenum datatype, const GLfloat *values, - const gl_state_index state[STATE_LENGTH], - GLbitfield flags) -{ - const GLuint oldNum = paramList->NumParameters; - const GLuint sz4 = (size + 3) / 4; /* no. of new param slots needed */ - - assert(size > 0); - - if (oldNum + sz4 > paramList->Size) { - /* Need to grow the parameter list array (alloc some extra) */ - paramList->Size = paramList->Size + 4 * sz4; - - /* realloc arrays */ - paramList->Parameters = (struct gl_program_parameter *) - _mesa_realloc(paramList->Parameters, - oldNum * sizeof(struct gl_program_parameter), - paramList->Size * sizeof(struct gl_program_parameter)); - - paramList->ParameterValues = (GLfloat (*)[4]) - _mesa_align_realloc(paramList->ParameterValues, /* old buf */ - oldNum * 4 * sizeof(GLfloat), /* old size */ - paramList->Size * 4 *sizeof(GLfloat), /* new sz */ - 16); - } - - if (!paramList->Parameters || - !paramList->ParameterValues) { - /* out of memory */ - paramList->NumParameters = 0; - paramList->Size = 0; - return -1; - } - else { - GLuint i; - - paramList->NumParameters = oldNum + sz4; - - _mesa_memset(¶mList->Parameters[oldNum], 0, - sz4 * sizeof(struct gl_program_parameter)); - - for (i = 0; i < sz4; i++) { - struct gl_program_parameter *p = paramList->Parameters + oldNum + i; - p->Name = name ? _mesa_strdup(name) : NULL; - p->Type = type; - p->Size = size; - p->DataType = datatype; - p->Flags = flags; - if (values) { - COPY_4V(paramList->ParameterValues[oldNum + i], values); - values += 4; - p->Initialized = GL_TRUE; - } - else { - /* silence valgrind */ - ASSIGN_4V(paramList->ParameterValues[oldNum + i], 0, 0, 0, 0); - } - size -= 4; - } - - if (state) { - for (i = 0; i < STATE_LENGTH; i++) - paramList->Parameters[oldNum].StateIndexes[i] = state[i]; - } - - return (GLint) oldNum; - } -} - - -/** - * Add a new named program parameter (Ex: NV_fragment_program DEFINE statement) - * \return index of the new entry in the parameter list - */ -GLint -_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4]) -{ - return _mesa_add_parameter(paramList, PROGRAM_NAMED_PARAM, name, - 4, GL_NONE, values, NULL, 0x0); - -} - - -/** - * Add a new named constant to the parameter list. - * This will be used when the program contains something like this: - * PARAM myVals = { 0, 1, 2, 3 }; - * - * \param paramList the parameter list - * \param name the name for the constant - * \param values four float values - * \return index/position of the new parameter in the parameter list - */ -GLint -_mesa_add_named_constant(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4], - GLuint size) -{ - /* first check if this is a duplicate constant */ - GLint pos; - for (pos = 0; pos < paramList->NumParameters; pos++) { - const GLfloat *pvals = paramList->ParameterValues[pos]; - if (pvals[0] == values[0] && - pvals[1] == values[1] && - pvals[2] == values[2] && - pvals[3] == values[3] && - _mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) { - /* Same name and value is already in the param list - reuse it */ - return pos; - } - } - /* not found, add new parameter */ - return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name, - size, GL_NONE, values, NULL, 0x0); -} - - -/** - * Add a new unnamed constant to the parameter list. This will be used - * when a fragment/vertex program contains something like this: - * MOV r, { 0, 1, 2, 3 }; - * We'll search the parameter list for an existing instance of the - * constant. If swizzleOut is non-null, we'll try swizzling when - * looking for a match. - * - * \param paramList the parameter list - * \param values four float values - * \param swizzleOut returns swizzle mask for accessing the constant - * \return index/position of the new parameter in the parameter list. - */ -GLint -_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, - const GLfloat values[4], GLuint size, - GLuint *swizzleOut) -{ - GLint pos; - ASSERT(size >= 1); - ASSERT(size <= 4); - - if (_mesa_lookup_parameter_constant(paramList, values, - size, &pos, swizzleOut)) { - return pos; - } - - /* Look for empty space in an already unnamed constant parameter - * to add this constant. This will only work for single-element - * constants because we rely on smearing (i.e. .yyyy or .zzzz). - */ - if (size == 1 && swizzleOut) { - for (pos = 0; pos < (GLint) paramList->NumParameters; pos++) { - struct gl_program_parameter *p = paramList->Parameters + pos; - if (p->Type == PROGRAM_CONSTANT && p->Size + size <= 4) { - /* ok, found room */ - GLfloat *pVal = paramList->ParameterValues[pos]; - GLuint swz = p->Size; /* 1, 2 or 3 for Y, Z, W */ - pVal[p->Size] = values[0]; - p->Size++; - *swizzleOut = MAKE_SWIZZLE4(swz, swz, swz, swz); - return pos; - } - } - } - - /* add a new parameter to store this constant */ - pos = _mesa_add_parameter(paramList, PROGRAM_CONSTANT, NULL, - size, GL_NONE, values, NULL, 0x0); - if (pos >= 0 && swizzleOut) { - if (size == 1) - *swizzleOut = SWIZZLE_XXXX; - else - *swizzleOut = SWIZZLE_NOOP; - } - return pos; -} - - -/** - * Add a uniform to the parameter list. - * Note that if the uniform is an array, size may be greater than - * what's implied by the datatype. - * \param name uniform's name - * \param size number of floats to allocate - * \param datatype GL_FLOAT_VEC3, GL_FLOAT_MAT4, etc. - */ -GLint -_mesa_add_uniform(struct gl_program_parameter_list *paramList, - const char *name, GLuint size, GLenum datatype, - const GLfloat *values) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - ASSERT(datatype != GL_NONE); - if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_UNIFORM) { - ASSERT(paramList->Parameters[i].Size == size); - ASSERT(paramList->Parameters[i].DataType == datatype); - /* already in list */ - return i; - } - else { - i = _mesa_add_parameter(paramList, PROGRAM_UNIFORM, name, - size, datatype, values, NULL, 0x0); - return i; - } -} - - -/** - * Mark the named uniform as 'used'. - */ -void -_mesa_use_uniform(struct gl_program_parameter_list *paramList, - const char *name) -{ - GLuint i; - for (i = 0; i < paramList->NumParameters; i++) { - struct gl_program_parameter *p = paramList->Parameters + i; - if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) && - _mesa_strcmp(p->Name, name) == 0) { - p->Used = GL_TRUE; - /* Note that large uniforms may occupy several slots so we're - * not done searching yet. - */ - } - } -} - - -/** - * Add a sampler to the parameter list. - * \param name uniform's name - * \param datatype GL_SAMPLER_2D, GL_SAMPLER_2D_RECT_ARB, etc. - * \param index the sampler number (as seen in TEX instructions) - * \return sampler index (starting at zero) or -1 if error - */ -GLint -_mesa_add_sampler(struct gl_program_parameter_list *paramList, - const char *name, GLenum datatype) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) { - ASSERT(paramList->Parameters[i].Size == 1); - ASSERT(paramList->Parameters[i].DataType == datatype); - /* already in list */ - return (GLint) paramList->ParameterValues[i][0]; - } - else { - GLuint i; - const GLint size = 1; /* a sampler is basically a texture unit number */ - GLfloat value; - GLint numSamplers = 0; - for (i = 0; i < paramList->NumParameters; i++) { - if (paramList->Parameters[i].Type == PROGRAM_SAMPLER) - numSamplers++; - } - value = (GLfloat) numSamplers; - (void) _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name, - size, datatype, &value, NULL, 0x0); - return numSamplers; - } -} - - -/** - * Add parameter representing a varying variable. - */ -GLint -_mesa_add_varying(struct gl_program_parameter_list *paramList, - const char *name, GLuint size, GLbitfield flags) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_VARYING) { - /* already in list */ - return i; - } - else { - /*assert(size == 4);*/ - i = _mesa_add_parameter(paramList, PROGRAM_VARYING, name, - size, GL_NONE, NULL, NULL, flags); - return i; - } -} - - -/** - * Add parameter representing a vertex program attribute. - * \param size size of attribute (in floats), may be -1 if unknown - * \param attrib the attribute index, or -1 if unknown - */ -GLint -_mesa_add_attribute(struct gl_program_parameter_list *paramList, - const char *name, GLint size, GLenum datatype, GLint attrib) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - if (i >= 0) { - /* replace */ - if (attrib < 0) - attrib = i; - paramList->Parameters[i].StateIndexes[0] = attrib; - } - else { - /* add */ - gl_state_index state[STATE_LENGTH]; - state[0] = (gl_state_index) attrib; - if (size < 0) - size = 4; - i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name, - size, datatype, NULL, state, 0x0); - } - return i; -} - - - -#if 0 /* not used yet */ -/** - * Returns the number of 4-component registers needed to store a piece - * of GL state. For matrices this may be as many as 4 registers, - * everything else needs - * just 1 register. - */ -static GLuint -sizeof_state_reference(const GLint *stateTokens) -{ - if (stateTokens[0] == STATE_MATRIX) { - GLuint rows = stateTokens[4] - stateTokens[3] + 1; - assert(rows >= 1); - assert(rows <= 4); - return rows; - } - else { - return 1; - } -} -#endif - - -/** - * Add a new state reference to the parameter list. - * This will be used when the program contains something like this: - * PARAM ambient = state.material.front.ambient; - * - * \param paramList the parameter list - * \param stateTokens an array of 5 (STATE_LENGTH) state tokens - * \return index of the new parameter. - */ -GLint -_mesa_add_state_reference(struct gl_program_parameter_list *paramList, - const gl_state_index stateTokens[STATE_LENGTH]) -{ - const GLuint size = 4; /* XXX fix */ - const char *name; - GLint index; - - /* Check if the state reference is already in the list */ - for (index = 0; index < (GLint) paramList->NumParameters; index++) { - GLuint i, match = 0; - for (i = 0; i < STATE_LENGTH; i++) { - if (paramList->Parameters[index].StateIndexes[i] == stateTokens[i]) { - match++; - } - else { - break; - } - } - if (match == STATE_LENGTH) { - /* this state reference is already in the parameter list */ - return index; - } - } - - name = _mesa_program_state_string(stateTokens); - index = _mesa_add_parameter(paramList, PROGRAM_STATE_VAR, name, - size, GL_NONE, - NULL, (gl_state_index *) stateTokens, 0x0); - paramList->StateFlags |= _mesa_program_state_flags(stateTokens); - - /* free name string here since we duplicated it in add_parameter() */ - _mesa_free((void *) name); - - return index; -} - - -/** - * Lookup a parameter value by name in the given parameter list. - * \return pointer to the float[4] values. - */ -GLfloat * -_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name) -{ - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); - if (i < 0) - return NULL; - else - return paramList->ParameterValues[i]; -} - - -/** - * Given a program parameter name, find its position in the list of parameters. - * \param paramList the parameter list to search - * \param nameLen length of name (in chars). - * If length is negative, assume that name is null-terminated. - * \param name the name to search for - * \return index of parameter in the list. - */ -GLint -_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name) -{ - GLint i; - - if (!paramList) - return -1; - - if (nameLen == -1) { - /* name is null-terminated */ - for (i = 0; i < (GLint) paramList->NumParameters; i++) { - if (paramList->Parameters[i].Name && - _mesa_strcmp(paramList->Parameters[i].Name, name) == 0) - return i; - } - } - else { - /* name is not null-terminated, use nameLen */ - for (i = 0; i < (GLint) paramList->NumParameters; i++) { - if (paramList->Parameters[i].Name && - _mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 - && _mesa_strlen(paramList->Parameters[i].Name) == (size_t)nameLen) - return i; - } - } - return -1; -} - - -/** - * Look for a float vector in the given parameter list. The float vector - * may be of length 1, 2, 3 or 4. If swizzleOut is non-null, we'll try - * swizzling to find a match. - * \param list the parameter list to search - * \param v the float vector to search for - * \param size number of element in v - * \param posOut returns the position of the constant, if found - * \param swizzleOut returns a swizzle mask describing location of the - * vector elements if found. - * \return GL_TRUE if found, GL_FALSE if not found - */ -GLboolean -_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list, - const GLfloat v[], GLuint vSize, - GLint *posOut, GLuint *swizzleOut) -{ - GLuint i; - - assert(vSize >= 1); - assert(vSize <= 4); - - if (!list) - return -1; - - for (i = 0; i < list->NumParameters; i++) { - if (list->Parameters[i].Type == PROGRAM_CONSTANT) { - if (!swizzleOut) { - /* swizzle not allowed */ - GLuint j, match = 0; - for (j = 0; j < vSize; j++) { - if (v[j] == list->ParameterValues[i][j]) - match++; - } - if (match == vSize) { - *posOut = i; - return GL_TRUE; - } - } - else { - /* try matching w/ swizzle */ - if (vSize == 1) { - /* look for v[0] anywhere within float[4] value */ - GLuint j; - for (j = 0; j < 4; j++) { - if (list->ParameterValues[i][j] == v[0]) { - /* found it */ - *posOut = i; - *swizzleOut = MAKE_SWIZZLE4(j, j, j, j); - return GL_TRUE; - } - } - } - else if (vSize <= list->Parameters[i].Size) { - /* see if we can match this constant (with a swizzle) */ - GLuint swz[4]; - GLuint match = 0, j, k; - for (j = 0; j < vSize; j++) { - if (v[j] == list->ParameterValues[i][j]) { - swz[j] = j; - match++; - } - else { - for (k = 0; k < list->Parameters[i].Size; k++) { - if (v[j] == list->ParameterValues[i][k]) { - swz[j] = k; - match++; - break; - } - } - } - } - /* smear last value to remaining positions */ - for (; j < 4; j++) - swz[j] = swz[j-1]; - - if (match == vSize) { - *posOut = i; - *swizzleOut = MAKE_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]); - return GL_TRUE; - } - } - } - } - } - - *posOut = -1; - return GL_FALSE; -} - - -struct gl_program_parameter_list * -_mesa_clone_parameter_list(const struct gl_program_parameter_list *list) -{ - struct gl_program_parameter_list *clone; - GLuint i; - - clone = _mesa_new_parameter_list(); - if (!clone) - return NULL; - - /** Not too efficient, but correct */ - for (i = 0; i < list->NumParameters; i++) { - struct gl_program_parameter *p = list->Parameters + i; - struct gl_program_parameter *pCopy; - GLuint size = MIN2(p->Size, 4); - GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType, - list->ParameterValues[i], NULL, 0x0); - ASSERT(j >= 0); - pCopy = clone->Parameters + j; - pCopy->Used = p->Used; - pCopy->Flags = p->Flags; - /* copy state indexes */ - if (p->Type == PROGRAM_STATE_VAR) { - GLint k; - for (k = 0; k < STATE_LENGTH; k++) { - pCopy->StateIndexes[k] = p->StateIndexes[k]; - } - } - else { - clone->Parameters[j].Size = p->Size; - } - - } - - clone->StateFlags = list->StateFlags; - - return clone; -} - - -/** - * Return a new parameter list which is listA + listB. - */ -struct gl_program_parameter_list * -_mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA, - const struct gl_program_parameter_list *listB) -{ - struct gl_program_parameter_list *list; - - if (listA) { - list = _mesa_clone_parameter_list(listA); - if (list && listB) { - GLuint i; - for (i = 0; i < listB->NumParameters; i++) { - struct gl_program_parameter *param = listB->Parameters + i; - _mesa_add_parameter(list, param->Type, param->Name, param->Size, - param->DataType, - listB->ParameterValues[i], - param->StateIndexes, - param->Flags); - } - } - } - else if (listB) { - list = _mesa_clone_parameter_list(listB); - } - else { - list = NULL; - } - return list; -} - - - -/** - * Find longest name of all uniform parameters in list. - */ -GLuint -_mesa_longest_parameter_name(const struct gl_program_parameter_list *list, - enum register_file type) -{ - GLuint i, maxLen = 0; - if (!list) - return 0; - for (i = 0; i < list->NumParameters; i++) { - if (list->Parameters[i].Type == type) { - GLuint len = _mesa_strlen(list->Parameters[i].Name); - if (len > maxLen) - maxLen = len; - } - } - return maxLen; -} - - -/** - * Count the number of parameters in the last that match the given type. - */ -GLuint -_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, - enum register_file type) -{ - GLuint i, count = 0; - if (list) { - for (i = 0; i < list->NumParameters; i++) { - if (list->Parameters[i].Type == type) - count++; - } - } - return count; -} diff --git a/src/libs/mesa/mesa/shader/prog_parameter.h b/src/libs/mesa/mesa/shader/prog_parameter.h deleted file mode 100644 index 200f2c0045..0000000000 --- a/src/libs/mesa/mesa/shader/prog_parameter.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_parameter.c - * Program parameter lists and functions. - * \author Brian Paul - */ - -#ifndef PROG_PARAMETER_H -#define PROG_PARAMETER_H - -#include "main/mtypes.h" -#include "prog_statevars.h" - - -/** - * Program parameter flags - */ -/*@{*/ -#define PROG_PARAM_BIT_CENTROID 0x1 /**< for varying vars (GLSL 1.20) */ -#define PROG_PARAM_BIT_INVARIANT 0x2 /**< for varying vars (GLSL 1.20) */ -#define PROG_PARAM_BIT_FLAT 0x4 /**< for varying vars (GLSL 1.30) */ -#define PROG_PARAM_BIT_LINEAR 0x8 /**< for varying vars (GLSL 1.30) */ -/*@}*/ - - - -/** - * Program parameter. - * Used by shaders/programs for uniforms, constants, varying vars, etc. - */ -struct gl_program_parameter -{ - const char *Name; /**< Null-terminated string */ - enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ - GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ - GLuint Size; /**< Number of components (1..4) */ - GLboolean Used; /**< Helper flag for GLSL uniform tracking */ - GLboolean Initialized; /**< Has the ParameterValue[] been set? */ - GLbitfield Flags; /**< Bitmask of PROG_PARAM_*_BIT */ - /** - * A sequence of STATE_* tokens and integers to identify GL state. - */ - gl_state_index StateIndexes[STATE_LENGTH]; -}; - - -/** - * List of gl_program_parameter instances. - */ -struct gl_program_parameter_list -{ - GLuint Size; /**< allocated size of Parameters, ParameterValues */ - GLuint NumParameters; /**< number of parameters in arrays */ - struct gl_program_parameter *Parameters; /**< Array [Size] */ - GLfloat (*ParameterValues)[4]; /**< Array [Size] of GLfloat[4] */ - GLbitfield StateFlags; /**< _NEW_* flags indicating which state changes - might invalidate ParameterValues[] */ -}; - - -extern struct gl_program_parameter_list * -_mesa_new_parameter_list(void); - -extern void -_mesa_free_parameter_list(struct gl_program_parameter_list *paramList); - -extern struct gl_program_parameter_list * -_mesa_clone_parameter_list(const struct gl_program_parameter_list *list); - -extern struct gl_program_parameter_list * -_mesa_combine_parameter_lists(const struct gl_program_parameter_list *a, - const struct gl_program_parameter_list *b); - -static INLINE GLuint -_mesa_num_parameters(const struct gl_program_parameter_list *list) -{ - return list ? list->NumParameters : 0; -} - -extern GLint -_mesa_add_parameter(struct gl_program_parameter_list *paramList, - enum register_file type, const char *name, - GLuint size, GLenum datatype, const GLfloat *values, - const gl_state_index state[STATE_LENGTH], - GLbitfield flags); - -extern GLint -_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4]); - -extern GLint -_mesa_add_named_constant(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4], - GLuint size); - -extern GLint -_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, - const GLfloat values[4], GLuint size, - GLuint *swizzleOut); - -extern GLint -_mesa_add_uniform(struct gl_program_parameter_list *paramList, - const char *name, GLuint size, GLenum datatype, - const GLfloat *values); - -extern void -_mesa_use_uniform(struct gl_program_parameter_list *paramList, - const char *name); - -extern GLint -_mesa_add_sampler(struct gl_program_parameter_list *paramList, - const char *name, GLenum datatype); - -extern GLint -_mesa_add_varying(struct gl_program_parameter_list *paramList, - const char *name, GLuint size, GLbitfield flags); - -extern GLint -_mesa_add_attribute(struct gl_program_parameter_list *paramList, - const char *name, GLint size, GLenum datatype, GLint attrib); - -extern GLint -_mesa_add_state_reference(struct gl_program_parameter_list *paramList, - const gl_state_index stateTokens[STATE_LENGTH]); - -extern GLfloat * -_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name); - -extern GLint -_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name); - -extern GLboolean -_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list, - const GLfloat v[], GLuint vSize, - GLint *posOut, GLuint *swizzleOut); - -extern GLuint -_mesa_longest_parameter_name(const struct gl_program_parameter_list *list, - enum register_file type); - -extern GLuint -_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, - enum register_file type); - - -#endif /* PROG_PARAMETER_H */ diff --git a/src/libs/mesa/mesa/shader/prog_print.c b/src/libs/mesa/mesa/shader/prog_print.c deleted file mode 100644 index b67a87f8ec..0000000000 --- a/src/libs/mesa/mesa/shader/prog_print.c +++ /dev/null @@ -1,829 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_print.c - * Print vertex/fragment programs - for debugging. - * \author Brian Paul - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_print.h" -#include "prog_statevars.h" - - - -/** - * Return string name for given program/register file. - */ -static const char * -file_string(enum register_file f, gl_prog_print_mode mode) -{ - switch (f) { - case PROGRAM_TEMPORARY: - return "TEMP"; - case PROGRAM_LOCAL_PARAM: - return "LOCAL"; - case PROGRAM_ENV_PARAM: - return "ENV"; - case PROGRAM_STATE_VAR: - return "STATE"; - case PROGRAM_INPUT: - return "INPUT"; - case PROGRAM_OUTPUT: - return "OUTPUT"; - case PROGRAM_NAMED_PARAM: - return "NAMED"; - case PROGRAM_CONSTANT: - return "CONST"; - case PROGRAM_UNIFORM: - return "UNIFORM"; - case PROGRAM_VARYING: - return "VARYING"; - case PROGRAM_WRITE_ONLY: - return "WRITE_ONLY"; - case PROGRAM_ADDRESS: - return "ADDR"; - case PROGRAM_SAMPLER: - return "SAMPLER"; - case PROGRAM_UNDEFINED: - return "UNDEFINED"; - default: - return "Unknown program file!"; - } -} - - -/** - * Return ARB_v/f_prog-style input attrib string. - */ -static const char * -arb_input_attrib_string(GLint index, GLenum progType) -{ - /* - * These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens. - */ - const char *vertAttribs[] = { - "vertex.position", - "vertex.weight", - "vertex.normal", - "vertex.color.primary", - "vertex.color.secondary", - "vertex.fogcoord", - "vertex.(six)", - "vertex.(seven)", - "vertex.texcoord[0]", - "vertex.texcoord[1]", - "vertex.texcoord[2]", - "vertex.texcoord[3]", - "vertex.texcoord[4]", - "vertex.texcoord[5]", - "vertex.texcoord[6]", - "vertex.texcoord[7]", - "vertex.attrib[0]", - "vertex.attrib[1]", - "vertex.attrib[2]", - "vertex.attrib[3]", - "vertex.attrib[4]", - "vertex.attrib[5]", - "vertex.attrib[6]", - "vertex.attrib[7]", - "vertex.attrib[8]", - "vertex.attrib[9]", - "vertex.attrib[10]", - "vertex.attrib[11]", - "vertex.attrib[12]", - "vertex.attrib[13]", - "vertex.attrib[14]", - "vertex.attrib[15]" - }; - const char *fragAttribs[] = { - "fragment.position", - "fragment.color.primary", - "fragment.color.secondary", - "fragment.fogcoord", - "fragment.texcoord[0]", - "fragment.texcoord[1]", - "fragment.texcoord[2]", - "fragment.texcoord[3]", - "fragment.texcoord[4]", - "fragment.texcoord[5]", - "fragment.texcoord[6]", - "fragment.texcoord[7]", - "fragment.varying[0]", - "fragment.varying[1]", - "fragment.varying[2]", - "fragment.varying[3]", - "fragment.varying[4]", - "fragment.varying[5]", - "fragment.varying[6]", - "fragment.varying[7]" - }; - - if (progType == GL_VERTEX_PROGRAM_ARB) { - assert(index < sizeof(vertAttribs) / sizeof(vertAttribs[0])); - return vertAttribs[index]; - } - else { - assert(index < sizeof(fragAttribs) / sizeof(fragAttribs[0])); - return fragAttribs[index]; - } -} - - -/** - * Return ARB_v/f_prog-style output attrib string. - */ -static const char * -arb_output_attrib_string(GLint index, GLenum progType) -{ - /* - * These strings should match the VERT_RESULT_x and FRAG_RESULT_x tokens. - */ - const char *vertResults[] = { - "result.position", - "result.color.primary", - "result.color.secondary", - "result.fogcoord", - "result.texcoord[0]", - "result.texcoord[1]", - "result.texcoord[2]", - "result.texcoord[3]", - "result.texcoord[4]", - "result.texcoord[5]", - "result.texcoord[6]", - "result.texcoord[7]", - "result.varying[0]", - "result.varying[1]", - "result.varying[2]", - "result.varying[3]", - "result.varying[4]", - "result.varying[5]", - "result.varying[6]", - "result.varying[7]" - }; - const char *fragResults[] = { - "result.color", - "result.color(half)", - "result.depth", - "result.color[0]", - "result.color[1]", - "result.color[2]", - "result.color[3]" - }; - - if (progType == GL_VERTEX_PROGRAM_ARB) { - assert(index < sizeof(vertResults) / sizeof(vertResults[0])); - return vertResults[index]; - } - else { - assert(index < sizeof(fragResults) / sizeof(fragResults[0])); - return fragResults[index]; - } -} - - -/** - * Return string representation of the given register. - * Note that some types of registers (like PROGRAM_UNIFORM) aren't defined - * by the ARB/NV program languages so we've taken some liberties here. - * \param file the register file (PROGRAM_INPUT, PROGRAM_TEMPORARY, etc) - * \param index number of the register in the register file - * \param mode the output format/mode/style - * \param prog pointer to containing program - */ -static const char * -reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, - GLboolean relAddr, const struct gl_program *prog) -{ - static char str[100]; - - str[0] = 0; - - switch (mode) { - case PROG_PRINT_DEBUG: - if (relAddr) - sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index); - else - sprintf(str, "%s[%d]", file_string(f, mode), index); - break; - - case PROG_PRINT_ARB: - switch (f) { - case PROGRAM_INPUT: - sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); - break; - case PROGRAM_OUTPUT: - sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); - break; - case PROGRAM_TEMPORARY: - sprintf(str, "temp%d", index); - break; - case PROGRAM_ENV_PARAM: - sprintf(str, "program.env[%d]", index); - break; - case PROGRAM_LOCAL_PARAM: - sprintf(str, "program.local[%d]", index); - break; - case PROGRAM_VARYING: /* extension */ - sprintf(str, "varying[%d]", index); - break; - case PROGRAM_CONSTANT: /* extension */ - sprintf(str, "constant[%d]", index); - break; - case PROGRAM_UNIFORM: /* extension */ - sprintf(str, "uniform[%d]", index); - break; - case PROGRAM_STATE_VAR: - { - struct gl_program_parameter *param - = prog->Parameters->Parameters + index; - sprintf(str, _mesa_program_state_string(param->StateIndexes)); - } - break; - case PROGRAM_ADDRESS: - sprintf(str, "A%d", index); - break; - default: - _mesa_problem(NULL, "bad file in reg_string()"); - } - break; - - case PROG_PRINT_NV: - switch (f) { - case PROGRAM_INPUT: - if (prog->Target == GL_VERTEX_PROGRAM_ARB) - sprintf(str, "v[%d]", index); - else - sprintf(str, "f[%d]", index); - break; - case PROGRAM_OUTPUT: - sprintf(str, "o[%d]", index); - break; - case PROGRAM_TEMPORARY: - sprintf(str, "R%d", index); - break; - case PROGRAM_ENV_PARAM: - sprintf(str, "c[%d]", index); - break; - case PROGRAM_VARYING: /* extension */ - sprintf(str, "varying[%d]", index); - break; - case PROGRAM_UNIFORM: /* extension */ - sprintf(str, "uniform[%d]", index); - break; - case PROGRAM_CONSTANT: /* extension */ - sprintf(str, "constant[%d]", index); - break; - case PROGRAM_STATE_VAR: /* extension */ - sprintf(str, "state[%d]", index); - break; - default: - _mesa_problem(NULL, "bad file in reg_string()"); - } - break; - - default: - _mesa_problem(NULL, "bad mode in reg_string()"); - } - - return str; -} - - -/** - * Return a string representation of the given swizzle word. - * If extended is true, use extended (comma-separated) format. - * \param swizzle the swizzle field - * \param negateBase 4-bit negation vector - * \param extended if true, also allow 0, 1 values - */ -const char * -_mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended) -{ - static const char swz[] = "xyzw01!?"; /* See SWIZZLE_x definitions */ - static char s[20]; - GLuint i = 0; - - if (!extended && swizzle == SWIZZLE_NOOP && negateBase == 0) - return ""; /* no swizzle/negation */ - - if (!extended) - s[i++] = '.'; - - if (negateBase & NEGATE_X) - s[i++] = '-'; - s[i++] = swz[GET_SWZ(swizzle, 0)]; - - if (extended) { - s[i++] = ','; - } - - if (negateBase & NEGATE_Y) - s[i++] = '-'; - s[i++] = swz[GET_SWZ(swizzle, 1)]; - - if (extended) { - s[i++] = ','; - } - - if (negateBase & NEGATE_Z) - s[i++] = '-'; - s[i++] = swz[GET_SWZ(swizzle, 2)]; - - if (extended) { - s[i++] = ','; - } - - if (negateBase & NEGATE_W) - s[i++] = '-'; - s[i++] = swz[GET_SWZ(swizzle, 3)]; - - s[i] = 0; - return s; -} - - -const char * -_mesa_writemask_string(GLuint writeMask) -{ - static char s[10]; - GLuint i = 0; - - if (writeMask == WRITEMASK_XYZW) - return ""; - - s[i++] = '.'; - if (writeMask & WRITEMASK_X) - s[i++] = 'x'; - if (writeMask & WRITEMASK_Y) - s[i++] = 'y'; - if (writeMask & WRITEMASK_Z) - s[i++] = 'z'; - if (writeMask & WRITEMASK_W) - s[i++] = 'w'; - - s[i] = 0; - return s; -} - - -const char * -_mesa_condcode_string(GLuint condcode) -{ - switch (condcode) { - case COND_GT: return "GT"; - case COND_EQ: return "EQ"; - case COND_LT: return "LT"; - case COND_UN: return "UN"; - case COND_GE: return "GE"; - case COND_LE: return "LE"; - case COND_NE: return "NE"; - case COND_TR: return "TR"; - case COND_FL: return "FL"; - default: return "cond???"; - } -} - - -static void -print_dst_reg(const struct prog_dst_register *dstReg, gl_prog_print_mode mode, - const struct gl_program *prog) -{ - _mesa_printf("%s%s", - reg_string((enum register_file) dstReg->File, - dstReg->Index, mode, dstReg->RelAddr, prog), - _mesa_writemask_string(dstReg->WriteMask)); - - if (dstReg->CondMask != COND_TR) { - _mesa_printf(" (%s.%s)", - _mesa_condcode_string(dstReg->CondMask), - _mesa_swizzle_string(dstReg->CondSwizzle, GL_FALSE, GL_FALSE)); - } - -#if 0 - _mesa_printf("%s[%d]%s", - file_string((enum register_file) dstReg->File, mode), - dstReg->Index, - _mesa_writemask_string(dstReg->WriteMask)); -#endif -} - -static void -print_src_reg(const struct prog_src_register *srcReg, gl_prog_print_mode mode, - const struct gl_program *prog) -{ - _mesa_printf("%s%s", - reg_string((enum register_file) srcReg->File, - srcReg->Index, mode, srcReg->RelAddr, prog), - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); -#if 0 - _mesa_printf("%s[%d]%s", - file_string((enum register_file) srcReg->File, mode), - srcReg->Index, - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); -#endif -} - -static void -print_comment(const struct prog_instruction *inst) -{ - if (inst->Comment) - _mesa_printf("; # %s\n", inst->Comment); - else - _mesa_printf(";\n"); -} - - -static void -print_alu_instruction(const struct prog_instruction *inst, - const char *opcode_string, GLuint numRegs, - gl_prog_print_mode mode, - const struct gl_program *prog) -{ - GLuint j; - - _mesa_printf("%s", opcode_string); - if (inst->CondUpdate) - _mesa_printf(".C"); - - /* frag prog only */ - if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - - _mesa_printf(" "); - if (inst->DstReg.File != PROGRAM_UNDEFINED) { - print_dst_reg(&inst->DstReg, mode, prog); - } - else { - _mesa_printf(" ???"); - } - - if (numRegs > 0) - _mesa_printf(", "); - - for (j = 0; j < numRegs; j++) { - print_src_reg(inst->SrcReg + j, mode, prog); - if (j + 1 < numRegs) - _mesa_printf(", "); - } - - print_comment(inst); -} - - -void -_mesa_print_alu_instruction(const struct prog_instruction *inst, - const char *opcode_string, GLuint numRegs) -{ - print_alu_instruction(inst, opcode_string, numRegs, PROG_PRINT_DEBUG, NULL); -} - - -void -_mesa_print_instruction(const struct prog_instruction *inst) -{ - /* note: 4th param should be ignored for PROG_PRINT_DEBUG */ - _mesa_print_instruction_opt(inst, 0, PROG_PRINT_DEBUG, NULL); -} - - -/** - * Print a single vertex/fragment program instruction. - */ -GLint -_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, - gl_prog_print_mode mode, - const struct gl_program *prog) -{ - GLint i; - - if (inst->Opcode == OPCODE_ELSE || - inst->Opcode == OPCODE_ENDIF || - inst->Opcode == OPCODE_ENDLOOP || - inst->Opcode == OPCODE_ENDSUB) { - indent -= 3; - } - for (i = 0; i < indent; i++) { - _mesa_printf(" "); - } - - switch (inst->Opcode) { - case OPCODE_PRINT: - _mesa_printf("PRINT '%s'", inst->Data); - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - _mesa_printf(", "); - _mesa_printf("%s[%d]%s", - file_string((enum register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].NegateBase, GL_FALSE)); - } - if (inst->Comment) - _mesa_printf(" # %s", inst->Comment); - print_comment(inst); - break; - case OPCODE_SWZ: - _mesa_printf("SWZ"); - if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - _mesa_printf(" "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", %s[%d], %s", - file_string((enum register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].NegateBase, GL_TRUE)); - print_comment(inst); - break; - case OPCODE_TEX: - case OPCODE_TXP: - case OPCODE_TXL: - case OPCODE_TXB: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - _mesa_printf(" "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", "); - print_src_reg(&inst->SrcReg[0], mode, prog); - _mesa_printf(", texture[%d], ", inst->TexSrcUnit); - switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: _mesa_printf("1D"); break; - case TEXTURE_2D_INDEX: _mesa_printf("2D"); break; - case TEXTURE_3D_INDEX: _mesa_printf("3D"); break; - case TEXTURE_CUBE_INDEX: _mesa_printf("CUBE"); break; - case TEXTURE_RECT_INDEX: _mesa_printf("RECT"); break; - default: - ; - } - print_comment(inst); - break; - - case OPCODE_KIL: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - _mesa_printf(" "); - print_src_reg(&inst->SrcReg[0], mode, prog); - print_comment(inst); - break; - case OPCODE_KIL_NV: - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - _mesa_printf(" "); - _mesa_printf("%s.%s", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - GL_FALSE, GL_FALSE)); - print_comment(inst); - break; - - case OPCODE_ARL: - _mesa_printf("ARL "); - print_dst_reg(&inst->DstReg, mode, prog); - _mesa_printf(", "); - print_src_reg(&inst->SrcReg[0], mode, prog); - print_comment(inst); - break; - case OPCODE_BRA: - _mesa_printf("BRA %d (%s%s)", - inst->BranchTarget, - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); - print_comment(inst); - break; - case OPCODE_IF: - if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - /* Use ordinary register */ - _mesa_printf("IF "); - print_src_reg(&inst->SrcReg[0], mode, prog); - _mesa_printf("; "); - } - else { - /* Use cond codes */ - _mesa_printf("IF (%s%s);", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - 0, GL_FALSE)); - } - _mesa_printf(" # (if false, goto %d)", inst->BranchTarget); - print_comment(inst); - return indent + 3; - case OPCODE_ELSE: - _mesa_printf("ELSE; # (goto %d)\n", inst->BranchTarget); - return indent + 3; - case OPCODE_ENDIF: - _mesa_printf("ENDIF;\n"); - break; - case OPCODE_BGNLOOP: - _mesa_printf("BGNLOOP; # (end at %d)\n", inst->BranchTarget); - return indent + 3; - case OPCODE_ENDLOOP: - _mesa_printf("ENDLOOP; # (goto %d)\n", inst->BranchTarget); - break; - case OPCODE_BRK: - case OPCODE_CONT: - _mesa_printf("%s (%s%s); # (goto %d)", - _mesa_opcode_string(inst->Opcode), - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), - inst->BranchTarget); - print_comment(inst); - break; - - case OPCODE_BGNSUB: - if (mode == PROG_PRINT_NV) { - _mesa_printf("%s:\n", inst->Comment); /* comment is label */ - return indent; - } - else { - _mesa_printf("BGNSUB"); - print_comment(inst); - return indent + 3; - } - case OPCODE_ENDSUB: - if (mode == PROG_PRINT_DEBUG) { - _mesa_printf("ENDSUB"); - print_comment(inst); - } - break; - case OPCODE_CAL: - if (mode == PROG_PRINT_NV) { - _mesa_printf("CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); - } - else { - _mesa_printf("CAL %u", inst->BranchTarget); - print_comment(inst); - } - break; - case OPCODE_RET: - _mesa_printf("RET (%s%s)", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); - print_comment(inst); - break; - - case OPCODE_END: - _mesa_printf("END\n"); - break; - case OPCODE_NOP: - if (mode == PROG_PRINT_DEBUG) { - _mesa_printf("NOP"); - print_comment(inst); - } - else if (inst->Comment) { - /* ARB/NV extensions don't have NOP instruction */ - _mesa_printf("# %s\n", inst->Comment); - } - break; - /* XXX may need other special-case instructions */ - default: - /* typical alu instruction */ - print_alu_instruction(inst, - _mesa_opcode_string(inst->Opcode), - _mesa_num_inst_src_regs(inst->Opcode), - mode, prog); - break; - } - return indent; -} - - -/** - * Print program to stdout, default options. - */ -void -_mesa_print_program(const struct gl_program *prog) -{ - _mesa_print_program_opt(prog, PROG_PRINT_DEBUG, GL_TRUE); -} - - -/** - * Print program, with options. - */ -void -_mesa_print_program_opt(const struct gl_program *prog, - gl_prog_print_mode mode, - GLboolean lineNumbers) -{ - GLuint i, indent = 0; - - switch (prog->Target) { - case GL_VERTEX_PROGRAM_ARB: - if (mode == PROG_PRINT_ARB) - _mesa_printf("!!ARBvp1.0\n"); - else if (mode == PROG_PRINT_NV) - _mesa_printf("!!VP1.0\n"); - else - _mesa_printf("# Vertex Program/Shader\n"); - break; - case GL_FRAGMENT_PROGRAM_ARB: - case GL_FRAGMENT_PROGRAM_NV: - if (mode == PROG_PRINT_ARB) - _mesa_printf("!!ARBfp1.0\n"); - else if (mode == PROG_PRINT_NV) - _mesa_printf("!!FP1.0\n"); - else - _mesa_printf("# Fragment Program/Shader\n"); - break; - } - - for (i = 0; i < prog->NumInstructions; i++) { - if (lineNumbers) - _mesa_printf("%3d: ", i); - indent = _mesa_print_instruction_opt(prog->Instructions + i, - indent, mode, prog); - } -} - - -/** - * Print all of a program's parameters. - */ -void -_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog) -{ - GLuint i; - - _mesa_printf("InputsRead: 0x%x\n", prog->InputsRead); - _mesa_printf("OutputsWritten: 0x%x\n", prog->OutputsWritten); - _mesa_printf("NumInstructions=%d\n", prog->NumInstructions); - _mesa_printf("NumTemporaries=%d\n", prog->NumTemporaries); - _mesa_printf("NumParameters=%d\n", prog->NumParameters); - _mesa_printf("NumAttributes=%d\n", prog->NumAttributes); - _mesa_printf("NumAddressRegs=%d\n", prog->NumAddressRegs); - _mesa_printf("Samplers=[ "); - for (i = 0; i < MAX_SAMPLERS; i++) { - _mesa_printf("%d ", prog->SamplerUnits[i]); - } - _mesa_printf("]\n"); - - _mesa_load_state_parameters(ctx, prog->Parameters); - -#if 0 - _mesa_printf("Local Params:\n"); - for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){ - const GLfloat *p = prog->LocalParams[i]; - _mesa_printf("%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); - } -#endif - _mesa_print_parameter_list(prog->Parameters); -} - - -void -_mesa_print_parameter_list(const struct gl_program_parameter_list *list) -{ - const gl_prog_print_mode mode = PROG_PRINT_DEBUG; - GLuint i; - - if (!list) - return; - - _mesa_printf("param list %p\n", (void *) list); - for (i = 0; i < list->NumParameters; i++){ - struct gl_program_parameter *param = list->Parameters + i; - const GLfloat *v = list->ParameterValues[i]; - _mesa_printf("param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", - i, param->Size, - file_string(list->Parameters[i].Type, mode), - param->Name, v[0], v[1], v[2], v[3]); - if (param->Flags & PROG_PARAM_BIT_CENTROID) - _mesa_printf(" Centroid"); - if (param->Flags & PROG_PARAM_BIT_INVARIANT) - _mesa_printf(" Invariant"); - if (param->Flags & PROG_PARAM_BIT_FLAT) - _mesa_printf(" Flat"); - if (param->Flags & PROG_PARAM_BIT_LINEAR) - _mesa_printf(" Linear"); - _mesa_printf("\n"); - } -} diff --git a/src/libs/mesa/mesa/shader/prog_print.h b/src/libs/mesa/mesa/shader/prog_print.h deleted file mode 100644 index cd9e388e82..0000000000 --- a/src/libs/mesa/mesa/shader/prog_print.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 PROG_PRINT_H -#define PROG_PRINT_H - - -/** - * The output style to use when printing programs. - */ -typedef enum { - PROG_PRINT_ARB, - PROG_PRINT_NV, - PROG_PRINT_DEBUG -} gl_prog_print_mode; - - -extern const char * -_mesa_condcode_string(GLuint condcode); - -extern const char * -_mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended); - -const char * -_mesa_writemask_string(GLuint writeMask); - -extern void -_mesa_print_alu_instruction(const struct prog_instruction *inst, - const char *opcode_string, GLuint numRegs); - -extern void -_mesa_print_instruction(const struct prog_instruction *inst); - -extern GLint -_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent, - gl_prog_print_mode mode, - const struct gl_program *prog); - -extern void -_mesa_print_program(const struct gl_program *prog); - -extern void -_mesa_print_program_opt(const struct gl_program *prog, gl_prog_print_mode mode, - GLboolean lineNumbers); - -extern void -_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog); - -extern void -_mesa_print_parameter_list(const struct gl_program_parameter_list *list); - - -#endif /* PROG_PRINT_H */ diff --git a/src/libs/mesa/mesa/shader/prog_statevars.c b/src/libs/mesa/mesa/shader/prog_statevars.c deleted file mode 100644 index 615826b210..0000000000 --- a/src/libs/mesa/mesa/shader/prog_statevars.c +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file prog_statevars.c - * Program state variable management. - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "prog_statevars.h" -#include "prog_parameter.h" - - -/** - * Use the list of tokens in the state[] array to find global GL state - * and return it in . Usually, four values are returned in - * but matrix queries may return as many as 16 values. - * This function is used for ARB vertex/fragment programs. - * The program parser will produce the state[] values. - */ -static void -_mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], - GLfloat *value) -{ - switch (state[0]) { - case STATE_MATERIAL: - { - /* state[1] is either 0=front or 1=back side */ - const GLuint face = (GLuint) state[1]; - const struct gl_material *mat = &ctx->Light.Material; - ASSERT(face == 0 || face == 1); - /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */ - ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); - /* XXX we could get rid of this switch entirely with a little - * work in arbprogparse.c's parse_state_single_item(). - */ - /* state[2] is the material attribute */ - switch (state[2]) { - case STATE_AMBIENT: - COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_AMBIENT + face]); - return; - case STATE_DIFFUSE: - COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_DIFFUSE + face]); - return; - case STATE_SPECULAR: - COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_SPECULAR + face]); - return; - case STATE_EMISSION: - COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_EMISSION + face]); - return; - case STATE_SHININESS: - value[0] = mat->Attrib[MAT_ATTRIB_FRONT_SHININESS + face][0]; - value[1] = 0.0F; - value[2] = 0.0F; - value[3] = 1.0F; - return; - default: - _mesa_problem(ctx, "Invalid material state in fetch_state"); - return; - } - } - case STATE_LIGHT: - { - /* state[1] is the light number */ - const GLuint ln = (GLuint) state[1]; - /* state[2] is the light attribute */ - switch (state[2]) { - case STATE_AMBIENT: - COPY_4V(value, ctx->Light.Light[ln].Ambient); - return; - case STATE_DIFFUSE: - COPY_4V(value, ctx->Light.Light[ln].Diffuse); - return; - case STATE_SPECULAR: - COPY_4V(value, ctx->Light.Light[ln].Specular); - return; - case STATE_POSITION: - COPY_4V(value, ctx->Light.Light[ln].EyePosition); - return; - case STATE_ATTENUATION: - value[0] = ctx->Light.Light[ln].ConstantAttenuation; - value[1] = ctx->Light.Light[ln].LinearAttenuation; - value[2] = ctx->Light.Light[ln].QuadraticAttenuation; - value[3] = ctx->Light.Light[ln].SpotExponent; - return; - case STATE_SPOT_DIRECTION: - COPY_3V(value, ctx->Light.Light[ln].EyeDirection); - value[3] = ctx->Light.Light[ln]._CosCutoff; - return; - case STATE_SPOT_CUTOFF: - value[0] = ctx->Light.Light[ln].SpotCutoff; - return; - case STATE_HALF_VECTOR: - { - static const GLfloat eye_z[] = {0, 0, 1}; - GLfloat p[3]; - /* Compute infinite half angle vector: - * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) - * light.EyePosition.w should be 0 for infinite lights. - */ - COPY_3V(p, ctx->Light.Light[ln].EyePosition); - NORMALIZE_3FV(p); - ADD_3V(value, p, eye_z); - NORMALIZE_3FV(value); - value[3] = 1.0; - } - return; - default: - _mesa_problem(ctx, "Invalid light state in fetch_state"); - return; - } - } - case STATE_LIGHTMODEL_AMBIENT: - COPY_4V(value, ctx->Light.Model.Ambient); - return; - case STATE_LIGHTMODEL_SCENECOLOR: - if (state[1] == 0) { - /* front */ - GLint i; - for (i = 0; i < 3; i++) { - value[i] = ctx->Light.Model.Ambient[i] - * ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i] - + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i]; - } - value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; - } - else { - /* back */ - GLint i; - for (i = 0; i < 3; i++) { - value[i] = ctx->Light.Model.Ambient[i] - * ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i] - + ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i]; - } - value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; - } - return; - case STATE_LIGHTPROD: - { - const GLuint ln = (GLuint) state[1]; - const GLuint face = (GLuint) state[2]; - GLint i; - ASSERT(face == 0 || face == 1); - switch (state[3]) { - case STATE_AMBIENT: - for (i = 0; i < 3; i++) { - value[i] = ctx->Light.Light[ln].Ambient[i] * - ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][i]; - } - /* [3] = material alpha */ - value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][3]; - return; - case STATE_DIFFUSE: - for (i = 0; i < 3; i++) { - value[i] = ctx->Light.Light[ln].Diffuse[i] * - ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][i]; - } - /* [3] = material alpha */ - value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3]; - return; - case STATE_SPECULAR: - for (i = 0; i < 3; i++) { - value[i] = ctx->Light.Light[ln].Specular[i] * - ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][i]; - } - /* [3] = material alpha */ - value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3]; - return; - default: - _mesa_problem(ctx, "Invalid lightprod state in fetch_state"); - return; - } - } - case STATE_TEXGEN: - { - /* state[1] is the texture unit */ - const GLuint unit = (GLuint) state[1]; - /* state[2] is the texgen attribute */ - switch (state[2]) { - case STATE_TEXGEN_EYE_S: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneS); - return; - case STATE_TEXGEN_EYE_T: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneT); - return; - case STATE_TEXGEN_EYE_R: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneR); - return; - case STATE_TEXGEN_EYE_Q: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneQ); - return; - case STATE_TEXGEN_OBJECT_S: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneS); - return; - case STATE_TEXGEN_OBJECT_T: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneT); - return; - case STATE_TEXGEN_OBJECT_R: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneR); - return; - case STATE_TEXGEN_OBJECT_Q: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneQ); - return; - default: - _mesa_problem(ctx, "Invalid texgen state in fetch_state"); - return; - } - } - case STATE_TEXENV_COLOR: - { - /* state[1] is the texture unit */ - const GLuint unit = (GLuint) state[1]; - COPY_4V(value, ctx->Texture.Unit[unit].EnvColor); - } - return; - case STATE_FOG_COLOR: - COPY_4V(value, ctx->Fog.Color); - return; - case STATE_FOG_PARAMS: - value[0] = ctx->Fog.Density; - value[1] = ctx->Fog.Start; - value[2] = ctx->Fog.End; - value[3] = (ctx->Fog.End == ctx->Fog.Start) - ? 1.0f : (GLfloat)(1.0 / (ctx->Fog.End - ctx->Fog.Start)); - return; - case STATE_CLIPPLANE: - { - const GLuint plane = (GLuint) state[1]; - COPY_4V(value, ctx->Transform.EyeUserPlane[plane]); - } - return; - case STATE_POINT_SIZE: - value[0] = ctx->Point.Size; - value[1] = ctx->Point.MinSize; - value[2] = ctx->Point.MaxSize; - value[3] = ctx->Point.Threshold; - return; - case STATE_POINT_ATTENUATION: - value[0] = ctx->Point.Params[0]; - value[1] = ctx->Point.Params[1]; - value[2] = ctx->Point.Params[2]; - value[3] = 1.0F; - return; - case STATE_MODELVIEW_MATRIX: - case STATE_PROJECTION_MATRIX: - case STATE_MVP_MATRIX: - case STATE_TEXTURE_MATRIX: - case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: - { - /* state[0] = modelview, projection, texture, etc. */ - /* state[1] = which texture matrix or program matrix */ - /* state[2] = first row to fetch */ - /* state[3] = last row to fetch */ - /* state[4] = transpose, inverse or invtrans */ - const GLmatrix *matrix; - const gl_state_index mat = state[0]; - const GLuint index = (GLuint) state[1]; - const GLuint firstRow = (GLuint) state[2]; - const GLuint lastRow = (GLuint) state[3]; - const gl_state_index modifier = state[4]; - const GLfloat *m; - GLuint row, i; - ASSERT(firstRow >= 0); - ASSERT(firstRow < 4); - ASSERT(lastRow >= 0); - ASSERT(lastRow < 4); - if (mat == STATE_MODELVIEW_MATRIX) { - matrix = ctx->ModelviewMatrixStack.Top; - } - else if (mat == STATE_PROJECTION_MATRIX) { - matrix = ctx->ProjectionMatrixStack.Top; - } - else if (mat == STATE_MVP_MATRIX) { - matrix = &ctx->_ModelProjectMatrix; - } - else if (mat == STATE_TEXTURE_MATRIX) { - matrix = ctx->TextureMatrixStack[index].Top; - } - else if (mat == STATE_PROGRAM_MATRIX) { - matrix = ctx->ProgramMatrixStack[index].Top; - } - else if (mat == STATE_COLOR_MATRIX) { - matrix = ctx->ColorMatrixStack.Top; - } - else { - _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()"); - return; - } - if (modifier == STATE_MATRIX_INVERSE || - modifier == STATE_MATRIX_INVTRANS) { - /* Be sure inverse is up to date: - */ - _math_matrix_alloc_inv( (GLmatrix *) matrix ); - _math_matrix_analyse( (GLmatrix*) matrix ); - m = matrix->inv; - } - else { - m = matrix->m; - } - if (modifier == STATE_MATRIX_TRANSPOSE || - modifier == STATE_MATRIX_INVTRANS) { - for (i = 0, row = firstRow; row <= lastRow; row++) { - value[i++] = m[row * 4 + 0]; - value[i++] = m[row * 4 + 1]; - value[i++] = m[row * 4 + 2]; - value[i++] = m[row * 4 + 3]; - } - } - else { - for (i = 0, row = firstRow; row <= lastRow; row++) { - value[i++] = m[row + 0]; - value[i++] = m[row + 4]; - value[i++] = m[row + 8]; - value[i++] = m[row + 12]; - } - } - } - return; - case STATE_DEPTH_RANGE: - value[0] = ctx->Viewport.Near; /* near */ - value[1] = ctx->Viewport.Far; /* far */ - value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */ - value[3] = 1.0; - return; - case STATE_FRAGMENT_PROGRAM: - { - /* state[1] = {STATE_ENV, STATE_LOCAL} */ - /* state[2] = parameter index */ - const int idx = (int) state[2]; - switch (state[1]) { - case STATE_ENV: - COPY_4V(value, ctx->FragmentProgram.Parameters[idx]); - break; - case STATE_LOCAL: - COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]); - break; - default: - _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); - return; - } - } - return; - - case STATE_VERTEX_PROGRAM: - { - /* state[1] = {STATE_ENV, STATE_LOCAL} */ - /* state[2] = parameter index */ - const int idx = (int) state[2]; - switch (state[1]) { - case STATE_ENV: - COPY_4V(value, ctx->VertexProgram.Parameters[idx]); - break; - case STATE_LOCAL: - COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]); - break; - default: - _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); - return; - } - } - return; - - case STATE_NORMAL_SCALE: - ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1); - return; - - case STATE_INTERNAL: - switch (state[1]) { - case STATE_NORMAL_SCALE: - ASSIGN_4V(value, - ctx->_ModelViewInvScale, - ctx->_ModelViewInvScale, - ctx->_ModelViewInvScale, - 1); - return; - case STATE_TEXRECT_SCALE: - { - const int unit = (int) state[2]; - const struct gl_texture_object *texObj - = ctx->Texture.Unit[unit]._Current; - if (texObj) { - struct gl_texture_image *texImage = texObj->Image[0][0]; - ASSIGN_4V(value, (GLfloat) (1.0 / texImage->Width), - (GLfloat)(1.0 / texImage->Height), - 0.0f, 1.0f); - } - } - return; - case STATE_FOG_PARAMS_OPTIMIZED: - /* for simpler per-vertex/pixel fog calcs. POW (for EXP/EXP2 fog) - * might be more expensive than EX2 on some hw, plus it needs - * another constant (e) anyway. Linear fog can now be done with a - * single MAD. - * linear: fogcoord * -1/(end-start) + end/(end-start) - * exp: 2^-(density/ln(2) * fogcoord) - * exp2: 2^-((density/(ln(2)^2) * fogcoord)^2) - */ - value[0] = (ctx->Fog.End == ctx->Fog.Start) - ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start)); - value[1] = ctx->Fog.End * -value[0]; - value[2] = (GLfloat)(ctx->Fog.Density * ONE_DIV_LN2); - value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2); - return; - - case STATE_LIGHT_SPOT_DIR_NORMALIZED: { - /* here, state[2] is the light number */ - /* pre-normalize spot dir */ - const GLuint ln = (GLuint) state[2]; - COPY_3V(value, ctx->Light.Light[ln]._NormDirection); - value[3] = ctx->Light.Light[ln]._CosCutoff; - return; - } - - case STATE_LIGHT_POSITION: { - const GLuint ln = (GLuint) state[2]; - COPY_4V(value, ctx->Light.Light[ln]._Position); - return; - } - - case STATE_LIGHT_POSITION_NORMALIZED: { - const GLuint ln = (GLuint) state[2]; - COPY_4V(value, ctx->Light.Light[ln]._Position); - NORMALIZE_3FV( value ); - return; - } - - case STATE_LIGHT_HALF_VECTOR: { - const GLuint ln = (GLuint) state[2]; - GLfloat p[3]; - /* Compute infinite half angle vector: - * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) - * light.EyePosition.w should be 0 for infinite lights. - */ - COPY_3V(p, ctx->Light.Light[ln]._Position); - NORMALIZE_3FV(p); - ADD_3V(value, p, ctx->_EyeZDir); - NORMALIZE_3FV(value); - value[3] = 1.0; - return; - } - - - case STATE_PT_SCALE: - value[0] = ctx->Pixel.RedScale; - value[1] = ctx->Pixel.GreenScale; - value[2] = ctx->Pixel.BlueScale; - value[3] = ctx->Pixel.AlphaScale; - break; - case STATE_PT_BIAS: - value[0] = ctx->Pixel.RedBias; - value[1] = ctx->Pixel.GreenBias; - value[2] = ctx->Pixel.BlueBias; - value[3] = ctx->Pixel.AlphaBias; - break; - case STATE_PCM_SCALE: - COPY_4V(value, ctx->Pixel.PostColorMatrixScale); - break; - case STATE_PCM_BIAS: - COPY_4V(value, ctx->Pixel.PostColorMatrixBias); - break; - case STATE_SHADOW_AMBIENT: - { - const int unit = (int) state[2]; - const struct gl_texture_object *texObj - = ctx->Texture.Unit[unit]._Current; - if (texObj) { - value[0] = texObj->ShadowAmbient; - value[1] = texObj->ShadowAmbient; - value[2] = texObj->ShadowAmbient; - value[3] = texObj->ShadowAmbient; - } - } - return; - - default: - /* unknown state indexes are silently ignored - * should be handled by the driver. - */ - return; - } - return; - - default: - _mesa_problem(ctx, "Invalid state in _mesa_fetch_state"); - return; - } -} - - -/** - * Return a bitmask of the Mesa state flags (_NEW_* values) which would - * indicate that the given context state may have changed. - * The bitmask is used during validation to determine if we need to update - * vertex/fragment program parameters (like "state.material.color") when - * some GL state has changed. - */ -GLbitfield -_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) -{ - switch (state[0]) { - case STATE_MATERIAL: - case STATE_LIGHT: - case STATE_LIGHTMODEL_AMBIENT: - case STATE_LIGHTMODEL_SCENECOLOR: - case STATE_LIGHTPROD: - return _NEW_LIGHT; - - case STATE_TEXGEN: - case STATE_TEXENV_COLOR: - return _NEW_TEXTURE; - - case STATE_FOG_COLOR: - case STATE_FOG_PARAMS: - return _NEW_FOG; - - case STATE_CLIPPLANE: - return _NEW_TRANSFORM; - - case STATE_POINT_SIZE: - case STATE_POINT_ATTENUATION: - return _NEW_POINT; - - case STATE_MODELVIEW_MATRIX: - return _NEW_MODELVIEW; - case STATE_PROJECTION_MATRIX: - return _NEW_PROJECTION; - case STATE_MVP_MATRIX: - return _NEW_MODELVIEW | _NEW_PROJECTION; - case STATE_TEXTURE_MATRIX: - return _NEW_TEXTURE_MATRIX; - case STATE_PROGRAM_MATRIX: - return _NEW_TRACK_MATRIX; - case STATE_COLOR_MATRIX: - return _NEW_COLOR_MATRIX; - - case STATE_DEPTH_RANGE: - return _NEW_VIEWPORT; - - case STATE_FRAGMENT_PROGRAM: - case STATE_VERTEX_PROGRAM: - return _NEW_PROGRAM; - - case STATE_NORMAL_SCALE: - return _NEW_MODELVIEW; - - case STATE_INTERNAL: - switch (state[1]) { - case STATE_TEXRECT_SCALE: - case STATE_SHADOW_AMBIENT: - return _NEW_TEXTURE; - case STATE_FOG_PARAMS_OPTIMIZED: - return _NEW_FOG; - default: - /* unknown state indexes are silently ignored and - * no flag set, since it is handled by the driver. - */ - return 0; - } - - default: - _mesa_problem(NULL, "unexpected state[0] in make_state_flags()"); - return 0; - } -} - - -static void -append(char *dst, const char *src) -{ - while (*dst) - dst++; - while (*src) - *dst++ = *src++; - *dst = 0; -} - - -/** - * Convert token 'k' to a string, append it onto 'dst' string. - */ -static void -append_token(char *dst, gl_state_index k) -{ - switch (k) { - case STATE_MATERIAL: - append(dst, "material"); - break; - case STATE_LIGHT: - append(dst, "light"); - break; - case STATE_LIGHTMODEL_AMBIENT: - append(dst, "lightmodel.ambient"); - break; - case STATE_LIGHTMODEL_SCENECOLOR: - break; - case STATE_LIGHTPROD: - append(dst, "lightprod"); - break; - case STATE_TEXGEN: - append(dst, "texgen"); - break; - case STATE_FOG_COLOR: - append(dst, "fog.color"); - break; - case STATE_FOG_PARAMS: - append(dst, "fog.params"); - break; - case STATE_CLIPPLANE: - append(dst, "clip"); - break; - case STATE_POINT_SIZE: - append(dst, "point.size"); - break; - case STATE_POINT_ATTENUATION: - append(dst, "point.attenuation"); - break; - case STATE_MODELVIEW_MATRIX: - append(dst, "matrix.modelview"); - break; - case STATE_PROJECTION_MATRIX: - append(dst, "matrix.projection"); - break; - case STATE_MVP_MATRIX: - append(dst, "matrix.mvp"); - break; - case STATE_TEXTURE_MATRIX: - append(dst, "matrix.texture"); - break; - case STATE_PROGRAM_MATRIX: - append(dst, "matrix.program"); - break; - case STATE_COLOR_MATRIX: - append(dst, "matrix.color"); - break; - case STATE_MATRIX_INVERSE: - append(dst, ".inverse"); - break; - case STATE_MATRIX_TRANSPOSE: - append(dst, ".transpose"); - break; - case STATE_MATRIX_INVTRANS: - append(dst, ".invtrans"); - break; - case STATE_AMBIENT: - append(dst, ".ambient"); - break; - case STATE_DIFFUSE: - append(dst, ".diffuse"); - break; - case STATE_SPECULAR: - append(dst, ".specular"); - break; - case STATE_EMISSION: - append(dst, ".emission"); - break; - case STATE_SHININESS: - append(dst, "lshininess"); - break; - case STATE_HALF_VECTOR: - append(dst, ".half"); - break; - case STATE_POSITION: - append(dst, ".position"); - break; - case STATE_ATTENUATION: - append(dst, ".attenuation"); - break; - case STATE_SPOT_DIRECTION: - append(dst, ".spot.direction"); - break; - case STATE_SPOT_CUTOFF: - append(dst, ".spot.cutoff"); - break; - case STATE_TEXGEN_EYE_S: - append(dst, "eye.s"); - break; - case STATE_TEXGEN_EYE_T: - append(dst, "eye.t"); - break; - case STATE_TEXGEN_EYE_R: - append(dst, "eye.r"); - break; - case STATE_TEXGEN_EYE_Q: - append(dst, "eye.q"); - break; - case STATE_TEXGEN_OBJECT_S: - append(dst, "object.s"); - break; - case STATE_TEXGEN_OBJECT_T: - append(dst, "object.t"); - break; - case STATE_TEXGEN_OBJECT_R: - append(dst, "object.r"); - break; - case STATE_TEXGEN_OBJECT_Q: - append(dst, "object.q"); - break; - case STATE_TEXENV_COLOR: - append(dst, "texenv"); - break; - case STATE_DEPTH_RANGE: - append(dst, "depth.range"); - break; - case STATE_VERTEX_PROGRAM: - case STATE_FRAGMENT_PROGRAM: - break; - case STATE_ENV: - append(dst, "env"); - break; - case STATE_LOCAL: - append(dst, "local"); - break; - /* BEGIN internal state vars */ - case STATE_INTERNAL: - append(dst, "(internal)"); - break; - case STATE_NORMAL_SCALE: - append(dst, "normalScale"); - break; - case STATE_TEXRECT_SCALE: - append(dst, "texrectScale"); - break; - case STATE_FOG_PARAMS_OPTIMIZED: - append(dst, "fogParamsOptimized"); - break; - case STATE_LIGHT_SPOT_DIR_NORMALIZED: - append(dst, "lightSpotDirNormalized"); - break; - case STATE_LIGHT_POSITION: - append(dst, "lightPosition"); - break; - case STATE_LIGHT_POSITION_NORMALIZED: - append(dst, "light.position.normalized"); - break; - case STATE_LIGHT_HALF_VECTOR: - append(dst, "lightHalfVector"); - break; - case STATE_PT_SCALE: - append(dst, "PTscale"); - break; - case STATE_PT_BIAS: - append(dst, "PTbias"); - break; - case STATE_PCM_SCALE: - append(dst, "PCMscale"); - break; - case STATE_PCM_BIAS: - append(dst, "PCMbias"); - break; - case STATE_SHADOW_AMBIENT: - append(dst, "ShadowAmbient"); - break; - default: - /* probably STATE_INTERNAL_DRIVER+i (driver private state) */ - append(dst, "driverState"); - } -} - -static void -append_face(char *dst, GLint face) -{ - if (face == 0) - append(dst, "front."); - else - append(dst, "back."); -} - -static void -append_index(char *dst, GLint index) -{ - char s[20]; - _mesa_sprintf(s, "[%d]", index); - append(dst, s); -} - -/** - * Make a string from the given state vector. - * For example, return "state.matrix.texture[2].inverse". - * Use _mesa_free() to deallocate the string. - */ -const char * -_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) -{ - char str[1000] = ""; - char tmp[30]; - - append(str, "state."); - append_token(str, state[0]); - - switch (state[0]) { - case STATE_MATERIAL: - append_face(str, state[1]); - append_token(str, state[2]); - break; - case STATE_LIGHT: - append_index(str, state[1]); /* light number [i]. */ - append_token(str, state[2]); /* coefficients */ - break; - case STATE_LIGHTMODEL_AMBIENT: - append(str, "lightmodel.ambient"); - break; - case STATE_LIGHTMODEL_SCENECOLOR: - if (state[1] == 0) { - append(str, "lightmodel.front.scenecolor"); - } - else { - append(str, "lightmodel.back.scenecolor"); - } - break; - case STATE_LIGHTPROD: - append_index(str, state[1]); /* light number [i]. */ - append_face(str, state[2]); - append_token(str, state[3]); - break; - case STATE_TEXGEN: - append_index(str, state[1]); /* tex unit [i] */ - append_token(str, state[2]); /* plane coef */ - break; - case STATE_TEXENV_COLOR: - append_index(str, state[1]); /* tex unit [i] */ - append(str, "color"); - break; - case STATE_CLIPPLANE: - append_index(str, state[1]); /* plane [i] */ - append(str, ".plane"); - break; - case STATE_MODELVIEW_MATRIX: - case STATE_PROJECTION_MATRIX: - case STATE_MVP_MATRIX: - case STATE_TEXTURE_MATRIX: - case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: - { - /* state[0] = modelview, projection, texture, etc. */ - /* state[1] = which texture matrix or program matrix */ - /* state[2] = first row to fetch */ - /* state[3] = last row to fetch */ - /* state[4] = transpose, inverse or invtrans */ - const gl_state_index mat = state[0]; - const GLuint index = (GLuint) state[1]; - const GLuint firstRow = (GLuint) state[2]; - const GLuint lastRow = (GLuint) state[3]; - const gl_state_index modifier = state[4]; - if (index || - mat == STATE_TEXTURE_MATRIX || - mat == STATE_PROGRAM_MATRIX) - append_index(str, index); - if (modifier) - append_token(str, modifier); - if (firstRow == lastRow) - _mesa_sprintf(tmp, ".row[%d]", firstRow); - else - _mesa_sprintf(tmp, ".row[%d..%d]", firstRow, lastRow); - append(str, tmp); - } - break; - case STATE_POINT_SIZE: - break; - case STATE_POINT_ATTENUATION: - break; - case STATE_FOG_PARAMS: - break; - case STATE_FOG_COLOR: - break; - case STATE_DEPTH_RANGE: - break; - case STATE_FRAGMENT_PROGRAM: - case STATE_VERTEX_PROGRAM: - /* state[1] = {STATE_ENV, STATE_LOCAL} */ - /* state[2] = parameter index */ - append_token(str, state[1]); - append_index(str, state[2]); - break; - case STATE_INTERNAL: - append_token(str, state[1]); - break; - default: - _mesa_problem(NULL, "Invalid state in _mesa_program_state_string"); - break; - } - - return _mesa_strdup(str); -} - - -/** - * Loop over all the parameters in a parameter list. If the parameter - * is a GL state reference, look up the current value of that state - * variable and put it into the parameter's Value[4] array. - * This would be called at glBegin time when using a fragment program. - */ -void -_mesa_load_state_parameters(GLcontext *ctx, - struct gl_program_parameter_list *paramList) -{ - GLuint i; - - if (!paramList) - return; - - /*assert(ctx->Driver.NeedFlush == 0);*/ - - for (i = 0; i < paramList->NumParameters; i++) { - if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) { - _mesa_fetch_state(ctx, - (gl_state_index *) paramList->Parameters[i].StateIndexes, - paramList->ParameterValues[i]); - } - } -} - - -/** - * Copy the 16 elements of a matrix into four consecutive program - * registers starting at 'pos'. - */ -static void -load_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16]) -{ - GLuint i; - for (i = 0; i < 4; i++) { - registers[pos + i][0] = mat[0 + i]; - registers[pos + i][1] = mat[4 + i]; - registers[pos + i][2] = mat[8 + i]; - registers[pos + i][3] = mat[12 + i]; - } -} - - -/** - * As above, but transpose the matrix. - */ -static void -load_transpose_matrix(GLfloat registers[][4], GLuint pos, - const GLfloat mat[16]) -{ - MEMCPY(registers[pos], mat, 16 * sizeof(GLfloat)); -} - - -/** - * Load current vertex program's parameter registers with tracked - * matrices (if NV program). This only needs to be done per - * glBegin/glEnd, not per-vertex. - */ -void -_mesa_load_tracked_matrices(GLcontext *ctx) -{ - GLuint i; - - for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) { - /* point 'mat' at source matrix */ - GLmatrix *mat; - if (ctx->VertexProgram.TrackMatrix[i] == GL_MODELVIEW) { - mat = ctx->ModelviewMatrixStack.Top; - } - else if (ctx->VertexProgram.TrackMatrix[i] == GL_PROJECTION) { - mat = ctx->ProjectionMatrixStack.Top; - } - else if (ctx->VertexProgram.TrackMatrix[i] == GL_TEXTURE) { - mat = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top; - } - else if (ctx->VertexProgram.TrackMatrix[i] == GL_COLOR) { - mat = ctx->ColorMatrixStack.Top; - } - else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) { - /* XXX verify the combined matrix is up to date */ - mat = &ctx->_ModelProjectMatrix; - } - else if (ctx->VertexProgram.TrackMatrix[i] >= GL_MATRIX0_NV && - ctx->VertexProgram.TrackMatrix[i] <= GL_MATRIX7_NV) { - GLuint n = ctx->VertexProgram.TrackMatrix[i] - GL_MATRIX0_NV; - ASSERT(n < MAX_PROGRAM_MATRICES); - mat = ctx->ProgramMatrixStack[n].Top; - } - else { - /* no matrix is tracked, but we leave the register values as-is */ - assert(ctx->VertexProgram.TrackMatrix[i] == GL_NONE); - continue; - } - - /* load the matrix values into sequential registers */ - if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) { - load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m); - } - else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_INVERSE_NV) { - _math_matrix_analyse(mat); /* update the inverse */ - ASSERT(!_math_matrix_is_dirty(mat)); - load_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv); - } - else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_TRANSPOSE_NV) { - load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->m); - } - else { - assert(ctx->VertexProgram.TrackMatrixTransform[i] - == GL_INVERSE_TRANSPOSE_NV); - _math_matrix_analyse(mat); /* update the inverse */ - ASSERT(!_math_matrix_is_dirty(mat)); - load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv); - } - } -} diff --git a/src/libs/mesa/mesa/shader/prog_statevars.h b/src/libs/mesa/mesa/shader/prog_statevars.h deleted file mode 100644 index 909bce0a4f..0000000000 --- a/src/libs/mesa/mesa/shader/prog_statevars.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 PROG_STATEVARS_H -#define PROG_STATEVARS_H - -#include "main/mtypes.h" - - -/** - * Number of STATE_* values we need to address any GL state. - * Used to dimension arrays. - */ -#define STATE_LENGTH 5 - - -/** - * Used for describing GL state referenced from inside ARB vertex and - * fragment programs. - * A string such as "state.light[0].ambient" gets translated into a - * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ]. - * - * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should - * always be the array index. - */ -typedef enum gl_state_index_ { - STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */ - - STATE_LIGHT, - STATE_LIGHTMODEL_AMBIENT, - STATE_LIGHTMODEL_SCENECOLOR, - STATE_LIGHTPROD, - - STATE_TEXGEN, - - STATE_FOG_COLOR, - STATE_FOG_PARAMS, - - STATE_CLIPPLANE, - - STATE_POINT_SIZE, - STATE_POINT_ATTENUATION, - - STATE_MODELVIEW_MATRIX, - STATE_PROJECTION_MATRIX, - STATE_MVP_MATRIX, - STATE_TEXTURE_MATRIX, - STATE_PROGRAM_MATRIX, - STATE_COLOR_MATRIX, - STATE_MATRIX_INVERSE, - STATE_MATRIX_TRANSPOSE, - STATE_MATRIX_INVTRANS, - - STATE_AMBIENT, - STATE_DIFFUSE, - STATE_SPECULAR, - STATE_EMISSION, - STATE_SHININESS, - STATE_HALF_VECTOR, - - STATE_POSITION, /**< xyzw = position */ - STATE_ATTENUATION, /**< xyz = attenuation, w = spot exponent */ - STATE_SPOT_DIRECTION, /**< xyz = direction, w = cos(cutoff) */ - STATE_SPOT_CUTOFF, /**< x = cutoff, yzw = undefined */ - - STATE_TEXGEN_EYE_S, - STATE_TEXGEN_EYE_T, - STATE_TEXGEN_EYE_R, - STATE_TEXGEN_EYE_Q, - STATE_TEXGEN_OBJECT_S, - STATE_TEXGEN_OBJECT_T, - STATE_TEXGEN_OBJECT_R, - STATE_TEXGEN_OBJECT_Q, - - STATE_TEXENV_COLOR, - - STATE_DEPTH_RANGE, - - STATE_VERTEX_PROGRAM, - STATE_FRAGMENT_PROGRAM, - - STATE_ENV, - STATE_LOCAL, - - STATE_INTERNAL, /* Mesa additions */ - STATE_NORMAL_SCALE, - STATE_TEXRECT_SCALE, - STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */ - STATE_LIGHT_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */ - STATE_LIGHT_POSITION, /* object vs eye space */ - STATE_LIGHT_POSITION_NORMALIZED, /* object vs eye space */ - STATE_LIGHT_HALF_VECTOR, /* object vs eye space */ - STATE_PT_SCALE, /**< Pixel transfer RGBA scale */ - STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ - STATE_PCM_SCALE, /**< Post color matrix RGBA scale */ - STATE_PCM_BIAS, /**< Post color matrix RGBA bias */ - STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */ - STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ -} gl_state_index; - - - -extern void -_mesa_load_state_parameters(GLcontext *ctx, - struct gl_program_parameter_list *paramList); - - -extern GLbitfield -_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]); - - -extern const char * -_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]); - - -extern void -_mesa_load_tracked_matrices(GLcontext *ctx); - - -#endif /* PROG_STATEVARS_H */ diff --git a/src/libs/mesa/mesa/shader/prog_uniform.c b/src/libs/mesa/mesa/shader/prog_uniform.c deleted file mode 100644 index dc76be8e46..0000000000 --- a/src/libs/mesa/mesa/shader/prog_uniform.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_uniform.c - * Shader uniform functions. - * \author Brian Paul - */ - -#include "main/imports.h" -#include "main/mtypes.h" -#include "prog_uniform.h" - - -struct gl_uniform_list * -_mesa_new_uniform_list(void) -{ - return CALLOC_STRUCT(gl_uniform_list); -} - - -void -_mesa_free_uniform_list(struct gl_uniform_list *list) -{ - GLuint i; - for (i = 0; i < list->NumUniforms; i++) { - _mesa_free((void *) list->Uniforms[i].Name); - } - _mesa_free(list->Uniforms); - _mesa_free(list); -} - - -struct gl_uniform * -_mesa_append_uniform(struct gl_uniform_list *list, - const char *name, GLenum target, GLuint progPos) -{ - const GLuint oldNum = list->NumUniforms; - struct gl_uniform *uniform; - GLint index; - - assert(target == GL_VERTEX_PROGRAM_ARB || - target == GL_FRAGMENT_PROGRAM_ARB); - - index = _mesa_lookup_uniform(list, name); - if (index < 0) { - /* not found - append to list */ - - if (oldNum + 1 > list->Size) { - /* Need to grow the list array (alloc some extra) */ - list->Size += 4; - - /* realloc arrays */ - list->Uniforms = (struct gl_uniform *) - _mesa_realloc(list->Uniforms, - oldNum * sizeof(struct gl_uniform), - list->Size * sizeof(struct gl_uniform)); - } - - if (!list->Uniforms) { - /* out of memory */ - list->NumUniforms = 0; - list->Size = 0; - return GL_FALSE; - } - - uniform = list->Uniforms + oldNum; - - uniform->Name = _mesa_strdup(name); - uniform->VertPos = -1; - uniform->FragPos = -1; - uniform->Initialized = GL_FALSE; - - list->NumUniforms++; - } - else { - /* found */ - uniform = list->Uniforms + index; - } - - /* update position for the vertex or fragment program */ - if (target == GL_VERTEX_PROGRAM_ARB) { - if (uniform->VertPos != -1) { - /* this uniform is already in the list - that shouldn't happen */ - return GL_FALSE; - } - uniform->VertPos = progPos; - } - else { - if (uniform->FragPos != -1) { - /* this uniform is already in the list - that shouldn't happen */ - return GL_FALSE; - } - uniform->FragPos = progPos; - } - - return uniform; -} - - -/** - * Return the location/index of the named uniform in the uniform list, - * or -1 if not found. - */ -GLint -_mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name) -{ - GLuint i; - for (i = 0; list && i < list->NumUniforms; i++) { - if (!_mesa_strcmp(list->Uniforms[i].Name, name)) { - return i; - } - } - return -1; -} - - -GLint -_mesa_longest_uniform_name(const struct gl_uniform_list *list) -{ - GLint max = 0; - GLuint i; - for (i = 0; list && i < list->NumUniforms; i++) { - GLuint len = _mesa_strlen(list->Uniforms[i].Name); - if (len > (GLuint)max) - max = len; - } - return max; -} - - -void -_mesa_print_uniforms(const struct gl_uniform_list *list) -{ - GLuint i; - printf("Uniform list %p:\n", (void *) list); - for (i = 0; i < list->NumUniforms; i++) { - printf("%d: %s %d %d\n", - i, - list->Uniforms[i].Name, - list->Uniforms[i].VertPos, - list->Uniforms[i].FragPos); - } -} diff --git a/src/libs/mesa/mesa/shader/prog_uniform.h b/src/libs/mesa/mesa/shader/prog_uniform.h deleted file mode 100644 index 22a2bfd970..0000000000 --- a/src/libs/mesa/mesa/shader/prog_uniform.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file prog_uniform.c - * Shader uniform functions. - * \author Brian Paul - */ - -#ifndef PROG_UNIFORM_H -#define PROG_UNIFORM_H - -#include "main/mtypes.h" -#include "prog_statevars.h" - - -/** - * Shader program uniform variable. - * The glGetUniformLocation() and glUniform() commands will use this - * information. - * Note that a uniform such as "binormal" might be used in both the - * vertex shader and the fragment shader. When glUniform() is called to - * set the uniform's value, it must be updated in both the vertex and - * fragment shaders. The uniform may be in different locations in the - * two shaders so we keep track of that here. - */ -struct gl_uniform -{ - const char *Name; /**< Null-terminated string */ - GLint VertPos; - GLint FragPos; - GLboolean Initialized; /**< For debug. Has this uniform been set? */ -#if 0 - GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ - GLuint Size; /**< Number of components (1..4) */ -#endif -}; - - -/** - * List of gl_uniforms - */ -struct gl_uniform_list -{ - GLuint Size; /**< allocated size of Uniforms array */ - GLuint NumUniforms; /**< number of uniforms in the array */ - struct gl_uniform *Uniforms; /**< Array [Size] */ -}; - - -extern struct gl_uniform_list * -_mesa_new_uniform_list(void); - -extern void -_mesa_free_uniform_list(struct gl_uniform_list *list); - -extern struct gl_uniform * -_mesa_append_uniform(struct gl_uniform_list *list, - const char *name, GLenum target, GLuint progPos); - -extern GLint -_mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name); - -extern GLint -_mesa_longest_uniform_name(const struct gl_uniform_list *list); - -extern void -_mesa_print_uniforms(const struct gl_uniform_list *list); - - -#endif /* PROG_UNIFORM_H */ diff --git a/src/libs/mesa/mesa/shader/program.c b/src/libs/mesa/mesa/shader/program.c deleted file mode 100644 index aa6c6c4951..0000000000 --- a/src/libs/mesa/mesa/shader/program.c +++ /dev/null @@ -1,792 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file program.c - * Vertex and fragment program support functions. - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "program.h" -#include "prog_cache.h" -#include "prog_parameter.h" -#include "prog_instruction.h" - - -/** - * A pointer to this dummy program is put into the hash table when - * glGenPrograms is called. - */ -struct gl_program _mesa_DummyProgram; - - -/** - * Init context's vertex/fragment program state - */ -void -_mesa_init_program(GLcontext *ctx) -{ - GLuint i; - - /* - * If this assertion fails, we need to increase the field - * size for register indexes. - */ - ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4 - <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4 - <= (1 << INST_INDEX_BITS)); - - ctx->Program.ErrorPos = -1; - ctx->Program.ErrorString = _mesa_strdup(""); - -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - ctx->VertexProgram.Enabled = GL_FALSE; -#if FEATURE_es2_glsl - ctx->VertexProgram.PointSizeEnabled = GL_TRUE; -#else - ctx->VertexProgram.PointSizeEnabled = GL_FALSE; -#endif - ctx->VertexProgram.TwoSideEnabled = GL_FALSE; - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, - ctx->Shared->DefaultVertexProgram); - assert(ctx->VertexProgram.Current); - for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) { - ctx->VertexProgram.TrackMatrix[i] = GL_NONE; - ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV; - } - ctx->VertexProgram.Cache = _mesa_new_program_cache(); -#endif - -#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program - ctx->FragmentProgram.Enabled = GL_FALSE; - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, - ctx->Shared->DefaultFragmentProgram); - assert(ctx->FragmentProgram.Current); - ctx->FragmentProgram.Cache = _mesa_new_program_cache(); -#endif - - - /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader - ctx->ATIFragmentShader.Enabled = GL_FALSE; - ctx->ATIFragmentShader.Current = ctx->Shared->DefaultFragmentShader; - assert(ctx->ATIFragmentShader.Current); - ctx->ATIFragmentShader.Current->RefCount++; -#endif -} - - -/** - * Free a context's vertex/fragment program state - */ -void -_mesa_free_program_data(GLcontext *ctx) -{ -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL); - _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache); -#endif -#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL); - _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache); -#endif - /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader - if (ctx->ATIFragmentShader.Current) { - ctx->ATIFragmentShader.Current->RefCount--; - if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); - } - } -#endif - _mesa_free((void *) ctx->Program.ErrorString); -} - - -/** - * Update the default program objects in the given context to reference those - * specified in the shared state and release those referencing the old - * shared state. - */ -void -_mesa_update_default_objects_program(GLcontext *ctx) -{ -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, - (struct gl_vertex_program *) - ctx->Shared->DefaultVertexProgram); - assert(ctx->VertexProgram.Current); -#endif - -#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, - (struct gl_fragment_program *) - ctx->Shared->DefaultFragmentProgram); - assert(ctx->FragmentProgram.Current); -#endif - - /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader - if (ctx->ATIFragmentShader.Current) { - ctx->ATIFragmentShader.Current->RefCount--; - if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); - } - } - ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader; - assert(ctx->ATIFragmentShader.Current); - ctx->ATIFragmentShader.Current->RefCount++; -#endif -} - - -/** - * Set the vertex/fragment program error state (position and error string). - * This is generally called from within the parsers. - */ -void -_mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string) -{ - ctx->Program.ErrorPos = pos; - _mesa_free((void *) ctx->Program.ErrorString); - if (!string) - string = ""; - ctx->Program.ErrorString = _mesa_strdup(string); -} - - -/** - * Find the line number and column for 'pos' within 'string'. - * Return a copy of the line which contains 'pos'. Free the line with - * _mesa_free(). - * \param string the program string - * \param pos the position within the string - * \param line returns the line number corresponding to 'pos'. - * \param col returns the column number corresponding to 'pos'. - * \return copy of the line containing 'pos'. - */ -const GLubyte * -_mesa_find_line_column(const GLubyte *string, const GLubyte *pos, - GLint *line, GLint *col) -{ - const GLubyte *lineStart = string; - const GLubyte *p = string; - GLubyte *s; - int len; - - *line = 1; - - while (p != pos) { - if (*p == (GLubyte) '\n') { - (*line)++; - lineStart = p + 1; - } - p++; - } - - *col = (pos - lineStart) + 1; - - /* return copy of this line */ - while (*p != 0 && *p != '\n') - p++; - len = p - lineStart; - s = (GLubyte *) _mesa_malloc(len + 1); - _mesa_memcpy(s, lineStart, len); - s[len] = 0; - - return s; -} - - -/** - * Initialize a new vertex/fragment program object. - */ -static struct gl_program * -_mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, - GLenum target, GLuint id) -{ - (void) ctx; - if (prog) { - GLuint i; - _mesa_bzero(prog, sizeof(*prog)); - prog->Id = id; - prog->Target = target; - prog->Resident = GL_TRUE; - prog->RefCount = 1; - prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB; - - /* default mapping from samplers to texture units */ - for (i = 0; i < MAX_SAMPLERS; i++) - prog->SamplerUnits[i] = i; - } - - return prog; -} - - -/** - * Initialize a new fragment program object. - */ -struct gl_program * -_mesa_init_fragment_program( GLcontext *ctx, struct gl_fragment_program *prog, - GLenum target, GLuint id) -{ - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; -} - - -/** - * Initialize a new vertex program object. - */ -struct gl_program * -_mesa_init_vertex_program( GLcontext *ctx, struct gl_vertex_program *prog, - GLenum target, GLuint id) -{ - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; -} - - -/** - * Allocate and initialize a new fragment/vertex program object but - * don't put it into the program hash table. Called via - * ctx->Driver.NewProgram. May be overridden (ie. replaced) by a - * device driver function to implement OO deriviation with additional - * types not understood by this function. - * - * \param ctx context - * \param id program id/number - * \param target program target/type - * \return pointer to new program object - */ -struct gl_program * -_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id) -{ - struct gl_program *prog; - switch (target) { - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - case GL_VERTEX_STATE_PROGRAM_NV: - prog = _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program), - target, id ); - break; - case GL_FRAGMENT_PROGRAM_NV: - case GL_FRAGMENT_PROGRAM_ARB: - prog =_mesa_init_fragment_program(ctx, - CALLOC_STRUCT(gl_fragment_program), - target, id ); - break; - default: - _mesa_problem(ctx, "bad target in _mesa_new_program"); - prog = NULL; - } - return prog; -} - - -/** - * Delete a program and remove it from the hash table, ignoring the - * reference count. - * Called via ctx->Driver.DeleteProgram. May be wrapped (OO deriviation) - * by a device driver function. - */ -void -_mesa_delete_program(GLcontext *ctx, struct gl_program *prog) -{ - (void) ctx; - ASSERT(prog); - ASSERT(prog->RefCount==0); - - if (prog == &_mesa_DummyProgram) - return; - - if (prog->String) - _mesa_free(prog->String); - - _mesa_free_instructions(prog->Instructions, prog->NumInstructions); - - if (prog->Parameters) { - _mesa_free_parameter_list(prog->Parameters); - } - if (prog->Varying) { - _mesa_free_parameter_list(prog->Varying); - } - if (prog->Attributes) { - _mesa_free_parameter_list(prog->Attributes); - } - - /* XXX this is a little ugly */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (vprog->TnlData) - _mesa_free(vprog->TnlData); - } - - _mesa_free(prog); -} - - -/** - * Return the gl_program object for a given ID. - * Basically just a wrapper for _mesa_HashLookup() to avoid a lot of - * casts elsewhere. - */ -struct gl_program * -_mesa_lookup_program(GLcontext *ctx, GLuint id) -{ - if (id) - return (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); - else - return NULL; -} - - -/** - * Reference counting for vertex/fragment programs - */ -void -_mesa_reference_program(GLcontext *ctx, - struct gl_program **ptr, - struct gl_program *prog) -{ - assert(ptr); - if (*ptr && prog) { - /* sanity check */ - if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB) - ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB); - else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB) - ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB || - prog->Target == GL_FRAGMENT_PROGRAM_NV); - } - if (*ptr == prog) { - return; /* no change */ - } - if (*ptr) { - GLboolean deleteFlag; - - /*_glthread_LOCK_MUTEX((*ptr)->Mutex);*/ -#if 0 - printf("Program %p ID=%u Target=%s Refcount-- to %d\n", - *ptr, (*ptr)->Id, - ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB ? "VP" : "FP"), - (*ptr)->RefCount - 1); -#endif - ASSERT((*ptr)->RefCount > 0); - (*ptr)->RefCount--; - - deleteFlag = ((*ptr)->RefCount == 0); - /*_glthread_UNLOCK_MUTEX((*ptr)->Mutex);*/ - - if (deleteFlag) { - ASSERT(ctx); - ctx->Driver.DeleteProgram(ctx, *ptr); - } - - *ptr = NULL; - } - - assert(!*ptr); - if (prog) { - /*_glthread_LOCK_MUTEX(prog->Mutex);*/ - prog->RefCount++; -#if 0 - printf("Program %p ID=%u Target=%s Refcount++ to %d\n", - prog, prog->Id, - (prog->Target == GL_VERTEX_PROGRAM_ARB ? "VP" : "FP"), - prog->RefCount); -#endif - /*_glthread_UNLOCK_MUTEX(prog->Mutex);*/ - } - - *ptr = prog; -} - - -/** - * Return a copy of a program. - * XXX Problem here if the program object is actually OO-derivation - * made by a device driver. - */ -struct gl_program * -_mesa_clone_program(GLcontext *ctx, const struct gl_program *prog) -{ - struct gl_program *clone; - - clone = ctx->Driver.NewProgram(ctx, prog->Target, prog->Id); - if (!clone) - return NULL; - - assert(clone->Target == prog->Target); - assert(clone->RefCount == 1); - - clone->String = (GLubyte *) _mesa_strdup((char *) prog->String); - clone->Format = prog->Format; - clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions); - if (!clone->Instructions) { - _mesa_reference_program(ctx, &clone, NULL); - return NULL; - } - _mesa_copy_instructions(clone->Instructions, prog->Instructions, - prog->NumInstructions); - clone->InputsRead = prog->InputsRead; - clone->OutputsWritten = prog->OutputsWritten; - clone->SamplersUsed = prog->SamplersUsed; - clone->ShadowSamplers = prog->ShadowSamplers; - memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed)); - - if (prog->Parameters) - clone->Parameters = _mesa_clone_parameter_list(prog->Parameters); - memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams)); - if (prog->Varying) - clone->Varying = _mesa_clone_parameter_list(prog->Varying); - if (prog->Attributes) - clone->Attributes = _mesa_clone_parameter_list(prog->Attributes); - memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams)); - clone->NumInstructions = prog->NumInstructions; - clone->NumTemporaries = prog->NumTemporaries; - clone->NumParameters = prog->NumParameters; - clone->NumAttributes = prog->NumAttributes; - clone->NumAddressRegs = prog->NumAddressRegs; - clone->NumNativeInstructions = prog->NumNativeInstructions; - clone->NumNativeTemporaries = prog->NumNativeTemporaries; - clone->NumNativeParameters = prog->NumNativeParameters; - clone->NumNativeAttributes = prog->NumNativeAttributes; - clone->NumNativeAddressRegs = prog->NumNativeAddressRegs; - clone->NumAluInstructions = prog->NumAluInstructions; - clone->NumTexInstructions = prog->NumTexInstructions; - clone->NumTexIndirections = prog->NumTexIndirections; - clone->NumNativeAluInstructions = prog->NumNativeAluInstructions; - clone->NumNativeTexInstructions = prog->NumNativeTexInstructions; - clone->NumNativeTexIndirections = prog->NumNativeTexIndirections; - - switch (prog->Target) { - case GL_VERTEX_PROGRAM_ARB: - { - const struct gl_vertex_program *vp - = (const struct gl_vertex_program *) prog; - struct gl_vertex_program *vpc = (struct gl_vertex_program *) clone; - vpc->IsPositionInvariant = vp->IsPositionInvariant; - } - break; - case GL_FRAGMENT_PROGRAM_ARB: - { - const struct gl_fragment_program *fp - = (const struct gl_fragment_program *) prog; - struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone; - fpc->FogOption = fp->FogOption; - fpc->UsesKill = fp->UsesKill; - } - break; - default: - _mesa_problem(NULL, "Unexpected target in _mesa_clone_program"); - } - - return clone; -} - - -/** - * Insert 'count' NOP instructions at 'start' in the given program. - * Adjust branch targets accordingly. - */ -GLboolean -_mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count) -{ - const GLuint origLen = prog->NumInstructions; - const GLuint newLen = origLen + count; - struct prog_instruction *newInst; - GLuint i; - - /* adjust branches */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - if (inst->BranchTarget > 0) { - if ((GLuint)inst->BranchTarget >= start) { - inst->BranchTarget += count; - } - } - } - - /* Alloc storage for new instructions */ - newInst = _mesa_alloc_instructions(newLen); - if (!newInst) { - return GL_FALSE; - } - - /* Copy 'start' instructions into new instruction buffer */ - _mesa_copy_instructions(newInst, prog->Instructions, start); - - /* init the new instructions */ - _mesa_init_instructions(newInst + start, count); - - /* Copy the remaining/tail instructions to new inst buffer */ - _mesa_copy_instructions(newInst + start + count, - prog->Instructions + start, - origLen - start); - - /* free old instructions */ - _mesa_free_instructions(prog->Instructions, origLen); - - /* install new instructions */ - prog->Instructions = newInst; - prog->NumInstructions = newLen; - - return GL_TRUE; -} - - -/** - * Delete 'count' instructions at 'start' in the given program. - * Adjust branch targets accordingly. - */ -GLboolean -_mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count) -{ - const GLuint origLen = prog->NumInstructions; - const GLuint newLen = origLen - count; - struct prog_instruction *newInst; - GLuint i; - - /* adjust branches */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - if (inst->BranchTarget > 0) { - if (inst->BranchTarget > start) { - inst->BranchTarget -= count; - } - } - } - - /* Alloc storage for new instructions */ - newInst = _mesa_alloc_instructions(newLen); - if (!newInst) { - return GL_FALSE; - } - - /* Copy 'start' instructions into new instruction buffer */ - _mesa_copy_instructions(newInst, prog->Instructions, start); - - /* Copy the remaining/tail instructions to new inst buffer */ - _mesa_copy_instructions(newInst + start, - prog->Instructions + start + count, - newLen - start); - - /* free old instructions */ - _mesa_free_instructions(prog->Instructions, origLen); - - /* install new instructions */ - prog->Instructions = newInst; - prog->NumInstructions = newLen; - - return GL_TRUE; -} - - -/** - * Search instructions for registers that match (oldFile, oldIndex), - * replacing them with (newFile, newIndex). - */ -static void -replace_registers(struct prog_instruction *inst, GLuint numInst, - GLuint oldFile, GLuint oldIndex, - GLuint newFile, GLuint newIndex) -{ - GLuint i, j; - for (i = 0; i < numInst; i++) { - /* src regs */ - for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) { - if (inst[i].SrcReg[j].File == oldFile && - inst[i].SrcReg[j].Index == oldIndex) { - inst[i].SrcReg[j].File = newFile; - inst[i].SrcReg[j].Index = newIndex; - } - } - /* dst reg */ - if (inst[i].DstReg.File == oldFile && inst[i].DstReg.Index == oldIndex) { - inst[i].DstReg.File = newFile; - inst[i].DstReg.Index = newIndex; - } - } -} - - -/** - * Search instructions for references to program parameters. When found, - * increment the parameter index by 'offset'. - * Used when combining programs. - */ -static void -adjust_param_indexes(struct prog_instruction *inst, GLuint numInst, - GLuint offset) -{ - GLuint i, j; - for (i = 0; i < numInst; i++) { - for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) { - GLuint f = inst[i].SrcReg[j].File; - if (f == PROGRAM_CONSTANT || - f == PROGRAM_UNIFORM || - f == PROGRAM_STATE_VAR) { - inst[i].SrcReg[j].Index += offset; - } - } - } -} - - -/** - * Combine two programs into one. Fix instructions so the outputs of - * the first program go to the inputs of the second program. - */ -struct gl_program * -_mesa_combine_programs(GLcontext *ctx, - const struct gl_program *progA, - const struct gl_program *progB) -{ - struct prog_instruction *newInst; - struct gl_program *newProg; - const GLuint lenA = progA->NumInstructions - 1; /* omit END instr */ - const GLuint lenB = progB->NumInstructions; - const GLuint numParamsA = _mesa_num_parameters(progA->Parameters); - const GLuint newLength = lenA + lenB; - GLbitfield inputsB; - GLuint i; - - ASSERT(progA->Target == progB->Target); - - newInst = _mesa_alloc_instructions(newLength); - if (!newInst) - return GL_FALSE; - - _mesa_copy_instructions(newInst, progA->Instructions, lenA); - _mesa_copy_instructions(newInst + lenA, progB->Instructions, lenB); - - /* adjust branch / instruction addresses for B's instructions */ - for (i = 0; i < lenB; i++) { - newInst[lenA + i].BranchTarget += lenA; - } - - newProg = ctx->Driver.NewProgram(ctx, progA->Target, 0); - newProg->Instructions = newInst; - newProg->NumInstructions = newLength; - - if (newProg->Target == GL_FRAGMENT_PROGRAM_ARB) { - struct gl_fragment_program *fprogA, *fprogB, *newFprog; - fprogA = (struct gl_fragment_program *) progA; - fprogB = (struct gl_fragment_program *) progB; - newFprog = (struct gl_fragment_program *) newProg; - - newFprog->UsesKill = fprogA->UsesKill || fprogB->UsesKill; - - /* Connect color outputs of fprogA to color inputs of fprogB, via a - * new temporary register. - */ - if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) && - (progB->InputsRead & (1 << FRAG_ATTRIB_COL0))) { - GLint tempReg = _mesa_find_free_register(newProg, PROGRAM_TEMPORARY); - if (tempReg < 0) { - _mesa_problem(ctx, "No free temp regs found in " - "_mesa_combine_programs(), using 31"); - tempReg = 31; - } - /* replace writes to result.color[0] with tempReg */ - replace_registers(newInst, lenA, - PROGRAM_OUTPUT, FRAG_RESULT_COLR, - PROGRAM_TEMPORARY, tempReg); - /* replace reads from input.color[0] with tempReg */ - replace_registers(newInst + lenA, lenB, - PROGRAM_INPUT, FRAG_ATTRIB_COL0, - PROGRAM_TEMPORARY, tempReg); - } - - inputsB = progB->InputsRead; - if (progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) { - inputsB &= ~(1 << FRAG_ATTRIB_COL0); - } - newProg->InputsRead = progA->InputsRead | inputsB; - newProg->OutputsWritten = progB->OutputsWritten; - newProg->SamplersUsed = progA->SamplersUsed | progB->SamplersUsed; - } - else { - /* vertex program */ - assert(0); /* XXX todo */ - } - - /* - * Merge parameters (uniforms, constants, etc) - */ - newProg->Parameters = _mesa_combine_parameter_lists(progA->Parameters, - progB->Parameters); - - adjust_param_indexes(newInst + lenA, lenB, numParamsA); - - - return newProg; -} - - - - -/** - * Scan the given program to find a free register of the given type. - * \param regFile - PROGRAM_INPUT, PROGRAM_OUTPUT or PROGRAM_TEMPORARY - */ -GLint -_mesa_find_free_register(const struct gl_program *prog, GLuint regFile) -{ - GLboolean used[MAX_PROGRAM_TEMPS]; - GLuint i, k; - - assert(regFile == PROGRAM_INPUT || - regFile == PROGRAM_OUTPUT || - regFile == PROGRAM_TEMPORARY); - - _mesa_memset(used, 0, sizeof(used)); - - for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; - } - } - } - - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { - if (!used[i]) - return i; - } - - return -1; -} diff --git a/src/libs/mesa/mesa/shader/program.h b/src/libs/mesa/mesa/shader/program.h deleted file mode 100644 index 48176162c3..0000000000 --- a/src/libs/mesa/mesa/shader/program.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file program.c - * Vertex and fragment program support functions. - * \author Brian Paul - */ - - -/** - * \mainpage Mesa vertex and fragment program module - * - * This module or directory contains most of the code for vertex and - * fragment programs and shaders, including state management, parsers, - * and (some) software routines for executing programs - */ - -#ifndef PROGRAM_H -#define PROGRAM_H - -#include "main/mtypes.h" - - -extern struct gl_program _mesa_DummyProgram; - - -extern void -_mesa_init_program(GLcontext *ctx); - -extern void -_mesa_free_program_data(GLcontext *ctx); - -extern void -_mesa_update_default_objects_program(GLcontext *ctx); - -extern void -_mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string); - -extern const GLubyte * -_mesa_find_line_column(const GLubyte *string, const GLubyte *pos, - GLint *line, GLint *col); - - -extern struct gl_program * -_mesa_init_vertex_program(GLcontext *ctx, - struct gl_vertex_program *prog, - GLenum target, GLuint id); - -extern struct gl_program * -_mesa_init_fragment_program(GLcontext *ctx, - struct gl_fragment_program *prog, - GLenum target, GLuint id); - -extern struct gl_program * -_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id); - -extern void -_mesa_delete_program(GLcontext *ctx, struct gl_program *prog); - -extern struct gl_program * -_mesa_lookup_program(GLcontext *ctx, GLuint id); - -extern void -_mesa_reference_program(GLcontext *ctx, - struct gl_program **ptr, - struct gl_program *prog); - -static INLINE void -_mesa_reference_vertprog(GLcontext *ctx, - struct gl_vertex_program **ptr, - struct gl_vertex_program *prog) -{ - _mesa_reference_program(ctx, (struct gl_program **) ptr, - (struct gl_program *) prog); -} - -static INLINE void -_mesa_reference_fragprog(GLcontext *ctx, - struct gl_fragment_program **ptr, - struct gl_fragment_program *prog) -{ - _mesa_reference_program(ctx, (struct gl_program **) ptr, - (struct gl_program *) prog); -} - -extern struct gl_program * -_mesa_clone_program(GLcontext *ctx, const struct gl_program *prog); - -extern GLboolean -_mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count); - -extern GLboolean -_mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count); - -extern struct gl_program * -_mesa_combine_programs(GLcontext *ctx, - const struct gl_program *progA, - const struct gl_program *progB); - -extern GLint -_mesa_find_free_register(const struct gl_program *prog, GLuint regFile); - - - -#endif /* PROGRAM_H */ diff --git a/src/libs/mesa/mesa/shader/programopt.c b/src/libs/mesa/mesa/shader/programopt.c deleted file mode 100644 index 56f1eb832e..0000000000 --- a/src/libs/mesa/mesa/shader/programopt.c +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file programopt.c - * Vertex/Fragment program optimizations and transformations for program - * options, etc. - * - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "prog_parameter.h" -#include "prog_statevars.h" -#include "program.h" -#include "programopt.h" -#include "prog_instruction.h" - - -/** - * This function inserts instructions for coordinate modelview * projection - * into a vertex program. - * May be used to implement the position_invariant option. - */ -void -_mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) -{ - struct prog_instruction *newInst; - const GLuint origLen = vprog->Base.NumInstructions; - const GLuint newLen = origLen + 4; - GLuint i; - - /* - * Setup state references for the modelview/projection matrix. - * XXX we should check if these state vars are already declared. - */ - static const gl_state_index mvpState[4][STATE_LENGTH] = { - { STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */ - { STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */ - { STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */ - { STATE_MVP_MATRIX, 0, 3, 3, 0 }, /* state.matrix.mvp.row[3] */ - }; - GLint mvpRef[4]; - - for (i = 0; i < 4; i++) { - mvpRef[i] = _mesa_add_state_reference(vprog->Base.Parameters, - mvpState[i]); - } - - /* Alloc storage for new instructions */ - newInst = _mesa_alloc_instructions(newLen); - if (!newInst) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, - "glProgramString(inserting position_invariant code)"); - return; - } - - /* - * Generated instructions: - * newInst[0] = DP4 result.position.x, mvp.row[0], vertex.position; - * newInst[1] = DP4 result.position.y, mvp.row[1], vertex.position; - * newInst[2] = DP4 result.position.z, mvp.row[2], vertex.position; - * newInst[3] = DP4 result.position.w, mvp.row[3], vertex.position; - */ - _mesa_init_instructions(newInst, 4); - for (i = 0; i < 4; i++) { - newInst[i].Opcode = OPCODE_DP4; - newInst[i].DstReg.File = PROGRAM_OUTPUT; - newInst[i].DstReg.Index = VERT_RESULT_HPOS; - newInst[i].DstReg.WriteMask = (WRITEMASK_X << i); - newInst[i].SrcReg[0].File = PROGRAM_STATE_VAR; - newInst[i].SrcReg[0].Index = mvpRef[i]; - newInst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP; - newInst[i].SrcReg[1].File = PROGRAM_INPUT; - newInst[i].SrcReg[1].Index = VERT_ATTRIB_POS; - newInst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP; - } - - /* Append original instructions after new instructions */ - _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen); - - /* free old instructions */ - _mesa_free_instructions(vprog->Base.Instructions, origLen); - - /* install new instructions */ - vprog->Base.Instructions = newInst; - vprog->Base.NumInstructions = newLen; - vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); -} - - - -/** - * Append extra instructions onto the given fragment program to implement - * the fog mode specified by fprog->FogOption. - * The fragment.fogcoord input is used to compute the fog blend factor. - * - * XXX with a little work, this function could be adapted to add fog code - * to vertex programs too. - */ -void -_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) -{ - static const gl_state_index fogPStateOpt[STATE_LENGTH] - = { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 }; - static const gl_state_index fogColorState[STATE_LENGTH] - = { STATE_FOG_COLOR, 0, 0, 0, 0}; - struct prog_instruction *newInst, *inst; - const GLuint origLen = fprog->Base.NumInstructions; - const GLuint newLen = origLen + 5; - GLuint i; - GLint fogPRefOpt, fogColorRef; /* state references */ - GLuint colorTemp, fogFactorTemp; /* temporary registerss */ - - if (fprog->FogOption == GL_NONE) { - _mesa_problem(ctx, "_mesa_append_fog_code() called for fragment program" - " with FogOption == GL_NONE"); - return; - } - - /* Alloc storage for new instructions */ - newInst = _mesa_alloc_instructions(newLen); - if (!newInst) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, - "glProgramString(inserting fog_option code)"); - return; - } - - /* Copy orig instructions into new instruction buffer */ - _mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen); - - /* PARAM fogParamsRefOpt = internal optimized fog params; */ - fogPRefOpt - = _mesa_add_state_reference(fprog->Base.Parameters, fogPStateOpt); - /* PARAM fogColorRef = state.fog.color; */ - fogColorRef - = _mesa_add_state_reference(fprog->Base.Parameters, fogColorState); - - /* TEMP colorTemp; */ - colorTemp = fprog->Base.NumTemporaries++; - /* TEMP fogFactorTemp; */ - fogFactorTemp = fprog->Base.NumTemporaries++; - - /* Scan program to find where result.color is written */ - inst = newInst; - for (i = 0; i < fprog->Base.NumInstructions; i++) { - if (inst->Opcode == OPCODE_END) - break; - if (inst->DstReg.File == PROGRAM_OUTPUT && - inst->DstReg.Index == FRAG_RESULT_COLR) { - /* change the instruction to write to colorTemp w/ clamping */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = colorTemp; - inst->SaturateMode = SATURATE_ZERO_ONE; - /* don't break (may be several writes to result.color) */ - } - inst++; - } - assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */ - - _mesa_init_instructions(inst, 5); - - /* emit instructions to compute fog blending factor */ - if (fprog->FogOption == GL_LINEAR) { - /* MAD fogFactorTemp.x, fragment.fogcoord.x, fogPRefOpt.x, fogPRefOpt.y; */ - inst->Opcode = OPCODE_MAD; - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = fogFactorTemp; - inst->DstReg.WriteMask = WRITEMASK_X; - inst->SrcReg[0].File = PROGRAM_INPUT; - inst->SrcReg[0].Index = FRAG_ATTRIB_FOGC; - inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; - inst->SrcReg[1].File = PROGRAM_STATE_VAR; - inst->SrcReg[1].Index = fogPRefOpt; - inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; - inst->SrcReg[2].File = PROGRAM_STATE_VAR; - inst->SrcReg[2].Index = fogPRefOpt; - inst->SrcReg[2].Swizzle = SWIZZLE_YYYY; - inst->SaturateMode = SATURATE_ZERO_ONE; - inst++; - } - else { - ASSERT(fprog->FogOption == GL_EXP || fprog->FogOption == GL_EXP2); - /* fogPRefOpt.z = d/ln(2), fogPRefOpt.w = d/sqrt(ln(2) */ - /* EXP: MUL fogFactorTemp.x, fogPRefOpt.z, fragment.fogcoord.x; */ - /* EXP2: MUL fogFactorTemp.x, fogPRefOpt.w, fragment.fogcoord.x; */ - inst->Opcode = OPCODE_MUL; - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = fogFactorTemp; - inst->DstReg.WriteMask = WRITEMASK_X; - inst->SrcReg[0].File = PROGRAM_STATE_VAR; - inst->SrcReg[0].Index = fogPRefOpt; - inst->SrcReg[0].Swizzle - = (fprog->FogOption == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW; - inst->SrcReg[1].File = PROGRAM_INPUT; - inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC; - inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; - inst++; - if (fprog->FogOption == GL_EXP2) { - /* MUL fogFactorTemp.x, fogFactorTemp.x, fogFactorTemp.x; */ - inst->Opcode = OPCODE_MUL; - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = fogFactorTemp; - inst->DstReg.WriteMask = WRITEMASK_X; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = fogFactorTemp; - inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; - inst->SrcReg[1].File = PROGRAM_TEMPORARY; - inst->SrcReg[1].Index = fogFactorTemp; - inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; - inst++; - } - /* EX2_SAT fogFactorTemp.x, -fogFactorTemp.x; */ - inst->Opcode = OPCODE_EX2; - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = fogFactorTemp; - inst->DstReg.WriteMask = WRITEMASK_X; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = fogFactorTemp; - inst->SrcReg[0].NegateBase = NEGATE_XYZW; - inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; - inst->SaturateMode = SATURATE_ZERO_ONE; - inst++; - } - /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */ - inst->Opcode = OPCODE_LRP; - inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; - inst->DstReg.WriteMask = WRITEMASK_XYZ; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = fogFactorTemp; - inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; - inst->SrcReg[1].File = PROGRAM_TEMPORARY; - inst->SrcReg[1].Index = colorTemp; - inst->SrcReg[1].Swizzle = SWIZZLE_NOOP; - inst->SrcReg[2].File = PROGRAM_STATE_VAR; - inst->SrcReg[2].Index = fogColorRef; - inst->SrcReg[2].Swizzle = SWIZZLE_NOOP; - inst++; - /* MOV result.color.w, colorTemp.x; # copy alpha */ - inst->Opcode = OPCODE_MOV; - inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; - inst->DstReg.WriteMask = WRITEMASK_W; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = colorTemp; - inst->SrcReg[0].Swizzle = SWIZZLE_NOOP; - inst++; - /* END; */ - inst->Opcode = OPCODE_END; - inst++; - - /* free old instructions */ - _mesa_free_instructions(fprog->Base.Instructions, origLen); - - /* install new instructions */ - fprog->Base.Instructions = newInst; - fprog->Base.NumInstructions = inst - newInst; - fprog->Base.InputsRead |= FRAG_BIT_FOGC; - /* XXX do this? fprog->FogOption = GL_NONE; */ -} - - - -static GLboolean -is_texture_instruction(const struct prog_instruction *inst) -{ - switch (inst->Opcode) { - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXD: - case OPCODE_TXL: - case OPCODE_TXP: - case OPCODE_TXP_NV: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Count the number of texure indirections in the given program. - * The program's NumTexIndirections field will be updated. - * See the GL_ARB_fragment_program spec (issue 24) for details. - * XXX we count texture indirections in texenvprogram.c (maybe use this code - * instead and elsewhere). - */ -void -_mesa_count_texture_indirections(struct gl_program *prog) -{ - GLuint indirections = 1; - GLbitfield tempsOutput = 0x0; - GLbitfield aluTemps = 0x0; - GLuint i; - - for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - - if (is_texture_instruction(inst)) { - if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) && - (tempsOutput & (1 << inst->SrcReg[0].Index))) || - ((inst->Opcode != OPCODE_KIL) && - (inst->DstReg.File == PROGRAM_TEMPORARY) && - (aluTemps & (1 << inst->DstReg.Index)))) - { - indirections++; - tempsOutput = 0x0; - aluTemps = 0x0; - } - } - else { - GLuint j; - for (j = 0; j < 3; j++) { - if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) - aluTemps |= (1 << inst->SrcReg[j].Index); - } - if (inst->DstReg.File == PROGRAM_TEMPORARY) - aluTemps |= (1 << inst->DstReg.Index); - } - - if ((inst->Opcode != OPCODE_KIL) && (inst->DstReg.File == PROGRAM_TEMPORARY)) - tempsOutput |= (1 << inst->DstReg.Index); - } - - prog->NumTexIndirections = indirections; -} - - -/** - * Count number of texture instructions in given program and update the - * program's NumTexInstructions field. - */ -void -_mesa_count_texture_instructions(struct gl_program *prog) -{ - GLuint i; - prog->NumTexInstructions = 0; - for (i = 0; i < prog->NumInstructions; i++) { - prog->NumTexInstructions += is_texture_instruction(prog->Instructions + i); - } -} - - -/** - * Scan/rewrite program to remove reads of custom (output) registers. - * The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING - * (for vertex shaders). - * In GLSL shaders, varying vars can be read and written. - * On some hardware, trying to read an output register causes trouble. - * So, rewrite the program to use a temporary register in this case. - */ -void -_mesa_remove_output_reads(struct gl_program *prog, enum register_file type) -{ - GLuint i; - GLint outputMap[VERT_RESULT_MAX]; - GLuint numVaryingReads = 0; - - assert(type == PROGRAM_VARYING || type == PROGRAM_OUTPUT); - assert(prog->Target == GL_VERTEX_PROGRAM_ARB || type != PROGRAM_VARYING); - - for (i = 0; i < VERT_RESULT_MAX; i++) - outputMap[i] = -1; - - /* look for instructions which read from varying vars */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->SrcReg[j].File == type) { - /* replace the read with a temp reg */ - const GLuint var = inst->SrcReg[j].Index; - if (outputMap[var] == -1) { - numVaryingReads++; - outputMap[var] = _mesa_find_free_register(prog, - PROGRAM_TEMPORARY); - } - inst->SrcReg[j].File = PROGRAM_TEMPORARY; - inst->SrcReg[j].Index = outputMap[var]; - } - } - } - - if (numVaryingReads == 0) - return; /* nothing to be done */ - - /* look for instructions which write to the varying vars identified above */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->DstReg.File == type && - outputMap[inst->DstReg.Index] >= 0) { - /* change inst to write to the temp reg, instead of the varying */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = outputMap[inst->DstReg.Index]; - } - } - } - - /* insert new instructions to copy the temp vars to the varying vars */ - { - struct prog_instruction *inst; - GLint endPos, var; - - /* Look for END instruction and insert the new varying writes */ - endPos = -1; - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - if (inst->Opcode == OPCODE_END) { - endPos = i; - _mesa_insert_instructions(prog, i, numVaryingReads); - break; - } - } - - assert(endPos >= 0); - - /* insert new MOV instructions here */ - inst = prog->Instructions + endPos; - for (var = 0; var < VERT_RESULT_MAX; var++) { - if (outputMap[var] >= 0) { - /* MOV VAR[var], TEMP[tmp]; */ - inst->Opcode = OPCODE_MOV; - inst->DstReg.File = type; - inst->DstReg.Index = var; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = outputMap[var]; - inst++; - } - } - } -} diff --git a/src/libs/mesa/mesa/shader/programopt.h b/src/libs/mesa/mesa/shader/programopt.h deleted file mode 100644 index 11572e64f5..0000000000 --- a/src/libs/mesa/mesa/shader/programopt.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 PROGRAMOPT_H -#define PROGRAMOPT_H 1 - - -extern void -_mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog); - -extern void -_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog); - -extern void -_mesa_count_texture_indirections(struct gl_program *prog); - -extern void -_mesa_count_texture_instructions(struct gl_program *prog); - -extern void -_mesa_remove_output_reads(struct gl_program *prog, enum register_file type); - -#endif /* PROGRAMOPT_H */ diff --git a/src/libs/mesa/mesa/shader/shader_api.c b/src/libs/mesa/mesa/shader/shader_api.c deleted file mode 100644 index 28b668d4c3..0000000000 --- a/src/libs/mesa/mesa/shader/shader_api.c +++ /dev/null @@ -1,1942 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.5 - * - * Copyright (C) 2004-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -/** - * \file shader_api.c - * Implementation of GLSL-related API functions - * \author Brian Paul - */ - -/** - * XXX things to do: - * 1. Check that the right error code is generated for all _mesa_error() calls. - * 2. Insert FLUSH_VERTICES calls in various places - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/macros.h" -#include "shader/program.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" -#include "shader/prog_uniform.h" -#include "shader/shader_api.h" -#include "shader/slang/slang_compile.h" -#include "shader/slang/slang_link.h" -#include "glapi/dispatch.h" - - -#ifndef GL_PROGRAM_BINARY_LENGTH_OES -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#endif - - -/** - * Allocate a new gl_shader_program object, initialize it. - */ -static struct gl_shader_program * -_mesa_new_shader_program(GLcontext *ctx, GLuint name) -{ - struct gl_shader_program *shProg; - shProg = CALLOC_STRUCT(gl_shader_program); - if (shProg) { - shProg->Type = GL_SHADER_PROGRAM_MESA; - shProg->Name = name; - shProg->RefCount = 1; - shProg->Attributes = _mesa_new_parameter_list(); - } - return shProg; -} - - -/** - * Clear (free) the shader program state that gets produced by linking. - */ -void -_mesa_clear_shader_program_data(GLcontext *ctx, - struct gl_shader_program *shProg) -{ - _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL); - _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL); - - if (shProg->Uniforms) { - _mesa_free_uniform_list(shProg->Uniforms); - shProg->Uniforms = NULL; - } - - if (shProg->Varying) { - _mesa_free_parameter_list(shProg->Varying); - shProg->Varying = NULL; - } -} - - -/** - * Free all the data that hangs off a shader program object, but not the - * object itself. - */ -void -_mesa_free_shader_program_data(GLcontext *ctx, - struct gl_shader_program *shProg) -{ - GLuint i; - - assert(shProg->Type == GL_SHADER_PROGRAM_MESA); - - _mesa_clear_shader_program_data(ctx, shProg); - - if (shProg->Attributes) { - _mesa_free_parameter_list(shProg->Attributes); - shProg->Attributes = NULL; - } - - /* detach shaders */ - for (i = 0; i < shProg->NumShaders; i++) { - _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); - } - shProg->NumShaders = 0; - - if (shProg->Shaders) { - _mesa_free(shProg->Shaders); - shProg->Shaders = NULL; - } - - if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); - shProg->InfoLog = NULL; - } -} - - -/** - * Free/delete a shader program object. - */ -void -_mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) -{ - _mesa_free_shader_program_data(ctx, shProg); - - _mesa_free(shProg); -} - - -/** - * Set ptr to point to shProg. - * If ptr is pointing to another object, decrement its refcount (and delete - * if refcount hits zero). - * Then set ptr to point to shProg, incrementing its refcount. - */ -/* XXX this could be static */ -void -_mesa_reference_shader_program(GLcontext *ctx, - struct gl_shader_program **ptr, - struct gl_shader_program *shProg) -{ - assert(ptr); - if (*ptr == shProg) { - /* no-op */ - return; - } - if (*ptr) { - /* Unreference the old shader program */ - GLboolean deleteFlag = GL_FALSE; - struct gl_shader_program *old = *ptr; - - ASSERT(old->RefCount > 0); - old->RefCount--; -#if 0 - printf("ShaderProgram %p ID=%u RefCount-- to %d\n", - (void *) old, old->Name, old->RefCount); -#endif - deleteFlag = (old->RefCount == 0); - - if (deleteFlag) { - _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); - _mesa_free_shader_program(ctx, old); - } - - *ptr = NULL; - } - assert(!*ptr); - - if (shProg) { - shProg->RefCount++; -#if 0 - printf("ShaderProgram %p ID=%u RefCount++ to %d\n", - (void *) shProg, shProg->Name, shProg->RefCount); -#endif - *ptr = shProg; - } -} - - -/** - * Lookup a GLSL program object. - */ -struct gl_shader_program * -_mesa_lookup_shader_program(GLcontext *ctx, GLuint name) -{ - struct gl_shader_program *shProg; - if (name) { - shProg = (struct gl_shader_program *) - _mesa_HashLookup(ctx->Shared->ShaderObjects, name); - /* Note that both gl_shader and gl_shader_program objects are kept - * in the same hash table. Check the object's type to be sure it's - * what we're expecting. - */ - if (shProg && shProg->Type != GL_SHADER_PROGRAM_MESA) { - return NULL; - } - return shProg; - } - return NULL; -} - - -/** - * As above, but record an error if program is not found. - */ -static struct gl_shader_program * -_mesa_lookup_shader_program_err(GLcontext *ctx, GLuint name, - const char *caller) -{ - if (!name) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); - return NULL; - } - else { - struct gl_shader_program *shProg = (struct gl_shader_program *) - _mesa_HashLookup(ctx->Shared->ShaderObjects, name); - if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); - return NULL; - } - if (shProg->Type != GL_SHADER_PROGRAM_MESA) { - _mesa_error(ctx, GL_INVALID_OPERATION, caller); - return NULL; - } - return shProg; - } -} - - - - -/** - * Allocate a new gl_shader object, initialize it. - */ -struct gl_shader * -_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type) -{ - struct gl_shader *shader; - assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER); - shader = CALLOC_STRUCT(gl_shader); - if (shader) { - shader->Type = type; - shader->Name = name; - shader->RefCount = 1; - } - return shader; -} - - -void -_mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) -{ - if (sh->Source) - _mesa_free((void *) sh->Source); - if (sh->InfoLog) - _mesa_free(sh->InfoLog); - _mesa_reference_program(ctx, &sh->Program, NULL); - _mesa_free(sh); -} - - -/** - * Set ptr to point to sh. - * If ptr is pointing to another shader, decrement its refcount (and delete - * if refcount hits zero). - * Then set ptr to point to sh, incrementing its refcount. - */ -/* XXX this could be static */ -void -_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, - struct gl_shader *sh) -{ - assert(ptr); - if (*ptr == sh) { - /* no-op */ - return; - } - if (*ptr) { - /* Unreference the old shader */ - GLboolean deleteFlag = GL_FALSE; - struct gl_shader *old = *ptr; - - ASSERT(old->RefCount > 0); - old->RefCount--; - /*printf("SHADER DECR %p (%d) to %d\n", - (void*) old, old->Name, old->RefCount);*/ - deleteFlag = (old->RefCount == 0); - - if (deleteFlag) { - _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); - _mesa_free_shader(ctx, old); - } - - *ptr = NULL; - } - assert(!*ptr); - - if (sh) { - /* reference new */ - sh->RefCount++; - /*printf("SHADER INCR %p (%d) to %d\n", - (void*) sh, sh->Name, sh->RefCount);*/ - *ptr = sh; - } -} - - -/** - * Lookup a GLSL shader object. - */ -struct gl_shader * -_mesa_lookup_shader(GLcontext *ctx, GLuint name) -{ - if (name) { - struct gl_shader *sh = (struct gl_shader *) - _mesa_HashLookup(ctx->Shared->ShaderObjects, name); - /* Note that both gl_shader and gl_shader_program objects are kept - * in the same hash table. Check the object's type to be sure it's - * what we're expecting. - */ - if (sh && sh->Type == GL_SHADER_PROGRAM_MESA) { - return NULL; - } - return sh; - } - return NULL; -} - - -/** - * As above, but record an error if shader is not found. - */ -static struct gl_shader * -_mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller) -{ - if (!name) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); - return NULL; - } - else { - struct gl_shader *sh = (struct gl_shader *) - _mesa_HashLookup(ctx->Shared->ShaderObjects, name); - if (!sh) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); - return NULL; - } - if (sh->Type == GL_SHADER_PROGRAM_MESA) { - _mesa_error(ctx, GL_INVALID_OPERATION, caller); - return NULL; - } - return sh; - } -} - - - -/** - * Initialize context's shader state. - */ -void -_mesa_init_shader_state(GLcontext * ctx) -{ - /* Device drivers may override these to control what kind of instructions - * are generated by the GLSL compiler. - */ - ctx->Shader.EmitHighLevelInstructions = GL_TRUE; - ctx->Shader.EmitCondCodes = GL_TRUE; /* XXX probably want GL_FALSE... */ - ctx->Shader.EmitComments = GL_FALSE; -} - - -/** - * Free the per-context shader-related state. - */ -void -_mesa_free_shader_state(GLcontext *ctx) -{ - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, NULL); -} - - -/** - * Copy string from to , up to maxLength characters, returning - * length of in . - * \param src the strings source - * \param maxLength max chars to copy - * \param length returns number of chars copied - * \param dst the string destination - */ -static void -copy_string(GLchar *dst, GLsizei maxLength, GLsizei *length, const GLchar *src) -{ - GLsizei len; - for (len = 0; len < maxLength - 1 && src && src[len]; len++) - dst[len] = src[len]; - if (maxLength > 0) - dst[len] = 0; - if (length) - *length = len; -} - - -static GLboolean -_mesa_is_program(GLcontext *ctx, GLuint name) -{ - struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, name); - return shProg ? GL_TRUE : GL_FALSE; -} - - -static GLboolean -_mesa_is_shader(GLcontext *ctx, GLuint name) -{ - struct gl_shader *shader = _mesa_lookup_shader(ctx, name); - return shader ? GL_TRUE : GL_FALSE; -} - - -/** - * Called via ctx->Driver.AttachShader() - */ -static void -_mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader) -{ - struct gl_shader_program *shProg; - struct gl_shader *sh; - GLuint i, n; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glAttachShader"); - if (!shProg) - return; - - sh = _mesa_lookup_shader_err(ctx, shader, "glAttachShader"); - if (!sh) { - return; - } - - n = shProg->NumShaders; - for (i = 0; i < n; i++) { - if (shProg->Shaders[i] == sh) { - /* The shader is already attched to this program. The - * GL_ARB_shader_objects spec says: - * - * "The error INVALID_OPERATION is generated by AttachObjectARB - * if is already attached to ." - */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader"); - return; - } - } - - /* grow list */ - shProg->Shaders = (struct gl_shader **) - _mesa_realloc(shProg->Shaders, - n * sizeof(struct gl_shader *), - (n + 1) * sizeof(struct gl_shader *)); - if (!shProg->Shaders) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader"); - return; - } - - /* append */ - shProg->Shaders[n] = NULL; /* since realloc() didn't zero the new space */ - _mesa_reference_shader(ctx, &shProg->Shaders[n], sh); - shProg->NumShaders++; -} - - -static GLint -_mesa_get_attrib_location(GLcontext *ctx, GLuint program, - const GLchar *name) -{ - struct gl_shader_program *shProg - = _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation"); - - if (!shProg) { - return -1; - } - - if (!shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetAttribLocation(program not linked)"); - return -1; - } - - if (!name) - return -1; - - if (shProg->VertexProgram) { - const struct gl_program_parameter_list *attribs = - shProg->VertexProgram->Base.Attributes; - if (attribs) { - GLint i = _mesa_lookup_parameter_index(attribs, -1, name); - if (i >= 0) { - return attribs->Parameters[i].StateIndexes[0]; - } - } - } - return -1; -} - - -static void -_mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index, - const GLchar *name) -{ - struct gl_shader_program *shProg; - const GLint size = -1; /* unknown size */ - GLint i, oldIndex; - GLenum datatype = GL_FLOAT_VEC4; - - shProg = _mesa_lookup_shader_program_err(ctx, program, - "glBindAttribLocation"); - if (!shProg) { - return; - } - - if (!name) - return; - - if (strncmp(name, "gl_", 3) == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindAttribLocation(illegal name)"); - return; - } - - if (index >= ctx->Const.VertexProgram.MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)"); - return; - } - - if (shProg->LinkStatus) { - /* get current index/location for the attribute */ - oldIndex = _mesa_get_attrib_location(ctx, program, name); - } - else { - oldIndex = -1; - } - - /* this will replace the current value if it's already in the list */ - i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index); - if (i < 0) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation"); - return; - } - - /* - * Note that this attribute binding won't go into effect until - * glLinkProgram is called again. - */ -} - - -static GLuint -_mesa_create_shader(GLcontext *ctx, GLenum type) -{ - struct gl_shader *sh; - GLuint name; - - name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1); - - switch (type) { - case GL_FRAGMENT_SHADER: - case GL_VERTEX_SHADER: - sh = _mesa_new_shader(ctx, name, type); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(type)"); - return 0; - } - - _mesa_HashInsert(ctx->Shared->ShaderObjects, name, sh); - - return name; -} - - -static GLuint -_mesa_create_program(GLcontext *ctx) -{ - GLuint name; - struct gl_shader_program *shProg; - - name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1); - shProg = _mesa_new_shader_program(ctx, name); - - _mesa_HashInsert(ctx->Shared->ShaderObjects, name, shProg); - - assert(shProg->RefCount == 1); - - return name; -} - - -/** - * Named w/ "2" to indicate OpenGL 2.x vs GL_ARB_fragment_programs's - * DeleteProgramARB. - */ -static void -_mesa_delete_program2(GLcontext *ctx, GLuint name) -{ - /* - * NOTE: deleting shaders/programs works a bit differently than - * texture objects (and buffer objects, etc). Shader/program - * handles/IDs exist in the hash table until the object is really - * deleted (refcount==0). With texture objects, the handle/ID is - * removed from the hash table in glDeleteTextures() while the tex - * object itself might linger until its refcount goes to zero. - */ - struct gl_shader_program *shProg; - - shProg = _mesa_lookup_shader_program_err(ctx, name, "glDeleteProgram"); - if (!shProg) - return; - - shProg->DeletePending = GL_TRUE; - - /* effectively, decr shProg's refcount */ - _mesa_reference_shader_program(ctx, &shProg, NULL); -} - - -static void -_mesa_delete_shader(GLcontext *ctx, GLuint shader) -{ - struct gl_shader *sh; - - sh = _mesa_lookup_shader_err(ctx, shader, "glDeleteShader"); - if (!sh) - return; - - sh->DeletePending = GL_TRUE; - - /* effectively, decr sh's refcount */ - _mesa_reference_shader(ctx, &sh, NULL); -} - - -static void -_mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) -{ - struct gl_shader_program *shProg; - GLuint n; - GLuint i, j; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glDetachShader"); - if (!shProg) - return; - - n = shProg->NumShaders; - - for (i = 0; i < n; i++) { - if (shProg->Shaders[i]->Name == shader) { - /* found it */ - struct gl_shader **newList; - - /* release */ - _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); - - /* alloc new, smaller array */ - newList = (struct gl_shader **) - _mesa_malloc((n - 1) * sizeof(struct gl_shader *)); - if (!newList) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader"); - return; - } - for (j = 0; j < i; j++) { - newList[j] = shProg->Shaders[j]; - } - while (++i < n) - newList[j++] = shProg->Shaders[i]; - _mesa_free(shProg->Shaders); - - shProg->Shaders = newList; - shProg->NumShaders = n - 1; - -#ifdef DEBUG - /* sanity check */ - { - for (j = 0; j < shProg->NumShaders; j++) { - assert(shProg->Shaders[j]->Type == GL_VERTEX_SHADER || - shProg->Shaders[j]->Type == GL_FRAGMENT_SHADER); - assert(shProg->Shaders[j]->RefCount > 0); - } - } -#endif - - return; - } - } - - /* not found */ - { - GLenum err; - if (_mesa_is_shader(ctx, shader)) - err = GL_INVALID_OPERATION; - else if (_mesa_is_program(ctx, shader)) - err = GL_INVALID_OPERATION; - else - err = GL_INVALID_VALUE; - _mesa_error(ctx, err, "glDetachProgram(shader)"); - return; - } -} - - -static GLint -sizeof_glsl_type(GLenum type) -{ - switch (type) { - case GL_FLOAT: - case GL_INT: - case GL_BOOL: - case GL_SAMPLER_1D: - case GL_SAMPLER_2D: - case GL_SAMPLER_3D: - case GL_SAMPLER_CUBE: - case GL_SAMPLER_1D_SHADOW: - case GL_SAMPLER_2D_SHADOW: - case GL_SAMPLER_2D_RECT_ARB: - case GL_SAMPLER_2D_RECT_SHADOW_ARB: - case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: - case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: - case GL_SAMPLER_CUBE_SHADOW_EXT: - return 1; - case GL_FLOAT_VEC2: - case GL_INT_VEC2: - case GL_BOOL_VEC2: - return 2; - case GL_FLOAT_VEC3: - case GL_INT_VEC3: - case GL_BOOL_VEC3: - return 3; - case GL_FLOAT_VEC4: - case GL_INT_VEC4: - case GL_BOOL_VEC4: - return 4; - case GL_FLOAT_MAT2: - case GL_FLOAT_MAT2x3: - case GL_FLOAT_MAT2x4: - return 8; /* two float[4] vectors */ - case GL_FLOAT_MAT3: - case GL_FLOAT_MAT3x2: - case GL_FLOAT_MAT3x4: - return 12; /* three float[4] vectors */ - case GL_FLOAT_MAT4: - case GL_FLOAT_MAT4x2: - case GL_FLOAT_MAT4x3: - return 16; /* four float[4] vectors */ - default: - _mesa_problem(NULL, "Invalid type in sizeof_glsl_type()"); - return 1; - } -} - - -static GLboolean -is_boolean_type(GLenum type) -{ - switch (type) { - case GL_BOOL: - case GL_BOOL_VEC2: - case GL_BOOL_VEC3: - case GL_BOOL_VEC4: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_integer_type(GLenum type) -{ - switch (type) { - case GL_INT: - case GL_INT_VEC2: - case GL_INT_VEC3: - case GL_INT_VEC4: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_sampler_type(GLenum type) -{ - switch (type) { - case GL_SAMPLER_1D: - case GL_SAMPLER_2D: - case GL_SAMPLER_3D: - case GL_SAMPLER_CUBE: - case GL_SAMPLER_1D_SHADOW: - case GL_SAMPLER_2D_SHADOW: - case GL_SAMPLER_2D_RECT_ARB: - case GL_SAMPLER_2D_RECT_SHADOW_ARB: - case GL_SAMPLER_1D_ARRAY_EXT: - case GL_SAMPLER_2D_ARRAY_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static void -_mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index, - GLsizei maxLength, GLsizei *length, GLint *size, - GLenum *type, GLchar *nameOut) -{ - const struct gl_program_parameter_list *attribs = NULL; - struct gl_shader_program *shProg; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib"); - if (!shProg) - return; - - if (shProg->VertexProgram) - attribs = shProg->VertexProgram->Base.Attributes; - - if (!attribs || index >= attribs->NumParameters) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)"); - return; - } - - copy_string(nameOut, maxLength, length, attribs->Parameters[index].Name); - - if (size) - *size = attribs->Parameters[index].Size - / sizeof_glsl_type(attribs->Parameters[index].DataType); - - if (type) - *type = attribs->Parameters[index].DataType; -} - - -static struct gl_program_parameter * -get_uniform_parameter(const struct gl_shader_program *shProg, GLuint index) -{ - const struct gl_program *prog; - GLint progPos; - - progPos = shProg->Uniforms->Uniforms[index].VertPos; - if (progPos >= 0) { - prog = &shProg->VertexProgram->Base; - } - else { - progPos = shProg->Uniforms->Uniforms[index].FragPos; - if (progPos >= 0) { - prog = &shProg->FragmentProgram->Base; - } - } - - if (!prog || progPos < 0) - return NULL; /* should never happen */ - - return &prog->Parameters->Parameters[progPos]; -} - - -/** - * Called via ctx->Driver.GetActiveUniform(). - */ -static void -_mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, - GLsizei maxLength, GLsizei *length, GLint *size, - GLenum *type, GLchar *nameOut) -{ - const struct gl_shader_program *shProg; - const struct gl_program *prog; - const struct gl_program_parameter *param; - GLint progPos; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform"); - if (!shProg) - return; - - if (!shProg->Uniforms || index >= shProg->Uniforms->NumUniforms) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)"); - return; - } - - progPos = shProg->Uniforms->Uniforms[index].VertPos; - if (progPos >= 0) { - prog = &shProg->VertexProgram->Base; - } - else { - progPos = shProg->Uniforms->Uniforms[index].FragPos; - if (progPos >= 0) { - prog = &shProg->FragmentProgram->Base; - } - } - - if (!prog || progPos < 0) - return; /* should never happen */ - - ASSERT(progPos < prog->Parameters->NumParameters); - param = &prog->Parameters->Parameters[progPos]; - - if (nameOut) { - copy_string(nameOut, maxLength, length, param->Name); - } - - if (size) { - GLint typeSize = sizeof_glsl_type(param->DataType); - if (param->Size > typeSize) { - /* This is an array. - * Array elements are placed on vector[4] boundaries so they're - * a multiple of four floats. We round typeSize up to next multiple - * of four to get the right size below. - */ - typeSize = (typeSize + 3) & ~3; - } - /* Note that the returned size is in units of the , not bytes */ - *size = param->Size / typeSize; - } - - if (type) { - *type = param->DataType; - } -} - - -/** - * Called via ctx->Driver.GetAttachedShaders(). - */ -static void -_mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj) -{ - struct gl_shader_program *shProg = - _mesa_lookup_shader_program_err(ctx, program, "glGetAttachedShaders"); - if (shProg) { - GLuint i; - for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) { - obj[i] = shProg->Shaders[i]->Name; - } - if (count) - *count = i; - } -} - - -static GLuint -_mesa_get_handle(GLcontext *ctx, GLenum pname) -{ - GLint handle = 0; - - if (pname == GL_PROGRAM_OBJECT_ARB) { - CALL_GetIntegerv(ctx->Exec, (GL_CURRENT_PROGRAM, &handle)); - } else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB"); - } - - return handle; -} - - -static void -_mesa_get_programiv(GLcontext *ctx, GLuint program, - GLenum pname, GLint *params) -{ - const struct gl_program_parameter_list *attribs; - struct gl_shader_program *shProg - = _mesa_lookup_shader_program(ctx, program); - - if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramiv(program)"); - return; - } - - if (shProg->VertexProgram) - attribs = shProg->VertexProgram->Base.Attributes; - else - attribs = NULL; - - switch (pname) { - case GL_DELETE_STATUS: - *params = shProg->DeletePending; - break; - case GL_LINK_STATUS: - *params = shProg->LinkStatus; - break; - case GL_VALIDATE_STATUS: - *params = shProg->Validated; - break; - case GL_INFO_LOG_LENGTH: - *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0; - break; - case GL_ATTACHED_SHADERS: - *params = shProg->NumShaders; - break; - case GL_ACTIVE_ATTRIBUTES: - *params = attribs ? attribs->NumParameters : 0; - break; - case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: - *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1; - break; - case GL_ACTIVE_UNIFORMS: - *params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0; - break; - case GL_ACTIVE_UNIFORM_MAX_LENGTH: - *params = _mesa_longest_uniform_name(shProg->Uniforms); - if (*params > 0) - (*params)++; /* add one for terminating zero */ - break; - case GL_PROGRAM_BINARY_LENGTH_OES: - *params = 0; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); - return; - } -} - - -static void -_mesa_get_shaderiv(GLcontext *ctx, GLuint name, GLenum pname, GLint *params) -{ - struct gl_shader *shader = _mesa_lookup_shader_err(ctx, name, "glGetShaderiv"); - - if (!shader) { - return; - } - - switch (pname) { - case GL_SHADER_TYPE: - *params = shader->Type; - break; - case GL_DELETE_STATUS: - *params = shader->DeletePending; - break; - case GL_COMPILE_STATUS: - *params = shader->CompileStatus; - break; - case GL_INFO_LOG_LENGTH: - *params = shader->InfoLog ? strlen(shader->InfoLog) + 1 : 0; - break; - case GL_SHADER_SOURCE_LENGTH: - *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)"); - return; - } -} - - -static void -_mesa_get_program_info_log(GLcontext *ctx, GLuint program, GLsizei bufSize, - GLsizei *length, GLchar *infoLog) -{ - struct gl_shader_program *shProg - = _mesa_lookup_shader_program(ctx, program); - if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(program)"); - return; - } - copy_string(infoLog, bufSize, length, shProg->InfoLog); -} - - -static void -_mesa_get_shader_info_log(GLcontext *ctx, GLuint shader, GLsizei bufSize, - GLsizei *length, GLchar *infoLog) -{ - struct gl_shader *sh = _mesa_lookup_shader(ctx, shader); - if (!sh) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)"); - return; - } - copy_string(infoLog, bufSize, length, sh->InfoLog); -} - - -/** - * Called via ctx->Driver.GetShaderSource(). - */ -static void -_mesa_get_shader_source(GLcontext *ctx, GLuint shader, GLsizei maxLength, - GLsizei *length, GLchar *sourceOut) -{ - struct gl_shader *sh; - sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource"); - if (!sh) { - return; - } - copy_string(sourceOut, maxLength, length, sh->Source); -} - - -static void -get_matrix_dims(GLenum type, GLint *rows, GLint *cols) -{ - switch (type) { - case GL_FLOAT_MAT2: - *rows = *cols = 2; - break; - case GL_FLOAT_MAT2x3: - *rows = 3; - *cols = 2; - break; - case GL_FLOAT_MAT2x4: - *rows = 4; - *cols = 2; - break; - case GL_FLOAT_MAT3: - *rows = 3; - *cols = 3; - break; - case GL_FLOAT_MAT3x2: - *rows = 2; - *cols = 3; - break; - case GL_FLOAT_MAT3x4: - *rows = 4; - *cols = 3; - break; - case GL_FLOAT_MAT4: - *rows = 4; - *cols = 4; - break; - case GL_FLOAT_MAT4x2: - *rows = 2; - *cols = 4; - break; - case GL_FLOAT_MAT4x3: - *rows = 3; - *cols = 4; - break; - default: - *rows = *cols = 0; - } -} - - -/** - * Determine the number of rows and columns occupied by a uniform - * according to its datatype. - */ -static void -get_uniform_rows_cols(const struct gl_program_parameter *p, - GLint *rows, GLint *cols) -{ - get_matrix_dims(p->DataType, rows, cols); - if (*rows == 0 && *cols == 0) { - /* not a matrix type, probably a float or vector */ - *rows = p->Size / 4 + 1; - if (p->Size % 4 == 0) - *cols = 4; - else - *cols = p->Size % 4; - } -} - - -/** - * Helper for get_uniform[fi]v() functions. - * Given a shader program name and uniform location, return a pointer - * to the shader program and return the program parameter position. - */ -static void -lookup_uniform_parameter(GLcontext *ctx, GLuint program, GLint location, - struct gl_program **progOut, GLint *paramPosOut) -{ - struct gl_shader_program *shProg - = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v"); - struct gl_program *prog = NULL; - GLint progPos = -1; - - /* if shProg is NULL, we'll have already recorded an error */ - - if (shProg) { - if (!shProg->Uniforms || - location < 0 || - location >= (GLint) shProg->Uniforms->NumUniforms) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)"); - } - else { - /* OK, find the gl_program and program parameter location */ - progPos = shProg->Uniforms->Uniforms[location].VertPos; - if (progPos >= 0) { - prog = &shProg->VertexProgram->Base; - } - else { - progPos = shProg->Uniforms->Uniforms[location].FragPos; - if (progPos >= 0) { - prog = &shProg->FragmentProgram->Base; - } - } - } - } - - *progOut = prog; - *paramPosOut = progPos; -} - - -/** - * Called via ctx->Driver.GetUniformfv(). - */ -static void -_mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location, - GLfloat *params) -{ - struct gl_program *prog; - GLint paramPos; - - lookup_uniform_parameter(ctx, program, location, &prog, ¶mPos); - - if (prog) { - const struct gl_program_parameter *p = - &prog->Parameters->Parameters[paramPos]; - GLint rows, cols, i, j, k; - - get_uniform_rows_cols(p, &rows, &cols); - - k = 0; - for (i = 0; i < rows; i++) { - for (j = 0; j < cols; j++ ) { - params[k++] = prog->Parameters->ParameterValues[paramPos+i][j]; - } - } - } -} - - -/** - * Called via ctx->Driver.GetUniformiv(). - * \sa _mesa_get_uniformfv, only difference is a cast. - */ -static void -_mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location, - GLint *params) -{ - struct gl_program *prog; - GLint paramPos; - - lookup_uniform_parameter(ctx, program, location, &prog, ¶mPos); - - if (prog) { - const struct gl_program_parameter *p = - &prog->Parameters->Parameters[paramPos]; - GLint rows, cols, i, j, k; - - get_uniform_rows_cols(p, &rows, &cols); - - k = 0; - for (i = 0; i < rows; i++) { - for (j = 0; j < cols; j++ ) { - params[k++] = (GLint) prog->Parameters->ParameterValues[paramPos+i][j]; - } - } - } -} - - -/** - * The value returned by GetUniformLocation actually encodes two things: - * 1. the index into the prog->Uniforms[] array for the uniform - * 2. an offset in the prog->ParameterValues[] array for specifying array - * elements or structure fields. - * This function merges those two values. - */ -static void -merge_location_offset(GLint *location, GLint offset) -{ - *location = *location | (offset << 16); -} - - -/** - * Seperate the uniform location and parameter offset. See above. - */ -static void -split_location_offset(GLint *location, GLint *offset) -{ - *offset = (*location >> 16); - *location = *location & 0xffff; -} - - -/** - * Called via ctx->Driver.GetUniformLocation(). - * - * The return value will encode two values, the uniform location and an - * offset (used for arrays, structs). - */ -static GLint -_mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) -{ - GLint offset = 0, location = -1; - - struct gl_shader_program *shProg = - _mesa_lookup_shader_program_err(ctx, program, "glGetUniformLocation"); - - if (!shProg) - return -1; - - if (shProg->LinkStatus == GL_FALSE) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)"); - return -1; - } - - /* XXX we should return -1 if the uniform was declared, but not - * actually used. - */ - - /* XXX we need to be able to parse uniform names for structs and arrays - * such as: - * mymatrix[1] - * mystruct.field1 - */ - - { - /* handle 1-dimension arrays here... */ - char *c = strchr(name, '['); - if (c) { - /* truncate name at [ */ - const GLint len = c - name; - GLchar *newName = _mesa_malloc(len + 1); - if (!newName) - return -1; /* out of mem */ - _mesa_memcpy(newName, name, len); - newName[len] = 0; - - location = _mesa_lookup_uniform(shProg->Uniforms, newName); - if (location >= 0) { - const GLint element = _mesa_atoi(c + 1); - if (element > 0) { - /* get type of the uniform array element */ - struct gl_program_parameter *p; - p = get_uniform_parameter(shProg, location); - if (p) { - GLint rows, cols; - get_matrix_dims(p->DataType, &rows, &cols); - if (rows < 1) - rows = 1; - offset = element * rows; - } - } - } - - _mesa_free(newName); - } - } - - if (location < 0) { - location = _mesa_lookup_uniform(shProg->Uniforms, name); - } - - if (location >= 0) { - merge_location_offset(&location, offset); - } - - return location; -} - - - -/** - * Called via ctx->Driver.ShaderSource() - */ -static void -_mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source) -{ - struct gl_shader *sh; - - sh = _mesa_lookup_shader_err(ctx, shader, "glShaderSource"); - if (!sh) - return; - - /* free old shader source string and install new one */ - if (sh->Source) { - _mesa_free((void *) sh->Source); - } - sh->Source = source; - sh->CompileStatus = GL_FALSE; -} - - -/** - * Called via ctx->Driver.CompileShader() - */ -static void -_mesa_compile_shader(GLcontext *ctx, GLuint shaderObj) -{ - struct gl_shader *sh; - - sh = _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader"); - if (!sh) - return; - - sh->CompileStatus = _slang_compile(ctx, sh); -} - - -/** - * Called via ctx->Driver.LinkProgram() - */ -static void -_mesa_link_program(GLcontext *ctx, GLuint program) -{ - struct gl_shader_program *shProg; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram"); - if (!shProg) - return; - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - _slang_link(ctx, program, shProg); -} - - -/** - * Called via ctx->Driver.UseProgram() - */ -void -_mesa_use_program(GLcontext *ctx, GLuint program) -{ - struct gl_shader_program *shProg; - - if (ctx->Shader.CurrentProgram && - ctx->Shader.CurrentProgram->Name == program) { - /* no-op */ - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (program) { - shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram"); - if (!shProg) { - return; - } - if (!shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glUseProgram(program %u not linked)", program); - return; - } - } - else { - shProg = NULL; - } - - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); -} - - - -/** - * Update the vertex/fragment program's TexturesUsed array. - * - * This needs to be called after glUniform(set sampler var) is called. - * A call to glUniform(samplerVar, value) causes a sampler to point to a - * particular texture unit. We know the sampler's texture target - * (1D/2D/3D/etc) from compile time but the sampler's texture unit is - * set by glUniform() calls. - * - * So, scan the program->SamplerUnits[] and program->SamplerTargets[] - * information to update the prog->TexturesUsed[] values. - * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX, - * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc. - * We'll use that info for state validation before rendering. - */ -void -_mesa_update_shader_textures_used(struct gl_program *prog) -{ - GLuint s; - - memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed)); - - for (s = 0; s < MAX_SAMPLERS; s++) { - if (prog->SamplersUsed & (1 << s)) { - GLuint u = prog->SamplerUnits[s]; - GLuint t = prog->SamplerTargets[s]; - assert(u < MAX_TEXTURE_IMAGE_UNITS); - prog->TexturesUsed[u] |= (1 << t); - } - } -} - - -/** - * Check if the type given by userType is allowed to set a uniform of the - * target type. Generally, equivalence is required, but setting Boolean - * uniforms can be done with glUniformiv or glUniformfv. - */ -static GLboolean -compatible_types(GLenum userType, GLenum targetType) -{ - if (userType == targetType) - return GL_TRUE; - - if (targetType == GL_BOOL && (userType == GL_FLOAT || userType == GL_INT)) - return GL_TRUE; - - if (targetType == GL_BOOL_VEC2 && (userType == GL_FLOAT_VEC2 || - userType == GL_INT_VEC2)) - return GL_TRUE; - - if (targetType == GL_BOOL_VEC3 && (userType == GL_FLOAT_VEC3 || - userType == GL_INT_VEC3)) - return GL_TRUE; - - if (targetType == GL_BOOL_VEC4 && (userType == GL_FLOAT_VEC4 || - userType == GL_INT_VEC4)) - return GL_TRUE; - - if (is_sampler_type(targetType) && userType == GL_INT) - return GL_TRUE; - - return GL_FALSE; -} - - -/** - * Set the value of a program's uniform variable. - * \param program the program whose uniform to update - * \param index the index of the program parameter for the uniform - * \param offset additional parameter slot offset (for arrays) - * \param type the incoming datatype of 'values' - * \param count the number of uniforms to set - * \param elems number of elements per uniform (1, 2, 3 or 4) - * \param values the new values, of datatype 'type' - */ -static void -set_program_uniform(GLcontext *ctx, struct gl_program *program, - GLint index, GLint offset, - GLenum type, GLsizei count, GLint elems, - const void *values) -{ - struct gl_program_parameter *param = - &program->Parameters->Parameters[index]; - const GLboolean isUniformBool = is_boolean_type(param->DataType); - const GLboolean areIntValues = is_integer_type(type); - - assert(offset >= 0); - assert(elems >= 1); - assert(elems <= 4); - - if (!compatible_types(type, param->DataType)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)"); - return; - } - - if (index + offset > program->Parameters->Size) { - /* out of bounds! */ - return; - } - - if (param->Type == PROGRAM_SAMPLER) { - /* This controls which texture unit which is used by a sampler */ - GLuint texUnit, sampler; - GLint i; - - /* data type for setting samplers must be int */ - if (type != GL_INT) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glUniform(only glUniform1i can be used " - "to set sampler uniforms)"); - return; - } - - /* XXX arrays of samplers haven't been tested much, but it's not a - * common thing... - */ - for (i = 0; i < count; i++) { - sampler = (GLuint) program->Parameters->ParameterValues[index + i][0]; - texUnit = ((GLuint *) values)[i]; - - /* check that the sampler (tex unit index) is legal */ - if (texUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glUniform1(invalid sampler/tex unit index)"); - return; - } - - /* This maps a sampler to a texture unit: */ - if (sampler < MAX_SAMPLERS) { - program->SamplerUnits[sampler] = texUnit; - } - } - - _mesa_update_shader_textures_used(program); - - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - } - else { - /* ordinary uniform variable */ - GLsizei k, i; - const GLint slots = (param->Size + 3) / 4; - const GLint typeSize = sizeof_glsl_type(param->DataType); - - if (param->Size > typeSize) { - /* an array */ - /* we'll ignore extra data below */ - } - else { - /* non-array: count must be one */ - if (count != 1) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glUniform(uniform is not an array)"); - return; - } - } - - /* loop over number of array elements */ - for (k = 0; k < count; k++) { - GLfloat *uniformVal; - - if (offset + k >= slots) { - /* Extra array data is ignored */ - break; - } - - /* uniformVal (the destination) is always float[4] */ - uniformVal = program->Parameters->ParameterValues[index + offset + k]; - - if (areIntValues) { - /* convert user's ints to floats */ - const GLint *iValues = ((const GLint *) values) + k * elems; - for (i = 0; i < elems; i++) { - uniformVal[i] = (GLfloat) iValues[i]; - } - } - else { - const GLfloat *fValues = ((const GLfloat *) values) + k * elems; - for (i = 0; i < elems; i++) { - uniformVal[i] = fValues[i]; - } - } - - /* if the uniform is bool-valued, convert to 1.0 or 0.0 */ - if (isUniformBool) { - for (i = 0; i < elems; i++) { - uniformVal[i] = uniformVal[i] ? 1.0 : 0.0; - } - } - } - } -} - - -/** - * Called via ctx->Driver.Uniform(). - */ -static void -_mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, - const GLvoid *values, GLenum type) -{ - struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - struct gl_uniform *uniform; - GLint elems, offset; - - if (!shProg || !shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)"); - return; - } - - if (location == -1) - return; /* The standard specifies this as a no-op */ - - if (location < -1) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)"); - return; - } - - split_location_offset(&location, &offset); - - if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { - _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location)"); - return; - } - - if (count < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(count < 0)"); - return; - } - - switch (type) { - case GL_FLOAT: - case GL_INT: - elems = 1; - break; - case GL_FLOAT_VEC2: - case GL_INT_VEC2: - elems = 2; - break; - case GL_FLOAT_VEC3: - case GL_INT_VEC3: - elems = 3; - break; - case GL_FLOAT_VEC4: - case GL_INT_VEC4: - elems = 4; - break; - default: - _mesa_problem(ctx, "Invalid type in _mesa_uniform"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - uniform = &shProg->Uniforms->Uniforms[location]; - - /* A uniform var may be used by both a vertex shader and a fragment - * shader. We may need to update one or both shader's uniform here: - */ - if (shProg->VertexProgram) { - /* convert uniform location to program parameter index */ - GLint index = uniform->VertPos; - if (index >= 0) { - set_program_uniform(ctx, &shProg->VertexProgram->Base, - index, offset, type, count, elems, values); - } - } - - if (shProg->FragmentProgram) { - /* convert uniform location to program parameter index */ - GLint index = uniform->FragPos; - if (index >= 0) { - set_program_uniform(ctx, &shProg->FragmentProgram->Base, - index, offset, type, count, elems, values); - } - } - - uniform->Initialized = GL_TRUE; -} - - -/** - * Set a matrix-valued program parameter. - */ -static void -set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, - GLuint index, GLuint offset, - GLuint count, GLuint rows, GLuint cols, - GLboolean transpose, const GLfloat *values) -{ - GLuint mat, row, col; - GLuint dst = index + offset, src = 0; - GLint nr, nc; - - /* check that the number of rows, columns is correct */ - get_matrix_dims(program->Parameters->Parameters[index].DataType, &nr, &nc); - if (rows != nr || cols != nc) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glUniformMatrix(matrix size mismatch)"); - return; - } - - if (index + offset > program->Parameters->Size) { - /* out of bounds! */ - return; - } - - /* - * Note: the _columns_ of a matrix are stored in program registers, not - * the rows. So, the loops below look a little funny. - * XXX could optimize this a bit... - */ - - /* loop over matrices */ - for (mat = 0; mat < count; mat++) { - - /* each matrix: */ - for (col = 0; col < cols; col++) { - GLfloat *v = program->Parameters->ParameterValues[dst]; - for (row = 0; row < rows; row++) { - if (transpose) { - v[row] = values[src + row * cols + col]; - } - else { - v[row] = values[src + col * rows + row]; - } - } - dst++; - } - - src += rows * cols; /* next matrix */ - } -} - - -/** - * Called by ctx->Driver.UniformMatrix(). - * Note: cols=2, rows=4 ==> array[2] of vec4 - */ -static void -_mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, - GLenum matrixType, GLint location, GLsizei count, - GLboolean transpose, const GLfloat *values) -{ - struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - struct gl_uniform *uniform; - GLint offset; - - if (!shProg || !shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glUniformMatrix(program not linked)"); - return; - } - - if (location == -1) - return; /* The standard specifies this as a no-op */ - - if (location < -1) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)"); - return; - } - - split_location_offset(&location, &offset); - - if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { - _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)"); - return; - } - if (values == NULL) { - _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - uniform = &shProg->Uniforms->Uniforms[location]; - - if (shProg->VertexProgram) { - /* convert uniform location to program parameter index */ - GLint index = uniform->VertPos; - if (index >= 0) { - set_program_uniform_matrix(ctx, &shProg->VertexProgram->Base, - index, offset, - count, rows, cols, transpose, values); - } - } - - if (shProg->FragmentProgram) { - /* convert uniform location to program parameter index */ - GLint index = uniform->FragPos; - if (index >= 0) { - set_program_uniform_matrix(ctx, &shProg->FragmentProgram->Base, - index, offset, - count, rows, cols, transpose, values); - } - } - - uniform->Initialized = GL_TRUE; -} - - -static void -_mesa_validate_program(GLcontext *ctx, GLuint program) -{ - struct gl_shader_program *shProg; - - shProg = _mesa_lookup_shader_program_err(ctx, program, "glValidateProgram"); - if (!shProg) { - return; - } - - if (!shProg->LinkStatus) { - shProg->Validated = GL_FALSE; - return; - } - - /* From the GL spec, a program is invalid if any of these are true: - - any two active samplers in the current program object are of - different types, but refer to the same texture image unit, - - any active sampler in the current program object refers to a texture - image unit where fixed-function fragment processing accesses a - texture target that does not match the sampler type, or - - the sum of the number of active samplers in the program and the - number of texture image units enabled for fixed-function fragment - processing exceeds the combined limit on the total number of texture - image units allowed. - */ - - shProg->Validated = GL_TRUE; -} - - -/** - * Plug in Mesa's GLSL functions into the device driver function table. - */ -void -_mesa_init_glsl_driver_functions(struct dd_function_table *driver) -{ - driver->AttachShader = _mesa_attach_shader; - driver->BindAttribLocation = _mesa_bind_attrib_location; - driver->CompileShader = _mesa_compile_shader; - driver->CreateProgram = _mesa_create_program; - driver->CreateShader = _mesa_create_shader; - driver->DeleteProgram2 = _mesa_delete_program2; - driver->DeleteShader = _mesa_delete_shader; - driver->DetachShader = _mesa_detach_shader; - driver->GetActiveAttrib = _mesa_get_active_attrib; - driver->GetActiveUniform = _mesa_get_active_uniform; - driver->GetAttachedShaders = _mesa_get_attached_shaders; - driver->GetAttribLocation = _mesa_get_attrib_location; - driver->GetHandle = _mesa_get_handle; - driver->GetProgramiv = _mesa_get_programiv; - driver->GetProgramInfoLog = _mesa_get_program_info_log; - driver->GetShaderiv = _mesa_get_shaderiv; - driver->GetShaderInfoLog = _mesa_get_shader_info_log; - driver->GetShaderSource = _mesa_get_shader_source; - driver->GetUniformfv = _mesa_get_uniformfv; - driver->GetUniformiv = _mesa_get_uniformiv; - driver->GetUniformLocation = _mesa_get_uniform_location; - driver->IsProgram = _mesa_is_program; - driver->IsShader = _mesa_is_shader; - driver->LinkProgram = _mesa_link_program; - driver->ShaderSource = _mesa_shader_source; - driver->Uniform = _mesa_uniform; - driver->UniformMatrix = _mesa_uniform_matrix; - driver->UseProgram = _mesa_use_program; - driver->ValidateProgram = _mesa_validate_program; -} diff --git a/src/libs/mesa/mesa/shader/shader_api.h b/src/libs/mesa/mesa/shader/shader_api.h deleted file mode 100644 index ec1996ee98..0000000000 --- a/src/libs/mesa/mesa/shader/shader_api.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2004-2006 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 SHADER_API_H -#define SHADER_API_H - - -#include "main/glheader.h" -#include "main/mtypes.h" - - -/** - * Internal functions - */ - -extern void -_mesa_init_shader_state(GLcontext * ctx); - -extern void -_mesa_free_shader_state(GLcontext *ctx); - -/* -extern struct gl_shader_program * -_mesa_new_shader_program(GLcontext *ctx, GLuint name); -*/ -extern void -_mesa_clear_shader_program_data(GLcontext *ctx, - struct gl_shader_program *shProg); - -extern void -_mesa_free_shader_program_data(GLcontext *ctx, - struct gl_shader_program *shProg); - -extern void -_mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg); - -extern void -_mesa_reference_shader_program(GLcontext *ctx, - struct gl_shader_program **ptr, - struct gl_shader_program *shProg); - -extern struct gl_shader_program * -_mesa_lookup_shader_program(GLcontext *ctx, GLuint name); - - -extern struct gl_shader * -_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); - -extern void -_mesa_free_shader(GLcontext *ctx, struct gl_shader *sh); - -extern void -_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, - struct gl_shader *sh); - -extern struct gl_shader * -_mesa_lookup_shader(GLcontext *ctx, GLuint name); - - -extern void -_mesa_update_shader_textures_used(struct gl_program *prog); - - -extern void -_mesa_use_program(GLcontext *ctx, GLuint program); - - -extern void -_mesa_init_glsl_driver_functions(struct dd_function_table *driver); - - -#endif /* SHADER_API_H */ diff --git a/src/libs/mesa/mesa/shader/slang/library/gc_to_bin.c b/src/libs/mesa/mesa/shader/slang/library/gc_to_bin.c deleted file mode 100755 index 8aef7b5412..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/gc_to_bin.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "../../grammar/grammar_crt.h" -#include "../../grammar/grammar_crt.c" -#include -#include - -static const char *slang_shader_syn = -#include "slang_shader_syn.h" -; - -static int gc_to_bin (grammar id, const char *in, const char *out) -{ - FILE *f; - byte *source, *prod; - unsigned int size, i, line = 0; - - printf ("Precompiling %s\n", in); - - f = fopen (in, "r"); - if (f == NULL) - return 1; - fseek (f, 0, SEEK_END); - size = ftell (f); - fseek (f, 0, SEEK_SET); - source = (byte *) grammar_alloc_malloc (size + 1); - source[fread (source, 1, size, f)] = '\0'; - fclose (f); - - if (!grammar_fast_check (id, source, &prod, &size, 65536)) - { - grammar_alloc_free (source); - return 1; - } - - f = fopen (out, "w"); - fprintf (f, "\n"); - fprintf (f, "/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\n"); - fprintf (f, "/* %s */\n", in); - fprintf (f, "\n"); - for (i = 0; i < size; i++) - { - unsigned int a; - if (prod[i] < 10) - a = 1; - else if (prod[i] < 100) - a = 2; - else - a = 3; - if (i < size - 1) - a++; - if (line + a >= 100) - { - fprintf (f, "\n"); - line = 0; - } - line += a; - fprintf (f, "%d", prod[i]); - if (i < size - 1) - fprintf (f, ","); - } - fprintf (f, "\n"); - fclose (f); - grammar_alloc_free (prod); - return 0; -} - -int main (int argc, char *argv[]) -{ - grammar id; - - id = grammar_load_from_text ((const byte *) slang_shader_syn); - if (id == 0) { - fprintf(stderr, "Error loading grammar from text\n"); - return 1; - } - grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1); - grammar_set_reg8 (id, (const byte *) "shader_type", atoi (argv[1])); - if (gc_to_bin (id, argv[2], argv[3])) { - fprintf(stderr, "Error in gc_to_bin %s %s\n", argv[2], argv[3]); - grammar_destroy (id); - return 1; - } - grammar_destroy (id); - return 0; -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_120_core.gc b/src/libs/mesa/mesa/shader/slang/library/slang_120_core.gc deleted file mode 100644 index 04c5ec2ec5..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_120_core.gc +++ /dev/null @@ -1,1978 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -// -// Constructors and operators introduced in GLSL 1.20 - mostly on new -// (non-square) types of matrices. -// -// One important change in the language is that when a matrix is used -// as an argument to a matrix constructor, it must be the only argument -// for the constructor. The compiler takes care of it by itself and -// here we only care to re-introduce constructors for old (square) -// types of matrices. -// - -// -// From Shader Spec, ver. 1.20, rev. 6 -// - -//// mat2x3: 2 columns of vec3 - -mat2x3 __constructor(const float f00, const float f10, const float f20, - const float f01, const float f11, const float f21) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[0].z = f20; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[1].z = f21; -} - -mat2x3 __constructor(const float f) -{ - __retVal = mat2x3( f, 0.0, 0.0, - 0.0, f, 0.0); -} - -mat2x3 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat2x3(f); -} - -mat2x3 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat2x3(f); -} - -mat2x3 __constructor(const vec3 c0, const vec3 c1) -{ - __retVal[0] = c0; - __retVal[1] = c1; -} - - - -//// mat2x4: 2 columns of vec4 - -mat2x4 __constructor(const float f00, const float f10, const float f20, const float f30, - const float f01, const float f11, const float f21, const float f31) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[0].z = f20; - __retVal[0].w = f30; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[1].z = f21; - __retVal[1].w = f31; -} - -mat2x4 __constructor(const float f) -{ - __retVal = mat2x4( f, 0.0, 0.0, 0.0, - 0.0, f, 0.0, 0.0); -} - -mat2x4 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat2x4(f); -} - -mat2x4 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat2x4(f); -} - -mat2x4 __constructor(const vec4 c0, const vec4 c1) -{ - __retVal[0] = c0; - __retVal[1] = c1; -} - - - -//// mat3x2: 3 columns of vec2 - -mat3x2 __constructor(const float f00, const float f10, - const float f01, const float f11, - const float f02, const float f12) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[2].x = f02; - __retVal[2].y = f12; -} - -mat3x2 __constructor(const float f) -{ - __retVal = mat3x2( f, 0.0, - 0.0, f, - 0.0, 0.0); -} - -mat3x2 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat3x2(f); -} - -mat3x2 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat3x2(f); -} - -mat3x2 __constructor(const vec2 c0, const vec2 c1, const vec2 c2) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; -} - - - -//// mat3x4: 3 columns of vec4 - -mat3x4 __constructor(const float f00, const float f10, const float f20, const float f30, - const float f01, const float f11, const float f21, const float f31, - const float f02, const float f12, const float f22, const float f32) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[0].z = f20; - __retVal[0].w = f30; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[1].z = f21; - __retVal[1].w = f31; - __retVal[2].x = f02; - __retVal[2].y = f12; - __retVal[2].z = f22; - __retVal[2].w = f32; -} - -mat3x4 __constructor(const float f) -{ - __retVal = mat3x4( f, 0.0, 0.0, 0.0, - 0.0, f, 0.0, 0.0, - 0.0, 0.0, f, 0.0); -} - -mat3x4 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat3x4(f); -} - -mat3x4 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat3x4(f); -} - -mat3x4 __constructor(const vec4 c0, const vec4 c1, const vec4 c2) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; -} - - - -//// mat4x2: 4 columns of vec2 - -mat4x2 __constructor(const float f00, const float f10, - const float f01, const float f11, - const float f02, const float f12, - const float f03, const float f13) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[2].x = f02; - __retVal[2].y = f12; - __retVal[3].x = f03; - __retVal[3].y = f13; -} - -mat4x2 __constructor(const float f) -{ - __retVal = mat4x2( f, 0.0, - 0.0, 4, - 0.0, 0.0, - 0.0, 0.0); -} - -mat4x2 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat4x2(f); -} - -mat4x2 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat4x2(f); -} - -mat4x2 __constructor(const vec2 c0, const vec2 c1, const vec2 c2, const vec2 c3) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; - __retVal[3] = c3; -} - - - -//// mat4x3: 4 columns of vec3 - -mat4x3 __constructor(const float f00, const float f10, const float f20, - const float f01, const float f11, const float f21, - const float f02, const float f12, const float f22, - const float f03, const float f13, const float f23) -{ - __retVal[0].x = f00; - __retVal[0].y = f10; - __retVal[0].z = f20; - __retVal[1].x = f01; - __retVal[1].y = f11; - __retVal[1].z = f21; - __retVal[2].x = f02; - __retVal[2].y = f12; - __retVal[2].z = f22; - __retVal[3].x = f03; - __retVal[3].y = f13; - __retVal[3].z = f23; -} - -mat4x3 __constructor(const float f) -{ - __retVal = mat4x3( f, 0.0, 0.0, - 0.0, f, 0.0, - 0.0, 0.0, f, - 0.0, 0.0, 0.0); -} - -mat4x3 __constructor(const int i) -{ - const float f = float(i); - __retVal = mat4x3(f); -} - -mat4x3 __constructor(const bool b) -{ - const float f = float(b); - __retVal = mat4x3(f); -} - -mat4x3 __constructor(const vec3 c0, const vec3 c1, const vec3 c2, const vec3 c3) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; - __retVal[3] = c3; -} - - - -//// misc assorted matrix constructors - -mat2 __constructor(const mat2 m) -{ - __retVal = m; -} - -mat2 __constructor(const mat3x2 m) -{ - __retVal = mat2(m[0], m[1]); -} - -mat2 __constructor(const mat4x2 m) -{ - __retVal = mat2(m[0], m[1]); -} - -mat2 __constructor(const mat2x3 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - -mat2 __constructor(const mat2x4 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - -mat2 __constructor(const mat3 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - -mat2 __constructor(const mat3x4 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - -mat2 __constructor(const mat4x3 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - -mat2 __constructor(const mat4 m) -{ - __retVal = mat2(m[0].xy, m[1].xy); -} - - - -mat2x3 __constructor(const mat2x3 m) -{ - __retVal = m; -} - -mat2x3 __constructor(const mat3 m) -{ - __retVal = mat2x3(m[0], m[1]); -} - -mat2x3 __constructor(const mat4x3 m) -{ - __retVal = mat2x3(m[0], m[1]); -} - -mat2x3 __constructor(const mat2x4 m) -{ - __retVal = mat2x3(m[0].xyz, m[1].xyz); -} - -mat2x3 __constructor(const mat3x4 m) -{ - __retVal = mat2x3(m[0].xyz, m[1].xyz); -} - -mat2x3 __constructor(const mat4 m) -{ - __retVal = mat2x3(m[0].xyz, m[1].xyz); -} - -mat2x3 __constructor(const mat2 m) -{ - __retVal = mat2x3(m[0].x, m[0].y, 0.0, - m[1].x, m[1].y, 0.0); -} - -mat2x3 __constructor(const mat3x2 m) -{ - __retVal = mat2x3(m[0].x, m[0].y, 0.0, - m[1].x, m[1].y, 0.0); -} - -mat2x3 __constructor(const mat4x2 m) -{ - __retVal = mat2x3(m[0].x, m[0].y, 0.0, - m[1].x, m[1].y, 0.0); -} - - - -mat2x4 __constructor(const mat2x4 m) -{ - __retVal = m; -} - -mat2x4 __constructor(const mat3x4 m) -{ - __retVal = mat2x4(m[0], m[1]); -} - -mat2x4 __constructor(const mat4 m) -{ - __retVal = mat2x4(m[0], m[1]); -} - -mat2x4 __constructor(const mat2x3 m) -{ - __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, - m[1].x, m[1].y, m[1].z, 0.0); -} - -mat2x4 __constructor(const mat3 m) -{ - __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, - m[1].x, m[1].y, m[1].z, 0.0); -} - -mat2x4 __constructor(const mat4x3 m) -{ - __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, - m[1].x, m[1].y, m[1].z, 0.0); -} - -mat2x4 __constructor(const mat2 m) -{ - __retVal = mat2x4(m[0].x, m[1].y, 0.0, 0.0, - m[1].x, m[1].y, 0.0, 0.0); -} - -mat2x4 __constructor(const mat3x2 m) -{ - __retVal = mat2x4(m[0].x, m[0].y, 0.0, 0.0, - m[1].x, m[1].y, 0.0, 0.0); -} - -mat2x4 __constructor(const mat4x2 m) -{ - __retVal = mat2x4(m[0].x, m[0].y, 0.0, 0.0, - m[1].x, m[1].y, 0.0, 0.0); -} - - - -mat3x2 __constructor(const mat3x2 m) -{ - __retVal = m; -} - -mat3x2 __constructor(const mat4x2 m) -{ - __retVal = mat3x2(m[0], m[1], m[2]); -} - -mat3x2 __constructor(const mat3 m) -{ - __retVal = mat3x2(m[0], m[1], m[2]); -} - -mat3x2 __constructor(const mat3x4 m) -{ - __retVal = mat3x2(m[0].x, m[0].y, - m[1].x, m[1].y, - m[2].x, m[2].y); -} - -mat3x2 __constructor(const mat4x3 m) -{ - __retVal = mat3x2(m[0].x, m[0].y, - m[1].x, m[1].y, - m[2].x, m[2].y); -} - -mat3x2 __constructor(const mat4 m) -{ - __retVal = mat3x2(m[0].x, m[0].y, - m[1].x, m[1].y, - 0.0, 0.0); -} - -mat3x2 __constructor(const mat2 m) -{ - __retVal = mat3x2(m[0], m[1], vec2(0.0)); -} - -mat3x2 __constructor(const mat2x3 m) -{ - __retVal = mat3x2(m[0].x, m[0].y, - m[1].x, m[1].y, - 0.0, 0.0); -} - -mat3x2 __constructor(const mat2x4 m) -{ - __retVal = mat3x2(m[0].x, m[0].y, - m[1].x, m[1].y, - 0.0, 0.0); -} - - - - -mat3 __constructor(const mat3 m) -{ - __retVal = m; -} - -mat3 __constructor(const mat4x3 m) -{ - __retVal = mat3 ( - m[0], - m[1], - m[2] - ); -} - -mat3 __constructor(const mat3x4 m) -{ - __retVal = mat3 ( - m[0].xyz, - m[1].xyz, - m[2].xyz - ); -} - -mat3 __constructor(const mat4 m) -{ - __retVal = mat3 ( - m[0].xyz, - m[1].xyz, - m[2].xyz - ); -} - -mat3 __constructor(const mat2x3 m) -{ - __retVal = mat3 ( - m[0], - m[1], - 0., 0., 1. - ); -} - -mat3 __constructor(const mat2x4 m) -{ - __retVal = mat3 ( - m[0].xyz, - m[1].xyz, - 0., 0., 1. - ); -} - -mat3 __constructor(const mat3x2 m) -{ - __retVal = mat3 ( - m[0], 0., - m[1], 0., - m[2], 1. - ); -} - -mat3 __constructor(const mat4x2 m) -{ - __retVal = mat3 ( - m[0], 0., - m[1], 0., - m[2], 1. - ); -} - -mat3 __constructor(const mat2 m) -{ - __retVal = mat3 ( - m[0], 0., - m[1], 0., - 0., 0., 1. - ); -} - - -mat3x4 __constructor(const mat3x4 m) -{ - __retVal = m; -} - -mat3x4 __constructor(const mat4 m) -{ - __retVal = mat3x4 ( - m[0], - m[1], - m[2] - ); -} - -mat3x4 __constructor(const mat3 m) -{ - __retVal = mat3x4 ( - m[0], 0., - m[1], 0., - m[2], 0. - ); -} - -mat3x4 __constructor(const mat4x3 m) -{ - __retVal = mat3x4 ( - m[0], 0., - m[1], 0., - m[2], 0. - ); -} - -mat3x4 __constructor(const mat2x4 m) -{ - __retVal = mat3x4 ( - m[0], - m[1], - 0., 0., 1., 0. - ); -} - -mat3x4 __constructor(const mat2x3 m) -{ - __retVal = mat3x4 ( - m[0], 0., - m[1], 0., - 0., 0., 1., 0. - ); -} - -mat3x4 __constructor(const mat3x2 m) -{ - __retVal = mat3x4 ( - m[0], 0., 0., - m[1], 0., 0., - m[2], 1., 0. - ); -} - -mat3x4 __constructor(const mat4x2 m) -{ - __retVal = mat3x4 ( - m[0], 0., 0., - m[1], 0., 0., - m[2], 1., 0. - ); -} - -mat3x4 __constructor(const mat2 m) -{ - __retVal = mat3x4 ( - m[0], 0., 0., - m[1], 0., 0., - 0., 0., 1., 0. - ); -} - - -mat4x2 __constructor(const mat4x2 m) -{ - __retVal = m; -} - -mat4x2 __constructor(const mat4x3 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - m[2].xy, - m[3].xy - ); -} - -mat4x2 __constructor(const mat4 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - m[2].xy, - m[3].xy - ); -} - -mat4x2 __constructor(const mat3x2 m) -{ - __retVal = mat4x2 ( - m[0], - m[1], - 0., 0. - ); -} - -mat4x2 __constructor(const mat3 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - m[2].xy, - 0., 0. - ); -} - -mat4x2 __constructor(const mat3x4 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - m[2].xy, - 0., 0. - ); -} - -mat4x2 __constructor(const mat2 m) -{ - __retVal = mat4x2 ( - m[0], - m[1], - 0., 0., - 0., 0. - ); -} - -mat4x2 __constructor(const mat2x3 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - 0., 0., - 0., 0. - ); -} - -mat4x2 __constructor(const mat2x4 m) -{ - __retVal = mat4x2 ( - m[0].xy, - m[1].xy, - 0., 0., - 0., 0. - ); -} - - -mat4x3 __constructor(const mat4x3 m) -{ - __retVal = m; -} - -mat4x3 __constructor(const mat4 m) -{ - __retVal = mat4x3 ( - m[0].xyz, - m[1].xyz, - m[2].xyz, - m[3].xyz - ); -} - -mat4x3 __constructor(const mat3 m) -{ - __retVal = mat4x3 ( - m[0], - m[1], - m[2], - 0., 0., 0. - ); -} - -mat4x3 __constructor(const mat3x4 m) -{ - __retVal = mat4x3 ( - m[0].xyz, - m[1].xyz, - m[2].xyz, - 0., 0., 0. - ); -} - -mat4x3 __constructor(const mat4x2 m) -{ - __retVal = mat4x3 ( - m[0], 0., - m[1], 0., - m[2], 1., - m[3], 0. - ); -} - -mat4x3 __constructor(const mat2x3 m) -{ - __retVal = mat4x3 ( - m[0], - m[1], - 0., 0., 1., - 0., 0., 0. - ); -} - -mat4x3 __constructor(const mat3x2 m) -{ - __retVal = mat4x3 ( - m[0], 0., - m[1], 0., - m[2], 1., - 0., 0., 0. - ); -} - -mat4x3 __constructor(const mat2x4 m) -{ - __retVal = mat4x3 ( - m[0].xyz, - m[1].xyz, - 0., 0., 1., - 0., 0., 0. - ); -} - -mat4x3 __constructor(const mat2 m) -{ - __retVal = mat4x3 ( - m[0], 0., - m[1], 0., - 0., 0., 1., - 0., 0., 0. - ); -} - - -mat4 __constructor(const mat4 m) -{ - __retVal = m; -} - -mat4 __constructor(const mat3x4 m) -{ - __retVal = mat4 ( - m[0], - m[1], - m[2], - 0., 0., 0., 1. - ); -} - -mat4 __constructor(const mat4x3 m) -{ - __retVal = mat4 ( - m[0], 0., - m[1], 0., - m[2], 0., - m[3], 1. - ); -} - -mat4 __constructor(const mat2x4 m) -{ - __retVal = mat4 ( - m[0], - m[1], - 0., 0., 1., 0., - 0., 0., 0., 1. - ); -} - -mat4 __constructor(const mat4x2 m) -{ - __retVal = mat4 ( - m[0], 0., 0., - m[1], 0., 0., - m[2], 1., 0., - m[3], 0., 1. - ); -} - -mat4 __constructor(const mat3 m) -{ - __retVal = mat4 ( - m[0], 0., - m[1], 0., - m[2], 0., - 0., 0., 0., 1. - ); -} - -mat4 __constructor(const mat2x3 m) -{ - __retVal = mat4 ( - m[0], 0., - m[1], 0., - 0., 0., 1., 0., - 0., 0., 0., 1. - ); -} - -mat4 __constructor(const mat3x2 m) -{ - __retVal = mat4 ( - m[0], 0., 0., - m[1], 0., 0., - m[2], 1., 0., - 0., 0., 0., 1. - ); -} - -mat4 __constructor(const mat2 m) -{ - __retVal = mat4 ( - m[0], 0., 0., - m[1], 0., 0., - 0., 0., 1., 0., - 0., 0., 0., 1. - ); -} - - -void __operator += (inout mat2x3 m, const mat2x3 n) { - m[0] += n[0]; - m[1] += n[1]; -} - -void __operator += (inout mat2x4 m, const mat2x4 n) { - m[0] += n[0]; - m[1] += n[1]; -} - -void __operator += (inout mat3x2 m, const mat3x2 n) { - m[0] += n[0]; - m[1] += n[1]; - m[2] += n[2]; -} - -void __operator += (inout mat3x4 m, const mat3x4 n) { - m[0] += n[0]; - m[1] += n[1]; - m[2] += n[2]; -} - -void __operator += (inout mat4x2 m, const mat4x2 n) { - m[0] += n[0]; - m[1] += n[1]; - m[2] += n[2]; - m[3] += n[3]; -} - -void __operator += (inout mat4x3 m, const mat4x3 n) { - m[0] += n[0]; - m[1] += n[1]; - m[2] += n[2]; - m[3] += n[3]; -} - - -void __operator -= (inout mat2x3 m, const mat2x3 n) { - m[0] -= n[0]; - m[1] -= n[1]; -} - -void __operator -= (inout mat2x4 m, const mat2x4 n) { - m[0] -= n[0]; - m[1] -= n[1]; -} - -void __operator -= (inout mat3x2 m, const mat3x2 n) { - m[0] -= n[0]; - m[1] -= n[1]; - m[2] -= n[2]; -} - -void __operator -= (inout mat3x4 m, const mat3x4 n) { - m[0] -= n[0]; - m[1] -= n[1]; - m[2] -= n[2]; -} - -void __operator -= (inout mat4x2 m, const mat4x2 n) { - m[0] -= n[0]; - m[1] -= n[1]; - m[2] -= n[2]; - m[3] -= n[3]; -} - -void __operator -= (inout mat4x3 m, const mat4x3 n) { - m[0] -= n[0]; - m[1] -= n[1]; - m[2] -= n[2]; - m[3] -= n[3]; -} - - -void __operator /= (inout mat2x3 m, const mat2x3 n) { - m[0] /= n[0]; - m[1] /= n[1]; -} - -void __operator /= (inout mat2x4 m, const mat2x4 n) { - m[0] /= n[0]; - m[1] /= n[1]; -} - -void __operator /= (inout mat3x2 m, const mat3x2 n) { - m[0] /= n[0]; - m[1] /= n[1]; - m[2] /= n[2]; -} - -void __operator /= (inout mat3x4 m, const mat3x4 n) { - m[0] /= n[0]; - m[1] /= n[1]; - m[2] /= n[2]; -} - -void __operator /= (inout mat4x2 m, const mat4x2 n) { - m[0] /= n[0]; - m[1] /= n[1]; - m[2] /= n[2]; - m[3] /= n[3]; -} - -void __operator /= (inout mat4x3 m, const mat4x3 n) { - m[0] /= n[0]; - m[1] /= n[1]; - m[2] /= n[2]; - m[3] /= n[3]; -} - - -vec3 __operator * (const mat2x3 m, const vec2 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y; - __retVal.z = v.x * m[0].z + v.y * m[1].z; -} - -vec4 __operator * (const mat2x4 m, const vec2 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y; - __retVal.z = v.x * m[0].z + v.y * m[1].z; - __retVal.w = v.x * m[0].w + v.y * m[1].w; -} - -vec2 __operator * (const mat3x2 m, const vec3 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y; -} - -vec4 __operator * (const mat3x4 m, const vec3 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y; - __retVal.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z; - __retVal.w = v.x * m[0].w + v.y * m[1].w + v.z * m[2].w; -} - -vec2 __operator * (const mat4x2 m, const vec4 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y; -} - -vec3 __operator * (const mat4x3 m, const vec4 v) -{ - __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x; - __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y; - __retVal.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z; -} - - -mat3x2 __operator * (const mat2 m, const mat3x2 n) -{ - //return mat3x2 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4x2 __operator * (const mat2 m, const mat4x2 n) -{ - //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x3 __operator * (const mat2x3 m, const mat2 n) -{ - //return mat2x3 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3 __operator * (const mat2x3 m, const mat3x2 n) -{ - //return mat3 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4x3 __operator * (const mat2x3 m, const mat4x2 n) -{ - //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x4 __operator * (const mat2x4 m, const mat2 n) -{ - //return mat2x4 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3x4 __operator * (const mat2x4 m, const mat3x2 n) -{ - //return mat3x4 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4 __operator * (const mat2x4 m, const mat4x2 n) -{ - //return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2 __operator * (const mat3x2 m, const mat2x3 n) -{ - //return mat2 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3x2 __operator * (const mat3x2 m, const mat3 n) -{ - //return mat3x2 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4x2 __operator * (const mat3x2 m, const mat4x3 n) -{ - //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x3 __operator * (const mat3 m, const mat2x3 n) -{ - //return mat2x3 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat4x3 __operator * (const mat3 m, const mat4x3 n) -{ - //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x4 __operator * (const mat3x4 m, const mat2x3 n) -{ - //return mat2x4 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3x4 __operator * (const mat3x4 m, const mat3 n) -{ - //return mat3x4 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4 __operator * (const mat3x4 m, const mat4x3 n) -{ - //return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2 __operator * (const mat4x2 m, const mat2x4 n) -{ - //return = mat2 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3x2 __operator * (const mat4x2 m, const mat3x4 n) -{ - //return mat3x2 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4x2 __operator * (const mat4x2 m, const mat4 n) -{ - //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x3 __operator * (const mat4x3 m, const mat2x4 n) -{ - //return mat2x3 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3 __operator * (const mat4x3 m, const mat3x4 n) -{ - //return mat3 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - -mat4x3 __operator * (const mat4x3 m, const mat4 n) -{ - //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; - __retVal[3] = m * n[3]; -} - - -mat2x4 __operator * (const mat4 m, const mat2x4 n) -{ - //return mat2x4 (m * n[0], m * n[1]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; -} - -mat3x4 __operator * (const mat4 m, const mat3x4 n) -{ - //return mat3x4 (m * n[0], m * n[1], m * n[2]); - __retVal[0] = m * n[0]; - __retVal[1] = m * n[1]; - __retVal[2] = m * n[2]; -} - - -void __operator *= (inout mat2x3 m, const mat2 n) { - m = m * n; -} - -void __operator *= (inout mat2x4 m, const mat2 n) { - m = m * n; -} - -void __operator *= (inout mat3x2 m, const mat3 n) { - m = m * n; -} - -void __operator *= (inout mat3x4 m, const mat3 n) { - m = m * n; -} - -void __operator *= (inout mat4x2 m, const mat4 n) { - m = m * n; -} - -void __operator *= (inout mat4x3 m, const mat4 n) { - m = m * n; -} - - -vec3 __operator * (const vec2 v, const mat3x2 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); -} - -vec4 __operator * (const vec2 v, const mat4x2 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); - __retVal.w = dot(v, m[3]); -} - -vec2 __operator * (const vec3 v, const mat2x3 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); -} - -vec4 __operator * (const vec3 v, const mat4x3 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); - __retVal.w = dot(v, m[3]); -} - -vec2 __operator * (const vec4 v, const mat2x4 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); -} - -vec3 __operator * (const vec4 v, const mat3x4 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); -} - - -void __operator += (inout mat2x3 m, const float a) { - m[0] += a; - m[1] += a; -} - -void __operator += (inout mat2x4 m, const float a) { - m[0] += a; - m[1] += a; -} - -void __operator += (inout mat3x2 m, const float a) { - m[0] += a; - m[1] += a; - m[2] += a; -} - -void __operator += (inout mat3x4 m, const float a) { - m[0] += a; - m[1] += a; - m[2] += a; -} - -void __operator += (inout mat4x2 m, const float a) { - m[0] += a; - m[1] += a; - m[2] += a; - m[3] += a; -} - -void __operator += (inout mat4x3 m, const float a) { - m[0] += a; - m[1] += a; - m[2] += a; - m[3] += a; -} - - -void __operator -= (inout mat2x3 m, const float a) { - m[0] -= a; - m[1] -= a; -} - -void __operator -= (inout mat2x4 m, const float a) { - m[0] -= a; - m[1] -= a; -} - -void __operator -= (inout mat3x2 m, const float a) { - m[0] -= a; - m[1] -= a; - m[2] -= a; -} - -void __operator -= (inout mat3x4 m, const float a) { - m[0] -= a; - m[1] -= a; - m[2] -= a; -} - -void __operator -= (inout mat4x2 m, const float a) { - m[0] -= a; - m[1] -= a; - m[2] -= a; - m[3] -= a; -} - -void __operator -= (inout mat4x3 m, const float a) { - m[0] -= a; - m[1] -= a; - m[2] -= a; - m[3] -= a; -} - - -void __operator *= (inout mat2x3 m, const float a) { - m[0] *= a; - m[1] *= a; -} - -void __operator *= (inout mat2x4 m, const float a) { - m[0] *= a; - m[1] *= a; -} - -void __operator *= (inout mat3x2 m, const float a) { - m[0] *= a; - m[1] *= a; - m[2] *= a; -} - -void __operator *= (inout mat3x4 m, const float a) { - m[0] *= a; - m[1] *= a; - m[2] *= a; -} - -void __operator *= (inout mat4x2 m, const float a) { - m[0] *= a; - m[1] *= a; - m[2] *= a; - m[3] *= a; -} - -void __operator *= (inout mat4x3 m, const float a) { - m[0] *= a; - m[1] *= a; - m[2] *= a; - m[3] *= a; -} - - -void __operator /= (inout mat2x3 m, const float a) { - m[0] /= a; - m[1] /= a; -} - -void __operator /= (inout mat2x4 m, const float a) { - m[0] /= a; - m[1] /= a; -} - -void __operator /= (inout mat3x2 m, const float a) { - m[0] /= a; - m[1] /= a; - m[2] /= a; -} - -void __operator /= (inout mat3x4 m, const float a) { - m[0] /= a; - m[1] /= a; - m[2] /= a; -} - -void __operator /= (inout mat4x2 m, const float a) { - m[0] /= a; - m[1] /= a; - m[2] /= a; - m[3] /= a; -} - -void __operator /= (inout mat4x3 m, const float a) { - m[0] /= a; - m[1] /= a; - m[2] /= a; - m[3] /= a; -} - - -mat2x3 __operator + (const mat2x3 m, const mat2x3 n) { - return mat2x3 (m[0] + n[0], m[1] + n[1]); -} - -mat2x4 __operator + (const mat2x4 m, const mat2x4 n) { - return mat2x4 (m[0] + n[0], m[1] + n[1]); -} - -mat3x2 __operator + (const mat3x2 m, const mat3x2 n) { - return mat3x2 (m[0] + n[0], m[1] + n[1], m[2] + n[2]); -} - -mat3x4 __operator + (const mat3x4 m, const mat3x4 n) { - return mat3x4 (m[0] + n[0], m[1] + n[1], m[2] + n[2]); -} - -mat4x2 __operator + (const mat4x2 m, const mat4x2 n) { - return mat4x2 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]); -} - -mat4x3 __operator + (const mat4x3 m, const mat4x3 n) { - return mat4x3 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]); -} - - -mat2x3 __operator - (const mat2x3 m, const mat2x3 n) { - return mat2x3 (m[0] - n[0], m[1] - n[1]); -} - -mat2x4 __operator - (const mat2x4 m, const mat2x4 n) { - return mat2x4 (m[0] - n[0], m[1] - n[1]); -} - -mat3x2 __operator - (const mat3x2 m, const mat3x2 n) { - return mat3x2 (m[0] - n[0], m[1] - n[1], m[2] - n[2]); -} - -mat3x4 __operator - (const mat3x4 m, const mat3x4 n) { - return mat3x4 (m[0] - n[0], m[1] - n[1], m[2] - n[2]); -} - -mat4x2 __operator - (const mat4x2 m, const mat4x2 n) { - return mat4x2 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]); -} - -mat4x3 __operator - (const mat4x3 m, const mat4x3 n) { - return mat4x3 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]); -} - - -mat2x3 __operator / (const mat2x3 m, const mat2x3 n) { - return mat2x3 (m[0] / n[0], m[1] / n[1]); -} - -mat2x4 __operator / (const mat2x4 m, const mat2x4 n) { - return mat2x4 (m[0] / n[0], m[1] / n[1]); -} - -mat3x2 __operator / (const mat3x2 m, const mat3x2 n) { - return mat3x2 (m[0] / n[0], m[1] / n[1], m[2] / n[2]); -} - -mat3x4 __operator / (const mat3x4 m, const mat3x4 n) { - return mat3x4 (m[0] / n[0], m[1] / n[1], m[2] / n[2]); -} - -mat4x2 __operator / (const mat4x2 m, const mat4x2 n) { - return mat4x2 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]); -} - -mat4x3 __operator / (const mat4x3 m, const mat4x3 n) { - return mat4x3 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]); -} - - -mat2x3 __operator + (const float a, const mat2x3 n) { - return mat2x3 (a + n[0], a + n[1]); -} - -mat2x3 __operator + (const mat2x3 m, const float b) { - return mat2x3 (m[0] + b, m[1] + b); -} - -mat2x4 __operator + (const float a, const mat2x4 n) { - return mat2x4 (a + n[0], a + n[1]); -} - -mat2x4 __operator + (const mat2x4 m, const float b) { - return mat2x4 (m[0] + b, m[1] + b); -} - -mat3x2 __operator + (const float a, const mat3x2 n) { - return mat3x2 (a + n[0], a + n[1], a + n[2]); -} - -mat3x2 __operator + (const mat3x2 m, const float b) { - return mat3x2 (m[0] + b, m[1] + b, m[2] + b); -} - -mat3x4 __operator + (const float a, const mat3x4 n) { - return mat3x4 (a + n[0], a + n[1], a + n[2]); -} - -mat3x4 __operator + (const mat3x4 m, const float b) { - return mat3x4 (m[0] + b, m[1] + b, m[2] + b); -} - -mat4x2 __operator + (const mat4x2 m, const float b) { - return mat4x2 (m[0] + b, m[1] + b, m[2] + b, m[3] + b); -} - -mat4x2 __operator + (const float a, const mat4x2 n) { - return mat4x2 (a + n[0], a + n[1], a + n[2], a + n[3]); -} - -mat4x3 __operator + (const mat4x3 m, const float b) { - return mat4x3 (m[0] + b, m[1] + b, m[2] + b, m[3] + b); -} - -mat4x3 __operator + (const float a, const mat4x3 n) { - return mat4x3 (a + n[0], a + n[1], a + n[2], a + n[3]); -} - - -mat2x3 __operator - (const float a, const mat2x3 n) { - return mat2x3 (a - n[0], a - n[1]); -} - -mat2x3 __operator - (const mat2x3 m, const float b) { - return mat2x3 (m[0] - b, m[1] - b); -} - -mat2x4 __operator - (const float a, const mat2x4 n) { - return mat2x4 (a - n[0], a - n[1]); -} - -mat2x4 __operator - (const mat2x4 m, const float b) { - return mat2x4 (m[0] - b, m[1] - b); -} - -mat3x2 __operator - (const float a, const mat3x2 n) { - return mat3x2 (a - n[0], a - n[1], a - n[2]); -} - -mat3x2 __operator - (const mat3x2 m, const float b) { - return mat3x2 (m[0] - b, m[1] - b, m[2] - b); -} - -mat3x4 __operator - (const float a, const mat3x4 n) { - return mat3x4 (a - n[0], a - n[1], a - n[2]); -} - -mat3x4 __operator - (const mat3x4 m, const float b) { - return mat3x4 (m[0] - b, m[1] - b, m[2] - b); -} - -mat4x2 __operator - (const mat4x2 m, const float b) { - return mat4x2 (m[0] - b, m[1] - b, m[2] - b, m[3] - b); -} - -mat4x2 __operator - (const float a, const mat4x2 n) { - return mat4x2 (a - n[0], a - n[1], a - n[2], a - n[3]); -} - -mat4x3 __operator - (const mat4x3 m, const float b) { - return mat4x3 (m[0] - b, m[1] - b, m[2] - b, m[3] - b); -} - -mat4x3 __operator - (const float a, const mat4x3 n) { - return mat4x3 (a - n[0], a - n[1], a - n[2], a - n[3]); -} - - -mat2x3 __operator * (const float a, const mat2x3 n) -{ - //return mat2x3 (a * n[0], a * n[1]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; -} - -mat2x3 __operator * (const mat2x3 m, const float b) -{ - //return mat2x3 (m[0] * b, m[1] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; -} - -mat2x4 __operator * (const float a, const mat2x4 n) -{ - //return mat2x4 (a * n[0], a * n[1]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; -} - -mat2x4 __operator * (const mat2x4 m, const float b) -{ - //return mat2x4 (m[0] * b, m[1] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; -} - -mat3x2 __operator * (const float a, const mat3x2 n) -{ - //return mat3x2 (a * n[0], a * n[1], a * n[2]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; -} - -mat3x2 __operator * (const mat3x2 m, const float b) -{ - //return mat3x2 (m[0] * b, m[1] * b, m[2] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; -} - -mat3x4 __operator * (const float a, const mat3x4 n) -{ - //return mat3x4 (a * n[0], a * n[1], a * n[2]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; -} - -mat3x4 __operator * (const mat3x4 m, const float b) -{ - //return mat3x4 (m[0] * b, m[1] * b, m[2] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; -} - -mat4x2 __operator * (const mat4x2 m, const float b) -{ - //return mat4x2 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; - __retVal[3] = m[3] * b; -} - -mat4x2 __operator * (const float a, const mat4x2 n) -{ - //return mat4x2 (a * n[0], a * n[1], a * n[2], a * n[3]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; - __retVal[3] = a * n[3]; -} - -mat4x3 __operator * (const mat4x3 m, const float b) -{ - //return mat4x3 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; - __retVal[3] = m[3] * b; -} - -mat4x3 __operator * (const float a, const mat4x3 n) -{ - //return mat4x3 (a * n[0], a * n[1], a * n[2], a * n[3]); - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; - __retVal[3] = a * n[3]; -} - - -mat2x3 __operator / (const float a, const mat2x3 n) -{ - //return mat2x3 (a / n[0], a / n[1]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; -} - -mat2x3 __operator / (const mat2x3 m, const float b) -{ - //return mat2x3 (m[0] / b, m[1] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; -} - -mat2x4 __operator / (const float a, const mat2x4 n) -{ - //return mat2x4 (a / n[0], a / n[1]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; -} - -mat2x4 __operator / (const mat2x4 m, const float b) -{ - //return mat2x4 (m[0] / b, m[1] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; -} - -mat3x2 __operator / (const float a, const mat3x2 n) -{ - //return mat3x2 (a / n[0], a / n[1], a / n[2]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; - __retVal[2] = inv * n[2]; -} - -mat3x2 __operator / (const mat3x2 m, const float b) -{ - //return mat3x2 (m[0] / b, m[1] / b, m[2] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; - __retVal[2] = m[2] * inv; -} - -mat3x4 __operator / (const float a, const mat3x4 n) -{ - //return mat3x4 (a / n[0], a / n[1], a / n[2]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; - __retVal[2] = inv * n[2]; -} - -mat3x4 __operator / (const mat3x4 m, const float b) -{ - //return mat3x4 (m[0] / b, m[1] / b, m[2] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; - __retVal[2] = m[2] * inv; -} - -mat4x2 __operator / (const mat4x2 m, const float b) -{ - //return mat4x2 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; - __retVal[2] = m[2] * inv; - __retVal[3] = m[3] * inv; -} - -mat4x2 __operator / (const float a, const mat4x2 n) -{ - //return mat4x2 (a / n[0], a / n[1], a / n[2], a / n[3]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; - __retVal[2] = inv * n[2]; - __retVal[3] = inv * n[3]; -} - -mat4x3 __operator / (const mat4x3 m, const float b) -{ - //return mat4x3 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); - const float inv = 1.0 / b; - __retVal[0] = m[0] * inv; - __retVal[1] = m[1] * inv; - __retVal[2] = m[2] * inv; - __retVal[3] = m[3] * inv; -} - -mat4x3 __operator / (const float a, const mat4x3 n) -{ - //return mat4x3 (a / n[0], a / n[1], a / n[2], a / n[3]); - const float inv = 1.0 / a; - __retVal[0] = inv * n[0]; - __retVal[1] = inv * n[1]; - __retVal[2] = inv * n[2]; - __retVal[3] = inv * n[3]; -} - - -mat2x3 __operator - (const mat2x3 m) { - return mat2x3 (-m[0], -m[1]); -} - -mat2x4 __operator - (const mat2x4 m) { - return mat2x4 (-m[0], -m[1]); -} - -mat3x2 __operator - (const mat3x2 m) { - return mat3x2 (-m[0], -m[1], -m[2]); -} - -mat3x4 __operator - (const mat3x4 m) { - return mat3x4 (-m[0], -m[1], -m[2]); -} - -mat4x2 __operator - (const mat4x2 m) { - return mat4x2 (-m[0], -m[1], -m[2], -m[3]); -} - -mat4x3 __operator - (const mat4x3 m) { - return mat4x3 (-m[0], -m[1], -m[2], -m[3]); -} - - -void __operator -- (inout mat2x3 m) { - --m[0]; - --m[1]; -} - -void __operator -- (inout mat2x4 m) { - --m[0]; - --m[1]; -} - -void __operator -- (inout mat3x2 m) { - --m[0]; - --m[1]; - --m[2]; -} - -void __operator -- (inout mat3x4 m) { - --m[0]; - --m[1]; - --m[2]; -} - -void __operator -- (inout mat4x2 m) { - --m[0]; - --m[1]; - --m[2]; - --m[3]; -} - -void __operator -- (inout mat4x3 m) { - --m[0]; - --m[1]; - --m[2]; - --m[3]; -} - - -void __operator ++ (inout mat2x3 m) { - ++m[0]; - ++m[1]; -} - -void __operator ++ (inout mat2x4 m) { - ++m[0]; - ++m[1]; -} - -void __operator ++ (inout mat3x2 m) { - ++m[0]; - ++m[1]; - ++m[2]; -} - -void __operator ++ (inout mat3x4 m) { - ++m[0]; - ++m[1]; - ++m[2]; -} - -void __operator ++ (inout mat4x2 m) { - ++m[0]; - ++m[1]; - ++m[2]; - ++m[3]; -} - -void __operator ++ (inout mat4x3 m) { - ++m[0]; - ++m[1]; - ++m[2]; - ++m[3]; -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_120_core_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_120_core_gc.h deleted file mode 100644 index 1fdbddf7c3..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_120_core_gc.h +++ /dev/null @@ -1,764 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_120_core.gc */ - -5,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0, -1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0, -18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -5,0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -11,0,99,48,0,0,1,1,0,0,11,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0, -0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0, -1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51, -49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119, -0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0, -0,28,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0, -0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0, -0,28,0,1,1,1,0,0,1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0, -0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0, -28,0,1,1,1,0,0,12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95, -0,0,27,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9, -0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0, -0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,5,0,105,0,0,0, -1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,1,0,98,0,0,0,1, -3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,10,0,99,48,0,0,1, -1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, -0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0,1,1,0,0,9,0,102,48,49,0,0, -1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51,49,0,0,1,1,0,0,9,0,102,48, -50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,50,50,0,0,1,1,0,0,9,0,102,51,50,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, -122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119, -0,18,102,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,50,0,57,59,119,0,18,102,51,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17, -48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2, -90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,1,0,98,0,0,0,1,3, -2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,12,0,99,48,0,0,1, -1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, -0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0, -1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120, -0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0, -18,102,49,51,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,52,120,50,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,16,10,52,0,0,17,48,0,48, -0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,5,0, -105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,1,0, -98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,10, -0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,1,1,0,0,10,0,99,51,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,48,48,0,0,1, -1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49, -0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102, -50,50,0,0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,1,1,0,0,9,0,102,50,51,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,59,122,0,18,102,50,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0, -0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17, -48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,5,0,105,0,0,0, -1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,1,0,98,0,0,0,1, -3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,11,0,99,48,0,0,1, -1,0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,1,1,0,0,11,0,99,51,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1, -90,95,0,0,13,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0, -18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0, -18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16, -10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57, -59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121, -0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0, -1,90,95,0,0,13,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0, -0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0, -26,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,26, -0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109, -0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,31,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16, -10,49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59, -120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57, -59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0, -57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48, -0,48,0,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17, -48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0, -0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0, -0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1, -90,95,0,0,28,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90, -95,0,0,28,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52, -0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,15,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, -0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0, -28,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17, -48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10, -49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0, -16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57, -59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0, -20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0, -0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0, -57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,29,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0, -18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0, -0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1, -1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,27,0,1,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8, -48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,14, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57, -0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,30,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120, -0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, -121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0, -27,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121, -0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16, -10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0, -1,90,95,0,0,27,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,58,118,101,99,50,0,0,17,48,0,48,0,0,0, -0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16, -10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0, -1,90,95,0,0,27,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0, -57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95, -0,0,14,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0, -14,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0, -16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0, -0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57, -59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122, -0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0, -18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,26,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0, -57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,28,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0, -18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90, -95,0,0,14,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0, -17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0, -0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,13,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18, -109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0, -30,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,30, -0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109, -0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1, -0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0, -0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10, -49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1, -0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0, -0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0, -16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0, -20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17, -48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -30,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,29, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,31,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57, -59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109, -0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16, -10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121, -0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18, -109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0, -30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0, -57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120, -121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,31,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,15,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,59,120, -121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,18, -109,0,16,10,51,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10, -49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -31,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, -109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50, -0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0, -0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,26,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16, -10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0, -20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18, -109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -31,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, -109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1, -0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0, -0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,15,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,30,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0, -57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1, -90,95,0,0,15,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0, -18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0, -57,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,28,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,18,109, -0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, -0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0, -14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0, -17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,27,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0, -0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17, -49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95, -0,0,15,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109, -0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109, -0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1, -90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2, -0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21, -0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0, -16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1, -90,95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2, -0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27,0,109,0,0,1,1,0,0, -27,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18, -110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,90,95,0,0,0,0,2, -2,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0, -9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0, -57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,90, -95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110, -0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,90,95,0,0,0,0,2,4,1, -0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1, -0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9, -18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0, -0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,90,95,0, -0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0, -31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9, -18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,26,0,109,0,0,1, -1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8, -48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0, -18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20, -0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0, -16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, -109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118, -0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, -18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59, -119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59, -121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121, -0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0, -57,59,121,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118, -0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0, -48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59, -121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10, -50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0, -16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0, -18,109,0,16,10,50,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18, -118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,29,0,109, -0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109, -0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122, -0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48, -18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57, -59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,0,1,90,95,0,0,11,0,2, -21,1,1,0,0,31,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0, -48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51, -0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16, -8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18, -109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18, -118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59, -122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,90,95,0,0,27,0,2,21,1, -1,0,0,13,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, -0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50, -0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51, -0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0, -13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1, -90,95,0,0,14,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,29,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1, -0,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0, -28,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18, -110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16, -10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20, -0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90, -95,0,0,29,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110, -0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21, -1,1,0,0,14,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18, -110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16, -10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0, -57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30, -0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110, -0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48, -20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, -109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,28,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0, -0,27,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18, -110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,31,0, -109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, -16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, -57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0, -1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0, -28,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,30,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,0,0,2, -3,1,0,2,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0, -0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90, -95,0,0,0,0,2,3,1,0,2,0,27,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0, -0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0, -48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18, -110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,27,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10, -50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10, -51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20, -0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0, -20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90, -95,0,0,11,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0, -0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18, -109,0,16,10,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1, -0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49, -0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0, -9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10, -50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0, -21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0, -2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16, -10,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109, -0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27, -0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18, -97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,30,0,109,0,0,1,1,0,0, -9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109, -0,16,10,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9, -18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57, -18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1, -0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18, -109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,3,1,0,2, -0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, -57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0, -23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0, -16,10,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18, -97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0, -9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109, -0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0, -26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57, -18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48, -0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0, -9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10, -50,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0, -24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0, -16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0, -26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1, -1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,27,0, -2,26,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48, -0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10, -50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0, -110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0, -0,1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, -57,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116, -52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16, -10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58, -109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0, -0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0, -110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0, -0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0, -109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1, -0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57, -18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0, -26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,90, -95,0,0,28,0,2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0, -0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50, -0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,30,0, -109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,49,0,0,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18, -110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57, -18,110,0,16,10,51,0,57,49,0,0,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, -0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16, -10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0, -110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109, -97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0, -1,90,95,0,0,28,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1, -1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18, -98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0, -0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110, -0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18, -109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1, -1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,8,48,0, -57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0, -30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0, -1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, -109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0, -46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,29, -0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,90, -95,0,0,31,0,2,26,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109, -0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46, -0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0, -110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,90, -95,0,0,26,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0, -18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, -26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,47, -0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0, -110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16, -10,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109, -97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0, -1,90,95,0,0,27,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10, -50,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58, -109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18, -97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0, -0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18, -98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1, -0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10, -49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0, -1,90,95,0,0,29,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49, -0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1, -90,95,0,0,31,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,26, -0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90, -95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0, -28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0, -0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, -8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48, -20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,29,0,2,21,1, -1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0, -1,90,95,0,0,29,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, -18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0, -16,10,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0, -0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,28, -0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,28,0,2,22, -1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18, -98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0, -48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,30,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0, -57,48,20,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0, -57,48,20,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, -109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,31, -0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,27, -1,1,0,0,26,0,109,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10, -49,0,57,54,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0, -0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109, -0,16,10,50,0,57,54,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,0,1,8,58,109,97,116,51,120, -52,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1, -90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57, -54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1, -90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57, -54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1, -90,95,0,0,0,0,2,25,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57, -52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10, -49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,27,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109, -0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,30,0,109,0,0,0,1, -9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,90,95, -0,0,0,0,2,25,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9, -18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,31,0,109, -0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9, -18,109,0,16,10,51,0,57,52,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,8,48,0, -57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0, -16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,27,0,109,0,0,0,1,9, -18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,90,95,0, -0,0,0,2,24,1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9, -18,109,0,16,10,50,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,8,48,0, -57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0, -0,1,90,95,0,0,0,0,2,24,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, -57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common.gc b/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common.gc deleted file mode 100644 index c6264c3b47..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common.gc +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2006 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. - */ - -// -// From Shader Spec, ver. 1.20, rev. 6 -// - -// -// 8.5 Matrix Functions -// - -mat2x3 matrixCompMult (mat2x3 m, mat2x3 n) { - return mat2x3 (m[0] * n[0], m[1] * n[1]); -} - -mat2x4 matrixCompMult (mat2x4 m, mat2x4 n) { - return mat2x4 (m[0] * n[0], m[1] * n[1]); -} - -mat3x2 matrixCompMult (mat3x2 m, mat3x2 n) { - return mat3x2 (m[0] * n[0], m[1] * n[1], m[2] * n[2]); -} - -mat3x4 matrixCompMult (mat3x4 m, mat3x4 n) { - return mat3x4 (m[0] * n[0], m[1] * n[1], m[2] * n[2]); -} - -mat4x2 matrixCompMult (mat4x2 m, mat4x2 n) { - return mat4x2 (m[0] * n[0], m[1] * n[1], m[2] * n[2], m[3] * n[3]); -} - -mat4x3 matrixCompMult (mat4x3 m, mat4x3 n) { - return mat4x3 (m[0] * n[0], m[1] * n[1], m[2] * n[2], m[3] * n[3]); -} - -mat2 outerProduct (vec2 c, vec2 r) { - return mat2 ( - c.x * r.x, c.y * r.x, - c.x * r.y, c.y * r.y - ); -} - -mat3 outerProduct (vec3 c, vec3 r) { - return mat3 ( - c.x * r.x, c.y * r.x, c.z * r.x, - c.x * r.y, c.y * r.y, c.z * r.y, - c.x * r.z, c.y * r.z, c.z * r.z - ); -} - -mat4 outerProduct (vec4 c, vec4 r) { - return mat4 ( - c.x * r.x, c.y * r.x, c.z * r.x, c.w * r.x, - c.x * r.y, c.y * r.y, c.z * r.y, c.w * r.y, - c.x * r.z, c.y * r.z, c.z * r.z, c.w * r.z, - c.x * r.w, c.y * r.w, c.z * r.w, c.w * r.w - ); -} - -mat2x3 outerProduct (vec3 c, vec2 r) { - return mat2x3 ( - c.x * r.x, c.y * r.x, c.z * r.x, - c.x * r.y, c.y * r.y, c.z * r.y - ); -} - -mat3x2 outerProduct (vec2 c, vec3 r) { - return mat3x2 ( - c.x * r.x, c.y * r.x, - c.x * r.y, c.y * r.y, - c.x * r.z, c.y * r.z - ); -} - -mat2x4 outerProduct (vec4 c, vec2 r) { - return mat2x4 ( - c.x * r.x, c.y * r.x, c.z * r.x, c.w * r.x, - c.x * r.y, c.y * r.y, c.z * r.y, c.w * r.y - ); -} - -mat4x2 outerProduct (vec2 c, vec4 r) { - return mat4x2 ( - c.x * r.x, c.y * r.x, - c.x * r.y, c.y * r.y, - c.x * r.z, c.y * r.z, - c.x * r.w, c.y * r.w - ); -} - -mat3x4 outerProduct (vec4 c, vec3 r) { - return mat3x4 ( - c.x * r.x, c.y * r.x, c.z * r.x, c.w * r.x, - c.x * r.y, c.y * r.y, c.z * r.y, c.w * r.y, - c.x * r.z, c.y * r.z, c.z * r.z, c.w * r.z - ); -} - -mat4x3 outerProduct (vec3 c, vec4 r) { - return mat4x3 ( - c.x * r.x, c.y * r.x, c.z * r.x, - c.x * r.y, c.y * r.y, c.z * r.y, - c.x * r.z, c.y * r.z, c.z * r.z, - c.x * r.w, c.y * r.w, c.z * r.w - ); -} - -mat2 transpose (mat2 m) { - return mat2 ( - m[0].x, m[1].x, - m[0].y, m[1].y - ); -} - -mat3 transpose (mat3 m) { - return mat3 ( - m[0].x, m[1].x, m[2].x, - m[0].y, m[1].y, m[2].y, - m[0].z, m[1].z, m[2].z - ); -} - -mat4 transpose (mat4 m) { - return mat4 ( - m[0].x, m[1].x, m[2].x, m[3].x, - m[0].y, m[1].y, m[2].y, m[3].y, - m[0].z, m[1].z, m[2].z, m[3].z, - m[0].w, m[1].w, m[2].w, m[3].w - ); -} - -mat2x3 transpose (mat3x2 m) { - return mat2x3 ( - m[0].x, m[1].x, m[2].x, - m[0].y, m[1].y, m[2].y - ); -} - -mat3x2 transpose (mat2x3 m) { - return mat3x2 ( - m[0].x, m[1].x, - m[0].y, m[1].y, - m[0].z, m[1].z - ); -} - -mat2x4 transpose (mat4x2 m) { - return mat2x4 ( - m[0].x, m[1].x, m[2].x, m[3].x, - m[0].y, m[1].y, m[2].y, m[3].y - ); -} - -mat4x2 transpose (mat2x4 m) { - return mat4x2 ( - m[0].x, m[1].x, - m[0].y, m[1].y, - m[0].z, m[1].z, - m[0].w, m[1].w - ); -} - -mat3x4 transpose (mat4x3 m) { - return mat3x4 ( - m[0].x, m[1].x, m[2].x, m[3].x, - m[0].y, m[1].y, m[2].y, m[3].y, - m[0].z, m[1].z, m[2].z, m[3].z - ); -} - -mat4x3 transpose (mat3x4 m) { - return mat4x3 ( - m[0].x, m[1].x, m[2].x, - m[0].y, m[1].y, m[2].y, - m[0].z, m[1].z, m[2].z, - m[0].w, m[1].w, m[2].w - ); -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common_gc.h deleted file mode 100644 index c397b9f0fa..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_common_gc.h +++ /dev/null @@ -1,108 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_builtin_120_common.gc */ - -5,1,90,95,0,0,26,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,0,109,0,0,1, -0,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, -48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,28,0,0,109,97,116,114, -105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,0,109,0,0,1,0,0,0,28,0,110,0,0,0,1,8,58,109,97, -116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,27,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,0,27,0,109,0,0,1,0,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,30,0,0,109,97,116,114,105,120,67,111,109,112,77, -117,108,116,0,1,0,0,0,30,0,109,0,0,1,0,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109, -0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,29,0,0,109,97,116,114,105,120,67,111, -109,112,77,117,108,116,0,1,0,0,0,29,0,109,0,0,1,0,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, -57,48,0,0,0,0,1,90,95,0,0,31,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31, -0,109,0,0,1,0,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0, -16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0,0,13,0,0,111, -117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109, -97,116,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18, -99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14, -0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8, -58,109,97,116,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48, -0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, -18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, -48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95, -0,0,15,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,12,0,114,0, -0,0,1,8,58,109,97,116,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59, -120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0, -59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0, -59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18, -99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18, -114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48, -0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0, -0,26,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,10,0,114,0,0, -0,1,8,58,109,97,116,50,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114, -0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18, -99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27, -0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8, -58,109,97,116,51,120,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59, -120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0, -59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,0,0, -111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58, -109,97,116,50,120,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120, -0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59, -120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59, -121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,0,0,111,117,116,101,114,80, -114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, -18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, -48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59, -121,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,30,0,0,111,117,116,101,114,80,114,111,100,117,99, -116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,99,0,59,120,0, -18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0, -48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59, -121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59, -121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0, -59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,0,0, -111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58, -109,97,116,52,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120, -0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59, -121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59, -122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0, -59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0, -59,119,0,48,0,0,0,0,1,90,95,0,0,13,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,0,109,0,0,0, -1,8,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, -0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,0,0,116,114,97, -110,115,112,111,115,101,0,1,0,0,0,14,0,109,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,59, -120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0, -57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,90,95,0, -0,15,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,15,0,109,0,0,0,1,8,58,109,97,116,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0, -18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0, -0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122, -0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59, -122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57, -59,119,0,0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,1,90,95,0,0,26,0,0,116,114,97,110,115,112,111, -115,101,0,1,0,0,0,27,0,109,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0, -0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,0,0,116, -114,97,110,115,112,111,115,101,0,1,0,0,0,26,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0, -16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109, -0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,0,0, -0,1,90,95,0,0,28,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,29,0,109,0,0,0,1,8,58,109,97,116, -50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50, -0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10, -49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,0,0,0,1,90, -95,0,0,29,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,28,0,109,0,0,0,1,8,58,109,97,116,52,120, -50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57, -59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,0,0,0,1,90,95,0,0,30, -0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,31,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0, -18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0, -0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122, -0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59, -122,0,0,0,0,0,1,90,95,0,0,31,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,30,0,109,0,0,0,1,8, -58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18, -109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0, -18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0, -0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119, -0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment.gc b/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment.gc deleted file mode 100644 index 7d516046a1..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment.gc +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -// -// From Shader Spec, ver. 1.20, rev. 6 -// - -varying vec2 gl_PointCoord; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h deleted file mode 100644 index add3b5aeaa..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h +++ /dev/null @@ -1,5 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_builtin_120_fragment.gc */ - -5,2,2,90,95,3,0,10,0,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin.gc b/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin.gc deleted file mode 100644 index 230c57cea8..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin.gc +++ /dev/null @@ -1,1873 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 2006 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -// -// From Shader Spec, ver. 1.10, rev. 59 -// - -// Note: the values assigned to these constants here aren't actually used. -// They're set by the compiler according to the GL context limits. -// See slang_simplify.c -const int gl_MaxLights = 8; -const int gl_MaxClipPlanes = 6; -const int gl_MaxTextureUnits = 8; -const int gl_MaxTextureCoords = 8; -const int gl_MaxVertexAttribs = 16; -const int gl_MaxVertexUniformComponents = 512; -const int gl_MaxVaryingFloats = 32; -const int gl_MaxVertexTextureImageUnits = 0; -const int gl_MaxCombinedTextureImageUnits = 2; -const int gl_MaxTextureImageUnits = 2; -const int gl_MaxFragmentUniformComponents = 64; -const int gl_MaxDrawBuffers = 1; - -uniform mat4 gl_ModelViewMatrix; -uniform mat4 gl_ProjectionMatrix; -uniform mat4 gl_ModelViewProjectionMatrix; -uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords]; - -uniform mat3 gl_NormalMatrix; - -uniform mat4 gl_ModelViewMatrixInverse; -uniform mat4 gl_ProjectionMatrixInverse; -uniform mat4 gl_ModelViewProjectionMatrixInverse; -uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords]; - -uniform mat4 gl_ModelViewMatrixTranspose; -uniform mat4 gl_ProjectionMatrixTranspose; -uniform mat4 gl_ModelViewProjectionMatrixTranspose; -uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords]; - -uniform mat4 gl_ModelViewMatrixInverseTranspose; -uniform mat4 gl_ProjectionMatrixInverseTranspose; -uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose; -uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords]; - -uniform float gl_NormalScale; - -struct gl_DepthRangeParameters { - float near; - float far; - float diff; -}; - -uniform gl_DepthRangeParameters gl_DepthRange; - -uniform vec4 gl_ClipPlane[gl_MaxClipPlanes]; - -struct gl_PointParameters { - float size; - float sizeMin; - float sizeMax; - float fadeThresholdSize; - float distanceConstantAttenuation; - float distanceLinearAttenuation; - float distanceQuadraticAttenuation; -}; - -uniform gl_PointParameters gl_Point; - -struct gl_MaterialParameters { - vec4 emission; - vec4 ambient; - vec4 diffuse; - vec4 specular; - float shininess; -}; - -uniform gl_MaterialParameters gl_FrontMaterial; -uniform gl_MaterialParameters gl_BackMaterial; - -/* NOTE: the order of these fields is significant! - * See the definition of the lighting state vars such as STATE_SPOT_DIRECTION. - */ -struct gl_LightSourceParameters { - vec4 ambient; - vec4 diffuse; - vec4 specular; - vec4 position; - vec4 halfVector; - vec3 spotDirection; - float spotCosCutoff; - - float constantAttenuation; - float linearAttenuation; - float quadraticAttenuation; - float spotExponent; - - float spotCutoff; -}; - -uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights]; - -struct gl_LightModelParameters { - vec4 ambient; -}; - -uniform gl_LightModelParameters gl_LightModel; - -struct gl_LightModelProducts { - vec4 sceneColor; -}; - -uniform gl_LightModelProducts gl_FrontLightModelProduct; -uniform gl_LightModelProducts gl_BackLightModelProduct; - -struct gl_LightProducts { - vec4 ambient; - vec4 diffuse; - vec4 specular; -}; - -uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights]; -uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights]; - -uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits]; -uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords]; -uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords]; -uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords]; -uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords]; -uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords]; -uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords]; -uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords]; -uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords]; - -struct gl_FogParameters { - vec4 color; - float density; - float start; - float end; - float scale; -}; - -uniform gl_FogParameters gl_Fog; - - - - - -// -// 8.1 Angle and Trigonometry Functions -// - -//// radians - -float radians(const float deg) -{ - const float c = 3.1415926 / 180.0; - __asm vec4_multiply __retVal, deg, c; -} - -vec2 radians(const vec2 deg) -{ - const float c = 3.1415926 / 180.0; - __asm vec4_multiply __retVal.xy, deg.xy, c.xx; -} - -vec3 radians(const vec3 deg) -{ - const float c = 3.1415926 / 180.0; - __asm vec4_multiply __retVal.xyz, deg.xyz, c.xxx; -} - -vec4 radians(const vec4 deg) -{ - const float c = 3.1415926 / 180.0; - __asm vec4_multiply __retVal, deg, c.xxxx; -} - - -//// degrees - -float degrees(const float rad) -{ - const float c = 180.0 / 3.1415926; - __asm vec4_multiply __retVal, rad, c; -} - -vec2 degrees(const vec2 rad) -{ - const float c = 180.0 / 3.1415926; - __asm vec4_multiply __retVal.xy, rad.xy, c.xx; -} - -vec3 degrees(const vec3 rad) -{ - const float c = 180.0 / 3.1415926; - __asm vec4_multiply __retVal.xyz, rad.xyz, c.xxx; -} - -vec4 degrees(const vec4 rad) -{ - const float c = 180.0 / 3.1415926; - __asm vec4_multiply __retVal, rad, c.xxxx; -} - - -//// sin - -float sin(const float radians) -{ - __asm float_sine __retVal, radians; -} - -vec2 sin(const vec2 radians) -{ - __asm float_sine __retVal.x, radians.x; - __asm float_sine __retVal.y, radians.y; -} - -vec3 sin(const vec3 radians) -{ - __asm float_sine __retVal.x, radians.x; - __asm float_sine __retVal.y, radians.y; - __asm float_sine __retVal.z, radians.z; -} - -vec4 sin(const vec4 radians) -{ - __asm float_sine __retVal.x, radians.x; - __asm float_sine __retVal.y, radians.y; - __asm float_sine __retVal.z, radians.z; - __asm float_sine __retVal.w, radians.w; -} - - -//// cos - -float cos(const float radians) -{ - __asm float_cosine __retVal, radians; -} - -vec2 cos(const vec2 radians) -{ - __asm float_cosine __retVal.x, radians.x; - __asm float_cosine __retVal.y, radians.y; -} - -vec3 cos(const vec3 radians) -{ - __asm float_cosine __retVal.x, radians.x; - __asm float_cosine __retVal.y, radians.y; - __asm float_cosine __retVal.z, radians.z; -} - -vec4 cos(const vec4 radians) -{ - __asm float_cosine __retVal.x, radians.x; - __asm float_cosine __retVal.y, radians.y; - __asm float_cosine __retVal.z, radians.z; - __asm float_cosine __retVal.w, radians.w; -} - - - -//// tan - -float tan(const float angle) -{ - const float s = sin(angle); - const float c = cos(angle); - return s / c; -} - -vec2 tan(const vec2 angle) -{ - const vec2 s = sin(angle); - const vec2 c = cos(angle); - return s / c; -} - -vec3 tan(const vec3 angle) -{ - const vec3 s = sin(angle); - const vec3 c = cos(angle); - return s / c; -} - -vec4 tan(const vec4 angle) -{ - const vec4 s = sin(angle); - const vec4 c = cos(angle); - return s / c; -} - - - -float asin(const float x) -{ - const float a0 = 1.5707288; // PI/2? - const float a1 = -0.2121144; - const float a2 = 0.0742610; - //const float a3 = -0.0187293; - const float halfPi = 3.1415926 * 0.5; - const float y = abs(x); - // three terms seem to be enough: - __retVal = (halfPi - sqrt(1.0 - y) * (a0 + y * (a1 + a2 * y))) * sign(x); - // otherwise, try four: - //__retVal = (halfPi - sqrt(1.0 - y) * (a0 + y * (a1 + y * (a2 + y * a3)))) * sign(x); -} - -vec2 asin(const vec2 v) -{ - __retVal.x = asin(v.x); - __retVal.y = asin(v.y); -} - -vec3 asin(const vec3 v) -{ - __retVal.x = asin(v.x); - __retVal.y = asin(v.y); - __retVal.z = asin(v.z); -} - -vec4 asin(const vec4 v) -{ - __retVal.x = asin(v.x); - __retVal.y = asin(v.y); - __retVal.z = asin(v.z); - __retVal.w = asin(v.w); -} - -float acos(const float x) -{ - const float halfPi = 3.1415926 * 0.5; - __retVal = halfPi - asin(x); -} - -vec2 acos(const vec2 v) -{ - __retVal.x = acos(v.x); - __retVal.y = acos(v.y); -} - -vec3 acos(const vec3 v) -{ - __retVal.x = acos(v.x); - __retVal.y = acos(v.y); - __retVal.z = acos(v.z); -} - -vec4 acos(const vec4 v) -{ - __retVal.x = acos(v.x); - __retVal.y = acos(v.y); - __retVal.z = acos(v.z); - __retVal.w = acos(v.w); -} - -float atan(const float x) -{ - __retVal = asin(x * inversesqrt(x * x + 1.0)); -} - -vec2 atan(const vec2 y_over_x) -{ - __retVal.x = atan(y_over_x.x); - __retVal.y = atan(y_over_x.y); -} - -vec3 atan(const vec3 y_over_x) -{ - __retVal.x = atan(y_over_x.x); - __retVal.y = atan(y_over_x.y); - __retVal.z = atan(y_over_x.z); -} - -vec4 atan(const vec4 y_over_x) -{ - __retVal.x = atan(y_over_x.x); - __retVal.y = atan(y_over_x.y); - __retVal.z = atan(y_over_x.z); - __retVal.w = atan(y_over_x.w); -} - -float atan(const float y, const float x) -{ - float r; - if (abs(x) > 1.0e-4) { - r = atan(y / x); - if (x < 0.0) { - r = r + sign(y) * 3.141593; - } - } - else { - r = sign(y) * 1.5707965; // pi/2 - } - return r; -} - -vec2 atan(const vec2 u, const vec2 v) -{ - __retVal.x = atan(u.x, v.x); - __retVal.y = atan(u.y, v.y); -} - -vec3 atan(const vec3 u, const vec3 v) -{ - __retVal.x = atan(u.x, v.x); - __retVal.y = atan(u.y, v.y); - __retVal.z = atan(u.z, v.z); -} - -vec4 atan(const vec4 u, const vec4 v) -{ - __retVal.x = atan(u.x, v.x); - __retVal.y = atan(u.y, v.y); - __retVal.z = atan(u.z, v.z); - __retVal.w = atan(u.w, v.w); -} - - -// -// 8.2 Exponential Functions -// - -//// pow - -float pow(const float a, const float b) -{ - __asm float_power __retVal, a, b; -} - -vec2 pow(const vec2 a, const vec2 b) -{ - __asm float_power __retVal.x, a.x, b.x; - __asm float_power __retVal.y, a.y, b.y; -} - -vec3 pow(const vec3 a, const vec3 b) -{ - __asm float_power __retVal.x, a.x, b.x; - __asm float_power __retVal.y, a.y, b.y; - __asm float_power __retVal.z, a.z, b.z; -} - -vec4 pow(const vec4 a, const vec4 b) -{ - __asm float_power __retVal.x, a.x, b.x; - __asm float_power __retVal.y, a.y, b.y; - __asm float_power __retVal.z, a.z, b.z; - __asm float_power __retVal.w, a.w, b.w; -} - - -//// exp - -float exp(const float a) -{ - // NOTE: log2(e) = 1.44269502 - float t = a * 1.44269502; - __asm float_exp2 __retVal, t; -} - -vec2 exp(const vec2 a) -{ - vec2 t = a * 1.44269502; - __asm float_exp2 __retVal.x, t.x; - __asm float_exp2 __retVal.y, t.y; -} - -vec3 exp(const vec3 a) -{ - vec3 t = a * 1.44269502; - __asm float_exp2 __retVal.x, t.x; - __asm float_exp2 __retVal.y, t.y; - __asm float_exp2 __retVal.z, t.z; -} - -vec4 exp(const vec4 a) -{ - vec4 t = a * 1.44269502; - __asm float_exp2 __retVal.x, t.x; - __asm float_exp2 __retVal.y, t.y; - __asm float_exp2 __retVal.z, t.z; - __asm float_exp2 __retVal.w, t.w; -} - - - -//// log2 - -float log2(const float x) -{ - __asm float_log2 __retVal, x; -} - -vec2 log2(const vec2 v) -{ - __asm float_log2 __retVal.x, v.x; - __asm float_log2 __retVal.y, v.y; -} - -vec3 log2(const vec3 v) -{ - __asm float_log2 __retVal.x, v.x; - __asm float_log2 __retVal.y, v.y; - __asm float_log2 __retVal.z, v.z; -} - -vec4 log2(const vec4 v) -{ - __asm float_log2 __retVal.x, v.x; - __asm float_log2 __retVal.y, v.y; - __asm float_log2 __retVal.z, v.z; - __asm float_log2 __retVal.w, v.w; -} - - -//// log (natural log) - -float log(const float x) -{ - // note: logBaseB(x) = logBaseN(x) / logBaseN(B) - // compute log(x) = log2(x) / log2(e) - // c = 1.0 / log2(e) = 0.693147181 - const float c = 0.693147181; - return log2(x) * c; -} - -vec2 log(const vec2 v) -{ - const float c = 0.693147181; - return log2(v) * c; -} - -vec3 log(const vec3 v) -{ - const float c = 0.693147181; - return log2(v) * c; -} - -vec4 log(const vec4 v) -{ - const float c = 0.693147181; - return log2(v) * c; -} - - -//// exp2 - -float exp2(const float a) -{ - __asm float_exp2 __retVal, a; -} - -vec2 exp2(const vec2 a) -{ - __asm float_exp2 __retVal.x, a.x; - __asm float_exp2 __retVal.y, a.y; -} - -vec3 exp2(const vec3 a) -{ - __asm float_exp2 __retVal.x, a.x; - __asm float_exp2 __retVal.y, a.y; - __asm float_exp2 __retVal.z, a.z; -} - -vec4 exp2(const vec4 a) -{ - __asm float_exp2 __retVal.x, a.x; - __asm float_exp2 __retVal.y, a.y; - __asm float_exp2 __retVal.z, a.z; - __asm float_exp2 __retVal.w, a.w; -} - - -//// sqrt - -float sqrt(const float x) -{ - float r; - __asm float_rsq r, x; - __asm float_rcp __retVal, r; -} - -vec2 sqrt(const vec2 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; -} - -vec3 sqrt(const vec3 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; - __asm float_rsq r, v.z; - __asm float_rcp __retVal.z, r; -} - -vec4 sqrt(const vec4 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; - __asm float_rsq r, v.z; - __asm float_rcp __retVal.z, r; - __asm float_rsq r, v.w; - __asm float_rcp __retVal.w, r; -} - - -//// inversesqrt - -float inversesqrt(const float x) -{ - __asm float_rsq __retVal.x, x; -} - -vec2 inversesqrt(const vec2 v) -{ - __asm float_rsq __retVal.x, v.x; - __asm float_rsq __retVal.y, v.y; -} - -vec3 inversesqrt(const vec3 v) -{ - __asm float_rsq __retVal.x, v.x; - __asm float_rsq __retVal.y, v.y; - __asm float_rsq __retVal.z, v.z; -} - -vec4 inversesqrt(const vec4 v) -{ - __asm float_rsq __retVal.x, v.x; - __asm float_rsq __retVal.y, v.y; - __asm float_rsq __retVal.z, v.z; - __asm float_rsq __retVal.w, v.w; -} - - -//// normalize - -float normalize(const float x) -{ - __retVal = 1.0; -} - -vec2 normalize(const vec2 v) -{ - const float s = inversesqrt(dot(v, v)); - __asm vec4_multiply __retVal.xy, v, s; -} - -vec3 normalize(const vec3 v) -{ -// const float s = inversesqrt(dot(v, v)); -// __retVal = v * s; -// XXX note, we _could_ use __retVal.w instead of tmp and and save a -// register, but that's actually a compilation error because v is a vec3 -// and the .w suffix is illegal. Oh well. - float tmp; - __asm vec3_dot tmp, v, v; - __asm float_rsq tmp, tmp; - __asm vec4_multiply __retVal.xyz, v, tmp; -} - -vec4 normalize(const vec4 v) -{ - float tmp; - __asm vec4_dot tmp, v, v; - __asm float_rsq tmp, tmp; - __asm vec4_multiply __retVal.xyz, v, tmp; -} - - - -// -// 8.3 Common Functions -// - - -//// abs - -float abs(const float a) -{ - __asm vec4_abs __retVal, a; -} - -vec2 abs(const vec2 a) -{ - __asm vec4_abs __retVal.xy, a; -} - -vec3 abs(const vec3 a) -{ - __asm vec4_abs __retVal.xyz, a; -} - -vec4 abs(const vec4 a) -{ - __asm vec4_abs __retVal, a; -} - - -//// sign - -float sign(const float x) -{ - float p, n; - __asm vec4_sgt p, x, 0.0; // p = (x > 0) - __asm vec4_sgt n, 0.0, x; // n = (x < 0) - __asm vec4_subtract __retVal, p, n; // sign = p - n -} - -vec2 sign(const vec2 v) -{ - vec2 p, n; - __asm vec4_sgt p.xy, v, 0.0; - __asm vec4_sgt n.xy, 0.0, v; - __asm vec4_subtract __retVal.xy, p, n; -} - -vec3 sign(const vec3 v) -{ - vec3 p, n; - __asm vec4_sgt p.xyz, v, 0.0; - __asm vec4_sgt n.xyz, 0.0, v; - __asm vec4_subtract __retVal.xyz, p, n; -} - -vec4 sign(const vec4 v) -{ - vec4 p, n; - __asm vec4_sgt p, v, 0.0; - __asm vec4_sgt n, 0.0, v; - __asm vec4_subtract __retVal, p, n; -} - - -//// floor - -float floor(const float a) -{ - __asm vec4_floor __retVal, a; -} - -vec2 floor(const vec2 a) -{ - __asm vec4_floor __retVal.xy, a; -} - -vec3 floor(const vec3 a) -{ - __asm vec4_floor __retVal.xyz, a; -} - -vec4 floor(const vec4 a) -{ - __asm vec4_floor __retVal, a; -} - - -//// ceil - -float ceil(const float a) -{ - // XXX this could be improved - float b = -a; - __asm vec4_floor b, b; - __retVal = -b; -} - -vec2 ceil(const vec2 a) -{ - vec2 b = -a; - __asm vec4_floor b, b; - __retVal.xy = -b; -} - -vec3 ceil(const vec3 a) -{ - vec3 b = -a; - __asm vec4_floor b, b; - __retVal.xyz = -b; -} - -vec4 ceil(const vec4 a) -{ - vec4 b = -a; - __asm vec4_floor b, b; - __retVal = -b; -} - - -//// fract - -float fract(const float a) -{ - __asm vec4_frac __retVal, a; -} - -vec2 fract(const vec2 a) -{ - __asm vec4_frac __retVal.xy, a; -} - -vec3 fract(const vec3 a) -{ - __asm vec4_frac __retVal.xyz, a; -} - -vec4 fract(const vec4 a) -{ - __asm vec4_frac __retVal, a; -} - - -//// mod (very untested!) - -float mod(const float a, const float b) -{ - float oneOverB; - __asm float_rcp oneOverB, b; - __retVal = a - b * floor(a * oneOverB); -} - -vec2 mod(const vec2 a, const float b) -{ - float oneOverB; - __asm float_rcp oneOverB, b; - __retVal.xy = a - b * floor(a * oneOverB); -} - -vec3 mod(const vec3 a, const float b) -{ - float oneOverB; - __asm float_rcp oneOverB, b; - __retVal.xyz = a - b * floor(a * oneOverB); -} - -vec4 mod(const vec4 a, const float b) -{ - float oneOverB; - __asm float_rcp oneOverB, b; - __retVal = a - b * floor(a * oneOverB); -} - -vec2 mod(const vec2 a, const vec2 b) -{ - vec2 oneOverB; - __asm float_rcp oneOverB.x, b.x; - __asm float_rcp oneOverB.y, b.y; - __retVal = a - b * floor(a * oneOverB); -} - -vec3 mod(const vec3 a, const vec3 b) -{ - vec3 oneOverB; - __asm float_rcp oneOverB.x, b.x; - __asm float_rcp oneOverB.y, b.y; - __asm float_rcp oneOverB.z, b.z; - __retVal = a - b * floor(a * oneOverB); -} - -vec4 mod(const vec4 a, const vec4 b) -{ - vec4 oneOverB; - __asm float_rcp oneOverB.x, b.x; - __asm float_rcp oneOverB.y, b.y; - __asm float_rcp oneOverB.z, b.z; - __asm float_rcp oneOverB.w, b.w; - __retVal = a - b * floor(a * oneOverB); -} - - -//// min - -float min(const float a, const float b) -{ - __asm vec4_min __retVal, a, b; -} - -vec2 min(const vec2 a, const vec2 b) -{ - __asm vec4_min __retVal.xy, a.xy, b.xy; -} - -vec3 min(const vec3 a, const vec3 b) -{ - __asm vec4_min __retVal.xyz, a.xyz, b.xyz; -} - -vec4 min(const vec4 a, const vec4 b) -{ - __asm vec4_min __retVal, a, b; -} - -vec2 min(const vec2 a, const float b) -{ - __asm vec4_min __retVal, a.xy, b; -} - -vec3 min(const vec3 a, const float b) -{ - __asm vec4_min __retVal, a.xyz, b; -} - -vec4 min(const vec4 a, const float b) -{ - __asm vec4_min __retVal, a, b; -} - - -//// max - -float max(const float a, const float b) -{ - __asm vec4_max __retVal, a, b; -} - -vec2 max(const vec2 a, const vec2 b) -{ - __asm vec4_max __retVal.xy, a.xy, b.xy; -} - -vec3 max(const vec3 a, const vec3 b) -{ - __asm vec4_max __retVal.xyz, a.xyz, b.xyz; -} - -vec4 max(const vec4 a, const vec4 b) -{ - __asm vec4_max __retVal, a, b; -} - -vec2 max(const vec2 a, const float b) -{ - __asm vec4_max __retVal, a.xy, b; -} - -vec3 max(const vec3 a, const float b) -{ - __asm vec4_max __retVal, a.xyz, b; -} - -vec4 max(const vec4 a, const float b) -{ - __asm vec4_max __retVal, a, b; -} - - -//// clamp - -float clamp(const float val, const float minVal, const float maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec2 clamp(const vec2 val, const float minVal, const float maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec3 clamp(const vec3 val, const float minVal, const float maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec4 clamp(const vec4 val, const float minVal, const float maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec2 clamp(const vec2 val, const vec2 minVal, const vec2 maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec3 clamp(const vec3 val, const vec3 minVal, const vec3 maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - -vec4 clamp(const vec4 val, const vec4 minVal, const vec4 maxVal) -{ - __asm vec4_clamp __retVal, val, minVal, maxVal; -} - - -//// mix - -float mix(const float x, const float y, const float a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec2 mix(const vec2 x, const vec2 y, const float a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec3 mix(const vec3 x, const vec3 y, const float a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec4 mix(const vec4 x, const vec4 y, const float a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec2 mix(const vec2 x, const vec2 y, const vec2 a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec3 mix(const vec3 x, const vec3 y, const vec3 a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - -vec4 mix(const vec4 x, const vec4 y, const vec4 a) -{ - __asm vec4_lrp __retVal, a, y, x; -} - - -//// step - -float step(const float edge, const float x) -{ - __asm vec4_sge __retVal, x, edge; -} - -vec2 step(const vec2 edge, const vec2 x) -{ - __asm vec4_sge __retVal.xy, x, edge; -} - -vec3 step(const vec3 edge, const vec3 x) -{ - __asm vec4_sge __retVal.xyz, x, edge; -} - -vec4 step(const vec4 edge, const vec4 x) -{ - __asm vec4_sge __retVal, x, edge; -} - -vec2 step(const float edge, const vec2 v) -{ - __asm vec4_sge __retVal.xy, v, edge; -} - -vec3 step(const float edge, const vec3 v) -{ - __asm vec4_sge __retVal.xyz, v, edge; -} - -vec4 step(const float edge, const vec4 v) -{ - __asm vec4_sge __retVal, v, edge; -} - - -//// smoothstep - -float smoothstep(const float edge0, const float edge1, const float x) -{ - float t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec2 smoothstep(const vec2 edge0, const vec2 edge1, const vec2 v) -{ - vec2 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec3 smoothstep(const vec3 edge0, const vec3 edge1, const vec3 v) -{ - vec3 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec4 smoothstep(const vec4 edge0, const vec4 edge1, const vec4 v) -{ - vec4 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec2 smoothstep(const float edge0, const float edge1, const vec2 v) -{ - vec2 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec3 smoothstep(const float edge0, const float edge1, const vec3 v) -{ - vec3 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -vec4 smoothstep(const float edge0, const float edge1, const vec4 v) -{ - vec4 t = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - - - -// -// 8.4 Geometric Functions -// - - -//// length - -float length(const float x) -{ - return abs(x); -} - -float length(const vec2 v) -{ - float r; - const float p = dot(v, v); // p = v.x * v.x + v.y * v.y - __asm float_rsq r, p; // r = 1 / sqrt(p) - __asm float_rcp __retVal.x, r; // retVal = 1 / r -} - -float length(const vec3 v) -{ - float r; - const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + v.z * v.z - __asm float_rsq r, p; // r = 1 / sqrt(p) - __asm float_rcp __retVal, r; // retVal = 1 / r -} - -float length(const vec4 v) -{ - float r; - const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + ... - __asm float_rsq r, p; // r = 1 / sqrt(p) - __asm float_rcp __retVal, r; // retVal = 1 / r -} - - -//// distance - -float distance(const float x, const float y) -{ - const float d = x - y; - __retVal = length(d); -} - -float distance(const vec2 v, const vec2 u) -{ - const vec2 d2 = v - u; - __retVal = length(d2); -} - -float distance(const vec3 v, const vec3 u) -{ - const vec3 d3 = v - u; - __retVal = length(d3); -} - -float distance(const vec4 v, const vec4 u) -{ - const vec4 d4 = v - u; - __retVal = length(d4); -} - - -//// cross - -vec3 cross(const vec3 v, const vec3 u) -{ - __asm vec3_cross __retVal.xyz, v, u; -} - - -//// faceforward - -float faceforward(const float N, const float I, const float Nref) -{ - // this could probably be done better - const float d = dot(Nref, I); - float s; - __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 - return mix(-N, N, s); -} - -vec2 faceforward(const vec2 N, const vec2 I, const vec2 Nref) -{ - // this could probably be done better - const float d = dot(Nref, I); - float s; - __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 - return mix(-N, N, s); -} - -vec3 faceforward(const vec3 N, const vec3 I, const vec3 Nref) -{ - // this could probably be done better - const float d = dot(Nref, I); - float s; - __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 - return mix(-N, N, s); -} - -vec4 faceforward(const vec4 N, const vec4 I, const vec4 Nref) -{ - // this could probably be done better - const float d = dot(Nref, I); - float s; - __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 - return mix(-N, N, s); -} - - -//// reflect - -float reflect(const float I, const float N) -{ - return I - 2.0 * dot(N, I) * N; -} - -vec2 reflect(const vec2 I, const vec2 N) -{ - return I - 2.0 * dot(N, I) * N; -} - -vec3 reflect(const vec3 I, const vec3 N) -{ - return I - 2.0 * dot(N, I) * N; -} - -vec4 reflect(const vec4 I, const vec4 N) -{ - return I - 2.0 * dot(N, I) * N; -} - -//// refract - -float refract(const float I, const float N, const float eta) -{ - float n_dot_i = dot(N, I); - float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); - float retval; - if (k < 0.0) - retval = 0.0; - else - retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; - return retval; -} - -vec2 refract(const vec2 I, const vec2 N, const float eta) -{ - float n_dot_i = dot(N, I); - float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); - vec2 retval; - if (k < 0.0) - retval = vec2(0.0); - else - retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; - return retval; -} - -vec3 refract(const vec3 I, const vec3 N, const float eta) -{ - float n_dot_i = dot(N, I); - float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); - vec3 retval; - if (k < 0.0) - retval = vec3(0.0); - else - retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; - return retval; -} - -vec4 refract(const vec4 I, const vec4 N, const float eta) -{ - float n_dot_i = dot(N, I); - float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); - vec4 retval; - if (k < 0.0) - retval = vec4(0.0); - else - retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; - return retval; -} - - - - -// -// 8.5 Matrix Functions -// - -mat2 matrixCompMult (mat2 m, mat2 n) { - return mat2 (m[0] * n[0], m[1] * n[1]); -} - -mat3 matrixCompMult (mat3 m, mat3 n) { - return mat3 (m[0] * n[0], m[1] * n[1], m[2] * n[2]); -} - -mat4 matrixCompMult (mat4 m, mat4 n) { - return mat4 (m[0] * n[0], m[1] * n[1], m[2] * n[2], m[3] * n[3]); -} - - - - -// -// 8.6 Vector Relational Functions -// - -//// lessThan - -bvec2 lessThan(const vec2 u, const vec2 v) -{ - __asm vec4_slt __retVal.xy, u, v; -} - -bvec3 lessThan(const vec3 u, const vec3 v) -{ - __asm vec4_slt __retVal.xyz, u, v; -} - -bvec4 lessThan(const vec4 u, const vec4 v) -{ - __asm vec4_slt __retVal, u, v; -} - -bvec2 lessThan(const ivec2 u, const ivec2 v) -{ - __asm vec4_slt __retVal.xy, u, v; -} - -bvec3 lessThan(const ivec3 u, const ivec3 v) -{ - __asm vec4_slt __retVal.xyz, u, v; -} - -bvec4 lessThan(const ivec4 u, const ivec4 v) -{ - __asm vec4_slt __retVal, u, v; -} - - -//// lessThanEqual - -bvec2 lessThanEqual(const vec2 u, const vec2 v) -{ - __asm vec4_sle __retVal.xy, u, v; -} - -bvec3 lessThanEqual(const vec3 u, const vec3 v) -{ - __asm vec4_sle __retVal.xyz, u, v; -} - -bvec4 lessThanEqual(const vec4 u, const vec4 v) -{ - __asm vec4_sle __retVal, u, v; -} - -bvec2 lessThanEqual(const ivec2 u, const ivec2 v) -{ - __asm vec4_sle __retVal.xy, u, v; -} - -bvec3 lessThanEqual(const ivec3 u, const ivec3 v) -{ - __asm vec4_sle __retVal.xyz, u, v; -} - -bvec4 lessThanEqual(const ivec4 u, const ivec4 v) -{ - __asm vec4_sle __retVal, u, v; -} - - -//// greaterThan - -bvec2 greaterThan(const vec2 u, const vec2 v) -{ - __asm vec4_sgt __retVal.xy, u, v; -} - -bvec3 greaterThan(const vec3 u, const vec3 v) -{ - __asm vec4_sgt __retVal.xyz, u, v; -} - -bvec4 greaterThan(const vec4 u, const vec4 v) -{ - __asm vec4_sgt __retVal, u, v; -} - -bvec2 greaterThan(const ivec2 u, const ivec2 v) -{ - __asm vec4_sgt __retVal.xy, u.xy, v.xy; -} - -bvec3 greaterThan(const ivec3 u, const ivec3 v) -{ - __asm vec4_sgt __retVal.xyz, u, v; -} - -bvec4 greaterThan(const ivec4 u, const ivec4 v) -{ - __asm vec4_sgt __retVal, u, v; -} - - -//// greaterThanEqual - -bvec2 greaterThanEqual(const vec2 u, const vec2 v) -{ - __asm vec4_sge __retVal.xy, u, v; -} - -bvec3 greaterThanEqual(const vec3 u, const vec3 v) -{ - __asm vec4_sge __retVal.xyz, u, v; -} - -bvec4 greaterThanEqual(const vec4 u, const vec4 v) -{ - __asm vec4_sge __retVal, u, v; -} - -bvec2 greaterThanEqual(const ivec2 u, const ivec2 v) -{ - __asm vec4_sge __retVal.xy, u, v; -} - -bvec3 greaterThanEqual(const ivec3 u, const ivec3 v) -{ - __asm vec4_sge __retVal.xyz, u, v; -} - -bvec4 greaterThanEqual(const ivec4 u, const ivec4 v) -{ - __asm vec4_sge __retVal, u, v; -} - - -//// equal - -bvec2 equal(const vec2 u, const vec2 v) -{ - __asm vec4_seq __retVal.xy, u, v; -} - -bvec3 equal(const vec3 u, const vec3 v) -{ - __asm vec4_seq __retVal.xyz, u, v; -} - -bvec4 equal(const vec4 u, const vec4 v) -{ - __asm vec4_seq __retVal, u, v; -} - -bvec2 equal(const ivec2 u, const ivec2 v) -{ - __asm vec4_seq __retVal.xy, u, v; -} - -bvec3 equal(const ivec3 u, const ivec3 v) -{ - __asm vec4_seq __retVal.xyz, u, v; -} - -bvec4 equal(const ivec4 u, const ivec4 v) -{ - __asm vec4_seq __retVal, u, v; -} - -bvec2 equal(const bvec2 u, const bvec2 v) -{ - __asm vec4_seq __retVal.xy, u, v; -} - -bvec3 equal(const bvec3 u, const bvec3 v) -{ - __asm vec4_seq __retVal.xyz, u, v; -} - -bvec4 equal(const bvec4 u, const bvec4 v) -{ - __asm vec4_seq __retVal, u, v; -} - - - - -//// notEqual - -bvec2 notEqual(const vec2 u, const vec2 v) -{ - __asm vec4_sne __retVal.xy, u, v; -} - -bvec3 notEqual(const vec3 u, const vec3 v) -{ - __asm vec4_sne __retVal.xyz, u, v; -} - -bvec4 notEqual(const vec4 u, const vec4 v) -{ - __asm vec4_sne __retVal, u, v; -} - -bvec2 notEqual(const ivec2 u, const ivec2 v) -{ - __asm vec4_sne __retVal.xy, u, v; -} - -bvec3 notEqual(const ivec3 u, const ivec3 v) -{ - __asm vec4_sne __retVal.xyz, u, v; -} - -bvec4 notEqual(const ivec4 u, const ivec4 v) -{ - __asm vec4_sne __retVal, u, v; -} - -bvec2 notEqual(const bvec2 u, const bvec2 v) -{ - __asm vec4_sne __retVal.xy, u, v; -} - -bvec3 notEqual(const bvec3 u, const bvec3 v) -{ - __asm vec4_sne __retVal.xyz, u, v; -} - -bvec4 notEqual(const bvec4 u, const bvec4 v) -{ - __asm vec4_sne __retVal, u, v; -} - - - -//// any - -bool any(const bvec2 v) -{ - float sum; - __asm vec4_add sum.x, v.x, v.y; - __asm vec4_sne __retVal.x, sum.x, 0.0; -} - -bool any(const bvec3 v) -{ - float sum; - __asm vec4_add sum.x, v.x, v.y; - __asm vec4_add sum.x, sum.x, v.z; - __asm vec4_sne __retVal.x, sum.x, 0.0; -} - -bool any(const bvec4 v) -{ - float sum; - __asm vec4_add sum.x, v.x, v.y; - __asm vec4_add sum.x, sum.x, v.z; - __asm vec4_add sum.x, sum.x, v.w; - __asm vec4_sne __retVal.x, sum.x, 0.0; -} - - -//// all - -bool all (const bvec2 v) -{ - float prod; - __asm vec4_multiply prod, v.x, v.y; - __asm vec4_sne __retVal, prod, 0.0; -} - -bool all (const bvec3 v) -{ - float prod; - __asm vec4_multiply prod, v.x, v.y; - __asm vec4_multiply prod, prod, v.z; - __asm vec4_sne __retVal, prod, 0.0; -} - -bool all (const bvec4 v) -{ - float prod; - __asm vec4_multiply prod, v.x, v.y; - __asm vec4_multiply prod, prod, v.z; - __asm vec4_multiply prod, prod, v.w; - __asm vec4_sne __retVal, prod, 0.0; -} - - - -//// not - -bvec2 not (const bvec2 v) -{ - __asm vec4_seq __retVal.xy, v, 0.0; -} - -bvec3 not (const bvec3 v) -{ - __asm vec4_seq __retVal.xyz, v, 0.0; -} - -bvec4 not (const bvec4 v) -{ - __asm vec4_seq __retVal, v, 0.0; -} - - - -//// Texture Lookup Functions (for both fragment and vertex shaders) - -vec4 texture1D(const sampler1D sampler, const float coord) -{ - __asm vec4_tex1d __retVal, sampler, coord; -} - -vec4 texture1DProj(const sampler1D sampler, const vec2 coord) -{ - // need to swizzle .y into .w - __asm vec4_texp1d __retVal, sampler, coord.xyyy; -} - -vec4 texture1DProj(const sampler1D sampler, const vec4 coord) -{ - __asm vec4_texp1d __retVal, sampler, coord; -} - - -vec4 texture2D(const sampler2D sampler, const vec2 coord) -{ - __asm vec4_tex2d __retVal, sampler, coord; -} - -vec4 texture2DProj(const sampler2D sampler, const vec3 coord) -{ - // need to swizzle 'z' into 'w'. - __asm vec4_texp2d __retVal, sampler, coord.xyzz; -} - -vec4 texture2DProj(const sampler2D sampler, const vec4 coord) -{ - __asm vec4_texp2d __retVal, sampler, coord; -} - - -vec4 texture3D(const sampler3D sampler, const vec3 coord) -{ - __asm vec4_tex3d __retVal, sampler, coord; -} - -vec4 texture3DProj(const sampler3D sampler, const vec4 coord) -{ - __asm vec4_texp3d __retVal, sampler, coord; -} - - -vec4 textureCube(const samplerCube sampler, const vec3 coord) -{ - __asm vec4_texcube __retVal, sampler, coord; -} - - - -vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord) -{ - __asm vec4_tex1d __retVal, sampler, coord; -} - -vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord) -{ - // .s and .p will be divided by .q - __asm vec4_texp1d __retVal, sampler, coord; -} - -vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) -{ - __asm vec4_tex2d __retVal, sampler, coord; -} - -vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord) -{ - // .s, .t and .p will be divided by .q - __asm vec4_texp2d __retVal, sampler, coord; -} - - -//// GL_ARB_texture_rectangle: -vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) -{ - __asm vec4_tex_rect __retVal, sampler, coord; -} - -vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) -{ - // need to swizzle .y into .w - __asm vec4_texp_rect __retVal, sampler, coord.xyzz; -} - -vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) -{ - __asm vec4_texp_rect __retVal, sampler, ccoord; -} - -vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) -{ - __asm vec4_tex_rect __retVal, sampler, coord; -} - -vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) -{ - __asm vec4_texp_rect __retVal, sampler, coord; -} - - - -// -// 8.9 Noise Functions -// -// AUTHOR: Stefan Gustavson (stegu@itn.liu.se), Nov 26, 2005 -// - -float noise1(const float x) -{ - __asm float_noise1 __retVal, x; -} - - -float noise1(const vec2 x) -{ - __asm float_noise2 __retVal, x; -} - -float noise1(const vec3 x) -{ - __asm float_noise3 __retVal, x; -} - -float noise1(const vec4 x) -{ - __asm float_noise4 __retVal, x; -} - -vec2 noise2(const float x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + 19.34); -} - -vec2 noise2(const vec2 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec2(19.34, 7.66)); -} - -vec2 noise2(const vec3 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec3(19.34, 7.66, 3.23)); -} - -vec2 noise2(const vec4 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec4(19.34, 7.66, 3.23, 2.77)); -} - -vec3 noise3(const float x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + 19.34); - __retVal.z = noise1(x + 5.47); -} - -vec3 noise3(const vec2 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec2(19.34, 7.66)); - __retVal.z = noise1(x + vec2(5.47, 17.85)); -} - -vec3 noise3(const vec3 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec3(19.34, 7.66, 3.23)); - __retVal.z = noise1(x + vec3(5.47, 17.85, 11.04)); -} - -vec3 noise3(const vec4 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec4(19.34, 7.66, 3.23, 2.77)); - __retVal.z = noise1(x + vec4(5.47, 17.85, 11.04, 13.19)); -} - -vec4 noise4(const float x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + 19.34); - __retVal.z = noise1(x + 5.47); - __retVal.w = noise1(x + 23.54); -} - -vec4 noise4(const vec2 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec2 (19.34, 7.66)); - __retVal.z = noise1(x + vec2 (5.47, 17.85)); - __retVal.w = noise1(x + vec2 (23.54, 29.11)); -} - -vec4 noise4(const vec3 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec3(19.34, 7.66, 3.23)); - __retVal.z = noise1(x + vec3(5.47, 17.85, 11.04)); - __retVal.w = noise1(x + vec3(23.54, 29.11, 31.91)); -} - -vec4 noise4(const vec4 x) -{ - __retVal.x = noise1(x); - __retVal.y = noise1(x + vec4(19.34, 7.66, 3.23, 2.77)); - __retVal.z = noise1(x + vec4(5.47, 17.85, 11.04, 13.19)); - __retVal.w = noise1(x + vec4(23.54, 29.11, 31.91, 37.48)); -} diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin_gc.h deleted file mode 100644 index 759bf247d8..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_common_builtin_gc.h +++ /dev/null @@ -1,868 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_common_builtin.gc */ - -5,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,90,95,1,0, -5,0,1,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,90,95,1,0,5, -0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0, -0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2, -16,10,49,54,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,85,110,105,102, -111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,53,49,50,0,0,0,2,2,90,95,1,0,5,0,1, -103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,115,0,2,16,10,51,50,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,114,101,73,109,97,103, -101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,67,111,109,98, -105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,10,50,0,0,0, -2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105, -116,115,0,2,16,10,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116, -85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,90,95, -1,0,5,0,1,103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,90, -95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97, -116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, -120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95, -4,0,14,0,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103, -108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2, -2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110, -118,101,114,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114, -111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,15, -0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111, -115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114, -105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108, -86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112, -111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120, -84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111, -111,114,100,115,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116, -114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0, -1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115, -101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86, -105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101, -84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101, -77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,9,0,1,103,108, -95,78,111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,90,95,0,0,24,103,108,95,68,101,112,116,104,82, -97,110,103,101,80,97,114,97,109,101,116,101,114,115,0,9,0,110,101,97,114,0,0,0,1,9,0,102,97,114,0, -0,0,1,9,0,100,105,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,68,101,112,116,104,82,97,110, -103,101,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101, -0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120, -67,108,105,112,80,108,97,110,101,115,0,0,0,2,2,90,95,0,0,24,103,108,95,80,111,105,110,116,80,97, -114,97,109,101,116,101,114,115,0,9,0,115,105,122,101,0,0,0,1,9,0,115,105,122,101,77,105,110,0,0,0, -1,9,0,115,105,122,101,77,97,120,0,0,0,1,9,0,102,97,100,101,84,104,114,101,115,104,111,108,100,83, -105,122,101,0,0,0,1,9,0,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116,65,116,116,101, -110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,76,105,110,101,97,114,65,116, -116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,81,117,97,100,114,97, -116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,80, -111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,80,111,105,110,116,0,0,0,2,2, -90,95,0,0,24,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,0, -101,109,105,115,115,105,111,110,0,0,0,1,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102, -102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,9,0,115,104,105,110,105,110,101, -115,115,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109, -101,116,101,114,115,0,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,90, -95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103, -108,95,66,97,99,107,77,97,116,101,114,105,97,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104, -116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,12,0,97,109,98,105,101,110,116,0, -0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,12,0,112, -111,115,105,116,105,111,110,0,0,0,1,12,0,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,0,115,112, -111,116,68,105,114,101,99,116,105,111,110,0,0,0,1,9,0,115,112,111,116,67,111,115,67,117,116,111, -102,102,0,0,0,1,9,0,99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0, -1,9,0,108,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,113,117,97,100, -114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,115,112,111,116,69,120,112, -111,110,101,110,116,0,0,0,1,9,0,115,112,111,116,67,117,116,111,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0, -25,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,0,1, -103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116, -115,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101, -116,101,114,115,0,12,0,97,109,98,105,101,110,116,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105, -103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76,105,103, -104,116,77,111,100,101,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108, -80,114,111,100,117,99,116,115,0,12,0,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,0,2,2,90,95, -4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0, -1,103,108,95,66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,0,0,24,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,0,97,109,98,105, -101,110,116,0,0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0, -0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120, -76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99, -116,115,0,0,1,103,108,95,66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108, -95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,84,101,120,116,117,114, -101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97, -103,101,85,110,105,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,83,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,82,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97, -110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2, -90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120, -84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106, -101,99,116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,0,0,24,103, -108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,12,0,99,111,108,111,114,0,0,0,1,9,0,100, -101,110,115,105,116,121,0,0,0,1,9,0,115,116,97,114,116,0,0,0,1,9,0,101,110,100,0,0,0,1,9,0,115,99, -97,108,101,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114, -115,0,0,1,103,108,95,70,111,103,0,0,0,1,90,95,0,0,9,0,0,114,97,100,105,97,110,115,0,1,1,0,0,9,0, -100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,100,101,103,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,114,97,100,105,97,110,115,0,1,1,0,0,10,0,100, -101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0, -49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,114,97, -100,105,97,110,115,0,1,1,0,0,11,0,100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49, -53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59, -120,120,120,0,0,0,0,1,90,95,0,0,12,0,0,114,97,100,105,97,110,115,0,1,1,0,0,12,0,100,101,103,0,0,0, -1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0, -0,18,99,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,100,101,103,114,101,101,115,0,1,1,0,0,9,0, -114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,114,97,100,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,100,101,103,114,101,101,115,0,1,1,0,0,10,0,114, -97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,100,101,103, -114,101,101,115,0,1,1,0,0,11,0,114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0, -17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120, -120,120,0,0,0,0,1,90,95,0,0,12,0,0,100,101,103,114,101,101,115,0,1,1,0,0,12,0,114,97,100,0,0,0,1,3, -2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99, -0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,115,105,110,0,1,1,0,0,9,0,114,97,100,105,97,110,115, -0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100, -105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,115,105,110,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0, -0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,115, -105,110,0,1,1,0,0,11,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108, -111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97, -110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,115,105,110,0,1,1,0,0, -12,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114, -97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,99,111, -115,0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,99, -111,115,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0, -4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,99,111,115,0,1,1,0,0,11,0,114,97,100, -105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,99,111,115,0,1,1,0,0,12,0,114,97, -100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111, -115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59, -121,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122, -0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95, -0,0,9,0,0,116,97,110,0,1,1,0,0,9,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,115, -105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,9,0,1,99,0,2,58,99,111,115,0,0,18,97,110, -103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,10,0,0,116,97,110,0,1,1,0,0,10,0,97, -110,103,108,101,0,0,0,1,3,2,90,95,1,0,10,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0, -0,0,0,3,2,90,95,1,0,10,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18, -99,0,49,0,0,1,90,95,0,0,11,0,0,116,97,110,0,1,1,0,0,11,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0, -11,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,11,0,1,99,0,2,58, -99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,12,0,0,116,97, -110,0,1,1,0,0,12,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,12,0,1,115,0,2,58,115,105,110,0,0,18, -97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,12,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0, -0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,9,0,0,97,115,105,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2, -90,95,1,0,9,0,1,97,48,0,2,17,49,0,53,55,48,55,50,56,56,0,0,0,0,3,2,90,95,1,0,9,0,1,97,49,0,2,17,48, -0,50,49,50,49,49,52,52,0,0,54,0,0,3,2,90,95,1,0,9,0,1,97,50,0,2,17,48,0,48,55,52,50,54,49,48,0,0,0, -0,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48, -0,0,3,2,90,95,1,0,9,0,1,121,0,2,58,97,98,115,0,0,18,120,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,0,17,49,0,48,0,0,18,121,0,47,0,0,18,97,48,0,18, -121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58,115,105,103,110,0,0,18,120,0,0,0,48,20,0, -0,1,90,95,0,0,10,0,0,97,115,105,110,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,115,105,110,0,1,1,0, -0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0, -20,0,0,1,90,95,0,0,12,0,0,97,115,105,110,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, -58,97,115,105,110,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,99,111,115,0,1,1,0,0,9,0, -120,0,0,0,1,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0, -53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,97,115,105,110,0,0, -18,120,0,0,0,47,20,0,0,1,90,95,0,0,10,0,0,97,99,111,115,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97, -99,111,115,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115, -0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18, -118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18,118,0, -59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,99,111,115,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,122,0,58,97,99,111,115,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,97,99,111,115,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0, -9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,0,18,120,0,58,105,110,118, -101,114,115,101,115,113,114,116,0,0,18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,90, -95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,121,95,111,118,101,114, -95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118, -101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0, -0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, -58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97, -116,97,110,0,1,1,0,0,12,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,121,95, -111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0,9,0,121,0,0, -1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,10,58,97,98,115,0,0,18,120,0,0,0,17,49,0,48, -0,45,52,0,41,0,2,9,18,114,0,58,97,116,97,110,0,0,18,121,0,18,120,0,49,0,0,20,0,10,18,120,0,17,48,0, -48,0,0,40,0,2,9,18,114,0,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,51,0,49,52,49,53,57,51,0, -0,48,46,20,0,0,9,14,0,0,2,9,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,49,0,53,55,48,55,57,54, -53,0,0,48,20,0,0,8,18,114,0,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10, -0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0,59,120,0,0, -18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,117, -0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,117,0,0, -1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0, -59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110, -0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,116,97, -110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,117,0,59,119,0,0,18,118,0,59,119,0, -0,0,20,0,0,1,90,95,0,0,9,0,0,112,111,119,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95, -0,0,10,0,0,112,111,119,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,112,111,119,0,1,1,0,0,11,0,97,0,0,1,1,0, -0,11,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, -18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18, -98,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,112,111,119,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86, -97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, -119,0,0,18,98,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,101,120,112,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,90,95,0,0,10,0,0,101,120,112,0,1,1,0, -0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0, -4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59, -120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -116,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1, -116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101, -120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97, -116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,0,1,90, -95,0,0,12,0,0,101,120,112,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,18,97,0,17,49,0, -52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18, -95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112, -50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,108,111, -103,50,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86, -97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,108,111,103,50,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108, -111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4, -102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,0,1,90,95,0,0,11,0,0,108,111,103,50,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95,108, -111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0, -0,0,1,90,95,0,0,12,0,0,108,111,103,50,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,111,97,116,95,108,111, -103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, -108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111, -97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0, -0,0,1,90,95,0,0,9,0,0,108,111,103,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54, -57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,120,0,0,0,18,99,0,48,0,0,1,90,95,0,0,10, -0,0,108,111,103,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49, -56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,11,0,0,108,111,103,0, -1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8, -58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,12,0,0,108,111,103,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103, -50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,9,0,0,101,120,112,50,0,1,1,0,0,9,0,97,0,0,0,1,4,102, -108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10, -0,0,101,120,112,50,0,1,1,0,0,10,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,50,0,1, -1,0,0,11,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, -108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101,120,112,50,0,1,1,0,0,12,0, -97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121, -0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, -97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114,116,0,1,1,0,0,9,0,120,0,0, -0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0, -10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, -0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,90,95, -0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97, -116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0, -105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0, -11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0, -0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0, -59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, -118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97, -108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115, -101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0, -0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0, -0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, -0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118, -0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0, -18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1, -4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0, -97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99, -52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12, -0,0,97,98,115,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,115,105,103,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9, -0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,120,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0, -0,10,0,0,115,105,103,110,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,112,0,0,1,1,110,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99, -52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0, -0,1,90,95,0,0,11,0,0,115,105,103,110,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,112,0,0,1,1, -110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -112,0,0,18,110,0,0,0,0,1,90,95,0,0,12,0,0,115,105,103,110,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0, -0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95, -115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90, -95,0,0,9,0,0,102,108,111,111,114,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,108,111,111,114,0,1,1,0,0, -10,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,108,111,111,114,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1, -90,95,0,0,12,0,0,102,108,111,111,114,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111, -114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,99,101,105,108,0,1,1,0,0, -9,0,97,0,0,0,1,3,2,90,95,0,0,9,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0, -18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,10,0,0,99, -101,105,108,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52, -95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18, -98,0,54,20,0,0,1,90,95,0,0,11,0,0,99,101,105,108,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,98, -0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,90,95,0,0,12,0,0,99,101,105,108,0,1,1,0,0, -12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114, -0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,9,0,0,102, -114,97,99,116,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86, -97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,114,97,99,116,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101, -99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0, -11,0,0,102,114,97,99,116,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,0,0,102,114,97,99,116,0,1,1,0, -0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, -0,0,1,90,95,0,0,9,0,0,109,111,100,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1, -111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0, -0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110, -101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1, -1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101, -114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,111, -110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58, -102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0, -11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,111,110,101, -79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102, -108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12, -0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,111,110,101,79, -118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, -118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,9,0,0,109,105,110,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105, -110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,105,110,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,0, -109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0, -0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52, -95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109, -105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,105,110,0,1,1,0, -0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,109,97,120,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0, -1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109, -97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59, -120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,97, -120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0, -12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,99,108,97,109,112,0,1,1,0,0,9,0,118,97,108,0,0,1,1,0, -0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108, -97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18, -109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97,108,0,0,1, -1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99, -108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0, -18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0,118,97,108,0,0, -1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95, -99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108, -0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0,0,12,0,118,97,108, -0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, -95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97, -108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97, -108,0,0,1,1,0,0,10,0,109,105,110,86,97,108,0,0,1,1,0,0,10,0,109,97,120,86,97,108,0,0,0,1,4,118,101, -99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110, -86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0, -118,97,108,0,0,1,1,0,0,11,0,109,105,110,86,97,108,0,0,1,1,0,0,11,0,109,97,120,86,97,108,0,0,0,1,4, -118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0, -0,12,0,118,97,108,0,0,1,1,0,0,12,0,109,105,110,86,97,108,0,0,1,1,0,0,12,0,109,97,120,86,97,108,0,0, -0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18, -109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,9,0,0,109,105,120,0,1,1,0,0, -9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1, -0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18, -95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120, -0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112, -0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109, -105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108, -114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0, -0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52, -95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0, -0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90, -95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,12,0,97,0,0,0,1,4, -118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, -0,0,1,90,95,0,0,9,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,9,0,120,0,0,0,1,4, -118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0, -0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,10,0,101,100,103,101,0,0,1,1,0,0,10,0,120,0,0,0, -1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18, -101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101,112,0,1,1,0,0,11,0,101,100,103,101,0,0,1,1, -0,0,11,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,12,0, -101,100,103,101,0,0,1,1,0,0,12,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,9, -0,101,100,103,101,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116, -101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90, -95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1, -90,95,0,0,9,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0, -0,9,0,101,100,103,101,49,0,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,116,0,2,58,99,108,97,109, -112,0,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49, -0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18, -116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,10,0,101, -100,103,101,48,0,0,1,1,0,0,10,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0, -1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, -101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51, -0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116, -101,112,0,1,1,0,0,11,0,101,100,103,101,48,0,0,1,1,0,0,11,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118, -0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47, -18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8, -18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115, -109,111,111,116,104,115,116,101,112,0,1,1,0,0,12,0,101,100,103,101,48,0,0,1,1,0,0,12,0,101,100,103, -101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0, -18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0, -0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0, -0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0, -1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108, -97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0, -47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0, -0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0, -101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49, -0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48, -17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115, -116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0, -47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0, -8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,9,0,0,108, -101,110,103,116,104,0,1,1,0,0,9,0,120,0,0,0,1,8,58,97,98,115,0,0,18,120,0,0,0,0,0,1,90,95,0,0,9,0, -0,108,101,110,103,116,104,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9, -0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90, -95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1, -0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0, -18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0, -100,105,115,116,97,110,99,101,0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,3,2,90,95,1,0,9,0,1, -100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0, -18,100,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,10,0,118,0,0,1,1,0,0, -10,0,117,0,0,0,1,3,2,90,95,1,0,10,0,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116, -86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,50,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115, -116,97,110,99,101,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,1,0,11,0,1,100,51,0,2, -18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100, -51,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,12,0,118,0,0,1,1,0,0,12, -0,117,0,0,0,1,3,2,90,95,1,0,12,0,1,100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,108,101,110,103,116,104,0,0,18,100,52,0,0,0,20,0,0,1,90,95,0,0,11,0,0,99,114,111,115, -115,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,9,0,0,102,97, -99,101,102,111,114,119,97,114,100,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,114,101, -102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3, -2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0, -0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,10,0,0,102,97,99,101, -102,111,114,119,97,114,100,0,1,1,0,0,10,0,78,0,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,114,101,102,0, -0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8, -58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,11,0,0,102,97,99,101,102, -111,114,119,97,114,100,0,1,1,0,0,11,0,78,0,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,114,101,102,0,0,0, -1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0, -0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58, -109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,12,0,0,102,97,99,101,102,111, -114,119,97,114,100,0,1,1,0,0,12,0,78,0,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,114,101,102,0,0,0,1,3, -2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9, -0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109, -105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,9,0,0,114,101,102,108,101,99,116,0, -1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18, -73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,10,0,0,114,101,102,108,101,99,116,0,1,1,0,0,10,0,73,0,0, -1,1,0,0,10,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78, -0,48,47,0,0,1,90,95,0,0,11,0,0,114,101,102,108,101,99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0, -0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90, -95,0,0,12,0,0,114,101,102,108,101,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,0,1,8,18,73,0, -17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,9,0,0,114, -101,102,114,97,99,116,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2, -90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95, -100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,9,0,1,114,101, -116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,17,48,0,48,0,0, -20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111, -116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97, -108,0,0,0,1,90,95,0,0,10,0,0,114,101,102,114,97,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,1, -1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0, -18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97, -0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0, -3,2,90,95,0,0,10,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116, -118,97,108,0,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116, -97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0, -0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,11,0,0,114,101,102,114,97, -99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0, -1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1, -107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95, -105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,11,0,1,114,101,116,118,97,108,0, -0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101,99,51,0,0,17,48,0,48, -0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95, -100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116, -118,97,108,0,0,0,1,90,95,0,0,12,0,0,114,101,102,114,97,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0, -78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111, -116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, -101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47, -48,47,0,0,3,2,90,95,0,0,12,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18, -114,101,116,118,97,108,0,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108, -0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116, -0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,13,0,0,109,97, -116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,13,0,109,0,0,1,0,0,0,13,0,110,0,0,0,1,8,58, -109,97,116,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,14,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,0,14,0,109,0,0,1,0,0,0,14,0,110,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,15,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108, -116,0,1,0,0,0,15,0,109,0,0,1,0,0,0,15,0,110,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0, -0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99, -52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0, -0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4, -118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0, -1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0, -18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0, -118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118, -0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1, -1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97, -108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115, -84,104,97,110,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95, -115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108, -101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1, -1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86, -97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,0, -1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101, -114,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0, -103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2, -0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, -101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0, -18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,7, -0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0, -11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113, -117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101, -114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52, -95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95, -0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117, -97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,10, -0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,11,0,117, -0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,12,0,117, -0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0, -18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0, -118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101, -99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0, -110,111,116,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101, -99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, -118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118, -0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4, -118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0, -0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59, -120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59, -120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115, -117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110, -121,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100, -0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100, -100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99, -52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0, -1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0, -0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,3, -0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0, -48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114, -111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0, -59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114, -111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52, -95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,0,110,111, -116,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0, -0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0, -0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121, -121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100, -0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, -0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50, -100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1, -1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52, -95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18, -95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, -90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90, -95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104, -97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120, -116,117,114,101,50,68,82,101,99,116,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99, -116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80, -114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1, -4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111, -119,50,68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100, -111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, -101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101, -49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101, -116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0,120,0,0,0, -1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, -0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97,116,95,110, -111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,110,111, -105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, -105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101, -50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, -49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0, -18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,90,95,0, -0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0, -0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,12,0, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46, -0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0, -0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0, -0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17, -55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, -0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0, -0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55, -0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0, -17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99, -50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55, -0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49, -0,0,18,120,0,58,118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1, -90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55, -0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17, -49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, -101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0, -57,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17, -49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0, -17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0, -0,0,0,46,0,0,20,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_core.gc b/src/libs/mesa/mesa/shader/slang/library/slang_core.gc deleted file mode 100644 index 0a0d15903b..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_core.gc +++ /dev/null @@ -1,2619 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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 nearly all constructors and operators for built-in data -// types, using extended language syntax. In general, compiler treats -// constructors and operators as ordinary functions with some exceptions. -// For example, the language does not allow functions to be called in -// constant expressions - here the exception is made to allow it. -// -// Each implementation provides its own version of this file. Each -// implementation can define the required set of operators and constructors -// in its own fashion. -// -// The extended language syntax is only present when compiling this file. -// It is implicitly included at the very beginning of the compiled shader, -// so no built-in functions can be used. -// -// To communicate with the implementation, a special extended "__asm" keyword -// is used, followed by an instruction name (any valid identifier), a -// destination variable identifier and a list of zero or more source -// variable identifiers. -// -// A variable identifier is a variable name declared earlier in the code -// (as a function parameter, local or global variable). -// -// An instruction name designates an instruction that must be exported -// by the implementation. Each instruction receives data from source -// variable identifiers and returns data in the destination variable -// identifier. -// -// It is up to the implementation how to define a particular operator -// or constructor. If it is expected to being used rarely, it can be -// defined in terms of other operators and constructors, -// for example: -// -// ivec2 __operator + (const ivec2 x, const ivec2 y) { -// return ivec2 (x[0] + y[0], x[1] + y[1]); -// } -// -// If a particular operator or constructor is expected to be used very -// often or is an atomic operation (that is, an operation that cannot be -// expressed in terms of other operations or would create a dependency -// cycle) it must be defined using one or more __asm constructs. -// -// Each implementation must define constructors for all scalar types -// (bool, float, int). There are 9 scalar-to-scalar constructors -// (including identity constructors). However, since the language -// introduces special constructors (like matrix constructor with a single -// scalar value), implementations must also implement these cases. -// The compiler provides the following algorithm when resolving a constructor: -// - try to find a constructor with a prototype matching ours, -// - if no constructor is found and this is a scalar-to-scalar constructor, -// raise an error, -// - if a constructor is found, execute it and return, -// - count the size of the constructor parameter list - if it is less than -// the size of our constructor's type, raise an error, -// - for each parameter in the list do a recursive constructor matching for -// appropriate scalar fields in the constructed variable, -// -// Each implementation must also define a set of operators that deal with -// built-in data types. -// There are four kinds of operators: -// 1) Operators that are implemented only by the compiler: "()" (function -// call), "," (sequence) and "?:" (selection). -// 2) Operators that are implemented by the compiler by expressing it in -// terms of other operators: -// - "." (field selection) - translated to subscript access, -// - "&&" (logical and) - translated to " ? : -// false", -// - "||" (logical or) - translated to " ? true : ", -// 3) Operators that can be defined by the implementation and if the required -// prototype is not found, standard behaviour is used: -// - "==", "!=", "=" (equality, assignment) - compare or assign -// matching fields one-by-one; -// note that at least operators for scalar data types must be defined -// by the implementation to get it work, -// 4) All other operators not mentioned above. If no required prototype is -// found, an error is raised. An implementation must follow the language -// specification to provide all valid operator prototypes. -// - - - -//// Basic, scalar constructors/casts - -int __constructor(const float f) -{ - __asm vec4_to_ivec4 __retVal, f; -} - -int __constructor(const bool b) -{ - __retVal = b; -} - -int __constructor(const int i) -{ - __retVal = i; -} - -bool __constructor(const int i) -{ - __asm vec4_sne __retVal, i, 0.0; -} - -bool __constructor(const float f) -{ - __asm vec4_sne __retVal, f, 0.0; -} - -bool __constructor(const bool b) -{ - __retVal = b; -} - -float __constructor(const int i) -{ - __asm ivec4_to_vec4 __retVal, i; -} - -float __constructor(const bool b) -{ - __asm ivec4_to_vec4 __retVal, b; -} - -float __constructor(const float f) -{ - __retVal = f; -} - - -//// vec2 constructors - -vec2 __constructor(const float x, const float y) -{ - __retVal.x = x; - __retVal.y = y; -} - -vec2 __constructor(const float f) -{ - __asm vec4_move __retVal.xy, f; -} - -vec2 __constructor(const int i) -{ - __asm ivec4_to_vec4 __retVal.xy, i; -} - -vec2 __constructor(const bool b) -{ - __asm ivec4_to_vec4 __retVal.xy, b; -} - -vec2 __constructor(const bvec2 b) -{ -// __retVal = b; - __asm ivec4_to_vec4 __retVal.xy, b; -} - -vec2 __constructor(const vec3 v) -{ - __asm vec4_move __retVal.xy, v.xy; -} - -vec2 __constructor(const vec4 v) -{ - __asm vec4_move __retVal.xy, v.xy; -} - - -//// vec3 constructors - -vec3 __constructor(const float x, const float y, const float z) -{ - __retVal.x = x; - __retVal.y = y; - __retVal.z = z; -} - -vec3 __constructor(const float f) -{ - // Note: this could be "__retVal.xyz = f" but that's an illegal assignment - __asm vec4_move __retVal.xyz, f; -} - -vec3 __constructor(const int i) -{ - __asm ivec4_to_vec4 __retVal.xyz, i; -} - -vec3 __constructor(const bool b) -{ - __asm ivec4_to_vec4 __retVal.xyz, b; -} - -vec3 __constructor(const bvec3 b) -{ - __asm ivec4_to_vec4 __retVal.xyz, b; -} - -vec3 __constructor(const vec4 v) -{ - __asm vec4_move __retVal.xyz, v; -} - - -//// vec4 constructors - -vec4 __constructor(const float x, const float y, const float z, const float w) -{ - __retVal.x = x; - __retVal.y = y; - __retVal.z = z; - __retVal.w = w; -} - -vec4 __constructor(const float f) -{ - // Note: this could be "__retVal = f" but that's an illegal assignment - __asm vec4_move __retVal, f; -} - -vec4 __constructor(const int i) -{ - __asm ivec4_to_vec4 __retVal, i; -} - -vec4 __constructor(const bool b) -{ - __asm ivec4_to_vec4 __retVal, b; -} - -vec4 __constructor(const bvec4 b) -{ - __asm ivec4_to_vec4 __retVal, b; -} - -vec4 __constructor(const ivec4 i) -{ - __asm ivec4_to_vec4 __retVal, i; -} - -vec4 __constructor(const vec3 v3, const float f) -{ - // XXX this constructor shouldn't be needed anymore - __retVal.xyz = v3; - __retVal.w = f; -} - -vec4 __constructor(const vec2 v2, const float f1, const float f2) -{ - // XXX this constructor shouldn't be needed anymore - __retVal.xy = v2; - __retVal.z = f1; - __retVal.w = f2; -} - - -//// ivec2 constructors - -ivec2 __constructor(const int i, const int j) -{ - __retVal.x = i; - __retVal.y = j; -} - -ivec2 __constructor(const int i) -{ - __asm vec4_move __retVal.xy, i; -} - -ivec2 __constructor(const float f) -{ - __asm vec4_to_ivec4 __retVal.xy, f; -} - -ivec2 __constructor(const bool b) -{ - __asm vec4_to_ivec4 __retVal.xy, b; -} - - -//// ivec3 constructors - -ivec3 __constructor(const int i, const int j, const int k) -{ - __retVal.x = i; - __retVal.y = j; - __retVal.z = k; -} - -ivec3 __constructor(const int i) -{ - __asm vec4_move __retVal.xyz, i; -} - -ivec3 __constructor(const float f) -{ - __asm vec4_to_ivec4 __retVal.xyz, f; -} - -ivec3 __constructor(const bool b) -{ - __asm vec4_move __retVal.xyz, b; -} - - -//// ivec4 constructors - -ivec4 __constructor(const int x, const int y, const int z, const int w) -{ - __retVal.x = x; - __retVal.y = y; - __retVal.z = z; - __retVal.w = w; -} - -ivec4 __constructor(const int i) -{ - __asm vec4_move __retVal, i; -} - -ivec4 __constructor(const float f) -{ - __asm vec4_to_ivec4 __retVal, f; -} - -ivec4 __constructor(const bool b) -{ - __asm vec4_to_ivec4 __retVal, b; -} - - -//// bvec2 constructors - -bvec2 __constructor(const bool b1, const bool b2) -{ - __retVal.x = b1; - __retVal.y = b2; -} - -bvec2 __constructor(const int i1, const int i2) -{ - __asm vec4_sne __retVal.x, i1, 0.0; - __asm vec4_sne __retVal.y, i2, 0.0; -} - - -bvec2 __constructor(const bool b) -{ - __asm vec4_move __retVal.xy, b; -} - -bvec2 __constructor(const float f) -{ - __asm vec4_sne __retVal.xy, f, 0.0; -} - -bvec2 __constructor(const int i) -{ - __asm vec4_sne __retVal.xy, i, 0.0; -} - -bvec2 __constructor(const vec2 v) -{ - __asm vec4_sne __retVal.xy, v, 0.0; -} - -bvec2 __constructor(const ivec2 v) -{ - __asm vec4_sne __retVal.xy, v, 0.0; -} - - - -//// bvec3 constructors - -bvec3 __constructor(const bool b1, const bool b2, const bool b3) -{ - __retVal.x = b1; - __retVal.y = b2; - __retVal.z = b3; -} - -bvec3 __constructor(const float f1, const float f2, const float f3) -{ - __asm vec4_sne __retVal.x, f1, 0.0; - __asm vec4_sne __retVal.y, f2, 0.0; - __asm vec4_sne __retVal.z, f3, 0.0; -} - -bvec3 __constructor(const bool b) -{ - __asm vec4_move __retVal.xyz, b; -} - -bvec3 __constructor(const float f) -{ - __asm vec4_sne __retVal.xyz, f, 0.0; -} - -bvec3 __constructor(const int i) -{ - __asm vec4_sne __retVal.xyz, i, 0.0; -} - -bvec3 __constructor(const vec3 v) -{ - __asm vec4_sne __retVal.xyz, v, 0.0; -} - -bvec3 __constructor(const ivec3 v) -{ - __asm vec4_sne __retVal.xyz, v, 0.0; -} - - - -//// bvec4 constructors - -bvec4 __constructor(const bool b1, const bool b2, const bool b3, const bool b4) -{ - __retVal.x = b1; - __retVal.y = b2; - __retVal.z = b3; - __retVal.w = b4; -} - -bvec4 __constructor(const float f1, const float f2, const float f3, const float f4) -{ - const float zero = 0.0; - __asm vec4_sne __retVal.x, f1, zero; - __asm vec4_sne __retVal.y, f2, zero; - __asm vec4_sne __retVal.z, f3, zero; - __asm vec4_sne __retVal.w, f4, zero; -} - -bvec4 __constructor(const bool b) -{ - __asm vec4_move __retVal.xyzw, b; -} - -bvec4 __constructor(const float f) -{ - __asm vec4_sne __retVal.xyzw, f, 0.0; -} - -bvec4 __constructor(const int i) -{ - __asm vec4_sne __retVal.xyzw, i, 0.0; -} - -bvec4 __constructor(const vec4 v) -{ - __asm vec4_sne __retVal.xyzw, v, 0.0; -} - -bvec4 __constructor(const ivec4 v) -{ - __asm vec4_sne __retVal.xyzw, v, 0.0; -} - - - -//// mat2 constructors - -mat2 __constructor(const float m00, const float m10, - const float m01, const float m11) -{ - __retVal[0].x = m00; - __retVal[0].y = m10; - __retVal[1].x = m01; - __retVal[1].y = m11; -} - -mat2 __constructor(const float f) -{ - __retVal[0].x = f; - __retVal[0].y = 0.0; - __retVal[1].x = 0.0; - __retVal[1].y = f; -} - -mat2 __constructor(const int i) -{ - return mat2(float(i)); -} - -mat2 __constructor(const bool b) -{ - return mat2(float(b)); -} - -mat2 __constructor(const vec2 c0, const vec2 c1) -{ - __retVal[0] = c0; - __retVal[1] = c1; -} - - -//// mat3 constructors - -mat3 __constructor(const float m00, const float m10, const float m20, - const float m01, const float m11, const float m21, - const float m02, const float m12, const float m22) -{ - __retVal[0].x = m00; - __retVal[0].y = m10; - __retVal[0].z = m20; - __retVal[1].x = m01; - __retVal[1].y = m11; - __retVal[1].z = m21; - __retVal[2].x = m02; - __retVal[2].y = m12; - __retVal[2].z = m22; -} - -mat3 __constructor(const float f) -{ - vec2 v = vec2(f, 0.0); - __retVal[0] = v.xyy; - __retVal[1] = v.yxy; - __retVal[2] = v.yyx; -} - -mat3 __constructor(const int i) -{ - return mat3(float(i)); -} - -mat3 __constructor(const bool b) -{ - return mat3(float(b)); -} - -mat3 __constructor(const vec3 c0, const vec3 c1, const vec3 c2) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; -} - - -//// mat4 constructors - -mat4 __constructor(const float m00, const float m10, const float m20, const float m30, - const float m01, const float m11, const float m21, const float m31, - const float m02, const float m12, const float m22, const float m32, - const float m03, const float m13, const float m23, const float m33) -{ - __retVal[0].x = m00; - __retVal[0].y = m10; - __retVal[0].z = m20; - __retVal[0].w = m30; - __retVal[1].x = m01; - __retVal[1].y = m11; - __retVal[1].z = m21; - __retVal[1].w = m31; - __retVal[2].x = m02; - __retVal[2].y = m12; - __retVal[2].z = m22; - __retVal[2].w = m32; - __retVal[3].x = m03; - __retVal[3].y = m13; - __retVal[3].z = m23; - __retVal[3].w = m33; -} - - -mat4 __constructor(const float f) -{ - vec2 v = vec2(f, 0.0); - __retVal[0] = v.xyyy; - __retVal[1] = v.yxyy; - __retVal[2] = v.yyxy; - __retVal[3] = v.yyyx; -} - -mat4 __constructor(const int i) -{ - return mat4(float(i)); -} - -mat4 __constructor(const bool b) -{ - return mat4(float(b)); -} - -mat4 __constructor(const vec4 c0, const vec4 c1, const vec4 c2, const vec4 c3) -{ - __retVal[0] = c0; - __retVal[1] = c1; - __retVal[2] = c2; - __retVal[3] = c3; -} - - - -//// Basic int operators - -int __operator + (const int a, const int b) -{ - __asm vec4_add __retVal, a, b; -} - -int __operator - (const int a, const int b) -{ - __asm vec4_subtract __retVal, a, b; -} - -int __operator * (const int a, const int b) -{ - __asm vec4_multiply __retVal, a, b; -} - -int __operator / (const int a, const int b) -{ - float bInv, x; - __asm float_rcp bInv, b; - __asm vec4_multiply x, a, bInv; - __asm vec4_to_ivec4 __retVal, x; -} - - -//// Basic ivec2 operators - -ivec2 __operator + (const ivec2 a, const ivec2 b) -{ - __asm vec4_add __retVal, a, b; -} - -ivec2 __operator - (const ivec2 a, const ivec2 b) -{ - __asm vec4_subtract __retVal, a, b; -} - -ivec2 __operator * (const ivec2 a, const ivec2 b) -{ - __asm vec4_multiply __retVal, a, b; -} - -ivec2 __operator / (const ivec2 a, const ivec2 b) -{ - vec2 bInv, x; - __asm float_rcp bInv.x, b.x; - __asm float_rcp bInv.y, b.y; - __asm vec4_multiply x, a, bInv; - __asm vec4_to_ivec4 __retVal, x; -} - - -//// Basic ivec3 operators - -ivec3 __operator + (const ivec3 a, const ivec3 b) -{ - __asm vec4_add __retVal, a, b; -} - -ivec3 __operator - (const ivec3 a, const ivec3 b) -{ - __asm vec4_subtract __retVal, a, b; -} - -ivec3 __operator * (const ivec3 a, const ivec3 b) -{ - __asm vec4_multiply __retVal, a, b; -} - -ivec3 __operator / (const ivec3 a, const ivec3 b) -{ - vec3 bInv, x; - __asm float_rcp bInv.x, b.x; - __asm float_rcp bInv.y, b.y; - __asm float_rcp bInv.z, b.z; - __asm vec4_multiply x, a, bInv; - __asm vec4_to_ivec4 __retVal, x; -} - - -//// Basic ivec4 operators - -ivec4 __operator + (const ivec4 a, const ivec4 b) -{ - __asm vec4_add __retVal, a, b; -} - -ivec4 __operator - (const ivec4 a, const ivec4 b) -{ - __asm vec4_subtract __retVal, a, b; -} - -ivec4 __operator * (const ivec4 a, const ivec4 b) -{ - __asm vec4_multiply __retVal, a, b; -} - -ivec4 __operator / (const ivec4 a, const ivec4 b) -{ - vec4 bInv, x; - __asm float_rcp bInv.x, b.x; - __asm float_rcp bInv.y, b.y; - __asm float_rcp bInv.z, b.z; - __asm float_rcp bInv.w, b.w; - __asm vec4_multiply x, a, bInv; - __asm vec4_to_ivec4 __retVal, x; -} - - -//// Basic float operators - -float __operator + (const float a, const float b) -{ - __asm vec4_add __retVal, a, b; -} - -float __operator - (const float a, const float b) -{ - __asm vec4_subtract __retVal, a, b; -} - -float __operator * (const float a, const float b) -{ - __asm vec4_multiply __retVal, a, b; -} - -float __operator / (const float a, const float b) -{ - float bInv; - __asm float_rcp bInv.x, b; - __asm vec4_multiply __retVal, a, bInv; -} - - -//// Basic vec2 operators - -vec2 __operator + (const vec2 v, const vec2 u) -{ - __asm vec4_add __retVal.xy, v, u; -} - -vec2 __operator - (const vec2 v, const vec2 u) -{ - __asm vec4_subtract __retVal.xy, v, u; -} - -vec2 __operator * (const vec2 v, const vec2 u) -{ - __asm vec4_multiply __retVal.xy, v, u; -} - -vec2 __operator / (const vec2 v, const vec2 u) -{ - vec2 w; // = 1 / u - __asm float_rcp w.x, u.x; - __asm float_rcp w.y, u.y; - __asm vec4_multiply __retVal.xy, v, w; -} - - -//// Basic vec3 operators - -vec3 __operator + (const vec3 v, const vec3 u) -{ - __asm vec4_add __retVal.xyz, v, u; -} - -vec3 __operator - (const vec3 v, const vec3 u) -{ - __asm vec4_subtract __retVal.xyz, v, u; -} - -vec3 __operator * (const vec3 v, const vec3 u) -{ - __asm vec4_multiply __retVal.xyz, v, u; -} - -vec3 __operator / (const vec3 v, const vec3 u) -{ - vec3 w; // = 1 / u - __asm float_rcp w.x, u.x; - __asm float_rcp w.y, u.y; - __asm float_rcp w.z, u.z; - __asm vec4_multiply __retVal.xyz, v, w; -} - - -//// Basic vec4 operators - -vec4 __operator + (const vec4 v, const vec4 u) -{ - __asm vec4_add __retVal, v, u; -} - -vec4 __operator - (const vec4 v, const vec4 u) -{ - __asm vec4_subtract __retVal, v, u; -} - -vec4 __operator * (const vec4 v, const vec4 u) -{ - __asm vec4_multiply __retVal, v, u; -} - -vec4 __operator / (const vec4 v, const vec4 u) -{ - vec4 w; // = 1 / u - __asm float_rcp w.x, u.x; - __asm float_rcp w.y, u.y; - __asm float_rcp w.z, u.z; - __asm float_rcp w.w, u.w; - __asm vec4_multiply __retVal, v, w; -} - - - - -//// Basic vec2/float operators - -vec2 __operator + (const float a, const vec2 u) -{ - __asm vec4_add __retVal.xy, a, u.xy; -} - -vec2 __operator + (const vec2 v, const float b) -{ - __asm vec4_add __retVal.xy, v.xy, b; -} - -vec2 __operator - (const float a, const vec2 u) -{ - __asm vec4_subtract __retVal.xy, a, u.xy; -} - -vec2 __operator - (const vec2 v, const float b) -{ - __asm vec4_subtract __retVal.xy, v.xy, b; -} - -vec2 __operator * (const float a, const vec2 u) -{ - __asm vec4_multiply __retVal.xy, a, u.xy; -} - -vec2 __operator * (const vec2 v, const float b) -{ - __asm vec4_multiply __retVal.xy, v.xy, b; -} - -vec2 __operator / (const float a, const vec2 u) -{ - vec2 invU; - __asm float_rcp invU.x, u.x; - __asm float_rcp invU.y, u.y; - __asm vec4_multiply __retVal.xy, a, invU.xy; -} - -vec2 __operator / (const vec2 v, const float b) -{ - float invB; - __asm float_rcp invB, b; - __asm vec4_multiply __retVal.xy, v.xy, invB; -} - - -//// Basic vec3/float operators - -vec3 __operator + (const float a, const vec3 u) -{ - __asm vec4_add __retVal.xyz, a, u.xyz; -} - -vec3 __operator + (const vec3 v, const float b) -{ - __asm vec4_add __retVal.xyz, v.xyz, b; -} - -vec3 __operator - (const float a, const vec3 u) -{ - __asm vec4_subtract __retVal.xyz, a, u.xyz; -} - -vec3 __operator - (const vec3 v, const float b) -{ - __asm vec4_subtract __retVal.xyz, v.xyz, b; -} - -vec3 __operator * (const float a, const vec3 u) -{ - __asm vec4_multiply __retVal.xyz, a, u.xyz; -} - -vec3 __operator * (const vec3 v, const float b) -{ - __asm vec4_multiply __retVal.xyz, v.xyz, b; -} - -vec3 __operator / (const float a, const vec3 u) -{ - vec3 invU; - __asm float_rcp invU.x, u.x; - __asm float_rcp invU.y, u.y; - __asm float_rcp invU.z, u.z; - __asm vec4_multiply __retVal.xyz, a, invU.xyz; -} - -vec3 __operator / (const vec3 v, const float b) -{ - float invB; - __asm float_rcp invB, b; - __asm vec4_multiply __retVal.xyz, v.xyz, invB; -} - - -//// Basic vec4/float operators - -vec4 __operator + (const float a, const vec4 u) -{ - __asm vec4_add __retVal, a, u; -} - -vec4 __operator + (const vec4 v, const float b) -{ - __asm vec4_add __retVal, v, b; -} - -vec4 __operator - (const float a, const vec4 u) -{ - __asm vec4_subtract __retVal, a, u; -} - -vec4 __operator - (const vec4 v, const float b) -{ - __asm vec4_subtract __retVal, v, b; -} - -vec4 __operator * (const float a, const vec4 u) -{ - __asm vec4_multiply __retVal, a, u; -} - -vec4 __operator * (const vec4 v, const float b) -{ - __asm vec4_multiply __retVal, v, b; -} - -vec4 __operator / (const float a, const vec4 u) -{ - vec4 invU; - __asm float_rcp invU.x, u.x; - __asm float_rcp invU.y, u.y; - __asm float_rcp invU.z, u.z; - __asm float_rcp invU.w, u.w; - __asm vec4_multiply __retVal, a, invU; -} - -vec4 __operator / (const vec4 v, const float b) -{ - float invB; - __asm float_rcp invB, b; - __asm vec4_multiply __retVal, v, invB; -} - - - -//// Basic ivec2/int operators - -ivec2 __operator + (const int a, const ivec2 u) -{ - __retVal = ivec2(a) + u; -} - -ivec2 __operator + (const ivec2 v, const int b) -{ - __retVal = v + ivec2(b); -} - -ivec2 __operator - (const int a, const ivec2 u) -{ - __retVal = ivec2(a) - u; -} - -ivec2 __operator - (const ivec2 v, const int b) -{ - __retVal = v - ivec2(b); -} - -ivec2 __operator * (const int a, const ivec2 u) -{ - __retVal = ivec2(a) * u; -} - -ivec2 __operator * (const ivec2 v, const int b) -{ - __retVal = v * ivec2(b); -} - -ivec2 __operator / (const int a, const ivec2 u) -{ - __retVal = ivec2(a) / u; -} - -ivec2 __operator / (const ivec2 v, const int b) -{ - __retVal = v / ivec2(b); -} - - -//// Basic ivec3/int operators - -ivec3 __operator + (const int a, const ivec3 u) -{ - __retVal = ivec3(a) + u; -} - -ivec3 __operator + (const ivec3 v, const int b) -{ - __retVal = v + ivec3(b); -} - -ivec3 __operator - (const int a, const ivec3 u) -{ - __retVal = ivec3(a) - u; -} - -ivec3 __operator - (const ivec3 v, const int b) -{ - __retVal = v - ivec3(b); -} - -ivec3 __operator * (const int a, const ivec3 u) -{ - __retVal = ivec3(a) * u; -} - -ivec3 __operator * (const ivec3 v, const int b) -{ - __retVal = v * ivec3(b); -} - -ivec3 __operator / (const int a, const ivec3 u) -{ - __retVal = ivec3(a) / u; -} - -ivec3 __operator / (const ivec3 v, const int b) -{ - __retVal = v / ivec3(b); -} - - -//// Basic ivec4/int operators - -ivec4 __operator + (const int a, const ivec4 u) -{ - __retVal = ivec4(a) + u; -} - -ivec4 __operator + (const ivec4 v, const int b) -{ - __retVal = v + ivec4(b); -} - -ivec4 __operator - (const int a, const ivec4 u) -{ - __retVal = ivec4(a) - u; -} - -ivec4 __operator - (const ivec4 v, const int b) -{ - __retVal = v - ivec4(b); -} - -ivec4 __operator * (const int a, const ivec4 u) -{ - __retVal = ivec4(a) * u; -} - -ivec4 __operator * (const ivec4 v, const int b) -{ - __retVal = v * ivec4(b); -} - -ivec4 __operator / (const int a, const ivec4 u) -{ - __retVal = ivec4(a) / u; -} - -ivec4 __operator / (const ivec4 v, const int b) -{ - __retVal = v / ivec4(b); -} - - - - -//// Unary negation operator - -int __operator - (const int a) -{ - __asm vec4_negate __retVal.x, a; -} - -ivec2 __operator - (const ivec2 v) -{ - __asm vec4_negate __retVal, v; -} - -ivec3 __operator - (const ivec3 v) -{ - __asm vec4_negate __retVal, v; -} - -ivec4 __operator - (const ivec4 v) -{ - __asm vec4_negate __retVal, v; -} - -float __operator - (const float a) -{ - __asm vec4_negate __retVal.x, a; -} - -vec2 __operator - (const vec2 v) -{ - __asm vec4_negate __retVal.xy, v.xy; -} - -vec3 __operator - (const vec3 v) -{ - __asm vec4_negate __retVal.xyz, v.xyz; -} - -vec4 __operator - (const vec4 v) -{ - __asm vec4_negate __retVal, v; -} - -mat2 __operator - (const mat2 m) -{ - __retVal[0] = -m[0]; - __retVal[1] = -m[1]; -} - -mat3 __operator - (const mat3 m) -{ - __retVal[0] = -m[0]; - __retVal[1] = -m[1]; - __retVal[2] = -m[2]; -} - -mat4 __operator - (const mat4 m) -{ - __retVal[0] = -m[0]; - __retVal[1] = -m[1]; - __retVal[2] = -m[2]; - __retVal[3] = -m[3]; -} - - - -//// dot product - -float dot(const float a, const float b) -{ - __retVal = a * b; -} - -float dot(const vec2 a, const vec2 b) -{ - __retVal = a.x * b.x + a.y * b.y; -} - -float dot(const vec3 a, const vec3 b) -{ - __asm vec3_dot __retVal, a, b; -} - -float dot(const vec4 a, const vec4 b) -{ - __asm vec4_dot __retVal, a, b; -} - - - -//// int assignment operators - -int __operator += (inout int a, const int b) -{ - a = a + b; - return a; -} - -int __operator -= (inout int a, const int b) -{ - a = a - b; - return a; -} - -int __operator *= (inout int a, const int b) -{ - a = a * b; - return a; -} - -int __operator /= (inout int a, const int b) -{ - a = a / b; - return a; -} - - -//// ivec2 assignment operators - -ivec2 __operator += (inout ivec2 v, const ivec2 u) -{ - v = v + u; - return v; -} - -ivec2 __operator -= (inout ivec2 v, const ivec2 u) -{ - v = v - u; - return v; -} - -ivec2 __operator *= (inout ivec2 v, const ivec2 u) -{ - v = v * u; - return v; -} - -ivec2 __operator /= (inout ivec2 v, const ivec2 u) -{ - v = v / u; - return v; -} - - -//// ivec3 assignment operators - -ivec3 __operator += (inout ivec3 v, const ivec3 u) -{ - v = v + u; - return v; -} - -ivec3 __operator -= (inout ivec3 v, const ivec3 u) -{ - v = v - u; - return v; -} - -ivec3 __operator *= (inout ivec3 v, const ivec3 u) -{ - v = v * u; - return v; -} - -ivec3 __operator /= (inout ivec3 v, const ivec3 u) -{ - v = v / u; - return v; -} - - -//// ivec4 assignment operators - -ivec4 __operator += (inout ivec4 v, const ivec4 u) -{ - v = v + u; - return v; -} - -ivec4 __operator -= (inout ivec4 v, const ivec4 u) -{ - v = v - u; - return v; -} - -ivec4 __operator *= (inout ivec4 v, const ivec4 u) -{ - v = v * u; - return v; -} - -ivec4 __operator /= (inout ivec4 v, const ivec4 u) -{ - v = v / u; - return v; -} - - -//// float assignment operators - -float __operator += (inout float a, const float b) -{ - a = a + b; - return a; -} - -float __operator -= (inout float a, const float b) -{ - a = a - b; - return a; -} - -float __operator *= (inout float a, const float b) -{ - a = a * b; - return a; -} - -float __operator /= (inout float a, const float b) -{ - a = a / b; - return a; -} - - -//// vec2 assignment operators - -vec2 __operator += (inout vec2 v, const vec2 u) -{ - v = v + u; - return v; -} - -vec2 __operator -= (inout vec2 v, const vec2 u) -{ - v = v - u; - return v; -} - -vec2 __operator *= (inout vec2 v, const vec2 u) -{ - v = v * u; - return v; -} - -vec2 __operator /= (inout vec2 v, const vec2 u) -{ - v = v / u; - return v; -} - - -//// vec3 assignment operators - -vec3 __operator += (inout vec3 v, const vec3 u) -{ - v = v + u; - return v; -} - -vec3 __operator -= (inout vec3 v, const vec3 u) -{ - v = v - u; - return v; -} - -vec3 __operator *= (inout vec3 v, const vec3 u) -{ - v = v * u; - return v; -} - -vec3 __operator /= (inout vec3 v, const vec3 u) -{ - v = v / u; - return v; -} - - -//// vec4 assignment operators - -vec4 __operator += (inout vec4 v, const vec4 u) -{ - v = v + u; - return v; -} - -vec4 __operator -= (inout vec4 v, const vec4 u) -{ - v = v - u; - return v; -} - -vec4 __operator *= (inout vec4 v, const vec4 u) -{ - v = v * u; - return v; -} - -vec4 __operator /= (inout vec4 v, const vec4 u) -{ - v = v / u; - return v; -} - - - -//// ivec2/int assignment operators - -ivec2 __operator += (inout ivec2 v, const int a) -{ - v = v + ivec2(a); - return v; -} - -ivec2 __operator -= (inout ivec2 v, const int a) -{ - v = v - ivec2(a); - return v; -} - -ivec2 __operator *= (inout ivec2 v, const int a) -{ - v = v * ivec2(a); - return v; -} - -ivec2 __operator /= (inout ivec2 v, const int a) -{ - v = v / ivec2(a); - return v; -} - - -//// ivec3/int assignment operators - -ivec3 __operator += (inout ivec3 v, const int a) -{ - v = v + ivec3(a); - return v; -} - -ivec3 __operator -= (inout ivec3 v, const int a) -{ - v = v - ivec3(a); - return v; -} - -ivec3 __operator *= (inout ivec3 v, const int a) -{ - v = v * ivec3(a); - return v; -} - -ivec4 __operator /= (inout ivec3 v, const int a) -{ - v = v / ivec3(a); - return v; -} - - -//// ivec4/int assignment operators - -ivec4 __operator += (inout ivec4 v, const int a) -{ - v = v + ivec4(a); - return v; -} - -ivec4 __operator -= (inout ivec4 v, const int a) -{ - v = v - ivec4(a); - return v; -} - -ivec4 __operator *= (inout ivec4 v, const int a) -{ - v = v * ivec4(a); - return v; -} - -ivec4 __operator /= (inout ivec4 v, const int a) -{ - v = v / ivec4(a); - return v; -} - - - -//// vec2/float assignment operators - -vec2 __operator += (inout vec2 v, const float a) -{ - v = v + vec2(a); - return v; -} - -vec2 __operator -= (inout vec2 v, const float a) -{ - v = v - vec2(a); - return v; -} - -vec2 __operator *= (inout vec2 v, const float a) -{ - v = v * vec2(a); - return v; -} - -vec2 __operator /= (inout vec2 v, const float a) -{ - v = v / vec2(a); - return v; -} - - -//// vec3/float assignment operators - -vec3 __operator += (inout vec3 v, const float a) -{ - v = v + vec3(a); - return v; -} - -vec3 __operator -= (inout vec3 v, const float a) -{ - v = v - vec3(a); - return v; -} - -vec3 __operator *= (inout vec3 v, const float a) -{ - v = v * vec3(a); - return v; -} - -vec3 __operator /= (inout vec3 v, const float a) -{ - v = v / vec3(a); - return v; -} - - -//// vec4/float assignment operators - -vec4 __operator += (inout vec4 v, const float a) -{ - v = v + vec4(a); - return v; -} - -vec4 __operator -= (inout vec4 v, const float a) -{ - v = v - vec4(a); - return v; -} - -vec4 __operator *= (inout vec4 v, const float a) -{ - v = v * vec4(a); - return v; -} - -vec4 __operator /= (inout vec4 v, const float a) -{ - v = v / vec4(a); - return v; -} - - - - - -//// Basic mat2 operations - -mat2 __operator + (const mat2 m, const mat2 n) -{ - __retVal[0] = m[0] + n[0]; - __retVal[1] = m[1] + n[1]; -} - -mat2 __operator - (const mat2 m, const mat2 n) -{ - __retVal[0] = m[0] - n[0]; - __retVal[1] = m[1] - n[1]; -} - -mat2 __operator * (const mat2 m, const mat2 n) -{ - __retVal[0] = m[0] * n[0].xx + m[1] * n[0].yy; - __retVal[1] = m[0] * n[1].xx + m[1] * n[1].yy; -} - -mat2 __operator / (const mat2 m, const mat2 n) -{ - __retVal[0] = m[0] / n[0]; - __retVal[1] = m[1] / n[1]; -} - - -//// Basic mat3 operations - -mat3 __operator + (const mat3 m, const mat3 n) -{ - __retVal[0] = m[0] + n[0]; - __retVal[1] = m[1] + n[1]; - __retVal[2] = m[2] + n[2]; -} - -mat3 __operator - (const mat3 m, const mat3 n) -{ - __retVal[0] = m[0] - n[0]; - __retVal[1] = m[1] - n[1]; - __retVal[2] = m[2] - n[2]; -} - -mat3 __operator * (const mat3 m, const mat3 n) -{ - __retVal[0] = m[0] * n[0].xxx + m[1] * n[0].yyy + m[2] * n[0].zzz; - __retVal[1] = m[0] * n[1].xxx + m[1] * n[1].yyy + m[2] * n[1].zzz; - __retVal[2] = m[0] * n[2].xxx + m[1] * n[2].yyy + m[2] * n[2].zzz; -} - -mat3 __operator / (const mat3 m, const mat3 n) -{ - __retVal[0] = m[0] / n[0]; - __retVal[1] = m[1] / n[1]; - __retVal[2] = m[2] / n[2]; -} - - -//// Basic mat4 operations - -mat4 __operator + (const mat4 m, const mat4 n) -{ - __retVal[0] = m[0] + n[0]; - __retVal[1] = m[1] + n[1]; - __retVal[2] = m[2] + n[2]; - __retVal[3] = m[3] + n[3]; -} - -mat4 __operator - (const mat4 m, const mat4 n) -{ - __retVal[0] = m[0] - n[0]; - __retVal[1] = m[1] - n[1]; - __retVal[2] = m[2] - n[2]; - __retVal[3] = m[3] - n[3]; -} - -mat4 __operator * (const mat4 m, const mat4 n) -{ - __retVal[0] = m[0] * n[0].xxxx + m[1] * n[0].yyyy + m[2] * n[0].zzzz + m[3] * n[0].wwww; - __retVal[1] = m[0] * n[1].xxxx + m[1] * n[1].yyyy + m[2] * n[1].zzzz + m[3] * n[1].wwww; - __retVal[2] = m[0] * n[2].xxxx + m[1] * n[2].yyyy + m[2] * n[2].zzzz + m[3] * n[2].wwww; - __retVal[3] = m[0] * n[3].xxxx + m[1] * n[3].yyyy + m[2] * n[3].zzzz + m[3] * n[3].wwww; -} - -mat4 __operator / (const mat4 m, const mat4 n) -{ - __retVal[0] = m[0] / n[0]; - __retVal[1] = m[1] / n[1]; - __retVal[2] = m[2] / n[2]; - __retVal[3] = m[3] / n[3]; -} - - -//// mat2/float operations - -mat2 __operator + (const float a, const mat2 n) -{ - __retVal[0] = a + n[0]; - __retVal[1] = a + n[1]; -} - -mat2 __operator + (const mat2 m, const float b) -{ - __retVal[0] = m[0] + b; - __retVal[1] = m[1] + b; -} - -mat2 __operator - (const float a, const mat2 n) -{ - __retVal[0] = a - n[0]; - __retVal[1] = a - n[1]; -} - -mat2 __operator - (const mat2 m, const float b) -{ - __retVal[0] = m[0] - b; - __retVal[1] = m[1] - b; -} - -mat2 __operator * (const float a, const mat2 n) -{ - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; -} - -mat2 __operator * (const mat2 m, const float b) -{ - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; -} - -mat2 __operator / (const float a, const mat2 n) -{ - __retVal[0] = a / n[0]; - __retVal[1] = a / n[1]; -} - -mat2 __operator / (const mat2 m, const float b) -{ - __retVal[0] = m[0] / b; - __retVal[1] = m[1] / b; -} - - -//// mat3/float operations - -mat3 __operator + (const float a, const mat3 n) -{ - __retVal[0] = a + n[0]; - __retVal[1] = a + n[1]; - __retVal[2] = a + n[2]; -} - -mat3 __operator + (const mat3 m, const float b) -{ - __retVal[0] = m[0] + b; - __retVal[1] = m[1] + b; - __retVal[2] = m[2] + b; -} - -mat3 __operator - (const float a, const mat3 n) -{ - __retVal[0] = a - n[0]; - __retVal[1] = a - n[1]; - __retVal[2] = a - n[2]; -} - -mat3 __operator - (const mat3 m, const float b) -{ - __retVal[0] = m[0] - b; - __retVal[1] = m[1] - b; - __retVal[2] = m[2] - b; -} - -mat3 __operator * (const float a, const mat3 n) -{ - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; -} - -mat3 __operator * (const mat3 m, const float b) -{ - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; -} - -mat3 __operator / (const float a, const mat3 n) -{ - __retVal[0] = a / n[0]; - __retVal[1] = a / n[1]; - __retVal[2] = a / n[2]; -} - -mat3 __operator / (const mat3 m, const float b) -{ - __retVal[0] = m[0] / b; - __retVal[1] = m[1] / b; - __retVal[2] = m[2] / b; -} - - -//// mat4/float operations - -mat4 __operator + (const float a, const mat4 n) -{ - __retVal[0] = a + n[0]; - __retVal[1] = a + n[1]; - __retVal[2] = a + n[2]; - __retVal[3] = a + n[3]; -} - -mat4 __operator + (const mat4 m, const float b) -{ - __retVal[0] = m[0] + b; - __retVal[1] = m[1] + b; - __retVal[2] = m[2] + b; - __retVal[3] = m[3] + b; -} - -mat4 __operator - (const float a, const mat4 n) -{ - __retVal[0] = a - n[0]; - __retVal[1] = a - n[1]; - __retVal[2] = a - n[2]; - __retVal[3] = a - n[3]; -} - -mat4 __operator - (const mat4 m, const float b) -{ - __retVal[0] = m[0] - b; - __retVal[1] = m[1] - b; - __retVal[2] = m[2] - b; - __retVal[3] = m[3] - b; -} - -mat4 __operator * (const float a, const mat4 n) -{ - __retVal[0] = a * n[0]; - __retVal[1] = a * n[1]; - __retVal[2] = a * n[2]; - __retVal[3] = a * n[3]; -} - -mat4 __operator * (const mat4 m, const float b) -{ - __retVal[0] = m[0] * b; - __retVal[1] = m[1] * b; - __retVal[2] = m[2] * b; - __retVal[3] = m[3] * b; -} - -mat4 __operator / (const float a, const mat4 n) -{ - __retVal[0] = a / n[0]; - __retVal[1] = a / n[1]; - __retVal[2] = a / n[2]; - __retVal[3] = a / n[3]; -} - -mat4 __operator / (const mat4 m, const float b) -{ - __retVal[0] = m[0] / b; - __retVal[1] = m[1] / b; - __retVal[2] = m[2] / b; - __retVal[3] = m[3] / b; -} - - - -//// matrix / vector products - -vec2 __operator * (const mat2 m, const vec2 v) -{ - __retVal = m[0] * v.xx - + m[1] * v.yy; -} - -vec2 __operator * (const vec2 v, const mat2 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); -} - -vec3 __operator * (const mat3 m, const vec3 v) -{ - __retVal = m[0] * v.xxx - + m[1] * v.yyy - + m[2] * v.zzz; -} - -vec3 __operator * (const vec3 v, const mat3 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); -} - -vec4 __operator * (const mat4 m, const vec4 v) -{ - __retVal = m[0] * v.xxxx - + m[1] * v.yyyy - + m[2] * v.zzzz - + m[3] * v.wwww; -} - -vec4 __operator * (const vec4 v, const mat4 m) -{ - __retVal.x = dot(v, m[0]); - __retVal.y = dot(v, m[1]); - __retVal.z = dot(v, m[2]); - __retVal.w = dot(v, m[3]); -} - - - -//// mat2 assignment operators - -mat2 __operator += (inout mat2 m, const mat2 n) -{ - m[0] = m[0] + n[0]; - m[1] = m[1] + n[1]; - return m; -} - -mat2 __operator -= (inout mat2 m, const mat2 n) -{ - m[0] = m[0] - n[0]; - m[1] = m[1] - n[1]; - return m; -} - -mat2 __operator *= (inout mat2 m, const mat2 n) -{ - m = m * n; - return m; -} - -mat2 __operator /= (inout mat2 m, const mat2 n) -{ - m[0] = m[0] / n[0]; - m[1] = m[1] / n[1]; - return m; -} - - -//// mat3 assignment operators - -mat3 __operator += (inout mat3 m, const mat3 n) -{ - m[0] = m[0] + n[0]; - m[1] = m[1] + n[1]; - m[2] = m[2] + n[2]; - return m; -} - -mat3 __operator -= (inout mat3 m, const mat3 n) -{ - m[0] = m[0] - n[0]; - m[1] = m[1] - n[1]; - m[2] = m[2] - n[2]; - return m; -} - -mat3 __operator *= (inout mat3 m, const mat3 n) -{ - m = m * n; - return m; -} - -mat3 __operator /= (inout mat3 m, const mat3 n) -{ - m[0] = m[0] / n[0]; - m[1] = m[1] / n[1]; - m[2] = m[2] / n[2]; - return m; -} - - -// mat4 assignment operators - -mat4 __operator += (inout mat4 m, const mat4 n) -{ - m[0] = m[0] + n[0]; - m[1] = m[1] + n[1]; - m[2] = m[2] + n[2]; - m[3] = m[3] + n[3]; - return m; -} - -mat4 __operator -= (inout mat4 m, const mat4 n) -{ - m[0] = m[0] - n[0]; - m[1] = m[1] - n[1]; - m[2] = m[2] - n[2]; - m[3] = m[3] - n[3]; - return m; -} - -mat4 __operator *= (inout mat4 m, const mat4 n) -{ - m = m * n; - return m; -} - -mat4 __operator /= (inout mat4 m, const mat4 n) -{ - m[0] = m[0] / n[0]; - m[1] = m[1] / n[1]; - m[2] = m[2] / n[2]; - m[3] = m[3] / n[3]; - return m; -} - - -//// mat2/float assignment operators - -mat2 __operator += (inout mat2 m, const float a) -{ - vec2 v = vec2(a); - m[0] = m[0] + v; - m[1] = m[1] + v; - return m; -} - -mat2 __operator -= (inout mat2 m, const float a) -{ - vec2 v = vec2(a); - m[0] = m[0] - v; - m[1] = m[1] - v; - return m; -} - -mat2 __operator *= (inout mat2 m, const float a) -{ - vec2 v = vec2(a); - m[0] = m[0] * v; - m[1] = m[1] * v; - return m; -} - -mat2 __operator /= (inout mat2 m, const float a) -{ - vec2 v = vec2(1.0 / a); - m[0] = m[0] * v; - m[1] = m[1] * v; - return m; -} - - -//// mat3/float assignment operators - -mat3 __operator += (inout mat3 m, const float a) -{ - vec3 v = vec3(a); - m[0] = m[0] + v; - m[1] = m[1] + v; - m[2] = m[2] + v; - return m; -} - -mat3 __operator -= (inout mat3 m, const float a) -{ - vec3 v = vec3(a); - m[0] = m[0] - v; - m[1] = m[1] - v; - m[2] = m[2] - v; - return m; -} - -mat3 __operator *= (inout mat3 m, const float a) -{ - vec3 v = vec3(a); - m[0] = m[0] * v; - m[1] = m[1] * v; - m[2] = m[2] * v; - return m; -} - -mat3 __operator /= (inout mat3 m, const float a) -{ - vec3 v = vec3(1.0 / a); - m[0] = m[0] * v; - m[1] = m[1] * v; - m[2] = m[2] * v; - return m; -} - - -//// mat4/float assignment operators - -mat4 __operator += (inout mat4 m, const float a) -{ - vec4 v = vec4(a); - m[0] = m[0] + v; - m[1] = m[1] + v; - m[2] = m[2] + v; - m[3] = m[3] + v; - return m; -} - -mat4 __operator -= (inout mat4 m, const float a) -{ - vec4 v = vec4(a); - m[0] = m[0] - v; - m[1] = m[1] - v; - m[2] = m[2] - v; - m[3] = m[3] - v; - return m; -} - -mat4 __operator *= (inout mat4 m, const float a) -{ - vec4 v = vec4(a); - m[0] = m[0] * v; - m[1] = m[1] * v; - m[2] = m[2] * v; - m[3] = m[3] * v; - return m; -} - -mat4 __operator /= (inout mat4 m, const float a) -{ - vec4 v = vec4(1.0 / a); - m[0] = m[0] * v; - m[1] = m[1] * v; - m[2] = m[2] * v; - m[3] = m[3] * v; - return m; -} - - - -//// vec/mat assignment operators - -vec2 __operator *= (inout vec2 v, const mat2 m) -{ - v = v * m; - return v; -} - -vec3 __operator *= (inout vec3 v, const mat3 m) -{ - v = v * m; - return v; -} - -vec4 __operator *= (inout vec4 v, const mat4 m) -{ - v = v * m; - return v; -} - - - -//// pre-decrement operators - -int __operator --(inout int a) -{ - a = a - 1; - __retVal = a; -} - -ivec2 __operator --(inout ivec2 v) -{ - v = v - ivec2(1); - __retVal = v; -} - -ivec3 __operator --(inout ivec3 v) -{ - v = v - ivec3(1); - __retVal = v; -} - -ivec4 __operator --(inout ivec4 v) -{ - v = v - ivec4(1); - __retVal = v; -} - - -float __operator --(inout float a) -{ - a = a - 1.0; - __retVal = a; -} - -vec2 __operator --(inout vec2 v) -{ - v = v - vec2(1.0); - __retVal = v; -} - -vec3 __operator --(inout vec3 v) -{ - v = v - vec3(1.0); - __retVal = v; -} - -vec4 __operator --(inout vec4 v) -{ - v = v - vec4(1.0); - __retVal = v; -} - - -mat2 __operator --(inout mat2 m) -{ - m[0] = m[0] - vec2(1.0); - m[1] = m[1] - vec2(1.0); - __retVal = m; -} - -mat3 __operator --(inout mat3 m) -{ - m[0] = m[0] - vec3(1.0); - m[1] = m[1] - vec3(1.0); - m[2] = m[2] - vec3(1.0); - __retVal = m; -} - -mat4 __operator --(inout mat4 m) -{ - m[0] = m[0] - vec4(1.0); - m[1] = m[1] - vec4(1.0); - m[2] = m[2] - vec4(1.0); - m[3] = m[3] - vec4(1.0); - __retVal = m; -} - - -//// pre-increment operators - -int __operator ++(inout int a) -{ - a = a + 1; - __retVal = a; -} - -ivec2 __operator ++(inout ivec2 v) -{ - v = v + ivec2(1); - __retVal = v; -} - -ivec3 __operator ++(inout ivec3 v) -{ - v = v + ivec3(1); - __retVal = v; -} - -ivec4 __operator ++(inout ivec4 v) -{ - v = v + ivec4(1); - __retVal = v; -} - - -float __operator ++(inout float a) -{ - a = a + 1.0; - __retVal = a; -} - -vec2 __operator ++(inout vec2 v) -{ - v = v + vec2(1.0); - __retVal = v; -} - -vec3 __operator ++(inout vec3 v) -{ - v = v + vec3(1.0); - __retVal = v; -} - -vec4 __operator ++(inout vec4 v) -{ - v = v + vec4(1.0); - __retVal = v; -} - - -mat2 __operator ++(inout mat2 m) -{ - m[0] = m[0] + vec2(1.0); - m[1] = m[1] + vec2(1.0); - __retVal = m; -} - -mat3 __operator ++(inout mat3 m) -{ - m[0] = m[0] + vec3(1.0); - m[1] = m[1] + vec3(1.0); - m[2] = m[2] + vec3(1.0); - __retVal = m; -} - -mat4 __operator ++(inout mat4 m) -{ - m[0] = m[0] + vec4(1.0); - m[1] = m[1] + vec4(1.0); - m[2] = m[2] + vec4(1.0); - m[3] = m[3] + vec4(1.0); - __retVal = m; -} - - - -//// post-decrement - -int __postDecr(inout int a) -{ - __retVal = a; - a = a - 1; -} - -ivec2 __postDecr(inout ivec2 v) -{ - __retVal = v; - v = v - ivec2(1); -} - -ivec3 __postDecr(inout ivec3 v) -{ - __retVal = v; - v = v - ivec3(1); -} - -ivec4 __postDecr(inout ivec4 v) -{ - __retVal = v; - v = v - ivec4(1); -} - - -float __postDecr(inout float a) -{ - __retVal = a; - a = a - 1.0; -} - -vec2 __postDecr(inout vec2 v) -{ - __retVal = v; - v = v - vec2(1.0); -} - -vec3 __postDecr(inout vec3 v) -{ - __retVal = v; - v = v - vec3(1.0); -} - -vec4 __postDecr(inout vec4 v) -{ - __retVal = v; - v = v - vec4(1.0); -} - - -mat2 __postDecr(inout mat2 m) -{ - __retVal = m; - m[0] = m[0] - vec2(1.0); - m[1] = m[1] - vec2(1.0); -} - -mat3 __postDecr(inout mat3 m) -{ - __retVal = m; - m[0] = m[0] - vec3(1.0); - m[1] = m[1] - vec3(1.0); - m[2] = m[2] - vec3(1.0); -} - -mat4 __postDecr(inout mat4 m) -{ - __retVal = m; - m[0] = m[0] - vec4(1.0); - m[1] = m[1] - vec4(1.0); - m[2] = m[2] - vec4(1.0); - m[3] = m[3] - vec4(1.0); -} - - -//// post-increment - -float __postIncr(inout float a) -{ - __retVal = a; - a = a + 1; -} - -vec2 __postIncr(inout vec2 v) -{ - __retVal = v; - v = v + vec2(1.0); -} - -vec3 __postIncr(inout vec3 v) -{ - __retVal = v; - v = v + vec3(1.0); -} - -vec4 __postIncr(inout vec4 v) -{ - __retVal = v; - v = v + vec4(1.0); -} - - -int __postIncr(inout int a) -{ - __retVal = a; - a = a + 1; -} - -ivec2 __postIncr(inout ivec2 v) -{ - __retVal = v; - v = v + ivec2(1); -} - -ivec3 __postIncr(inout ivec3 v) -{ - __retVal = v; - v = v + ivec3(1); -} - -ivec4 __postIncr(inout ivec4 v) -{ - __retVal = v; - v = v + ivec3(1); -} - - -mat2 __postIncr(inout mat2 m) -{ - mat2 n = m; - m[0] = m[0] + vec2(1.0); - m[1] = m[1] + vec2(1.0); - return n; -} - -mat3 __postIncr(inout mat3 m) -{ - mat3 n = m; - m[0] = m[0] + vec3(1.0); - m[1] = m[1] + vec3(1.0); - m[2] = m[2] + vec3(1.0); - return n; -} - -mat4 __postIncr(inout mat4 m) -{ - mat4 n = m; - m[0] = m[0] + vec4(1.0); - m[1] = m[1] + vec4(1.0); - m[2] = m[2] + vec4(1.0); - m[3] = m[3] + vec4(1.0); - return n; -} - - - -//// inequality operators - - -// XXX are the inequality operators for floats/ints really needed???? -bool __operator < (const float a, const float b) -{ - __asm vec4_sgt __retVal.x, b, a; -} - - -bool __operator < (const int a, const int b) { - return float (a) < float (b); -} - -bool __operator > (const float a, const float b) { - bool c; - __asm float_less c, b, a; - return c; -} - -bool __operator > (const int a, const int b) { - return float (a) > float (b); -} - -bool __operator >= (const float a, const float b) { - bool g, e; - __asm float_less g, b, a; - __asm float_equal e, a, b; - return g || e; -} - -bool __operator >= (const int a, const int b) { - return float (a) >= float (b); -} - -bool __operator <= (const float a, const float b) { - bool g, e; - __asm float_less g, a, b; - __asm float_equal e, a, b; - return g || e; -} - -bool __operator <= (const int a, const int b) { - return float (a) <= float (b); -} - - - -// -// MESA-specific extension functions. -// - -void printMESA (const float f) { - __asm float_print f; -} - -void printMESA (const int i) { - __asm int_print i; -} - -void printMESA (const bool b) { - __asm bool_print b; -} - -void printMESA (const vec2 v) { - printMESA (v.x); - printMESA (v.y); -} - -void printMESA (const vec3 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); -} - -void printMESA (const vec4 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); - printMESA (v.w); -} - -void printMESA (const ivec2 v) { - printMESA (v.x); - printMESA (v.y); -} - -void printMESA (const ivec3 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); -} - -void printMESA (const ivec4 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); - printMESA (v.w); -} - -void printMESA (const bvec2 v) { - printMESA (v.x); - printMESA (v.y); -} - -void printMESA (const bvec3 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); -} - -void printMESA (const bvec4 v) { - printMESA (v.x); - printMESA (v.y); - printMESA (v.z); - printMESA (v.w); -} - -void printMESA (const mat2 m) { - printMESA (m[0]); - printMESA (m[1]); -} - -void printMESA (const mat3 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); -} - -void printMESA (const mat4 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); - printMESA (m[3]); -} - -void printMESA (const sampler1D e) { - __asm int_print e; -} - -void printMESA (const sampler2D e) { - __asm int_print e; -} - -void printMESA (const sampler3D e) { - __asm int_print e; -} - -void printMESA (const samplerCube e) { - __asm int_print e; -} - -void printMESA (const sampler1DShadow e) { - __asm int_print e; -} - -void printMESA (const sampler2DShadow e) { - __asm int_print e; -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_core_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_core_gc.h deleted file mode 100644 index b3d3e87cf4..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_core_gc.h +++ /dev/null @@ -1,869 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_core.gc */ - -5,1,90,95,0,0,5,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,5,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,18,98,0,20,0,0,1,90,95,0,0,5,0,1,1,1,0,0,5,0,105,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,105,0,20,0,0,1,90,95,0,0,1,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,102, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,98,0,20,0,0,1,90,95,0,0,9,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118, -101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,1,0,98,0,0, -0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0, -0,0,1,90,95,0,0,9,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,20,0,0,1, -90,95,0,0,10,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0,1,90,95,0,0,10,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,102,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116, -111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0, -10,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,2,0,98,0,0,0,1,4,105,118, -101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0, -0,0,1,90,95,0,0,10,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,12,0,118, -0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0, -122,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,90,95,0, -0,11,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101, -99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0, -0,0,1,90,95,0,0,11,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,3,0,98,0, -0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,109,111, -118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,0,0,1,90,95,0,0,12,0,1,1, -1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,122,0,0,1,1,0,0,9,0,119,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,18,119,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,5,0,105,0,0,0,1, -4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0, -0,1,90,95,0,0,12,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,4,0,98,0,0,0,1,4,105,118, -101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0, -0,12,0,1,1,1,0,0,8,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114, -101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,11,0,118,51,0,0,1,1,0,0,9,0,102,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,119,0,18,102,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,10,0,118,50,0,0,1,1,0,0,9,0,102,49, -0,0,1,1,0,0,9,0,102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,18,102,50,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106, -0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,9,0,102,0,0,0,1,4, -118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -102,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0, -105,0,0,1,1,0,0,5,0,106,0,0,1,1,0,0,5,0,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,18,107,0,20,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109, -111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,90,95,0,0,7,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, -52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95, -0,0,8,0,1,1,1,0,0,5,0,120,0,0,1,1,0,0,5,0,121,0,0,1,1,0,0,5,0,122,0,0,1,1,0,0,5,0,119,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109, -111,118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,9,0,102, -0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18, -102,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,49,0,0,1,1, -0,0,1,0,98,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,49,0,0,1,1,0,0,5, -0,105,50,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -105,49,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,105,50,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, -52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0, -2,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,17,48,0,48,0,0,0,0, -0,1,90,95,0,0,2,0,1,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,6,0,118,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1,0,0,1,0,98,51, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,90, -95,0,0,3,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,17,48,0,48,0,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,17,48,0, -48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102,51, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,109,111,118, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0, -9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,90, -95,0,0,3,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,7,0,118,0,0,0,1, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1,0,0,1,0,98,51, -0,0,1,1,0,0,1,0,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18, -98,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1,90,95,0,0,4,0,1,1,1,0, -0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,1,1,0,0,9,0,102,52,0,0,0,1,3,2,90, -95,1,0,9,0,1,122,101,114,111,0,2,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,18,122,101,114,111,0,0,0,4,118,101, -99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102,51,0,0,18,122,101,114, -111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,102,52,0, -0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,109,111, -118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,98,0,0,0,0,1,90,95,0,0,4,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,119,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,105,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4, -0,1,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0,9,0,109,48,48,0,0,1, -1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18, -109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,0,1, -90,95,0,0,13,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,102,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,17,48,0,48,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,59,121,0,18,102,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109, -97,116,50,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0,1,0,98,0,0, -0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0, -0,10,0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99, -48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,14,0,1,1, -1,0,0,9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,48,49, -0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,48,50,0,0,1,1,0,0,9,0,109, -49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,109, -50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48,50,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,9,0,102,0,0,0,1,3,2, -90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,118,0,59,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,118, -0,59,121,121,120,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116,51,0,0,58,102, -108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,1,0,98,0,0,0,1,8,58,109,97,116, -51,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,11,0,99,48,0,0,1,1, -0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,109,48,48,0,0,1,1,0, -0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,51,48,0,0,1,1,0,0,9,0,109,48,49,0,0, -1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,51,49,0,0,1,1,0,0,9,0,109,48, -50,0,0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,1,1,0,0,9,0,109,51,50,0,0,1,1,0,0,9,0, -109,48,51,0,0,1,1,0,0,9,0,109,49,51,0,0,1,1,0,0,9,0,109,50,51,0,0,1,1,0,0,9,0,109,51,51,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,109,51, -48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -59,119,0,18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57, -59,120,0,18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,109,49, -51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,109,50,51,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,59,119,0,18,109,51,51,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9, -0,102,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,118,0,59,121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51, -0,57,18,118,0,59,121,121,121,120,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97, -116,52,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,1,0,98,0,0,0, -1,8,58,109,97,116,52,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0, -12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,1,1,0,0,12,0,99,51,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,5,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0, -0,5,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -5,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,22,1,1,0,0,5,0, -97,0,0,1,1,0,0,5,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,97,0,0,1,1, -0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -6,0,2,21,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0, -97,0,0,1,1,0,0,6,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105, -118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0, -97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101, -99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,22, -1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95, -105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0, -8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101, -99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,8,0,2,21,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,22, -1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,98,73,110,118,0,59,119,0,0,18,98,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118, -101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,2,26,1,1,0,0,9,0,97, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99, -52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1, -90,95,0,0,9,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,22, -1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,90,95,0, -0,10,0,2,26,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10, -0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0, -118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0, -118,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112, -0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0, -0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1, -1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0, -0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0, -0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117, -0,0,0,1,3,2,90,95,0,0,11,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18, -117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, -18,119,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52, -95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27, -1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, -95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0, -0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0,12, -0,117,0,0,0,1,3,2,90,95,0,0,12,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120, -0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121, -0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,10, -0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1, -0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,9,0,97,0, -0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10, -0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1, -0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2, -21,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,105,110,118,85,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0, -18,105,110,118,85,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118, -66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0, -0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0, -11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,9,0, -97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,27, -1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95, -0,0,11,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121, -122,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59, -120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,3, -2,90,95,0,0,11,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0, -59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0, -0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117, -0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,97,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,22,1, -1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18, -105,110,118,66,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101, -99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0, -2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0, -117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0, -0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0, -12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0, -0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,3,2,90,95,0,0,12,0,1,105,110,118,85,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -105,110,118,85,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,105,110,118,85,0,0,0,0,1,90,95,0,0,12,0,2,22, -1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0, -6,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, -101,99,50,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,46,20, -0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118, -0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18, -98,0,0,0,47,20,0,0,1,90,95,0,0,6,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,6,0,2,21,1, -1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118, -101,99,50,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90, -95,0,0,6,0,2,22,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0, -0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0, -46,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,5, -0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97, -0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,7,0, -2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101, -99,51,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,48,20,0,0,1, -90,95,0,0,7,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0,118,0,0,1, -1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0, -0,0,49,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0, -0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99, -52,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0, -8,0,2,27,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58, -105,118,101,99,52,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0, -117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,48,20, -0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,5,0,97, -0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0, -0,18,117,0,49,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,5,0,2, -27,1,1,0,0,5,0,97,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,97,0,0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,110, -101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0, -0,7,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0, -18,118,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,0, -1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, -0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,2,27, -1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0, -0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0, -0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,54,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54, -20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, -49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,54,20,0,0,1,90,95,0,0,9,0,0, -100,111,116,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0, -18,98,0,48,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,97,0,59,120,0,18,98,0,59,120,0,48,18,97,0,59,121,0,18,98,0,59,121, -0,48,46,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118, -101,99,51,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -9,0,0,100,111,116,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,1,1,0,2,0,5,0,97,0,0, -1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,2,1,0,2,0, -5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0, -2,3,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90, -95,0,0,5,0,2,4,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97, -0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0, -18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0, -0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0, -1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1, -0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90, -95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8, -18,118,0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9, -18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0, -8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8, -0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118, -0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -49,20,0,8,18,118,0,0,0,1,90,95,0,0,9,0,2,1,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18, -97,0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,2,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9, -18,97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,3,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0, -98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,4,1,0,2,0,9,0,97,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2, -0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90, -95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0, -8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18, -118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0, -0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0, -0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2, -2,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0, -0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118, -0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0, -117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0, -118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2, -1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0, -0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0, -18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6, -0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,49,20,0, -8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0, -0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118, -0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105, -118,101,99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0, -0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1, -90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99, -52,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0, -0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18, -97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,1, -1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0, -46,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0, -18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0, -118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58, -118,101,99,50,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1, -0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1, -90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99, -51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97, -0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11, -0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0, -0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, -118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2, -0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,47,20,0, -8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118, -0,58,118,101,99,52,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0, -0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0, -0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2, -27,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109, -0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,0,48, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0, -57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,0,48,46,20,0,0,1,90,95, -0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0, -0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50, -0,57,18,110,0,16,10,50,0,57,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121,0,48,46,18,109, -0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,0,48,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57, -59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,10,50,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121, -121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,0,48,46,20,0,0,1,90, -95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,0,1,90,95,0,0,15,0,2,26, -1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0, -15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109, -0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121, -121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,122,0,48,46,18,109, -0,16,10,51,0,57,18,110,0,16,8,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,120,0,48,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16, -10,49,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,49,0,57,59,119,119,119, -119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,0, -16,10,50,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121, -121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16, -10,51,0,57,18,110,0,16,10,50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,51,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,51,0,57,59,120,120,120,120,0,48,18,109,0,16, -10,49,0,57,18,110,0,16,10,51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10, -51,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,59,119,119,119, -119,0,48,46,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, -49,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98, -0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0, -0,1,90,95,0,0,13,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0, -0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,0,1, -90,95,0,0,13,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0, -0,13,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97, -0,18,110,0,16,10,49,0,57,49,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,0,1,90,95,0,0,14,0,2, -26,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110, -0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50, -0,57,46,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,9,0,97,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0, -57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,90,95, -0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,98,0,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,14,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0, -1,90,95,0,0,14,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, -18,110,0,16,10,50,0,57,49,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,0,1,90,95,0,0,15,0,2,26,1,1,0, -0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18, -110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10, -49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1, -90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,16,10,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51, -0,57,18,98,0,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109,0,0,1,1, -0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0, -47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,47,20,0,0,1,90,95,0,0,15,0,2, -21,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110, -0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20, -0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16, -10,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,49,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98, -0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,49,20,0,0,1,90,95,0,0,10,0,2, -21,1,1,0,0,13,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8, -48,0,57,18,118,0,59,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,0,48,46,20,0,0,1,90,95, -0,0,10,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2, -21,1,1,0,0,14,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8, -48,0,57,18,118,0,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109, -0,16,10,50,0,57,18,118,0,59,122,122,122,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0, -1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0, -18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18, -118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116, -0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0, -0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120, -120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18, -118,0,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,118,0,59,119,119,119,119,0,48,46,20,0,0, -1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0, -0,1,90,95,0,0,13,0,2,1,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,13, -0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,109, -0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0, -13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18, -109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0, -0,14,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9, -18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,109,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2, -0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9, -18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,8,18,109,0,0,0,1,90, -95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0, -8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0, -16,10,50,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,109,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,109,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0, -0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49, -20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,109,0,16, -10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,9,18,109,0,16,10,51,0,57,18,109,0, -16,10,51,0,57,18,110,0,16,10,51,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,1,1,0,2,0,13,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18, -109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10, -49,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,118,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,47,20, -0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10, -0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90, -95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118, -101,99,50,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90, -95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118, -101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9,18, -109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,118,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0, -47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,47,20,0,8,18,109,0,0,0,1,90,95,0, -0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99, -51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0, -16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0, -57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0, -1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,8,18,109,0,0, -0,1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2,58, -118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9, -18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0, -16,10,50,0,57,18,118,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,118,0,46,20,0,8, -18,109,0,0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1, -118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118, -0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,47,20,0,9,18,109,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,118,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,118, -0,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90, -95,0,0,12,0,1,118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8, -48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,9,18,109, -0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51, -0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,3,2,90,95,0,0,12,0,1,118,0,2,58,118,101,99,52,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,9,18,109,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10, -0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, -11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,14,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,118,0,18,118,0, -18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,5,0,2,25,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16, -10,49,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,25,1,0,2,0,6,0, -118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,7,0,2,25,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,51,0,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0, -1,90,95,0,0,8,0,2,25,1,0,2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,10,49, -0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,25,1,0,2,0,9,0, -97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20, -0,0,1,90,95,0,0,10,0,2,25,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49, -0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,25,1,0, -2,0,11,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,12,0,2,25,1,0,2,0,12,0,118,0,0,0,1,9,18,118, -0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,0,1,90,95,0,0,13,0,2,25,1,0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8, -48,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0, -20,0,0,1,90,95,0,0,14,0,2,25,1,0,2,0,14,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58, -118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1, -90,95,0,0,15,0,2,25,1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90, -95,0,0,5,0,2,24,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,24,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105, -118,101,99,50,0,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90, -95,0,0,7,0,2,24,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0, -0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,24,1,0,2,0,8,0,118, -0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,24,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0, -48,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2,24,1,0,2,0,10, -0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,24,1,0,2,0,11,0,118,0,0,0,1,9,18,118,0,18, -118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0, -20,0,0,1,90,95,0,0,12,0,2,24,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17, -49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,13,0,2,24,1, -0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,0,17,49,0, -48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,0,17,49,0,48, -0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,2,24,1,0,2,0, -14,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0, -0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0, -0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,24,1,0,2,0,15,0,109, -0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46, -20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20, -0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0, -9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9, -18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,68,101,99, -114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16, -10,49,0,47,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,6,0,118,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16, -10,49,0,0,0,47,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,7,0,118,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0, -16,10,49,0,0,0,47,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,8,0,118,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0, -0,16,10,49,0,0,0,47,20,0,0,1,90,95,0,0,9,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,9,0,97, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,0, -1,90,95,0,0,10,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47, -20,0,0,1,90,95,0,0,11,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0, -0,47,20,0,0,1,90,95,0,0,12,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0, -0,0,0,47,20,0,0,1,90,95,0,0,13,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,13,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58, -118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58, -118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,68,101,99, -114,0,1,0,2,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48, -0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57, -18,109,0,16,10,50,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1,90,95,0,0,15,0,0,95,95, -112,111,115,116,68,101,99,114,0,1,0,2,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109, -0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20, -0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0, -9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9, -18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1, -90,95,0,0,9,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,90,95,0,0,10,0,0,95,95,112, -111,115,116,73,110,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0, -20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0,11,0,0,95, -95,112,111,115,116,73,110,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0,12,0, -0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0, -5,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116, -73,110,99,114,0,1,0,2,0,6,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118, -0,18,118,0,58,105,118,101,99,50,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115, -116,73,110,99,114,0,1,0,2,0,7,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18, -118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111, -115,116,73,110,99,114,0,1,0,2,0,8,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9, -18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,13,0,0,95,95,112, -111,115,116,73,110,99,114,0,1,0,2,0,13,0,109,0,0,0,1,3,2,90,95,0,0,13,0,1,110,0,2,18,109,0,0,0,9, -18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18, -109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,8,18, -110,0,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,14,0,109,0,0,0,1,3,2,90, -95,0,0,14,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51, -0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0, -0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,0, -17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,15,0,0,95,95,112,111,115,116,73,110,99,114,0, -1,0,2,0,15,0,109,0,0,0,1,3,2,90,95,0,0,15,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109, -0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10, -51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0, -0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0, -0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,40,0,0,1,90,95, -0,0,1,0,2,16,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,99,0,0,0,4,102,108,111, -97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,90,95,0,0,1,0,2,16,1,1, -0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97, -116,0,0,18,98,0,0,0,41,0,0,1,90,95,0,0,1,0,2,18,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, -95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0, -18,97,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103, -0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,18,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111, -97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,43,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,9, -0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95, -108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18, -101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,5,0,97,0,0,1, -1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0, -42,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,9,0,102,0,0,0,1,4,102,108,111, -97,116,95,112,114,105,110,116,0,18,102,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0, -1,1,0,0,5,0,105,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,90,95,0,0,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,0,1,0,98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0, -18,98,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,10,0,118,0,0,0,1,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0, -0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,11,0,118,0, -0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77, -69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,12,0,118,0,0,0,1,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, -118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69, -83,65,0,1,1,0,0,6,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9, -58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, -116,77,69,83,65,0,1,1,0,0,7,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120, -0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1, -0,0,8,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, -118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0, -0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,2,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69, -83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,3,0,118,0,0,0,1,9,58,112,114,105,110, -116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, -121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,0,4,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112, -114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,13,0,109,0,0, -0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0, -1,1,0,0,14,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83, -65,0,0,18,109,0,16,10,50,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0, -15,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,10,51,0,57,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,16,0,101,0,0,0,1,4,105,110,116,95, -112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0, -17,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,18,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,19,0,101,0,0,0,1,4,105,110,116, -95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, -0,20,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,21,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, -0,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin.gc deleted file mode 100644 index 416c6ff313..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin.gc +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -// -// From Shader Spec, ver. 1.10, rev. 59 -// - -__fixed_input vec4 gl_FragCoord; -__fixed_input bool gl_FrontFacing; -__fixed_output vec4 gl_FragColor; -__fixed_output vec4 gl_FragData[gl_MaxDrawBuffers]; -__fixed_output float gl_FragDepth; - -varying vec4 gl_Color; -varying vec4 gl_SecondaryColor; -varying vec4 gl_TexCoord[gl_MaxTextureCoords]; -varying float gl_FogFragCoord; - - - -//// 8.7 Texture Lookup Functions (with bias) - -vec4 texture1D(const sampler1D sampler, const float coord, const float bias) -{ - vec4 coord4; - coord4.x = coord; - coord4.w = bias; - __asm vec4_texb1d __retVal, sampler, coord4; -} - -vec4 texture1DProj(const sampler1D sampler, const vec2 coord, const float bias) -{ - // do projection here (there's no vec4_texbp1d instruction) - vec4 pcoord; - pcoord.x = coord.x / coord.y; - pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - -vec4 texture1DProj(const sampler1D sampler, const vec4 coord, const float bias) -{ - // do projection here (there's no vec4_texbp1d instruction) - vec4 pcoord; - pcoord.x = coord.x / coord.z; - pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - - - - -vec4 texture2D(const sampler2D sampler, const vec2 coord, const float bias) -{ - vec4 coord4; - coord4.xy = coord.xy; - coord4.w = bias; - __asm vec4_texb2d __retVal, sampler, coord4; -} - -vec4 texture2DProj(const sampler2D sampler, const vec3 coord, const float bias) -{ - // do projection here (there's no vec4_texbp2d instruction) - vec4 pcoord; - pcoord.xy = coord.xy / coord.z; - pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - -vec4 texture2DProj(const sampler2D sampler, const vec4 coord, const float bias) -{ - // do projection here (there's no vec4_texbp2d instruction) - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - - - - -vec4 texture3D(const sampler3D sampler, const vec3 coord, const float bias) -{ - vec4 coord4; - coord4.xyz = coord.xyz; - coord4.w = bias; - __asm vec4_texb3d __retVal, sampler, coord4; -} - -vec4 texture3DProj(const sampler3D sampler, const vec4 coord, const float bias) -{ - // do projection here (there's no vec4_texbp3d instruction) - vec4 pcoord; - pcoord.xyz = coord.xyz / coord.w; - pcoord.w = bias; - __asm vec4_texb3d __retVal, sampler, pcoord; -} - - - - -vec4 textureCube(const samplerCube sampler, const vec3 coord, const float bias) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = bias; - __asm vec4_texcube __retVal, sampler, coord4; -} - - - - -// For shadow textures, we use the regular tex instructions since they should -// do the depth comparison step. - -vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord, const float bias) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = bias; - __asm vec4_texb1d __retVal, sampler, coord4; -} - -vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float bias) -{ - vec4 pcoord; - pcoord.x = coord.x / coord.w; - pcoord.z = coord.z; - pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - -vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = bias; - __asm vec4_texb2d __retVal, sampler, coord4; -} - -vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float bias) -{ - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - pcoord.z = coord.z; - pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - - - -// -// 8.8 Fragment Processing Functions -// - -float dFdx(const float p) -{ - __asm vec4_ddx __retVal.x, p.xxxx; -} - -vec2 dFdx(const vec2 p) -{ - __asm vec4_ddx __retVal.xy, p.xyyy; -} - -vec3 dFdx(const vec3 p) -{ - __asm vec4_ddx __retVal.xyz, p.xyzz; -} - -vec4 dFdx(const vec4 p) -{ - __asm vec4_ddx __retVal, p; -} - -float dFdy(const float p) -{ - __asm vec4_ddy __retVal.x, p.xxxx; -} - -vec2 dFdy(const vec2 p) -{ - __asm vec4_ddy __retVal.xy, p.xyyy; -} - -vec3 dFdy(const vec3 p) -{ - __asm vec4_ddy __retVal.xyz, p.xyzz; -} - -vec4 dFdy(const vec4 p) -{ - __asm vec4_ddy __retVal, p; -} - -float fwidth (const float p) -{ - // XXX hand-write with __asm - return abs(dFdx(p)) + abs(dFdy(p)); -} - -vec2 fwidth(const vec2 p) -{ - // XXX hand-write with __asm - return abs(dFdx(p)) + abs(dFdy(p)); -} - -vec3 fwidth(const vec3 p) -{ - // XXX hand-write with __asm - return abs(dFdx(p)) + abs(dFdy(p)); -} - -vec4 fwidth(const vec4 p) -{ - // XXX hand-write with __asm - return abs(dFdx(p)) + abs(dFdy(p)); -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin_gc.h deleted file mode 100644 index 738a0f9295..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ /dev/null @@ -1,107 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_fragment_builtin.gc */ - -5,2,2,90,95,6,0,12,0,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,90,95,6,0,1,0,1,103, -108,95,70,114,111,110,116,70,97,99,105,110,103,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103, -67,111,108,111,114,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108, -95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,0,0,2,2,90,95,5,0,9,0,1,103,108,95,70,114, -97,103,68,101,112,116,104,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95, -3,0,12,0,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0, -1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101, -67,111,111,114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111, -114,100,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0, -12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0, -20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, -98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0, -1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99, -111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116, -86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1, -1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99, -111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18, -99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20, -0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9, -0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, -52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0, -18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101, -120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11, -0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114, -100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99, -111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0, -4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100, -0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95, -116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0, -1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0, -18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97, -115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, -114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111, -114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9, -18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111, -111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4, -118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67, -117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0, -0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114, -100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98, -105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, -100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0, -0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111, -111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119, -0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115, -104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114, -100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0, -20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, -98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111, -114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12, -0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114, -100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116, -101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21, -0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0, -0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0, -18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100, -120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,120,0,1,1,0,0,10,0,112,0, -0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59, -120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99, -52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122, -122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100, -100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100,121,0,1,1, -0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0,0,10,0,112,0,0,0,1,4, -118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121, -121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99,52,95, -100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0, -0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0, -18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119,105,100,116,104,0,1,1, -0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58, -100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105,100,116,104,0,1,1,0,0,10, -0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70, -100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100,116,104,0,1,1,0,0,11,0,112, -0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100, -121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116,104,0,1,1,0,0,12,0,112,0,0, -0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100,121,0, -0,18,112,0,0,0,0,0,46,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives.syn b/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives.syn deleted file mode 100755 index b51d168cc0..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives.syn +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2006 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. - */ - -/** - * \file slang_pp_directives.syn - * slang preprocessor directives parser - * \author Michal Krol - */ - -.syntax source; - -/* - * This syntax script preprocesses a GLSL shader. - * It is assumed, that the #version directive has been parsed. Separate pass for parsing - * version gives better control on behavior depending on the version number given. - * - * The output is a source string with comments and directives removed. White spaces and comments - * are replaced with on or more spaces. All new-lines are preserved and converted to Linux format. - * Directives are escaped with a null character. The end of the source string is marked by - * two consecutive null characters. The consumer is responsible for executing the escaped - * directives, removing dead portions of code and expanding macros. - */ - -.emtcode ESCAPE_TOKEN 0 - -/* - * The TOKEN_* symbols follow the ESCAPE_TOKEN. - * - * NOTE: - * There is no TOKEN_IFDEF and neither is TOKEN_IFNDEF. They are handled with TOKEN_IF and - * operator defined. - * The "#ifdef SYMBOL" is replaced with "#if defined SYMBOL" - * The "#ifndef SYMBOL" is replaced with "#if !defined SYMBOL" - */ -.emtcode TOKEN_END 0 -.emtcode TOKEN_DEFINE 1 -.emtcode TOKEN_UNDEF 2 -.emtcode TOKEN_IF 3 -.emtcode TOKEN_ELSE 4 -.emtcode TOKEN_ELIF 5 -.emtcode TOKEN_ENDIF 6 -.emtcode TOKEN_ERROR 7 -.emtcode TOKEN_PRAGMA 8 -.emtcode TOKEN_EXTENSION 9 -.emtcode TOKEN_LINE 10 - -/* - * The PARAM_* symbols follow the TOKEN_DEFINE. - */ -.emtcode PARAM_END 0 -.emtcode PARAM_PARAMETER 1 - -/* - * The BEHAVIOR_* symbols follow the TOKEN_EXTENSION. - */ -.emtcode BEHAVIOR_REQUIRE 1 -.emtcode BEHAVIOR_ENABLE 2 -.emtcode BEHAVIOR_WARN 3 -.emtcode BEHAVIOR_DISABLE 4 - -/* - * The PRAGMA_* symbols follow TOKEN_PRAGMA - */ -.emtcode PRAGMA_NO_PARAM 0 -.emtcode PRAGMA_PARAM 1 - -source - optional_directive .and .loop source_element .and '\0' .emit ESCAPE_TOKEN .emit TOKEN_END; - -source_element - c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest .and .true .emit ' '; - -c_style_comment_rest - .loop c_style_comment_body .and c_style_comment_end; - -c_style_comment_body - c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar; - -c_style_comment_char_nostar - new_line .or '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_char_star_noslashstar - '*' .and c_style_comment_char_star_noslashstar_1; -c_style_comment_char_star_noslashstar_1 - c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar; - -c_style_comment_char_noslashstar - new_line .or '\x30'-'\xFF' .or '\x01'-'\x29' .or '\x2B'-'\x2E'; - -c_style_comment_end - '*' .and .loop c_style_comment_char_star .and '/'; - -c_style_comment_char_star - '*'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line_directive; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line_directive - new_line .and optional_directive; - -new_line - generic_new_line .emit '\n'; - -generic_new_line - carriage_return_line_feed .or line_feed_carriage_return .or '\n' .or '\r'; - -carriage_return_line_feed - '\r' .and '\n'; - -line_feed_carriage_return - '\n' .and '\r'; - -optional_directive - directive .emit ESCAPE_TOKEN .or .true; - -directive - dir_define .emit TOKEN_DEFINE .or - dir_undef .emit TOKEN_UNDEF .or - dir_if .emit TOKEN_IF .or - dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd' - .emit ' ' .or - dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' - .emit 'd' .emit ' ' .or - dir_else .emit TOKEN_ELSE .or - dir_elif .emit TOKEN_ELIF .or - dir_endif .emit TOKEN_ENDIF .or - dir_ext .emit TOKEN_EXTENSION .or - dir_pragma .emit TOKEN_PRAGMA .or - dir_line .emit TOKEN_LINE; - -dir_define - optional_space .and '#' .and optional_space .and "define" .and symbol .and opt_parameters .and - definition; - -dir_undef - optional_space .and '#' .and optional_space .and "undef" .and symbol; - -dir_if - optional_space .and '#' .and optional_space .and "if" .and expression; - -dir_ifdef - optional_space .and '#' .and optional_space .and "ifdef" .and symbol; - -dir_ifndef - optional_space .and '#' .and optional_space .and "ifndef" .and symbol; - -dir_else - optional_space .and '#' .and optional_space .and "else"; - -dir_elif - optional_space .and '#' .and optional_space .and "elif" .and expression; - -dir_endif - optional_space .and '#' .and optional_space .and "endif"; - -dir_ext - optional_space .and '#' .and optional_space .and "extension" .and space .and extension_name .and - optional_space .and ':' .and optional_space .and extension_behavior; - -dir_line - optional_space .and '#' .and optional_space .and "line" .and expression; - -dir_pragma - optional_space .and '#' .and optional_space .and "pragma" .and symbol .and opt_pragma_param; - - -opt_pragma_param - pragma_param .or .true .emit PRAGMA_NO_PARAM; - -pragma_param - optional_space .and '(' .emit PRAGMA_PARAM .and optional_space .and symbol_no_space .and optional_space .and ')'; - -symbol_no_space - symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -symbol - space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -opt_parameters - parameters .or .true .emit PARAM_END; - -parameters - '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END; -parameters_1 - parameters_2 .or .true; -parameters_2 - parameter .emit PARAM_PARAMETER .and .loop parameters_3; -parameters_3 - optional_space .and ',' .and parameter .emit PARAM_PARAMETER; - -parameter - optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and - .true .emit '\0'; - -definition - .loop definition_character .emit * .and .true .emit '\0'; - -definition_character - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -expression - expression_element .and .loop expression_element .and .true .emit '\0'; - -expression_element - expression_character .emit *; - -expression_character - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -extension_name - symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -extension_behavior - "require" .emit BEHAVIOR_REQUIRE .or - "enable" .emit BEHAVIOR_ENABLE .or - "warn" .emit BEHAVIOR_WARN .or - "disable" .emit BEHAVIOR_DISABLE; - -optional_space - .loop single_space; - -space - single_space .and .loop single_space; - -single_space - ' ' .or '\t'; - -source_token - space .emit ' ' .or complex_token .or source_token_1; -source_token_1 - simple_token .emit ' ' .and .true .emit ' '; - -/* - * All possible tokens. - */ - -complex_token - identifier .or number; - -simple_token - increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or - addto .or subtractfrom .or multiplyto .or divideto .or other; - -identifier - identifier_char1 .emit * .and .loop identifier_char2 .emit *; -identifier_char1 - 'a'-'z' .or 'A'-'Z' .or '_'; -identifier_char2 - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - -number - float .or integer; - -digit_oct - '0'-'7'; - -digit_dec - '0'-'9'; - -digit_hex - '0'-'9' .or 'A'-'F' .or 'a'-'f'; - -float - float_1 .or float_2; -float_1 - float_fractional_constant .and float_optional_exponent_part; -float_2 - float_digit_sequence .and float_exponent_part; - -float_fractional_constant - float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3; -float_fractional_constant_1 - float_digit_sequence .and '.' .emit '.' .and float_digit_sequence; -float_fractional_constant_2 - float_digit_sequence .and '.' .emit '.'; -float_fractional_constant_3 - '.' .emit '.' .and float_digit_sequence; - -float_optional_exponent_part - float_exponent_part .or .true; - -float_digit_sequence - digit_dec .emit * .and .loop digit_dec .emit *; - -float_exponent_part - float_exponent_part_1 .or float_exponent_part_2; -float_exponent_part_1 - 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence; -float_exponent_part_2 - 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence; - -float_optional_sign - '+' .emit '+' .or '-' .emit '-' .or .true; - -integer - integer_hex .or integer_oct .or integer_dec; - -integer_hex - '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and - .loop digit_hex .emit *; -integer_hex_1 - 'x' .or 'X'; - -integer_oct - '0' .emit '0' .and .loop digit_oct .emit *; - -integer_dec - digit_dec .emit * .and .loop digit_dec .emit *; - -increment - '+' .emit * .and '+' .emit *; - -decrement - '-' .emit * .and '-' .emit *; - -lequal - '<' .emit * .and '=' .emit *; - -gequal - '>' .emit * .and '=' .emit *; - -equal - '=' .emit * .and '=' .emit *; - -nequal - '!' .emit * .and '=' .emit *; - -and - '&' .emit * .and '&' .emit *; - -xor - '^' .emit * .and '^' .emit *; - -or - '|' .emit * .and '|' .emit *; - -addto - '+' .emit * .and '=' .emit *; - -subtractfrom - '-' .emit * .and '=' .emit *; - -multiplyto - '*' .emit * .and '=' .emit *; - -divideto - '/' .emit * .and '=' .emit *; - -/* - * All characters except '\0' and '#'. - */ -other - '\x24'-'\xFF' .emit * .or '\x01'-'\x22' .emit *; - -symbol_character - 'A'-'Z' .or 'a'-'z' .or '_'; - -symbol_character2 - 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_'; - -.string string_lexer; - -string_lexer - lex_first_identifier_character .and .loop lex_next_identifier_character; - -lex_first_identifier_character - 'a'-'z' .or 'A'-'Z' .or '_'; - -lex_next_identifier_character - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives_syn.h b/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives_syn.h deleted file mode 100644 index 430f8d8217..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_directives_syn.h +++ /dev/null @@ -1,250 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax source;\n" -".emtcode ESCAPE_TOKEN 0\n" -".emtcode TOKEN_END 0\n" -".emtcode TOKEN_DEFINE 1\n" -".emtcode TOKEN_UNDEF 2\n" -".emtcode TOKEN_IF 3\n" -".emtcode TOKEN_ELSE 4\n" -".emtcode TOKEN_ELIF 5\n" -".emtcode TOKEN_ENDIF 6\n" -".emtcode TOKEN_ERROR 7\n" -".emtcode TOKEN_PRAGMA 8\n" -".emtcode TOKEN_EXTENSION 9\n" -".emtcode TOKEN_LINE 10\n" -".emtcode PARAM_END 0\n" -".emtcode PARAM_PARAMETER 1\n" -".emtcode BEHAVIOR_REQUIRE 1\n" -".emtcode BEHAVIOR_ENABLE 2\n" -".emtcode BEHAVIOR_WARN 3\n" -".emtcode BEHAVIOR_DISABLE 4\n" -".emtcode PRAGMA_NO_PARAM 0\n" -".emtcode PRAGMA_PARAM 1\n" -"source\n" -" optional_directive .and .loop source_element .and '\\0' .emit ESCAPE_TOKEN .emit TOKEN_END;\n" -"source_element\n" -" c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token;\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest .and .true .emit ' ';\n" -"c_style_comment_rest\n" -" .loop c_style_comment_body .and c_style_comment_end;\n" -"c_style_comment_body\n" -" c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar;\n" -"c_style_comment_char_nostar\n" -" new_line .or '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_char_star_noslashstar\n" -" '*' .and c_style_comment_char_star_noslashstar_1;\n" -"c_style_comment_char_star_noslashstar_1\n" -" c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar;\n" -"c_style_comment_char_noslashstar\n" -" new_line .or '\\x30'-'\\xFF' .or '\\x01'-'\\x29' .or '\\x2B'-'\\x2E';\n" -"c_style_comment_end\n" -" '*' .and .loop c_style_comment_char_star .and '/';\n" -"c_style_comment_char_star\n" -" '*';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line_directive;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"new_line_directive\n" -" new_line .and optional_directive;\n" -"new_line\n" -" generic_new_line .emit '\\n';\n" -"generic_new_line\n" -" carriage_return_line_feed .or line_feed_carriage_return .or '\\n' .or '\\r';\n" -"carriage_return_line_feed\n" -" '\\r' .and '\\n';\n" -"line_feed_carriage_return\n" -" '\\n' .and '\\r';\n" -"optional_directive\n" -" directive .emit ESCAPE_TOKEN .or .true;\n" -"directive\n" -" dir_define .emit TOKEN_DEFINE .or\n" -" dir_undef .emit TOKEN_UNDEF .or\n" -" dir_if .emit TOKEN_IF .or\n" -" dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd'\n" -" .emit ' ' .or\n" -" dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e'\n" -" .emit 'd' .emit ' ' .or\n" -" dir_else .emit TOKEN_ELSE .or\n" -" dir_elif .emit TOKEN_ELIF .or\n" -" dir_endif .emit TOKEN_ENDIF .or\n" -" dir_ext .emit TOKEN_EXTENSION .or\n" -" dir_pragma .emit TOKEN_PRAGMA .or\n" -" dir_line .emit TOKEN_LINE;\n" -"dir_define\n" -" optional_space .and '#' .and optional_space .and \"define\" .and symbol .and opt_parameters .and\n" -" definition;\n" -"dir_undef\n" -" optional_space .and '#' .and optional_space .and \"undef\" .and symbol;\n" -"dir_if\n" -" optional_space .and '#' .and optional_space .and \"if\" .and expression;\n" -"dir_ifdef\n" -" optional_space .and '#' .and optional_space .and \"ifdef\" .and symbol;\n" -"dir_ifndef\n" -" optional_space .and '#' .and optional_space .and \"ifndef\" .and symbol;\n" -"dir_else\n" -" optional_space .and '#' .and optional_space .and \"else\";\n" -"dir_elif\n" -" optional_space .and '#' .and optional_space .and \"elif\" .and expression;\n" -"dir_endif\n" -" optional_space .and '#' .and optional_space .and \"endif\";\n" -"dir_ext\n" -" optional_space .and '#' .and optional_space .and \"extension\" .and space .and extension_name .and\n" -" optional_space .and ':' .and optional_space .and extension_behavior;\n" -"dir_line\n" -" optional_space .and '#' .and optional_space .and \"line\" .and expression;\n" -"dir_pragma\n" -" optional_space .and '#' .and optional_space .and \"pragma\" .and symbol .and opt_pragma_param;\n" -"opt_pragma_param\n" -" pragma_param .or .true .emit PRAGMA_NO_PARAM;\n" -"pragma_param\n" -" optional_space .and '(' .emit PRAGMA_PARAM .and optional_space .and symbol_no_space .and optional_space .and ')';\n" -"symbol_no_space\n" -" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"symbol\n" -" space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"opt_parameters\n" -" parameters .or .true .emit PARAM_END;\n" -"parameters\n" -" '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END;\n" -"parameters_1\n" -" parameters_2 .or .true;\n" -"parameters_2\n" -" parameter .emit PARAM_PARAMETER .and .loop parameters_3;\n" -"parameters_3\n" -" optional_space .and ',' .and parameter .emit PARAM_PARAMETER;\n" -"parameter\n" -" optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and\n" -" .true .emit '\\0';\n" -"definition\n" -" .loop definition_character .emit * .and .true .emit '\\0';\n" -"definition_character\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"expression\n" -" expression_element .and .loop expression_element .and .true .emit '\\0';\n" -"expression_element\n" -" expression_character .emit *;\n" -"expression_character\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"extension_name\n" -" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"extension_behavior\n" -" \"require\" .emit BEHAVIOR_REQUIRE .or\n" -" \"enable\" .emit BEHAVIOR_ENABLE .or\n" -" \"warn\" .emit BEHAVIOR_WARN .or\n" -" \"disable\" .emit BEHAVIOR_DISABLE;\n" -"optional_space\n" -" .loop single_space;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"source_token\n" -" space .emit ' ' .or complex_token .or source_token_1;\n" -"source_token_1\n" -" simple_token .emit ' ' .and .true .emit ' ';\n" -"complex_token\n" -" identifier .or number;\n" -"simple_token\n" -" increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or\n" -" addto .or subtractfrom .or multiplyto .or divideto .or other;\n" -"identifier\n" -" identifier_char1 .emit * .and .loop identifier_char2 .emit *;\n" -"identifier_char1\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"identifier_char2\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"number\n" -" float .or integer;\n" -"digit_oct\n" -" '0'-'7';\n" -"digit_dec\n" -" '0'-'9';\n" -"digit_hex\n" -" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n" -"float\n" -" float_1 .or float_2;\n" -"float_1\n" -" float_fractional_constant .and float_optional_exponent_part;\n" -"float_2\n" -" float_digit_sequence .and float_exponent_part;\n" -"float_fractional_constant\n" -" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n" -"float_fractional_constant_1\n" -" float_digit_sequence .and '.' .emit '.' .and float_digit_sequence;\n" -"float_fractional_constant_2\n" -" float_digit_sequence .and '.' .emit '.';\n" -"float_fractional_constant_3\n" -" '.' .emit '.' .and float_digit_sequence;\n" -"float_optional_exponent_part\n" -" float_exponent_part .or .true;\n" -"float_digit_sequence\n" -" digit_dec .emit * .and .loop digit_dec .emit *;\n" -"float_exponent_part\n" -" float_exponent_part_1 .or float_exponent_part_2;\n" -"float_exponent_part_1\n" -" 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence;\n" -"float_exponent_part_2\n" -" 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence;\n" -"float_optional_sign\n" -" '+' .emit '+' .or '-' .emit '-' .or .true;\n" -"integer\n" -" integer_hex .or integer_oct .or integer_dec;\n" -"integer_hex\n" -" '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and\n" -" .loop digit_hex .emit *;\n" -"integer_hex_1\n" -" 'x' .or 'X';\n" -"integer_oct\n" -" '0' .emit '0' .and .loop digit_oct .emit *;\n" -"integer_dec\n" -" digit_dec .emit * .and .loop digit_dec .emit *;\n" -"increment\n" -" '+' .emit * .and '+' .emit *;\n" -"decrement\n" -" '-' .emit * .and '-' .emit *;\n" -"lequal\n" -" '<' .emit * .and '=' .emit *;\n" -"gequal\n" -" '>' .emit * .and '=' .emit *;\n" -"equal\n" -" '=' .emit * .and '=' .emit *;\n" -"nequal\n" -" '!' .emit * .and '=' .emit *;\n" -"and\n" -" '&' .emit * .and '&' .emit *;\n" -"xor\n" -" '^' .emit * .and '^' .emit *;\n" -"or\n" -" '|' .emit * .and '|' .emit *;\n" -"addto\n" -" '+' .emit * .and '=' .emit *;\n" -"subtractfrom\n" -" '-' .emit * .and '=' .emit *;\n" -"multiplyto\n" -" '*' .emit * .and '=' .emit *;\n" -"divideto\n" -" '/' .emit * .and '=' .emit *;\n" -"other\n" -" '\\x24'-'\\xFF' .emit * .or '\\x01'-'\\x22' .emit *;\n" -"symbol_character\n" -" 'A'-'Z' .or 'a'-'z' .or '_';\n" -"symbol_character2\n" -" 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_';\n" -".string string_lexer;\n" -"string_lexer\n" -" lex_first_identifier_character .and .loop lex_next_identifier_character;\n" -"lex_first_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"lex_next_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"" diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression.syn b/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression.syn deleted file mode 100755 index bfdb220bf5..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression.syn +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2006 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. - */ - -/** - * \file slang_pp_expression.syn - * slang preprocessor expression parser - * \author Michal Krol - */ - -/* - * Parses one or two (optional) expressions on literal integer constants. Those expressions come - * from #if #elif and #line directives. The preprocessor already parsed those directives and - * expanded the expression (expressions). All occurences of the operator "defined" are already - * replaced with either "0" or "1" literals. - */ - -.syntax expression; - -/* - * Those separate individual expressions. - * For #if/#elif case it is: EXP_EXPRESSION ... EXP_END - * For #line case it may be: EXP_EXPRESSION ... EXP_EXPRESSION ... EXP_END - */ -.emtcode EXP_END 0 -.emtcode EXP_EXPRESSION 1 - -.emtcode OP_END 0 -.emtcode OP_PUSHINT 1 -.emtcode OP_LOGICALOR 2 -.emtcode OP_LOGICALAND 3 -.emtcode OP_OR 4 -.emtcode OP_XOR 5 -.emtcode OP_AND 6 -.emtcode OP_EQUAL 7 -.emtcode OP_NOTEQUAL 8 -.emtcode OP_LESSEQUAL 9 -.emtcode OP_GREATEREQUAL 10 -.emtcode OP_LESS 11 -.emtcode OP_GREATER 12 -.emtcode OP_LEFTSHIFT 13 -.emtcode OP_RIGHTSHIFT 14 -.emtcode OP_ADD 15 -.emtcode OP_SUBTRACT 16 -.emtcode OP_MULTIPLY 17 -.emtcode OP_DIVIDE 18 -.emtcode OP_MODULUS 19 -.emtcode OP_PLUS 20 -.emtcode OP_MINUS 21 -.emtcode OP_NEGATE 22 -.emtcode OP_COMPLEMENT 23 - -expression - first_expression .and optional_second_expression .and optional_space .and '\0' .emit EXP_END; - -first_expression - optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END; - -optional_second_expression - second_expression .or .true; - -second_expression - space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END; - -logical_or_expression - logical_and_expression .and .loop logical_or_expression_1; -logical_or_expression_1 - barbar .and logical_and_expression .and .true .emit OP_LOGICALOR; - -logical_and_expression - or_expression .and .loop logical_and_expression_1; -logical_and_expression_1 - ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND; - -or_expression - xor_expression .and .loop or_expression_1; -or_expression_1 - bar .and xor_expression .and .true .emit OP_OR; - -xor_expression - and_expression .and .loop xor_expression_1; -xor_expression_1 - caret .and and_expression .and .true .emit OP_XOR; - -and_expression - equality_expression .and .loop and_expression_1; -and_expression_1 - ampersand .and equality_expression .and .true .emit OP_AND; - -equality_expression - relational_expression .and .loop equality_expression_1; -equality_expression_1 - equality_expression_2 .or equality_expression_3; -equality_expression_2 - equalsequals .and relational_expression .and .true .emit OP_EQUAL; -equality_expression_3 - bangequals .and relational_expression .and .true .emit OP_NOTEQUAL; - -relational_expression - shift_expression .and .loop relational_expression_1; -relational_expression_1 - relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or - relational_expression_5; -relational_expression_2 - lessequals .and shift_expression .and .true .emit OP_LESSEQUAL; -relational_expression_3 - greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL; -relational_expression_4 - less .and shift_expression .and .true .emit OP_LESS; -relational_expression_5 - greater .and shift_expression .and .true .emit OP_GREATER; - -shift_expression - additive_expression .and .loop shift_expression_1; -shift_expression_1 - shift_expression_2 .or shift_expression_3; -shift_expression_2 - lessless .and additive_expression .and .true .emit OP_LEFTSHIFT; -shift_expression_3 - greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT; - -additive_expression - multiplicative_expression .and .loop additive_expression_1; -additive_expression_1 - additive_expression_2 .or additive_expression_3; -additive_expression_2 - plus .and multiplicative_expression .and .true .emit OP_ADD; -additive_expression_3 - dash .and multiplicative_expression .and .true .emit OP_SUBTRACT; - -multiplicative_expression - unary_expression .and .loop multiplicative_expression_1; -multiplicative_expression_1 - multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4; -multiplicative_expression_2 - star .and unary_expression .and .true .emit OP_MULTIPLY; -multiplicative_expression_3 - slash .and unary_expression .and .true .emit OP_DIVIDE; -multiplicative_expression_4 - percent .and unary_expression .and .true .emit OP_MODULUS; - -unary_expression - primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or - unary_expression_4; -unary_expression_1 - plus .and unary_expression .and .true .emit OP_PLUS; -unary_expression_2 - dash .and unary_expression .and .true .emit OP_MINUS; -unary_expression_3 - bang .and unary_expression .and .true .emit OP_NEGATE; -unary_expression_4 - tilda .and unary_expression .and .true .emit OP_COMPLEMENT; - -primary_expression - intconstant .or primary_expression_1; -primary_expression_1 - lparen .and logical_or_expression .and rparen; - -intconstant - integer .emit OP_PUSHINT; - -integer - integer_dec; - -integer_dec - digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -digit_dec - '0'-'9'; - -optional_space - .loop single_space; - -space - single_space .and .loop single_space; - -single_space - ' ' .or '\t'; - -ampersand - optional_space .and '&' .and optional_space; - -ampersandampersand - optional_space .and '&' .and '&' .and optional_space; - -bang - optional_space .and '!' .and optional_space; - -bangequals - optional_space .and '!' .and '=' .and optional_space; - -bar - optional_space .and '|' .and optional_space; - -barbar - optional_space .and '|' .and '|' .and optional_space; - -caret - optional_space .and '^' .and optional_space; - -dash - optional_space .and '-' .and optional_space; - -equalsequals - optional_space .and '=' .and '=' .and optional_space; - -greater - optional_space .and '>' .and optional_space; - -greaterequals - optional_space .and '>' .and '=' .and optional_space; - -greatergreater - optional_space .and '>' .and '>' .and optional_space; - -less - optional_space .and '<' .and optional_space; - -lessequals - optional_space .and '<' .and '=' .and optional_space; - -lessless - optional_space .and '<' .and '<' .and optional_space; - -lparen - optional_space .and '(' .and optional_space; - -percent - optional_space .and '%' .and optional_space; - -plus - optional_space .and '+' .and optional_space; - -rparen - optional_space .and ')' .and optional_space; - -slash - optional_space .and '/' .and optional_space; - -star - optional_space .and '*' .and optional_space; - -tilda - optional_space .and '~' .and optional_space; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression_syn.h b/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression_syn.h deleted file mode 100644 index f3e9ef6b22..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_expression_syn.h +++ /dev/null @@ -1,179 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax expression;\n" -".emtcode EXP_END 0\n" -".emtcode EXP_EXPRESSION 1\n" -".emtcode OP_END 0\n" -".emtcode OP_PUSHINT 1\n" -".emtcode OP_LOGICALOR 2\n" -".emtcode OP_LOGICALAND 3\n" -".emtcode OP_OR 4\n" -".emtcode OP_XOR 5\n" -".emtcode OP_AND 6\n" -".emtcode OP_EQUAL 7\n" -".emtcode OP_NOTEQUAL 8\n" -".emtcode OP_LESSEQUAL 9\n" -".emtcode OP_GREATEREQUAL 10\n" -".emtcode OP_LESS 11\n" -".emtcode OP_GREATER 12\n" -".emtcode OP_LEFTSHIFT 13\n" -".emtcode OP_RIGHTSHIFT 14\n" -".emtcode OP_ADD 15\n" -".emtcode OP_SUBTRACT 16\n" -".emtcode OP_MULTIPLY 17\n" -".emtcode OP_DIVIDE 18\n" -".emtcode OP_MODULUS 19\n" -".emtcode OP_PLUS 20\n" -".emtcode OP_MINUS 21\n" -".emtcode OP_NEGATE 22\n" -".emtcode OP_COMPLEMENT 23\n" -"expression\n" -" first_expression .and optional_second_expression .and optional_space .and '\\0' .emit EXP_END;\n" -"first_expression\n" -" optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" -"optional_second_expression\n" -" second_expression .or .true;\n" -"second_expression\n" -" space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" -"logical_or_expression\n" -" logical_and_expression .and .loop logical_or_expression_1;\n" -"logical_or_expression_1\n" -" barbar .and logical_and_expression .and .true .emit OP_LOGICALOR;\n" -"logical_and_expression\n" -" or_expression .and .loop logical_and_expression_1;\n" -"logical_and_expression_1\n" -" ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND;\n" -"or_expression\n" -" xor_expression .and .loop or_expression_1;\n" -"or_expression_1\n" -" bar .and xor_expression .and .true .emit OP_OR;\n" -"xor_expression\n" -" and_expression .and .loop xor_expression_1;\n" -"xor_expression_1\n" -" caret .and and_expression .and .true .emit OP_XOR;\n" -"and_expression\n" -" equality_expression .and .loop and_expression_1;\n" -"and_expression_1\n" -" ampersand .and equality_expression .and .true .emit OP_AND;\n" -"equality_expression\n" -" relational_expression .and .loop equality_expression_1;\n" -"equality_expression_1\n" -" equality_expression_2 .or equality_expression_3;\n" -"equality_expression_2\n" -" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n" -"equality_expression_3\n" -" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n" -"relational_expression\n" -" shift_expression .and .loop relational_expression_1;\n" -"relational_expression_1\n" -" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n" -" relational_expression_5;\n" -"relational_expression_2\n" -" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n" -"relational_expression_3\n" -" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n" -"relational_expression_4\n" -" less .and shift_expression .and .true .emit OP_LESS;\n" -"relational_expression_5\n" -" greater .and shift_expression .and .true .emit OP_GREATER;\n" -"shift_expression\n" -" additive_expression .and .loop shift_expression_1;\n" -"shift_expression_1\n" -" shift_expression_2 .or shift_expression_3;\n" -"shift_expression_2\n" -" lessless .and additive_expression .and .true .emit OP_LEFTSHIFT;\n" -"shift_expression_3\n" -" greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT;\n" -"additive_expression\n" -" multiplicative_expression .and .loop additive_expression_1;\n" -"additive_expression_1\n" -" additive_expression_2 .or additive_expression_3;\n" -"additive_expression_2\n" -" plus .and multiplicative_expression .and .true .emit OP_ADD;\n" -"additive_expression_3\n" -" dash .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n" -"multiplicative_expression\n" -" unary_expression .and .loop multiplicative_expression_1;\n" -"multiplicative_expression_1\n" -" multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4;\n" -"multiplicative_expression_2\n" -" star .and unary_expression .and .true .emit OP_MULTIPLY;\n" -"multiplicative_expression_3\n" -" slash .and unary_expression .and .true .emit OP_DIVIDE;\n" -"multiplicative_expression_4\n" -" percent .and unary_expression .and .true .emit OP_MODULUS;\n" -"unary_expression\n" -" primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" -" unary_expression_4;\n" -"unary_expression_1\n" -" plus .and unary_expression .and .true .emit OP_PLUS;\n" -"unary_expression_2\n" -" dash .and unary_expression .and .true .emit OP_MINUS;\n" -"unary_expression_3\n" -" bang .and unary_expression .and .true .emit OP_NEGATE;\n" -"unary_expression_4\n" -" tilda .and unary_expression .and .true .emit OP_COMPLEMENT;\n" -"primary_expression\n" -" intconstant .or primary_expression_1;\n" -"primary_expression_1\n" -" lparen .and logical_or_expression .and rparen;\n" -"intconstant\n" -" integer .emit OP_PUSHINT;\n" -"integer\n" -" integer_dec;\n" -"integer_dec\n" -" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"digit_dec\n" -" '0'-'9';\n" -"optional_space\n" -" .loop single_space;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"ampersand\n" -" optional_space .and '&' .and optional_space;\n" -"ampersandampersand\n" -" optional_space .and '&' .and '&' .and optional_space;\n" -"bang\n" -" optional_space .and '!' .and optional_space;\n" -"bangequals\n" -" optional_space .and '!' .and '=' .and optional_space;\n" -"bar\n" -" optional_space .and '|' .and optional_space;\n" -"barbar\n" -" optional_space .and '|' .and '|' .and optional_space;\n" -"caret\n" -" optional_space .and '^' .and optional_space;\n" -"dash\n" -" optional_space .and '-' .and optional_space;\n" -"equalsequals\n" -" optional_space .and '=' .and '=' .and optional_space;\n" -"greater\n" -" optional_space .and '>' .and optional_space;\n" -"greaterequals\n" -" optional_space .and '>' .and '=' .and optional_space;\n" -"greatergreater\n" -" optional_space .and '>' .and '>' .and optional_space;\n" -"less\n" -" optional_space .and '<' .and optional_space;\n" -"lessequals\n" -" optional_space .and '<' .and '=' .and optional_space;\n" -"lessless\n" -" optional_space .and '<' .and '<' .and optional_space;\n" -"lparen\n" -" optional_space .and '(' .and optional_space;\n" -"percent\n" -" optional_space .and '%' .and optional_space;\n" -"plus\n" -" optional_space .and '+' .and optional_space;\n" -"rparen\n" -" optional_space .and ')' .and optional_space;\n" -"slash\n" -" optional_space .and '/' .and optional_space;\n" -"star\n" -" optional_space .and '*' .and optional_space;\n" -"tilda\n" -" optional_space .and '~' .and optional_space;\n" -"" diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_version.syn b/src/libs/mesa/mesa/shader/slang/library/slang_pp_version.syn deleted file mode 100644 index 3fe1a57ba2..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_version.syn +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2005-2006 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. - */ - -/** - * \file slang_pp_version.syn - * slang #version directive syntax - * \author Michal Krol - */ - -.syntax version_directive; - -version_directive - version_directive_1; -version_directive_1 - prior_optional_spaces .and optional_version_directive .and .true .emit $; - -optional_version_directive - version_directive_body .or .true .emit 10 .emit 1; - -version_directive_body - '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and - new_line; - -version_number - version_number_100 .or version_number_110 .or version_number_120; - -version_number_100 - leading_zeroes .and "100" .emit 0 .emit 1; - -version_number_110 - leading_zeroes .and "110" .emit 10 .emit 1; - -version_number_120 - leading_zeroes .and "120" .emit 20 .emit 1; - -leading_zeroes - .loop zero; - -zero - '0'; - -space - single_space .and .loop single_space; - -optional_space - .loop single_space; - -single_space - ' ' .or '\t'; - -prior_optional_spaces - .loop prior_space; - -prior_space - c_style_comment_block .or cpp_style_comment_block .or space .or new_line; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -.string __string_filter; - -__string_filter - .loop __identifier_char; - -__identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_pp_version_syn.h b/src/libs/mesa/mesa/shader/slang/library/slang_pp_version_syn.h deleted file mode 100644 index 54aee3ff28..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_pp_version_syn.h +++ /dev/null @@ -1,69 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax version_directive;\n" -"version_directive\n" -" version_directive_1;\n" -"version_directive_1\n" -" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n" -"optional_version_directive\n" -" version_directive_body .or .true .emit 10 .emit 1;\n" -"version_directive_body\n" -" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n" -" new_line;\n" -"version_number\n" -" version_number_100 .or version_number_110 .or version_number_120;\n" -"version_number_100\n" -" leading_zeroes .and \"100\" .emit 0 .emit 1;\n" -"version_number_110\n" -" leading_zeroes .and \"110\" .emit 10 .emit 1;\n" -"version_number_120\n" -" leading_zeroes .and \"120\" .emit 20 .emit 1;\n" -"leading_zeroes\n" -" .loop zero;\n" -"zero\n" -" '0';\n" -"space\n" -" single_space .and .loop single_space;\n" -"optional_space\n" -" .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"prior_optional_spaces\n" -" .loop prior_space;\n" -"prior_space\n" -" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest;\n" -"c_style_comment_rest\n" -" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n" -"c_style_comment_rest_1\n" -" c_style_comment_end .or c_style_comment_rest_2;\n" -"c_style_comment_rest_2\n" -" '*' .and c_style_comment_rest;\n" -"c_style_comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_end\n" -" '*' .and '/';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"new_line\n" -" cr_lf .or lf_cr .or '\\n' .or '\\r';\n" -"cr_lf\n" -" '\\r' .and '\\n';\n" -"lf_cr\n" -" '\\n' .and '\\r';\n" -".string __string_filter;\n" -"__string_filter\n" -" .loop __identifier_char;\n" -"__identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n" -"" diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_shader.syn b/src/libs/mesa/mesa/shader/slang/library/slang_shader.syn deleted file mode 100644 index cc5c70a02f..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_shader.syn +++ /dev/null @@ -1,1716 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2004-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/* - * \file slang_shader.syn - * slang vertex/fragment shader syntax - * \author Michal Krol - */ - -/* - * usage: - * syn2c slang_shader.syn > slang_shader_syn.h - * - * when modifying or extending this file, several things must be taken into - * consideration: - * - * - when adding new operators that were marked as reserved in the - * initial specification, one must only uncomment particular lines of - * code that refer to operators being added; - * - * - when adding new shader targets, one must reserve a new value for - * shader_type register and use it in .if constructs for symbols that - * are exclusive for that shader; - * - * - some symbols mimic output of other symbols - the best example is - * the "for" construct: expression "for (foo(); ; bar())" is seen as - * "for (foo(); true; bar())" by the output processor - hence, special - * care must be taken when rearranging output of essential symbols; - * - * - order of single-quoted tokens does matter in alternatives - so do not - * parse "<" operator before "<<" and "<<" before "<<="; - * - * - all double-quoted tokens are internally preprocessed to eliminate - * problems with parsing strings that are prefixes of other strings, - * like "sampler1D" and "sampler1DShadow"; - */ - -.syntax translation_unit; - -/* revision number - increment after each change affecting emitted output */ -.emtcode REVISION 5 - -/* external declaration (or precision or invariant stmt) */ -.emtcode EXTERNAL_NULL 0 -.emtcode EXTERNAL_FUNCTION_DEFINITION 1 -.emtcode EXTERNAL_DECLARATION 2 -.emtcode DEFAULT_PRECISION 3 -.emtcode INVARIANT_STMT 4 - -/* precision */ -.emtcode PRECISION_DEFAULT 0 -.emtcode PRECISION_LOW 1 -.emtcode PRECISION_MEDIUM 2 -.emtcode PRECISION_HIGH 3 - -/* declaration */ -.emtcode DECLARATION_FUNCTION_PROTOTYPE 1 -.emtcode DECLARATION_INIT_DECLARATOR_LIST 2 - -/* function type */ -.emtcode FUNCTION_ORDINARY 0 -.emtcode FUNCTION_CONSTRUCTOR 1 -.emtcode FUNCTION_OPERATOR 2 - -/* function call type */ -.emtcode FUNCTION_CALL_NONARRAY 0 -.emtcode FUNCTION_CALL_ARRAY 1 - -/* operator type */ -.emtcode OPERATOR_ADDASSIGN 1 -.emtcode OPERATOR_SUBASSIGN 2 -.emtcode OPERATOR_MULASSIGN 3 -.emtcode OPERATOR_DIVASSIGN 4 -/*.emtcode OPERATOR_MODASSIGN 5*/ -/*.emtcode OPERATOR_LSHASSIGN 6*/ -/*.emtcode OPERATOR_RSHASSIGN 7*/ -/*.emtcode OPERATOR_ORASSIGN 8*/ -/*.emtcode OPERATOR_XORASSIGN 9*/ -/*.emtcode OPERATOR_ANDASSIGN 10*/ -.emtcode OPERATOR_LOGICALXOR 11 -/*.emtcode OPERATOR_BITOR 12*/ -/*.emtcode OPERATOR_BITXOR 13*/ -/*.emtcode OPERATOR_BITAND 14*/ -.emtcode OPERATOR_LESS 15 -.emtcode OPERATOR_GREATER 16 -.emtcode OPERATOR_LESSEQUAL 17 -.emtcode OPERATOR_GREATEREQUAL 18 -/*.emtcode OPERATOR_LSHIFT 19*/ -/*.emtcode OPERATOR_RSHIFT 20*/ -.emtcode OPERATOR_MULTIPLY 21 -.emtcode OPERATOR_DIVIDE 22 -/*.emtcode OPERATOR_MODULUS 23*/ -.emtcode OPERATOR_INCREMENT 24 -.emtcode OPERATOR_DECREMENT 25 -.emtcode OPERATOR_PLUS 26 -.emtcode OPERATOR_MINUS 27 -/*.emtcode OPERATOR_COMPLEMENT 28*/ -.emtcode OPERATOR_NOT 29 - -/* init declarator list */ -.emtcode DECLARATOR_NONE 0 -.emtcode DECLARATOR_NEXT 1 - -/* variable declaration */ -.emtcode VARIABLE_NONE 0 -.emtcode VARIABLE_IDENTIFIER 1 -.emtcode VARIABLE_INITIALIZER 2 -.emtcode VARIABLE_ARRAY_EXPLICIT 3 -.emtcode VARIABLE_ARRAY_UNKNOWN 4 - -/* type qualifier */ -.emtcode TYPE_QUALIFIER_NONE 0 -.emtcode TYPE_QUALIFIER_CONST 1 -.emtcode TYPE_QUALIFIER_ATTRIBUTE 2 -.emtcode TYPE_QUALIFIER_VARYING 3 -.emtcode TYPE_QUALIFIER_UNIFORM 4 -.emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5 -.emtcode TYPE_QUALIFIER_FIXEDINPUT 6 - -/* invariant qualifier */ -.emtcode TYPE_VARIANT 90 -.emtcode TYPE_INVARIANT 91 - -/* centroid qualifier */ -.emtcode TYPE_CENTER 95 -.emtcode TYPE_CENTROID 96 - -/* type specifier */ -.emtcode TYPE_SPECIFIER_VOID 0 -.emtcode TYPE_SPECIFIER_BOOL 1 -.emtcode TYPE_SPECIFIER_BVEC2 2 -.emtcode TYPE_SPECIFIER_BVEC3 3 -.emtcode TYPE_SPECIFIER_BVEC4 4 -.emtcode TYPE_SPECIFIER_INT 5 -.emtcode TYPE_SPECIFIER_IVEC2 6 -.emtcode TYPE_SPECIFIER_IVEC3 7 -.emtcode TYPE_SPECIFIER_IVEC4 8 -.emtcode TYPE_SPECIFIER_FLOAT 9 -.emtcode TYPE_SPECIFIER_VEC2 10 -.emtcode TYPE_SPECIFIER_VEC3 11 -.emtcode TYPE_SPECIFIER_VEC4 12 -.emtcode TYPE_SPECIFIER_MAT2 13 -.emtcode TYPE_SPECIFIER_MAT3 14 -.emtcode TYPE_SPECIFIER_MAT4 15 -.emtcode TYPE_SPECIFIER_SAMPLER1D 16 -.emtcode TYPE_SPECIFIER_SAMPLER2D 17 -.emtcode TYPE_SPECIFIER_SAMPLER3D 18 -.emtcode TYPE_SPECIFIER_SAMPLERCUBE 19 -.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20 -.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21 -.emtcode TYPE_SPECIFIER_SAMPLER2DRECT 22 -.emtcode TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23 -.emtcode TYPE_SPECIFIER_STRUCT 24 -.emtcode TYPE_SPECIFIER_TYPENAME 25 - -/* OpenGL 2.1 */ -.emtcode TYPE_SPECIFIER_MAT23 26 -.emtcode TYPE_SPECIFIER_MAT32 27 -.emtcode TYPE_SPECIFIER_MAT24 28 -.emtcode TYPE_SPECIFIER_MAT42 29 -.emtcode TYPE_SPECIFIER_MAT34 30 -.emtcode TYPE_SPECIFIER_MAT43 31 - -/* type specifier array */ -.emtcode TYPE_SPECIFIER_NONARRAY 0 -.emtcode TYPE_SPECIFIER_ARRAY 1 - -/* structure field */ -.emtcode FIELD_NONE 0 -.emtcode FIELD_NEXT 1 -.emtcode FIELD_ARRAY 2 - -/* operation */ -.emtcode OP_END 0 -.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1 -.emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2 -.emtcode OP_DECLARE 3 -.emtcode OP_ASM 4 -.emtcode OP_BREAK 5 -.emtcode OP_CONTINUE 6 -.emtcode OP_DISCARD 7 -.emtcode OP_RETURN 8 -.emtcode OP_EXPRESSION 9 -.emtcode OP_IF 10 -.emtcode OP_WHILE 11 -.emtcode OP_DO 12 -.emtcode OP_FOR 13 -.emtcode OP_PUSH_VOID 14 -.emtcode OP_PUSH_BOOL 15 -.emtcode OP_PUSH_INT 16 -.emtcode OP_PUSH_FLOAT 17 -.emtcode OP_PUSH_IDENTIFIER 18 -.emtcode OP_SEQUENCE 19 -.emtcode OP_ASSIGN 20 -.emtcode OP_ADDASSIGN 21 -.emtcode OP_SUBASSIGN 22 -.emtcode OP_MULASSIGN 23 -.emtcode OP_DIVASSIGN 24 -/*.emtcode OP_MODASSIGN 25*/ -/*.emtcode OP_LSHASSIGN 26*/ -/*.emtcode OP_RSHASSIGN 27*/ -/*.emtcode OP_ORASSIGN 28*/ -/*.emtcode OP_XORASSIGN 29*/ -/*.emtcode OP_ANDASSIGN 30*/ -.emtcode OP_SELECT 31 -.emtcode OP_LOGICALOR 32 -.emtcode OP_LOGICALXOR 33 -.emtcode OP_LOGICALAND 34 -/*.emtcode OP_BITOR 35*/ -/*.emtcode OP_BITXOR 36*/ -/*.emtcode OP_BITAND 37*/ -.emtcode OP_EQUAL 38 -.emtcode OP_NOTEQUAL 39 -.emtcode OP_LESS 40 -.emtcode OP_GREATER 41 -.emtcode OP_LESSEQUAL 42 -.emtcode OP_GREATEREQUAL 43 -/*.emtcode OP_LSHIFT 44*/ -/*.emtcode OP_RSHIFT 45*/ -.emtcode OP_ADD 46 -.emtcode OP_SUBTRACT 47 -.emtcode OP_MULTIPLY 48 -.emtcode OP_DIVIDE 49 -/*.emtcode OP_MODULUS 50*/ -.emtcode OP_PREINCREMENT 51 -.emtcode OP_PREDECREMENT 52 -.emtcode OP_PLUS 53 -.emtcode OP_MINUS 54 -/*.emtcode OP_COMPLEMENT 55*/ -.emtcode OP_NOT 56 -.emtcode OP_SUBSCRIPT 57 -.emtcode OP_CALL 58 -.emtcode OP_FIELD 59 -.emtcode OP_POSTINCREMENT 60 -.emtcode OP_POSTDECREMENT 61 -.emtcode OP_PRECISION 62 -.emtcode OP_METHOD 63 - -/* parameter qualifier */ -.emtcode PARAM_QUALIFIER_IN 0 -.emtcode PARAM_QUALIFIER_OUT 1 -.emtcode PARAM_QUALIFIER_INOUT 2 - -/* function parameter */ -.emtcode PARAMETER_NONE 0 -.emtcode PARAMETER_NEXT 1 - -/* function parameter array presence */ -.emtcode PARAMETER_ARRAY_NOT_PRESENT 0 -.emtcode PARAMETER_ARRAY_PRESENT 1 - -/* INVALID_EXTERNAL_DECLARATION seems to be reported when there's */ -/* any syntax errors... */ -.errtext INVALID_EXTERNAL_DECLARATION "2001: Syntax error." -.errtext INVALID_OPERATOR_OVERRIDE "2002: Invalid operator override." -.errtext LBRACE_EXPECTED "2003: '{' expected but '$err_token$' found." -.errtext LPAREN_EXPECTED "2004: '(' expected but '$err_token$' found." -.errtext RPAREN_EXPECTED "2005: ')' expected but '$err_token$' found." -.errtext INVALID_PRECISION "2006: Invalid precision specifier '$err_token$'." -.errtext INVALID_PRECISION_TYPE "2007: Invalid precision type '$err_token$'." - - -/* - * tells whether the shader that is being parsed is a built-in shader or not - * 0 - normal behaviour - * 1 - accepts constructor and operator definitions and __asm statements - * the implementation will set it to 1 when compiling internal built-in shaders - */ -.regbyte parsing_builtin 0 - -/* - * holds the type of the shader being parsed; possible values are - * listed below. - * FRAGMENT_SHADER 1 - * VERTEX_SHADER 2 - * shader type is set by the caller before parsing - */ -.regbyte shader_type 0 - -/* - * ::= - */ -variable_identifier - identifier .emit OP_PUSH_IDENTIFIER; - -/* - * ::= - * | - * | - * | - * | "(" ")" - */ -primary_expression - floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1; -primary_expression_1 - lparen .and expression .and rparen; - -/* - * ::= - * | "[" "]" - * | - * | "." - * | "++" - * | "--" - */ -postfix_expression - postfix_expression_1 .and .loop postfix_expression_2; -postfix_expression_1 - function_call .or primary_expression; -postfix_expression_2 - postfix_expression_3 .or postfix_expression_4 .or - plusplus .emit OP_POSTINCREMENT .or - minusminus .emit OP_POSTDECREMENT; -postfix_expression_3 - lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT; -postfix_expression_4 - dot .and field_selection .emit OP_FIELD; - -/* - * ::= - */ -integer_expression - expression; - -/* - * ::= - */ -function_call - function_call_or_method; - -/* - * ::= - * | "." - */ -function_call_or_method - regular_function_call .or method_call; - -/* - * ::= "." - */ -method_call - identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END; - -/* - * ::= - */ -regular_function_call - function_call_generic .emit OP_CALL .and .true .emit OP_END; - -/* - * ::= ")" - * | ")" - */ -function_call_generic - function_call_generic_1 .or function_call_generic_2; -function_call_generic_1 - function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED; -function_call_generic_2 - function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED; - -/* - * ::= "void" - * | - */ -function_call_header_no_parameters - function_call_header .and function_call_header_no_parameters_1; -function_call_header_no_parameters_1 - "void" .or .true; - -/* - * ::= - * | "," - */ -function_call_header_with_parameters - function_call_header .and assignment_expression .and .true .emit OP_END .and - .loop function_call_header_with_parameters_1; -function_call_header_with_parameters_1 - comma .and assignment_expression .and .true .emit OP_END; - -/* - * ::= "(" - */ -function_call_header - function_identifier .and lparen; - -/* - * ::= - * | - * | - * - * note: and have been deleted - */ -function_identifier - identifier .and function_identifier_opt_array; -function_identifier_opt_array - function_identifier_array .emit FUNCTION_CALL_ARRAY .or - .true .emit FUNCTION_CALL_NONARRAY; -function_identifier_array - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * | "++" - * | "--" - * | - * - * ::= "+" - * | "-" - * | "!" - * | "~" // reserved - */ -unary_expression - postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or - unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/; -unary_expression_1 - plusplus .and unary_expression .and .true .emit OP_PREINCREMENT; -unary_expression_2 - minusminus .and unary_expression .and .true .emit OP_PREDECREMENT; -unary_expression_3 - plus .and unary_expression .and .true .emit OP_PLUS; -unary_expression_4 - minus .and unary_expression .and .true .emit OP_MINUS; -unary_expression_5 - bang .and unary_expression .and .true .emit OP_NOT; -/*unary_expression_6 - tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/ - -/* - * ::= - * | "*" - * | "/" - * | "%" // reserved - */ -multiplicative_expression - unary_expression .and .loop multiplicative_expression_1; -multiplicative_expression_1 - multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/; -multiplicative_expression_2 - star .and unary_expression .and .true .emit OP_MULTIPLY; -multiplicative_expression_3 - slash .and unary_expression .and .true .emit OP_DIVIDE; -/*multiplicative_expression_4 - percent .and unary_expression .and .true .emit OP_MODULUS;*/ - -/* - * ::= - * | "+" - * | "-" - */ -additive_expression - multiplicative_expression .and .loop additive_expression_1; -additive_expression_1 - additive_expression_2 .or additive_expression_3; -additive_expression_2 - plus .and multiplicative_expression .and .true .emit OP_ADD; -additive_expression_3 - minus .and multiplicative_expression .and .true .emit OP_SUBTRACT; - -/* - * ::= - * | "<<" // reserved - * | ">>" // reserved - */ -shift_expression - additive_expression/* .and .loop shift_expression_1*/; -/*shift_expression_1 - shift_expression_2 .or shift_expression_3;*/ -/*shift_expression_2 - lessless .and additive_expression .and .true .emit OP_LSHIFT;*/ -/*shift_expression_3 - greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/ - -/* - * ::= - * | "<" - * | ">" - * | "<=" - * | ">=" - */ -relational_expression - shift_expression .and .loop relational_expression_1; -relational_expression_1 - relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or - relational_expression_5; -relational_expression_2 - lessequals .and shift_expression .and .true .emit OP_LESSEQUAL; -relational_expression_3 - greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL; -relational_expression_4 - less .and shift_expression .and .true .emit OP_LESS; -relational_expression_5 - greater .and shift_expression .and .true .emit OP_GREATER; - -/* - * ::= - * | "==" - * | "!=" - */ -equality_expression - relational_expression .and .loop equality_expression_1; -equality_expression_1 - equality_expression_2 .or equality_expression_3; -equality_expression_2 - equalsequals .and relational_expression .and .true .emit OP_EQUAL; -equality_expression_3 - bangequals .and relational_expression .and .true .emit OP_NOTEQUAL; - -/* - * ::= - * | "&" // reserved - */ -and_expression - equality_expression/* .and .loop and_expression_1*/; -/*and_expression_1 - ampersand .and equality_expression .and .true .emit OP_BITAND;*/ - -/* - * ::= - * | "^" // reserved - */ -exclusive_or_expression - and_expression/* .and .loop exclusive_or_expression_1*/; -/*exclusive_or_expression_1 - caret .and and_expression .and .true .emit OP_BITXOR;*/ - -/* - * ::= - * | "|" // reserved - */ -inclusive_or_expression - exclusive_or_expression/* .and .loop inclusive_or_expression_1*/; -/*inclusive_or_expression_1 - bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/ - -/* - * ::= - * | "&&" - */ -logical_and_expression - inclusive_or_expression .and .loop logical_and_expression_1; -logical_and_expression_1 - ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND; - -/* - * ::= - * | "^^" - */ -logical_xor_expression - logical_and_expression .and .loop logical_xor_expression_1; -logical_xor_expression_1 - caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR; - -/* - * ::= - * | "||" - */ -logical_or_expression - logical_xor_expression .and .loop logical_or_expression_1; -logical_or_expression_1 - barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR; - -/* - * ::= - * | "?" ":" - */ -conditional_expression - logical_or_expression .and .loop conditional_expression_1; -conditional_expression_1 - question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT; - -/* - * ::= - * | - * - * ::= "=" - * | "*=" - * | "/=" - * | "+=" - * | "-=" - * | "%=" // reserved - * | "<<=" // reserved - * | ">>=" // reserved - * | "&=" // reserved - * | "^=" // reserved - * | "|=" // reserved - */ -assignment_expression - assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or - assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or - assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or - assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression; -assignment_expression_1 - unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN; -assignment_expression_2 - unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN; -assignment_expression_3 - unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN; -assignment_expression_4 - unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN; -assignment_expression_5 - unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN; -/*assignment_expression_6 - unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/ -/*assignment_expression_7 - unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/ -/*assignment_expression_8 - unary_expression .and greatergreaterequals .and assignment_expression .and - .true .emit OP_RSHASSIGN;*/ -/*assignment_expression_9 - unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/ -/*assignment_expression_10 - unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/ -/*assignment_expression_11 - unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/ - -/* - * ::= - * | "," - */ -expression - assignment_expression .and .loop expression_1; -expression_1 - comma .and assignment_expression .and .true .emit OP_SEQUENCE; - -/* - * ::= - */ -constant_expression - conditional_expression .and .true .emit OP_END; - -/* - * ::= ";" - * | ";" - */ -declaration - declaration_1 .or declaration_2; -declaration_1 - function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon; -declaration_2 - init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon; - -/* - * ::= "void" ")" - * | ")" - */ -function_prototype - function_prototype_1 .or function_prototype_2; -function_prototype_1 - function_header .and "void" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE; -function_prototype_2 - function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE; - -/* - * ::= - * | - */ -function_declarator - function_header_with_parameters .or function_header; - -/* - * ::= - * | "," - * - */ -function_header_with_parameters - function_header .and parameter_declaration .and .loop function_header_with_parameters_1; -function_header_with_parameters_1 - comma .and parameter_declaration; - -/* - * ::= "(" - */ -function_header - function_header_nospace .or function_header_space; -function_header_space - fully_specified_type_space .and space .and function_decl_identifier .and lparen; -function_header_nospace - fully_specified_type_nospace .and function_decl_identifier .and lparen; - -/* - * ::= "__constructor" - * | <__operator> - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator and constructor prototypes and definitions - */ -function_decl_identifier - .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or - .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or - identifier .emit FUNCTION_ORDINARY; - -/* - * <__operator> ::= "__operator" - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator prototypes and definitions - */ -__operator - "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE; - -/* - * ::= "=" - * | "+=" - * | "-=" - * | "*=" - * | "/=" - * | "%=" // reserved - * | "<<=" // reserved - * | ">>=" // reserved - * | "&=" // reserved - * | "^=" // reserved - * | "|=" // reserved - * | "^^" - * | "|" // reserved - * | "^" // reserved - * | "&" // reserved - * | "==" - * | "!=" - * | "<" - * | ">" - * | "<=" - * | ">=" - * | "<<" // reserved - * | ">>" // reserved - * | "*" - * | "/" - * | "%" // reserved - * | "++" - * | "--" - * | "+" - * | "-" - * | "~" // reserved - * | "!" - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator prototypes and definitions - */ -overriden_operator - plusplus .emit OPERATOR_INCREMENT .or - plusequals .emit OPERATOR_ADDASSIGN .or - plus .emit OPERATOR_PLUS .or - minusminus .emit OPERATOR_DECREMENT .or - minusequals .emit OPERATOR_SUBASSIGN .or - minus .emit OPERATOR_MINUS .or - bang .emit OPERATOR_NOT .or - starequals .emit OPERATOR_MULASSIGN .or - star .emit OPERATOR_MULTIPLY .or - slashequals .emit OPERATOR_DIVASSIGN .or - slash .emit OPERATOR_DIVIDE .or - lessequals .emit OPERATOR_LESSEQUAL .or - /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/ - /*lessless .emit OPERATOR_LSHIFT .or*/ - less .emit OPERATOR_LESS .or - greaterequals .emit OPERATOR_GREATEREQUAL .or - /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/ - /*greatergreater .emit OPERATOR_RSHIFT .or*/ - greater .emit OPERATOR_GREATER .or - /*percentequals .emit OPERATOR_MODASSIGN .or*/ - /*percent .emit OPERATOR_MODULUS .or*/ - /*ampersandequals .emit OPERATOR_ANDASSIGN */ - /*ampersand .emit OPERATOR_BITAND .or*/ - /*barequals .emit OPERATOR_ORASSIGN .or*/ - /*bar .emit OPERATOR_BITOR .or*/ - /*tilde .emit OPERATOR_COMPLEMENT .or*/ - /*caretequals .emit OPERATOR_XORASSIGN .or*/ - caretcaret .emit OPERATOR_LOGICALXOR /*.or - caret .emit OPERATOR_BITXOR*/; - -/* - * ::= - * | "[" "]" - */ -parameter_declarator - parameter_declarator_nospace .or parameter_declarator_space; -parameter_declarator_nospace - type_specifier_nospace .and identifier .and parameter_declarator_1; -parameter_declarator_space - type_specifier_space .and space .and identifier .and parameter_declarator_1; -parameter_declarator_1 - parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or - .true .emit PARAMETER_ARRAY_NOT_PRESENT; -parameter_declarator_2 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * - * | - * - * | - * - * | - * - * | - * - * | - * - * | - * | - */ -parameter_declaration - parameter_declaration_1 .emit PARAMETER_NEXT; -parameter_declaration_1 - parameter_declaration_2 .or parameter_declaration_3; -parameter_declaration_2 - type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4; -parameter_declaration_3 - parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4; -parameter_declaration_4 - parameter_declaration_optprec .and parameter_declaration_rest; -parameter_declaration_optprec - parameter_declaration_prec .or .true .emit PRECISION_DEFAULT; -parameter_declaration_prec - precision .and space; -parameter_declaration_rest - parameter_declarator .or parameter_type_specifier; - -/* - * ::= "in" - * | "out" - * | "inout" - * | "" - */ -parameter_qualifier - parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN; -parameter_qualifier_1 - parameter_qualifier_2 .and space; -parameter_qualifier_2 - "in" .emit PARAM_QUALIFIER_IN .or - "out" .emit PARAM_QUALIFIER_OUT .or - "inout" .emit PARAM_QUALIFIER_INOUT; - -/* - * ::= - * | "[" "]" - */ -parameter_type_specifier - parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2; -parameter_type_specifier_1 - type_specifier_nospace .or type_specifier_space; -parameter_type_specifier_2 - parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or - .true .emit PARAMETER_ARRAY_NOT_PRESENT; -parameter_type_specifier_3 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * | "," - * | "," "[" "]" - * | "," "[" "]" - * | "," "=" - */ -init_declarator_list - single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and - .true .emit DECLARATOR_NONE; -init_declarator_list_1 - comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2; -init_declarator_list_2 - init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE; -init_declarator_list_3 - equals .and initializer .emit VARIABLE_INITIALIZER; -init_declarator_list_4 - lbracket .and init_declarator_list_5 .and rbracket; -init_declarator_list_5 - constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; - -/* - * ::= - * | - * | "[" "]" - * | "[" "]" - * | "=" - */ -single_declaration - single_declaration_nospace .or single_declaration_space; -single_declaration_space - fully_specified_type_space .and single_declaration_space_1; -single_declaration_nospace - fully_specified_type_nospace .and single_declaration_nospace_1; -single_declaration_space_1 - single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; -single_declaration_nospace_1 - single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; -single_declaration_space_2 - space .and identifier .and single_declaration_3; -single_declaration_nospace_2 - identifier .and single_declaration_3; -single_declaration_3 - single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE; -single_declaration_4 - equals .and initializer .emit VARIABLE_INITIALIZER; -single_declaration_5 - lbracket .and single_declaration_6 .and rbracket; -single_declaration_6 - constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; - -/* - * ::= - * - * Example: "invariant varying highp vec3" - */ -fully_specified_type_space - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; -fully_specified_type_nospace - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; -fully_specified_type_optinvariant - fully_specified_type_invariant .or .true .emit TYPE_VARIANT; -fully_specified_type_invariant - invariant_qualifier .and space; -fully_specified_type_optcentroid - fully_specified_type_centroid .or .true .emit TYPE_CENTER; -fully_specified_type_centroid - centroid_qualifier .and space; -fully_specified_type_optqual - fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE; -fully_specified_type_qual - type_qualifier .and space; -fully_specified_type_optprec - fully_specified_type_prec .or .true .emit PRECISION_DEFAULT; -fully_specified_type_prec - precision .and space; - -/* - * ::= "invariant" - */ -invariant_qualifier - "invariant" .emit TYPE_INVARIANT; - -centroid_qualifier - "centroid" .emit TYPE_CENTROID; - - -/* - * ::= "const" - * | "attribute" // Vertex only. - * | "varying" - * | "uniform" - * | "__fixed_output" - * | "__fixed_input" - * - * note: this is an extension to the standard language specification, - * normally slang disallows __fixed_output and __fixed_input type qualifiers - */ -type_qualifier - "const" .emit TYPE_QUALIFIER_CONST .or - .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or - "varying" .emit TYPE_QUALIFIER_VARYING .or - "uniform" .emit TYPE_QUALIFIER_UNIFORM .or - .if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or - .if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT; - -/* - * ::= "void" - * | "float" - * | "int" - * | "bool" - * | "vec2" - * | "vec3" - * | "vec4" - * | "bvec2" - * | "bvec3" - * | "bvec4" - * | "ivec2" - * | "ivec3" - * | "ivec4" - * | "mat2" - * | "mat3" - * | "mat4" - * | "mat2x3" - * | "mat3x2" - * | "mat2x4" - * | "mat4x2" - * | "mat3x4" - * | "mat4x3" - * | "sampler1D" - * | "sampler2D" - * | "sampler3D" - * | "samplerCube" - * | "sampler1DShadow" - * | "sampler2DShadow" - * | "sampler2DRect" - * | "sampler2DRectShadow" - * | - * | - */ -type_specifier_nonarray_space - "void" .emit TYPE_SPECIFIER_VOID .or - "float" .emit TYPE_SPECIFIER_FLOAT .or - "int" .emit TYPE_SPECIFIER_INT .or - "bool" .emit TYPE_SPECIFIER_BOOL .or - "vec2" .emit TYPE_SPECIFIER_VEC2 .or - "vec3" .emit TYPE_SPECIFIER_VEC3 .or - "vec4" .emit TYPE_SPECIFIER_VEC4 .or - "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or - "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or - "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or - "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or - "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or - "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or - "mat2" .emit TYPE_SPECIFIER_MAT2 .or - "mat3" .emit TYPE_SPECIFIER_MAT3 .or - "mat4" .emit TYPE_SPECIFIER_MAT4 .or - "mat2x3" .emit TYPE_SPECIFIER_MAT23 .or - "mat3x2" .emit TYPE_SPECIFIER_MAT32 .or - "mat2x4" .emit TYPE_SPECIFIER_MAT24 .or - "mat4x2" .emit TYPE_SPECIFIER_MAT42 .or - "mat3x4" .emit TYPE_SPECIFIER_MAT34 .or - "mat4x3" .emit TYPE_SPECIFIER_MAT43 .or - "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or - "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or - "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or - "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or - "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or - "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or - "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or - "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or - type_name .emit TYPE_SPECIFIER_TYPENAME; -type_specifier_nonarray_nospace - struct_specifier .emit TYPE_SPECIFIER_STRUCT; -type_specifier_nonarray - type_specifier_nonarray_nospace .or type_specifier_nonarray_space; - -/* - * ::= - * | "[" "]" - */ -type_specifier_space - type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY; -type_specifier_nospace - type_specifier_nospace_array .or type_specifier_nospace_1; -type_specifier_nospace_1 - type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY; -type_specifier_nospace_array - type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket; - -/* - * ::= "struct" "{" "}" - * | "struct" "{" "}" - */ -struct_specifier - "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and - struct_declaration_list .and rbrace .emit FIELD_NONE; -struct_specifier_1 - struct_specifier_2 .or .true .emit '\0'; -struct_specifier_2 - space .and identifier; - -/* - * ::= - * | - */ -struct_declaration_list - struct_declaration .and .loop struct_declaration .emit FIELD_NEXT; - -/* - * ::= ";" - */ -struct_declaration - struct_declaration_nospace .or struct_declaration_space; -struct_declaration_space - type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE; -struct_declaration_nospace - type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE; - -/* - * ::= - * | "," - */ -struct_declarator_list - struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT; -struct_declarator_list_1 - comma .and struct_declarator; - -/* - * ::= - * | "[" "]" - */ -struct_declarator - identifier .and struct_declarator_1; -struct_declarator_1 - struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE; -struct_declarator_2 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - */ -initializer - assignment_expression .and .true .emit OP_END; - -/* - * ::= - */ -declaration_statement - declaration; - -/* - * ::= - * | - */ -statement - compound_statement .or simple_statement; -statement_space - compound_statement .or statement_space_1; -statement_space_1 - space .and simple_statement; - -/* - * ::= <__asm_statement> - * | - * | - * | - * | - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows use of __asm statements - */ -simple_statement - .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or - selection_statement .or - iteration_statement .or - precision_stmt .emit OP_PRECISION .or - jump_statement .or - expression_statement .emit OP_EXPRESSION .or - declaration_statement .emit OP_DECLARE; - -/* - * ::= "{" "}" - * | "{" "}" - */ -compound_statement - compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END; -compound_statement_1 - compound_statement_2 .or compound_statement_3; -compound_statement_2 - lbrace .and rbrace; -compound_statement_3 - lbrace .and statement_list .and rbrace; - -/* - * ::= "{" "}" - * | "{" "}" - */ -compound_statement_no_new_scope - compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END; -compound_statement_no_new_scope_1 - compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3; -compound_statement_no_new_scope_2 - lbrace .and rbrace; -compound_statement_no_new_scope_3 - lbrace .and statement_list .and rbrace; - - -/* - * ::= - * | - */ -statement_list - statement .and .loop statement; - -/* - * ::= ";" - * | ";" - */ -expression_statement - expression_statement_1 .or expression_statement_2; -expression_statement_1 - semicolon .emit OP_PUSH_VOID .emit OP_END; -expression_statement_2 - expression .and semicolon .emit OP_END; - -/* - * ::= "if" "(" ")" - */ -selection_statement - "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and - rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement; - -/* - * ::= "else" - * | - */ -selection_rest_statement - statement .and selection_rest_statement_1; -selection_rest_statement_1 - selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END; -selection_rest_statement_2 - "else" .and optional_space .and statement; - -/* - * ::= - * | "=" - * - * note: if is executed, the emit format must - * match emit format - */ -condition - condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or - condition_3 .emit OP_EXPRESSION; -condition_1 - condition_1_nospace .or condition_1_space; -condition_1_nospace - fully_specified_type_nospace .and condition_2; -condition_1_space - fully_specified_type_space .and space .and condition_2; -condition_2 - identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and - initializer .and .true .emit DECLARATOR_NONE; -condition_3 - expression .and .true .emit OP_END; - -/* - * ::= "while" "(" ")" - * | "do" "while" "(" ")" ";" - * | "for" "(" ")" - */ -iteration_statement - iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3; -iteration_statement_1 - "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and - rparen .error RPAREN_EXPECTED .and statement; -iteration_statement_2 - "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and - expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon; -iteration_statement_3 - "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and - for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement; - -/* - * ::= - * | - */ -for_init_statement - expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE; - -/* - * ::= - * | "" - * - * note: is used only by "for" statement. - * if is ommitted, parser simulates default behaviour, - * that is simulates "true" expression - */ -conditionopt - condition .or - .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END; - -/* - * ::= ";" - * | ";" - */ -for_rest_statement - conditionopt .and semicolon .and for_rest_statement_1; -for_rest_statement_1 - for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END; -for_rest_statement_2 - expression .and .true .emit OP_END; - -/* - * ::= "continue" ";" - * | "break" ";" - * | "return" ";" - * | "return" ";" - * | "discard" ";" // Fragment shader only. - */ -jump_statement - jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or - .if (shader_type == 1) jump_statement_5; -jump_statement_1 - "continue" .and semicolon .emit OP_CONTINUE; -jump_statement_2 - "break" .and semicolon .emit OP_BREAK; -jump_statement_3 - "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END; -jump_statement_4 - "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END; -jump_statement_5 - "discard" .and semicolon .emit OP_DISCARD; - -/* - * <__asm_statement> ::= "__asm" ";" - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -__asm_statement - "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END; - -/* - * ::= - * | "," - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -asm_arguments - asm_argument .and .true .emit OP_END .and .loop asm_arguments_1; -asm_arguments_1 - comma .and asm_argument .and .true .emit OP_END; - -/* - * ::= - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -asm_argument - var_with_field .or - variable_identifier .or - floatconstant; - -var_with_field - variable_identifier .and dot .and field_selection .emit OP_FIELD; - - -/* - * ::= - * | - */ -translation_unit - optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and - .loop external_declaration .and optional_space .and - '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; - - -/* - * ::= - * | - */ -external_declaration - precision_stmt .emit DEFAULT_PRECISION .or - function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or - invariant_stmt .emit INVARIANT_STMT .or - declaration .emit EXTERNAL_DECLARATION; - - -/* - * ::= "precision" - */ -precision_stmt - "precision" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon; - -/* - * ::= "lowp" - * | "mediump" - * | "highp" - */ -precision - "lowp" .emit PRECISION_LOW .or - "mediump" .emit PRECISION_MEDIUM .or - "highp" .emit PRECISION_HIGH; - -/* - * ::= "int" - * | "float" - * | "a sampler type" - */ -prectype - "int" .emit TYPE_SPECIFIER_INT .or - "float" .emit TYPE_SPECIFIER_FLOAT .or - "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or - "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or - "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or - "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or - "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or - "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or - "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or - "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW; - - -/* - * ::= "invariant" identifier; - */ -invariant_stmt - "invariant" .and space .and identifier .and semicolon; - - -/* - * :: - */ -function_definition - function_prototype .and compound_statement_no_new_scope; - - - -/* - * helper rules, not part of the official language syntax - */ - -digit_oct - '0'-'7'; - -digit_dec - '0'-'9'; - -digit_hex - '0'-'9' .or 'A'-'F' .or 'a'-'f'; - -id_character_first - 'a'-'z' .or 'A'-'Z' .or '_'; - -id_character_next - id_character_first .or digit_dec; - -identifier - id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0'; - -float - float_1 .or float_2 .or float_3; -float_1 - float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix; -float_2 - float_digit_sequence .and .true .emit '\0' .and float_exponent_part .and optional_f_suffix; -float_3 - float_digit_sequence .and .true .emit '\0' .and 'f' .emit '\0'; - -float_fractional_constant - float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3; -float_fractional_constant_1 - float_digit_sequence .and '.' .and float_digit_sequence; -float_fractional_constant_2 - float_digit_sequence .and '.' .and .true .emit '\0'; -float_fractional_constant_3 - '.' .emit '\0' .and float_digit_sequence; - -float_optional_exponent_part - float_exponent_part .or .true .emit '\0'; - -float_digit_sequence - digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -float_exponent_part - float_exponent_part_1 .or float_exponent_part_2; -float_exponent_part_1 - 'e' .and float_optional_sign .and float_digit_sequence; -float_exponent_part_2 - 'E' .and float_optional_sign .and float_digit_sequence; - -float_optional_sign - float_sign .or .true; - -float_sign - '+' .or '-' .emit '-'; - -optional_f_suffix - 'f' .or .true; - - -integer - integer_hex .or integer_oct .or integer_dec; - -integer_hex - '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and - .true .emit '\0'; -integer_hex_1 - 'x' .or 'X'; - -integer_oct - '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0'; - -integer_dec - digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -boolean - "true" .emit 2 .emit '1' .emit '\0' .or - "false" .emit 2 .emit '0' .emit '\0'; - -type_name - identifier; - -field_selection - identifier; - -floatconstant - float .emit OP_PUSH_FLOAT; - -intconstant - integer .emit OP_PUSH_INT; - -boolconstant - boolean .emit OP_PUSH_BOOL; - -optional_space - .loop single_space; - -space - single_space .and .loop single_space; - -single_space - white_char .or c_style_comment_block .or cpp_style_comment_block; - -white_char - ' ' .or '\t' .or new_line .or '\v' .or '\f'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -/* lexical rules */ - -/*ampersand - optional_space .and '&' .and optional_space;*/ - -ampersandampersand - optional_space .and '&' .and '&' .and optional_space; - -/*ampersandequals - optional_space .and '&' .and '=' .and optional_space;*/ - -/*bar - optional_space .and '|' .and optional_space;*/ - -barbar - optional_space .and '|' .and '|' .and optional_space; - -/*barequals - optional_space .and '|' .and '=' .and optional_space;*/ - -bang - optional_space .and '!' .and optional_space; - -bangequals - optional_space .and '!' .and '=' .and optional_space; - -/*caret - optional_space .and '^' .and optional_space;*/ - -caretcaret - optional_space .and '^' .and '^' .and optional_space; - -/*caretequals - optional_space .and '^' .and '=' .and optional_space;*/ - -colon - optional_space .and ':' .and optional_space; - -comma - optional_space .and ',' .and optional_space; - -dot - optional_space .and '.' .and optional_space; - -equals - optional_space .and '=' .and optional_space; - -equalsequals - optional_space .and '=' .and '=' .and optional_space; - -greater - optional_space .and '>' .and optional_space; - -greaterequals - optional_space .and '>' .and '=' .and optional_space; - -/*greatergreater - optional_space .and '>' .and '>' .and optional_space;*/ - -/*greatergreaterequals - optional_space .and '>' .and '>' .and '=' .and optional_space;*/ - -lbrace - optional_space .and '{' .and optional_space; - -lbracket - optional_space .and '[' .and optional_space; - -less - optional_space .and '<' .and optional_space; - -lessequals - optional_space .and '<' .and '=' .and optional_space; - -/*lessless - optional_space .and '<' .and '<' .and optional_space;*/ - -/*lesslessequals - optional_space .and '<' .and '<' .and '=' .and optional_space;*/ - -lparen - optional_space .and '(' .and optional_space; - -minus - optional_space .and '-' .and optional_space; - -minusequals - optional_space .and '-' .and '=' .and optional_space; - -minusminus - optional_space .and '-' .and '-' .and optional_space; - -/*percent - optional_space .and '%' .and optional_space;*/ - -/*percentequals - optional_space .and '%' .and '=' .and optional_space;*/ - -plus - optional_space .and '+' .and optional_space; - -plusequals - optional_space .and '+' .and '=' .and optional_space; - -plusplus - optional_space .and '+' .and '+' .and optional_space; - -question - optional_space .and '?' .and optional_space; - -rbrace - optional_space .and '}' .and optional_space; - -rbracket - optional_space .and ']' .and optional_space; - -rparen - optional_space .and ')' .and optional_space; - -semicolon - optional_space .and ';' .and optional_space; - -slash - optional_space .and '/' .and optional_space; - -slashequals - optional_space .and '/' .and '=' .and optional_space; - -star - optional_space .and '*' .and optional_space; - -starequals - optional_space .and '*' .and '=' .and optional_space; - -/*tilde - optional_space .and '~' .and optional_space;*/ - -/* string rules - these are used internally by the parser when parsing quoted strings */ - -.string string_lexer; - -string_lexer - lex_first_identifier_character .and .loop lex_next_identifier_character; - -lex_first_identifier_character - 'a'-'z' .or 'A'-'Z' .or '_'; - -lex_next_identifier_character - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - -/* error rules - these are used by error messages */ - -err_token - '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or - '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or - '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier; - -err_identifier - id_character_first .and .loop id_character_next; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_shader_syn.h b/src/libs/mesa/mesa/shader/slang/library/slang_shader_syn.h deleted file mode 100644 index 6a382970e1..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_shader_syn.h +++ /dev/null @@ -1,866 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax translation_unit;\n" -".emtcode REVISION 5\n" -".emtcode EXTERNAL_NULL 0\n" -".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n" -".emtcode EXTERNAL_DECLARATION 2\n" -".emtcode DEFAULT_PRECISION 3\n" -".emtcode INVARIANT_STMT 4\n" -".emtcode PRECISION_DEFAULT 0\n" -".emtcode PRECISION_LOW 1\n" -".emtcode PRECISION_MEDIUM 2\n" -".emtcode PRECISION_HIGH 3\n" -".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n" -".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n" -".emtcode FUNCTION_ORDINARY 0\n" -".emtcode FUNCTION_CONSTRUCTOR 1\n" -".emtcode FUNCTION_OPERATOR 2\n" -".emtcode FUNCTION_CALL_NONARRAY 0\n" -".emtcode FUNCTION_CALL_ARRAY 1\n" -".emtcode OPERATOR_ADDASSIGN 1\n" -".emtcode OPERATOR_SUBASSIGN 2\n" -".emtcode OPERATOR_MULASSIGN 3\n" -".emtcode OPERATOR_DIVASSIGN 4\n" -".emtcode OPERATOR_LOGICALXOR 11\n" -".emtcode OPERATOR_LESS 15\n" -".emtcode OPERATOR_GREATER 16\n" -".emtcode OPERATOR_LESSEQUAL 17\n" -".emtcode OPERATOR_GREATEREQUAL 18\n" -".emtcode OPERATOR_MULTIPLY 21\n" -".emtcode OPERATOR_DIVIDE 22\n" -".emtcode OPERATOR_INCREMENT 24\n" -".emtcode OPERATOR_DECREMENT 25\n" -".emtcode OPERATOR_PLUS 26\n" -".emtcode OPERATOR_MINUS 27\n" -".emtcode OPERATOR_NOT 29\n" -".emtcode DECLARATOR_NONE 0\n" -".emtcode DECLARATOR_NEXT 1\n" -".emtcode VARIABLE_NONE 0\n" -".emtcode VARIABLE_IDENTIFIER 1\n" -".emtcode VARIABLE_INITIALIZER 2\n" -".emtcode VARIABLE_ARRAY_EXPLICIT 3\n" -".emtcode VARIABLE_ARRAY_UNKNOWN 4\n" -".emtcode TYPE_QUALIFIER_NONE 0\n" -".emtcode TYPE_QUALIFIER_CONST 1\n" -".emtcode TYPE_QUALIFIER_ATTRIBUTE 2\n" -".emtcode TYPE_QUALIFIER_VARYING 3\n" -".emtcode TYPE_QUALIFIER_UNIFORM 4\n" -".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n" -".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n" -".emtcode TYPE_VARIANT 90\n" -".emtcode TYPE_INVARIANT 91\n" -".emtcode TYPE_CENTER 95\n" -".emtcode TYPE_CENTROID 96\n" -".emtcode TYPE_SPECIFIER_VOID 0\n" -".emtcode TYPE_SPECIFIER_BOOL 1\n" -".emtcode TYPE_SPECIFIER_BVEC2 2\n" -".emtcode TYPE_SPECIFIER_BVEC3 3\n" -".emtcode TYPE_SPECIFIER_BVEC4 4\n" -".emtcode TYPE_SPECIFIER_INT 5\n" -".emtcode TYPE_SPECIFIER_IVEC2 6\n" -".emtcode TYPE_SPECIFIER_IVEC3 7\n" -".emtcode TYPE_SPECIFIER_IVEC4 8\n" -".emtcode TYPE_SPECIFIER_FLOAT 9\n" -".emtcode TYPE_SPECIFIER_VEC2 10\n" -".emtcode TYPE_SPECIFIER_VEC3 11\n" -".emtcode TYPE_SPECIFIER_VEC4 12\n" -".emtcode TYPE_SPECIFIER_MAT2 13\n" -".emtcode TYPE_SPECIFIER_MAT3 14\n" -".emtcode TYPE_SPECIFIER_MAT4 15\n" -".emtcode TYPE_SPECIFIER_SAMPLER1D 16\n" -".emtcode TYPE_SPECIFIER_SAMPLER2D 17\n" -".emtcode TYPE_SPECIFIER_SAMPLER3D 18\n" -".emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\n" -".emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DRECT 22\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23\n" -".emtcode TYPE_SPECIFIER_STRUCT 24\n" -".emtcode TYPE_SPECIFIER_TYPENAME 25\n" -".emtcode TYPE_SPECIFIER_MAT23 26\n" -".emtcode TYPE_SPECIFIER_MAT32 27\n" -".emtcode TYPE_SPECIFIER_MAT24 28\n" -".emtcode TYPE_SPECIFIER_MAT42 29\n" -".emtcode TYPE_SPECIFIER_MAT34 30\n" -".emtcode TYPE_SPECIFIER_MAT43 31\n" -".emtcode TYPE_SPECIFIER_NONARRAY 0\n" -".emtcode TYPE_SPECIFIER_ARRAY 1\n" -".emtcode FIELD_NONE 0\n" -".emtcode FIELD_NEXT 1\n" -".emtcode FIELD_ARRAY 2\n" -".emtcode OP_END 0\n" -".emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\n" -".emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\n" -".emtcode OP_DECLARE 3\n" -".emtcode OP_ASM 4\n" -".emtcode OP_BREAK 5\n" -".emtcode OP_CONTINUE 6\n" -".emtcode OP_DISCARD 7\n" -".emtcode OP_RETURN 8\n" -".emtcode OP_EXPRESSION 9\n" -".emtcode OP_IF 10\n" -".emtcode OP_WHILE 11\n" -".emtcode OP_DO 12\n" -".emtcode OP_FOR 13\n" -".emtcode OP_PUSH_VOID 14\n" -".emtcode OP_PUSH_BOOL 15\n" -".emtcode OP_PUSH_INT 16\n" -".emtcode OP_PUSH_FLOAT 17\n" -".emtcode OP_PUSH_IDENTIFIER 18\n" -".emtcode OP_SEQUENCE 19\n" -".emtcode OP_ASSIGN 20\n" -".emtcode OP_ADDASSIGN 21\n" -".emtcode OP_SUBASSIGN 22\n" -".emtcode OP_MULASSIGN 23\n" -".emtcode OP_DIVASSIGN 24\n" -".emtcode OP_SELECT 31\n" -".emtcode OP_LOGICALOR 32\n" -".emtcode OP_LOGICALXOR 33\n" -".emtcode OP_LOGICALAND 34\n" -".emtcode OP_EQUAL 38\n" -".emtcode OP_NOTEQUAL 39\n" -".emtcode OP_LESS 40\n" -".emtcode OP_GREATER 41\n" -".emtcode OP_LESSEQUAL 42\n" -".emtcode OP_GREATEREQUAL 43\n" -".emtcode OP_ADD 46\n" -".emtcode OP_SUBTRACT 47\n" -".emtcode OP_MULTIPLY 48\n" -".emtcode OP_DIVIDE 49\n" -".emtcode OP_PREINCREMENT 51\n" -".emtcode OP_PREDECREMENT 52\n" -".emtcode OP_PLUS 53\n" -".emtcode OP_MINUS 54\n" -".emtcode OP_NOT 56\n" -".emtcode OP_SUBSCRIPT 57\n" -".emtcode OP_CALL 58\n" -".emtcode OP_FIELD 59\n" -".emtcode OP_POSTINCREMENT 60\n" -".emtcode OP_POSTDECREMENT 61\n" -".emtcode OP_PRECISION 62\n" -".emtcode OP_METHOD 63\n" -".emtcode PARAM_QUALIFIER_IN 0\n" -".emtcode PARAM_QUALIFIER_OUT 1\n" -".emtcode PARAM_QUALIFIER_INOUT 2\n" -".emtcode PARAMETER_NONE 0\n" -".emtcode PARAMETER_NEXT 1\n" -".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n" -".emtcode PARAMETER_ARRAY_PRESENT 1\n" -".errtext INVALID_EXTERNAL_DECLARATION \"2001: Syntax error.\"\n" -".errtext INVALID_OPERATOR_OVERRIDE \"2002: Invalid operator override.\"\n" -".errtext LBRACE_EXPECTED \"2003: '{' expected but '$err_token$' found.\"\n" -".errtext LPAREN_EXPECTED \"2004: '(' expected but '$err_token$' found.\"\n" -".errtext RPAREN_EXPECTED \"2005: ')' expected but '$err_token$' found.\"\n" -".errtext INVALID_PRECISION \"2006: Invalid precision specifier '$err_token$'.\"\n" -".errtext INVALID_PRECISION_TYPE \"2007: Invalid precision type '$err_token$'.\"\n" -".regbyte parsing_builtin 0\n" -".regbyte shader_type 0\n" -"variable_identifier\n" -" identifier .emit OP_PUSH_IDENTIFIER;\n" -"primary_expression\n" -" floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\n" -"primary_expression_1\n" -" lparen .and expression .and rparen;\n" -"postfix_expression\n" -" postfix_expression_1 .and .loop postfix_expression_2;\n" -"postfix_expression_1\n" -" function_call .or primary_expression;\n" -"postfix_expression_2\n" -" postfix_expression_3 .or postfix_expression_4 .or\n" -" plusplus .emit OP_POSTINCREMENT .or\n" -" minusminus .emit OP_POSTDECREMENT;\n" -"postfix_expression_3\n" -" lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\n" -"postfix_expression_4\n" -" dot .and field_selection .emit OP_FIELD;\n" -"integer_expression\n" -" expression;\n" -"function_call\n" -" function_call_or_method;\n" -"function_call_or_method\n" -" regular_function_call .or method_call;\n" -"method_call\n" -" identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END;\n" -"regular_function_call\n" -" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n" -"function_call_generic\n" -" function_call_generic_1 .or function_call_generic_2;\n" -"function_call_generic_1\n" -" function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\n" -"function_call_generic_2\n" -" function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\n" -"function_call_header_no_parameters\n" -" function_call_header .and function_call_header_no_parameters_1;\n" -"function_call_header_no_parameters_1\n" -" \"void\" .or .true;\n" -"function_call_header_with_parameters\n" -" function_call_header .and assignment_expression .and .true .emit OP_END .and\n" -" .loop function_call_header_with_parameters_1;\n" -"function_call_header_with_parameters_1\n" -" comma .and assignment_expression .and .true .emit OP_END;\n" -"function_call_header\n" -" function_identifier .and lparen;\n" -"function_identifier\n" -" identifier .and function_identifier_opt_array;\n" -"function_identifier_opt_array\n" -" function_identifier_array .emit FUNCTION_CALL_ARRAY .or\n" -" .true .emit FUNCTION_CALL_NONARRAY;\n" -"function_identifier_array\n" -" lbracket .and constant_expression .and rbracket;\n" -"unary_expression\n" -" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" -" unary_expression_4 .or unary_expression_5;\n" -"unary_expression_1\n" -" plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\n" -"unary_expression_2\n" -" minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\n" -"unary_expression_3\n" -" plus .and unary_expression .and .true .emit OP_PLUS;\n" -"unary_expression_4\n" -" minus .and unary_expression .and .true .emit OP_MINUS;\n" -"unary_expression_5\n" -" bang .and unary_expression .and .true .emit OP_NOT;\n" -"multiplicative_expression\n" -" unary_expression .and .loop multiplicative_expression_1;\n" -"multiplicative_expression_1\n" -" multiplicative_expression_2 .or multiplicative_expression_3;\n" -"multiplicative_expression_2\n" -" star .and unary_expression .and .true .emit OP_MULTIPLY;\n" -"multiplicative_expression_3\n" -" slash .and unary_expression .and .true .emit OP_DIVIDE;\n" -"additive_expression\n" -" multiplicative_expression .and .loop additive_expression_1;\n" -"additive_expression_1\n" -" additive_expression_2 .or additive_expression_3;\n" -"additive_expression_2\n" -" plus .and multiplicative_expression .and .true .emit OP_ADD;\n" -"additive_expression_3\n" -" minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n" -"shift_expression\n" -" additive_expression;\n" -"relational_expression\n" -" shift_expression .and .loop relational_expression_1;\n" -"relational_expression_1\n" -" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n" -" relational_expression_5;\n" -"relational_expression_2\n" -" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n" -"relational_expression_3\n" -" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n" -"relational_expression_4\n" -" less .and shift_expression .and .true .emit OP_LESS;\n" -"relational_expression_5\n" -" greater .and shift_expression .and .true .emit OP_GREATER;\n" -"equality_expression\n" -" relational_expression .and .loop equality_expression_1;\n" -"equality_expression_1\n" -" equality_expression_2 .or equality_expression_3;\n" -"equality_expression_2\n" -" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n" -"equality_expression_3\n" -" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n" -"and_expression\n" -" equality_expression;\n" -"exclusive_or_expression\n" -" and_expression;\n" -"inclusive_or_expression\n" -" exclusive_or_expression;\n" -"logical_and_expression\n" -" inclusive_or_expression .and .loop logical_and_expression_1;\n" -"logical_and_expression_1\n" -" ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\n" -"logical_xor_expression\n" -" logical_and_expression .and .loop logical_xor_expression_1;\n" -"logical_xor_expression_1\n" -" caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\n" -"logical_or_expression\n" -" logical_xor_expression .and .loop logical_or_expression_1;\n" -"logical_or_expression_1\n" -" barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\n" -"conditional_expression\n" -" logical_or_expression .and .loop conditional_expression_1;\n" -"conditional_expression_1\n" -" question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\n" -"assignment_expression\n" -" assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\n" -" assignment_expression_4 .or assignment_expression_5 .or conditional_expression;\n" -"assignment_expression_1\n" -" unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\n" -"assignment_expression_2\n" -" unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\n" -"assignment_expression_3\n" -" unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\n" -"assignment_expression_4\n" -" unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\n" -"assignment_expression_5\n" -" unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\n" -"expression\n" -" assignment_expression .and .loop expression_1;\n" -"expression_1\n" -" comma .and assignment_expression .and .true .emit OP_SEQUENCE;\n" -"constant_expression\n" -" conditional_expression .and .true .emit OP_END;\n" -"declaration\n" -" declaration_1 .or declaration_2;\n" -"declaration_1\n" -" function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\n" -"declaration_2\n" -" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n" -"function_prototype\n" -" function_prototype_1 .or function_prototype_2;\n" -"function_prototype_1\n" -" function_header .and \"void\" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n" -"function_prototype_2\n" -" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n" -"function_declarator\n" -" function_header_with_parameters .or function_header;\n" -"function_header_with_parameters\n" -" function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\n" -"function_header_with_parameters_1\n" -" comma .and parameter_declaration;\n" -"function_header\n" -" function_header_nospace .or function_header_space;\n" -"function_header_space\n" -" fully_specified_type_space .and space .and function_decl_identifier .and lparen;\n" -"function_header_nospace\n" -" fully_specified_type_nospace .and function_decl_identifier .and lparen;\n" -"function_decl_identifier\n" -" .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n" -" .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n" -" identifier .emit FUNCTION_ORDINARY;\n" -"__operator\n" -" \"__operator\" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\n" -"overriden_operator\n" -" plusplus .emit OPERATOR_INCREMENT .or\n" -" plusequals .emit OPERATOR_ADDASSIGN .or\n" -" plus .emit OPERATOR_PLUS .or\n" -" minusminus .emit OPERATOR_DECREMENT .or\n" -" minusequals .emit OPERATOR_SUBASSIGN .or\n" -" minus .emit OPERATOR_MINUS .or\n" -" bang .emit OPERATOR_NOT .or\n" -" starequals .emit OPERATOR_MULASSIGN .or\n" -" star .emit OPERATOR_MULTIPLY .or\n" -" slashequals .emit OPERATOR_DIVASSIGN .or\n" -" slash .emit OPERATOR_DIVIDE .or\n" -" lessequals .emit OPERATOR_LESSEQUAL .or\n" -" \n" -" \n" -" less .emit OPERATOR_LESS .or\n" -" greaterequals .emit OPERATOR_GREATEREQUAL .or\n" -" \n" -" \n" -" greater .emit OPERATOR_GREATER .or\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" caretcaret .emit OPERATOR_LOGICALXOR ;\n" -"parameter_declarator\n" -" parameter_declarator_nospace .or parameter_declarator_space;\n" -"parameter_declarator_nospace\n" -" type_specifier_nospace .and identifier .and parameter_declarator_1;\n" -"parameter_declarator_space\n" -" type_specifier_space .and space .and identifier .and parameter_declarator_1;\n" -"parameter_declarator_1\n" -" parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n" -" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" -"parameter_declarator_2\n" -" lbracket .and constant_expression .and rbracket;\n" -"parameter_declaration\n" -" parameter_declaration_1 .emit PARAMETER_NEXT;\n" -"parameter_declaration_1\n" -" parameter_declaration_2 .or parameter_declaration_3;\n" -"parameter_declaration_2\n" -" type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\n" -"parameter_declaration_3\n" -" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n" -"parameter_declaration_4\n" -" parameter_declaration_optprec .and parameter_declaration_rest;\n" -"parameter_declaration_optprec\n" -" parameter_declaration_prec .or .true .emit PRECISION_DEFAULT;\n" -"parameter_declaration_prec\n" -" precision .and space;\n" -"parameter_declaration_rest\n" -" parameter_declarator .or parameter_type_specifier;\n" -"parameter_qualifier\n" -" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n" -"parameter_qualifier_1\n" -" parameter_qualifier_2 .and space;\n" -"parameter_qualifier_2\n" -" \"in\" .emit PARAM_QUALIFIER_IN .or\n" -" \"out\" .emit PARAM_QUALIFIER_OUT .or\n" -" \"inout\" .emit PARAM_QUALIFIER_INOUT;\n" -"parameter_type_specifier\n" -" parameter_type_specifier_1 .and .true .emit '\\0' .and parameter_type_specifier_2;\n" -"parameter_type_specifier_1\n" -" type_specifier_nospace .or type_specifier_space;\n" -"parameter_type_specifier_2\n" -" parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n" -" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" -"parameter_type_specifier_3\n" -" lbracket .and constant_expression .and rbracket;\n" -"init_declarator_list\n" -" single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\n" -" .true .emit DECLARATOR_NONE;\n" -"init_declarator_list_1\n" -" comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\n" -"init_declarator_list_2\n" -" init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\n" -"init_declarator_list_3\n" -" equals .and initializer .emit VARIABLE_INITIALIZER;\n" -"init_declarator_list_4\n" -" lbracket .and init_declarator_list_5 .and rbracket;\n" -"init_declarator_list_5\n" -" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" -"single_declaration\n" -" single_declaration_nospace .or single_declaration_space;\n" -"single_declaration_space\n" -" fully_specified_type_space .and single_declaration_space_1;\n" -"single_declaration_nospace\n" -" fully_specified_type_nospace .and single_declaration_nospace_1;\n" -"single_declaration_space_1\n" -" single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" -"single_declaration_nospace_1\n" -" single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" -"single_declaration_space_2\n" -" space .and identifier .and single_declaration_3;\n" -"single_declaration_nospace_2\n" -" identifier .and single_declaration_3;\n" -"single_declaration_3\n" -" single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n" -"single_declaration_4\n" -" equals .and initializer .emit VARIABLE_INITIALIZER;\n" -"single_declaration_5\n" -" lbracket .and single_declaration_6 .and rbracket;\n" -"single_declaration_6\n" -" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" -"fully_specified_type_space\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n" -"fully_specified_type_nospace\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n" -"fully_specified_type_optinvariant\n" -" fully_specified_type_invariant .or .true .emit TYPE_VARIANT;\n" -"fully_specified_type_invariant\n" -" invariant_qualifier .and space;\n" -"fully_specified_type_optcentroid\n" -" fully_specified_type_centroid .or .true .emit TYPE_CENTER;\n" -"fully_specified_type_centroid\n" -" centroid_qualifier .and space;\n" -"fully_specified_type_optqual\n" -" fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE;\n" -"fully_specified_type_qual\n" -" type_qualifier .and space;\n" -"fully_specified_type_optprec\n" -" fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n" -"fully_specified_type_prec\n" -" precision .and space;\n" -"invariant_qualifier\n" -" \"invariant\" .emit TYPE_INVARIANT;\n" -"centroid_qualifier\n" -" \"centroid\" .emit TYPE_CENTROID;\n" -"type_qualifier\n" -" \"const\" .emit TYPE_QUALIFIER_CONST .or\n" -" .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n" -" \"varying\" .emit TYPE_QUALIFIER_VARYING .or\n" -" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n" -" .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n" -" .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n" -"type_specifier_nonarray_space\n" -" \"void\" .emit TYPE_SPECIFIER_VOID .or\n" -" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" -" \"int\" .emit TYPE_SPECIFIER_INT .or\n" -" \"bool\" .emit TYPE_SPECIFIER_BOOL .or\n" -" \"vec2\" .emit TYPE_SPECIFIER_VEC2 .or\n" -" \"vec3\" .emit TYPE_SPECIFIER_VEC3 .or\n" -" \"vec4\" .emit TYPE_SPECIFIER_VEC4 .or\n" -" \"bvec2\" .emit TYPE_SPECIFIER_BVEC2 .or\n" -" \"bvec3\" .emit TYPE_SPECIFIER_BVEC3 .or\n" -" \"bvec4\" .emit TYPE_SPECIFIER_BVEC4 .or\n" -" \"ivec2\" .emit TYPE_SPECIFIER_IVEC2 .or\n" -" \"ivec3\" .emit TYPE_SPECIFIER_IVEC3 .or\n" -" \"ivec4\" .emit TYPE_SPECIFIER_IVEC4 .or\n" -" \"mat2\" .emit TYPE_SPECIFIER_MAT2 .or\n" -" \"mat3\" .emit TYPE_SPECIFIER_MAT3 .or\n" -" \"mat4\" .emit TYPE_SPECIFIER_MAT4 .or\n" -" \"mat2x3\" .emit TYPE_SPECIFIER_MAT23 .or\n" -" \"mat3x2\" .emit TYPE_SPECIFIER_MAT32 .or\n" -" \"mat2x4\" .emit TYPE_SPECIFIER_MAT24 .or\n" -" \"mat4x2\" .emit TYPE_SPECIFIER_MAT42 .or\n" -" \"mat3x4\" .emit TYPE_SPECIFIER_MAT34 .or\n" -" \"mat4x3\" .emit TYPE_SPECIFIER_MAT43 .or\n" -" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n" -" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n" -" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n" -" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n" -" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n" -" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n" -" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" -" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or\n" -" type_name .emit TYPE_SPECIFIER_TYPENAME;\n" -"type_specifier_nonarray_nospace\n" -" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n" -"type_specifier_nonarray\n" -" type_specifier_nonarray_nospace .or type_specifier_nonarray_space;\n" -"type_specifier_space\n" -" type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" -"type_specifier_nospace\n" -" type_specifier_nospace_array .or type_specifier_nospace_1;\n" -"type_specifier_nospace_1\n" -" type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" -"type_specifier_nospace_array\n" -" type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;\n" -"struct_specifier\n" -" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n" -" struct_declaration_list .and rbrace .emit FIELD_NONE;\n" -"struct_specifier_1\n" -" struct_specifier_2 .or .true .emit '\\0';\n" -"struct_specifier_2\n" -" space .and identifier;\n" -"struct_declaration_list\n" -" struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n" -"struct_declaration\n" -" struct_declaration_nospace .or struct_declaration_space;\n" -"struct_declaration_space\n" -" type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" -"struct_declaration_nospace\n" -" type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" -"struct_declarator_list\n" -" struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n" -"struct_declarator_list_1\n" -" comma .and struct_declarator;\n" -"struct_declarator\n" -" identifier .and struct_declarator_1;\n" -"struct_declarator_1\n" -" struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\n" -"struct_declarator_2\n" -" lbracket .and constant_expression .and rbracket;\n" -"initializer\n" -" assignment_expression .and .true .emit OP_END;\n" -"declaration_statement\n" -" declaration;\n" -"statement\n" -" compound_statement .or simple_statement;\n" -"statement_space\n" -" compound_statement .or statement_space_1;\n" -"statement_space_1\n" -" space .and simple_statement;\n" -"simple_statement\n" -" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n" -" selection_statement .or\n" -" iteration_statement .or\n" -" precision_stmt .emit OP_PRECISION .or\n" -" jump_statement .or\n" -" expression_statement .emit OP_EXPRESSION .or\n" -" declaration_statement .emit OP_DECLARE;\n" -"compound_statement\n" -" compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\n" -"compound_statement_1\n" -" compound_statement_2 .or compound_statement_3;\n" -"compound_statement_2\n" -" lbrace .and rbrace;\n" -"compound_statement_3\n" -" lbrace .and statement_list .and rbrace;\n" -"compound_statement_no_new_scope\n" -" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n" -"compound_statement_no_new_scope_1\n" -" compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\n" -"compound_statement_no_new_scope_2\n" -" lbrace .and rbrace;\n" -"compound_statement_no_new_scope_3\n" -" lbrace .and statement_list .and rbrace;\n" -"statement_list\n" -" statement .and .loop statement;\n" -"expression_statement\n" -" expression_statement_1 .or expression_statement_2;\n" -"expression_statement_1\n" -" semicolon .emit OP_PUSH_VOID .emit OP_END;\n" -"expression_statement_2\n" -" expression .and semicolon .emit OP_END;\n" -"selection_statement\n" -" \"if\" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\n" -" rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\n" -"selection_rest_statement\n" -" statement .and selection_rest_statement_1;\n" -"selection_rest_statement_1\n" -" selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n" -"selection_rest_statement_2\n" -" \"else\" .and optional_space .and statement;\n" -"condition\n" -" condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n" -" condition_3 .emit OP_EXPRESSION;\n" -"condition_1\n" -" condition_1_nospace .or condition_1_space;\n" -"condition_1_nospace\n" -" fully_specified_type_nospace .and condition_2;\n" -"condition_1_space\n" -" fully_specified_type_space .and space .and condition_2;\n" -"condition_2\n" -" identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\n" -" initializer .and .true .emit DECLARATOR_NONE;\n" -"condition_3\n" -" expression .and .true .emit OP_END;\n" -"iteration_statement\n" -" iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n" -"iteration_statement_1\n" -" \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n" -" rparen .error RPAREN_EXPECTED .and statement;\n" -"iteration_statement_2\n" -" \"do\" .emit OP_DO .and statement_space .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n" -" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n" -"iteration_statement_3\n" -" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n" -" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement;\n" -"for_init_statement\n" -" expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\n" -"conditionopt\n" -" condition .or\n" -" .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\\0' .emit OP_END;\n" -"for_rest_statement\n" -" conditionopt .and semicolon .and for_rest_statement_1;\n" -"for_rest_statement_1\n" -" for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\n" -"for_rest_statement_2\n" -" expression .and .true .emit OP_END;\n" -"jump_statement\n" -" jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\n" -" .if (shader_type == 1) jump_statement_5;\n" -"jump_statement_1\n" -" \"continue\" .and semicolon .emit OP_CONTINUE;\n" -"jump_statement_2\n" -" \"break\" .and semicolon .emit OP_BREAK;\n" -"jump_statement_3\n" -" \"return\" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\n" -"jump_statement_4\n" -" \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n" -"jump_statement_5\n" -" \"discard\" .and semicolon .emit OP_DISCARD;\n" -"__asm_statement\n" -" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n" -"asm_arguments\n" -" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n" -"asm_arguments_1\n" -" comma .and asm_argument .and .true .emit OP_END;\n" -"asm_argument\n" -" var_with_field .or\n" -" variable_identifier .or\n" -" floatconstant;\n" -"var_with_field\n" -" variable_identifier .and dot .and field_selection .emit OP_FIELD;\n" -"translation_unit\n" -" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n" -" .loop external_declaration .and optional_space .and\n" -" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" -"external_declaration\n" -" precision_stmt .emit DEFAULT_PRECISION .or\n" -" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n" -" invariant_stmt .emit INVARIANT_STMT .or\n" -" declaration .emit EXTERNAL_DECLARATION;\n" -"precision_stmt\n" -" \"precision\" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon;\n" -"precision\n" -" \"lowp\" .emit PRECISION_LOW .or\n" -" \"mediump\" .emit PRECISION_MEDIUM .or\n" -" \"highp\" .emit PRECISION_HIGH;\n" -"prectype\n" -" \"int\" .emit TYPE_SPECIFIER_INT .or\n" -" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" -" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n" -" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n" -" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n" -" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n" -" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n" -" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n" -" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" -" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW;\n" -"invariant_stmt\n" -" \"invariant\" .and space .and identifier .and semicolon;\n" -"function_definition\n" -" function_prototype .and compound_statement_no_new_scope;\n" -"digit_oct\n" -" '0'-'7';\n" -"digit_dec\n" -" '0'-'9';\n" -"digit_hex\n" -" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n" -"id_character_first\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"id_character_next\n" -" id_character_first .or digit_dec;\n" -"identifier\n" -" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n" -"float\n" -" float_1 .or float_2 .or float_3;\n" -"float_1\n" -" float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix;\n" -"float_2\n" -" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part .and optional_f_suffix;\n" -"float_3\n" -" float_digit_sequence .and .true .emit '\\0' .and 'f' .emit '\\0';\n" -"float_fractional_constant\n" -" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n" -"float_fractional_constant_1\n" -" float_digit_sequence .and '.' .and float_digit_sequence;\n" -"float_fractional_constant_2\n" -" float_digit_sequence .and '.' .and .true .emit '\\0';\n" -"float_fractional_constant_3\n" -" '.' .emit '\\0' .and float_digit_sequence;\n" -"float_optional_exponent_part\n" -" float_exponent_part .or .true .emit '\\0';\n" -"float_digit_sequence\n" -" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"float_exponent_part\n" -" float_exponent_part_1 .or float_exponent_part_2;\n" -"float_exponent_part_1\n" -" 'e' .and float_optional_sign .and float_digit_sequence;\n" -"float_exponent_part_2\n" -" 'E' .and float_optional_sign .and float_digit_sequence;\n" -"float_optional_sign\n" -" float_sign .or .true;\n" -"float_sign\n" -" '+' .or '-' .emit '-';\n" -"optional_f_suffix\n" -" 'f' .or .true;\n" -"integer\n" -" integer_hex .or integer_oct .or integer_dec;\n" -"integer_hex\n" -" '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\n" -" .true .emit '\\0';\n" -"integer_hex_1\n" -" 'x' .or 'X';\n" -"integer_oct\n" -" '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\\0';\n" -"integer_dec\n" -" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"boolean\n" -" \"true\" .emit 2 .emit '1' .emit '\\0' .or\n" -" \"false\" .emit 2 .emit '0' .emit '\\0';\n" -"type_name\n" -" identifier;\n" -"field_selection\n" -" identifier;\n" -"floatconstant\n" -" float .emit OP_PUSH_FLOAT;\n" -"intconstant\n" -" integer .emit OP_PUSH_INT;\n" -"boolconstant\n" -" boolean .emit OP_PUSH_BOOL;\n" -"optional_space\n" -" .loop single_space;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" white_char .or c_style_comment_block .or cpp_style_comment_block;\n" -"white_char\n" -" ' ' .or '\\t' .or new_line .or '\\v' .or '\\f';\n" -"new_line\n" -" cr_lf .or lf_cr .or '\\n' .or '\\r';\n" -"cr_lf\n" -" '\\r' .and '\\n';\n" -"lf_cr\n" -" '\\n' .and '\\r';\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest;\n" -"c_style_comment_rest\n" -" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n" -"c_style_comment_rest_1\n" -" c_style_comment_end .or c_style_comment_rest_2;\n" -"c_style_comment_rest_2\n" -" '*' .and c_style_comment_rest;\n" -"c_style_comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_end\n" -" '*' .and '/';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"ampersandampersand\n" -" optional_space .and '&' .and '&' .and optional_space;\n" -"barbar\n" -" optional_space .and '|' .and '|' .and optional_space;\n" -"bang\n" -" optional_space .and '!' .and optional_space;\n" -"bangequals\n" -" optional_space .and '!' .and '=' .and optional_space;\n" -"caretcaret\n" -" optional_space .and '^' .and '^' .and optional_space;\n" -"colon\n" -" optional_space .and ':' .and optional_space;\n" -"comma\n" -" optional_space .and ',' .and optional_space;\n" -"dot\n" -" optional_space .and '.' .and optional_space;\n" -"equals\n" -" optional_space .and '=' .and optional_space;\n" -"equalsequals\n" -" optional_space .and '=' .and '=' .and optional_space;\n" -"greater\n" -" optional_space .and '>' .and optional_space;\n" -"greaterequals\n" -" optional_space .and '>' .and '=' .and optional_space;\n" -"lbrace\n" -" optional_space .and '{' .and optional_space;\n" -"lbracket\n" -" optional_space .and '[' .and optional_space;\n" -"less\n" -" optional_space .and '<' .and optional_space;\n" -"lessequals\n" -" optional_space .and '<' .and '=' .and optional_space;\n" -"lparen\n" -" optional_space .and '(' .and optional_space;\n" -"minus\n" -" optional_space .and '-' .and optional_space;\n" -"minusequals\n" -" optional_space .and '-' .and '=' .and optional_space;\n" -"minusminus\n" -" optional_space .and '-' .and '-' .and optional_space;\n" -"plus\n" -" optional_space .and '+' .and optional_space;\n" -"plusequals\n" -" optional_space .and '+' .and '=' .and optional_space;\n" -"plusplus\n" -" optional_space .and '+' .and '+' .and optional_space;\n" -"question\n" -" optional_space .and '?' .and optional_space;\n" -"rbrace\n" -" optional_space .and '}' .and optional_space;\n" -"rbracket\n" -" optional_space .and ']' .and optional_space;\n" -"rparen\n" -" optional_space .and ')' .and optional_space;\n" -"semicolon\n" -" optional_space .and ';' .and optional_space;\n" -"slash\n" -" optional_space .and '/' .and optional_space;\n" -"slashequals\n" -" optional_space .and '/' .and '=' .and optional_space;\n" -"star\n" -" optional_space .and '*' .and optional_space;\n" -"starequals\n" -" optional_space .and '*' .and '=' .and optional_space;\n" -".string string_lexer;\n" -"string_lexer\n" -" lex_first_identifier_character .and .loop lex_next_identifier_character;\n" -"lex_first_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"lex_next_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"err_token\n" -" '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\n" -" '-' .or '+' .or '=' .or '|' .or '\\\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '\"' .or\n" -" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n" -"err_identifier\n" -" id_character_first .and .loop id_character_next;\n" -"" diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_version.syn b/src/libs/mesa/mesa/shader/slang/library/slang_version.syn deleted file mode 100755 index aaf8bef342..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_version.syn +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 2005 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. - */ - -/** - * \file slang_version.syn - * slang #version directive syntax - * \author Michal Krol - */ - -.syntax version_directive; - -version_directive - version_directive_1 .and .loop version_directive_2; -version_directive_1 - prior_optional_spaces .and optional_version_directive .and .true .emit $; -version_directive_2 - prior_optional_spaces .and version_directive_body .and .true .emit $; - -optional_version_directive - version_directive_body .or .true .emit 10 .emit 1; - -version_directive_body - '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and - new_line; - -version_number - version_number_110; - -version_number_110 - leading_zeroes .and "110" .emit 10 .emit 1; - -leading_zeroes - .loop zero; - -zero - '0'; - -space - single_space .and .loop single_space; - -optional_space - .loop single_space; - -single_space - ' ' .or '\t'; - -prior_optional_spaces - .loop prior_space; - -prior_space - c_style_comment_block .or cpp_style_comment_block .or space .or new_line; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -.string __string_filter; - -__string_filter - .loop __identifier_char; - -__identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_version_syn.h b/src/libs/mesa/mesa/shader/slang/library/slang_version_syn.h deleted file mode 100755 index 3b94d85927..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_version_syn.h +++ /dev/null @@ -1,64 +0,0 @@ -".syntax version_directive;\n" -"version_directive\n" -" version_directive_1 .and .loop version_directive_2;\n" -"version_directive_1\n" -" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n" -"version_directive_2\n" -" prior_optional_spaces .and version_directive_body .and .true .emit $;\n" -"optional_version_directive\n" -" version_directive_body .or .true .emit 10 .emit 1;\n" -"version_directive_body\n" -" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n" -" new_line;\n" -"version_number\n" -" version_number_110;\n" -"version_number_110\n" -" leading_zeroes .and \"110\" .emit 10 .emit 1;\n" -"leading_zeroes\n" -" .loop zero;\n" -"zero\n" -" '0';\n" -"space\n" -" single_space .and .loop single_space;\n" -"optional_space\n" -" .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"prior_optional_spaces\n" -" .loop prior_space;\n" -"prior_space\n" -" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest;\n" -"c_style_comment_rest\n" -" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n" -"c_style_comment_rest_1\n" -" c_style_comment_end .or c_style_comment_rest_2;\n" -"c_style_comment_rest_2\n" -" '*' .and c_style_comment_rest;\n" -"c_style_comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_end\n" -" '*' .and '/';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"new_line\n" -" cr_lf .or lf_cr .or '\\n' .or '\\r';\n" -"cr_lf\n" -" '\\r' .and '\\n';\n" -"lf_cr\n" -" '\\n' .and '\\r';\n" -".string __string_filter;\n" -"__string_filter\n" -" .loop __identifier_char;\n" -"__identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n" -"" diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin.gc b/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin.gc deleted file mode 100644 index 17e86d9a0e..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin.gc +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2006 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. - */ - -// -// From Shader Spec, ver. 1.10, rev. 59 -// - -__fixed_output vec4 gl_Position; -__fixed_output float gl_PointSize; -__fixed_output vec4 gl_ClipVertex; - -attribute vec4 gl_Color; -attribute vec4 gl_SecondaryColor; -attribute vec3 gl_Normal; -attribute vec4 gl_Vertex; -attribute vec4 gl_MultiTexCoord0; -attribute vec4 gl_MultiTexCoord1; -attribute vec4 gl_MultiTexCoord2; -attribute vec4 gl_MultiTexCoord3; -attribute vec4 gl_MultiTexCoord4; -attribute vec4 gl_MultiTexCoord5; -attribute vec4 gl_MultiTexCoord6; -attribute vec4 gl_MultiTexCoord7; -attribute float gl_FogCoord; - -varying vec4 gl_FrontColor; -varying vec4 gl_BackColor; -varying vec4 gl_FrontSecondaryColor; -varying vec4 gl_BackSecondaryColor; -varying vec4 gl_TexCoord[gl_MaxTextureCoords]; -varying float gl_FogFragCoord; - -// -// Geometric Functions -// - -vec4 ftransform() -{ - __retVal = gl_ModelViewProjectionMatrix[0] * gl_Vertex.xxxx - + gl_ModelViewProjectionMatrix[1] * gl_Vertex.yyyy - + gl_ModelViewProjectionMatrix[2] * gl_Vertex.zzzz - + gl_ModelViewProjectionMatrix[3] * gl_Vertex.wwww; -} - - - -// -// 8.7 Texture Lookup Functions -// These are pretty much identical to the ones in slang_fragment_builtin.gc -// When used in a vertex program, the texture sample instructions should not -// be using a LOD term so it's effectively zero. Adding 'lod' to that does -// what we want. -// - -vec4 texture1DLod(const sampler1D sampler, const float coord, const float lod) -{ - vec4 coord4; - coord4.x = coord; - coord4.w = lod; - __asm vec4_texb1d __retVal, sampler, coord4; -} - -vec4 texture1DProjLod(const sampler1D sampler, const vec2 coord, const float lod) -{ - vec4 pcoord; - pcoord.x = coord.x / coord.y; - pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - -vec4 texture1DProjLod(const sampler1D sampler, const vec4 coord, const float lod) -{ - vec4 pcoord; - pcoord.x = coord.x / coord.z; - pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - - - -vec4 texture2DLod(const sampler2D sampler, const vec2 coord, const float lod) -{ - vec4 coord4; - coord4.xy = coord.xy; - coord4.w = lod; - __asm vec4_texb2d __retVal, sampler, coord4; -} - -vec4 texture2DProjLod(const sampler2D sampler, const vec3 coord, const float lod) -{ - vec4 pcoord; - pcoord.xy = coord.xy / coord.z; - pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - -vec4 texture2DProjLod(const sampler2D sampler, const vec4 coord, const float lod) -{ - vec4 pcoord; - pcoord.xy = coord.xy / coord.z; - pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - - -vec4 texture3DLod(const sampler3D sampler, const vec3 coord, const float lod) -{ - vec4 coord4; - coord4.xyz = coord.xyz; - coord4.w = lod; - __asm vec4_texb3d __retVal, sampler, coord4; -} - -vec4 texture3DProjLod(const sampler3D sampler, const vec4 coord, const float lod) -{ - // do projection here (there's no vec4_texbp3d instruction) - vec4 pcoord; - pcoord.xyz = coord.xyz / coord.w; - pcoord.w = lod; - __asm vec4_texb3d __retVal, sampler, pcoord; -} - - -vec4 textureCubeLod(const samplerCube sampler, const vec3 coord, const float lod) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = lod; - __asm vec4_texcube __retVal, sampler, coord4; -} - - -vec4 shadow1DLod(const sampler1DShadow sampler, const vec3 coord, const float lod) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = lod; - __asm vec4_texb1d __retVal, sampler, coord4; -} - -vec4 shadow1DProjLod(const sampler1DShadow sampler, const vec4 coord, - const float lod) -{ - vec4 pcoord; - pcoord.x = coord.x / coord.w; - pcoord.z = coord.z; - pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; -} - - -vec4 shadow2DLod(const sampler2DShadow sampler, const vec3 coord, const float lod) -{ - vec4 coord4; - coord4.xyz = coord; - coord4.w = lod; - __asm vec4_texb2d __retVal, sampler, coord4; -} - -vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, - const float lod) -{ - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - pcoord.z = coord.z; - pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; -} - diff --git a/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin_gc.h deleted file mode 100644 index 2cb91bf268..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ /dev/null @@ -1,106 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_vertex_builtin.gc */ - -5,2,2,90,95,5,0,12,0,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,90,95,5,0,9,0,1,103,108, -95,80,111,105,110,116,83,105,122,101,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,67,108,105,112,86,101, -114,116,101,120,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95,2,0,12,0, -1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,2,0,11,0,1,103, -108,95,78,111,114,109,97,108,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,86,101,114,116,101,120,0,0,0,2, -2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,48,0,0,0,2,2,90,95, -2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,90,95,2,0,12,0, -1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,90,95,2,0,12,0,1,103, -108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95, -77,117,108,116,105,84,101,120,67,111,111,114,100,52,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117, -108,116,105,84,101,120,67,111,111,114,100,53,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116, -105,84,101,120,67,111,111,114,100,54,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84, -101,120,67,111,111,114,100,55,0,0,0,2,2,90,95,2,0,9,0,1,103,108,95,70,111,103,67,111,111,114,100,0, -0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0, -1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110, -116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,66, -97,99,107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108, -95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0, -1,90,95,0,0,12,0,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116, -114,105,120,0,16,8,48,0,57,18,103,108,95,86,101,114,116,101,120,0,59,120,120,120,120,0,48,18,103, -108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105, -120,0,16,10,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,121,121,121,0,48,46,18,103,108, -95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0, -16,10,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,108,95,77, -111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16,10, -51,0,57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0, -0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114, -100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90, -95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0, -18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101, -120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0, -1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99, -111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18, -99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0, -4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0, -1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111, -114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0, -116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, -112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108, -111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120, -116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1, -0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111, -111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0, -18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114, -101,51,68,76,111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100, -0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111, -111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90, -95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99, -111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0, -1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100, -0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120, -99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, -90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99, -111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52, -95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,76, -111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0, -9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, -100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112, -99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0, -115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52, -0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114, -100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0, -18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0, -4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 diff --git a/src/libs/mesa/mesa/shader/slang/library/syn_to_c.c b/src/libs/mesa/mesa/shader/slang/library/syn_to_c.c deleted file mode 100644 index f997edfd8b..0000000000 --- a/src/libs/mesa/mesa/shader/slang/library/syn_to_c.c +++ /dev/null @@ -1,72 +0,0 @@ -#include - -static int was_space = 0; -static int first_char = 1; - -static void put_char (int c) -{ - if (c == '\n') { - if (!first_char) { - fputs ("\\n\"\n\"", stdout); - first_char = 1; - } - } - else { - first_char = 0; - if (c == '\\') - fputs ("\\\\", stdout); - else if (c == '\"') - fputs ("\\\"", stdout); - else if (!was_space || !(c == ' ' || c == '\t')) - fputc (c, stdout); - was_space = (c == ' ' || c == '\t'); - } -} - -int main (int argc, char *argv[]) -{ - int c; - FILE *f; - - if (argc == 1) - return 1; - f = fopen (argv[1], "r"); - if (f == NULL) - return 1; - - fputs ("\n", stdout); - fputs ("/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */\n", stdout); - fputs ("\n", stdout); - fputs ("\"", stdout); - c = getc (f); - while (c != EOF) { - if (c == '/') { - int c2 = getc (f); - if (c2 == '*') { - was_space = 0; - c = getc (f); - for (;;) { - if (c == '*') { - c2 = getc (f); - if (c2 == '/') - break; - } - c = getc (f); - } - } - else { - put_char (c); - put_char (c2); - } - } - else { - put_char (c); - } - c = getc (f); - } - fputs ("\"\n", stdout); - - fclose (f); - return 0; -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_builtin.c b/src/libs/mesa/mesa/shader/slang/slang_builtin.c deleted file mode 100644 index 5a673941fa..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_builtin.c +++ /dev/null @@ -1,711 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file slang_builtin.c - * Resolve built-in uniform vars. - * \author Brian Paul - */ - -#include "main/imports.h" -#include "main/mtypes.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_statevars.h" -#include "shader/slang/slang_ir.h" -#include "shader/slang/slang_emit.h" -#include "shader/slang/slang_builtin.h" - - -/** special state token (see below) */ -#define STATE_ARRAY ((gl_state_index) 0xfffff) - - -/** - * Lookup GL state given a variable name, 0, 1 or 2 indexes and a field. - * Allocate room for the state in the given param list and return position - * in the list. - * Yes, this is kind of ugly, but it works. - */ -static GLint -lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, - GLuint *swizzleOut, - struct gl_program_parameter_list *paramList) -{ - /* - * NOTE: The ARB_vertex_program extension specified that matrices get - * loaded in registers in row-major order. With GLSL, we want column- - * major order. So, we need to transpose all matrices here... - */ - static const struct { - const char *name; - gl_state_index matrix; - gl_state_index modifier; - } matrices[] = { - { "gl_ModelViewMatrix", STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE }, - { "gl_ModelViewMatrixInverse", STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVTRANS }, - { "gl_ModelViewMatrixTranspose", STATE_MODELVIEW_MATRIX, 0 }, - { "gl_ModelViewMatrixInverseTranspose", STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE }, - - { "gl_ProjectionMatrix", STATE_PROJECTION_MATRIX, STATE_MATRIX_TRANSPOSE }, - { "gl_ProjectionMatrixInverse", STATE_PROJECTION_MATRIX, STATE_MATRIX_INVTRANS }, - { "gl_ProjectionMatrixTranspose", STATE_PROJECTION_MATRIX, 0 }, - { "gl_ProjectionMatrixInverseTranspose", STATE_PROJECTION_MATRIX, STATE_MATRIX_INVERSE }, - - { "gl_ModelViewProjectionMatrix", STATE_MVP_MATRIX, STATE_MATRIX_TRANSPOSE }, - { "gl_ModelViewProjectionMatrixInverse", STATE_MVP_MATRIX, STATE_MATRIX_INVTRANS }, - { "gl_ModelViewProjectionMatrixTranspose", STATE_MVP_MATRIX, 0 }, - { "gl_ModelViewProjectionMatrixInverseTranspose", STATE_MVP_MATRIX, STATE_MATRIX_INVERSE }, - - { "gl_TextureMatrix", STATE_TEXTURE_MATRIX, STATE_MATRIX_TRANSPOSE }, - { "gl_TextureMatrixInverse", STATE_TEXTURE_MATRIX, STATE_MATRIX_INVTRANS }, - { "gl_TextureMatrixTranspose", STATE_TEXTURE_MATRIX, 0 }, - { "gl_TextureMatrixInverseTranspose", STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE }, - - { "gl_NormalMatrix", STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE }, - - { NULL, 0, 0 } - }; - gl_state_index tokens[STATE_LENGTH]; - GLuint i; - GLboolean isMatrix = GL_FALSE; - - for (i = 0; i < STATE_LENGTH; i++) { - tokens[i] = 0; - } - *swizzleOut = SWIZZLE_NOOP; - - /* first, look if var is a pre-defined matrix */ - for (i = 0; matrices[i].name; i++) { - if (strcmp(var, matrices[i].name) == 0) { - tokens[0] = matrices[i].matrix; - /* tokens[1], [2] and [3] filled below */ - tokens[4] = matrices[i].modifier; - isMatrix = GL_TRUE; - break; - } - } - - if (isMatrix) { - if (tokens[0] == STATE_TEXTURE_MATRIX) { - if (index1 >= 0) { - tokens[1] = index1; /* which texture matrix */ - index1 = 0; /* prevent extra addition at end of function */ - } - } - if (index1 < 0) { - /* index1 is unused: prevent extra addition at end of function */ - index1 = 0; - } - } - else if (strcmp(var, "gl_DepthRange") == 0) { - tokens[0] = STATE_DEPTH_RANGE; - if (strcmp(field, "near") == 0) { - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "far") == 0) { - *swizzleOut = SWIZZLE_YYYY; - } - else if (strcmp(field, "diff") == 0) { - *swizzleOut = SWIZZLE_ZZZZ; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_ClipPlane") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_CLIPPLANE; - tokens[1] = index1; - } - else if (strcmp(var, "gl_Point") == 0) { - if (strcmp(field, "size") == 0) { - tokens[0] = STATE_POINT_SIZE; - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "sizeMin") == 0) { - tokens[0] = STATE_POINT_SIZE; - *swizzleOut = SWIZZLE_YYYY; - } - else if (strcmp(field, "sizeMax") == 0) { - tokens[0] = STATE_POINT_SIZE; - *swizzleOut = SWIZZLE_ZZZZ; - } - else if (strcmp(field, "fadeThresholdSize") == 0) { - tokens[0] = STATE_POINT_SIZE; - *swizzleOut = SWIZZLE_WWWW; - } - else if (strcmp(field, "distanceConstantAttenuation") == 0) { - tokens[0] = STATE_POINT_ATTENUATION; - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "distanceLinearAttenuation") == 0) { - tokens[0] = STATE_POINT_ATTENUATION; - *swizzleOut = SWIZZLE_YYYY; - } - else if (strcmp(field, "distanceQuadraticAttenuation") == 0) { - tokens[0] = STATE_POINT_ATTENUATION; - *swizzleOut = SWIZZLE_ZZZZ; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_FrontMaterial") == 0 || - strcmp(var, "gl_BackMaterial") == 0) { - tokens[0] = STATE_MATERIAL; - if (strcmp(var, "gl_FrontMaterial") == 0) - tokens[1] = 0; - else - tokens[1] = 1; - if (strcmp(field, "emission") == 0) { - tokens[2] = STATE_EMISSION; - } - else if (strcmp(field, "ambient") == 0) { - tokens[2] = STATE_AMBIENT; - } - else if (strcmp(field, "diffuse") == 0) { - tokens[2] = STATE_DIFFUSE; - } - else if (strcmp(field, "specular") == 0) { - tokens[2] = STATE_SPECULAR; - } - else if (strcmp(field, "shininess") == 0) { - tokens[2] = STATE_SHININESS; - *swizzleOut = SWIZZLE_XXXX; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_LightSource") == 0) { - if (!field || index1 < 0) - return -1; - - tokens[0] = STATE_LIGHT; - tokens[1] = index1; - - if (strcmp(field, "ambient") == 0) { - tokens[2] = STATE_AMBIENT; - } - else if (strcmp(field, "diffuse") == 0) { - tokens[2] = STATE_DIFFUSE; - } - else if (strcmp(field, "specular") == 0) { - tokens[2] = STATE_SPECULAR; - } - else if (strcmp(field, "position") == 0) { - tokens[2] = STATE_POSITION; - } - else if (strcmp(field, "halfVector") == 0) { - tokens[2] = STATE_HALF_VECTOR; - } - else if (strcmp(field, "spotDirection") == 0) { - tokens[2] = STATE_SPOT_DIRECTION; - } - else if (strcmp(field, "spotCosCutoff") == 0) { - tokens[2] = STATE_SPOT_DIRECTION; - *swizzleOut = SWIZZLE_WWWW; - } - else if (strcmp(field, "spotCutoff") == 0) { - tokens[2] = STATE_SPOT_CUTOFF; - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "spotExponent") == 0) { - tokens[2] = STATE_ATTENUATION; - *swizzleOut = SWIZZLE_WWWW; - } - else if (strcmp(field, "constantAttenuation") == 0) { - tokens[2] = STATE_ATTENUATION; - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "linearAttenuation") == 0) { - tokens[2] = STATE_ATTENUATION; - *swizzleOut = SWIZZLE_YYYY; - } - else if (strcmp(field, "quadraticAttenuation") == 0) { - tokens[2] = STATE_ATTENUATION; - *swizzleOut = SWIZZLE_ZZZZ; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_LightModel") == 0) { - if (strcmp(field, "ambient") == 0) { - tokens[0] = STATE_LIGHTMODEL_AMBIENT; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_FrontLightModelProduct") == 0) { - if (strcmp(field, "sceneColor") == 0) { - tokens[0] = STATE_LIGHTMODEL_SCENECOLOR; - tokens[1] = 0; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_BackLightModelProduct") == 0) { - if (strcmp(field, "sceneColor") == 0) { - tokens[0] = STATE_LIGHTMODEL_SCENECOLOR; - tokens[1] = 1; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_FrontLightProduct") == 0 || - strcmp(var, "gl_BackLightProduct") == 0) { - if (index1 < 0 || !field) - return -1; - - tokens[0] = STATE_LIGHTPROD; - tokens[1] = index1; /* light number */ - if (strcmp(var, "gl_FrontLightProduct") == 0) { - tokens[2] = 0; /* front */ - } - else { - tokens[2] = 1; /* back */ - } - if (strcmp(field, "ambient") == 0) { - tokens[3] = STATE_AMBIENT; - } - else if (strcmp(field, "diffuse") == 0) { - tokens[3] = STATE_DIFFUSE; - } - else if (strcmp(field, "specular") == 0) { - tokens[3] = STATE_SPECULAR; - } - else { - return -1; - } - } - else if (strcmp(var, "gl_TextureEnvColor") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXENV_COLOR; - tokens[1] = index1; - } - else if (strcmp(var, "gl_EyePlaneS") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_EYE_S; - } - else if (strcmp(var, "gl_EyePlaneT") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_EYE_T; - } - else if (strcmp(var, "gl_EyePlaneR") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_EYE_R; - } - else if (strcmp(var, "gl_EyePlaneQ") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_EYE_Q; - } - else if (strcmp(var, "gl_ObjectPlaneS") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_OBJECT_S; - } - else if (strcmp(var, "gl_ObjectPlaneT") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_OBJECT_T; - } - else if (strcmp(var, "gl_ObjectPlaneR") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_OBJECT_R; - } - else if (strcmp(var, "gl_ObjectPlaneQ") == 0) { - if (index1 < 0) - return -1; - tokens[0] = STATE_TEXGEN; - tokens[1] = index1; /* tex unit */ - tokens[2] = STATE_TEXGEN_OBJECT_Q; - } - else if (strcmp(var, "gl_Fog") == 0) { - if (strcmp(field, "color") == 0) { - tokens[0] = STATE_FOG_COLOR; - } - else if (strcmp(field, "density") == 0) { - tokens[0] = STATE_FOG_PARAMS; - *swizzleOut = SWIZZLE_XXXX; - } - else if (strcmp(field, "start") == 0) { - tokens[0] = STATE_FOG_PARAMS; - *swizzleOut = SWIZZLE_YYYY; - } - else if (strcmp(field, "end") == 0) { - tokens[0] = STATE_FOG_PARAMS; - *swizzleOut = SWIZZLE_ZZZZ; - } - else if (strcmp(field, "scale") == 0) { - tokens[0] = STATE_FOG_PARAMS; - *swizzleOut = SWIZZLE_WWWW; - } - else { - return -1; - } - } - else { - return -1; - } - - if (isMatrix) { - /* load all four columns of matrix */ - GLint pos[4]; - GLuint j; - for (j = 0; j < 4; j++) { - tokens[2] = tokens[3] = j; /* jth row of matrix */ - pos[j] = _mesa_add_state_reference(paramList, tokens); - assert(pos[j] >= 0); - ASSERT(pos[j] >= 0); - } - return pos[0] + index1; - } - else { - /* allocate a single register */ - GLint pos = _mesa_add_state_reference(paramList, tokens); - ASSERT(pos >= 0); - return pos; - } -} - - - -/** - * Given a variable name and datatype, emit uniform/constant buffer - * entries which will store that state variable. - * For example, if name="gl_LightSource" we'll emit 64 state variable - * vectors/references and return position where that data starts. This will - * allow run-time array indexing into the light source array. - * - * Note that this is a recursive function. - * - * \return -1 if error, else index of start of data in the program parameter list - */ -static GLint -emit_statevars(const char *name, int array_len, - const slang_type_specifier *type, - gl_state_index tokens[STATE_LENGTH], - struct gl_program_parameter_list *paramList) -{ - if (type->type == SLANG_SPEC_ARRAY) { - GLint i, pos; - assert(array_len > 0); - if (strcmp(name, "gl_ClipPlane") == 0) { - tokens[0] = STATE_CLIPPLANE; - } - else if (strcmp(name, "gl_LightSource") == 0) { - tokens[0] = STATE_LIGHT; - } - else if (strcmp(name, "gl_FrontLightProduct") == 0) { - tokens[0] = STATE_LIGHTPROD; - tokens[2] = 0; /* front */ - } - else if (strcmp(name, "gl_BackLightProduct") == 0) { - tokens[0] = STATE_LIGHTPROD; - tokens[2] = 1; /* back */ - } - else if (strcmp(name, "gl_TextureEnvColor") == 0) { - tokens[0] = STATE_TEXENV_COLOR; - } - else if (strcmp(name, "gl_EyePlaneS") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_EYE_S; - } - else if (strcmp(name, "gl_EyePlaneT") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_EYE_T; - } - else if (strcmp(name, "gl_EyePlaneR") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_EYE_R; - } - else if (strcmp(name, "gl_EyePlaneQ") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_EYE_Q; - } - else if (strcmp(name, "gl_ObjectPlaneS") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_OBJECT_S; - } - else if (strcmp(name, "gl_ObjectPlaneT") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_OBJECT_T; - } - else if (strcmp(name, "gl_ObjectPlaneR") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_OBJECT_R; - } - else if (strcmp(name, "gl_ObjectPlaneQ") == 0) { - tokens[0] = STATE_TEXGEN; - tokens[2] = STATE_TEXGEN_OBJECT_Q; - } - else { - return -1; /* invalid array name */ - } - for (i = 0; i < array_len; i++) { - GLint p; - tokens[1] = i; - p = emit_statevars(NULL, 0, type->_array, tokens, paramList); - if (i == 0) - pos = p; - } - return pos; - } - else if (type->type == SLANG_SPEC_STRUCT) { - const slang_variable_scope *fields = type->_struct->fields; - GLuint i, pos; - for (i = 0; i < fields->num_variables; i++) { - const slang_variable *var = fields->variables[i]; - GLint p = emit_statevars(var->a_name, 0, &var->type.specifier, - tokens, paramList); - if (i == 0) - pos = p; - } - return pos; - } - else { - GLint pos; - assert(type->type == SLANG_SPEC_VEC4 || - type->type == SLANG_SPEC_VEC3 || - type->type == SLANG_SPEC_VEC2 || - type->type == SLANG_SPEC_FLOAT || - type->type == SLANG_SPEC_IVEC4 || - type->type == SLANG_SPEC_IVEC3 || - type->type == SLANG_SPEC_IVEC2 || - type->type == SLANG_SPEC_INT); - if (name) { - GLint t; - - if (tokens[0] == STATE_LIGHT) - t = 2; - else if (tokens[0] == STATE_LIGHTPROD) - t = 3; - else - return -1; /* invalid array name */ - - if (strcmp(name, "ambient") == 0) { - tokens[t] = STATE_AMBIENT; - } - else if (strcmp(name, "diffuse") == 0) { - tokens[t] = STATE_DIFFUSE; - } - else if (strcmp(name, "specular") == 0) { - tokens[t] = STATE_SPECULAR; - } - else if (strcmp(name, "position") == 0) { - tokens[t] = STATE_POSITION; - } - else if (strcmp(name, "halfVector") == 0) { - tokens[t] = STATE_HALF_VECTOR; - } - else if (strcmp(name, "spotDirection") == 0) { - tokens[t] = STATE_SPOT_DIRECTION; /* xyz components */ - } - else if (strcmp(name, "spotCosCutoff") == 0) { - tokens[t] = STATE_SPOT_DIRECTION; /* w component */ - } - - else if (strcmp(name, "constantAttenuation") == 0) { - tokens[t] = STATE_ATTENUATION; /* x component */ - } - else if (strcmp(name, "linearAttenuation") == 0) { - tokens[t] = STATE_ATTENUATION; /* y component */ - } - else if (strcmp(name, "quadraticAttenuation") == 0) { - tokens[t] = STATE_ATTENUATION; /* z component */ - } - else if (strcmp(name, "spotExponent") == 0) { - tokens[t] = STATE_ATTENUATION; /* w = spot exponent */ - } - - else if (strcmp(name, "spotCutoff") == 0) { - tokens[t] = STATE_SPOT_CUTOFF; /* x component */ - } - - else { - return -1; /* invalid field name */ - } - } - - pos = _mesa_add_state_reference(paramList, tokens); - return pos; - } - - return 1; -} - - -/** - * Unroll the named built-in uniform variable into a sequence of state - * vars in the given parameter list. - */ -static GLint -alloc_state_var_array(const slang_variable *var, - struct gl_program_parameter_list *paramList) -{ - gl_state_index tokens[STATE_LENGTH]; - GLuint i; - GLint pos; - - /* Initialize the state tokens array. This is very important. - * When we call _mesa_add_state_reference() it'll searches the parameter - * list to see if the given statevar token sequence is already present. - * This is normally a good thing since it prevents redundant values in the - * constant buffer. - * - * But when we're building arrays of state this can be bad. For example, - * consider this fragment of GLSL code: - * foo = gl_LightSource[3].diffuse; - * ... - * bar = gl_LightSource[i].diffuse; - * - * When we unroll the gl_LightSource array (for "bar") we want to re-emit - * gl_LightSource[3].diffuse and not re-use the first instance (from "foo") - * since that would upset the array layout. We handle this situation by - * setting the last token in the state var token array to the special - * value STATE_ARRAY. - * This token will only be set for array state. We can hijack the last - * element in the array for this since it's never used for light, clipplane - * or texture env array state. - */ - for (i = 0; i < STATE_LENGTH; i++) - tokens[i] = 0; - tokens[STATE_LENGTH - 1] = STATE_ARRAY; - - pos = emit_statevars(var->a_name, var->array_len, &var->type.specifier, - tokens, paramList); - - return pos; -} - - - -/** - * Allocate storage for a pre-defined uniform (a GL state variable). - * As a memory-saving optimization, we try to only allocate storage for - * state vars that are actually used. - * - * Arrays such as gl_LightSource are handled specially. For an expression - * like "gl_LightSource[2].diffuse", we can allocate a single uniform/constant - * slot and return the index. In this case, we return direct=TRUE. - * - * Buf for something like "gl_LightSource[i].diffuse" we don't know the value - * of 'i' at compile time so we need to "unroll" the gl_LightSource array - * into a consecutive sequence of uniform/constant slots so it can be indexed - * at runtime. In this case, we return direct=FALSE. - * - * Currently, all pre-defined uniforms are in one of these forms: - * var - * var[i] - * var.field - * var[i].field - * var[i][j] - * - * \return -1 upon error, else position in paramList of the state variable/data - */ -GLint -_slang_alloc_statevar(slang_ir_node *n, - struct gl_program_parameter_list *paramList, - GLboolean *direct) -{ - slang_ir_node *n0 = n; - const char *field = NULL; - GLint index1 = -1, index2 = -1; - GLuint swizzle; - - *direct = GL_TRUE; - - if (n->Opcode == IR_FIELD) { - field = n->Field; - n = n->Children[0]; - } - - if (n->Opcode == IR_ELEMENT) { - if (n->Children[1]->Opcode == IR_FLOAT) { - index1 = (GLint) n->Children[1]->Value[0]; - } - else { - *direct = GL_FALSE; - } - n = n->Children[0]; - } - - if (n->Opcode == IR_ELEMENT) { - /* XXX can only handle constant indexes for now */ - if (n->Children[1]->Opcode == IR_FLOAT) { - index2 = (GLint) n->Children[1]->Value[0]; - } - else { - *direct = GL_FALSE; - } - n = n->Children[0]; - } - - assert(n->Opcode == IR_VAR); - - if (*direct) { - const char *var = (const char *) n->Var->a_name; - GLint pos = - lookup_statevar(var, index1, index2, field, &swizzle, paramList); - if (pos >= 0) { - /* newly resolved storage for the statevar/constant/uniform */ - n0->Store->File = PROGRAM_STATE_VAR; - n0->Store->Index = pos; - n0->Store->Swizzle = swizzle; - n0->Store->Parent = NULL; - return pos; - } - } - - *direct = GL_FALSE; - return alloc_state_var_array(n->Var, paramList); -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_builtin.h b/src/libs/mesa/mesa/shader/slang/slang_builtin.h deleted file mode 100644 index 7f6fe80fcc..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_builtin.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SLANG_BUILTIN_H -#define SLANG_BUILTIN_H - -#include "shader/prog_parameter.h" -#include "slang_utility.h" -#include "slang_ir.h" - - -extern GLint -_slang_alloc_statevar(slang_ir_node *n, - struct gl_program_parameter_list *paramList, - GLboolean *direct); - - -#endif /* SLANG_BUILTIN_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_codegen.c b/src/libs/mesa/mesa/shader/slang/slang_codegen.c deleted file mode 100644 index ac706325b8..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_codegen.c +++ /dev/null @@ -1,4629 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file slang_codegen.c - * Generate IR tree from AST. - * \author Brian Paul - */ - - -/*** - *** NOTES: - *** The new_() functions return a new instance of a simple IR node. - *** The gen_() functions generate larger IR trees from the simple nodes. - ***/ - - - -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" -#include "slang_typeinfo.h" -#include "slang_codegen.h" -#include "slang_compile.h" -#include "slang_label.h" -#include "slang_mem.h" -#include "slang_simplify.h" -#include "slang_emit.h" -#include "slang_vartable.h" -#include "slang_ir.h" -#include "slang_print.h" - - -/** Max iterations to unroll */ -const GLuint MAX_FOR_LOOP_UNROLL_ITERATIONS = 32; - -/** Max for-loop body size (in slang operations) to unroll */ -const GLuint MAX_FOR_LOOP_UNROLL_BODY_SIZE = 50; - -/** Max for-loop body complexity to unroll. - * We'll compute complexity as the product of the number of iterations - * and the size of the body. So long-ish loops with very simple bodies - * can be unrolled, as well as short loops with larger bodies. - */ -const GLuint MAX_FOR_LOOP_UNROLL_COMPLEXITY = 256; - - - -static slang_ir_node * -_slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper); - - -/** - * Retrieves type information about an operation. - * Returns GL_TRUE on success. - * Returns GL_FALSE otherwise. - */ -static GLboolean -typeof_operation(const struct slang_assemble_ctx_ *A, - slang_operation *op, - slang_typeinfo *ti) -{ - return _slang_typeof_operation(op, &A->space, ti, A->atoms, A->log); -} - - -static GLboolean -is_sampler_type(const slang_fully_specified_type *t) -{ - switch (t->specifier.type) { - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Return the offset (in floats or ints) of the named field within - * the given struct. Return -1 if field not found. - * If field is NULL, return the size of the struct instead. - */ -static GLint -_slang_field_offset(const slang_type_specifier *spec, slang_atom field) -{ - GLint offset = 0; - GLuint i; - for (i = 0; i < spec->_struct->fields->num_variables; i++) { - const slang_variable *v = spec->_struct->fields->variables[i]; - const GLuint sz = _slang_sizeof_type_specifier(&v->type.specifier); - if (sz > 1) { - /* types larger than 1 float are register (4-float) aligned */ - offset = (offset + 3) & ~3; - } - if (field && v->a_name == field) { - return offset; - } - offset += sz; - } - if (field) - return -1; /* field not found */ - else - return offset; /* struct size */ -} - - -/** - * Return the size (in floats) of the given type specifier. - * If the size is greater than 4, the size should be a multiple of 4 - * so that the correct number of 4-float registers are allocated. - * For example, a mat3x2 is size 12 because we want to store the - * 3 columns in 3 float[4] registers. - */ -GLuint -_slang_sizeof_type_specifier(const slang_type_specifier *spec) -{ - GLuint sz; - switch (spec->type) { - case SLANG_SPEC_VOID: - sz = 0; - break; - case SLANG_SPEC_BOOL: - sz = 1; - break; - case SLANG_SPEC_BVEC2: - sz = 2; - break; - case SLANG_SPEC_BVEC3: - sz = 3; - break; - case SLANG_SPEC_BVEC4: - sz = 4; - break; - case SLANG_SPEC_INT: - sz = 1; - break; - case SLANG_SPEC_IVEC2: - sz = 2; - break; - case SLANG_SPEC_IVEC3: - sz = 3; - break; - case SLANG_SPEC_IVEC4: - sz = 4; - break; - case SLANG_SPEC_FLOAT: - sz = 1; - break; - case SLANG_SPEC_VEC2: - sz = 2; - break; - case SLANG_SPEC_VEC3: - sz = 3; - break; - case SLANG_SPEC_VEC4: - sz = 4; - break; - case SLANG_SPEC_MAT2: - sz = 2 * 4; /* 2 columns (regs) */ - break; - case SLANG_SPEC_MAT3: - sz = 3 * 4; - break; - case SLANG_SPEC_MAT4: - sz = 4 * 4; - break; - case SLANG_SPEC_MAT23: - sz = 2 * 4; /* 2 columns (regs) */ - break; - case SLANG_SPEC_MAT32: - sz = 3 * 4; /* 3 columns (regs) */ - break; - case SLANG_SPEC_MAT24: - sz = 2 * 4; - break; - case SLANG_SPEC_MAT42: - sz = 4 * 4; /* 4 columns (regs) */ - break; - case SLANG_SPEC_MAT34: - sz = 3 * 4; - break; - case SLANG_SPEC_MAT43: - sz = 4 * 4; /* 4 columns (regs) */ - break; - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - sz = 1; /* a sampler is basically just an integer index */ - break; - case SLANG_SPEC_STRUCT: - sz = _slang_field_offset(spec, 0); /* special use */ - if (sz == 1) { - /* 1-float structs are actually troublesome to deal with since they - * might get placed at R.x, R.y, R.z or R.z. Return size=2 to - * ensure the object is placed at R.x - */ - sz = 2; - } - else if (sz > 4) { - sz = (sz + 3) & ~0x3; /* round up to multiple of four */ - } - break; - case SLANG_SPEC_ARRAY: - sz = _slang_sizeof_type_specifier(spec->_array); - break; - default: - _mesa_problem(NULL, "Unexpected type in _slang_sizeof_type_specifier()"); - sz = 0; - } - - if (sz > 4) { - /* if size is > 4, it should be a multiple of four */ - assert((sz & 0x3) == 0); - } - return sz; -} - - -/** - * Query variable/array length (number of elements). - * This is slightly non-trivial because there are two ways to express - * arrays: "float x[3]" vs. "float[3] x". - * \return the length of the array for the given variable, or 0 if not an array - */ -static GLint -_slang_array_length(const slang_variable *var) -{ - if (var->type.array_len > 0) { - /* Ex: float[4] x; */ - return var->type.array_len; - } - if (var->array_len > 0) { - /* Ex: float x[4]; */ - return var->array_len; - } - return 0; -} - - -/** - * Compute total size of array give size of element, number of elements. - * \return size in floats - */ -static GLint -_slang_array_size(GLint elemSize, GLint arrayLen) -{ - GLint total; - assert(elemSize > 0); - if (arrayLen > 1) { - /* round up base type to multiple of 4 */ - total = ((elemSize + 3) & ~0x3) * MAX2(arrayLen, 1); - } - else { - total = elemSize; - } - return total; -} - - - -/** - * Establish the binding between a slang_ir_node and a slang_variable. - * Then, allocate/attach a slang_ir_storage object to the IR node if needed. - * The IR node must be a IR_VAR or IR_VAR_DECL node. - * \param n the IR node - * \param var the variable to associate with the IR node - */ -static void -_slang_attach_storage(slang_ir_node *n, slang_variable *var) -{ - assert(n); - assert(var); - assert(n->Opcode == IR_VAR || n->Opcode == IR_VAR_DECL); - assert(!n->Var || n->Var == var); - - n->Var = var; - - if (!n->Store) { - /* need to setup storage */ - if (n->Var && n->Var->store) { - /* node storage info = var storage info */ - n->Store = n->Var->store; - } - else { - /* alloc new storage info */ - n->Store = _slang_new_ir_storage(PROGRAM_UNDEFINED, -7, -5); -#if 0 - printf("%s var=%s Store=%p Size=%d\n", __FUNCTION__, - (char*) var->a_name, - (void*) n->Store, n->Store->Size); -#endif - if (n->Var) - n->Var->store = n->Store; - assert(n->Var->store); - } - } -} - - -/** - * Return the TEXTURE_*_INDEX value that corresponds to a sampler type, - * or -1 if the type is not a sampler. - */ -static GLint -sampler_to_texture_index(const slang_type_specifier_type type) -{ - switch (type) { - case SLANG_SPEC_SAMPLER1D: - return TEXTURE_1D_INDEX; - case SLANG_SPEC_SAMPLER2D: - return TEXTURE_2D_INDEX; - case SLANG_SPEC_SAMPLER3D: - return TEXTURE_3D_INDEX; - case SLANG_SPEC_SAMPLERCUBE: - return TEXTURE_CUBE_INDEX; - case SLANG_SPEC_SAMPLER1DSHADOW: - return TEXTURE_1D_INDEX; /* XXX fix */ - case SLANG_SPEC_SAMPLER2DSHADOW: - return TEXTURE_2D_INDEX; /* XXX fix */ - case SLANG_SPEC_SAMPLER2DRECT: - return TEXTURE_RECT_INDEX; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return TEXTURE_RECT_INDEX; /* XXX fix */ - default: - return -1; - } -} - - -#define SWIZZLE_ZWWW MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W) - -/** - * Return the VERT_ATTRIB_* or FRAG_ATTRIB_* value that corresponds to - * a vertex or fragment program input variable. Return -1 if the input - * name is invalid. - * XXX return size too - */ -static GLint -_slang_input_index(const char *name, GLenum target, GLuint *swizzleOut) -{ - struct input_info { - const char *Name; - GLuint Attrib; - GLuint Swizzle; - }; - static const struct input_info vertInputs[] = { - { "gl_Vertex", VERT_ATTRIB_POS, SWIZZLE_NOOP }, - { "gl_Normal", VERT_ATTRIB_NORMAL, SWIZZLE_NOOP }, - { "gl_Color", VERT_ATTRIB_COLOR0, SWIZZLE_NOOP }, - { "gl_SecondaryColor", VERT_ATTRIB_COLOR1, SWIZZLE_NOOP }, - { "gl_FogCoord", VERT_ATTRIB_FOG, SWIZZLE_XXXX }, - { "gl_MultiTexCoord0", VERT_ATTRIB_TEX0, SWIZZLE_NOOP }, - { "gl_MultiTexCoord1", VERT_ATTRIB_TEX1, SWIZZLE_NOOP }, - { "gl_MultiTexCoord2", VERT_ATTRIB_TEX2, SWIZZLE_NOOP }, - { "gl_MultiTexCoord3", VERT_ATTRIB_TEX3, SWIZZLE_NOOP }, - { "gl_MultiTexCoord4", VERT_ATTRIB_TEX4, SWIZZLE_NOOP }, - { "gl_MultiTexCoord5", VERT_ATTRIB_TEX5, SWIZZLE_NOOP }, - { "gl_MultiTexCoord6", VERT_ATTRIB_TEX6, SWIZZLE_NOOP }, - { "gl_MultiTexCoord7", VERT_ATTRIB_TEX7, SWIZZLE_NOOP }, - { NULL, 0, SWIZZLE_NOOP } - }; - static const struct input_info fragInputs[] = { - { "gl_FragCoord", FRAG_ATTRIB_WPOS, SWIZZLE_NOOP }, - { "gl_Color", FRAG_ATTRIB_COL0, SWIZZLE_NOOP }, - { "gl_SecondaryColor", FRAG_ATTRIB_COL1, SWIZZLE_NOOP }, - { "gl_TexCoord", FRAG_ATTRIB_TEX0, SWIZZLE_NOOP }, - /* note: we're packing several quantities into the fogcoord vector */ - { "gl_FogFragCoord", FRAG_ATTRIB_FOGC, SWIZZLE_XXXX }, - { "gl_FrontFacing", FRAG_ATTRIB_FOGC, SWIZZLE_YYYY }, /*XXX*/ - { "gl_PointCoord", FRAG_ATTRIB_FOGC, SWIZZLE_ZWWW }, - { NULL, 0, SWIZZLE_NOOP } - }; - GLuint i; - const struct input_info *inputs - = (target == GL_VERTEX_PROGRAM_ARB) ? vertInputs : fragInputs; - - ASSERT(MAX_TEXTURE_COORD_UNITS == 8); /* if this fails, fix vertInputs above */ - - for (i = 0; inputs[i].Name; i++) { - if (strcmp(inputs[i].Name, name) == 0) { - /* found */ - *swizzleOut = inputs[i].Swizzle; - return inputs[i].Attrib; - } - } - return -1; -} - - -/** - * Return the VERT_RESULT_* or FRAG_RESULT_* value that corresponds to - * a vertex or fragment program output variable. Return -1 for an invalid - * output name. - */ -static GLint -_slang_output_index(const char *name, GLenum target) -{ - struct output_info { - const char *Name; - GLuint Attrib; - }; - static const struct output_info vertOutputs[] = { - { "gl_Position", VERT_RESULT_HPOS }, - { "gl_FrontColor", VERT_RESULT_COL0 }, - { "gl_BackColor", VERT_RESULT_BFC0 }, - { "gl_FrontSecondaryColor", VERT_RESULT_COL1 }, - { "gl_BackSecondaryColor", VERT_RESULT_BFC1 }, - { "gl_TexCoord", VERT_RESULT_TEX0 }, - { "gl_FogFragCoord", VERT_RESULT_FOGC }, - { "gl_PointSize", VERT_RESULT_PSIZ }, - { NULL, 0 } - }; - static const struct output_info fragOutputs[] = { - { "gl_FragColor", FRAG_RESULT_COLR }, - { "gl_FragDepth", FRAG_RESULT_DEPR }, - { "gl_FragData", FRAG_RESULT_DATA0 }, - { NULL, 0 } - }; - GLuint i; - const struct output_info *outputs - = (target == GL_VERTEX_PROGRAM_ARB) ? vertOutputs : fragOutputs; - - for (i = 0; outputs[i].Name; i++) { - if (strcmp(outputs[i].Name, name) == 0) { - /* found */ - return outputs[i].Attrib; - } - } - return -1; -} - - - -/**********************************************************************/ - - -/** - * Map "_asm foo" to IR_FOO, etc. - */ -typedef struct -{ - const char *Name; - slang_ir_opcode Opcode; - GLuint HaveRetValue, NumParams; -} slang_asm_info; - - -static slang_asm_info AsmInfo[] = { - /* vec4 binary op */ - { "vec4_add", IR_ADD, 1, 2 }, - { "vec4_subtract", IR_SUB, 1, 2 }, - { "vec4_multiply", IR_MUL, 1, 2 }, - { "vec4_dot", IR_DOT4, 1, 2 }, - { "vec3_dot", IR_DOT3, 1, 2 }, - { "vec2_dot", IR_DOT2, 1, 2 }, - { "vec3_nrm", IR_NRM3, 1, 1 }, - { "vec4_nrm", IR_NRM4, 1, 1 }, - { "vec3_cross", IR_CROSS, 1, 2 }, - { "vec4_lrp", IR_LRP, 1, 3 }, - { "vec4_min", IR_MIN, 1, 2 }, - { "vec4_max", IR_MAX, 1, 2 }, - { "vec4_clamp", IR_CLAMP, 1, 3 }, - { "vec4_seq", IR_SEQUAL, 1, 2 }, - { "vec4_sne", IR_SNEQUAL, 1, 2 }, - { "vec4_sge", IR_SGE, 1, 2 }, - { "vec4_sgt", IR_SGT, 1, 2 }, - { "vec4_sle", IR_SLE, 1, 2 }, - { "vec4_slt", IR_SLT, 1, 2 }, - /* vec4 unary */ - { "vec4_move", IR_MOVE, 1, 1 }, - { "vec4_floor", IR_FLOOR, 1, 1 }, - { "vec4_frac", IR_FRAC, 1, 1 }, - { "vec4_abs", IR_ABS, 1, 1 }, - { "vec4_negate", IR_NEG, 1, 1 }, - { "vec4_ddx", IR_DDX, 1, 1 }, - { "vec4_ddy", IR_DDY, 1, 1 }, - /* float binary op */ - { "float_power", IR_POW, 1, 2 }, - /* texture / sampler */ - { "vec4_tex1d", IR_TEX, 1, 2 }, - { "vec4_texb1d", IR_TEXB, 1, 2 }, /* 1d w/ bias */ - { "vec4_texp1d", IR_TEXP, 1, 2 }, /* 1d w/ projection */ - { "vec4_tex2d", IR_TEX, 1, 2 }, - { "vec4_texb2d", IR_TEXB, 1, 2 }, /* 2d w/ bias */ - { "vec4_texp2d", IR_TEXP, 1, 2 }, /* 2d w/ projection */ - { "vec4_tex3d", IR_TEX, 1, 2 }, - { "vec4_texb3d", IR_TEXB, 1, 2 }, /* 3d w/ bias */ - { "vec4_texp3d", IR_TEXP, 1, 2 }, /* 3d w/ projection */ - { "vec4_texcube", IR_TEX, 1, 2 }, /* cubemap */ - { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ - { "vec4_texp_rect", IR_TEXP, 1, 2 },/* rectangle w/ projection */ - - /* unary op */ - { "ivec4_to_vec4", IR_I_TO_F, 1, 1 }, /* int[4] to float[4] */ - { "vec4_to_ivec4", IR_F_TO_I, 1, 1 }, /* float[4] to int[4] */ - { "float_exp", IR_EXP, 1, 1 }, - { "float_exp2", IR_EXP2, 1, 1 }, - { "float_log2", IR_LOG2, 1, 1 }, - { "float_rsq", IR_RSQ, 1, 1 }, - { "float_rcp", IR_RCP, 1, 1 }, - { "float_sine", IR_SIN, 1, 1 }, - { "float_cosine", IR_COS, 1, 1 }, - { "float_noise1", IR_NOISE1, 1, 1}, - { "float_noise2", IR_NOISE2, 1, 1}, - { "float_noise3", IR_NOISE3, 1, 1}, - { "float_noise4", IR_NOISE4, 1, 1}, - - { NULL, IR_NOP, 0, 0 } -}; - - -static slang_ir_node * -new_node3(slang_ir_opcode op, - slang_ir_node *c0, slang_ir_node *c1, slang_ir_node *c2) -{ - slang_ir_node *n = (slang_ir_node *) _slang_alloc(sizeof(slang_ir_node)); - if (n) { - n->Opcode = op; - n->Children[0] = c0; - n->Children[1] = c1; - n->Children[2] = c2; - n->InstLocation = -1; - } - return n; -} - -static slang_ir_node * -new_node2(slang_ir_opcode op, slang_ir_node *c0, slang_ir_node *c1) -{ - return new_node3(op, c0, c1, NULL); -} - -static slang_ir_node * -new_node1(slang_ir_opcode op, slang_ir_node *c0) -{ - return new_node3(op, c0, NULL, NULL); -} - -static slang_ir_node * -new_node0(slang_ir_opcode op) -{ - return new_node3(op, NULL, NULL, NULL); -} - - -/** - * Create sequence of two nodes. - */ -static slang_ir_node * -new_seq(slang_ir_node *left, slang_ir_node *right) -{ - if (!left) - return right; - if (!right) - return left; - return new_node2(IR_SEQ, left, right); -} - -static slang_ir_node * -new_label(slang_label *label) -{ - slang_ir_node *n = new_node0(IR_LABEL); - assert(label); - if (n) - n->Label = label; - return n; -} - -static slang_ir_node * -new_float_literal(const float v[4], GLuint size) -{ - slang_ir_node *n = new_node0(IR_FLOAT); - assert(size <= 4); - COPY_4V(n->Value, v); - /* allocate a storage object, but compute actual location (Index) later */ - n->Store = _slang_new_ir_storage(PROGRAM_CONSTANT, -1, size); - return n; -} - - -static slang_ir_node * -new_not(slang_ir_node *n) -{ - return new_node1(IR_NOT, n); -} - - -/** - * Non-inlined function call. - */ -static slang_ir_node * -new_function_call(slang_ir_node *code, slang_label *name) -{ - slang_ir_node *n = new_node1(IR_CALL, code); - assert(name); - if (n) - n->Label = name; - return n; -} - - -/** - * Unconditional jump. - */ -static slang_ir_node * -new_return(slang_label *dest) -{ - slang_ir_node *n = new_node0(IR_RETURN); - assert(dest); - if (n) - n->Label = dest; - return n; -} - - -static slang_ir_node * -new_loop(slang_ir_node *body) -{ - return new_node1(IR_LOOP, body); -} - - -static slang_ir_node * -new_break(slang_ir_node *loopNode) -{ - slang_ir_node *n = new_node0(IR_BREAK); - assert(loopNode); - assert(loopNode->Opcode == IR_LOOP); - if (n) { - /* insert this node at head of linked list */ - n->List = loopNode->List; - loopNode->List = n; - } - return n; -} - - -/** - * Make new IR_BREAK_IF_TRUE. - */ -static slang_ir_node * -new_break_if_true(slang_ir_node *loopNode, slang_ir_node *cond) -{ - slang_ir_node *n; - assert(loopNode); - assert(loopNode->Opcode == IR_LOOP); - n = new_node1(IR_BREAK_IF_TRUE, cond); - if (n) { - /* insert this node at head of linked list */ - n->List = loopNode->List; - loopNode->List = n; - } - return n; -} - - -/** - * Make new IR_CONT_IF_TRUE node. - */ -static slang_ir_node * -new_cont_if_true(slang_ir_node *loopNode, slang_ir_node *cond) -{ - slang_ir_node *n; - assert(loopNode); - assert(loopNode->Opcode == IR_LOOP); - n = new_node1(IR_CONT_IF_TRUE, cond); - if (n) { - /* insert this node at head of linked list */ - n->List = loopNode->List; - loopNode->List = n; - } - return n; -} - - -static slang_ir_node * -new_cond(slang_ir_node *n) -{ - slang_ir_node *c = new_node1(IR_COND, n); - return c; -} - - -static slang_ir_node * -new_if(slang_ir_node *cond, slang_ir_node *ifPart, slang_ir_node *elsePart) -{ - return new_node3(IR_IF, cond, ifPart, elsePart); -} - - -/** - * New IR_VAR node - a reference to a previously declared variable. - */ -static slang_ir_node * -new_var(slang_assemble_ctx *A, slang_variable *var) -{ - slang_ir_node *n = new_node0(IR_VAR); - if (n) { - _slang_attach_storage(n, var); - } - return n; -} - - -/** - * Check if the given function is really just a wrapper for a - * basic assembly instruction. - */ -static GLboolean -slang_is_asm_function(const slang_function *fun) -{ - if (fun->body->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE && - fun->body->num_children == 1 && - fun->body->children[0].type == SLANG_OPER_ASM) { - return GL_TRUE; - } - return GL_FALSE; -} - - -static GLboolean -_slang_is_noop(const slang_operation *oper) -{ - if (!oper || - oper->type == SLANG_OPER_VOID || - (oper->num_children == 1 && oper->children[0].type == SLANG_OPER_VOID)) - return GL_TRUE; - else - return GL_FALSE; -} - - -/** - * Recursively search tree for a node of the given type. - */ -static slang_operation * -_slang_find_node_type(slang_operation *oper, slang_operation_type type) -{ - GLuint i; - if (oper->type == type) - return oper; - for (i = 0; i < oper->num_children; i++) { - slang_operation *p = _slang_find_node_type(&oper->children[i], type); - if (p) - return p; - } - return NULL; -} - - -/** - * Count the number of operations of the given time rooted at 'oper'. - */ -static GLuint -_slang_count_node_type(slang_operation *oper, slang_operation_type type) -{ - GLuint i, count = 0; - if (oper->type == type) { - return 1; - } - for (i = 0; i < oper->num_children; i++) { - count += _slang_count_node_type(&oper->children[i], type); - } - return count; -} - - -/** - * Check if the 'return' statement found under 'oper' is a "tail return" - * that can be no-op'd. For example: - * - * void func(void) - * { - * .. do something .. - * return; // this is a no-op - * } - * - * This is used when determining if a function can be inlined. If the - * 'return' is not the last statement, we can't inline the function since - * we still need the semantic behaviour of the 'return' but we don't want - * to accidentally return from the _calling_ function. We'd need to use an - * unconditional branch, but we don't have such a GPU instruction (not - * always, at least). - */ -static GLboolean -_slang_is_tail_return(const slang_operation *oper) -{ - GLuint k = oper->num_children; - - while (k > 0) { - const slang_operation *last = &oper->children[k - 1]; - if (last->type == SLANG_OPER_RETURN) - return GL_TRUE; - else if (last->type == SLANG_OPER_IDENTIFIER || - last->type == SLANG_OPER_LABEL) - k--; /* try prev child */ - else if (last->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE || - last->type == SLANG_OPER_BLOCK_NEW_SCOPE) - /* try sub-children */ - return _slang_is_tail_return(last); - else - break; - } - - return GL_FALSE; -} - - -static void -slang_resolve_variable(slang_operation *oper) -{ - if (oper->type == SLANG_OPER_IDENTIFIER && !oper->var) { - oper->var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE); - } -} - - -/** - * Replace particular variables (SLANG_OPER_IDENTIFIER) with new expressions. - */ -static void -slang_substitute(slang_assemble_ctx *A, slang_operation *oper, - GLuint substCount, slang_variable **substOld, - slang_operation **substNew, GLboolean isLHS) -{ - switch (oper->type) { - case SLANG_OPER_VARIABLE_DECL: - { - slang_variable *v = _slang_variable_locate(oper->locals, - oper->a_id, GL_TRUE); - assert(v); - if (v->initializer && oper->num_children == 0) { - /* set child of oper to copy of initializer */ - oper->num_children = 1; - oper->children = slang_operation_new(1); - slang_operation_copy(&oper->children[0], v->initializer); - } - if (oper->num_children == 1) { - /* the initializer */ - slang_substitute(A, &oper->children[0], substCount, - substOld, substNew, GL_FALSE); - } - } - break; - case SLANG_OPER_IDENTIFIER: - assert(oper->num_children == 0); - if (1/**!isLHS XXX FIX */) { - slang_atom id = oper->a_id; - slang_variable *v; - GLuint i; - v = _slang_variable_locate(oper->locals, id, GL_TRUE); - if (!v) { - _mesa_problem(NULL, "var %s not found!\n", (char *) oper->a_id); - return; - } - - /* look for a substitution */ - for (i = 0; i < substCount; i++) { - if (v == substOld[i]) { - /* OK, replace this SLANG_OPER_IDENTIFIER with a new expr */ -#if 0 /* DEBUG only */ - if (substNew[i]->type == SLANG_OPER_IDENTIFIER) { - assert(substNew[i]->var); - assert(substNew[i]->var->a_name); - printf("Substitute %s with %s in id node %p\n", - (char*)v->a_name, (char*) substNew[i]->var->a_name, - (void*) oper); - } - else { - printf("Substitute %s with %f in id node %p\n", - (char*)v->a_name, substNew[i]->literal[0], - (void*) oper); - } -#endif - slang_operation_copy(oper, substNew[i]); - break; - } - } - } - break; - - case SLANG_OPER_RETURN: - /* do return replacement here too */ - assert(oper->num_children == 0 || oper->num_children == 1); - if (oper->num_children == 1 && !_slang_is_noop(&oper->children[0])) { - /* replace: - * return expr; - * with: - * __retVal = expr; - * return; - * then do substitutions on the assignment. - */ - slang_operation *blockOper, *assignOper, *returnOper; - - /* check if function actually has a return type */ - assert(A->CurFunction); - if (A->CurFunction->header.type.specifier.type == SLANG_SPEC_VOID) { - slang_info_log_error(A->log, "illegal return expression"); - return; - } - - blockOper = slang_operation_new(1); - blockOper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE; - blockOper->num_children = 2; - blockOper->locals->outer_scope = oper->locals->outer_scope; - blockOper->children = slang_operation_new(2); - assignOper = blockOper->children + 0; - returnOper = blockOper->children + 1; - - assignOper->type = SLANG_OPER_ASSIGN; - assignOper->num_children = 2; - assignOper->locals->outer_scope = blockOper->locals; - assignOper->children = slang_operation_new(2); - assignOper->children[0].type = SLANG_OPER_IDENTIFIER; - assignOper->children[0].a_id = slang_atom_pool_atom(A->atoms, "__retVal"); - assignOper->children[0].locals->outer_scope = assignOper->locals; - - slang_operation_copy(&assignOper->children[1], - &oper->children[0]); - - returnOper->type = SLANG_OPER_RETURN; /* return w/ no value */ - assert(returnOper->num_children == 0); - - /* do substitutions on the "__retVal = expr" sub-tree */ - slang_substitute(A, assignOper, - substCount, substOld, substNew, GL_FALSE); - - /* install new code */ - slang_operation_copy(oper, blockOper); - slang_operation_destruct(blockOper); - } - else { - /* check if return value was expected */ - assert(A->CurFunction); - if (A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) { - slang_info_log_error(A->log, "return statement requires an expression"); - return; - } - } - break; - - case SLANG_OPER_ASSIGN: - case SLANG_OPER_SUBSCRIPT: - /* special case: - * child[0] can't have substitutions but child[1] can. - */ - slang_substitute(A, &oper->children[0], - substCount, substOld, substNew, GL_TRUE); - slang_substitute(A, &oper->children[1], - substCount, substOld, substNew, GL_FALSE); - break; - case SLANG_OPER_FIELD: - /* XXX NEW - test */ - slang_substitute(A, &oper->children[0], - substCount, substOld, substNew, GL_TRUE); - break; - default: - { - GLuint i; - for (i = 0; i < oper->num_children; i++) - slang_substitute(A, &oper->children[i], - substCount, substOld, substNew, GL_FALSE); - } - } -} - - -/** - * Produce inline code for a call to an assembly instruction. - * This is typically used to compile a call to a built-in function like this: - * - * vec4 mix(const vec4 x, const vec4 y, const vec4 a) - * { - * __asm vec4_lrp __retVal, a, y, x; - * } - * - * - * A call to - * r = mix(p1, p2, p3); - * - * Becomes: - * - * mov - * / \ - * r vec4_lrp - * / | \ - * p3 p2 p1 - * - * We basically translate a SLANG_OPER_CALL into a SLANG_OPER_ASM. - */ -static slang_operation * -slang_inline_asm_function(slang_assemble_ctx *A, - slang_function *fun, slang_operation *oper) -{ - const GLuint numArgs = oper->num_children; - GLuint i; - slang_operation *inlined; - const GLboolean haveRetValue = _slang_function_has_return_value(fun); - slang_variable **substOld; - slang_operation **substNew; - - ASSERT(slang_is_asm_function(fun)); - ASSERT(fun->param_count == numArgs + haveRetValue); - - /* - printf("Inline %s as %s\n", - (char*) fun->header.a_name, - (char*) fun->body->children[0].a_id); - */ - - /* - * We'll substitute formal params with actual args in the asm call. - */ - substOld = (slang_variable **) - _slang_alloc(numArgs * sizeof(slang_variable *)); - substNew = (slang_operation **) - _slang_alloc(numArgs * sizeof(slang_operation *)); - for (i = 0; i < numArgs; i++) { - substOld[i] = fun->parameters->variables[i]; - substNew[i] = oper->children + i; - } - - /* make a copy of the code to inline */ - inlined = slang_operation_new(1); - slang_operation_copy(inlined, &fun->body->children[0]); - if (haveRetValue) { - /* get rid of the __retVal child */ - inlined->num_children--; - for (i = 0; i < inlined->num_children; i++) { - inlined->children[i] = inlined->children[i + 1]; - } - } - - /* now do formal->actual substitutions */ - slang_substitute(A, inlined, numArgs, substOld, substNew, GL_FALSE); - - _slang_free(substOld); - _slang_free(substNew); - -#if 0 - printf("+++++++++++++ inlined asm function %s +++++++++++++\n", - (char *) fun->header.a_name); - slang_print_tree(inlined, 3); - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++\n"); -#endif - - return inlined; -} - - -/** - * Inline the given function call operation. - * Return a new slang_operation that corresponds to the inlined code. - */ -static slang_operation * -slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun, - slang_operation *oper, slang_operation *returnOper) -{ - typedef enum { - SUBST = 1, - COPY_IN, - COPY_OUT - } ParamMode; - ParamMode *paramMode; - const GLboolean haveRetValue = _slang_function_has_return_value(fun); - const GLuint numArgs = oper->num_children; - const GLuint totalArgs = numArgs + haveRetValue; - slang_operation *args = oper->children; - slang_operation *inlined, *top; - slang_variable **substOld; - slang_operation **substNew; - GLuint substCount, numCopyIn, i; - slang_function *prevFunction; - slang_variable_scope *newScope = NULL; - - /* save / push */ - prevFunction = A->CurFunction; - A->CurFunction = fun; - - /*assert(oper->type == SLANG_OPER_CALL); (or (matrix) multiply, etc) */ - assert(fun->param_count == totalArgs); - - /* allocate temporary arrays */ - paramMode = (ParamMode *) - _slang_alloc(totalArgs * sizeof(ParamMode)); - substOld = (slang_variable **) - _slang_alloc(totalArgs * sizeof(slang_variable *)); - substNew = (slang_operation **) - _slang_alloc(totalArgs * sizeof(slang_operation *)); - -#if 0 - printf("\nInline call to %s (total vars=%d nparams=%d)\n", - (char *) fun->header.a_name, - fun->parameters->num_variables, numArgs); -#endif - - if (haveRetValue && !returnOper) { - /* Create 3-child comma sequence for inlined code: - * child[0]: declare __resultTmp - * child[1]: inlined function body - * child[2]: __resultTmp - */ - slang_operation *commaSeq; - slang_operation *declOper = NULL; - slang_variable *resultVar; - - commaSeq = slang_operation_new(1); - commaSeq->type = SLANG_OPER_SEQUENCE; - assert(commaSeq->locals); - commaSeq->locals->outer_scope = oper->locals->outer_scope; - commaSeq->num_children = 3; - commaSeq->children = slang_operation_new(3); - /* allocate the return var */ - resultVar = slang_variable_scope_grow(commaSeq->locals); - /* - printf("Alloc __resultTmp in scope %p for retval of calling %s\n", - (void*)commaSeq->locals, (char *) fun->header.a_name); - */ - - resultVar->a_name = slang_atom_pool_atom(A->atoms, "__resultTmp"); - resultVar->type = fun->header.type; /* XXX copy? */ - resultVar->isTemp = GL_TRUE; - - /* child[0] = __resultTmp declaration */ - declOper = &commaSeq->children[0]; - declOper->type = SLANG_OPER_VARIABLE_DECL; - declOper->a_id = resultVar->a_name; - declOper->locals->outer_scope = commaSeq->locals; - - /* child[1] = function body */ - inlined = &commaSeq->children[1]; - inlined->locals->outer_scope = commaSeq->locals; - - /* child[2] = __resultTmp reference */ - returnOper = &commaSeq->children[2]; - returnOper->type = SLANG_OPER_IDENTIFIER; - returnOper->a_id = resultVar->a_name; - returnOper->locals->outer_scope = commaSeq->locals; - - top = commaSeq; - } - else { - top = inlined = slang_operation_new(1); - /* XXXX this may be inappropriate!!!! */ - inlined->locals->outer_scope = oper->locals->outer_scope; - } - - - assert(inlined->locals); - - /* Examine the parameters, look for inout/out params, look for possible - * substitutions, etc: - * param type behaviour - * in copy actual to local - * const in substitute param with actual - * out copy out - */ - substCount = 0; - for (i = 0; i < totalArgs; i++) { - slang_variable *p = fun->parameters->variables[i]; - /* - printf("Param %d: %s %s \n", i, - slang_type_qual_string(p->type.qualifier), - (char *) p->a_name); - */ - if (p->type.qualifier == SLANG_QUAL_INOUT || - p->type.qualifier == SLANG_QUAL_OUT) { - /* an output param */ - slang_operation *arg; - if (i < numArgs) - arg = &args[i]; - else - arg = returnOper; - paramMode[i] = SUBST; - - if (arg->type == SLANG_OPER_IDENTIFIER) - slang_resolve_variable(arg); - - /* replace parameter 'p' with argument 'arg' */ - substOld[substCount] = p; - substNew[substCount] = arg; /* will get copied */ - substCount++; - } - else if (p->type.qualifier == SLANG_QUAL_CONST) { - /* a constant input param */ - if (args[i].type == SLANG_OPER_IDENTIFIER || - args[i].type == SLANG_OPER_LITERAL_FLOAT) { - /* replace all occurances of this parameter variable with the - * actual argument variable or a literal. - */ - paramMode[i] = SUBST; - slang_resolve_variable(&args[i]); - substOld[substCount] = p; - substNew[substCount] = &args[i]; /* will get copied */ - substCount++; - } - else { - paramMode[i] = COPY_IN; - } - } - else { - paramMode[i] = COPY_IN; - } - assert(paramMode[i]); - } - - /* actual code inlining: */ - slang_operation_copy(inlined, fun->body); - - /*** XXX review this */ - assert(inlined->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE || - inlined->type == SLANG_OPER_BLOCK_NEW_SCOPE); - inlined->type = SLANG_OPER_BLOCK_NEW_SCOPE; - -#if 0 - printf("======================= orig body code ======================\n"); - printf("=== params scope = %p\n", (void*) fun->parameters); - slang_print_tree(fun->body, 8); - printf("======================= copied code =========================\n"); - slang_print_tree(inlined, 8); -#endif - - /* do parameter substitution in inlined code: */ - slang_substitute(A, inlined, substCount, substOld, substNew, GL_FALSE); - -#if 0 - printf("======================= subst code ==========================\n"); - slang_print_tree(inlined, 8); - printf("=============================================================\n"); -#endif - - /* New prolog statements: (inserted before the inlined code) - * Copy the 'in' arguments. - */ - numCopyIn = 0; - for (i = 0; i < numArgs; i++) { - if (paramMode[i] == COPY_IN) { - slang_variable *p = fun->parameters->variables[i]; - /* declare parameter 'p' */ - slang_operation *decl = slang_operation_insert(&inlined->num_children, - &inlined->children, - numCopyIn); - - decl->type = SLANG_OPER_VARIABLE_DECL; - assert(decl->locals); - decl->locals->outer_scope = inlined->locals; - decl->a_id = p->a_name; - decl->num_children = 1; - decl->children = slang_operation_new(1); - - /* child[0] is the var's initializer */ - slang_operation_copy(&decl->children[0], args + i); - - /* add parameter 'p' to the local variable scope here */ - { - slang_variable *pCopy = slang_variable_scope_grow(inlined->locals); - pCopy->type = p->type; - pCopy->a_name = p->a_name; - pCopy->array_len = p->array_len; - } - - newScope = inlined->locals; - numCopyIn++; - } - } - - /* Now add copies of the function's local vars to the new variable scope */ - for (i = totalArgs; i < fun->parameters->num_variables; i++) { - slang_variable *p = fun->parameters->variables[i]; - slang_variable *pCopy = slang_variable_scope_grow(inlined->locals); - pCopy->type = p->type; - pCopy->a_name = p->a_name; - pCopy->array_len = p->array_len; - } - - - /* New epilog statements: - * 1. Create end of function label to jump to from return statements. - * 2. Copy the 'out' parameter vars - */ - { - slang_operation *lab = slang_operation_insert(&inlined->num_children, - &inlined->children, - inlined->num_children); - lab->type = SLANG_OPER_LABEL; - lab->label = A->curFuncEndLabel; - } - - for (i = 0; i < totalArgs; i++) { - if (paramMode[i] == COPY_OUT) { - const slang_variable *p = fun->parameters->variables[i]; - /* actualCallVar = outParam */ - /*if (i > 0 || !haveRetValue)*/ - slang_operation *ass = slang_operation_insert(&inlined->num_children, - &inlined->children, - inlined->num_children); - ass->type = SLANG_OPER_ASSIGN; - ass->num_children = 2; - ass->locals->outer_scope = inlined->locals; - ass->children = slang_operation_new(2); - ass->children[0] = args[i]; /*XXX copy */ - ass->children[1].type = SLANG_OPER_IDENTIFIER; - ass->children[1].a_id = p->a_name; - ass->children[1].locals->outer_scope = ass->locals; - } - } - - _slang_free(paramMode); - _slang_free(substOld); - _slang_free(substNew); - - /* Update scoping to use the new local vars instead of the - * original function's vars. This is especially important - * for nested inlining. - */ - if (newScope) - slang_replace_scope(inlined, fun->parameters, newScope); - -#if 0 - printf("Done Inline call to %s (total vars=%d nparams=%d)\n\n", - (char *) fun->header.a_name, - fun->parameters->num_variables, numArgs); - slang_print_tree(top, 0); -#endif - - /* pop */ - A->CurFunction = prevFunction; - - return top; -} - - -static slang_ir_node * -_slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, - slang_operation *oper, slang_operation *dest) -{ - slang_ir_node *n; - slang_operation *inlined; - slang_label *prevFuncEndLabel; - char name[200]; - - prevFuncEndLabel = A->curFuncEndLabel; - sprintf(name, "__endOfFunc_%s_", (char *) fun->header.a_name); - A->curFuncEndLabel = _slang_label_new(name); - assert(A->curFuncEndLabel); - - if (slang_is_asm_function(fun) && !dest) { - /* assemble assembly function - tree style */ - inlined = slang_inline_asm_function(A, fun, oper); - } - else { - /* non-assembly function */ - /* We always generate an "inline-able" block of code here. - * We may either: - * 1. insert the inline code - * 2. Generate a call to the "inline" code as a subroutine - */ - - - slang_operation *ret = NULL; - - inlined = slang_inline_function_call(A, fun, oper, dest); - if (!inlined) - return NULL; - - ret = _slang_find_node_type(inlined, SLANG_OPER_RETURN); - if (ret) { - /* check if this is a "tail" return */ - if (_slang_count_node_type(inlined, SLANG_OPER_RETURN) == 1 && - _slang_is_tail_return(inlined)) { - /* The only RETURN is the last stmt in the function, no-op it - * and inline the function body. - */ - ret->type = SLANG_OPER_NONE; - } - else { - slang_operation *callOper; - /* The function we're calling has one or more 'return' statements. - * So, we can't truly inline this function because we need to - * implement 'return' with RET (and CAL). - * Nevertheless, we performed "inlining" to make a new instance - * of the function body to deal with static register allocation. - * - * XXX check if there's one 'return' and if it's the very last - * statement in the function - we can optimize that case. - */ - assert(inlined->type == SLANG_OPER_BLOCK_NEW_SCOPE || - inlined->type == SLANG_OPER_SEQUENCE); - - if (_slang_function_has_return_value(fun) && !dest) { - assert(inlined->children[0].type == SLANG_OPER_VARIABLE_DECL); - assert(inlined->children[2].type == SLANG_OPER_IDENTIFIER); - callOper = &inlined->children[1]; - } - else { - callOper = inlined; - } - callOper->type = SLANG_OPER_NON_INLINED_CALL; - callOper->fun = fun; - callOper->label = _slang_label_new_unique((char*) fun->header.a_name); - } - } - } - - if (!inlined) - return NULL; - - /* Replace the function call with the inlined block (or new CALL stmt) */ - slang_operation_destruct(oper); - *oper = *inlined; - _slang_free(inlined); - -#if 0 - assert(inlined->locals); - printf("*** Inlined code for call to %s:\n", - (char*) fun->header.a_name); - slang_print_tree(oper, 10); - printf("\n"); -#endif - - n = _slang_gen_operation(A, oper); - - /*_slang_label_delete(A->curFuncEndLabel);*/ - A->curFuncEndLabel = prevFuncEndLabel; - - return n; -} - - -static slang_asm_info * -slang_find_asm_info(const char *name) -{ - GLuint i; - for (i = 0; AsmInfo[i].Name; i++) { - if (_mesa_strcmp(AsmInfo[i].Name, name) == 0) { - return AsmInfo + i; - } - } - return NULL; -} - - -/** - * Some write-masked assignments are simple, but others are hard. - * Simple example: - * vec3 v; - * v.xy = vec2(a, b); - * Hard example: - * vec3 v; - * v.zy = vec2(a, b); - * this gets transformed/swizzled into: - * v.zy = vec2(a, b).*yx* (* = don't care) - * This function helps to determine simple vs. non-simple. - */ -static GLboolean -_slang_simple_writemask(GLuint writemask, GLuint swizzle) -{ - switch (writemask) { - case WRITEMASK_X: - return GET_SWZ(swizzle, 0) == SWIZZLE_X; - case WRITEMASK_Y: - return GET_SWZ(swizzle, 1) == SWIZZLE_Y; - case WRITEMASK_Z: - return GET_SWZ(swizzle, 2) == SWIZZLE_Z; - case WRITEMASK_W: - return GET_SWZ(swizzle, 3) == SWIZZLE_W; - case WRITEMASK_XY: - return (GET_SWZ(swizzle, 0) == SWIZZLE_X) - && (GET_SWZ(swizzle, 1) == SWIZZLE_Y); - case WRITEMASK_XYZ: - return (GET_SWZ(swizzle, 0) == SWIZZLE_X) - && (GET_SWZ(swizzle, 1) == SWIZZLE_Y) - && (GET_SWZ(swizzle, 2) == SWIZZLE_Z); - case WRITEMASK_XYZW: - return swizzle == SWIZZLE_NOOP; - default: - return GL_FALSE; - } -} - - -/** - * Convert the given swizzle into a writemask. In some cases this - * is trivial, in other cases, we'll need to also swizzle the right - * hand side to put components in the right places. - * See comment above for more info. - * XXX this function could be simplified and should probably be renamed. - * \param swizzle the incoming swizzle - * \param writemaskOut returns the writemask - * \param swizzleOut swizzle to apply to the right-hand-side - * \return GL_FALSE for simple writemasks, GL_TRUE for non-simple - */ -static GLboolean -swizzle_to_writemask(slang_assemble_ctx *A, GLuint swizzle, - GLuint *writemaskOut, GLuint *swizzleOut) -{ - GLuint mask = 0x0, newSwizzle[4]; - GLint i, size; - - /* make new dst writemask, compute size */ - for (i = 0; i < 4; i++) { - const GLuint swz = GET_SWZ(swizzle, i); - if (swz == SWIZZLE_NIL) { - /* end */ - break; - } - assert(swz >= 0 && swz <= 3); - - if (swizzle != SWIZZLE_XXXX && - swizzle != SWIZZLE_YYYY && - swizzle != SWIZZLE_ZZZZ && - swizzle != SWIZZLE_WWWW && - (mask & (1 << swz))) { - /* a channel can't be specified twice (ex: ".xyyz") */ - slang_info_log_error(A->log, "Invalid writemask '%s'", - _mesa_swizzle_string(swizzle, 0, 0)); - return GL_FALSE; - } - - mask |= (1 << swz); - } - assert(mask <= 0xf); - size = i; /* number of components in mask/swizzle */ - - *writemaskOut = mask; - - /* make new src swizzle, by inversion */ - for (i = 0; i < 4; i++) { - newSwizzle[i] = i; /*identity*/ - } - for (i = 0; i < size; i++) { - const GLuint swz = GET_SWZ(swizzle, i); - newSwizzle[swz] = i; - } - *swizzleOut = MAKE_SWIZZLE4(newSwizzle[0], - newSwizzle[1], - newSwizzle[2], - newSwizzle[3]); - - if (_slang_simple_writemask(mask, *swizzleOut)) { - if (size >= 1) - assert(GET_SWZ(*swizzleOut, 0) == SWIZZLE_X); - if (size >= 2) - assert(GET_SWZ(*swizzleOut, 1) == SWIZZLE_Y); - if (size >= 3) - assert(GET_SWZ(*swizzleOut, 2) == SWIZZLE_Z); - if (size >= 4) - assert(GET_SWZ(*swizzleOut, 3) == SWIZZLE_W); - return GL_TRUE; - } - else - return GL_FALSE; -} - - -#if 0 /* not used, but don't remove just yet */ -/** - * Recursively traverse 'oper' to produce a swizzle mask in the event - * of any vector subscripts and swizzle suffixes. - * Ex: for "vec4 v", "v[2].x" resolves to v.z - */ -static GLuint -resolve_swizzle(const slang_operation *oper) -{ - if (oper->type == SLANG_OPER_FIELD) { - /* writemask from .xyzw suffix */ - slang_swizzle swz; - if (_slang_is_swizzle((char*) oper->a_id, 4, &swz)) { - GLuint swizzle = MAKE_SWIZZLE4(swz.swizzle[0], - swz.swizzle[1], - swz.swizzle[2], - swz.swizzle[3]); - GLuint child_swizzle = resolve_swizzle(&oper->children[0]); - GLuint s = _slang_swizzle_swizzle(child_swizzle, swizzle); - return s; - } - else - return SWIZZLE_XYZW; - } - else if (oper->type == SLANG_OPER_SUBSCRIPT && - oper->children[1].type == SLANG_OPER_LITERAL_INT) { - /* writemask from [index] */ - GLuint child_swizzle = resolve_swizzle(&oper->children[0]); - GLuint i = (GLuint) oper->children[1].literal[0]; - GLuint swizzle; - GLuint s; - switch (i) { - case 0: - swizzle = SWIZZLE_XXXX; - break; - case 1: - swizzle = SWIZZLE_YYYY; - break; - case 2: - swizzle = SWIZZLE_ZZZZ; - break; - case 3: - swizzle = SWIZZLE_WWWW; - break; - default: - swizzle = SWIZZLE_XYZW; - } - s = _slang_swizzle_swizzle(child_swizzle, swizzle); - return s; - } - else { - return SWIZZLE_XYZW; - } -} -#endif - - -#if 0 -/** - * Recursively descend through swizzle nodes to find the node's storage info. - */ -static slang_ir_storage * -get_store(const slang_ir_node *n) -{ - if (n->Opcode == IR_SWIZZLE) { - return get_store(n->Children[0]); - } - return n->Store; -} -#endif - - -/** - * Generate IR tree for an asm instruction/operation such as: - * __asm vec4_dot __retVal.x, v1, v2; - */ -static slang_ir_node * -_slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, - slang_operation *dest) -{ - const slang_asm_info *info; - slang_ir_node *kids[3], *n; - GLuint j, firstOperand; - - assert(oper->type == SLANG_OPER_ASM); - - info = slang_find_asm_info((char *) oper->a_id); - if (!info) { - _mesa_problem(NULL, "undefined __asm function %s\n", - (char *) oper->a_id); - assert(info); - } - assert(info->NumParams <= 3); - - if (info->NumParams == oper->num_children) { - /* Storage for result is not specified. - * Children[0], [1], [2] are the operands. - */ - firstOperand = 0; - } - else { - /* Storage for result (child[0]) is specified. - * Children[1], [2], [3] are the operands. - */ - firstOperand = 1; - } - - /* assemble child(ren) */ - kids[0] = kids[1] = kids[2] = NULL; - for (j = 0; j < info->NumParams; j++) { - kids[j] = _slang_gen_operation(A, &oper->children[firstOperand + j]); - if (!kids[j]) - return NULL; - } - - n = new_node3(info->Opcode, kids[0], kids[1], kids[2]); - - if (firstOperand) { - /* Setup n->Store to be a particular location. Otherwise, storage - * for the result (a temporary) will be allocated later. - */ - slang_operation *dest_oper; - slang_ir_node *n0; - - dest_oper = &oper->children[0]; - - n0 = _slang_gen_operation(A, dest_oper); - if (!n0) - return NULL; - - assert(!n->Store); - n->Store = n0->Store; - - assert(n->Store->File != PROGRAM_UNDEFINED || n->Store->Parent); - - _slang_free(n0); - } - - return n; -} - - -#if 0 -static void -print_funcs(struct slang_function_scope_ *scope, const char *name) -{ - GLuint i; - for (i = 0; i < scope->num_functions; i++) { - slang_function *f = &scope->functions[i]; - if (!name || strcmp(name, (char*) f->header.a_name) == 0) - printf(" %s (%d args)\n", name, f->param_count); - - } - if (scope->outer_scope) - print_funcs(scope->outer_scope, name); -} -#endif - - -/** - * Find a function of the given name, taking 'numArgs' arguments. - * This is the function we'll try to call when there is no exact match - * between function parameters and call arguments. - * - * XXX we should really create a list of candidate functions and try - * all of them... - */ -static slang_function * -_slang_find_function_by_argc(slang_function_scope *scope, - const char *name, int numArgs) -{ - while (scope) { - GLuint i; - for (i = 0; i < scope->num_functions; i++) { - slang_function *f = &scope->functions[i]; - if (strcmp(name, (char*) f->header.a_name) == 0) { - int haveRetValue = _slang_function_has_return_value(f); - if (numArgs == f->param_count - haveRetValue) - return f; - } - } - scope = scope->outer_scope; - } - - return NULL; -} - - -static slang_function * -_slang_find_function_by_max_argc(slang_function_scope *scope, - const char *name) -{ - slang_function *maxFunc = NULL; - GLuint maxArgs = 0; - - while (scope) { - GLuint i; - for (i = 0; i < scope->num_functions; i++) { - slang_function *f = &scope->functions[i]; - if (strcmp(name, (char*) f->header.a_name) == 0) { - if (f->param_count > maxArgs) { - maxArgs = f->param_count; - maxFunc = f; - } - } - } - scope = scope->outer_scope; - } - - return maxFunc; -} - - -/** - * Generate a new slang_function which is a constructor for a user-defined - * struct type. - */ -static slang_function * -_slang_make_struct_constructor(slang_assemble_ctx *A, slang_struct *str) -{ - const GLint numFields = str->fields->num_variables; - slang_function *fun = slang_function_new(SLANG_FUNC_CONSTRUCTOR); - - /* function header (name, return type) */ - fun->header.a_name = str->a_name; - fun->header.type.qualifier = SLANG_QUAL_NONE; - fun->header.type.specifier.type = SLANG_SPEC_STRUCT; - fun->header.type.specifier._struct = str; - - /* function parameters (= struct's fields) */ - { - GLint i; - for (i = 0; i < numFields; i++) { - /* - printf("Field %d: %s\n", i, (char*) str->fields->variables[i]->a_name); - */ - slang_variable *p = slang_variable_scope_grow(fun->parameters); - *p = *str->fields->variables[i]; /* copy the variable and type */ - p->type.qualifier = SLANG_QUAL_CONST; - } - fun->param_count = fun->parameters->num_variables; - } - - /* Add __retVal to params */ - { - slang_variable *p = slang_variable_scope_grow(fun->parameters); - slang_atom a_retVal = slang_atom_pool_atom(A->atoms, "__retVal"); - assert(a_retVal); - p->a_name = a_retVal; - p->type = fun->header.type; - p->type.qualifier = SLANG_QUAL_OUT; - fun->param_count++; - } - - /* function body is: - * block: - * declare T; - * T.f1 = p1; - * T.f2 = p2; - * ... - * T.fn = pn; - * return T; - */ - { - slang_variable_scope *scope; - slang_variable *var; - GLint i; - - fun->body = slang_operation_new(1); - fun->body->type = SLANG_OPER_BLOCK_NEW_SCOPE; - fun->body->num_children = numFields + 2; - fun->body->children = slang_operation_new(numFields + 2); - - scope = fun->body->locals; - scope->outer_scope = fun->parameters; - - /* create local var 't' */ - var = slang_variable_scope_grow(scope); - var->a_name = slang_atom_pool_atom(A->atoms, "t"); - var->type = fun->header.type; - - /* declare t */ - { - slang_operation *decl; - - decl = &fun->body->children[0]; - decl->type = SLANG_OPER_VARIABLE_DECL; - decl->locals = _slang_variable_scope_new(scope); - decl->a_id = var->a_name; - } - - /* assign params to fields of t */ - for (i = 0; i < numFields; i++) { - slang_operation *assign = &fun->body->children[1 + i]; - - assign->type = SLANG_OPER_ASSIGN; - assign->locals = _slang_variable_scope_new(scope); - assign->num_children = 2; - assign->children = slang_operation_new(2); - - { - slang_operation *lhs = &assign->children[0]; - - lhs->type = SLANG_OPER_FIELD; - lhs->locals = _slang_variable_scope_new(scope); - lhs->num_children = 1; - lhs->children = slang_operation_new(1); - lhs->a_id = str->fields->variables[i]->a_name; - - lhs->children[0].type = SLANG_OPER_IDENTIFIER; - lhs->children[0].a_id = var->a_name; - lhs->children[0].locals = _slang_variable_scope_new(scope); - -#if 0 - lhs->children[1].num_children = 1; - lhs->children[1].children = slang_operation_new(1); - lhs->children[1].children[0].type = SLANG_OPER_IDENTIFIER; - lhs->children[1].children[0].a_id = str->fields->variables[i]->a_name; - lhs->children[1].children->locals = _slang_variable_scope_new(scope); -#endif - } - - { - slang_operation *rhs = &assign->children[1]; - - rhs->type = SLANG_OPER_IDENTIFIER; - rhs->locals = _slang_variable_scope_new(scope); - rhs->a_id = str->fields->variables[i]->a_name; - } - } - - /* return t; */ - { - slang_operation *ret = &fun->body->children[numFields + 1]; - - ret->type = SLANG_OPER_RETURN; - ret->locals = _slang_variable_scope_new(scope); - ret->num_children = 1; - ret->children = slang_operation_new(1); - ret->children[0].type = SLANG_OPER_IDENTIFIER; - ret->children[0].a_id = var->a_name; - ret->children[0].locals = _slang_variable_scope_new(scope); - } - } - /* - slang_print_function(fun, 1); - */ - return fun; -} - - -/** - * Find/create a function (constructor) for the given structure name. - */ -static slang_function * -_slang_locate_struct_constructor(slang_assemble_ctx *A, const char *name) -{ - unsigned int i; - for (i = 0; i < A->space.structs->num_structs; i++) { - slang_struct *str = &A->space.structs->structs[i]; - if (strcmp(name, (const char *) str->a_name) == 0) { - /* found a structure type that matches the function name */ - if (!str->constructor) { - /* create the constructor function now */ - str->constructor = _slang_make_struct_constructor(A, str); - } - return str->constructor; - } - } - return NULL; -} - - -/** - * Generate a new slang_function to satisfy a call to an array constructor. - * Ex: float[3](1., 2., 3.) - */ -static slang_function * -_slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper) -{ - slang_type_specifier_type baseType; - slang_function *fun; - int num_elements; - - fun = slang_function_new(SLANG_FUNC_CONSTRUCTOR); - if (!fun) - return NULL; - - baseType = slang_type_specifier_type_from_string((char *) oper->a_id); - - num_elements = oper->num_children; - - /* function header, return type */ - { - fun->header.a_name = oper->a_id; - fun->header.type.qualifier = SLANG_QUAL_NONE; - fun->header.type.specifier.type = SLANG_SPEC_ARRAY; - fun->header.type.specifier._array = - slang_type_specifier_new(baseType, NULL, NULL); - fun->header.type.array_len = num_elements; - } - - /* function parameters (= number of elements) */ - { - GLint i; - for (i = 0; i < num_elements; i++) { - /* - printf("Field %d: %s\n", i, (char*) str->fields->variables[i]->a_name); - */ - slang_variable *p = slang_variable_scope_grow(fun->parameters); - char name[10]; - _mesa_snprintf(name, sizeof(name), "p%d", i); - p->a_name = slang_atom_pool_atom(A->atoms, name); - p->type.qualifier = SLANG_QUAL_CONST; - p->type.specifier.type = baseType; - } - fun->param_count = fun->parameters->num_variables; - } - - /* Add __retVal to params */ - { - slang_variable *p = slang_variable_scope_grow(fun->parameters); - slang_atom a_retVal = slang_atom_pool_atom(A->atoms, "__retVal"); - assert(a_retVal); - p->a_name = a_retVal; - p->type = fun->header.type; - p->type.qualifier = SLANG_QUAL_OUT; - p->type.specifier.type = baseType; - fun->param_count++; - } - - /* function body is: - * block: - * declare T; - * T[0] = p0; - * T[1] = p1; - * ... - * T[n] = pn; - * return T; - */ - { - slang_variable_scope *scope; - slang_variable *var; - GLint i; - - fun->body = slang_operation_new(1); - fun->body->type = SLANG_OPER_BLOCK_NEW_SCOPE; - fun->body->num_children = num_elements + 2; - fun->body->children = slang_operation_new(num_elements + 2); - - scope = fun->body->locals; - scope->outer_scope = fun->parameters; - - /* create local var 't' */ - var = slang_variable_scope_grow(scope); - var->a_name = slang_atom_pool_atom(A->atoms, "ttt"); - var->type = fun->header.type;/*XXX copy*/ - - /* declare t */ - { - slang_operation *decl; - - decl = &fun->body->children[0]; - decl->type = SLANG_OPER_VARIABLE_DECL; - decl->locals = _slang_variable_scope_new(scope); - decl->a_id = var->a_name; - } - - /* assign params to elements of t */ - for (i = 0; i < num_elements; i++) { - slang_operation *assign = &fun->body->children[1 + i]; - - assign->type = SLANG_OPER_ASSIGN; - assign->locals = _slang_variable_scope_new(scope); - assign->num_children = 2; - assign->children = slang_operation_new(2); - - { - slang_operation *lhs = &assign->children[0]; - - lhs->type = SLANG_OPER_SUBSCRIPT; - lhs->locals = _slang_variable_scope_new(scope); - lhs->num_children = 2; - lhs->children = slang_operation_new(2); - - lhs->children[0].type = SLANG_OPER_IDENTIFIER; - lhs->children[0].a_id = var->a_name; - lhs->children[0].locals = _slang_variable_scope_new(scope); - - lhs->children[1].type = SLANG_OPER_LITERAL_INT; - lhs->children[1].literal[0] = (GLfloat) i; - } - - { - slang_operation *rhs = &assign->children[1]; - - rhs->type = SLANG_OPER_IDENTIFIER; - rhs->locals = _slang_variable_scope_new(scope); - rhs->a_id = fun->parameters->variables[i]->a_name; - } - } - - /* return t; */ - { - slang_operation *ret = &fun->body->children[num_elements + 1]; - - ret->type = SLANG_OPER_RETURN; - ret->locals = _slang_variable_scope_new(scope); - ret->num_children = 1; - ret->children = slang_operation_new(1); - ret->children[0].type = SLANG_OPER_IDENTIFIER; - ret->children[0].a_id = var->a_name; - ret->children[0].locals = _slang_variable_scope_new(scope); - } - } - - /* - slang_print_function(fun, 1); - */ - - return fun; -} - - -static GLboolean -_slang_is_vec_mat_type(const char *name) -{ - static const char *vecmat_types[] = { - "float", "int", "bool", - "vec2", "vec3", "vec4", - "ivec2", "ivec3", "ivec4", - "bvec2", "bvec3", "bvec4", - "mat2", "mat3", "mat4", - "mat2x3", "mat2x4", "mat3x2", "mat3x4", "mat4x2", "mat4x3", - NULL - }; - int i; - for (i = 0; vecmat_types[i]; i++) - if (_mesa_strcmp(name, vecmat_types[i]) == 0) - return GL_TRUE; - return GL_FALSE; -} - - -/** - * Assemble a function call, given a particular function name. - * \param name the function's name (operators like '*' are possible). - */ -static slang_ir_node * -_slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, - slang_operation *oper, slang_operation *dest) -{ - slang_operation *params = oper->children; - const GLuint param_count = oper->num_children; - slang_atom atom; - slang_function *fun; - slang_ir_node *n; - - atom = slang_atom_pool_atom(A->atoms, name); - if (atom == SLANG_ATOM_NULL) - return NULL; - - if (oper->array_constructor) { - /* this needs special handling */ - fun = _slang_make_array_constructor(A, oper); - } - else { - /* Try to find function by name and exact argument type matching */ - GLboolean error = GL_FALSE; - fun = _slang_function_locate(A->space.funcs, atom, params, param_count, - &A->space, A->atoms, A->log, &error); - if (error) { - slang_info_log_error(A->log, - "Function '%s' not found (check argument types)", - name); - return NULL; - } - } - - if (!fun) { - /* Next, try locating a constructor function for a user-defined type */ - fun = _slang_locate_struct_constructor(A, name); - } - - /* - * At this point, some heuristics are used to try to find a function - * that matches the calling signature by means of casting or "unrolling" - * of constructors. - */ - - if (!fun && _slang_is_vec_mat_type(name)) { - /* Next, if this call looks like a vec() or mat() constructor call, - * try "unwinding" the args to satisfy a constructor. - */ - fun = _slang_find_function_by_max_argc(A->space.funcs, name); - if (fun) { - if (!_slang_adapt_call(oper, fun, &A->space, A->atoms, A->log)) { - slang_info_log_error(A->log, - "Function '%s' not found (check argument types)", - name); - return NULL; - } - } - } - - if (!fun && _slang_is_vec_mat_type(name)) { - /* Next, try casting args to the types of the formal parameters */ - int numArgs = oper->num_children; - fun = _slang_find_function_by_argc(A->space.funcs, name, numArgs); - if (!fun || !_slang_cast_func_params(oper, fun, &A->space, A->atoms, A->log)) { - slang_info_log_error(A->log, - "Function '%s' not found (check argument types)", - name); - return NULL; - } - assert(fun); - } - - if (!fun) { - slang_info_log_error(A->log, - "Function '%s' not found (check argument types)", - name); - return NULL; - } - if (!fun->body) { - slang_info_log_error(A->log, - "Function '%s' prototyped but not defined. " - "Separate compilation units not supported.", - name); - return NULL; - } - - /* type checking to be sure function's return type matches 'dest' type */ - if (dest) { - slang_typeinfo t0; - - slang_typeinfo_construct(&t0); - typeof_operation(A, dest, &t0); - - if (!slang_type_specifier_equal(&t0.spec, &fun->header.type.specifier)) { - slang_info_log_error(A->log, - "Incompatible type returned by call to '%s'", - name); - return NULL; - } - } - - n = _slang_gen_function_call(A, fun, oper, dest); - - if (n && !n->Store && !dest - && fun->header.type.specifier.type != SLANG_SPEC_VOID) { - /* setup n->Store for the result of the function call */ - GLint size = _slang_sizeof_type_specifier(&fun->header.type.specifier); - n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, size); - /*printf("Alloc storage for function result, size %d \n", size);*/ - } - - if (oper->array_constructor) { - /* free the temporary array constructor function now */ - slang_function_destruct(fun); - } - - return n; -} - - -static slang_ir_node * -_slang_gen_method_call(slang_assemble_ctx *A, slang_operation *oper) -{ - slang_atom *a_length = slang_atom_pool_atom(A->atoms, "length"); - slang_ir_node *n; - slang_variable *var; - - /* NOTE: In GLSL 1.20, there's only one kind of method - * call: array.length(). Anything else is an error. - */ - if (oper->a_id != a_length) { - slang_info_log_error(A->log, - "Undefined method call '%s'", (char *) oper->a_id); - return NULL; - } - - /* length() takes no arguments */ - if (oper->num_children > 0) { - slang_info_log_error(A->log, "Invalid arguments to length() method"); - return NULL; - } - - /* lookup the object/variable */ - var = _slang_variable_locate(oper->locals, oper->a_obj, GL_TRUE); - if (!var || var->type.specifier.type != SLANG_SPEC_ARRAY) { - slang_info_log_error(A->log, - "Undefined object '%s'", (char *) oper->a_obj); - return NULL; - } - - /* Create a float/literal IR node encoding the array length */ - n = new_node0(IR_FLOAT); - if (n) { - n->Value[0] = (float) _slang_array_length(var); - n->Store = _slang_new_ir_storage(PROGRAM_CONSTANT, -1, 1); - } - return n; -} - - -static GLboolean -_slang_is_constant_cond(const slang_operation *oper, GLboolean *value) -{ - if (oper->type == SLANG_OPER_LITERAL_FLOAT || - oper->type == SLANG_OPER_LITERAL_INT || - oper->type == SLANG_OPER_LITERAL_BOOL) { - if (oper->literal[0]) - *value = GL_TRUE; - else - *value = GL_FALSE; - return GL_TRUE; - } - else if (oper->type == SLANG_OPER_EXPRESSION && - oper->num_children == 1) { - return _slang_is_constant_cond(&oper->children[0], value); - } - return GL_FALSE; -} - - -/** - * Test if an operation is a scalar or boolean. - */ -static GLboolean -_slang_is_scalar_or_boolean(slang_assemble_ctx *A, slang_operation *oper) -{ - slang_typeinfo type; - GLint size; - - slang_typeinfo_construct(&type); - typeof_operation(A, oper, &type); - size = _slang_sizeof_type_specifier(&type.spec); - slang_typeinfo_destruct(&type); - return size == 1; -} - - -/** - * Test if an operation is boolean. - */ -static GLboolean -_slang_is_boolean(slang_assemble_ctx *A, slang_operation *oper) -{ - slang_typeinfo type; - GLboolean isBool; - - slang_typeinfo_construct(&type); - typeof_operation(A, oper, &type); - isBool = (type.spec.type == SLANG_SPEC_BOOL); - slang_typeinfo_destruct(&type); - return isBool; -} - - -/** - * Generate loop code using high-level IR_LOOP instruction - */ -static slang_ir_node * -_slang_gen_while(slang_assemble_ctx * A, const slang_operation *oper) -{ - /* - * LOOP: - * BREAK if !expr (child[0]) - * body code (child[1]) - */ - slang_ir_node *prevLoop, *loop, *breakIf, *body; - GLboolean isConst, constTrue; - - /* type-check expression */ - if (!_slang_is_boolean(A, &oper->children[0])) { - slang_info_log_error(A->log, "scalar/boolean expression expected for 'while'"); - return NULL; - } - - /* Check if loop condition is a constant */ - isConst = _slang_is_constant_cond(&oper->children[0], &constTrue); - - if (isConst && !constTrue) { - /* loop is never executed! */ - return new_node0(IR_NOP); - } - - loop = new_loop(NULL); - - /* save old, push new loop */ - prevLoop = A->CurLoop; - A->CurLoop = loop; - - if (isConst && constTrue) { - /* while(nonzero constant), no conditional break */ - breakIf = NULL; - } - else { - slang_ir_node *cond - = new_cond(new_not(_slang_gen_operation(A, &oper->children[0]))); - breakIf = new_break_if_true(A->CurLoop, cond); - } - body = _slang_gen_operation(A, &oper->children[1]); - loop->Children[0] = new_seq(breakIf, body); - - /* Do infinite loop detection */ - /* loop->List is head of linked list of break/continue nodes */ - if (!loop->List && isConst && constTrue) { - /* infinite loop detected */ - A->CurLoop = prevLoop; /* clean-up */ - slang_info_log_error(A->log, "Infinite loop detected!"); - return NULL; - } - - /* pop loop, restore prev */ - A->CurLoop = prevLoop; - - return loop; -} - - -/** - * Generate IR tree for a do-while loop using high-level LOOP, IF instructions. - */ -static slang_ir_node * -_slang_gen_do(slang_assemble_ctx * A, const slang_operation *oper) -{ - /* - * LOOP: - * body code (child[0]) - * tail code: - * BREAK if !expr (child[1]) - */ - slang_ir_node *prevLoop, *loop; - GLboolean isConst, constTrue; - - /* type-check expression */ - if (!_slang_is_boolean(A, &oper->children[1])) { - slang_info_log_error(A->log, "scalar/boolean expression expected for 'do/while'"); - return NULL; - } - - loop = new_loop(NULL); - - /* save old, push new loop */ - prevLoop = A->CurLoop; - A->CurLoop = loop; - - /* loop body: */ - loop->Children[0] = _slang_gen_operation(A, &oper->children[0]); - - /* Check if loop condition is a constant */ - isConst = _slang_is_constant_cond(&oper->children[1], &constTrue); - if (isConst && constTrue) { - /* do { } while(1) ==> no conditional break */ - loop->Children[1] = NULL; /* no tail code */ - } - else { - slang_ir_node *cond - = new_cond(new_not(_slang_gen_operation(A, &oper->children[1]))); - loop->Children[1] = new_break_if_true(A->CurLoop, cond); - } - - /* XXX we should do infinite loop detection, as above */ - - /* pop loop, restore prev */ - A->CurLoop = prevLoop; - - return loop; -} - - -/** - * Recursively count the number of operations rooted at 'oper'. - * This gives some kind of indication of the size/complexity of an operation. - */ -static GLuint -sizeof_operation(const slang_operation *oper) -{ - if (oper) { - GLuint count = 1; /* me */ - GLuint i; - for (i = 0; i < oper->num_children; i++) { - count += sizeof_operation(&oper->children[i]); - } - return count; - } - else { - return 0; - } -} - - -/** - * Determine if a for-loop can be unrolled. - * At this time, only a rather narrow class of for loops can be unrolled. - * See code for details. - * When a loop can't be unrolled because it's too large we'll emit a - * message to the log. - */ -static GLboolean -_slang_can_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) -{ - GLuint bodySize; - GLint start, end; - const char *varName; - slang_atom varId; - - assert(oper->type == SLANG_OPER_FOR); - assert(oper->num_children == 4); - - /* children[0] must be either "int i=constant" or "i=constant" */ - if (oper->children[0].type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) { - slang_variable *var; - - if (oper->children[0].children[0].type != SLANG_OPER_VARIABLE_DECL) - return GL_FALSE; - - varId = oper->children[0].children[0].a_id; - - var = _slang_variable_locate(oper->children[0].children[0].locals, - varId, GL_TRUE); - if (!var) - return GL_FALSE; - if (!var->initializer) - return GL_FALSE; - if (var->initializer->type != SLANG_OPER_LITERAL_INT) - return GL_FALSE; - start = (GLint) var->initializer->literal[0]; - } - else if (oper->children[0].type == SLANG_OPER_EXPRESSION) { - if (oper->children[0].children[0].type != SLANG_OPER_ASSIGN) - return GL_FALSE; - if (oper->children[0].children[0].children[0].type != SLANG_OPER_IDENTIFIER) - return GL_FALSE; - if (oper->children[0].children[0].children[1].type != SLANG_OPER_LITERAL_INT) - return GL_FALSE; - - varId = oper->children[0].children[0].children[0].a_id; - - start = (GLint) oper->children[0].children[0].children[1].literal[0]; - } - else { - return GL_FALSE; - } - - /* children[1] must be "ichildren[1].type != SLANG_OPER_EXPRESSION) - return GL_FALSE; - if (oper->children[1].children[0].type != SLANG_OPER_LESS) - return GL_FALSE; - if (oper->children[1].children[0].children[0].type != SLANG_OPER_IDENTIFIER) - return GL_FALSE; - if (oper->children[1].children[0].children[1].type != SLANG_OPER_LITERAL_INT) - return GL_FALSE; - - end = (GLint) oper->children[1].children[0].children[1].literal[0]; - - /* children[2] must be "i++" or "++i" */ - if (oper->children[2].type != SLANG_OPER_POSTINCREMENT && - oper->children[2].type != SLANG_OPER_PREINCREMENT) - return GL_FALSE; - if (oper->children[2].children[0].type != SLANG_OPER_IDENTIFIER) - return GL_FALSE; - - /* make sure the same variable name is used in all places */ - if ((oper->children[1].children[0].children[0].a_id != varId) || - (oper->children[2].children[0].a_id != varId)) - return GL_FALSE; - - varName = (const char *) varId; - - /* children[3], the loop body, can't be too large */ - bodySize = sizeof_operation(&oper->children[3]); - if (bodySize > MAX_FOR_LOOP_UNROLL_BODY_SIZE) { - slang_info_log_print(A->log, - "Note: 'for (%s ... )' body is too large/complex" - " to unroll", - varName); - return GL_FALSE; - } - - if (start >= end) - return GL_FALSE; /* degenerate case */ - - if (end - start > MAX_FOR_LOOP_UNROLL_ITERATIONS) { - slang_info_log_print(A->log, - "Note: 'for (%s=%d; %s<%d; ++%s)' is too" - " many iterations to unroll", - varName, start, varName, end, varName); - return GL_FALSE; - } - - if ((end - start) * bodySize > MAX_FOR_LOOP_UNROLL_COMPLEXITY) { - slang_info_log_print(A->log, - "Note: 'for (%s=%d; %s<%d; ++%s)' will generate" - " too much code to unroll", - varName, start, varName, end, varName); - return GL_FALSE; - } - - return GL_TRUE; /* we can unroll the loop */ -} - - -/** - * Unroll a for-loop. - * First we determine the number of iterations to unroll. - * Then for each iteration: - * make a copy of the loop body - * replace instances of the loop variable with the current iteration value - * generate IR code for the body - * \return pointer to generated IR code or NULL if error, out of memory, etc. - */ -static slang_ir_node * -_slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) -{ - GLint start, end, iter; - slang_ir_node *n, *root = NULL; - slang_atom varId; - - if (oper->children[0].type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) { - /* for (int i=0; ... */ - slang_variable *var; - - varId = oper->children[0].children[0].a_id; - var = _slang_variable_locate(oper->children[0].children[0].locals, - varId, GL_TRUE); - start = (GLint) var->initializer->literal[0]; - } - else { - /* for (i=0; ... */ - varId = oper->children[0].children[0].children[0].a_id; - start = (GLint) oper->children[0].children[0].children[1].literal[0]; - } - - end = (GLint) oper->children[1].children[0].children[1].literal[0]; - - for (iter = start; iter < end; iter++) { - slang_operation *body; - - /* make a copy of the loop body */ - body = slang_operation_new(1); - if (!body) - return NULL; - - if (!slang_operation_copy(body, &oper->children[3])) - return NULL; - - /* in body, replace instances of 'varId' with literal 'iter' */ - { - slang_variable *oldVar; - slang_operation *newOper; - - oldVar = _slang_variable_locate(oper->locals, varId, GL_TRUE); - if (!oldVar) { - /* undeclared loop variable */ - slang_operation_delete(body); - return NULL; - } - - newOper = slang_operation_new(1); - newOper->type = SLANG_OPER_LITERAL_INT; - newOper->literal_size = 1; - newOper->literal[0] = iter; - - /* replace instances of the loop variable with newOper */ - slang_substitute(A, body, 1, &oldVar, &newOper, GL_FALSE); - } - - /* do IR codegen for body */ - n = _slang_gen_operation(A, body); - root = new_seq(root, n); - - slang_operation_delete(body); - } - - return root; -} - - -/** - * Generate IR for a for-loop. Unrolling will be done when possible. - */ -static slang_ir_node * -_slang_gen_for(slang_assemble_ctx * A, const slang_operation *oper) -{ - GLboolean unroll = _slang_can_unroll_for_loop(A, oper); - - if (unroll) { - slang_ir_node *code = _slang_unroll_for_loop(A, oper); - if (code) - return code; - } - - /* conventional for-loop code generation */ - { - /* - * init code (child[0]) - * LOOP: - * BREAK if !expr (child[1]) - * body code (child[3]) - * tail code: - * incr code (child[2]) // XXX continue here - */ - slang_ir_node *prevLoop, *loop, *cond, *breakIf, *body, *init, *incr; - init = _slang_gen_operation(A, &oper->children[0]); - loop = new_loop(NULL); - - /* save old, push new loop */ - prevLoop = A->CurLoop; - A->CurLoop = loop; - - cond = new_cond(new_not(_slang_gen_operation(A, &oper->children[1]))); - breakIf = new_break_if_true(A->CurLoop, cond); - body = _slang_gen_operation(A, &oper->children[3]); - incr = _slang_gen_operation(A, &oper->children[2]); - - loop->Children[0] = new_seq(breakIf, body); - loop->Children[1] = incr; /* tail code */ - - /* pop loop, restore prev */ - A->CurLoop = prevLoop; - - return new_seq(init, loop); - } -} - - -static slang_ir_node * -_slang_gen_continue(slang_assemble_ctx * A, const slang_operation *oper) -{ - slang_ir_node *n, *loopNode; - assert(oper->type == SLANG_OPER_CONTINUE); - loopNode = A->CurLoop; - assert(loopNode); - assert(loopNode->Opcode == IR_LOOP); - n = new_node0(IR_CONT); - if (n) { - n->Parent = loopNode; - /* insert this node at head of linked list */ - n->List = loopNode->List; - loopNode->List = n; - } - return n; -} - - -/** - * Determine if the given operation is of a specific type. - */ -static GLboolean -is_operation_type(const slang_operation *oper, slang_operation_type type) -{ - if (oper->type == type) - return GL_TRUE; - else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE || - oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) && - oper->num_children == 1) - return is_operation_type(&oper->children[0], type); - else - return GL_FALSE; -} - - -/** - * Generate IR tree for an if/then/else conditional using high-level - * IR_IF instruction. - */ -static slang_ir_node * -_slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) -{ - /* - * eval expr (child[0]) - * IF expr THEN - * if-body code - * ELSE - * else-body code - * ENDIF - */ - const GLboolean haveElseClause = !_slang_is_noop(&oper->children[2]); - slang_ir_node *ifNode, *cond, *ifBody, *elseBody; - GLboolean isConst, constTrue; - - /* type-check expression */ - if (!_slang_is_boolean(A, &oper->children[0])) { - slang_info_log_error(A->log, "boolean expression expected for 'if'"); - return NULL; - } - - if (!_slang_is_scalar_or_boolean(A, &oper->children[0])) { - slang_info_log_error(A->log, "scalar/boolean expression expected for 'if'"); - return NULL; - } - - isConst = _slang_is_constant_cond(&oper->children[0], &constTrue); - if (isConst) { - if (constTrue) { - /* if (true) ... */ - return _slang_gen_operation(A, &oper->children[1]); - } - else { - /* if (false) ... */ - return _slang_gen_operation(A, &oper->children[2]); - } - } - - cond = _slang_gen_operation(A, &oper->children[0]); - cond = new_cond(cond); - - if (is_operation_type(&oper->children[1], SLANG_OPER_BREAK) - && !haveElseClause) { - /* Special case: generate a conditional break */ - ifBody = new_break_if_true(A->CurLoop, cond); - return ifBody; - } - else if (is_operation_type(&oper->children[1], SLANG_OPER_CONTINUE) - && !haveElseClause) { - /* Special case: generate a conditional break */ - ifBody = new_cont_if_true(A->CurLoop, cond); - return ifBody; - } - else { - /* general case */ - ifBody = _slang_gen_operation(A, &oper->children[1]); - if (haveElseClause) - elseBody = _slang_gen_operation(A, &oper->children[2]); - else - elseBody = NULL; - ifNode = new_if(cond, ifBody, elseBody); - return ifNode; - } -} - - - -static slang_ir_node * -_slang_gen_not(slang_assemble_ctx * A, const slang_operation *oper) -{ - slang_ir_node *n; - - assert(oper->type == SLANG_OPER_NOT); - - /* type-check expression */ - if (!_slang_is_scalar_or_boolean(A, &oper->children[0])) { - slang_info_log_error(A->log, - "scalar/boolean expression expected for '!'"); - return NULL; - } - - n = _slang_gen_operation(A, &oper->children[0]); - if (n) - return new_not(n); - else - return NULL; -} - - -static slang_ir_node * -_slang_gen_xor(slang_assemble_ctx * A, const slang_operation *oper) -{ - slang_ir_node *n1, *n2; - - assert(oper->type == SLANG_OPER_LOGICALXOR); - - if (!_slang_is_scalar_or_boolean(A, &oper->children[0]) || - !_slang_is_scalar_or_boolean(A, &oper->children[0])) { - slang_info_log_error(A->log, - "scalar/boolean expressions expected for '^^'"); - return NULL; - } - - n1 = _slang_gen_operation(A, &oper->children[0]); - if (!n1) - return NULL; - n2 = _slang_gen_operation(A, &oper->children[1]); - if (!n2) - return NULL; - return new_node2(IR_NOTEQUAL, n1, n2); -} - - -/** - * Generate IR node for storage of a temporary of given size. - */ -static slang_ir_node * -_slang_gen_temporary(GLint size) -{ - slang_ir_storage *store; - slang_ir_node *n = NULL; - - store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -2, size); - if (store) { - n = new_node0(IR_VAR_DECL); - if (n) { - n->Store = store; - } - else { - _slang_free(store); - } - } - return n; -} - - -/** - * Generate program constants for an array. - * Ex: const vec2[3] v = vec2[3](vec2(1,1), vec2(2,2), vec2(3,3)); - * This will allocate and initialize three vector constants, storing - * the array in constant memory, not temporaries like a non-const array. - * This can also be used for uniform array initializers. - * \return GL_TRUE for success, GL_FALSE if failure (semantic error, etc). - */ -static GLboolean -make_constant_array(slang_assemble_ctx *A, - slang_variable *var, - slang_operation *initializer) -{ - struct gl_program *prog = A->program; - const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier); - const char *varName = (char *) var->a_name; - const GLuint numElements = initializer->num_children; - GLint size; - GLuint i, j; - GLfloat *values; - - if (!var->store) { - var->store = _slang_new_ir_storage(PROGRAM_UNDEFINED, -6, -6); - } - size = var->store->Size; - - assert(var->type.qualifier == SLANG_QUAL_CONST || - var->type.qualifier == SLANG_QUAL_UNIFORM); - assert(initializer->type == SLANG_OPER_CALL); - assert(initializer->array_constructor); - - values = (GLfloat *) _mesa_malloc(numElements * 4 * sizeof(GLfloat)); - - /* convert constructor params into ordinary floats */ - for (i = 0; i < numElements; i++) { - const slang_operation *op = &initializer->children[i]; - if (op->type != SLANG_OPER_LITERAL_FLOAT) { - /* unsupported type for this optimization */ - free(values); - return GL_FALSE; - } - for (j = 0; j < op->literal_size; j++) { - values[i * 4 + j] = op->literal[j]; - } - for ( ; j < 4; j++) { - values[i * 4 + j] = 0.0f; - } - } - - /* slightly different paths for constants vs. uniforms */ - if (var->type.qualifier == SLANG_QUAL_UNIFORM) { - var->store->File = PROGRAM_UNIFORM; - var->store->Index = _mesa_add_uniform(prog->Parameters, varName, - size, datatype, values); - } - else { - var->store->File = PROGRAM_CONSTANT; - var->store->Index = _mesa_add_named_constant(prog->Parameters, varName, - values, size); - } - assert(var->store->Size == size); - - _mesa_free(values); - - return GL_TRUE; -} - - - -/** - * Generate IR node for allocating/declaring a variable (either a local or - * a global). - * Generally, this involves allocating an slang_ir_storage instance for the - * variable, choosing a register file (temporary, constant, etc). - * For ordinary variables we do not yet allocate storage though. We do that - * when we find the first actual use of the variable to avoid allocating temp - * regs that will never get used. - * At this time, uniforms are always allocated space in this function. - * - * \param initializer Optional initializer expression for the variable. - */ -static slang_ir_node * -_slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var, - slang_operation *initializer) -{ - const char *varName = (const char *) var->a_name; - const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier); - slang_ir_node *varDecl, *n; - slang_ir_storage *store; - GLint arrayLen, size, totalSize; /* if array then totalSize > size */ - enum register_file file; - - /*assert(!var->declared);*/ - var->declared = GL_TRUE; - - /* determine GPU register file for simple cases */ - if (is_sampler_type(&var->type)) { - file = PROGRAM_SAMPLER; - } - else if (var->type.qualifier == SLANG_QUAL_UNIFORM) { - file = PROGRAM_UNIFORM; - } - else { - file = PROGRAM_TEMPORARY; - } - - totalSize = size = _slang_sizeof_type_specifier(&var->type.specifier); - if (size <= 0) { - slang_info_log_error(A->log, "invalid declaration for '%s'", varName); - return NULL; - } - - arrayLen = _slang_array_length(var); - totalSize = _slang_array_size(size, arrayLen); - - /* Allocate IR node for the declaration */ - varDecl = new_node0(IR_VAR_DECL); - if (!varDecl) - return NULL; - - _slang_attach_storage(varDecl, var); /* undefined storage at first */ - assert(var->store); - assert(varDecl->Store == var->store); - assert(varDecl->Store); - assert(varDecl->Store->Index < 0); - store = var->store; - - assert(store == varDecl->Store); - - - /* Fill in storage fields which we now know. store->Index/Swizzle may be - * set for some cases below. Otherwise, store->Index/Swizzle will be set - * during code emit. - */ - store->File = file; - store->Size = totalSize; - - /* if there's an initializer, generate IR for the expression */ - if (initializer) { - slang_ir_node *varRef, *init; - - if (var->type.qualifier == SLANG_QUAL_CONST) { - /* if the variable is const, the initializer must be a const - * expression as well. - */ -#if 0 - if (!_slang_is_constant_expr(initializer)) { - slang_info_log_error(A->log, - "initializer for %s not constant", varName); - return NULL; - } -#endif - } - - /* IR for the variable we're initializing */ - varRef = new_var(A, var); - if (!varRef) { - slang_info_log_error(A->log, "out of memory"); - return NULL; - } - - /* constant-folding, etc here */ - _slang_simplify(initializer, &A->space, A->atoms); - - /* look for simple constant-valued variables and uniforms */ - if (var->type.qualifier == SLANG_QUAL_CONST || - var->type.qualifier == SLANG_QUAL_UNIFORM) { - - if (initializer->type == SLANG_OPER_CALL && - initializer->array_constructor) { - /* array initializer */ - if (make_constant_array(A, var, initializer)) - return varRef; - } - else if (initializer->type == SLANG_OPER_LITERAL_FLOAT || - initializer->type == SLANG_OPER_LITERAL_INT) { - /* simple float/vector initializer */ - if (store->File == PROGRAM_UNIFORM) { - store->Index = _mesa_add_uniform(A->program->Parameters, - varName, - totalSize, datatype, - initializer->literal); - store->Swizzle = _slang_var_swizzle(size, 0); - return varRef; - } -#if 0 - else { - store->File = PROGRAM_CONSTANT; - store->Index = _mesa_add_named_constant(A->program->Parameters, - varName, - initializer->literal, - totalSize); - store->Swizzle = _slang_var_swizzle(size, 0); - return varRef; - } -#endif - } - } - - /* IR for initializer */ - init = _slang_gen_operation(A, initializer); - if (!init) - return NULL; - - /* XXX remove this when type checking is added above */ - if (init->Store && init->Store->Size != totalSize) { - slang_info_log_error(A->log, "invalid assignment (wrong types)"); - return NULL; - } - - /* assign RHS to LHS */ - n = new_node2(IR_COPY, varRef, init); - n = new_seq(varDecl, n); - } - else { - /* no initializer */ - n = varDecl; - } - - if (store->File == PROGRAM_UNIFORM && store->Index < 0) { - /* always need to allocate storage for uniforms at this point */ - store->Index = _mesa_add_uniform(A->program->Parameters, varName, - totalSize, datatype, NULL); - store->Swizzle = _slang_var_swizzle(size, 0); - } - -#if 0 - printf("%s var %p %s store=%p index=%d size=%d\n", - __FUNCTION__, (void *) var, (char *) varName, - (void *) store, store->Index, store->Size); -#endif - - return n; -} - - -/** - * Generate code for a selection expression: b ? x : y - * XXX In some cases we could implement a selection expression - * with an LRP instruction (use the boolean as the interpolant). - * Otherwise, we use an IF/ELSE/ENDIF construct. - */ -static slang_ir_node * -_slang_gen_select(slang_assemble_ctx *A, slang_operation *oper) -{ - slang_ir_node *cond, *ifNode, *trueExpr, *falseExpr, *trueNode, *falseNode; - slang_ir_node *tmpDecl, *tmpVar, *tree; - slang_typeinfo type0, type1, type2; - int size, isBool, isEqual; - - assert(oper->type == SLANG_OPER_SELECT); - assert(oper->num_children == 3); - - /* type of children[0] must be boolean */ - slang_typeinfo_construct(&type0); - typeof_operation(A, &oper->children[0], &type0); - isBool = (type0.spec.type == SLANG_SPEC_BOOL); - slang_typeinfo_destruct(&type0); - if (!isBool) { - slang_info_log_error(A->log, "selector type is not boolean"); - return NULL; - } - - slang_typeinfo_construct(&type1); - slang_typeinfo_construct(&type2); - typeof_operation(A, &oper->children[1], &type1); - typeof_operation(A, &oper->children[2], &type2); - isEqual = slang_type_specifier_equal(&type1.spec, &type2.spec); - slang_typeinfo_destruct(&type1); - slang_typeinfo_destruct(&type2); - if (!isEqual) { - slang_info_log_error(A->log, "incompatible types for ?: operator"); - return NULL; - } - - /* size of x or y's type */ - size = _slang_sizeof_type_specifier(&type1.spec); - assert(size > 0); - - /* temporary var */ - tmpDecl = _slang_gen_temporary(size); - - /* the condition (child 0) */ - cond = _slang_gen_operation(A, &oper->children[0]); - cond = new_cond(cond); - - /* if-true body (child 1) */ - tmpVar = new_node0(IR_VAR); - tmpVar->Store = tmpDecl->Store; - trueExpr = _slang_gen_operation(A, &oper->children[1]); - trueNode = new_node2(IR_COPY, tmpVar, trueExpr); - - /* if-false body (child 2) */ - tmpVar = new_node0(IR_VAR); - tmpVar->Store = tmpDecl->Store; - falseExpr = _slang_gen_operation(A, &oper->children[2]); - falseNode = new_node2(IR_COPY, tmpVar, falseExpr); - - ifNode = new_if(cond, trueNode, falseNode); - - /* tmp var value */ - tmpVar = new_node0(IR_VAR); - tmpVar->Store = tmpDecl->Store; - - tree = new_seq(ifNode, tmpVar); - tree = new_seq(tmpDecl, tree); - - /*_slang_print_ir_tree(tree, 10);*/ - return tree; -} - - -/** - * Generate code for &&. - */ -static slang_ir_node * -_slang_gen_logical_and(slang_assemble_ctx *A, slang_operation *oper) -{ - /* rewrite "a && b" as "a ? b : false" */ - slang_operation *select; - slang_ir_node *n; - - select = slang_operation_new(1); - select->type = SLANG_OPER_SELECT; - select->num_children = 3; - select->children = slang_operation_new(3); - - slang_operation_copy(&select->children[0], &oper->children[0]); - slang_operation_copy(&select->children[1], &oper->children[1]); - select->children[2].type = SLANG_OPER_LITERAL_BOOL; - ASSIGN_4V(select->children[2].literal, 0, 0, 0, 0); /* false */ - select->children[2].literal_size = 1; - - n = _slang_gen_select(A, select); - return n; -} - - -/** - * Generate code for ||. - */ -static slang_ir_node * -_slang_gen_logical_or(slang_assemble_ctx *A, slang_operation *oper) -{ - /* rewrite "a || b" as "a ? true : b" */ - slang_operation *select; - slang_ir_node *n; - - select = slang_operation_new(1); - select->type = SLANG_OPER_SELECT; - select->num_children = 3; - select->children = slang_operation_new(3); - - slang_operation_copy(&select->children[0], &oper->children[0]); - select->children[1].type = SLANG_OPER_LITERAL_BOOL; - ASSIGN_4V(select->children[1].literal, 1, 1, 1, 1); /* true */ - select->children[1].literal_size = 1; - slang_operation_copy(&select->children[2], &oper->children[1]); - - n = _slang_gen_select(A, select); - return n; -} - - -/** - * Generate IR tree for a return statement. - */ -static slang_ir_node * -_slang_gen_return(slang_assemble_ctx * A, slang_operation *oper) -{ - const GLboolean haveReturnValue - = (oper->num_children == 1 && oper->children[0].type != SLANG_OPER_VOID); - - /* error checking */ - assert(A->CurFunction); - if (haveReturnValue && - A->CurFunction->header.type.specifier.type == SLANG_SPEC_VOID) { - slang_info_log_error(A->log, "illegal return expression"); - return NULL; - } - else if (!haveReturnValue && - A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) { - slang_info_log_error(A->log, "return statement requires an expression"); - return NULL; - } - - if (!haveReturnValue) { - return new_return(A->curFuncEndLabel); - } - else { - /* - * Convert from: - * return expr; - * To: - * __retVal = expr; - * return; // goto __endOfFunction - */ - slang_operation *assign; - slang_atom a_retVal; - slang_ir_node *n; - - a_retVal = slang_atom_pool_atom(A->atoms, "__retVal"); - assert(a_retVal); - -#if 1 /* DEBUG */ - { - slang_variable *v = - _slang_variable_locate(oper->locals, a_retVal, GL_TRUE); - if (!v) { - /* trying to return a value in a void-valued function */ - return NULL; - } - } -#endif - - assign = slang_operation_new(1); - assign->type = SLANG_OPER_ASSIGN; - assign->num_children = 2; - assign->children = slang_operation_new(2); - /* lhs (__retVal) */ - assign->children[0].type = SLANG_OPER_IDENTIFIER; - assign->children[0].a_id = a_retVal; - assign->children[0].locals->outer_scope = assign->locals; - /* rhs (expr) */ - /* XXX we might be able to avoid this copy someday */ - slang_operation_copy(&assign->children[1], &oper->children[0]); - - /* assemble the new code */ - n = new_seq(_slang_gen_operation(A, assign), - new_return(A->curFuncEndLabel)); - - slang_operation_delete(assign); - return n; - } -} - - -#if 0 -/** - * Determine if the given operation/expression is const-valued. - */ -static GLboolean -_slang_is_constant_expr(const slang_operation *oper) -{ - slang_variable *var; - GLuint i; - - switch (oper->type) { - case SLANG_OPER_IDENTIFIER: - var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE); - if (var && var->type.qualifier == SLANG_QUAL_CONST) - return GL_TRUE; - return GL_FALSE; - default: - for (i = 0; i < oper->num_children; i++) { - if (!_slang_is_constant_expr(&oper->children[i])) - return GL_FALSE; - } - return GL_TRUE; - } -} -#endif - - -/** - * Check if an assignment of type t1 to t0 is legal. - * XXX more cases needed. - */ -static GLboolean -_slang_assignment_compatible(slang_assemble_ctx *A, - slang_operation *op0, - slang_operation *op1) -{ - slang_typeinfo t0, t1; - GLuint sz0, sz1; - - if (op0->type == SLANG_OPER_POSTINCREMENT || - op0->type == SLANG_OPER_POSTDECREMENT) { - return GL_FALSE; - } - - slang_typeinfo_construct(&t0); - typeof_operation(A, op0, &t0); - - slang_typeinfo_construct(&t1); - typeof_operation(A, op1, &t1); - - sz0 = _slang_sizeof_type_specifier(&t0.spec); - sz1 = _slang_sizeof_type_specifier(&t1.spec); - -#if 1 - if (sz0 != sz1) { - /*printf("assignment size mismatch %u vs %u\n", sz0, sz1);*/ - return GL_FALSE; - } -#endif - - if (t0.spec.type == SLANG_SPEC_STRUCT && - t1.spec.type == SLANG_SPEC_STRUCT && - t0.spec._struct->a_name != t1.spec._struct->a_name) - return GL_FALSE; - - if (t0.spec.type == SLANG_SPEC_FLOAT && - t1.spec.type == SLANG_SPEC_BOOL) - return GL_FALSE; - -#if 0 /* not used just yet - causes problems elsewhere */ - if (t0.spec.type == SLANG_SPEC_INT && - t1.spec.type == SLANG_SPEC_FLOAT) - return GL_FALSE; -#endif - - if (t0.spec.type == SLANG_SPEC_BOOL && - t1.spec.type == SLANG_SPEC_FLOAT) - return GL_FALSE; - - if (t0.spec.type == SLANG_SPEC_BOOL && - t1.spec.type == SLANG_SPEC_INT) - return GL_FALSE; - - return GL_TRUE; -} - - -/** - * Generate IR tree for a local variable declaration. - * Basically do some error checking and call _slang_gen_var_decl(). - */ -static slang_ir_node * -_slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper) -{ - const char *varName = (char *) oper->a_id; - slang_variable *var; - slang_ir_node *varDecl; - slang_operation *initializer; - - assert(oper->type == SLANG_OPER_VARIABLE_DECL); - assert(oper->num_children <= 1); - - /* lookup the variable by name */ - var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE); - if (!var) - return NULL; /* "shouldn't happen" */ - - if (var->type.qualifier == SLANG_QUAL_ATTRIBUTE || - var->type.qualifier == SLANG_QUAL_VARYING || - var->type.qualifier == SLANG_QUAL_UNIFORM) { - /* can't declare attribute/uniform vars inside functions */ - slang_info_log_error(A->log, - "local variable '%s' cannot be an attribute/uniform/varying", - varName); - return NULL; - } - -#if 0 - if (v->declared) { - slang_info_log_error(A->log, "variable '%s' redeclared", varName); - return NULL; - } -#endif - - /* check if the var has an initializer */ - if (oper->num_children > 0) { - assert(oper->num_children == 1); - initializer = &oper->children[0]; - } - else if (var->initializer) { - initializer = var->initializer; - } - else { - initializer = NULL; - } - - if (initializer) { - /* check/compare var type and initializer type */ - if (!_slang_assignment_compatible(A, oper, initializer)) { - slang_info_log_error(A->log, "incompatible types in assignment"); - return NULL; - } - } - else { - if (var->type.qualifier == SLANG_QUAL_CONST) { - slang_info_log_error(A->log, - "const-qualified variable '%s' requires initializer", - varName); - return NULL; - } - } - - /* Generate IR node */ - varDecl = _slang_gen_var_decl(A, var, initializer); - if (!varDecl) - return NULL; - - return varDecl; -} - - -/** - * Generate IR tree for a reference to a variable (such as in an expression). - * This is different from a variable declaration. - */ -static slang_ir_node * -_slang_gen_variable(slang_assemble_ctx * A, slang_operation *oper) -{ - /* If there's a variable associated with this oper (from inlining) - * use it. Otherwise, use the oper's var id. - */ - slang_atom name = oper->var ? oper->var->a_name : oper->a_id; - slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE); - slang_ir_node *n; - if (!var) { - slang_info_log_error(A->log, "undefined variable '%s'", (char *) name); - return NULL; - } - assert(var->declared); - n = new_var(A, var); - return n; -} - - - -/** - * Return the number of components actually named by the swizzle. - * Recall that swizzles may have undefined/don't-care values. - */ -static GLuint -swizzle_size(GLuint swizzle) -{ - GLuint size = 0, i; - for (i = 0; i < 4; i++) { - GLuint swz = GET_SWZ(swizzle, i); - size += (swz >= 0 && swz <= 3); - } - return size; -} - - -static slang_ir_node * -_slang_gen_swizzle(slang_ir_node *child, GLuint swizzle) -{ - slang_ir_node *n = new_node1(IR_SWIZZLE, child); - assert(child); - if (n) { - assert(!n->Store); - n->Store = _slang_new_ir_storage_relative(0, - swizzle_size(swizzle), - child->Store); - n->Store->Swizzle = swizzle; - } - return n; -} - - -static GLboolean -is_store_writable(const slang_assemble_ctx *A, const slang_ir_storage *store) -{ - while (store->Parent) - store = store->Parent; - - if (!(store->File == PROGRAM_OUTPUT || - store->File == PROGRAM_TEMPORARY || - (store->File == PROGRAM_VARYING && - A->program->Target == GL_VERTEX_PROGRAM_ARB))) { - return GL_FALSE; - } - else { - return GL_TRUE; - } -} - - -/** - * Walk up an IR storage path to compute the final swizzle. - * This is used when we find an expression such as "foo.xz.yx". - */ -static GLuint -root_swizzle(const slang_ir_storage *st) -{ - GLuint swizzle = st->Swizzle; - while (st->Parent) { - st = st->Parent; - swizzle = _slang_swizzle_swizzle(st->Swizzle, swizzle); - } - return swizzle; -} - - -/** - * Generate IR tree for an assignment (=). - */ -static slang_ir_node * -_slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper) -{ - if (oper->children[0].type == SLANG_OPER_IDENTIFIER) { - /* Check that var is writeable */ - slang_variable *var - = _slang_variable_locate(oper->children[0].locals, - oper->children[0].a_id, GL_TRUE); - if (!var) { - slang_info_log_error(A->log, "undefined variable '%s'", - (char *) oper->children[0].a_id); - return NULL; - } - if (var->type.qualifier == SLANG_QUAL_CONST || - var->type.qualifier == SLANG_QUAL_ATTRIBUTE || - var->type.qualifier == SLANG_QUAL_UNIFORM || - (var->type.qualifier == SLANG_QUAL_VARYING && - A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) { - slang_info_log_error(A->log, - "illegal assignment to read-only variable '%s'", - (char *) oper->children[0].a_id); - return NULL; - } - } - - if (oper->children[0].type == SLANG_OPER_IDENTIFIER && - oper->children[1].type == SLANG_OPER_CALL) { - /* Special case of: x = f(a, b) - * Replace with f(a, b, x) (where x == hidden __retVal out param) - * - * XXX this could be even more effective if we could accomodate - * cases such as "v.x = f();" - would help with typical vertex - * transformation. - */ - slang_ir_node *n; - n = _slang_gen_function_call_name(A, - (const char *) oper->children[1].a_id, - &oper->children[1], &oper->children[0]); - return n; - } - else { - slang_ir_node *n, *lhs, *rhs; - - /* lhs and rhs type checking */ - if (!_slang_assignment_compatible(A, - &oper->children[0], - &oper->children[1])) { - slang_info_log_error(A->log, "incompatible types in assignment"); - return NULL; - } - - lhs = _slang_gen_operation(A, &oper->children[0]); - if (!lhs) { - return NULL; - } - - if (!lhs->Store) { - slang_info_log_error(A->log, - "invalid left hand side for assignment"); - return NULL; - } - - /* check that lhs is writable */ - if (!is_store_writable(A, lhs->Store)) { - slang_info_log_error(A->log, - "illegal assignment to read-only l-value"); - return NULL; - } - - rhs = _slang_gen_operation(A, &oper->children[1]); - if (lhs && rhs) { - /* convert lhs swizzle into writemask */ - const GLuint swizzle = root_swizzle(lhs->Store); - GLuint writemask, newSwizzle = 0x0; - if (!swizzle_to_writemask(A, swizzle, &writemask, &newSwizzle)) { - /* Non-simple writemask, need to swizzle right hand side in - * order to put components into the right place. - */ - rhs = _slang_gen_swizzle(rhs, newSwizzle); - } - n = new_node2(IR_COPY, lhs, rhs); - return n; - } - else { - return NULL; - } - } -} - - -/** - * Generate IR tree for referencing a field in a struct (or basic vector type) - */ -static slang_ir_node * -_slang_gen_struct_field(slang_assemble_ctx * A, slang_operation *oper) -{ - slang_typeinfo ti; - - /* type of struct */ - slang_typeinfo_construct(&ti); - typeof_operation(A, &oper->children[0], &ti); - - if (_slang_type_is_vector(ti.spec.type)) { - /* the field should be a swizzle */ - const GLuint rows = _slang_type_dim(ti.spec.type); - slang_swizzle swz; - slang_ir_node *n; - GLuint swizzle; - if (!_slang_is_swizzle((char *) oper->a_id, rows, &swz)) { - slang_info_log_error(A->log, "Bad swizzle"); - return NULL; - } - swizzle = MAKE_SWIZZLE4(swz.swizzle[0], - swz.swizzle[1], - swz.swizzle[2], - swz.swizzle[3]); - - n = _slang_gen_operation(A, &oper->children[0]); - /* create new parent node with swizzle */ - if (n) - n = _slang_gen_swizzle(n, swizzle); - return n; - } - else if ( ti.spec.type == SLANG_SPEC_FLOAT - || ti.spec.type == SLANG_SPEC_INT - || ti.spec.type == SLANG_SPEC_BOOL) { - const GLuint rows = 1; - slang_swizzle swz; - slang_ir_node *n; - GLuint swizzle; - if (!_slang_is_swizzle((char *) oper->a_id, rows, &swz)) { - slang_info_log_error(A->log, "Bad swizzle"); - } - swizzle = MAKE_SWIZZLE4(swz.swizzle[0], - swz.swizzle[1], - swz.swizzle[2], - swz.swizzle[3]); - n = _slang_gen_operation(A, &oper->children[0]); - /* create new parent node with swizzle */ - n = _slang_gen_swizzle(n, swizzle); - return n; - } - else { - /* the field is a structure member (base.field) */ - /* oper->children[0] is the base */ - /* oper->a_id is the field name */ - slang_ir_node *base, *n; - slang_typeinfo field_ti; - GLint fieldSize, fieldOffset = -1; - - /* type of field */ - slang_typeinfo_construct(&field_ti); - typeof_operation(A, oper, &field_ti); - - fieldSize = _slang_sizeof_type_specifier(&field_ti.spec); - if (fieldSize > 0) - fieldOffset = _slang_field_offset(&ti.spec, oper->a_id); - - if (fieldSize == 0 || fieldOffset < 0) { - const char *structName; - if (ti.spec._struct) - structName = (char *) ti.spec._struct->a_name; - else - structName = "unknown"; - slang_info_log_error(A->log, - "\"%s\" is not a member of struct \"%s\"", - (char *) oper->a_id, structName); - return NULL; - } - assert(fieldSize >= 0); - - base = _slang_gen_operation(A, &oper->children[0]); - if (!base) { - /* error msg should have already been logged */ - return NULL; - } - - n = new_node1(IR_FIELD, base); - if (!n) - return NULL; - - n->Field = (char *) oper->a_id; - - /* Store the field's offset in storage->Index */ - n->Store = _slang_new_ir_storage(base->Store->File, - fieldOffset, - fieldSize); - - return n; - } -} - - -/** - * Gen code for array indexing. - */ -static slang_ir_node * -_slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper) -{ - slang_typeinfo array_ti; - - /* get array's type info */ - slang_typeinfo_construct(&array_ti); - typeof_operation(A, &oper->children[0], &array_ti); - - if (_slang_type_is_vector(array_ti.spec.type)) { - /* indexing a simple vector type: "vec4 v; v[0]=p;" */ - /* translate the index into a swizzle/writemask: "v.x=p" */ - const GLuint max = _slang_type_dim(array_ti.spec.type); - GLint index; - slang_ir_node *n; - - index = (GLint) oper->children[1].literal[0]; - if (oper->children[1].type != SLANG_OPER_LITERAL_INT || - index >= (GLint) max) { -#if 0 - slang_info_log_error(A->log, "Invalid array index for vector type"); - printf("type = %d\n", oper->children[1].type); - printf("index = %d, max = %d\n", index, max); - printf("array = %s\n", (char*)oper->children[0].a_id); - printf("index = %s\n", (char*)oper->children[1].a_id); - return NULL; -#else - index = 0; -#endif - } - - n = _slang_gen_operation(A, &oper->children[0]); - if (n) { - /* use swizzle to access the element */ - GLuint swizzle = MAKE_SWIZZLE4(SWIZZLE_X + index, - SWIZZLE_NIL, - SWIZZLE_NIL, - SWIZZLE_NIL); - n = _slang_gen_swizzle(n, swizzle); - } - assert(n->Store); - return n; - } - else { - /* conventional array */ - slang_typeinfo elem_ti; - slang_ir_node *elem, *array, *index; - GLint elemSize, arrayLen; - - /* size of array element */ - slang_typeinfo_construct(&elem_ti); - typeof_operation(A, oper, &elem_ti); - elemSize = _slang_sizeof_type_specifier(&elem_ti.spec); - - if (_slang_type_is_matrix(array_ti.spec.type)) - arrayLen = _slang_type_dim(array_ti.spec.type); - else - arrayLen = array_ti.array_len; - - slang_typeinfo_destruct(&array_ti); - slang_typeinfo_destruct(&elem_ti); - - if (elemSize <= 0) { - /* unknown var or type */ - slang_info_log_error(A->log, "Undefined variable or type"); - return NULL; - } - - array = _slang_gen_operation(A, &oper->children[0]); - index = _slang_gen_operation(A, &oper->children[1]); - if (array && index) { - /* bounds check */ - GLint constIndex = -1; - if (index->Opcode == IR_FLOAT) { - constIndex = (int) index->Value[0]; - if (constIndex < 0 || constIndex >= arrayLen) { - slang_info_log_error(A->log, - "Array index out of bounds (index=%d size=%d)", - constIndex, arrayLen); - _slang_free_ir_tree(array); - _slang_free_ir_tree(index); - return NULL; - } - } - - if (!array->Store) { - slang_info_log_error(A->log, "Invalid array"); - return NULL; - } - - elem = new_node2(IR_ELEMENT, array, index); - - /* The storage info here will be updated during code emit */ - elem->Store = _slang_new_ir_storage(array->Store->File, - array->Store->Index, - elemSize); - elem->Store->Swizzle = _slang_var_swizzle(elemSize, 0); - return elem; - } - else { - _slang_free_ir_tree(array); - _slang_free_ir_tree(index); - return NULL; - } - } -} - - -static slang_ir_node * -_slang_gen_compare(slang_assemble_ctx *A, slang_operation *oper, - slang_ir_opcode opcode) -{ - slang_typeinfo t0, t1; - slang_ir_node *n; - - slang_typeinfo_construct(&t0); - typeof_operation(A, &oper->children[0], &t0); - - slang_typeinfo_construct(&t1); - typeof_operation(A, &oper->children[0], &t1); - - if (t0.spec.type == SLANG_SPEC_ARRAY || - t1.spec.type == SLANG_SPEC_ARRAY) { - slang_info_log_error(A->log, "Illegal array comparison"); - return NULL; - } - - if (oper->type != SLANG_OPER_EQUAL && - oper->type != SLANG_OPER_NOTEQUAL) { - /* <, <=, >, >= can only be used with scalars */ - if ((t0.spec.type != SLANG_SPEC_INT && - t0.spec.type != SLANG_SPEC_FLOAT) || - (t1.spec.type != SLANG_SPEC_INT && - t1.spec.type != SLANG_SPEC_FLOAT)) { - slang_info_log_error(A->log, "Incompatible type(s) for inequality operator"); - return NULL; - } - } - - n = new_node2(opcode, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); - - /* result is a bool (size 1) */ - n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, 1); - - return n; -} - - -#if 0 -static void -print_vars(slang_variable_scope *s) -{ - int i; - printf("vars: "); - for (i = 0; i < s->num_variables; i++) { - printf("%s %d, \n", - (char*) s->variables[i]->a_name, - s->variables[i]->declared); - } - - printf("\n"); -} -#endif - - -#if 0 -static void -_slang_undeclare_vars(slang_variable_scope *locals) -{ - if (locals->num_variables > 0) { - int i; - for (i = 0; i < locals->num_variables; i++) { - slang_variable *v = locals->variables[i]; - printf("undeclare %s at %p\n", (char*) v->a_name, v); - v->declared = GL_FALSE; - } - } -} -#endif - - -/** - * Generate IR tree for a slang_operation (AST node) - */ -static slang_ir_node * -_slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) -{ - switch (oper->type) { - case SLANG_OPER_BLOCK_NEW_SCOPE: - { - slang_ir_node *n; - - _slang_push_var_table(A->vartable); - - oper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE; /* temp change */ - n = _slang_gen_operation(A, oper); - oper->type = SLANG_OPER_BLOCK_NEW_SCOPE; /* restore */ - - _slang_pop_var_table(A->vartable); - - /*_slang_undeclare_vars(oper->locals);*/ - /*print_vars(oper->locals);*/ - - if (n) - n = new_node1(IR_SCOPE, n); - return n; - } - break; - - case SLANG_OPER_BLOCK_NO_NEW_SCOPE: - /* list of operations */ - if (oper->num_children > 0) - { - slang_ir_node *n, *tree = NULL; - GLuint i; - - for (i = 0; i < oper->num_children; i++) { - n = _slang_gen_operation(A, &oper->children[i]); - if (!n) { - _slang_free_ir_tree(tree); - return NULL; /* error must have occured */ - } - tree = new_seq(tree, n); - } - - return tree; - } - else { - return new_node0(IR_NOP); - } - - case SLANG_OPER_EXPRESSION: - return _slang_gen_operation(A, &oper->children[0]); - - case SLANG_OPER_FOR: - return _slang_gen_for(A, oper); - case SLANG_OPER_DO: - return _slang_gen_do(A, oper); - case SLANG_OPER_WHILE: - return _slang_gen_while(A, oper); - case SLANG_OPER_BREAK: - if (!A->CurLoop) { - slang_info_log_error(A->log, "'break' not in loop"); - return NULL; - } - return new_break(A->CurLoop); - case SLANG_OPER_CONTINUE: - if (!A->CurLoop) { - slang_info_log_error(A->log, "'continue' not in loop"); - return NULL; - } - return _slang_gen_continue(A, oper); - case SLANG_OPER_DISCARD: - return new_node0(IR_KILL); - - case SLANG_OPER_EQUAL: - return _slang_gen_compare(A, oper, IR_EQUAL); - case SLANG_OPER_NOTEQUAL: - return _slang_gen_compare(A, oper, IR_NOTEQUAL); - case SLANG_OPER_GREATER: - return _slang_gen_compare(A, oper, IR_SGT); - case SLANG_OPER_LESS: - return _slang_gen_compare(A, oper, IR_SLT); - case SLANG_OPER_GREATEREQUAL: - return _slang_gen_compare(A, oper, IR_SGE); - case SLANG_OPER_LESSEQUAL: - return _slang_gen_compare(A, oper, IR_SLE); - case SLANG_OPER_ADD: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "+", oper, NULL); - return n; - } - case SLANG_OPER_SUBTRACT: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "-", oper, NULL); - return n; - } - case SLANG_OPER_MULTIPLY: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "*", oper, NULL); - return n; - } - case SLANG_OPER_DIVIDE: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "/", oper, NULL); - return n; - } - case SLANG_OPER_MINUS: - { - slang_ir_node *n; - assert(oper->num_children == 1); - n = _slang_gen_function_call_name(A, "-", oper, NULL); - return n; - } - case SLANG_OPER_PLUS: - /* +expr --> do nothing */ - return _slang_gen_operation(A, &oper->children[0]); - case SLANG_OPER_VARIABLE_DECL: - return _slang_gen_declaration(A, oper); - case SLANG_OPER_ASSIGN: - return _slang_gen_assignment(A, oper); - case SLANG_OPER_ADDASSIGN: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "+=", oper, NULL); - return n; - } - case SLANG_OPER_SUBASSIGN: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "-=", oper, NULL); - return n; - } - break; - case SLANG_OPER_MULASSIGN: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "*=", oper, NULL); - return n; - } - case SLANG_OPER_DIVASSIGN: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_function_call_name(A, "/=", oper, NULL); - return n; - } - case SLANG_OPER_LOGICALAND: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_logical_and(A, oper); - return n; - } - case SLANG_OPER_LOGICALOR: - { - slang_ir_node *n; - assert(oper->num_children == 2); - n = _slang_gen_logical_or(A, oper); - return n; - } - case SLANG_OPER_LOGICALXOR: - return _slang_gen_xor(A, oper); - case SLANG_OPER_NOT: - return _slang_gen_not(A, oper); - case SLANG_OPER_SELECT: /* b ? x : y */ - { - slang_ir_node *n; - assert(oper->num_children == 3); - n = _slang_gen_select(A, oper); - return n; - } - - case SLANG_OPER_ASM: - return _slang_gen_asm(A, oper, NULL); - case SLANG_OPER_CALL: - return _slang_gen_function_call_name(A, (const char *) oper->a_id, - oper, NULL); - case SLANG_OPER_METHOD: - return _slang_gen_method_call(A, oper); - case SLANG_OPER_RETURN: - return _slang_gen_return(A, oper); - case SLANG_OPER_LABEL: - return new_label(oper->label); - case SLANG_OPER_IDENTIFIER: - return _slang_gen_variable(A, oper); - case SLANG_OPER_IF: - return _slang_gen_if(A, oper); - case SLANG_OPER_FIELD: - return _slang_gen_struct_field(A, oper); - case SLANG_OPER_SUBSCRIPT: - return _slang_gen_array_element(A, oper); - case SLANG_OPER_LITERAL_FLOAT: - /* fall-through */ - case SLANG_OPER_LITERAL_INT: - /* fall-through */ - case SLANG_OPER_LITERAL_BOOL: - return new_float_literal(oper->literal, oper->literal_size); - - case SLANG_OPER_POSTINCREMENT: /* var++ */ - { - slang_ir_node *n; - assert(oper->num_children == 1); - n = _slang_gen_function_call_name(A, "__postIncr", oper, NULL); - return n; - } - case SLANG_OPER_POSTDECREMENT: /* var-- */ - { - slang_ir_node *n; - assert(oper->num_children == 1); - n = _slang_gen_function_call_name(A, "__postDecr", oper, NULL); - return n; - } - case SLANG_OPER_PREINCREMENT: /* ++var */ - { - slang_ir_node *n; - assert(oper->num_children == 1); - n = _slang_gen_function_call_name(A, "++", oper, NULL); - return n; - } - case SLANG_OPER_PREDECREMENT: /* --var */ - { - slang_ir_node *n; - assert(oper->num_children == 1); - n = _slang_gen_function_call_name(A, "--", oper, NULL); - return n; - } - - case SLANG_OPER_NON_INLINED_CALL: - case SLANG_OPER_SEQUENCE: - { - slang_ir_node *tree = NULL; - GLuint i; - for (i = 0; i < oper->num_children; i++) { - slang_ir_node *n = _slang_gen_operation(A, &oper->children[i]); - tree = new_seq(tree, n); - if (n) - tree->Store = n->Store; - } - if (oper->type == SLANG_OPER_NON_INLINED_CALL) { - tree = new_function_call(tree, oper->label); - } - return tree; - } - - case SLANG_OPER_NONE: - case SLANG_OPER_VOID: - /* returning NULL here would generate an error */ - return new_node0(IR_NOP); - - default: - _mesa_problem(NULL, "bad node type %d in _slang_gen_operation", - oper->type); - return new_node0(IR_NOP); - } - - return NULL; -} - - -/** - * Check if the given type specifier is a rectangular texture sampler. - */ -static GLboolean -is_rect_sampler_spec(const slang_type_specifier *spec) -{ - while (spec->_array) { - spec = spec->_array; - } - return spec->type == SLANG_SPEC_SAMPLER2DRECT || - spec->type == SLANG_SPEC_SAMPLER2DRECTSHADOW; -} - - - -/** - * Called by compiler when a global variable has been parsed/compiled. - * Here we examine the variable's type to determine what kind of register - * storage will be used. - * - * A uniform such as "gl_Position" will become the register specification - * (PROGRAM_OUTPUT, VERT_RESULT_HPOS). Or, uniform "gl_FogFragCoord" - * will be (PROGRAM_INPUT, FRAG_ATTRIB_FOGC). - * - * Samplers are interesting. For "uniform sampler2D tex;" we'll specify - * (PROGRAM_SAMPLER, index) where index is resolved at link-time to an - * actual texture unit (as specified by the user calling glUniform1i()). - */ -GLboolean -_slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, - slang_unit_type type) -{ - struct gl_program *prog = A->program; - const char *varName = (char *) var->a_name; - GLboolean success = GL_TRUE; - slang_ir_storage *store = NULL; - int dbg = 0; - const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier); - const GLint size = _slang_sizeof_type_specifier(&var->type.specifier); - const GLint arrayLen = _slang_array_length(var); - const GLint totalSize = _slang_array_size(size, arrayLen); - GLint texIndex = sampler_to_texture_index(var->type.specifier.type); - - /* check for sampler2D arrays */ - if (texIndex == -1 && var->type.specifier._array) - texIndex = sampler_to_texture_index(var->type.specifier._array->type); - - if (texIndex != -1) { - /* This is a texture sampler variable... - * store->File = PROGRAM_SAMPLER - * store->Index = sampler number (0..7, typically) - * store->Size = texture type index (1D, 2D, 3D, cube, etc) - */ - if (var->initializer) { - slang_info_log_error(A->log, "illegal assignment to '%s'", varName); - return GL_FALSE; - } -#if FEATURE_es2_glsl /* XXX should use FEATURE_texture_rect */ - /* disallow rect samplers */ - if (is_rect_sampler_spec(&var->type.specifier)) { - slang_info_log_error(A->log, "invalid sampler type for '%s'", varName); - return GL_FALSE; - } -#else - (void) is_rect_sampler_spec; /* silence warning */ -#endif - { - GLint sampNum = _mesa_add_sampler(prog->Parameters, varName, datatype); - store = _slang_new_ir_storage_sampler(sampNum, texIndex, totalSize); - - /* If we have a sampler array, then we need to allocate the - * additional samplers to ensure we don't allocate them elsewhere. - * We can't directly use _mesa_add_sampler() as that checks the - * varName and gets a match, so we call _mesa_add_parameter() - * directly and use the last sampler number from the call above. - */ - if (arrayLen > 0) { - GLint a = arrayLen - 1; - GLint i; - for (i = 0; i < a; i++) { - GLfloat value = (GLfloat)(i + sampNum + 1); - (void) _mesa_add_parameter(prog->Parameters, PROGRAM_SAMPLER, - varName, 1, datatype, &value, NULL, 0x0); - } - } - } - if (dbg) printf("SAMPLER "); - } - else if (var->type.qualifier == SLANG_QUAL_UNIFORM) { - /* Uniform variable */ - const GLuint swizzle = _slang_var_swizzle(totalSize, 0); - - if (prog) { - /* user-defined uniform */ - if (datatype == GL_NONE) { - if (var->type.specifier.type == SLANG_SPEC_STRUCT) { - /* temporary work-around */ - GLenum datatype = GL_FLOAT; - GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, - totalSize, datatype, NULL); - store = _slang_new_ir_storage_swz(PROGRAM_UNIFORM, uniformLoc, - totalSize, swizzle); - - /* XXX what we need to do is unroll the struct into its - * basic types, creating a uniform variable for each. - * For example: - * struct foo { - * vec3 a; - * vec4 b; - * }; - * uniform foo f; - * - * Should produce uniforms: - * "f.a" (GL_FLOAT_VEC3) - * "f.b" (GL_FLOAT_VEC4) - */ - - if (var->initializer) { - slang_info_log_error(A->log, - "unsupported initializer for uniform '%s'", varName); - return GL_FALSE; - } - } - else { - slang_info_log_error(A->log, - "invalid datatype for uniform variable %s", - varName); - return GL_FALSE; - } - } - else { - /* non-struct uniform */ - if (!_slang_gen_var_decl(A, var, var->initializer)) - return GL_FALSE; - store = var->store; - } - } - else { - /* pre-defined uniform, like gl_ModelviewMatrix */ - /* We know it's a uniform, but don't allocate storage unless - * it's really used. - */ - store = _slang_new_ir_storage_swz(PROGRAM_STATE_VAR, -1, - totalSize, swizzle); - } - if (dbg) printf("UNIFORM (sz %d) ", totalSize); - } - else if (var->type.qualifier == SLANG_QUAL_VARYING) { - /* varyings must be float, vec or mat */ - if (!_slang_type_is_float_vec_mat(var->type.specifier.type) && - var->type.specifier.type != SLANG_SPEC_ARRAY) { - slang_info_log_error(A->log, - "varying '%s' must be float/vector/matrix", - varName); - return GL_FALSE; - } - - if (var->initializer) { - slang_info_log_error(A->log, "illegal initializer for varying '%s'", - varName); - return GL_FALSE; - } - - if (prog) { - /* user-defined varying */ - GLbitfield flags; - GLint varyingLoc; - GLuint swizzle; - - flags = 0x0; - if (var->type.centroid == SLANG_CENTROID) - flags |= PROG_PARAM_BIT_CENTROID; - if (var->type.variant == SLANG_INVARIANT) - flags |= PROG_PARAM_BIT_INVARIANT; - - varyingLoc = _mesa_add_varying(prog->Varying, varName, - totalSize, flags); - swizzle = _slang_var_swizzle(size, 0); - store = _slang_new_ir_storage_swz(PROGRAM_VARYING, varyingLoc, - totalSize, swizzle); - } - else { - /* pre-defined varying, like gl_Color or gl_TexCoord */ - if (type == SLANG_UNIT_FRAGMENT_BUILTIN) { - /* fragment program input */ - GLuint swizzle; - GLint index = _slang_input_index(varName, GL_FRAGMENT_PROGRAM_ARB, - &swizzle); - assert(index >= 0); - assert(index < FRAG_ATTRIB_MAX); - store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, - size, swizzle); - } - else { - /* vertex program output */ - GLint index = _slang_output_index(varName, GL_VERTEX_PROGRAM_ARB); - GLuint swizzle = _slang_var_swizzle(size, 0); - assert(index >= 0); - assert(index < VERT_RESULT_MAX); - assert(type == SLANG_UNIT_VERTEX_BUILTIN); - store = _slang_new_ir_storage_swz(PROGRAM_OUTPUT, index, - size, swizzle); - } - if (dbg) printf("V/F "); - } - if (dbg) printf("VARYING "); - } - else if (var->type.qualifier == SLANG_QUAL_ATTRIBUTE) { - GLuint swizzle; - GLint index; - /* attributes must be float, vec or mat */ - if (!_slang_type_is_float_vec_mat(var->type.specifier.type)) { - slang_info_log_error(A->log, - "attribute '%s' must be float/vector/matrix", - varName); - return GL_FALSE; - } - - if (prog) { - /* user-defined vertex attribute */ - const GLint attr = -1; /* unknown */ - swizzle = _slang_var_swizzle(size, 0); - index = _mesa_add_attribute(prog->Attributes, varName, - size, datatype, attr); - assert(index >= 0); - index = VERT_ATTRIB_GENERIC0 + index; - } - else { - /* pre-defined vertex attrib */ - index = _slang_input_index(varName, GL_VERTEX_PROGRAM_ARB, &swizzle); - assert(index >= 0); - } - store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle); - if (dbg) printf("ATTRIB "); - } - else if (var->type.qualifier == SLANG_QUAL_FIXEDINPUT) { - GLuint swizzle = SWIZZLE_XYZW; /* silence compiler warning */ - GLint index = _slang_input_index(varName, GL_FRAGMENT_PROGRAM_ARB, - &swizzle); - store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle); - if (dbg) printf("INPUT "); - } - else if (var->type.qualifier == SLANG_QUAL_FIXEDOUTPUT) { - if (type == SLANG_UNIT_VERTEX_BUILTIN) { - GLint index = _slang_output_index(varName, GL_VERTEX_PROGRAM_ARB); - store = _slang_new_ir_storage(PROGRAM_OUTPUT, index, size); - } - else { - GLint index = _slang_output_index(varName, GL_FRAGMENT_PROGRAM_ARB); - GLint specialSize = 4; /* treat all fragment outputs as float[4] */ - assert(type == SLANG_UNIT_FRAGMENT_BUILTIN); - store = _slang_new_ir_storage(PROGRAM_OUTPUT, index, specialSize); - } - if (dbg) printf("OUTPUT "); - } - else if (var->type.qualifier == SLANG_QUAL_CONST && !prog) { - /* pre-defined global constant, like gl_MaxLights */ - store = _slang_new_ir_storage(PROGRAM_CONSTANT, -1, size); - if (dbg) printf("CONST "); - } - else { - /* ordinary variable (may be const) */ - slang_ir_node *n; - - /* IR node to declare the variable */ - n = _slang_gen_var_decl(A, var, var->initializer); - - /* emit GPU instructions */ - success = _slang_emit_code(n, A->vartable, A->program, A->pragmas, GL_FALSE, A->log); - - _slang_free_ir_tree(n); - } - - if (dbg) printf("GLOBAL VAR %s idx %d\n", (char*) var->a_name, - store ? store->Index : -2); - - if (store) - var->store = store; /* save var's storage info */ - - var->declared = GL_TRUE; - - return success; -} - - -/** - * Produce an IR tree from a function AST (fun->body). - * Then call the code emitter to convert the IR tree into gl_program - * instructions. - */ -GLboolean -_slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) -{ - slang_ir_node *n; - GLboolean success = GL_TRUE; - - if (_mesa_strcmp((char *) fun->header.a_name, "main") != 0) { - /* we only really generate code for main, all other functions get - * inlined or codegen'd upon an actual call. - */ -#if 0 - /* do some basic error checking though */ - if (fun->header.type.specifier.type != SLANG_SPEC_VOID) { - /* check that non-void functions actually return something */ - slang_operation *op - = _slang_find_node_type(fun->body, SLANG_OPER_RETURN); - if (!op) { - slang_info_log_error(A->log, - "function \"%s\" has no return statement", - (char *) fun->header.a_name); - printf( - "function \"%s\" has no return statement\n", - (char *) fun->header.a_name); - return GL_FALSE; - } - } -#endif - return GL_TRUE; /* not an error */ - } - -#if 0 - printf("\n*********** codegen_function %s\n", (char *) fun->header.a_name); - slang_print_function(fun, 1); -#endif - - /* should have been allocated earlier: */ - assert(A->program->Parameters ); - assert(A->program->Varying); - assert(A->vartable); - A->CurLoop = NULL; - A->CurFunction = fun; - - /* fold constant expressions, etc. */ - _slang_simplify(fun->body, &A->space, A->atoms); - -#if 0 - printf("\n*********** simplified %s\n", (char *) fun->header.a_name); - slang_print_function(fun, 1); -#endif - - /* Create an end-of-function label */ - A->curFuncEndLabel = _slang_label_new("__endOfFunc__main"); - - /* push new vartable scope */ - _slang_push_var_table(A->vartable); - - /* Generate IR tree for the function body code */ - n = _slang_gen_operation(A, fun->body); - if (n) - n = new_node1(IR_SCOPE, n); - - /* pop vartable, restore previous */ - _slang_pop_var_table(A->vartable); - - if (!n) { - /* XXX record error */ - return GL_FALSE; - } - - /* append an end-of-function-label to IR tree */ - n = new_seq(n, new_label(A->curFuncEndLabel)); - - /*_slang_label_delete(A->curFuncEndLabel);*/ - A->curFuncEndLabel = NULL; - -#if 0 - printf("************* New AST for %s *****\n", (char*)fun->header.a_name); - slang_print_function(fun, 1); -#endif -#if 0 - printf("************* IR for %s *******\n", (char*)fun->header.a_name); - _slang_print_ir_tree(n, 0); -#endif -#if 0 - printf("************* End codegen function ************\n\n"); -#endif - - /* Emit program instructions */ - success = _slang_emit_code(n, A->vartable, A->program, A->pragmas, GL_TRUE, A->log); - _slang_free_ir_tree(n); - - /* free codegen context */ - /* - _mesa_free(A->codegen); - */ - - return success; -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_codegen.h b/src/libs/mesa/mesa/shader/slang/slang_codegen.h deleted file mode 100644 index f2daa034e4..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_codegen.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SLANG_CODEGEN_H -#define SLANG_CODEGEN_H - - -#include "main/imports.h" -#include "slang_compile.h" - - -typedef struct slang_assemble_ctx_ -{ - slang_atom_pool *atoms; - slang_name_space space; - struct gl_program *program; - struct gl_sl_pragmas *pragmas; - slang_var_table *vartable; - slang_info_log *log; - struct slang_label_ *curFuncEndLabel; - struct slang_ir_node_ *CurLoop; - struct slang_function_ *CurFunction; -} slang_assemble_ctx; - - -extern GLuint -_slang_sizeof_type_specifier(const slang_type_specifier *spec); - -extern GLboolean -_slang_codegen_function(slang_assemble_ctx *A , struct slang_function_ *fun); - -extern GLboolean -_slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, - slang_unit_type type); - - -#endif /* SLANG_CODEGEN_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile.c b/src/libs/mesa/mesa/shader/slang/slang_compile.c deleted file mode 100644 index 26a0598a7c..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile.c +++ /dev/null @@ -1,2799 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file slang_compile.c - * slang front-end compiler - * \author Michal Krol - */ - -#include "main/imports.h" -#include "main/context.h" -#include "shader/program.h" -#include "shader/programopt.h" -#include "shader/prog_print.h" -#include "shader/prog_parameter.h" -#include "shader/grammar/grammar_mesa.h" -#include "slang_codegen.h" -#include "slang_compile.h" -#include "slang_preprocess.h" -#include "slang_storage.h" -#include "slang_emit.h" -#include "slang_log.h" -#include "slang_mem.h" -#include "slang_vartable.h" -#include "slang_simplify.h" - -#include "slang_print.h" - -/* - * This is a straightforward implementation of the slang front-end - * compiler. Lots of error-checking functionality is missing but - * every well-formed shader source should compile successfully and - * execute as expected. However, some semantically ill-formed shaders - * may be accepted resulting in undefined behaviour. - */ - - -/** re-defined below, should be the same though */ -#define TYPE_SPECIFIER_COUNT 32 - - -/** - * Check if the given identifier is legal. - */ -static GLboolean -legal_identifier(slang_atom name) -{ - /* "gl_" is a reserved prefix */ - if (_mesa_strncmp((char *) name, "gl_", 3) == 0) { - return GL_FALSE; - } - return GL_TRUE; -} - - -/* - * slang_code_unit - */ - -GLvoid -_slang_code_unit_ctr(slang_code_unit * self, - struct slang_code_object_ * object) -{ - _slang_variable_scope_ctr(&self->vars); - _slang_function_scope_ctr(&self->funs); - _slang_struct_scope_ctr(&self->structs); - self->object = object; -} - -GLvoid -_slang_code_unit_dtr(slang_code_unit * self) -{ - slang_variable_scope_destruct(&self->vars); - slang_function_scope_destruct(&self->funs); - slang_struct_scope_destruct(&self->structs); -} - -/* - * slang_code_object - */ - -GLvoid -_slang_code_object_ctr(slang_code_object * self) -{ - GLuint i; - - for (i = 0; i < SLANG_BUILTIN_TOTAL; i++) - _slang_code_unit_ctr(&self->builtin[i], self); - _slang_code_unit_ctr(&self->unit, self); - slang_atom_pool_construct(&self->atompool); -} - -GLvoid -_slang_code_object_dtr(slang_code_object * self) -{ - GLuint i; - - for (i = 0; i < SLANG_BUILTIN_TOTAL; i++) - _slang_code_unit_dtr(&self->builtin[i]); - _slang_code_unit_dtr(&self->unit); - slang_atom_pool_destruct(&self->atompool); -} - - -/* slang_parse_ctx */ - -typedef struct slang_parse_ctx_ -{ - const byte *I; - slang_info_log *L; - int parsing_builtin; - GLboolean global_scope; /**< Is object being declared a global? */ - slang_atom_pool *atoms; - slang_unit_type type; /**< Vertex vs. Fragment */ - GLuint version; /**< user-specified (or default) #version */ -} slang_parse_ctx; - -/* slang_output_ctx */ - -typedef struct slang_output_ctx_ -{ - slang_variable_scope *vars; - slang_function_scope *funs; - slang_struct_scope *structs; - struct gl_program *program; - struct gl_sl_pragmas *pragmas; - slang_var_table *vartable; - GLuint default_precision[TYPE_SPECIFIER_COUNT]; - GLboolean allow_precision; - GLboolean allow_invariant; - GLboolean allow_centroid; - GLboolean allow_array_types; /* float[] syntax */ -} slang_output_ctx; - -/* _slang_compile() */ - - -/* Debugging aid, print file/line where parsing error is detected */ -#define RETURN0 \ - do { \ - if (0) \ - printf("slang error at %s:%d\n", __FILE__, __LINE__); \ - return 0; \ - } while (0) - - -static void -parse_identifier_str(slang_parse_ctx * C, char **id) -{ - *id = (char *) C->I; - C->I += _mesa_strlen(*id) + 1; -} - -static slang_atom -parse_identifier(slang_parse_ctx * C) -{ - const char *id; - - id = (const char *) C->I; - C->I += _mesa_strlen(id) + 1; - return slang_atom_pool_atom(C->atoms, id); -} - -static int -parse_number(slang_parse_ctx * C, int *number) -{ - const int radix = (int) (*C->I++); - *number = 0; - while (*C->I != '\0') { - int digit; - if (*C->I >= '0' && *C->I <= '9') - digit = (int) (*C->I - '0'); - else if (*C->I >= 'A' && *C->I <= 'Z') - digit = (int) (*C->I - 'A') + 10; - else - digit = (int) (*C->I - 'a') + 10; - *number = *number * radix + digit; - C->I++; - } - C->I++; - if (*number > 65535) - slang_info_log_warning(C->L, "%d: literal integer overflow.", *number); - return 1; -} - -static int -parse_float(slang_parse_ctx * C, float *number) -{ - char *integral = NULL; - char *fractional = NULL; - char *exponent = NULL; - char *whole = NULL; - - parse_identifier_str(C, &integral); - parse_identifier_str(C, &fractional); - parse_identifier_str(C, &exponent); - - whole = (char *) _slang_alloc((_mesa_strlen(integral) + - _mesa_strlen(fractional) + - _mesa_strlen(exponent) + 3) * sizeof(char)); - if (whole == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - - slang_string_copy(whole, integral); - slang_string_concat(whole, "."); - slang_string_concat(whole, fractional); - slang_string_concat(whole, "E"); - slang_string_concat(whole, exponent); - - *number = (float) (_mesa_strtod(whole, (char **) NULL)); - - _slang_free(whole); - - return 1; -} - -/* revision number - increment after each change affecting emitted output */ -#define REVISION 5 - -static int -check_revision(slang_parse_ctx * C) -{ - if (*C->I != REVISION) { - slang_info_log_error(C->L, "Internal compiler error."); - RETURN0; - } - C->I++; - return 1; -} - -static int parse_statement(slang_parse_ctx *, slang_output_ctx *, - slang_operation *); -static int parse_expression(slang_parse_ctx *, slang_output_ctx *, - slang_operation *); -static int parse_type_specifier(slang_parse_ctx *, slang_output_ctx *, - slang_type_specifier *); -static int -parse_type_array_size(slang_parse_ctx *C, - slang_output_ctx *O, - GLint *array_len); - -static GLboolean -parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len) -{ - slang_operation array_size; - slang_name_space space; - GLboolean result; - - if (!slang_operation_construct(&array_size)) - return GL_FALSE; - if (!parse_expression(C, O, &array_size)) { - slang_operation_destruct(&array_size); - return GL_FALSE; - } - - space.funcs = O->funs; - space.structs = O->structs; - space.vars = O->vars; - - /* evaluate compile-time expression which is array size */ - _slang_simplify(&array_size, &space, C->atoms); - - if (array_size.type == SLANG_OPER_LITERAL_INT) { - result = GL_TRUE; - *len = (GLint) array_size.literal[0]; - } else if (array_size.type == SLANG_OPER_IDENTIFIER) { - slang_variable *var = _slang_variable_locate(array_size.locals, array_size.a_id, GL_TRUE); - if (!var) { - slang_info_log_error(C->L, "undefined variable '%s'", - (char *) array_size.a_id); - result = GL_FALSE; - } else if (var->type.qualifier == SLANG_QUAL_CONST && - var->type.specifier.type == SLANG_SPEC_INT) { - if (var->initializer && - var->initializer->type == SLANG_OPER_LITERAL_INT) { - *len = (GLint) var->initializer->literal[0]; - result = GL_TRUE; - } else { - slang_info_log_error(C->L, "unable to parse array size declaration"); - result = GL_FALSE; - } - } else { - slang_info_log_error(C->L, "unable to parse array size declaration"); - result = GL_FALSE; - } - } else { - result = GL_FALSE; - } - - slang_operation_destruct(&array_size); - return result; -} - -static GLboolean -calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O, - slang_variable * var) -{ - slang_storage_aggregate agg; - - if (!slang_storage_aggregate_construct(&agg)) - return GL_FALSE; - if (!_slang_aggregate_variable(&agg, &var->type.specifier, var->array_len, - O->funs, O->structs, O->vars, C->atoms)) { - slang_storage_aggregate_destruct(&agg); - return GL_FALSE; - } - var->size = _slang_sizeof_aggregate(&agg); - slang_storage_aggregate_destruct(&agg); - return GL_TRUE; -} - -static void -promote_type_to_array(slang_parse_ctx *C, - slang_fully_specified_type *type, - GLint array_len) -{ - slang_type_specifier *baseType = - slang_type_specifier_new(type->specifier.type, NULL, NULL); - - type->specifier.type = SLANG_SPEC_ARRAY; - type->specifier._array = baseType; - type->array_len = array_len; -} - - -static GLboolean -convert_to_array(slang_parse_ctx * C, slang_variable * var, - const slang_type_specifier * sp) -{ - /* sized array - mark it as array, copy the specifier to the array element - * and parse the expression */ - var->type.specifier.type = SLANG_SPEC_ARRAY; - var->type.specifier._array = (slang_type_specifier *) - _slang_alloc(sizeof(slang_type_specifier)); - if (var->type.specifier._array == NULL) { - slang_info_log_memory(C->L); - return GL_FALSE; - } - slang_type_specifier_ctr(var->type.specifier._array); - return slang_type_specifier_copy(var->type.specifier._array, sp); -} - -/* structure field */ -#define FIELD_NONE 0 -#define FIELD_NEXT 1 -#define FIELD_ARRAY 2 - -static GLboolean -parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O, - slang_variable * var, slang_atom a_name, - const slang_type_specifier * sp, - GLuint array_len) -{ - var->a_name = a_name; - if (var->a_name == SLANG_ATOM_NULL) - return GL_FALSE; - - switch (*C->I++) { - case FIELD_NONE: - if (array_len != -1) { - if (!convert_to_array(C, var, sp)) - return GL_FALSE; - var->array_len = array_len; - } - else { - if (!slang_type_specifier_copy(&var->type.specifier, sp)) - return GL_FALSE; - } - break; - case FIELD_ARRAY: - if (array_len != -1) - return GL_FALSE; - if (!convert_to_array(C, var, sp)) - return GL_FALSE; - if (!parse_array_len(C, O, &var->array_len)) - return GL_FALSE; - break; - default: - return GL_FALSE; - } - - return calculate_var_size(C, O, var); -} - -static int -parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O, - slang_struct * st, slang_type_specifier * sp) -{ - slang_output_ctx o = *O; - GLint array_len; - - o.structs = st->structs; - if (!parse_type_specifier(C, &o, sp)) - RETURN0; - if (!parse_type_array_size(C, &o, &array_len)) - RETURN0; - - do { - slang_atom a_name; - slang_variable *var = slang_variable_scope_grow(st->fields); - if (!var) { - slang_info_log_memory(C->L); - RETURN0; - } - a_name = parse_identifier(C); - if (_slang_variable_locate(st->fields, a_name, GL_FALSE)) { - slang_info_log_error(C->L, "duplicate field '%s'", (char *) a_name); - RETURN0; - } - - if (!parse_struct_field_var(C, &o, var, a_name, sp, array_len)) - RETURN0; - } - while (*C->I++ != FIELD_NONE); - - return 1; -} - -static int -parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) -{ - slang_atom a_name; - const char *name; - - /* parse struct name (if any) and make sure it is unique in current scope */ - a_name = parse_identifier(C); - if (a_name == SLANG_ATOM_NULL) - RETURN0; - - name = slang_atom_pool_id(C->atoms, a_name); - if (name[0] != '\0' - && slang_struct_scope_find(O->structs, a_name, 0) != NULL) { - slang_info_log_error(C->L, "%s: duplicate type name.", name); - RETURN0; - } - - /* set-up a new struct */ - *st = (slang_struct *) _slang_alloc(sizeof(slang_struct)); - if (*st == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - if (!slang_struct_construct(*st)) { - _slang_free(*st); - *st = NULL; - slang_info_log_memory(C->L); - RETURN0; - } - (**st).a_name = a_name; - (**st).structs->outer_scope = O->structs; - - /* parse individual struct fields */ - do { - slang_type_specifier sp; - - slang_type_specifier_ctr(&sp); - if (!parse_struct_field(C, O, *st, &sp)) { - slang_type_specifier_dtr(&sp); - RETURN0; - } - slang_type_specifier_dtr(&sp); - } - while (*C->I++ != FIELD_NONE); - - /* if named struct, copy it to current scope */ - if (name[0] != '\0') { - slang_struct *s; - - O->structs->structs = - (slang_struct *) _slang_realloc(O->structs->structs, - O->structs->num_structs - * sizeof(slang_struct), - (O->structs->num_structs + 1) - * sizeof(slang_struct)); - if (O->structs->structs == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - s = &O->structs->structs[O->structs->num_structs]; - if (!slang_struct_construct(s)) - RETURN0; - O->structs->num_structs++; - if (!slang_struct_copy(s, *st)) - RETURN0; - } - - return 1; -} - - -/* invariant qualifer */ -#define TYPE_VARIANT 90 -#define TYPE_INVARIANT 91 - -static int -parse_type_variant(slang_parse_ctx * C, slang_type_variant *variant) -{ - GLuint invariant = *C->I++; - switch (invariant) { - case TYPE_VARIANT: - *variant = SLANG_VARIANT; - return 1; - case TYPE_INVARIANT: - *variant = SLANG_INVARIANT; - return 1; - default: - RETURN0; - } -} - - -/* centroid qualifer */ -#define TYPE_CENTER 95 -#define TYPE_CENTROID 96 - -static int -parse_type_centroid(slang_parse_ctx * C, slang_type_centroid *centroid) -{ - GLuint c = *C->I++; - switch (c) { - case TYPE_CENTER: - *centroid = SLANG_CENTER; - return 1; - case TYPE_CENTROID: - *centroid = SLANG_CENTROID; - return 1; - default: - RETURN0; - } -} - - -/* type qualifier */ -#define TYPE_QUALIFIER_NONE 0 -#define TYPE_QUALIFIER_CONST 1 -#define TYPE_QUALIFIER_ATTRIBUTE 2 -#define TYPE_QUALIFIER_VARYING 3 -#define TYPE_QUALIFIER_UNIFORM 4 -#define TYPE_QUALIFIER_FIXEDOUTPUT 5 -#define TYPE_QUALIFIER_FIXEDINPUT 6 - -static int -parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual) -{ - GLuint qualifier = *C->I++; - switch (qualifier) { - case TYPE_QUALIFIER_NONE: - *qual = SLANG_QUAL_NONE; - break; - case TYPE_QUALIFIER_CONST: - *qual = SLANG_QUAL_CONST; - break; - case TYPE_QUALIFIER_ATTRIBUTE: - *qual = SLANG_QUAL_ATTRIBUTE; - break; - case TYPE_QUALIFIER_VARYING: - *qual = SLANG_QUAL_VARYING; - break; - case TYPE_QUALIFIER_UNIFORM: - *qual = SLANG_QUAL_UNIFORM; - break; - case TYPE_QUALIFIER_FIXEDOUTPUT: - *qual = SLANG_QUAL_FIXEDOUTPUT; - break; - case TYPE_QUALIFIER_FIXEDINPUT: - *qual = SLANG_QUAL_FIXEDINPUT; - break; - default: - RETURN0; - } - return 1; -} - -/* type specifier */ -#define TYPE_SPECIFIER_VOID 0 -#define TYPE_SPECIFIER_BOOL 1 -#define TYPE_SPECIFIER_BVEC2 2 -#define TYPE_SPECIFIER_BVEC3 3 -#define TYPE_SPECIFIER_BVEC4 4 -#define TYPE_SPECIFIER_INT 5 -#define TYPE_SPECIFIER_IVEC2 6 -#define TYPE_SPECIFIER_IVEC3 7 -#define TYPE_SPECIFIER_IVEC4 8 -#define TYPE_SPECIFIER_FLOAT 9 -#define TYPE_SPECIFIER_VEC2 10 -#define TYPE_SPECIFIER_VEC3 11 -#define TYPE_SPECIFIER_VEC4 12 -#define TYPE_SPECIFIER_MAT2 13 -#define TYPE_SPECIFIER_MAT3 14 -#define TYPE_SPECIFIER_MAT4 15 -#define TYPE_SPECIFIER_SAMPLER1D 16 -#define TYPE_SPECIFIER_SAMPLER2D 17 -#define TYPE_SPECIFIER_SAMPLER3D 18 -#define TYPE_SPECIFIER_SAMPLERCUBE 19 -#define TYPE_SPECIFIER_SAMPLER1DSHADOW 20 -#define TYPE_SPECIFIER_SAMPLER2DSHADOW 21 -#define TYPE_SPECIFIER_SAMPLER2DRECT 22 -#define TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23 -#define TYPE_SPECIFIER_STRUCT 24 -#define TYPE_SPECIFIER_TYPENAME 25 -#define TYPE_SPECIFIER_MAT23 26 -#define TYPE_SPECIFIER_MAT32 27 -#define TYPE_SPECIFIER_MAT24 28 -#define TYPE_SPECIFIER_MAT42 29 -#define TYPE_SPECIFIER_MAT34 30 -#define TYPE_SPECIFIER_MAT43 31 -#define TYPE_SPECIFIER_COUNT 32 - -static int -parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, - slang_type_specifier * spec) -{ - switch (*C->I++) { - case TYPE_SPECIFIER_VOID: - spec->type = SLANG_SPEC_VOID; - break; - case TYPE_SPECIFIER_BOOL: - spec->type = SLANG_SPEC_BOOL; - break; - case TYPE_SPECIFIER_BVEC2: - spec->type = SLANG_SPEC_BVEC2; - break; - case TYPE_SPECIFIER_BVEC3: - spec->type = SLANG_SPEC_BVEC3; - break; - case TYPE_SPECIFIER_BVEC4: - spec->type = SLANG_SPEC_BVEC4; - break; - case TYPE_SPECIFIER_INT: - spec->type = SLANG_SPEC_INT; - break; - case TYPE_SPECIFIER_IVEC2: - spec->type = SLANG_SPEC_IVEC2; - break; - case TYPE_SPECIFIER_IVEC3: - spec->type = SLANG_SPEC_IVEC3; - break; - case TYPE_SPECIFIER_IVEC4: - spec->type = SLANG_SPEC_IVEC4; - break; - case TYPE_SPECIFIER_FLOAT: - spec->type = SLANG_SPEC_FLOAT; - break; - case TYPE_SPECIFIER_VEC2: - spec->type = SLANG_SPEC_VEC2; - break; - case TYPE_SPECIFIER_VEC3: - spec->type = SLANG_SPEC_VEC3; - break; - case TYPE_SPECIFIER_VEC4: - spec->type = SLANG_SPEC_VEC4; - break; - case TYPE_SPECIFIER_MAT2: - spec->type = SLANG_SPEC_MAT2; - break; - case TYPE_SPECIFIER_MAT3: - spec->type = SLANG_SPEC_MAT3; - break; - case TYPE_SPECIFIER_MAT4: - spec->type = SLANG_SPEC_MAT4; - break; - case TYPE_SPECIFIER_MAT23: - spec->type = SLANG_SPEC_MAT23; - break; - case TYPE_SPECIFIER_MAT32: - spec->type = SLANG_SPEC_MAT32; - break; - case TYPE_SPECIFIER_MAT24: - spec->type = SLANG_SPEC_MAT24; - break; - case TYPE_SPECIFIER_MAT42: - spec->type = SLANG_SPEC_MAT42; - break; - case TYPE_SPECIFIER_MAT34: - spec->type = SLANG_SPEC_MAT34; - break; - case TYPE_SPECIFIER_MAT43: - spec->type = SLANG_SPEC_MAT43; - break; - case TYPE_SPECIFIER_SAMPLER1D: - spec->type = SLANG_SPEC_SAMPLER1D; - break; - case TYPE_SPECIFIER_SAMPLER2D: - spec->type = SLANG_SPEC_SAMPLER2D; - break; - case TYPE_SPECIFIER_SAMPLER3D: - spec->type = SLANG_SPEC_SAMPLER3D; - break; - case TYPE_SPECIFIER_SAMPLERCUBE: - spec->type = SLANG_SPEC_SAMPLERCUBE; - break; - case TYPE_SPECIFIER_SAMPLER2DRECT: - spec->type = SLANG_SPEC_SAMPLER2DRECT; - break; - case TYPE_SPECIFIER_SAMPLER1DSHADOW: - spec->type = SLANG_SPEC_SAMPLER1DSHADOW; - break; - case TYPE_SPECIFIER_SAMPLER2DSHADOW: - spec->type = SLANG_SPEC_SAMPLER2DSHADOW; - break; - case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW: - spec->type = SLANG_SPEC_SAMPLER2DRECTSHADOW; - break; - case TYPE_SPECIFIER_STRUCT: - spec->type = SLANG_SPEC_STRUCT; - if (!parse_struct(C, O, &spec->_struct)) - RETURN0; - break; - case TYPE_SPECIFIER_TYPENAME: - spec->type = SLANG_SPEC_STRUCT; - { - slang_atom a_name; - slang_struct *stru; - - a_name = parse_identifier(C); - if (a_name == NULL) - RETURN0; - - stru = slang_struct_scope_find(O->structs, a_name, 1); - if (stru == NULL) { - slang_info_log_error(C->L, "undeclared type name '%s'", - slang_atom_pool_id(C->atoms, a_name)); - RETURN0; - } - - spec->_struct = (slang_struct *) _slang_alloc(sizeof(slang_struct)); - if (spec->_struct == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - if (!slang_struct_construct(spec->_struct)) { - _slang_free(spec->_struct); - spec->_struct = NULL; - RETURN0; - } - if (!slang_struct_copy(spec->_struct, stru)) - RETURN0; - } - break; - default: - RETURN0; - } - return 1; -} - -#define TYPE_SPECIFIER_NONARRAY 0 -#define TYPE_SPECIFIER_ARRAY 1 - -static int -parse_type_array_size(slang_parse_ctx *C, - slang_output_ctx *O, - GLint *array_len) -{ - GLuint size; - - switch (*C->I++) { - case TYPE_SPECIFIER_NONARRAY: - *array_len = -1; /* -1 = not an array */ - break; - case TYPE_SPECIFIER_ARRAY: - if (!parse_array_len(C, O, &size)) - RETURN0; - *array_len = (GLint) size; - break; - default: - assert(0); - RETURN0; - } - return 1; -} - -#define PRECISION_DEFAULT 0 -#define PRECISION_LOW 1 -#define PRECISION_MEDIUM 2 -#define PRECISION_HIGH 3 - -static int -parse_type_precision(slang_parse_ctx *C, - slang_type_precision *precision) -{ - GLint prec = *C->I++; - switch (prec) { - case PRECISION_DEFAULT: - *precision = SLANG_PREC_DEFAULT; - return 1; - case PRECISION_LOW: - *precision = SLANG_PREC_LOW; - return 1; - case PRECISION_MEDIUM: - *precision = SLANG_PREC_MEDIUM; - return 1; - case PRECISION_HIGH: - *precision = SLANG_PREC_HIGH; - return 1; - default: - RETURN0; - } -} - -static int -parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O, - slang_fully_specified_type * type) -{ - if (!parse_type_variant(C, &type->variant)) - RETURN0; - - if (!parse_type_centroid(C, &type->centroid)) - RETURN0; - - if (!parse_type_qualifier(C, &type->qualifier)) - RETURN0; - - if (!parse_type_precision(C, &type->precision)) - RETURN0; - - if (!parse_type_specifier(C, O, &type->specifier)) - RETURN0; - - if (!parse_type_array_size(C, O, &type->array_len)) - RETURN0; - - if (!O->allow_invariant && type->variant == SLANG_INVARIANT) { - slang_info_log_error(C->L, - "'invariant' keyword not allowed (perhaps set #version 120)"); - RETURN0; - } - - if (!O->allow_centroid && type->centroid == SLANG_CENTROID) { - slang_info_log_error(C->L, - "'centroid' keyword not allowed (perhaps set #version 120)"); - RETURN0; - } - else if (type->centroid == SLANG_CENTROID && - type->qualifier != SLANG_QUAL_VARYING) { - slang_info_log_error(C->L, - "'centroid' keyword only allowed for varying vars"); - RETURN0; - } - - - /* need this? - if (type->qualifier != SLANG_QUAL_VARYING && - type->variant == SLANG_INVARIANT) { - slang_info_log_error(C->L, - "invariant qualifer only allowed for varying vars"); - RETURN0; - } - */ - - if (O->allow_precision) { - if (type->precision == SLANG_PREC_DEFAULT) { - assert(type->specifier.type < TYPE_SPECIFIER_COUNT); - /* use the default precision for this datatype */ - type->precision = O->default_precision[type->specifier.type]; - } - } - else { - /* only default is allowed */ - if (type->precision != SLANG_PREC_DEFAULT) { - slang_info_log_error(C->L, "precision qualifiers not allowed"); - RETURN0; - } - } - - if (!O->allow_array_types && type->array_len >= 0) { - slang_info_log_error(C->L, "first-class array types not allowed"); - RETURN0; - } - - if (type->array_len >= 0) { - /* convert type to array type (ex: convert "int" to "array of int" */ - promote_type_to_array(C, type, type->array_len); - } - - return 1; -} - -/* operation */ -#define OP_END 0 -#define OP_BLOCK_BEGIN_NO_NEW_SCOPE 1 -#define OP_BLOCK_BEGIN_NEW_SCOPE 2 -#define OP_DECLARE 3 -#define OP_ASM 4 -#define OP_BREAK 5 -#define OP_CONTINUE 6 -#define OP_DISCARD 7 -#define OP_RETURN 8 -#define OP_EXPRESSION 9 -#define OP_IF 10 -#define OP_WHILE 11 -#define OP_DO 12 -#define OP_FOR 13 -#define OP_PUSH_VOID 14 -#define OP_PUSH_BOOL 15 -#define OP_PUSH_INT 16 -#define OP_PUSH_FLOAT 17 -#define OP_PUSH_IDENTIFIER 18 -#define OP_SEQUENCE 19 -#define OP_ASSIGN 20 -#define OP_ADDASSIGN 21 -#define OP_SUBASSIGN 22 -#define OP_MULASSIGN 23 -#define OP_DIVASSIGN 24 -/*#define OP_MODASSIGN 25*/ -/*#define OP_LSHASSIGN 26*/ -/*#define OP_RSHASSIGN 27*/ -/*#define OP_ORASSIGN 28*/ -/*#define OP_XORASSIGN 29*/ -/*#define OP_ANDASSIGN 30*/ -#define OP_SELECT 31 -#define OP_LOGICALOR 32 -#define OP_LOGICALXOR 33 -#define OP_LOGICALAND 34 -/*#define OP_BITOR 35*/ -/*#define OP_BITXOR 36*/ -/*#define OP_BITAND 37*/ -#define OP_EQUAL 38 -#define OP_NOTEQUAL 39 -#define OP_LESS 40 -#define OP_GREATER 41 -#define OP_LESSEQUAL 42 -#define OP_GREATEREQUAL 43 -/*#define OP_LSHIFT 44*/ -/*#define OP_RSHIFT 45*/ -#define OP_ADD 46 -#define OP_SUBTRACT 47 -#define OP_MULTIPLY 48 -#define OP_DIVIDE 49 -/*#define OP_MODULUS 50*/ -#define OP_PREINCREMENT 51 -#define OP_PREDECREMENT 52 -#define OP_PLUS 53 -#define OP_MINUS 54 -/*#define OP_COMPLEMENT 55*/ -#define OP_NOT 56 -#define OP_SUBSCRIPT 57 -#define OP_CALL 58 -#define OP_FIELD 59 -#define OP_POSTINCREMENT 60 -#define OP_POSTDECREMENT 61 -#define OP_PRECISION 62 -#define OP_METHOD 63 - - -/** - * When parsing a compound production, this function is used to parse the - * children. - * For example, a while-loop compound will have two children, the - * while condition expression and the loop body. So, this function will - * be called twice to parse those two sub-expressions. - * \param C the parsing context - * \param O the output context - * \param oper the operation we're parsing - * \param statement indicates whether parsing a statement, or expression - * \return 1 if success, 0 if error - */ -static int -parse_child_operation(slang_parse_ctx * C, slang_output_ctx * O, - slang_operation * oper, GLboolean statement) -{ - slang_operation *ch; - - /* grow child array */ - ch = slang_operation_grow(&oper->num_children, &oper->children); - if (statement) - return parse_statement(C, O, ch); - return parse_expression(C, O, ch); -} - -static int parse_declaration(slang_parse_ctx * C, slang_output_ctx * O); - -static int -parse_statement(slang_parse_ctx * C, slang_output_ctx * O, - slang_operation * oper) -{ - int op; - - oper->locals->outer_scope = O->vars; - - op = *C->I++; - switch (op) { - case OP_BLOCK_BEGIN_NO_NEW_SCOPE: - /* parse child statements, do not create new variable scope */ - oper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE; - while (*C->I != OP_END) - if (!parse_child_operation(C, O, oper, GL_TRUE)) - RETURN0; - C->I++; - break; - case OP_BLOCK_BEGIN_NEW_SCOPE: - /* parse child statements, create new variable scope */ - { - slang_output_ctx o = *O; - - oper->type = SLANG_OPER_BLOCK_NEW_SCOPE; - o.vars = oper->locals; - while (*C->I != OP_END) - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - C->I++; - } - break; - case OP_DECLARE: - /* local variable declaration, individual declarators are stored as - * children identifiers - */ - oper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE; - { - const unsigned int first_var = O->vars->num_variables; - - /* parse the declaration, note that there can be zero or more - * than one declarators - */ - if (!parse_declaration(C, O)) - RETURN0; - if (first_var < O->vars->num_variables) { - const unsigned int num_vars = O->vars->num_variables - first_var; - unsigned int i; - assert(oper->num_children == 0); - oper->num_children = num_vars; - oper->children = slang_operation_new(num_vars); - if (oper->children == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - for (i = first_var; i < O->vars->num_variables; i++) { - slang_operation *o = &oper->children[i - first_var]; - slang_variable *var = O->vars->variables[i]; - o->type = SLANG_OPER_VARIABLE_DECL; - o->locals->outer_scope = O->vars; - o->a_id = var->a_name; - - /* new/someday... - calculate_var_size(C, O, var); - */ - - if (!legal_identifier(o->a_id)) { - slang_info_log_error(C->L, "illegal variable name '%s'", - (char *) o->a_id); - RETURN0; - } - } - } - } - break; - case OP_ASM: - /* the __asm statement, parse the mnemonic and all its arguments - * as expressions - */ - oper->type = SLANG_OPER_ASM; - oper->a_id = parse_identifier(C); - if (oper->a_id == SLANG_ATOM_NULL) - RETURN0; - while (*C->I != OP_END) { - if (!parse_child_operation(C, O, oper, GL_FALSE)) - RETURN0; - } - C->I++; - break; - case OP_BREAK: - oper->type = SLANG_OPER_BREAK; - break; - case OP_CONTINUE: - oper->type = SLANG_OPER_CONTINUE; - break; - case OP_DISCARD: - oper->type = SLANG_OPER_DISCARD; - break; - case OP_RETURN: - oper->type = SLANG_OPER_RETURN; - if (!parse_child_operation(C, O, oper, GL_FALSE)) - RETURN0; - break; - case OP_EXPRESSION: - oper->type = SLANG_OPER_EXPRESSION; - if (!parse_child_operation(C, O, oper, GL_FALSE)) - RETURN0; - break; - case OP_IF: - oper->type = SLANG_OPER_IF; - if (!parse_child_operation(C, O, oper, GL_FALSE)) - RETURN0; - if (!parse_child_operation(C, O, oper, GL_TRUE)) - RETURN0; - if (!parse_child_operation(C, O, oper, GL_TRUE)) - RETURN0; - break; - case OP_WHILE: - { - slang_output_ctx o = *O; - - oper->type = SLANG_OPER_WHILE; - o.vars = oper->locals; - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - } - break; - case OP_DO: - oper->type = SLANG_OPER_DO; - if (!parse_child_operation(C, O, oper, GL_TRUE)) - RETURN0; - if (!parse_child_operation(C, O, oper, GL_FALSE)) - RETURN0; - break; - case OP_FOR: - { - slang_output_ctx o = *O; - - oper->type = SLANG_OPER_FOR; - o.vars = oper->locals; - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - if (!parse_child_operation(C, &o, oper, GL_FALSE)) - RETURN0; - if (!parse_child_operation(C, &o, oper, GL_TRUE)) - RETURN0; - } - break; - case OP_PRECISION: - { - /* set default precision for a type in this scope */ - /* ignored at this time */ - int prec_qual = *C->I++; - int datatype = *C->I++; - (void) prec_qual; - (void) datatype; - } - break; - default: - /*printf("Unexpected operation %d\n", op);*/ - RETURN0; - } - return 1; -} - -static int -handle_nary_expression(slang_parse_ctx * C, slang_operation * op, - slang_operation ** ops, unsigned int *total_ops, - unsigned int n) -{ - unsigned int i; - - op->children = slang_operation_new(n); - if (op->children == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - op->num_children = n; - - for (i = 0; i < n; i++) { - slang_operation_destruct(&op->children[i]); - op->children[i] = (*ops)[*total_ops - (n + 1 - i)]; - } - - (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1]; - *total_ops -= n; - - *ops = (slang_operation *) - _slang_realloc(*ops, - (*total_ops + n) * sizeof(slang_operation), - *total_ops * sizeof(slang_operation)); - if (*ops == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - return 1; -} - -static int -is_constructor_name(const char *name, slang_atom a_name, - slang_struct_scope * structs) -{ - if (slang_type_specifier_type_from_string(name) != SLANG_SPEC_VOID) - return 1; - return slang_struct_scope_find(structs, a_name, 1) != NULL; -} - -#define FUNCTION_CALL_NONARRAY 0 -#define FUNCTION_CALL_ARRAY 1 - -static int -parse_expression(slang_parse_ctx * C, slang_output_ctx * O, - slang_operation * oper) -{ - slang_operation *ops = NULL; - unsigned int num_ops = 0; - int number; - - while (*C->I != OP_END) { - slang_operation *op; - const unsigned int op_code = *C->I++; - - /* allocate default operation, becomes a no-op if not used */ - ops = (slang_operation *) - _slang_realloc(ops, - num_ops * sizeof(slang_operation), - (num_ops + 1) * sizeof(slang_operation)); - if (ops == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - op = &ops[num_ops]; - if (!slang_operation_construct(op)) { - slang_info_log_memory(C->L); - RETURN0; - } - num_ops++; - op->locals->outer_scope = O->vars; - - switch (op_code) { - case OP_PUSH_VOID: - op->type = SLANG_OPER_VOID; - break; - case OP_PUSH_BOOL: - op->type = SLANG_OPER_LITERAL_BOOL; - if (!parse_number(C, &number)) - RETURN0; - op->literal[0] = - op->literal[1] = - op->literal[2] = - op->literal[3] = (GLfloat) number; - op->literal_size = 1; - break; - case OP_PUSH_INT: - op->type = SLANG_OPER_LITERAL_INT; - if (!parse_number(C, &number)) - RETURN0; - op->literal[0] = - op->literal[1] = - op->literal[2] = - op->literal[3] = (GLfloat) number; - op->literal_size = 1; - break; - case OP_PUSH_FLOAT: - op->type = SLANG_OPER_LITERAL_FLOAT; - if (!parse_float(C, &op->literal[0])) - RETURN0; - op->literal[1] = - op->literal[2] = - op->literal[3] = op->literal[0]; - op->literal_size = 1; - break; - case OP_PUSH_IDENTIFIER: - op->type = SLANG_OPER_IDENTIFIER; - op->a_id = parse_identifier(C); - if (op->a_id == SLANG_ATOM_NULL) - RETURN0; - break; - case OP_SEQUENCE: - op->type = SLANG_OPER_SEQUENCE; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_ASSIGN: - op->type = SLANG_OPER_ASSIGN; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_ADDASSIGN: - op->type = SLANG_OPER_ADDASSIGN; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_SUBASSIGN: - op->type = SLANG_OPER_SUBASSIGN; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_MULASSIGN: - op->type = SLANG_OPER_MULASSIGN; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_DIVASSIGN: - op->type = SLANG_OPER_DIVASSIGN; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - /*case OP_MODASSIGN: */ - /*case OP_LSHASSIGN: */ - /*case OP_RSHASSIGN: */ - /*case OP_ORASSIGN: */ - /*case OP_XORASSIGN: */ - /*case OP_ANDASSIGN: */ - case OP_SELECT: - op->type = SLANG_OPER_SELECT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 3)) - RETURN0; - break; - case OP_LOGICALOR: - op->type = SLANG_OPER_LOGICALOR; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_LOGICALXOR: - op->type = SLANG_OPER_LOGICALXOR; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_LOGICALAND: - op->type = SLANG_OPER_LOGICALAND; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - /*case OP_BITOR: */ - /*case OP_BITXOR: */ - /*case OP_BITAND: */ - case OP_EQUAL: - op->type = SLANG_OPER_EQUAL; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_NOTEQUAL: - op->type = SLANG_OPER_NOTEQUAL; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_LESS: - op->type = SLANG_OPER_LESS; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_GREATER: - op->type = SLANG_OPER_GREATER; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_LESSEQUAL: - op->type = SLANG_OPER_LESSEQUAL; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_GREATEREQUAL: - op->type = SLANG_OPER_GREATEREQUAL; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - /*case OP_LSHIFT: */ - /*case OP_RSHIFT: */ - case OP_ADD: - op->type = SLANG_OPER_ADD; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_SUBTRACT: - op->type = SLANG_OPER_SUBTRACT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_MULTIPLY: - op->type = SLANG_OPER_MULTIPLY; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_DIVIDE: - op->type = SLANG_OPER_DIVIDE; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - /*case OP_MODULUS: */ - case OP_PREINCREMENT: - op->type = SLANG_OPER_PREINCREMENT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_PREDECREMENT: - op->type = SLANG_OPER_PREDECREMENT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_PLUS: - op->type = SLANG_OPER_PLUS; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_MINUS: - op->type = SLANG_OPER_MINUS; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_NOT: - op->type = SLANG_OPER_NOT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - /*case OP_COMPLEMENT: */ - case OP_SUBSCRIPT: - op->type = SLANG_OPER_SUBSCRIPT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) - RETURN0; - break; - case OP_METHOD: - op->type = SLANG_OPER_METHOD; - op->a_obj = parse_identifier(C); - if (op->a_obj == SLANG_ATOM_NULL) - RETURN0; - - op->a_id = parse_identifier(C); - if (op->a_id == SLANG_ATOM_NULL) - RETURN0; - - assert(*C->I == OP_END); - C->I++; - - while (*C->I != OP_END) - if (!parse_child_operation(C, O, op, GL_FALSE)) - RETURN0; - C->I++; -#if 0 - /* don't lookup the method (not yet anyway) */ - if (!C->parsing_builtin - && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) { - const char *id; - - id = slang_atom_pool_id(C->atoms, op->a_id); - if (!is_constructor_name(id, op->a_id, O->structs)) { - slang_info_log_error(C->L, "%s: undeclared function name.", id); - RETURN0; - } - } -#endif - break; - case OP_CALL: - { - GLboolean array_constructor = GL_FALSE; - GLint array_constructor_size = 0; - - op->type = SLANG_OPER_CALL; - op->a_id = parse_identifier(C); - if (op->a_id == SLANG_ATOM_NULL) - RETURN0; - switch (*C->I++) { - case FUNCTION_CALL_NONARRAY: - /* Nothing to do. */ - break; - case FUNCTION_CALL_ARRAY: - /* Calling an array constructor. For example: - * float[3](1.1, 2.2, 3.3); - */ - if (!O->allow_array_types) { - slang_info_log_error(C->L, - "array constructors not allowed " - "in this GLSL version"); - RETURN0; - } - else { - /* parse the array constructor size */ - slang_operation array_size; - array_constructor = GL_TRUE; - slang_operation_construct(&array_size); - if (!parse_expression(C, O, &array_size)) { - slang_operation_destruct(&array_size); - return GL_FALSE; - } - if (array_size.type != SLANG_OPER_LITERAL_INT) { - slang_info_log_error(C->L, - "constructor array size is not an integer"); - slang_operation_destruct(&array_size); - RETURN0; - } - array_constructor_size = (int) array_size.literal[0]; - op->array_constructor = GL_TRUE; - slang_operation_destruct(&array_size); - } - break; - default: - assert(0); - RETURN0; - } - while (*C->I != OP_END) - if (!parse_child_operation(C, O, op, GL_FALSE)) - RETURN0; - C->I++; - - if (array_constructor && - array_constructor_size != op->num_children) { - slang_info_log_error(C->L, "number of parameters to array" - " constructor does not match array size"); - RETURN0; - } - - if (!C->parsing_builtin - && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) { - const char *id; - - id = slang_atom_pool_id(C->atoms, op->a_id); - if (!is_constructor_name(id, op->a_id, O->structs)) { - slang_info_log_error(C->L, "%s: undeclared function name.", id); - RETURN0; - } - } - } - break; - case OP_FIELD: - op->type = SLANG_OPER_FIELD; - op->a_id = parse_identifier(C); - if (op->a_id == SLANG_ATOM_NULL) - RETURN0; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_POSTINCREMENT: - op->type = SLANG_OPER_POSTINCREMENT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - case OP_POSTDECREMENT: - op->type = SLANG_OPER_POSTDECREMENT; - if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) - RETURN0; - break; - default: - RETURN0; - } - } - C->I++; - - slang_operation_destruct(oper); - *oper = *ops; /* struct copy */ - _slang_free(ops); - - return 1; -} - -/* parameter qualifier */ -#define PARAM_QUALIFIER_IN 0 -#define PARAM_QUALIFIER_OUT 1 -#define PARAM_QUALIFIER_INOUT 2 - -/* function parameter array presence */ -#define PARAMETER_ARRAY_NOT_PRESENT 0 -#define PARAMETER_ARRAY_PRESENT 1 - -static int -parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O, - slang_variable * param) -{ - int param_qual, precision_qual; - - /* parse and validate the parameter's type qualifiers (there can be - * two at most) because not all combinations are valid - */ - if (!parse_type_qualifier(C, ¶m->type.qualifier)) - RETURN0; - - param_qual = *C->I++; - switch (param_qual) { - case PARAM_QUALIFIER_IN: - if (param->type.qualifier != SLANG_QUAL_CONST - && param->type.qualifier != SLANG_QUAL_NONE) { - slang_info_log_error(C->L, "Invalid type qualifier."); - RETURN0; - } - break; - case PARAM_QUALIFIER_OUT: - if (param->type.qualifier == SLANG_QUAL_NONE) - param->type.qualifier = SLANG_QUAL_OUT; - else { - slang_info_log_error(C->L, "Invalid type qualifier."); - RETURN0; - } - break; - case PARAM_QUALIFIER_INOUT: - if (param->type.qualifier == SLANG_QUAL_NONE) - param->type.qualifier = SLANG_QUAL_INOUT; - else { - slang_info_log_error(C->L, "Invalid type qualifier."); - RETURN0; - } - break; - default: - RETURN0; - } - - /* parse precision qualifier (lowp, mediump, highp */ - precision_qual = *C->I++; - /* ignored at this time */ - (void) precision_qual; - - /* parse parameter's type specifier and name */ - if (!parse_type_specifier(C, O, ¶m->type.specifier)) - RETURN0; - if (!parse_type_array_size(C, O, ¶m->type.array_len)) - RETURN0; - param->a_name = parse_identifier(C); - if (param->a_name == SLANG_ATOM_NULL) - RETURN0; - - /* first-class array - */ - if (param->type.array_len >= 0) { - slang_type_specifier p; - - slang_type_specifier_ctr(&p); - if (!slang_type_specifier_copy(&p, ¶m->type.specifier)) { - slang_type_specifier_dtr(&p); - RETURN0; - } - if (!convert_to_array(C, param, &p)) { - slang_type_specifier_dtr(&p); - RETURN0; - } - slang_type_specifier_dtr(&p); - param->array_len = param->type.array_len; - } - - /* if the parameter is an array, parse its size (the size must be - * explicitly defined - */ - if (*C->I++ == PARAMETER_ARRAY_PRESENT) { - slang_type_specifier p; - - if (param->type.array_len >= 0) { - slang_info_log_error(C->L, "multi-dimensional arrays not allowed"); - RETURN0; - } - slang_type_specifier_ctr(&p); - if (!slang_type_specifier_copy(&p, ¶m->type.specifier)) { - slang_type_specifier_dtr(&p); - RETURN0; - } - if (!convert_to_array(C, param, &p)) { - slang_type_specifier_dtr(&p); - RETURN0; - } - slang_type_specifier_dtr(&p); - if (!parse_array_len(C, O, ¶m->array_len)) - RETURN0; - } - -#if 0 - /* calculate the parameter size */ - if (!calculate_var_size(C, O, param)) - RETURN0; -#endif - /* TODO: allocate the local address here? */ - return 1; -} - -/* function type */ -#define FUNCTION_ORDINARY 0 -#define FUNCTION_CONSTRUCTOR 1 -#define FUNCTION_OPERATOR 2 - -/* function parameter */ -#define PARAMETER_NONE 0 -#define PARAMETER_NEXT 1 - -/* operator type */ -#define OPERATOR_ADDASSIGN 1 -#define OPERATOR_SUBASSIGN 2 -#define OPERATOR_MULASSIGN 3 -#define OPERATOR_DIVASSIGN 4 -/*#define OPERATOR_MODASSIGN 5*/ -/*#define OPERATOR_LSHASSIGN 6*/ -/*#define OPERATOR_RSHASSIGN 7*/ -/*#define OPERATOR_ANDASSIGN 8*/ -/*#define OPERATOR_XORASSIGN 9*/ -/*#define OPERATOR_ORASSIGN 10*/ -#define OPERATOR_LOGICALXOR 11 -/*#define OPERATOR_BITOR 12*/ -/*#define OPERATOR_BITXOR 13*/ -/*#define OPERATOR_BITAND 14*/ -#define OPERATOR_LESS 15 -#define OPERATOR_GREATER 16 -#define OPERATOR_LESSEQUAL 17 -#define OPERATOR_GREATEREQUAL 18 -/*#define OPERATOR_LSHIFT 19*/ -/*#define OPERATOR_RSHIFT 20*/ -#define OPERATOR_MULTIPLY 21 -#define OPERATOR_DIVIDE 22 -/*#define OPERATOR_MODULUS 23*/ -#define OPERATOR_INCREMENT 24 -#define OPERATOR_DECREMENT 25 -#define OPERATOR_PLUS 26 -#define OPERATOR_MINUS 27 -/*#define OPERATOR_COMPLEMENT 28*/ -#define OPERATOR_NOT 29 - -static const struct -{ - unsigned int o_code; - const char *o_name; -} operator_names[] = { - {OPERATOR_INCREMENT, "++"}, - {OPERATOR_ADDASSIGN, "+="}, - {OPERATOR_PLUS, "+"}, - {OPERATOR_DECREMENT, "--"}, - {OPERATOR_SUBASSIGN, "-="}, - {OPERATOR_MINUS, "-"}, - {OPERATOR_NOT, "!"}, - {OPERATOR_MULASSIGN, "*="}, - {OPERATOR_MULTIPLY, "*"}, - {OPERATOR_DIVASSIGN, "/="}, - {OPERATOR_DIVIDE, "/"}, - {OPERATOR_LESSEQUAL, "<="}, - /*{ OPERATOR_LSHASSIGN, "<<=" }, */ - /*{ OPERATOR_LSHIFT, "<<" }, */ - {OPERATOR_LESS, "<"}, - {OPERATOR_GREATEREQUAL, ">="}, - /*{ OPERATOR_RSHASSIGN, ">>=" }, */ - /*{ OPERATOR_RSHIFT, ">>" }, */ - {OPERATOR_GREATER, ">"}, - /*{ OPERATOR_MODASSIGN, "%=" }, */ - /*{ OPERATOR_MODULUS, "%" }, */ - /*{ OPERATOR_ANDASSIGN, "&=" }, */ - /*{ OPERATOR_BITAND, "&" }, */ - /*{ OPERATOR_ORASSIGN, "|=" }, */ - /*{ OPERATOR_BITOR, "|" }, */ - /*{ OPERATOR_COMPLEMENT, "~" }, */ - /*{ OPERATOR_XORASSIGN, "^=" }, */ - {OPERATOR_LOGICALXOR, "^^"}, - /*{ OPERATOR_BITXOR, "^" } */ -}; - -static slang_atom -parse_operator_name(slang_parse_ctx * C) -{ - unsigned int i; - - for (i = 0; i < sizeof(operator_names) / sizeof(*operator_names); i++) { - if (operator_names[i].o_code == (unsigned int) (*C->I)) { - slang_atom atom = - slang_atom_pool_atom(C->atoms, operator_names[i].o_name); - if (atom == SLANG_ATOM_NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - C->I++; - return atom; - } - } - RETURN0; -} - - -static int -parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O, - slang_function * func) -{ - GLuint functype; - /* parse function type and name */ - if (!parse_fully_specified_type(C, O, &func->header.type)) - RETURN0; - - functype = *C->I++; - switch (functype) { - case FUNCTION_ORDINARY: - func->kind = SLANG_FUNC_ORDINARY; - func->header.a_name = parse_identifier(C); - if (func->header.a_name == SLANG_ATOM_NULL) - RETURN0; - break; - case FUNCTION_CONSTRUCTOR: - func->kind = SLANG_FUNC_CONSTRUCTOR; - if (func->header.type.specifier.type == SLANG_SPEC_STRUCT) - RETURN0; - func->header.a_name = - slang_atom_pool_atom(C->atoms, - slang_type_specifier_type_to_string - (func->header.type.specifier.type)); - if (func->header.a_name == SLANG_ATOM_NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - break; - case FUNCTION_OPERATOR: - func->kind = SLANG_FUNC_OPERATOR; - func->header.a_name = parse_operator_name(C); - if (func->header.a_name == SLANG_ATOM_NULL) - RETURN0; - break; - default: - RETURN0; - } - - if (!legal_identifier(func->header.a_name)) { - slang_info_log_error(C->L, "illegal function name '%s'", - (char *) func->header.a_name); - RETURN0; - } - - /* parse function parameters */ - while (*C->I++ == PARAMETER_NEXT) { - slang_variable *p = slang_variable_scope_grow(func->parameters); - if (!p) { - slang_info_log_memory(C->L); - RETURN0; - } - if (!parse_parameter_declaration(C, O, p)) - RETURN0; - } - - /* if the function returns a value, append a hidden __retVal 'out' - * parameter that corresponds to the return value. - */ - if (_slang_function_has_return_value(func)) { - slang_variable *p = slang_variable_scope_grow(func->parameters); - slang_atom a_retVal = slang_atom_pool_atom(C->atoms, "__retVal"); - assert(a_retVal); - p->a_name = a_retVal; - p->type = func->header.type; - p->type.qualifier = SLANG_QUAL_OUT; - } - - /* function formal parameters and local variables share the same - * scope, so save the information about param count in a seperate - * place also link the scope to the global variable scope so when a - * given identifier is not found here, the search process continues - * in the global space - */ - func->param_count = func->parameters->num_variables; - func->parameters->outer_scope = O->vars; - - return 1; -} - -static int -parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O, - slang_function * func) -{ - slang_output_ctx o = *O; - - if (!parse_function_prototype(C, O, func)) - RETURN0; - - /* create function's body operation */ - func->body = (slang_operation *) _slang_alloc(sizeof(slang_operation)); - if (func->body == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - if (!slang_operation_construct(func->body)) { - _slang_free(func->body); - func->body = NULL; - slang_info_log_memory(C->L); - RETURN0; - } - - /* to parse the body the parse context is modified in order to - * capture parsed variables into function's local variable scope - */ - C->global_scope = GL_FALSE; - o.vars = func->parameters; - if (!parse_statement(C, &o, func->body)) - RETURN0; - - C->global_scope = GL_TRUE; - return 1; -} - -static GLboolean -initialize_global(slang_assemble_ctx * A, slang_variable * var) -{ - slang_operation op_id, op_assign; - GLboolean result; - - /* construct the left side of assignment */ - if (!slang_operation_construct(&op_id)) - return GL_FALSE; - op_id.type = SLANG_OPER_IDENTIFIER; - op_id.a_id = var->a_name; - - /* put the variable into operation's scope */ - op_id.locals->variables = - (slang_variable **) _slang_alloc(sizeof(slang_variable *)); - if (op_id.locals->variables == NULL) { - slang_operation_destruct(&op_id); - return GL_FALSE; - } - op_id.locals->num_variables = 1; - op_id.locals->variables[0] = var; - - /* construct the assignment expression */ - if (!slang_operation_construct(&op_assign)) { - op_id.locals->num_variables = 0; - slang_operation_destruct(&op_id); - return GL_FALSE; - } - op_assign.type = SLANG_OPER_ASSIGN; - op_assign.children = - (slang_operation *) _slang_alloc(2 * sizeof(slang_operation)); - if (op_assign.children == NULL) { - slang_operation_destruct(&op_assign); - op_id.locals->num_variables = 0; - slang_operation_destruct(&op_id); - return GL_FALSE; - } - op_assign.num_children = 2; - op_assign.children[0] = op_id; - op_assign.children[1] = *var->initializer; - - result = 1; - - /* carefully destroy the operations */ - op_assign.num_children = 0; - _slang_free(op_assign.children); - op_assign.children = NULL; - slang_operation_destruct(&op_assign); - op_id.locals->num_variables = 0; - slang_operation_destruct(&op_id); - - if (!result) - return GL_FALSE; - - return GL_TRUE; -} - -/* init declarator list */ -#define DECLARATOR_NONE 0 -#define DECLARATOR_NEXT 1 - -/* variable declaration */ -#define VARIABLE_NONE 0 -#define VARIABLE_IDENTIFIER 1 -#define VARIABLE_INITIALIZER 2 -#define VARIABLE_ARRAY_EXPLICIT 3 -#define VARIABLE_ARRAY_UNKNOWN 4 - - -/** - * Parse the initializer for a variable declaration. - */ -static int -parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, - const slang_fully_specified_type * type) -{ - slang_variable *var; - slang_atom a_name; - - /* empty init declatator (without name, e.g. "float ;") */ - if (*C->I++ == VARIABLE_NONE) - return 1; - - a_name = parse_identifier(C); - - /* check if name is already in this scope */ - if (_slang_variable_locate(O->vars, a_name, GL_FALSE)) { - slang_info_log_error(C->L, - "declaration of '%s' conflicts with previous declaration", - (char *) a_name); - RETURN0; - } - - /* make room for the new variable and initialize it */ - var = slang_variable_scope_grow(O->vars); - if (!var) { - slang_info_log_memory(C->L); - RETURN0; - } - - /* copy the declarator type qualifier/etc info, parse the identifier */ - var->type.qualifier = type->qualifier; - var->type.centroid = type->centroid; - var->type.precision = type->precision; - var->type.variant = type->variant; - var->type.array_len = type->array_len; - var->a_name = a_name; - if (var->a_name == SLANG_ATOM_NULL) - RETURN0; - - switch (*C->I++) { - case VARIABLE_NONE: - /* simple variable declarator - just copy the specifier */ - if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) - RETURN0; - break; - case VARIABLE_INITIALIZER: - /* initialized variable - copy the specifier and parse the expression */ - if (0 && type->array_len >= 0) { - /* The type was something like "float[4]" */ - convert_to_array(C, var, &type->specifier); - var->array_len = type->array_len; - } - else { - if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) - RETURN0; - } - var->initializer = - (slang_operation *) _slang_alloc(sizeof(slang_operation)); - if (var->initializer == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } - if (!slang_operation_construct(var->initializer)) { - _slang_free(var->initializer); - var->initializer = NULL; - slang_info_log_memory(C->L); - RETURN0; - } - if (!parse_expression(C, O, var->initializer)) - RETURN0; - break; - case VARIABLE_ARRAY_UNKNOWN: - /* unsized array - mark it as array and copy the specifier to - * the array element - */ - if (type->array_len >= 0) { - slang_info_log_error(C->L, "multi-dimensional arrays not allowed"); - RETURN0; - } - if (!convert_to_array(C, var, &type->specifier)) - return GL_FALSE; - break; - case VARIABLE_ARRAY_EXPLICIT: - if (type->array_len >= 0) { - /* the user is trying to do something like: float[2] x[3]; */ - slang_info_log_error(C->L, "multi-dimensional arrays not allowed"); - RETURN0; - } - if (!convert_to_array(C, var, &type->specifier)) - return GL_FALSE; - if (!parse_array_len(C, O, &var->array_len)) - return GL_FALSE; - break; - default: - RETURN0; - } - - /* allocate global address space for a variable with a known size */ - if (C->global_scope - && !(var->type.specifier.type == SLANG_SPEC_ARRAY - && var->array_len == 0)) { - if (!calculate_var_size(C, O, var)) - return GL_FALSE; - } - - /* emit code for global var decl */ - if (C->global_scope) { - slang_assemble_ctx A; - A.atoms = C->atoms; - A.space.funcs = O->funs; - A.space.structs = O->structs; - A.space.vars = O->vars; - A.program = O->program; - A.pragmas = O->pragmas; - A.vartable = O->vartable; - A.log = C->L; - A.curFuncEndLabel = NULL; - if (!_slang_codegen_global_variable(&A, var, C->type)) - RETURN0; - } - - /* initialize global variable */ - if (C->global_scope) { - if (var->initializer != NULL) { - slang_assemble_ctx A; - - A.atoms = C->atoms; - A.space.funcs = O->funs; - A.space.structs = O->structs; - A.space.vars = O->vars; - if (!initialize_global(&A, var)) - RETURN0; - } - } - return 1; -} - -/** - * Parse a list of variable declarations. Each variable may have an - * initializer. - */ -static int -parse_init_declarator_list(slang_parse_ctx * C, slang_output_ctx * O) -{ - slang_fully_specified_type type; - - /* parse the fully specified type, common to all declarators */ - if (!slang_fully_specified_type_construct(&type)) - RETURN0; - if (!parse_fully_specified_type(C, O, &type)) { - slang_fully_specified_type_destruct(&type); - RETURN0; - } - - /* parse declarators, pass-in the parsed type */ - do { - if (!parse_init_declarator(C, O, &type)) { - slang_fully_specified_type_destruct(&type); - RETURN0; - } - } - while (*C->I++ == DECLARATOR_NEXT); - - slang_fully_specified_type_destruct(&type); - return 1; -} - - -/** - * Parse a function definition or declaration. - * \param C parsing context - * \param O output context - * \param definition if non-zero expect a definition, else a declaration - * \param parsed_func_ret returns the parsed function - * \return GL_TRUE if success, GL_FALSE if failure - */ -static GLboolean -parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition, - slang_function ** parsed_func_ret) -{ - slang_function parsed_func, *found_func; - - /* parse function definition/declaration */ - if (!slang_function_construct(&parsed_func)) - return GL_FALSE; - if (definition) { - if (!parse_function_definition(C, O, &parsed_func)) { - slang_function_destruct(&parsed_func); - return GL_FALSE; - } - } - else { - if (!parse_function_prototype(C, O, &parsed_func)) { - slang_function_destruct(&parsed_func); - return GL_FALSE; - } - } - - /* find a function with a prototype matching the parsed one - only - * the current scope is being searched to allow built-in function - * overriding - */ - found_func = slang_function_scope_find(O->funs, &parsed_func, 0); - if (found_func == NULL) { - /* New function, add it to the function list */ - O->funs->functions = - (slang_function *) _slang_realloc(O->funs->functions, - O->funs->num_functions - * sizeof(slang_function), - (O->funs->num_functions + 1) - * sizeof(slang_function)); - if (O->funs->functions == NULL) { - slang_info_log_memory(C->L); - slang_function_destruct(&parsed_func); - return GL_FALSE; - } - O->funs->functions[O->funs->num_functions] = parsed_func; - O->funs->num_functions++; - - /* return the newly parsed function */ - *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1]; - } - else { - /* previously defined or declared */ - /* TODO: check function return type qualifiers and specifiers */ - if (definition) { - if (found_func->body != NULL) { - slang_info_log_error(C->L, "%s: function already has a body.", - slang_atom_pool_id(C->atoms, - parsed_func.header. - a_name)); - slang_function_destruct(&parsed_func); - return GL_FALSE; - } - - /* destroy the existing function declaration and replace it - * with the new one - */ - slang_function_destruct(found_func); - *found_func = parsed_func; - } - else { - /* another declaration of the same function prototype - ignore it */ - slang_function_destruct(&parsed_func); - } - - /* return the found function */ - *parsed_func_ret = found_func; - } - - return GL_TRUE; -} - -/* declaration */ -#define DECLARATION_FUNCTION_PROTOTYPE 1 -#define DECLARATION_INIT_DECLARATOR_LIST 2 - -static int -parse_declaration(slang_parse_ctx * C, slang_output_ctx * O) -{ - switch (*C->I++) { - case DECLARATION_INIT_DECLARATOR_LIST: - if (!parse_init_declarator_list(C, O)) - RETURN0; - break; - case DECLARATION_FUNCTION_PROTOTYPE: - { - slang_function *dummy_func; - - if (!parse_function(C, O, 0, &dummy_func)) - RETURN0; - } - break; - default: - RETURN0; - } - return 1; -} - -static int -parse_default_precision(slang_parse_ctx * C, slang_output_ctx * O) -{ - int precision, type; - - if (!O->allow_precision) { - slang_info_log_error(C->L, "syntax error at \"precision\""); - RETURN0; - } - - precision = *C->I++; - switch (precision) { - case PRECISION_LOW: - case PRECISION_MEDIUM: - case PRECISION_HIGH: - /* OK */ - break; - default: - _mesa_problem(NULL, "unexpected precision %d at %s:%d\n", - precision, __FILE__, __LINE__); - RETURN0; - } - - type = *C->I++; - switch (type) { - case TYPE_SPECIFIER_FLOAT: - case TYPE_SPECIFIER_INT: - case TYPE_SPECIFIER_SAMPLER1D: - case TYPE_SPECIFIER_SAMPLER2D: - case TYPE_SPECIFIER_SAMPLER3D: - case TYPE_SPECIFIER_SAMPLERCUBE: - case TYPE_SPECIFIER_SAMPLER1DSHADOW: - case TYPE_SPECIFIER_SAMPLER2DSHADOW: - case TYPE_SPECIFIER_SAMPLER2DRECT: - case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW: - /* OK */ - break; - default: - _mesa_problem(NULL, "unexpected type %d at %s:%d\n", - type, __FILE__, __LINE__); - RETURN0; - } - - assert(type < TYPE_SPECIFIER_COUNT); - O->default_precision[type] = precision; - - return 1; -} - - -/** - * Initialize the default precision for all types. - * XXX this info isn't used yet. - */ -static void -init_default_precision(slang_output_ctx *O, slang_unit_type type) -{ - GLuint i; - for (i = 0; i < TYPE_SPECIFIER_COUNT; i++) { -#if FEATURE_es2_glsl - O->default_precision[i] = PRECISION_LOW; -#else - O->default_precision[i] = PRECISION_HIGH; -#endif - } - - if (type == SLANG_UNIT_VERTEX_SHADER) { - O->default_precision[TYPE_SPECIFIER_FLOAT] = PRECISION_HIGH; - O->default_precision[TYPE_SPECIFIER_INT] = PRECISION_HIGH; - } - else { - O->default_precision[TYPE_SPECIFIER_INT] = PRECISION_MEDIUM; - } -} - - -static int -parse_invariant(slang_parse_ctx * C, slang_output_ctx * O) -{ - if (O->allow_invariant) { - slang_atom *a = parse_identifier(C); - /* XXX not doing anything with this var yet */ - /*printf("ID: %s\n", (char*) a);*/ - return a ? 1 : 0; - } - else { - slang_info_log_error(C->L, "syntax error at \"invariant\""); - RETURN0; - } -} - - -/* external declaration or default precision specifier */ -#define EXTERNAL_NULL 0 -#define EXTERNAL_FUNCTION_DEFINITION 1 -#define EXTERNAL_DECLARATION 2 -#define DEFAULT_PRECISION 3 -#define INVARIANT_STMT 4 - - -static GLboolean -parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, - struct gl_shader *shader) -{ - GET_CURRENT_CONTEXT(ctx); - slang_output_ctx o; - GLboolean success; - GLuint maxRegs; - slang_function *mainFunc = NULL; - - if (unit->type == SLANG_UNIT_FRAGMENT_BUILTIN || - unit->type == SLANG_UNIT_FRAGMENT_SHADER) { - maxRegs = ctx->Const.FragmentProgram.MaxTemps; - } - else { - assert(unit->type == SLANG_UNIT_VERTEX_BUILTIN || - unit->type == SLANG_UNIT_VERTEX_SHADER); - maxRegs = ctx->Const.VertexProgram.MaxTemps; - } - - /* setup output context */ - o.funs = &unit->funs; - o.structs = &unit->structs; - o.vars = &unit->vars; - o.program = shader ? shader->Program : NULL; - o.pragmas = shader ? &shader->Pragmas : NULL; - o.vartable = _slang_new_var_table(maxRegs); - _slang_push_var_table(o.vartable); - - /* allow 'invariant' keyword? */ -#if FEATURE_es2_glsl - o.allow_invariant = GL_TRUE; -#else - o.allow_invariant = (C->version >= 120) ? GL_TRUE : GL_FALSE; -#endif - - /* allow 'centroid' keyword? */ - o.allow_centroid = (C->version >= 120) ? GL_TRUE : GL_FALSE; - - /* allow 'lowp/mediump/highp' keywords? */ -#if FEATURE_es2_glsl - o.allow_precision = GL_TRUE; -#else - o.allow_precision = (C->version >= 120) ? GL_TRUE : GL_FALSE; -#endif - init_default_precision(&o, unit->type); - - /* allow 'float[]' keyword? */ - o.allow_array_types = (C->version >= 120) ? GL_TRUE : GL_FALSE; - - /* parse individual functions and declarations */ - while (*C->I != EXTERNAL_NULL) { - switch (*C->I++) { - case EXTERNAL_FUNCTION_DEFINITION: - { - slang_function *func; - success = parse_function(C, &o, 1, &func); - if (success && - _mesa_strcmp((char *) func->header.a_name, "main") == 0) { - /* found main() */ - mainFunc = func; - } - } - break; - case EXTERNAL_DECLARATION: - success = parse_declaration(C, &o); - break; - case DEFAULT_PRECISION: - success = parse_default_precision(C, &o); - break; - case INVARIANT_STMT: - success = parse_invariant(C, &o); - break; - default: - success = GL_FALSE; - } - - if (!success) { - /* xxx free codegen */ - _slang_pop_var_table(o.vartable); - return GL_FALSE; - } - } - C->I++; - - if (mainFunc) { - /* assemble (generate code) for main() */ - slang_assemble_ctx A; - - A.atoms = C->atoms; - A.space.funcs = o.funs; - A.space.structs = o.structs; - A.space.vars = o.vars; - A.program = o.program; - A.pragmas = &shader->Pragmas; - A.vartable = o.vartable; - A.log = C->L; - - /* main() takes no parameters */ - if (mainFunc->param_count > 0) { - slang_info_log_error(A.log, "main() takes no arguments"); - return GL_FALSE; - } - - _slang_codegen_function(&A, mainFunc); - - shader->Main = GL_TRUE; /* this shader defines main() */ - } - - _slang_pop_var_table(o.vartable); - _slang_delete_var_table(o.vartable); - - return GL_TRUE; -} - -static GLboolean -compile_binary(const byte * prod, slang_code_unit * unit, - GLuint version, - slang_unit_type type, slang_info_log * infolog, - slang_code_unit * builtin, slang_code_unit * downlink, - struct gl_shader *shader) -{ - slang_parse_ctx C; - - unit->type = type; - - /* setup parse context */ - C.I = prod; - C.L = infolog; - C.parsing_builtin = (builtin == NULL); - C.global_scope = GL_TRUE; - C.atoms = &unit->object->atompool; - C.type = type; - C.version = version; - - if (!check_revision(&C)) - return GL_FALSE; - - if (downlink != NULL) { - unit->vars.outer_scope = &downlink->vars; - unit->funs.outer_scope = &downlink->funs; - unit->structs.outer_scope = &downlink->structs; - } - - /* parse translation unit */ - return parse_code_unit(&C, unit, shader); -} - -static GLboolean -compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, - slang_unit_type type, slang_info_log * infolog, - slang_code_unit * builtin, - struct gl_shader *shader, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - byte *prod; - GLuint size, start, version; - slang_string preprocessed; - GLuint maxVersion; - -#if FEATURE_ARB_shading_language_120 - maxVersion = 120; -#elif FEATURE_es2_glsl - maxVersion = 100; -#else - maxVersion = 110; -#endif - - /* First retrieve the version number. */ - if (!_slang_preprocess_version(source, &version, &start, infolog)) - return GL_FALSE; - - if (version > maxVersion) { - slang_info_log_error(infolog, - "language version %.2f is not supported.", - version * 0.01); - return GL_FALSE; - } - - /* Now preprocess the source string. */ - slang_string_init(&preprocessed); - if (!_slang_preprocess_directives(&preprocessed, &source[start], - infolog, extensions, pragmas)) { - slang_string_free(&preprocessed); - slang_info_log_error(infolog, "failed to preprocess the source."); - return GL_FALSE; - } - - /* Finally check the syntax and generate its binary representation. */ - if (!grammar_fast_check(id, - (const byte *) (slang_string_cstr(&preprocessed)), - &prod, &size, 65536)) { - char buf[1024]; - GLint pos; - - slang_string_free(&preprocessed); - grammar_get_last_error((byte *) (buf), sizeof(buf), &pos); - slang_info_log_error(infolog, buf); - /* syntax error (possibly in library code) */ -#if 0 - { - int line, col; - char *s; - s = (char *) _mesa_find_line_column((const GLubyte *) source, - (const GLubyte *) source + pos, - &line, &col); - printf("Error on line %d, col %d: %s\n", line, col, s); - } -#endif - return GL_FALSE; - } - slang_string_free(&preprocessed); - - /* Syntax is okay - translate it to internal representation. */ - if (!compile_binary(prod, unit, version, type, infolog, builtin, - &builtin[SLANG_BUILTIN_TOTAL - 1], - shader)) { - grammar_alloc_free(prod); - return GL_FALSE; - } - grammar_alloc_free(prod); - return GL_TRUE; -} - -LONGSTRING static const char *slang_shader_syn = -#include "library/slang_shader_syn.h" - ; - -static const byte slang_core_gc[] = { -#include "library/slang_core_gc.h" -}; - -static const byte slang_120_core_gc[] = { -#include "library/slang_120_core_gc.h" -}; - -static const byte slang_120_fragment_gc[] = { -#include "library/slang_builtin_120_fragment_gc.h" -}; - -static const byte slang_common_builtin_gc[] = { -#include "library/slang_common_builtin_gc.h" -}; - -static const byte slang_fragment_builtin_gc[] = { -#include "library/slang_fragment_builtin_gc.h" -}; - -static const byte slang_vertex_builtin_gc[] = { -#include "library/slang_vertex_builtin_gc.h" -}; - -static GLboolean -compile_object(grammar * id, const char *source, slang_code_object * object, - slang_unit_type type, slang_info_log * infolog, - struct gl_shader *shader, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - slang_code_unit *builtins = NULL; - GLuint base_version = 110; - - /* load GLSL grammar */ - *id = grammar_load_from_text((const byte *) (slang_shader_syn)); - if (*id == 0) { - byte buf[1024]; - int pos; - - grammar_get_last_error(buf, 1024, &pos); - slang_info_log_error(infolog, (const char *) (buf)); - return GL_FALSE; - } - - /* set shader type - the syntax is slightly different for different shaders */ - if (type == SLANG_UNIT_FRAGMENT_SHADER - || type == SLANG_UNIT_FRAGMENT_BUILTIN) - grammar_set_reg8(*id, (const byte *) "shader_type", 1); - else - grammar_set_reg8(*id, (const byte *) "shader_type", 2); - - /* enable language extensions */ - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); - - /* if parsing user-specified shader, load built-in library */ - if (type == SLANG_UNIT_FRAGMENT_SHADER || type == SLANG_UNIT_VERTEX_SHADER) { - /* compile core functionality first */ - if (!compile_binary(slang_core_gc, - &object->builtin[SLANG_BUILTIN_CORE], - base_version, - SLANG_UNIT_FRAGMENT_BUILTIN, infolog, - NULL, NULL, NULL)) - return GL_FALSE; - -#if FEATURE_ARB_shading_language_120 - if (!compile_binary(slang_120_core_gc, - &object->builtin[SLANG_BUILTIN_120_CORE], - 120, - SLANG_UNIT_FRAGMENT_BUILTIN, infolog, - NULL, &object->builtin[SLANG_BUILTIN_CORE], NULL)) - return GL_FALSE; -#endif - - /* compile common functions and variables, link to core */ - if (!compile_binary(slang_common_builtin_gc, - &object->builtin[SLANG_BUILTIN_COMMON], -#if FEATURE_ARB_shading_language_120 - 120, -#else - base_version, -#endif - SLANG_UNIT_FRAGMENT_BUILTIN, infolog, NULL, -#if FEATURE_ARB_shading_language_120 - &object->builtin[SLANG_BUILTIN_120_CORE], -#else - &object->builtin[SLANG_BUILTIN_CORE], -#endif - NULL)) - return GL_FALSE; - - /* compile target-specific functions and variables, link to common */ - if (type == SLANG_UNIT_FRAGMENT_SHADER) { - if (!compile_binary(slang_fragment_builtin_gc, - &object->builtin[SLANG_BUILTIN_TARGET], - base_version, - SLANG_UNIT_FRAGMENT_BUILTIN, infolog, NULL, - &object->builtin[SLANG_BUILTIN_COMMON], NULL)) - return GL_FALSE; -#if FEATURE_ARB_shading_language_120 - if (!compile_binary(slang_120_fragment_gc, - &object->builtin[SLANG_BUILTIN_TARGET], - 120, - SLANG_UNIT_FRAGMENT_BUILTIN, infolog, NULL, - &object->builtin[SLANG_BUILTIN_COMMON], NULL)) - return GL_FALSE; -#endif - } - else if (type == SLANG_UNIT_VERTEX_SHADER) { - if (!compile_binary(slang_vertex_builtin_gc, - &object->builtin[SLANG_BUILTIN_TARGET], - base_version, - SLANG_UNIT_VERTEX_BUILTIN, infolog, NULL, - &object->builtin[SLANG_BUILTIN_COMMON], NULL)) - return GL_FALSE; - } - - /* disable language extensions */ -#if NEW_SLANG /* allow-built-ins */ - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); -#else - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 0); -#endif - builtins = object->builtin; - } - - /* compile the actual shader - pass-in built-in library for external shader */ - return compile_with_grammar(*id, source, &object->unit, type, infolog, - builtins, shader, extensions, pragmas); -} - - -static GLboolean -compile_shader(GLcontext *ctx, slang_code_object * object, - slang_unit_type type, slang_info_log * infolog, - struct gl_shader *shader) -{ - GLboolean success; - grammar id = 0; - -#if 0 /* for debug */ - _mesa_printf("********* COMPILE SHADER ***********\n"); - _mesa_printf("%s\n", shader->Source); - _mesa_printf("************************************\n"); -#endif - - assert(shader->Program); - - _slang_code_object_dtr(object); - _slang_code_object_ctr(object); - - success = compile_object(&id, shader->Source, object, type, infolog, shader, - &ctx->Extensions, &shader->Pragmas); - if (id != 0) - grammar_destroy(id); - if (!success) - return GL_FALSE; - - return GL_TRUE; -} - - - -GLboolean -_slang_compile(GLcontext *ctx, struct gl_shader *shader) -{ - GLboolean success; - slang_info_log info_log; - slang_code_object obj; - slang_unit_type type; - - if (shader->Type == GL_VERTEX_SHADER) { - type = SLANG_UNIT_VERTEX_SHADER; - } - else { - assert(shader->Type == GL_FRAGMENT_SHADER); - type = SLANG_UNIT_FRAGMENT_SHADER; - } - - if (!shader->Source) - return GL_FALSE; - - ctx->Shader.MemPool = _slang_new_mempool(1024*1024); - - shader->Main = GL_FALSE; - - if (!shader->Program) { - GLenum progTarget; - if (shader->Type == GL_VERTEX_SHADER) - progTarget = GL_VERTEX_PROGRAM_ARB; - else - progTarget = GL_FRAGMENT_PROGRAM_ARB; - shader->Program = ctx->Driver.NewProgram(ctx, progTarget, 1); - shader->Program->Parameters = _mesa_new_parameter_list(); - shader->Program->Varying = _mesa_new_parameter_list(); - shader->Program->Attributes = _mesa_new_parameter_list(); - } - - slang_info_log_construct(&info_log); - _slang_code_object_ctr(&obj); - - success = compile_shader(ctx, &obj, type, &info_log, shader); - - /* free shader's prev info log */ - if (shader->InfoLog) { - _mesa_free(shader->InfoLog); - shader->InfoLog = NULL; - } - - if (info_log.text) { - /* copy info-log string to shader object */ - shader->InfoLog = _mesa_strdup(info_log.text); - } - - if (info_log.error_flag) { - success = GL_FALSE; - } - - slang_info_log_destruct(&info_log); - _slang_code_object_dtr(&obj); - - _slang_delete_mempool((slang_mempool *) ctx->Shader.MemPool); - ctx->Shader.MemPool = NULL; - - /* remove any reads of output registers */ -#if 0 - printf("Pre-remove output reads:\n"); - _mesa_print_program(shader->Program); -#endif - _mesa_remove_output_reads(shader->Program, PROGRAM_OUTPUT); - if (shader->Type == GL_VERTEX_SHADER) { - /* and remove writes to varying vars in vertex programs */ - _mesa_remove_output_reads(shader->Program, PROGRAM_VARYING); - } -#if 0 - printf("Post-remove output reads:\n"); - _mesa_print_program(shader->Program); -#endif - - return success; -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile.h b/src/libs/mesa/mesa/shader/slang/slang_compile.h deleted file mode 100644 index 7fb549d33d..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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. - */ - -#if !defined SLANG_COMPILE_H -#define SLANG_COMPILE_H - -#include "main/imports.h" -#include "main/mtypes.h" -#include "slang_typeinfo.h" -#include "slang_compile_variable.h" -#include "slang_compile_struct.h" -#include "slang_compile_operation.h" -#include "slang_compile_function.h" - -#if defined __cplusplus -extern "C" { -#endif - -typedef struct slang_name_space_ -{ - struct slang_function_scope_ *funcs; - struct slang_struct_scope_ *structs; - struct slang_variable_scope_ *vars; -} slang_name_space; - -typedef enum slang_unit_type_ -{ - SLANG_UNIT_FRAGMENT_SHADER, - SLANG_UNIT_VERTEX_SHADER, - SLANG_UNIT_FRAGMENT_BUILTIN, - SLANG_UNIT_VERTEX_BUILTIN -} slang_unit_type; - - -typedef struct slang_code_unit_ -{ - slang_variable_scope vars; - slang_function_scope funs; - slang_struct_scope structs; - slang_unit_type type; - struct slang_code_object_ *object; -} slang_code_unit; - - -extern GLvoid -_slang_code_unit_ctr (slang_code_unit *, struct slang_code_object_ *); - -extern GLvoid -_slang_code_unit_dtr (slang_code_unit *); - -#define SLANG_BUILTIN_CORE 0 -#define SLANG_BUILTIN_120_CORE 1 -#define SLANG_BUILTIN_COMMON 2 -#define SLANG_BUILTIN_TARGET 3 - -#define SLANG_BUILTIN_TOTAL 4 - -typedef struct slang_code_object_ -{ - slang_code_unit builtin[SLANG_BUILTIN_TOTAL]; - slang_code_unit unit; - slang_atom_pool atompool; -} slang_code_object; - -extern GLvoid -_slang_code_object_ctr (slang_code_object *); - -extern GLvoid -_slang_code_object_dtr (slang_code_object *); - -extern GLboolean -_slang_compile (GLcontext *ctx, struct gl_shader *shader); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_function.c b/src/libs/mesa/mesa/shader/slang/slang_compile_function.c deleted file mode 100644 index 4dd885176d..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_function.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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. - */ - -/** - * \file slang_compile_function.c - * slang front-end compiler - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_mem.h" - - -int -slang_function_construct(slang_function * func) -{ - func->kind = SLANG_FUNC_ORDINARY; - if (!slang_variable_construct(&func->header)) - return 0; - - func->parameters = (slang_variable_scope *) - _slang_alloc(sizeof(slang_variable_scope)); - if (func->parameters == NULL) { - slang_variable_destruct(&func->header); - return 0; - } - - _slang_variable_scope_ctr(func->parameters); - func->param_count = 0; - func->body = NULL; - return 1; -} - -void -slang_function_destruct(slang_function * func) -{ - slang_variable_destruct(&func->header); - slang_variable_scope_destruct(func->parameters); - _slang_free(func->parameters); - if (func->body != NULL) { - slang_operation_destruct(func->body); - _slang_free(func->body); - } -} - - -slang_function * -slang_function_new(slang_function_kind kind) -{ - slang_function *fun = (slang_function *) - _slang_alloc(sizeof(slang_function)); - if (fun) { - slang_function_construct(fun); - fun->kind = kind; - } - return fun; -} - - -/* - * slang_function_scope - */ - -GLvoid -_slang_function_scope_ctr(slang_function_scope * self) -{ - self->functions = NULL; - self->num_functions = 0; - self->outer_scope = NULL; -} - -void -slang_function_scope_destruct(slang_function_scope * scope) -{ - unsigned int i; - - for (i = 0; i < scope->num_functions; i++) - slang_function_destruct(scope->functions + i); - _slang_free(scope->functions); -} - - -/** - * Does this function have a non-void return value? - */ -GLboolean -_slang_function_has_return_value(const slang_function *fun) -{ - return fun->header.type.specifier.type != SLANG_SPEC_VOID; -} - - -/** - * Search a list of functions for a particular function by name. - * \param funcs the list of functions to search - * \param a_name the name to search for - * \param all_scopes if non-zero, search containing scopes too. - * \return pointer to found function, or NULL. - */ -int -slang_function_scope_find_by_name(slang_function_scope * funcs, - slang_atom a_name, int all_scopes) -{ - unsigned int i; - - for (i = 0; i < funcs->num_functions; i++) - if (a_name == funcs->functions[i].header.a_name) - return 1; - if (all_scopes && funcs->outer_scope != NULL) - return slang_function_scope_find_by_name(funcs->outer_scope, a_name, 1); - return 0; -} - - -/** - * Search a list of functions for a particular function (for implementing - * function calls. Matching is done by first comparing the function's name, - * then the function's parameter list. - * - * \param funcs the list of functions to search - * \param fun the function to search for - * \param all_scopes if non-zero, search containing scopes too. - * \return pointer to found function, or NULL. - */ -slang_function * -slang_function_scope_find(slang_function_scope * funcs, slang_function * fun, - int all_scopes) -{ - unsigned int i; - - for (i = 0; i < funcs->num_functions; i++) { - slang_function *f = &funcs->functions[i]; - const GLuint haveRetValue = 0; -#if 0 - = (f->header.type.specifier.type != SLANG_SPEC_VOID); -#endif - unsigned int j; - - /* - printf("Compare name %s to %s (ret %u, %d, %d)\n", - (char *) fun->header.a_name, (char *) f->header.a_name, - haveRetValue, - fun->param_count, f->param_count); - */ - - if (fun->header.a_name != f->header.a_name) - continue; - if (fun->param_count != f->param_count) - continue; - for (j = haveRetValue; j < fun->param_count; j++) { - if (!slang_type_specifier_equal - (&fun->parameters->variables[j]->type.specifier, - &f->parameters->variables[j]->type.specifier)) - break; - } - if (j == fun->param_count) { - /* - printf("Found match\n"); - */ - return f; - } - } - /* - printf("Not found\n"); - */ - if (all_scopes && funcs->outer_scope != NULL) - return slang_function_scope_find(funcs->outer_scope, fun, 1); - return NULL; -} - - -/** - * Lookup a function according to name and parameter count/types. - */ -slang_function * -_slang_function_locate(const slang_function_scope * funcs, slang_atom a_name, - slang_operation * args, GLuint num_args, - const slang_name_space * space, slang_atom_pool * atoms, - slang_info_log *log, GLboolean *error) -{ - slang_typeinfo arg_ti[100]; - GLuint i; - - *error = GL_FALSE; - - /* determine type of each argument */ - assert(num_args < 100); - for (i = 0; i < num_args; i++) { - if (!slang_typeinfo_construct(&arg_ti[i])) - return NULL; - if (!_slang_typeof_operation(&args[i], space, &arg_ti[i], atoms, log)) { - return NULL; - } - } - - /* loop over function scopes */ - while (funcs) { - - /* look for function with matching name and argument/param types */ - for (i = 0; i < funcs->num_functions; i++) { - slang_function *f = &funcs->functions[i]; - const GLuint haveRetValue = _slang_function_has_return_value(f); - GLuint j; - - if (a_name != f->header.a_name) - continue; - if (f->param_count - haveRetValue != num_args) - continue; - - /* compare parameter / argument types */ - for (j = 0; j < num_args; j++) { - if (!slang_type_specifier_compatible(&arg_ti[j].spec, - &f->parameters->variables[j]->type.specifier)) { - /* param/arg types don't match */ - break; - } - - /* "out" and "inout" formal parameter requires the actual - * argument to be an l-value. - */ - if (!arg_ti[j].can_be_referenced && - (f->parameters->variables[j]->type.qualifier == SLANG_QUAL_OUT || - f->parameters->variables[j]->type.qualifier == SLANG_QUAL_INOUT)) { - /* param is not an lvalue! */ - *error = GL_TRUE; - return NULL; - } - } - - if (j == num_args) { - /* name and args match! */ - return f; - } - } - - funcs = funcs->outer_scope; - } - - return NULL; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_function.h b/src/libs/mesa/mesa/shader/slang/slang_compile_function.h deleted file mode 100644 index a5445ec253..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_function.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 2005-2006 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 SLANG_COMPILE_FUNCTION_H -#define SLANG_COMPILE_FUNCTION_H - - -/** - * Types of functions. - */ -typedef enum slang_function_kind_ -{ - SLANG_FUNC_ORDINARY, - SLANG_FUNC_CONSTRUCTOR, - SLANG_FUNC_OPERATOR -} slang_function_kind; - - -/** - * Description of a compiled shader function. - */ -typedef struct slang_function_ -{ - slang_function_kind kind; - slang_variable header; /**< The function's name and return type */ - slang_variable_scope *parameters; /**< formal parameters AND local vars */ - unsigned int param_count; /**< number of formal params (no locals) */ - slang_operation *body; /**< The instruction tree */ -} slang_function; - -extern int slang_function_construct(slang_function *); -extern void slang_function_destruct(slang_function *); -extern slang_function *slang_function_new(slang_function_kind kind); - -extern GLboolean -_slang_function_has_return_value(const slang_function *fun); - - -/** - * Basically, a list of compiled functions. - */ -typedef struct slang_function_scope_ -{ - slang_function *functions; - GLuint num_functions; - struct slang_function_scope_ *outer_scope; -} slang_function_scope; - - -extern GLvoid -_slang_function_scope_ctr(slang_function_scope *); - -extern void -slang_function_scope_destruct(slang_function_scope *); - -extern int -slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int); - -extern slang_function * -slang_function_scope_find(slang_function_scope *, slang_function *, int); - -extern struct slang_function_ * -_slang_function_locate(const struct slang_function_scope_ *funcs, - slang_atom name, struct slang_operation_ *params, - GLuint num_params, - const struct slang_name_space_ *space, - slang_atom_pool *atoms, slang_info_log *log, - GLboolean *error); - - -#endif /* SLANG_COMPILE_FUNCTION_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_operation.c b/src/libs/mesa/mesa/shader/slang/slang_compile_operation.c deleted file mode 100644 index e650616880..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_operation.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 2005-2006 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. - */ - -/** - * \file slang_compile_operation.c - * slang front-end compiler - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_mem.h" - - -/** - * Init a slang_operation object - */ -GLboolean -slang_operation_construct(slang_operation * oper) -{ - oper->type = SLANG_OPER_NONE; - oper->children = NULL; - oper->num_children = 0; - oper->literal[0] = 0.0; - oper->literal_size = 1; - oper->array_constructor = GL_FALSE; - oper->a_id = SLANG_ATOM_NULL; - oper->locals = _slang_variable_scope_new(NULL); - if (oper->locals == NULL) - return GL_FALSE; - _slang_variable_scope_ctr(oper->locals); - oper->fun = NULL; - oper->var = NULL; - return GL_TRUE; -} - -void -slang_operation_destruct(slang_operation * oper) -{ - GLuint i; - - for (i = 0; i < oper->num_children; i++) - slang_operation_destruct(oper->children + i); - _slang_free(oper->children); - slang_variable_scope_destruct(oper->locals); - _slang_free(oper->locals); - oper->children = NULL; - oper->num_children = 0; - oper->locals = NULL; -} - - -/** - * Recursively traverse 'oper', replacing occurances of 'oldScope' with - * 'newScope' in the oper->locals->outer_scope field. - */ -void -slang_replace_scope(slang_operation *oper, - slang_variable_scope *oldScope, - slang_variable_scope *newScope) -{ - GLuint i; - - if (oper->locals != newScope && - oper->locals->outer_scope == oldScope) { - /* found. replace old w/ new */ - oper->locals->outer_scope = newScope; - } - - if (oper->type == SLANG_OPER_VARIABLE_DECL) { - /* search/replace in the initializer */ - slang_variable *var; - var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE); - if (var && var->initializer) { - slang_replace_scope(var->initializer, oldScope, newScope); - } - } - - /* search/replace in children */ - for (i = 0; i < oper->num_children; i++) { - slang_replace_scope(&oper->children[i], oldScope, newScope); - } -} - - -/** - * Recursively copy a slang_operation node. - * \param x copy target - * \param y copy source - * \return GL_TRUE for success, GL_FALSE if failure - */ -GLboolean -slang_operation_copy(slang_operation * x, const slang_operation * y) -{ - slang_operation z; - GLuint i; - - if (!slang_operation_construct(&z)) - return GL_FALSE; - z.type = y->type; - z.children = (slang_operation *) - _slang_alloc(y->num_children * sizeof(slang_operation)); - if (z.children == NULL) { - slang_operation_destruct(&z); - return GL_FALSE; - } - for (z.num_children = 0; z.num_children < y->num_children; - z.num_children++) { - if (!slang_operation_construct(&z.children[z.num_children])) { - slang_operation_destruct(&z); - return GL_FALSE; - } - } - for (i = 0; i < z.num_children; i++) { - if (!slang_operation_copy(&z.children[i], &y->children[i])) { - slang_operation_destruct(&z); - return GL_FALSE; - } - } - z.literal[0] = y->literal[0]; - z.literal[1] = y->literal[1]; - z.literal[2] = y->literal[2]; - z.literal[3] = y->literal[3]; - z.literal_size = y->literal_size; - assert(y->literal_size >= 1); - assert(y->literal_size <= 4); - z.a_id = y->a_id; - if (y->locals) { - if (!slang_variable_scope_copy(z.locals, y->locals)) { - slang_operation_destruct(&z); - return GL_FALSE; - } - } -#if 0 - z.var = y->var; - z.fun = y->fun; -#endif - slang_operation_destruct(x); - *x = z; - - /* If this operation declares a new scope, we need to make sure - * all children point to it, not the original operation's scope! - */ - if (x->type == SLANG_OPER_BLOCK_NEW_SCOPE || - x->type == SLANG_OPER_WHILE || - x->type == SLANG_OPER_FOR) { - slang_replace_scope(x, y->locals, x->locals); - } - - return GL_TRUE; -} - - -slang_operation * -slang_operation_new(GLuint count) -{ - slang_operation *ops - = (slang_operation *) _slang_alloc(count * sizeof(slang_operation)); - assert(count > 0); - if (ops) { - GLuint i; - for (i = 0; i < count; i++) - slang_operation_construct(ops + i); - } - return ops; -} - - -/** - * Delete operation and all children - */ -void -slang_operation_delete(slang_operation *oper) -{ - slang_operation_destruct(oper); - _slang_free(oper); -} - - -slang_operation * -slang_operation_grow(GLuint *numChildren, slang_operation **children) -{ - slang_operation *ops; - - ops = (slang_operation *) - _slang_realloc(*children, - *numChildren * sizeof(slang_operation), - (*numChildren + 1) * sizeof(slang_operation)); - if (ops) { - slang_operation *newOp = ops + *numChildren; - if (!slang_operation_construct(newOp)) { - _slang_free(ops); - *children = NULL; - return NULL; - } - *children = ops; - (*numChildren)++; - return newOp; - } - return NULL; -} - -/** - * Insert a new slang_operation into an array. - * \param numElements pointer to current array size (in/out) - * \param array address of the array (in/out) - * \param pos position to insert new element - * \return pointer to the new operation/element - */ -slang_operation * -slang_operation_insert(GLuint *numElements, slang_operation **array, - GLuint pos) -{ - slang_operation *ops; - - assert(pos <= *numElements); - - ops = (slang_operation *) - _slang_alloc((*numElements + 1) * sizeof(slang_operation)); - if (ops) { - slang_operation *newOp; - newOp = ops + pos; - if (pos > 0) - _mesa_memcpy(ops, *array, pos * sizeof(slang_operation)); - if (pos < *numElements) - _mesa_memcpy(newOp + 1, (*array) + pos, - (*numElements - pos) * sizeof(slang_operation)); - - if (!slang_operation_construct(newOp)) { - _slang_free(ops); - *numElements = 0; - *array = NULL; - return NULL; - } - if (*array) - _slang_free(*array); - *array = ops; - (*numElements)++; - return newOp; - } - return NULL; -} - - -void -_slang_operation_swap(slang_operation *oper0, slang_operation *oper1) -{ - slang_operation tmp = *oper0; - *oper0 = *oper1; - *oper1 = tmp; -} - - diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_operation.h b/src/libs/mesa/mesa/shader/slang/slang_compile_operation.h deleted file mode 100644 index 37af5d617c..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_operation.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 2005-2006 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 SLANG_COMPILE_OPERATION_H -#define SLANG_COMPILE_OPERATION_H - - -/** - * Types of slang operations. - * These are the types of the AST (abstract syntax tree) nodes. - * [foo] indicates a sub-tree or reference to another type of node - */ -typedef enum slang_operation_type_ -{ - SLANG_OPER_NONE, - SLANG_OPER_BLOCK_NO_NEW_SCOPE, /* "{" sequence "}" */ - SLANG_OPER_BLOCK_NEW_SCOPE, /* "{" sequence "}" */ - SLANG_OPER_VARIABLE_DECL, /* [type] [var] or [var] = [expr] */ - SLANG_OPER_ASM, - SLANG_OPER_BREAK, /* "break" statement */ - SLANG_OPER_CONTINUE, /* "continue" statement */ - SLANG_OPER_DISCARD, /* "discard" (kill fragment) statement */ - SLANG_OPER_RETURN, /* "return" [expr] */ - SLANG_OPER_LABEL, /* a jump target */ - SLANG_OPER_EXPRESSION, /* [expr] */ - SLANG_OPER_IF, /* "if" [0] then [1] else [2] */ - SLANG_OPER_WHILE, /* "while" [cond] [body] */ - SLANG_OPER_DO, /* "do" [body] "while" [cond] */ - SLANG_OPER_FOR, /* "for" [init] [while] [incr] [body] */ - SLANG_OPER_VOID, /* nop */ - SLANG_OPER_LITERAL_BOOL, /* "true" or "false" */ - SLANG_OPER_LITERAL_INT, /* integer literal */ - SLANG_OPER_LITERAL_FLOAT, /* float literal */ - SLANG_OPER_IDENTIFIER, /* var name, func name, etc */ - SLANG_OPER_SEQUENCE, /* [expr] "," [expr] "," etc */ - SLANG_OPER_ASSIGN, /* [var] "=" [expr] */ - SLANG_OPER_ADDASSIGN, /* [var] "+=" [expr] */ - SLANG_OPER_SUBASSIGN, /* [var] "-=" [expr] */ - SLANG_OPER_MULASSIGN, /* [var] "*=" [expr] */ - SLANG_OPER_DIVASSIGN, /* [var] "/=" [expr] */ - /*SLANG_OPER_MODASSIGN, */ - /*SLANG_OPER_LSHASSIGN, */ - /*SLANG_OPER_RSHASSIGN, */ - /*SLANG_OPER_ORASSIGN, */ - /*SLANG_OPER_XORASSIGN, */ - /*SLANG_OPER_ANDASSIGN, */ - SLANG_OPER_SELECT, /* [expr] "?" [expr] ":" [expr] */ - SLANG_OPER_LOGICALOR, /* [expr] "||" [expr] */ - SLANG_OPER_LOGICALXOR, /* [expr] "^^" [expr] */ - SLANG_OPER_LOGICALAND, /* [expr] "&&" [expr] */ - /*SLANG_OPER_BITOR, */ - /*SLANG_OPER_BITXOR, */ - /*SLANG_OPER_BITAND, */ - SLANG_OPER_EQUAL, /* [expr] "==" [expr] */ - SLANG_OPER_NOTEQUAL, /* [expr] "!=" [expr] */ - SLANG_OPER_LESS, /* [expr] "<" [expr] */ - SLANG_OPER_GREATER, /* [expr] ">" [expr] */ - SLANG_OPER_LESSEQUAL, /* [expr] "<=" [expr] */ - SLANG_OPER_GREATEREQUAL, /* [expr] ">=" [expr] */ - /*SLANG_OPER_LSHIFT, */ - /*SLANG_OPER_RSHIFT, */ - SLANG_OPER_ADD, /* [expr] "+" [expr] */ - SLANG_OPER_SUBTRACT, /* [expr] "-" [expr] */ - SLANG_OPER_MULTIPLY, /* [expr] "*" [expr] */ - SLANG_OPER_DIVIDE, /* [expr] "/" [expr] */ - /*SLANG_OPER_MODULUS, */ - SLANG_OPER_PREINCREMENT, /* "++" [var] */ - SLANG_OPER_PREDECREMENT, /* "--" [var] */ - SLANG_OPER_PLUS, /* "-" [expr] */ - SLANG_OPER_MINUS, /* "+" [expr] */ - /*SLANG_OPER_COMPLEMENT, */ - SLANG_OPER_NOT, /* "!" [expr] */ - SLANG_OPER_SUBSCRIPT, /* [expr] "[" [expr] "]" */ - SLANG_OPER_CALL, /* [func name] [param] [param] [...] */ - SLANG_OPER_NON_INLINED_CALL, /* a real function call */ - SLANG_OPER_METHOD, /* method call, such as v.length() */ - SLANG_OPER_FIELD, /* i.e.: ".next" or ".xzy" or ".xxx" etc */ - SLANG_OPER_POSTINCREMENT, /* [var] "++" */ - SLANG_OPER_POSTDECREMENT /* [var] "--" */ -} slang_operation_type; - - -/** - * A slang_operation is basically a compiled instruction (such as assignment, - * a while-loop, a conditional, a multiply, a function call, etc). - * The AST (abstract syntax tree) is built from these nodes. - * NOTE: This structure could have been implemented as a union of simpler - * structs which would correspond to the operation types above. - */ -typedef struct slang_operation_ -{ - slang_operation_type type; - struct slang_operation_ *children; - GLuint num_children; - GLfloat literal[4]; /**< Used for float, int and bool values */ - GLuint literal_size; /**< 1, 2, 3, or 4 */ - slang_atom a_id; /**< type: asm, identifier, call, field */ - slang_atom a_obj; /**< object in a method call */ - slang_variable_scope *locals; /**< local vars for scope */ - struct slang_function_ *fun; /**< If type == SLANG_OPER_CALL */ - struct slang_variable_ *var; /**< If type == slang_oper_identier */ - struct slang_label_ *label; /**< If type == SLANG_OPER_LABEL */ - /** If type==SLANG_OPER_CALL and we're calling an array constructor, - * for which there's no real function, we need to have a flag to - * indicate such. num_children indicates number of elements. - */ - GLboolean array_constructor; - double x; -} slang_operation; - - -extern GLboolean -slang_operation_construct(slang_operation *); - -extern void -slang_operation_destruct(slang_operation *); - -extern void -slang_replace_scope(slang_operation *oper, - slang_variable_scope *oldScope, - slang_variable_scope *newScope); - -extern GLboolean -slang_operation_copy(slang_operation *, const slang_operation *); - -extern slang_operation * -slang_operation_new(GLuint count); - -extern void -slang_operation_delete(slang_operation *oper); - -extern slang_operation * -slang_operation_grow(GLuint *numChildren, slang_operation **children); - -extern slang_operation * -slang_operation_insert(GLuint *numChildren, slang_operation **children, - GLuint pos); - -extern void -_slang_operation_swap(slang_operation *oper0, slang_operation *oper1); - - -#endif /* SLANG_COMPILE_OPERATION_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_struct.c b/src/libs/mesa/mesa/shader/slang/slang_compile_struct.c deleted file mode 100644 index e6c38730d7..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_struct.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file slang_compile_struct.c - * slang front-end compiler - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_mem.h" -#include "slang_compile.h" - - -GLvoid -_slang_struct_scope_ctr(slang_struct_scope * self) -{ - self->structs = NULL; - self->num_structs = 0; - self->outer_scope = NULL; -} - -void -slang_struct_scope_destruct(slang_struct_scope * scope) -{ - GLuint i; - - for (i = 0; i < scope->num_structs; i++) - slang_struct_destruct(scope->structs + i); - _slang_free(scope->structs); - /* do not free scope->outer_scope */ -} - -int -slang_struct_scope_copy(slang_struct_scope * x, const slang_struct_scope * y) -{ - slang_struct_scope z; - GLuint i; - - _slang_struct_scope_ctr(&z); - z.structs = (slang_struct *) - _slang_alloc(y->num_structs * sizeof(slang_struct)); - if (z.structs == NULL) { - slang_struct_scope_destruct(&z); - return 0; - } - for (z.num_structs = 0; z.num_structs < y->num_structs; z.num_structs++) - if (!slang_struct_construct(&z.structs[z.num_structs])) { - slang_struct_scope_destruct(&z); - return 0; - } - for (i = 0; i < z.num_structs; i++) - if (!slang_struct_copy(&z.structs[i], &y->structs[i])) { - slang_struct_scope_destruct(&z); - return 0; - } - z.outer_scope = y->outer_scope; - slang_struct_scope_destruct(x); - *x = z; - return 1; -} - -slang_struct * -slang_struct_scope_find(slang_struct_scope * stru, slang_atom a_name, - int all_scopes) -{ - GLuint i; - - for (i = 0; i < stru->num_structs; i++) - if (a_name == stru->structs[i].a_name) - return &stru->structs[i]; - if (all_scopes && stru->outer_scope != NULL) - return slang_struct_scope_find(stru->outer_scope, a_name, 1); - return NULL; -} - -/* slang_struct */ - -int -slang_struct_construct(slang_struct * stru) -{ - stru->a_name = SLANG_ATOM_NULL; - stru->fields = (slang_variable_scope *) - _slang_alloc(sizeof(slang_variable_scope)); - if (stru->fields == NULL) - return 0; - _slang_variable_scope_ctr(stru->fields); - - stru->structs = - (slang_struct_scope *) _slang_alloc(sizeof(slang_struct_scope)); - if (stru->structs == NULL) { - slang_variable_scope_destruct(stru->fields); - _slang_free(stru->fields); - return 0; - } - _slang_struct_scope_ctr(stru->structs); - stru->constructor = NULL; - return 1; -} - -void -slang_struct_destruct(slang_struct * stru) -{ - slang_variable_scope_destruct(stru->fields); - _slang_free(stru->fields); - slang_struct_scope_destruct(stru->structs); - _slang_free(stru->structs); -} - -int -slang_struct_copy(slang_struct * x, const slang_struct * y) -{ - slang_struct z; - - if (!slang_struct_construct(&z)) - return 0; - z.a_name = y->a_name; - if (!slang_variable_scope_copy(z.fields, y->fields)) { - slang_struct_destruct(&z); - return 0; - } - if (!slang_struct_scope_copy(z.structs, y->structs)) { - slang_struct_destruct(&z); - return 0; - } - slang_struct_destruct(x); - *x = z; - return 1; -} - -int -slang_struct_equal(const slang_struct * x, const slang_struct * y) -{ - GLuint i; - - if (x->fields->num_variables != y->fields->num_variables) - return 0; - - for (i = 0; i < x->fields->num_variables; i++) { - const slang_variable *varx = x->fields->variables[i]; - const slang_variable *vary = y->fields->variables[i]; - - if (varx->a_name != vary->a_name) - return 0; - if (!slang_type_specifier_equal(&varx->type.specifier, - &vary->type.specifier)) - return 0; - if (varx->type.specifier.type == SLANG_SPEC_ARRAY) - if (varx->array_len != vary->array_len) - return GL_FALSE; - } - return 1; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_struct.h b/src/libs/mesa/mesa/shader/slang/slang_compile_struct.h deleted file mode 100644 index 90c5512f4d..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_struct.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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. - */ - -#if !defined SLANG_COMPILE_STRUCT_H -#define SLANG_COMPILE_STRUCT_H - -#if defined __cplusplus -extern "C" { -#endif - -struct slang_function_; - -typedef struct slang_struct_scope_ -{ - struct slang_struct_ *structs; - GLuint num_structs; - struct slang_struct_scope_ *outer_scope; -} slang_struct_scope; - -extern GLvoid -_slang_struct_scope_ctr (slang_struct_scope *); - -void slang_struct_scope_destruct (slang_struct_scope *); -int slang_struct_scope_copy (slang_struct_scope *, const slang_struct_scope *); -struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, slang_atom, int); - -typedef struct slang_struct_ -{ - slang_atom a_name; - struct slang_variable_scope_ *fields; - slang_struct_scope *structs; - struct slang_function_ *constructor; -} slang_struct; - -int slang_struct_construct (slang_struct *); -void slang_struct_destruct (slang_struct *); -int slang_struct_copy (slang_struct *, const slang_struct *); -int slang_struct_equal (const slang_struct *, const slang_struct *); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_variable.c b/src/libs/mesa/mesa/shader/slang/slang_compile_variable.c deleted file mode 100644 index eab912710e..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_variable.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file slang_compile_variable.c - * slang front-end compiler - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_mem.h" - - -static slang_variable * -slang_variable_new(void) -{ - slang_variable *v = (slang_variable *) _slang_alloc(sizeof(slang_variable)); - if (v) { - if (!slang_variable_construct(v)) { - _slang_free(v); - v = NULL; - } - } - return v; -} - - -static void -slang_variable_delete(slang_variable * var) -{ - slang_variable_destruct(var); - _slang_free(var); -} - - -/* - * slang_variable_scope - */ - -slang_variable_scope * -_slang_variable_scope_new(slang_variable_scope *parent) -{ - slang_variable_scope *s; - s = (slang_variable_scope *) _slang_alloc(sizeof(slang_variable_scope)); - if (s) - s->outer_scope = parent; - return s; -} - - -GLvoid -_slang_variable_scope_ctr(slang_variable_scope * self) -{ - self->variables = NULL; - self->num_variables = 0; - self->outer_scope = NULL; -} - -void -slang_variable_scope_destruct(slang_variable_scope * scope) -{ - unsigned int i; - - if (!scope) - return; - for (i = 0; i < scope->num_variables; i++) { - if (scope->variables[i]) - slang_variable_delete(scope->variables[i]); - } - _slang_free(scope->variables); - /* do not free scope->outer_scope */ -} - -int -slang_variable_scope_copy(slang_variable_scope * x, - const slang_variable_scope * y) -{ - slang_variable_scope z; - unsigned int i; - - _slang_variable_scope_ctr(&z); - z.variables = (slang_variable **) - _slang_alloc(y->num_variables * sizeof(slang_variable *)); - if (z.variables == NULL) { - slang_variable_scope_destruct(&z); - return 0; - } - for (z.num_variables = 0; z.num_variables < y->num_variables; - z.num_variables++) { - z.variables[z.num_variables] = slang_variable_new(); - if (!z.variables[z.num_variables]) { - slang_variable_scope_destruct(&z); - return 0; - } - } - for (i = 0; i < z.num_variables; i++) { - if (!slang_variable_copy(z.variables[i], y->variables[i])) { - slang_variable_scope_destruct(&z); - return 0; - } - } - z.outer_scope = y->outer_scope; - slang_variable_scope_destruct(x); - *x = z; - return 1; -} - - -/** - * Grow the variable list by one. - * \return pointer to space for the new variable (will be initialized) - */ -slang_variable * -slang_variable_scope_grow(slang_variable_scope *scope) -{ - const int n = scope->num_variables; - scope->variables = (slang_variable **) - _slang_realloc(scope->variables, - n * sizeof(slang_variable *), - (n + 1) * sizeof(slang_variable *)); - if (!scope->variables) - return NULL; - - scope->num_variables++; - - scope->variables[n] = slang_variable_new(); - if (!scope->variables[n]) - return NULL; - - return scope->variables[n]; -} - - - -/* slang_variable */ - -int -slang_variable_construct(slang_variable * var) -{ - if (!slang_fully_specified_type_construct(&var->type)) - return 0; - var->a_name = SLANG_ATOM_NULL; - var->array_len = 0; - var->initializer = NULL; - var->size = 0; - var->isTemp = GL_FALSE; - var->store = NULL; - var->declared = 0; - return 1; -} - - -void -slang_variable_destruct(slang_variable * var) -{ - slang_fully_specified_type_destruct(&var->type); - if (var->initializer != NULL) { - slang_operation_destruct(var->initializer); - _slang_free(var->initializer); - } -#if 0 - if (var->aux) { - _mesa_free(var->aux); - } -#endif -} - - -int -slang_variable_copy(slang_variable * x, const slang_variable * y) -{ - slang_variable z; - - if (!slang_variable_construct(&z)) - return 0; - if (!slang_fully_specified_type_copy(&z.type, &y->type)) { - slang_variable_destruct(&z); - return 0; - } - z.a_name = y->a_name; - z.array_len = y->array_len; - if (y->initializer != NULL) { - z.initializer - = (slang_operation *) _slang_alloc(sizeof(slang_operation)); - if (z.initializer == NULL) { - slang_variable_destruct(&z); - return 0; - } - if (!slang_operation_construct(z.initializer)) { - _slang_free(z.initializer); - slang_variable_destruct(&z); - return 0; - } - if (!slang_operation_copy(z.initializer, y->initializer)) { - slang_variable_destruct(&z); - return 0; - } - } - z.size = y->size; - slang_variable_destruct(x); - *x = z; - return 1; -} - - -/** - * Search for named variable in given scope. - * \param all if true, search parent scopes too. - */ -slang_variable * -_slang_variable_locate(const slang_variable_scope * scope, - const slang_atom a_name, GLboolean all) -{ - while (scope) { - GLuint i; - for (i = 0; i < scope->num_variables; i++) - if (a_name == scope->variables[i]->a_name) - return scope->variables[i]; - if (all) - scope = scope->outer_scope; - else - scope = NULL; - } - return NULL; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_compile_variable.h b/src/libs/mesa/mesa/shader/slang/slang_compile_variable.h deleted file mode 100644 index a667d91b47..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_compile_variable.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 2005-2006 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 SLANG_COMPILE_VARIABLE_H -#define SLANG_COMPILE_VARIABLE_H - - -struct slang_ir_storage_; - - -/** - * A shading language program variable. - */ -typedef struct slang_variable_ -{ - slang_fully_specified_type type; /**< Variable's data type */ - slang_atom a_name; /**< The variable's name (char *) */ - GLuint array_len; /**< only if type == SLANG_SPEC_ARRAy */ - struct slang_operation_ *initializer; /**< Optional initializer code */ - GLuint size; /**< Variable's size in bytes */ - GLboolean isTemp; /**< a named temporary (__resultTmp) */ - GLboolean declared; /**< for debug */ - struct slang_ir_storage_ *store; /**< Storage for this var */ -} slang_variable; - - -/** - * Basically a list of variables, with a pointer to the parent scope. - */ -typedef struct slang_variable_scope_ -{ - slang_variable **variables; /**< Array [num_variables] of ptrs to vars */ - GLuint num_variables; - struct slang_variable_scope_ *outer_scope; -} slang_variable_scope; - - -extern slang_variable_scope * -_slang_variable_scope_new(slang_variable_scope *parent); - -extern GLvoid -_slang_variable_scope_ctr(slang_variable_scope *); - -extern void -slang_variable_scope_destruct(slang_variable_scope *); - -extern int -slang_variable_scope_copy(slang_variable_scope *, - const slang_variable_scope *); - -extern slang_variable * -slang_variable_scope_grow(slang_variable_scope *); - -extern int -slang_variable_construct(slang_variable *); - -extern void -slang_variable_destruct(slang_variable *); - -extern int -slang_variable_copy(slang_variable *, const slang_variable *); - -extern slang_variable * -_slang_variable_locate(const slang_variable_scope *, const slang_atom a_name, - GLboolean all); - - -#endif /* SLANG_COMPILE_VARIABLE_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_emit.c b/src/libs/mesa/mesa/shader/slang/slang_emit.c deleted file mode 100644 index 80ccc79eb9..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_emit.c +++ /dev/null @@ -1,2485 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. 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. - */ - -/** - * \file slang_emit.c - * Emit program instructions (PI code) from IR trees. - * \author Brian Paul - */ - -/*** - *** NOTES - *** - *** To emit GPU instructions, we basically just do an in-order traversal - *** of the IR tree. - ***/ - - -#include "main/imports.h" -#include "main/context.h" -#include "main/macros.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "slang_builtin.h" -#include "slang_emit.h" -#include "slang_mem.h" - - -#define PEEPHOLE_OPTIMIZATIONS 1 -#define ANNOTATE 0 - - -typedef struct -{ - slang_info_log *log; - slang_var_table *vt; - struct gl_program *prog; - struct gl_program **Subroutines; - GLuint NumSubroutines; - - GLuint MaxInstructions; /**< size of prog->Instructions[] buffer */ - - /* code-gen options */ - GLboolean EmitHighLevelInstructions; - GLboolean EmitCondCodes; - GLboolean EmitComments; - GLboolean EmitBeginEndSub; /* XXX TEMPORARY */ -} slang_emit_info; - - - -static struct gl_program * -new_subroutine(slang_emit_info *emitInfo, GLuint *id) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint n = emitInfo->NumSubroutines; - - emitInfo->Subroutines = (struct gl_program **) - _mesa_realloc(emitInfo->Subroutines, - n * sizeof(struct gl_program), - (n + 1) * sizeof(struct gl_program)); - emitInfo->Subroutines[n] = ctx->Driver.NewProgram(ctx, emitInfo->prog->Target, 0); - emitInfo->Subroutines[n]->Parameters = emitInfo->prog->Parameters; - emitInfo->NumSubroutines++; - *id = n; - return emitInfo->Subroutines[n]; -} - - -/** - * Convert a writemask to a swizzle. Used for testing cond codes because - * we only want to test the cond code component(s) that was set by the - * previous instruction. - */ -static GLuint -writemask_to_swizzle(GLuint writemask) -{ - if (writemask == WRITEMASK_X) - return SWIZZLE_XXXX; - if (writemask == WRITEMASK_Y) - return SWIZZLE_YYYY; - if (writemask == WRITEMASK_Z) - return SWIZZLE_ZZZZ; - if (writemask == WRITEMASK_W) - return SWIZZLE_WWWW; - return SWIZZLE_XYZW; /* shouldn't be hit */ -} - - -/** - * Convert a swizzle mask to a writemask. - * Note that the slang_ir_storage->Swizzle field can represent either a - * swizzle mask or a writemask, depending on how it's used. For example, - * when we parse "direction.yz" alone, we don't know whether .yz is a - * writemask or a swizzle. In this case, we encode ".yz" in store->Swizzle - * as a swizzle mask (.yz?? actually). Later, if direction.yz is used as - * an R-value, we use store->Swizzle as-is. Otherwise, if direction.yz is - * used as an L-value, we convert it to a writemask. - */ -static GLuint -swizzle_to_writemask(GLuint swizzle) -{ - GLuint i, writemask = 0x0; - for (i = 0; i < 4; i++) { - GLuint swz = GET_SWZ(swizzle, i); - if (swz <= SWIZZLE_W) { - writemask |= (1 << swz); - } - } - return writemask; -} - - -/** - * Swizzle a swizzle (function composition). - * That is, return swz2(swz1), or said another way: swz1.szw2 - * Example: swizzle_swizzle(".zwxx", ".xxyw") yields ".zzwx" - */ -GLuint -_slang_swizzle_swizzle(GLuint swz1, GLuint swz2) -{ - GLuint i, swz, s[4]; - for (i = 0; i < 4; i++) { - GLuint c = GET_SWZ(swz2, i); - if (c <= SWIZZLE_W) - s[i] = GET_SWZ(swz1, c); - else - s[i] = c; - } - swz = MAKE_SWIZZLE4(s[0], s[1], s[2], s[3]); - return swz; -} - - -/** - * Return the default swizzle mask for accessing a variable of the - * given size (in floats). If size = 1, comp is used to identify - * which component [0..3] of the register holds the variable. - */ -GLuint -_slang_var_swizzle(GLint size, GLint comp) -{ - switch (size) { - case 1: - return MAKE_SWIZZLE4(comp, SWIZZLE_NIL, SWIZZLE_NIL, SWIZZLE_NIL); - case 2: - return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_NIL, SWIZZLE_NIL); - case 3: - return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_NIL); - default: - return SWIZZLE_XYZW; - } -} - - - -/** - * Allocate storage for the given node (if it hasn't already been allocated). - * - * Typically this is temporary storage for an intermediate result (such as - * for a multiply or add, etc). - * - * If n->Store does not exist it will be created and will be of the size - * specified by defaultSize. - */ -static GLboolean -alloc_node_storage(slang_emit_info *emitInfo, slang_ir_node *n, - GLint defaultSize) -{ - assert(!n->Var); - if (!n->Store) { - assert(defaultSize > 0); - n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, defaultSize); - } - - /* now allocate actual register(s). I.e. set n->Store->Index >= 0 */ - if (n->Store->Index < 0) { - if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many temporaries"); - _slang_free(n->Store); - n->Store = NULL; - return GL_FALSE; - } - } - return GL_TRUE; -} - - -/** - * Free temporary storage, if n->Store is, in fact, temp storage. - * Otherwise, no-op. - */ -static void -free_node_storage(slang_var_table *vt, slang_ir_node *n) -{ - if (n->Store->File == PROGRAM_TEMPORARY && - n->Store->Index >= 0 && - n->Opcode != IR_SWIZZLE) { - if (_slang_is_temp(vt, n->Store)) { - _slang_free_temp(vt, n->Store); - n->Store->Index = -1; - n->Store = NULL; /* XXX this may not be needed */ - } - } -} - - -/** - * Helper function to allocate a short-term temporary. - * Free it with _slang_free_temp(). - */ -static GLboolean -alloc_local_temp(slang_emit_info *emitInfo, slang_ir_storage *temp, GLint size) -{ - assert(size >= 1); - assert(size <= 4); - _mesa_bzero(temp, sizeof(*temp)); - temp->Size = size; - temp->File = PROGRAM_TEMPORARY; - temp->Index = -1; - return _slang_alloc_temp(emitInfo->vt, temp); -} - - -/** - * Remove any SWIZZLE_NIL terms from given swizzle mask. - * For a swizzle like .z??? generate .zzzz (replicate single component). - * Else, for .wx?? generate .wxzw (insert default component for the position). - */ -static GLuint -fix_swizzle(GLuint swizzle) -{ - GLuint c0 = GET_SWZ(swizzle, 0), - c1 = GET_SWZ(swizzle, 1), - c2 = GET_SWZ(swizzle, 2), - c3 = GET_SWZ(swizzle, 3); - if (c1 == SWIZZLE_NIL && c2 == SWIZZLE_NIL && c3 == SWIZZLE_NIL) { - /* smear first component across all positions */ - c1 = c2 = c3 = c0; - } - else { - /* insert default swizzle components */ - if (c0 == SWIZZLE_NIL) - c0 = SWIZZLE_X; - if (c1 == SWIZZLE_NIL) - c1 = SWIZZLE_Y; - if (c2 == SWIZZLE_NIL) - c2 = SWIZZLE_Z; - if (c3 == SWIZZLE_NIL) - c3 = SWIZZLE_W; - } - return MAKE_SWIZZLE4(c0, c1, c2, c3); -} - - - -/** - * Convert IR storage to an instruction dst register. - */ -static void -storage_to_dst_reg(struct prog_dst_register *dst, const slang_ir_storage *st) -{ - const GLboolean relAddr = st->RelAddr; - const GLint size = st->Size; - GLint index = st->Index; - GLuint swizzle = st->Swizzle; - - assert(index >= 0); - /* if this is storage relative to some parent storage, walk up the tree */ - while (st->Parent) { - st = st->Parent; - assert(st->Index >= 0); - index += st->Index; - swizzle = _slang_swizzle_swizzle(st->Swizzle, swizzle); - } - - assert(st->File != PROGRAM_UNDEFINED); - dst->File = st->File; - - assert(index >= 0); - dst->Index = index; - - assert(size >= 1); - assert(size <= 4); - - if (swizzle != SWIZZLE_XYZW) { - dst->WriteMask = swizzle_to_writemask(swizzle); - } - else { - switch (size) { - case 1: - dst->WriteMask = WRITEMASK_X << GET_SWZ(st->Swizzle, 0); - break; - case 2: - dst->WriteMask = WRITEMASK_XY; - break; - case 3: - dst->WriteMask = WRITEMASK_XYZ; - break; - case 4: - dst->WriteMask = WRITEMASK_XYZW; - break; - default: - ; /* error would have been caught above */ - } - } - - dst->RelAddr = relAddr; -} - - -/** - * Convert IR storage to an instruction src register. - */ -static void -storage_to_src_reg(struct prog_src_register *src, const slang_ir_storage *st) -{ - const GLboolean relAddr = st->RelAddr; - GLint index = st->Index; - GLuint swizzle = st->Swizzle; - - /* if this is storage relative to some parent storage, walk up the tree */ - assert(index >= 0); - while (st->Parent) { - st = st->Parent; - if (st->Index < 0) { - /* an error should have been reported already */ - return; - } - assert(st->Index >= 0); - index += st->Index; - swizzle = _slang_swizzle_swizzle(fix_swizzle(st->Swizzle), swizzle); - } - - assert(st->File >= 0); -#if 1 /* XXX temporary */ - if (st->File == PROGRAM_UNDEFINED) { - slang_ir_storage *st0 = (slang_ir_storage *) st; - st0->File = PROGRAM_TEMPORARY; - } -#endif - assert(st->File < PROGRAM_UNDEFINED); - src->File = st->File; - - assert(index >= 0); - src->Index = index; - - swizzle = fix_swizzle(swizzle); - assert(GET_SWZ(swizzle, 0) <= SWIZZLE_W); - assert(GET_SWZ(swizzle, 1) <= SWIZZLE_W); - assert(GET_SWZ(swizzle, 2) <= SWIZZLE_W); - assert(GET_SWZ(swizzle, 3) <= SWIZZLE_W); - src->Swizzle = swizzle; - - src->RelAddr = relAddr; -} - - -/* - * Setup storage pointing to a scalar constant/literal. - */ -static void -constant_to_storage(slang_emit_info *emitInfo, - GLfloat val, - slang_ir_storage *store) -{ - GLuint swizzle; - GLint reg; - GLfloat value[4]; - - value[0] = val; - reg = _mesa_add_unnamed_constant(emitInfo->prog->Parameters, - value, 1, &swizzle); - - memset(store, 0, sizeof(*store)); - store->File = PROGRAM_CONSTANT; - store->Index = reg; - store->Swizzle = swizzle; -} - - -/** - * Add new instruction at end of given program. - * \param prog the program to append instruction onto - * \param opcode opcode for the new instruction - * \return pointer to the new instruction - */ -static struct prog_instruction * -new_instruction(slang_emit_info *emitInfo, gl_inst_opcode opcode) -{ - struct gl_program *prog = emitInfo->prog; - struct prog_instruction *inst; - -#if 0 - /* print prev inst */ - if (prog->NumInstructions > 0) { - _mesa_print_instruction(prog->Instructions + prog->NumInstructions - 1); - } -#endif - assert(prog->NumInstructions <= emitInfo->MaxInstructions); - - if (prog->NumInstructions == emitInfo->MaxInstructions) { - /* grow the instruction buffer */ - emitInfo->MaxInstructions += 20; - prog->Instructions = - _mesa_realloc_instructions(prog->Instructions, - prog->NumInstructions, - emitInfo->MaxInstructions); - } - - inst = prog->Instructions + prog->NumInstructions; - prog->NumInstructions++; - _mesa_init_instructions(inst, 1); - inst->Opcode = opcode; - inst->BranchTarget = -1; /* invalid */ - /* - printf("New inst %d: %p %s\n", prog->NumInstructions-1,(void*)inst, - _mesa_opcode_string(inst->Opcode)); - */ - return inst; -} - - -static struct prog_instruction * -emit_arl_load(slang_emit_info *emitInfo, - enum register_file file, GLint index, GLuint swizzle) -{ - struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); - inst->SrcReg[0].File = file; - inst->SrcReg[0].Index = index; - inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.Index = 0; - inst->DstReg.WriteMask = WRITEMASK_X; - return inst; -} - - -/** - * Emit a new instruction with given opcode, operands. - * At this point the instruction may have multiple indirect register - * loads/stores. We convert those into ARL loads and address-relative - * operands. See comments inside. - * At some point in the future we could directly emit indirectly addressed - * registers in Mesa GPU instructions. - */ -static struct prog_instruction * -emit_instruction(slang_emit_info *emitInfo, - gl_inst_opcode opcode, - const slang_ir_storage *dst, - const slang_ir_storage *src0, - const slang_ir_storage *src1, - const slang_ir_storage *src2) -{ - struct prog_instruction *inst; - GLuint numIndirect = 0; - const slang_ir_storage *src[3]; - slang_ir_storage newSrc[3], newDst; - GLuint i; - GLboolean isTemp[3]; - - isTemp[0] = isTemp[1] = isTemp[2] = GL_FALSE; - - src[0] = src0; - src[1] = src1; - src[2] = src2; - - /* count up how many operands are indirect loads */ - for (i = 0; i < 3; i++) { - if (src[i] && src[i]->IsIndirect) - numIndirect++; - } - if (dst && dst->IsIndirect) - numIndirect++; - - /* Take special steps for indirect register loads. - * If we had multiple address registers this would be simpler. - * For example, this GLSL code: - * x[i] = y[j] + z[k]; - * would translate into something like: - * ARL ADDR.x, i; - * ARL ADDR.y, j; - * ARL ADDR.z, k; - * ADD TEMP[ADDR.x+5], TEMP[ADDR.y+9], TEMP[ADDR.z+4]; - * But since we currently only have one address register we have to do this: - * ARL ADDR.x, i; - * MOV t1, TEMP[ADDR.x+9]; - * ARL ADDR.x, j; - * MOV t2, TEMP[ADDR.x+4]; - * ARL ADDR.x, k; - * ADD TEMP[ADDR.x+5], t1, t2; - * The code here figures this out... - */ - if (numIndirect > 0) { - for (i = 0; i < 3; i++) { - if (src[i] && src[i]->IsIndirect) { - /* load the ARL register with the indirect register */ - emit_arl_load(emitInfo, - src[i]->IndirectFile, - src[i]->IndirectIndex, - src[i]->IndirectSwizzle); - - if (numIndirect > 1) { - /* Need to load src[i] into a temporary register */ - slang_ir_storage srcRelAddr; - alloc_local_temp(emitInfo, &newSrc[i], src[i]->Size); - isTemp[i] = GL_TRUE; - - /* set RelAddr flag on src register */ - srcRelAddr = *src[i]; - srcRelAddr.RelAddr = GL_TRUE; - srcRelAddr.IsIndirect = GL_FALSE; /* not really needed */ - - /* MOV newSrc, srcRelAddr; */ - inst = emit_instruction(emitInfo, - OPCODE_MOV, - &newSrc[i], - &srcRelAddr, - NULL, - NULL); - - src[i] = &newSrc[i]; - } - else { - /* just rewrite the src[i] storage to be ARL-relative */ - newSrc[i] = *src[i]; - newSrc[i].RelAddr = GL_TRUE; - newSrc[i].IsIndirect = GL_FALSE; /* not really needed */ - src[i] = &newSrc[i]; - } - } - } - } - - /* Take special steps for indirect dest register write */ - if (dst && dst->IsIndirect) { - /* load the ARL register with the indirect register */ - emit_arl_load(emitInfo, - dst->IndirectFile, - dst->IndirectIndex, - dst->IndirectSwizzle); - newDst = *dst; - newDst.RelAddr = GL_TRUE; - newDst.IsIndirect = GL_FALSE; - dst = &newDst; - } - - /* OK, emit the instruction and its dst, src regs */ - inst = new_instruction(emitInfo, opcode); - if (!inst) - return NULL; - - if (dst) - storage_to_dst_reg(&inst->DstReg, dst); - - for (i = 0; i < 3; i++) { - if (src[i]) - storage_to_src_reg(&inst->SrcReg[i], src[i]); - } - - /* Free any temp registers that we allocated above */ - for (i = 0; i < 3; i++) { - if (isTemp[i]) - _slang_free_temp(emitInfo->vt, &newSrc[i]); - } - - return inst; -} - - - -/** - * Put a comment on the given instruction. - */ -static void -inst_comment(struct prog_instruction *inst, const char *comment) -{ - if (inst) - inst->Comment = _mesa_strdup(comment); -} - - - -/** - * Return pointer to last instruction in program. - */ -static struct prog_instruction * -prev_instruction(slang_emit_info *emitInfo) -{ - struct gl_program *prog = emitInfo->prog; - if (prog->NumInstructions == 0) - return NULL; - else - return prog->Instructions + prog->NumInstructions - 1; -} - - -static struct prog_instruction * -emit(slang_emit_info *emitInfo, slang_ir_node *n); - - -/** - * Return an annotation string for given node's storage. - */ -static char * -storage_annotation(const slang_ir_node *n, const struct gl_program *prog) -{ -#if ANNOTATE - const slang_ir_storage *st = n->Store; - static char s[100] = ""; - - if (!st) - return _mesa_strdup(""); - - switch (st->File) { - case PROGRAM_CONSTANT: - if (st->Index >= 0) { - const GLfloat *val = prog->Parameters->ParameterValues[st->Index]; - if (st->Swizzle == SWIZZLE_NOOP) - sprintf(s, "{%g, %g, %g, %g}", val[0], val[1], val[2], val[3]); - else { - sprintf(s, "%g", val[GET_SWZ(st->Swizzle, 0)]); - } - } - break; - case PROGRAM_TEMPORARY: - if (n->Var) - sprintf(s, "%s", (char *) n->Var->a_name); - else - sprintf(s, "t[%d]", st->Index); - break; - case PROGRAM_STATE_VAR: - case PROGRAM_UNIFORM: - sprintf(s, "%s", prog->Parameters->Parameters[st->Index].Name); - break; - case PROGRAM_VARYING: - sprintf(s, "%s", prog->Varying->Parameters[st->Index].Name); - break; - case PROGRAM_INPUT: - sprintf(s, "input[%d]", st->Index); - break; - case PROGRAM_OUTPUT: - sprintf(s, "output[%d]", st->Index); - break; - default: - s[0] = 0; - } - return _mesa_strdup(s); -#else - return NULL; -#endif -} - - -/** - * Return an annotation string for an instruction. - */ -static char * -instruction_annotation(gl_inst_opcode opcode, char *dstAnnot, - char *srcAnnot0, char *srcAnnot1, char *srcAnnot2) -{ -#if ANNOTATE - const char *operator; - char *s; - int len = 50; - - if (dstAnnot) - len += strlen(dstAnnot); - else - dstAnnot = _mesa_strdup(""); - - if (srcAnnot0) - len += strlen(srcAnnot0); - else - srcAnnot0 = _mesa_strdup(""); - - if (srcAnnot1) - len += strlen(srcAnnot1); - else - srcAnnot1 = _mesa_strdup(""); - - if (srcAnnot2) - len += strlen(srcAnnot2); - else - srcAnnot2 = _mesa_strdup(""); - - switch (opcode) { - case OPCODE_ADD: - operator = "+"; - break; - case OPCODE_SUB: - operator = "-"; - break; - case OPCODE_MUL: - operator = "*"; - break; - case OPCODE_DP2: - operator = "DP2"; - break; - case OPCODE_DP3: - operator = "DP3"; - break; - case OPCODE_DP4: - operator = "DP4"; - break; - case OPCODE_XPD: - operator = "XPD"; - break; - case OPCODE_RSQ: - operator = "RSQ"; - break; - case OPCODE_SGT: - operator = ">"; - break; - default: - operator = ","; - } - - s = (char *) malloc(len); - sprintf(s, "%s = %s %s %s %s", dstAnnot, - srcAnnot0, operator, srcAnnot1, srcAnnot2); - assert(_mesa_strlen(s) < len); - - free(dstAnnot); - free(srcAnnot0); - free(srcAnnot1); - free(srcAnnot2); - - return s; -#else - return NULL; -#endif -} - - -/** - * Emit an instruction that's just a comment. - */ -static struct prog_instruction * -emit_comment(slang_emit_info *emitInfo, const char *comment) -{ - struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_NOP); - inst_comment(inst, comment); - return inst; -} - - -/** - * Generate code for a simple arithmetic instruction. - * Either 1, 2 or 3 operands. - */ -static struct prog_instruction * -emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) -{ - const slang_ir_info *info = _slang_ir_info(n->Opcode); - struct prog_instruction *inst; - GLuint i; - - assert(info); - assert(info->InstOpcode != OPCODE_NOP); - -#if PEEPHOLE_OPTIMIZATIONS - /* Look for MAD opportunity */ - if (info->NumParams == 2 && - n->Opcode == IR_ADD && n->Children[0]->Opcode == IR_MUL) { - /* found pattern IR_ADD(IR_MUL(A, B), C) */ - emit(emitInfo, n->Children[0]->Children[0]); /* A */ - emit(emitInfo, n->Children[0]->Children[1]); /* B */ - emit(emitInfo, n->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ - - inst = emit_instruction(emitInfo, - OPCODE_MAD, - n->Store, - n->Children[0]->Children[0]->Store, - n->Children[0]->Children[1]->Store, - n->Children[1]->Store); - - free_node_storage(emitInfo->vt, n->Children[0]->Children[0]); - free_node_storage(emitInfo->vt, n->Children[0]->Children[1]); - free_node_storage(emitInfo->vt, n->Children[1]); - return inst; - } - - if (info->NumParams == 2 && - n->Opcode == IR_ADD && n->Children[1]->Opcode == IR_MUL) { - /* found pattern IR_ADD(A, IR_MUL(B, C)) */ - emit(emitInfo, n->Children[0]); /* A */ - emit(emitInfo, n->Children[1]->Children[0]); /* B */ - emit(emitInfo, n->Children[1]->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ - - inst = emit_instruction(emitInfo, - OPCODE_MAD, - n->Store, - n->Children[1]->Children[0]->Store, - n->Children[1]->Children[1]->Store, - n->Children[0]->Store); - - free_node_storage(emitInfo->vt, n->Children[1]->Children[0]); - free_node_storage(emitInfo->vt, n->Children[1]->Children[1]); - free_node_storage(emitInfo->vt, n->Children[0]); - return inst; - } -#endif - - /* gen code for children, may involve temp allocation */ - for (i = 0; i < info->NumParams; i++) { - emit(emitInfo, n->Children[i]); - if (!n->Children[i] || !n->Children[i]->Store) { - /* error recovery */ - return NULL; - } - } - - /* result storage */ - alloc_node_storage(emitInfo, n, -1); - - inst = emit_instruction(emitInfo, - info->InstOpcode, - n->Store, /* dest */ - (info->NumParams > 0 ? n->Children[0]->Store : NULL), - (info->NumParams > 1 ? n->Children[1]->Store : NULL), - (info->NumParams > 2 ? n->Children[2]->Store : NULL) - ); - - /* free temps */ - for (i = 0; i < info->NumParams; i++) - free_node_storage(emitInfo->vt, n->Children[i]); - - return inst; -} - - -/** - * Emit code for == and != operators. These could normally be handled - * by emit_arith() except we need to be able to handle structure comparisons. - */ -static struct prog_instruction * -emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst = NULL; - GLint size; - - assert(n->Opcode == IR_EQUAL || n->Opcode == IR_NOTEQUAL); - - /* gen code for children */ - emit(emitInfo, n->Children[0]); - emit(emitInfo, n->Children[1]); - - if (n->Children[0]->Store->Size != n->Children[1]->Store->Size) { - slang_info_log_error(emitInfo->log, "invalid operands to == or !="); - n->Store = NULL; - return NULL; - } - - /* final result is 1 bool */ - if (!alloc_node_storage(emitInfo, n, 1)) - return NULL; - - size = n->Children[0]->Store->Size; - - if (size == 1) { - gl_inst_opcode opcode = n->Opcode == IR_EQUAL ? OPCODE_SEQ : OPCODE_SNE; - inst = emit_instruction(emitInfo, - opcode, - n->Store, /* dest */ - n->Children[0]->Store, - n->Children[1]->Store, - NULL); - } - else if (size <= 4) { - /* compare two vectors. - * Unfortunately, there's no instruction to compare vectors and - * return a scalar result. Do it with some compare and dot product - * instructions... - */ - GLuint swizzle; - gl_inst_opcode dotOp; - slang_ir_storage tempStore; - - if (!alloc_local_temp(emitInfo, &tempStore, 4)) { - n->Store = NULL; - return NULL; - /* out of temps */ - } - - if (size == 4) { - dotOp = OPCODE_DP4; - swizzle = SWIZZLE_XYZW; - } - else if (size == 3) { - dotOp = OPCODE_DP3; - swizzle = SWIZZLE_XYZW; - } - else { - assert(size == 2); - dotOp = OPCODE_DP3; /* XXX use OPCODE_DP2 eventually */ - swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y); - } - - /* Compute inequality (temp = (A != B)) */ - inst = emit_instruction(emitInfo, - OPCODE_SNE, - &tempStore, - n->Children[0]->Store, - n->Children[1]->Store, - NULL); - inst_comment(inst, "Compare values"); - - /* Compute val = DOT(temp, temp) (reduction) */ - inst = emit_instruction(emitInfo, - dotOp, - n->Store, - &tempStore, - &tempStore, - NULL); - inst->SrcReg[0].Swizzle = inst->SrcReg[1].Swizzle = swizzle; /*override*/ - inst_comment(inst, "Reduce vec to bool"); - - _slang_free_temp(emitInfo->vt, &tempStore); /* free temp */ - - if (n->Opcode == IR_EQUAL) { - /* compute val = !val.x with SEQ val, val, 0; */ - slang_ir_storage zero; - constant_to_storage(emitInfo, 0.0, &zero); - inst = emit_instruction(emitInfo, - OPCODE_SEQ, - n->Store, /* dest */ - n->Store, - &zero, - NULL); - inst_comment(inst, "Invert true/false"); - } - } - else { - /* size > 4, struct or array compare. - * XXX this won't work reliably for structs with padding!! - */ - GLint i, num = (n->Children[0]->Store->Size + 3) / 4; - slang_ir_storage accTemp, sneTemp; - - if (!alloc_local_temp(emitInfo, &accTemp, 4)) - return NULL; - - if (!alloc_local_temp(emitInfo, &sneTemp, 4)) - return NULL; - - for (i = 0; i < num; i++) { - slang_ir_storage srcStore0 = *n->Children[0]->Store; - slang_ir_storage srcStore1 = *n->Children[1]->Store; - srcStore0.Index += i; - srcStore1.Index += i; - - if (i == 0) { - /* SNE accTemp, left[i], right[i] */ - inst = emit_instruction(emitInfo, OPCODE_SNE, - &accTemp, /* dest */ - &srcStore0, - &srcStore1, - NULL); - inst_comment(inst, "Begin struct/array comparison"); - } - else { - /* SNE sneTemp, left[i], right[i] */ - inst = emit_instruction(emitInfo, OPCODE_SNE, - &sneTemp, /* dest */ - &srcStore0, - &srcStore1, - NULL); - /* ADD accTemp, accTemp, sneTemp; # like logical-OR */ - inst = emit_instruction(emitInfo, OPCODE_ADD, - &accTemp, /* dest */ - &accTemp, - &sneTemp, - NULL); - } - } - - /* compute accTemp.x || accTemp.y || accTemp.z || accTemp.w with DOT4 */ - inst = emit_instruction(emitInfo, OPCODE_DP4, - n->Store, - &accTemp, - &accTemp, - NULL); - inst_comment(inst, "End struct/array comparison"); - - if (n->Opcode == IR_EQUAL) { - /* compute tmp.x = !tmp.x via tmp.x = (tmp.x == 0) */ - slang_ir_storage zero; - constant_to_storage(emitInfo, 0.0, &zero); - inst = emit_instruction(emitInfo, OPCODE_SEQ, - n->Store, /* dest */ - n->Store, - &zero, - NULL); - inst_comment(inst, "Invert true/false"); - } - - _slang_free_temp(emitInfo->vt, &accTemp); - _slang_free_temp(emitInfo->vt, &sneTemp); - } - - /* free temps */ - free_node_storage(emitInfo->vt, n->Children[0]); - free_node_storage(emitInfo->vt, n->Children[1]); - - return inst; -} - - - -/** - * Generate code for an IR_CLAMP instruction. - */ -static struct prog_instruction * -emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - slang_ir_node tmpNode; - - assert(n->Opcode == IR_CLAMP); - /* ch[0] = value - * ch[1] = min limit - * ch[2] = max limit - */ - - inst = emit(emitInfo, n->Children[0]); - - /* If lower limit == 0.0 and upper limit == 1.0, - * set prev instruction's SaturateMode field to SATURATE_ZERO_ONE. - * Else, - * emit OPCODE_MIN, OPCODE_MAX sequence. - */ -#if 0 - /* XXX this isn't quite finished yet */ - if (n->Children[1]->Opcode == IR_FLOAT && - n->Children[1]->Value[0] == 0.0 && - n->Children[1]->Value[1] == 0.0 && - n->Children[1]->Value[2] == 0.0 && - n->Children[1]->Value[3] == 0.0 && - n->Children[2]->Opcode == IR_FLOAT && - n->Children[2]->Value[0] == 1.0 && - n->Children[2]->Value[1] == 1.0 && - n->Children[2]->Value[2] == 1.0 && - n->Children[2]->Value[3] == 1.0) { - if (!inst) { - inst = prev_instruction(prog); - } - if (inst && inst->Opcode != OPCODE_NOP) { - /* and prev instruction's DstReg matches n->Children[0]->Store */ - inst->SaturateMode = SATURATE_ZERO_ONE; - n->Store = n->Children[0]->Store; - return inst; - } - } -#endif - - if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; - - emit(emitInfo, n->Children[1]); - emit(emitInfo, n->Children[2]); - - /* Some GPUs don't allow reading from output registers. So if the - * dest for this clamp() is an output reg, we can't use that reg for - * the intermediate result. Use a temp register instead. - */ - _mesa_bzero(&tmpNode, sizeof(tmpNode)); - alloc_node_storage(emitInfo, &tmpNode, n->Store->Size); - - /* tmp = max(ch[0], ch[1]) */ - inst = emit_instruction(emitInfo, OPCODE_MAX, - tmpNode.Store, /* dest */ - n->Children[0]->Store, - n->Children[1]->Store, - NULL); - - /* n->dest = min(tmp, ch[2]) */ - inst = emit_instruction(emitInfo, OPCODE_MIN, - n->Store, /* dest */ - tmpNode.Store, - n->Children[2]->Store, - NULL); - - free_node_storage(emitInfo->vt, &tmpNode); - - return inst; -} - - -static struct prog_instruction * -emit_negation(slang_emit_info *emitInfo, slang_ir_node *n) -{ - /* Implement as MOV dst, -src; */ - /* XXX we could look at the previous instruction and in some circumstances - * modify it to accomplish the negation. - */ - struct prog_instruction *inst; - - emit(emitInfo, n->Children[0]); - - if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; - - inst = emit_instruction(emitInfo, - OPCODE_MOV, - n->Store, /* dest */ - n->Children[0]->Store, - NULL, - NULL); - inst->SrcReg[0].NegateBase = NEGATE_XYZW; - return inst; -} - - -static struct prog_instruction * -emit_label(slang_emit_info *emitInfo, const slang_ir_node *n) -{ - assert(n->Label); -#if 0 - /* XXX this fails in loop tail code - investigate someday */ - assert(_slang_label_get_location(n->Label) < 0); - _slang_label_set_location(n->Label, emitInfo->prog->NumInstructions, - emitInfo->prog); -#else - if (_slang_label_get_location(n->Label) < 0) - _slang_label_set_location(n->Label, emitInfo->prog->NumInstructions, - emitInfo->prog); -#endif - return NULL; -} - - -/** - * Emit code for a function call. - * Note that for each time a function is called, we emit the function's - * body code again because the set of available registers may be different. - */ -static struct prog_instruction * -emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct gl_program *progSave; - struct prog_instruction *inst; - GLuint subroutineId; - GLuint maxInstSave; - - assert(n->Opcode == IR_CALL); - assert(n->Label); - - /* save/push cur program */ - maxInstSave = emitInfo->MaxInstructions; - progSave = emitInfo->prog; - - emitInfo->prog = new_subroutine(emitInfo, &subroutineId); - emitInfo->MaxInstructions = emitInfo->prog->NumInstructions; - - _slang_label_set_location(n->Label, emitInfo->prog->NumInstructions, - emitInfo->prog); - - if (emitInfo->EmitBeginEndSub) { - /* BGNSUB isn't a real instruction. - * We require a label (i.e. "foobar:") though, if we're going to - * print the program in the NV format. The BNGSUB instruction is - * really just a NOP to attach the label to. - */ - inst = new_instruction(emitInfo, OPCODE_BGNSUB); - inst_comment(inst, n->Label->Name); - } - - /* body of function: */ - emit(emitInfo, n->Children[0]); - n->Store = n->Children[0]->Store; - - /* add RET instruction now, if needed */ - inst = prev_instruction(emitInfo); - if (inst && inst->Opcode != OPCODE_RET) { - inst = new_instruction(emitInfo, OPCODE_RET); - } - - if (emitInfo->EmitBeginEndSub) { - inst = new_instruction(emitInfo, OPCODE_ENDSUB); - inst_comment(inst, n->Label->Name); - } - - /* pop/restore cur program */ - emitInfo->prog = progSave; - emitInfo->MaxInstructions = maxInstSave; - - /* emit the function call */ - inst = new_instruction(emitInfo, OPCODE_CAL); - /* The branch target is just the subroutine number (changed later) */ - inst->BranchTarget = subroutineId; - inst_comment(inst, n->Label->Name); - assert(inst->BranchTarget >= 0); - - return inst; -} - - -/** - * Emit code for a 'return' statement. - */ -static struct prog_instruction * -emit_return(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - assert(n); - assert(n->Opcode == IR_RETURN); - assert(n->Label); - inst = new_instruction(emitInfo, OPCODE_RET); - inst->DstReg.CondMask = COND_TR; /* always return */ - return inst; -} - - -static struct prog_instruction * -emit_kill(slang_emit_info *emitInfo) -{ - struct gl_fragment_program *fp; - struct prog_instruction *inst; - /* NV-KILL - discard fragment depending on condition code. - * Note that ARB-KILL depends on sign of vector operand. - */ - inst = new_instruction(emitInfo, OPCODE_KIL_NV); - inst->DstReg.CondMask = COND_TR; /* always kill */ - - assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); - fp = (struct gl_fragment_program *) emitInfo->prog; - fp->UsesKill = GL_TRUE; - - return inst; -} - - -static struct prog_instruction * -emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - gl_inst_opcode opcode; - - if (n->Opcode == IR_TEX) { - opcode = OPCODE_TEX; - } - else if (n->Opcode == IR_TEXB) { - opcode = OPCODE_TXB; - } - else { - assert(n->Opcode == IR_TEXP); - opcode = OPCODE_TXP; - } - - if (n->Children[0]->Opcode == IR_ELEMENT) { - /* array is the sampler (a uniform which'll indicate the texture unit) */ - assert(n->Children[0]->Children[0]->Store); - assert(n->Children[0]->Children[0]->Store->File == PROGRAM_SAMPLER); - - emit(emitInfo, n->Children[0]); - - n->Children[0]->Var = n->Children[0]->Children[0]->Var; - } else { - /* this is the sampler (a uniform which'll indicate the texture unit) */ - assert(n->Children[0]->Store); - assert(n->Children[0]->Store->File == PROGRAM_SAMPLER); - } - - /* emit code for the texcoord operand */ - (void) emit(emitInfo, n->Children[1]); - - /* alloc storage for result of texture fetch */ - if (!alloc_node_storage(emitInfo, n, 4)) - return NULL; - - /* emit TEX instruction; Child[1] is the texcoord */ - inst = emit_instruction(emitInfo, - opcode, - n->Store, - n->Children[1]->Store, - NULL, - NULL); - - /* Store->Index is the uniform/sampler index */ - assert(n->Children[0]->Store->Index >= 0); - inst->TexSrcUnit = n->Children[0]->Store->Index; - inst->TexSrcTarget = n->Children[0]->Store->TexTarget; - - /* mark the sampler as being used */ - _mesa_use_uniform(emitInfo->prog->Parameters, - (char *) n->Children[0]->Var->a_name); - - return inst; -} - - -/** - * Assignment/copy - */ -static struct prog_instruction * -emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - - assert(n->Opcode == IR_COPY); - - /* lhs */ - emit(emitInfo, n->Children[0]); - if (!n->Children[0]->Store || n->Children[0]->Store->Index < 0) { - /* an error should have been already recorded */ - return NULL; - } - - /* rhs */ - assert(n->Children[1]); - inst = emit(emitInfo, n->Children[1]); - - if (!n->Children[1]->Store || n->Children[1]->Store->Index < 0) { - if (!emitInfo->log->text) { - slang_info_log_error(emitInfo->log, "invalid assignment"); - } - return NULL; - } - - assert(n->Children[1]->Store->Index >= 0); - - /*assert(n->Children[0]->Store->Size == n->Children[1]->Store->Size);*/ - - n->Store = n->Children[0]->Store; - - if (n->Store->File == PROGRAM_SAMPLER) { - /* no code generated for sampler assignments, - * just copy the sampler index/target at compile time. - */ - n->Store->Index = n->Children[1]->Store->Index; - n->Store->TexTarget = n->Children[1]->Store->TexTarget; - return NULL; - } - -#if PEEPHOLE_OPTIMIZATIONS - if (inst && - (n->Children[1]->Opcode != IR_SWIZZLE) && - _slang_is_temp(emitInfo->vt, n->Children[1]->Store) && - (inst->DstReg.File == n->Children[1]->Store->File) && - (inst->DstReg.Index == n->Children[1]->Store->Index) && - !n->Children[0]->Store->IsIndirect && - n->Children[0]->Store->Size <= 4) { - /* Peephole optimization: - * The Right-Hand-Side has its results in a temporary place. - * Modify the RHS (and the prev instruction) to store its results - * in the destination specified by n->Children[0]. - * Then, this MOVE is a no-op. - * Ex: - * MUL tmp, x, y; - * MOV a, tmp; - * becomes: - * MUL a, x, y; - */ - - /* fixup the previous instruction (which stored the RHS result) */ - assert(n->Children[0]->Store->Index >= 0); - storage_to_dst_reg(&inst->DstReg, n->Children[0]->Store); - return inst; - } - else -#endif - { - if (n->Children[0]->Store->Size > 4) { - /* move matrix/struct etc (block of registers) */ - slang_ir_storage dstStore = *n->Children[0]->Store; - slang_ir_storage srcStore = *n->Children[1]->Store; - GLint size = srcStore.Size; - ASSERT(n->Children[1]->Store->Swizzle == SWIZZLE_NOOP); - dstStore.Size = 4; - srcStore.Size = 4; - while (size >= 4) { - inst = emit_instruction(emitInfo, OPCODE_MOV, - &dstStore, - &srcStore, - NULL, - NULL); - inst_comment(inst, "IR_COPY block"); - srcStore.Index++; - dstStore.Index++; - size -= 4; - } - } - else { - /* single register move */ - char *srcAnnot, *dstAnnot; - assert(n->Children[0]->Store->Index >= 0); - inst = emit_instruction(emitInfo, OPCODE_MOV, - n->Children[0]->Store, /* dest */ - n->Children[1]->Store, - NULL, - NULL); - dstAnnot = storage_annotation(n->Children[0], emitInfo->prog); - srcAnnot = storage_annotation(n->Children[1], emitInfo->prog); - inst->Comment = instruction_annotation(inst->Opcode, dstAnnot, - srcAnnot, NULL, NULL); - } - free_node_storage(emitInfo->vt, n->Children[1]); - return inst; - } -} - - -/** - * An IR_COND node wraps a boolean expression which is used by an - * IF or WHILE test. This is where we'll set condition codes, if needed. - */ -static struct prog_instruction * -emit_cond(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - - assert(n->Opcode == IR_COND); - - if (!n->Children[0]) - return NULL; - - /* emit code for the expression */ - inst = emit(emitInfo, n->Children[0]); - - if (!n->Children[0]->Store) { - /* error recovery */ - return NULL; - } - - assert(n->Children[0]->Store); - /*assert(n->Children[0]->Store->Size == 1);*/ - - if (emitInfo->EmitCondCodes) { - if (inst && - n->Children[0]->Store && - inst->DstReg.File == n->Children[0]->Store->File && - inst->DstReg.Index == n->Children[0]->Store->Index) { - /* The previous instruction wrote to the register who's value - * we're testing. Just fix that instruction so that the - * condition codes are computed. - */ - inst->CondUpdate = GL_TRUE; - n->Store = n->Children[0]->Store; - return inst; - } - else { - /* This'll happen for things like "if (i) ..." where no code - * is normally generated for the expression "i". - * Generate a move instruction just to set condition codes. - */ - if (!alloc_node_storage(emitInfo, n, 1)) - return NULL; - inst = emit_instruction(emitInfo, OPCODE_MOV, - n->Store, /* dest */ - n->Children[0]->Store, - NULL, - NULL); - inst->CondUpdate = GL_TRUE; - inst_comment(inst, "COND expr"); - _slang_free_temp(emitInfo->vt, n->Store); - return inst; - } - } - else { - /* No-op: the boolean result of the expression is in a regular reg */ - n->Store = n->Children[0]->Store; - return inst; - } -} - - -/** - * Logical-NOT - */ -static struct prog_instruction * -emit_not(slang_emit_info *emitInfo, slang_ir_node *n) -{ - static const struct { - gl_inst_opcode op, opNot; - } operators[] = { - { OPCODE_SLT, OPCODE_SGE }, - { OPCODE_SLE, OPCODE_SGT }, - { OPCODE_SGT, OPCODE_SLE }, - { OPCODE_SGE, OPCODE_SLT }, - { OPCODE_SEQ, OPCODE_SNE }, - { OPCODE_SNE, OPCODE_SEQ }, - { 0, 0 } - }; - struct prog_instruction *inst; - slang_ir_storage zero; - GLuint i; - - /* child expr */ - inst = emit(emitInfo, n->Children[0]); - -#if PEEPHOLE_OPTIMIZATIONS - if (inst) { - /* if the prev instruction was a comparison instruction, invert it */ - for (i = 0; operators[i].op; i++) { - if (inst->Opcode == operators[i].op) { - inst->Opcode = operators[i].opNot; - n->Store = n->Children[0]->Store; - return inst; - } - } - } -#endif - - /* else, invert using SEQ (v = v == 0) */ - if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; - - constant_to_storage(emitInfo, 0.0, &zero); - inst = emit_instruction(emitInfo, - OPCODE_SEQ, - n->Store, - n->Children[0]->Store, - &zero, - NULL); - inst_comment(inst, "NOT"); - - free_node_storage(emitInfo->vt, n->Children[0]); - - return inst; -} - - -static struct prog_instruction * -emit_if(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct gl_program *prog = emitInfo->prog; - GLuint ifInstLoc, elseInstLoc = 0; - GLuint condWritemask = 0; - - /* emit condition expression code */ - { - struct prog_instruction *inst; - inst = emit(emitInfo, n->Children[0]); - if (emitInfo->EmitCondCodes) { - if (!inst) { - /* error recovery */ - return NULL; - } - condWritemask = inst->DstReg.WriteMask; - } - } - - if (!n->Children[0]->Store) - return NULL; - -#if 0 - assert(n->Children[0]->Store->Size == 1); /* a bool! */ -#endif - - ifInstLoc = prog->NumInstructions; - if (emitInfo->EmitHighLevelInstructions) { - if (emitInfo->EmitCondCodes) { - /* IF condcode THEN ... */ - struct prog_instruction *ifInst; - ifInst = new_instruction(emitInfo, OPCODE_IF); - ifInst->DstReg.CondMask = COND_NE; /* if cond is non-zero */ - /* only test the cond code (1 of 4) that was updated by the - * previous instruction. - */ - ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); - } - else { - /* IF src[0] THEN ... */ - emit_instruction(emitInfo, OPCODE_IF, - NULL, /* dst */ - n->Children[0]->Store, /* op0 */ - NULL, - NULL); - } - } - else { - /* conditional jump to else, or endif */ - struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_BRA); - ifInst->DstReg.CondMask = COND_EQ; /* BRA if cond is zero */ - inst_comment(ifInst, "if zero"); - ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); - } - - /* if body */ - emit(emitInfo, n->Children[1]); - - if (n->Children[2]) { - /* have else body */ - elseInstLoc = prog->NumInstructions; - if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ELSE); - } - else { - /* jump to endif instruction */ - struct prog_instruction *inst; - inst = new_instruction(emitInfo, OPCODE_BRA); - inst_comment(inst, "else"); - inst->DstReg.CondMask = COND_TR; /* always branch */ - } - prog->Instructions[ifInstLoc].BranchTarget = prog->NumInstructions; - emit(emitInfo, n->Children[2]); - } - else { - /* no else body */ - prog->Instructions[ifInstLoc].BranchTarget = prog->NumInstructions; - } - - if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ENDIF); - } - - if (n->Children[2]) { - prog->Instructions[elseInstLoc].BranchTarget = prog->NumInstructions; - } - return NULL; -} - - -static struct prog_instruction * -emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct gl_program *prog = emitInfo->prog; - struct prog_instruction *endInst; - GLuint beginInstLoc, tailInstLoc, endInstLoc; - slang_ir_node *ir; - - /* emit OPCODE_BGNLOOP */ - beginInstLoc = prog->NumInstructions; - if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_BGNLOOP); - } - - /* body */ - emit(emitInfo, n->Children[0]); - - /* tail */ - tailInstLoc = prog->NumInstructions; - if (n->Children[1]) { - if (emitInfo->EmitComments) - emit_comment(emitInfo, "Loop tail code:"); - emit(emitInfo, n->Children[1]); - } - - endInstLoc = prog->NumInstructions; - if (emitInfo->EmitHighLevelInstructions) { - /* emit OPCODE_ENDLOOP */ - endInst = new_instruction(emitInfo, OPCODE_ENDLOOP); - } - else { - /* emit unconditional BRA-nch */ - endInst = new_instruction(emitInfo, OPCODE_BRA); - endInst->DstReg.CondMask = COND_TR; /* always true */ - } - /* ENDLOOP's BranchTarget points to the BGNLOOP inst */ - endInst->BranchTarget = beginInstLoc; - - if (emitInfo->EmitHighLevelInstructions) { - /* BGNLOOP's BranchTarget points to the ENDLOOP inst */ - prog->Instructions[beginInstLoc].BranchTarget = prog->NumInstructions -1; - } - - /* Done emitting loop code. Now walk over the loop's linked list of - * BREAK and CONT nodes, filling in their BranchTarget fields (which - * will point to the ENDLOOP+1 or BGNLOOP instructions, respectively). - */ - for (ir = n->List; ir; ir = ir->List) { - struct prog_instruction *inst = prog->Instructions + ir->InstLocation; - assert(inst->BranchTarget < 0); - if (ir->Opcode == IR_BREAK || - ir->Opcode == IR_BREAK_IF_TRUE) { - assert(inst->Opcode == OPCODE_BRK || - inst->Opcode == OPCODE_BRA); - /* go to instruction after end of loop */ - inst->BranchTarget = endInstLoc + 1; - } - else { - assert(ir->Opcode == IR_CONT || - ir->Opcode == IR_CONT_IF_TRUE); - assert(inst->Opcode == OPCODE_CONT || - inst->Opcode == OPCODE_BRA); - /* go to instruction at tail of loop */ - inst->BranchTarget = endInstLoc; - } - } - return NULL; -} - - -/** - * Unconditional "continue" or "break" statement. - * Either OPCODE_CONT, OPCODE_BRK or OPCODE_BRA will be emitted. - */ -static struct prog_instruction * -emit_cont_break(slang_emit_info *emitInfo, slang_ir_node *n) -{ - gl_inst_opcode opcode; - struct prog_instruction *inst; - - if (n->Opcode == IR_CONT) { - /* we need to execute the loop's tail code before doing CONT */ - assert(n->Parent); - assert(n->Parent->Opcode == IR_LOOP); - if (n->Parent->Children[1]) { - /* emit tail code */ - if (emitInfo->EmitComments) { - emit_comment(emitInfo, "continue - tail code:"); - } - emit(emitInfo, n->Parent->Children[1]); - } - } - - /* opcode selection */ - if (emitInfo->EmitHighLevelInstructions) { - opcode = (n->Opcode == IR_CONT) ? OPCODE_CONT : OPCODE_BRK; - } - else { - opcode = OPCODE_BRA; - } - n->InstLocation = emitInfo->prog->NumInstructions; - inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_TR; /* always true */ - return inst; -} - - -/** - * Conditional "continue" or "break" statement. - * Either OPCODE_CONT, OPCODE_BRK or OPCODE_BRA will be emitted. - */ -static struct prog_instruction * -emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - - assert(n->Opcode == IR_CONT_IF_TRUE || - n->Opcode == IR_BREAK_IF_TRUE); - - /* evaluate condition expr, setting cond codes */ - inst = emit(emitInfo, n->Children[0]); - if (emitInfo->EmitCondCodes) { - assert(inst); - inst->CondUpdate = GL_TRUE; - } - - n->InstLocation = emitInfo->prog->NumInstructions; - - /* opcode selection */ - if (emitInfo->EmitHighLevelInstructions) { - const gl_inst_opcode opcode - = (n->Opcode == IR_CONT_IF_TRUE) ? OPCODE_CONT : OPCODE_BRK; - if (emitInfo->EmitCondCodes) { - /* Get the writemask from the previous instruction which set - * the condcodes. Use that writemask as the CondSwizzle. - */ - const GLuint condWritemask = inst->DstReg.WriteMask; - inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); - return inst; - } - else { - /* IF reg - * BRK/CONT; - * ENDIF - */ - GLint ifInstLoc; - ifInstLoc = emitInfo->prog->NumInstructions; - inst = emit_instruction(emitInfo, OPCODE_IF, - NULL, /* dest */ - n->Children[0]->Store, - NULL, - NULL); - n->InstLocation = emitInfo->prog->NumInstructions; - - inst = new_instruction(emitInfo, opcode); - inst = new_instruction(emitInfo, OPCODE_ENDIF); - - emitInfo->prog->Instructions[ifInstLoc].BranchTarget - = emitInfo->prog->NumInstructions; - return inst; - } - } - else { - const GLuint condWritemask = inst->DstReg.WriteMask; - assert(emitInfo->EmitCondCodes); - inst = new_instruction(emitInfo, OPCODE_BRA); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); - return inst; - } -} - - -/** - * Return the size of a swizzle mask given that some swizzle components - * may be NIL/undefined. For example: - * swizzle_size(".zzxx") = 4 - * swizzle_size(".xy??") = 2 - * swizzle_size(".w???") = 1 - */ -static GLuint -swizzle_size(GLuint swizzle) -{ - GLuint i; - for (i = 0; i < 4; i++) { - if (GET_SWZ(swizzle, i) == SWIZZLE_NIL) - return i; - } - return 4; -} - - -static struct prog_instruction * -emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - - inst = emit(emitInfo, n->Children[0]); - - if (!n->Store->Parent) { - /* this covers a case such as "(b ? p : q).x" */ - n->Store->Parent = n->Children[0]->Store; - assert(n->Store->Parent); - } - - { - const GLuint swizzle = n->Store->Swizzle; - /* new storage is parent storage with updated Swizzle + Size fields */ - _slang_copy_ir_storage(n->Store, n->Store->Parent); - /* Apply this node's swizzle to parent's storage */ - n->Store->Swizzle = _slang_swizzle_swizzle(n->Store->Swizzle, swizzle); - /* Update size */ - n->Store->Size = swizzle_size(n->Store->Swizzle); - } - - assert(!n->Store->Parent); - assert(n->Store->Index >= 0); - - return inst; -} - - -/** - * Dereference array element: element == array[index] - * This basically involves emitting code for computing the array index - * and updating the node/element's storage info. - */ -static struct prog_instruction * -emit_array_element(slang_emit_info *emitInfo, slang_ir_node *n) -{ - slang_ir_storage *arrayStore, *indexStore; - const int elemSize = n->Store->Size; /* number of floats */ - const GLint elemSizeVec = (elemSize + 3) / 4; /* number of vec4 */ - struct prog_instruction *inst; - - assert(n->Opcode == IR_ELEMENT); - assert(elemSize > 0); - - /* special case for built-in state variables, like light state */ - { - slang_ir_storage *root = n->Store; - assert(!root->Parent); - while (root->Parent) - root = root->Parent; - - if (root->File == PROGRAM_STATE_VAR) { - GLboolean direct; - GLint index = - _slang_alloc_statevar(n, emitInfo->prog->Parameters, &direct); - if (index < 0) { - /* error */ - return NULL; - } - if (direct) { - n->Store->Index = index; - return NULL; /* all done */ - } - } - } - - /* do codegen for array itself */ - emit(emitInfo, n->Children[0]); - arrayStore = n->Children[0]->Store; - - /* The initial array element storage is the array's storage, - * then modified below. - */ - _slang_copy_ir_storage(n->Store, arrayStore); - - - if (n->Children[1]->Opcode == IR_FLOAT) { - /* Constant array index */ - const GLint element = (GLint) n->Children[1]->Value[0]; - - /* this element's storage is the array's storage, plus constant offset */ - n->Store->Index += elemSizeVec * element; - } - else { - /* Variable array index */ - - /* do codegen for array index expression */ - emit(emitInfo, n->Children[1]); - indexStore = n->Children[1]->Store; - - if (indexStore->IsIndirect) { - /* need to put the array index into a temporary since we can't - * directly support a[b[i]] constructs. - */ - - - /*indexStore = tempstore();*/ - } - - - if (elemSize > 4) { - /* need to multiply array index by array element size */ - struct prog_instruction *inst; - slang_ir_storage *indexTemp; - slang_ir_storage elemSizeStore; - - /* allocate 1 float indexTemp */ - indexTemp = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, 1); - _slang_alloc_temp(emitInfo->vt, indexTemp); - - /* allocate a constant containing the element size */ - constant_to_storage(emitInfo, (float) elemSizeVec, &elemSizeStore); - - /* multiply array index by element size */ - inst = emit_instruction(emitInfo, - OPCODE_MUL, - indexTemp, /* dest */ - indexStore, /* the index */ - &elemSizeStore, - NULL); - - indexStore = indexTemp; - } - - if (arrayStore->IsIndirect) { - /* ex: in a[i][j], a[i] (the arrayStore) is indirect */ - /* Need to add indexStore to arrayStore->Indirect store */ - slang_ir_storage indirectArray; - slang_ir_storage *indexTemp; - - _slang_init_ir_storage(&indirectArray, - arrayStore->IndirectFile, - arrayStore->IndirectIndex, - 1, - arrayStore->IndirectSwizzle); - - /* allocate 1 float indexTemp */ - indexTemp = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, 1); - _slang_alloc_temp(emitInfo->vt, indexTemp); - - inst = emit_instruction(emitInfo, - OPCODE_ADD, - indexTemp, /* dest */ - indexStore, /* the index */ - &indirectArray, /* indirect array base */ - NULL); - - indexStore = indexTemp; - } - - /* update the array element storage info */ - n->Store->IsIndirect = GL_TRUE; - n->Store->IndirectFile = indexStore->File; - n->Store->IndirectIndex = indexStore->Index; - n->Store->IndirectSwizzle = indexStore->Swizzle; - } - - n->Store->Size = elemSize; - n->Store->Swizzle = _slang_var_swizzle(elemSize, 0); - - return NULL; /* no instruction */ -} - - -/** - * Resolve storage for accessing a structure field. - */ -static struct prog_instruction * -emit_struct_field(slang_emit_info *emitInfo, slang_ir_node *n) -{ - slang_ir_storage *root = n->Store; - GLint fieldOffset, fieldSize; - - assert(n->Opcode == IR_FIELD); - - assert(!root->Parent); - while (root->Parent) - root = root->Parent; - - /* If this is the field of a state var, allocate constant/uniform - * storage for it now if we haven't already. - * Note that we allocate storage (uniform/constant slots) for state - * variables here rather than at declaration time so we only allocate - * space for the ones that we actually use! - */ - if (root->File == PROGRAM_STATE_VAR) { - GLboolean direct; - GLint index = _slang_alloc_statevar(n, emitInfo->prog->Parameters, &direct); - if (index < 0) { - slang_info_log_error(emitInfo->log, "Error parsing state variable"); - return NULL; - } - if (direct) { - root->Index = index; - return NULL; /* all done */ - } - } - - /* do codegen for struct */ - emit(emitInfo, n->Children[0]); - assert(n->Children[0]->Store->Index >= 0); - - - fieldOffset = n->Store->Index; - fieldSize = n->Store->Size; - - _slang_copy_ir_storage(n->Store, n->Children[0]->Store); - - n->Store->Index = n->Children[0]->Store->Index + fieldOffset / 4; - n->Store->Size = fieldSize; - - switch (fieldSize) { - case 1: - { - GLint swz = fieldOffset % 4; - n->Store->Swizzle = MAKE_SWIZZLE4(swz, swz, swz, swz); - } - break; - case 2: - n->Store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_NIL, SWIZZLE_NIL); - break; - case 3: - n->Store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_Z, SWIZZLE_NIL); - break; - default: - n->Store->Swizzle = SWIZZLE_XYZW; - } - - assert(n->Store->Index >= 0); - - return NULL; /* no instruction */ -} - - -/** - * Emit code for a variable declaration. - * This usually doesn't result in any code generation, but just - * memory allocation. - */ -static struct prog_instruction * -emit_var_decl(slang_emit_info *emitInfo, slang_ir_node *n) -{ - assert(n->Store); - assert(n->Store->File != PROGRAM_UNDEFINED); - assert(n->Store->Size > 0); - /*assert(n->Store->Index < 0);*/ - - if (!n->Var || n->Var->isTemp) { - /* a nameless/temporary variable, will be freed after first use */ - /*NEW*/ - if (n->Store->Index < 0 && !_slang_alloc_temp(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many temporaries"); - return NULL; - } - } - else { - /* a regular variable */ - _slang_add_variable(emitInfo->vt, n->Var); - if (!_slang_alloc_var(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many variables"); - return NULL; - } - /* - printf("IR_VAR_DECL %s %d store %p\n", - (char*) n->Var->a_name, n->Store->Index, (void*) n->Store); - */ - assert(n->Var->store == n->Store); - } - if (emitInfo->EmitComments) { - /* emit NOP with comment describing the variable's storage location */ - char s[1000]; - sprintf(s, "TEMP[%d]%s = variable %s (size %d)", - n->Store->Index, - _mesa_swizzle_string(n->Store->Swizzle, 0, GL_FALSE), - (n->Var ? (char *) n->Var->a_name : "anonymous"), - n->Store->Size); - emit_comment(emitInfo, s); - } - return NULL; -} - - -/** - * Emit code for a reference to a variable. - * Actually, no code is generated but we may do some memory allocation. - * In particular, state vars (uniforms) are allocated on an as-needed basis. - */ -static struct prog_instruction * -emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) -{ - assert(n->Store); - assert(n->Store->File != PROGRAM_UNDEFINED); - - if (n->Store->File == PROGRAM_STATE_VAR && n->Store->Index < 0) { - GLboolean direct; - GLint index = _slang_alloc_statevar(n, emitInfo->prog->Parameters, &direct); - if (index < 0) { - /* error */ - char s[100]; - _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'", - (char *) n->Var->a_name); - slang_info_log_error(emitInfo->log, s); - return NULL; - } - - n->Store->Index = index; - } - else if (n->Store->File == PROGRAM_UNIFORM || - n->Store->File == PROGRAM_SAMPLER) { - /* mark var as used */ - _mesa_use_uniform(emitInfo->prog->Parameters, (char *) n->Var->a_name); - } - else if (n->Store->File == PROGRAM_INPUT) { - assert(n->Store->Index >= 0); - emitInfo->prog->InputsRead |= (1 << n->Store->Index); - } - - if (n->Store->Index < 0) { - /* probably ran out of registers */ - return NULL; - } - assert(n->Store->Size > 0); - - return NULL; -} - - -static struct prog_instruction * -emit(slang_emit_info *emitInfo, slang_ir_node *n) -{ - struct prog_instruction *inst; - if (!n) - return NULL; - - if (emitInfo->log->error_flag) { - return NULL; - } - - switch (n->Opcode) { - case IR_SEQ: - /* sequence of two sub-trees */ - assert(n->Children[0]); - assert(n->Children[1]); - emit(emitInfo, n->Children[0]); - if (emitInfo->log->error_flag) - return NULL; - inst = emit(emitInfo, n->Children[1]); -#if 0 - assert(!n->Store); -#endif - n->Store = n->Children[1]->Store; - return inst; - - case IR_SCOPE: - /* new variable scope */ - _slang_push_var_table(emitInfo->vt); - inst = emit(emitInfo, n->Children[0]); - _slang_pop_var_table(emitInfo->vt); - return inst; - - case IR_VAR_DECL: - /* Variable declaration - allocate a register for it */ - inst = emit_var_decl(emitInfo, n); - return inst; - - case IR_VAR: - /* Reference to a variable - * Storage should have already been resolved/allocated. - */ - return emit_var_ref(emitInfo, n); - - case IR_ELEMENT: - return emit_array_element(emitInfo, n); - case IR_FIELD: - return emit_struct_field(emitInfo, n); - case IR_SWIZZLE: - return emit_swizzle(emitInfo, n); - - /* Simple arithmetic */ - /* unary */ - case IR_MOVE: - case IR_RSQ: - case IR_RCP: - case IR_FLOOR: - case IR_FRAC: - case IR_F_TO_I: - case IR_I_TO_F: - case IR_ABS: - case IR_SIN: - case IR_COS: - case IR_DDX: - case IR_DDY: - case IR_EXP: - case IR_EXP2: - case IR_LOG2: - case IR_NOISE1: - case IR_NOISE2: - case IR_NOISE3: - case IR_NOISE4: - case IR_NRM4: - case IR_NRM3: - /* binary */ - case IR_ADD: - case IR_SUB: - case IR_MUL: - case IR_DOT4: - case IR_DOT3: - case IR_DOT2: - case IR_CROSS: - case IR_MIN: - case IR_MAX: - case IR_SEQUAL: - case IR_SNEQUAL: - case IR_SGE: - case IR_SGT: - case IR_SLE: - case IR_SLT: - case IR_POW: - /* trinary operators */ - case IR_LRP: - return emit_arith(emitInfo, n); - - case IR_EQUAL: - case IR_NOTEQUAL: - return emit_compare(emitInfo, n); - - case IR_CLAMP: - return emit_clamp(emitInfo, n); - case IR_TEX: - case IR_TEXB: - case IR_TEXP: - return emit_tex(emitInfo, n); - case IR_NEG: - return emit_negation(emitInfo, n); - case IR_FLOAT: - /* find storage location for this float constant */ - n->Store->Index = _mesa_add_unnamed_constant(emitInfo->prog->Parameters, - n->Value, - n->Store->Size, - &n->Store->Swizzle); - if (n->Store->Index < 0) { - slang_info_log_error(emitInfo->log, "Ran out of space for constants"); - return NULL; - } - return NULL; - - case IR_COPY: - return emit_copy(emitInfo, n); - - case IR_COND: - return emit_cond(emitInfo, n); - - case IR_NOT: - return emit_not(emitInfo, n); - - case IR_LABEL: - return emit_label(emitInfo, n); - - case IR_KILL: - return emit_kill(emitInfo); - - case IR_CALL: - /* new variable scope for subroutines/function calls */ - _slang_push_var_table(emitInfo->vt); - inst = emit_fcall(emitInfo, n); - _slang_pop_var_table(emitInfo->vt); - return inst; - - case IR_IF: - return emit_if(emitInfo, n); - - case IR_LOOP: - return emit_loop(emitInfo, n); - case IR_BREAK_IF_TRUE: - case IR_CONT_IF_TRUE: - return emit_cont_break_if_true(emitInfo, n); - case IR_BREAK: - /* fall-through */ - case IR_CONT: - return emit_cont_break(emitInfo, n); - - case IR_BEGIN_SUB: - return new_instruction(emitInfo, OPCODE_BGNSUB); - case IR_END_SUB: - return new_instruction(emitInfo, OPCODE_ENDSUB); - case IR_RETURN: - return emit_return(emitInfo, n); - - case IR_NOP: - return NULL; - - default: - _mesa_problem(NULL, "Unexpected IR opcode in emit()\n"); - } - return NULL; -} - - -/** - * After code generation, any subroutines will be in separate program - * objects. This function appends all the subroutines onto the main - * program and resolves the linking of all the branch/call instructions. - * XXX this logic should really be part of the linking process... - */ -static void -_slang_resolve_subroutines(slang_emit_info *emitInfo) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_program *mainP = emitInfo->prog; - GLuint *subroutineLoc, i, total; - - subroutineLoc - = (GLuint *) _mesa_malloc(emitInfo->NumSubroutines * sizeof(GLuint)); - - /* total number of instructions */ - total = mainP->NumInstructions; - for (i = 0; i < emitInfo->NumSubroutines; i++) { - subroutineLoc[i] = total; - total += emitInfo->Subroutines[i]->NumInstructions; - } - - /* adjust BranchTargets within the functions */ - for (i = 0; i < emitInfo->NumSubroutines; i++) { - struct gl_program *sub = emitInfo->Subroutines[i]; - GLuint j; - for (j = 0; j < sub->NumInstructions; j++) { - struct prog_instruction *inst = sub->Instructions + j; - if (inst->Opcode != OPCODE_CAL && inst->BranchTarget >= 0) { - inst->BranchTarget += subroutineLoc[i]; - } - } - } - - /* append subroutines' instructions after main's instructions */ - mainP->Instructions = _mesa_realloc_instructions(mainP->Instructions, - mainP->NumInstructions, - total); - mainP->NumInstructions = total; - for (i = 0; i < emitInfo->NumSubroutines; i++) { - struct gl_program *sub = emitInfo->Subroutines[i]; - _mesa_copy_instructions(mainP->Instructions + subroutineLoc[i], - sub->Instructions, - sub->NumInstructions); - /* delete subroutine code */ - sub->Parameters = NULL; /* prevent double-free */ - _mesa_reference_program(ctx, &emitInfo->Subroutines[i], NULL); - } - - /* free subroutine list */ - if (emitInfo->Subroutines) { - _mesa_free(emitInfo->Subroutines); - emitInfo->Subroutines = NULL; - } - emitInfo->NumSubroutines = 0; - - /* Examine CAL instructions. - * At this point, the BranchTarget field of the CAL instruction is - * the number/id of the subroutine to call (an index into the - * emitInfo->Subroutines list). - * Translate that into an actual instruction location now. - */ - for (i = 0; i < mainP->NumInstructions; i++) { - struct prog_instruction *inst = mainP->Instructions + i; - if (inst->Opcode == OPCODE_CAL) { - const GLuint f = inst->BranchTarget; - inst->BranchTarget = subroutineLoc[f]; - } - } - - _mesa_free(subroutineLoc); -} - - - -/** - * Convert the IR tree into GPU instructions. - * \param n root of IR tree - * \param vt variable table - * \param prog program to put GPU instructions into - * \param pragmas controls codegen options - * \param withEnd if true, emit END opcode at end - * \param log log for emitting errors/warnings/info - */ -GLboolean -_slang_emit_code(slang_ir_node *n, slang_var_table *vt, - struct gl_program *prog, - const struct gl_sl_pragmas *pragmas, - GLboolean withEnd, - slang_info_log *log) -{ - GET_CURRENT_CONTEXT(ctx); - GLboolean success; - slang_emit_info emitInfo; - GLuint maxUniforms; - - emitInfo.log = log; - emitInfo.vt = vt; - emitInfo.prog = prog; - emitInfo.Subroutines = NULL; - emitInfo.NumSubroutines = 0; - emitInfo.MaxInstructions = prog->NumInstructions; - - emitInfo.EmitHighLevelInstructions = ctx->Shader.EmitHighLevelInstructions; - emitInfo.EmitCondCodes = ctx->Shader.EmitCondCodes; - emitInfo.EmitComments = ctx->Shader.EmitComments || pragmas->Debug; - emitInfo.EmitBeginEndSub = GL_TRUE; - - if (!emitInfo.EmitCondCodes) { - emitInfo.EmitHighLevelInstructions = GL_TRUE; - } - - /* Check uniform/constant limits */ - if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { - maxUniforms = ctx->Const.FragmentProgram.MaxUniformComponents / 4; - } - else { - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); - maxUniforms = ctx->Const.VertexProgram.MaxUniformComponents / 4; - } - if (prog->Parameters->NumParameters > maxUniforms) { - slang_info_log_error(log, "Constant/uniform register limit exceeded " - "(max=%u vec4)", maxUniforms); - - return GL_FALSE; - } - - (void) emit(&emitInfo, n); - - /* finish up by adding the END opcode to program */ - if (withEnd) { - struct prog_instruction *inst; - inst = new_instruction(&emitInfo, OPCODE_END); - } - - _slang_resolve_subroutines(&emitInfo); - - success = GL_TRUE; - -#if 0 - printf("*********** End emit code (%u inst):\n", prog->NumInstructions); - _mesa_print_program(prog); - _mesa_print_program_parameters(ctx,prog); -#endif - - return success; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_emit.h b/src/libs/mesa/mesa/shader/slang/slang_emit.h deleted file mode 100644 index 8ff52bf605..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_emit.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 2005-2008 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 SLANG_EMIT_H -#define SLANG_EMIT_H - - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_ir.h" -#include "main/mtypes.h" - - -extern void -slang_print_ir(const slang_ir_node *n, int indent); - - -extern GLuint -_slang_swizzle_swizzle(GLuint swz1, GLuint swz2); - - -extern GLuint -_slang_var_swizzle(GLint size, GLint comp); - - -extern GLboolean -_slang_emit_code(slang_ir_node *n, slang_var_table *vartable, - struct gl_program *prog, - const struct gl_sl_pragmas *pragmas, - GLboolean withEnd, - slang_info_log *log); - - -#endif /* SLANG_EMIT_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_ir.c b/src/libs/mesa/mesa/shader/slang/slang_ir.c deleted file mode 100644 index e4c6e0ea51..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_ir.c +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - - -#include "main/imports.h" -#include "main/context.h" -#include "slang_ir.h" -#include "slang_mem.h" -#include "shader/prog_instruction.h" -#include "shader/prog_print.h" - - -static const slang_ir_info IrInfo[] = { - /* binary ops */ - { IR_ADD, "IR_ADD", OPCODE_ADD, 4, 2 }, - { IR_SUB, "IR_SUB", OPCODE_SUB, 4, 2 }, - { IR_MUL, "IR_MUL", OPCODE_MUL, 4, 2 }, - { IR_DIV, "IR_DIV", OPCODE_NOP, 0, 2 }, /* XXX broke */ - { IR_DOT4, "IR_DOT4", OPCODE_DP4, 1, 2 }, - { IR_DOT3, "IR_DOT3", OPCODE_DP3, 1, 2 }, - { IR_DOT2, "IR_DOT2", OPCODE_DP2, 1, 2 }, - { IR_NRM4, "IR_NRM4", OPCODE_NRM4, 1, 1 }, - { IR_NRM3, "IR_NRM3", OPCODE_NRM3, 1, 1 }, - { IR_CROSS, "IR_CROSS", OPCODE_XPD, 3, 2 }, - { IR_LRP, "IR_LRP", OPCODE_LRP, 4, 3 }, - { IR_MIN, "IR_MIN", OPCODE_MIN, 4, 2 }, - { IR_MAX, "IR_MAX", OPCODE_MAX, 4, 2 }, - { IR_CLAMP, "IR_CLAMP", OPCODE_NOP, 4, 3 }, /* special case: emit_clamp() */ - { IR_SEQUAL, "IR_SEQUAL", OPCODE_SEQ, 4, 2 }, - { IR_SNEQUAL, "IR_SNEQUAL", OPCODE_SNE, 4, 2 }, - { IR_SGE, "IR_SGE", OPCODE_SGE, 4, 2 }, - { IR_SGT, "IR_SGT", OPCODE_SGT, 4, 2 }, - { IR_SLE, "IR_SLE", OPCODE_SLE, 4, 2 }, - { IR_SLT, "IR_SLT", OPCODE_SLT, 4, 2 }, - { IR_POW, "IR_POW", OPCODE_POW, 1, 2 }, - { IR_EQUAL, "IR_EQUAL", OPCODE_NOP, 1, 2 }, - { IR_NOTEQUAL, "IR_NOTEQUAL", OPCODE_NOP, 1, 2 }, - - /* unary ops */ - { IR_MOVE, "IR_MOVE", OPCODE_MOV, 4, 1 }, - { IR_I_TO_F, "IR_I_TO_F", OPCODE_MOV, 4, 1 }, /* int[4] to float[4] */ - { IR_F_TO_I, "IR_F_TO_I", OPCODE_TRUNC, 4, 1 }, - { IR_EXP, "IR_EXP", OPCODE_EXP, 1, 1 }, - { IR_EXP2, "IR_EXP2", OPCODE_EX2, 1, 1 }, - { IR_LOG2, "IR_LOG2", OPCODE_LG2, 1, 1 }, - { IR_RSQ, "IR_RSQ", OPCODE_RSQ, 1, 1 }, - { IR_RCP, "IR_RCP", OPCODE_RCP, 1, 1 }, - { IR_FLOOR, "IR_FLOOR", OPCODE_FLR, 4, 1 }, - { IR_FRAC, "IR_FRAC", OPCODE_FRC, 4, 1 }, - { IR_ABS, "IR_ABS", OPCODE_ABS, 4, 1 }, - { IR_NEG, "IR_NEG", OPCODE_NOP, 4, 1 }, /* special case: emit_negation() */ - { IR_DDX, "IR_DDX", OPCODE_DDX, 4, 1 }, - { IR_DDY, "IR_DDY", OPCODE_DDY, 4, 1 }, - { IR_SIN, "IR_SIN", OPCODE_SIN, 1, 1 }, - { IR_COS, "IR_COS", OPCODE_COS, 1, 1 }, - { IR_NOISE1, "IR_NOISE1", OPCODE_NOISE1, 1, 1 }, - { IR_NOISE2, "IR_NOISE2", OPCODE_NOISE2, 1, 1 }, - { IR_NOISE3, "IR_NOISE3", OPCODE_NOISE3, 1, 1 }, - { IR_NOISE4, "IR_NOISE4", OPCODE_NOISE4, 1, 1 }, - - /* other */ - { IR_SEQ, "IR_SEQ", OPCODE_NOP, 0, 0 }, - { IR_SCOPE, "IR_SCOPE", OPCODE_NOP, 0, 0 }, - { IR_LABEL, "IR_LABEL", OPCODE_NOP, 0, 0 }, - { IR_IF, "IR_IF", OPCODE_NOP, 0, 0 }, - { IR_KILL, "IR_KILL", OPCODE_NOP, 0, 0 }, - { IR_COND, "IR_COND", OPCODE_NOP, 0, 0 }, - { IR_CALL, "IR_CALL", OPCODE_NOP, 0, 0 }, - { IR_COPY, "IR_COPY", OPCODE_NOP, 0, 1 }, - { IR_NOT, "IR_NOT", OPCODE_NOP, 1, 1 }, - { IR_VAR, "IR_VAR", OPCODE_NOP, 0, 0 }, - { IR_VAR_DECL, "IR_VAR_DECL", OPCODE_NOP, 0, 0 }, - { IR_TEX, "IR_TEX", OPCODE_TEX, 4, 1 }, - { IR_TEXB, "IR_TEXB", OPCODE_TXB, 4, 1 }, - { IR_TEXP, "IR_TEXP", OPCODE_TXP, 4, 1 }, - { IR_FLOAT, "IR_FLOAT", OPCODE_NOP, 0, 0 }, /* float literal */ - { IR_FIELD, "IR_FIELD", OPCODE_NOP, 0, 0 }, - { IR_ELEMENT, "IR_ELEMENT", OPCODE_NOP, 0, 0 }, - { IR_SWIZZLE, "IR_SWIZZLE", OPCODE_NOP, 0, 0 }, - { IR_NOP, "IR_NOP", OPCODE_NOP, 0, 0 }, - { 0, NULL, 0, 0, 0 } -}; - - -const slang_ir_info * -_slang_ir_info(slang_ir_opcode opcode) -{ - GLuint i; - for (i = 0; IrInfo[i].IrName; i++) { - if (IrInfo[i].IrOpcode == opcode) { - return IrInfo + i; - } - } - return NULL; -} - - -void -_slang_init_ir_storage(slang_ir_storage *st, - enum register_file file, GLint index, GLint size, - GLuint swizzle) -{ - st->File = file; - st->Index = index; - st->Size = size; - st->Swizzle = swizzle; - st->Parent = NULL; - st->IsIndirect = GL_FALSE; -} - - -/** - * Return a new slang_ir_storage object. - */ -slang_ir_storage * -_slang_new_ir_storage(enum register_file file, GLint index, GLint size) -{ - slang_ir_storage *st; - st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); - if (st) { - st->File = file; - st->Index = index; - st->Size = size; - st->Swizzle = SWIZZLE_NOOP; - st->Parent = NULL; - st->IsIndirect = GL_FALSE; - } - return st; -} - - -/** - * Return a new slang_ir_storage object. - */ -slang_ir_storage * -_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size, - GLuint swizzle) -{ - slang_ir_storage *st; - st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); - if (st) { - st->File = file; - st->Index = index; - st->Size = size; - st->Swizzle = swizzle; - st->Parent = NULL; - st->IsIndirect = GL_FALSE; - } - return st; -} - - -/** - * Return a new slang_ir_storage object. - */ -slang_ir_storage * -_slang_new_ir_storage_relative(GLint index, GLint size, - slang_ir_storage *parent) -{ - slang_ir_storage *st; - st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); - if (st) { - st->File = PROGRAM_UNDEFINED; - st->Index = index; - st->Size = size; - st->Swizzle = SWIZZLE_NOOP; - st->Parent = parent; - st->IsIndirect = GL_FALSE; - } - return st; -} - - -slang_ir_storage * -_slang_new_ir_storage_indirect(enum register_file file, - GLint index, - GLint size, - enum register_file indirectFile, - GLint indirectIndex, - GLuint indirectSwizzle) -{ - slang_ir_storage *st; - st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); - if (st) { - st->File = file; - st->Index = index; - st->Size = size; - st->Swizzle = SWIZZLE_NOOP; - st->IsIndirect = GL_TRUE; - st->IndirectFile = indirectFile; - st->IndirectIndex = indirectIndex; - st->IndirectSwizzle = indirectSwizzle; - } - return st; -} - - -/** - * Allocate IR storage for a texture sampler. - * \param sampNum the sampler number/index - * \param texTarget one of TEXTURE_x_INDEX values - * \param size number of samplers (in case of sampler array) - */ -slang_ir_storage * -_slang_new_ir_storage_sampler(GLint sampNum, GLuint texTarget, GLint size) -{ - slang_ir_storage *st; - assert(texTarget < NUM_TEXTURE_TARGETS); - st = _slang_new_ir_storage(PROGRAM_SAMPLER, sampNum, size); - if (st) { - st->TexTarget = texTarget; - } - return st; -} - - - -/* XXX temporary function */ -void -_slang_copy_ir_storage(slang_ir_storage *dst, const slang_ir_storage *src) -{ - *dst = *src; - dst->Parent = NULL; -} - - - -static const char * -_slang_ir_name(slang_ir_opcode opcode) -{ - return _slang_ir_info(opcode)->IrName; -} - - - -#if 0 /* no longer needed with mempool */ -/** - * Since many IR nodes might point to the same IR storage info, we need - * to be careful when deleting things. - * Before deleting an IR tree, traverse it and do refcounting on the - * IR storage nodes. Use the refcount info during delete to free things - * properly. - */ -static void -_slang_refcount_storage(slang_ir_node *n) -{ - GLuint i; - if (!n) - return; - if (n->Store) - n->Store->RefCount++; - for (i = 0; i < 3; i++) - _slang_refcount_storage(n->Children[i]); -} -#endif - - -static void -_slang_free_ir(slang_ir_node *n) -{ - GLuint i; - if (!n) - return; - -#if 0 - if (n->Store) { - n->Store->RefCount--; - if (n->Store->RefCount == 0) { - _slang_free(n->Store); - n->Store = NULL; - } - } -#endif - - for (i = 0; i < 3; i++) - _slang_free_ir(n->Children[i]); - /* Do not free n->List since it's a child elsewhere */ - _slang_free(n); -} - - -/** - * Recursively free an IR tree. - */ -void -_slang_free_ir_tree(slang_ir_node *n) -{ -#if 0 - _slang_refcount_storage(n); -#endif - _slang_free_ir(n); -} - - -static const char * -storage_string(const slang_ir_storage *st) -{ - static const char *files[] = { - "TEMP", - "LOCAL_PARAM", - "ENV_PARAM", - "STATE", - "INPUT", - "OUTPUT", - "NAMED_PARAM", - "CONSTANT", - "UNIFORM", - "VARYING", - "WRITE_ONLY", - "ADDRESS", - "SAMPLER", - "UNDEFINED" - }; - static char s[100]; - assert(Elements(files) == PROGRAM_FILE_MAX); -#if 0 - if (st->Size == 1) - sprintf(s, "%s[%d]", files[st->File], st->Index); - else - sprintf(s, "%s[%d..%d]", files[st->File], st->Index, - st->Index + st->Size - 1); -#endif - assert(st->File < (GLint) (sizeof(files) / sizeof(files[0]))); - sprintf(s, "%s[%d]", files[st->File], st->Index); - return s; -} - - -static void -spaces(int n) -{ - while (n-- > 0) { - printf(" "); - } -} - - -void -_slang_print_ir_tree(const slang_ir_node *n, int indent) -{ -#define IND 0 - - if (!n) - return; -#if !IND - if (n->Opcode != IR_SEQ) -#else - printf("%3d:", indent); -#endif - spaces(indent); - - switch (n->Opcode) { - case IR_SEQ: -#if IND - printf("SEQ at %p\n", (void*) n); -#endif - assert(n->Children[0]); - assert(n->Children[1]); - _slang_print_ir_tree(n->Children[0], indent + IND); - _slang_print_ir_tree(n->Children[1], indent + IND); - break; - case IR_SCOPE: - printf("NEW SCOPE\n"); - assert(!n->Children[1]); - _slang_print_ir_tree(n->Children[0], indent + 3); - break; - case IR_COPY: - printf("COPY\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - _slang_print_ir_tree(n->Children[1], indent+3); - break; - case IR_LABEL: - printf("LABEL: %s\n", n->Label->Name); - break; - case IR_COND: - printf("COND\n"); - _slang_print_ir_tree(n->Children[0], indent + 3); - break; - - case IR_IF: - printf("IF \n"); - _slang_print_ir_tree(n->Children[0], indent+3); - spaces(indent); - printf("THEN\n"); - _slang_print_ir_tree(n->Children[1], indent+3); - if (n->Children[2]) { - spaces(indent); - printf("ELSE\n"); - _slang_print_ir_tree(n->Children[2], indent+3); - } - spaces(indent); - printf("ENDIF\n"); - break; - - case IR_BEGIN_SUB: - printf("BEGIN_SUB\n"); - break; - case IR_END_SUB: - printf("END_SUB\n"); - break; - case IR_RETURN: - printf("RETURN\n"); - break; - case IR_CALL: - printf("CALL %s\n", n->Label->Name); - break; - - case IR_LOOP: - printf("LOOP\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - if (n->Children[1]) { - spaces(indent); - printf("TAIL:\n"); - _slang_print_ir_tree(n->Children[1], indent+3); - } - spaces(indent); - printf("ENDLOOP\n"); - break; - case IR_CONT: - printf("CONT\n"); - break; - case IR_BREAK: - printf("BREAK\n"); - break; - case IR_BREAK_IF_TRUE: - printf("BREAK_IF_TRUE\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - break; - case IR_CONT_IF_TRUE: - printf("CONT_IF_TRUE\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - break; - - case IR_VAR: - printf("VAR %s%s at %s store %p\n", - (n->Var ? (char *) n->Var->a_name : "TEMP"), - _mesa_swizzle_string(n->Store->Swizzle, 0, 0), - storage_string(n->Store), (void*) n->Store); - break; - case IR_VAR_DECL: - printf("VAR_DECL %s (%p) at %s store %p\n", - (n->Var ? (char *) n->Var->a_name : "TEMP"), - (void*) n->Var, storage_string(n->Store), - (void*) n->Store); - break; - case IR_FIELD: - printf("FIELD %s of\n", n->Field); - _slang_print_ir_tree(n->Children[0], indent+3); - break; - case IR_FLOAT: - printf("FLOAT %g %g %g %g\n", - n->Value[0], n->Value[1], n->Value[2], n->Value[3]); - break; - case IR_I_TO_F: - printf("INT_TO_FLOAT\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - break; - case IR_F_TO_I: - printf("FLOAT_TO_INT\n"); - _slang_print_ir_tree(n->Children[0], indent+3); - break; - case IR_SWIZZLE: - printf("SWIZZLE %s of (store %p) \n", - _mesa_swizzle_string(n->Store->Swizzle, 0, 0), (void*) n->Store); - _slang_print_ir_tree(n->Children[0], indent + 3); - break; - default: - printf("%s (%p, %p) (store %p)\n", _slang_ir_name(n->Opcode), - (void*) n->Children[0], (void*) n->Children[1], (void*) n->Store); - _slang_print_ir_tree(n->Children[0], indent+3); - _slang_print_ir_tree(n->Children[1], indent+3); - } -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_ir.h b/src/libs/mesa/mesa/shader/slang/slang_ir.h deleted file mode 100644 index 644269d491..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_ir.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -/** - * \file slang_ir.h - * Mesa GLSL Intermediate Representation tree types and constants. - * \author Brian Paul - */ - - -#ifndef SLANG_IR_H -#define SLANG_IR_H - - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_label.h" -#include "main/mtypes.h" - - -/** - * Intermediate Representation opcodes - */ -typedef enum -{ - IR_NOP = 0, - IR_SEQ, /* sequence (eval left, then right) */ - IR_SCOPE, /* new variable scope (one child) */ - - IR_LABEL, /* target of a jump or cjump */ - - IR_COND, /* conditional expression/predicate */ - - IR_IF, /* high-level IF/then/else */ - /* Children[0] = conditional expression */ - /* Children[1] = if-true part */ - /* Children[2] = if-else part, or NULL */ - - IR_BEGIN_SUB, /* begin subroutine */ - IR_END_SUB, /* end subroutine */ - IR_RETURN, /* return from subroutine */ - IR_CALL, /* call subroutine */ - - IR_LOOP, /* high-level loop-begin / loop-end */ - /* Children[0] = loop body */ - /* Children[1] = loop tail code, or NULL */ - - IR_CONT, /* continue loop */ - /* n->Parent = ptr to parent IR_LOOP Node */ - IR_BREAK, /* break loop */ - - IR_BREAK_IF_TRUE, /**< Children[0] = the condition expression */ - IR_CONT_IF_TRUE, - - IR_COPY, /**< assignment/copy */ - IR_MOVE, /**< assembly MOV instruction */ - - /* vector ops: */ - IR_ADD, /**< assembly ADD instruction */ - IR_SUB, - IR_MUL, - IR_DIV, - IR_DOT4, - IR_DOT3, - IR_DOT2, - IR_NRM4, - IR_NRM3, - IR_CROSS, /* vec3 cross product */ - IR_LRP, - IR_CLAMP, - IR_MIN, - IR_MAX, - IR_SEQUAL, /* Set if args are equal (vector) */ - IR_SNEQUAL, /* Set if args are not equal (vector) */ - IR_SGE, /* Set if greater or equal (vector) */ - IR_SGT, /* Set if greater than (vector) */ - IR_SLE, /* Set if less or equal (vector) */ - IR_SLT, /* Set if less than (vector) */ - IR_POW, /* x^y */ - IR_EXP, /* e^x */ - IR_EXP2, /* 2^x */ - IR_LOG2, /* log base 2 */ - IR_RSQ, /* 1/sqrt() */ - IR_RCP, /* reciprocol */ - IR_FLOOR, - IR_FRAC, - IR_ABS, /* absolute value */ - IR_NEG, /* negate */ - IR_DDX, /* derivative w.r.t. X */ - IR_DDY, /* derivative w.r.t. Y */ - IR_SIN, /* sine */ - IR_COS, /* cosine */ - IR_NOISE1, /* noise(x) */ - IR_NOISE2, /* noise(x, y) */ - IR_NOISE3, /* noise(x, y, z) */ - IR_NOISE4, /* noise(x, y, z, w) */ - - IR_EQUAL, /* boolean equality */ - IR_NOTEQUAL,/* boolean inequality */ - IR_NOT, /* boolean not */ - - IR_VAR, /* variable reference */ - IR_VAR_DECL,/* var declaration */ - - IR_ELEMENT, /* array element */ - IR_FIELD, /* struct field */ - IR_SWIZZLE, /* swizzled storage access */ - - IR_TEX, /* texture lookup */ - IR_TEXB, /* texture lookup with LOD bias */ - IR_TEXP, /* texture lookup with projection */ - - IR_FLOAT, - IR_I_TO_F, /* int[4] to float[4] conversion */ - IR_F_TO_I, /* float[4] to int[4] conversion */ - - IR_KILL /* fragment kill/discard */ -} slang_ir_opcode; - - -/** - * Describes where data/variables are stored in the various register files. - * - * In the simple case, the File, Index and Size fields indicate where - * a variable is stored. For example, a vec3 variable may be stored - * as (File=PROGRAM_TEMPORARY, Index=6, Size=3). Or, File[Index]. - * Or, a program input like color may be stored as - * (File=PROGRAM_INPUT,Index=3,Size=4); - * - * For single-float values, the Swizzle field indicates which component - * of the vector contains the float. - * - * If IsIndirect is set, the storage is accessed through an indirect - * register lookup. The value in question will be located at: - * File[Index + IndirectFile[IndirectIndex]] - * - * This is primary used for indexing arrays. For example, consider this - * GLSL code: - * uniform int i; - * float a[10]; - * float x = a[i]; - * - * here, storage for a[i] would be described by (File=PROGRAM_TEMPORAY, - * Index=aPos, IndirectFile=PROGRAM_UNIFORM, IndirectIndex=iPos), which - * would mean TEMP[aPos + UNIFORM[iPos]] - */ -struct slang_ir_storage_ -{ - enum register_file File; /**< PROGRAM_TEMPORARY, PROGRAM_INPUT, etc */ - GLint Index; /**< -1 means unallocated */ - GLint Size; /**< number of floats or ints */ - GLuint Swizzle; /**< Swizzle AND writemask info */ - GLint RefCount; /**< Used during IR tree delete */ - - GLboolean RelAddr; /* we'll remove this eventually */ - - GLboolean IsIndirect; - enum register_file IndirectFile; - GLint IndirectIndex; - GLuint IndirectSwizzle; - GLuint TexTarget; /**< If File==PROGRAM_SAMPLER, one of TEXTURE_x_INDEX */ - - /** If Parent is non-null, Index is relative to parent. - * The other fields are ignored. - */ - struct slang_ir_storage_ *Parent; -}; - -typedef struct slang_ir_storage_ slang_ir_storage; - - -/** - * Intermediate Representation (IR) tree node - * Basically a binary tree, but IR_LRP and IR_CLAMP have three children. - */ -typedef struct slang_ir_node_ -{ - slang_ir_opcode Opcode; - struct slang_ir_node_ *Children[3]; - slang_ir_storage *Store; /**< location of result of this operation */ - GLint InstLocation; /**< Location of instruction emitted for this node */ - - /** special fields depending on Opcode: */ - const char *Field; /**< If Opcode == IR_FIELD */ - GLfloat Value[4]; /**< If Opcode == IR_FLOAT */ - slang_variable *Var; /**< If Opcode == IR_VAR or IR_VAR_DECL */ - struct slang_ir_node_ *List; /**< For various linked lists */ - struct slang_ir_node_ *Parent; /**< Pointer to logical parent (ie. loop) */ - slang_label *Label; /**< Used for branches */ -} slang_ir_node; - - - -/** - * Assembly and IR info - */ -typedef struct -{ - slang_ir_opcode IrOpcode; - const char *IrName; - gl_inst_opcode InstOpcode; - GLuint ResultSize, NumParams; -} slang_ir_info; - - - -extern const slang_ir_info * -_slang_ir_info(slang_ir_opcode opcode); - - -extern void -_slang_init_ir_storage(slang_ir_storage *st, - enum register_file file, GLint index, GLint size, - GLuint swizzle); - -extern slang_ir_storage * -_slang_new_ir_storage(enum register_file file, GLint index, GLint size); - - -extern slang_ir_storage * -_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size, - GLuint swizzle); - -extern slang_ir_storage * -_slang_new_ir_storage_relative(GLint index, GLint size, - slang_ir_storage *parent); - - -extern slang_ir_storage * -_slang_new_ir_storage_indirect(enum register_file file, - GLint index, - GLint size, - enum register_file indirectFile, - GLint indirectIndex, - GLuint indirectSwizzle); - -extern slang_ir_storage * -_slang_new_ir_storage_sampler(GLint sampNum, GLuint texTarget, GLint size); - - -extern void -_slang_copy_ir_storage(slang_ir_storage *dst, const slang_ir_storage *src); - - -extern void -_slang_free_ir_tree(slang_ir_node *n); - - -extern void -_slang_print_ir_tree(const slang_ir_node *n, int indent); - - -#endif /* SLANG_IR_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_label.c b/src/libs/mesa/mesa/shader/slang/slang_label.c deleted file mode 100644 index 1ca1ef0c7c..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_label.c +++ /dev/null @@ -1,104 +0,0 @@ - - -/** - * Functions for managing instruction labels. - * Basically, this is used to manage the problem of forward branches where - * we have a branch instruciton but don't know the target address yet. - */ - - -#include "slang_label.h" -#include "slang_mem.h" - - - -slang_label * -_slang_label_new(const char *name) -{ - slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); - if (l) { - l->Name = _slang_strdup(name); - l->Location = -1; - } - return l; -} - -/** - * As above, but suffix the name with a unique number. - */ -slang_label * -_slang_label_new_unique(const char *name) -{ - static int id = 1; - slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); - if (l) { - l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10); - if (!l->Name) { - _mesa_free(l); - return NULL; - } - _mesa_sprintf(l->Name, "%s_%d", name, id); - id++; - l->Location = -1; - } - return l; -} - -void -_slang_label_delete(slang_label *l) -{ - if (l->Name) { - _slang_free(l->Name); - l->Name = NULL; - } - if (l->References) { - _slang_free(l->References); - l->References = NULL; - } - _slang_free(l); -} - - -void -_slang_label_add_reference(slang_label *l, GLuint inst) -{ - const GLuint oldSize = l->NumReferences * sizeof(GLuint); - assert(l->Location < 0); - l->References = _slang_realloc(l->References, - oldSize, oldSize + sizeof(GLuint)); - if (l->References) { - l->References[l->NumReferences] = inst; - l->NumReferences++; - } -} - - -GLint -_slang_label_get_location(const slang_label *l) -{ - return l->Location; -} - - -void -_slang_label_set_location(slang_label *l, GLint location, - struct gl_program *prog) -{ - GLuint i; - - assert(l->Location < 0); - assert(location >= 0); - - l->Location = location; - - /* for the instructions that were waiting to learn the label's location: */ - for (i = 0; i < l->NumReferences; i++) { - const GLuint j = l->References[i]; - prog->Instructions[j].BranchTarget = location; - } - - if (l->References) { - _slang_free(l->References); - l->References = NULL; - } -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_label.h b/src/libs/mesa/mesa/shader/slang/slang_label.h deleted file mode 100644 index 87068ae7a7..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_label.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef SLANG_LABEL_H -#define SLANG_LABEL_H 1 - -#include "main/imports.h" -#include "main/mtypes.h" -#include "shader/prog_instruction.h" - - -struct slang_label_ -{ - char *Name; - GLint Location; - /** - * List of instruction references (numbered starting at zero) which need - * their BranchTarget field filled in with the location eventually - * assigned to the label. - */ - GLuint NumReferences; - GLuint *References; /** Array [NumReferences] */ -}; - -typedef struct slang_label_ slang_label; - - -extern slang_label * -_slang_label_new(const char *name); - -extern slang_label * -_slang_label_new_unique(const char *name); - -extern void -_slang_label_delete(slang_label *l); - -extern void -_slang_label_add_reference(slang_label *l, GLuint inst); - -extern GLint -_slang_label_get_location(const slang_label *l); - -extern void -_slang_label_set_location(slang_label *l, GLint location, - struct gl_program *prog); - - -#endif /* SLANG_LABEL_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_link.c b/src/libs/mesa/mesa/shader/slang/slang_link.c deleted file mode 100644 index 2aa3851911..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_link.c +++ /dev/null @@ -1,744 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -/** - * \file slang_link.c - * GLSL linker - * \author Brian Paul - */ - -#include "main/imports.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/macros.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" -#include "shader/prog_uniform.h" -#include "shader/shader_api.h" -#include "slang_link.h" - - -/** cast wrapper */ -static struct gl_vertex_program * -vertex_program(struct gl_program *prog) -{ - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); - return (struct gl_vertex_program *) prog; -} - - -/** cast wrapper */ -static struct gl_fragment_program * -fragment_program(struct gl_program *prog) -{ - assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); - return (struct gl_fragment_program *) prog; -} - - -/** - * Record a linking error. - */ -static void -link_error(struct gl_shader_program *shProg, const char *msg) -{ - if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); - } - shProg->InfoLog = _mesa_strdup(msg); - shProg->LinkStatus = GL_FALSE; -} - - - -/** - * Check if the given bit is either set or clear in both bitfields. - */ -static GLboolean -bits_agree(GLbitfield flags1, GLbitfield flags2, GLbitfield bit) -{ - return (flags1 & bit) == (flags2 & bit); -} - - -/** - * Linking varying vars involves rearranging varying vars so that the - * vertex program's output varyings matches the order of the fragment - * program's input varyings. - * We'll then rewrite instructions to replace PROGRAM_VARYING with either - * PROGRAM_INPUT or PROGRAM_OUTPUT depending on whether it's a vertex or - * fragment shader. - * This is also where we set program Input/OutputFlags to indicate - * which inputs are centroid-sampled, invariant, etc. - */ -static GLboolean -link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) -{ - GLuint *map, i, firstVarying, newFile; - GLbitfield *inOutFlags; - - map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); - if (!map) - return GL_FALSE; - - /* Varying variables are treated like other vertex program outputs - * (and like other fragment program inputs). The position of the - * first varying differs for vertex/fragment programs... - * Also, replace File=PROGRAM_VARYING with File=PROGRAM_INPUT/OUTPUT. - */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - firstVarying = VERT_RESULT_VAR0; - newFile = PROGRAM_OUTPUT; - inOutFlags = prog->OutputFlags; - } - else { - assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); - firstVarying = FRAG_ATTRIB_VAR0; - newFile = PROGRAM_INPUT; - inOutFlags = prog->InputFlags; - } - - for (i = 0; i < prog->Varying->NumParameters; i++) { - /* see if this varying is in the linked varying list */ - const struct gl_program_parameter *var = prog->Varying->Parameters + i; - GLint j = _mesa_lookup_parameter_index(shProg->Varying, -1, var->Name); - if (j >= 0) { - /* varying is already in list, do some error checking */ - const struct gl_program_parameter *v = - &shProg->Varying->Parameters[j]; - if (var->Size != v->Size) { - link_error(shProg, "mismatched varying variable types"); - return GL_FALSE; - } - if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { - char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "centroid modifier mismatch for '%s'", var->Name); - link_error(shProg, msg); - return GL_FALSE; - } - if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { - char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "invariant modifier mismatch for '%s'", var->Name); - link_error(shProg, msg); - return GL_FALSE; - } - } - else { - /* not already in linked list */ - j = _mesa_add_varying(shProg->Varying, var->Name, var->Size, - var->Flags); - } - - /* Map varying[i] to varying[j]. - * Plus, set prog->Input/OutputFlags[] as described above. - * Note: the loop here takes care of arrays or large (sz>4) vars. - */ - { - GLint sz = var->Size; - while (sz > 0) { - inOutFlags[firstVarying + j] = var->Flags; - /*printf("Link varying from %d to %d\n", i, j);*/ - map[i++] = j++; - sz -= 4; - } - i--; /* go back one */ - } - } - - - /* OK, now scan the program/shader instructions looking for varying vars, - * replacing the old index with the new index. - */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - GLuint j; - - if (inst->DstReg.File == PROGRAM_VARYING) { - inst->DstReg.File = newFile; - inst->DstReg.Index = map[ inst->DstReg.Index ] + firstVarying; - } - - for (j = 0; j < 3; j++) { - if (inst->SrcReg[j].File == PROGRAM_VARYING) { - inst->SrcReg[j].File = newFile; - inst->SrcReg[j].Index = map[ inst->SrcReg[j].Index ] + firstVarying; - } - } - } - - free(map); - - /* these will get recomputed before linking is completed */ - prog->InputsRead = 0x0; - prog->OutputsWritten = 0x0; - - return GL_TRUE; -} - - -/** - * Build the shProg->Uniforms list. - * This is basically a list/index of all uniforms found in either/both of - * the vertex and fragment shaders. - * - * About uniforms: - * Each uniform has two indexes, one that points into the vertex - * program's parameter array and another that points into the fragment - * program's parameter array. When the user changes a uniform's value - * we have to change the value in the vertex and/or fragment program's - * parameter array. - * - * This function will be called twice to set up the two uniform->parameter - * mappings. - * - * If a uniform is only present in the vertex program OR fragment program - * then the fragment/vertex parameter index, respectively, will be -1. - */ -static GLboolean -link_uniform_vars(GLcontext *ctx, - struct gl_shader_program *shProg, - struct gl_program *prog, - GLuint *numSamplers) -{ - GLuint samplerMap[200]; /* max number of samplers declared, not used */ - GLuint i; - - for (i = 0; i < prog->Parameters->NumParameters; i++) { - const struct gl_program_parameter *p = prog->Parameters->Parameters + i; - - /* - * XXX FIX NEEDED HERE - * We should also be adding a uniform if p->Type == PROGRAM_STATE_VAR. - * For example, modelview matrix, light pos, etc. - * Also, we need to update the state-var name-generator code to - * generate GLSL-style names, like "gl_LightSource[0].position". - * Furthermore, we'll need to fix the state-var's size/datatype info. - */ - - if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) - && p->Used) { - /* add this uniform, indexing into the target's Parameters list */ - struct gl_uniform *uniform = - _mesa_append_uniform(shProg->Uniforms, p->Name, prog->Target, i); - if (uniform) - uniform->Initialized = p->Initialized; - - /* Add the flag indicating that the program is dependent on constant - * state. - */ - prog->Parameters->StateFlags |= _NEW_PROGRAM; - } - - /* The samplerMap[] table we build here is used to remap/re-index - * sampler references by TEX instructions. - */ - if (p->Type == PROGRAM_SAMPLER && p->Used) { - /* Allocate a new sampler index */ - GLuint oldSampNum = (GLuint) prog->Parameters->ParameterValues[i][0]; - GLuint newSampNum = *numSamplers; - if (newSampNum >= ctx->Const.MaxTextureImageUnits) { - char s[100]; - _mesa_sprintf(s, "Too many texture samplers (%u, max is %u)", - newSampNum, ctx->Const.MaxTextureImageUnits); - link_error(shProg, s); - return GL_FALSE; - } - /* save old->new mapping in the table */ - if (oldSampNum < Elements(samplerMap)) - samplerMap[oldSampNum] = newSampNum; - /* update parameter's sampler index */ - prog->Parameters->ParameterValues[i][0] = (GLfloat) newSampNum; - (*numSamplers)++; - } - } - - /* OK, now scan the program/shader instructions looking for texture - * instructions using sampler vars. Replace old sampler indexes with - * new ones. - */ - prog->SamplersUsed = 0x0; - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - if (_mesa_is_tex_instruction(inst->Opcode)) { - const GLint oldSampNum = inst->TexSrcUnit; - -#if 0 - printf("====== remap sampler from %d to %d\n", - inst->TexSrcUnit, samplerMap[ inst->TexSrcUnit ]); -#endif - - /* here, texUnit is really samplerUnit */ - if (oldSampNum < Elements(samplerMap)) { - const GLuint newSampNum = samplerMap[oldSampNum]; - inst->TexSrcUnit = newSampNum; - prog->SamplerTargets[newSampNum] = inst->TexSrcTarget; - prog->SamplersUsed |= (1 << newSampNum); - } - } - } - - return GL_TRUE; -} - - -/** - * Resolve binding of generic vertex attributes. - * For example, if the vertex shader declared "attribute vec4 foobar" we'll - * allocate a generic vertex attribute for "foobar" and plug that value into - * the vertex program instructions. - * But if the user called glBindAttributeLocation(), those bindings will - * have priority. - */ -static GLboolean -_slang_resolve_attributes(struct gl_shader_program *shProg, - const struct gl_program *origProg, - struct gl_program *linkedProg) -{ - GLint attribMap[MAX_VERTEX_ATTRIBS]; - GLuint i, j; - GLbitfield usedAttributes; /* generics only, not legacy attributes */ - - assert(origProg != linkedProg); - assert(origProg->Target == GL_VERTEX_PROGRAM_ARB); - assert(linkedProg->Target == GL_VERTEX_PROGRAM_ARB); - - if (!shProg->Attributes) - shProg->Attributes = _mesa_new_parameter_list(); - - if (linkedProg->Attributes) { - _mesa_free_parameter_list(linkedProg->Attributes); - } - linkedProg->Attributes = _mesa_new_parameter_list(); - - - /* Build a bitmask indicating which attribute indexes have been - * explicitly bound by the user with glBindAttributeLocation(). - */ - usedAttributes = 0x0; - for (i = 0; i < shProg->Attributes->NumParameters; i++) { - GLint attr = shProg->Attributes->Parameters[i].StateIndexes[0]; - usedAttributes |= (1 << attr); - } - - /* If gl_Vertex is used, that actually counts against the limit - * on generic vertex attributes. This avoids the ambiguity of - * whether glVertexAttrib4fv(0, v) sets legacy attribute 0 (vert pos) - * or generic attribute[0]. If gl_Vertex is used, we want the former. - */ - if (origProg->InputsRead & VERT_BIT_POS) { - usedAttributes |= 0x1; - } - - /* initialize the generic attribute map entries to -1 */ - for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) { - attribMap[i] = -1; - } - - /* - * Scan program for generic attribute references - */ - for (i = 0; i < linkedProg->NumInstructions; i++) { - struct prog_instruction *inst = linkedProg->Instructions + i; - for (j = 0; j < 3; j++) { - if (inst->SrcReg[j].File == PROGRAM_INPUT && - inst->SrcReg[j].Index >= VERT_ATTRIB_GENERIC0) { - /* - * OK, we've found a generic vertex attribute reference. - */ - const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0; - - GLint attr = attribMap[k]; - - if (attr < 0) { - /* Need to figure out attribute mapping now. - */ - const char *name = origProg->Attributes->Parameters[k].Name; - const GLint size = origProg->Attributes->Parameters[k].Size; - const GLenum type =origProg->Attributes->Parameters[k].DataType; - GLint index; - - /* See if there's a user-defined attribute binding for - * this name. - */ - index = _mesa_lookup_parameter_index(shProg->Attributes, - -1, name); - if (index >= 0) { - /* Found a user-defined binding */ - attr = shProg->Attributes->Parameters[index].StateIndexes[0]; - } - else { - /* No user-defined binding, choose our own attribute number. - * Start at 1 since generic attribute 0 always aliases - * glVertex/position. - */ - for (attr = 0; attr < MAX_VERTEX_ATTRIBS; attr++) { - if (((1 << attr) & usedAttributes) == 0) - break; - } - if (attr == MAX_VERTEX_ATTRIBS) { - link_error(shProg, "Too many vertex attributes"); - return GL_FALSE; - } - - /* mark this attribute as used */ - usedAttributes |= (1 << attr); - } - - attribMap[k] = attr; - - /* Save the final name->attrib binding so it can be queried - * with glGetAttributeLocation(). - */ - _mesa_add_attribute(linkedProg->Attributes, name, - size, type, attr); - } - - assert(attr >= 0); - - /* update the instruction's src reg */ - inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr; - } - } - } - - return GL_TRUE; -} - - -/** - * Scan program instructions to update the program's NumTemporaries field. - * Note: this implemenation relies on the code generator allocating - * temps in increasing order (0, 1, 2, ... ). - */ -static void -_slang_count_temporaries(struct gl_program *prog) -{ - GLuint i, j; - GLint maxIndex = -1; - - for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - for (j = 0; j < numSrc; j++) { - if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { - if (maxIndex < inst->SrcReg[j].Index) - maxIndex = inst->SrcReg[j].Index; - } - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - if (maxIndex < (GLint) inst->DstReg.Index) - maxIndex = inst->DstReg.Index; - } - } - } - - prog->NumTemporaries = (GLuint) (maxIndex + 1); -} - - -/** - * Scan program instructions to update the program's InputsRead and - * OutputsWritten fields. - */ -static void -_slang_update_inputs_outputs(struct gl_program *prog) -{ - GLuint i, j; - GLuint maxAddrReg = 0; - - prog->InputsRead = 0x0; - prog->OutputsWritten = 0x0; - - for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - for (j = 0; j < numSrc; j++) { - if (inst->SrcReg[j].File == PROGRAM_INPUT) { - prog->InputsRead |= 1 << inst->SrcReg[j].Index; - if (prog->Target == GL_FRAGMENT_PROGRAM_ARB && - inst->SrcReg[j].Index == FRAG_ATTRIB_FOGC) { - /* The fragment shader FOGC input is used for fog, - * front-facing and sprite/point coord. - */ - struct gl_fragment_program *fp = fragment_program(prog); - const GLint swz = GET_SWZ(inst->SrcReg[j].Swizzle, 0); - if (swz == SWIZZLE_X) - fp->UsesFogFragCoord = GL_TRUE; - else if (swz == SWIZZLE_Y) - fp->UsesFrontFacing = GL_TRUE; - else if (swz == SWIZZLE_Z || swz == SWIZZLE_W) - fp->UsesPointCoord = GL_TRUE; - } - } - else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) { - maxAddrReg = MAX2(maxAddrReg, (GLuint) (inst->SrcReg[j].Index + 1)); - } - } - - if (inst->DstReg.File == PROGRAM_OUTPUT) { - prog->OutputsWritten |= 1 << inst->DstReg.Index; - if (inst->DstReg.RelAddr) { - /* If the output attribute is indexed with relative addressing - * we know that it must be a varying or texcoord such as - * gl_TexCoord[i] = v; In this case, mark all the texcoords - * or varying outputs as being written. It's not an error if - * a vertex shader writes varying vars that aren't used by the - * fragment shader. But it is an error for a fragment shader - * to use varyings that are not written by the vertex shader. - */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - if (inst->DstReg.Index == VERT_RESULT_TEX0) { - /* mark all texcoord outputs as written */ - const GLbitfield mask = - ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0; - prog->OutputsWritten |= mask; - } - else if (inst->DstReg.Index == VERT_RESULT_VAR0) { - /* mark all generic varying outputs as written */ - const GLbitfield mask = - ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0; - prog->OutputsWritten |= mask; - } - } - } - } - else if (inst->DstReg.File == PROGRAM_ADDRESS) { - maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1); - } - } - - prog->NumAddressRegs = maxAddrReg; -} - - -/** - * Shader linker. Currently: - * - * 1. The last attached vertex shader and fragment shader are linked. - * 2. Varying vars in the two shaders are combined so their locations - * agree between the vertex and fragment stages. They're treated as - * vertex program output attribs and as fragment program input attribs. - * 3. The vertex and fragment programs are cloned and modified to update - * src/dst register references so they use the new, linked varying - * storage locations. - */ -void -_slang_link(GLcontext *ctx, - GLhandleARB programObj, - struct gl_shader_program *shProg) -{ - const struct gl_vertex_program *vertProg; - const struct gl_fragment_program *fragProg; - GLuint numSamplers = 0; - GLuint i; - - _mesa_clear_shader_program_data(ctx, shProg); - - /* check that all programs compiled successfully */ - for (i = 0; i < shProg->NumShaders; i++) { - if (!shProg->Shaders[i]->CompileStatus) { - link_error(shProg, "linking with uncompiled shader\n"); - return; - } - } - - shProg->Uniforms = _mesa_new_uniform_list(); - shProg->Varying = _mesa_new_parameter_list(); - - /** - * Find attached vertex, fragment shaders defining main() - */ - vertProg = NULL; - fragProg = NULL; - for (i = 0; i < shProg->NumShaders; i++) { - struct gl_shader *shader = shProg->Shaders[i]; - if (shader->Type == GL_VERTEX_SHADER) { - if (shader->Main) - vertProg = vertex_program(shader->Program); - } - else if (shader->Type == GL_FRAGMENT_SHADER) { - if (shader->Main) - fragProg = fragment_program(shader->Program); - } - else { - _mesa_problem(ctx, "unexpected shader target in slang_link()"); - } - } - -#if FEATURE_es2_glsl - /* must have both a vertex and fragment program for ES2 */ - if (!vertProg) { - link_error(shProg, "missing vertex shader\n"); - return; - } - if (!fragProg) { - link_error(shProg, "missing fragment shader\n"); - return; - } -#endif - - /* - * Make copies of the vertex/fragment programs now since we'll be - * changing src/dst registers after merging the uniforms and varying vars. - */ - _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL); - if (vertProg) { - struct gl_vertex_program *linked_vprog = - vertex_program(_mesa_clone_program(ctx, &vertProg->Base)); - shProg->VertexProgram = linked_vprog; /* refcount OK */ - ASSERT(shProg->VertexProgram->Base.RefCount == 1); - } - - _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL); - if (fragProg) { - struct gl_fragment_program *linked_fprog = - fragment_program(_mesa_clone_program(ctx, &fragProg->Base)); - shProg->FragmentProgram = linked_fprog; /* refcount OK */ - ASSERT(shProg->FragmentProgram->Base.RefCount == 1); - } - - /* link varying vars */ - if (shProg->VertexProgram) { - if (!link_varying_vars(shProg, &shProg->VertexProgram->Base)) - return; - } - if (shProg->FragmentProgram) { - if (!link_varying_vars(shProg, &shProg->FragmentProgram->Base)) - return; - } - - /* link uniform vars */ - if (shProg->VertexProgram) { - if (!link_uniform_vars(ctx, shProg, &shProg->VertexProgram->Base, - &numSamplers)) { - return; - } - } - if (shProg->FragmentProgram) { - if (!link_uniform_vars(ctx, shProg, &shProg->FragmentProgram->Base, - &numSamplers)) { - return; - } - } - - /*_mesa_print_uniforms(shProg->Uniforms);*/ - - if (shProg->VertexProgram) { - if (!_slang_resolve_attributes(shProg, &vertProg->Base, - &shProg->VertexProgram->Base)) { - return; - } - } - - if (shProg->VertexProgram) { - _slang_update_inputs_outputs(&shProg->VertexProgram->Base); - _slang_count_temporaries(&shProg->VertexProgram->Base); - if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { - /* the vertex program did not compute a vertex position */ - link_error(shProg, - "gl_Position was not written by vertex shader\n"); - return; - } - } - if (shProg->FragmentProgram) { - _slang_count_temporaries(&shProg->FragmentProgram->Base); - _slang_update_inputs_outputs(&shProg->FragmentProgram->Base); - } - - /* Check that all the varying vars needed by the fragment shader are - * actually produced by the vertex shader. - */ - if (shProg->FragmentProgram) { - const GLbitfield varyingRead - = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0; - const GLbitfield varyingWritten = shProg->VertexProgram ? - shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0; - if ((varyingRead & varyingWritten) != varyingRead) { - link_error(shProg, - "Fragment program using varying vars not written by vertex shader\n"); - return; - } - } - - /* check that gl_FragColor and gl_FragData are not both written to */ - if (shProg->FragmentProgram) { - GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLR))) && - (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { - link_error(shProg, "Fragment program cannot write both gl_FragColor" - " and gl_FragData[].\n"); - return; - } - } - - - if (fragProg && shProg->FragmentProgram) { - /* Compute initial program's TexturesUsed info */ - _mesa_update_shader_textures_used(&shProg->FragmentProgram->Base); - - /* notify driver that a new fragment program has been compiled/linked */ - ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, - &shProg->FragmentProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original fragment program:\n"); - _mesa_print_program(&fragProg->Base); - _mesa_print_program_parameters(ctx, &fragProg->Base); - - printf("Mesa post-link fragment program:\n"); - _mesa_print_program(&shProg->FragmentProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); - } - } - - if (vertProg && shProg->VertexProgram) { - /* Compute initial program's TexturesUsed info */ - _mesa_update_shader_textures_used(&shProg->VertexProgram->Base); - - /* notify driver that a new vertex program has been compiled/linked */ - ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, - &shProg->VertexProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original vertex program:\n"); - _mesa_print_program(&vertProg->Base); - _mesa_print_program_parameters(ctx, &vertProg->Base); - - printf("Mesa post-link vertex program:\n"); - _mesa_print_program(&shProg->VertexProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); - } - } - - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Varying vars:\n"); - _mesa_print_parameter_list(shProg->Varying); - } - - shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_link.h b/src/libs/mesa/mesa/shader/slang/slang_link.h deleted file mode 100644 index 2b44d20787..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_link.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 2008 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 SLANG_LINK_H -#define SLANG_LINK_H 1 - -#include "slang_compile.h" - - -extern void -_slang_link(GLcontext *ctx, GLhandleARB h, - struct gl_shader_program *shProg); - - -#endif - diff --git a/src/libs/mesa/mesa/shader/slang/slang_log.c b/src/libs/mesa/mesa/shader/slang/slang_log.c deleted file mode 100644 index d5576d7ee2..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_log.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -#include "main/imports.h" -#include "main/context.h" -#include "slang_log.h" -#include "slang_utility.h" - - - -static char *out_of_memory = "Error: Out of memory.\n"; - -void -slang_info_log_construct(slang_info_log * log) -{ - log->text = NULL; - log->dont_free_text = GL_FALSE; - log->error_flag = GL_FALSE; -} - -void -slang_info_log_destruct(slang_info_log * log) -{ - if (!log->dont_free_text) - _mesa_free(log->text); -} - -static int -slang_info_log_message(slang_info_log * log, const char *prefix, - const char *msg) -{ - GLuint size; - - if (log->dont_free_text) - return 0; - size = slang_string_length(msg) + 2; - if (prefix != NULL) - size += slang_string_length(prefix) + 2; - if (log->text != NULL) { - GLuint old_len = slang_string_length(log->text); - log->text = (char *) - _mesa_realloc(log->text, old_len + 1, old_len + size); - } - else { - log->text = (char *) (_mesa_malloc(size)); - if (log->text != NULL) - log->text[0] = '\0'; - } - if (log->text == NULL) - return 0; - if (prefix != NULL) { - slang_string_concat(log->text, prefix); - slang_string_concat(log->text, ": "); - } - slang_string_concat(log->text, msg); - slang_string_concat(log->text, "\n"); - - if (MESA_VERBOSE & VERBOSE_GLSL) { - _mesa_printf("Mesa: GLSL %s", log->text); - } - - return 1; -} - -int -slang_info_log_print(slang_info_log * log, const char *msg, ...) -{ - va_list va; - char buf[1024]; - - va_start(va, msg); - _mesa_vsprintf(buf, msg, va); - va_end(va); - return slang_info_log_message(log, NULL, buf); -} - -int -slang_info_log_error(slang_info_log * log, const char *msg, ...) -{ - va_list va; - char buf[1024]; - - va_start(va, msg); - _mesa_vsprintf(buf, msg, va); - va_end(va); - log->error_flag = GL_TRUE; - if (slang_info_log_message(log, "Error", buf)) - return 1; - slang_info_log_memory(log); - return 0; -} - -int -slang_info_log_warning(slang_info_log * log, const char *msg, ...) -{ - va_list va; - char buf[1024]; - - va_start(va, msg); - _mesa_vsprintf(buf, msg, va); - va_end(va); - if (slang_info_log_message(log, "Warning", buf)) - return 1; - slang_info_log_memory(log); - return 0; -} - -void -slang_info_log_memory(slang_info_log * log) -{ - if (!slang_info_log_message(log, "Error", "Out of memory.")) { - log->dont_free_text = GL_TRUE; - log->error_flag = GL_TRUE; - log->text = out_of_memory; - } -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_log.h b/src/libs/mesa/mesa/shader/slang/slang_log.h deleted file mode 100644 index dcaba0285a..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_log.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SLANG_LOG_H -#define SLANG_LOG_H - - -typedef struct slang_info_log_ -{ - char *text; - GLboolean dont_free_text; - GLboolean error_flag; -} slang_info_log; - - -extern void -slang_info_log_construct(slang_info_log *); - -extern void -slang_info_log_destruct(slang_info_log *); - -extern int -slang_info_log_print(slang_info_log *, const char *, ...); - -extern int -slang_info_log_error(slang_info_log *, const char *, ...); - -extern int -slang_info_log_warning(slang_info_log *, const char *, ...); - -extern void -slang_info_log_memory(slang_info_log *); - - -#endif /* SLANG_LOG_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_mem.c b/src/libs/mesa/mesa/shader/slang/slang_mem.c deleted file mode 100644 index 9224578edb..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_mem.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file slang_mem.c - * - * Memory manager for GLSL compiler. The general idea is to do all - * allocations out of a large pool then just free the pool when done - * compiling to avoid intricate malloc/free tracking and memory leaks. - * - * \author Brian Paul - */ - -#include "main/context.h" -#include "main/macros.h" -#include "slang_mem.h" - - -#define GRANULARITY 8 -#define ROUND_UP(B) ( ((B) + (GRANULARITY - 1)) & ~(GRANULARITY - 1) ) - - -/** If 1, use conventional malloc/free. Helpful for debugging */ -#define USE_MALLOC_FREE 0 - - -struct slang_mempool_ -{ - GLuint Size, Used, Count, Largest; - char *Data; - struct slang_mempool_ *Next; -}; - - -slang_mempool * -_slang_new_mempool(GLuint initialSize) -{ - slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool)); - if (pool) { - pool->Data = (char *) _mesa_calloc(initialSize); - /*printf("ALLOC MEMPOOL %d at %p\n", initialSize, pool->Data);*/ - if (!pool->Data) { - _mesa_free(pool); - return NULL; - } - pool->Size = initialSize; - pool->Used = 0; - } - return pool; -} - - -void -_slang_delete_mempool(slang_mempool *pool) -{ - GLuint total = 0; - while (pool) { - slang_mempool *next = pool->Next; - /* - printf("DELETE MEMPOOL %u / %u count=%u largest=%u\n", - pool->Used, pool->Size, pool->Count, pool->Largest); - */ - total += pool->Used; - _mesa_free(pool->Data); - _mesa_free(pool); - pool = next; - } - /*printf("TOTAL ALLOCATED: %u\n", total);*/ -} - - -#ifdef DEBUG -static void -check_zero(const char *addr, GLuint n) -{ - GLuint i; - for (i = 0; i < n; i++) { - assert(addr[i]==0); - } -} -#endif - - -#ifdef DEBUG -static GLboolean -is_valid_address(const slang_mempool *pool, void *addr) -{ - while (pool) { - if ((char *) addr >= pool->Data && - (char *) addr < pool->Data + pool->Used) - return GL_TRUE; - - pool = pool->Next; - } - return GL_FALSE; -} -#endif - - -/** - * Alloc 'bytes' from shader mempool. - */ -void * -_slang_alloc(GLuint bytes) -{ -#if USE_MALLOC_FREE - return _mesa_calloc(bytes); -#else - slang_mempool *pool; - GET_CURRENT_CONTEXT(ctx); - pool = (slang_mempool *) ctx->Shader.MemPool; - - if (bytes == 0) - bytes = 1; - - while (pool) { - if (pool->Used + bytes <= pool->Size) { - /* found room */ - void *addr = (void *) (pool->Data + pool->Used); -#ifdef DEBUG - check_zero((char*) addr, bytes); -#endif - pool->Used += ROUND_UP(bytes); - pool->Largest = MAX2(pool->Largest, bytes); - pool->Count++; - /*printf("alloc %u Used %u\n", bytes, pool->Used);*/ - return addr; - } - else if (pool->Next) { - /* try next block */ - pool = pool->Next; - } - else { - /* alloc new pool */ - const GLuint sz = MAX2(bytes, pool->Size); - pool->Next = _slang_new_mempool(sz); - if (!pool->Next) { - /* we're _really_ out of memory */ - return NULL; - } - else { - pool = pool->Next; - pool->Largest = bytes; - pool->Count++; - pool->Used = ROUND_UP(bytes); -#ifdef DEBUG - check_zero((char*) pool->Data, bytes); -#endif - return (void *) pool->Data; - } - } - } - return NULL; -#endif -} - - -void * -_slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize) -{ -#if USE_MALLOC_FREE - return _mesa_realloc(oldBuffer, oldSize, newSize); -#else - GET_CURRENT_CONTEXT(ctx); - slang_mempool *pool = (slang_mempool *) ctx->Shader.MemPool; - (void) pool; - - if (newSize < oldSize) { - return oldBuffer; - } - else { - const GLuint copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = _slang_alloc(newSize); - - if (oldBuffer) - ASSERT(is_valid_address(pool, oldBuffer)); - - if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); - - return newBuffer; - } -#endif -} - - -/** - * Clone string, storing in current mempool. - */ -char * -_slang_strdup(const char *s) -{ - if (s) { - size_t l = _mesa_strlen(s); - char *s2 = (char *) _slang_alloc(l + 1); - if (s2) - _mesa_strcpy(s2, s); - return s2; - } - else { - return NULL; - } -} - - -/** - * Don't actually free memory, but mark it (for debugging). - */ -void -_slang_free(void *addr) -{ -#if USE_MALLOC_FREE - _mesa_free(addr); -#else - if (addr) { - GET_CURRENT_CONTEXT(ctx); - slang_mempool *pool = (slang_mempool *) ctx->Shader.MemPool; - (void) pool; - ASSERT(is_valid_address(pool, addr)); - } -#endif -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_mem.h b/src/libs/mesa/mesa/shader/slang/slang_mem.h deleted file mode 100644 index b5bfae2479..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_mem.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SLANG_MEM_H -#define SLANG_MEM_H - - -#include "main/imports.h" - - -typedef struct slang_mempool_ slang_mempool; - - -extern slang_mempool * -_slang_new_mempool(GLuint initialSize); - -extern void -_slang_delete_mempool(slang_mempool *pool); - -extern void * -_slang_alloc(GLuint bytes); - -extern void * -_slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize); - -extern char * -_slang_strdup(const char *s); - -extern void -_slang_free(void *addr); - - -#endif diff --git a/src/libs/mesa/mesa/shader/slang/slang_preprocess.c b/src/libs/mesa/mesa/shader/slang/slang_preprocess.c deleted file mode 100644 index e03a70fdae..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_preprocess.c +++ /dev/null @@ -1,1410 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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. - */ - -/** - * \file slang_preprocess.c - * slang preprocessor - * \author Michal Krol - */ - -#include "main/imports.h" -#include "shader/grammar/grammar_mesa.h" -#include "slang_preprocess.h" - -LONGSTRING static const char *slang_pp_directives_syn = -#include "library/slang_pp_directives_syn.h" -; - -LONGSTRING static const char *slang_pp_expression_syn = -#include "library/slang_pp_expression_syn.h" -; - -LONGSTRING static const char *slang_pp_version_syn = -#include "library/slang_pp_version_syn.h" -; - -static GLvoid -grammar_error_to_log (slang_info_log *log) -{ - char buf[1024]; - GLint pos; - - grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos); - if (buf[0] == 0) { - _mesa_snprintf(buf, sizeof(buf), "Preprocessor error"); - } - slang_info_log_error (log, buf); -} - -GLboolean -_slang_preprocess_version (const char *text, GLuint *version, GLuint *eaten, slang_info_log *log) -{ - grammar id; - byte *prod, *I; - unsigned int size; - - id = grammar_load_from_text ((const byte *) (slang_pp_version_syn)); - if (id == 0) { - grammar_error_to_log (log); - return GL_FALSE; - } - - if (!grammar_fast_check (id, (const byte *) (text), &prod, &size, 8)) { - grammar_error_to_log (log); - grammar_destroy (id); - return GL_FALSE; - } - - /* there can be multiple #version directives - grab the last one */ - I = &prod[size - 6]; - *version = (GLuint) (I[0]) + (GLuint) (I[1]) * 100; - *eaten = (GLuint) (I[2]) + ((GLuint) (I[3]) << 8) + ((GLuint) (I[4]) << 16) + ((GLuint) (I[5]) << 24); - - grammar_destroy (id); - grammar_alloc_free (prod); - return GL_TRUE; -} - -/* - * The preprocessor does the following work. - * 1. Remove comments. Each comment block is replaced with a single space and if the - * block contains new-lines, they are preserved. This ensures that line numbers - * stay the same and if a comment block delimits two tokens, the are delitmited - * by the space after comment removal. - * 2. Remove preprocessor directives from the source string, checking their syntax and - * executing them if appropriate. Again, new-lines are preserved. - * 3. Expand macros. - * 4. Tokenize the source string by ensuring there is at least one space between every - * two adjacent tokens. - */ - -#define PP_ANNOTATE 0 - -static GLvoid -pp_annotate (slang_string *output, const char *fmt, ...) -{ -#if PP_ANNOTATE - va_list va; - char buffer[1024]; - - va_start (va, fmt); - _mesa_vsprintf (buffer, fmt, va); - va_end (va); - slang_string_pushs (output, buffer, _mesa_strlen (buffer)); -#else - (GLvoid) (output); - (GLvoid) (fmt); -#endif -} - - /* - * The expression is executed on a fixed-sized stack. The PUSH macro makes a runtime - * check if the stack is not overflown by too complex expressions. In that situation the - * GLSL preprocessor should report internal compiler error. - * The BINARYDIV makes a runtime check if the divider is not 0. If it is, it reports - * compilation error. - */ - -#define EXECUTION_STACK_SIZE 1024 - -#define PUSH(x)\ - do {\ - if (sp == 0) {\ - slang_info_log_error (elog, "internal compiler error: preprocessor execution stack overflow.");\ - return GL_FALSE;\ - }\ - stack[--sp] = x;\ - } while (GL_FALSE) - -#define POP(x)\ - do {\ - assert (sp < EXECUTION_STACK_SIZE);\ - x = stack[sp++];\ - } while (GL_FALSE) - -#define BINARY(op)\ - do {\ - GLint a, b;\ - POP(b);\ - POP(a);\ - PUSH(a op b);\ - } while (GL_FALSE) - -#define BINARYDIV(op)\ - do {\ - GLint a, b;\ - POP(b);\ - POP(a);\ - if (b == 0) {\ - slang_info_log_error (elog, "division by zero in preprocessor expression.");\ - return GL_FALSE;\ - }\ - PUSH(a op b);\ - } while (GL_FALSE) - -#define UNARY(op)\ - do {\ - GLint a;\ - POP(a);\ - PUSH(op a);\ - } while (GL_FALSE) - -#define OP_END 0 -#define OP_PUSHINT 1 -#define OP_LOGICALOR 2 -#define OP_LOGICALAND 3 -#define OP_OR 4 -#define OP_XOR 5 -#define OP_AND 6 -#define OP_EQUAL 7 -#define OP_NOTEQUAL 8 -#define OP_LESSEQUAL 9 -#define OP_GREATEREQUAL 10 -#define OP_LESS 11 -#define OP_GREATER 12 -#define OP_LEFTSHIFT 13 -#define OP_RIGHTSHIFT 14 -#define OP_ADD 15 -#define OP_SUBTRACT 16 -#define OP_MULTIPLY 17 -#define OP_DIVIDE 18 -#define OP_MODULUS 19 -#define OP_PLUS 20 -#define OP_MINUS 21 -#define OP_NEGATE 22 -#define OP_COMPLEMENT 23 - -static GLboolean -execute_expression (slang_string *output, const byte *code, GLuint *pi, GLint *result, - slang_info_log *elog) -{ - GLuint i = *pi; - GLint stack[EXECUTION_STACK_SIZE]; - GLuint sp = EXECUTION_STACK_SIZE; - - while (code[i] != OP_END) { - switch (code[i++]) { - case OP_PUSHINT: - i++; - PUSH(_mesa_atoi ((const char *) (&code[i]))); - i += _mesa_strlen ((const char *) (&code[i])) + 1; - break; - case OP_LOGICALOR: - BINARY(||); - break; - case OP_LOGICALAND: - BINARY(&&); - break; - case OP_OR: - BINARY(|); - break; - case OP_XOR: - BINARY(^); - break; - case OP_AND: - BINARY(&); - break; - case OP_EQUAL: - BINARY(==); - break; - case OP_NOTEQUAL: - BINARY(!=); - break; - case OP_LESSEQUAL: - BINARY(<=); - break; - case OP_GREATEREQUAL: - BINARY(>=); - break; - case OP_LESS: - BINARY(<); - break; - case OP_GREATER: - BINARY(>); - break; - case OP_LEFTSHIFT: - BINARY(<<); - break; - case OP_RIGHTSHIFT: - BINARY(>>); - break; - case OP_ADD: - BINARY(+); - break; - case OP_SUBTRACT: - BINARY(-); - break; - case OP_MULTIPLY: - BINARY(*); - break; - case OP_DIVIDE: - BINARYDIV(/); - break; - case OP_MODULUS: - BINARYDIV(%); - break; - case OP_PLUS: - UNARY(+); - break; - case OP_MINUS: - UNARY(-); - break; - case OP_NEGATE: - UNARY(!); - break; - case OP_COMPLEMENT: - UNARY(~); - break; - default: - assert (0); - } - } - - /* Write-back the index skipping the OP_END. */ - *pi = i + 1; - - /* There should be exactly one value left on the stack. This is our result. */ - POP(*result); - pp_annotate (output, "%d ", *result); - assert (sp == EXECUTION_STACK_SIZE); - return GL_TRUE; -} - -/* - * Function execute_expressions() executes up to 2 expressions. The second expression is there - * for the #line directive which takes 1 or 2 expressions that indicate line and file numbers. - * If it fails, it returns 0. If it succeeds, it returns the number of executed expressions. - */ - -#define EXP_END 0 -#define EXP_EXPRESSION 1 - -static GLuint -execute_expressions (slang_string *output, grammar eid, const byte *expr, GLint results[2], - slang_info_log *elog) -{ - GLint success; - byte *code; - GLuint size, count = 0; - - success = grammar_fast_check (eid, expr, &code, &size, 64); - if (success) { - GLuint i = 0; - - while (code[i++] == EXP_EXPRESSION) { - assert (count < 2); - - if (!execute_expression (output, code, &i, &results[count], elog)) { - count = 0; - break; - } - count++; - } - grammar_alloc_free (code); - } - else { - slang_info_log_error (elog, "syntax error in preprocessor expression.");\ - } - return count; -} - -/* - * The pp_symbol structure is used to hold macro definitions and macro formal parameters. The - * pp_symbols strcture is a collection of pp_symbol. It is used both for storing macro formal - * parameters and all global macro definitions. Making this unification wastes some memory, - * becuse macro formal parameters don't need further lists of symbols. We lose 8 bytes per - * formal parameter here, but making this we can use the same code to substitute macro parameters - * as well as macros in the source string. - */ - -typedef struct -{ - struct pp_symbol_ *symbols; - GLuint count; -} pp_symbols; - -static GLvoid -pp_symbols_init (pp_symbols *self) -{ - self->symbols = NULL; - self->count = 0; -} - -static GLvoid -pp_symbols_free (pp_symbols *); - -typedef struct pp_symbol_ -{ - slang_string name; - slang_string replacement; - pp_symbols parameters; -} pp_symbol; - -static GLvoid -pp_symbol_init (pp_symbol *self) -{ - slang_string_init (&self->name); - slang_string_init (&self->replacement); - pp_symbols_init (&self->parameters); -} - -static GLvoid -pp_symbol_free (pp_symbol *self) -{ - slang_string_free (&self->name); - slang_string_free (&self->replacement); - pp_symbols_free (&self->parameters); -} - -static GLvoid -pp_symbol_reset (pp_symbol *self) -{ - /* Leave symbol name intact. */ - slang_string_reset (&self->replacement); - pp_symbols_free (&self->parameters); - pp_symbols_init (&self->parameters); -} - -static GLvoid -pp_symbols_free (pp_symbols *self) -{ - GLuint i; - - for (i = 0; i < self->count; i++) - pp_symbol_free (&self->symbols[i]); - _mesa_free (self->symbols); -} - -static pp_symbol * -pp_symbols_push (pp_symbols *self) -{ - self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, self->count * sizeof (pp_symbol), - (self->count + 1) * sizeof (pp_symbol))); - if (self->symbols == NULL) - return NULL; - pp_symbol_init (&self->symbols[self->count]); - return &self->symbols[self->count++]; -} - -static GLboolean -pp_symbols_erase (pp_symbols *self, pp_symbol *symbol) -{ - assert (symbol >= self->symbols && symbol < self->symbols + self->count); - - self->count--; - pp_symbol_free (symbol); - if (symbol < self->symbols + self->count) - _mesa_memcpy (symbol, symbol + 1, sizeof (pp_symbol) * (self->symbols + self->count - symbol)); - self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, (self->count + 1) * sizeof (pp_symbol), - self->count * sizeof (pp_symbol))); - return self->symbols != NULL; -} - -static pp_symbol * -pp_symbols_find (pp_symbols *self, const char *name) -{ - GLuint i; - - for (i = 0; i < self->count; i++) - if (_mesa_strcmp (name, slang_string_cstr (&self->symbols[i].name)) == 0) - return &self->symbols[i]; - return NULL; -} - -/* - * The condition context of a single #if/#else/#endif level. Those can be nested, so there - * is a stack of condition contexts. - * There is a special global context on the bottom of the stack. It is there to simplify - * context handling. - */ - -typedef struct -{ - GLboolean current; /* The condition value of this level. */ - GLboolean effective; /* The effective product of current condition, outer level conditions - * and position within #if-#else-#endif sections. */ - GLboolean else_allowed; /* TRUE if in #if-#else section, FALSE if in #else-#endif section - * and for global context. */ - GLboolean endif_required; /* FALSE for global context only. */ -} pp_cond_ctx; - -/* Should be enuff. */ -#define CONDITION_STACK_SIZE 64 - -typedef struct -{ - pp_cond_ctx stack[CONDITION_STACK_SIZE]; - pp_cond_ctx *top; -} pp_cond_stack; - -static GLboolean -pp_cond_stack_push (pp_cond_stack *self, slang_info_log *elog) -{ - if (self->top == self->stack) { - slang_info_log_error (elog, "internal compiler error: preprocessor condition stack overflow."); - return GL_FALSE; - } - self->top--; - return GL_TRUE; -} - -static GLvoid -pp_cond_stack_reevaluate (pp_cond_stack *self) -{ - /* There must be at least 2 conditions on the stack - one global and one being evaluated. */ - assert (self->top <= &self->stack[CONDITION_STACK_SIZE - 2]); - - self->top->effective = self->top->current && self->top[1].effective; -} - - -/** - * Extension enables through #extension directive. - * NOTE: Currently, only enable/disable state is stored. - */ -typedef struct -{ - GLboolean ARB_draw_buffers; - GLboolean ARB_texture_rectangle; -} pp_ext; - - -/** - * Disable all extensions. Called at startup and on #extension all: disable. - */ -static GLvoid -pp_ext_disable_all(pp_ext *self) -{ - _mesa_memset(self, 0, sizeof(self)); -} - - -/** - * Called during preprocessor initialization to set the initial enable/disable - * state of extensions. - */ -static GLvoid -pp_ext_init(pp_ext *self, const struct gl_extensions *extensions) -{ - pp_ext_disable_all (self); - if (extensions->ARB_draw_buffers) - self->ARB_draw_buffers = GL_TRUE; - if (extensions->NV_texture_rectangle) - self->ARB_texture_rectangle = GL_TRUE; -} - -/** - * Called in response to #extension directives to enable/disable - * the named extension. - */ -static GLboolean -pp_ext_set(pp_ext *self, const char *name, GLboolean enable) -{ - if (_mesa_strcmp (name, "GL_ARB_draw_buffers") == 0) - self->ARB_draw_buffers = enable; - else if (_mesa_strcmp (name, "GL_ARB_texture_rectangle") == 0) - self->ARB_texture_rectangle = enable; - else - return GL_FALSE; - return GL_TRUE; -} - - -static void -pp_pragmas_init(struct gl_sl_pragmas *pragmas) -{ - pragmas->Optimize = GL_TRUE; - pragmas->Debug = GL_FALSE; -} - - -/** - * Called in response to #pragma. For example, "#pragma debug(on)" would - * call this function as pp_pragma("debug", "on"). - * \return GL_TRUE if pragma is valid, GL_FALSE if invalid - */ -static GLboolean -pp_pragma(struct gl_sl_pragmas *pragmas, const char *pragma, const char *param) -{ -#if 0 - printf("#pragma %s %s\n", pragma, param); -#endif - if (_mesa_strcmp(pragma, "optimize") == 0) { - if (!param) - return GL_FALSE; /* missing required param */ - if (_mesa_strcmp(param, "on") == 0) { - pragmas->Optimize = GL_TRUE; - } - else if (_mesa_strcmp(param, "off") == 0) { - pragmas->Optimize = GL_FALSE; - } - else { - return GL_FALSE; /* invalid param */ - } - } - else if (_mesa_strcmp(pragma, "debug") == 0) { - if (!param) - return GL_FALSE; /* missing required param */ - if (_mesa_strcmp(param, "on") == 0) { - pragmas->Debug = GL_TRUE; - } - else if (_mesa_strcmp(param, "off") == 0) { - pragmas->Debug = GL_FALSE; - } - else { - return GL_FALSE; /* invalid param */ - } - } - /* all other pragmas are silently ignored */ - return GL_TRUE; -} - - -/** - * The state of preprocessor: current line, file and version number, list - * of all defined macros and the #if/#endif context. - */ -typedef struct -{ - GLint line; - GLint file; - GLint version; - pp_symbols symbols; - pp_ext ext; - slang_info_log *elog; - pp_cond_stack cond; -} pp_state; - -static GLvoid -pp_state_init (pp_state *self, slang_info_log *elog, - const struct gl_extensions *extensions) -{ - self->line = 0; - self->file = 1; -#if FEATURE_es2_glsl - self->version = 100; -#else - self->version = 110; -#endif - pp_symbols_init (&self->symbols); - pp_ext_init (&self->ext, extensions); - self->elog = elog; - - /* Initialize condition stack and create the global context. */ - self->cond.top = &self->cond.stack[CONDITION_STACK_SIZE - 1]; - self->cond.top->current = GL_TRUE; - self->cond.top->effective = GL_TRUE; - self->cond.top->else_allowed = GL_FALSE; - self->cond.top->endif_required = GL_FALSE; -} - -static GLvoid -pp_state_free (pp_state *self) -{ - pp_symbols_free (&self->symbols); -} - -#define IS_FIRST_ID_CHAR(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || (x) == '_') -#define IS_NEXT_ID_CHAR(x) (IS_FIRST_ID_CHAR(x) || ((x) >= '0' && (x) <= '9')) -#define IS_WHITE(x) ((x) == ' ' || (x) == '\n') -#define IS_NULL(x) ((x) == '\0') - -#define SKIP_WHITE(x) do { while (IS_WHITE(*(x))) (x)++; } while (GL_FALSE) - -typedef struct -{ - slang_string *output; - const char *input; - pp_state *state; -} expand_state; - -static GLboolean -expand_defined (expand_state *e, slang_string *buffer) -{ - GLboolean in_paren = GL_FALSE; - const char *id; - - /* Parse the optional opening parenthesis. */ - SKIP_WHITE(e->input); - if (*e->input == '(') { - e->input++; - in_paren = GL_TRUE; - SKIP_WHITE(e->input); - } - - /* Parse operand. */ - if (!IS_FIRST_ID_CHAR(*e->input)) { - slang_info_log_error (e->state->elog, - "preprocess error: identifier expected after operator 'defined'."); - return GL_FALSE; - } - slang_string_reset (buffer); - slang_string_pushc (buffer, *e->input++); - while (IS_NEXT_ID_CHAR(*e->input)) - slang_string_pushc (buffer, *e->input++); - id = slang_string_cstr (buffer); - - /* Check if the operand is defined. Output 1 if it is defined, output 0 if not. */ - if (pp_symbols_find (&e->state->symbols, id) == NULL) - slang_string_pushs (e->output, " 0 ", 3); - else - slang_string_pushs (e->output, " 1 ", 3); - - /* Parse the closing parentehesis if the opening one was there. */ - if (in_paren) { - SKIP_WHITE(e->input); - if (*e->input != ')') { - slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - return GL_TRUE; -} - -static GLboolean -expand (expand_state *, pp_symbols *); - -static GLboolean -expand_symbol (expand_state *e, pp_symbol *symbol) -{ - expand_state es; - - /* If the macro has some parameters, we need to parse them. */ - if (symbol->parameters.count != 0) { - GLuint i; - - /* Parse the opening parenthesis. */ - SKIP_WHITE(e->input); - if (*e->input != '(') { - slang_info_log_error (e->state->elog, "preprocess error: '(' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - - /* Parse macro actual parameters. This can be anything, separated by a colon. - */ - for (i = 0; i < symbol->parameters.count; i++) { - GLuint nested_paren_count = 0; /* track number of nested parentheses */ - - if (*e->input == ')') { - slang_info_log_error (e->state->elog, "preprocess error: unexpected ')'."); - return GL_FALSE; - } - - /* Eat all characters up to the comma or closing parentheses. */ - pp_symbol_reset (&symbol->parameters.symbols[i]); - while (!IS_NULL(*e->input)) { - /* Exit loop only when all nested parens have been eaten. */ - if (nested_paren_count == 0 && (*e->input == ',' || *e->input == ')')) - break; - - /* Actually count nested parens here. */ - if (*e->input == '(') - nested_paren_count++; - else if (*e->input == ')') - nested_paren_count--; - - slang_string_pushc (&symbol->parameters.symbols[i].replacement, *e->input++); - } - - /* If it was not the last paremeter, skip the comma. Otherwise, skip the - * closing parentheses. */ - if (i + 1 == symbol->parameters.count) { - /* This is the last paremeter - skip the closing parentheses. */ - if (*e->input != ')') { - slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - else { - /* Skip the separating comma. */ - if (*e->input != ',') { - slang_info_log_error (e->state->elog, "preprocess error: ',' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - } - } - - /* Expand the macro. Use its parameters as a priority symbol list to expand - * macro parameters correctly. */ - es.output = e->output; - es.input = slang_string_cstr (&symbol->replacement); - es.state = e->state; - slang_string_pushc (e->output, ' '); - if (!expand (&es, &symbol->parameters)) - return GL_FALSE; - slang_string_pushc (e->output, ' '); - return GL_TRUE; -} - -/* - * Function expand() expands source text from to . The expansion is made using - * the list passed in parameter. It allows us to expand macro formal parameters with - * actual parameters. The global list of symbols from pp state is used when doing a recursive - * call of expand(). - */ - -static GLboolean -expand (expand_state *e, pp_symbols *symbols) -{ - while (!IS_NULL(*e->input)) { - if (IS_FIRST_ID_CHAR(*e->input)) { - slang_string buffer; - const char *id; - - /* Parse the identifier. */ - slang_string_init (&buffer); - slang_string_pushc (&buffer, *e->input++); - while (IS_NEXT_ID_CHAR(*e->input)) - slang_string_pushc (&buffer, *e->input++); - id = slang_string_cstr (&buffer); - - /* Now check if the identifier is special in some way. The "defined" identifier is - * actually an operator that we must handle here and expand it either to " 0 " or " 1 ". - * The other identifiers start with "__" and we expand it to appropriate values - * taken from the preprocessor state. */ - if (_mesa_strcmp (id, "defined") == 0) { - if (!expand_defined (e, &buffer)) - return GL_FALSE; - } - else if (_mesa_strcmp (id, "__LINE__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->line); - slang_string_pushc (e->output, ' '); - } - else if (_mesa_strcmp (id, "__FILE__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->file); - slang_string_pushc (e->output, ' '); - } - else if (_mesa_strcmp (id, "__VERSION__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->version); - slang_string_pushc (e->output, ' '); - } -#if FEATURE_es2_glsl - else if (_mesa_strcmp (id, "GL_ES") == 0 || - _mesa_strcmp (id, "GL_FRAGMENT_PRECISION_HIGH") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, '1'); - slang_string_pushc (e->output, ' '); - } -#endif - else { - pp_symbol *symbol; - - /* The list of symbols from take precedence over the list from . - * Note that in some cases this is the same list so avoid double look-up. */ - symbol = pp_symbols_find (symbols, id); - if (symbol == NULL && symbols != &e->state->symbols) - symbol = pp_symbols_find (&e->state->symbols, id); - - /* If the symbol was found, recursively expand its definition. */ - if (symbol != NULL) { - if (!expand_symbol (e, symbol)) { - slang_string_free (&buffer); - return GL_FALSE; - } - } - else { - slang_string_push (e->output, &buffer); - } - } - slang_string_free (&buffer); - } - else if (IS_WHITE(*e->input)) { - slang_string_pushc (e->output, *e->input++); - } - else { - while (!IS_WHITE(*e->input) && !IS_NULL(*e->input) && !IS_FIRST_ID_CHAR(*e->input)) - slang_string_pushc (e->output, *e->input++); - } - } - return GL_TRUE; -} - -static GLboolean -parse_if (slang_string *output, const byte *prod, GLuint *pi, GLint *result, pp_state *state, - grammar eid) -{ - const char *text; - GLuint len; - - text = (const char *) (&prod[*pi]); - len = _mesa_strlen (text); - - if (state->cond.top->effective) { - slang_string expr; - GLuint count; - GLint results[2]; - expand_state es; - - /* Expand the expression. */ - slang_string_init (&expr); - es.output = &expr; - es.input = text; - es.state = state; - if (!expand (&es, &state->symbols)) - return GL_FALSE; - - /* Execute the expression. */ - count = execute_expressions (output, eid, (const byte *) (slang_string_cstr (&expr)), - results, state->elog); - slang_string_free (&expr); - if (count != 1) - return GL_FALSE; - *result = results[0]; - } - else { - /* The directive is dead. */ - *result = 0; - } - - *pi += len + 1; - return GL_TRUE; -} - -#define ESCAPE_TOKEN 0 - -#define TOKEN_END 0 -#define TOKEN_DEFINE 1 -#define TOKEN_UNDEF 2 -#define TOKEN_IF 3 -#define TOKEN_ELSE 4 -#define TOKEN_ELIF 5 -#define TOKEN_ENDIF 6 -#define TOKEN_ERROR 7 -#define TOKEN_PRAGMA 8 -#define TOKEN_EXTENSION 9 -#define TOKEN_LINE 10 - -#define PARAM_END 0 -#define PARAM_PARAMETER 1 - -#define BEHAVIOR_REQUIRE 1 -#define BEHAVIOR_ENABLE 2 -#define BEHAVIOR_WARN 3 -#define BEHAVIOR_DISABLE 4 - -#define PRAGMA_NO_PARAM 0 -#define PRAGMA_PARAM 1 - - -static GLboolean -preprocess_source (slang_string *output, const char *source, - grammar pid, grammar eid, - slang_info_log *elog, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - static const char *predefined[] = { - "__FILE__", - "__LINE__", - "__VERSION__", -#if FEATURE_es2_glsl - "GL_ES", - "GL_FRAGMENT_PRECISION_HIGH", -#endif - NULL - }; - byte *prod; - GLuint size, i; - pp_state state; - - if (!grammar_fast_check (pid, (const byte *) (source), &prod, &size, 65536)) { - grammar_error_to_log (elog); - return GL_FALSE; - } - - pp_state_init (&state, elog, extensions); - pp_pragmas_init (pragmas); - - /* add the predefined symbols to the symbol table */ - for (i = 0; predefined[i]; i++) { - pp_symbol *symbol = NULL; - symbol = pp_symbols_push(&state.symbols); - assert(symbol); - slang_string_pushs(&symbol->name, - predefined[i], _mesa_strlen(predefined[i])); - } - - i = 0; - while (i < size) { - if (prod[i] != ESCAPE_TOKEN) { - if (state.cond.top->effective) { - slang_string input; - expand_state es; - - /* Eat only one line of source code to expand it. - * FIXME: This approach has one drawback. If a macro with parameters spans across - * multiple lines, the preprocessor will raise an error. */ - slang_string_init (&input); - while (prod[i] != '\0' && prod[i] != '\n') - slang_string_pushc (&input, prod[i++]); - if (prod[i] != '\0') - slang_string_pushc (&input, prod[i++]); - - /* Increment line number. */ - state.line++; - - es.output = output; - es.input = slang_string_cstr (&input); - es.state = &state; - if (!expand (&es, &state.symbols)) - goto error; - - slang_string_free (&input); - } - else { - /* Condition stack is disabled - keep track on line numbers and output only newlines. */ - if (prod[i] == '\n') { - state.line++; - /*pp_annotate (output, "%c", prod[i]);*/ - } - else { - /*pp_annotate (output, "%c", prod[i]);*/ - } - i++; - } - } - else { - const char *id; - GLuint idlen; - GLubyte token; - - i++; - token = prod[i++]; - switch (token) { - - case TOKEN_END: - /* End of source string. - * Check if all #ifs have been terminated by matching #endifs. - * On condition stack there should be only the global condition context. */ - if (state.cond.top->endif_required) { - slang_info_log_error (elog, "end of source without matching #endif."); - return GL_FALSE; - } - break; - - case TOKEN_DEFINE: - { - pp_symbol *symbol = NULL; - - /* Parse macro name. */ - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - pp_annotate (output, "// #define %s(", id); - - /* If the symbol is already defined, override it. */ - symbol = pp_symbols_find (&state.symbols, id); - if (symbol == NULL) { - symbol = pp_symbols_push (&state.symbols); - if (symbol == NULL) - goto error; - slang_string_pushs (&symbol->name, id, idlen); - } - else { - pp_symbol_reset (symbol); - } - } - i += idlen + 1; - - /* Parse optional macro parameters. */ - while (prod[i++] != PARAM_END) { - pp_symbol *param; - - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - pp_annotate (output, "%s, ", id); - param = pp_symbols_push (&symbol->parameters); - if (param == NULL) - goto error; - slang_string_pushs (¶m->name, id, idlen); - } - i += idlen + 1; - } - - /* Parse macro replacement. */ - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - slang_string replacement; - expand_state es; - - pp_annotate (output, ") %s", id); - - slang_string_init(&replacement); - slang_string_pushs(&replacement, id, idlen); - - /* Expand macro replacement. */ - es.output = &symbol->replacement; - es.input = slang_string_cstr(&replacement); - es.state = &state; - if (!expand(&es, &state.symbols)) { - slang_string_free(&replacement); - goto error; - } - slang_string_free(&replacement); - } - i += idlen + 1; - } - break; - - case TOKEN_UNDEF: - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - if (state.cond.top->effective) { - pp_symbol *symbol; - - pp_annotate (output, "// #undef %s", id); - /* Try to find symbol with given name and remove it. */ - symbol = pp_symbols_find (&state.symbols, id); - if (symbol != NULL) - if (!pp_symbols_erase (&state.symbols, symbol)) - goto error; - } - break; - - case TOKEN_IF: - { - GLint result; - - /* Parse #if expression end execute it. */ - pp_annotate (output, "// #if "); - if (!parse_if (output, prod, &i, &result, &state, eid)) - goto error; - - /* Push new condition on the stack. */ - if (!pp_cond_stack_push (&state.cond, state.elog)) - goto error; - state.cond.top->current = result ? GL_TRUE : GL_FALSE; - state.cond.top->else_allowed = GL_TRUE; - state.cond.top->endif_required = GL_TRUE; - pp_cond_stack_reevaluate (&state.cond); - } - break; - - case TOKEN_ELSE: - /* Check if #else is alloved here. */ - if (!state.cond.top->else_allowed) { - slang_info_log_error (elog, "#else without matching #if."); - goto error; - } - - /* Negate current condition and reevaluate it. */ - state.cond.top->current = !state.cond.top->current; - state.cond.top->else_allowed = GL_FALSE; - pp_cond_stack_reevaluate (&state.cond); - if (state.cond.top->effective) - pp_annotate (output, "// #else"); - break; - - case TOKEN_ELIF: - /* Check if #elif is alloved here. */ - if (!state.cond.top->else_allowed) { - slang_info_log_error (elog, "#elif without matching #if."); - goto error; - } - - /* Negate current condition and reevaluate it. */ - state.cond.top->current = !state.cond.top->current; - pp_cond_stack_reevaluate (&state.cond); - - if (state.cond.top->effective) - pp_annotate (output, "// #elif "); - - { - GLint result; - - /* Parse #elif expression end execute it. */ - if (!parse_if (output, prod, &i, &result, &state, eid)) - goto error; - - /* Update current condition and reevaluate it. */ - state.cond.top->current = result ? GL_TRUE : GL_FALSE; - pp_cond_stack_reevaluate (&state.cond); - } - break; - - case TOKEN_ENDIF: - /* Check if #endif is alloved here. */ - if (!state.cond.top->endif_required) { - slang_info_log_error (elog, "#endif without matching #if."); - goto error; - } - - /* Pop the condition off the stack. */ - state.cond.top++; - if (state.cond.top->effective) - pp_annotate (output, "// #endif"); - break; - - case TOKEN_EXTENSION: - /* Parse the extension name. */ - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - if (state.cond.top->effective) - pp_annotate (output, "// #extension %s: ", id); - - /* Parse and apply extension behavior. */ - if (state.cond.top->effective) { - switch (prod[i++]) { - - case BEHAVIOR_REQUIRE: - pp_annotate (output, "require"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") == 0) { - slang_info_log_error (elog, "require: bad behavior for #extension all."); - goto error; - } - else { - slang_info_log_error (elog, "%s: required extension is not supported.", id); - goto error; - } - } - break; - - case BEHAVIOR_ENABLE: - pp_annotate (output, "enable"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") == 0) { - slang_info_log_error (elog, "enable: bad behavior for #extension all."); - goto error; - } - else { - slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); - } - } - break; - - case BEHAVIOR_WARN: - pp_annotate (output, "warn"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") != 0) { - slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); - } - } - break; - - case BEHAVIOR_DISABLE: - pp_annotate (output, "disable"); - if (!pp_ext_set (&state.ext, id, GL_FALSE)) { - if (_mesa_strcmp (id, "all") == 0) { - pp_ext_disable_all (&state.ext); - } - else { - slang_info_log_warning (elog, "%s: disabled extension is not supported.", id); - } - } - break; - - default: - assert (0); - } - } - break; - - case TOKEN_PRAGMA: - { - GLint have_param; - const char *pragma, *param; - - pragma = (const char *) (&prod[i]); - i += _mesa_strlen(pragma) + 1; - have_param = (prod[i++] == PRAGMA_PARAM); - if (have_param) { - param = (const char *) (&prod[i]); - i += _mesa_strlen(param) + 1; - } - else { - param = NULL; - } - pp_pragma(pragmas, pragma, param); - } - break; - - case TOKEN_LINE: - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - - if (state.cond.top->effective) { - slang_string buffer; - GLuint count; - GLint results[2]; - expand_state es; - - slang_string_init (&buffer); - state.line++; - es.output = &buffer; - es.input = id; - es.state = &state; - if (!expand (&es, &state.symbols)) - goto error; - - pp_annotate (output, "// #line "); - count = execute_expressions (output, eid, - (const byte *) (slang_string_cstr (&buffer)), - results, state.elog); - slang_string_free (&buffer); - if (count == 0) - goto error; - - state.line = results[0] - 1; - if (count == 2) - state.file = results[1]; - } - break; - } - } - } - - /* Check for missing #endifs. */ - if (state.cond.top->endif_required) { - slang_info_log_error (elog, "#endif expected but end of source found."); - goto error; - } - - grammar_alloc_free(prod); - pp_state_free (&state); - return GL_TRUE; - -error: - grammar_alloc_free(prod); - pp_state_free (&state); - return GL_FALSE; -} - - -/** - * Remove the continuation characters from the input string. - * This is the very first step in preprocessing and is effective - * even inside comment blocks. - * If there is a whitespace between a backslash and a newline, - * this is not considered as a line continuation. - * \return GL_TRUE for success, GL_FALSE otherwise. - */ -static GLboolean -_slang_preprocess_backslashes(slang_string *output, - const char *input) -{ - while (*input) { - if (input[0] == '\\') { - /* If a newline follows, eat the backslash and the newline. */ - if (input[1] == '\r') { - if (input[2] == '\n') { - input += 3; - } else { - input += 2; - } - } else if (input[1] == '\n') { - if (input[2] == '\r') { - input += 3; - } else { - input += 2; - } - } else { - /* Leave the backslash alone. */ - slang_string_pushc(output, *input++); - } - } else { - slang_string_pushc(output, *input++); - } - } - return GL_TRUE; -} - - -/** - * Run preprocessor on source code. - * \param extensions indicates which GL extensions are enabled - * \param output the post-process results - * \param input the input text - * \param elog log to record warnings, errors - * \return GL_TRUE for success, GL_FALSE for error - */ -GLboolean -_slang_preprocess_directives(slang_string *output, - const char *input, - slang_info_log *elog, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - grammar pid, eid; - GLboolean success; - slang_string without_backslashes; - - pid = grammar_load_from_text ((const byte *) (slang_pp_directives_syn)); - if (pid == 0) { - grammar_error_to_log (elog); - return GL_FALSE; - } - eid = grammar_load_from_text ((const byte *) (slang_pp_expression_syn)); - if (eid == 0) { - grammar_error_to_log (elog); - grammar_destroy (pid); - return GL_FALSE; - } - - slang_string_init(&without_backslashes); - success = _slang_preprocess_backslashes(&without_backslashes, input); - - if (0) { - _mesa_printf("Pre-processed shader:\n"); - _mesa_printf("%s", slang_string_cstr(&without_backslashes)); - _mesa_printf("----------------------\n"); - } - - if (success) { - success = preprocess_source(output, - slang_string_cstr(&without_backslashes), - pid, - eid, - elog, - extensions, - pragmas); - } - - slang_string_free(&without_backslashes); - grammar_destroy (eid); - grammar_destroy (pid); - - if (0) { - _mesa_printf("Post-processed shader:\n"); - _mesa_printf("%s", slang_string_cstr(output)); - _mesa_printf("----------------------\n"); - } - - return success; -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_preprocess.h b/src/libs/mesa/mesa/shader/slang/slang_preprocess.h deleted file mode 100644 index f344820dae..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_preprocess.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. 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 SLANG_PREPROCESS_H -#define SLANG_PREPROCESS_H - -#include "slang_compile.h" -#include "slang_log.h" - - -extern GLboolean -_slang_preprocess_version (const char *, GLuint *, GLuint *, slang_info_log *); - -extern GLboolean -_slang_preprocess_directives(slang_string *output, const char *input, - slang_info_log *, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas); - -#endif /* SLANG_PREPROCESS_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_print.c b/src/libs/mesa/mesa/shader/slang/slang_print.c deleted file mode 100644 index bf1475f91d..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_print.c +++ /dev/null @@ -1,875 +0,0 @@ - -/** - * Dump/print a slang_operation tree - */ - - -#include "main/imports.h" -#include "slang_compile.h" -#include "slang_print.h" - - -static void -spaces(int n) -{ - while (n--) - printf(" "); -} - - -static void -print_type(const slang_fully_specified_type *t) -{ - switch (t->qualifier) { - case SLANG_QUAL_NONE: - /*printf("");*/ - break; - case SLANG_QUAL_CONST: - printf("const "); - break; - case SLANG_QUAL_ATTRIBUTE: - printf("attrib "); - break; - case SLANG_QUAL_VARYING: - printf("varying "); - break; - case SLANG_QUAL_UNIFORM: - printf("uniform "); - break; - case SLANG_QUAL_OUT: - printf("output "); - break; - case SLANG_QUAL_INOUT: - printf("inout "); - break; - case SLANG_QUAL_FIXEDOUTPUT: - printf("fixedoutput"); - break; - case SLANG_QUAL_FIXEDINPUT: - printf("fixedinput"); - break; - default: - printf("unknown qualifer!"); - } - - switch (t->specifier.type) { - case SLANG_SPEC_VOID: - printf("void"); - break; - case SLANG_SPEC_BOOL: - printf("bool"); - break; - case SLANG_SPEC_BVEC2: - printf("bvec2"); - break; - case SLANG_SPEC_BVEC3: - printf("bvec3"); - break; - case SLANG_SPEC_BVEC4: - printf("bvec4"); - break; - case SLANG_SPEC_INT: - printf("int"); - break; - case SLANG_SPEC_IVEC2: - printf("ivec2"); - break; - case SLANG_SPEC_IVEC3: - printf("ivec3"); - break; - case SLANG_SPEC_IVEC4: - printf("ivec4"); - break; - case SLANG_SPEC_FLOAT: - printf("float"); - break; - case SLANG_SPEC_VEC2: - printf("vec2"); - break; - case SLANG_SPEC_VEC3: - printf("vec3"); - break; - case SLANG_SPEC_VEC4: - printf("vec4"); - break; - case SLANG_SPEC_MAT2: - printf("mat2"); - break; - case SLANG_SPEC_MAT3: - printf("mat3"); - break; - case SLANG_SPEC_MAT4: - printf("mat4"); - break; - case SLANG_SPEC_MAT23: - printf("mat2x3"); - break; - case SLANG_SPEC_MAT32: - printf("mat3x2"); - break; - case SLANG_SPEC_MAT24: - printf("mat2x4"); - break; - case SLANG_SPEC_MAT42: - printf("mat4x2"); - break; - case SLANG_SPEC_MAT34: - printf("mat3x4"); - break; - case SLANG_SPEC_MAT43: - printf("mat4x3"); - break; - case SLANG_SPEC_SAMPLER1D: - printf("sampler1D"); - break; - case SLANG_SPEC_SAMPLER2D: - printf("sampler2D"); - break; - case SLANG_SPEC_SAMPLER3D: - printf("sampler3D"); - break; - case SLANG_SPEC_SAMPLERCUBE: - printf("samplerCube"); - break; - case SLANG_SPEC_SAMPLER1DSHADOW: - printf("sampler1DShadow"); - break; - case SLANG_SPEC_SAMPLER2DSHADOW: - printf("sampler2DShadow"); - break; - case SLANG_SPEC_STRUCT: - printf("struct"); - break; - case SLANG_SPEC_ARRAY: - printf("array"); - break; - default: - printf("unknown type"); - } - /*printf("\n");*/ -} - - -static void -print_variable(const slang_variable *v, int indent) -{ - spaces(indent); - printf("VAR "); - print_type(&v->type); - printf(" %s (at %p)", (char *) v->a_name, (void *) v); - if (v->initializer) { - printf(" :=\n"); - slang_print_tree(v->initializer, indent + 3); - } - else { - printf(";\n"); - } -} - - -static void -print_binary(const slang_operation *op, const char *oper, int indent) -{ - assert(op->num_children == 2); -#if 0 - printf("binary at %p locals=%p outer=%p\n", - (void *) op, - (void *) op->locals, - (void *) op->locals->outer_scope); -#endif - slang_print_tree(&op->children[0], indent + 3); - spaces(indent); - printf("%s at %p locals=%p outer=%p\n", - oper, (void *) op, (void *) op->locals, - (void *) op->locals->outer_scope); - slang_print_tree(&op->children[1], indent + 3); -} - - -static void -print_generic2(const slang_operation *op, const char *oper, - const char *s, int indent) -{ - GLuint i; - if (oper) { - spaces(indent); - printf("%s %s at %p locals=%p outer=%p\n", - oper, s, (void *) op, (void *) op->locals, - (void *) op->locals->outer_scope); - } - for (i = 0; i < op->num_children; i++) { - spaces(indent); - printf("//child %u of %u:\n", i, op->num_children); - slang_print_tree(&op->children[i], indent); - } -} - -static void -print_generic(const slang_operation *op, const char *oper, int indent) -{ - print_generic2(op, oper, "", indent); -} - - -static const slang_variable_scope * -find_scope(const slang_variable_scope *s, slang_atom name) -{ - GLuint i; - for (i = 0; i < s->num_variables; i++) { - if (s->variables[i]->a_name == name) - return s; - } - if (s->outer_scope) - return find_scope(s->outer_scope, name); - else - return NULL; -} - -static const slang_variable * -find_var(const slang_variable_scope *s, slang_atom name) -{ - GLuint i; - for (i = 0; i < s->num_variables; i++) { - if (s->variables[i]->a_name == name) - return s->variables[i]; - } - if (s->outer_scope) - return find_var(s->outer_scope, name); - else - return NULL; -} - - -void -slang_print_tree(const slang_operation *op, int indent) -{ - GLuint i; - - switch (op->type) { - - case SLANG_OPER_NONE: - spaces(indent); - printf("SLANG_OPER_NONE\n"); - break; - - case SLANG_OPER_BLOCK_NO_NEW_SCOPE: - spaces(indent); - printf("{ locals=%p outer=%p\n", (void*)op->locals, (void*)op->locals->outer_scope); - print_generic(op, NULL, indent+3); - spaces(indent); - printf("}\n"); - break; - - case SLANG_OPER_BLOCK_NEW_SCOPE: - spaces(indent); - printf("{{ // new scope locals=%p outer=%p: ", - (void *) op->locals, - (void *) op->locals->outer_scope); - for (i = 0; i < op->locals->num_variables; i++) { - printf("%s ", (char *) op->locals->variables[i]->a_name); - } - printf("\n"); - print_generic(op, NULL, indent+3); - spaces(indent); - printf("}}\n"); - break; - - case SLANG_OPER_VARIABLE_DECL: - assert(op->num_children == 0 || op->num_children == 1); - { - slang_variable *v; - v = _slang_variable_locate(op->locals, op->a_id, GL_TRUE); - if (v) { - const slang_variable_scope *scope; - spaces(indent); - printf("DECL (locals=%p outer=%p) ", (void*)op->locals, (void*) op->locals->outer_scope); - print_type(&v->type); - printf(" %s (%p)", (char *) op->a_id, - (void *) find_var(op->locals, op->a_id)); - - scope = find_scope(op->locals, op->a_id); - printf(" (in scope %p) ", (void *) scope); - assert(scope); - if (op->num_children == 1) { - printf(" :=\n"); - slang_print_tree(&op->children[0], indent + 3); - } - else if (v->initializer) { - printf(" := INITIALIZER\n"); - slang_print_tree(v->initializer, indent + 3); - } - else { - printf(";\n"); - } - /* - spaces(indent); - printf("TYPE: "); - print_type(&v->type); - spaces(indent); - printf("ADDR: %d size: %d\n", v->address, v->size); - */ - } - else { - spaces(indent); - printf("DECL %s (anonymous variable!!!!)\n", (char *) op->a_id); - } - } - break; - - case SLANG_OPER_ASM: - spaces(indent); - printf("ASM: %s at %p locals=%p outer=%p\n", - (char *) op->a_id, - (void *) op, - (void *) op->locals, - (void *) op->locals->outer_scope); - print_generic(op, "ASM", indent+3); - break; - - case SLANG_OPER_BREAK: - spaces(indent); - printf("BREAK\n"); - break; - - case SLANG_OPER_CONTINUE: - spaces(indent); - printf("CONTINUE\n"); - break; - - case SLANG_OPER_DISCARD: - spaces(indent); - printf("DISCARD\n"); - break; - - case SLANG_OPER_RETURN: - spaces(indent); - printf("RETURN\n"); - if (op->num_children > 0) - slang_print_tree(&op->children[0], indent + 3); - break; - - case SLANG_OPER_LABEL: - spaces(indent); - printf("LABEL %s\n", (char *) op->a_id); - break; - - case SLANG_OPER_EXPRESSION: - spaces(indent); - printf("EXPR: locals=%p outer=%p\n", - (void *) op->locals, - (void *) op->locals->outer_scope); - /*print_generic(op, "SLANG_OPER_EXPRESSION", indent);*/ - slang_print_tree(&op->children[0], indent + 3); - break; - - case SLANG_OPER_IF: - spaces(indent); - printf("IF\n"); - slang_print_tree(&op->children[0], indent + 3); - spaces(indent); - printf("THEN\n"); - slang_print_tree(&op->children[1], indent + 3); - spaces(indent); - printf("ELSE\n"); - slang_print_tree(&op->children[2], indent + 3); - spaces(indent); - printf("ENDIF\n"); - break; - - case SLANG_OPER_WHILE: - assert(op->num_children == 2); - spaces(indent); - printf("WHILE LOOP: locals = %p\n", (void *) op->locals); - indent += 3; - spaces(indent); - printf("WHILE cond:\n"); - slang_print_tree(&op->children[0], indent + 3); - spaces(indent); - printf("WHILE body:\n"); - slang_print_tree(&op->children[1], indent + 3); - indent -= 3; - spaces(indent); - printf("END WHILE LOOP\n"); - break; - - case SLANG_OPER_DO: - spaces(indent); - printf("DO LOOP: locals = %p\n", (void *) op->locals); - indent += 3; - spaces(indent); - printf("DO body:\n"); - slang_print_tree(&op->children[0], indent + 3); - spaces(indent); - printf("DO cond:\n"); - slang_print_tree(&op->children[1], indent + 3); - indent -= 3; - spaces(indent); - printf("END DO LOOP\n"); - break; - - case SLANG_OPER_FOR: - spaces(indent); - printf("FOR LOOP: locals = %p\n", (void *) op->locals); - indent += 3; - spaces(indent); - printf("FOR init:\n"); - slang_print_tree(&op->children[0], indent + 3); - spaces(indent); - printf("FOR condition:\n"); - slang_print_tree(&op->children[1], indent + 3); - spaces(indent); - printf("FOR step:\n"); - slang_print_tree(&op->children[2], indent + 3); - spaces(indent); - printf("FOR body:\n"); - slang_print_tree(&op->children[3], indent + 3); - indent -= 3; - spaces(indent); - printf("ENDFOR\n"); - /* - print_generic(op, "FOR", indent + 3); - */ - break; - - case SLANG_OPER_VOID: - spaces(indent); - printf("(oper-void)\n"); - break; - - case SLANG_OPER_LITERAL_BOOL: - spaces(indent); - printf("LITERAL ("); - for (i = 0; i < op->literal_size; i++) - printf("%s ", op->literal[0] ? "TRUE" : "FALSE"); - printf(")\n"); - - break; - - case SLANG_OPER_LITERAL_INT: - spaces(indent); - printf("LITERAL ("); - for (i = 0; i < op->literal_size; i++) - printf("%d ", (int) op->literal[i]); - printf(")\n"); - break; - - case SLANG_OPER_LITERAL_FLOAT: - spaces(indent); - printf("LITERAL ("); - for (i = 0; i < op->literal_size; i++) - printf("%f ", op->literal[i]); - printf(")\n"); - break; - - case SLANG_OPER_IDENTIFIER: - { - const slang_variable_scope *scope; - spaces(indent); - if (op->var && op->var->a_name) { - scope = find_scope(op->locals, op->var->a_name); - printf("VAR %s (in scope %p)\n", (char *) op->var->a_name, - (void *) scope); - assert(scope); - } - else { - scope = find_scope(op->locals, op->a_id); - printf("VAR' %s (in scope %p) locals=%p outer=%p\n", - (char *) op->a_id, - (void *) scope, - (void *) op->locals, - (void *) op->locals->outer_scope); - assert(scope); - } - } - break; - - case SLANG_OPER_SEQUENCE: - print_generic(op, "COMMA-SEQ", indent+3); - break; - - case SLANG_OPER_ASSIGN: - spaces(indent); - printf("ASSIGNMENT locals=%p outer=%p\n", - (void *) op->locals, - (void *) op->locals->outer_scope); - print_binary(op, ":=", indent); - break; - - case SLANG_OPER_ADDASSIGN: - spaces(indent); - printf("ASSIGN\n"); - print_binary(op, "+=", indent); - break; - - case SLANG_OPER_SUBASSIGN: - spaces(indent); - printf("ASSIGN\n"); - print_binary(op, "-=", indent); - break; - - case SLANG_OPER_MULASSIGN: - spaces(indent); - printf("ASSIGN\n"); - print_binary(op, "*=", indent); - break; - - case SLANG_OPER_DIVASSIGN: - spaces(indent); - printf("ASSIGN\n"); - print_binary(op, "/=", indent); - break; - - /*SLANG_OPER_MODASSIGN,*/ - /*SLANG_OPER_LSHASSIGN,*/ - /*SLANG_OPER_RSHASSIGN,*/ - /*SLANG_OPER_ORASSIGN,*/ - /*SLANG_OPER_XORASSIGN,*/ - /*SLANG_OPER_ANDASSIGN,*/ - case SLANG_OPER_SELECT: - spaces(indent); - printf("SLANG_OPER_SELECT n=%d\n", op->num_children); - assert(op->num_children == 3); - slang_print_tree(&op->children[0], indent+3); - spaces(indent); - printf("?\n"); - slang_print_tree(&op->children[1], indent+3); - spaces(indent); - printf(":\n"); - slang_print_tree(&op->children[2], indent+3); - break; - - case SLANG_OPER_LOGICALOR: - print_binary(op, "||", indent); - break; - - case SLANG_OPER_LOGICALXOR: - print_binary(op, "^^", indent); - break; - - case SLANG_OPER_LOGICALAND: - print_binary(op, "&&", indent); - break; - - /*SLANG_OPER_BITOR*/ - /*SLANG_OPER_BITXOR*/ - /*SLANG_OPER_BITAND*/ - case SLANG_OPER_EQUAL: - print_binary(op, "==", indent); - break; - - case SLANG_OPER_NOTEQUAL: - print_binary(op, "!=", indent); - break; - - case SLANG_OPER_LESS: - print_binary(op, "<", indent); - break; - - case SLANG_OPER_GREATER: - print_binary(op, ">", indent); - break; - - case SLANG_OPER_LESSEQUAL: - print_binary(op, "<=", indent); - break; - - case SLANG_OPER_GREATEREQUAL: - print_binary(op, ">=", indent); - break; - - /*SLANG_OPER_LSHIFT*/ - /*SLANG_OPER_RSHIFT*/ - case SLANG_OPER_ADD: - print_binary(op, "+", indent); - break; - - case SLANG_OPER_SUBTRACT: - print_binary(op, "-", indent); - break; - - case SLANG_OPER_MULTIPLY: - print_binary(op, "*", indent); - break; - - case SLANG_OPER_DIVIDE: - print_binary(op, "/", indent); - break; - - /*SLANG_OPER_MODULUS*/ - case SLANG_OPER_PREINCREMENT: - spaces(indent); - printf("PRE++\n"); - slang_print_tree(&op->children[0], indent+3); - break; - - case SLANG_OPER_PREDECREMENT: - spaces(indent); - printf("PRE--\n"); - slang_print_tree(&op->children[0], indent+3); - break; - - case SLANG_OPER_PLUS: - spaces(indent); - printf("SLANG_OPER_PLUS\n"); - break; - - case SLANG_OPER_MINUS: - spaces(indent); - printf("SLANG_OPER_MINUS\n"); - break; - - /*SLANG_OPER_COMPLEMENT*/ - case SLANG_OPER_NOT: - spaces(indent); - printf("NOT\n"); - slang_print_tree(&op->children[0], indent+3); - break; - - case SLANG_OPER_SUBSCRIPT: - spaces(indent); - printf("SLANG_OPER_SUBSCRIPT locals=%p outer=%p\n", - (void *) op->locals, - (void *) op->locals->outer_scope); - print_generic(op, NULL, indent+3); - break; - - case SLANG_OPER_CALL: -#if 0 - slang_function *fun - = _slang_function_locate(A->space.funcs, oper->a_id, - oper->children, - oper->num_children, &A->space, A->atoms); -#endif - spaces(indent); - printf("CALL %s(\n", (char *) op->a_id); - for (i = 0; i < op->num_children; i++) { - slang_print_tree(&op->children[i], indent+3); - if (i + 1 < op->num_children) { - spaces(indent + 3); - printf(",\n"); - } - } - spaces(indent); - printf(")\n"); - break; - - case SLANG_OPER_METHOD: - spaces(indent); - printf("METHOD CALL %s.%s\n", (char *) op->a_obj, (char *) op->a_id); - break; - - case SLANG_OPER_FIELD: - spaces(indent); - printf("FIELD %s of\n", (char*) op->a_id); - slang_print_tree(&op->children[0], indent+3); - break; - - case SLANG_OPER_POSTINCREMENT: - spaces(indent); - printf("POST++\n"); - slang_print_tree(&op->children[0], indent+3); - break; - - case SLANG_OPER_POSTDECREMENT: - spaces(indent); - printf("POST--\n"); - slang_print_tree(&op->children[0], indent+3); - break; - - default: - printf("unknown op->type %d\n", (int) op->type); - } - -} - - - -void -slang_print_function(const slang_function *f, GLboolean body) -{ - GLuint i; - -#if 0 - if (_mesa_strcmp((char *) f->header.a_name, "main") != 0) - return; -#endif - - printf("FUNCTION %s ( scope=%p\n", - (char *) f->header.a_name, (void *) f->parameters); - - for (i = 0; i < f->param_count; i++) { - print_variable(f->parameters->variables[i], 3); - } - - printf(") param scope = %p\n", (void *) f->parameters); - - if (body && f->body) - slang_print_tree(f->body, 0); -} - - - - - -const char * -slang_type_qual_string(slang_type_qualifier q) -{ - switch (q) { - case SLANG_QUAL_NONE: - return "none"; - case SLANG_QUAL_CONST: - return "const"; - case SLANG_QUAL_ATTRIBUTE: - return "attribute"; - case SLANG_QUAL_VARYING: - return "varying"; - case SLANG_QUAL_UNIFORM: - return "uniform"; - case SLANG_QUAL_OUT: - return "out"; - case SLANG_QUAL_INOUT: - return "inout"; - case SLANG_QUAL_FIXEDOUTPUT: - return "fixedoutput"; - case SLANG_QUAL_FIXEDINPUT: - return "fixedinputk"; - default: - return "qual?"; - } -} - - -static const char * -slang_type_string(slang_type_specifier_type t) -{ - switch (t) { - case SLANG_SPEC_VOID: - return "void"; - case SLANG_SPEC_BOOL: - return "bool"; - case SLANG_SPEC_BVEC2: - return "bvec2"; - case SLANG_SPEC_BVEC3: - return "bvec3"; - case SLANG_SPEC_BVEC4: - return "bvec4"; - case SLANG_SPEC_INT: - return "int"; - case SLANG_SPEC_IVEC2: - return "ivec2"; - case SLANG_SPEC_IVEC3: - return "ivec3"; - case SLANG_SPEC_IVEC4: - return "ivec4"; - case SLANG_SPEC_FLOAT: - return "float"; - case SLANG_SPEC_VEC2: - return "vec2"; - case SLANG_SPEC_VEC3: - return "vec3"; - case SLANG_SPEC_VEC4: - return "vec4"; - case SLANG_SPEC_MAT2: - return "mat2"; - case SLANG_SPEC_MAT3: - return "mat3"; - case SLANG_SPEC_MAT4: - return "mat4"; - case SLANG_SPEC_SAMPLER1D: - return "sampler1D"; - case SLANG_SPEC_SAMPLER2D: - return "sampler2D"; - case SLANG_SPEC_SAMPLER3D: - return "sampler3D"; - case SLANG_SPEC_SAMPLERCUBE: - return "samplerCube"; - case SLANG_SPEC_SAMPLER1DSHADOW: - return "sampler1DShadow"; - case SLANG_SPEC_SAMPLER2DSHADOW: - return "sampler2DShadow"; - case SLANG_SPEC_SAMPLER2DRECT: - return "sampler2DRect"; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return "sampler2DRectShadow"; - case SLANG_SPEC_STRUCT: - return "struct"; - case SLANG_SPEC_ARRAY: - return "array"; - default: - return "type?"; - } -} - - -static const char * -slang_fq_type_string(const slang_fully_specified_type *t) -{ - static char str[1000]; - sprintf(str, "%s %s", slang_type_qual_string(t->qualifier), - slang_type_string(t->specifier.type)); - return str; -} - - -void -slang_print_type(const slang_fully_specified_type *t) -{ - printf("%s %s", slang_type_qual_string(t->qualifier), - slang_type_string(t->specifier.type)); -} - - -#if 0 -static char * -slang_var_string(const slang_variable *v) -{ - static char str[1000]; - sprintf(str, "%s : %s", - (char *) v->a_name, - slang_fq_type_string(&v->type)); - return str; -} -#endif - - -void -slang_print_variable(const slang_variable *v) -{ - printf("Name: %s\n", (char *) v->a_name); - printf("Type: %s\n", slang_fq_type_string(&v->type)); -} - - -void -_slang_print_var_scope(const slang_variable_scope *vars, int indent) -{ - GLuint i; - - spaces(indent); - printf("Var scope %p %d vars:\n", (void *) vars, vars->num_variables); - for (i = 0; i < vars->num_variables; i++) { - spaces(indent + 3); - printf("%s (at %p)\n", (char *) vars->variables[i]->a_name, (void*) (vars->variables + i)); - } - spaces(indent + 3); - printf("outer_scope = %p\n", (void*) vars->outer_scope); - - if (vars->outer_scope) { - /*spaces(indent + 3);*/ - _slang_print_var_scope(vars->outer_scope, indent + 3); - } -} - - - -int -slang_checksum_tree(const slang_operation *op) -{ - int s = op->num_children; - GLuint i; - - for (i = 0; i < op->num_children; i++) { - s += slang_checksum_tree(&op->children[i]); - } - return s; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_print.h b/src/libs/mesa/mesa/shader/slang/slang_print.h deleted file mode 100644 index 46605c8061..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_print.h +++ /dev/null @@ -1,29 +0,0 @@ - - -#ifndef SLANG_PRINT -#define SLANG_PRINT - -extern void -slang_print_function(const slang_function *f, GLboolean body); - -extern void -slang_print_tree(const slang_operation *op, int indent); - -extern const char * -slang_type_qual_string(slang_type_qualifier q); - -extern void -slang_print_type(const slang_fully_specified_type *t); - -extern void -slang_print_variable(const slang_variable *v); - -extern void -_slang_print_var_scope(const slang_variable_scope *s, int indent); - - -extern int -slang_checksum_tree(const slang_operation *op); - -#endif /* SLANG_PRINT */ - diff --git a/src/libs/mesa/mesa/shader/slang/slang_simplify.c b/src/libs/mesa/mesa/shader/slang/slang_simplify.c deleted file mode 100644 index b8a21f642c..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_simplify.c +++ /dev/null @@ -1,526 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 2005-2008 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. - */ - -/** - * Functions for constant folding, built-in constant lookup, and function - * call casting. - */ - - -#include "main/imports.h" -#include "main/macros.h" -#include "main/get.h" -#include "slang_compile.h" -#include "slang_codegen.h" -#include "slang_simplify.h" -#include "slang_print.h" - - -#ifndef GL_MAX_FRAGMENT_UNIFORM_VECTORS -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#endif -#ifndef GL_MAX_VERTEX_UNIFORM_VECTORS -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#endif -#ifndef GL_MAX_VARYING_VECTORS -#define GL_MAX_VARYING_VECTORS 0x8DFC -#endif - - -/** - * Lookup the value of named constant, such as gl_MaxLights. - * \return value of constant, or -1 if unknown - */ -GLint -_slang_lookup_constant(const char *name) -{ - struct constant_info { - const char *Name; - const GLenum Token; - }; - static const struct constant_info info[] = { - { "gl_MaxClipPlanes", GL_MAX_CLIP_PLANES }, - { "gl_MaxCombinedTextureImageUnits", GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS }, - { "gl_MaxDrawBuffers", GL_MAX_DRAW_BUFFERS }, - { "gl_MaxFragmentUniformComponents", GL_MAX_FRAGMENT_UNIFORM_COMPONENTS }, - { "gl_MaxLights", GL_MAX_LIGHTS }, - { "gl_MaxTextureUnits", GL_MAX_TEXTURE_UNITS }, - { "gl_MaxTextureCoords", GL_MAX_TEXTURE_COORDS }, - { "gl_MaxVertexAttribs", GL_MAX_VERTEX_ATTRIBS }, - { "gl_MaxVertexUniformComponents", GL_MAX_VERTEX_UNIFORM_COMPONENTS }, - { "gl_MaxVaryingFloats", GL_MAX_VARYING_FLOATS }, - { "gl_MaxVertexTextureImageUnits", GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS }, - { "gl_MaxTextureImageUnits", GL_MAX_TEXTURE_IMAGE_UNITS }, -#if FEATURE_es2_glsl - { "gl_MaxVertexUniformVectors", GL_MAX_VERTEX_UNIFORM_VECTORS }, - { "gl_MaxVaryingVectors", GL_MAX_VARYING_VECTORS }, - { "gl_MaxFragmentUniformVectors", GL_MAX_FRAGMENT_UNIFORM_VECTORS }, -#endif - { NULL, 0 } - }; - GLuint i; - - for (i = 0; info[i].Name; i++) { - if (strcmp(info[i].Name, name) == 0) { - /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; - } - } - return -1; -} - - -static slang_operation_type -literal_type(slang_operation_type t1, slang_operation_type t2) -{ - if (t1 == SLANG_OPER_LITERAL_FLOAT || t2 == SLANG_OPER_LITERAL_FLOAT) - return SLANG_OPER_LITERAL_FLOAT; - else - return SLANG_OPER_LITERAL_INT; -} - - -/** - * Recursively traverse an AST tree, applying simplifications wherever - * possible. - * At the least, we do constant folding. We need to do that much so that - * compile-time expressions can be evaluated for things like array - * declarations. I.e.: float foo[3 + 5]; - */ -void -_slang_simplify(slang_operation *oper, - const slang_name_space * space, - slang_atom_pool * atoms) -{ - GLboolean isFloat[4]; - GLboolean isBool[4]; - GLuint i, n; - - if (oper->type == SLANG_OPER_IDENTIFIER) { - /* see if it's a named constant */ - GLint value = _slang_lookup_constant((char *) oper->a_id); - /*printf("value[%s] = %d\n", (char*) oper->a_id, value);*/ - if (value >= 0) { - oper->literal[0] = - oper->literal[1] = - oper->literal[2] = - oper->literal[3] = (GLfloat) value; - oper->type = SLANG_OPER_LITERAL_INT; - return; - } - /* look for user-defined constant */ - { - slang_variable *var; - var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE); - if (var) { - if (var->type.qualifier == SLANG_QUAL_CONST && - var->initializer && - (var->initializer->type == SLANG_OPER_LITERAL_INT || - var->initializer->type == SLANG_OPER_LITERAL_FLOAT)) { - oper->literal[0] = var->initializer->literal[0]; - oper->literal[1] = var->initializer->literal[1]; - oper->literal[2] = var->initializer->literal[2]; - oper->literal[3] = var->initializer->literal[3]; - oper->literal_size = var->initializer->literal_size; - oper->type = var->initializer->type; - /* - printf("value[%s] = %f\n", - (char*) oper->a_id, oper->literal[0]); - */ - return; - } - } - } - } - - /* first, simplify children */ - for (i = 0; i < oper->num_children; i++) { - _slang_simplify(&oper->children[i], space, atoms); - } - - /* examine children */ - n = MIN2(oper->num_children, 4); - for (i = 0; i < n; i++) { - isFloat[i] = (oper->children[i].type == SLANG_OPER_LITERAL_FLOAT || - oper->children[i].type == SLANG_OPER_LITERAL_INT); - isBool[i] = (oper->children[i].type == SLANG_OPER_LITERAL_BOOL); - } - - if (oper->num_children == 2 && isFloat[0] && isFloat[1]) { - /* probably simple arithmetic */ - switch (oper->type) { - case SLANG_OPER_ADD: - for (i = 0; i < 4; i++) { - oper->literal[i] - = oper->children[0].literal[i] + oper->children[1].literal[i]; - } - oper->literal_size = oper->children[0].literal_size; - oper->type = literal_type(oper->children[0].type, - oper->children[1].type); - slang_operation_destruct(oper); /* frees unused children */ - return; - case SLANG_OPER_SUBTRACT: - for (i = 0; i < 4; i++) { - oper->literal[i] - = oper->children[0].literal[i] - oper->children[1].literal[i]; - } - oper->literal_size = oper->children[0].literal_size; - oper->type = literal_type(oper->children[0].type, - oper->children[1].type); - slang_operation_destruct(oper); - return; - case SLANG_OPER_MULTIPLY: - for (i = 0; i < 4; i++) { - oper->literal[i] - = oper->children[0].literal[i] * oper->children[1].literal[i]; - } - oper->literal_size = oper->children[0].literal_size; - oper->type = literal_type(oper->children[0].type, - oper->children[1].type); - slang_operation_destruct(oper); - return; - case SLANG_OPER_DIVIDE: - for (i = 0; i < 4; i++) { - oper->literal[i] - = oper->children[0].literal[i] / oper->children[1].literal[i]; - } - oper->literal_size = oper->children[0].literal_size; - oper->type = literal_type(oper->children[0].type, - oper->children[1].type); - slang_operation_destruct(oper); - return; - default: - ; /* nothing */ - } - } - - if (oper->num_children == 1 && isFloat[0]) { - switch (oper->type) { - case SLANG_OPER_MINUS: - for (i = 0; i < 4; i++) { - oper->literal[i] = -oper->children[0].literal[i]; - } - oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; - return; - case SLANG_OPER_PLUS: - COPY_4V(oper->literal, oper->children[0].literal); - oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; - return; - default: - ; /* nothing */ - } - } - - if (oper->num_children == 2 && isBool[0] && isBool[1]) { - /* simple boolean expression */ - switch (oper->type) { - case SLANG_OPER_LOGICALAND: - for (i = 0; i < 4; i++) { - const GLint a = oper->children[0].literal[i] ? 1 : 0; - const GLint b = oper->children[1].literal[i] ? 1 : 0; - oper->literal[i] = (GLfloat) (a && b); - } - oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_BOOL; - return; - case SLANG_OPER_LOGICALOR: - for (i = 0; i < 4; i++) { - const GLint a = oper->children[0].literal[i] ? 1 : 0; - const GLint b = oper->children[1].literal[i] ? 1 : 0; - oper->literal[i] = (GLfloat) (a || b); - } - oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_BOOL; - return; - case SLANG_OPER_LOGICALXOR: - for (i = 0; i < 4; i++) { - const GLint a = oper->children[0].literal[i] ? 1 : 0; - const GLint b = oper->children[1].literal[i] ? 1 : 0; - oper->literal[i] = (GLfloat) (a ^ b); - } - oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_BOOL; - return; - default: - ; /* nothing */ - } - } - - if (oper->num_children == 4 - && isFloat[0] && isFloat[1] && isFloat[2] && isFloat[3]) { - /* vec4(flt, flt, flt, flt) constructor */ - if (oper->type == SLANG_OPER_CALL) { - if (strcmp((char *) oper->a_id, "vec4") == 0) { - oper->literal[0] = oper->children[0].literal[0]; - oper->literal[1] = oper->children[1].literal[0]; - oper->literal[2] = oper->children[2].literal[0]; - oper->literal[3] = oper->children[3].literal[0]; - oper->literal_size = 4; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; - return; - } - } - } - - if (oper->num_children == 3 && isFloat[0] && isFloat[1] && isFloat[2]) { - /* vec3(flt, flt, flt) constructor */ - if (oper->type == SLANG_OPER_CALL) { - if (strcmp((char *) oper->a_id, "vec3") == 0) { - oper->literal[0] = oper->children[0].literal[0]; - oper->literal[1] = oper->children[1].literal[0]; - oper->literal[2] = oper->children[2].literal[0]; - oper->literal[3] = oper->literal[2]; - oper->literal_size = 3; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; - return; - } - } - } - - if (oper->num_children == 2 && isFloat[0] && isFloat[1]) { - /* vec2(flt, flt) constructor */ - if (oper->type == SLANG_OPER_CALL) { - if (strcmp((char *) oper->a_id, "vec2") == 0) { - oper->literal[0] = oper->children[0].literal[0]; - oper->literal[1] = oper->children[1].literal[0]; - oper->literal[2] = oper->literal[1]; - oper->literal[3] = oper->literal[1]; - oper->literal_size = 2; - slang_operation_destruct(oper); /* XXX oper->locals goes NULL! */ - oper->type = SLANG_OPER_LITERAL_FLOAT; - assert(oper->num_children == 0); - return; - } - } - } - - if (oper->num_children == 1 && isFloat[0]) { - /* vec2/3/4(flt, flt) constructor */ - if (oper->type == SLANG_OPER_CALL) { - const char *func = (const char *) oper->a_id; - if (strncmp(func, "vec", 3) == 0 && func[3] >= '2' && func[3] <= '4') { - oper->literal[0] = - oper->literal[1] = - oper->literal[2] = - oper->literal[3] = oper->children[0].literal[0]; - oper->literal_size = func[3] - '0'; - assert(oper->literal_size >= 2); - assert(oper->literal_size <= 4); - slang_operation_destruct(oper); /* XXX oper->locals goes NULL! */ - oper->type = SLANG_OPER_LITERAL_FLOAT; - assert(oper->num_children == 0); - return; - } - } - } -} - - - -/** - * Insert casts to try to adapt actual parameters to formal parameters for a - * function call when an exact match for the parameter types is not found. - * Example: - * void foo(int i, bool b) {} - * x = foo(3.15, 9); - * Gets translated into: - * x = foo(int(3.15), bool(9)) - */ -GLboolean -_slang_cast_func_params(slang_operation *callOper, const slang_function *fun, - const slang_name_space * space, - slang_atom_pool * atoms, slang_info_log *log) -{ - const GLboolean haveRetValue = _slang_function_has_return_value(fun); - const int numParams = fun->param_count - haveRetValue; - int i; - int dbg = 0; - - if (dbg) - printf("Adapt call of %d args to func %s (%d params)\n", - callOper->num_children, (char*) fun->header.a_name, numParams); - - for (i = 0; i < numParams; i++) { - slang_typeinfo argType; - slang_variable *paramVar = fun->parameters->variables[i]; - - /* Get type of arg[i] */ - if (!slang_typeinfo_construct(&argType)) - return GL_FALSE; - if (!_slang_typeof_operation(&callOper->children[i], space, - &argType, atoms, log)) { - slang_typeinfo_destruct(&argType); - return GL_FALSE; - } - - /* see if arg type matches parameter type */ - if (!slang_type_specifier_equal(&argType.spec, - ¶mVar->type.specifier)) { - /* need to adapt arg type to match param type */ - const char *constructorName = - slang_type_specifier_type_to_string(paramVar->type.specifier.type); - slang_operation *child = slang_operation_new(1); - - if (dbg) - printf("Need to adapt types of arg %d\n", i); - - slang_operation_copy(child, &callOper->children[i]); - child->locals->outer_scope = callOper->children[i].locals; - -#if 0 - if (_slang_sizeof_type_specifier(&argType.spec) > - _slang_sizeof_type_specifier(¶mVar->type.specifier)) { - } -#endif - - callOper->children[i].type = SLANG_OPER_CALL; - callOper->children[i].a_id = slang_atom_pool_atom(atoms, constructorName); - callOper->children[i].num_children = 1; - callOper->children[i].children = child; - } - - slang_typeinfo_destruct(&argType); - } - - if (dbg) { - printf("===== New call to %s with cast arguments ===============\n", - (char*) fun->header.a_name); - slang_print_tree(callOper, 5); - } - - return GL_TRUE; -} - - -/** - * Adapt the arguments for a function call to match the parameters of - * the given function. - * This is for: - * 1. converting/casting argument types to match parameters - * 2. breaking up vector/matrix types into individual components to - * satisfy constructors. - */ -GLboolean -_slang_adapt_call(slang_operation *callOper, const slang_function *fun, - const slang_name_space * space, - slang_atom_pool * atoms, slang_info_log *log) -{ - const GLboolean haveRetValue = _slang_function_has_return_value(fun); - const int numParams = fun->param_count - haveRetValue; - int i; - int dbg = 0; - - if (dbg) - printf("Adapt %d args to %d parameters for %s\n", - callOper->num_children, numParams, (char *) fun->header.a_name); - - /* Only try adapting for constructors */ - if (fun->kind != SLANG_FUNC_CONSTRUCTOR) - return GL_FALSE; - - if (callOper->num_children != numParams) { - /* number of arguments doesn't match number of parameters */ - - /* For constructor calls, we can try to unroll vector/matrix args - * into individual floats/ints and try to match the function params. - */ - for (i = 0; i < numParams; i++) { - slang_typeinfo argType; - GLint argSz, j; - - /* Get type of arg[i] */ - if (!slang_typeinfo_construct(&argType)) - return GL_FALSE; - if (!_slang_typeof_operation(&callOper->children[i], space, - &argType, atoms, log)) { - slang_typeinfo_destruct(&argType); - return GL_FALSE; - } - - /* - paramSz = _slang_sizeof_type_specifier(¶mVar->type.specifier); - assert(paramSz == 1); - */ - argSz = _slang_sizeof_type_specifier(&argType.spec); - if (argSz > 1) { - slang_operation origArg; - /* break up arg[i] into components */ - if (dbg) - printf("Break up arg %d from 1 to %d elements\n", i, argSz); - - slang_operation_construct(&origArg); - slang_operation_copy(&origArg, &callOper->children[i]); - - /* insert argSz-1 new children/args */ - for (j = 0; j < argSz - 1; j++) { - (void) slang_operation_insert(&callOper->num_children, - &callOper->children, i); - } - - /* replace arg[i+j] with subscript/index oper */ - for (j = 0; j < argSz; j++) { - callOper->children[i + j].type = SLANG_OPER_SUBSCRIPT; - callOper->children[i + j].locals = _slang_variable_scope_new(callOper->locals); - callOper->children[i + j].num_children = 2; - callOper->children[i + j].children = slang_operation_new(2); - slang_operation_copy(&callOper->children[i + j].children[0], - &origArg); - callOper->children[i + j].children[1].type - = SLANG_OPER_LITERAL_INT; - callOper->children[i + j].children[1].literal[0] = (GLfloat) j; - } - } - } - } - - if (callOper->num_children < (GLuint) numParams) { - /* still not enough args for all params */ - return GL_FALSE; - } - else if (callOper->num_children > (GLuint) numParams) { - /* now too many arguments */ - /* just truncate */ - callOper->num_children = (GLuint) numParams; - } - - if (dbg) { - printf("===== New call to %s with adapted arguments ===============\n", - (char*) fun->header.a_name); - slang_print_tree(callOper, 5); - } - - return GL_TRUE; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_simplify.h b/src/libs/mesa/mesa/shader/slang/slang_simplify.h deleted file mode 100644 index 8689c23b1a..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_simplify.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 2005-2008 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 SLANG_SIMPLIFY_H -#define SLANG_SIMPLIFY_H - - -extern GLint -_slang_lookup_constant(const char *name); - - -extern void -_slang_simplify(slang_operation *oper, - const slang_name_space * space, - slang_atom_pool * atoms); - - -extern GLboolean -_slang_cast_func_params(slang_operation *callOper, const slang_function *fun, - const slang_name_space * space, - slang_atom_pool * atoms, slang_info_log *log); - -extern GLboolean -_slang_adapt_call(slang_operation *callOper, const slang_function *fun, - const slang_name_space * space, - slang_atom_pool * atoms, slang_info_log *log); - - -#endif /* SLANG_SIMPLIFY_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_storage.c b/src/libs/mesa/mesa/shader/slang/slang_storage.c deleted file mode 100644 index e8b0fb7747..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_storage.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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. - */ - -/** - * \file slang_storage.c - * slang variable storage - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_storage.h" -#include "slang_mem.h" - -/* slang_storage_array */ - -GLboolean -slang_storage_array_construct(slang_storage_array * arr) -{ - arr->type = SLANG_STORE_AGGREGATE; - arr->aggregate = NULL; - arr->length = 0; - return GL_TRUE; -} - -GLvoid -slang_storage_array_destruct(slang_storage_array * arr) -{ - if (arr->aggregate != NULL) { - slang_storage_aggregate_destruct(arr->aggregate); - _slang_free(arr->aggregate); - } -} - -/* slang_storage_aggregate */ - -GLboolean -slang_storage_aggregate_construct(slang_storage_aggregate * agg) -{ - agg->arrays = NULL; - agg->count = 0; - return GL_TRUE; -} - -GLvoid -slang_storage_aggregate_destruct(slang_storage_aggregate * agg) -{ - GLuint i; - - for (i = 0; i < agg->count; i++) - slang_storage_array_destruct(agg->arrays + i); - _slang_free(agg->arrays); -} - -static slang_storage_array * -slang_storage_aggregate_push_new(slang_storage_aggregate * agg) -{ - slang_storage_array *arr = NULL; - - agg->arrays = (slang_storage_array *) - _slang_realloc(agg->arrays, - agg->count * sizeof(slang_storage_array), - (agg->count + 1) * sizeof(slang_storage_array)); - if (agg->arrays != NULL) { - arr = agg->arrays + agg->count; - if (!slang_storage_array_construct(arr)) - return NULL; - agg->count++; - } - return arr; -} - -/* _slang_aggregate_variable() */ - -static GLboolean -aggregate_vector(slang_storage_aggregate * agg, slang_storage_type basic_type, - GLuint row_count) -{ - slang_storage_array *arr = slang_storage_aggregate_push_new(agg); - if (arr == NULL) - return GL_FALSE; - arr->type = basic_type; - arr->length = row_count; - return GL_TRUE; -} - -static GLboolean -aggregate_matrix(slang_storage_aggregate * agg, slang_storage_type basic_type, - GLuint columns, GLuint rows) -{ - slang_storage_array *arr = slang_storage_aggregate_push_new(agg); - if (arr == NULL) - return GL_FALSE; - arr->type = SLANG_STORE_AGGREGATE; - arr->length = columns; - arr->aggregate = (slang_storage_aggregate *) - _slang_alloc(sizeof(slang_storage_aggregate)); - if (arr->aggregate == NULL) - return GL_FALSE; - if (!slang_storage_aggregate_construct(arr->aggregate)) { - _slang_free(arr->aggregate); - arr->aggregate = NULL; - return GL_FALSE; - } - if (!aggregate_vector(arr->aggregate, basic_type, rows)) - return GL_FALSE; - return GL_TRUE; -} - - -static GLboolean -aggregate_variables(slang_storage_aggregate * agg, - slang_variable_scope * vars, slang_function_scope * funcs, - slang_struct_scope * structs, - slang_variable_scope * globals, - slang_atom_pool * atoms) -{ - GLuint i; - - for (i = 0; i < vars->num_variables; i++) - if (!_slang_aggregate_variable(agg, &vars->variables[i]->type.specifier, - vars->variables[i]->array_len, funcs, - structs, globals, atoms)) - return GL_FALSE; - return GL_TRUE; -} - - -GLboolean -_slang_aggregate_variable(slang_storage_aggregate * agg, - slang_type_specifier * spec, GLuint array_len, - slang_function_scope * funcs, - slang_struct_scope * structs, - slang_variable_scope * vars, - slang_atom_pool * atoms) -{ - switch (spec->type) { - case SLANG_SPEC_BOOL: - return aggregate_vector(agg, SLANG_STORE_BOOL, 1); - case SLANG_SPEC_BVEC2: - return aggregate_vector(agg, SLANG_STORE_BOOL, 2); - case SLANG_SPEC_BVEC3: - return aggregate_vector(agg, SLANG_STORE_BOOL, 3); - case SLANG_SPEC_BVEC4: - return aggregate_vector(agg, SLANG_STORE_BOOL, 4); - case SLANG_SPEC_INT: - return aggregate_vector(agg, SLANG_STORE_INT, 1); - case SLANG_SPEC_IVEC2: - return aggregate_vector(agg, SLANG_STORE_INT, 2); - case SLANG_SPEC_IVEC3: - return aggregate_vector(agg, SLANG_STORE_INT, 3); - case SLANG_SPEC_IVEC4: - return aggregate_vector(agg, SLANG_STORE_INT, 4); - case SLANG_SPEC_FLOAT: - return aggregate_vector(agg, SLANG_STORE_FLOAT, 1); - case SLANG_SPEC_VEC2: - return aggregate_vector(agg, SLANG_STORE_FLOAT, 2); - case SLANG_SPEC_VEC3: - return aggregate_vector(agg, SLANG_STORE_FLOAT, 3); - case SLANG_SPEC_VEC4: - return aggregate_vector(agg, SLANG_STORE_FLOAT, 4); - case SLANG_SPEC_MAT2: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 2, 2); - case SLANG_SPEC_MAT3: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 3, 3); - case SLANG_SPEC_MAT4: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 4, 4); - - case SLANG_SPEC_MAT23: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 2, 3); - case SLANG_SPEC_MAT32: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 3, 2); - case SLANG_SPEC_MAT24: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 2, 4); - case SLANG_SPEC_MAT42: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 4, 2); - case SLANG_SPEC_MAT34: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 3, 4); - case SLANG_SPEC_MAT43: - return aggregate_matrix(agg, SLANG_STORE_FLOAT, 4, 3); - - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return aggregate_vector(agg, SLANG_STORE_INT, 1); - case SLANG_SPEC_STRUCT: - return aggregate_variables(agg, spec->_struct->fields, funcs, structs, - vars, atoms); - case SLANG_SPEC_ARRAY: - { - slang_storage_array *arr; - - arr = slang_storage_aggregate_push_new(agg); - if (arr == NULL) - return GL_FALSE; - arr->type = SLANG_STORE_AGGREGATE; - arr->aggregate = (slang_storage_aggregate *) - _slang_alloc(sizeof(slang_storage_aggregate)); - if (arr->aggregate == NULL) - return GL_FALSE; - if (!slang_storage_aggregate_construct(arr->aggregate)) { - _slang_free(arr->aggregate); - arr->aggregate = NULL; - return GL_FALSE; - } - if (!_slang_aggregate_variable(arr->aggregate, spec->_array, 0, - funcs, structs, vars, atoms)) - return GL_FALSE; - arr->length = array_len; - /* TODO: check if 0 < arr->length <= 65535 */ - } - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -GLuint -_slang_sizeof_type(slang_storage_type type) -{ - if (type == SLANG_STORE_AGGREGATE) - return 0; - if (type == SLANG_STORE_VEC4) - return 4 * sizeof(GLfloat); - return sizeof(GLfloat); -} - - -GLuint -_slang_sizeof_aggregate(const slang_storage_aggregate * agg) -{ - GLuint i, size = 0; - - for (i = 0; i < agg->count; i++) { - slang_storage_array *arr = &agg->arrays[i]; - GLuint element_size; - - if (arr->type == SLANG_STORE_AGGREGATE) - element_size = _slang_sizeof_aggregate(arr->aggregate); - else - element_size = _slang_sizeof_type(arr->type); - size += element_size * arr->length; - } - return size; -} - - -#if 0 -GLboolean -_slang_flatten_aggregate(slang_storage_aggregate * flat, - const slang_storage_aggregate * agg) -{ - GLuint i; - - for (i = 0; i < agg->count; i++) { - GLuint j; - - for (j = 0; j < agg->arrays[i].length; j++) { - if (agg->arrays[i].type == SLANG_STORE_AGGREGATE) { - if (!_slang_flatten_aggregate(flat, agg->arrays[i].aggregate)) - return GL_FALSE; - } - else { - GLuint k, count; - slang_storage_type type; - - if (agg->arrays[i].type == SLANG_STORE_VEC4) { - count = 4; - type = SLANG_STORE_FLOAT; - } - else { - count = 1; - type = agg->arrays[i].type; - } - - for (k = 0; k < count; k++) { - slang_storage_array *arr; - - arr = slang_storage_aggregate_push_new(flat); - if (arr == NULL) - return GL_FALSE; - arr->type = type; - arr->length = 1; - } - } - } - } - return GL_TRUE; -} -#endif diff --git a/src/libs/mesa/mesa/shader/slang/slang_storage.h b/src/libs/mesa/mesa/shader/slang/slang_storage.h deleted file mode 100644 index 1876a36dd6..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_storage.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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 SLANG_STORAGE_H -#define SLANG_STORAGE_H - -#include "slang_compile.h" - - -/* - * Program variable data storage is kept completely transparent to the - * front-end compiler. It is up to the back-end how the data is - * actually allocated. The slang_storage_type enum provides the basic - * information about how the memory is interpreted. This abstract - * piece of memory is called a data slot. A data slot of a particular - * type has a fixed size. - * - * For now, only the three basic types are supported, that is bool, - * int and float. Other built-in types like vector or matrix can - * easily be decomposed into a series of basic types. - * - * If the vec4 module is enabled, 4-component vectors of floats are - * used when possible. 4x4 matrices are constructed of 4 vec4 slots. - */ -typedef enum slang_storage_type_ -{ - /* core */ - SLANG_STORE_AGGREGATE, - SLANG_STORE_BOOL, - SLANG_STORE_INT, - SLANG_STORE_FLOAT, - /* vec4 */ - SLANG_STORE_VEC4 -} slang_storage_type; - - -/** - * The slang_storage_array structure groups data slots of the same - * type into an array. This array has a fixed length. Arrays are - * required to have a size equal to the sum of sizes of its - * elements. They are also required to support indirect - * addressing. That is, if B references first data slot in the array, - * S is the size of the data slot and I is the integral index that is - * not known at compile time, B+I*S references I-th data slot. - * - * This structure is also used to break down built-in data types that - * are not supported directly. Vectors, like vec3, are constructed - * from arrays of their basic types. Matrices are formed of an array - * of column vectors, which are in turn processed as other vectors. - */ -typedef struct slang_storage_array_ -{ - slang_storage_type type; - struct slang_storage_aggregate_ *aggregate; - GLuint length; -} slang_storage_array; - -GLboolean slang_storage_array_construct (slang_storage_array *); -GLvoid slang_storage_array_destruct (slang_storage_array *); - - -/** - * The slang_storage_aggregate structure relaxes the indirect - * addressing requirement for slang_storage_array - * structure. Aggregates are always accessed statically - its member - * addresses are well-known at compile time. For example, user-defined - * types are implemented as aggregates. Aggregates can collect data of - * a different type. - */ -typedef struct slang_storage_aggregate_ -{ - slang_storage_array *arrays; - GLuint count; -} slang_storage_aggregate; - -GLboolean slang_storage_aggregate_construct (slang_storage_aggregate *); -GLvoid slang_storage_aggregate_destruct (slang_storage_aggregate *); - - -extern GLboolean -_slang_aggregate_variable(slang_storage_aggregate *agg, - slang_type_specifier *spec, - GLuint array_len, - slang_function_scope *funcs, - slang_struct_scope *structs, - slang_variable_scope *vars, - slang_atom_pool *atoms); - -/* - * Returns the size (in machine units) of the given storage type. - * It is an error to pass-in SLANG_STORE_AGGREGATE. - * Returns 0 on error. - */ -extern GLuint -_slang_sizeof_type (slang_storage_type); - - -/** - * Returns total size (in machine units) of the given aggregate. - * Returns 0 on error. - */ -extern GLuint -_slang_sizeof_aggregate (const slang_storage_aggregate *); - - -#if 0 -/** - * Converts structured aggregate to a flat one, with arrays of generic - * type being one-element long. Returns GL_TRUE on success. Returns - * GL_FALSE otherwise. - */ -extern GLboolean -_slang_flatten_aggregate (slang_storage_aggregate *, - const slang_storage_aggregate *); - -#endif - -#endif /* SLANG_STORAGE_H */ diff --git a/src/libs/mesa/mesa/shader/slang/slang_typeinfo.c b/src/libs/mesa/mesa/shader/slang/slang_typeinfo.c deleted file mode 100644 index 1ef43f58c0..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_typeinfo.c +++ /dev/null @@ -1,1137 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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. - */ - -/** - * \file slang_typeinfo.c - * slang type info - * \author Michal Krol - */ - -#include "main/imports.h" -#include "shader/prog_instruction.h" -#include "slang_typeinfo.h" -#include "slang_compile.h" -#include "slang_log.h" -#include "slang_mem.h" - - -/** - * Checks if a field selector is a general swizzle (an r-value swizzle - * with replicated components or an l-value swizzle mask) for a - * vector. Returns GL_TRUE if this is the case, is filled with - * swizzle information. Returns GL_FALSE otherwise. - */ -GLboolean -_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz) -{ - GLuint i; - GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE; - - /* init to undefined. - * We rely on undefined/nil values to distinguish between - * regular swizzles and writemasks. - * For example, the swizzle ".xNNN" is the writemask ".x". - * That's different than the swizzle ".xxxx". - */ - for (i = 0; i < 4; i++) - swz->swizzle[i] = SWIZZLE_NIL; - - /* the swizzle can be at most 4-component long */ - swz->num_components = slang_string_length(field); - if (swz->num_components > 4) - return GL_FALSE; - - for (i = 0; i < swz->num_components; i++) { - /* mark which swizzle group is used */ - switch (field[i]) { - case 'x': - case 'y': - case 'z': - case 'w': - xyzw = GL_TRUE; - break; - case 'r': - case 'g': - case 'b': - case 'a': - rgba = GL_TRUE; - break; - case 's': - case 't': - case 'p': - case 'q': - stpq = GL_TRUE; - break; - default: - return GL_FALSE; - } - - /* collect swizzle component */ - switch (field[i]) { - case 'x': - case 'r': - case 's': - swz->swizzle[i] = 0; - break; - case 'y': - case 'g': - case 't': - swz->swizzle[i] = 1; - break; - case 'z': - case 'b': - case 'p': - swz->swizzle[i] = 2; - break; - case 'w': - case 'a': - case 'q': - swz->swizzle[i] = 3; - break; - } - - /* check if the component is valid for given vector's row count */ - if (rows <= swz->swizzle[i]) - return GL_FALSE; - } - - /* only one swizzle group can be used */ - if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq)) - return GL_FALSE; - - return GL_TRUE; -} - - - -/** - * Checks if a general swizzle is an l-value swizzle - these swizzles - * do not have duplicated fields. Returns GL_TRUE if this is a - * swizzle mask. Returns GL_FALSE otherwise - */ -static GLboolean -_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows) -{ - GLuint i, c = 0; - - /* the swizzle may not be longer than the vector dim */ - if (swz->num_components > rows) - return GL_FALSE; - - /* the swizzle components cannot be duplicated */ - for (i = 0; i < swz->num_components; i++) { - if ((c & (1 << swz->swizzle[i])) != 0) - return GL_FALSE; - c |= 1 << swz->swizzle[i]; - } - - return GL_TRUE; -} - - -/** - * Combines (multiplies) two swizzles to form single swizzle. - * Example: "vec.wzyx.yx" --> "vec.zw". - */ -static void -_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left, - const slang_swizzle * right) -{ - GLuint i; - - dst->num_components = right->num_components; - for (i = 0; i < right->num_components; i++) - dst->swizzle[i] = left->swizzle[right->swizzle[i]]; -} - - -typedef struct -{ - const char *name; - slang_type_specifier_type type; -} type_specifier_type_name; - -static const type_specifier_type_name type_specifier_type_names[] = { - {"void", SLANG_SPEC_VOID}, - {"bool", SLANG_SPEC_BOOL}, - {"bvec2", SLANG_SPEC_BVEC2}, - {"bvec3", SLANG_SPEC_BVEC3}, - {"bvec4", SLANG_SPEC_BVEC4}, - {"int", SLANG_SPEC_INT}, - {"ivec2", SLANG_SPEC_IVEC2}, - {"ivec3", SLANG_SPEC_IVEC3}, - {"ivec4", SLANG_SPEC_IVEC4}, - {"float", SLANG_SPEC_FLOAT}, - {"vec2", SLANG_SPEC_VEC2}, - {"vec3", SLANG_SPEC_VEC3}, - {"vec4", SLANG_SPEC_VEC4}, - {"mat2", SLANG_SPEC_MAT2}, - {"mat3", SLANG_SPEC_MAT3}, - {"mat4", SLANG_SPEC_MAT4}, - {"mat2x3", SLANG_SPEC_MAT23}, - {"mat3x2", SLANG_SPEC_MAT32}, - {"mat2x4", SLANG_SPEC_MAT24}, - {"mat4x2", SLANG_SPEC_MAT42}, - {"mat3x4", SLANG_SPEC_MAT34}, - {"mat4x3", SLANG_SPEC_MAT43}, - {"sampler1D", SLANG_SPEC_SAMPLER1D}, - {"sampler2D", SLANG_SPEC_SAMPLER2D}, - {"sampler3D", SLANG_SPEC_SAMPLER3D}, - {"samplerCube", SLANG_SPEC_SAMPLERCUBE}, - {"sampler1DShadow", SLANG_SPEC_SAMPLER1DSHADOW}, - {"sampler2DShadow", SLANG_SPEC_SAMPLER2DSHADOW}, - {"sampler2DRect", SLANG_SPEC_SAMPLER2DRECT}, - {"sampler2DRectShadow", SLANG_SPEC_SAMPLER2DRECTSHADOW}, - {NULL, SLANG_SPEC_VOID} -}; - -slang_type_specifier_type -slang_type_specifier_type_from_string(const char *name) -{ - const type_specifier_type_name *p = type_specifier_type_names; - while (p->name != NULL) { - if (slang_string_compare(p->name, name) == 0) - break; - p++; - } - return p->type; -} - -const char * -slang_type_specifier_type_to_string(slang_type_specifier_type type) -{ - const type_specifier_type_name *p = type_specifier_type_names; - while (p->name != NULL) { - if (p->type == type) - break; - p++; - } - return p->name; -} - -/* slang_fully_specified_type */ - -int -slang_fully_specified_type_construct(slang_fully_specified_type * type) -{ - type->qualifier = SLANG_QUAL_NONE; - slang_type_specifier_ctr(&type->specifier); - return 1; -} - -void -slang_fully_specified_type_destruct(slang_fully_specified_type * type) -{ - slang_type_specifier_dtr(&type->specifier); -} - -int -slang_fully_specified_type_copy(slang_fully_specified_type * x, - const slang_fully_specified_type * y) -{ - slang_fully_specified_type z; - - if (!slang_fully_specified_type_construct(&z)) - return 0; - z.qualifier = y->qualifier; - z.precision = y->precision; - z.variant = y->variant; - z.centroid = y->centroid; - z.array_len = y->array_len; - if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) { - slang_fully_specified_type_destruct(&z); - return 0; - } - slang_fully_specified_type_destruct(x); - *x = z; - return 1; -} - - - -GLvoid -slang_type_specifier_ctr(slang_type_specifier * self) -{ - self->type = SLANG_SPEC_VOID; - self->_struct = NULL; - self->_array = NULL; -} - -GLvoid -slang_type_specifier_dtr(slang_type_specifier * self) -{ - if (self->_struct != NULL) { - slang_struct_destruct(self->_struct); - _slang_free(self->_struct); - } - if (self->_array != NULL) { - slang_type_specifier_dtr(self->_array); - _slang_free(self->_array); - } -} - -slang_type_specifier * -slang_type_specifier_new(slang_type_specifier_type type, - struct slang_struct_ *_struct, - struct slang_type_specifier_ *_array) -{ - slang_type_specifier *spec = - (slang_type_specifier *) _slang_alloc(sizeof(slang_type_specifier)); - if (spec) { - spec->type = type; - spec->_struct = _struct; - spec->_array = _array; - } - return spec; -} - -GLboolean -slang_type_specifier_copy(slang_type_specifier * x, - const slang_type_specifier * y) -{ - slang_type_specifier z; - - slang_type_specifier_ctr(&z); - z.type = y->type; - if (z.type == SLANG_SPEC_STRUCT) { - z._struct = (slang_struct *) _slang_alloc(sizeof(slang_struct)); - if (z._struct == NULL) { - slang_type_specifier_dtr(&z); - return GL_FALSE; - } - if (!slang_struct_construct(z._struct)) { - _slang_free(z._struct); - slang_type_specifier_dtr(&z); - return GL_FALSE; - } - if (!slang_struct_copy(z._struct, y->_struct)) { - slang_type_specifier_dtr(&z); - return GL_FALSE; - } - } - else if (z.type == SLANG_SPEC_ARRAY) { - z._array = (slang_type_specifier *) - _slang_alloc(sizeof(slang_type_specifier)); - if (z._array == NULL) { - slang_type_specifier_dtr(&z); - return GL_FALSE; - } - slang_type_specifier_ctr(z._array); - if (!slang_type_specifier_copy(z._array, y->_array)) { - slang_type_specifier_dtr(&z); - return GL_FALSE; - } - } - slang_type_specifier_dtr(x); - *x = z; - return GL_TRUE; -} - - -/** - * Test if two types are equal. - */ -GLboolean -slang_type_specifier_equal(const slang_type_specifier * x, - const slang_type_specifier * y) -{ - if (x->type != y->type) - return GL_FALSE; - if (x->type == SLANG_SPEC_STRUCT) - return slang_struct_equal(x->_struct, y->_struct); - if (x->type == SLANG_SPEC_ARRAY) - return slang_type_specifier_equal(x->_array, y->_array); - return GL_TRUE; -} - - -/** - * As above, but allow float/int casting. - */ -GLboolean -slang_type_specifier_compatible(const slang_type_specifier * x, - const slang_type_specifier * y) -{ - /* special case: float == int */ - if (x->type == SLANG_SPEC_INT && y->type == SLANG_SPEC_FLOAT) { - return GL_TRUE; - } - /* XXX may need to add bool/int compatibility, etc */ - - if (x->type != y->type) - return GL_FALSE; - if (x->type == SLANG_SPEC_STRUCT) - return slang_struct_equal(x->_struct, y->_struct); - if (x->type == SLANG_SPEC_ARRAY) - return slang_type_specifier_compatible(x->_array, y->_array); - return GL_TRUE; -} - - -GLboolean -slang_typeinfo_construct(slang_typeinfo * ti) -{ - _mesa_bzero(ti, sizeof(*ti)); - slang_type_specifier_ctr(&ti->spec); - ti->array_len = 0; - return GL_TRUE; -} - -GLvoid -slang_typeinfo_destruct(slang_typeinfo * ti) -{ - slang_type_specifier_dtr(&ti->spec); -} - - - -/** - * Determine the return type of a function. - * \param a_name the function name - * \param param function parameters (overloading) - * \param num_params number of parameters to function - * \param space namespace to search - * \param spec returns the type - * \param funFound returns pointer to the function, or NULL if not found. - * \return GL_TRUE for success, GL_FALSE if failure (bad function name) - */ -static GLboolean -_slang_typeof_function(slang_atom a_name, - slang_operation * params, GLuint num_params, - const slang_name_space * space, - slang_type_specifier * spec, - slang_function **funFound, - slang_atom_pool *atoms, slang_info_log *log) -{ - GLboolean error; - - *funFound = _slang_function_locate(space->funcs, a_name, params, - num_params, space, atoms, log, &error); - if (error) - return GL_FALSE; - - if (!*funFound) - return GL_TRUE; /* yes, not false */ - - return slang_type_specifier_copy(spec, &(*funFound)->header.type.specifier); -} - - -/** - * Determine the type of a math function. - * \param name name of the operator, one of +,-,*,/ or unary - - * \param params array of function parameters - * \param num_params number of parameters - * \param space namespace to use - * \param spec returns the function's type - * \param atoms atom pool - * \return GL_TRUE for success, GL_FALSE if failure - */ -static GLboolean -typeof_math_call(const char *name, slang_operation *call, - const slang_name_space * space, - slang_type_specifier * spec, - slang_atom_pool * atoms, - slang_info_log *log) -{ - if (call->fun) { - /* we've previously resolved this function call */ - slang_type_specifier_copy(spec, &call->fun->header.type.specifier); - return GL_TRUE; - } - else { - slang_atom atom; - slang_function *fun; - - /* number of params: */ - assert(call->num_children == 1 || call->num_children == 2); - - atom = slang_atom_pool_atom(atoms, name); - if (!_slang_typeof_function(atom, call->children, call->num_children, - space, spec, &fun, atoms, log)) - return GL_FALSE; - - if (fun) { - /* Save pointer to save time in future */ - call->fun = fun; - return GL_TRUE; - } - return GL_FALSE; - } -} - - -/** - * Determine the return type of an operation. - * \param op the operation node - * \param space the namespace to use - * \param ti the returned type - * \param atoms atom pool - * \return GL_TRUE for success, GL_FALSE if failure - */ -GLboolean -_slang_typeof_operation(slang_operation * op, - const slang_name_space * space, - slang_typeinfo * ti, - slang_atom_pool * atoms, - slang_info_log *log) -{ - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - - switch (op->type) { - case SLANG_OPER_BLOCK_NO_NEW_SCOPE: - case SLANG_OPER_BLOCK_NEW_SCOPE: - case SLANG_OPER_ASM: - case SLANG_OPER_BREAK: - case SLANG_OPER_CONTINUE: - case SLANG_OPER_DISCARD: - case SLANG_OPER_RETURN: - case SLANG_OPER_IF: - case SLANG_OPER_WHILE: - case SLANG_OPER_DO: - case SLANG_OPER_FOR: - case SLANG_OPER_VOID: - ti->spec.type = SLANG_SPEC_VOID; - break; - case SLANG_OPER_EXPRESSION: - case SLANG_OPER_ASSIGN: - case SLANG_OPER_ADDASSIGN: - case SLANG_OPER_SUBASSIGN: - case SLANG_OPER_MULASSIGN: - case SLANG_OPER_DIVASSIGN: - case SLANG_OPER_PREINCREMENT: - case SLANG_OPER_PREDECREMENT: - if (!_slang_typeof_operation(op->children, space, ti, atoms, log)) - return GL_FALSE; - break; - case SLANG_OPER_LITERAL_BOOL: - if (op->literal_size == 1) - ti->spec.type = SLANG_SPEC_BOOL; - else if (op->literal_size == 2) - ti->spec.type = SLANG_SPEC_BVEC2; - else if (op->literal_size == 3) - ti->spec.type = SLANG_SPEC_BVEC3; - else if (op->literal_size == 4) - ti->spec.type = SLANG_SPEC_BVEC4; - else { - _mesa_problem(NULL, - "Unexpected bool literal_size %d in _slang_typeof_operation()", - op->literal_size); - ti->spec.type = SLANG_SPEC_BOOL; - } - break; - case SLANG_OPER_LOGICALOR: - case SLANG_OPER_LOGICALXOR: - case SLANG_OPER_LOGICALAND: - case SLANG_OPER_EQUAL: - case SLANG_OPER_NOTEQUAL: - case SLANG_OPER_LESS: - case SLANG_OPER_GREATER: - case SLANG_OPER_LESSEQUAL: - case SLANG_OPER_GREATEREQUAL: - case SLANG_OPER_NOT: - ti->spec.type = SLANG_SPEC_BOOL; - break; - case SLANG_OPER_LITERAL_INT: - if (op->literal_size == 1) - ti->spec.type = SLANG_SPEC_INT; - else if (op->literal_size == 2) - ti->spec.type = SLANG_SPEC_IVEC2; - else if (op->literal_size == 3) - ti->spec.type = SLANG_SPEC_IVEC3; - else if (op->literal_size == 4) - ti->spec.type = SLANG_SPEC_IVEC4; - else { - _mesa_problem(NULL, - "Unexpected int literal_size %d in _slang_typeof_operation()", - op->literal_size); - ti->spec.type = SLANG_SPEC_INT; - } - break; - case SLANG_OPER_LITERAL_FLOAT: - if (op->literal_size == 1) - ti->spec.type = SLANG_SPEC_FLOAT; - else if (op->literal_size == 2) - ti->spec.type = SLANG_SPEC_VEC2; - else if (op->literal_size == 3) - ti->spec.type = SLANG_SPEC_VEC3; - else if (op->literal_size == 4) - ti->spec.type = SLANG_SPEC_VEC4; - else { - _mesa_problem(NULL, - "Unexpected float literal_size %d in _slang_typeof_operation()", - op->literal_size); - ti->spec.type = SLANG_SPEC_FLOAT; - } - break; - case SLANG_OPER_IDENTIFIER: - case SLANG_OPER_VARIABLE_DECL: - { - slang_variable *var; - var = _slang_variable_locate(op->locals, op->a_id, GL_TRUE); - if (!var) { - slang_info_log_error(log, "undefined variable '%s'", - (char *) op->a_id); - return GL_FALSE; - } - if (!slang_type_specifier_copy(&ti->spec, &var->type.specifier)) { - slang_info_log_memory(log); - return GL_FALSE; - } - ti->can_be_referenced = GL_TRUE; - if (var->type.specifier.type == SLANG_SPEC_ARRAY && - var->type.array_len >= 1) { - /* the datatype is an array, ex: float[3] x; */ - ti->array_len = var->type.array_len; - } - else { - /* the variable is an array, ex: float x[3]; */ - ti->array_len = var->array_len; - } - } - break; - case SLANG_OPER_SEQUENCE: - /* TODO: check [0] and [1] if they match */ - if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) { - return GL_FALSE; - } - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - /*case SLANG_OPER_MODASSIGN: */ - /*case SLANG_OPER_LSHASSIGN: */ - /*case SLANG_OPER_RSHASSIGN: */ - /*case SLANG_OPER_ORASSIGN: */ - /*case SLANG_OPER_XORASSIGN: */ - /*case SLANG_OPER_ANDASSIGN: */ - case SLANG_OPER_SELECT: - /* TODO: check [1] and [2] if they match */ - if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) { - return GL_FALSE; - } - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - /*case SLANG_OPER_BITOR: */ - /*case SLANG_OPER_BITXOR: */ - /*case SLANG_OPER_BITAND: */ - /*case SLANG_OPER_LSHIFT: */ - /*case SLANG_OPER_RSHIFT: */ - case SLANG_OPER_ADD: - assert(op->num_children == 2); - if (!typeof_math_call("+", op, space, &ti->spec, atoms, log)) - return GL_FALSE; - break; - case SLANG_OPER_SUBTRACT: - assert(op->num_children == 2); - if (!typeof_math_call("-", op, space, &ti->spec, atoms, log)) - return GL_FALSE; - break; - case SLANG_OPER_MULTIPLY: - assert(op->num_children == 2); - if (!typeof_math_call("*", op, space, &ti->spec, atoms, log)) - return GL_FALSE; - break; - case SLANG_OPER_DIVIDE: - assert(op->num_children == 2); - if (!typeof_math_call("/", op, space, &ti->spec, atoms, log)) - return GL_FALSE; - break; - /*case SLANG_OPER_MODULUS: */ - case SLANG_OPER_PLUS: - if (!_slang_typeof_operation(op->children, space, ti, atoms, log)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - case SLANG_OPER_MINUS: - assert(op->num_children == 1); - if (!typeof_math_call("-", op, space, &ti->spec, atoms, log)) - return GL_FALSE; - break; - /*case SLANG_OPER_COMPLEMENT: */ - case SLANG_OPER_SUBSCRIPT: - { - slang_typeinfo _ti; - - if (!slang_typeinfo_construct(&_ti)) - return GL_FALSE; - if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) { - slang_typeinfo_destruct(&_ti); - return GL_FALSE; - } - ti->can_be_referenced = _ti.can_be_referenced; - if (_ti.spec.type == SLANG_SPEC_ARRAY) { - if (!slang_type_specifier_copy(&ti->spec, _ti.spec._array)) { - slang_typeinfo_destruct(&_ti); - return GL_FALSE; - } - } - else { - if (!_slang_type_is_vector(_ti.spec.type) - && !_slang_type_is_matrix(_ti.spec.type)) { - slang_typeinfo_destruct(&_ti); - slang_info_log_error(log, "cannot index a non-array type"); - return GL_FALSE; - } - ti->spec.type = _slang_type_base(_ti.spec.type); - } - slang_typeinfo_destruct(&_ti); - } - break; - case SLANG_OPER_CALL: - if (op->array_constructor) { - /* build array typeinfo */ - ti->spec.type = SLANG_SPEC_ARRAY; - ti->spec._array = (slang_type_specifier *) - _slang_alloc(sizeof(slang_type_specifier)); - slang_type_specifier_ctr(ti->spec._array); - - ti->spec._array->type = - slang_type_specifier_type_from_string((char *) op->a_id); - ti->array_len = op->num_children; - } - else if (op->fun) { - /* we've resolved this call before */ - slang_type_specifier_copy(&ti->spec, &op->fun->header.type.specifier); - } - else { - slang_function *fun; - if (!_slang_typeof_function(op->a_id, op->children, op->num_children, - space, &ti->spec, &fun, atoms, log)) - return GL_FALSE; - if (fun) { - /* save result for future use */ - op->fun = fun; - } - else { - slang_struct *s = - slang_struct_scope_find(space->structs, op->a_id, GL_TRUE); - if (s) { - /* struct initializer */ - ti->spec.type = SLANG_SPEC_STRUCT; - ti->spec._struct = - (slang_struct *) _slang_alloc(sizeof(slang_struct)); - if (ti->spec._struct == NULL) - return GL_FALSE; - if (!slang_struct_construct(ti->spec._struct)) { - _slang_free(ti->spec._struct); - ti->spec._struct = NULL; - return GL_FALSE; - } - if (!slang_struct_copy(ti->spec._struct, s)) - return GL_FALSE; - } - else { - /* float, int, vec4, mat3, etc. constructor? */ - const char *name; - slang_type_specifier_type type; - - name = slang_atom_pool_id(atoms, op->a_id); - type = slang_type_specifier_type_from_string(name); - if (type == SLANG_SPEC_VOID) { - slang_info_log_error(log, "undefined function '%s'", name); - return GL_FALSE; - } - ti->spec.type = type; - } - } - } - break; - case SLANG_OPER_METHOD: - /* at this time, GLSL 1.20 only has one method: array.length() - * which returns an integer. - */ - ti->spec.type = SLANG_SPEC_INT; - break; - case SLANG_OPER_FIELD: - { - slang_typeinfo _ti; - - if (!slang_typeinfo_construct(&_ti)) - return GL_FALSE; - if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) { - slang_typeinfo_destruct(&_ti); - return GL_FALSE; - } - if (_ti.spec.type == SLANG_SPEC_STRUCT) { - slang_variable *field; - - field = _slang_variable_locate(_ti.spec._struct->fields, op->a_id, - GL_FALSE); - if (field == NULL) { - slang_typeinfo_destruct(&_ti); - return GL_FALSE; - } - if (!slang_type_specifier_copy(&ti->spec, &field->type.specifier)) { - slang_typeinfo_destruct(&_ti); - return GL_FALSE; - } - ti->can_be_referenced = _ti.can_be_referenced; - } - else { - GLuint rows; - const char *swizzle; - slang_type_specifier_type base; - - /* determine the swizzle of the field expression */ - if (!_slang_type_is_vector(_ti.spec.type)) { - slang_typeinfo_destruct(&_ti); - slang_info_log_error(log, "Can't swizzle scalar expression"); - return GL_FALSE; - } - rows = _slang_type_dim(_ti.spec.type); - swizzle = slang_atom_pool_id(atoms, op->a_id); - if (!_slang_is_swizzle(swizzle, rows, &ti->swz)) { - slang_typeinfo_destruct(&_ti); - slang_info_log_error(log, "bad swizzle '%s'", swizzle); - return GL_FALSE; - } - ti->is_swizzled = GL_TRUE; - ti->can_be_referenced = _ti.can_be_referenced - && _slang_is_swizzle_mask(&ti->swz, rows); - if (_ti.is_swizzled) { - slang_swizzle swz; - - /* swizzle the swizzle */ - _slang_multiply_swizzles(&swz, &_ti.swz, &ti->swz); - ti->swz = swz; - } - base = _slang_type_base(_ti.spec.type); - switch (ti->swz.num_components) { - case 1: - ti->spec.type = base; - break; - case 2: - switch (base) { - case SLANG_SPEC_FLOAT: - ti->spec.type = SLANG_SPEC_VEC2; - break; - case SLANG_SPEC_INT: - ti->spec.type = SLANG_SPEC_IVEC2; - break; - case SLANG_SPEC_BOOL: - ti->spec.type = SLANG_SPEC_BVEC2; - break; - default: - break; - } - break; - case 3: - switch (base) { - case SLANG_SPEC_FLOAT: - ti->spec.type = SLANG_SPEC_VEC3; - break; - case SLANG_SPEC_INT: - ti->spec.type = SLANG_SPEC_IVEC3; - break; - case SLANG_SPEC_BOOL: - ti->spec.type = SLANG_SPEC_BVEC3; - break; - default: - break; - } - break; - case 4: - switch (base) { - case SLANG_SPEC_FLOAT: - ti->spec.type = SLANG_SPEC_VEC4; - break; - case SLANG_SPEC_INT: - ti->spec.type = SLANG_SPEC_IVEC4; - break; - case SLANG_SPEC_BOOL: - ti->spec.type = SLANG_SPEC_BVEC4; - break; - default: - break; - } - break; - default: - break; - } - } - slang_typeinfo_destruct(&_ti); - } - break; - case SLANG_OPER_POSTINCREMENT: - case SLANG_OPER_POSTDECREMENT: - if (!_slang_typeof_operation(op->children, space, ti, atoms, log)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - default: - return GL_FALSE; - } - - return GL_TRUE; -} - - -/** - * Determine if a type is a matrix. - * \return GL_TRUE if is a matrix, GL_FALSE otherwise. - */ -GLboolean -_slang_type_is_matrix(slang_type_specifier_type ty) -{ - switch (ty) { - case SLANG_SPEC_MAT2: - case SLANG_SPEC_MAT3: - case SLANG_SPEC_MAT4: - case SLANG_SPEC_MAT23: - case SLANG_SPEC_MAT32: - case SLANG_SPEC_MAT24: - case SLANG_SPEC_MAT42: - case SLANG_SPEC_MAT34: - case SLANG_SPEC_MAT43: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Determine if a type is a vector. - * \return GL_TRUE if is a vector, GL_FALSE otherwise. - */ -GLboolean -_slang_type_is_vector(slang_type_specifier_type ty) -{ - switch (ty) { - case SLANG_SPEC_VEC2: - case SLANG_SPEC_VEC3: - case SLANG_SPEC_VEC4: - case SLANG_SPEC_IVEC2: - case SLANG_SPEC_IVEC3: - case SLANG_SPEC_IVEC4: - case SLANG_SPEC_BVEC2: - case SLANG_SPEC_BVEC3: - case SLANG_SPEC_BVEC4: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Determine if a type is a float, float vector or float matrix. - * \return GL_TRUE if so, GL_FALSE otherwise - */ -GLboolean -_slang_type_is_float_vec_mat(slang_type_specifier_type ty) -{ - switch (ty) { - case SLANG_SPEC_FLOAT: - case SLANG_SPEC_VEC2: - case SLANG_SPEC_VEC3: - case SLANG_SPEC_VEC4: - case SLANG_SPEC_MAT2: - case SLANG_SPEC_MAT3: - case SLANG_SPEC_MAT4: - case SLANG_SPEC_MAT23: - case SLANG_SPEC_MAT32: - case SLANG_SPEC_MAT24: - case SLANG_SPEC_MAT42: - case SLANG_SPEC_MAT34: - case SLANG_SPEC_MAT43: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Given a vector type, return the type of the vector's elements. - * For a matrix, return the type of the columns. - */ -slang_type_specifier_type -_slang_type_base(slang_type_specifier_type ty) -{ - switch (ty) { - case SLANG_SPEC_FLOAT: - case SLANG_SPEC_VEC2: - case SLANG_SPEC_VEC3: - case SLANG_SPEC_VEC4: - return SLANG_SPEC_FLOAT; - case SLANG_SPEC_INT: - case SLANG_SPEC_IVEC2: - case SLANG_SPEC_IVEC3: - case SLANG_SPEC_IVEC4: - return SLANG_SPEC_INT; - case SLANG_SPEC_BOOL: - case SLANG_SPEC_BVEC2: - case SLANG_SPEC_BVEC3: - case SLANG_SPEC_BVEC4: - return SLANG_SPEC_BOOL; - case SLANG_SPEC_MAT2: - return SLANG_SPEC_VEC2; - case SLANG_SPEC_MAT3: - return SLANG_SPEC_VEC3; - case SLANG_SPEC_MAT4: - return SLANG_SPEC_VEC4; - case SLANG_SPEC_MAT23: - return SLANG_SPEC_VEC3; - case SLANG_SPEC_MAT32: - return SLANG_SPEC_VEC2; - case SLANG_SPEC_MAT24: - return SLANG_SPEC_VEC4; - case SLANG_SPEC_MAT42: - return SLANG_SPEC_VEC2; - case SLANG_SPEC_MAT34: - return SLANG_SPEC_VEC4; - case SLANG_SPEC_MAT43: - return SLANG_SPEC_VEC3; - default: - return SLANG_SPEC_VOID; - } -} - - -/** - * Return the dimensionality of a vector, or for a matrix, return number - * of columns. - */ -GLuint -_slang_type_dim(slang_type_specifier_type ty) -{ - switch (ty) { - case SLANG_SPEC_FLOAT: - case SLANG_SPEC_INT: - case SLANG_SPEC_BOOL: - return 1; - case SLANG_SPEC_VEC2: - case SLANG_SPEC_IVEC2: - case SLANG_SPEC_BVEC2: - case SLANG_SPEC_MAT2: - return 2; - case SLANG_SPEC_VEC3: - case SLANG_SPEC_IVEC3: - case SLANG_SPEC_BVEC3: - case SLANG_SPEC_MAT3: - return 3; - case SLANG_SPEC_VEC4: - case SLANG_SPEC_IVEC4: - case SLANG_SPEC_BVEC4: - case SLANG_SPEC_MAT4: - return 4; - - case SLANG_SPEC_MAT23: - return 2; - case SLANG_SPEC_MAT32: - return 3; - case SLANG_SPEC_MAT24: - return 2; - case SLANG_SPEC_MAT42: - return 4; - case SLANG_SPEC_MAT34: - return 3; - case SLANG_SPEC_MAT43: - return 4; - - default: - return 0; - } -} - - -/** - * Return the GL_* type that corresponds to a SLANG_SPEC_* type. - */ -GLenum -_slang_gltype_from_specifier(const slang_type_specifier *type) -{ - switch (type->type) { - case SLANG_SPEC_BOOL: - return GL_BOOL; - case SLANG_SPEC_BVEC2: - return GL_BOOL_VEC2; - case SLANG_SPEC_BVEC3: - return GL_BOOL_VEC3; - case SLANG_SPEC_BVEC4: - return GL_BOOL_VEC4; - case SLANG_SPEC_INT: - return GL_INT; - case SLANG_SPEC_IVEC2: - return GL_INT_VEC2; - case SLANG_SPEC_IVEC3: - return GL_INT_VEC3; - case SLANG_SPEC_IVEC4: - return GL_INT_VEC4; - case SLANG_SPEC_FLOAT: - return GL_FLOAT; - case SLANG_SPEC_VEC2: - return GL_FLOAT_VEC2; - case SLANG_SPEC_VEC3: - return GL_FLOAT_VEC3; - case SLANG_SPEC_VEC4: - return GL_FLOAT_VEC4; - case SLANG_SPEC_MAT2: - return GL_FLOAT_MAT2; - case SLANG_SPEC_MAT3: - return GL_FLOAT_MAT3; - case SLANG_SPEC_MAT4: - return GL_FLOAT_MAT4; - case SLANG_SPEC_MAT23: - return GL_FLOAT_MAT2x3; - case SLANG_SPEC_MAT32: - return GL_FLOAT_MAT3x2; - case SLANG_SPEC_MAT24: - return GL_FLOAT_MAT2x4; - case SLANG_SPEC_MAT42: - return GL_FLOAT_MAT4x2; - case SLANG_SPEC_MAT34: - return GL_FLOAT_MAT3x4; - case SLANG_SPEC_MAT43: - return GL_FLOAT_MAT4x3; - case SLANG_SPEC_SAMPLER1D: - return GL_SAMPLER_1D; - case SLANG_SPEC_SAMPLER2D: - return GL_SAMPLER_2D; - case SLANG_SPEC_SAMPLER3D: - return GL_SAMPLER_3D; - case SLANG_SPEC_SAMPLERCUBE: - return GL_SAMPLER_CUBE; - case SLANG_SPEC_SAMPLER1DSHADOW: - return GL_SAMPLER_1D_SHADOW; - case SLANG_SPEC_SAMPLER2DSHADOW: - return GL_SAMPLER_2D_SHADOW; - case SLANG_SPEC_SAMPLER2DRECT: - return GL_SAMPLER_2D_RECT_ARB; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return GL_SAMPLER_2D_RECT_SHADOW_ARB; - case SLANG_SPEC_ARRAY: - return _slang_gltype_from_specifier(type->_array); - case SLANG_SPEC_STRUCT: - /* fall-through */ - default: - return GL_NONE; - } -} - diff --git a/src/libs/mesa/mesa/shader/slang/slang_typeinfo.h b/src/libs/mesa/mesa/shader/slang/slang_typeinfo.h deleted file mode 100644 index e6fecd350a..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_typeinfo.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 2005-2006 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 SLANG_TYPEINFO_H -#define SLANG_TYPEINFO_H 1 - -#include "main/imports.h" -#include "main/mtypes.h" -#include "slang_log.h" -#include "slang_utility.h" -#include "slang_vartable.h" - - -struct slang_operation_; - -struct slang_name_space_; - - - -/** - * Holds complete information about vector swizzle - the - * array contains vector component source indices, where 0 is "x", 1 - * is "y", 2 is "z" and 3 is "w". - * Example: "xwz" --> { 3, { 0, 3, 2, not used } }. - */ -typedef struct slang_swizzle_ -{ - GLuint num_components; - GLuint swizzle[4]; -} slang_swizzle; - -extern GLboolean -_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz); - - -typedef enum slang_type_variant_ -{ - SLANG_VARIANT, /* the default */ - SLANG_INVARIANT /* indicates the "invariant" keyword */ -} slang_type_variant; - - -typedef enum slang_type_centroid_ -{ - SLANG_CENTER, /* the default */ - SLANG_CENTROID /* indicates the "centroid" keyword */ -} slang_type_centroid; - - -typedef enum slang_type_qualifier_ -{ - SLANG_QUAL_NONE, - SLANG_QUAL_CONST, - SLANG_QUAL_ATTRIBUTE, - SLANG_QUAL_VARYING, - SLANG_QUAL_UNIFORM, - SLANG_QUAL_OUT, - SLANG_QUAL_INOUT, - SLANG_QUAL_FIXEDOUTPUT, /* internal */ - SLANG_QUAL_FIXEDINPUT /* internal */ -} slang_type_qualifier; - - -typedef enum slang_type_precision_ -{ - SLANG_PREC_DEFAULT, - SLANG_PREC_LOW, - SLANG_PREC_MEDIUM, - SLANG_PREC_HIGH -} slang_type_precision; - - -/** - * The basic shading language types (float, vec4, mat3, etc) - */ -typedef enum slang_type_specifier_type_ -{ - SLANG_SPEC_VOID, - SLANG_SPEC_BOOL, - SLANG_SPEC_BVEC2, - SLANG_SPEC_BVEC3, - SLANG_SPEC_BVEC4, - SLANG_SPEC_INT, - SLANG_SPEC_IVEC2, - SLANG_SPEC_IVEC3, - SLANG_SPEC_IVEC4, - SLANG_SPEC_FLOAT, - SLANG_SPEC_VEC2, - SLANG_SPEC_VEC3, - SLANG_SPEC_VEC4, - SLANG_SPEC_MAT2, - SLANG_SPEC_MAT3, - SLANG_SPEC_MAT4, - SLANG_SPEC_MAT23, - SLANG_SPEC_MAT32, - SLANG_SPEC_MAT24, - SLANG_SPEC_MAT42, - SLANG_SPEC_MAT34, - SLANG_SPEC_MAT43, - SLANG_SPEC_SAMPLER1D, - SLANG_SPEC_SAMPLER2D, - SLANG_SPEC_SAMPLER3D, - SLANG_SPEC_SAMPLERCUBE, - SLANG_SPEC_SAMPLER2DRECT, - SLANG_SPEC_SAMPLER1DSHADOW, - SLANG_SPEC_SAMPLER2DSHADOW, - SLANG_SPEC_SAMPLER2DRECTSHADOW, - SLANG_SPEC_STRUCT, - SLANG_SPEC_ARRAY -} slang_type_specifier_type; - - -extern slang_type_specifier_type -slang_type_specifier_type_from_string(const char *); - -extern const char * -slang_type_specifier_type_to_string(slang_type_specifier_type); - - -/** - * Describes more sophisticated types, like structs and arrays. - */ -typedef struct slang_type_specifier_ -{ - slang_type_specifier_type type; - struct slang_struct_ *_struct; /**< if type == SLANG_SPEC_STRUCT */ - struct slang_type_specifier_ *_array; /**< if type == SLANG_SPEC_ARRAY */ -} slang_type_specifier; - - -extern GLvoid -slang_type_specifier_ctr(slang_type_specifier *); - -extern GLvoid -slang_type_specifier_dtr(slang_type_specifier *); - -extern slang_type_specifier * -slang_type_specifier_new(slang_type_specifier_type type, - struct slang_struct_ *_struct, - struct slang_type_specifier_ *_array); - - -extern GLboolean -slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *); - -extern GLboolean -slang_type_specifier_equal(const slang_type_specifier *, - const slang_type_specifier *); - - -extern GLboolean -slang_type_specifier_compatible(const slang_type_specifier * x, - const slang_type_specifier * y); - - -typedef struct slang_fully_specified_type_ -{ - slang_type_qualifier qualifier; - slang_type_specifier specifier; - slang_type_precision precision; - slang_type_variant variant; - slang_type_centroid centroid; - GLint array_len; /**< -1 if not an array type */ -} slang_fully_specified_type; - -extern int -slang_fully_specified_type_construct(slang_fully_specified_type *); - -extern void -slang_fully_specified_type_destruct(slang_fully_specified_type *); - -extern int -slang_fully_specified_type_copy(slang_fully_specified_type *, - const slang_fully_specified_type *); - - - -typedef struct slang_typeinfo_ -{ - GLboolean can_be_referenced; - GLboolean is_swizzled; - slang_swizzle swz; - slang_type_specifier spec; - GLuint array_len; -} slang_typeinfo; - -extern GLboolean -slang_typeinfo_construct(slang_typeinfo *); - -extern GLvoid -slang_typeinfo_destruct(slang_typeinfo *); - - -extern GLboolean -_slang_typeof_operation(struct slang_operation_ *, - const struct slang_name_space_ *, - slang_typeinfo *, slang_atom_pool *, - slang_info_log *log); - -extern GLboolean -_slang_type_is_matrix(slang_type_specifier_type); - -extern GLboolean -_slang_type_is_vector(slang_type_specifier_type); - -extern GLboolean -_slang_type_is_float_vec_mat(slang_type_specifier_type); - -extern slang_type_specifier_type -_slang_type_base(slang_type_specifier_type); - -extern GLuint -_slang_type_dim(slang_type_specifier_type); - -extern GLenum -_slang_gltype_from_specifier(const slang_type_specifier *type); - -#endif diff --git a/src/libs/mesa/mesa/shader/slang/slang_utility.c b/src/libs/mesa/mesa/shader/slang/slang_utility.c deleted file mode 100644 index 3631e32b3c..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_utility.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/** - * \file slang_utility.c - * slang utilities - * \author Michal Krol - */ - -#include "main/imports.h" -#include "slang_utility.h" -#include "slang_mem.h" - -char * -slang_string_concat (char *dst, const char *src) -{ - return _mesa_strcpy (dst + _mesa_strlen (dst), src); -} - - -/* slang_string */ - -GLvoid -slang_string_init (slang_string *self) -{ - self->data = NULL; - self->capacity = 0; - self->length = 0; - self->fail = GL_FALSE; -} - -GLvoid -slang_string_free (slang_string *self) -{ - if (self->data != NULL) - _mesa_free (self->data); -} - -GLvoid -slang_string_reset (slang_string *self) -{ - self->length = 0; - self->fail = GL_FALSE; -} - -static GLboolean -grow (slang_string *self, GLuint size) -{ - if (self->fail) - return GL_FALSE; - if (size > self->capacity) { - /* do not overflow 32-bit range */ - assert (size < 0x80000000); - - self->data = (char *) (_mesa_realloc (self->data, self->capacity, size * 2)); - self->capacity = size * 2; - if (self->data == NULL) { - self->capacity = 0; - self->fail = GL_TRUE; - return GL_FALSE; - } - } - return GL_TRUE; -} - -GLvoid -slang_string_push (slang_string *self, const slang_string *str) -{ - if (str->fail) { - self->fail = GL_TRUE; - return; - } - if (grow (self, self->length + str->length)) { - _mesa_memcpy (&self->data[self->length], str->data, str->length); - self->length += str->length; - } -} - -GLvoid -slang_string_pushc (slang_string *self, const char c) -{ - if (grow (self, self->length + 1)) { - self->data[self->length] = c; - self->length++; - } -} - -GLvoid -slang_string_pushs (slang_string *self, const char *cstr, GLuint len) -{ - if (grow (self, self->length + len)) { - _mesa_memcpy (&self->data[self->length], cstr, len); - self->length += len; - } -} - -GLvoid -slang_string_pushi (slang_string *self, GLint i) -{ - char buffer[12]; - - _mesa_sprintf (buffer, "%d", i); - slang_string_pushs (self, buffer, strlen (buffer)); -} - -const char * -slang_string_cstr (slang_string *self) -{ - if (grow (self, self->length + 1)) - self->data[self->length] = '\0'; - return self->data; -} - -/* slang_atom_pool */ - -void -slang_atom_pool_construct(slang_atom_pool * pool) -{ - GLuint i; - - for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) - pool->entries[i] = NULL; -} - -void -slang_atom_pool_destruct (slang_atom_pool * pool) -{ - GLuint i; - - for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) { - slang_atom_entry * entry; - - entry = pool->entries[i]; - while (entry != NULL) { - slang_atom_entry *next = entry->next; - _slang_free(entry->id); - _slang_free(entry); - entry = next; - } - } -} - -/* - * Search the atom pool for an atom with a given name. - * If atom is not found, create and add it to the pool. - * Returns ATOM_NULL if the atom was not found and the function failed - * to create a new atom. - */ -slang_atom -slang_atom_pool_atom(slang_atom_pool * pool, const char * id) -{ - GLuint hash; - const char * p = id; - slang_atom_entry ** entry; - - /* Hash a given string to a number in the range [0, ATOM_POOL_SIZE). */ - hash = 0; - while (*p != '\0') { - GLuint g; - - hash = (hash << 4) + (GLuint) (*p++); - g = hash & 0xf0000000; - if (g != 0) - hash ^= g >> 24; - hash &= ~g; - } - hash %= SLANG_ATOM_POOL_SIZE; - - /* Now the hash points to a linked list of atoms with names that - * have the same hash value. Search the linked list for a given - * name. - */ - entry = &pool->entries[hash]; - while (*entry != NULL) { - /* If the same, return the associated atom. */ - if (slang_string_compare((**entry).id, id) == 0) - return (slang_atom) (**entry).id; - /* Grab the next atom in the linked list. */ - entry = &(**entry).next; - } - - /* Okay, we have not found an atom. Create a new entry for it. - * Note that the points to the last entry's field. - */ - *entry = (slang_atom_entry *) _slang_alloc(sizeof(slang_atom_entry)); - if (*entry == NULL) - return SLANG_ATOM_NULL; - - /* Initialize a new entry. Because we'll need the actual name of - * the atom, we use the pointer to this string as an actual atom's - * value. - */ - (**entry).next = NULL; - (**entry).id = _slang_strdup(id); - if ((**entry).id == NULL) - return SLANG_ATOM_NULL; - return (slang_atom) (**entry).id; -} - -/** - * Return the name of a given atom. - */ -const char * -slang_atom_pool_id(slang_atom_pool * pool, slang_atom atom) -{ - return (const char *) (atom); -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_utility.h b/src/libs/mesa/mesa/shader/slang/slang_utility.h deleted file mode 100644 index 032c561810..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_utility.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 SLANG_UTILITY_H -#define SLANG_UTILITY_H - - -/* Compile-time assertions. If the expression is zero, try to declare an - * array of size [-1] to cause compilation error. - */ -#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) - - -#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) -#define slang_string_copy(dst, src) _mesa_strcpy (dst, src) -#define slang_string_length(str) _mesa_strlen (str) - -char *slang_string_concat (char *, const char *); - -/* slang_string */ - -typedef struct -{ - char *data; - GLuint length; - GLuint capacity; - GLboolean fail; -} slang_string; - -GLvoid -slang_string_init (slang_string *); - -GLvoid -slang_string_free (slang_string *); - -GLvoid -slang_string_reset (slang_string *); - -GLvoid -slang_string_push (slang_string *, const slang_string *); - -GLvoid -slang_string_pushc (slang_string *, const char); - -GLvoid -slang_string_pushs (slang_string *, const char *, GLuint); - -GLvoid -slang_string_pushi (slang_string *, GLint); - -const char * -slang_string_cstr (slang_string *); - -/* slang_atom */ - -typedef GLvoid *slang_atom; - -#define SLANG_ATOM_NULL ((slang_atom) 0) - -typedef struct slang_atom_entry_ -{ - char *id; - struct slang_atom_entry_ *next; -} slang_atom_entry; - -#define SLANG_ATOM_POOL_SIZE 1023 - -typedef struct slang_atom_pool_ -{ - slang_atom_entry *entries[SLANG_ATOM_POOL_SIZE]; -} slang_atom_pool; - -GLvoid slang_atom_pool_construct (slang_atom_pool *); -GLvoid slang_atom_pool_destruct (slang_atom_pool *); -slang_atom slang_atom_pool_atom (slang_atom_pool *, const char *); -const char *slang_atom_pool_id (slang_atom_pool *, slang_atom); - - -#endif diff --git a/src/libs/mesa/mesa/shader/slang/slang_vartable.c b/src/libs/mesa/mesa/shader/slang/slang_vartable.c deleted file mode 100644 index a4ebacc093..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_vartable.c +++ /dev/null @@ -1,362 +0,0 @@ - -#include "main/imports.h" -#include "shader/program.h" -#include "shader/prog_print.h" -#include "slang_compile.h" -#include "slang_compile_variable.h" -#include "slang_emit.h" -#include "slang_mem.h" -#include "slang_vartable.h" -#include "slang_ir.h" - - -static int dbg = 0; - - -typedef enum { - FREE, - VAR, - TEMP -} TempState; - - -/** - * Variable/register info for one variable scope. - */ -struct table -{ - int Level; - int NumVars; - slang_variable **Vars; /* array [NumVars] */ - - TempState Temps[MAX_PROGRAM_TEMPS * 4]; /* per-component state */ - int ValSize[MAX_PROGRAM_TEMPS * 4]; /**< For debug only */ - - struct table *Parent; /** Parent scope table */ -}; - - -/** - * A variable table is a stack of tables, one per scope. - */ -struct slang_var_table_ -{ - GLint CurLevel; - GLuint MaxRegisters; - struct table *Top; /**< Table at top of stack */ -}; - - - -slang_var_table * -_slang_new_var_table(GLuint maxRegisters) -{ - slang_var_table *vt - = (slang_var_table *) _slang_alloc(sizeof(slang_var_table)); - if (vt) { - vt->MaxRegisters = maxRegisters; - } - return vt; -} - - -void -_slang_delete_var_table(slang_var_table *vt) -{ - if (vt->Top) { - _mesa_problem(NULL, "non-empty var table in _slang_delete_var_table()"); - return; - } - _slang_free(vt); -} - - - -/** - * Create new table on top of vartable stack. - * Used when we enter a {} block. - */ -void -_slang_push_var_table(slang_var_table *vt) -{ - struct table *t = (struct table *) _slang_alloc(sizeof(struct table)); - if (t) { - t->Level = vt->CurLevel++; - t->Parent = vt->Top; - if (t->Parent) { - /* copy the info indicating which temp regs are in use */ - memcpy(t->Temps, t->Parent->Temps, sizeof(t->Temps)); - memcpy(t->ValSize, t->Parent->ValSize, sizeof(t->ValSize)); - } - vt->Top = t; - if (dbg) printf("Pushing level %d\n", t->Level); - } -} - - -/** - * Pop top entry from variable table. - * Used when we leave a {} block. - */ -void -_slang_pop_var_table(slang_var_table *vt) -{ - struct table *t = vt->Top; - int i; - - if (dbg) printf("Popping level %d\n", t->Level); - - /* free the storage allocated for each variable */ - for (i = 0; i < t->NumVars; i++) { - slang_ir_storage *store = t->Vars[i]->store; - GLint j; - GLuint comp; - if (dbg) printf(" Free var %s, size %d at %d.%s\n", - (char*) t->Vars[i]->a_name, store->Size, - store->Index, - _mesa_swizzle_string(store->Swizzle, 0, 0)); - - if (store->File == PROGRAM_SAMPLER) { - /* samplers have no storage */ - continue; - } - - if (store->Size == 1) - comp = GET_SWZ(store->Swizzle, 0); - else - comp = 0; - - /* store->Index may be -1 if we run out of registers */ - if (store->Index >= 0) { - for (j = 0; j < store->Size; j++) { - assert(t->Temps[store->Index * 4 + j + comp] == VAR); - t->Temps[store->Index * 4 + j + comp] = FREE; - } - } - store->Index = -1; - } - if (t->Parent) { - /* just verify that any remaining allocations in this scope - * were for temps - */ - for (i = 0; i < (int) vt->MaxRegisters * 4; i++) { - if (t->Temps[i] != FREE && t->Parent->Temps[i] == FREE) { - if (dbg) printf(" Free reg %d\n", i/4); - assert(t->Temps[i] == TEMP); - } - } - } - - if (t->Vars) { - _slang_free(t->Vars); - t->Vars = NULL; - } - - vt->Top = t->Parent; - _slang_free(t); - vt->CurLevel--; -} - - -/** - * Add a new variable to the given var/symbol table. - */ -void -_slang_add_variable(slang_var_table *vt, slang_variable *v) -{ - struct table *t; - assert(vt); - t = vt->Top; - assert(t); - if (dbg) printf("Adding var %s, store %p\n", (char *) v->a_name, (void *) v->store); - t->Vars = (slang_variable **) - _slang_realloc(t->Vars, - t->NumVars * sizeof(slang_variable *), - (t->NumVars + 1) * sizeof(slang_variable *)); - t->Vars[t->NumVars] = v; - t->NumVars++; -} - - -/** - * Look for variable by name in given table. - * If not found, Parent table will be searched. - */ -slang_variable * -_slang_find_variable(const slang_var_table *vt, slang_atom name) -{ - struct table *t = vt->Top; - while (1) { - int i; - for (i = 0; i < t->NumVars; i++) { - if (t->Vars[i]->a_name == name) - return t->Vars[i]; - } - if (t->Parent) - t = t->Parent; - else - return NULL; - } -} - - -/** - * Allocation helper. - * \param size var size in floats - * \return position for var, measured in floats - */ -static GLint -alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp) -{ - struct table *t = vt->Top; - /* if size == 1, allocate anywhere, else, pos must be multiple of 4 */ - const GLuint step = (size == 1) ? 1 : 4; - GLuint i, j; - assert(size > 0); /* number of floats */ - - for (i = 0; i <= vt->MaxRegisters * 4 - size; i += step) { - GLuint found = 0; - for (j = 0; j < (GLuint) size; j++) { - assert(i + j < 4 * MAX_PROGRAM_TEMPS); - if (i + j < vt->MaxRegisters * 4 && t->Temps[i + j] == FREE) { - found++; - } - else { - break; - } - } - if (found == size) { - /* found block of size free regs */ - if (size > 1) - assert(i % 4 == 0); - for (j = 0; j < (GLuint) size; j++) { - assert(i + j < 4 * MAX_PROGRAM_TEMPS); - t->Temps[i + j] = isTemp ? TEMP : VAR; - } - assert(i < MAX_PROGRAM_TEMPS * 4); - t->ValSize[i] = size; - return i; - } - } - - /* if we get here, we ran out of registers */ - return -1; -} - - -/** - * Allocate temp register(s) for storing a variable. - * \param size size needed, in floats - * \param swizzle returns swizzle mask for accessing var in register - * \return register allocated, or -1 - */ -GLboolean -_slang_alloc_var(slang_var_table *vt, slang_ir_storage *store) -{ - struct table *t = vt->Top; - int i; - - if (store->File == PROGRAM_SAMPLER) { - /* don't really allocate storage */ - store->Index = 0; - return GL_TRUE; - } - - i = alloc_reg(vt, store->Size, GL_FALSE); - if (i < 0) - return GL_FALSE; - - store->Index = i / 4; - store->Swizzle = _slang_var_swizzle(store->Size, i % 4); - - if (dbg) - printf("Alloc var storage sz %d at %d.%s (level %d) store %p\n", - store->Size, store->Index, - _mesa_swizzle_string(store->Swizzle, 0, 0), - t->Level, - (void*) store); - - return GL_TRUE; -} - - - -/** - * Allocate temp register(s) for storing an unnamed intermediate value. - */ -GLboolean -_slang_alloc_temp(slang_var_table *vt, slang_ir_storage *store) -{ - struct table *t = vt->Top; - const int i = alloc_reg(vt, store->Size, GL_TRUE); - if (i < 0) - return GL_FALSE; - - assert(store->Index < 0); - - store->Index = i / 4; - store->Swizzle = _slang_var_swizzle(store->Size, i % 4); - - if (dbg) printf("Alloc temp sz %d at %d.%s (level %d) store %p\n", - store->Size, store->Index, - _mesa_swizzle_string(store->Swizzle, 0, 0), t->Level, - (void *) store); - - return GL_TRUE; -} - - -void -_slang_free_temp(slang_var_table *vt, slang_ir_storage *store) -{ - struct table *t = vt->Top; - GLuint i; - GLuint r = store->Index; - assert(store->Size > 0); - assert(r >= 0); - assert(r + store->Size <= vt->MaxRegisters * 4); - if (dbg) printf("Free temp sz %d at %d.%s (level %d) store %p\n", - store->Size, r, - _mesa_swizzle_string(store->Swizzle, 0, 0), - t->Level, (void *) store); - if (store->Size == 1) { - const GLuint comp = GET_SWZ(store->Swizzle, 0); - /* we can actually fail some of these assertions because of the - * troublesome IR_SWIZZLE handling. - */ -#if 0 - assert(store->Swizzle == MAKE_SWIZZLE4(comp, comp, comp, comp)); - assert(comp < 4); - assert(t->ValSize[r * 4 + comp] == 1); -#endif - assert(t->Temps[r * 4 + comp] == TEMP); - t->Temps[r * 4 + comp] = FREE; - } - else { - /*assert(store->Swizzle == SWIZZLE_NOOP);*/ - assert(t->ValSize[r*4] == store->Size); - for (i = 0; i < (GLuint) store->Size; i++) { - assert(t->Temps[r * 4 + i] == TEMP); - t->Temps[r * 4 + i] = FREE; - } - } -} - - -GLboolean -_slang_is_temp(const slang_var_table *vt, const slang_ir_storage *store) -{ - struct table *t = vt->Top; - GLuint comp; - assert(store->Index >= 0); - assert(store->Index < (int) vt->MaxRegisters); - if (store->Swizzle == SWIZZLE_NOOP) - comp = 0; - else - comp = GET_SWZ(store->Swizzle, 0); - - if (t->Temps[store->Index * 4 + comp] == TEMP) - return GL_TRUE; - else - return GL_FALSE; -} diff --git a/src/libs/mesa/mesa/shader/slang/slang_vartable.h b/src/libs/mesa/mesa/shader/slang/slang_vartable.h deleted file mode 100644 index 94bcd63f45..0000000000 --- a/src/libs/mesa/mesa/shader/slang/slang_vartable.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef SLANG_VARTABLE_H -#define SLANG_VARTABLE_H - -struct slang_ir_storage_; - -typedef struct slang_var_table_ slang_var_table; - -struct slang_variable_; - -extern slang_var_table * -_slang_new_var_table(GLuint maxRegisters); - -extern void -_slang_delete_var_table(slang_var_table *vt); - -extern void -_slang_push_var_table(slang_var_table *parent); - -extern void -_slang_pop_var_table(slang_var_table *t); - -extern void -_slang_add_variable(slang_var_table *t, struct slang_variable_ *v); - -extern struct slang_variable_ * -_slang_find_variable(const slang_var_table *t, slang_atom name); - -extern GLboolean -_slang_alloc_var(slang_var_table *t, struct slang_ir_storage_ *store); - -extern GLboolean -_slang_alloc_temp(slang_var_table *t, struct slang_ir_storage_ *store); - -extern void -_slang_free_temp(slang_var_table *t, struct slang_ir_storage_ *store); - -extern GLboolean -_slang_is_temp(const slang_var_table *t, const struct slang_ir_storage_ *store); - - -#endif /* SLANG_VARTABLE_H */ diff --git a/src/libs/mesa/mesa/sparc/clip.S b/src/libs/mesa/mesa/sparc/clip.S deleted file mode 100644 index 58c228ed15..0000000000 --- a/src/libs/mesa/mesa/sparc/clip.S +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Clip testing in SPARC assembly - */ - -#if __arch64__ -#define LDPTR ldx -#define V4F_DATA 0x00 -#define V4F_START 0x08 -#define V4F_COUNT 0x10 -#define V4F_STRIDE 0x14 -#define V4F_SIZE 0x18 -#define V4F_FLAGS 0x1c -#else -#define LDPTR ld -#define V4F_DATA 0x00 -#define V4F_START 0x04 -#define V4F_COUNT 0x08 -#define V4F_STRIDE 0x0c -#define V4F_SIZE 0x10 -#define V4F_FLAGS 0x14 -#endif - -#define VEC_SIZE_1 1 -#define VEC_SIZE_2 3 -#define VEC_SIZE_3 7 -#define VEC_SIZE_4 15 - -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) - /* Solaris requires this for 64-bit. */ - .register %g2, #scratch - .register %g3, #scratch - .register %g7, #scratch -#endif - - .text - .align 64 - -one_dot_zero: - .word 0x3f800000 /* 1.0f */ - - /* This trick is shamelessly stolen from the x86 - * Mesa asm. Very clever, and we can do it too - * since we have the necessary add with carry - * instructions on Sparc. - */ -clip_table: - .byte 0, 1, 0, 2, 4, 5, 4, 6 - .byte 0, 1, 0, 2, 8, 9, 8, 10 - .byte 32, 33, 32, 34, 36, 37, 36, 38 - .byte 32, 33, 32, 34, 40, 41, 40, 42 - .byte 0, 1, 0, 2, 4, 5, 4, 6 - .byte 0, 1, 0, 2, 8, 9, 8, 10 - .byte 16, 17, 16, 18, 20, 21, 20, 22 - .byte 16, 17, 16, 18, 24, 25, 24, 26 - .byte 63, 61, 63, 62, 55, 53, 55, 54 - .byte 63, 61, 63, 62, 59, 57, 59, 58 - .byte 47, 45, 47, 46, 39, 37, 39, 38 - .byte 47, 45, 47, 46, 43, 41, 43, 42 - .byte 63, 61, 63, 62, 55, 53, 55, 54 - .byte 63, 61, 63, 62, 59, 57, 59, 58 - .byte 31, 29, 31, 30, 23, 21, 23, 22 - .byte 31, 29, 31, 30, 27, 25, 27, 26 - -/* GLvector4f *clip_vec, GLvector4f *proj_vec, - GLubyte clipMask[], GLubyte *orMask, GLubyte *andMask */ - - .align 64 -__pc_tramp: - retl - nop - - .globl _mesa_sparc_cliptest_points4 -_mesa_sparc_cliptest_points4: - save %sp, -64, %sp - call __pc_tramp - sub %o7, (. - one_dot_zero - 4), %g1 - ld [%g1 + 0x0], %f4 - add %g1, 0x4, %g1 - - ld [%i0 + V4F_STRIDE], %l1 - ld [%i0 + V4F_COUNT], %g7 - LDPTR [%i0 + V4F_START], %i0 - LDPTR [%i1 + V4F_START], %i5 - ldub [%i3], %g2 - ldub [%i4], %g3 - sll %g3, 8, %g3 - or %g2, %g3, %g2 - - ld [%i1 + V4F_FLAGS], %g3 - or %g3, VEC_SIZE_4, %g3 - st %g3, [%i1 + V4F_FLAGS] - mov 3, %g3 - st %g3, [%i1 + V4F_SIZE] - st %g7, [%i1 + V4F_COUNT] - clr %l2 - clr %l0 - - /* l0: i - * g7: count - * l1: stride - * l2: c - * g2: (tmpAndMask << 8) | tmpOrMask - * g1: clip_table - * i0: from[stride][i] - * i2: clipMask - * i5: vProj[4][i] - */ - -1: ld [%i0 + 0x0c], %f3 ! LSU Group - ld [%i0 + 0x0c], %g5 ! LSU Group - ld [%i0 + 0x08], %g4 ! LSU Group - fdivs %f4, %f3, %f8 ! FGM - addcc %g5, %g5, %g5 ! IEU1 Group - addx %g0, 0x0, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - ld [%i0 + 0x04], %g4 ! LSU Group - addx %g3, %g3, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - ld [%i0 + 0x00], %g4 ! LSU Group - addx %g3, %g3, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - ldub [%g1 + %g3], %g3 ! LSU Group - cmp %g3, 0 ! IEU1 Group, stall - be 2f ! CTI - stb %g3, [%i2] ! LSU - sll %g3, 8, %g4 ! IEU1 Group - add %l2, 1, %l2 ! IEU0 - st %g0, [%i5 + 0x00] ! LSU - or %g4, 0xff, %g4 ! IEU0 Group - or %g2, %g3, %g2 ! IEU1 - st %g0, [%i5 + 0x04] ! LSU - and %g2, %g4, %g2 ! IEU0 Group - st %g0, [%i5 + 0x08] ! LSU - b 3f ! CTI - st %f4, [%i5 + 0x0c] ! LSU Group -2: ld [%i0 + 0x00], %f0 ! LSU Group - ld [%i0 + 0x04], %f1 ! LSU Group - ld [%i0 + 0x08], %f2 ! LSU Group - fmuls %f0, %f8, %f0 ! FGM - st %f0, [%i5 + 0x00] ! LSU Group - fmuls %f1, %f8, %f1 ! FGM - st %f1, [%i5 + 0x04] ! LSU Group - fmuls %f2, %f8, %f2 ! FGM - st %f2, [%i5 + 0x08] ! LSU Group - st %f8, [%i5 + 0x0c] ! LSU Group -3: add %i5, 0x10, %i5 ! IEU1 - add %l0, 1, %l0 ! IEU0 Group - add %i2, 1, %i2 ! IEU0 Group - cmp %l0, %g7 ! IEU1 Group - bne 1b ! CTI - add %i0, %l1, %i0 ! IEU0 Group - stb %g2, [%i3] ! LSU - srl %g2, 8, %g3 ! IEU0 Group - cmp %l2, %g7 ! IEU1 Group - bl,a 1f ! CTI - clr %g3 ! IEU0 -1: stb %g3, [%i4] ! LSU Group - ret ! CTI Group - restore %i1, 0x0, %o0 - - .globl _mesa_sparc_cliptest_points4_np -_mesa_sparc_cliptest_points4_np: - save %sp, -64, %sp - - call __pc_tramp - sub %o7, (. - one_dot_zero - 4), %g1 - add %g1, 0x4, %g1 - - ld [%i0 + V4F_STRIDE], %l1 - ld [%i0 + V4F_COUNT], %g7 - LDPTR [%i0 + V4F_START], %i0 - LDPTR [%i1 + V4F_START], %i5 - ldub [%i3], %g2 - ldub [%i4], %g3 - sll %g3, 8, %g3 - or %g2, %g3, %g2 - - ld [%i1 + V4F_FLAGS], %g3 - or %g3, VEC_SIZE_4, %g3 - st %g3, [%i1 + V4F_FLAGS] - mov 3, %g3 - st %g3, [%i1 + V4F_SIZE] - st %g7, [%i1 + V4F_COUNT] - clr %l2 - clr %l0 - - /* l0: i - * g7: count - * l1: stride - * l2: c - * g2: (tmpAndMask << 8) | tmpOrMask - * g1: clip_table - * i0: from[stride][i] - * i2: clipMask - */ - -1: ld [%i0 + 0x0c], %g5 ! LSU Group - ld [%i0 + 0x08], %g4 ! LSU Group - addcc %g5, %g5, %g5 ! IEU1 Group - addx %g0, 0x0, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - ld [%i0 + 0x04], %g4 ! LSU Group - addx %g3, %g3, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - ld [%i0 + 0x00], %g4 ! LSU Group - addx %g3, %g3, %g3 ! IEU1 Group - addcc %g4, %g4, %g4 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - subcc %g5, %g4, %g0 ! IEU1 Group - addx %g3, %g3, %g3 ! IEU1 Group - ldub [%g1 + %g3], %g3 ! LSU Group - cmp %g3, 0 ! IEU1 Group, stall - be 2f ! CTI - stb %g3, [%i2] ! LSU - sll %g3, 8, %g4 ! IEU1 Group - add %l2, 1, %l2 ! IEU0 - or %g4, 0xff, %g4 ! IEU0 Group - or %g2, %g3, %g2 ! IEU1 - and %g2, %g4, %g2 ! IEU0 Group -2: add %l0, 1, %l0 ! IEU0 Group - add %i2, 1, %i2 ! IEU0 Group - cmp %l0, %g7 ! IEU1 Group - bne 1b ! CTI - add %i0, %l1, %i0 ! IEU0 Group - stb %g2, [%i3] ! LSU - srl %g2, 8, %g3 ! IEU0 Group - cmp %l2, %g7 ! IEU1 Group - bl,a 1f ! CTI - clr %g3 ! IEU0 -1: stb %g3, [%i4] ! LSU Group - ret ! CTI Group - restore %i1, 0x0, %o0 diff --git a/src/libs/mesa/mesa/sparc/glapi_sparc.S b/src/libs/mesa/mesa/sparc/glapi_sparc.S deleted file mode 100644 index 3d1d55fd76..0000000000 --- a/src/libs/mesa/mesa/sparc/glapi_sparc.S +++ /dev/null @@ -1,1868 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_SPARC_asm.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "glapioffsets.h" - -#ifdef __arch64__ -# define GL_STUB(fn,off) \ -fn: \ - sethi %hi(0xDEADBEEF), %g4 ; \ - sethi %hi(0xDEADBEEF), %g1 ; \ - or %g4, %lo(0xDEADBEEF), %g4 ; \ - or %g1, %lo(0xDEADBEEF), %g1 ; \ - sllx %g4, 32, %g4 ; \ - ldx [%g1 + %g4], %g1 ; \ - sethi %hi(8 * off), %g4 ; \ - or %g4, %lo(8 * off), %g4 ; \ - ldx [%g1 + %g4], %g5 ; \ - jmpl %g5, %g0 ; \ - nop -#else -# define GL_STUB(fn,off) \ -fn: \ - sethi %hi(0xDEADBEEF), %g1 ; \ - ld [%g1 + %lo(0xDEADBEEF)], %g1 ; \ - ld [%g1 + (4 * off)], %g5 ; \ - jmpl %g5, %g0 ; \ - nop -#endif - -#define GL_STUB_ALIAS(fn,alias) fn = alias - -.text -.align 32 - .globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function -__glapi_sparc_icache_flush: /* %o0 = insn_addr */ - flush %o0 - retl - nop - -.data -.align 64 - - .globl glNewList ; .type glNewList,#function - .globl glEndList ; .type glEndList,#function - .globl glCallList ; .type glCallList,#function - .globl glCallLists ; .type glCallLists,#function - .globl glDeleteLists ; .type glDeleteLists,#function - .globl glGenLists ; .type glGenLists,#function - .globl glListBase ; .type glListBase,#function - .globl glBegin ; .type glBegin,#function - .globl glBitmap ; .type glBitmap,#function - .globl glColor3b ; .type glColor3b,#function - .globl glColor3bv ; .type glColor3bv,#function - .globl glColor3d ; .type glColor3d,#function - .globl glColor3dv ; .type glColor3dv,#function - .globl glColor3f ; .type glColor3f,#function - .globl glColor3fv ; .type glColor3fv,#function - .globl glColor3i ; .type glColor3i,#function - .globl glColor3iv ; .type glColor3iv,#function - .globl glColor3s ; .type glColor3s,#function - .globl glColor3sv ; .type glColor3sv,#function - .globl glColor3ub ; .type glColor3ub,#function - .globl glColor3ubv ; .type glColor3ubv,#function - .globl glColor3ui ; .type glColor3ui,#function - .globl glColor3uiv ; .type glColor3uiv,#function - .globl glColor3us ; .type glColor3us,#function - .globl glColor3usv ; .type glColor3usv,#function - .globl glColor4b ; .type glColor4b,#function - .globl glColor4bv ; .type glColor4bv,#function - .globl glColor4d ; .type glColor4d,#function - .globl glColor4dv ; .type glColor4dv,#function - .globl glColor4f ; .type glColor4f,#function - .globl glColor4fv ; .type glColor4fv,#function - .globl glColor4i ; .type glColor4i,#function - .globl glColor4iv ; .type glColor4iv,#function - .globl glColor4s ; .type glColor4s,#function - .globl glColor4sv ; .type glColor4sv,#function - .globl glColor4ub ; .type glColor4ub,#function - .globl glColor4ubv ; .type glColor4ubv,#function - .globl glColor4ui ; .type glColor4ui,#function - .globl glColor4uiv ; .type glColor4uiv,#function - .globl glColor4us ; .type glColor4us,#function - .globl glColor4usv ; .type glColor4usv,#function - .globl glEdgeFlag ; .type glEdgeFlag,#function - .globl glEdgeFlagv ; .type glEdgeFlagv,#function - .globl glEnd ; .type glEnd,#function - .globl glIndexd ; .type glIndexd,#function - .globl glIndexdv ; .type glIndexdv,#function - .globl glIndexf ; .type glIndexf,#function - .globl glIndexfv ; .type glIndexfv,#function - .globl glIndexi ; .type glIndexi,#function - .globl glIndexiv ; .type glIndexiv,#function - .globl glIndexs ; .type glIndexs,#function - .globl glIndexsv ; .type glIndexsv,#function - .globl glNormal3b ; .type glNormal3b,#function - .globl glNormal3bv ; .type glNormal3bv,#function - .globl glNormal3d ; .type glNormal3d,#function - .globl glNormal3dv ; .type glNormal3dv,#function - .globl glNormal3f ; .type glNormal3f,#function - .globl glNormal3fv ; .type glNormal3fv,#function - .globl glNormal3i ; .type glNormal3i,#function - .globl glNormal3iv ; .type glNormal3iv,#function - .globl glNormal3s ; .type glNormal3s,#function - .globl glNormal3sv ; .type glNormal3sv,#function - .globl glRasterPos2d ; .type glRasterPos2d,#function - .globl glRasterPos2dv ; .type glRasterPos2dv,#function - .globl glRasterPos2f ; .type glRasterPos2f,#function - .globl glRasterPos2fv ; .type glRasterPos2fv,#function - .globl glRasterPos2i ; .type glRasterPos2i,#function - .globl glRasterPos2iv ; .type glRasterPos2iv,#function - .globl glRasterPos2s ; .type glRasterPos2s,#function - .globl glRasterPos2sv ; .type glRasterPos2sv,#function - .globl glRasterPos3d ; .type glRasterPos3d,#function - .globl glRasterPos3dv ; .type glRasterPos3dv,#function - .globl glRasterPos3f ; .type glRasterPos3f,#function - .globl glRasterPos3fv ; .type glRasterPos3fv,#function - .globl glRasterPos3i ; .type glRasterPos3i,#function - .globl glRasterPos3iv ; .type glRasterPos3iv,#function - .globl glRasterPos3s ; .type glRasterPos3s,#function - .globl glRasterPos3sv ; .type glRasterPos3sv,#function - .globl glRasterPos4d ; .type glRasterPos4d,#function - .globl glRasterPos4dv ; .type glRasterPos4dv,#function - .globl glRasterPos4f ; .type glRasterPos4f,#function - .globl glRasterPos4fv ; .type glRasterPos4fv,#function - .globl glRasterPos4i ; .type glRasterPos4i,#function - .globl glRasterPos4iv ; .type glRasterPos4iv,#function - .globl glRasterPos4s ; .type glRasterPos4s,#function - .globl glRasterPos4sv ; .type glRasterPos4sv,#function - .globl glRectd ; .type glRectd,#function - .globl glRectdv ; .type glRectdv,#function - .globl glRectf ; .type glRectf,#function - .globl glRectfv ; .type glRectfv,#function - .globl glRecti ; .type glRecti,#function - .globl glRectiv ; .type glRectiv,#function - .globl glRects ; .type glRects,#function - .globl glRectsv ; .type glRectsv,#function - .globl glTexCoord1d ; .type glTexCoord1d,#function - .globl glTexCoord1dv ; .type glTexCoord1dv,#function - .globl glTexCoord1f ; .type glTexCoord1f,#function - .globl glTexCoord1fv ; .type glTexCoord1fv,#function - .globl glTexCoord1i ; .type glTexCoord1i,#function - .globl glTexCoord1iv ; .type glTexCoord1iv,#function - .globl glTexCoord1s ; .type glTexCoord1s,#function - .globl glTexCoord1sv ; .type glTexCoord1sv,#function - .globl glTexCoord2d ; .type glTexCoord2d,#function - .globl glTexCoord2dv ; .type glTexCoord2dv,#function - .globl glTexCoord2f ; .type glTexCoord2f,#function - .globl glTexCoord2fv ; .type glTexCoord2fv,#function - .globl glTexCoord2i ; .type glTexCoord2i,#function - .globl glTexCoord2iv ; .type glTexCoord2iv,#function - .globl glTexCoord2s ; .type glTexCoord2s,#function - .globl glTexCoord2sv ; .type glTexCoord2sv,#function - .globl glTexCoord3d ; .type glTexCoord3d,#function - .globl glTexCoord3dv ; .type glTexCoord3dv,#function - .globl glTexCoord3f ; .type glTexCoord3f,#function - .globl glTexCoord3fv ; .type glTexCoord3fv,#function - .globl glTexCoord3i ; .type glTexCoord3i,#function - .globl glTexCoord3iv ; .type glTexCoord3iv,#function - .globl glTexCoord3s ; .type glTexCoord3s,#function - .globl glTexCoord3sv ; .type glTexCoord3sv,#function - .globl glTexCoord4d ; .type glTexCoord4d,#function - .globl glTexCoord4dv ; .type glTexCoord4dv,#function - .globl glTexCoord4f ; .type glTexCoord4f,#function - .globl glTexCoord4fv ; .type glTexCoord4fv,#function - .globl glTexCoord4i ; .type glTexCoord4i,#function - .globl glTexCoord4iv ; .type glTexCoord4iv,#function - .globl glTexCoord4s ; .type glTexCoord4s,#function - .globl glTexCoord4sv ; .type glTexCoord4sv,#function - .globl glVertex2d ; .type glVertex2d,#function - .globl glVertex2dv ; .type glVertex2dv,#function - .globl glVertex2f ; .type glVertex2f,#function - .globl glVertex2fv ; .type glVertex2fv,#function - .globl glVertex2i ; .type glVertex2i,#function - .globl glVertex2iv ; .type glVertex2iv,#function - .globl glVertex2s ; .type glVertex2s,#function - .globl glVertex2sv ; .type glVertex2sv,#function - .globl glVertex3d ; .type glVertex3d,#function - .globl glVertex3dv ; .type glVertex3dv,#function - .globl glVertex3f ; .type glVertex3f,#function - .globl glVertex3fv ; .type glVertex3fv,#function - .globl glVertex3i ; .type glVertex3i,#function - .globl glVertex3iv ; .type glVertex3iv,#function - .globl glVertex3s ; .type glVertex3s,#function - .globl glVertex3sv ; .type glVertex3sv,#function - .globl glVertex4d ; .type glVertex4d,#function - .globl glVertex4dv ; .type glVertex4dv,#function - .globl glVertex4f ; .type glVertex4f,#function - .globl glVertex4fv ; .type glVertex4fv,#function - .globl glVertex4i ; .type glVertex4i,#function - .globl glVertex4iv ; .type glVertex4iv,#function - .globl glVertex4s ; .type glVertex4s,#function - .globl glVertex4sv ; .type glVertex4sv,#function - .globl glClipPlane ; .type glClipPlane,#function - .globl glColorMaterial ; .type glColorMaterial,#function - .globl glCullFace ; .type glCullFace,#function - .globl glFogf ; .type glFogf,#function - .globl glFogfv ; .type glFogfv,#function - .globl glFogi ; .type glFogi,#function - .globl glFogiv ; .type glFogiv,#function - .globl glFrontFace ; .type glFrontFace,#function - .globl glHint ; .type glHint,#function - .globl glLightf ; .type glLightf,#function - .globl glLightfv ; .type glLightfv,#function - .globl glLighti ; .type glLighti,#function - .globl glLightiv ; .type glLightiv,#function - .globl glLightModelf ; .type glLightModelf,#function - .globl glLightModelfv ; .type glLightModelfv,#function - .globl glLightModeli ; .type glLightModeli,#function - .globl glLightModeliv ; .type glLightModeliv,#function - .globl glLineStipple ; .type glLineStipple,#function - .globl glLineWidth ; .type glLineWidth,#function - .globl glMaterialf ; .type glMaterialf,#function - .globl glMaterialfv ; .type glMaterialfv,#function - .globl glMateriali ; .type glMateriali,#function - .globl glMaterialiv ; .type glMaterialiv,#function - .globl glPointSize ; .type glPointSize,#function - .globl glPolygonMode ; .type glPolygonMode,#function - .globl glPolygonStipple ; .type glPolygonStipple,#function - .globl glScissor ; .type glScissor,#function - .globl glShadeModel ; .type glShadeModel,#function - .globl glTexParameterf ; .type glTexParameterf,#function - .globl glTexParameterfv ; .type glTexParameterfv,#function - .globl glTexParameteri ; .type glTexParameteri,#function - .globl glTexParameteriv ; .type glTexParameteriv,#function - .globl glTexImage1D ; .type glTexImage1D,#function - .globl glTexImage2D ; .type glTexImage2D,#function - .globl glTexEnvf ; .type glTexEnvf,#function - .globl glTexEnvfv ; .type glTexEnvfv,#function - .globl glTexEnvi ; .type glTexEnvi,#function - .globl glTexEnviv ; .type glTexEnviv,#function - .globl glTexGend ; .type glTexGend,#function - .globl glTexGendv ; .type glTexGendv,#function - .globl glTexGenf ; .type glTexGenf,#function - .globl glTexGenfv ; .type glTexGenfv,#function - .globl glTexGeni ; .type glTexGeni,#function - .globl glTexGeniv ; .type glTexGeniv,#function - .globl glFeedbackBuffer ; .type glFeedbackBuffer,#function - .globl glSelectBuffer ; .type glSelectBuffer,#function - .globl glRenderMode ; .type glRenderMode,#function - .globl glInitNames ; .type glInitNames,#function - .globl glLoadName ; .type glLoadName,#function - .globl glPassThrough ; .type glPassThrough,#function - .globl glPopName ; .type glPopName,#function - .globl glPushName ; .type glPushName,#function - .globl glDrawBuffer ; .type glDrawBuffer,#function - .globl glClear ; .type glClear,#function - .globl glClearAccum ; .type glClearAccum,#function - .globl glClearIndex ; .type glClearIndex,#function - .globl glClearColor ; .type glClearColor,#function - .globl glClearStencil ; .type glClearStencil,#function - .globl glClearDepth ; .type glClearDepth,#function - .globl glStencilMask ; .type glStencilMask,#function - .globl glColorMask ; .type glColorMask,#function - .globl glDepthMask ; .type glDepthMask,#function - .globl glIndexMask ; .type glIndexMask,#function - .globl glAccum ; .type glAccum,#function - .globl glDisable ; .type glDisable,#function - .globl glEnable ; .type glEnable,#function - .globl glFinish ; .type glFinish,#function - .globl glFlush ; .type glFlush,#function - .globl glPopAttrib ; .type glPopAttrib,#function - .globl glPushAttrib ; .type glPushAttrib,#function - .globl glMap1d ; .type glMap1d,#function - .globl glMap1f ; .type glMap1f,#function - .globl glMap2d ; .type glMap2d,#function - .globl glMap2f ; .type glMap2f,#function - .globl glMapGrid1d ; .type glMapGrid1d,#function - .globl glMapGrid1f ; .type glMapGrid1f,#function - .globl glMapGrid2d ; .type glMapGrid2d,#function - .globl glMapGrid2f ; .type glMapGrid2f,#function - .globl glEvalCoord1d ; .type glEvalCoord1d,#function - .globl glEvalCoord1dv ; .type glEvalCoord1dv,#function - .globl glEvalCoord1f ; .type glEvalCoord1f,#function - .globl glEvalCoord1fv ; .type glEvalCoord1fv,#function - .globl glEvalCoord2d ; .type glEvalCoord2d,#function - .globl glEvalCoord2dv ; .type glEvalCoord2dv,#function - .globl glEvalCoord2f ; .type glEvalCoord2f,#function - .globl glEvalCoord2fv ; .type glEvalCoord2fv,#function - .globl glEvalMesh1 ; .type glEvalMesh1,#function - .globl glEvalPoint1 ; .type glEvalPoint1,#function - .globl glEvalMesh2 ; .type glEvalMesh2,#function - .globl glEvalPoint2 ; .type glEvalPoint2,#function - .globl glAlphaFunc ; .type glAlphaFunc,#function - .globl glBlendFunc ; .type glBlendFunc,#function - .globl glLogicOp ; .type glLogicOp,#function - .globl glStencilFunc ; .type glStencilFunc,#function - .globl glStencilOp ; .type glStencilOp,#function - .globl glDepthFunc ; .type glDepthFunc,#function - .globl glPixelZoom ; .type glPixelZoom,#function - .globl glPixelTransferf ; .type glPixelTransferf,#function - .globl glPixelTransferi ; .type glPixelTransferi,#function - .globl glPixelStoref ; .type glPixelStoref,#function - .globl glPixelStorei ; .type glPixelStorei,#function - .globl glPixelMapfv ; .type glPixelMapfv,#function - .globl glPixelMapuiv ; .type glPixelMapuiv,#function - .globl glPixelMapusv ; .type glPixelMapusv,#function - .globl glReadBuffer ; .type glReadBuffer,#function - .globl glCopyPixels ; .type glCopyPixels,#function - .globl glReadPixels ; .type glReadPixels,#function - .globl glDrawPixels ; .type glDrawPixels,#function - .globl glGetBooleanv ; .type glGetBooleanv,#function - .globl glGetClipPlane ; .type glGetClipPlane,#function - .globl glGetDoublev ; .type glGetDoublev,#function - .globl glGetError ; .type glGetError,#function - .globl glGetFloatv ; .type glGetFloatv,#function - .globl glGetIntegerv ; .type glGetIntegerv,#function - .globl glGetLightfv ; .type glGetLightfv,#function - .globl glGetLightiv ; .type glGetLightiv,#function - .globl glGetMapdv ; .type glGetMapdv,#function - .globl glGetMapfv ; .type glGetMapfv,#function - .globl glGetMapiv ; .type glGetMapiv,#function - .globl glGetMaterialfv ; .type glGetMaterialfv,#function - .globl glGetMaterialiv ; .type glGetMaterialiv,#function - .globl glGetPixelMapfv ; .type glGetPixelMapfv,#function - .globl glGetPixelMapuiv ; .type glGetPixelMapuiv,#function - .globl glGetPixelMapusv ; .type glGetPixelMapusv,#function - .globl glGetPolygonStipple ; .type glGetPolygonStipple,#function - .globl glGetString ; .type glGetString,#function - .globl glGetTexEnvfv ; .type glGetTexEnvfv,#function - .globl glGetTexEnviv ; .type glGetTexEnviv,#function - .globl glGetTexGendv ; .type glGetTexGendv,#function - .globl glGetTexGenfv ; .type glGetTexGenfv,#function - .globl glGetTexGeniv ; .type glGetTexGeniv,#function - .globl glGetTexImage ; .type glGetTexImage,#function - .globl glGetTexParameterfv ; .type glGetTexParameterfv,#function - .globl glGetTexParameteriv ; .type glGetTexParameteriv,#function - .globl glGetTexLevelParameterfv ; .type glGetTexLevelParameterfv,#function - .globl glGetTexLevelParameteriv ; .type glGetTexLevelParameteriv,#function - .globl glIsEnabled ; .type glIsEnabled,#function - .globl glIsList ; .type glIsList,#function - .globl glDepthRange ; .type glDepthRange,#function - .globl glFrustum ; .type glFrustum,#function - .globl glLoadIdentity ; .type glLoadIdentity,#function - .globl glLoadMatrixf ; .type glLoadMatrixf,#function - .globl glLoadMatrixd ; .type glLoadMatrixd,#function - .globl glMatrixMode ; .type glMatrixMode,#function - .globl glMultMatrixf ; .type glMultMatrixf,#function - .globl glMultMatrixd ; .type glMultMatrixd,#function - .globl glOrtho ; .type glOrtho,#function - .globl glPopMatrix ; .type glPopMatrix,#function - .globl glPushMatrix ; .type glPushMatrix,#function - .globl glRotated ; .type glRotated,#function - .globl glRotatef ; .type glRotatef,#function - .globl glScaled ; .type glScaled,#function - .globl glScalef ; .type glScalef,#function - .globl glTranslated ; .type glTranslated,#function - .globl glTranslatef ; .type glTranslatef,#function - .globl glViewport ; .type glViewport,#function - .globl glArrayElement ; .type glArrayElement,#function - .globl glBindTexture ; .type glBindTexture,#function - .globl glColorPointer ; .type glColorPointer,#function - .globl glDisableClientState ; .type glDisableClientState,#function - .globl glDrawArrays ; .type glDrawArrays,#function - .globl glDrawElements ; .type glDrawElements,#function - .globl glEdgeFlagPointer ; .type glEdgeFlagPointer,#function - .globl glEnableClientState ; .type glEnableClientState,#function - .globl glIndexPointer ; .type glIndexPointer,#function - .globl glIndexub ; .type glIndexub,#function - .globl glIndexubv ; .type glIndexubv,#function - .globl glInterleavedArrays ; .type glInterleavedArrays,#function - .globl glNormalPointer ; .type glNormalPointer,#function - .globl glPolygonOffset ; .type glPolygonOffset,#function - .globl glTexCoordPointer ; .type glTexCoordPointer,#function - .globl glVertexPointer ; .type glVertexPointer,#function - .globl glAreTexturesResident ; .type glAreTexturesResident,#function - .globl glCopyTexImage1D ; .type glCopyTexImage1D,#function - .globl glCopyTexImage2D ; .type glCopyTexImage2D,#function - .globl glCopyTexSubImage1D ; .type glCopyTexSubImage1D,#function - .globl glCopyTexSubImage2D ; .type glCopyTexSubImage2D,#function - .globl glDeleteTextures ; .type glDeleteTextures,#function - .globl glGenTextures ; .type glGenTextures,#function - .globl glGetPointerv ; .type glGetPointerv,#function - .globl glIsTexture ; .type glIsTexture,#function - .globl glPrioritizeTextures ; .type glPrioritizeTextures,#function - .globl glTexSubImage1D ; .type glTexSubImage1D,#function - .globl glTexSubImage2D ; .type glTexSubImage2D,#function - .globl glPopClientAttrib ; .type glPopClientAttrib,#function - .globl glPushClientAttrib ; .type glPushClientAttrib,#function - .globl glBlendColor ; .type glBlendColor,#function - .globl glBlendEquation ; .type glBlendEquation,#function - .globl glDrawRangeElements ; .type glDrawRangeElements,#function - .globl glColorTable ; .type glColorTable,#function - .globl glColorTableParameterfv ; .type glColorTableParameterfv,#function - .globl glColorTableParameteriv ; .type glColorTableParameteriv,#function - .globl glCopyColorTable ; .type glCopyColorTable,#function - .globl glGetColorTable ; .type glGetColorTable,#function - .globl glGetColorTableParameterfv ; .type glGetColorTableParameterfv,#function - .globl glGetColorTableParameteriv ; .type glGetColorTableParameteriv,#function - .globl glColorSubTable ; .type glColorSubTable,#function - .globl glCopyColorSubTable ; .type glCopyColorSubTable,#function - .globl glConvolutionFilter1D ; .type glConvolutionFilter1D,#function - .globl glConvolutionFilter2D ; .type glConvolutionFilter2D,#function - .globl glConvolutionParameterf ; .type glConvolutionParameterf,#function - .globl glConvolutionParameterfv ; .type glConvolutionParameterfv,#function - .globl glConvolutionParameteri ; .type glConvolutionParameteri,#function - .globl glConvolutionParameteriv ; .type glConvolutionParameteriv,#function - .globl glCopyConvolutionFilter1D ; .type glCopyConvolutionFilter1D,#function - .globl glCopyConvolutionFilter2D ; .type glCopyConvolutionFilter2D,#function - .globl glGetConvolutionFilter ; .type glGetConvolutionFilter,#function - .globl glGetConvolutionParameterfv ; .type glGetConvolutionParameterfv,#function - .globl glGetConvolutionParameteriv ; .type glGetConvolutionParameteriv,#function - .globl glGetSeparableFilter ; .type glGetSeparableFilter,#function - .globl glSeparableFilter2D ; .type glSeparableFilter2D,#function - .globl glGetHistogram ; .type glGetHistogram,#function - .globl glGetHistogramParameterfv ; .type glGetHistogramParameterfv,#function - .globl glGetHistogramParameteriv ; .type glGetHistogramParameteriv,#function - .globl glGetMinmax ; .type glGetMinmax,#function - .globl glGetMinmaxParameterfv ; .type glGetMinmaxParameterfv,#function - .globl glGetMinmaxParameteriv ; .type glGetMinmaxParameteriv,#function - .globl glHistogram ; .type glHistogram,#function - .globl glMinmax ; .type glMinmax,#function - .globl glResetHistogram ; .type glResetHistogram,#function - .globl glResetMinmax ; .type glResetMinmax,#function - .globl glTexImage3D ; .type glTexImage3D,#function - .globl glTexSubImage3D ; .type glTexSubImage3D,#function - .globl glCopyTexSubImage3D ; .type glCopyTexSubImage3D,#function - .globl glActiveTextureARB ; .type glActiveTextureARB,#function - .globl glClientActiveTextureARB ; .type glClientActiveTextureARB,#function - .globl glMultiTexCoord1dARB ; .type glMultiTexCoord1dARB,#function - .globl glMultiTexCoord1dvARB ; .type glMultiTexCoord1dvARB,#function - .globl glMultiTexCoord1fARB ; .type glMultiTexCoord1fARB,#function - .globl glMultiTexCoord1fvARB ; .type glMultiTexCoord1fvARB,#function - .globl glMultiTexCoord1iARB ; .type glMultiTexCoord1iARB,#function - .globl glMultiTexCoord1ivARB ; .type glMultiTexCoord1ivARB,#function - .globl glMultiTexCoord1sARB ; .type glMultiTexCoord1sARB,#function - .globl glMultiTexCoord1svARB ; .type glMultiTexCoord1svARB,#function - .globl glMultiTexCoord2dARB ; .type glMultiTexCoord2dARB,#function - .globl glMultiTexCoord2dvARB ; .type glMultiTexCoord2dvARB,#function - .globl glMultiTexCoord2fARB ; .type glMultiTexCoord2fARB,#function - .globl glMultiTexCoord2fvARB ; .type glMultiTexCoord2fvARB,#function - .globl glMultiTexCoord2iARB ; .type glMultiTexCoord2iARB,#function - .globl glMultiTexCoord2ivARB ; .type glMultiTexCoord2ivARB,#function - .globl glMultiTexCoord2sARB ; .type glMultiTexCoord2sARB,#function - .globl glMultiTexCoord2svARB ; .type glMultiTexCoord2svARB,#function - .globl glMultiTexCoord3dARB ; .type glMultiTexCoord3dARB,#function - .globl glMultiTexCoord3dvARB ; .type glMultiTexCoord3dvARB,#function - .globl glMultiTexCoord3fARB ; .type glMultiTexCoord3fARB,#function - .globl glMultiTexCoord3fvARB ; .type glMultiTexCoord3fvARB,#function - .globl glMultiTexCoord3iARB ; .type glMultiTexCoord3iARB,#function - .globl glMultiTexCoord3ivARB ; .type glMultiTexCoord3ivARB,#function - .globl glMultiTexCoord3sARB ; .type glMultiTexCoord3sARB,#function - .globl glMultiTexCoord3svARB ; .type glMultiTexCoord3svARB,#function - .globl glMultiTexCoord4dARB ; .type glMultiTexCoord4dARB,#function - .globl glMultiTexCoord4dvARB ; .type glMultiTexCoord4dvARB,#function - .globl glMultiTexCoord4fARB ; .type glMultiTexCoord4fARB,#function - .globl glMultiTexCoord4fvARB ; .type glMultiTexCoord4fvARB,#function - .globl glMultiTexCoord4iARB ; .type glMultiTexCoord4iARB,#function - .globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function - .globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function - .globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function - .globl glAttachShader ; .type glAttachShader,#function - .globl glCreateProgram ; .type glCreateProgram,#function - .globl glCreateShader ; .type glCreateShader,#function - .globl glDeleteProgram ; .type glDeleteProgram,#function - .globl glDeleteShader ; .type glDeleteShader,#function - .globl glDetachShader ; .type glDetachShader,#function - .globl glGetAttachedShaders ; .type glGetAttachedShaders,#function - .globl glGetProgramInfoLog ; .type glGetProgramInfoLog,#function - .globl glGetProgramiv ; .type glGetProgramiv,#function - .globl glGetShaderInfoLog ; .type glGetShaderInfoLog,#function - .globl glGetShaderiv ; .type glGetShaderiv,#function - .globl glIsProgram ; .type glIsProgram,#function - .globl glIsShader ; .type glIsShader,#function - .globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function - .globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function - .globl glStencilOpSeparate ; .type glStencilOpSeparate,#function - .globl glUniformMatrix2x3fv ; .type glUniformMatrix2x3fv,#function - .globl glUniformMatrix2x4fv ; .type glUniformMatrix2x4fv,#function - .globl glUniformMatrix3x2fv ; .type glUniformMatrix3x2fv,#function - .globl glUniformMatrix3x4fv ; .type glUniformMatrix3x4fv,#function - .globl glUniformMatrix4x2fv ; .type glUniformMatrix4x2fv,#function - .globl glUniformMatrix4x3fv ; .type glUniformMatrix4x3fv,#function - .globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function - .globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function - .globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function - .globl glMultTransposeMatrixfARB ; .type glMultTransposeMatrixfARB,#function - .globl glSampleCoverageARB ; .type glSampleCoverageARB,#function - .globl glCompressedTexImage1DARB ; .type glCompressedTexImage1DARB,#function - .globl glCompressedTexImage2DARB ; .type glCompressedTexImage2DARB,#function - .globl glCompressedTexImage3DARB ; .type glCompressedTexImage3DARB,#function - .globl glCompressedTexSubImage1DARB ; .type glCompressedTexSubImage1DARB,#function - .globl glCompressedTexSubImage2DARB ; .type glCompressedTexSubImage2DARB,#function - .globl glCompressedTexSubImage3DARB ; .type glCompressedTexSubImage3DARB,#function - .globl glGetCompressedTexImageARB ; .type glGetCompressedTexImageARB,#function - .globl glDisableVertexAttribArrayARB ; .type glDisableVertexAttribArrayARB,#function - .globl glEnableVertexAttribArrayARB ; .type glEnableVertexAttribArrayARB,#function - .globl glGetProgramEnvParameterdvARB ; .type glGetProgramEnvParameterdvARB,#function - .globl glGetProgramEnvParameterfvARB ; .type glGetProgramEnvParameterfvARB,#function - .globl glGetProgramLocalParameterdvARB ; .type glGetProgramLocalParameterdvARB,#function - .globl glGetProgramLocalParameterfvARB ; .type glGetProgramLocalParameterfvARB,#function - .globl glGetProgramStringARB ; .type glGetProgramStringARB,#function - .globl glGetProgramivARB ; .type glGetProgramivARB,#function - .globl glGetVertexAttribdvARB ; .type glGetVertexAttribdvARB,#function - .globl glGetVertexAttribfvARB ; .type glGetVertexAttribfvARB,#function - .globl glGetVertexAttribivARB ; .type glGetVertexAttribivARB,#function - .globl glProgramEnvParameter4dARB ; .type glProgramEnvParameter4dARB,#function - .globl glProgramEnvParameter4dvARB ; .type glProgramEnvParameter4dvARB,#function - .globl glProgramEnvParameter4fARB ; .type glProgramEnvParameter4fARB,#function - .globl glProgramEnvParameter4fvARB ; .type glProgramEnvParameter4fvARB,#function - .globl glProgramLocalParameter4dARB ; .type glProgramLocalParameter4dARB,#function - .globl glProgramLocalParameter4dvARB ; .type glProgramLocalParameter4dvARB,#function - .globl glProgramLocalParameter4fARB ; .type glProgramLocalParameter4fARB,#function - .globl glProgramLocalParameter4fvARB ; .type glProgramLocalParameter4fvARB,#function - .globl glProgramStringARB ; .type glProgramStringARB,#function - .globl glVertexAttrib1dARB ; .type glVertexAttrib1dARB,#function - .globl glVertexAttrib1dvARB ; .type glVertexAttrib1dvARB,#function - .globl glVertexAttrib1fARB ; .type glVertexAttrib1fARB,#function - .globl glVertexAttrib1fvARB ; .type glVertexAttrib1fvARB,#function - .globl glVertexAttrib1sARB ; .type glVertexAttrib1sARB,#function - .globl glVertexAttrib1svARB ; .type glVertexAttrib1svARB,#function - .globl glVertexAttrib2dARB ; .type glVertexAttrib2dARB,#function - .globl glVertexAttrib2dvARB ; .type glVertexAttrib2dvARB,#function - .globl glVertexAttrib2fARB ; .type glVertexAttrib2fARB,#function - .globl glVertexAttrib2fvARB ; .type glVertexAttrib2fvARB,#function - .globl glVertexAttrib2sARB ; .type glVertexAttrib2sARB,#function - .globl glVertexAttrib2svARB ; .type glVertexAttrib2svARB,#function - .globl glVertexAttrib3dARB ; .type glVertexAttrib3dARB,#function - .globl glVertexAttrib3dvARB ; .type glVertexAttrib3dvARB,#function - .globl glVertexAttrib3fARB ; .type glVertexAttrib3fARB,#function - .globl glVertexAttrib3fvARB ; .type glVertexAttrib3fvARB,#function - .globl glVertexAttrib3sARB ; .type glVertexAttrib3sARB,#function - .globl glVertexAttrib3svARB ; .type glVertexAttrib3svARB,#function - .globl glVertexAttrib4NbvARB ; .type glVertexAttrib4NbvARB,#function - .globl glVertexAttrib4NivARB ; .type glVertexAttrib4NivARB,#function - .globl glVertexAttrib4NsvARB ; .type glVertexAttrib4NsvARB,#function - .globl glVertexAttrib4NubARB ; .type glVertexAttrib4NubARB,#function - .globl glVertexAttrib4NubvARB ; .type glVertexAttrib4NubvARB,#function - .globl glVertexAttrib4NuivARB ; .type glVertexAttrib4NuivARB,#function - .globl glVertexAttrib4NusvARB ; .type glVertexAttrib4NusvARB,#function - .globl glVertexAttrib4bvARB ; .type glVertexAttrib4bvARB,#function - .globl glVertexAttrib4dARB ; .type glVertexAttrib4dARB,#function - .globl glVertexAttrib4dvARB ; .type glVertexAttrib4dvARB,#function - .globl glVertexAttrib4fARB ; .type glVertexAttrib4fARB,#function - .globl glVertexAttrib4fvARB ; .type glVertexAttrib4fvARB,#function - .globl glVertexAttrib4ivARB ; .type glVertexAttrib4ivARB,#function - .globl glVertexAttrib4sARB ; .type glVertexAttrib4sARB,#function - .globl glVertexAttrib4svARB ; .type glVertexAttrib4svARB,#function - .globl glVertexAttrib4ubvARB ; .type glVertexAttrib4ubvARB,#function - .globl glVertexAttrib4uivARB ; .type glVertexAttrib4uivARB,#function - .globl glVertexAttrib4usvARB ; .type glVertexAttrib4usvARB,#function - .globl glVertexAttribPointerARB ; .type glVertexAttribPointerARB,#function - .globl glBindBufferARB ; .type glBindBufferARB,#function - .globl glBufferDataARB ; .type glBufferDataARB,#function - .globl glBufferSubDataARB ; .type glBufferSubDataARB,#function - .globl glDeleteBuffersARB ; .type glDeleteBuffersARB,#function - .globl glGenBuffersARB ; .type glGenBuffersARB,#function - .globl glGetBufferParameterivARB ; .type glGetBufferParameterivARB,#function - .globl glGetBufferPointervARB ; .type glGetBufferPointervARB,#function - .globl glGetBufferSubDataARB ; .type glGetBufferSubDataARB,#function - .globl glIsBufferARB ; .type glIsBufferARB,#function - .globl glMapBufferARB ; .type glMapBufferARB,#function - .globl glUnmapBufferARB ; .type glUnmapBufferARB,#function - .globl glBeginQueryARB ; .type glBeginQueryARB,#function - .globl glDeleteQueriesARB ; .type glDeleteQueriesARB,#function - .globl glEndQueryARB ; .type glEndQueryARB,#function - .globl glGenQueriesARB ; .type glGenQueriesARB,#function - .globl glGetQueryObjectivARB ; .type glGetQueryObjectivARB,#function - .globl glGetQueryObjectuivARB ; .type glGetQueryObjectuivARB,#function - .globl glGetQueryivARB ; .type glGetQueryivARB,#function - .globl glIsQueryARB ; .type glIsQueryARB,#function - .globl glAttachObjectARB ; .type glAttachObjectARB,#function - .globl glCompileShaderARB ; .type glCompileShaderARB,#function - .globl glCreateProgramObjectARB ; .type glCreateProgramObjectARB,#function - .globl glCreateShaderObjectARB ; .type glCreateShaderObjectARB,#function - .globl glDeleteObjectARB ; .type glDeleteObjectARB,#function - .globl glDetachObjectARB ; .type glDetachObjectARB,#function - .globl glGetActiveUniformARB ; .type glGetActiveUniformARB,#function - .globl glGetAttachedObjectsARB ; .type glGetAttachedObjectsARB,#function - .globl glGetHandleARB ; .type glGetHandleARB,#function - .globl glGetInfoLogARB ; .type glGetInfoLogARB,#function - .globl glGetObjectParameterfvARB ; .type glGetObjectParameterfvARB,#function - .globl glGetObjectParameterivARB ; .type glGetObjectParameterivARB,#function - .globl glGetShaderSourceARB ; .type glGetShaderSourceARB,#function - .globl glGetUniformLocationARB ; .type glGetUniformLocationARB,#function - .globl glGetUniformfvARB ; .type glGetUniformfvARB,#function - .globl glGetUniformivARB ; .type glGetUniformivARB,#function - .globl glLinkProgramARB ; .type glLinkProgramARB,#function - .globl glShaderSourceARB ; .type glShaderSourceARB,#function - .globl glUniform1fARB ; .type glUniform1fARB,#function - .globl glUniform1fvARB ; .type glUniform1fvARB,#function - .globl glUniform1iARB ; .type glUniform1iARB,#function - .globl glUniform1ivARB ; .type glUniform1ivARB,#function - .globl glUniform2fARB ; .type glUniform2fARB,#function - .globl glUniform2fvARB ; .type glUniform2fvARB,#function - .globl glUniform2iARB ; .type glUniform2iARB,#function - .globl glUniform2ivARB ; .type glUniform2ivARB,#function - .globl glUniform3fARB ; .type glUniform3fARB,#function - .globl glUniform3fvARB ; .type glUniform3fvARB,#function - .globl glUniform3iARB ; .type glUniform3iARB,#function - .globl glUniform3ivARB ; .type glUniform3ivARB,#function - .globl glUniform4fARB ; .type glUniform4fARB,#function - .globl glUniform4fvARB ; .type glUniform4fvARB,#function - .globl glUniform4iARB ; .type glUniform4iARB,#function - .globl glUniform4ivARB ; .type glUniform4ivARB,#function - .globl glUniformMatrix2fvARB ; .type glUniformMatrix2fvARB,#function - .globl glUniformMatrix3fvARB ; .type glUniformMatrix3fvARB,#function - .globl glUniformMatrix4fvARB ; .type glUniformMatrix4fvARB,#function - .globl glUseProgramObjectARB ; .type glUseProgramObjectARB,#function - .globl glValidateProgramARB ; .type glValidateProgramARB,#function - .globl glBindAttribLocationARB ; .type glBindAttribLocationARB,#function - .globl glGetActiveAttribARB ; .type glGetActiveAttribARB,#function - .globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function - .globl glDrawBuffersARB ; .type glDrawBuffersARB,#function - .globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function - .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function - .globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function - .globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function - .globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function - .globl gl_dispatch_stub_566 ; .type gl_dispatch_stub_566,#function - .globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function - .globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function - .globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function - .globl glColorPointerEXT ; .type glColorPointerEXT,#function - .globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function - .globl glIndexPointerEXT ; .type glIndexPointerEXT,#function - .globl glNormalPointerEXT ; .type glNormalPointerEXT,#function - .globl glTexCoordPointerEXT ; .type glTexCoordPointerEXT,#function - .globl glVertexPointerEXT ; .type glVertexPointerEXT,#function - .globl glPointParameterfEXT ; .type glPointParameterfEXT,#function - .globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function - .globl glLockArraysEXT ; .type glLockArraysEXT,#function - .globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function - .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function - .globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function - .globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function - .globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function - .globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function - .globl glSecondaryColor3dvEXT ; .type glSecondaryColor3dvEXT,#function - .globl glSecondaryColor3fEXT ; .type glSecondaryColor3fEXT,#function - .globl glSecondaryColor3fvEXT ; .type glSecondaryColor3fvEXT,#function - .globl glSecondaryColor3iEXT ; .type glSecondaryColor3iEXT,#function - .globl glSecondaryColor3ivEXT ; .type glSecondaryColor3ivEXT,#function - .globl glSecondaryColor3sEXT ; .type glSecondaryColor3sEXT,#function - .globl glSecondaryColor3svEXT ; .type glSecondaryColor3svEXT,#function - .globl glSecondaryColor3ubEXT ; .type glSecondaryColor3ubEXT,#function - .globl glSecondaryColor3ubvEXT ; .type glSecondaryColor3ubvEXT,#function - .globl glSecondaryColor3uiEXT ; .type glSecondaryColor3uiEXT,#function - .globl glSecondaryColor3uivEXT ; .type glSecondaryColor3uivEXT,#function - .globl glSecondaryColor3usEXT ; .type glSecondaryColor3usEXT,#function - .globl glSecondaryColor3usvEXT ; .type glSecondaryColor3usvEXT,#function - .globl glSecondaryColorPointerEXT ; .type glSecondaryColorPointerEXT,#function - .globl glMultiDrawArraysEXT ; .type glMultiDrawArraysEXT,#function - .globl glMultiDrawElementsEXT ; .type glMultiDrawElementsEXT,#function - .globl glFogCoordPointerEXT ; .type glFogCoordPointerEXT,#function - .globl glFogCoorddEXT ; .type glFogCoorddEXT,#function - .globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function - .globl glFogCoordfEXT ; .type glFogCoordfEXT,#function - .globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function - .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function - .globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function - .globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function - .globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function - .globl glCombinerInputNV ; .type glCombinerInputNV,#function - .globl glCombinerOutputNV ; .type glCombinerOutputNV,#function - .globl glCombinerParameterfNV ; .type glCombinerParameterfNV,#function - .globl glCombinerParameterfvNV ; .type glCombinerParameterfvNV,#function - .globl glCombinerParameteriNV ; .type glCombinerParameteriNV,#function - .globl glCombinerParameterivNV ; .type glCombinerParameterivNV,#function - .globl glFinalCombinerInputNV ; .type glFinalCombinerInputNV,#function - .globl glGetCombinerInputParameterfvNV ; .type glGetCombinerInputParameterfvNV,#function - .globl glGetCombinerInputParameterivNV ; .type glGetCombinerInputParameterivNV,#function - .globl glGetCombinerOutputParameterfvNV ; .type glGetCombinerOutputParameterfvNV,#function - .globl glGetCombinerOutputParameterivNV ; .type glGetCombinerOutputParameterivNV,#function - .globl glGetFinalCombinerInputParameterfvNV ; .type glGetFinalCombinerInputParameterfvNV,#function - .globl glGetFinalCombinerInputParameterivNV ; .type glGetFinalCombinerInputParameterivNV,#function - .globl glResizeBuffersMESA ; .type glResizeBuffersMESA,#function - .globl glWindowPos2dMESA ; .type glWindowPos2dMESA,#function - .globl glWindowPos2dvMESA ; .type glWindowPos2dvMESA,#function - .globl glWindowPos2fMESA ; .type glWindowPos2fMESA,#function - .globl glWindowPos2fvMESA ; .type glWindowPos2fvMESA,#function - .globl glWindowPos2iMESA ; .type glWindowPos2iMESA,#function - .globl glWindowPos2ivMESA ; .type glWindowPos2ivMESA,#function - .globl glWindowPos2sMESA ; .type glWindowPos2sMESA,#function - .globl glWindowPos2svMESA ; .type glWindowPos2svMESA,#function - .globl glWindowPos3dMESA ; .type glWindowPos3dMESA,#function - .globl glWindowPos3dvMESA ; .type glWindowPos3dvMESA,#function - .globl glWindowPos3fMESA ; .type glWindowPos3fMESA,#function - .globl glWindowPos3fvMESA ; .type glWindowPos3fvMESA,#function - .globl glWindowPos3iMESA ; .type glWindowPos3iMESA,#function - .globl glWindowPos3ivMESA ; .type glWindowPos3ivMESA,#function - .globl glWindowPos3sMESA ; .type glWindowPos3sMESA,#function - .globl glWindowPos3svMESA ; .type glWindowPos3svMESA,#function - .globl glWindowPos4dMESA ; .type glWindowPos4dMESA,#function - .globl glWindowPos4dvMESA ; .type glWindowPos4dvMESA,#function - .globl glWindowPos4fMESA ; .type glWindowPos4fMESA,#function - .globl glWindowPos4fvMESA ; .type glWindowPos4fvMESA,#function - .globl glWindowPos4iMESA ; .type glWindowPos4iMESA,#function - .globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function - .globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function - .globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function - .globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function - .globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function - .globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function - .globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function - .globl gl_dispatch_stub_652 ; .type gl_dispatch_stub_652,#function - .globl gl_dispatch_stub_653 ; .type gl_dispatch_stub_653,#function - .globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function - .globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function - .globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function - .globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function - .globl glBindProgramNV ; .type glBindProgramNV,#function - .globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function - .globl glExecuteProgramNV ; .type glExecuteProgramNV,#function - .globl glGenProgramsNV ; .type glGenProgramsNV,#function - .globl glGetProgramParameterdvNV ; .type glGetProgramParameterdvNV,#function - .globl glGetProgramParameterfvNV ; .type glGetProgramParameterfvNV,#function - .globl glGetProgramStringNV ; .type glGetProgramStringNV,#function - .globl glGetProgramivNV ; .type glGetProgramivNV,#function - .globl glGetTrackMatrixivNV ; .type glGetTrackMatrixivNV,#function - .globl glGetVertexAttribPointervNV ; .type glGetVertexAttribPointervNV,#function - .globl glGetVertexAttribdvNV ; .type glGetVertexAttribdvNV,#function - .globl glGetVertexAttribfvNV ; .type glGetVertexAttribfvNV,#function - .globl glGetVertexAttribivNV ; .type glGetVertexAttribivNV,#function - .globl glIsProgramNV ; .type glIsProgramNV,#function - .globl glLoadProgramNV ; .type glLoadProgramNV,#function - .globl glProgramParameters4dvNV ; .type glProgramParameters4dvNV,#function - .globl glProgramParameters4fvNV ; .type glProgramParameters4fvNV,#function - .globl glRequestResidentProgramsNV ; .type glRequestResidentProgramsNV,#function - .globl glTrackMatrixNV ; .type glTrackMatrixNV,#function - .globl glVertexAttrib1dNV ; .type glVertexAttrib1dNV,#function - .globl glVertexAttrib1dvNV ; .type glVertexAttrib1dvNV,#function - .globl glVertexAttrib1fNV ; .type glVertexAttrib1fNV,#function - .globl glVertexAttrib1fvNV ; .type glVertexAttrib1fvNV,#function - .globl glVertexAttrib1sNV ; .type glVertexAttrib1sNV,#function - .globl glVertexAttrib1svNV ; .type glVertexAttrib1svNV,#function - .globl glVertexAttrib2dNV ; .type glVertexAttrib2dNV,#function - .globl glVertexAttrib2dvNV ; .type glVertexAttrib2dvNV,#function - .globl glVertexAttrib2fNV ; .type glVertexAttrib2fNV,#function - .globl glVertexAttrib2fvNV ; .type glVertexAttrib2fvNV,#function - .globl glVertexAttrib2sNV ; .type glVertexAttrib2sNV,#function - .globl glVertexAttrib2svNV ; .type glVertexAttrib2svNV,#function - .globl glVertexAttrib3dNV ; .type glVertexAttrib3dNV,#function - .globl glVertexAttrib3dvNV ; .type glVertexAttrib3dvNV,#function - .globl glVertexAttrib3fNV ; .type glVertexAttrib3fNV,#function - .globl glVertexAttrib3fvNV ; .type glVertexAttrib3fvNV,#function - .globl glVertexAttrib3sNV ; .type glVertexAttrib3sNV,#function - .globl glVertexAttrib3svNV ; .type glVertexAttrib3svNV,#function - .globl glVertexAttrib4dNV ; .type glVertexAttrib4dNV,#function - .globl glVertexAttrib4dvNV ; .type glVertexAttrib4dvNV,#function - .globl glVertexAttrib4fNV ; .type glVertexAttrib4fNV,#function - .globl glVertexAttrib4fvNV ; .type glVertexAttrib4fvNV,#function - .globl glVertexAttrib4sNV ; .type glVertexAttrib4sNV,#function - .globl glVertexAttrib4svNV ; .type glVertexAttrib4svNV,#function - .globl glVertexAttrib4ubNV ; .type glVertexAttrib4ubNV,#function - .globl glVertexAttrib4ubvNV ; .type glVertexAttrib4ubvNV,#function - .globl glVertexAttribPointerNV ; .type glVertexAttribPointerNV,#function - .globl glVertexAttribs1dvNV ; .type glVertexAttribs1dvNV,#function - .globl glVertexAttribs1fvNV ; .type glVertexAttribs1fvNV,#function - .globl glVertexAttribs1svNV ; .type glVertexAttribs1svNV,#function - .globl glVertexAttribs2dvNV ; .type glVertexAttribs2dvNV,#function - .globl glVertexAttribs2fvNV ; .type glVertexAttribs2fvNV,#function - .globl glVertexAttribs2svNV ; .type glVertexAttribs2svNV,#function - .globl glVertexAttribs3dvNV ; .type glVertexAttribs3dvNV,#function - .globl glVertexAttribs3fvNV ; .type glVertexAttribs3fvNV,#function - .globl glVertexAttribs3svNV ; .type glVertexAttribs3svNV,#function - .globl glVertexAttribs4dvNV ; .type glVertexAttribs4dvNV,#function - .globl glVertexAttribs4fvNV ; .type glVertexAttribs4fvNV,#function - .globl glVertexAttribs4svNV ; .type glVertexAttribs4svNV,#function - .globl glVertexAttribs4ubvNV ; .type glVertexAttribs4ubvNV,#function - .globl glAlphaFragmentOp1ATI ; .type glAlphaFragmentOp1ATI,#function - .globl glAlphaFragmentOp2ATI ; .type glAlphaFragmentOp2ATI,#function - .globl glAlphaFragmentOp3ATI ; .type glAlphaFragmentOp3ATI,#function - .globl glBeginFragmentShaderATI ; .type glBeginFragmentShaderATI,#function - .globl glBindFragmentShaderATI ; .type glBindFragmentShaderATI,#function - .globl glColorFragmentOp1ATI ; .type glColorFragmentOp1ATI,#function - .globl glColorFragmentOp2ATI ; .type glColorFragmentOp2ATI,#function - .globl glColorFragmentOp3ATI ; .type glColorFragmentOp3ATI,#function - .globl glDeleteFragmentShaderATI ; .type glDeleteFragmentShaderATI,#function - .globl glEndFragmentShaderATI ; .type glEndFragmentShaderATI,#function - .globl glGenFragmentShadersATI ; .type glGenFragmentShadersATI,#function - .globl glPassTexCoordATI ; .type glPassTexCoordATI,#function - .globl glSampleMapATI ; .type glSampleMapATI,#function - .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function - .globl glPointParameteriNV ; .type glPointParameteriNV,#function - .globl glPointParameterivNV ; .type glPointParameterivNV,#function - .globl gl_dispatch_stub_733 ; .type gl_dispatch_stub_733,#function - .globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function - .globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function - .globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function - .globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function - .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function - .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function - .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function - .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function - .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function - .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function - .globl gl_dispatch_stub_744 ; .type gl_dispatch_stub_744,#function - .globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function - .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function - .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function - .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function - .globl glDeleteFramebuffersEXT ; .type glDeleteFramebuffersEXT,#function - .globl glDeleteRenderbuffersEXT ; .type glDeleteRenderbuffersEXT,#function - .globl glFramebufferRenderbufferEXT ; .type glFramebufferRenderbufferEXT,#function - .globl glFramebufferTexture1DEXT ; .type glFramebufferTexture1DEXT,#function - .globl glFramebufferTexture2DEXT ; .type glFramebufferTexture2DEXT,#function - .globl glFramebufferTexture3DEXT ; .type glFramebufferTexture3DEXT,#function - .globl glGenFramebuffersEXT ; .type glGenFramebuffersEXT,#function - .globl glGenRenderbuffersEXT ; .type glGenRenderbuffersEXT,#function - .globl glGenerateMipmapEXT ; .type glGenerateMipmapEXT,#function - .globl glGetFramebufferAttachmentParameterivEXT ; .type glGetFramebufferAttachmentParameterivEXT,#function - .globl glGetRenderbufferParameterivEXT ; .type glGetRenderbufferParameterivEXT,#function - .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function - .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function - .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function - .globl gl_dispatch_stub_763 ; .type gl_dispatch_stub_763,#function - .globl glFramebufferTextureLayerEXT ; .type glFramebufferTextureLayerEXT,#function - .globl gl_dispatch_stub_765 ; .type gl_dispatch_stub_765,#function - .globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function - .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function - .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function - .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function - .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function -_mesa_sparc_glapi_begin: - - GL_STUB(glNewList, _gloffset_NewList) - GL_STUB(glEndList, _gloffset_EndList) - GL_STUB(glCallList, _gloffset_CallList) - GL_STUB(glCallLists, _gloffset_CallLists) - GL_STUB(glDeleteLists, _gloffset_DeleteLists) - GL_STUB(glGenLists, _gloffset_GenLists) - GL_STUB(glListBase, _gloffset_ListBase) - GL_STUB(glBegin, _gloffset_Begin) - GL_STUB(glBitmap, _gloffset_Bitmap) - GL_STUB(glColor3b, _gloffset_Color3b) - GL_STUB(glColor3bv, _gloffset_Color3bv) - GL_STUB(glColor3d, _gloffset_Color3d) - GL_STUB(glColor3dv, _gloffset_Color3dv) - GL_STUB(glColor3f, _gloffset_Color3f) - GL_STUB(glColor3fv, _gloffset_Color3fv) - GL_STUB(glColor3i, _gloffset_Color3i) - GL_STUB(glColor3iv, _gloffset_Color3iv) - GL_STUB(glColor3s, _gloffset_Color3s) - GL_STUB(glColor3sv, _gloffset_Color3sv) - GL_STUB(glColor3ub, _gloffset_Color3ub) - GL_STUB(glColor3ubv, _gloffset_Color3ubv) - GL_STUB(glColor3ui, _gloffset_Color3ui) - GL_STUB(glColor3uiv, _gloffset_Color3uiv) - GL_STUB(glColor3us, _gloffset_Color3us) - GL_STUB(glColor3usv, _gloffset_Color3usv) - GL_STUB(glColor4b, _gloffset_Color4b) - GL_STUB(glColor4bv, _gloffset_Color4bv) - GL_STUB(glColor4d, _gloffset_Color4d) - GL_STUB(glColor4dv, _gloffset_Color4dv) - GL_STUB(glColor4f, _gloffset_Color4f) - GL_STUB(glColor4fv, _gloffset_Color4fv) - GL_STUB(glColor4i, _gloffset_Color4i) - GL_STUB(glColor4iv, _gloffset_Color4iv) - GL_STUB(glColor4s, _gloffset_Color4s) - GL_STUB(glColor4sv, _gloffset_Color4sv) - GL_STUB(glColor4ub, _gloffset_Color4ub) - GL_STUB(glColor4ubv, _gloffset_Color4ubv) - GL_STUB(glColor4ui, _gloffset_Color4ui) - GL_STUB(glColor4uiv, _gloffset_Color4uiv) - GL_STUB(glColor4us, _gloffset_Color4us) - GL_STUB(glColor4usv, _gloffset_Color4usv) - GL_STUB(glEdgeFlag, _gloffset_EdgeFlag) - GL_STUB(glEdgeFlagv, _gloffset_EdgeFlagv) - GL_STUB(glEnd, _gloffset_End) - GL_STUB(glIndexd, _gloffset_Indexd) - GL_STUB(glIndexdv, _gloffset_Indexdv) - GL_STUB(glIndexf, _gloffset_Indexf) - GL_STUB(glIndexfv, _gloffset_Indexfv) - GL_STUB(glIndexi, _gloffset_Indexi) - GL_STUB(glIndexiv, _gloffset_Indexiv) - GL_STUB(glIndexs, _gloffset_Indexs) - GL_STUB(glIndexsv, _gloffset_Indexsv) - GL_STUB(glNormal3b, _gloffset_Normal3b) - GL_STUB(glNormal3bv, _gloffset_Normal3bv) - GL_STUB(glNormal3d, _gloffset_Normal3d) - GL_STUB(glNormal3dv, _gloffset_Normal3dv) - GL_STUB(glNormal3f, _gloffset_Normal3f) - GL_STUB(glNormal3fv, _gloffset_Normal3fv) - GL_STUB(glNormal3i, _gloffset_Normal3i) - GL_STUB(glNormal3iv, _gloffset_Normal3iv) - GL_STUB(glNormal3s, _gloffset_Normal3s) - GL_STUB(glNormal3sv, _gloffset_Normal3sv) - GL_STUB(glRasterPos2d, _gloffset_RasterPos2d) - GL_STUB(glRasterPos2dv, _gloffset_RasterPos2dv) - GL_STUB(glRasterPos2f, _gloffset_RasterPos2f) - GL_STUB(glRasterPos2fv, _gloffset_RasterPos2fv) - GL_STUB(glRasterPos2i, _gloffset_RasterPos2i) - GL_STUB(glRasterPos2iv, _gloffset_RasterPos2iv) - GL_STUB(glRasterPos2s, _gloffset_RasterPos2s) - GL_STUB(glRasterPos2sv, _gloffset_RasterPos2sv) - GL_STUB(glRasterPos3d, _gloffset_RasterPos3d) - GL_STUB(glRasterPos3dv, _gloffset_RasterPos3dv) - GL_STUB(glRasterPos3f, _gloffset_RasterPos3f) - GL_STUB(glRasterPos3fv, _gloffset_RasterPos3fv) - GL_STUB(glRasterPos3i, _gloffset_RasterPos3i) - GL_STUB(glRasterPos3iv, _gloffset_RasterPos3iv) - GL_STUB(glRasterPos3s, _gloffset_RasterPos3s) - GL_STUB(glRasterPos3sv, _gloffset_RasterPos3sv) - GL_STUB(glRasterPos4d, _gloffset_RasterPos4d) - GL_STUB(glRasterPos4dv, _gloffset_RasterPos4dv) - GL_STUB(glRasterPos4f, _gloffset_RasterPos4f) - GL_STUB(glRasterPos4fv, _gloffset_RasterPos4fv) - GL_STUB(glRasterPos4i, _gloffset_RasterPos4i) - GL_STUB(glRasterPos4iv, _gloffset_RasterPos4iv) - GL_STUB(glRasterPos4s, _gloffset_RasterPos4s) - GL_STUB(glRasterPos4sv, _gloffset_RasterPos4sv) - GL_STUB(glRectd, _gloffset_Rectd) - GL_STUB(glRectdv, _gloffset_Rectdv) - GL_STUB(glRectf, _gloffset_Rectf) - GL_STUB(glRectfv, _gloffset_Rectfv) - GL_STUB(glRecti, _gloffset_Recti) - GL_STUB(glRectiv, _gloffset_Rectiv) - GL_STUB(glRects, _gloffset_Rects) - GL_STUB(glRectsv, _gloffset_Rectsv) - GL_STUB(glTexCoord1d, _gloffset_TexCoord1d) - GL_STUB(glTexCoord1dv, _gloffset_TexCoord1dv) - GL_STUB(glTexCoord1f, _gloffset_TexCoord1f) - GL_STUB(glTexCoord1fv, _gloffset_TexCoord1fv) - GL_STUB(glTexCoord1i, _gloffset_TexCoord1i) - GL_STUB(glTexCoord1iv, _gloffset_TexCoord1iv) - GL_STUB(glTexCoord1s, _gloffset_TexCoord1s) - GL_STUB(glTexCoord1sv, _gloffset_TexCoord1sv) - GL_STUB(glTexCoord2d, _gloffset_TexCoord2d) - GL_STUB(glTexCoord2dv, _gloffset_TexCoord2dv) - GL_STUB(glTexCoord2f, _gloffset_TexCoord2f) - GL_STUB(glTexCoord2fv, _gloffset_TexCoord2fv) - GL_STUB(glTexCoord2i, _gloffset_TexCoord2i) - GL_STUB(glTexCoord2iv, _gloffset_TexCoord2iv) - GL_STUB(glTexCoord2s, _gloffset_TexCoord2s) - GL_STUB(glTexCoord2sv, _gloffset_TexCoord2sv) - GL_STUB(glTexCoord3d, _gloffset_TexCoord3d) - GL_STUB(glTexCoord3dv, _gloffset_TexCoord3dv) - GL_STUB(glTexCoord3f, _gloffset_TexCoord3f) - GL_STUB(glTexCoord3fv, _gloffset_TexCoord3fv) - GL_STUB(glTexCoord3i, _gloffset_TexCoord3i) - GL_STUB(glTexCoord3iv, _gloffset_TexCoord3iv) - GL_STUB(glTexCoord3s, _gloffset_TexCoord3s) - GL_STUB(glTexCoord3sv, _gloffset_TexCoord3sv) - GL_STUB(glTexCoord4d, _gloffset_TexCoord4d) - GL_STUB(glTexCoord4dv, _gloffset_TexCoord4dv) - GL_STUB(glTexCoord4f, _gloffset_TexCoord4f) - GL_STUB(glTexCoord4fv, _gloffset_TexCoord4fv) - GL_STUB(glTexCoord4i, _gloffset_TexCoord4i) - GL_STUB(glTexCoord4iv, _gloffset_TexCoord4iv) - GL_STUB(glTexCoord4s, _gloffset_TexCoord4s) - GL_STUB(glTexCoord4sv, _gloffset_TexCoord4sv) - GL_STUB(glVertex2d, _gloffset_Vertex2d) - GL_STUB(glVertex2dv, _gloffset_Vertex2dv) - GL_STUB(glVertex2f, _gloffset_Vertex2f) - GL_STUB(glVertex2fv, _gloffset_Vertex2fv) - GL_STUB(glVertex2i, _gloffset_Vertex2i) - GL_STUB(glVertex2iv, _gloffset_Vertex2iv) - GL_STUB(glVertex2s, _gloffset_Vertex2s) - GL_STUB(glVertex2sv, _gloffset_Vertex2sv) - GL_STUB(glVertex3d, _gloffset_Vertex3d) - GL_STUB(glVertex3dv, _gloffset_Vertex3dv) - GL_STUB(glVertex3f, _gloffset_Vertex3f) - GL_STUB(glVertex3fv, _gloffset_Vertex3fv) - GL_STUB(glVertex3i, _gloffset_Vertex3i) - GL_STUB(glVertex3iv, _gloffset_Vertex3iv) - GL_STUB(glVertex3s, _gloffset_Vertex3s) - GL_STUB(glVertex3sv, _gloffset_Vertex3sv) - GL_STUB(glVertex4d, _gloffset_Vertex4d) - GL_STUB(glVertex4dv, _gloffset_Vertex4dv) - GL_STUB(glVertex4f, _gloffset_Vertex4f) - GL_STUB(glVertex4fv, _gloffset_Vertex4fv) - GL_STUB(glVertex4i, _gloffset_Vertex4i) - GL_STUB(glVertex4iv, _gloffset_Vertex4iv) - GL_STUB(glVertex4s, _gloffset_Vertex4s) - GL_STUB(glVertex4sv, _gloffset_Vertex4sv) - GL_STUB(glClipPlane, _gloffset_ClipPlane) - GL_STUB(glColorMaterial, _gloffset_ColorMaterial) - GL_STUB(glCullFace, _gloffset_CullFace) - GL_STUB(glFogf, _gloffset_Fogf) - GL_STUB(glFogfv, _gloffset_Fogfv) - GL_STUB(glFogi, _gloffset_Fogi) - GL_STUB(glFogiv, _gloffset_Fogiv) - GL_STUB(glFrontFace, _gloffset_FrontFace) - GL_STUB(glHint, _gloffset_Hint) - GL_STUB(glLightf, _gloffset_Lightf) - GL_STUB(glLightfv, _gloffset_Lightfv) - GL_STUB(glLighti, _gloffset_Lighti) - GL_STUB(glLightiv, _gloffset_Lightiv) - GL_STUB(glLightModelf, _gloffset_LightModelf) - GL_STUB(glLightModelfv, _gloffset_LightModelfv) - GL_STUB(glLightModeli, _gloffset_LightModeli) - GL_STUB(glLightModeliv, _gloffset_LightModeliv) - GL_STUB(glLineStipple, _gloffset_LineStipple) - GL_STUB(glLineWidth, _gloffset_LineWidth) - GL_STUB(glMaterialf, _gloffset_Materialf) - GL_STUB(glMaterialfv, _gloffset_Materialfv) - GL_STUB(glMateriali, _gloffset_Materiali) - GL_STUB(glMaterialiv, _gloffset_Materialiv) - GL_STUB(glPointSize, _gloffset_PointSize) - GL_STUB(glPolygonMode, _gloffset_PolygonMode) - GL_STUB(glPolygonStipple, _gloffset_PolygonStipple) - GL_STUB(glScissor, _gloffset_Scissor) - GL_STUB(glShadeModel, _gloffset_ShadeModel) - GL_STUB(glTexParameterf, _gloffset_TexParameterf) - GL_STUB(glTexParameterfv, _gloffset_TexParameterfv) - GL_STUB(glTexParameteri, _gloffset_TexParameteri) - GL_STUB(glTexParameteriv, _gloffset_TexParameteriv) - GL_STUB(glTexImage1D, _gloffset_TexImage1D) - GL_STUB(glTexImage2D, _gloffset_TexImage2D) - GL_STUB(glTexEnvf, _gloffset_TexEnvf) - GL_STUB(glTexEnvfv, _gloffset_TexEnvfv) - GL_STUB(glTexEnvi, _gloffset_TexEnvi) - GL_STUB(glTexEnviv, _gloffset_TexEnviv) - GL_STUB(glTexGend, _gloffset_TexGend) - GL_STUB(glTexGendv, _gloffset_TexGendv) - GL_STUB(glTexGenf, _gloffset_TexGenf) - GL_STUB(glTexGenfv, _gloffset_TexGenfv) - GL_STUB(glTexGeni, _gloffset_TexGeni) - GL_STUB(glTexGeniv, _gloffset_TexGeniv) - GL_STUB(glFeedbackBuffer, _gloffset_FeedbackBuffer) - GL_STUB(glSelectBuffer, _gloffset_SelectBuffer) - GL_STUB(glRenderMode, _gloffset_RenderMode) - GL_STUB(glInitNames, _gloffset_InitNames) - GL_STUB(glLoadName, _gloffset_LoadName) - GL_STUB(glPassThrough, _gloffset_PassThrough) - GL_STUB(glPopName, _gloffset_PopName) - GL_STUB(glPushName, _gloffset_PushName) - GL_STUB(glDrawBuffer, _gloffset_DrawBuffer) - GL_STUB(glClear, _gloffset_Clear) - GL_STUB(glClearAccum, _gloffset_ClearAccum) - GL_STUB(glClearIndex, _gloffset_ClearIndex) - GL_STUB(glClearColor, _gloffset_ClearColor) - GL_STUB(glClearStencil, _gloffset_ClearStencil) - GL_STUB(glClearDepth, _gloffset_ClearDepth) - GL_STUB(glStencilMask, _gloffset_StencilMask) - GL_STUB(glColorMask, _gloffset_ColorMask) - GL_STUB(glDepthMask, _gloffset_DepthMask) - GL_STUB(glIndexMask, _gloffset_IndexMask) - GL_STUB(glAccum, _gloffset_Accum) - GL_STUB(glDisable, _gloffset_Disable) - GL_STUB(glEnable, _gloffset_Enable) - GL_STUB(glFinish, _gloffset_Finish) - GL_STUB(glFlush, _gloffset_Flush) - GL_STUB(glPopAttrib, _gloffset_PopAttrib) - GL_STUB(glPushAttrib, _gloffset_PushAttrib) - GL_STUB(glMap1d, _gloffset_Map1d) - GL_STUB(glMap1f, _gloffset_Map1f) - GL_STUB(glMap2d, _gloffset_Map2d) - GL_STUB(glMap2f, _gloffset_Map2f) - GL_STUB(glMapGrid1d, _gloffset_MapGrid1d) - GL_STUB(glMapGrid1f, _gloffset_MapGrid1f) - GL_STUB(glMapGrid2d, _gloffset_MapGrid2d) - GL_STUB(glMapGrid2f, _gloffset_MapGrid2f) - GL_STUB(glEvalCoord1d, _gloffset_EvalCoord1d) - GL_STUB(glEvalCoord1dv, _gloffset_EvalCoord1dv) - GL_STUB(glEvalCoord1f, _gloffset_EvalCoord1f) - GL_STUB(glEvalCoord1fv, _gloffset_EvalCoord1fv) - GL_STUB(glEvalCoord2d, _gloffset_EvalCoord2d) - GL_STUB(glEvalCoord2dv, _gloffset_EvalCoord2dv) - GL_STUB(glEvalCoord2f, _gloffset_EvalCoord2f) - GL_STUB(glEvalCoord2fv, _gloffset_EvalCoord2fv) - GL_STUB(glEvalMesh1, _gloffset_EvalMesh1) - GL_STUB(glEvalPoint1, _gloffset_EvalPoint1) - GL_STUB(glEvalMesh2, _gloffset_EvalMesh2) - GL_STUB(glEvalPoint2, _gloffset_EvalPoint2) - GL_STUB(glAlphaFunc, _gloffset_AlphaFunc) - GL_STUB(glBlendFunc, _gloffset_BlendFunc) - GL_STUB(glLogicOp, _gloffset_LogicOp) - GL_STUB(glStencilFunc, _gloffset_StencilFunc) - GL_STUB(glStencilOp, _gloffset_StencilOp) - GL_STUB(glDepthFunc, _gloffset_DepthFunc) - GL_STUB(glPixelZoom, _gloffset_PixelZoom) - GL_STUB(glPixelTransferf, _gloffset_PixelTransferf) - GL_STUB(glPixelTransferi, _gloffset_PixelTransferi) - GL_STUB(glPixelStoref, _gloffset_PixelStoref) - GL_STUB(glPixelStorei, _gloffset_PixelStorei) - GL_STUB(glPixelMapfv, _gloffset_PixelMapfv) - GL_STUB(glPixelMapuiv, _gloffset_PixelMapuiv) - GL_STUB(glPixelMapusv, _gloffset_PixelMapusv) - GL_STUB(glReadBuffer, _gloffset_ReadBuffer) - GL_STUB(glCopyPixels, _gloffset_CopyPixels) - GL_STUB(glReadPixels, _gloffset_ReadPixels) - GL_STUB(glDrawPixels, _gloffset_DrawPixels) - GL_STUB(glGetBooleanv, _gloffset_GetBooleanv) - GL_STUB(glGetClipPlane, _gloffset_GetClipPlane) - GL_STUB(glGetDoublev, _gloffset_GetDoublev) - GL_STUB(glGetError, _gloffset_GetError) - GL_STUB(glGetFloatv, _gloffset_GetFloatv) - GL_STUB(glGetIntegerv, _gloffset_GetIntegerv) - GL_STUB(glGetLightfv, _gloffset_GetLightfv) - GL_STUB(glGetLightiv, _gloffset_GetLightiv) - GL_STUB(glGetMapdv, _gloffset_GetMapdv) - GL_STUB(glGetMapfv, _gloffset_GetMapfv) - GL_STUB(glGetMapiv, _gloffset_GetMapiv) - GL_STUB(glGetMaterialfv, _gloffset_GetMaterialfv) - GL_STUB(glGetMaterialiv, _gloffset_GetMaterialiv) - GL_STUB(glGetPixelMapfv, _gloffset_GetPixelMapfv) - GL_STUB(glGetPixelMapuiv, _gloffset_GetPixelMapuiv) - GL_STUB(glGetPixelMapusv, _gloffset_GetPixelMapusv) - GL_STUB(glGetPolygonStipple, _gloffset_GetPolygonStipple) - GL_STUB(glGetString, _gloffset_GetString) - GL_STUB(glGetTexEnvfv, _gloffset_GetTexEnvfv) - GL_STUB(glGetTexEnviv, _gloffset_GetTexEnviv) - GL_STUB(glGetTexGendv, _gloffset_GetTexGendv) - GL_STUB(glGetTexGenfv, _gloffset_GetTexGenfv) - GL_STUB(glGetTexGeniv, _gloffset_GetTexGeniv) - GL_STUB(glGetTexImage, _gloffset_GetTexImage) - GL_STUB(glGetTexParameterfv, _gloffset_GetTexParameterfv) - GL_STUB(glGetTexParameteriv, _gloffset_GetTexParameteriv) - GL_STUB(glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv) - GL_STUB(glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv) - GL_STUB(glIsEnabled, _gloffset_IsEnabled) - GL_STUB(glIsList, _gloffset_IsList) - GL_STUB(glDepthRange, _gloffset_DepthRange) - GL_STUB(glFrustum, _gloffset_Frustum) - GL_STUB(glLoadIdentity, _gloffset_LoadIdentity) - GL_STUB(glLoadMatrixf, _gloffset_LoadMatrixf) - GL_STUB(glLoadMatrixd, _gloffset_LoadMatrixd) - GL_STUB(glMatrixMode, _gloffset_MatrixMode) - GL_STUB(glMultMatrixf, _gloffset_MultMatrixf) - GL_STUB(glMultMatrixd, _gloffset_MultMatrixd) - GL_STUB(glOrtho, _gloffset_Ortho) - GL_STUB(glPopMatrix, _gloffset_PopMatrix) - GL_STUB(glPushMatrix, _gloffset_PushMatrix) - GL_STUB(glRotated, _gloffset_Rotated) - GL_STUB(glRotatef, _gloffset_Rotatef) - GL_STUB(glScaled, _gloffset_Scaled) - GL_STUB(glScalef, _gloffset_Scalef) - GL_STUB(glTranslated, _gloffset_Translated) - GL_STUB(glTranslatef, _gloffset_Translatef) - GL_STUB(glViewport, _gloffset_Viewport) - GL_STUB(glArrayElement, _gloffset_ArrayElement) - GL_STUB(glBindTexture, _gloffset_BindTexture) - GL_STUB(glColorPointer, _gloffset_ColorPointer) - GL_STUB(glDisableClientState, _gloffset_DisableClientState) - GL_STUB(glDrawArrays, _gloffset_DrawArrays) - GL_STUB(glDrawElements, _gloffset_DrawElements) - GL_STUB(glEdgeFlagPointer, _gloffset_EdgeFlagPointer) - GL_STUB(glEnableClientState, _gloffset_EnableClientState) - GL_STUB(glIndexPointer, _gloffset_IndexPointer) - GL_STUB(glIndexub, _gloffset_Indexub) - GL_STUB(glIndexubv, _gloffset_Indexubv) - GL_STUB(glInterleavedArrays, _gloffset_InterleavedArrays) - GL_STUB(glNormalPointer, _gloffset_NormalPointer) - GL_STUB(glPolygonOffset, _gloffset_PolygonOffset) - GL_STUB(glTexCoordPointer, _gloffset_TexCoordPointer) - GL_STUB(glVertexPointer, _gloffset_VertexPointer) - GL_STUB(glAreTexturesResident, _gloffset_AreTexturesResident) - GL_STUB(glCopyTexImage1D, _gloffset_CopyTexImage1D) - GL_STUB(glCopyTexImage2D, _gloffset_CopyTexImage2D) - GL_STUB(glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D) - GL_STUB(glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D) - GL_STUB(glDeleteTextures, _gloffset_DeleteTextures) - GL_STUB(glGenTextures, _gloffset_GenTextures) - GL_STUB(glGetPointerv, _gloffset_GetPointerv) - GL_STUB(glIsTexture, _gloffset_IsTexture) - GL_STUB(glPrioritizeTextures, _gloffset_PrioritizeTextures) - GL_STUB(glTexSubImage1D, _gloffset_TexSubImage1D) - GL_STUB(glTexSubImage2D, _gloffset_TexSubImage2D) - GL_STUB(glPopClientAttrib, _gloffset_PopClientAttrib) - GL_STUB(glPushClientAttrib, _gloffset_PushClientAttrib) - GL_STUB(glBlendColor, _gloffset_BlendColor) - GL_STUB(glBlendEquation, _gloffset_BlendEquation) - GL_STUB(glDrawRangeElements, _gloffset_DrawRangeElements) - GL_STUB(glColorTable, _gloffset_ColorTable) - GL_STUB(glColorTableParameterfv, _gloffset_ColorTableParameterfv) - GL_STUB(glColorTableParameteriv, _gloffset_ColorTableParameteriv) - GL_STUB(glCopyColorTable, _gloffset_CopyColorTable) - GL_STUB(glGetColorTable, _gloffset_GetColorTable) - GL_STUB(glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv) - GL_STUB(glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv) - GL_STUB(glColorSubTable, _gloffset_ColorSubTable) - GL_STUB(glCopyColorSubTable, _gloffset_CopyColorSubTable) - GL_STUB(glConvolutionFilter1D, _gloffset_ConvolutionFilter1D) - GL_STUB(glConvolutionFilter2D, _gloffset_ConvolutionFilter2D) - GL_STUB(glConvolutionParameterf, _gloffset_ConvolutionParameterf) - GL_STUB(glConvolutionParameterfv, _gloffset_ConvolutionParameterfv) - GL_STUB(glConvolutionParameteri, _gloffset_ConvolutionParameteri) - GL_STUB(glConvolutionParameteriv, _gloffset_ConvolutionParameteriv) - GL_STUB(glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D) - GL_STUB(glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D) - GL_STUB(glGetConvolutionFilter, _gloffset_GetConvolutionFilter) - GL_STUB(glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv) - GL_STUB(glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv) - GL_STUB(glGetSeparableFilter, _gloffset_GetSeparableFilter) - GL_STUB(glSeparableFilter2D, _gloffset_SeparableFilter2D) - GL_STUB(glGetHistogram, _gloffset_GetHistogram) - GL_STUB(glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv) - GL_STUB(glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv) - GL_STUB(glGetMinmax, _gloffset_GetMinmax) - GL_STUB(glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv) - GL_STUB(glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv) - GL_STUB(glHistogram, _gloffset_Histogram) - GL_STUB(glMinmax, _gloffset_Minmax) - GL_STUB(glResetHistogram, _gloffset_ResetHistogram) - GL_STUB(glResetMinmax, _gloffset_ResetMinmax) - GL_STUB(glTexImage3D, _gloffset_TexImage3D) - GL_STUB(glTexSubImage3D, _gloffset_TexSubImage3D) - GL_STUB(glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D) - GL_STUB(glActiveTextureARB, _gloffset_ActiveTextureARB) - GL_STUB(glClientActiveTextureARB, _gloffset_ClientActiveTextureARB) - GL_STUB(glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB) - GL_STUB(glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB) - GL_STUB(glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB) - GL_STUB(glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB) - GL_STUB(glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB) - GL_STUB(glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB) - GL_STUB(glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB) - GL_STUB(glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB) - GL_STUB(glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB) - GL_STUB(glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB) - GL_STUB(glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB) - GL_STUB(glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB) - GL_STUB(glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB) - GL_STUB(glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB) - GL_STUB(glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB) - GL_STUB(glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB) - GL_STUB(glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB) - GL_STUB(glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB) - GL_STUB(glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB) - GL_STUB(glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB) - GL_STUB(glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB) - GL_STUB(glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB) - GL_STUB(glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB) - GL_STUB(glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB) - GL_STUB(glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB) - GL_STUB(glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB) - GL_STUB(glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB) - GL_STUB(glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB) - GL_STUB(glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB) - GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB) - GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB) - GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB) - GL_STUB(glAttachShader, _gloffset_AttachShader) - GL_STUB(glCreateProgram, _gloffset_CreateProgram) - GL_STUB(glCreateShader, _gloffset_CreateShader) - GL_STUB(glDeleteProgram, _gloffset_DeleteProgram) - GL_STUB(glDeleteShader, _gloffset_DeleteShader) - GL_STUB(glDetachShader, _gloffset_DetachShader) - GL_STUB(glGetAttachedShaders, _gloffset_GetAttachedShaders) - GL_STUB(glGetProgramInfoLog, _gloffset_GetProgramInfoLog) - GL_STUB(glGetProgramiv, _gloffset_GetProgramiv) - GL_STUB(glGetShaderInfoLog, _gloffset_GetShaderInfoLog) - GL_STUB(glGetShaderiv, _gloffset_GetShaderiv) - GL_STUB(glIsProgram, _gloffset_IsProgram) - GL_STUB(glIsShader, _gloffset_IsShader) - GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate) - GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate) - GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate) - GL_STUB(glUniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv) - GL_STUB(glUniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv) - GL_STUB(glUniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv) - GL_STUB(glUniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv) - GL_STUB(glUniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv) - GL_STUB(glUniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv) - GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB) - GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB) - GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB) - GL_STUB(glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB) - GL_STUB(glSampleCoverageARB, _gloffset_SampleCoverageARB) - GL_STUB(glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB) - GL_STUB(glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB) - GL_STUB(glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB) - GL_STUB(glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB) - GL_STUB(glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB) - GL_STUB(glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB) - GL_STUB(glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB) - GL_STUB(glDisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB) - GL_STUB(glEnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB) - GL_STUB(glGetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB) - GL_STUB(glGetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB) - GL_STUB(glGetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB) - GL_STUB(glGetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB) - GL_STUB(glGetProgramStringARB, _gloffset_GetProgramStringARB) - GL_STUB(glGetProgramivARB, _gloffset_GetProgramivARB) - GL_STUB(glGetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB) - GL_STUB(glGetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB) - GL_STUB(glGetVertexAttribivARB, _gloffset_GetVertexAttribivARB) - GL_STUB(glProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB) - GL_STUB(glProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB) - GL_STUB(glProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB) - GL_STUB(glProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB) - GL_STUB(glProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB) - GL_STUB(glProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB) - GL_STUB(glProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB) - GL_STUB(glProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB) - GL_STUB(glProgramStringARB, _gloffset_ProgramStringARB) - GL_STUB(glVertexAttrib1dARB, _gloffset_VertexAttrib1dARB) - GL_STUB(glVertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB) - GL_STUB(glVertexAttrib1fARB, _gloffset_VertexAttrib1fARB) - GL_STUB(glVertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB) - GL_STUB(glVertexAttrib1sARB, _gloffset_VertexAttrib1sARB) - GL_STUB(glVertexAttrib1svARB, _gloffset_VertexAttrib1svARB) - GL_STUB(glVertexAttrib2dARB, _gloffset_VertexAttrib2dARB) - GL_STUB(glVertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB) - GL_STUB(glVertexAttrib2fARB, _gloffset_VertexAttrib2fARB) - GL_STUB(glVertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB) - GL_STUB(glVertexAttrib2sARB, _gloffset_VertexAttrib2sARB) - GL_STUB(glVertexAttrib2svARB, _gloffset_VertexAttrib2svARB) - GL_STUB(glVertexAttrib3dARB, _gloffset_VertexAttrib3dARB) - GL_STUB(glVertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB) - GL_STUB(glVertexAttrib3fARB, _gloffset_VertexAttrib3fARB) - GL_STUB(glVertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB) - GL_STUB(glVertexAttrib3sARB, _gloffset_VertexAttrib3sARB) - GL_STUB(glVertexAttrib3svARB, _gloffset_VertexAttrib3svARB) - GL_STUB(glVertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB) - GL_STUB(glVertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB) - GL_STUB(glVertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB) - GL_STUB(glVertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB) - GL_STUB(glVertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB) - GL_STUB(glVertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB) - GL_STUB(glVertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB) - GL_STUB(glVertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB) - GL_STUB(glVertexAttrib4dARB, _gloffset_VertexAttrib4dARB) - GL_STUB(glVertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB) - GL_STUB(glVertexAttrib4fARB, _gloffset_VertexAttrib4fARB) - GL_STUB(glVertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB) - GL_STUB(glVertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB) - GL_STUB(glVertexAttrib4sARB, _gloffset_VertexAttrib4sARB) - GL_STUB(glVertexAttrib4svARB, _gloffset_VertexAttrib4svARB) - GL_STUB(glVertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB) - GL_STUB(glVertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB) - GL_STUB(glVertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB) - GL_STUB(glVertexAttribPointerARB, _gloffset_VertexAttribPointerARB) - GL_STUB(glBindBufferARB, _gloffset_BindBufferARB) - GL_STUB(glBufferDataARB, _gloffset_BufferDataARB) - GL_STUB(glBufferSubDataARB, _gloffset_BufferSubDataARB) - GL_STUB(glDeleteBuffersARB, _gloffset_DeleteBuffersARB) - GL_STUB(glGenBuffersARB, _gloffset_GenBuffersARB) - GL_STUB(glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB) - GL_STUB(glGetBufferPointervARB, _gloffset_GetBufferPointervARB) - GL_STUB(glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB) - GL_STUB(glIsBufferARB, _gloffset_IsBufferARB) - GL_STUB(glMapBufferARB, _gloffset_MapBufferARB) - GL_STUB(glUnmapBufferARB, _gloffset_UnmapBufferARB) - GL_STUB(glBeginQueryARB, _gloffset_BeginQueryARB) - GL_STUB(glDeleteQueriesARB, _gloffset_DeleteQueriesARB) - GL_STUB(glEndQueryARB, _gloffset_EndQueryARB) - GL_STUB(glGenQueriesARB, _gloffset_GenQueriesARB) - GL_STUB(glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB) - GL_STUB(glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB) - GL_STUB(glGetQueryivARB, _gloffset_GetQueryivARB) - GL_STUB(glIsQueryARB, _gloffset_IsQueryARB) - GL_STUB(glAttachObjectARB, _gloffset_AttachObjectARB) - GL_STUB(glCompileShaderARB, _gloffset_CompileShaderARB) - GL_STUB(glCreateProgramObjectARB, _gloffset_CreateProgramObjectARB) - GL_STUB(glCreateShaderObjectARB, _gloffset_CreateShaderObjectARB) - GL_STUB(glDeleteObjectARB, _gloffset_DeleteObjectARB) - GL_STUB(glDetachObjectARB, _gloffset_DetachObjectARB) - GL_STUB(glGetActiveUniformARB, _gloffset_GetActiveUniformARB) - GL_STUB(glGetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB) - GL_STUB(glGetHandleARB, _gloffset_GetHandleARB) - GL_STUB(glGetInfoLogARB, _gloffset_GetInfoLogARB) - GL_STUB(glGetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB) - GL_STUB(glGetObjectParameterivARB, _gloffset_GetObjectParameterivARB) - GL_STUB(glGetShaderSourceARB, _gloffset_GetShaderSourceARB) - GL_STUB(glGetUniformLocationARB, _gloffset_GetUniformLocationARB) - GL_STUB(glGetUniformfvARB, _gloffset_GetUniformfvARB) - GL_STUB(glGetUniformivARB, _gloffset_GetUniformivARB) - GL_STUB(glLinkProgramARB, _gloffset_LinkProgramARB) - GL_STUB(glShaderSourceARB, _gloffset_ShaderSourceARB) - GL_STUB(glUniform1fARB, _gloffset_Uniform1fARB) - GL_STUB(glUniform1fvARB, _gloffset_Uniform1fvARB) - GL_STUB(glUniform1iARB, _gloffset_Uniform1iARB) - GL_STUB(glUniform1ivARB, _gloffset_Uniform1ivARB) - GL_STUB(glUniform2fARB, _gloffset_Uniform2fARB) - GL_STUB(glUniform2fvARB, _gloffset_Uniform2fvARB) - GL_STUB(glUniform2iARB, _gloffset_Uniform2iARB) - GL_STUB(glUniform2ivARB, _gloffset_Uniform2ivARB) - GL_STUB(glUniform3fARB, _gloffset_Uniform3fARB) - GL_STUB(glUniform3fvARB, _gloffset_Uniform3fvARB) - GL_STUB(glUniform3iARB, _gloffset_Uniform3iARB) - GL_STUB(glUniform3ivARB, _gloffset_Uniform3ivARB) - GL_STUB(glUniform4fARB, _gloffset_Uniform4fARB) - GL_STUB(glUniform4fvARB, _gloffset_Uniform4fvARB) - GL_STUB(glUniform4iARB, _gloffset_Uniform4iARB) - GL_STUB(glUniform4ivARB, _gloffset_Uniform4ivARB) - GL_STUB(glUniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB) - GL_STUB(glUniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB) - GL_STUB(glUniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB) - GL_STUB(glUseProgramObjectARB, _gloffset_UseProgramObjectARB) - GL_STUB(glValidateProgramARB, _gloffset_ValidateProgramARB) - GL_STUB(glBindAttribLocationARB, _gloffset_BindAttribLocationARB) - GL_STUB(glGetActiveAttribARB, _gloffset_GetActiveAttribARB) - GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB) - GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB) - GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT) - GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562) - GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563) - GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564) - GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565) - GL_STUB(gl_dispatch_stub_566, _gloffset__dispatch_stub_566) - GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567) - GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568) - GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569) - GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT) - GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT) - GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT) - GL_STUB(glNormalPointerEXT, _gloffset_NormalPointerEXT) - GL_STUB(glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT) - GL_STUB(glVertexPointerEXT, _gloffset_VertexPointerEXT) - GL_STUB(glPointParameterfEXT, _gloffset_PointParameterfEXT) - GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT) - GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT) - GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT) - GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580) - GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581) - GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT) - GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT) - GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT) - GL_STUB(glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT) - GL_STUB(glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT) - GL_STUB(glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT) - GL_STUB(glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT) - GL_STUB(glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT) - GL_STUB(glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT) - GL_STUB(glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT) - GL_STUB(glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT) - GL_STUB(glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT) - GL_STUB(glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT) - GL_STUB(glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT) - GL_STUB(glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT) - GL_STUB(glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT) - GL_STUB(glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT) - GL_STUB(glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT) - GL_STUB(glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT) - GL_STUB(glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT) - GL_STUB(glFogCoorddEXT, _gloffset_FogCoorddEXT) - GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT) - GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT) - GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT) - GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606) - GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT) - GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV) - GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV) - GL_STUB(glCombinerInputNV, _gloffset_CombinerInputNV) - GL_STUB(glCombinerOutputNV, _gloffset_CombinerOutputNV) - GL_STUB(glCombinerParameterfNV, _gloffset_CombinerParameterfNV) - GL_STUB(glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV) - GL_STUB(glCombinerParameteriNV, _gloffset_CombinerParameteriNV) - GL_STUB(glCombinerParameterivNV, _gloffset_CombinerParameterivNV) - GL_STUB(glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV) - GL_STUB(glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV) - GL_STUB(glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV) - GL_STUB(glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV) - GL_STUB(glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV) - GL_STUB(glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV) - GL_STUB(glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV) - GL_STUB(glResizeBuffersMESA, _gloffset_ResizeBuffersMESA) - GL_STUB(glWindowPos2dMESA, _gloffset_WindowPos2dMESA) - GL_STUB(glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA) - GL_STUB(glWindowPos2fMESA, _gloffset_WindowPos2fMESA) - GL_STUB(glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA) - GL_STUB(glWindowPos2iMESA, _gloffset_WindowPos2iMESA) - GL_STUB(glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA) - GL_STUB(glWindowPos2sMESA, _gloffset_WindowPos2sMESA) - GL_STUB(glWindowPos2svMESA, _gloffset_WindowPos2svMESA) - GL_STUB(glWindowPos3dMESA, _gloffset_WindowPos3dMESA) - GL_STUB(glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA) - GL_STUB(glWindowPos3fMESA, _gloffset_WindowPos3fMESA) - GL_STUB(glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA) - GL_STUB(glWindowPos3iMESA, _gloffset_WindowPos3iMESA) - GL_STUB(glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA) - GL_STUB(glWindowPos3sMESA, _gloffset_WindowPos3sMESA) - GL_STUB(glWindowPos3svMESA, _gloffset_WindowPos3svMESA) - GL_STUB(glWindowPos4dMESA, _gloffset_WindowPos4dMESA) - GL_STUB(glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA) - GL_STUB(glWindowPos4fMESA, _gloffset_WindowPos4fMESA) - GL_STUB(glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA) - GL_STUB(glWindowPos4iMESA, _gloffset_WindowPos4iMESA) - GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA) - GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA) - GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA) - GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648) - GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649) - GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650) - GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651) - GL_STUB(gl_dispatch_stub_652, _gloffset__dispatch_stub_652) - GL_STUB(gl_dispatch_stub_653, _gloffset__dispatch_stub_653) - GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654) - GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655) - GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656) - GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV) - GL_STUB(glBindProgramNV, _gloffset_BindProgramNV) - GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV) - GL_STUB(glExecuteProgramNV, _gloffset_ExecuteProgramNV) - GL_STUB(glGenProgramsNV, _gloffset_GenProgramsNV) - GL_STUB(glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV) - GL_STUB(glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV) - GL_STUB(glGetProgramStringNV, _gloffset_GetProgramStringNV) - GL_STUB(glGetProgramivNV, _gloffset_GetProgramivNV) - GL_STUB(glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV) - GL_STUB(glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV) - GL_STUB(glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV) - GL_STUB(glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV) - GL_STUB(glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV) - GL_STUB(glIsProgramNV, _gloffset_IsProgramNV) - GL_STUB(glLoadProgramNV, _gloffset_LoadProgramNV) - GL_STUB(glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV) - GL_STUB(glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV) - GL_STUB(glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV) - GL_STUB(glTrackMatrixNV, _gloffset_TrackMatrixNV) - GL_STUB(glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV) - GL_STUB(glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV) - GL_STUB(glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV) - GL_STUB(glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV) - GL_STUB(glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV) - GL_STUB(glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV) - GL_STUB(glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV) - GL_STUB(glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV) - GL_STUB(glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV) - GL_STUB(glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV) - GL_STUB(glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV) - GL_STUB(glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV) - GL_STUB(glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV) - GL_STUB(glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV) - GL_STUB(glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV) - GL_STUB(glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV) - GL_STUB(glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV) - GL_STUB(glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV) - GL_STUB(glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV) - GL_STUB(glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV) - GL_STUB(glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV) - GL_STUB(glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV) - GL_STUB(glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV) - GL_STUB(glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV) - GL_STUB(glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV) - GL_STUB(glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV) - GL_STUB(glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV) - GL_STUB(glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV) - GL_STUB(glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV) - GL_STUB(glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV) - GL_STUB(glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV) - GL_STUB(glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV) - GL_STUB(glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV) - GL_STUB(glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV) - GL_STUB(glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV) - GL_STUB(glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV) - GL_STUB(glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV) - GL_STUB(glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV) - GL_STUB(glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV) - GL_STUB(glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV) - GL_STUB(glAlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI) - GL_STUB(glAlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI) - GL_STUB(glAlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI) - GL_STUB(glBeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI) - GL_STUB(glBindFragmentShaderATI, _gloffset_BindFragmentShaderATI) - GL_STUB(glColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI) - GL_STUB(glColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI) - GL_STUB(glColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI) - GL_STUB(glDeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI) - GL_STUB(glEndFragmentShaderATI, _gloffset_EndFragmentShaderATI) - GL_STUB(glGenFragmentShadersATI, _gloffset_GenFragmentShadersATI) - GL_STUB(glPassTexCoordATI, _gloffset_PassTexCoordATI) - GL_STUB(glSampleMapATI, _gloffset_SampleMapATI) - GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI) - GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV) - GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV) - GL_STUB(gl_dispatch_stub_733, _gloffset__dispatch_stub_733) - GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734) - GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735) - GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736) - GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737) - GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV) - GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV) - GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV) - GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV) - GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV) - GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV) - GL_STUB(gl_dispatch_stub_744, _gloffset__dispatch_stub_744) - GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745) - GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT) - GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT) - GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT) - GL_STUB(glDeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT) - GL_STUB(glDeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT) - GL_STUB(glFramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT) - GL_STUB(glFramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT) - GL_STUB(glFramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT) - GL_STUB(glFramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT) - GL_STUB(glGenFramebuffersEXT, _gloffset_GenFramebuffersEXT) - GL_STUB(glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT) - GL_STUB(glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT) - GL_STUB(glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT) - GL_STUB(glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT) - GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT) - GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) - GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) - GL_STUB(gl_dispatch_stub_763, _gloffset__dispatch_stub_763) - GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT) - GL_STUB(gl_dispatch_stub_765, _gloffset__dispatch_stub_765) - GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766) - GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767) - GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768) - GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769) - - .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function -_mesa_sparc_glapi_end: - - .globl glArrayElementEXT ; .type glArrayElementEXT,#function ; glArrayElementEXT = glArrayElement - .globl glBindTextureEXT ; .type glBindTextureEXT,#function ; glBindTextureEXT = glBindTexture - .globl glDrawArraysEXT ; .type glDrawArraysEXT,#function ; glDrawArraysEXT = glDrawArrays -#ifndef GLX_INDIRECT_RENDERING - .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function ; glAreTexturesResidentEXT = glAreTexturesResident -#endif - .globl glCopyTexImage1DEXT ; .type glCopyTexImage1DEXT,#function ; glCopyTexImage1DEXT = glCopyTexImage1D - .globl glCopyTexImage2DEXT ; .type glCopyTexImage2DEXT,#function ; glCopyTexImage2DEXT = glCopyTexImage2D - .globl glCopyTexSubImage1DEXT ; .type glCopyTexSubImage1DEXT,#function ; glCopyTexSubImage1DEXT = glCopyTexSubImage1D - .globl glCopyTexSubImage2DEXT ; .type glCopyTexSubImage2DEXT,#function ; glCopyTexSubImage2DEXT = glCopyTexSubImage2D -#ifndef GLX_INDIRECT_RENDERING - .globl glDeleteTexturesEXT ; .type glDeleteTexturesEXT,#function ; glDeleteTexturesEXT = glDeleteTextures -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function ; glGenTexturesEXT = glGenTextures -#endif - .globl glGetPointervEXT ; .type glGetPointervEXT,#function ; glGetPointervEXT = glGetPointerv -#ifndef GLX_INDIRECT_RENDERING - .globl glIsTextureEXT ; .type glIsTextureEXT,#function ; glIsTextureEXT = glIsTexture -#endif - .globl glPrioritizeTexturesEXT ; .type glPrioritizeTexturesEXT,#function ; glPrioritizeTexturesEXT = glPrioritizeTextures - .globl glTexSubImage1DEXT ; .type glTexSubImage1DEXT,#function ; glTexSubImage1DEXT = glTexSubImage1D - .globl glTexSubImage2DEXT ; .type glTexSubImage2DEXT,#function ; glTexSubImage2DEXT = glTexSubImage2D - .globl glBlendColorEXT ; .type glBlendColorEXT,#function ; glBlendColorEXT = glBlendColor - .globl glBlendEquationEXT ; .type glBlendEquationEXT,#function ; glBlendEquationEXT = glBlendEquation - .globl glDrawRangeElementsEXT ; .type glDrawRangeElementsEXT,#function ; glDrawRangeElementsEXT = glDrawRangeElements - .globl glColorTableEXT ; .type glColorTableEXT,#function ; glColorTableEXT = glColorTable -#ifndef GLX_INDIRECT_RENDERING - .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function ; glGetColorTableEXT = glGetColorTable -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function ; glGetColorTableParameterfvEXT = glGetColorTableParameterfv -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function ; glGetColorTableParameterivEXT = glGetColorTableParameteriv -#endif - .globl glTexImage3DEXT ; .type glTexImage3DEXT,#function ; glTexImage3DEXT = glTexImage3D - .globl glTexSubImage3DEXT ; .type glTexSubImage3DEXT,#function ; glTexSubImage3DEXT = glTexSubImage3D - .globl glCopyTexSubImage3DEXT ; .type glCopyTexSubImage3DEXT,#function ; glCopyTexSubImage3DEXT = glCopyTexSubImage3D - .globl glActiveTexture ; .type glActiveTexture,#function ; glActiveTexture = glActiveTextureARB - .globl glClientActiveTexture ; .type glClientActiveTexture,#function ; glClientActiveTexture = glClientActiveTextureARB - .globl glMultiTexCoord1d ; .type glMultiTexCoord1d,#function ; glMultiTexCoord1d = glMultiTexCoord1dARB - .globl glMultiTexCoord1dv ; .type glMultiTexCoord1dv,#function ; glMultiTexCoord1dv = glMultiTexCoord1dvARB - .globl glMultiTexCoord1f ; .type glMultiTexCoord1f,#function ; glMultiTexCoord1f = glMultiTexCoord1fARB - .globl glMultiTexCoord1fv ; .type glMultiTexCoord1fv,#function ; glMultiTexCoord1fv = glMultiTexCoord1fvARB - .globl glMultiTexCoord1i ; .type glMultiTexCoord1i,#function ; glMultiTexCoord1i = glMultiTexCoord1iARB - .globl glMultiTexCoord1iv ; .type glMultiTexCoord1iv,#function ; glMultiTexCoord1iv = glMultiTexCoord1ivARB - .globl glMultiTexCoord1s ; .type glMultiTexCoord1s,#function ; glMultiTexCoord1s = glMultiTexCoord1sARB - .globl glMultiTexCoord1sv ; .type glMultiTexCoord1sv,#function ; glMultiTexCoord1sv = glMultiTexCoord1svARB - .globl glMultiTexCoord2d ; .type glMultiTexCoord2d,#function ; glMultiTexCoord2d = glMultiTexCoord2dARB - .globl glMultiTexCoord2dv ; .type glMultiTexCoord2dv,#function ; glMultiTexCoord2dv = glMultiTexCoord2dvARB - .globl glMultiTexCoord2f ; .type glMultiTexCoord2f,#function ; glMultiTexCoord2f = glMultiTexCoord2fARB - .globl glMultiTexCoord2fv ; .type glMultiTexCoord2fv,#function ; glMultiTexCoord2fv = glMultiTexCoord2fvARB - .globl glMultiTexCoord2i ; .type glMultiTexCoord2i,#function ; glMultiTexCoord2i = glMultiTexCoord2iARB - .globl glMultiTexCoord2iv ; .type glMultiTexCoord2iv,#function ; glMultiTexCoord2iv = glMultiTexCoord2ivARB - .globl glMultiTexCoord2s ; .type glMultiTexCoord2s,#function ; glMultiTexCoord2s = glMultiTexCoord2sARB - .globl glMultiTexCoord2sv ; .type glMultiTexCoord2sv,#function ; glMultiTexCoord2sv = glMultiTexCoord2svARB - .globl glMultiTexCoord3d ; .type glMultiTexCoord3d,#function ; glMultiTexCoord3d = glMultiTexCoord3dARB - .globl glMultiTexCoord3dv ; .type glMultiTexCoord3dv,#function ; glMultiTexCoord3dv = glMultiTexCoord3dvARB - .globl glMultiTexCoord3f ; .type glMultiTexCoord3f,#function ; glMultiTexCoord3f = glMultiTexCoord3fARB - .globl glMultiTexCoord3fv ; .type glMultiTexCoord3fv,#function ; glMultiTexCoord3fv = glMultiTexCoord3fvARB - .globl glMultiTexCoord3i ; .type glMultiTexCoord3i,#function ; glMultiTexCoord3i = glMultiTexCoord3iARB - .globl glMultiTexCoord3iv ; .type glMultiTexCoord3iv,#function ; glMultiTexCoord3iv = glMultiTexCoord3ivARB - .globl glMultiTexCoord3s ; .type glMultiTexCoord3s,#function ; glMultiTexCoord3s = glMultiTexCoord3sARB - .globl glMultiTexCoord3sv ; .type glMultiTexCoord3sv,#function ; glMultiTexCoord3sv = glMultiTexCoord3svARB - .globl glMultiTexCoord4d ; .type glMultiTexCoord4d,#function ; glMultiTexCoord4d = glMultiTexCoord4dARB - .globl glMultiTexCoord4dv ; .type glMultiTexCoord4dv,#function ; glMultiTexCoord4dv = glMultiTexCoord4dvARB - .globl glMultiTexCoord4f ; .type glMultiTexCoord4f,#function ; glMultiTexCoord4f = glMultiTexCoord4fARB - .globl glMultiTexCoord4fv ; .type glMultiTexCoord4fv,#function ; glMultiTexCoord4fv = glMultiTexCoord4fvARB - .globl glMultiTexCoord4i ; .type glMultiTexCoord4i,#function ; glMultiTexCoord4i = glMultiTexCoord4iARB - .globl glMultiTexCoord4iv ; .type glMultiTexCoord4iv,#function ; glMultiTexCoord4iv = glMultiTexCoord4ivARB - .globl glMultiTexCoord4s ; .type glMultiTexCoord4s,#function ; glMultiTexCoord4s = glMultiTexCoord4sARB - .globl glMultiTexCoord4sv ; .type glMultiTexCoord4sv,#function ; glMultiTexCoord4sv = glMultiTexCoord4svARB - .globl glLoadTransposeMatrixd ; .type glLoadTransposeMatrixd,#function ; glLoadTransposeMatrixd = glLoadTransposeMatrixdARB - .globl glLoadTransposeMatrixf ; .type glLoadTransposeMatrixf,#function ; glLoadTransposeMatrixf = glLoadTransposeMatrixfARB - .globl glMultTransposeMatrixd ; .type glMultTransposeMatrixd,#function ; glMultTransposeMatrixd = glMultTransposeMatrixdARB - .globl glMultTransposeMatrixf ; .type glMultTransposeMatrixf,#function ; glMultTransposeMatrixf = glMultTransposeMatrixfARB - .globl glSampleCoverage ; .type glSampleCoverage,#function ; glSampleCoverage = glSampleCoverageARB - .globl glCompressedTexImage1D ; .type glCompressedTexImage1D,#function ; glCompressedTexImage1D = glCompressedTexImage1DARB - .globl glCompressedTexImage2D ; .type glCompressedTexImage2D,#function ; glCompressedTexImage2D = glCompressedTexImage2DARB - .globl glCompressedTexImage3D ; .type glCompressedTexImage3D,#function ; glCompressedTexImage3D = glCompressedTexImage3DARB - .globl glCompressedTexSubImage1D ; .type glCompressedTexSubImage1D,#function ; glCompressedTexSubImage1D = glCompressedTexSubImage1DARB - .globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB - .globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB - .globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB - .globl glDisableVertexAttribArray ; .type glDisableVertexAttribArray,#function ; glDisableVertexAttribArray = glDisableVertexAttribArrayARB - .globl glEnableVertexAttribArray ; .type glEnableVertexAttribArray,#function ; glEnableVertexAttribArray = glEnableVertexAttribArrayARB - .globl glGetVertexAttribdv ; .type glGetVertexAttribdv,#function ; glGetVertexAttribdv = glGetVertexAttribdvARB - .globl glGetVertexAttribfv ; .type glGetVertexAttribfv,#function ; glGetVertexAttribfv = glGetVertexAttribfvARB - .globl glGetVertexAttribiv ; .type glGetVertexAttribiv,#function ; glGetVertexAttribiv = glGetVertexAttribivARB - .globl glProgramParameter4dNV ; .type glProgramParameter4dNV,#function ; glProgramParameter4dNV = glProgramEnvParameter4dARB - .globl glProgramParameter4dvNV ; .type glProgramParameter4dvNV,#function ; glProgramParameter4dvNV = glProgramEnvParameter4dvARB - .globl glProgramParameter4fNV ; .type glProgramParameter4fNV,#function ; glProgramParameter4fNV = glProgramEnvParameter4fARB - .globl glProgramParameter4fvNV ; .type glProgramParameter4fvNV,#function ; glProgramParameter4fvNV = glProgramEnvParameter4fvARB - .globl glVertexAttrib1d ; .type glVertexAttrib1d,#function ; glVertexAttrib1d = glVertexAttrib1dARB - .globl glVertexAttrib1dv ; .type glVertexAttrib1dv,#function ; glVertexAttrib1dv = glVertexAttrib1dvARB - .globl glVertexAttrib1f ; .type glVertexAttrib1f,#function ; glVertexAttrib1f = glVertexAttrib1fARB - .globl glVertexAttrib1fv ; .type glVertexAttrib1fv,#function ; glVertexAttrib1fv = glVertexAttrib1fvARB - .globl glVertexAttrib1s ; .type glVertexAttrib1s,#function ; glVertexAttrib1s = glVertexAttrib1sARB - .globl glVertexAttrib1sv ; .type glVertexAttrib1sv,#function ; glVertexAttrib1sv = glVertexAttrib1svARB - .globl glVertexAttrib2d ; .type glVertexAttrib2d,#function ; glVertexAttrib2d = glVertexAttrib2dARB - .globl glVertexAttrib2dv ; .type glVertexAttrib2dv,#function ; glVertexAttrib2dv = glVertexAttrib2dvARB - .globl glVertexAttrib2f ; .type glVertexAttrib2f,#function ; glVertexAttrib2f = glVertexAttrib2fARB - .globl glVertexAttrib2fv ; .type glVertexAttrib2fv,#function ; glVertexAttrib2fv = glVertexAttrib2fvARB - .globl glVertexAttrib2s ; .type glVertexAttrib2s,#function ; glVertexAttrib2s = glVertexAttrib2sARB - .globl glVertexAttrib2sv ; .type glVertexAttrib2sv,#function ; glVertexAttrib2sv = glVertexAttrib2svARB - .globl glVertexAttrib3d ; .type glVertexAttrib3d,#function ; glVertexAttrib3d = glVertexAttrib3dARB - .globl glVertexAttrib3dv ; .type glVertexAttrib3dv,#function ; glVertexAttrib3dv = glVertexAttrib3dvARB - .globl glVertexAttrib3f ; .type glVertexAttrib3f,#function ; glVertexAttrib3f = glVertexAttrib3fARB - .globl glVertexAttrib3fv ; .type glVertexAttrib3fv,#function ; glVertexAttrib3fv = glVertexAttrib3fvARB - .globl glVertexAttrib3s ; .type glVertexAttrib3s,#function ; glVertexAttrib3s = glVertexAttrib3sARB - .globl glVertexAttrib3sv ; .type glVertexAttrib3sv,#function ; glVertexAttrib3sv = glVertexAttrib3svARB - .globl glVertexAttrib4Nbv ; .type glVertexAttrib4Nbv,#function ; glVertexAttrib4Nbv = glVertexAttrib4NbvARB - .globl glVertexAttrib4Niv ; .type glVertexAttrib4Niv,#function ; glVertexAttrib4Niv = glVertexAttrib4NivARB - .globl glVertexAttrib4Nsv ; .type glVertexAttrib4Nsv,#function ; glVertexAttrib4Nsv = glVertexAttrib4NsvARB - .globl glVertexAttrib4Nub ; .type glVertexAttrib4Nub,#function ; glVertexAttrib4Nub = glVertexAttrib4NubARB - .globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB - .globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB - .globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB - .globl glVertexAttrib4bv ; .type glVertexAttrib4bv,#function ; glVertexAttrib4bv = glVertexAttrib4bvARB - .globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB - .globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB - .globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB - .globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB - .globl glVertexAttrib4iv ; .type glVertexAttrib4iv,#function ; glVertexAttrib4iv = glVertexAttrib4ivARB - .globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB - .globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB - .globl glVertexAttrib4ubv ; .type glVertexAttrib4ubv,#function ; glVertexAttrib4ubv = glVertexAttrib4ubvARB - .globl glVertexAttrib4uiv ; .type glVertexAttrib4uiv,#function ; glVertexAttrib4uiv = glVertexAttrib4uivARB - .globl glVertexAttrib4usv ; .type glVertexAttrib4usv,#function ; glVertexAttrib4usv = glVertexAttrib4usvARB - .globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB - .globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB - .globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB - .globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB - .globl glDeleteBuffers ; .type glDeleteBuffers,#function ; glDeleteBuffers = glDeleteBuffersARB - .globl glGenBuffers ; .type glGenBuffers,#function ; glGenBuffers = glGenBuffersARB - .globl glGetBufferParameteriv ; .type glGetBufferParameteriv,#function ; glGetBufferParameteriv = glGetBufferParameterivARB - .globl glGetBufferPointerv ; .type glGetBufferPointerv,#function ; glGetBufferPointerv = glGetBufferPointervARB - .globl glGetBufferSubData ; .type glGetBufferSubData,#function ; glGetBufferSubData = glGetBufferSubDataARB - .globl glIsBuffer ; .type glIsBuffer,#function ; glIsBuffer = glIsBufferARB - .globl glMapBuffer ; .type glMapBuffer,#function ; glMapBuffer = glMapBufferARB - .globl glUnmapBuffer ; .type glUnmapBuffer,#function ; glUnmapBuffer = glUnmapBufferARB - .globl glBeginQuery ; .type glBeginQuery,#function ; glBeginQuery = glBeginQueryARB - .globl glDeleteQueries ; .type glDeleteQueries,#function ; glDeleteQueries = glDeleteQueriesARB - .globl glEndQuery ; .type glEndQuery,#function ; glEndQuery = glEndQueryARB - .globl glGenQueries ; .type glGenQueries,#function ; glGenQueries = glGenQueriesARB - .globl glGetQueryObjectiv ; .type glGetQueryObjectiv,#function ; glGetQueryObjectiv = glGetQueryObjectivARB - .globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB - .globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB - .globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB - .globl glCompileShader ; .type glCompileShader,#function ; glCompileShader = glCompileShaderARB - .globl glGetActiveUniform ; .type glGetActiveUniform,#function ; glGetActiveUniform = glGetActiveUniformARB - .globl glGetShaderSource ; .type glGetShaderSource,#function ; glGetShaderSource = glGetShaderSourceARB - .globl glGetUniformLocation ; .type glGetUniformLocation,#function ; glGetUniformLocation = glGetUniformLocationARB - .globl glGetUniformfv ; .type glGetUniformfv,#function ; glGetUniformfv = glGetUniformfvARB - .globl glGetUniformiv ; .type glGetUniformiv,#function ; glGetUniformiv = glGetUniformivARB - .globl glLinkProgram ; .type glLinkProgram,#function ; glLinkProgram = glLinkProgramARB - .globl glShaderSource ; .type glShaderSource,#function ; glShaderSource = glShaderSourceARB - .globl glUniform1f ; .type glUniform1f,#function ; glUniform1f = glUniform1fARB - .globl glUniform1fv ; .type glUniform1fv,#function ; glUniform1fv = glUniform1fvARB - .globl glUniform1i ; .type glUniform1i,#function ; glUniform1i = glUniform1iARB - .globl glUniform1iv ; .type glUniform1iv,#function ; glUniform1iv = glUniform1ivARB - .globl glUniform2f ; .type glUniform2f,#function ; glUniform2f = glUniform2fARB - .globl glUniform2fv ; .type glUniform2fv,#function ; glUniform2fv = glUniform2fvARB - .globl glUniform2i ; .type glUniform2i,#function ; glUniform2i = glUniform2iARB - .globl glUniform2iv ; .type glUniform2iv,#function ; glUniform2iv = glUniform2ivARB - .globl glUniform3f ; .type glUniform3f,#function ; glUniform3f = glUniform3fARB - .globl glUniform3fv ; .type glUniform3fv,#function ; glUniform3fv = glUniform3fvARB - .globl glUniform3i ; .type glUniform3i,#function ; glUniform3i = glUniform3iARB - .globl glUniform3iv ; .type glUniform3iv,#function ; glUniform3iv = glUniform3ivARB - .globl glUniform4f ; .type glUniform4f,#function ; glUniform4f = glUniform4fARB - .globl glUniform4fv ; .type glUniform4fv,#function ; glUniform4fv = glUniform4fvARB - .globl glUniform4i ; .type glUniform4i,#function ; glUniform4i = glUniform4iARB - .globl glUniform4iv ; .type glUniform4iv,#function ; glUniform4iv = glUniform4ivARB - .globl glUniformMatrix2fv ; .type glUniformMatrix2fv,#function ; glUniformMatrix2fv = glUniformMatrix2fvARB - .globl glUniformMatrix3fv ; .type glUniformMatrix3fv,#function ; glUniformMatrix3fv = glUniformMatrix3fvARB - .globl glUniformMatrix4fv ; .type glUniformMatrix4fv,#function ; glUniformMatrix4fv = glUniformMatrix4fvARB - .globl glUseProgram ; .type glUseProgram,#function ; glUseProgram = glUseProgramObjectARB - .globl glValidateProgram ; .type glValidateProgram,#function ; glValidateProgram = glValidateProgramARB - .globl glBindAttribLocation ; .type glBindAttribLocation,#function ; glBindAttribLocation = glBindAttribLocationARB - .globl glGetActiveAttrib ; .type glGetActiveAttrib,#function ; glGetActiveAttrib = glGetActiveAttribARB - .globl glGetAttribLocation ; .type glGetAttribLocation,#function ; glGetAttribLocation = glGetAttribLocationARB - .globl glDrawBuffers ; .type glDrawBuffers,#function ; glDrawBuffers = glDrawBuffersARB - .globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB - .globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT - .globl glPointParameterfARB ; .type glPointParameterfARB,#function ; glPointParameterfARB = glPointParameterfEXT - .globl glPointParameterfv ; .type glPointParameterfv,#function ; glPointParameterfv = glPointParameterfvEXT - .globl glPointParameterfvARB ; .type glPointParameterfvARB,#function ; glPointParameterfvARB = glPointParameterfvEXT - .globl glSecondaryColor3b ; .type glSecondaryColor3b,#function ; glSecondaryColor3b = glSecondaryColor3bEXT - .globl glSecondaryColor3bv ; .type glSecondaryColor3bv,#function ; glSecondaryColor3bv = glSecondaryColor3bvEXT - .globl glSecondaryColor3d ; .type glSecondaryColor3d,#function ; glSecondaryColor3d = glSecondaryColor3dEXT - .globl glSecondaryColor3dv ; .type glSecondaryColor3dv,#function ; glSecondaryColor3dv = glSecondaryColor3dvEXT - .globl glSecondaryColor3f ; .type glSecondaryColor3f,#function ; glSecondaryColor3f = glSecondaryColor3fEXT - .globl glSecondaryColor3fv ; .type glSecondaryColor3fv,#function ; glSecondaryColor3fv = glSecondaryColor3fvEXT - .globl glSecondaryColor3i ; .type glSecondaryColor3i,#function ; glSecondaryColor3i = glSecondaryColor3iEXT - .globl glSecondaryColor3iv ; .type glSecondaryColor3iv,#function ; glSecondaryColor3iv = glSecondaryColor3ivEXT - .globl glSecondaryColor3s ; .type glSecondaryColor3s,#function ; glSecondaryColor3s = glSecondaryColor3sEXT - .globl glSecondaryColor3sv ; .type glSecondaryColor3sv,#function ; glSecondaryColor3sv = glSecondaryColor3svEXT - .globl glSecondaryColor3ub ; .type glSecondaryColor3ub,#function ; glSecondaryColor3ub = glSecondaryColor3ubEXT - .globl glSecondaryColor3ubv ; .type glSecondaryColor3ubv,#function ; glSecondaryColor3ubv = glSecondaryColor3ubvEXT - .globl glSecondaryColor3ui ; .type glSecondaryColor3ui,#function ; glSecondaryColor3ui = glSecondaryColor3uiEXT - .globl glSecondaryColor3uiv ; .type glSecondaryColor3uiv,#function ; glSecondaryColor3uiv = glSecondaryColor3uivEXT - .globl glSecondaryColor3us ; .type glSecondaryColor3us,#function ; glSecondaryColor3us = glSecondaryColor3usEXT - .globl glSecondaryColor3usv ; .type glSecondaryColor3usv,#function ; glSecondaryColor3usv = glSecondaryColor3usvEXT - .globl glSecondaryColorPointer ; .type glSecondaryColorPointer,#function ; glSecondaryColorPointer = glSecondaryColorPointerEXT - .globl glMultiDrawArrays ; .type glMultiDrawArrays,#function ; glMultiDrawArrays = glMultiDrawArraysEXT - .globl glMultiDrawElements ; .type glMultiDrawElements,#function ; glMultiDrawElements = glMultiDrawElementsEXT - .globl glFogCoordPointer ; .type glFogCoordPointer,#function ; glFogCoordPointer = glFogCoordPointerEXT - .globl glFogCoordd ; .type glFogCoordd,#function ; glFogCoordd = glFogCoorddEXT - .globl glFogCoorddv ; .type glFogCoorddv,#function ; glFogCoorddv = glFogCoorddvEXT - .globl glFogCoordf ; .type glFogCoordf,#function ; glFogCoordf = glFogCoordfEXT - .globl glFogCoordfv ; .type glFogCoordfv,#function ; glFogCoordfv = glFogCoordfvEXT - .globl glBlendFuncSeparate ; .type glBlendFuncSeparate,#function ; glBlendFuncSeparate = glBlendFuncSeparateEXT - .globl glWindowPos2d ; .type glWindowPos2d,#function ; glWindowPos2d = glWindowPos2dMESA - .globl glWindowPos2dARB ; .type glWindowPos2dARB,#function ; glWindowPos2dARB = glWindowPos2dMESA - .globl glWindowPos2dv ; .type glWindowPos2dv,#function ; glWindowPos2dv = glWindowPos2dvMESA - .globl glWindowPos2dvARB ; .type glWindowPos2dvARB,#function ; glWindowPos2dvARB = glWindowPos2dvMESA - .globl glWindowPos2f ; .type glWindowPos2f,#function ; glWindowPos2f = glWindowPos2fMESA - .globl glWindowPos2fARB ; .type glWindowPos2fARB,#function ; glWindowPos2fARB = glWindowPos2fMESA - .globl glWindowPos2fv ; .type glWindowPos2fv,#function ; glWindowPos2fv = glWindowPos2fvMESA - .globl glWindowPos2fvARB ; .type glWindowPos2fvARB,#function ; glWindowPos2fvARB = glWindowPos2fvMESA - .globl glWindowPos2i ; .type glWindowPos2i,#function ; glWindowPos2i = glWindowPos2iMESA - .globl glWindowPos2iARB ; .type glWindowPos2iARB,#function ; glWindowPos2iARB = glWindowPos2iMESA - .globl glWindowPos2iv ; .type glWindowPos2iv,#function ; glWindowPos2iv = glWindowPos2ivMESA - .globl glWindowPos2ivARB ; .type glWindowPos2ivARB,#function ; glWindowPos2ivARB = glWindowPos2ivMESA - .globl glWindowPos2s ; .type glWindowPos2s,#function ; glWindowPos2s = glWindowPos2sMESA - .globl glWindowPos2sARB ; .type glWindowPos2sARB,#function ; glWindowPos2sARB = glWindowPos2sMESA - .globl glWindowPos2sv ; .type glWindowPos2sv,#function ; glWindowPos2sv = glWindowPos2svMESA - .globl glWindowPos2svARB ; .type glWindowPos2svARB,#function ; glWindowPos2svARB = glWindowPos2svMESA - .globl glWindowPos3d ; .type glWindowPos3d,#function ; glWindowPos3d = glWindowPos3dMESA - .globl glWindowPos3dARB ; .type glWindowPos3dARB,#function ; glWindowPos3dARB = glWindowPos3dMESA - .globl glWindowPos3dv ; .type glWindowPos3dv,#function ; glWindowPos3dv = glWindowPos3dvMESA - .globl glWindowPos3dvARB ; .type glWindowPos3dvARB,#function ; glWindowPos3dvARB = glWindowPos3dvMESA - .globl glWindowPos3f ; .type glWindowPos3f,#function ; glWindowPos3f = glWindowPos3fMESA - .globl glWindowPos3fARB ; .type glWindowPos3fARB,#function ; glWindowPos3fARB = glWindowPos3fMESA - .globl glWindowPos3fv ; .type glWindowPos3fv,#function ; glWindowPos3fv = glWindowPos3fvMESA - .globl glWindowPos3fvARB ; .type glWindowPos3fvARB,#function ; glWindowPos3fvARB = glWindowPos3fvMESA - .globl glWindowPos3i ; .type glWindowPos3i,#function ; glWindowPos3i = glWindowPos3iMESA - .globl glWindowPos3iARB ; .type glWindowPos3iARB,#function ; glWindowPos3iARB = glWindowPos3iMESA - .globl glWindowPos3iv ; .type glWindowPos3iv,#function ; glWindowPos3iv = glWindowPos3ivMESA - .globl glWindowPos3ivARB ; .type glWindowPos3ivARB,#function ; glWindowPos3ivARB = glWindowPos3ivMESA - .globl glWindowPos3s ; .type glWindowPos3s,#function ; glWindowPos3s = glWindowPos3sMESA - .globl glWindowPos3sARB ; .type glWindowPos3sARB,#function ; glWindowPos3sARB = glWindowPos3sMESA - .globl glWindowPos3sv ; .type glWindowPos3sv,#function ; glWindowPos3sv = glWindowPos3svMESA - .globl glWindowPos3svARB ; .type glWindowPos3svARB,#function ; glWindowPos3svARB = glWindowPos3svMESA - .globl glBindProgramARB ; .type glBindProgramARB,#function ; glBindProgramARB = glBindProgramNV - .globl glDeleteProgramsARB ; .type glDeleteProgramsARB,#function ; glDeleteProgramsARB = glDeleteProgramsNV - .globl glGenProgramsARB ; .type glGenProgramsARB,#function ; glGenProgramsARB = glGenProgramsNV - .globl glGetVertexAttribPointerv ; .type glGetVertexAttribPointerv,#function ; glGetVertexAttribPointerv = glGetVertexAttribPointervNV - .globl glGetVertexAttribPointervARB ; .type glGetVertexAttribPointervARB,#function ; glGetVertexAttribPointervARB = glGetVertexAttribPointervNV - .globl glIsProgramARB ; .type glIsProgramARB,#function ; glIsProgramARB = glIsProgramNV - .globl glPointParameteri ; .type glPointParameteri,#function ; glPointParameteri = glPointParameteriNV - .globl glPointParameteriv ; .type glPointParameteriv,#function ; glPointParameteriv = glPointParameterivNV - .globl glBlendEquationSeparate ; .type glBlendEquationSeparate,#function ; glBlendEquationSeparate = glBlendEquationSeparateEXT diff --git a/src/libs/mesa/mesa/sparc/norm.S b/src/libs/mesa/mesa/sparc/norm.S deleted file mode 100644 index 44950a10a5..0000000000 --- a/src/libs/mesa/mesa/sparc/norm.S +++ /dev/null @@ -1,608 +0,0 @@ - -#include "sparc_matrix.h" - -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) - /* Solaris requires this for 64-bit. */ - .register %g2, #scratch - .register %g3, #scratch -#endif - - .text - -#ifdef __arch64__ -#define STACK_VAR_OFF (2047 + (8 * 16)) -#else -#define STACK_VAR_OFF (4 * 16) -#endif - - /* Newton-Raphson approximation turns out to be slower - * (and less accurate) than direct fsqrts/fdivs. - */ -#define ONE_DOT_ZERO 0x3f800000 - - .globl _mesa_sparc_transform_normalize_normals -_mesa_sparc_transform_normalize_normals: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - - sethi %hi(ONE_DOT_ZERO), %g2 - sub %sp, 16, %sp - st %g2, [%sp + STACK_VAR_OFF+0x0] - st %o1, [%sp + STACK_VAR_OFF+0x4] - ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f - ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale - add %sp, 16, %sp - - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_1_2_4_5_6_8_9_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - cmp %o3, 0 - bne 4f - clr %o4 ! 'i' for STRIDE_LOOP - -1: /* LENGTHS == NULL */ - ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) + (uy * m1) + (uz * m2) - * ty (f5) = (ux * m4) + (uy * m5) + (uz * m6) - * tz (f7) = (ux * m8) + (uy * m9) + (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - fmuls %f1, M1, %f4 ! FGM Group - fmuls %f0, M4, %f5 ! FGM Group - fmuls %f1, M5, %f6 ! FGM Group - fmuls %f0, M8, %f7 ! FGM Group f3 available - fmuls %f1, M9, %f8 ! FGM Group f4 available - fadds %f3, %f4, %f3 ! FGA - fmuls %f2, M2, %f10 ! FGM Group f5 available - fmuls %f2, M6, %f0 ! FGM Group f6 available - fadds %f5, %f6, %f5 ! FGA - fmuls %f2, M10, %f4 ! FGM Group f7 available - fadds %f7, %f8, %f7 ! FGA Group f8,f3 available - fadds %f3, %f10, %f3 ! FGA Group f10 available - fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available - fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available - - /* f3=tx, f5=ty, f7=tz */ - - /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */ - fmuls %f3, %f3, %f6 ! FGM Group f3 available - fmuls %f5, %f5, %f8 ! FGM Group f5 available - fmuls %f7, %f7, %f10 ! FGM Group f7 available - fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available - fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available - - /* scale (f6) = 1.0 / sqrt(len) */ - fsqrts %f6, %f6 ! FDIV 20 cycles - fdivs %f12, %f6, %f6 ! FDIV 14 cycles - - fmuls %f3, %f6, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale - fmuls %f5, %f6, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale - fmuls %f7, %f6, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - - ba 7f - nop - -4: /* LENGTHS != NULL */ - fmuls M0, %f15, M0 - fmuls M1, %f15, M1 - fmuls M2, %f15, M2 - fmuls M4, %f15, M4 - fmuls M5, %f15, M5 - fmuls M6, %f15, M6 - fmuls M8, %f15, M8 - fmuls M9, %f15, M9 - fmuls M10, %f15, M10 - -5: - ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) + (uy * m1) + (uz * m2) - * ty (f5) = (ux * m4) + (uy * m5) + (uz * m6) - * tz (f7) = (ux * m8) + (uy * m9) + (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - fmuls %f1, M1, %f4 ! FGM Group - fmuls %f0, M4, %f5 ! FGM Group - fmuls %f1, M5, %f6 ! FGM Group - fmuls %f0, M8, %f7 ! FGM Group f3 available - fmuls %f1, M9, %f8 ! FGM Group f4 available - fadds %f3, %f4, %f3 ! FGA - fmuls %f2, M2, %f10 ! FGM Group f5 available - fmuls %f2, M6, %f0 ! FGM Group f6 available - fadds %f5, %f6, %f5 ! FGA - fmuls %f2, M10, %f4 ! FGM Group f7 available - fadds %f7, %f8, %f7 ! FGA Group f8,f3 available - fadds %f3, %f10, %f3 ! FGA Group f10 available - ld [%o3], %f13 ! LSU - fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available - add %o3, 4, %o3 ! IEU0 - fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available - - /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */ - - fmuls %f3, %f13, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * len - fmuls %f5, %f13, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * len - fmuls %f7, %f13, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * len - - cmp %o4, %g1 ! continue if (i < count) - bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_transform_normalize_normals_no_rot -_mesa_sparc_transform_normalize_normals_no_rot: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - - sethi %hi(ONE_DOT_ZERO), %g2 - sub %sp, 16, %sp - st %g2, [%sp + STACK_VAR_OFF+0x0] - st %o1, [%sp + STACK_VAR_OFF+0x4] - ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f - ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale - add %sp, 16, %sp - - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_5_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - cmp %o3, 0 - bne 4f - clr %o4 ! 'i' for STRIDE_LOOP - -1: /* LENGTHS == NULL */ - ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) - * ty (f5) = (uy * m5) - * tz (f7) = (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - fmuls %f1, M5, %f5 ! FGM Group - fmuls %f2, M10, %f7 ! FGM Group - - /* f3=tx, f5=ty, f7=tz */ - - /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */ - fmuls %f3, %f3, %f6 ! FGM Group stall, f3 available - fmuls %f5, %f5, %f8 ! FGM Group f5 available - fmuls %f7, %f7, %f10 ! FGM Group f7 available - fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available - fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available - - /* scale (f6) = 1.0 / sqrt(len) */ - fsqrts %f6, %f6 ! FDIV 20 cycles - fdivs %f12, %f6, %f6 ! FDIV 14 cycles - - fmuls %f3, %f6, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale - fmuls %f5, %f6, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale - fmuls %f7, %f6, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - - ba 7f - nop - -4: /* LENGTHS != NULL */ - fmuls M0, %f15, M0 - fmuls M5, %f15, M5 - fmuls M10, %f15, M10 - -5: - ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) - * ty (f5) = (uy * m5) - * tz (f7) = (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - ld [%o3], %f13 ! LSU - fmuls %f1, M5, %f5 ! FGM Group - add %o3, 4, %o3 ! IEU0 - fmuls %f2, M10, %f7 ! FGM Group - - /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */ - - fmuls %f3, %f13, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * len - fmuls %f5, %f13, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * len - fmuls %f7, %f13, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * len - - cmp %o4, %g1 ! continue if (i < count) - bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_transform_rescale_normals_no_rot -_mesa_sparc_transform_rescale_normals_no_rot: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - sub %sp, 16, %sp - st %o1, [%sp + STACK_VAR_OFF+0x0] - ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale - add %sp, 16, %sp - - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_5_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - clr %o4 ! 'i' for STRIDE_LOOP - - fmuls M0, %f15, M0 - fmuls M5, %f15, M5 - fmuls M10, %f15, M10 - -1: ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) - * ty (f5) = (uy * m5) - * tz (f7) = (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - st %f3, [%g3 + 0x00] ! LSU - fmuls %f1, M5, %f5 ! FGM Group - st %f5, [%g3 + 0x04] ! LSU - fmuls %f2, M10, %f7 ! FGM Group - st %f7, [%g3 + 0x08] ! LSU - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_transform_rescale_normals -_mesa_sparc_transform_rescale_normals: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - sub %sp, 16, %sp - st %o1, [%sp + STACK_VAR_OFF+0x0] - ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale - add %sp, 16, %sp - - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_1_2_4_5_6_8_9_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - clr %o4 ! 'i' for STRIDE_LOOP - - fmuls M0, %f15, M0 - fmuls M1, %f15, M1 - fmuls M2, %f15, M2 - fmuls M4, %f15, M4 - fmuls M5, %f15, M5 - fmuls M6, %f15, M6 - fmuls M8, %f15, M8 - fmuls M9, %f15, M9 - fmuls M10, %f15, M10 - -1: ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - fmuls %f0, M0, %f3 ! FGM Group - fmuls %f1, M1, %f4 ! FGM Group - fmuls %f0, M4, %f5 ! FGM Group - fmuls %f1, M5, %f6 ! FGM Group - fmuls %f0, M8, %f7 ! FGM Group f3 available - fmuls %f1, M9, %f8 ! FGM Group f4 available - fadds %f3, %f4, %f3 ! FGA - fmuls %f2, M2, %f10 ! FGM Group f5 available - fmuls %f2, M6, %f0 ! FGM Group f6 available - fadds %f5, %f6, %f5 ! FGA - fmuls %f2, M10, %f4 ! FGM Group f7 available - fadds %f7, %f8, %f7 ! FGA Group f8,f3 available - fadds %f3, %f10, %f3 ! FGA Group f10 available - st %f3, [%g3 + 0x00] ! LSU - fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available - st %f5, [%g3 + 0x04] ! LSU - fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available - st %f7, [%g3 + 0x08] ! LSU - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_transform_normals_no_rot -_mesa_sparc_transform_normals_no_rot: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_5_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - clr %o4 ! 'i' for STRIDE_LOOP - -1: ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* tx (f3) = (ux * m0) - * ty (f5) = (uy * m5) - * tz (f7) = (uz * m10) - */ - fmuls %f0, M0, %f3 ! FGM Group - st %f3, [%g3 + 0x00] ! LSU - fmuls %f1, M5, %f5 ! FGM Group - st %f5, [%g3 + 0x04] ! LSU - fmuls %f2, M10, %f7 ! FGM Group - st %f7, [%g3 + 0x08] ! LSU - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_transform_normals -_mesa_sparc_transform_normals: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - LDMATRIX_0_1_2_4_5_6_8_9_10(%o0) - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - clr %o4 ! 'i' for STRIDE_LOOP - -1: ld [%o5 + 0x00], %f0 ! ux = from[0] - ld [%o5 + 0x04], %f1 ! uy = from[1] - ld [%o5 + 0x08], %f2 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - fmuls %f0, M0, %f3 ! FGM Group - fmuls %f1, M1, %f4 ! FGM Group - fmuls %f0, M4, %f5 ! FGM Group - fmuls %f1, M5, %f6 ! FGM Group - fmuls %f0, M8, %f7 ! FGM Group f3 available - fmuls %f1, M9, %f8 ! FGM Group f4 available - fadds %f3, %f4, %f3 ! FGA - fmuls %f2, M2, %f10 ! FGM Group f5 available - fmuls %f2, M6, %f0 ! FGM Group f6 available - fadds %f5, %f6, %f5 ! FGA - fmuls %f2, M10, %f4 ! FGM Group f7 available - fadds %f7, %f8, %f7 ! FGA Group f8,f3 available - fadds %f3, %f10, %f3 ! FGA Group f10 available - st %f3, [%g3 + 0x00] ! LSU - fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available - st %f5, [%g3 + 0x04] ! LSU - fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available - st %f7, [%g3 + 0x08] ! LSU - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_normalize_normals -_mesa_sparc_normalize_normals: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - - sethi %hi(ONE_DOT_ZERO), %g2 - sub %sp, 16, %sp - st %g2, [%sp + STACK_VAR_OFF+0x0] - ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f - add %sp, 16, %sp - - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - cmp %o3, 0 - bne 4f - clr %o4 ! 'i' for STRIDE_LOOP - -1: /* LENGTHS == NULL */ - ld [%o5 + 0x00], %f3 ! ux = from[0] - ld [%o5 + 0x04], %f5 ! uy = from[1] - ld [%o5 + 0x08], %f7 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* f3=tx, f5=ty, f7=tz */ - - /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */ - fmuls %f3, %f3, %f6 ! FGM Group f3 available - fmuls %f5, %f5, %f8 ! FGM Group f5 available - fmuls %f7, %f7, %f10 ! FGM Group f7 available - fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available - fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available - - /* scale (f6) = 1.0 / sqrt(len) */ - fsqrts %f6, %f6 ! FDIV 20 cycles - fdivs %f12, %f6, %f6 ! FDIV 14 cycles - - fmuls %f3, %f6, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale - fmuls %f5, %f6, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale - fmuls %f7, %f6, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - - ba 7f - nop - -4: /* LENGTHS != NULL */ - -5: - ld [%o5 + 0x00], %f3 ! ux = from[0] - ld [%o5 + 0x04], %f5 ! uy = from[1] - ld [%o5 + 0x08], %f7 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - ld [%o3], %f13 ! LSU - add %o3, 4, %o3 ! IEU0 - - /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */ - - fmuls %f3, %f13, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * len - fmuls %f5, %f13, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * len - fmuls %f7, %f13, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * len - - cmp %o4, %g1 ! continue if (i < count) - bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop - - .globl _mesa_sparc_rescale_normals -_mesa_sparc_rescale_normals: - /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - - sethi %hi(ONE_DOT_ZERO), %g2 - sub %sp, 16, %sp - st %o1, [%sp + STACK_VAR_OFF+0x0] - ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale - add %sp, 16, %sp - - LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start - ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count - ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride - LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start - - /* dest->count = in->count */ - st %g1, [%o4 + V4F_COUNT] - - cmp %g1, 1 - bl 7f - clr %o4 ! 'i' for STRIDE_LOOP - -1: - ld [%o5 + 0x00], %f3 ! ux = from[0] - ld [%o5 + 0x04], %f5 ! uy = from[1] - ld [%o5 + 0x08], %f7 ! uz = from[2] - add %o5, %g2, %o5 ! STRIDE_F(from, stride) - add %o4, 1, %o4 ! i++ - - /* f3=tx, f5=ty, f7=tz */ - - fmuls %f3, %f15, %f3 - st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale - fmuls %f5, %f15, %f5 - st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale - fmuls %f7, %f15, %f7 - st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale - - cmp %o4, %g1 ! continue if (i < count) - bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer - -7: retl - nop diff --git a/src/libs/mesa/mesa/sparc/sparc.c b/src/libs/mesa/mesa/sparc/sparc.c deleted file mode 100644 index 84e8ac6723..0000000000 --- a/src/libs/mesa/mesa/sparc/sparc.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2003 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. - */ - -/* - * Sparc assembly code by David S. Miller - */ - - -#include "sparc.h" - -#ifdef USE_SPARC_ASM - -#include "main/context.h" -#include "math/m_xform.h" -#include "tnl/t_context.h" - -#ifdef DEBUG -#include "math/m_debug.h" -#endif - -#define XFORM_ARGS GLvector4f *to_vec, \ - const GLfloat m[16], \ - const GLvector4f *from_vec - -#define DECLARE_XFORM_GROUP(pfx, sz) \ - extern void _mesa_##pfx##_transform_points##sz##_general(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_identity(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_3d_no_rot(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_perspective(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_2d(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_2d_no_rot(XFORM_ARGS); \ - extern void _mesa_##pfx##_transform_points##sz##_3d(XFORM_ARGS); - -#define ASSIGN_XFORM_GROUP(pfx, sz) \ - _mesa_transform_tab[sz][MATRIX_GENERAL] = \ - _mesa_##pfx##_transform_points##sz##_general; \ - _mesa_transform_tab[sz][MATRIX_IDENTITY] = \ - _mesa_##pfx##_transform_points##sz##_identity; \ - _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_3d_no_rot; \ - _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \ - _mesa_##pfx##_transform_points##sz##_perspective; \ - _mesa_transform_tab[sz][MATRIX_2D] = \ - _mesa_##pfx##_transform_points##sz##_2d; \ - _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_2d_no_rot; \ - _mesa_transform_tab[sz][MATRIX_3D] = \ - _mesa_##pfx##_transform_points##sz##_3d; - - -DECLARE_XFORM_GROUP(sparc, 1) -DECLARE_XFORM_GROUP(sparc, 2) -DECLARE_XFORM_GROUP(sparc, 3) -DECLARE_XFORM_GROUP(sparc, 4) - -extern GLvector4f *_mesa_sparc_cliptest_points4(GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask); - -extern GLvector4f *_mesa_sparc_cliptest_points4_np(GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask); - -#define NORM_ARGS const GLmatrix *mat, \ - GLfloat scale, \ - const GLvector4f *in, \ - const GLfloat *lengths, \ - GLvector4f *dest - -extern void _mesa_sparc_transform_normalize_normals(NORM_ARGS); -extern void _mesa_sparc_transform_normalize_normals_no_rot(NORM_ARGS); -extern void _mesa_sparc_transform_rescale_normals_no_rot(NORM_ARGS); -extern void _mesa_sparc_transform_rescale_normals(NORM_ARGS); -extern void _mesa_sparc_transform_normals_no_rot(NORM_ARGS); -extern void _mesa_sparc_transform_normals(NORM_ARGS); -extern void _mesa_sparc_normalize_normals(NORM_ARGS); -extern void _mesa_sparc_rescale_normals(NORM_ARGS); - - - -void _mesa_init_all_sparc_transform_asm(void) -{ - ASSIGN_XFORM_GROUP(sparc, 1) - ASSIGN_XFORM_GROUP(sparc, 2) - ASSIGN_XFORM_GROUP(sparc, 3) - ASSIGN_XFORM_GROUP(sparc, 4) - - _mesa_clip_tab[4] = _mesa_sparc_cliptest_points4; - _mesa_clip_np_tab[4] = _mesa_sparc_cliptest_points4_np; - -#if 0 - /* disable these too. See bug 673938 */ - _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = - _mesa_sparc_transform_normalize_normals; - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = - _mesa_sparc_transform_normalize_normals_no_rot; - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = - _mesa_sparc_transform_rescale_normals_no_rot; - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = - _mesa_sparc_transform_rescale_normals; - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = - _mesa_sparc_transform_normals_no_rot; - _mesa_normal_tab[NORM_TRANSFORM] = - _mesa_sparc_transform_normals; - _mesa_normal_tab[NORM_NORMALIZE] = - _mesa_sparc_normalize_normals; - _mesa_normal_tab[NORM_RESCALE] = - _mesa_sparc_rescale_normals; -#endif - -#ifdef DEBUG_MATH - _math_test_all_transform_functions("sparc"); - _math_test_all_cliptest_functions("sparc"); - _math_test_all_normal_transform_functions("sparc"); -#endif -} - -extern unsigned int _mesa_sparc_glapi_begin; -extern unsigned int _mesa_sparc_glapi_end; -extern void __glapi_sparc_icache_flush(unsigned int *); - -#endif /* USE_SPARC_ASM */ - - -void _mesa_init_sparc_glapi_relocs(void) -{ -#ifdef USE_SPARC_ASM - unsigned int *insn_ptr, *end_ptr; - unsigned long disp_addr; - - insn_ptr = &_mesa_sparc_glapi_begin; - end_ptr = &_mesa_sparc_glapi_end; - disp_addr = (unsigned long) &_glapi_Dispatch; - - while (insn_ptr < end_ptr) { -#ifdef __arch64__ - insn_ptr[0] |= (disp_addr >> (32 + 10)); - insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&insn_ptr[0]); - insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1)); - insn_ptr[3] |= (disp_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&insn_ptr[2]); - insn_ptr += 11; -#else - insn_ptr[0] |= (disp_addr >> 10); - insn_ptr[1] |= (disp_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&insn_ptr[0]); - insn_ptr += 5; -#endif - } -#endif /* USE_SPARC_ASM */ -} diff --git a/src/libs/mesa/mesa/sparc/sparc.h b/src/libs/mesa/mesa/sparc/sparc.h deleted file mode 100644 index a98e4d0e40..0000000000 --- a/src/libs/mesa/mesa/sparc/sparc.h +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * 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. - */ - -/* - * Sparc assembly code by David S. Miller - */ - - -#ifndef SPARC_H -#define SPARC_H - -extern void _mesa_init_all_sparc_transform_asm(void); -extern void _mesa_init_sparc_glapi_relocs(void); - -#endif /* !(SPARC_H) */ diff --git a/src/libs/mesa/mesa/sparc/sparc_matrix.h b/src/libs/mesa/mesa/sparc/sparc_matrix.h deleted file mode 100644 index f677d9bda1..0000000000 --- a/src/libs/mesa/mesa/sparc/sparc_matrix.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * SPARC assembly matrix code. - */ - -#ifndef _SPARC_MATRIX_H -#define _SPARC_MATRIX_H - -#ifdef __arch64__ -#define LDPTR ldx -#define MAT_M 0x00 -#define MAT_INV 0x08 -#define V4F_DATA 0x00 -#define V4F_START 0x08 -#define V4F_COUNT 0x10 -#define V4F_STRIDE 0x14 -#define V4F_SIZE 0x18 -#define V4F_FLAGS 0x1c -#else -#define LDPTR ld -#define MAT_M 0x00 -#define MAT_INV 0x04 -#define V4F_DATA 0x00 -#define V4F_START 0x04 -#define V4F_COUNT 0x08 -#define V4F_STRIDE 0x0c -#define V4F_SIZE 0x10 -#define V4F_FLAGS 0x14 -#endif - -#define VEC_SIZE_1 1 -#define VEC_SIZE_2 3 -#define VEC_SIZE_3 7 -#define VEC_SIZE_4 15 - -#define M0 %f16 -#define M1 %f17 -#define M2 %f18 -#define M3 %f19 -#define M4 %f20 -#define M5 %f21 -#define M6 %f22 -#define M7 %f23 -#define M8 %f24 -#define M9 %f25 -#define M10 %f26 -#define M11 %f27 -#define M12 %f28 -#define M13 %f29 -#define M14 %f30 -#define M15 %f31 - -#define LDMATRIX_0_1_2_3_12_13_14_15(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + (12 * 0x4)], M12; \ - ldd [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_1_12_13(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + (12 * 0x4)], M12 - -#define LDMATRIX_0_12_13(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + (12 * 0x4)], M12 - -#define LDMATRIX_0_1_2_12_13_14(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_12_13_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_1_2_3_4_5_6_7_12_13_14_15(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ldd [BASE + ( 6 * 0x4)], M6; \ - ldd [BASE + (12 * 0x4)], M12; \ - ldd [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_5_12_13(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ldd [BASE + (12 * 0x4)], M12 - -#define LDMATRIX_0_1_2_3_4_5_6_12_13_14(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ld [BASE + ( 6 * 0x4)], M6; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_5_12_13_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_5_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ldd [BASE + ( 6 * 0x4)], M6; \ - ldd [BASE + ( 8 * 0x4)], M8; \ - ldd [BASE + (10 * 0x4)], M10; \ - ldd [BASE + (12 * 0x4)], M12; \ - ldd [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_1_4_5_12_13(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ldd [BASE + (12 * 0x4)], M12 - -#define LDMATRIX_0_5_12_13(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ldd [BASE + (12 * 0x4)], M12 - -#define LDMATRIX_0_1_2_4_5_6_8_9_10(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ld [BASE + ( 6 * 0x4)], M6; \ - ldd [BASE + ( 8 * 0x4)], M8; \ - ld [BASE + (10 * 0x4)], M10 - -#define LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(BASE) \ - ldd [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 2 * 0x4)], M2; \ - ldd [BASE + ( 4 * 0x4)], M4; \ - ld [BASE + ( 6 * 0x4)], M6; \ - ldd [BASE + ( 8 * 0x4)], M8; \ - ld [BASE + (10 * 0x4)], M10; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_5_10(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ld [BASE + (10 * 0x4)], M10; \ - -#define LDMATRIX_0_5_10_12_13_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ld [BASE + (10 * 0x4)], M10; \ - ldd [BASE + (12 * 0x4)], M12; \ - ld [BASE + (14 * 0x4)], M14 - -#define LDMATRIX_0_5_8_9_10_14(BASE) \ - ld [BASE + ( 0 * 0x4)], M0; \ - ld [BASE + ( 5 * 0x4)], M5; \ - ldd [BASE + ( 8 * 0x4)], M8; \ - ld [BASE + (10 * 0x4)], M10; \ - ld [BASE + (14 * 0x4)], M14 - -#endif /* !(_SPARC_MATRIX_H) */ diff --git a/src/libs/mesa/mesa/sparc/xform.S b/src/libs/mesa/mesa/sparc/xform.S deleted file mode 100644 index f2b9674bf2..0000000000 --- a/src/libs/mesa/mesa/sparc/xform.S +++ /dev/null @@ -1,1392 +0,0 @@ - - /* TODO - * - * 1) It would be nice if load/store double could be used - * at least for the matrix parts. I think for the matrices - * it is safe, but for the vertices it probably is not due to - * things like glInterleavedArrays etc. - * - * UPDATE: Trying this now in sparc_matrix.h -DaveM_990624 - * - * 2) One extremely slick trick would be if we could enclose - * groups of xform calls on the same vertices such that - * we just load the matrix into f16-->f31 before the calls - * and then we would not have to do them here. This may be - * tricky and not much of a gain though. - */ - -#include "sparc_matrix.h" - -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) - /* Solaris requires this for 64-bit. */ - .register %g2, #scratch - .register %g3, #scratch -#endif - - .text - .align 64 - -__set_v4f_1: - ld [%o0 + V4F_FLAGS], %g2 - mov 1, %g1 - st %g1, [%o0 + V4F_SIZE] - or %g2, VEC_SIZE_1, %g2 - retl - st %g2, [%o0 + V4F_FLAGS] -__set_v4f_2: - ld [%o0 + V4F_FLAGS], %g2 - mov 2, %g1 - st %g1, [%o0 + V4F_SIZE] - or %g2, VEC_SIZE_2, %g2 - retl - st %g2, [%o0 + V4F_FLAGS] -__set_v4f_3: - ld [%o0 + V4F_FLAGS], %g2 - mov 3, %g1 - st %g1, [%o0 + V4F_SIZE] - or %g2, VEC_SIZE_3, %g2 - retl - st %g2, [%o0 + V4F_FLAGS] -__set_v4f_4: - ld [%o0 + V4F_FLAGS], %g2 - mov 4, %g1 - st %g1, [%o0 + V4F_SIZE] - or %g2, VEC_SIZE_4, %g2 - retl - st %g2, [%o0 + V4F_FLAGS] - - /* First the raw versions. */ - - .globl _mesa_sparc_transform_points1_general -_mesa_sparc_transform_points1_general: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_3_12_13_14_15(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f8 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group 1-cycle stall on %f0 - fmuls %f0, M1, %f2 ! FGM Group - fmuls %f0, M2, %f3 ! FGM Group - fmuls %f0, M3, %f4 ! FGM Group - fmuls %f8, M0, %f9 ! FGM Group f1 available - fadds %f1, M12, %f1 ! FGA - st %f1, [%g2 + 0x00] ! LSU - fmuls %f8, M1, %f10 ! FGM Group f2 available - fadds %f2, M13, %f2 ! FGA - st %f2, [%g2 + 0x04] ! LSU - fmuls %f8, M2, %f11 ! FGM Group f3 available - fadds %f3, M14, %f3 ! FGA - st %f3, [%g2 + 0x08] ! LSU - fmuls %f8, M3, %f12 ! FGM Group f4 available - fadds %f4, M15, %f4 ! FGA - st %f4, [%g2 + 0x0c] ! LSU - fadds %f9, M12, %f9 ! FGA Group f9 available - st %f9, [%g2 + 0x10] ! LSU - fadds %f10, M13, %f10 ! FGA Group f10 available - st %f10, [%g2 + 0x14] ! LSU - fadds %f11, M14, %f11 ! FGA Group f11 available - st %f11, [%g2 + 0x18] ! LSU - fadds %f12, M15, %f12 ! FGA Group f12 available - st %f12, [%g2 + 0x1c] ! LSU - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 ! LSU Group - fmuls %f0, M0, %f1 ! FGM Group 1-cycle stall on %f0 - fmuls %f0, M1, %f2 ! FGM Group - fmuls %f0, M2, %f3 ! FGM Group - fmuls %f0, M3, %f4 ! FGM Group - fadds %f1, M12, %f1 ! FGA Group - st %f1, [%g2 + 0x00] ! LSU - fadds %f2, M13, %f2 ! FGA Group - st %f2, [%g2 + 0x04] ! LSU - fadds %f3, M14, %f3 ! FGA Group - st %f3, [%g2 + 0x08] ! LSU - fadds %f4, M15, %f4 ! FGA Group - st %f4, [%g2 + 0x0c] ! LSU - -3: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points1_identity -_mesa_sparc_transform_points1_identity: - cmp %o0, %o2 - be 4f - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f1 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - st %f0, [%g2 + 0x00] ! LSU Group - cmp %o1, %o2 ! IEU1 - st %f1, [%g2 + 0x10] ! LSU Group - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - addx %g0, %g0, %g0 - st %f0, [%g2 + 0x00] - -3: - ba __set_v4f_1 - nop - -4: retl - nop - - .globl _mesa_sparc_transform_points1_2d -_mesa_sparc_transform_points1_2d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_12_13(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f8 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group - fmuls %f0, M1, %f2 ! FGM Group - fmuls %f8, M0, %f9 ! FGM Group - fmuls %f8, M1, %f10 ! FGM Group - fadds %f1, M12, %f3 ! FGA Group f1 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f2, M13, %f4 ! FGA Group f2 available - st %f4, [%g2 + 0x04] ! LSU - fadds %f9, M12, %f11 ! FGA Group f9 available - st %f11, [%g2 + 0x10] ! LSU - fadds %f10, M13, %f12 ! FGA Group f10 available - st %f12, [%g2 + 0x14] ! LSU - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - fmuls %f0, M0, %f1 - fmuls %f0, M1, %f2 - fadds %f1, M12, %f3 - st %f3, [%g2 + 0x00] - fadds %f2, M13, %f4 - st %f4, [%g2 + 0x04] - -3: - ba __set_v4f_2 - nop - - .globl _mesa_sparc_transform_points1_2d_no_rot -_mesa_sparc_transform_points1_2d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_12_13(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f4 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group - fmuls %f4, M0, %f5 ! FGM Group - fadds %f1, M12, %f3 ! FGA Group, 2 cycle stall, f1 available - st %f3, [%g2 + 0x00] ! LSU - st M13, [%g2 + 0x04] ! LSU Group, f5 available - fadds %f5, M12, %f6 ! FGA - st %f6, [%g2 + 0x10] ! LSU Group - st M13, [%g2 + 0x14] ! LSU Group - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - fmuls %f0, M0, %f1 - fadds %f1, M12, %f3 - st %f3, [%g2 + 0x00] - st M13, [%g2 + 0x04] - -3: - ba __set_v4f_2 - nop - - .globl _mesa_sparc_transform_points1_3d -_mesa_sparc_transform_points1_3d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_12_13_14(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f4 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group - fmuls %f0, M1, %f2 ! FGM Group - fmuls %f0, M2, %f3 ! FGM Group - fmuls %f4, M0, %f5 ! FGM Group - fadds %f1, M12, %f1 ! FGA Group, f1 available - st %f1, [%g2 + 0x00] ! LSU - fmuls %f4, M1, %f6 ! FGM - fadds %f2, M13, %f2 ! FGA Group, f2 available - st %f2, [%g2 + 0x04] ! LSU - fmuls %f4, M2, %f7 ! FGM - fadds %f3, M14, %f3 ! FGA Group, f3 available - st %f3, [%g2 + 0x08] ! LSU - fadds %f5, M12, %f5 ! FGA Group, f5 available - st %f5, [%g2 + 0x10] ! LSU - fadds %f6, M13, %f6 ! FGA Group, f6 available - st %f6, [%g2 + 0x14] ! LSU - fadds %f7, M14, %f7 ! FGA Group, f7 available - st %f7, [%g2 + 0x18] ! LSU - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - fmuls %f0, M0, %f1 - fmuls %f0, M1, %f2 - fmuls %f0, M2, %f3 - fadds %f1, M12, %f1 - st %f1, [%g2 + 0x00] - fadds %f2, M13, %f2 - st %f2, [%g2 + 0x04] - fadds %f3, M14, %f3 - st %f3, [%g2 + 0x08] - -3: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points1_3d_no_rot -_mesa_sparc_transform_points1_3d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_12_13_14(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f2 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group - fmuls %f2, M0, %f3 ! FGM Group - fadds %f1, M12, %f1 ! FGA Group, 2 cycle stall, f1 available - st %f1, [%g2 + 0x00] ! LSU - fadds %f3, M12, %f3 ! FGA Group, f3 available - st M13, [%g2 + 0x04] ! LSU - st M14, [%g2 + 0x08] ! LSU Group - st %f3, [%g2 + 0x10] ! LSU Group - st M13, [%g2 + 0x14] ! LSU Group - st M14, [%g2 + 0x18] ! LSU Group - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - fmuls %f0, M0, %f1 - fadds %f1, M12, %f1 - st %f1, [%g2 + 0x00] - st M13, [%g2 + 0x04] - st M14, [%g2 + 0x08] - -3: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points1_perspective -_mesa_sparc_transform_points1_perspective: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_14(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - ld [%g1 + 0x00], %f2 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f1 ! FGM Group - st %f1, [%g2 + 0x00] ! LSU - fmuls %f2, M0, %f3 ! FGM Group - st %g0, [%g2 + 0x04] ! LSU - st M14, [%g2 + 0x08] ! LSU Group - st %g0, [%g2 + 0x0c] ! LSU Group - st %f3, [%g2 + 0x10] ! LSU Group - st %g0, [%g2 + 0x14] ! LSU Group - st M14, [%g2 + 0x18] ! LSU Group - st %g0, [%g2 + 0x1c] ! LSU Group - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 - fmuls %f0, M0, %f1 - st %f1, [%g2 + 0x00] - st %g0, [%g2 + 0x04] - st M14, [%g2 + 0x08] - st %g0, [%g2 + 0x0c] - -3: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points2_general -_mesa_sparc_transform_points2_general: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_3_4_5_6_7_12_13_14_15(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f2 ! FGM Group - fmuls %f0, M1, %f3 ! FGM Group - fmuls %f0, M2, %f4 ! FGM Group - fmuls %f0, M3, %f5 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group f2 available - fmuls %f1, M4, %f6 ! FGM - fadds %f3, M13, %f3 ! FGA Group f3 available - fmuls %f1, M5, %f7 ! FGM - fadds %f4, M14, %f4 ! FGA Group f4 available - fmuls %f1, M6, %f8 ! FGM - fadds %f5, M15, %f5 ! FGA Group f5 available - fmuls %f1, M7, %f9 ! FGM - fadds %f2, %f6, %f2 ! FGA Group f6 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, %f7, %f3 ! FGA Group f7 available - st %f3, [%g2 + 0x04] ! LSU - fadds %f4, %f8, %f4 ! FGA Group f8 available - st %f4, [%g2 + 0x08] ! LSU - fadds %f5, %f9, %f5 ! FGA Group f9 available - st %f5, [%g2 + 0x0c] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points2_identity -_mesa_sparc_transform_points2_identity: - cmp %o2, %o0 - be 3f - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - add %o1, 1, %o1 ! IEU0 - ld [%g1 + 0x04], %f1 ! LSU Group - add %g1, %o5, %g1 ! IEU0 - cmp %o1, %g3 ! IEU1 - st %f0, [%g2 + 0x00] ! LSU Group - st %f1, [%g2 + 0x04] ! LSU Group - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 -2: - ba __set_v4f_2 - nop - -3: retl - nop - - .globl _mesa_sparc_transform_points2_2d -_mesa_sparc_transform_points2_2d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_4_5_12_13(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f2 ! FGM - ld [%g1 + 0x00], %f8 ! LSU Group - fmuls %f0, M1, %f3 ! FGM - ld [%g1 + 0x04], %f9 ! LSU Group - fmuls %f1, M4, %f6 ! FGM - fmuls %f1, M5, %f7 ! FGM Group - add %g1, %o5, %g1 ! IEU0 - fmuls %f8, M0, %f10 ! FGM Group f2 available - fadds %f2, M12, %f2 ! FGA - fmuls %f8, M1, %f11 ! FGM Group f3 available - fadds %f3, M13, %f3 ! FGA - fmuls %f9, M4, %f12 ! FGM Group - fmuls %f9, M5, %f13 ! FGM Group - fadds %f10, M12, %f10 ! FGA Group f2, f10 available - fadds %f2, %f6, %f2 ! FGA Group f3, f11 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f11, M13, %f11 ! FGA Group f12 available - fadds %f3, %f7, %f3 ! FGA Group f13 available - st %f3, [%g2 + 0x04] ! LSU - fadds %f10, %f12, %f10 ! FGA Group f10 available - st %f10, [%g2 + 0x10] ! LSU - fadds %f11, %f13, %f11 ! FGA Group f11 available - st %f11, [%g2 + 0x14] ! LSU - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - fmuls %f0, M0, %f2 ! FGM Group - fmuls %f0, M1, %f3 ! FGM Group - fmuls %f1, M4, %f6 ! FGM Group - fmuls %f1, M5, %f7 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group f2 available - fadds %f3, M13, %f3 ! FGA Group f3 available - fadds %f2, %f6, %f2 ! FGA Group 2 cycle stall, f2 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, %f7, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x04] ! LSU - -3: - ba __set_v4f_2 - nop - - .globl _mesa_sparc_transform_points2_2d_no_rot -_mesa_sparc_transform_points2_2d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_12_13(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - ld [%g1 + 0x00], %f4 ! LSU Group - fmuls %f0, M0, %f2 ! FGM - ld [%g1 + 0x04], %f5 ! LSU Group - fmuls %f1, M5, %f3 ! FGM - fmuls %f4, M0, %f6 ! FGM Group - add %g1, %o5, %g1 ! IEU0 - fmuls %f5, M5, %f7 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group f2 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, M13, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x04] ! LSU - fadds %f6, M12, %f6 ! FGA Group f6 available - st %f6, [%g2 + 0x10] ! LSU - fadds %f7, M13, %f7 ! FGA Group f7 available - st %f7, [%g2 + 0x14] ! LSU - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - fmuls %f0, M0, %f2 ! FGM Group - fmuls %f1, M5, %f3 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group, 2 cycle stall, f2 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, M13, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x04] ! LSU - -3: - ba __set_v4f_2 - nop - - /* orig: 12 cycles */ - .globl _mesa_sparc_transform_points2_3d -_mesa_sparc_transform_points2_3d: - ld [%o2 + V4F_STRIDE], %o5 - ld [%o2 + V4F_START], %g1 - ld [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_3_4_5_6_12_13_14(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o1 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - add %o1, 2, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - ld [%g1 + 0x00], %f9 ! LSU Group - fmuls %f0, M0, %f2 ! FGM - ld [%g1 + 0x04], %f10 ! LSU Group - fmuls %f0, M1, %f3 ! FGM - fmuls %f0, M2, %f4 ! FGM Group - add %g1, %o5, %g1 ! IEU0 - fmuls %f1, M4, %f6 ! FGM Group - fmuls %f1, M5, %f7 ! FGM Group f2 available - fadds %f2, M12, %f2 ! FGA - fmuls %f1, M6, %f8 ! FGM Group f3 available - fadds %f3, M13, %f3 ! FGA - fmuls %f9, M0, %f11 ! FGM Group f4 available - fadds %f4, M14, %f4 ! FGA - fmuls %f9, M1, %f12 ! FGM Group f6 available - fmuls %f9, M2, %f13 ! FGM Group f2, f7 available - fadds %f2, %f6, %f2 ! FGA - st %f2, [%g2 + 0x00] ! LSU - fmuls %f10, M4, %f14 ! FGM Group f3, f8 available - fadds %f3, %f7, %f3 ! FGA - st %f3, [%g2 + 0x04] ! LSU - fmuls %f10, M5, %f15 ! FGM Group f4, f11 available - fadds %f11, M12, %f11 ! FGA - fmuls %f10, M6, %f0 ! FGM Group f12 available - fadds %f12, M13, %f12 ! FGA - fadds %f13, M14, %f13 ! FGA Group f13 available - fadds %f4, %f8, %f4 ! FGA Group f14 available - st %f4, [%g2 + 0x08] ! LSU - fadds %f11, %f14, %f11 ! FGA Group f15, f11 available - st %f11, [%g2 + 0x10] ! LSU - fadds %f12, %f15, %f12 ! FGA Group f0, f12 available - st %f12, [%g2 + 0x14] ! LSU - fadds %f13, %f0, %f13 ! FGA Group f13 available - st %f13, [%g2 + 0x18] ! LSU - - cmp %o1, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o1, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - fmuls %f0, M0, %f2 ! FGM Group - fmuls %f0, M1, %f3 ! FGM Group - fmuls %f0, M2, %f4 ! FGM Group - fmuls %f1, M4, %f6 ! FGM Group - fmuls %f1, M5, %f7 ! FGM Group f2 available - fadds %f2, M12, %f2 ! FGA - fmuls %f1, M6, %f8 ! FGM Group f3 available - fadds %f3, M13, %f3 ! FGA - fadds %f4, M14, %f4 ! FGA Group f4 available - fadds %f2, %f6, %f2 ! FGA Group stall, f2, f6, f7 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, %f7, %f3 ! FGA Group f3, f8 available - st %f3, [%g2 + 0x04] ! LSU - fadds %f4, %f8, %f4 ! FGA Group f4 available - st %f4, [%g2 + 0x08] ! LSU - -3: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points2_3d_no_rot -_mesa_sparc_transform_points2_3d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_12_13_14(%o1) - - cmp %g3, 1 - st %g3, [%o0 + V4F_COUNT] - bl 3f - clr %o3 - - be 2f - andn %g3, 1, %o2 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - add %o3, 2, %o3 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - ld [%g1 + 0x00], %f4 ! LSU Group - fmuls %f0, M0, %f2 ! FGM - ld [%g1 + 0x04], %f5 ! LSU Group - fmuls %f1, M5, %f3 ! FGM - fmuls %f4, M0, %f6 ! FGM Group - add %g1, %o5, %g1 ! IEU0 - fmuls %f5, M5, %f7 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group f2 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, M13, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x04] ! LSU - fadds %f6, M12, %f6 ! FGA Group f6 available - st M14, [%g2 + 0x08] ! LSU - fadds %f7, M13, %f7 ! FGA Group f7 available - st %f6, [%g2 + 0x10] ! LSU - st %f7, [%g2 + 0x14] ! LSU Group - st M14, [%g2 + 0x18] ! LSU Group - cmp %o3, %o2 ! IEU1 - bne 1b ! CTI - add %g2, 0x20, %g2 ! IEU0 Group - - cmp %o3, %g3 - be 3f - nop - -2: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - fmuls %f0, M0, %f2 ! FGM Group - fmuls %f1, M5, %f3 ! FGM Group - fadds %f2, M12, %f2 ! FGA Group, 2 cycle stall, f2 available - st %f2, [%g2 + 0x00] ! LSU - fadds %f3, M13, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x04] ! LSU - st M14, [%g2 + 0x08] ! LSU Group - -3: ld [%o1 + (14 * 0x4)], %g3 - cmp %g3, 0 - bne __set_v4f_3 - nop - ba __set_v4f_2 - nop - - .globl _mesa_sparc_transform_points2_perspective -_mesa_sparc_transform_points2_perspective: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 - ld [%g1 + 0x04], %f1 - add %o1, 1, %o1 - add %g1, %o5, %g1 - fmuls %f0, M0, %f2 - st %f2, [%g2 + 0x00] - fmuls %f1, M5, %f3 - st %f3, [%g2 + 0x04] - st M14, [%g2 + 0x08] - st %g0, [%g2 + 0x0c] - cmp %o1, %g3 - bne 1b - add %g2, 0x10, %g2 -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points3_general -_mesa_sparc_transform_points3_general: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f3 ! FGM - fmuls %f1, M4, %f7 ! FGM Group - fmuls %f0, M1, %f4 ! FGM Group - fmuls %f1, M5, %f8 ! FGM Group - fmuls %f0, M2, %f5 ! FGM Group f3 available - fmuls %f1, M6, %f9 ! FGM Group f7 available - fadds %f3, %f7, %f3 ! FGA - fmuls %f0, M3, %f6 ! FGM Group f4 available - fmuls %f1, M7, %f10 ! FGM Group f8 available - fadds %f4, %f8, %f4 ! FGA - fmuls %f2, M8, %f7 ! FGM Group f5 available - fmuls %f2, M9, %f8 ! FGM Group f9,f3 available - fadds %f5, %f9, %f5 ! FGA - fmuls %f2, M10, %f9 ! FGM Group f6 available - fadds %f6, %f10, %f6 ! FGA Group f10,f4 available - fmuls %f2, M11, %f10 ! FGM - fadds %f3, M12, %f3 ! FGA Group f7 available - fadds %f4, M13, %f4 ! FGA Group f8,f5 available - fadds %f5, M14, %f5 ! FGA Group f9 available - fadds %f6, M15, %f6 ! FGA Group f10,f6 available - fadds %f3, %f7, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, %f8, %f4 ! FGA Group f4 available - st %f4, [%g2 + 0x04] ! LSU - fadds %f5, %f9, %f5 ! FGA Group f5 available - st %f5, [%g2 + 0x08] ! LSU - fadds %f6, %f10, %f6 ! FGA Group f6 available - st %f6, [%g2 + 0x0c] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points3_identity -_mesa_sparc_transform_points3_identity: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 - ld [%g1 + 0x04], %f1 - ld [%g1 + 0x08], %f2 - add %o1, 1, %o1 - add %g1, %o5, %g1 - cmp %o1, %g3 - st %f0, [%g2 + 0x00] - st %f1, [%g2 + 0x04] - st %f2, [%g2 + 0x08] - bne 1b - add %g2, 0x10, %g2 -2: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points3_2d -_mesa_sparc_transform_points3_2d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_4_5_12_13(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f3 ! FGM - fmuls %f0, M1, %f4 ! FGM Group - fmuls %f1, M4, %f6 ! FGM Group - fmuls %f1, M5, %f7 ! FGM Group - fadds %f3, M12, %f3 ! FGA Group f3 available - fadds %f4, M13, %f4 ! FGA Group f4 available - fadds %f3, %f6, %f3 ! FGA Group f6 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, %f7, %f4 ! FGA Group f7 available - st %f4, [%g2 + 0x04] ! LSU - st %f2, [%g2 + 0x08] ! LSU Group - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points3_2d_no_rot -_mesa_sparc_transform_points3_2d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_12_13(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f3 ! FGM - fmuls %f1, M5, %f4 ! FGM Group - st %f2, [%g2 + 0x08] ! LSU - fadds %f3, M12, %f3 ! FGA Group - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, M13, %f4 ! FGA Group - st %f4, [%g2 + 0x04] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points3_3d -_mesa_sparc_transform_points3_3d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f3 ! FGM - fmuls %f1, M4, %f6 ! FGM Group - fmuls %f0, M1, %f4 ! FGM Group - fmuls %f1, M5, %f7 ! FGM Group - fmuls %f0, M2, %f5 ! FGM Group f3 available - fmuls %f1, M6, %f8 ! FGM Group f6 available - fadds %f3, %f6, %f3 ! FGA - fmuls %f2, M8, %f9 ! FGM Group f4 available - fmuls %f2, M9, %f10 ! FGM Group f7 available - fadds %f4, %f7, %f4 ! FGA - fmuls %f2, M10, %f11 ! FGM Group f5 available - fadds %f5, %f8, %f5 ! FGA Group f8, f3 available - fadds %f3, %f9, %f3 ! FGA Group f9 available - fadds %f4, %f10, %f4 ! FGA Group f10, f4 available - fadds %f5, %f11, %f5 ! FGA Group stall, f11, f5 available - fadds %f3, M12, %f3 ! FGA Group f3 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, M13, %f4 ! FGA Group f4 available - st %f4, [%g2 + 0x04] ! LSU - fadds %f5, M14, %f5 ! FGA Group f5 available - st %f5, [%g2 + 0x08] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points3_3d_no_rot -_mesa_sparc_transform_points3_3d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_10_12_13_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - cmp %o1, %g3 ! IEU1 Group - fmuls %f0, M0, %f3 ! FGM - fmuls %f1, M5, %f4 ! FGM Group - fmuls %f2, M10, %f5 ! FGM Group - fadds %f3, M12, %f3 ! FGA Group, stall, f3 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, M13, %f4 ! FGA Group, f4 available - st %f4, [%g2 + 0x04] ! LSU - fadds %f5, M14, %f5 ! FGA Group, f5 available - st %f5, [%g2 + 0x08] ! LEU - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_3 - nop - - .globl _mesa_sparc_transform_points3_perspective -_mesa_sparc_transform_points3_perspective: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_8_9_10_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f3 ! FGM - fmuls %f2, M8, %f6 ! FGM Group - fmuls %f1, M5, %f4 ! FGM Group - fmuls %f2, M9, %f7 ! FGM Group - fmuls %f2, M10, %f5 ! FGM Group f3 available - fadds %f3, %f6, %f3 ! FGA Group f6 available - st %f3, [%g2 + 0x00] ! LSU - fadds %f4, %f7, %f4 ! FGA Group stall, f4, f7 available - st %f4, [%g2 + 0x04] ! LSU - fadds %f5, M14, %f5 ! FGA Group - st %f5, [%g2 + 0x08] ! LSU - fnegs %f2, %f6 ! FGA Group - st %f6, [%g2 + 0x0c] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_general -_mesa_sparc_transform_points4_general: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - ld [%g1 + 0x0c], %f3 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f4 ! FGM Group - fmuls %f1, M4, %f8 ! FGM Group - fmuls %f0, M1, %f5 ! FGM Group - fmuls %f1, M5, %f9 ! FGM Group - fmuls %f0, M2, %f6 ! FGM Group f4 available - fmuls %f1, M6, %f10 ! FGM Group f8 available - fadds %f4, %f8, %f4 ! FGA - fmuls %f0, M3, %f7 ! FGM Group f5 available - fmuls %f1, M7, %f11 ! FGM Group f9 available - fadds %f5, %f9, %f5 ! FGA - fmuls %f2, M8, %f12 ! FGM Group f6 available - fmuls %f2, M9, %f13 ! FGM Group f10, f4 available - fadds %f6, %f10, %f6 ! FGA - fmuls %f2, M10, %f14 ! FGM Group f7 available - fmuls %f2, M11, %f15 ! FGM Group f11, f5 available - fadds %f7, %f11, %f7 ! FGA - fmuls %f3, M12, %f8 ! FGM Group f12 available - fadds %f4, %f12, %f4 ! FGA - fmuls %f3, M13, %f9 ! FGM Group f13, f6 available - fadds %f5, %f13, %f5 ! FGA - fmuls %f3, M14, %f10 ! FGM Group f14 available - fadds %f6, %f14, %f6 ! FGA - fmuls %f3, M15, %f11 ! FGM Group f15, f7 available - fadds %f7, %f15, %f7 ! FGA - fadds %f4, %f8, %f4 ! FGA Group f8, f4 available - st %f4, [%g2 + 0x00] ! LSU - fadds %f5, %f9, %f5 ! FGA Group f9, f5 available - st %f5, [%g2 + 0x04] ! LSU - fadds %f6, %f10, %f6 ! FGA Group f10, f6 available - st %f6, [%g2 + 0x08] ! LSU - fadds %f7, %f11, %f7 ! FGA Group f11, f7 available - st %f7, [%g2 + 0x0c] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_identity -_mesa_sparc_transform_points4_identity: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 - ld [%g1 + 0x04], %f1 - ld [%g1 + 0x08], %f2 - add %o1, 1, %o1 - ld [%g1 + 0x0c], %f3 - add %g1, %o5, %g1 - st %f0, [%g2 + 0x00] - st %f1, [%g2 + 0x04] - st %f2, [%g2 + 0x08] - cmp %o1, %g3 - st %f3, [%g2 + 0x0c] - bne 1b - add %g2, 0x10, %g2 -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_2d -_mesa_sparc_transform_points4_2d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_4_5_12_13(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - ld [%g1 + 0x0c], %f3 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f4 ! FGM - fmuls %f1, M4, %f8 ! FGM Group - fmuls %f0, M1, %f5 ! FGM Group - fmuls %f1, M5, %f9 ! FGM Group f4 available - fmuls %f3, M12, %f12 ! FGM Group - fmuls %f3, M13, %f13 ! FGM Group f8 available - fadds %f4, %f8, %f4 ! FGA - fadds %f5, %f9, %f5 ! FGA Group stall, f5, f9 available - fadds %f4, %f12, %f4 ! FGA Group 2 cycle stall, f4, f12, f13 avail - st %f4, [%g2 + 0x00] ! LSU - fadds %f5, %f13, %f5 ! FGA Group f5 available - st %f5, [%g2 + 0x04] ! LSU - st %f2, [%g2 + 0x08] ! LSU Group - st %f3, [%g2 + 0x0c] ! LSU Group - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_2d_no_rot -_mesa_sparc_transform_points4_2d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_4_5_12_13(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 - ld [%g1 + 0x04], %f1 - ld [%g1 + 0x08], %f2 - ld [%g1 + 0x0c], %f3 - add %o1, 1, %o1 - add %g1, %o5, %g1 - fmuls %f0, M0, %f4 - fmuls %f3, M12, %f8 - fmuls %f1, M5, %f5 - fmuls %f3, M13, %f9 - fadds %f4, %f8, %f4 - st %f4, [%g2 + 0x00] - fadds %f5, %f9, %f5 - st %f5, [%g2 + 0x04] - st %f2, [%g2 + 0x08] - st %f3, [%g2 + 0x0c] - cmp %o1, %g3 - bne 1b - add %g2, 0x10, %g2 -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_3d -_mesa_sparc_transform_points4_3d: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - ld [%g1 + 0x0c], %f3 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f4 ! FGM - fmuls %f1, M4, %f7 ! FGM Group - fmuls %f0, M1, %f5 ! FGM Group - fmuls %f1, M5, %f8 ! FGM Group - fmuls %f0, M2, %f6 ! FGM Group f4 available - fmuls %f1, M6, %f9 ! FGM Group f7 available - fadds %f4, %f7, %f4 ! FGA - fmuls %f2, M8, %f10 ! FGM Group f5 available - fmuls %f2, M9, %f11 ! FGM Group f8 available - fadds %f5, %f8, %f5 ! FGA - fmuls %f2, M10, %f12 ! FGM Group f6 available - fmuls %f3, M12, %f13 ! FGM Group f9, f4 available - fadds %f6, %f9, %f6 ! FGA - fmuls %f3, M13, %f14 ! FGM Group f10 available - fadds %f4, %f10, %f4 ! FGA - fmuls %f3, M14, %f15 ! FGM Group f11, f5 available - fadds %f5, %f11, %f5 ! FGA - fadds %f6, %f12, %f6 ! FGA Group stall, f12, f13, f6 available - fadds %f4, %f13, %f4 ! FGA Group f14, f4 available - st %f4, [%g2 + 0x00] ! LSU - fadds %f5, %f14, %f5 ! FGA Group f15, f5 available - st %f5, [%g2 + 0x04] ! LSU - fadds %f6, %f15, %f6 ! FGA Group f6 available - st %f6, [%g2 + 0x08] ! LSU - st %f3, [%g2 + 0x0c] ! LSU Group - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_3d_no_rot -_mesa_sparc_transform_points4_3d_no_rot: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_10_12_13_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - ld [%g1 + 0x0c], %f3 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f4 ! FGM - fmuls %f3, M12, %f7 ! FGM Group - fmuls %f1, M5, %f5 ! FGM Group - fmuls %f3, M13, %f8 ! FGM Group - fmuls %f2, M10, %f6 ! FGM Group f4 available - fmuls %f3, M14, %f9 ! FGM Group f7 available - fadds %f4, %f7, %f4 ! FGA - st %f4, [%g2 + 0x00] ! LSU - fadds %f5, %f8, %f5 ! FGA Group stall, f5, f8 available - st %f5, [%g2 + 0x04] ! LSU - fadds %f6, %f9, %f6 ! FGA Group stall, f6, f9 available - st %f6, [%g2 + 0x08] ! LSU - st %f3, [%g2 + 0x0c] ! LSU Group - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop - - .globl _mesa_sparc_transform_points4_perspective -_mesa_sparc_transform_points4_perspective: - ld [%o2 + V4F_STRIDE], %o5 - LDPTR [%o2 + V4F_START], %g1 - LDPTR [%o0 + V4F_START], %g2 - ld [%o2 + V4F_COUNT], %g3 - - LDMATRIX_0_5_8_9_10_14(%o1) - - cmp %g3, 0 - st %g3, [%o0 + V4F_COUNT] - be 2f - clr %o1 - -1: ld [%g1 + 0x00], %f0 ! LSU Group - ld [%g1 + 0x04], %f1 ! LSU Group - ld [%g1 + 0x08], %f2 ! LSU Group - ld [%g1 + 0x0c], %f3 ! LSU Group - add %o1, 1, %o1 ! IEU0 - add %g1, %o5, %g1 ! IEU1 - fmuls %f0, M0, %f4 ! FGM - fmuls %f2, M8, %f7 ! FGM Group - fmuls %f1, M5, %f5 ! FGM Group - fmuls %f2, M9, %f8 ! FGM Group - fmuls %f2, M10, %f6 ! FGM Group f4 available - fmuls %f3, M14, %f9 ! FGM Group f7 available - fadds %f4, %f7, %f4 ! FGA - st %f4, [%g2 + 0x00] ! LSU - fadds %f5, %f8, %f5 ! FGA Group stall, f5, f8 available - st %f5, [%g2 + 0x04] ! LSU - fadds %f6, %f9, %f6 ! FGA Group stall, f6, f9 available - st %f6, [%g2 + 0x08] ! LSU - fnegs %f2, %f7 ! FGA Group - st %f7, [%g2 + 0x0c] ! LSU - cmp %o1, %g3 ! IEU1 - bne 1b ! CTI - add %g2, 0x10, %g2 ! IEU0 Group -2: - ba __set_v4f_4 - nop diff --git a/src/libs/mesa/mesa/swrast/s_aaline.c b/src/libs/mesa/mesa/swrast/s_aaline.c deleted file mode 100644 index 9bfa8f2e61..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aaline.c +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "swrast/s_aaline.h" -#include "swrast/s_context.h" -#include "swrast/s_span.h" -#include "swrast/swrast.h" - - -#define SUB_PIXEL 4 - - -/* - * Info about the AA line we're rendering - */ -struct LineInfo -{ - GLfloat x0, y0; /* start */ - GLfloat x1, y1; /* end */ - GLfloat dx, dy; /* direction vector */ - GLfloat len; /* length */ - GLfloat halfWidth; /* half of line width */ - GLfloat xAdj, yAdj; /* X and Y adjustment for quad corners around line */ - /* for coverage computation */ - GLfloat qx0, qy0; /* quad vertices */ - GLfloat qx1, qy1; - GLfloat qx2, qy2; - GLfloat qx3, qy3; - GLfloat ex0, ey0; /* quad edge vectors */ - GLfloat ex1, ey1; - GLfloat ex2, ey2; - GLfloat ex3, ey3; - - /* DO_Z */ - GLfloat zPlane[4]; - /* DO_RGBA */ - GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; - /* DO_INDEX */ - GLfloat iPlane[4]; - /* DO_ATTRIBS */ - GLfloat wPlane[4]; - GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; - GLfloat lambda[FRAG_ATTRIB_MAX]; - GLfloat texWidth[FRAG_ATTRIB_MAX]; - GLfloat texHeight[FRAG_ATTRIB_MAX]; - - SWspan span; -}; - - - -/* - * Compute the equation of a plane used to interpolate line fragment data - * such as color, Z, texture coords, etc. - * Input: (x0, y0) and (x1,y1) are the endpoints of the line. - * z0, and z1 are the end point values to interpolate. - * Output: plane - the plane equation. - * - * Note: we don't really have enough parameters to specify a plane. - * We take the endpoints of the line and compute a plane such that - * the cross product of the line vector and the plane normal is - * parallel to the projection plane. - */ -static void -compute_plane(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, - GLfloat z0, GLfloat z1, GLfloat plane[4]) -{ -#if 0 - /* original */ - const GLfloat px = x1 - x0; - const GLfloat py = y1 - y0; - const GLfloat pz = z1 - z0; - const GLfloat qx = -py; - const GLfloat qy = px; - const GLfloat qz = 0; - const GLfloat a = py * qz - pz * qy; - const GLfloat b = pz * qx - px * qz; - const GLfloat c = px * qy - py * qx; - const GLfloat d = -(a * x0 + b * y0 + c * z0); - plane[0] = a; - plane[1] = b; - plane[2] = c; - plane[3] = d; -#else - /* simplified */ - const GLfloat px = x1 - x0; - const GLfloat py = y1 - y0; - const GLfloat pz = z0 - z1; - const GLfloat a = pz * px; - const GLfloat b = pz * py; - const GLfloat c = px * px + py * py; - const GLfloat d = -(a * x0 + b * y0 + c * z0); - if (a == 0.0 && b == 0.0 && c == 0.0 && d == 0.0) { - plane[0] = 0.0; - plane[1] = 0.0; - plane[2] = 1.0; - plane[3] = 0.0; - } - else { - plane[0] = a; - plane[1] = b; - plane[2] = c; - plane[3] = d; - } -#endif -} - - -static INLINE void -constant_plane(GLfloat value, GLfloat plane[4]) -{ - plane[0] = 0.0; - plane[1] = 0.0; - plane[2] = -1.0; - plane[3] = value; -} - - -static INLINE GLfloat -solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; - return z; -} - -#define SOLVE_PLANE(X, Y, PLANE) \ - ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2]) - - -/* - * Return 1 / solve_plane(). - */ -static INLINE GLfloat -solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y; - if (denom == 0.0) - return 0.0; - else - return -plane[2] / denom; -} - - -/* - * Solve plane and return clamped GLchan value. - */ -static INLINE GLchan -solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; -#if CHAN_TYPE == GL_FLOAT - return CLAMP(z, 0.0F, CHAN_MAXF); -#else - if (z < 0) - return 0; - else if (z > CHAN_MAX) - return CHAN_MAX; - return (GLchan) IROUND_POS(z); -#endif -} - - -/* - * Compute mipmap level of detail. - */ -static INLINE GLfloat -compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4], - GLfloat invQ, GLfloat width, GLfloat height) -{ - GLfloat dudx = sPlane[0] / sPlane[2] * invQ * width; - GLfloat dudy = sPlane[1] / sPlane[2] * invQ * width; - GLfloat dvdx = tPlane[0] / tPlane[2] * invQ * height; - GLfloat dvdy = tPlane[1] / tPlane[2] * invQ * height; - GLfloat r1 = dudx * dudx + dudy * dudy; - GLfloat r2 = dvdx * dvdx + dvdy * dvdy; - GLfloat rho2 = r1 + r2; - /* return log base 2 of rho */ - if (rho2 == 0.0F) - return 0.0; - else - return (GLfloat) (LOGF(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */ -} - - - - -/* - * Fill in the samples[] array with the (x,y) subpixel positions of - * xSamples * ySamples sample positions. - * Note that the four corner samples are put into the first four - * positions of the array. This allows us to optimize for the common - * case of all samples being inside the polygon. - */ -static void -make_sample_table(GLint xSamples, GLint ySamples, GLfloat samples[][2]) -{ - const GLfloat dx = 1.0F / (GLfloat) xSamples; - const GLfloat dy = 1.0F / (GLfloat) ySamples; - GLint x, y; - GLint i; - - i = 4; - for (x = 0; x < xSamples; x++) { - for (y = 0; y < ySamples; y++) { - GLint j; - if (x == 0 && y == 0) { - /* lower left */ - j = 0; - } - else if (x == xSamples - 1 && y == 0) { - /* lower right */ - j = 1; - } - else if (x == 0 && y == ySamples - 1) { - /* upper left */ - j = 2; - } - else if (x == xSamples - 1 && y == ySamples - 1) { - /* upper right */ - j = 3; - } - else { - j = i++; - } - samples[j][0] = x * dx + 0.5F * dx; - samples[j][1] = y * dy + 0.5F * dy; - } - } -} - - - -/* - * Compute how much of the given pixel's area is inside the rectangle - * defined by vertices v0, v1, v2, v3. - * Vertices MUST be specified in counter-clockwise order. - * Return: coverage in [0, 1]. - */ -static GLfloat -compute_coveragef(const struct LineInfo *info, - GLint winx, GLint winy) -{ - static GLfloat samples[SUB_PIXEL * SUB_PIXEL][2]; - static GLboolean haveSamples = GL_FALSE; - const GLfloat x = (GLfloat) winx; - const GLfloat y = (GLfloat) winy; - GLint stop = 4, i; - GLfloat insideCount = SUB_PIXEL * SUB_PIXEL; - - if (!haveSamples) { - make_sample_table(SUB_PIXEL, SUB_PIXEL, samples); - haveSamples = GL_TRUE; - } - -#if 0 /*DEBUG*/ - { - const GLfloat area = dx0 * dy1 - dx1 * dy0; - assert(area >= 0.0); - } -#endif - - for (i = 0; i < stop; i++) { - const GLfloat sx = x + samples[i][0]; - const GLfloat sy = y + samples[i][1]; - const GLfloat fx0 = sx - info->qx0; - const GLfloat fy0 = sy - info->qy0; - const GLfloat fx1 = sx - info->qx1; - const GLfloat fy1 = sy - info->qy1; - const GLfloat fx2 = sx - info->qx2; - const GLfloat fy2 = sy - info->qy2; - const GLfloat fx3 = sx - info->qx3; - const GLfloat fy3 = sy - info->qy3; - /* cross product determines if sample is inside or outside each edge */ - GLfloat cross0 = (info->ex0 * fy0 - info->ey0 * fx0); - GLfloat cross1 = (info->ex1 * fy1 - info->ey1 * fx1); - GLfloat cross2 = (info->ex2 * fy2 - info->ey2 * fx2); - GLfloat cross3 = (info->ex3 * fy3 - info->ey3 * fx3); - /* Check if the sample is exactly on an edge. If so, let cross be a - * positive or negative value depending on the direction of the edge. - */ - if (cross0 == 0.0F) - cross0 = info->ex0 + info->ey0; - if (cross1 == 0.0F) - cross1 = info->ex1 + info->ey1; - if (cross2 == 0.0F) - cross2 = info->ex2 + info->ey2; - if (cross3 == 0.0F) - cross3 = info->ex3 + info->ey3; - if (cross0 < 0.0F || cross1 < 0.0F || cross2 < 0.0F || cross3 < 0.0F) { - /* point is outside quadrilateral */ - insideCount -= 1.0F; - stop = SUB_PIXEL * SUB_PIXEL; - } - } - if (stop == 4) - return 1.0F; - else - return insideCount * (1.0F / (SUB_PIXEL * SUB_PIXEL)); -} - - -/** - * Compute coverage value for color index mode. - * XXX this may not be quite correct. - * \return coverage in [0,15]. - */ -static GLfloat -compute_coveragei(const struct LineInfo *info, - GLint winx, GLint winy) -{ - return compute_coveragef(info, winx, winy) * 15.0F; -} - - - -typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line, - int ix, int iy); - - - -/* - * Draw an AA line segment (called many times per line when stippling) - */ -static void -segment(GLcontext *ctx, - struct LineInfo *line, - plot_func plot, - GLfloat t0, GLfloat t1) -{ - const GLfloat absDx = (line->dx < 0.0F) ? -line->dx : line->dx; - const GLfloat absDy = (line->dy < 0.0F) ? -line->dy : line->dy; - /* compute the actual segment's endpoints */ - const GLfloat x0 = line->x0 + t0 * line->dx; - const GLfloat y0 = line->y0 + t0 * line->dy; - const GLfloat x1 = line->x0 + t1 * line->dx; - const GLfloat y1 = line->y0 + t1 * line->dy; - - /* compute vertices of the line-aligned quadrilateral */ - line->qx0 = x0 - line->yAdj; - line->qy0 = y0 + line->xAdj; - line->qx1 = x0 + line->yAdj; - line->qy1 = y0 - line->xAdj; - line->qx2 = x1 + line->yAdj; - line->qy2 = y1 - line->xAdj; - line->qx3 = x1 - line->yAdj; - line->qy3 = y1 + line->xAdj; - /* compute the quad's edge vectors (for coverage calc) */ - line->ex0 = line->qx1 - line->qx0; - line->ey0 = line->qy1 - line->qy0; - line->ex1 = line->qx2 - line->qx1; - line->ey1 = line->qy2 - line->qy1; - line->ex2 = line->qx3 - line->qx2; - line->ey2 = line->qy3 - line->qy2; - line->ex3 = line->qx0 - line->qx3; - line->ey3 = line->qy0 - line->qy3; - - if (absDx > absDy) { - /* X-major line */ - GLfloat dydx = line->dy / line->dx; - GLfloat xLeft, xRight, yBot, yTop; - GLint ix, ixRight; - if (x0 < x1) { - xLeft = x0 - line->halfWidth; - xRight = x1 + line->halfWidth; - if (line->dy >= 0.0) { - yBot = y0 - 3.0F * line->halfWidth; - yTop = y0 + line->halfWidth; - } - else { - yBot = y0 - line->halfWidth; - yTop = y0 + 3.0F * line->halfWidth; - } - } - else { - xLeft = x1 - line->halfWidth; - xRight = x0 + line->halfWidth; - if (line->dy <= 0.0) { - yBot = y1 - 3.0F * line->halfWidth; - yTop = y1 + line->halfWidth; - } - else { - yBot = y1 - line->halfWidth; - yTop = y1 + 3.0F * line->halfWidth; - } - } - - /* scan along the line, left-to-right */ - ixRight = (GLint) (xRight + 1.0F); - - /*printf("avg span height: %g\n", yTop - yBot);*/ - for (ix = (GLint) xLeft; ix < ixRight; ix++) { - const GLint iyBot = (GLint) yBot; - const GLint iyTop = (GLint) (yTop + 1.0F); - GLint iy; - /* scan across the line, bottom-to-top */ - for (iy = iyBot; iy < iyTop; iy++) { - (*plot)(ctx, line, ix, iy); - } - yBot += dydx; - yTop += dydx; - } - } - else { - /* Y-major line */ - GLfloat dxdy = line->dx / line->dy; - GLfloat yBot, yTop, xLeft, xRight; - GLint iy, iyTop; - if (y0 < y1) { - yBot = y0 - line->halfWidth; - yTop = y1 + line->halfWidth; - if (line->dx >= 0.0) { - xLeft = x0 - 3.0F * line->halfWidth; - xRight = x0 + line->halfWidth; - } - else { - xLeft = x0 - line->halfWidth; - xRight = x0 + 3.0F * line->halfWidth; - } - } - else { - yBot = y1 - line->halfWidth; - yTop = y0 + line->halfWidth; - if (line->dx <= 0.0) { - xLeft = x1 - 3.0F * line->halfWidth; - xRight = x1 + line->halfWidth; - } - else { - xLeft = x1 - line->halfWidth; - xRight = x1 + 3.0F * line->halfWidth; - } - } - - /* scan along the line, bottom-to-top */ - iyTop = (GLint) (yTop + 1.0F); - - /*printf("avg span width: %g\n", xRight - xLeft);*/ - for (iy = (GLint) yBot; iy < iyTop; iy++) { - const GLint ixLeft = (GLint) xLeft; - const GLint ixRight = (GLint) (xRight + 1.0F); - GLint ix; - /* scan across the line, left-to-right */ - for (ix = ixLeft; ix < ixRight; ix++) { - (*plot)(ctx, line, ix, iy); - } - xLeft += dxdy; - xRight += dxdy; - } - } -} - - -#define NAME(x) aa_ci_##x -#define DO_Z -#define DO_ATTRIBS /* for fog */ -#define DO_INDEX -#include "s_aalinetemp.h" - - -#define NAME(x) aa_rgba_##x -#define DO_Z -#define DO_RGBA -#include "s_aalinetemp.h" - - -#define NAME(x) aa_general_rgba_##x -#define DO_Z -#define DO_RGBA -#define DO_ATTRIBS -#include "s_aalinetemp.h" - - - -void -_swrast_choose_aa_line_function(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - ASSERT(ctx->Line.SmoothFlag); - - if (ctx->Visual.rgbMode) { - /* RGBA */ - if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current - || (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - || ctx->Fog.ColorSumEnabled - || swrast->_FogEnabled) { - swrast->Line = aa_general_rgba_line; - } - else { - swrast->Line = aa_rgba_line; - } - } - else { - /* Color Index */ - swrast->Line = aa_ci_line; - } -} diff --git a/src/libs/mesa/mesa/swrast/s_aaline.h b/src/libs/mesa/mesa/swrast/s_aaline.h deleted file mode 100644 index f1d708ec80..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aaline.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_AALINE_H -#define S_AALINE_H - - -#include "swrast.h" - - -extern void -_swrast_choose_aa_line_function(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_aalinetemp.h b/src/libs/mesa/mesa/swrast/s_aalinetemp.h deleted file mode 100644 index 42ffe9f20c..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aalinetemp.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/* - * Antialiased line template. - */ - - -/* - * Function to render each fragment in the AA line. - * \param ix - integer fragment window X coordiante - * \param iy - integer fragment window Y coordiante - */ -static void -NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLfloat fx = (GLfloat) ix; - const GLfloat fy = (GLfloat) iy; -#ifdef DO_INDEX - const GLfloat coverage = compute_coveragei(line, ix, iy); -#else - const GLfloat coverage = compute_coveragef(line, ix, iy); -#endif - const GLuint i = line->span.end; - - (void) swrast; - - if (coverage == 0.0) - return; - - line->span.end++; - line->span.array->coverage[i] = coverage; - line->span.array->x[i] = ix; - line->span.array->y[i] = iy; - - /* - * Compute Z, color, texture coords, fog for the fragment by - * solving the plane equations at (ix,iy). - */ -#ifdef DO_Z - line->span.array->z[i] = (GLuint) solve_plane(fx, fy, line->zPlane); -#endif -#ifdef DO_RGBA - line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane); - line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane); - line->span.array->rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane); - line->span.array->rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane); -#endif -#ifdef DO_INDEX - line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane); -#endif -#if defined(DO_ATTRIBS) - ATTRIB_LOOP_BEGIN - GLfloat (*attribArray)[4] = line->span.array->attribs[attr]; - if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0 - && !ctx->FragmentProgram._Current) { - /* texcoord w/ divide by Q */ - const GLuint unit = attr - FRAG_ATTRIB_TEX0; - const GLfloat invQ = solve_plane_recip(fx, fy, line->attrPlane[attr][3]); - GLuint c; - for (c = 0; c < 3; c++) { - attribArray[i][c] = solve_plane(fx, fy, line->attrPlane[attr][c]) * invQ; - } - line->span.array->lambda[unit][i] - = compute_lambda(line->attrPlane[attr][0], - line->attrPlane[attr][1], invQ, - line->texWidth[attr], line->texHeight[attr]); - } - else { - /* non-texture attrib */ - const GLfloat invW = solve_plane_recip(fx, fy, line->wPlane); - GLuint c; - for (c = 0; c < 4; c++) { - attribArray[i][c] = solve_plane(fx, fy, line->attrPlane[attr][c]) * invW; - } - } - ATTRIB_LOOP_END -#endif - - if (line->span.end == MAX_WIDTH) { -#if defined(DO_RGBA) - _swrast_write_rgba_span(ctx, &(line->span)); -#else - _swrast_write_index_span(ctx, &(line->span)); -#endif - line->span.end = 0; /* reset counter */ - } -} - - - -/* - * Line setup - */ -static void -NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLfloat tStart, tEnd; /* segment start, end along line length */ - GLboolean inSegment; - GLint iLen, i; - - /* Init the LineInfo struct */ - struct LineInfo line; - line.x0 = v0->attrib[FRAG_ATTRIB_WPOS][0]; - line.y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; - line.x1 = v1->attrib[FRAG_ATTRIB_WPOS][0]; - line.y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; - line.dx = line.x1 - line.x0; - line.dy = line.y1 - line.y0; - line.len = SQRTF(line.dx * line.dx + line.dy * line.dy); - line.halfWidth = 0.5F * CLAMP(ctx->Line.Width, - ctx->Const.MinLineWidthAA, - ctx->Const.MaxLineWidthAA); - - if (line.len == 0.0 || IS_INF_OR_NAN(line.len)) - return; - - INIT_SPAN(line.span, GL_LINE); - line.span.arrayMask = SPAN_XY | SPAN_COVERAGE; - line.span.facing = swrast->PointLineFacing; - line.xAdj = line.dx / line.len * line.halfWidth; - line.yAdj = line.dy / line.len * line.halfWidth; - -#ifdef DO_Z - line.span.arrayMask |= SPAN_Z; - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->attrib[FRAG_ATTRIB_WPOS][2], v1->attrib[FRAG_ATTRIB_WPOS][2], line.zPlane); -#endif -#ifdef DO_RGBA - line.span.arrayMask |= SPAN_RGBA; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->color[RCOMP], v1->color[RCOMP], line.rPlane); - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->color[GCOMP], v1->color[GCOMP], line.gPlane); - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->color[BCOMP], v1->color[BCOMP], line.bPlane); - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->color[ACOMP], v1->color[ACOMP], line.aPlane); - } - else { - constant_plane(v1->color[RCOMP], line.rPlane); - constant_plane(v1->color[GCOMP], line.gPlane); - constant_plane(v1->color[BCOMP], line.bPlane); - constant_plane(v1->color[ACOMP], line.aPlane); - } -#endif -#ifdef DO_INDEX - line.span.arrayMask |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->attrib[FRAG_ATTRIB_CI][0], - v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); - } - else { - constant_plane(v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); - } -#endif -#if defined(DO_ATTRIBS) - { - const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; - line.span.arrayMask |= SPAN_LAMBDA; - compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane); - ATTRIB_LOOP_BEGIN - GLuint c; - if (swrast->_InterpMode[attr] == GL_FLAT) { - for (c = 0; c < 4; c++) { - constant_plane(v1->attrib[attr][c], line.attrPlane[attr][c]); - } - } - else { - for (c = 0; c < 4; c++) { - const GLfloat a0 = v0->attrib[attr][c] * invW0; - const GLfloat a1 = v1->attrib[attr][c] * invW1; - compute_plane(line.x0, line.y0, line.x1, line.y1, a0, a1, - line.attrPlane[attr][c]); - } - } - line.span.arrayAttribs |= (1 << attr); - if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { - const GLuint u = attr - FRAG_ATTRIB_TEX0; - const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; - const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel]; - line.texWidth[attr] = (GLfloat) texImage->Width; - line.texHeight[attr] = (GLfloat) texImage->Height; - } - ATTRIB_LOOP_END - } -#endif - - tStart = tEnd = 0.0; - inSegment = GL_FALSE; - iLen = (GLint) line.len; - - if (ctx->Line.StippleFlag) { - for (i = 0; i < iLen; i++) { - const GLuint bit = (swrast->StippleCounter / ctx->Line.StippleFactor) & 0xf; - if ((1 << bit) & ctx->Line.StipplePattern) { - /* stipple bit is on */ - const GLfloat t = (GLfloat) i / (GLfloat) line.len; - if (!inSegment) { - /* start new segment */ - inSegment = GL_TRUE; - tStart = t; - } - else { - /* still in the segment, extend it */ - tEnd = t; - } - } - else { - /* stipple bit is off */ - if (inSegment && (tEnd > tStart)) { - /* draw the segment */ - segment(ctx, &line, NAME(plot), tStart, tEnd); - inSegment = GL_FALSE; - } - else { - /* still between segments, do nothing */ - } - } - swrast->StippleCounter++; - } - - if (inSegment) { - /* draw the final segment of the line */ - segment(ctx, &line, NAME(plot), tStart, 1.0F); - } - } - else { - /* non-stippled */ - segment(ctx, &line, NAME(plot), 0.0, 1.0); - } - -#if defined(DO_RGBA) - _swrast_write_rgba_span(ctx, &(line.span)); -#else - _swrast_write_index_span(ctx, &(line.span)); -#endif -} - - - - -#undef DO_Z -#undef DO_RGBA -#undef DO_INDEX -#undef DO_ATTRIBS -#undef NAME diff --git a/src/libs/mesa/mesa/swrast/s_aatriangle.c b/src/libs/mesa/mesa/swrast/s_aatriangle.c deleted file mode 100644 index 078f16aea0..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aatriangle.c +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/* - * Antialiased Triangle rasterizers - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "s_aatriangle.h" -#include "s_context.h" -#include "s_span.h" - - -/* - * Compute coefficients of a plane using the X,Y coords of the v0, v1, v2 - * vertices and the given Z values. - * A point (x,y,z) lies on plane iff a*x+b*y+c*z+d = 0. - */ -static INLINE void -compute_plane(const GLfloat v0[], const GLfloat v1[], const GLfloat v2[], - GLfloat z0, GLfloat z1, GLfloat z2, GLfloat plane[4]) -{ - const GLfloat px = v1[0] - v0[0]; - const GLfloat py = v1[1] - v0[1]; - const GLfloat pz = z1 - z0; - - const GLfloat qx = v2[0] - v0[0]; - const GLfloat qy = v2[1] - v0[1]; - const GLfloat qz = z2 - z0; - - /* Crossproduct "(a,b,c):= dv1 x dv2" is orthogonal to plane. */ - const GLfloat a = py * qz - pz * qy; - const GLfloat b = pz * qx - px * qz; - const GLfloat c = px * qy - py * qx; - /* Point on the plane = "r*(a,b,c) + w", with fixed "r" depending - on the distance of plane from origin and arbitrary "w" parallel - to the plane. */ - /* The scalar product "(r*(a,b,c)+w)*(a,b,c)" is "r*(a^2+b^2+c^2)", - which is equal to "-d" below. */ - const GLfloat d = -(a * v0[0] + b * v0[1] + c * z0); - - plane[0] = a; - plane[1] = b; - plane[2] = c; - plane[3] = d; -} - - -/* - * Compute coefficients of a plane with a constant Z value. - */ -static INLINE void -constant_plane(GLfloat value, GLfloat plane[4]) -{ - plane[0] = 0.0; - plane[1] = 0.0; - plane[2] = -1.0; - plane[3] = value; -} - -#define CONSTANT_PLANE(VALUE, PLANE) \ -do { \ - PLANE[0] = 0.0F; \ - PLANE[1] = 0.0F; \ - PLANE[2] = -1.0F; \ - PLANE[3] = VALUE; \ -} while (0) - - - -/* - * Solve plane equation for Z at (X,Y). - */ -static INLINE GLfloat -solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - ASSERT(plane[2] != 0.0F); - return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; -} - - -#define SOLVE_PLANE(X, Y, PLANE) \ - ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2]) - - -/* - * Return 1 / solve_plane(). - */ -static INLINE GLfloat -solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y; - if (denom == 0.0F) - return 0.0F; - else - return -plane[2] / denom; -} - - -/* - * Solve plane and return clamped GLchan value. - */ -static INLINE GLchan -solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4]) -{ - const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; -#if CHAN_TYPE == GL_FLOAT - return CLAMP(z, 0.0F, CHAN_MAXF); -#else - if (z < 0) - return 0; - else if (z > CHAN_MAX) - return CHAN_MAX; - return (GLchan) IROUND_POS(z); -#endif -} - - -static INLINE GLfloat -plane_dx(const GLfloat plane[4]) -{ - return -plane[0] / plane[2]; -} - -static INLINE GLfloat -plane_dy(const GLfloat plane[4]) -{ - return -plane[1] / plane[2]; -} - - - -/* - * Compute how much (area) of the given pixel is inside the triangle. - * Vertices MUST be specified in counter-clockwise order. - * Return: coverage in [0, 1]. - */ -static GLfloat -compute_coveragef(const GLfloat v0[3], const GLfloat v1[3], - const GLfloat v2[3], GLint winx, GLint winy) -{ - /* Given a position [0,3]x[0,3] return the sub-pixel sample position. - * Contributed by Ray Tice. - * - * Jitter sample positions - - * - average should be .5 in x & y for each column - * - each of the 16 rows and columns should be used once - * - the rectangle formed by the first four points - * should contain the other points - * - the distrubition should be fairly even in any given direction - * - * The pattern drawn below isn't optimal, but it's better than a regular - * grid. In the drawing, the center of each subpixel is surrounded by - * four dots. The "x" marks the jittered position relative to the - * subpixel center. - */ -#define POS(a, b) (0.5+a*4+b)/16 - static const GLfloat samples[16][2] = { - /* start with the four corners */ - { POS(0, 2), POS(0, 0) }, - { POS(3, 3), POS(0, 2) }, - { POS(0, 0), POS(3, 1) }, - { POS(3, 1), POS(3, 3) }, - /* continue with interior samples */ - { POS(1, 1), POS(0, 1) }, - { POS(2, 0), POS(0, 3) }, - { POS(0, 3), POS(1, 3) }, - { POS(1, 2), POS(1, 0) }, - { POS(2, 3), POS(1, 2) }, - { POS(3, 2), POS(1, 1) }, - { POS(0, 1), POS(2, 2) }, - { POS(1, 0), POS(2, 1) }, - { POS(2, 1), POS(2, 3) }, - { POS(3, 0), POS(2, 0) }, - { POS(1, 3), POS(3, 0) }, - { POS(2, 2), POS(3, 2) } - }; - - const GLfloat x = (GLfloat) winx; - const GLfloat y = (GLfloat) winy; - const GLfloat dx0 = v1[0] - v0[0]; - const GLfloat dy0 = v1[1] - v0[1]; - const GLfloat dx1 = v2[0] - v1[0]; - const GLfloat dy1 = v2[1] - v1[1]; - const GLfloat dx2 = v0[0] - v2[0]; - const GLfloat dy2 = v0[1] - v2[1]; - GLint stop = 4, i; - GLfloat insideCount = 16.0F; - -#ifdef DEBUG - { - const GLfloat area = dx0 * dy1 - dx1 * dy0; - ASSERT(area >= 0.0); - } -#endif - - for (i = 0; i < stop; i++) { - const GLfloat sx = x + samples[i][0]; - const GLfloat sy = y + samples[i][1]; - /* cross product determines if sample is inside or outside each edge */ - GLfloat cross = (dx0 * (sy - v0[1]) - dy0 * (sx - v0[0])); - /* Check if the sample is exactly on an edge. If so, let cross be a - * positive or negative value depending on the direction of the edge. - */ - if (cross == 0.0F) - cross = dx0 + dy0; - if (cross < 0.0F) { - /* sample point is outside first edge */ - insideCount -= 1.0F; - stop = 16; - } - else { - /* sample point is inside first edge */ - cross = (dx1 * (sy - v1[1]) - dy1 * (sx - v1[0])); - if (cross == 0.0F) - cross = dx1 + dy1; - if (cross < 0.0F) { - /* sample point is outside second edge */ - insideCount -= 1.0F; - stop = 16; - } - else { - /* sample point is inside first and second edges */ - cross = (dx2 * (sy - v2[1]) - dy2 * (sx - v2[0])); - if (cross == 0.0F) - cross = dx2 + dy2; - if (cross < 0.0F) { - /* sample point is outside third edge */ - insideCount -= 1.0F; - stop = 16; - } - } - } - } - if (stop == 4) - return 1.0F; - else - return insideCount * (1.0F / 16.0F); -} - - - -/* - * Compute how much (area) of the given pixel is inside the triangle. - * Vertices MUST be specified in counter-clockwise order. - * Return: coverage in [0, 15]. - */ -static GLint -compute_coveragei(const GLfloat v0[3], const GLfloat v1[3], - const GLfloat v2[3], GLint winx, GLint winy) -{ - /* NOTE: 15 samples instead of 16. */ - static const GLfloat samples[15][2] = { - /* start with the four corners */ - { POS(0, 2), POS(0, 0) }, - { POS(3, 3), POS(0, 2) }, - { POS(0, 0), POS(3, 1) }, - { POS(3, 1), POS(3, 3) }, - /* continue with interior samples */ - { POS(1, 1), POS(0, 1) }, - { POS(2, 0), POS(0, 3) }, - { POS(0, 3), POS(1, 3) }, - { POS(1, 2), POS(1, 0) }, - { POS(2, 3), POS(1, 2) }, - { POS(3, 2), POS(1, 1) }, - { POS(0, 1), POS(2, 2) }, - { POS(1, 0), POS(2, 1) }, - { POS(2, 1), POS(2, 3) }, - { POS(3, 0), POS(2, 0) }, - { POS(1, 3), POS(3, 0) } - }; - const GLfloat x = (GLfloat) winx; - const GLfloat y = (GLfloat) winy; - const GLfloat dx0 = v1[0] - v0[0]; - const GLfloat dy0 = v1[1] - v0[1]; - const GLfloat dx1 = v2[0] - v1[0]; - const GLfloat dy1 = v2[1] - v1[1]; - const GLfloat dx2 = v0[0] - v2[0]; - const GLfloat dy2 = v0[1] - v2[1]; - GLint stop = 4, i; - GLint insideCount = 15; - -#ifdef DEBUG - { - const GLfloat area = dx0 * dy1 - dx1 * dy0; - ASSERT(area >= 0.0); - } -#endif - - for (i = 0; i < stop; i++) { - const GLfloat sx = x + samples[i][0]; - const GLfloat sy = y + samples[i][1]; - const GLfloat fx0 = sx - v0[0]; - const GLfloat fy0 = sy - v0[1]; - const GLfloat fx1 = sx - v1[0]; - const GLfloat fy1 = sy - v1[1]; - const GLfloat fx2 = sx - v2[0]; - const GLfloat fy2 = sy - v2[1]; - /* cross product determines if sample is inside or outside each edge */ - GLfloat cross0 = (dx0 * fy0 - dy0 * fx0); - GLfloat cross1 = (dx1 * fy1 - dy1 * fx1); - GLfloat cross2 = (dx2 * fy2 - dy2 * fx2); - /* Check if the sample is exactly on an edge. If so, let cross be a - * positive or negative value depending on the direction of the edge. - */ - if (cross0 == 0.0F) - cross0 = dx0 + dy0; - if (cross1 == 0.0F) - cross1 = dx1 + dy1; - if (cross2 == 0.0F) - cross2 = dx2 + dy2; - if (cross0 < 0.0F || cross1 < 0.0F || cross2 < 0.0F) { - /* point is outside triangle */ - insideCount--; - stop = 15; - } - } - if (stop == 4) - return 15; - else - return insideCount; -} - - -static void -rgba_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ -#define DO_Z -#define DO_RGBA -#include "s_aatritemp.h" -} - - -static void -index_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ -#define DO_Z -#define DO_ATTRIBS -#define DO_INDEX -#include "s_aatritemp.h" -} - - -static void -general_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ -#define DO_Z -#define DO_RGBA -#define DO_ATTRIBS -#include "s_aatritemp.h" -} - - - -/* - * Examine GL state and set swrast->Triangle to an - * appropriate antialiased triangle rasterizer function. - */ -void -_swrast_set_aa_triangle_function(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - ASSERT(ctx->Polygon.SmoothFlag); - - if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current - || swrast->_FogEnabled - || NEED_SECONDARY_COLOR(ctx)) { - SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri; - } - else if (ctx->Visual.rgbMode) { - SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; - } - else { - SWRAST_CONTEXT(ctx)->Triangle = index_aa_tri; - } - - ASSERT(SWRAST_CONTEXT(ctx)->Triangle); -} diff --git a/src/libs/mesa/mesa/swrast/s_aatriangle.h b/src/libs/mesa/mesa/swrast/s_aatriangle.h deleted file mode 100644 index 4b57fa73a2..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aatriangle.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_AATRIANGLE_H -#define S_AATRIANGLE_H - - -#include "swrast.h" - - -extern void -_swrast_set_aa_triangle_function(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_aatritemp.h b/src/libs/mesa/mesa/swrast/s_aatritemp.h deleted file mode 100644 index 0827b3db9e..0000000000 --- a/src/libs/mesa/mesa/swrast/s_aatritemp.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/* - * Antialiased Triangle Rasterizer Template - * - * This file is #include'd to generate custom AA triangle rasterizers. - * NOTE: this code hasn't been optimized yet. That'll come after it - * works correctly. - * - * The following macros may be defined to indicate what auxillary information - * must be copmuted across the triangle: - * DO_Z - if defined, compute Z values - * DO_RGBA - if defined, compute RGBA values - * DO_INDEX - if defined, compute color index values - * DO_ATTRIBS - if defined, compute texcoords, varying, etc. - */ - -/*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/ -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *p1 = v1->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *p2 = v2->attrib[FRAG_ATTRIB_WPOS]; - const SWvertex *vMin, *vMid, *vMax; - GLint iyMin, iyMax; - GLfloat yMin, yMax; - GLboolean ltor; - GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */ - - SWspan span; - -#ifdef DO_Z - GLfloat zPlane[4]; -#endif -#ifdef DO_RGBA - GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; -#endif -#ifdef DO_INDEX - GLfloat iPlane[4]; -#endif -#if defined(DO_ATTRIBS) - GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; - GLfloat wPlane[4]; /* win[3] */ -#endif - GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign; - - (void) swrast; - - INIT_SPAN(span, GL_POLYGON); - span.arrayMask = SPAN_COVERAGE; - - /* determine bottom to top order of vertices */ - { - GLfloat y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat y2 = v2->attrib[FRAG_ATTRIB_WPOS][1]; - if (y0 <= y1) { - if (y1 <= y2) { - vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */ - } - else if (y2 <= y0) { - vMin = v2; vMid = v0; vMax = v1; /* y2<=y0<=y1 */ - } - else { - vMin = v0; vMid = v2; vMax = v1; bf = -bf; /* y0<=y2<=y1 */ - } - } - else { - if (y0 <= y2) { - vMin = v1; vMid = v0; vMax = v2; bf = -bf; /* y1<=y0<=y2 */ - } - else if (y2 <= y1) { - vMin = v2; vMid = v1; vMax = v0; bf = -bf; /* y2<=y1<=y0 */ - } - else { - vMin = v1; vMid = v2; vMax = v0; /* y1<=y2<=y0 */ - } - } - } - - majDx = vMax->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; - majDy = vMax->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; - - /* front/back-face determination and cullling */ - { - const GLfloat botDx = vMid->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; - const GLfloat botDy = vMid->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; - const GLfloat area = majDx * botDy - botDx * majDy; - /* Do backface culling */ - if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area)) - return; - ltor = (GLboolean) (area < 0.0F); - - span.facing = area * swrast->_BackfaceSign > 0.0F; - } - - /* Plane equation setup: - * We evaluate plane equations at window (x,y) coordinates in order - * to compute color, Z, fog, texcoords, etc. This isn't terribly - * efficient but it's easy and reliable. - */ -#ifdef DO_Z - compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane); - span.arrayMask |= SPAN_Z; -#endif -#ifdef DO_RGBA - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane); - compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane); - compute_plane(p0, p1, p2, v0->color[BCOMP], v1->color[BCOMP], v2->color[BCOMP], bPlane); - compute_plane(p0, p1, p2, v0->color[ACOMP], v1->color[ACOMP], v2->color[ACOMP], aPlane); - } - else { - constant_plane(v2->color[RCOMP], rPlane); - constant_plane(v2->color[GCOMP], gPlane); - constant_plane(v2->color[BCOMP], bPlane); - constant_plane(v2->color[ACOMP], aPlane); - } - span.arrayMask |= SPAN_RGBA; -#endif -#ifdef DO_INDEX - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(p0, p1, p2, (GLfloat) v0->attrib[FRAG_ATTRIB_CI][0], - v1->attrib[FRAG_ATTRIB_CI][0], v2->attrib[FRAG_ATTRIB_CI][0], iPlane); - } - else { - constant_plane(v2->attrib[FRAG_ATTRIB_CI][0], iPlane); - } - span.arrayMask |= SPAN_INDEX; -#endif -#if defined(DO_ATTRIBS) - { - const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat invW2 = v2->attrib[FRAG_ATTRIB_WPOS][3]; - compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane); - span.attrStepX[FRAG_ATTRIB_WPOS][3] = plane_dx(wPlane); - span.attrStepY[FRAG_ATTRIB_WPOS][3] = plane_dy(wPlane); - ATTRIB_LOOP_BEGIN - GLuint c; - if (swrast->_InterpMode[attr] == GL_FLAT) { - for (c = 0; c < 4; c++) { - constant_plane(v2->attrib[attr][c] * invW2, attrPlane[attr][c]); - } - } - else { - for (c = 0; c < 4; c++) { - const GLfloat a0 = v0->attrib[attr][c] * invW0; - const GLfloat a1 = v1->attrib[attr][c] * invW1; - const GLfloat a2 = v2->attrib[attr][c] * invW2; - compute_plane(p0, p1, p2, a0, a1, a2, attrPlane[attr][c]); - } - } - for (c = 0; c < 4; c++) { - span.attrStepX[attr][c] = plane_dx(attrPlane[attr][c]); - span.attrStepY[attr][c] = plane_dy(attrPlane[attr][c]); - } - ATTRIB_LOOP_END - } -#endif - - /* Begin bottom-to-top scan over the triangle. - * The long edge will either be on the left or right side of the - * triangle. We always scan from the long edge toward the shorter - * edges, stopping when we find that coverage = 0. If the long edge - * is on the left we scan left-to-right. Else, we scan right-to-left. - */ - yMin = vMin->attrib[FRAG_ATTRIB_WPOS][1]; - yMax = vMax->attrib[FRAG_ATTRIB_WPOS][1]; - iyMin = (GLint) yMin; - iyMax = (GLint) yMax + 1; - - if (ltor) { - /* scan left to right */ - const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat dxdy = majDx / majDy; - const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F; - GLfloat x = pMin[0] - (yMin - iyMin) * dxdy; - GLint iy; - for (iy = iyMin; iy < iyMax; iy++, x += dxdy) { - GLint ix, startX = (GLint) (x - xAdj); - GLuint count; - GLfloat coverage = 0.0F; - - /* skip over fragments with zero coverage */ - while (startX < MAX_WIDTH) { - coverage = compute_coveragef(pMin, pMid, pMax, startX, iy); - if (coverage > 0.0F) - break; - startX++; - } - - /* enter interior of triangle */ - ix = startX; - -#if defined(DO_ATTRIBS) - /* compute attributes at left-most fragment */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5, iy + 0.5, wPlane); - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - span.attrStart[attr][c] = solve_plane(ix + 0.5, iy + 0.5, attrPlane[attr][c]); - } - ATTRIB_LOOP_END -#endif - - count = 0; - while (coverage > 0.0F) { - /* (cx,cy) = center of fragment */ - const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; - SWspanarrays *array = span.array; -#ifdef DO_INDEX - array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy); -#else - array->coverage[count] = coverage; -#endif -#ifdef DO_Z - array->z[count] = (GLuint) solve_plane(cx, cy, zPlane); -#endif -#ifdef DO_RGBA - array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane); - array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane); - array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane); - array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane); -#endif -#ifdef DO_INDEX - array->index[count] = (GLint) solve_plane(cx, cy, iPlane); -#endif - ix++; - count++; - coverage = compute_coveragef(pMin, pMid, pMax, ix, iy); - } - - if (ix <= startX) - continue; - - span.x = startX; - span.y = iy; - span.end = (GLuint) ix - (GLuint) startX; -#if defined(DO_RGBA) - _swrast_write_rgba_span(ctx, &span); -#else - _swrast_write_index_span(ctx, &span); -#endif - } - } - else { - /* scan right to left */ - const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; - const GLfloat dxdy = majDx / majDy; - const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F; - GLfloat x = pMin[0] - (yMin - iyMin) * dxdy; - GLint iy; - for (iy = iyMin; iy < iyMax; iy++, x += dxdy) { - GLint ix, left, startX = (GLint) (x + xAdj); - GLuint count, n; - GLfloat coverage = 0.0F; - - /* make sure we're not past the window edge */ - if (startX >= ctx->DrawBuffer->_Xmax) { - startX = ctx->DrawBuffer->_Xmax - 1; - } - - /* skip fragments with zero coverage */ - while (startX > 0) { - coverage = compute_coveragef(pMin, pMax, pMid, startX, iy); - if (coverage > 0.0F) - break; - startX--; - } - - /* enter interior of triangle */ - ix = startX; - count = 0; - while (coverage > 0.0F) { - /* (cx,cy) = center of fragment */ - const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; - SWspanarrays *array = span.array; - ASSERT(ix >= 0); -#ifdef DO_INDEX - array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy); -#else - array->coverage[ix] = coverage; -#endif -#ifdef DO_Z - array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane); -#endif -#ifdef DO_RGBA - array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane); - array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane); - array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane); - array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane); -#endif -#ifdef DO_INDEX - array->index[ix] = (GLint) solve_plane(cx, cy, iPlane); -#endif - ix--; - count++; - coverage = compute_coveragef(pMin, pMax, pMid, ix, iy); - } - -#if defined(DO_ATTRIBS) - /* compute attributes at left-most fragment */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5, wPlane); - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5, attrPlane[attr][c]); - } - ATTRIB_LOOP_END -#endif - - if (startX <= ix) - continue; - - n = (GLuint) startX - (GLuint) ix; - - left = ix + 1; - - /* shift all values to the left */ - /* XXX this is temporary */ - { - SWspanarrays *array = span.array; - GLint j; - for (j = 0; j < (GLint) n; j++) { - array->coverage[j] = array->coverage[j + left]; -#ifdef DO_RGBA - COPY_CHAN4(array->rgba[j], array->rgba[j + left]); -#endif -#ifdef DO_INDEX - array->index[j] = array->index[j + left]; -#endif -#ifdef DO_Z - array->z[j] = array->z[j + left]; -#endif - } - } - - span.x = left; - span.y = iy; - span.end = n; -#if defined(DO_RGBA) - _swrast_write_rgba_span(ctx, &span); -#else - _swrast_write_index_span(ctx, &span); -#endif - } - } -} - - -#undef DO_Z -#undef DO_RGBA -#undef DO_INDEX -#undef DO_ATTRIBS -#undef DO_OCCLUSION_TEST diff --git a/src/libs/mesa/mesa/swrast/s_accum.c b/src/libs/mesa/mesa/swrast/s_accum.c deleted file mode 100644 index ff741777e7..0000000000 --- a/src/libs/mesa/mesa/swrast/s_accum.c +++ /dev/null @@ -1,599 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/fbobject.h" - -#include "s_accum.h" -#include "s_context.h" -#include "s_masking.h" -#include "s_span.h" - - -/* XXX this would have to change for accum buffers with more or less - * than 16 bits per color channel. - */ -#define ACCUM_SCALE16 32767.0 - - -/* - * Accumulation buffer notes - * - * Normally, accumulation buffer values are GLshorts with values in - * [-32767, 32767] which represent floating point colors in [-1, 1], - * as defined by the OpenGL specification. - * - * We optimize for the common case used for full-scene antialiasing: - * // start with accum buffer cleared to zero - * glAccum(GL_LOAD, w); // or GL_ACCUM the first image - * glAccum(GL_ACCUM, w); - * ... - * glAccum(GL_ACCUM, w); - * glAccum(GL_RETURN, 1.0); - * That is, we start with an empty accumulation buffer and accumulate - * n images, each with weight w = 1/n. - * In this scenario, we can simply store unscaled integer values in - * the accum buffer instead of scaled integers. We'll also keep track - * of the w value so when we do GL_RETURN we simply divide the accumulated - * values by n (n=1/w). - * This lets us avoid _many_ int->float->int conversions. - */ - - -#if CHAN_BITS == 8 -/* enable the optimization */ -#define USE_OPTIMIZED_ACCUM 1 -#else -#define USE_OPTIMIZED_ACCUM 0 -#endif - - -/** - * This is called when we fall out of optimized/unscaled accum buffer mode. - * That is, we convert each unscaled accum buffer value into a scaled value - * representing the range[-1, 1]. - */ -static void -rescale_accum( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; - const GLfloat s = swrast->_IntegerAccumScaler * (32767.0F / CHAN_MAXF); - - assert(rb); - assert(rb->_BaseFormat == GL_RGBA); - /* add other types in future? */ - assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT); - assert(swrast->_IntegerAccumMode); - - if (rb->GetPointer(ctx, rb, 0, 0)) { - /* directly-addressable memory */ - GLuint y; - for (y = 0; y < rb->Height; y++) { - GLuint i; - GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, 0, y); - for (i = 0; i < 4 * rb->Width; i++) { - acc[i] = (GLshort) (acc[i] * s); - } - } - } - else { - /* use get/put row funcs */ - GLuint y; - for (y = 0; y < rb->Height; y++) { - GLshort accRow[MAX_WIDTH * 4]; - GLuint i; - rb->GetRow(ctx, rb, rb->Width, 0, y, accRow); - for (i = 0; i < 4 * rb->Width; i++) { - accRow[i] = (GLshort) (accRow[i] * s); - } - rb->PutRow(ctx, rb, rb->Width, 0, y, accRow, NULL); - } - } - - swrast->_IntegerAccumMode = GL_FALSE; -} - - - -/** - * Clear the accumulation Buffer. - */ -void -_swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint x, y, width, height; - - if (ctx->Visual.accumRedBits == 0) { - /* No accumulation buffer! Not an error. */ - return; - } - - if (!rb || !rb->Data) - return; - - assert(rb->_BaseFormat == GL_RGBA); - /* add other types in future? */ - assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT); - - /* bounds, with scissor */ - x = ctx->DrawBuffer->_Xmin; - y = ctx->DrawBuffer->_Ymin; - width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - - if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { - const GLfloat accScale = 32767.0; - GLshort clearVal[4]; - GLuint i; - - clearVal[0] = (GLshort) (ctx->Accum.ClearColor[0] * accScale); - clearVal[1] = (GLshort) (ctx->Accum.ClearColor[1] * accScale); - clearVal[2] = (GLshort) (ctx->Accum.ClearColor[2] * accScale); - clearVal[3] = (GLshort) (ctx->Accum.ClearColor[3] * accScale); - - for (i = 0; i < height; i++) { - rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); - } - } - else { - /* someday support other sizes */ - } - - /* update optimized accum state vars */ - if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 && - ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) { -#if USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; -#else - swrast->_IntegerAccumMode = GL_FALSE; -#endif - swrast->_IntegerAccumScaler = 0.0; /* denotes empty accum buffer */ - } - else { - swrast->_IntegerAccumMode = GL_FALSE; - } -} - - -static void -accum_add(GLcontext *ctx, GLfloat value, - GLint xpos, GLint ypos, GLint width, GLint height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; - - assert(rb); - - /* Leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode) - rescale_accum(ctx); - - if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { - const GLshort incr = (GLshort) (value * ACCUM_SCALE16); - if (rb->GetPointer(ctx, rb, 0, 0)) { - GLint i, j; - for (i = 0; i < height; i++) { - GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); - for (j = 0; j < 4 * width; j++) { - acc[j] += incr; - } - } - } - else { - GLint i, j; - for (i = 0; i < height; i++) { - GLshort accRow[4 * MAX_WIDTH]; - rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow); - for (j = 0; j < 4 * width; j++) { - accRow[j] += incr; - } - rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL); - } - } - } - else { - /* other types someday */ - } -} - - -static void -accum_mult(GLcontext *ctx, GLfloat mult, - GLint xpos, GLint ypos, GLint width, GLint height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; - - assert(rb); - - /* Leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode) - rescale_accum(ctx); - - if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { - if (rb->GetPointer(ctx, rb, 0, 0)) { - GLint i, j; - for (i = 0; i < height; i++) { - GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); - for (j = 0; j < 4 * width; j++) { - acc[j] = (GLshort) (acc[j] * mult); - } - } - } - else { - GLint i, j; - for (i = 0; i < height; i++) { - GLshort accRow[4 * MAX_WIDTH]; - rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow); - for (j = 0; j < 4 * width; j++) { - accRow[j] = (GLshort) (accRow[j] * mult); - } - rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL); - } - } - } - else { - /* other types someday */ - } -} - - - -static void -accum_accum(GLcontext *ctx, GLfloat value, - GLint xpos, GLint ypos, GLint width, GLint height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; - const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL); - - assert(rb); - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no read buffer - OK */ - return; - } - - /* May have to leave optimized accum buffer mode */ - if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0) - swrast->_IntegerAccumScaler = value; - if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler) - rescale_accum(ctx); - - if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { - const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF; - GLshort accumRow[4 * MAX_WIDTH]; - GLchan rgba[MAX_WIDTH][4]; - GLint i; - - for (i = 0; i < height; i++) { - GLshort *acc; - if (directAccess) { - acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); - } - else { - rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow); - acc = accumRow; - } - - /* read colors from color buffer */ - _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, - xpos, ypos + i, CHAN_TYPE, rgba); - - /* do accumulation */ - if (swrast->_IntegerAccumMode) { - /* simply add integer color values into accum buffer */ - GLint j; - for (j = 0; j < width; j++) { - acc[j * 4 + 0] += rgba[j][RCOMP]; - acc[j * 4 + 1] += rgba[j][GCOMP]; - acc[j * 4 + 2] += rgba[j][BCOMP]; - acc[j * 4 + 3] += rgba[j][ACOMP]; - } - } - else { - /* scaled integer (or float) accum buffer */ - GLint j; - for (j = 0; j < width; j++) { - acc[j * 4 + 0] += (GLshort) ((GLfloat) rgba[j][RCOMP] * scale); - acc[j * 4 + 1] += (GLshort) ((GLfloat) rgba[j][GCOMP] * scale); - acc[j * 4 + 2] += (GLshort) ((GLfloat) rgba[j][BCOMP] * scale); - acc[j * 4 + 3] += (GLshort) ((GLfloat) rgba[j][ACOMP] * scale); - } - } - - if (!directAccess) { - rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL); - } - } - } - else { - /* other types someday */ - } -} - - - -static void -accum_load(GLcontext *ctx, GLfloat value, - GLint xpos, GLint ypos, GLint width, GLint height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; - const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL); - - assert(rb); - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no read buffer - OK */ - return; - } - - /* This is a change to go into optimized accum buffer mode */ - if (value > 0.0 && value <= 1.0) { -#if USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; -#else - swrast->_IntegerAccumMode = GL_FALSE; -#endif - swrast->_IntegerAccumScaler = value; - } - else { - swrast->_IntegerAccumMode = GL_FALSE; - swrast->_IntegerAccumScaler = 0.0; - } - - if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { - const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF; - GLshort accumRow[4 * MAX_WIDTH]; - GLchan rgba[MAX_WIDTH][4]; - GLint i; - - for (i = 0; i < height; i++) { - GLshort *acc; - if (directAccess) { - acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); - } - else { - rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow); - acc = accumRow; - } - - /* read colors from color buffer */ - _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, - xpos, ypos + i, CHAN_TYPE, rgba); - - /* do load */ - if (swrast->_IntegerAccumMode) { - /* just copy values in */ - GLint j; - assert(swrast->_IntegerAccumScaler > 0.0); - assert(swrast->_IntegerAccumScaler <= 1.0); - for (j = 0; j < width; j++) { - acc[j * 4 + 0] = rgba[j][RCOMP]; - acc[j * 4 + 1] = rgba[j][GCOMP]; - acc[j * 4 + 2] = rgba[j][BCOMP]; - acc[j * 4 + 3] = rgba[j][ACOMP]; - } - } - else { - /* scaled integer (or float) accum buffer */ - GLint j; - for (j = 0; j < width; j++) { - acc[j * 4 + 0] = (GLshort) ((GLfloat) rgba[j][RCOMP] * scale); - acc[j * 4 + 1] = (GLshort) ((GLfloat) rgba[j][GCOMP] * scale); - acc[j * 4 + 2] = (GLshort) ((GLfloat) rgba[j][BCOMP] * scale); - acc[j * 4 + 3] = (GLshort) ((GLfloat) rgba[j][ACOMP] * scale); - } - } - - if (!directAccess) { - rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL); - } - } - } -} - - -static void -accum_return(GLcontext *ctx, GLfloat value, - GLint xpos, GLint ypos, GLint width, GLint height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer; - const GLboolean directAccess - = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL); - const GLboolean masking = (!ctx->Color.ColorMask[RCOMP] || - !ctx->Color.ColorMask[GCOMP] || - !ctx->Color.ColorMask[BCOMP] || - !ctx->Color.ColorMask[ACOMP]); - - static GLchan multTable[32768]; - static GLfloat prevMult = 0.0; - const GLfloat mult = swrast->_IntegerAccumScaler; - const GLint max = MIN2((GLint) (256 / mult), 32767); - - /* May have to leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode && value != 1.0) - rescale_accum(ctx); - - if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) { - /* build lookup table to avoid many floating point multiplies */ - GLint j; - assert(swrast->_IntegerAccumScaler <= 1.0); - if (mult != prevMult) { - for (j = 0; j < max; j++) - multTable[j] = IROUND((GLfloat) j * mult); - prevMult = mult; - } - } - - if (accumRb->DataType == GL_SHORT || - accumRb->DataType == GL_UNSIGNED_SHORT) { - const GLfloat scale = value * CHAN_MAXF / ACCUM_SCALE16; - GLuint buffer; - GLint i; - - /* XXX maybe transpose the 'i' and 'buffer' loops??? */ - for (i = 0; i < height; i++) { - GLshort accumRow[4 * MAX_WIDTH]; - GLshort *acc; - SWspan span; - - /* init color span */ - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_RGBA; - span.x = xpos; - span.y = ypos + i; - - if (directAccess) { - acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i); - } - else { - accumRb->GetRow(ctx, accumRb, width, xpos, ypos + i, accumRow); - acc = accumRow; - } - - /* get the colors to return */ - if (swrast->_IntegerAccumMode) { - GLint j; - for (j = 0; j < width; j++) { - ASSERT(acc[j * 4 + 0] < max); - ASSERT(acc[j * 4 + 1] < max); - ASSERT(acc[j * 4 + 2] < max); - ASSERT(acc[j * 4 + 3] < max); - span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]]; - span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]]; - span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]]; - span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]]; - } - } - else { - /* scaled integer (or float) accum buffer */ - GLint j; - for (j = 0; j < width; j++) { -#if CHAN_BITS==32 - GLchan r = acc[j * 4 + 0] * scale; - GLchan g = acc[j * 4 + 1] * scale; - GLchan b = acc[j * 4 + 2] * scale; - GLchan a = acc[j * 4 + 3] * scale; -#else - GLint r = IROUND( (GLfloat) (acc[j * 4 + 0]) * scale ); - GLint g = IROUND( (GLfloat) (acc[j * 4 + 1]) * scale ); - GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale ); - GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale ); -#endif - span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX ); - span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX ); - span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX ); - span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX ); - } - } - - /* store colors */ - for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer]; - if (masking) { - _swrast_mask_rgba_span(ctx, rb, &span); - } - rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL); - } - } - } - else { - /* other types someday */ - } -} - - - -/** - * Software fallback for glAccum. - */ -void -_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLint xpos, ypos, width, height; - - if (SWRAST_CONTEXT(ctx)->NewState) - _swrast_validate_derived( ctx ); - - if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) { - _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer"); - return; - } - - RENDER_START(swrast, ctx); - - /* Compute region after calling RENDER_START so that we know the - * drawbuffer's size/bounds are up to date. - */ - xpos = ctx->DrawBuffer->_Xmin; - ypos = ctx->DrawBuffer->_Ymin; - width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - - switch (op) { - case GL_ADD: - if (value != 0.0F) { - accum_add(ctx, value, xpos, ypos, width, height); - } - break; - case GL_MULT: - if (value != 1.0F) { - accum_mult(ctx, value, xpos, ypos, width, height); - } - break; - case GL_ACCUM: - if (value != 0.0F) { - accum_accum(ctx, value, xpos, ypos, width, height); - } - break; - case GL_LOAD: - accum_load(ctx, value, xpos, ypos, width, height); - break; - case GL_RETURN: - accum_return(ctx, value, xpos, ypos, width, height); - break; - default: - _mesa_problem(ctx, "invalid mode in _swrast_Accum()"); - break; - } - - RENDER_FINISH(swrast, ctx); -} diff --git a/src/libs/mesa/mesa/swrast/s_accum.h b/src/libs/mesa/mesa/swrast/s_accum.h deleted file mode 100644 index 42e38cf02b..0000000000 --- a/src/libs/mesa/mesa/swrast/s_accum.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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 S_ACCUM_H -#define S_ACCUM_H - - -#include "main/mtypes.h" - - -extern void -_swrast_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_alpha.c b/src/libs/mesa/mesa/swrast/s_alpha.c deleted file mode 100644 index 5761bb00b4..0000000000 --- a/src/libs/mesa/mesa/swrast/s_alpha.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file swrast/s_alpha.c - * \brief Functions to apply alpha test. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/macros.h" - -#include "s_alpha.h" -#include "s_context.h" - - -#define ALPHA_TEST(ALPHA, LOOP_CODE) \ -do { \ - switch (ctx->Color.AlphaFunc) { \ - case GL_LESS: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA < ref); \ - LOOP_CODE; \ - } \ - break; \ - case GL_LEQUAL: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA <= ref); \ - LOOP_CODE; \ - } \ - break; \ - case GL_GEQUAL: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA >= ref); \ - LOOP_CODE; \ - } \ - break; \ - case GL_GREATER: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA > ref); \ - LOOP_CODE; \ - } \ - break; \ - case GL_NOTEQUAL: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA != ref); \ - LOOP_CODE; \ - } \ - break; \ - case GL_EQUAL: \ - for (i = 0; i < n; i++) { \ - mask[i] &= (ALPHA == ref); \ - LOOP_CODE; \ - } \ - break; \ - default: \ - _mesa_problem(ctx, "Invalid alpha test in _swrast_alpha_test" ); \ - return 0; \ - } \ -} while (0) - - - -/** - * Perform the alpha test for an array of pixels. - * For pixels that fail the test, mask[i] will be set to 0. - * \return 0 if all pixels in the span failed the alpha test, - * 1 if one or more pixels passed the alpha test. - */ -GLint -_swrast_alpha_test(const GLcontext *ctx, SWspan *span) -{ - const GLuint n = span->end; - GLubyte *mask = span->array->mask; - GLuint i; - - if (ctx->Color.AlphaFunc == GL_ALWAYS) { - /* do nothing */ - return 1; - } - else if (ctx->Color.AlphaFunc == GL_NEVER) { - /* All pixels failed - caller should check for this return value and - * act accordingly. - */ - span->writeAll = GL_FALSE; - return 0; - } - - if (span->arrayMask & SPAN_RGBA) { - /* Use array's alpha values */ - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - GLubyte ref; - CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); - ALPHA_TEST(rgba[i][ACOMP], ;); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - GLushort ref; - CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef); - ALPHA_TEST(rgba[i][ACOMP], ;); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - const GLfloat ref = ctx->Color.AlphaRef; - ALPHA_TEST(rgba[i][ACOMP], ;); - } - } - else { - /* Interpolate alpha values */ - ASSERT(span->interpMask & SPAN_RGBA); - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - const GLfixed alphaStep = span->alphaStep; - GLfixed alpha = span->alpha; - GLubyte ref; - CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); - ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - const GLfixed alphaStep = span->alphaStep; - GLfixed alpha = span->alpha; - GLushort ref; - CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef); - ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep); - } - else { - const GLfloat alphaStep = span->alphaStep; - GLfloat alpha = span->alpha; - const GLfloat ref = ctx->Color.AlphaRef; - ALPHA_TEST(alpha, alpha += alphaStep); - } - } - - span->writeAll = GL_FALSE; - - /* XXX examine mask[] values? */ - return 1; -} diff --git a/src/libs/mesa/mesa/swrast/s_alpha.h b/src/libs/mesa/mesa/swrast/s_alpha.h deleted file mode 100644 index 7a5b72e650..0000000000 --- a/src/libs/mesa/mesa/swrast/s_alpha.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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 S_ALPHA_H -#define S_ALPHA_H - - -#include "s_context.h" - - -extern GLint -_swrast_alpha_test( const GLcontext *ctx, SWspan *span ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_atifragshader.c b/src/libs/mesa/mesa/swrast/s_atifragshader.c deleted file mode 100644 index 21cbd3cf37..0000000000 --- a/src/libs/mesa/mesa/swrast/s_atifragshader.c +++ /dev/null @@ -1,613 +0,0 @@ -/* - * Copyright (C) 2004 David Airlie 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 - * DAVID AIRLIE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "shader/program.h" -#include "shader/atifragshader.h" -#include "swrast/s_atifragshader.h" - - -/** - * State for executing ATI fragment shader. - */ -struct atifs_machine -{ - GLfloat Registers[6][4]; /** six temporary registers */ - GLfloat PrevPassRegisters[6][4]; - GLfloat Inputs[2][4]; /** Primary, secondary input colors */ -}; - - - -/** - * Fetch a texel. - */ -static void -fetch_texel(GLcontext * ctx, const GLfloat texcoord[4], GLfloat lambda, - GLuint unit, GLfloat color[4]) -{ - GLchan rgba[4]; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, - 1, (const GLfloat(*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); -} - -static void -apply_swizzle(GLfloat values[4], GLuint swizzle) -{ - GLfloat s, t, r, q; - - s = values[0]; - t = values[1]; - r = values[2]; - q = values[3]; - - switch (swizzle) { - case GL_SWIZZLE_STR_ATI: - values[0] = s; - values[1] = t; - values[2] = r; - break; - case GL_SWIZZLE_STQ_ATI: - values[0] = s; - values[1] = t; - values[2] = q; - break; - case GL_SWIZZLE_STR_DR_ATI: - values[0] = s / r; - values[1] = t / r; - values[2] = 1 / r; - break; - case GL_SWIZZLE_STQ_DQ_ATI: -/* make sure q is not 0 to avoid problems later with infinite values (texture lookup)? */ - if (q == 0.0F) q = 0.000000001; - values[0] = s / q; - values[1] = t / q; - values[2] = 1 / q; - break; - } - values[3] = 0.0; -} - -static void -apply_src_rep(GLint optype, GLuint rep, GLfloat * val) -{ - GLint i; - GLint start, end; - if (!rep) - return; - - start = optype ? 3 : 0; - end = 4; - - for (i = start; i < end; i++) { - switch (rep) { - case GL_RED: - val[i] = val[0]; - break; - case GL_GREEN: - val[i] = val[1]; - break; - case GL_BLUE: - val[i] = val[2]; - break; - case GL_ALPHA: - val[i] = val[3]; - break; - } - } -} - -static void -apply_src_mod(GLint optype, GLuint mod, GLfloat * val) -{ - GLint i; - GLint start, end; - - if (!mod) - return; - - start = optype ? 3 : 0; - end = 4; - - for (i = start; i < end; i++) { - if (mod & GL_COMP_BIT_ATI) - val[i] = 1 - val[i]; - - if (mod & GL_BIAS_BIT_ATI) - val[i] = val[i] - 0.5; - - if (mod & GL_2X_BIT_ATI) - val[i] = 2 * val[i]; - - if (mod & GL_NEGATE_BIT_ATI) - val[i] = -val[i]; - } -} - -static void -apply_dst_mod(GLuint optype, GLuint mod, GLfloat * val) -{ - GLint i; - GLint has_sat = mod & GL_SATURATE_BIT_ATI; - GLint start, end; - - mod &= ~GL_SATURATE_BIT_ATI; - - start = optype ? 3 : 0; - end = optype ? 4 : 3; - - for (i = start; i < end; i++) { - switch (mod) { - case GL_2X_BIT_ATI: - val[i] = 2 * val[i]; - break; - case GL_4X_BIT_ATI: - val[i] = 4 * val[i]; - break; - case GL_8X_BIT_ATI: - val[i] = 8 * val[i]; - break; - case GL_HALF_BIT_ATI: - val[i] = val[i] * 0.5; - break; - case GL_QUARTER_BIT_ATI: - val[i] = val[i] * 0.25; - break; - case GL_EIGHTH_BIT_ATI: - val[i] = val[i] * 0.125; - break; - } - - if (has_sat) { - if (val[i] < 0.0) - val[i] = 0; - else if (val[i] > 1.0) - val[i] = 1.0; - } - else { - if (val[i] < -8.0) - val[i] = -8.0; - else if (val[i] > 8.0) - val[i] = 8.0; - } - } -} - - -static void -write_dst_addr(GLuint optype, GLuint mod, GLuint mask, GLfloat * src, - GLfloat * dst) -{ - GLint i; - apply_dst_mod(optype, mod, src); - - if (optype == ATI_FRAGMENT_SHADER_COLOR_OP) { - if (mask) { - if (mask & GL_RED_BIT_ATI) - dst[0] = src[0]; - - if (mask & GL_GREEN_BIT_ATI) - dst[1] = src[1]; - - if (mask & GL_BLUE_BIT_ATI) - dst[2] = src[2]; - } - else { - for (i = 0; i < 3; i++) - dst[i] = src[i]; - } - } - else - dst[3] = src[3]; -} - -static void -finish_pass(struct atifs_machine *machine) -{ - GLint i; - - for (i = 0; i < 6; i++) { - COPY_4V(machine->PrevPassRegisters[i], machine->Registers[i]); - } -} - -struct ati_fs_opcode_st ati_fs_opcodes[] = { - {GL_ADD_ATI, 2}, - {GL_SUB_ATI, 2}, - {GL_MUL_ATI, 2}, - {GL_MAD_ATI, 3}, - {GL_LERP_ATI, 3}, - {GL_MOV_ATI, 1}, - {GL_CND_ATI, 3}, - {GL_CND0_ATI, 3}, - {GL_DOT2_ADD_ATI, 3}, - {GL_DOT3_ATI, 2}, - {GL_DOT4_ATI, 2} -}; - - - -static void -handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst, - const SWspan *span, GLuint column, GLuint idx) -{ - GLuint swizzle = texinst->swizzle; - GLuint pass_tex = texinst->src; - - if (pass_tex >= GL_TEXTURE0_ARB && pass_tex <= GL_TEXTURE7_ARB) { - pass_tex -= GL_TEXTURE0_ARB; - COPY_4V(machine->Registers[idx], - span->array->attribs[FRAG_ATTRIB_TEX0 + pass_tex][column]); - } - else if (pass_tex >= GL_REG_0_ATI && pass_tex <= GL_REG_5_ATI) { - pass_tex -= GL_REG_0_ATI; - COPY_4V(machine->Registers[idx], machine->PrevPassRegisters[pass_tex]); - } - apply_swizzle(machine->Registers[idx], swizzle); - -} - -static void -handle_sample_op(GLcontext * ctx, struct atifs_machine *machine, - struct atifs_setupinst *texinst, const SWspan *span, - GLuint column, GLuint idx) -{ -/* sample from unit idx using texinst->src as coords */ - GLuint swizzle = texinst->swizzle; - GLuint coord_source = texinst->src; - GLfloat tex_coords[4]; - - if (coord_source >= GL_TEXTURE0_ARB && coord_source <= GL_TEXTURE7_ARB) { - coord_source -= GL_TEXTURE0_ARB; - COPY_4V(tex_coords, - span->array->attribs[FRAG_ATTRIB_TEX0 + coord_source][column]); - } - else if (coord_source >= GL_REG_0_ATI && coord_source <= GL_REG_5_ATI) { - coord_source -= GL_REG_0_ATI; - COPY_4V(tex_coords, machine->PrevPassRegisters[coord_source]); - } - apply_swizzle(tex_coords, swizzle); - fetch_texel(ctx, tex_coords, 0.0F, idx, machine->Registers[idx]); -} - -#define SETUP_SRC_REG(optype, i, x) \ -do { \ - COPY_4V(src[optype][i], x); \ -} while (0) - - - -/** - * Execute the given fragment shader. - * NOTE: we do everything in single-precision floating point - * \param ctx - rendering context - * \param shader - the shader to execute - * \param machine - virtual machine state - * \param span - the SWspan we're operating on - * \param column - which pixel [i] we're operating on in the span - */ -static void -execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader, - struct atifs_machine *machine, const SWspan *span, - GLuint column) -{ - GLuint pc; - struct atifs_instruction *inst; - struct atifs_setupinst *texinst; - GLint optype; - GLuint i; - GLint j, pass; - GLint dstreg; - GLfloat src[2][3][4]; - GLfloat zeros[4] = { 0.0, 0.0, 0.0, 0.0 }; - GLfloat ones[4] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat dst[2][4], *dstp; - - for (pass = 0; pass < shader->NumPasses; pass++) { - if (pass > 0) - finish_pass(machine); - for (j = 0; j < MAX_NUM_FRAGMENT_REGISTERS_ATI; j++) { - texinst = &shader->SetupInst[pass][j]; - if (texinst->Opcode == ATI_FRAGMENT_SHADER_PASS_OP) - handle_pass_op(machine, texinst, span, column, j); - else if (texinst->Opcode == ATI_FRAGMENT_SHADER_SAMPLE_OP) - handle_sample_op(ctx, machine, texinst, span, column, j); - } - - for (pc = 0; pc < shader->numArithInstr[pass]; pc++) { - inst = &shader->Instructions[pass][pc]; - - /* setup the source registers for color and alpha ops */ - for (optype = 0; optype < 2; optype++) { - for (i = 0; i < inst->ArgCount[optype]; i++) { - GLint index = inst->SrcReg[optype][i].Index; - - if (index >= GL_REG_0_ATI && index <= GL_REG_5_ATI) - SETUP_SRC_REG(optype, i, - machine->Registers[index - GL_REG_0_ATI]); - else if (index >= GL_CON_0_ATI && index <= GL_CON_7_ATI) { - if (shader->LocalConstDef & (1 << (index - GL_CON_0_ATI))) { - SETUP_SRC_REG(optype, i, - shader->Constants[index - GL_CON_0_ATI]); - } else { - SETUP_SRC_REG(optype, i, - ctx->ATIFragmentShader.GlobalConstants[index - GL_CON_0_ATI]); - } - } - else if (index == GL_ONE) - SETUP_SRC_REG(optype, i, ones); - else if (index == GL_ZERO) - SETUP_SRC_REG(optype, i, zeros); - else if (index == GL_PRIMARY_COLOR_EXT) - SETUP_SRC_REG(optype, i, - machine->Inputs[ATI_FS_INPUT_PRIMARY]); - else if (index == GL_SECONDARY_INTERPOLATOR_ATI) - SETUP_SRC_REG(optype, i, - machine->Inputs[ATI_FS_INPUT_SECONDARY]); - - apply_src_rep(optype, inst->SrcReg[optype][i].argRep, - src[optype][i]); - apply_src_mod(optype, inst->SrcReg[optype][i].argMod, - src[optype][i]); - } - } - - /* Execute the operations - color then alpha */ - for (optype = 0; optype < 2; optype++) { - if (inst->Opcode[optype]) { - switch (inst->Opcode[optype]) { - case GL_ADD_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - src[optype][0][i] + src[optype][1][i]; - } - else - dst[optype][3] = src[optype][0][3] + src[optype][1][3]; - break; - case GL_SUB_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - src[optype][0][i] - src[optype][1][i]; - } - else - dst[optype][3] = src[optype][0][3] - src[optype][1][3]; - break; - case GL_MUL_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - src[optype][0][i] * src[optype][1][i]; - } - else - dst[optype][3] = src[optype][0][3] * src[optype][1][3]; - break; - case GL_MAD_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - src[optype][0][i] * src[optype][1][i] + - src[optype][2][i]; - } - else - dst[optype][3] = - src[optype][0][3] * src[optype][1][3] + - src[optype][2][3]; - break; - case GL_LERP_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - src[optype][0][i] * src[optype][1][i] + (1 - - src - [optype] - [0][i]) * - src[optype][2][i]; - } - else - dst[optype][3] = - src[optype][0][3] * src[optype][1][3] + (1 - - src[optype] - [0][3]) * - src[optype][2][3]; - break; - - case GL_MOV_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = src[optype][0][i]; - } - else - dst[optype][3] = src[optype][0][3]; - break; - case GL_CND_ATI: - if (!optype) { - for (i = 0; i < 3; i++) { - dst[optype][i] = - (src[optype][2][i] > - 0.5) ? src[optype][0][i] : src[optype][1][i]; - } - } - else { - dst[optype][3] = - (src[optype][2][3] > - 0.5) ? src[optype][0][3] : src[optype][1][3]; - } - break; - - case GL_CND0_ATI: - if (!optype) - for (i = 0; i < 3; i++) { - dst[optype][i] = - (src[optype][2][i] >= - 0) ? src[optype][0][i] : src[optype][1][i]; - } - else { - dst[optype][3] = - (src[optype][2][3] >= - 0) ? src[optype][0][3] : src[optype][1][3]; - } - break; - case GL_DOT2_ADD_ATI: - { - GLfloat result; - - /* DOT 2 always uses the source from the color op */ - /* could save recalculation of dot products for alpha inst */ - result = src[0][0][0] * src[0][1][0] + - src[0][0][1] * src[0][1][1] + src[0][2][2]; - if (!optype) { - for (i = 0; i < 3; i++) { - dst[optype][i] = result; - } - } - else - dst[optype][3] = result; - } - break; - case GL_DOT3_ATI: - { - GLfloat result; - - /* DOT 3 always uses the source from the color op */ - result = src[0][0][0] * src[0][1][0] + - src[0][0][1] * src[0][1][1] + - src[0][0][2] * src[0][1][2]; - - if (!optype) { - for (i = 0; i < 3; i++) { - dst[optype][i] = result; - } - } - else - dst[optype][3] = result; - } - break; - case GL_DOT4_ATI: - { - GLfloat result; - - /* DOT 4 always uses the source from the color op */ - result = src[0][0][0] * src[0][1][0] + - src[0][0][1] * src[0][1][1] + - src[0][0][2] * src[0][1][2] + - src[0][0][3] * src[0][1][3]; - if (!optype) { - for (i = 0; i < 3; i++) { - dst[optype][i] = result; - } - } - else - dst[optype][3] = result; - } - break; - - } - } - } - - /* write out the destination registers */ - for (optype = 0; optype < 2; optype++) { - if (inst->Opcode[optype]) { - dstreg = inst->DstReg[optype].Index; - dstp = machine->Registers[dstreg - GL_REG_0_ATI]; - - if ((optype == 0) || ((inst->Opcode[1] != GL_DOT2_ADD_ATI) && - (inst->Opcode[1] != GL_DOT3_ATI) && (inst->Opcode[1] != GL_DOT4_ATI))) - write_dst_addr(optype, inst->DstReg[optype].dstMod, - inst->DstReg[optype].dstMask, dst[optype], - dstp); - else - write_dst_addr(1, inst->DstReg[0].dstMod, 0, dst[1], dstp); - } - } - } - } -} - - -/** - * Init fragment shader virtual machine state. - */ -static void -init_machine(GLcontext * ctx, struct atifs_machine *machine, - const struct ati_fragment_shader *shader, - const SWspan *span, GLuint col) -{ - GLfloat (*inputs)[4] = machine->Inputs; - GLint i, j; - - for (i = 0; i < 6; i++) { - for (j = 0; j < 4; j++) - machine->Registers[i][j] = 0.0; - } - - COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->attribs[FRAG_ATTRIB_COL0][col]); - COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->attribs[FRAG_ATTRIB_COL1][col]); -} - - - -/** - * Execute the current ATI shader program, operating on the given span. - */ -void -_swrast_exec_fragment_shader(GLcontext * ctx, SWspan *span) -{ - const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current; - struct atifs_machine machine; - GLuint i; - - /* incoming colors should be floats */ - ASSERT(span->array->ChanType == GL_FLOAT); - - ctx->_CurrentProgram = GL_FRAGMENT_SHADER_ATI; - - for (i = 0; i < span->end; i++) { - if (span->array->mask[i]) { - init_machine(ctx, &machine, shader, span, i); - - execute_shader(ctx, shader, &machine, span, i); - - /* store result color */ - { - const GLfloat *colOut = machine.Registers[0]; - /*fprintf(stderr,"outputs %f %f %f %f\n", - colOut[0], colOut[1], colOut[2], colOut[3]); */ - COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], colOut); - } - } - } - - ctx->_CurrentProgram = 0; -} diff --git a/src/libs/mesa/mesa/swrast/s_atifragshader.h b/src/libs/mesa/mesa/swrast/s_atifragshader.h deleted file mode 100644 index 871a0c0455..0000000000 --- a/src/libs/mesa/mesa/swrast/s_atifragshader.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2003 David Airlie 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 - * DAVID AIRLIE 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 S_ATIFRAGSHADER_H -#define S_ATIFRAGSHADER_H - - -#include "s_context.h" - - -extern void -_swrast_exec_fragment_shader( GLcontext *ctx, SWspan *span ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_bitmap.c b/src/libs/mesa/mesa/swrast/s_bitmap.c deleted file mode 100644 index 35b34e654f..0000000000 --- a/src/libs/mesa/mesa/swrast/s_bitmap.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** - * \file swrast/s_bitmap.c - * \brief glBitmap rendering. - * \author Brian Paul - */ - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/pixel.h" - -#include "s_context.h" -#include "s_span.h" - - - -/** - * Render a bitmap. - * Called via ctx->Driver.Bitmap() - * All parameter error checking will have been done before this is called. - */ -void -_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLint row, col; - GLuint count = 0; - SWspan span; - - ASSERT(ctx->RenderMode == GL_RENDER); - - bitmap = _mesa_map_bitmap_pbo(ctx, unpack, bitmap); - if (!bitmap) - return; - - RENDER_START(swrast,ctx); - - if (SWRAST_CONTEXT(ctx)->NewState) - _swrast_validate_derived( ctx ); - - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_XY; - _swrast_span_default_attribs(ctx, &span); - - for (row = 0; row < height; row++) { - const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack, - bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0); - - if (unpack->LsbFirst) { - /* Lsb first */ - GLubyte mask = 1U << (unpack->SkipPixels & 0x7); - for (col = 0; col < width; col++) { - if (*src & mask) { - span.array->x[count] = px + col; - span.array->y[count] = py + row; - count++; - } - if (mask == 128U) { - src++; - mask = 1U; - } - else { - mask = mask << 1; - } - } - - /* get ready for next row */ - if (mask != 1) - src++; - } - else { - /* Msb first */ - GLubyte mask = 128U >> (unpack->SkipPixels & 0x7); - for (col = 0; col < width; col++) { - if (*src & mask) { - span.array->x[count] = px + col; - span.array->y[count] = py + row; - count++; - } - if (mask == 1U) { - src++; - mask = 128U; - } - else { - mask = mask >> 1; - } - } - - /* get ready for next row */ - if (mask != 128) - src++; - } - - if (count + width >= MAX_WIDTH || row + 1 == height) { - /* flush the span */ - span.end = count; - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); - span.end = 0; - count = 0; - } - } - - RENDER_FINISH(swrast,ctx); - - _mesa_unmap_bitmap_pbo(ctx, unpack); -} - - -#if 0 -/* - * XXX this is another way to implement Bitmap. Use horizontal runs of - * fragments, initializing the mask array to indicate which fragments to - * draw or skip. - */ -void -_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLint row, col; - SWspan span; - - ASSERT(ctx->RenderMode == GL_RENDER); - ASSERT(bitmap); - - RENDER_START(swrast,ctx); - - if (SWRAST_CONTEXT(ctx)->NewState) - _swrast_validate_derived( ctx ); - - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_MASK; - _swrast_span_default_attribs(ctx, &span); - - /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */ - span.x = px; - span.y = py; - /*span.end = width;*/ - - for (row=0; rowLsbFirst) { - /* Lsb first */ - GLubyte mask = 1U << (unpack->SkipPixels & 0x7); - for (col=0; colmask[col] = (*src & mask) ? GL_TRUE : GL_FALSE; - if (mask == 128U) { - src++; - mask = 1U; - } - else { - mask = mask << 1; - } - } - - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); - - /* get ready for next row */ - if (mask != 1) - src++; - } - else { - /* Msb first */ - GLubyte mask = 128U >> (unpack->SkipPixels & 0x7); - for (col=0; colmask[col] = (*src & mask) ? GL_TRUE : GL_FALSE; - if (mask == 1U) { - src++; - mask = 128U; - } - else { - mask = mask >> 1; - } - } - - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); - - /* get ready for next row */ - if (mask != 128) - src++; - } - } - - RENDER_FINISH(swrast,ctx); -} -#endif diff --git a/src/libs/mesa/mesa/swrast/s_blend.c b/src/libs/mesa/mesa/swrast/s_blend.c deleted file mode 100644 index 95c83432a9..0000000000 --- a/src/libs/mesa/mesa/swrast/s_blend.c +++ /dev/null @@ -1,1002 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - - -/** - * \file swrast/s_blend.c - * \brief software blending. - * \author Brian Paul - * - * Only a few blend modes have been optimized (min, max, transparency, add) - * more optimized cases can easily be added if needed. - * Celestia uses glBlendFunc(GL_SRC_ALPHA, GL_ONE), for example. - */ - - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/macros.h" - -#include "s_blend.h" -#include "s_context.h" -#include "s_span.h" - - -#if defined(USE_MMX_ASM) -#include "x86/mmx.h" -#include "x86/common_x86_asm.h" -#define _BLENDAPI _ASMAPI -#else -#define _BLENDAPI -#endif - - -/** - * Integer divide by 255 - * Declare "int divtemp" before using. - * This satisfies Glean and should be reasonably fast. - * Contributed by Nathan Hand. - */ -#define DIV255(X) (divtemp = (X), ((divtemp << 8) + divtemp + 256) >> 16) - - - -/** - * Special case for glBlendFunc(GL_ZERO, GL_ONE). - * No-op means the framebuffer values remain unchanged. - * Any chanType ok. - */ -static void _BLENDAPI -blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLint bytes; - - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_ZERO); - ASSERT(ctx->Color.BlendDstRGB == GL_ONE); - (void) ctx; - - /* just memcpy */ - if (chanType == GL_UNSIGNED_BYTE) - bytes = 4 * n * sizeof(GLubyte); - else if (chanType == GL_UNSIGNED_SHORT) - bytes = 4 * n * sizeof(GLushort); - else - bytes = 4 * n * sizeof(GLfloat); - - _mesa_memcpy(src, dst, bytes); -} - - -/** - * Special case for glBlendFunc(GL_ONE, GL_ZERO) - * Any chanType ok. - */ -static void _BLENDAPI -blend_replace(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_ONE); - ASSERT(ctx->Color.BlendDstRGB == GL_ZERO); - (void) ctx; - (void) n; - (void) mask; - (void) src; - (void) dst; -} - - -/** - * Common transparency blending mode: - * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). - */ -static void _BLENDAPI -blend_transparency_ubyte(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - GLuint i; - - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_UNSIGNED_BYTE); - - (void) ctx; - - for (i = 0; i < n; i++) { - if (mask[i]) { - const GLint t = rgba[i][ACOMP]; /* t is in [0, 255] */ - if (t == 0) { - /* 0% alpha */ - COPY_4UBV(rgba[i], dest[i]); - } - else if (t != 255) { - GLint divtemp; - const GLint r = DIV255((rgba[i][RCOMP] - dest[i][RCOMP]) * t) + dest[i][RCOMP]; - const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; - const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; - const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; - ASSERT(r <= 255); - ASSERT(g <= 255); - ASSERT(b <= 255); - ASSERT(a <= 255); - rgba[i][RCOMP] = (GLubyte) r; - rgba[i][GCOMP] = (GLubyte) g; - rgba[i][BCOMP] = (GLubyte) b; - rgba[i][ACOMP] = (GLubyte) a; - } - } - } -} - - -static void _BLENDAPI -blend_transparency_ushort(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLushort (*rgba)[4] = (GLushort (*)[4]) src; - const GLushort (*dest)[4] = (const GLushort (*)[4]) dst; - GLuint i; - - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_UNSIGNED_SHORT); - - (void) ctx; - - for (i = 0; i < n; i++) { - if (mask[i]) { - const GLint t = rgba[i][ACOMP]; - if (t == 0) { - /* 0% alpha */ - COPY_4V(rgba[i], dest[i]); - } - else if (t != 65535) { - const GLfloat tt = (GLfloat) t / 65535.0F; - GLushort r = (GLushort) ((rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]); - GLushort g = (GLushort) ((rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]); - GLushort b = (GLushort) ((rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]); - GLushort a = (GLushort) ((rgba[i][ACOMP] - dest[i][ACOMP]) * tt + dest[i][ACOMP]); - ASSIGN_4V(rgba[i], r, g, b, a); - } - } - } -} - - -static void _BLENDAPI -blend_transparency_float(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; - const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - GLuint i; - - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_FLOAT); - - (void) ctx; - - for (i = 0; i < n; i++) { - if (mask[i]) { - const GLfloat t = rgba[i][ACOMP]; /* t in [0, 1] */ - if (t == 0.0F) { - /* 0% alpha */ - COPY_4V(rgba[i], dest[i]); - } - else if (t != 1.0F) { - GLfloat r = (rgba[i][RCOMP] - dest[i][RCOMP]) * t + dest[i][RCOMP]; - GLfloat g = (rgba[i][GCOMP] - dest[i][GCOMP]) * t + dest[i][GCOMP]; - GLfloat b = (rgba[i][BCOMP] - dest[i][BCOMP]) * t + dest[i][BCOMP]; - GLfloat a = (rgba[i][ACOMP] - dest[i][ACOMP]) * t + dest[i][ACOMP]; - ASSIGN_4V(rgba[i], r, g, b, a); - } - } - } -} - - - -/** - * Add src and dest: glBlendFunc(GL_ONE, GL_ONE). - * Any chanType ok. - */ -static void _BLENDAPI -blend_add(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLuint i; - - ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB == GL_ONE); - ASSERT(ctx->Color.BlendDstRGB == GL_ONE); - (void) ctx; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - for (i=0;iColor.BlendEquationRGB == GL_MIN); - ASSERT(ctx->Color.BlendEquationA == GL_MIN); - (void) ctx; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - for (i=0;iColor.BlendEquationRGB == GL_MAX); - ASSERT(ctx->Color.BlendEquationA == GL_MAX); - (void) ctx; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - for (i=0;i> 16; - rgba[i][GCOMP] = (rgba[i][GCOMP] * dest[i][GCOMP] + 65535) >> 16; - rgba[i][BCOMP] = (rgba[i][BCOMP] * dest[i][BCOMP] + 65535) >> 16; - rgba[i][ACOMP] = (rgba[i][ACOMP] * dest[i][ACOMP] + 65535) >> 16; - } - } - } - else { - GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; - const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - ASSERT(chanType == GL_FLOAT); - for (i=0;iColor.BlendSrcRGB) { - case GL_ZERO: - sR = sG = sB = 0.0F; - break; - case GL_ONE: - sR = sG = sB = 1.0F; - break; - case GL_DST_COLOR: - sR = Rd; - sG = Gd; - sB = Bd; - break; - case GL_ONE_MINUS_DST_COLOR: - sR = 1.0F - Rd; - sG = 1.0F - Gd; - sB = 1.0F - Bd; - break; - case GL_SRC_ALPHA: - sR = sG = sB = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - sR = sG = sB = 1.0F - As; - break; - case GL_DST_ALPHA: - sR = sG = sB = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - sR = sG = sB = 1.0F - Ad; - break; - case GL_SRC_ALPHA_SATURATE: - if (As < 1.0F - Ad) { - sR = sG = sB = As; - } - else { - sR = sG = sB = 1.0F - Ad; - } - break; - case GL_CONSTANT_COLOR: - sR = ctx->Color.BlendColor[0]; - sG = ctx->Color.BlendColor[1]; - sB = ctx->Color.BlendColor[2]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - sR = 1.0F - ctx->Color.BlendColor[0]; - sG = 1.0F - ctx->Color.BlendColor[1]; - sB = 1.0F - ctx->Color.BlendColor[2]; - break; - case GL_CONSTANT_ALPHA: - sR = sG = sB = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - sR = sG = sB = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_SRC_COLOR: - sR = Rs; - sG = Gs; - sB = Bs; - break; - case GL_ONE_MINUS_SRC_COLOR: - sR = 1.0F - Rs; - sG = 1.0F - Gs; - sB = 1.0F - Bs; - break; - default: - /* this should never happen */ - _mesa_problem(ctx, "Bad blend source RGB factor in blend_general_float"); - return; - } - - /* Source Alpha factor */ - switch (ctx->Color.BlendSrcA) { - case GL_ZERO: - sA = 0.0F; - break; - case GL_ONE: - sA = 1.0F; - break; - case GL_DST_COLOR: - sA = Ad; - break; - case GL_ONE_MINUS_DST_COLOR: - sA = 1.0F - Ad; - break; - case GL_SRC_ALPHA: - sA = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - sA = 1.0F - As; - break; - case GL_DST_ALPHA: - sA = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - sA = 1.0F - Ad; - break; - case GL_SRC_ALPHA_SATURATE: - sA = 1.0; - break; - case GL_CONSTANT_COLOR: - sA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - sA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_CONSTANT_ALPHA: - sA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - sA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_SRC_COLOR: - sA = As; - break; - case GL_ONE_MINUS_SRC_COLOR: - sA = 1.0F - As; - break; - default: - /* this should never happen */ - sA = 0.0F; - _mesa_problem(ctx, "Bad blend source A factor in blend_general_float"); - return; - } - - /* Dest RGB factor */ - switch (ctx->Color.BlendDstRGB) { - case GL_ZERO: - dR = dG = dB = 0.0F; - break; - case GL_ONE: - dR = dG = dB = 1.0F; - break; - case GL_SRC_COLOR: - dR = Rs; - dG = Gs; - dB = Bs; - break; - case GL_ONE_MINUS_SRC_COLOR: - dR = 1.0F - Rs; - dG = 1.0F - Gs; - dB = 1.0F - Bs; - break; - case GL_SRC_ALPHA: - dR = dG = dB = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dR = dG = dB = 1.0F - As; - break; - case GL_DST_ALPHA: - dR = dG = dB = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - dR = dG = dB = 1.0F - Ad; - break; - case GL_CONSTANT_COLOR: - dR = ctx->Color.BlendColor[0]; - dG = ctx->Color.BlendColor[1]; - dB = ctx->Color.BlendColor[2]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dR = 1.0F - ctx->Color.BlendColor[0]; - dG = 1.0F - ctx->Color.BlendColor[1]; - dB = 1.0F - ctx->Color.BlendColor[2]; - break; - case GL_CONSTANT_ALPHA: - dR = dG = dB = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dR = dG = dB = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_DST_COLOR: - dR = Rd; - dG = Gd; - dB = Bd; - break; - case GL_ONE_MINUS_DST_COLOR: - dR = 1.0F - Rd; - dG = 1.0F - Gd; - dB = 1.0F - Bd; - break; - default: - /* this should never happen */ - dR = dG = dB = 0.0F; - _mesa_problem(ctx, "Bad blend dest RGB factor in blend_general_float"); - return; - } - - /* Dest Alpha factor */ - switch (ctx->Color.BlendDstA) { - case GL_ZERO: - dA = 0.0F; - break; - case GL_ONE: - dA = 1.0F; - break; - case GL_SRC_COLOR: - dA = As; - break; - case GL_ONE_MINUS_SRC_COLOR: - dA = 1.0F - As; - break; - case GL_SRC_ALPHA: - dA = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dA = 1.0F - As; - break; - case GL_DST_ALPHA: - dA = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - dA = 1.0F - Ad; - break; - case GL_CONSTANT_COLOR: - dA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_CONSTANT_ALPHA: - dA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_DST_COLOR: - dA = Ad; - break; - case GL_ONE_MINUS_DST_COLOR: - dA = 1.0F - Ad; - break; - default: - /* this should never happen */ - dA = 0.0F; - _mesa_problem(ctx, "Bad blend dest A factor in blend_general_float"); - return; - } - - /* compute the blended RGB */ - switch (ctx->Color.BlendEquationRGB) { - case GL_FUNC_ADD: - r = Rs * sR + Rd * dR; - g = Gs * sG + Gd * dG; - b = Bs * sB + Bd * dB; - a = As * sA + Ad * dA; - break; - case GL_FUNC_SUBTRACT: - r = Rs * sR - Rd * dR; - g = Gs * sG - Gd * dG; - b = Bs * sB - Bd * dB; - a = As * sA - Ad * dA; - break; - case GL_FUNC_REVERSE_SUBTRACT: - r = Rd * dR - Rs * sR; - g = Gd * dG - Gs * sG; - b = Bd * dB - Bs * sB; - a = Ad * dA - As * sA; - break; - case GL_MIN: - r = MIN2( Rd, Rs ); - g = MIN2( Gd, Gs ); - b = MIN2( Bd, Bs ); - break; - case GL_MAX: - r = MAX2( Rd, Rs ); - g = MAX2( Gd, Gs ); - b = MAX2( Bd, Bs ); - break; - default: - /* should never get here */ - r = g = b = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); - return; - } - - /* compute the blended alpha */ - switch (ctx->Color.BlendEquationA) { - case GL_FUNC_ADD: - a = As * sA + Ad * dA; - break; - case GL_FUNC_SUBTRACT: - a = As * sA - Ad * dA; - break; - case GL_FUNC_REVERSE_SUBTRACT: - a = Ad * dA - As * sA; - break; - case GL_MIN: - a = MIN2( Ad, As ); - break; - case GL_MAX: - a = MAX2( Ad, As ); - break; - default: - /* should never get here */ - a = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); - return; - } - - /* final clamping */ -#if 0 - rgba[i][RCOMP] = MAX2( r, 0.0F ); - rgba[i][GCOMP] = MAX2( g, 0.0F ); - rgba[i][BCOMP] = MAX2( b, 0.0F ); - rgba[i][ACOMP] = CLAMP( a, 0.0F, 1.0F ); -#else - ASSIGN_4V(rgba[i], r, g, b, a); -#endif - } - } -} - - -/** - * Do any blending operation, any chanType. - */ -static void -blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[], - void *src, const void *dst, GLenum chanType) -{ - GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4]; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - GLuint i; - /* convert ubytes to floats */ - for (i = 0; i < n; i++) { - if (mask[i]) { - rgbaF[i][RCOMP] = UBYTE_TO_FLOAT(rgba[i][RCOMP]); - rgbaF[i][GCOMP] = UBYTE_TO_FLOAT(rgba[i][GCOMP]); - rgbaF[i][BCOMP] = UBYTE_TO_FLOAT(rgba[i][BCOMP]); - rgbaF[i][ACOMP] = UBYTE_TO_FLOAT(rgba[i][ACOMP]); - destF[i][RCOMP] = UBYTE_TO_FLOAT(dest[i][RCOMP]); - destF[i][GCOMP] = UBYTE_TO_FLOAT(dest[i][GCOMP]); - destF[i][BCOMP] = UBYTE_TO_FLOAT(dest[i][BCOMP]); - destF[i][ACOMP] = UBYTE_TO_FLOAT(dest[i][ACOMP]); - } - } - /* do blend */ - blend_general_float(ctx, n, mask, rgbaF, destF, chanType); - /* convert back to ubytes */ - for (i = 0; i < n; i++) { - if (mask[i]) { - UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][RCOMP], rgbaF[i][RCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][GCOMP], rgbaF[i][GCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][BCOMP], rgbaF[i][BCOMP]); - UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][ACOMP], rgbaF[i][ACOMP]); - } - } - } - else if (chanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = (GLushort (*)[4]) src; - const GLushort (*dest)[4] = (const GLushort (*)[4]) dst; - GLuint i; - /* convert ushorts to floats */ - for (i = 0; i < n; i++) { - if (mask[i]) { - rgbaF[i][RCOMP] = USHORT_TO_FLOAT(rgba[i][RCOMP]); - rgbaF[i][GCOMP] = USHORT_TO_FLOAT(rgba[i][GCOMP]); - rgbaF[i][BCOMP] = USHORT_TO_FLOAT(rgba[i][BCOMP]); - rgbaF[i][ACOMP] = USHORT_TO_FLOAT(rgba[i][ACOMP]); - destF[i][RCOMP] = USHORT_TO_FLOAT(dest[i][RCOMP]); - destF[i][GCOMP] = USHORT_TO_FLOAT(dest[i][GCOMP]); - destF[i][BCOMP] = USHORT_TO_FLOAT(dest[i][BCOMP]); - destF[i][ACOMP] = USHORT_TO_FLOAT(dest[i][ACOMP]); - } - } - /* do blend */ - blend_general_float(ctx, n, mask, rgbaF, destF, chanType); - /* convert back to ushorts */ - for (i = 0; i < n; i++) { - if (mask[i]) { - UNCLAMPED_FLOAT_TO_USHORT(rgba[i][RCOMP], rgbaF[i][RCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(rgba[i][GCOMP], rgbaF[i][GCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(rgba[i][BCOMP], rgbaF[i][BCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(rgba[i][ACOMP], rgbaF[i][ACOMP]); - } - } - } - else { - blend_general_float(ctx, n, mask, (GLfloat (*)[4]) src, - (GLfloat (*)[4]) dst, chanType); - } -} - - - -/** - * Analyze current blending parameters to pick fastest blending function. - * Result: the ctx->Color.BlendFunc pointer is updated. - */ -void -_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLenum eq = ctx->Color.BlendEquationRGB; - const GLenum srcRGB = ctx->Color.BlendSrcRGB; - const GLenum dstRGB = ctx->Color.BlendDstRGB; - const GLenum srcA = ctx->Color.BlendSrcA; - const GLenum dstA = ctx->Color.BlendDstA; - - if (ctx->Color.BlendEquationRGB != ctx->Color.BlendEquationA) { - swrast->BlendFunc = blend_general; - } - else if (eq == GL_MIN) { - /* Note: GL_MIN ignores the blending weight factors */ -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_min; - } - else -#endif - swrast->BlendFunc = blend_min; - } - else if (eq == GL_MAX) { - /* Note: GL_MAX ignores the blending weight factors */ -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_max; - } - else -#endif - swrast->BlendFunc = blend_max; - } - else if (srcRGB != srcA || dstRGB != dstA) { - swrast->BlendFunc = blend_general; - } - else if (eq == GL_FUNC_ADD && srcRGB == GL_SRC_ALPHA - && dstRGB == GL_ONE_MINUS_SRC_ALPHA) { -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_transparency; - } - else -#endif - { - if (chanType == GL_UNSIGNED_BYTE) - swrast->BlendFunc = blend_transparency_ubyte; - else if (chanType == GL_UNSIGNED_SHORT) - swrast->BlendFunc = blend_transparency_ushort; - else - swrast->BlendFunc = blend_transparency_float; - } - } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ONE) { -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_add; - } - else -#endif - swrast->BlendFunc = blend_add; - } - else if (((eq == GL_FUNC_ADD || eq == GL_FUNC_REVERSE_SUBTRACT) - && (srcRGB == GL_ZERO && dstRGB == GL_SRC_COLOR)) - || - ((eq == GL_FUNC_ADD || eq == GL_FUNC_SUBTRACT) - && (srcRGB == GL_DST_COLOR && dstRGB == GL_ZERO))) { -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_modulate; - } - else -#endif - swrast->BlendFunc = blend_modulate; - } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) { - swrast->BlendFunc = blend_noop; - } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) { - swrast->BlendFunc = blend_replace; - } - else { - swrast->BlendFunc = blend_general; - } -} - - - -/** - * Apply the blending operator to a span of pixels. - * We can handle horizontal runs of pixels (spans) or arrays of x/y - * pixel coordinates. - */ -void -_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - void *rbPixels; - - ASSERT(span->end <= MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(rb->DataType == span->array->ChanType); - ASSERT(!ctx->Color._LogicOpEnabled); - - rbPixels = _swrast_get_dest_rgba(ctx, rb, span); - - swrast->BlendFunc(ctx, span->end, span->array->mask, - span->array->rgba, rbPixels, span->array->ChanType); -} diff --git a/src/libs/mesa/mesa/swrast/s_blend.h b/src/libs/mesa/mesa/swrast/s_blend.h deleted file mode 100644 index 8d5a81635d..0000000000 --- a/src/libs/mesa/mesa/swrast/s_blend.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 S_BLEND_H -#define S_BLEND_H - - -#include "s_context.h" - - -extern void -_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span); - - -extern void -_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_blit.c b/src/libs/mesa/mesa/swrast/s_blit.c deleted file mode 100644 index bc4b2ac625..0000000000 --- a/src/libs/mesa/mesa/swrast/s_blit.c +++ /dev/null @@ -1,793 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "main/glheader.h" -#include "main/macros.h" -#include "s_context.h" - - -#define ABS(X) ((X) < 0 ? -(X) : (X)) - - -/** - * Generate a row resampler function for GL_NEAREST mode. - */ -#define RESAMPLE(NAME, PIXELTYPE, SIZE) \ -static void \ -NAME(GLint srcWidth, GLint dstWidth, \ - const GLvoid *srcBuffer, GLvoid *dstBuffer, \ - GLboolean flip) \ -{ \ - const PIXELTYPE *src = (const PIXELTYPE *) srcBuffer;\ - PIXELTYPE *dst = (PIXELTYPE *) dstBuffer; \ - GLint dstCol; \ - \ - if (flip) { \ - for (dstCol = 0; dstCol < dstWidth; dstCol++) { \ - GLint srcCol = (dstCol * srcWidth) / dstWidth; \ - ASSERT(srcCol >= 0); \ - ASSERT(srcCol < srcWidth); \ - srcCol = srcWidth - 1 - srcCol; /* flip */ \ - if (SIZE == 1) { \ - dst[dstCol] = src[srcCol]; \ - } \ - else if (SIZE == 2) { \ - dst[dstCol*2+0] = src[srcCol*2+0]; \ - dst[dstCol*2+1] = src[srcCol*2+1]; \ - } \ - else if (SIZE == 4) { \ - dst[dstCol*4+0] = src[srcCol*4+0]; \ - dst[dstCol*4+1] = src[srcCol*4+1]; \ - dst[dstCol*4+2] = src[srcCol*4+2]; \ - dst[dstCol*4+3] = src[srcCol*4+3]; \ - } \ - } \ - } \ - else { \ - for (dstCol = 0; dstCol < dstWidth; dstCol++) { \ - GLint srcCol = (dstCol * srcWidth) / dstWidth; \ - ASSERT(srcCol >= 0); \ - ASSERT(srcCol < srcWidth); \ - if (SIZE == 1) { \ - dst[dstCol] = src[srcCol]; \ - } \ - else if (SIZE == 2) { \ - dst[dstCol*2+0] = src[srcCol*2+0]; \ - dst[dstCol*2+1] = src[srcCol*2+1]; \ - } \ - else if (SIZE == 4) { \ - dst[dstCol*4+0] = src[srcCol*4+0]; \ - dst[dstCol*4+1] = src[srcCol*4+1]; \ - dst[dstCol*4+2] = src[srcCol*4+2]; \ - dst[dstCol*4+3] = src[srcCol*4+3]; \ - } \ - } \ - } \ -} - -/** - * Resamplers for 1, 2, 4, 8 and 16-byte pixels. - */ -RESAMPLE(resample_row_1, GLubyte, 1) -RESAMPLE(resample_row_2, GLushort, 1) -RESAMPLE(resample_row_4, GLuint, 1) -RESAMPLE(resample_row_8, GLuint, 2) -RESAMPLE(resample_row_16, GLuint, 4) - - -/** - * Blit color, depth or stencil with GL_NEAREST filtering. - */ -static void -blit_nearest(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLenum buffer) -{ - struct gl_renderbuffer *readRb, *drawRb; - - const GLint srcWidth = ABS(srcX1 - srcX0); - const GLint dstWidth = ABS(dstX1 - dstX0); - const GLint srcHeight = ABS(srcY1 - srcY0); - const GLint dstHeight = ABS(dstY1 - dstY0); - - const GLint srcXpos = MIN2(srcX0, srcX1); - const GLint srcYpos = MIN2(srcY0, srcY1); - const GLint dstXpos = MIN2(dstX0, dstX1); - const GLint dstYpos = MIN2(dstY0, dstY1); - - const GLboolean invertX = (srcX1 < srcX0) ^ (dstX1 < dstX0); - const GLboolean invertY = (srcY1 < srcY0) ^ (dstY1 < dstY0); - - GLint dstRow; - - GLint comps, pixelSize; - GLvoid *srcBuffer, *dstBuffer; - GLint prevY = -1; - - typedef void (*resample_func)(GLint srcWidth, GLint dstWidth, - const GLvoid *srcBuffer, GLvoid *dstBuffer, - GLboolean flip); - resample_func resampleRow; - - switch (buffer) { - case GL_COLOR_BUFFER_BIT: - readRb = ctx->ReadBuffer->_ColorReadBuffer; - drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - comps = 4; - break; - case GL_DEPTH_BUFFER_BIT: - readRb = ctx->ReadBuffer->_DepthBuffer; - drawRb = ctx->DrawBuffer->_DepthBuffer; - comps = 1; - break; - case GL_STENCIL_BUFFER_BIT: - readRb = ctx->ReadBuffer->_StencilBuffer; - drawRb = ctx->DrawBuffer->_StencilBuffer; - comps = 1; - break; - default: - _mesa_problem(ctx, "unexpected buffer in blit_nearest()"); - return; - } - - switch (readRb->DataType) { - case GL_UNSIGNED_BYTE: - pixelSize = comps * sizeof(GLubyte); - break; - case GL_UNSIGNED_SHORT: - pixelSize = comps * sizeof(GLushort); - break; - case GL_UNSIGNED_INT: - pixelSize = comps * sizeof(GLuint); - break; - case GL_FLOAT: - pixelSize = comps * sizeof(GLfloat); - break; - default: - _mesa_problem(ctx, "unexpected buffer type (0x%x) in blit_nearest", - readRb->DataType); - return; - } - - /* choose row resampler */ - switch (pixelSize) { - case 1: - resampleRow = resample_row_1; - break; - case 2: - resampleRow = resample_row_2; - break; - case 4: - resampleRow = resample_row_4; - break; - case 8: - resampleRow = resample_row_8; - break; - case 16: - resampleRow = resample_row_16; - break; - default: - _mesa_problem(ctx, "unexpected pixel size (%d) in blit_nearest", - pixelSize); - return; - } - - /* allocate the src/dst row buffers */ - srcBuffer = _mesa_malloc(pixelSize * srcWidth); - if (!srcBuffer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); - if (!dstBuffer) { - _mesa_free(srcBuffer); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - - for (dstRow = 0; dstRow < dstHeight; dstRow++) { - const GLint dstY = dstYpos + dstRow; - GLint srcRow = (dstRow * srcHeight) / dstHeight; - GLint srcY; - - ASSERT(srcRow >= 0); - ASSERT(srcRow < srcHeight); - - if (invertY) { - srcRow = srcHeight - 1 - srcRow; - } - - srcY = srcYpos + srcRow; - - /* get pixel row from source and resample to match dest width */ - if (prevY != srcY) { - readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY, srcBuffer); - (*resampleRow)(srcWidth, dstWidth, srcBuffer, dstBuffer, invertX); - prevY = srcY; - } - - /* store pixel row in destination */ - drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); - } - - _mesa_free(srcBuffer); - _mesa_free(dstBuffer); -} - - - -#define LERP(T, A, B) ( (A) + (T) * ((B) - (A)) ) - -static INLINE GLfloat -lerp_2d(GLfloat a, GLfloat b, - GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11) -{ - const GLfloat temp0 = LERP(a, v00, v10); - const GLfloat temp1 = LERP(a, v01, v11); - return LERP(b, temp0, temp1); -} - - -/** - * Bilinear interpolation of two source rows. - * GLubyte pixels. - */ -static void -resample_linear_row_ub(GLint srcWidth, GLint dstWidth, - const GLvoid *srcBuffer0, const GLvoid *srcBuffer1, - GLvoid *dstBuffer, GLboolean flip, GLfloat rowWeight) -{ - const GLubyte (*srcColor0)[4] = (const GLubyte (*)[4]) srcBuffer0; - const GLubyte (*srcColor1)[4] = (const GLubyte (*)[4]) srcBuffer1; - GLubyte (*dstColor)[4] = (GLubyte (*)[4]) dstBuffer; - const GLfloat dstWidthF = (GLfloat) dstWidth; - GLint dstCol; - - for (dstCol = 0; dstCol < dstWidth; dstCol++) { - const GLfloat srcCol = (dstCol * srcWidth) / dstWidthF; - GLint srcCol0 = IFLOOR(srcCol); - GLint srcCol1 = srcCol0 + 1; - GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */ - GLfloat red, green, blue, alpha; - - ASSERT(srcCol0 >= 0); - ASSERT(srcCol0 < srcWidth); - ASSERT(srcCol1 <= srcWidth); - - if (srcCol1 == srcWidth) { - /* last column fudge */ - srcCol1--; - colWeight = 0.0; - } - - if (flip) { - srcCol0 = srcWidth - 1 - srcCol0; - srcCol1 = srcWidth - 1 - srcCol1; - } - - red = lerp_2d(colWeight, rowWeight, - srcColor0[srcCol0][RCOMP], srcColor0[srcCol1][RCOMP], - srcColor1[srcCol0][RCOMP], srcColor1[srcCol1][RCOMP]); - green = lerp_2d(colWeight, rowWeight, - srcColor0[srcCol0][GCOMP], srcColor0[srcCol1][GCOMP], - srcColor1[srcCol0][GCOMP], srcColor1[srcCol1][GCOMP]); - blue = lerp_2d(colWeight, rowWeight, - srcColor0[srcCol0][BCOMP], srcColor0[srcCol1][BCOMP], - srcColor1[srcCol0][BCOMP], srcColor1[srcCol1][BCOMP]); - alpha = lerp_2d(colWeight, rowWeight, - srcColor0[srcCol0][ACOMP], srcColor0[srcCol1][ACOMP], - srcColor1[srcCol0][ACOMP], srcColor1[srcCol1][ACOMP]); - - dstColor[dstCol][RCOMP] = IFLOOR(red); - dstColor[dstCol][GCOMP] = IFLOOR(green); - dstColor[dstCol][BCOMP] = IFLOOR(blue); - dstColor[dstCol][ACOMP] = IFLOOR(alpha); - } -} - - - -/** - * Bilinear filtered blit (color only). - */ -static void -blit_linear(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1) -{ - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_ColorReadBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - - const GLint srcWidth = ABS(srcX1 - srcX0); - const GLint dstWidth = ABS(dstX1 - dstX0); - const GLint srcHeight = ABS(srcY1 - srcY0); - const GLint dstHeight = ABS(dstY1 - dstY0); - const GLfloat dstHeightF = (GLfloat) dstHeight; - - const GLint srcXpos = MIN2(srcX0, srcX1); - const GLint srcYpos = MIN2(srcY0, srcY1); - const GLint dstXpos = MIN2(dstX0, dstX1); - const GLint dstYpos = MIN2(dstY0, dstY1); - - const GLboolean invertX = (srcX1 < srcX0) ^ (dstX1 < dstX0); - const GLboolean invertY = (srcY1 < srcY0) ^ (dstY1 < dstY0); - - GLint dstRow; - - GLint pixelSize; - GLvoid *srcBuffer0, *srcBuffer1; - GLint srcBufferY0 = -1, srcBufferY1 = -1; - GLvoid *dstBuffer; - - switch (readRb->DataType) { - case GL_UNSIGNED_BYTE: - pixelSize = 4 * sizeof(GLubyte); - break; - case GL_UNSIGNED_SHORT: - pixelSize = 4 * sizeof(GLushort); - break; - case GL_UNSIGNED_INT: - pixelSize = 4 * sizeof(GLuint); - break; - case GL_FLOAT: - pixelSize = 4 * sizeof(GLfloat); - break; - default: - _mesa_problem(ctx, "unexpected buffer type (0x%x) in blit_nearest", - readRb->DataType); - return; - } - - /* Allocate the src/dst row buffers. - * Keep two adjacent src rows around for bilinear sampling. - */ - srcBuffer0 = _mesa_malloc(pixelSize * srcWidth); - if (!srcBuffer0) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - srcBuffer1 = _mesa_malloc(pixelSize * srcWidth); - if (!srcBuffer1) { - _mesa_free(srcBuffer0); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); - if (!dstBuffer) { - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - - for (dstRow = 0; dstRow < dstHeight; dstRow++) { - const GLint dstY = dstYpos + dstRow; - const GLfloat srcRow = (dstRow * srcHeight) / dstHeightF; - GLint srcRow0 = IFLOOR(srcRow); - GLint srcRow1 = srcRow0 + 1; - GLfloat rowWeight = srcRow - srcRow0; /* fractional part of srcRow */ - - ASSERT(srcRow >= 0); - ASSERT(srcRow < srcHeight); - - if (srcRow1 == srcHeight) { - /* last row fudge */ - srcRow1 = srcRow0; - rowWeight = 0.0; - } - - if (invertY) { - srcRow0 = srcHeight - 1 - srcRow0; - srcRow1 = srcHeight - 1 - srcRow1; - } - - srcY0 = srcYpos + srcRow0; - srcY1 = srcYpos + srcRow1; - - /* get the two source rows */ - if (srcY0 == srcBufferY0 && srcY1 == srcBufferY1) { - /* use same source row buffers again */ - } - else if (srcY0 == srcBufferY1) { - /* move buffer1 into buffer0 by swapping pointers */ - GLvoid *tmp = srcBuffer0; - srcBuffer0 = srcBuffer1; - srcBuffer1 = tmp; - /* get y1 row */ - readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY1, srcBuffer1); - srcBufferY0 = srcY0; - srcBufferY1 = srcY1; - } - else { - /* get both new rows */ - readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY0, srcBuffer0); - readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY1, srcBuffer1); - srcBufferY0 = srcY0; - srcBufferY1 = srcY1; - } - - if (readRb->DataType == GL_UNSIGNED_BYTE) { - resample_linear_row_ub(srcWidth, dstWidth, srcBuffer0, srcBuffer1, - dstBuffer, invertX, rowWeight); - } - else { - _mesa_problem(ctx, "Unsupported color channel type in sw blit"); - break; - } - - /* store pixel row in destination */ - drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); - } - - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); - _mesa_free(dstBuffer); -} - - -/** - * Simple case: Blit color, depth or stencil with no scaling or flipping. - * XXX we could easily support vertical flipping here. - */ -static void -simple_blit(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLenum buffer) -{ - struct gl_renderbuffer *readRb, *drawRb; - const GLint width = srcX1 - srcX0; - const GLint height = srcY1 - srcY0; - GLint row, srcY, dstY, yStep; - GLint comps, bytesPerRow; - void *rowBuffer; - - /* only one buffer */ - ASSERT(_mesa_bitcount(buffer) == 1); - /* no flipping checks */ - ASSERT(srcX0 < srcX1); - ASSERT(srcY0 < srcY1); - ASSERT(dstX0 < dstX1); - ASSERT(dstY0 < dstY1); - /* size checks */ - ASSERT(srcX1 - srcX0 == dstX1 - dstX0); - ASSERT(srcY1 - srcY0 == dstY1 - dstY0); - - /* determine if copy should be bottom-to-top or top-to-bottom */ - if (srcY0 > dstY0) { - /* src above dst: copy bottom-to-top */ - yStep = 1; - srcY = srcY0; - dstY = dstY0; - } - else { - /* src below dst: copy top-to-bottom */ - yStep = -1; - srcY = srcY1 - 1; - dstY = dstY1 - 1; - } - - switch (buffer) { - case GL_COLOR_BUFFER_BIT: - readRb = ctx->ReadBuffer->_ColorReadBuffer; - drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - comps = 4; - break; - case GL_DEPTH_BUFFER_BIT: - readRb = ctx->ReadBuffer->_DepthBuffer; - drawRb = ctx->DrawBuffer->_DepthBuffer; - comps = 1; - break; - case GL_STENCIL_BUFFER_BIT: - readRb = ctx->ReadBuffer->_StencilBuffer; - drawRb = ctx->DrawBuffer->_StencilBuffer; - comps = 1; - break; - default: - _mesa_problem(ctx, "unexpected buffer in simple_blit()"); - return; - } - - ASSERT(readRb->DataType == drawRb->DataType); - - /* compute bytes per row */ - switch (readRb->DataType) { - case GL_UNSIGNED_BYTE: - bytesPerRow = comps * width * sizeof(GLubyte); - break; - case GL_UNSIGNED_SHORT: - bytesPerRow = comps * width * sizeof(GLushort); - break; - case GL_UNSIGNED_INT: - bytesPerRow = comps * width * sizeof(GLuint); - break; - case GL_FLOAT: - bytesPerRow = comps * width * sizeof(GLfloat); - break; - default: - _mesa_problem(ctx, "unexpected buffer type in simple_blit"); - return; - } - - /* allocate the row buffer */ - rowBuffer = _mesa_malloc(bytesPerRow); - if (!rowBuffer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); - return; - } - - for (row = 0; row < height; row++) { - readRb->GetRow(ctx, readRb, width, srcX0, srcY, rowBuffer); - drawRb->PutRow(ctx, drawRb, width, dstX0, dstY, rowBuffer, NULL); - srcY += yStep; - dstY += yStep; - } - - _mesa_free(rowBuffer); -} - - -/** - * Clip dst coords against Xmax (or Ymax). - */ -static INLINE void -clip_right_or_top(GLint *srcX0, GLint *srcX1, - GLint *dstX0, GLint *dstX1, - GLint maxValue) -{ - GLfloat t, bias; - - if (*dstX1 > maxValue) { - /* X1 outside right edge */ - ASSERT(*dstX0 < maxValue); /* X0 should be inside right edge */ - t = (GLfloat) (maxValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0); - /* chop off [t, 1] part */ - ASSERT(t >= 0.0 && t <= 1.0); - *dstX1 = maxValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; - *srcX1 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); - } - else if (*dstX0 > maxValue) { - /* X0 outside right edge */ - ASSERT(*dstX1 < maxValue); /* X1 should be inside right edge */ - t = (GLfloat) (maxValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1); - /* chop off [t, 1] part */ - ASSERT(t >= 0.0 && t <= 1.0); - *dstX0 = maxValue; - bias = (*srcX0 < *srcX1) ? -0.5 : 0.5; - *srcX0 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); - } -} - - -/** - * Clip dst coords against Xmin (or Ymin). - */ -static INLINE void -clip_left_or_bottom(GLint *srcX0, GLint *srcX1, - GLint *dstX0, GLint *dstX1, - GLint minValue) -{ - GLfloat t, bias; - - if (*dstX0 < minValue) { - /* X0 outside left edge */ - ASSERT(*dstX1 > minValue); /* X1 should be inside left edge */ - t = (GLfloat) (minValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0); - /* chop off [0, t] part */ - ASSERT(t >= 0.0 && t <= 1.0); - *dstX0 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; /* flipped??? */ - *srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); - } - else if (*dstX1 < minValue) { - /* X1 outside left edge */ - ASSERT(*dstX0 > minValue); /* X0 should be inside left edge */ - t = (GLfloat) (minValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1); - /* chop off [0, t] part */ - ASSERT(t >= 0.0 && t <= 1.0); - *dstX1 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; - *srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); - } -} - - -/** - * Do clipping of blit src/dest rectangles. - * The dest rect is clipped against both the buffer bounds and scissor bounds. - * The src rect is just clipped against the buffer bounds. - * - * When either the src or dest rect is clipped, the other is also clipped - * proportionately! - * - * Note that X0 need not be less than X1 (same for Y) for either the source - * and dest rects. That makes the clipping a little trickier. - * - * \return GL_TRUE if anything is left to draw, GL_FALSE if totally clipped - */ -static GLboolean -clip_blit(GLcontext *ctx, - GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1, - GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1) -{ - const GLint srcXmin = 0; - const GLint srcXmax = ctx->ReadBuffer->Width; - const GLint srcYmin = 0; - const GLint srcYmax = ctx->ReadBuffer->Height; - - /* these include scissor bounds */ - const GLint dstXmin = ctx->DrawBuffer->_Xmin; - const GLint dstXmax = ctx->DrawBuffer->_Xmax; - const GLint dstYmin = ctx->DrawBuffer->_Ymin; - const GLint dstYmax = ctx->DrawBuffer->_Ymax; - - /* - printf("PreClipX: src: %d .. %d dst: %d .. %d\n", - *srcX0, *srcX1, *dstX0, *dstX1); - printf("PreClipY: src: %d .. %d dst: %d .. %d\n", - *srcY0, *srcY1, *dstY0, *dstY1); - */ - - /* trivial rejection tests */ - if (*dstX0 == *dstX1) - return GL_FALSE; /* no width */ - if (*dstX0 <= dstXmin && *dstX1 <= dstXmin) - return GL_FALSE; /* totally out (left) of bounds */ - if (*dstX0 >= dstXmax && *dstX1 >= dstXmax) - return GL_FALSE; /* totally out (right) of bounds */ - - if (*dstY0 == *dstY1) - return GL_FALSE; - if (*dstY0 <= dstYmin && *dstY1 <= dstYmin) - return GL_FALSE; - if (*dstY0 >= dstYmax && *dstY1 >= dstYmax) - return GL_FALSE; - - if (*srcX0 == *srcX1) - return GL_FALSE; - if (*srcX0 <= srcXmin && *srcX1 <= srcXmin) - return GL_FALSE; - if (*srcX0 >= srcXmax && *srcX1 >= srcXmax) - return GL_FALSE; - - if (*srcY0 == *srcY1) - return GL_FALSE; - if (*srcY0 <= srcYmin && *srcY1 <= srcYmin) - return GL_FALSE; - if (*srcY0 >= srcYmax && *srcY1 >= srcYmax) - return GL_FALSE; - - /* - * dest clip - */ - clip_right_or_top(srcX0, srcX1, dstX0, dstX1, dstXmax); - clip_right_or_top(srcY0, srcY1, dstY0, dstY1, dstYmax); - clip_left_or_bottom(srcX0, srcX1, dstX0, dstX1, dstXmin); - clip_left_or_bottom(srcY0, srcY1, dstY0, dstY1, dstYmin); - - /* - * src clip (just swap src/dst values from above) - */ - clip_right_or_top(dstX0, dstX1, srcX0, srcX1, srcXmax); - clip_right_or_top(dstY0, dstY1, srcY0, srcY1, srcYmax); - clip_left_or_bottom(dstX0, dstX1, srcX0, srcX1, srcXmin); - clip_left_or_bottom(dstY0, dstY1, srcY0, srcY1, srcYmin); - - /* - printf("PostClipX: src: %d .. %d dst: %d .. %d\n", - *srcX0, *srcX1, *dstX0, *dstX1); - printf("PostClipY: src: %d .. %d dst: %d .. %d\n", - *srcY0, *srcY1, *dstY0, *dstY1); - */ - - ASSERT(*dstX0 >= dstXmin); - ASSERT(*dstX0 <= dstXmax); - ASSERT(*dstX1 >= dstXmin); - ASSERT(*dstX1 <= dstXmax); - - ASSERT(*dstY0 >= dstYmin); - ASSERT(*dstY0 <= dstYmax); - ASSERT(*dstY1 >= dstYmin); - ASSERT(*dstY1 <= dstYmax); - - ASSERT(*srcX0 >= srcXmin); - ASSERT(*srcX0 <= srcXmax); - ASSERT(*srcX1 >= srcXmin); - ASSERT(*srcX1 <= srcXmax); - - ASSERT(*srcY0 >= srcYmin); - ASSERT(*srcY0 <= srcYmax); - ASSERT(*srcY1 >= srcYmin); - ASSERT(*srcY1 <= srcYmax); - - return GL_TRUE; -} - - -/** - * Software fallback for glBlitFramebufferEXT(). - */ -void -_swrast_BlitFramebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - static const GLint buffers[3] = { - GL_COLOR_BUFFER_BIT, - GL_DEPTH_BUFFER_BIT, - GL_STENCIL_BUFFER_BIT - }; - GLint i; - - if (!ctx->DrawBuffer->_NumColorDrawBuffers) - return; - - if (!clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1, - &dstX0, &dstY0, &dstX1, &dstY1)) { - return; - } - - RENDER_START(swrast, ctx); - - if (srcX1 - srcX0 == dstX1 - dstX0 && - srcY1 - srcY0 == dstY1 - dstY0 && - srcX0 < srcX1 && - srcY0 < srcY1 && - dstX0 < dstX1 && - dstY0 < dstY1) { - /* no stretching or flipping. - * filter doesn't matter. - */ - for (i = 0; i < 3; i++) { - if (mask & buffers[i]) { - simple_blit(ctx, srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, buffers[i]); - } - } - } - else { - if (filter == GL_NEAREST) { - for (i = 0; i < 3; i++) { - if (mask & buffers[i]) { - blit_nearest(ctx, srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, buffers[i]); - } - } - } - else { - ASSERT(filter == GL_LINEAR); - if (mask & GL_COLOR_BUFFER_BIT) { /* depth/stencil not allowed */ - blit_linear(ctx, srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1); - } - } - } - - RENDER_FINISH(swrast, ctx); -} diff --git a/src/libs/mesa/mesa/swrast/s_buffers.c b/src/libs/mesa/mesa/swrast/s_buffers.c deleted file mode 100644 index 9e87d6d485..0000000000 --- a/src/libs/mesa/mesa/swrast/s_buffers.c +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -/** XXX This file should be named s_clear.c */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "s_accum.h" -#include "s_context.h" -#include "s_depth.h" -#include "s_masking.h" -#include "s_stencil.h" - - -/** - * Clear the color buffer when glColorMask is in effect. - */ -static void -clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - SWspan span; - GLint i; - - ASSERT(ctx->Visual.rgbMode); - ASSERT(rb->PutRow); - - /* Initialize color span with clear color */ - /* XXX optimize for clearcolor == black/zero (bzero) */ - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_RGBA; - span.array->ChanType = rb->DataType; - if (span.array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte clearColor[4]; - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[RCOMP], ctx->Color.ClearColor[0]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[GCOMP], ctx->Color.ClearColor[1]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[BCOMP], ctx->Color.ClearColor[2]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[ACOMP], ctx->Color.ClearColor[3]); - for (i = 0; i < width; i++) { - COPY_4UBV(span.array->rgba[i], clearColor); - } - } - else if (span.array->ChanType == GL_UNSIGNED_SHORT) { - GLushort clearColor[4]; - UNCLAMPED_FLOAT_TO_USHORT(clearColor[RCOMP], ctx->Color.ClearColor[0]); - UNCLAMPED_FLOAT_TO_USHORT(clearColor[GCOMP], ctx->Color.ClearColor[1]); - UNCLAMPED_FLOAT_TO_USHORT(clearColor[BCOMP], ctx->Color.ClearColor[2]); - UNCLAMPED_FLOAT_TO_USHORT(clearColor[ACOMP], ctx->Color.ClearColor[3]); - for (i = 0; i < width; i++) { - COPY_4V(span.array->rgba[i], clearColor); - } - } - else { - ASSERT(span.array->ChanType == GL_FLOAT); - for (i = 0; i < width; i++) { - CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][0], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][1], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][2], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][3], ctx->Color.ClearColor[3]); - } - } - - /* Note that masking will change the color values, but only the - * channels for which the write mask is GL_FALSE. The channels - * which which are write-enabled won't get modified. - */ - for (i = 0; i < height; i++) { - span.x = x; - span.y = y + i; - _swrast_mask_rgba_span(ctx, rb, &span); - /* write masked row */ - rb->PutRow(ctx, rb, width, x, y + i, span.array->rgba, NULL); - } -} - - -/** - * Clear color index buffer with masking. - */ -static void -clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - SWspan span; - GLint i; - - ASSERT(!ctx->Visual.rgbMode); - ASSERT(rb->PutRow); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - /* Initialize index span with clear index */ - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_INDEX; - for (i = 0; i < width;i++) { - span.array->index[i] = ctx->Color.ClearIndex; - } - - /* Note that masking will change the color indexes, but only the - * bits for which the write mask is GL_FALSE. The bits - * which are write-enabled won't get modified. - */ - for (i = 0; i < height;i++) { - span.x = x; - span.y = y + i; - _swrast_mask_ci_span(ctx, rb, &span); - /* write masked row */ - rb->PutRow(ctx, rb, width, x, y + i, span.array->index, NULL); - } -} - - -/** - * Clear an rgba color buffer without channel masking. - */ -static void -clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLubyte clear8[4]; - GLushort clear16[4]; - GLvoid *clearVal; - GLint i; - - ASSERT(ctx->Visual.rgbMode); - - ASSERT(ctx->Color.ColorMask[0] && - ctx->Color.ColorMask[1] && - ctx->Color.ColorMask[2] && - ctx->Color.ColorMask[3]); - - ASSERT(rb->PutMonoRow); - - switch (rb->DataType) { - case GL_UNSIGNED_BYTE: - UNCLAMPED_FLOAT_TO_UBYTE(clear8[0], ctx->Color.ClearColor[0]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[1], ctx->Color.ClearColor[1]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[2], ctx->Color.ClearColor[2]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[3], ctx->Color.ClearColor[3]); - clearVal = clear8; - break; - case GL_UNSIGNED_SHORT: - UNCLAMPED_FLOAT_TO_USHORT(clear16[0], ctx->Color.ClearColor[0]); - UNCLAMPED_FLOAT_TO_USHORT(clear16[1], ctx->Color.ClearColor[1]); - UNCLAMPED_FLOAT_TO_USHORT(clear16[2], ctx->Color.ClearColor[2]); - UNCLAMPED_FLOAT_TO_USHORT(clear16[3], ctx->Color.ClearColor[3]); - clearVal = clear16; - break; - case GL_FLOAT: - clearVal = ctx->Color.ClearColor; - break; - default: - _mesa_problem(ctx, "Bad rb DataType in clear_color_buffer"); - return; - } - - for (i = 0; i < height; i++) { - rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); - } -} - - -/** - * Clear color index buffer without masking. - */ -static void -clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLubyte clear8; - GLushort clear16; - GLuint clear32; - GLvoid *clearVal; - GLint i; - - ASSERT(!ctx->Visual.rgbMode); - - ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1)) - == (GLuint) ((1 << rb->IndexBits) - 1)); - - ASSERT(rb->PutMonoRow); - - /* setup clear value */ - switch (rb->DataType) { - case GL_UNSIGNED_BYTE: - clear8 = (GLubyte) ctx->Color.ClearIndex; - clearVal = &clear8; - break; - case GL_UNSIGNED_SHORT: - clear16 = (GLushort) ctx->Color.ClearIndex; - clearVal = &clear16; - break; - case GL_UNSIGNED_INT: - clear32 = ctx->Color.ClearIndex; - clearVal = &clear32; - break; - default: - _mesa_problem(ctx, "Bad rb DataType in clear_color_buffer"); - return; - } - - for (i = 0; i < height; i++) - rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); -} - - -/** - * Clear the front/back/left/right/aux color buffers. - * This function is usually only called if the device driver can't - * clear its own color buffers for some reason (such as with masking). - */ -static void -clear_color_buffers(GLcontext *ctx) -{ - GLboolean masking; - GLuint buf; - - if (ctx->Visual.rgbMode) { - if (ctx->Color.ColorMask[0] && - ctx->Color.ColorMask[1] && - ctx->Color.ColorMask[2] && - ctx->Color.ColorMask[3]) { - masking = GL_FALSE; - } - else { - masking = GL_TRUE; - } - } - else { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - const GLuint indexBits = (1 << rb->IndexBits) - 1; - if ((ctx->Color.IndexMask & indexBits) == indexBits) { - masking = GL_FALSE; - } - else { - masking = GL_TRUE; - } - } - - for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[buf]; - if (ctx->Visual.rgbMode) { - if (masking) { - clear_rgba_buffer_with_masking(ctx, rb); - } - else { - clear_rgba_buffer(ctx, rb); - } - } - else { - if (masking) { - clear_ci_buffer_with_masking(ctx, rb); - } - else { - clear_ci_buffer(ctx, rb); - } - } - } -} - - -/** - * Called via the device driver's ctx->Driver.Clear() function if the - * device driver can't clear one or more of the buffers itself. - * \param buffers bitfield of BUFFER_BIT_* values indicating which - * renderbuffers are to be cleared. - * \param all if GL_TRUE, clear whole buffer, else clear specified region. - */ -void -_swrast_Clear(GLcontext *ctx, GLbitfield buffers) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - -#ifdef DEBUG_FOO - { - const GLbitfield legalBits = - BUFFER_BIT_FRONT_LEFT | - BUFFER_BIT_FRONT_RIGHT | - BUFFER_BIT_BACK_LEFT | - BUFFER_BIT_BACK_RIGHT | - BUFFER_BIT_DEPTH | - BUFFER_BIT_STENCIL | - BUFFER_BIT_ACCUM | - BUFFER_BIT_AUX0 | - BUFFER_BIT_AUX1 | - BUFFER_BIT_AUX2 | - BUFFER_BIT_AUX3; - assert((buffers & (~legalBits)) == 0); - } -#endif - - RENDER_START(swrast,ctx); - - /* do software clearing here */ - if (buffers) { - if ((buffers & BUFFER_BITS_COLOR) - && (ctx->DrawBuffer->_NumColorDrawBuffers > 0)) { - clear_color_buffers(ctx); - } - if (buffers & BUFFER_BIT_DEPTH) { - _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer); - } - if (buffers & BUFFER_BIT_ACCUM) { - _swrast_clear_accum_buffer(ctx, - ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer); - } - if (buffers & BUFFER_BIT_STENCIL) { - _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer); - } - } - - RENDER_FINISH(swrast,ctx); -} diff --git a/src/libs/mesa/mesa/swrast/s_context.c b/src/libs/mesa/mesa/swrast/s_context.c deleted file mode 100644 index 62857ddeb0..0000000000 --- a/src/libs/mesa/mesa/swrast/s_context.c +++ /dev/null @@ -1,945 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - * - * Authors: - * Keith Whitwell - * Brian Paul - */ - -#include "main/imports.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/mtypes.h" -#include "main/teximage.h" -#include "shader/prog_parameter.h" -#include "shader/prog_statevars.h" -#include "swrast.h" -#include "s_blend.h" -#include "s_context.h" -#include "s_lines.h" -#include "s_points.h" -#include "s_span.h" -#include "s_triangle.h" -#include "s_texfilter.h" - - -/** - * Recompute the value of swrast->_RasterMask, etc. according to - * the current context. The _RasterMask field can be easily tested by - * drivers to determine certain basic GL state (does the primitive need - * stenciling, logic-op, fog, etc?). - */ -static void -_swrast_update_rasterflags( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLbitfield rasterMask = 0; - - if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT; - if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT; - if (ctx->Depth.Test) rasterMask |= DEPTH_BIT; - if (swrast->_FogEnabled) rasterMask |= FOG_BIT; - if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT; - if (ctx->Stencil.Enabled) rasterMask |= STENCIL_BIT; - if (ctx->Visual.rgbMode) { - const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); - if (colorMask != 0xffffffff) rasterMask |= MASKING_BIT; - if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; - if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; - } - else { - if (ctx->Color.IndexMask != 0xffffffff) rasterMask |= MASKING_BIT; - if (ctx->Color.IndexLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; - } - - if ( ctx->Viewport.X < 0 - || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width - || ctx->Viewport.Y < 0 - || ctx->Viewport.Y + ctx->Viewport.Height > (GLint) ctx->DrawBuffer->Height) { - rasterMask |= CLIP_BIT; - } - - if (ctx->Query.CurrentOcclusionObject) - rasterMask |= OCCLUSION_BIT; - - - /* If we're not drawing to exactly one color buffer set the - * MULTI_DRAW_BIT flag. Also set it if we're drawing to no - * buffers or the RGBA or CI mask disables all writes. - */ - if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { - /* more than one color buffer designated for writing (or zero buffers) */ - rasterMask |= MULTI_DRAW_BIT; - } - else if (ctx->Visual.rgbMode && *((GLuint *) ctx->Color.ColorMask) == 0) { - rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */ - } - else if (!ctx->Visual.rgbMode && ctx->Color.IndexMask==0) { - rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */ - } - - if (ctx->FragmentProgram._Current) { - rasterMask |= FRAGPROG_BIT; - } - - if (ctx->ATIFragmentShader._Enabled) { - rasterMask |= ATIFRAGSHADER_BIT; - } - -#if CHAN_TYPE == GL_FLOAT - if (ctx->Color.ClampFragmentColor == GL_TRUE) { - rasterMask |= CLAMPING_BIT; - } -#endif - - SWRAST_CONTEXT(ctx)->_RasterMask = rasterMask; -} - - -/** - * Examine polygon cull state to compute the _BackfaceCullSign field. - * _BackfaceCullSign will be 0 if no culling, -1 if culling back-faces, - * and 1 if culling front-faces. The Polygon FrontFace state also - * factors in. - */ -static void -_swrast_update_polygon( GLcontext *ctx ) -{ - GLfloat backface_sign; - - if (ctx->Polygon.CullFlag) { - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - backface_sign = -1.0; - break; - case GL_FRONT: - backface_sign = 1.0; - break; - case GL_FRONT_AND_BACK: - /* fallthrough */ - default: - backface_sign = 0.0; - } - } - else { - backface_sign = 0.0; - } - - SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign; - - /* This is for front/back-face determination, but not for culling */ - SWRAST_CONTEXT(ctx)->_BackfaceSign - = (ctx->Polygon.FrontFace == GL_CW) ? -1.0 : 1.0; -} - - - -/** - * Update the _PreferPixelFog field to indicate if we need to compute - * fog blend factors (from the fog coords) per-fragment. - */ -static void -_swrast_update_fog_hint( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - swrast->_PreferPixelFog = (!swrast->AllowVertexFog || - ctx->FragmentProgram._Current || - (ctx->Hint.Fog == GL_NICEST && - swrast->AllowPixelFog)); -} - - - -/** - * Update the swrast->_AnyTextureCombine flag. - */ -static void -_swrast_update_texture_env( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint i; - swrast->_AnyTextureCombine = GL_FALSE; - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (ctx->Texture.Unit[i].EnvMode == GL_COMBINE_EXT || - ctx->Texture.Unit[i].EnvMode == GL_COMBINE4_NV) { - swrast->_AnyTextureCombine = GL_TRUE; - return; - } - } -} - - -/** - * Determine if we can defer texturing/shading until after Z/stencil - * testing. This potentially allows us to skip texturing/shading for - * lots of fragments. - */ -static void -_swrast_update_deferred_texture(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (ctx->Color.AlphaEnabled) { - /* alpha test depends on post-texture/shader colors */ - swrast->_DeferredTexture = GL_FALSE; - } - else { - const struct gl_fragment_program *fprog - = ctx->FragmentProgram._Current; - if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR))) { - /* Z comes from fragment program/shader */ - swrast->_DeferredTexture = GL_FALSE; - } - else if (ctx->Query.CurrentOcclusionObject) { - /* occlusion query depends on shader discard/kill results */ - swrast->_DeferredTexture = GL_FALSE; - } - else { - swrast->_DeferredTexture = GL_TRUE; - } - } -} - - -/** - * Update swrast->_FogColor and swrast->_FogEnable values. - */ -static void -_swrast_update_fog_state( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - - /* determine if fog is needed, and if so, which fog mode */ - swrast->_FogEnabled = GL_FALSE; - if (fp && fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - if (fp->FogOption != GL_NONE) { - swrast->_FogEnabled = GL_TRUE; - swrast->_FogMode = fp->FogOption; - } - } - else if (ctx->Fog.Enabled) { - swrast->_FogEnabled = GL_TRUE; - swrast->_FogMode = ctx->Fog.Mode; - } -} - - -/** - * Update state for running fragment programs. Basically, load the - * program parameters with current state values. - */ -static void -_swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState) -{ - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - if (fp) { -#if 0 - /* XXX Need a way to trigger the initial loading of parameters - * even when there's no recent state changes. - */ - if (fp->Base.Parameters->StateFlags & newState) -#endif - _mesa_load_state_parameters(ctx, fp->Base.Parameters); - } -} - - - -#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \ - _NEW_TEXTURE | \ - _NEW_HINT | \ - _NEW_POLYGON ) - -/* State referenced by _swrast_choose_triangle, _swrast_choose_line. - */ -#define _SWRAST_NEW_TRIANGLE (_SWRAST_NEW_DERIVED | \ - _NEW_RENDERMODE| \ - _NEW_POLYGON| \ - _NEW_DEPTH| \ - _NEW_STENCIL| \ - _NEW_COLOR| \ - _NEW_TEXTURE| \ - _SWRAST_NEW_RASTERMASK| \ - _NEW_LIGHT| \ - _NEW_FOG | \ - _DD_NEW_SEPARATE_SPECULAR) - -#define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \ - _NEW_RENDERMODE| \ - _NEW_LINE| \ - _NEW_TEXTURE| \ - _NEW_LIGHT| \ - _NEW_FOG| \ - _NEW_DEPTH | \ - _DD_NEW_SEPARATE_SPECULAR) - -#define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \ - _NEW_RENDERMODE | \ - _NEW_POINT | \ - _NEW_TEXTURE | \ - _NEW_LIGHT | \ - _NEW_FOG | \ - _DD_NEW_SEPARATE_SPECULAR) - -#define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE - -#define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE - -#define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR - - - -/** - * Stub for swrast->Triangle to select a true triangle function - * after a state change. - */ -static void -_swrast_validate_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - _swrast_validate_derived( ctx ); - swrast->choose_triangle( ctx ); - ASSERT(swrast->Triangle); - - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { - /* separate specular color, but no texture */ - swrast->SpecTriangle = swrast->Triangle; - swrast->Triangle = _swrast_add_spec_terms_triangle; - } - - swrast->Triangle( ctx, v0, v1, v2 ); -} - -/** - * Called via swrast->Line. Examine current GL state and choose a software - * line routine. Then call it. - */ -static void -_swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - _swrast_validate_derived( ctx ); - swrast->choose_line( ctx ); - ASSERT(swrast->Line); - - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { - swrast->SpecLine = swrast->Line; - swrast->Line = _swrast_add_spec_terms_line; - } - - swrast->Line( ctx, v0, v1 ); -} - -/** - * Called via swrast->Point. Examine current GL state and choose a software - * point routine. Then call it. - */ -static void -_swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - _swrast_validate_derived( ctx ); - swrast->choose_point( ctx ); - - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { - swrast->SpecPoint = swrast->Point; - swrast->Point = _swrast_add_spec_terms_point; - } - - swrast->Point( ctx, v0 ); -} - - -/** - * Called via swrast->BlendFunc. Examine GL state to choose a blending - * function, then call it. - */ -static void _ASMAPI -_swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, - GLenum chanType ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - _swrast_validate_derived( ctx ); /* why is this needed? */ - _swrast_choose_blend_func( ctx, chanType ); - - swrast->BlendFunc( ctx, n, mask, src, dst, chanType ); -} - - -/** - * Make sure we have texture image data for all the textures we may need - * for subsequent rendering. - */ -static void -_swrast_validate_texture_images(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint u; - - if (!swrast->ValidateTextureImage || !ctx->Texture._EnabledUnits) { - /* no textures enabled, or no way to validate images! */ - return; - } - - for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { - if (ctx->Texture.Unit[u]._ReallyEnabled) { - struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current; - ASSERT(texObj); - if (texObj) { - GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - GLuint face; - for (face = 0; face < numFaces; face++) { - GLint lvl; - for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) { - struct gl_texture_image *texImg = texObj->Image[face][lvl]; - if (texImg && !texImg->Data) { - swrast->ValidateTextureImage(ctx, texObj, face, lvl); - ASSERT(texObj->Image[face][lvl]->Data); - } - } - } - } - } - } -} - - -/** - * Free the texture image data attached to all currently enabled - * textures. Meant to be called by device drivers when transitioning - * from software to hardware rendering. - */ -void -_swrast_eject_texture_images(GLcontext *ctx) -{ - GLuint u; - - if (!ctx->Texture._EnabledUnits) { - /* no textures enabled */ - return; - } - - for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { - if (ctx->Texture.Unit[u]._ReallyEnabled) { - struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current; - ASSERT(texObj); - if (texObj) { - GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - GLuint face; - for (face = 0; face < numFaces; face++) { - GLint lvl; - for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) { - struct gl_texture_image *texImg = texObj->Image[face][lvl]; - if (texImg && texImg->Data) { - _mesa_free_texmemory(texImg->Data); - texImg->Data = NULL; - } - } - } - } - } - } -} - - - -static void -_swrast_sleep( GLcontext *ctx, GLbitfield new_state ) -{ - (void) ctx; (void) new_state; -} - - -static void -_swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint i; - - swrast->NewState |= new_state; - - /* After 10 statechanges without any swrast functions being called, - * put the module to sleep. - */ - if (++swrast->StateChanges > 10) { - swrast->InvalidateState = _swrast_sleep; - swrast->NewState = ~0; - new_state = ~0; - } - - { - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - if (fp && (fp->Base.Parameters->StateFlags & new_state)) { - _mesa_load_state_parameters(ctx, fp->Base.Parameters); - } - } - - if (new_state & swrast->InvalidateTriangleMask) - swrast->Triangle = _swrast_validate_triangle; - - if (new_state & swrast->InvalidateLineMask) - swrast->Line = _swrast_validate_line; - - if (new_state & swrast->InvalidatePointMask) - swrast->Point = _swrast_validate_point; - - if (new_state & _SWRAST_NEW_BLEND_FUNC) - swrast->BlendFunc = _swrast_validate_blend_func; - - if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC) - for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++) - swrast->TextureSample[i] = NULL; -} - - -void -_swrast_update_texture_samplers(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint u; - - for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { - const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current; - /* Note: If tObj is NULL, the sample function will be a simple - * function that just returns opaque black (0,0,0,1). - */ - swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj); - } -} - - -/** - * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs, - * swrast->_ActiveAtttribMask. - */ -static void -_swrast_update_active_attribs(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint attribsMask; - - /* - * Compute _ActiveAttribsMask = which fragment attributes are needed. - */ - if (ctx->FragmentProgram._Current) { - /* fragment program/shader */ - attribsMask = ctx->FragmentProgram._Current->Base.InputsRead; - attribsMask &= ~FRAG_BIT_WPOS; /* WPOS is always handled specially */ - } - else if (ctx->ATIFragmentShader._Enabled) { - attribsMask = ~0; /* XXX fix me */ - } - else { - /* fixed function */ - attribsMask = 0x0; - -#if CHAN_TYPE == GL_FLOAT - attribsMask |= FRAG_BIT_COL0; -#endif - - if (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - attribsMask |= FRAG_BIT_COL1; - } - - if (swrast->_FogEnabled) - attribsMask |= FRAG_BIT_FOGC; - - attribsMask |= (ctx->Texture._EnabledUnits << FRAG_ATTRIB_TEX0); - } - - swrast->_ActiveAttribMask = attribsMask; - - /* Update _ActiveAttribs[] list */ - { - GLuint i, num = 0; - for (i = 0; i < FRAG_ATTRIB_MAX; i++) { - if (attribsMask & (1 << i)) { - swrast->_ActiveAttribs[num++] = i; - /* how should this attribute be interpolated? */ - if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1) - swrast->_InterpMode[i] = ctx->Light.ShadeModel; - else - swrast->_InterpMode[i] = GL_SMOOTH; - } - } - swrast->_NumActiveAttribs = num; - } -} - - -void -_swrast_validate_derived( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (swrast->NewState) { - if (swrast->NewState & _NEW_POLYGON) - _swrast_update_polygon( ctx ); - - if (swrast->NewState & (_NEW_HINT | _NEW_PROGRAM)) - _swrast_update_fog_hint( ctx ); - - if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE) - _swrast_update_texture_env( ctx ); - - if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM)) - _swrast_update_fog_state( ctx ); - - if (swrast->NewState & (_NEW_MODELVIEW | - _NEW_PROJECTION | - _NEW_TEXTURE_MATRIX | - _NEW_FOG | - _NEW_LIGHT | - _NEW_LINE | - _NEW_TEXTURE | - _NEW_TRANSFORM | - _NEW_POINT | - _NEW_VIEWPORT | - _NEW_PROGRAM)) - _swrast_update_fragment_program( ctx, swrast->NewState ); - - if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) { - _swrast_update_texture_samplers( ctx ); - _swrast_validate_texture_images(ctx); - } - - if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM)) - _swrast_update_deferred_texture(ctx); - - if (swrast->NewState & _SWRAST_NEW_RASTERMASK) - _swrast_update_rasterflags( ctx ); - - if (swrast->NewState & (_NEW_DEPTH | - _NEW_FOG | - _NEW_LIGHT | - _NEW_PROGRAM | - _NEW_TEXTURE)) - _swrast_update_active_attribs(ctx); - - swrast->NewState = 0; - swrast->StateChanges = 0; - swrast->InvalidateState = _swrast_invalidate_state; - } -} - -#define SWRAST_DEBUG 0 - -/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc. - */ -void -_swrast_Quad( GLcontext *ctx, - const SWvertex *v0, const SWvertex *v1, - const SWvertex *v2, const SWvertex *v3 ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_Quad\n"); - _swrast_print_vertex( ctx, v0 ); - _swrast_print_vertex( ctx, v1 ); - _swrast_print_vertex( ctx, v2 ); - _swrast_print_vertex( ctx, v3 ); - } - SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v3 ); - SWRAST_CONTEXT(ctx)->Triangle( ctx, v1, v2, v3 ); -} - -void -_swrast_Triangle( GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2 ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_Triangle\n"); - _swrast_print_vertex( ctx, v0 ); - _swrast_print_vertex( ctx, v1 ); - _swrast_print_vertex( ctx, v2 ); - } - SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 ); -} - -void -_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_Line\n"); - _swrast_print_vertex( ctx, v0 ); - _swrast_print_vertex( ctx, v1 ); - } - SWRAST_CONTEXT(ctx)->Line( ctx, v0, v1 ); -} - -void -_swrast_Point( GLcontext *ctx, const SWvertex *v0 ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_Point\n"); - _swrast_print_vertex( ctx, v0 ); - } - SWRAST_CONTEXT(ctx)->Point( ctx, v0 ); -} - -void -_swrast_InvalidateState( GLcontext *ctx, GLbitfield new_state ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_InvalidateState\n"); - } - SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state ); -} - -void -_swrast_ResetLineStipple( GLcontext *ctx ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_ResetLineStipple\n"); - } - SWRAST_CONTEXT(ctx)->StippleCounter = 0; -} - -void -_swrast_SetFacing(GLcontext *ctx, GLuint facing) -{ - SWRAST_CONTEXT(ctx)->PointLineFacing = facing; -} - -void -_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value); - } - SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT ); - SWRAST_CONTEXT(ctx)->AllowVertexFog = value; -} - -void -_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value ) -{ - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value); - } - SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT ); - SWRAST_CONTEXT(ctx)->AllowPixelFog = value; -} - - -GLboolean -_swrast_CreateContext( GLcontext *ctx ) -{ - GLuint i; - SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext)); - - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_CreateContext\n"); - } - - if (!swrast) - return GL_FALSE; - - swrast->NewState = ~0; - - swrast->choose_point = _swrast_choose_point; - swrast->choose_line = _swrast_choose_line; - swrast->choose_triangle = _swrast_choose_triangle; - - swrast->InvalidatePointMask = _SWRAST_NEW_POINT; - swrast->InvalidateLineMask = _SWRAST_NEW_LINE; - swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE; - - swrast->Point = _swrast_validate_point; - swrast->Line = _swrast_validate_line; - swrast->Triangle = _swrast_validate_triangle; - swrast->InvalidateState = _swrast_sleep; - swrast->BlendFunc = _swrast_validate_blend_func; - - swrast->AllowVertexFog = GL_TRUE; - swrast->AllowPixelFog = GL_TRUE; - - /* Optimized Accum buffer */ - swrast->_IntegerAccumMode = GL_FALSE; - swrast->_IntegerAccumScaler = 0.0; - - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) - swrast->TextureSample[i] = NULL; - - swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays); - if (!swrast->SpanArrays) { - FREE(swrast); - return GL_FALSE; - } - swrast->SpanArrays->ChanType = CHAN_TYPE; -#if CHAN_TYPE == GL_UNSIGNED_BYTE - swrast->SpanArrays->rgba = swrast->SpanArrays->rgba8; -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - swrast->SpanArrays->rgba = swrast->SpanArrays->rgba16; -#else - swrast->SpanArrays->rgba = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0]; -#endif - - /* init point span buffer */ - swrast->PointSpan.primitive = GL_POINT; - swrast->PointSpan.end = 0; - swrast->PointSpan.facing = 0; - swrast->PointSpan.array = swrast->SpanArrays; - - swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureImageUnits * - MAX_WIDTH * 4 * sizeof(GLchan)); - if (!swrast->TexelBuffer) { - FREE(swrast->SpanArrays); - FREE(swrast); - return GL_FALSE; - } - - ctx->swrast_context = swrast; - - return GL_TRUE; -} - -void -_swrast_DestroyContext( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (SWRAST_DEBUG) { - _mesa_debug(ctx, "_swrast_DestroyContext\n"); - } - - FREE( swrast->SpanArrays ); - if (swrast->ZoomedArrays) - FREE( swrast->ZoomedArrays ); - FREE( swrast->TexelBuffer ); - FREE( swrast ); - - ctx->swrast_context = 0; -} - - -struct swrast_device_driver * -_swrast_GetDeviceDriverReference( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - return &swrast->Driver; -} - -void -_swrast_flush( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - /* flush any pending fragments from rendering points */ - if (swrast->PointSpan.end > 0) { - if (ctx->Visual.rgbMode) { - _swrast_write_rgba_span(ctx, &(swrast->PointSpan)); - } - else { - _swrast_write_index_span(ctx, &(swrast->PointSpan)); - } - swrast->PointSpan.end = 0; - } -} - -void -_swrast_render_primitive( GLcontext *ctx, GLenum prim ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) { - _swrast_flush(ctx); - } - swrast->Primitive = prim; -} - - -void -_swrast_render_start( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (swrast->Driver.SpanRenderStart) - swrast->Driver.SpanRenderStart( ctx ); - swrast->PointSpan.end = 0; -} - -void -_swrast_render_finish( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (swrast->Driver.SpanRenderFinish) - swrast->Driver.SpanRenderFinish( ctx ); - - _swrast_flush(ctx); -} - - -#define SWRAST_DEBUG_VERTICES 0 - -void -_swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) -{ - GLuint i; - - if (SWRAST_DEBUG_VERTICES) { - _mesa_debug(ctx, "win %f %f %f %f\n", - v->attrib[FRAG_ATTRIB_WPOS][0], - v->attrib[FRAG_ATTRIB_WPOS][1], - v->attrib[FRAG_ATTRIB_WPOS][2], - v->attrib[FRAG_ATTRIB_WPOS][3]); - - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) - if (ctx->Texture.Unit[i]._ReallyEnabled) - _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i, - v->attrib[FRAG_ATTRIB_TEX0 + i][0], - v->attrib[FRAG_ATTRIB_TEX0 + i][1], - v->attrib[FRAG_ATTRIB_TEX0 + i][2], - v->attrib[FRAG_ATTRIB_TEX0 + i][3]); - -#if CHAN_TYPE == GL_FLOAT - _mesa_debug(ctx, "color %f %f %f %f\n", - v->color[0], v->color[1], v->color[2], v->color[3]); -#else - _mesa_debug(ctx, "color %d %d %d %d\n", - v->color[0], v->color[1], v->color[2], v->color[3]); -#endif - _mesa_debug(ctx, "spec %g %g %g %g\n", - v->attrib[FRAG_ATTRIB_COL1][0], - v->attrib[FRAG_ATTRIB_COL1][1], - v->attrib[FRAG_ATTRIB_COL1][2], - v->attrib[FRAG_ATTRIB_COL1][3]); - _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]); - _mesa_debug(ctx, "index %d\n", v->attrib[FRAG_ATTRIB_CI][0]); - _mesa_debug(ctx, "pointsize %f\n", v->pointSize); - _mesa_debug(ctx, "\n"); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_context.h b/src/libs/mesa/mesa/swrast/s_context.h deleted file mode 100644 index a511d1c9a1..0000000000 --- a/src/libs/mesa/mesa/swrast/s_context.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file swrast/s_context.h - * \brief Software rasterization context and private types. - * \author Keith Whitwell - */ - -/** - * \mainpage swrast module - * - * This module, software rasterization, contains the software fallback - * routines for drawing points, lines, triangles, bitmaps and images. - * All rendering boils down to writing spans (arrays) of pixels with - * particular colors. The span-writing routines must be implemented - * by the device driver. - */ - - -#ifndef S_CONTEXT_H -#define S_CONTEXT_H - -#include "main/mtypes.h" -#include "shader/prog_execute.h" -#include "swrast.h" -#include "s_span.h" - - -typedef void (*texture_sample_func)(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]); - -typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, - const GLubyte mask[], - GLvoid *src, const GLvoid *dst, - GLenum chanType); - -typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *); - -typedef void (*swrast_line_func)( GLcontext *ctx, - const SWvertex *, const SWvertex *); - -typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *, - const SWvertex *, const SWvertex *); - - -typedef void (*validate_texture_image_func)(GLcontext *ctx, - struct gl_texture_object *texObj, - GLuint face, GLuint level); - - -/** - * \defgroup Bitmasks - * Bitmasks to indicate which rasterization options are enabled - * (RasterMask) - */ -/*@{*/ -#define ALPHATEST_BIT 0x001 /**< Alpha-test pixels */ -#define BLEND_BIT 0x002 /**< Blend pixels */ -#define DEPTH_BIT 0x004 /**< Depth-test pixels */ -#define FOG_BIT 0x008 /**< Fog pixels */ -#define LOGIC_OP_BIT 0x010 /**< Apply logic op in software */ -#define CLIP_BIT 0x020 /**< Scissor or window clip pixels */ -#define STENCIL_BIT 0x040 /**< Stencil pixels */ -#define MASKING_BIT 0x080 /**< Do glColorMask or glIndexMask */ -#define MULTI_DRAW_BIT 0x400 /**< Write to more than one color- */ - /**< buffer or no buffers. */ -#define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */ -#define TEXTURE_BIT 0x1000 /**< Texturing really enabled */ -#define FRAGPROG_BIT 0x2000 /**< Fragment program enabled */ -#define ATIFRAGSHADER_BIT 0x4000 /**< ATI Fragment shader enabled */ -#define CLAMPING_BIT 0x8000 /**< Clamp colors to [0,1] */ -/*@}*/ - -#define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \ - _NEW_SCISSOR| \ - _NEW_COLOR| \ - _NEW_DEPTH| \ - _NEW_FOG| \ - _NEW_PROGRAM| \ - _NEW_STENCIL| \ - _NEW_TEXTURE| \ - _NEW_VIEWPORT| \ - _NEW_DEPTH) - - -/** - * \struct SWcontext - * \brief Per-context state that's private to the software rasterizer module. - */ -typedef struct -{ - /** Driver interface: - */ - struct swrast_device_driver Driver; - - /** Configuration mechanisms to make software rasterizer match - * characteristics of the hardware rasterizer (if present): - */ - GLboolean AllowVertexFog; - GLboolean AllowPixelFog; - - /** Derived values, invalidated on statechanges, updated from - * _swrast_validate_derived(): - */ - GLbitfield _RasterMask; - GLfloat _BackfaceSign; /** +1 or -1 */ - GLfloat _BackfaceCullSign; /** +1, 0, or -1 */ - GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ - GLboolean _AnyTextureCombine; - GLboolean _FogEnabled; - GLboolean _DeferredTexture; - GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ - - /** List/array of the fragment attributes to interpolate */ - GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; - /** Same info, but as a bitmask */ - GLbitfield _ActiveAttribMask; - /** Number of fragment attributes to interpolate */ - GLuint _NumActiveAttribs; - /** Indicates how each attrib is to be interpolated (lines/tris) */ - GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */ - - /* Accum buffer temporaries. - */ - GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */ - GLfloat _IntegerAccumScaler; /**< Implicit scale factor */ - - /* Working values: - */ - GLuint StippleCounter; /**< Line stipple counter */ - GLuint PointLineFacing; - GLbitfield NewState; - GLuint StateChanges; - GLenum Primitive; /* current primitive being drawn (ala glBegin) */ - - void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state ); - - /** - * When the NewState mask intersects these masks, we invalidate the - * Point/Line/Triangle function pointers below. - */ - /*@{*/ - GLbitfield InvalidatePointMask; - GLbitfield InvalidateLineMask; - GLbitfield InvalidateTriangleMask; - /*@}*/ - - /** - * Device drivers plug in functions for these callbacks. - * Will be called when the GL state change mask intersects the above masks. - */ - /*@{*/ - void (*choose_point)( GLcontext * ); - void (*choose_line)( GLcontext * ); - void (*choose_triangle)( GLcontext * ); - /*@}*/ - - /** - * Current point, line and triangle drawing functions. - */ - /*@{*/ - swrast_point_func Point; - swrast_line_func Line; - swrast_tri_func Triangle; - /*@}*/ - - /** - * Placeholders for when separate specular (or secondary color) is - * enabled but texturing is not. - */ - /*@{*/ - swrast_point_func SpecPoint; - swrast_line_func SpecLine; - swrast_tri_func SpecTriangle; - /*@}*/ - - /** - * Typically, we'll allocate a sw_span structure as a local variable - * and set its 'array' pointer to point to this object. The reason is - * this object is big and causes problems when allocated on the stack - * on some systems. - */ - SWspanarrays *SpanArrays; - SWspanarrays *ZoomedArrays; /**< For pixel zooming */ - - /** - * Used to buffer N GL_POINTS, instead of rendering one by one. - */ - SWspan PointSpan; - - /** Internal hooks, kept up to date by the same mechanism as above. - */ - blend_func BlendFunc; - texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS]; - - /** Buffer for saving the sampled texture colors. - * Needed for GL_ARB_texture_env_crossbar implementation. - */ - GLchan *TexelBuffer; - - validate_texture_image_func ValidateTextureImage; - - /** State used during execution of fragment programs */ - struct gl_program_machine FragProgMachine; - -} SWcontext; - - -extern void -_swrast_validate_derived( GLcontext *ctx ); - -extern void -_swrast_update_texture_samplers(GLcontext *ctx); - - -#define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context) - -#define RENDER_START(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderStart) { \ - (*(SWctx)->Driver.SpanRenderStart)(GLctx); \ - } \ - } while (0) - -#define RENDER_FINISH(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderFinish) { \ - (*(SWctx)->Driver.SpanRenderFinish)(GLctx); \ - } \ - } while (0) - - - -/** - * Size of an RGBA pixel, in bytes, for given datatype. - */ -#define RGBA_PIXEL_SIZE(TYPE) \ - ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \ - ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \ - : 4 * sizeof(GLfloat))) - - - -/* - * XXX these macros are just bandages for now in order to make - * CHAN_BITS==32 compile cleanly. - * These should probably go elsewhere at some point. - */ -#if CHAN_TYPE == GL_FLOAT -#define ChanToFixed(X) (X) -#define FixedToChan(X) (X) -#else -#define ChanToFixed(X) IntToFixed(X) -#define FixedToChan(X) FixedToInt(X) -#endif - - -/** - * For looping over fragment attributes in the pointe, line - * triangle rasterizers. - */ -#define ATTRIB_LOOP_BEGIN \ - { \ - GLuint a; \ - for (a = 0; a < swrast->_NumActiveAttribs; a++) { \ - const GLuint attr = swrast->_ActiveAttribs[a]; - -#define ATTRIB_LOOP_END } } - - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_copypix.c b/src/libs/mesa/mesa/swrast/s_copypix.c deleted file mode 100644 index fc5990b261..0000000000 --- a/src/libs/mesa/mesa/swrast/s_copypix.c +++ /dev/null @@ -1,932 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/convolve.h" -#include "main/histogram.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/pixel.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" -#include "s_stencil.h" -#include "s_zoom.h" - - - -/** - * Determine if there's overlap in an image copy. - * This test also compensates for the fact that copies are done from - * bottom to top and overlaps can sometimes be handled correctly - * without making a temporary image copy. - * \return GL_TRUE if the regions overlap, GL_FALSE otherwise. - */ -static GLboolean -regions_overlap(GLint srcx, GLint srcy, - GLint dstx, GLint dsty, - GLint width, GLint height, - GLfloat zoomX, GLfloat zoomY) -{ - if (zoomX == 1.0 && zoomY == 1.0) { - /* no zoom */ - if (srcx >= dstx + width || (srcx + width <= dstx)) { - return GL_FALSE; - } - else if (srcy < dsty) { /* this is OK */ - return GL_FALSE; - } - else if (srcy > dsty + height) { - return GL_FALSE; - } - else { - return GL_TRUE; - } - } - else { - /* add one pixel of slop when zooming, just to be safe */ - if (srcx > (dstx + ((zoomX > 0.0F) ? (width * zoomX + 1.0F) : 0.0F))) { - /* src is completely right of dest */ - return GL_FALSE; - } - else if (srcx + width + 1.0F < dstx + ((zoomX > 0.0F) ? 0.0F : (width * zoomX))) { - /* src is completely left of dest */ - return GL_FALSE; - } - else if ((srcy < dsty) && (srcy + height < dsty + (height * zoomY))) { - /* src is completely below dest */ - return GL_FALSE; - } - else if ((srcy > dsty) && (srcy + height > dsty + (height * zoomY))) { - /* src is completely above dest */ - return GL_FALSE; - } - else { - return GL_TRUE; - } - } -} - - -/** - * RGBA copypixels with convolution. - */ -static void -copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, GLint destx, GLint desty) -{ - GLint row; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLbitfield transferOps = ctx->_ImageTransferState; - const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) - || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); - GLfloat *dest, *tmpImage, *convImage; - SWspan span; - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; - - /* allocate space for GLfloat image */ - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - return; - } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - _mesa_free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - return; - } - - /* read source image as float/RGBA */ - dest = tmpImage; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, srcy + row, GL_FLOAT, dest); - dest += 4 * width; - } - - /* do the image transfer ops which preceed convolution */ - for (row = 0; row < height; row++) { - GLfloat (*rgba)[4] = (GLfloat (*)[4]) (tmpImage + row * width * 4); - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_PRE_CONVOLUTION_BITS, - width, rgba); - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - _mesa_free(tmpImage); - - /* do remaining post-convolution image transfer ops */ - for (row = 0; row < height; row++) { - GLfloat (*rgba)[4] = (GLfloat (*)[4]) (convImage + row * width * 4); - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_POST_CONVOLUTION_BITS, - width, rgba); - } - - if (!sink) { - /* write the new image */ - for (row = 0; row < height; row++) { - const GLfloat *src = convImage + row * width * 4; - GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; - - /* copy convolved colors into span array */ - _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); - - /* write span */ - span.x = destx; - span.y = desty + row; - span.end = width; - span.array->ChanType = GL_FLOAT; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } - } - /* restore this */ - span.array->ChanType = CHAN_TYPE; - } - - _mesa_free(convImage); -} - - -/** - * RGBA copypixels - */ -static void -copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, GLint destx, GLint desty) -{ - GLfloat *tmpImage, *p; - GLint sy, dy, stepy, row; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - GLint overlapping; - GLuint transferOps = ctx->_ImageTransferState; - SWspan span; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty); - return; - } - else if (ctx->Pixel.Convolution1DEnabled) { - /* make sure we don't apply 1D convolution */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - } - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be done bottom-to-top or top-to-bottom */ - if (!overlapping && srcy < desty) { - /* top-down max-to-min */ - sy = srcy + height - 1; - dy = desty + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcy; - dy = desty; - stepy = 1; - } - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ - - if (overlapping) { - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); - if (!tmpImage) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; - } - /* read the source image as RGBA/float */ - p = tmpImage; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, sy + row, GL_FLOAT, p ); - p += width * 4; - } - p = tmpImage; - } - else { - tmpImage = NULL; /* silence compiler warnings */ - p = NULL; - } - - ASSERT(width < MAX_WIDTH); - - for (row = 0; row < height; row++, sy += stepy, dy += stepy) { - GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL0]; - - /* Get row/span of source pixels */ - if (overlapping) { - /* get from buffered image */ - _mesa_memcpy(rgba, p, width * sizeof(GLfloat) * 4); - p += width * 4; - } - else { - /* get from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, sy, GL_FLOAT, rgba ); - } - - if (transferOps) { - _mesa_apply_rgba_transfer_ops(ctx, transferOps, width, - (GLfloat (*)[4]) rgba); - } - - /* Write color span */ - span.x = destx; - span.y = dy; - span.end = width; - span.array->ChanType = GL_FLOAT; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } - } - - span.array->ChanType = CHAN_TYPE; /* restore */ - - if (overlapping) - _mesa_free(tmpImage); -} - - -static void -copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, - GLint destx, GLint desty ) -{ - GLuint *tmpImage,*p; - GLint sy, dy, stepy; - GLint j; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - GLint overlapping; - SWspan span; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_INDEX; - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be bottom-to-top or top-to-bottom */ - if (!overlapping && srcy < desty) { - /* top-down max-to-min */ - sy = srcy + height - 1; - dy = desty + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcy; - dy = desty; - stepy = 1; - } - - if (overlapping) { - GLint ssy = sy; - tmpImage = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!tmpImage) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; - } - /* read the image */ - p = tmpImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, ssy, p ); - p += width; - } - p = tmpImage; - } - else { - tmpImage = NULL; /* silence compiler warning */ - p = NULL; - } - - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - /* Get color indexes */ - if (overlapping) { - _mesa_memcpy(span.array->index, p, width * sizeof(GLuint)); - p += width; - } - else { - _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, sy, span.array->index ); - } - - if (ctx->_ImageTransferState) - _mesa_apply_ci_transfer_ops(ctx, ctx->_ImageTransferState, - width, span.array->index); - - /* write color indexes */ - span.x = destx; - span.y = dy; - span.end = width; - if (zoom) - _swrast_write_zoomed_index_span(ctx, destx, desty, &span); - else - _swrast_write_index_span(ctx, &span); - } - - if (overlapping) - _mesa_free(tmpImage); -} - - -/** - * Convert floating point Z values to integer Z values with pixel transfer's - * Z scale and bias. - */ -static void -scale_and_bias_z(GLcontext *ctx, GLuint width, - const GLfloat depth[], GLuint z[]) -{ - const GLuint depthMax = ctx->DrawBuffer->_DepthMax; - GLuint i; - - if (depthMax <= 0xffffff && - ctx->Pixel.DepthScale == 1.0 && - ctx->Pixel.DepthBias == 0.0) { - /* no scale or bias and no clamping and no worry of overflow */ - const GLfloat depthMaxF = ctx->DrawBuffer->_DepthMaxF; - for (i = 0; i < width; i++) { - z[i] = (GLuint) (depth[i] * depthMaxF); - } - } - else { - /* need to be careful with overflow */ - const GLdouble depthMaxF = ctx->DrawBuffer->_DepthMaxF; - for (i = 0; i < width; i++) { - GLdouble d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias; - d = CLAMP(d, 0.0, 1.0) * depthMaxF; - if (d >= depthMaxF) - z[i] = depthMax; - else - z[i] = (GLuint) d; - } - } -} - - - -/* - * TODO: Optimize!!!! - */ -static void -copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, - GLint destx, GLint desty ) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct gl_renderbuffer *readRb = fb->_DepthBuffer; - GLfloat *p, *tmpImage; - GLint sy, dy, stepy; - GLint j; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - GLint overlapping; - SWspan span; - - if (!readRb) { - /* no readbuffer - OK */ - return; - } - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_Z; - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be bottom-to-top or top-to-bottom */ - if (!overlapping && srcy < desty) { - /* top-down max-to-min */ - sy = srcy + height - 1; - dy = desty + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcy; - dy = desty; - stepy = 1; - } - - if (overlapping) { - GLint ssy = sy; - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; - } - p = tmpImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_depth_span_float(ctx, readRb, width, srcx, ssy, p); - p += width; - } - p = tmpImage; - } - else { - tmpImage = NULL; /* silence compiler warning */ - p = NULL; - } - - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - GLfloat depth[MAX_WIDTH]; - /* get depth values */ - if (overlapping) { - _mesa_memcpy(depth, p, width * sizeof(GLfloat)); - p += width; - } - else { - _swrast_read_depth_span_float(ctx, readRb, width, srcx, sy, depth); - } - - /* apply scale and bias */ - scale_and_bias_z(ctx, width, depth, span.array->z); - - /* write depth values */ - span.x = destx; - span.y = dy; - span.end = width; - if (fb->Visual.rgbMode) { - if (zoom) - _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); - else - _swrast_write_rgba_span(ctx, &span); - } - else { - if (zoom) - _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); - else - _swrast_write_index_span(ctx, &span); - } - } - - if (overlapping) - _mesa_free(tmpImage); -} - - - -static void -copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, - GLint destx, GLint desty ) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - GLint sy, dy, stepy; - GLint j; - GLstencil *p, *tmpImage; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - GLint overlapping; - - if (!rb) { - /* no readbuffer - OK */ - return; - } - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be bottom-to-top or top-to-bottom */ - if (!overlapping && srcy < desty) { - /* top-down max-to-min */ - sy = srcy + height - 1; - dy = desty + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcy; - dy = desty; - stepy = 1; - } - - if (overlapping) { - GLint ssy = sy; - tmpImage = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); - if (!tmpImage) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; - } - p = tmpImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_stencil_span( ctx, rb, width, srcx, ssy, p ); - p += width; - } - p = tmpImage; - } - else { - tmpImage = NULL; /* silence compiler warning */ - p = NULL; - } - - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - GLstencil stencil[MAX_WIDTH]; - - /* Get stencil values */ - if (overlapping) { - _mesa_memcpy(stencil, p, width * sizeof(GLstencil)); - p += width; - } - else { - _swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil ); - } - - _mesa_apply_stencil_transfer_ops(ctx, width, stencil); - - /* Write stencil values */ - if (zoom) { - _swrast_write_zoomed_stencil_span(ctx, destx, desty, width, - destx, dy, stencil); - } - else { - _swrast_write_stencil_span( ctx, width, destx, dy, stencil ); - } - } - - if (overlapping) - _mesa_free(tmpImage); -} - - -/** - * This isn't terribly efficient. If a driver really has combined - * depth/stencil buffers the driver should implement an optimized - * CopyPixels function. - */ -static void -copy_depth_stencil_pixels(GLcontext *ctx, - const GLint srcX, const GLint srcY, - const GLint width, const GLint height, - const GLint destX, const GLint destY) -{ - struct gl_renderbuffer *stencilReadRb, *depthReadRb, *depthDrawRb; - GLint sy, dy, stepy; - GLint j; - GLstencil *tempStencilImage = NULL, *stencilPtr = NULL; - GLfloat *tempDepthImage = NULL, *depthPtr = NULL; - const GLfloat depthScale = ctx->DrawBuffer->_DepthMaxF; - const GLuint stencilMask = ctx->Stencil.WriteMask[0]; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean scaleOrBias - = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; - GLint overlapping; - - depthDrawRb = ctx->DrawBuffer->_DepthBuffer; - depthReadRb = ctx->ReadBuffer->_DepthBuffer; - stencilReadRb = ctx->ReadBuffer->_StencilBuffer; - - ASSERT(depthDrawRb); - ASSERT(depthReadRb); - ASSERT(stencilReadRb); - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcX, srcY, destX, destY, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be bottom-to-top or top-to-bottom */ - if (!overlapping && srcY < destY) { - /* top-down max-to-min */ - sy = srcY + height - 1; - dy = destY + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcY; - dy = destY; - stepy = 1; - } - - if (overlapping) { - GLint ssy = sy; - - if (stencilMask != 0x0) { - tempStencilImage - = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); - if (!tempStencilImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - return; - } - - /* get copy of stencil pixels */ - stencilPtr = tempStencilImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_stencil_span(ctx, stencilReadRb, - width, srcX, ssy, stencilPtr); - stencilPtr += width; - } - stencilPtr = tempStencilImage; - } - - if (ctx->Depth.Mask) { - tempDepthImage - = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); - if (!tempDepthImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - _mesa_free(tempStencilImage); - return; - } - - /* get copy of depth pixels */ - depthPtr = tempDepthImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_depth_span_float(ctx, depthReadRb, - width, srcX, ssy, depthPtr); - depthPtr += width; - } - depthPtr = tempDepthImage; - } - } - - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - if (stencilMask != 0x0) { - GLstencil stencil[MAX_WIDTH]; - - /* Get stencil values */ - if (overlapping) { - _mesa_memcpy(stencil, stencilPtr, width * sizeof(GLstencil)); - stencilPtr += width; - } - else { - _swrast_read_stencil_span(ctx, stencilReadRb, - width, srcX, sy, stencil); - } - - _mesa_apply_stencil_transfer_ops(ctx, width, stencil); - - /* Write values */ - if (zoom) { - _swrast_write_zoomed_stencil_span(ctx, destX, destY, width, - destX, dy, stencil); - } - else { - _swrast_write_stencil_span( ctx, width, destX, dy, stencil ); - } - } - - if (ctx->Depth.Mask) { - GLfloat depth[MAX_WIDTH]; - GLuint zVals32[MAX_WIDTH]; - GLushort zVals16[MAX_WIDTH]; - GLvoid *zVals; - GLuint zBytes; - - /* get depth values */ - if (overlapping) { - _mesa_memcpy(depth, depthPtr, width * sizeof(GLfloat)); - depthPtr += width; - } - else { - _swrast_read_depth_span_float(ctx, depthReadRb, - width, srcX, sy, depth); - } - - /* scale & bias */ - if (scaleOrBias) { - _mesa_scale_and_bias_depth(ctx, width, depth); - } - /* convert to integer Z values */ - if (depthDrawRb->DataType == GL_UNSIGNED_SHORT) { - GLint k; - for (k = 0; k < width; k++) - zVals16[k] = (GLushort) (depth[k] * depthScale); - zVals = zVals16; - zBytes = 2; - } - else { - GLint k; - for (k = 0; k < width; k++) - zVals32[k] = (GLuint) (depth[k] * depthScale); - zVals = zVals32; - zBytes = 4; - } - - /* Write values */ - if (zoom) { - _swrast_write_zoomed_z_span(ctx, destX, destY, width, - destX, dy, zVals); - } - else { - _swrast_put_row(ctx, depthDrawRb, width, destX, dy, zVals, zBytes); - } - } - } - - if (tempStencilImage) - _mesa_free(tempStencilImage); - - if (tempDepthImage) - _mesa_free(tempDepthImage); -} - - - -/** - * Try to do a fast copy pixels. - */ -static GLboolean -fast_copy_pixels(GLcontext *ctx, - GLint srcX, GLint srcY, GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) -{ - struct gl_framebuffer *srcFb = ctx->ReadBuffer; - struct gl_framebuffer *dstFb = ctx->DrawBuffer; - struct gl_renderbuffer *srcRb, *dstRb; - GLint row, yStep; - - if (SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 || - ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - ctx->_ImageTransferState) { - /* can't handle these */ - return GL_FALSE; - } - - if (type == GL_COLOR) { - if (dstFb->_NumColorDrawBuffers != 1) - return GL_FALSE; - srcRb = srcFb->_ColorReadBuffer; - dstRb = dstFb->_ColorDrawBuffers[0]; - } - else if (type == GL_STENCIL) { - srcRb = srcFb->_StencilBuffer; - dstRb = dstFb->_StencilBuffer; - } - else if (type == GL_DEPTH) { - srcRb = srcFb->_DepthBuffer; - dstRb = dstFb->_DepthBuffer; - } - else { - ASSERT(type == GL_DEPTH_STENCIL_EXT); - /* XXX correct? */ - srcRb = srcFb->Attachment[BUFFER_DEPTH].Renderbuffer; - dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer; - } - - /* src and dst renderbuffers must be same format and type */ - if (!srcRb || !dstRb || - srcRb->DataType != dstRb->DataType || - srcRb->_BaseFormat != dstRb->_BaseFormat) { - return GL_FALSE; - } - - /* clipping not supported */ - if (srcX < 0 || srcX + width > (GLint) srcFb->Width || - srcY < 0 || srcY + height > (GLint) srcFb->Height || - dstX < dstFb->_Xmin || dstX + width > dstFb->_Xmax || - dstY < dstFb->_Ymin || dstY + height > dstFb->_Ymax) { - return GL_FALSE; - } - - /* overlapping src/dst doesn't matter, just determine Y direction */ - if (srcY < dstY) { - /* top-down max-to-min */ - srcY = srcY + height - 1; - dstY = dstY + height - 1; - yStep = -1; - } - else { - /* bottom-up min-to-max */ - yStep = 1; - } - - for (row = 0; row < height; row++) { - GLuint temp[MAX_WIDTH][4]; - srcRb->GetRow(ctx, srcRb, width, srcX, srcY, temp); - dstRb->PutRow(ctx, dstRb, width, dstX, dstY, temp, NULL); - srcY += yStep; - dstY += yStep; - } - - return GL_TRUE; -} - - -/** - * Do software-based glCopyPixels. - * By time we get here, all parameters will have been error-checked. - */ -void -_swrast_CopyPixels( GLcontext *ctx, - GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLint destx, GLint desty, GLenum type ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - RENDER_START(swrast,ctx); - - if (swrast->NewState) - _swrast_validate_derived( ctx ); - - if (!fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type)) { - switch (type) { - case GL_COLOR: - if (ctx->Visual.rgbMode) { - copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty ); - } - else { - copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty ); - } - break; - case GL_DEPTH: - copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty ); - break; - case GL_STENCIL: - copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty ); - break; - case GL_DEPTH_STENCIL_EXT: - copy_depth_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty); - break; - default: - _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels"); - } - } - - RENDER_FINISH(swrast,ctx); -} diff --git a/src/libs/mesa/mesa/swrast/s_depth.c b/src/libs/mesa/mesa/swrast/s_depth.c deleted file mode 100644 index 26e23f02d5..0000000000 --- a/src/libs/mesa/mesa/swrast/s_depth.c +++ /dev/null @@ -1,1429 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2.1 - * - * Copyright (C) 1999-2008 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/fbobject.h" - -#include "s_depth.h" -#include "s_context.h" -#include "s_span.h" - - -/** - * Do depth test for a horizontal span of fragments. - * Input: zbuffer - array of z values in the zbuffer - * z - array of fragment z values - * Return: number of fragments which pass the test. - */ -static GLuint -depth_test_span16( GLcontext *ctx, GLuint n, - GLushort zbuffer[], const GLuint z[], GLubyte mask[] ) -{ - GLuint passed = 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; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;i= zbuffer[i]) { - zbuffer[i] = z[i]; - passed++; - } - else { - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0;i= zbuffer[i]) { - /* pass */ - passed++; - } - else { - mask[i] = 0; - } - } - } - } - break; - case GL_GREATER: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;i zbuffer[i]) { - zbuffer[i] = z[i]; - passed++; - } - else { - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0;i zbuffer[i]) { - /* pass */ - passed++; - } - else { - mask[i] = 0; - } - } - } - } - break; - case GL_NOTEQUAL: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Func) { - case GL_LESS: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;i= zbuffer[i]) { - zbuffer[i] = z[i]; - passed++; - } - else { - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0;i= zbuffer[i]) { - /* pass */ - passed++; - } - else { - mask[i] = 0; - } - } - } - } - break; - case GL_GREATER: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;i zbuffer[i]) { - zbuffer[i] = z[i]; - passed++; - } - else { - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0;i zbuffer[i]) { - /* pass */ - passed++; - } - else { - mask[i] = 0; - } - } - } - } - break; - case GL_NOTEQUAL: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0;iDrawBuffer; - struct gl_renderbuffer *rb = fb->_DepthBuffer; - const GLint x = span->x; - const GLint y = span->y; - const GLuint count = span->end; - const GLuint *zValues = span->array->z; - GLubyte *mask = span->array->mask; - GLuint passed; - - ASSERT((span->arrayMask & SPAN_XY) == 0); - ASSERT(span->arrayMask & SPAN_Z); - - if (rb->GetPointer(ctx, rb, 0, 0)) { - /* Directly access buffer */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort *zbuffer = (GLushort *) rb->GetPointer(ctx, rb, x, y); - passed = depth_test_span16(ctx, count, zbuffer, zValues, mask); - } - else { - GLuint *zbuffer = (GLuint *) rb->GetPointer(ctx, rb, x, y); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - passed = depth_test_span32(ctx, count, zbuffer, zValues, mask); - } - } - else { - /* read depth values from buffer, test, write back */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort zbuffer[MAX_WIDTH]; - rb->GetRow(ctx, rb, count, x, y, zbuffer); - passed = depth_test_span16(ctx, count, zbuffer, zValues, mask); - rb->PutRow(ctx, rb, count, x, y, zbuffer, mask); - } - else { - GLuint zbuffer[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, count, x, y, zbuffer); - passed = depth_test_span32(ctx, count, zbuffer, zValues, mask); - rb->PutRow(ctx, rb, count, x, y, zbuffer, mask); - } - } - - if (passed < count) { - span->writeAll = GL_FALSE; - } - return passed; -} - - - -#define Z_ADDRESS(X, Y) (zStart + (Y) * stride + (X)) - - -/* - * Do depth testing for an array of fragments at assorted locations. - */ -static void -direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride, - GLuint n, const GLint x[], const GLint y[], - const GLuint z[], GLubyte mask[] ) -{ - /* 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; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i= *zptr) { - /* pass */ - *zptr = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i= *zptr) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_GREATER: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i *zptr) { - /* pass */ - *zptr = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i *zptr) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_NOTEQUAL: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Func) { - case GL_LESS: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i= *zptr) { - /* pass */ - *zptr = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i= *zptr) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_GREATER: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i *zptr) { - /* pass */ - *zptr = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i *zptr) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_NOTEQUAL: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDrawBuffer; - struct gl_renderbuffer *rb = fb->_DepthBuffer; - const GLuint count = span->end; - const GLint *x = span->array->x; - const GLint *y = span->array->y; - const GLuint *z = span->array->z; - GLubyte *mask = span->array->mask; - - if (rb->GetPointer(ctx, rb, 0, 0)) { - /* Directly access values */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort *zStart = (GLushort *) rb->Data; - GLuint stride = rb->Width; - direct_depth_test_pixels16(ctx, zStart, stride, count, x, y, z, mask); - } - else { - GLuint *zStart = (GLuint *) rb->Data; - GLuint stride = rb->Width; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - direct_depth_test_pixels32(ctx, zStart, stride, count, x, y, z, mask); - } - } - else { - /* read depth values from buffer, test, write back */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort zbuffer[MAX_WIDTH]; - _swrast_get_values(ctx, rb, count, x, y, zbuffer, sizeof(GLushort)); - depth_test_span16(ctx, count, zbuffer, z, mask); - rb->PutValues(ctx, rb, count, x, y, zbuffer, mask); - } - else { - GLuint zbuffer[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - _swrast_get_values(ctx, rb, count, x, y, zbuffer, sizeof(GLuint)); - depth_test_span32(ctx, count, zbuffer, z, mask); - rb->PutValues(ctx, rb, count, x, y, zbuffer, mask); - } - } - - return count; /* not really correct, but OK */ -} - - -/** - * Apply depth (Z) buffer testing to the span. - * \return approx number of pixels that passed (only zero is reliable) - */ -GLuint -_swrast_depth_test_span( GLcontext *ctx, SWspan *span) -{ - if (span->arrayMask & SPAN_XY) - return depth_test_pixels(ctx, span); - else - return depth_test_span(ctx, span); -} - - -/** - * GL_EXT_depth_bounds_test extension. - * Discard fragments depending on whether the corresponding Z-buffer - * values are outside the depth bounds test range. - * Note: we test the Z buffer values, not the fragment Z values! - * \return GL_TRUE if any fragments pass, GL_FALSE if no fragments pass - */ -GLboolean -_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_DepthBuffer; - GLuint zMin = (GLuint) (ctx->Depth.BoundsMin * fb->_DepthMaxF + 0.5F); - GLuint zMax = (GLuint) (ctx->Depth.BoundsMax * fb->_DepthMaxF + 0.5F); - GLubyte *mask = span->array->mask; - const GLuint count = span->end; - GLuint i; - GLboolean anyPass = GL_FALSE; - - if (rb->DataType == GL_UNSIGNED_SHORT) { - /* get 16-bit values */ - GLushort zbuffer16[MAX_WIDTH], *zbuffer; - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, count, span->array->x, span->array->y, - zbuffer16, sizeof(GLushort)); - zbuffer = zbuffer16; - } - else { - zbuffer = (GLushort*) rb->GetPointer(ctx, rb, span->x, span->y); - if (!zbuffer) { - rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer16); - zbuffer = zbuffer16; - } - } - assert(zbuffer); - - /* Now do the tests */ - for (i = 0; i < count; i++) { - if (mask[i]) { - if (zbuffer[i] < zMin || zbuffer[i] > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } - } - else { - /* get 32-bit values */ - GLuint zbuffer32[MAX_WIDTH], *zbuffer; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, count, span->array->x, span->array->y, - zbuffer32, sizeof(GLuint)); - zbuffer = zbuffer32; - } - else { - zbuffer = (GLuint*) rb->GetPointer(ctx, rb, span->x, span->y); - if (!zbuffer) { - rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer32); - zbuffer = zbuffer32; - } - } - assert(zbuffer); - - /* Now do the tests */ - for (i = 0; i < count; i++) { - if (mask[i]) { - if (zbuffer[i] < zMin || zbuffer[i] > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } - } - - return anyPass; -} - - - -/**********************************************************************/ -/***** Read Depth Buffer *****/ -/**********************************************************************/ - - -/** - * Read a span of depth values from the given depth renderbuffer, returning - * the values as GLfloats. - * This function does clipping to prevent reading outside the depth buffer's - * bounds. Though the clipping is redundant when we're called from - * _swrast_ReadPixels. - */ -void -_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLfloat depth[] ) -{ - const GLfloat scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; - - if (!rb) { - /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLfloat)); - } - - ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); - - if (y < 0 || y >= (GLint) rb->Height || - x + n <= 0 || x >= (GLint) rb->Width) { - /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); - return; - } - - if (x < 0) { - GLint dx = -x; - GLint i; - for (i = 0; i < dx; i++) - depth[i] = 0.0; - x = 0; - n -= dx; - depth += dx; - } - if (x + n > (GLint) rb->Width) { - GLint dx = x + n - (GLint) rb->Width; - GLint i; - for (i = 0; i < dx; i++) - depth[n - i - 1] = 0.0; - n -= dx; - } - if (n <= 0) { - return; - } - - if (rb->DataType == GL_UNSIGNED_INT) { - GLuint temp[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, n, x, y, temp); - for (i = 0; i < n; i++) { - depth[i] = temp[i] * scale; - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort temp[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, n, x, y, temp); - for (i = 0; i < n; i++) { - depth[i] = temp[i] * scale; - } - } - else { - _mesa_problem(ctx, "Invalid depth renderbuffer data type"); - } -} - - -/** - * As above, but return 32-bit GLuint values. - */ -void -_swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLuint depth[] ) -{ - if (!rb) { - /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLfloat)); - } - - ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); - - if (y < 0 || y >= (GLint) rb->Height || - x + n <= 0 || x >= (GLint) rb->Width) { - /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); - return; - } - - if (x < 0) { - GLint dx = -x; - GLint i; - for (i = 0; i < dx; i++) - depth[i] = 0; - x = 0; - n -= dx; - depth += dx; - } - if (x + n > (GLint) rb->Width) { - GLint dx = x + n - (GLint) rb->Width; - GLint i; - for (i = 0; i < dx; i++) - depth[n - i - 1] = 0; - n -= dx; - } - if (n <= 0) { - return; - } - - if (rb->DataType == GL_UNSIGNED_INT) { - rb->GetRow(ctx, rb, n, x, y, depth); - if (rb->DepthBits < 32) { - GLuint shift = 32 - rb->DepthBits; - GLint i; - for (i = 0; i < n; i++) { - GLuint z = depth[i]; - depth[i] = z << shift; /* XXX lsb bits? */ - } - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort temp[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, n, x, y, temp); - if (rb->DepthBits == 16) { - for (i = 0; i < n; i++) { - GLuint z = temp[i]; - depth[i] = (z << 16) | z; - } - } - else { - GLuint shift = 16 - rb->DepthBits; - for (i = 0; i < n; i++) { - GLuint z = temp[i]; - depth[i] = (z << (shift + 16)) | (z << shift); /* XXX lsb bits? */ - } - } - } - else { - _mesa_problem(ctx, "Invalid depth renderbuffer data type"); - } -} - - - -/** - * Clear the given z/depth renderbuffer. - */ -void -_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) -{ - GLuint clearValue; - GLint x, y, width, height; - - if (!rb || !ctx->Depth.Mask) { - /* no depth buffer, or writing to it is disabled */ - return; - } - - /* compute integer clearing value */ - if (ctx->Depth.Clear == 1.0) { - clearValue = ctx->DrawBuffer->_DepthMax; - } - else { - clearValue = (GLuint) (ctx->Depth.Clear * ctx->DrawBuffer->_DepthMaxF); - } - - assert(rb->_BaseFormat == GL_DEPTH_COMPONENT); - - /* compute region to clear */ - x = ctx->DrawBuffer->_Xmin; - y = ctx->DrawBuffer->_Ymin; - width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - - if (rb->GetPointer(ctx, rb, 0, 0)) { - /* Direct buffer access is possible. Either this is just malloc'd - * memory, or perhaps the driver mmap'd the zbuffer memory. - */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - if ((clearValue & 0xff) == ((clearValue >> 8) & 0xff) && - ((GLushort *) rb->GetPointer(ctx, rb, 0, 0) + width == - (GLushort *) rb->GetPointer(ctx, rb, 0, 1))) { - /* optimized case */ - GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y); - GLuint len = width * height * sizeof(GLushort); - _mesa_memset(dst, (clearValue & 0xff), len); - } - else { - /* general case */ - GLint i, j; - for (i = 0; i < height; i++) { - GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y + i); - for (j = 0; j < width; j++) { - dst[j] = clearValue; - } - } - } - } - else { - GLint i, j; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - for (i = 0; i < height; i++) { - GLuint *dst = (GLuint *) rb->GetPointer(ctx, rb, x, y + i); - for (j = 0; j < width; j++) { - dst[j] = clearValue; - } - } - } - } - else { - /* Direct access not possible. Use PutRow to write new values. */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort clearVal16 = (GLushort) (clearValue & 0xffff); - GLint i; - for (i = 0; i < height; i++) { - rb->PutMonoRow(ctx, rb, width, x, y + i, &clearVal16, NULL); - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - GLint i; - ASSERT(sizeof(clearValue) == sizeof(GLuint)); - for (i = 0; i < height; i++) { - rb->PutMonoRow(ctx, rb, width, x, y + i, &clearValue, NULL); - } - } - else { - _mesa_problem(ctx, "bad depth renderbuffer DataType"); - } - } -} diff --git a/src/libs/mesa/mesa/swrast/s_depth.h b/src/libs/mesa/mesa/swrast/s_depth.h deleted file mode 100644 index 3688625683..0000000000 --- a/src/libs/mesa/mesa/swrast/s_depth.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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 S_DEPTH_H -#define S_DEPTH_H - - -#include "s_context.h" - - -extern GLuint -_swrast_depth_test_span( GLcontext *ctx, SWspan *span); - - -extern GLboolean -_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ); - - -extern void -_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLfloat depth[] ); - - -extern void -_swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLuint depth[] ); - - -extern void -_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_drawpix.c b/src/libs/mesa/mesa/swrast/s_drawpix.c deleted file mode 100644 index 7af3e3dad1..0000000000 --- a/src/libs/mesa/mesa/swrast/s_drawpix.c +++ /dev/null @@ -1,938 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/convolve.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/pixel.h" -#include "main/state.h" - -#include "s_context.h" -#include "s_span.h" -#include "s_stencil.h" -#include "s_zoom.h" - - - -/** - * Try to do a fast and simple RGB(a) glDrawPixels. - * Return: GL_TRUE if success, GL_FALSE if slow path must be used instead - */ -static GLboolean -fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *userUnpack, - const GLvoid *pixels) -{ - const GLint imgX = x, imgY = y; - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - GLenum rbType; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - SWspan span; - GLboolean simpleZoom; - GLint yStep; /* +1 or -1 */ - struct gl_pixelstore_attrib unpack; - GLint destX, destY, drawWidth, drawHeight; /* post clipping */ - - if (!rb) - return GL_TRUE; /* no-op */ - - rbType = rb->DataType; - - if ((swrast->_RasterMask & ~CLIP_BIT) || - ctx->Texture._EnabledCoordUnits || - userUnpack->SwapBytes || - ctx->_ImageTransferState) { - /* can't handle any of those conditions */ - return GL_FALSE; - } - - INIT_SPAN(span, GL_BITMAP); - span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; - _swrast_span_default_attribs(ctx, &span); - - /* copy input params since clipping may change them */ - unpack = *userUnpack; - destX = x; - destY = y; - drawWidth = width; - drawHeight = height; - - /* check for simple zooming and clipping */ - if (ctx->Pixel.ZoomX == 1.0F && - (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)) { - if (!_mesa_clip_drawpixels(ctx, &destX, &destY, - &drawWidth, &drawHeight, &unpack)) { - /* image was completely clipped: no-op, all done */ - return GL_TRUE; - } - simpleZoom = GL_TRUE; - yStep = (GLint) ctx->Pixel.ZoomY; - ASSERT(yStep == 1 || yStep == -1); - } - else { - /* non-simple zooming */ - simpleZoom = GL_FALSE; - yStep = 1; - if (unpack.RowLength == 0) - unpack.RowLength = width; - } - - /* - * Ready to draw! - */ - - if (format == GL_RGBA && type == rbType) { - const GLubyte *src - = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width, - height, format, type, 0, 0); - const GLint srcStride = _mesa_image_row_stride(&unpack, width, - format, type); - if (simpleZoom) { - GLint row; - for (row = 0; row < drawHeight; row++) { - rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL); - src += srcStride; - destY += yStep; - } - } - else { - /* with zooming */ - GLint row; - for (row = 0; row < drawHeight; row++) { - span.x = destX; - span.y = destY + row; - span.end = drawWidth; - span.array->ChanType = rbType; - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, src); - src += srcStride; - } - span.array->ChanType = CHAN_TYPE; - } - return GL_TRUE; - } - - if (format == GL_RGB && type == rbType) { - const GLubyte *src - = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width, - height, format, type, 0, 0); - const GLint srcStride = _mesa_image_row_stride(&unpack, width, - format, type); - if (simpleZoom) { - GLint row; - for (row = 0; row < drawHeight; row++) { - rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); - src += srcStride; - destY += yStep; - } - } - else { - /* with zooming */ - GLint row; - for (row = 0; row < drawHeight; row++) { - span.x = destX; - span.y = destY; - span.end = drawWidth; - span.array->ChanType = rbType; - _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, src); - src += srcStride; - destY++; - } - span.array->ChanType = CHAN_TYPE; - } - return GL_TRUE; - } - - /* Remaining cases haven't been tested with alignment != 1 */ - if (userUnpack->Alignment != 1) - return GL_FALSE; - - if (format == GL_LUMINANCE && type == CHAN_TYPE && rbType == CHAN_TYPE) { - const GLchan *src = (const GLchan *) pixels - + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels); - if (simpleZoom) { - /* no zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row = 0; row < drawHeight; row++) { - GLchan rgb[MAX_WIDTH][3]; - GLint i; - for (i = 0;iPutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL); - src += unpack.RowLength; - destY += yStep; - } - } - else { - /* with zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row = 0; row < drawHeight; row++) { - GLchan rgb[MAX_WIDTH][3]; - GLint i; - for (i = 0;irgba[i][0] = *ptr; - span.array->rgba[i][1] = *ptr; - span.array->rgba[i][2] = *ptr++; - span.array->rgba[i][3] = *ptr++; - } - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba, NULL); - src += unpack.RowLength*2; - destY += yStep; - } - } - else { - /* with zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row = 0; row < drawHeight; row++) { - const GLchan *ptr = src; - GLint i; - for (i = 0;irgba[i][0] = *ptr; - span.array->rgba[i][1] = *ptr; - span.array->rgba[i][2] = *ptr++; - span.array->rgba[i][3] = *ptr++; - } - span.x = destX; - span.y = destY; - span.end = drawWidth; - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - span.array->rgba); - src += unpack.RowLength*2; - destY++; - } - } - return GL_TRUE; - } - - if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) { - const GLubyte *src = (const GLubyte *) pixels - + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels; - if (ctx->Visual.rgbMode && rbType == GL_UNSIGNED_BYTE) { - /* convert ubyte/CI data to ubyte/RGBA */ - if (simpleZoom) { - GLint row; - for (row = 0; row < drawHeight; row++) { - ASSERT(drawWidth <= MAX_WIDTH); - _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, - span.array->rgba8); - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba8, NULL); - src += unpack.RowLength; - destY += yStep; - } - } - else { - /* ubyte/CI to ubyte/RGBA with zooming */ - GLint row; - for (row = 0; row < drawHeight; row++) { - ASSERT(drawWidth <= MAX_WIDTH); - _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, - span.array->rgba8); - span.x = destX; - span.y = destY; - span.end = drawWidth; - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - span.array->rgba8); - src += unpack.RowLength; - destY++; - } - } - return GL_TRUE; - } - else if (!ctx->Visual.rgbMode && rbType == GL_UNSIGNED_INT) { - /* write CI data to CI frame buffer */ - GLint row; - if (simpleZoom) { - for (row = 0; row < drawHeight; row++) { - GLuint index32[MAX_WIDTH]; - GLint col; - for (col = 0; col < drawWidth; col++) - index32[col] = src[col]; - rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL); - src += unpack.RowLength; - destY += yStep; - } - return GL_TRUE; - } - } - } - - /* can't handle this pixel format and/or data type */ - return GL_FALSE; -} - - - -/* - * Draw color index image. - */ -static void -draw_index_pixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - const GLint imgX = x, imgY = y; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - GLint row, skipPixels; - SWspan span; - - INIT_SPAN(span, GL_BITMAP); - span.arrayMask = SPAN_INDEX; - _swrast_span_default_attribs(ctx, &span); - - /* - * General solution - */ - skipPixels = 0; - while (skipPixels < width) { - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - ASSERT(spanWidth <= MAX_WIDTH); - for (row = 0; row < height; row++) { - const GLvoid *source = _mesa_image_address2d(unpack, pixels, - width, height, - GL_COLOR_INDEX, type, - row, skipPixels); - _mesa_unpack_index_span(ctx, spanWidth, GL_UNSIGNED_INT, - span.array->index, type, source, unpack, - ctx->_ImageTransferState); - - /* These may get changed during writing/clipping */ - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - - if (zoom) - _swrast_write_zoomed_index_span(ctx, imgX, imgY, &span); - else - _swrast_write_index_span(ctx, &span); - } - skipPixels += spanWidth; - } -} - - - -/* - * Draw stencil image. - */ -static void -draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - GLint skipPixels; - - /* if width > MAX_WIDTH, have to process image in chunks */ - skipPixels = 0; - while (skipPixels < width) { - const GLint spanX = x + skipPixels; - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - GLint row; - for (row = 0; row < height; row++) { - const GLint spanY = y + row; - GLstencil values[MAX_WIDTH]; - GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte)) - ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; - const GLvoid *source = _mesa_image_address2d(unpack, pixels, - width, height, - GL_COLOR_INDEX, type, - row, skipPixels); - _mesa_unpack_stencil_span(ctx, spanWidth, destType, values, - type, source, unpack, - ctx->_ImageTransferState); - if (zoom) { - _swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth, - spanX, spanY, values); - } - else { - _swrast_write_stencil_span(ctx, spanWidth, spanX, spanY, values); - } - } - skipPixels += spanWidth; - } -} - - -/* - * Draw depth image. - */ -static void -draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - const GLboolean scaleOrBias - = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - SWspan span; - - INIT_SPAN(span, GL_BITMAP); - span.arrayMask = SPAN_Z; - _swrast_span_default_attribs(ctx, &span); - - if (type == GL_UNSIGNED_SHORT - && ctx->DrawBuffer->Visual.depthBits == 16 - && !scaleOrBias - && !zoom - && ctx->Visual.rgbMode - && width <= MAX_WIDTH - && !unpack->SwapBytes) { - /* Special case: directly write 16-bit depth values */ - GLint row; - for (row = 0; row < height; row++) { - const GLushort *zSrc = (const GLushort *) - _mesa_image_address2d(unpack, pixels, width, height, - GL_DEPTH_COMPONENT, type, row, 0); - GLint i; - for (i = 0; i < width; i++) - span.array->z[i] = zSrc[i]; - span.x = x; - span.y = y + row; - span.end = width; - _swrast_write_rgba_span(ctx, &span); - } - } - else if (type == GL_UNSIGNED_INT - && !scaleOrBias - && !zoom - && ctx->Visual.rgbMode - && width <= MAX_WIDTH - && !unpack->SwapBytes) { - /* Special case: shift 32-bit values down to Visual.depthBits */ - const GLint shift = 32 - ctx->DrawBuffer->Visual.depthBits; - GLint row; - for (row = 0; row < height; row++) { - const GLuint *zSrc = (const GLuint *) - _mesa_image_address2d(unpack, pixels, width, height, - GL_DEPTH_COMPONENT, type, row, 0); - if (shift == 0) { - _mesa_memcpy(span.array->z, zSrc, width * sizeof(GLuint)); - } - else { - GLint col; - for (col = 0; col < width; col++) - span.array->z[col] = zSrc[col] >> shift; - } - span.x = x; - span.y = y + row; - span.end = width; - _swrast_write_rgba_span(ctx, &span); - } - } - else { - /* General case */ - const GLuint depthMax = ctx->DrawBuffer->_DepthMax; - GLint skipPixels = 0; - - /* in case width > MAX_WIDTH do the copy in chunks */ - while (skipPixels < width) { - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - GLint row; - ASSERT(span.end <= MAX_WIDTH); - for (row = 0; row < height; row++) { - const GLvoid *zSrc = _mesa_image_address2d(unpack, - pixels, width, height, - GL_DEPTH_COMPONENT, type, - row, skipPixels); - - /* Set these for each row since the _swrast_write_* function may - * change them while clipping. - */ - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - - _mesa_unpack_depth_span(ctx, spanWidth, - GL_UNSIGNED_INT, span.array->z, depthMax, - type, zSrc, unpack); - if (zoom) { - _swrast_write_zoomed_depth_span(ctx, x, y, &span); - } - else if (ctx->Visual.rgbMode) { - _swrast_write_rgba_span(ctx, &span); - } - else { - _swrast_write_index_span(ctx, &span); - } - } - skipPixels += spanWidth; - } - } -} - - - -/** - * Draw RGBA image. - */ -static void -draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - const GLint imgX = x, imgY = y; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - GLfloat *convImage = NULL; - GLbitfield transferOps = ctx->_ImageTransferState; - SWspan span; - - /* Try an optimized glDrawPixels first */ - if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type, - unpack, pixels)) { - return; - } - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ - - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - /* Convolution has to be handled specially. We'll create an - * intermediate image, applying all pixel transfer operations - * up to convolution. Then we'll convolve the image. Then - * we'll proceed with the rest of the transfer operations and - * rasterize the image. - */ - GLint row; - GLfloat *dest, *tmpImage; - - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; - } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - _mesa_free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); - return; - } - - /* Unpack the image and apply transfer ops up to convolution */ - dest = tmpImage; - for (row = 0; row < height; row++) { - const GLvoid *source = _mesa_image_address2d(unpack, - pixels, width, height, format, type, row, 0); - _mesa_unpack_color_span_float(ctx, width, GL_RGBA, (GLfloat *) dest, - format, type, source, unpack, - transferOps & IMAGE_PRE_CONVOLUTION_BITS); - dest += width * 4; - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - _mesa_free(tmpImage); - - /* continue transfer ops and draw the convolved image */ - unpack = &ctx->DefaultPacking; - pixels = convImage; - format = GL_RGBA; - type = GL_FLOAT; - transferOps &= IMAGE_POST_CONVOLUTION_BITS; - } - else if (ctx->Pixel.Convolution1DEnabled) { - /* we only want to apply 1D convolution to glTexImage1D */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - } - - if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 && - ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT && - ctx->Color.ClampFragmentColor != GL_FALSE) { - /* need to clamp colors before applying fragment ops */ - transferOps |= IMAGE_CLAMP_BIT; - } - - /* - * General solution - */ - { - const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) - || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); - const GLbitfield interpMask = span.interpMask; - const GLbitfield arrayMask = span.arrayMask; - const GLint srcStride - = _mesa_image_row_stride(unpack, width, format, type); - GLint skipPixels = 0; - /* use span array for temp color storage */ - GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; - - /* if the span is wider than MAX_WIDTH we have to do it in chunks */ - while (skipPixels < width) { - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - const GLubyte *source - = (const GLubyte *) _mesa_image_address2d(unpack, pixels, - width, height, format, - type, 0, skipPixels); - GLint row; - - for (row = 0; row < height; row++) { - /* get image row as float/RGBA */ - _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba, - format, type, source, unpack, - transferOps); - /* draw the span */ - if (!sink) { - /* Set these for each row since the _swrast_write_* functions - * may change them while clipping/rendering. - */ - span.array->ChanType = GL_FLOAT; - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - span.arrayMask = arrayMask; - span.interpMask = interpMask; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } - } - - source += srcStride; - } /* for row */ - - skipPixels += spanWidth; - } /* while skipPixels < width */ - - /* XXX this is ugly/temporary, to undo above change */ - span.array->ChanType = CHAN_TYPE; - } - - if (convImage) { - _mesa_free(convImage); - } -} - - -/** - * This is a bit different from drawing GL_DEPTH_COMPONENT pixels. - * The only per-pixel operations that apply are depth scale/bias, - * stencil offset/shift, GL_DEPTH_WRITEMASK and GL_STENCIL_WRITEMASK, - * and pixel zoom. - * Also, only the depth buffer and stencil buffers are touched, not the - * color buffer(s). - */ -static void -draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) -{ - const GLint imgX = x, imgY = y; - const GLboolean scaleOrBias - = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; - const GLuint depthMax = ctx->DrawBuffer->_DepthMax; - const GLuint stencilMask = ctx->Stencil.WriteMask[0]; - const GLuint stencilType = (STENCIL_BITS == 8) ? - GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - struct gl_renderbuffer *depthRb, *stencilRb; - struct gl_pixelstore_attrib clippedUnpack = *unpack; - - if (!zoom) { - if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height, - &clippedUnpack)) { - /* totally clipped */ - return; - } - } - - depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; - stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; - ASSERT(depthRb); - ASSERT(stencilRb); - - if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT && - stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT && - depthRb == stencilRb && - !scaleOrBias && - !zoom && - ctx->Depth.Mask && - (stencilMask & 0xff) == 0xff) { - /* This is the ideal case. - * Drawing GL_DEPTH_STENCIL pixels into a combined depth/stencil buffer. - * Plus, no pixel transfer ops, zooming, or masking needed. - */ - GLint i; - for (i = 0; i < height; i++) { - const GLuint *src = (const GLuint *) - _mesa_image_address2d(&clippedUnpack, pixels, width, height, - GL_DEPTH_STENCIL_EXT, type, i, 0); - depthRb->PutRow(ctx, depthRb, width, x, y + i, src, NULL); - } - } - else { - /* sub-optimal cases: - * Separate depth/stencil buffers, or pixel transfer ops required. - */ - /* XXX need to handle very wide images (skippixels) */ - GLint i; - - depthRb = ctx->DrawBuffer->_DepthBuffer; - stencilRb = ctx->DrawBuffer->_StencilBuffer; - - for (i = 0; i < height; i++) { - const GLuint *depthStencilSrc = (const GLuint *) - _mesa_image_address2d(&clippedUnpack, pixels, width, height, - GL_DEPTH_STENCIL_EXT, type, i, 0); - - if (ctx->Depth.Mask) { - if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24) { - /* fast path 24-bit zbuffer */ - GLuint zValues[MAX_WIDTH]; - GLint j; - ASSERT(depthRb->DataType == GL_UNSIGNED_INT); - for (j = 0; j < width; j++) { - zValues[j] = depthStencilSrc[j] >> 8; - } - if (zoom) - _swrast_write_zoomed_z_span(ctx, imgX, imgY, width, - x, y + i, zValues); - else - depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL); - } - else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 16) { - /* fast path 16-bit zbuffer */ - GLushort zValues[MAX_WIDTH]; - GLint j; - ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT); - for (j = 0; j < width; j++) { - zValues[j] = depthStencilSrc[j] >> 16; - } - if (zoom) - _swrast_write_zoomed_z_span(ctx, imgX, imgY, width, - x, y + i, zValues); - else - depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL); - } - else { - /* general case */ - GLuint zValues[MAX_WIDTH]; /* 16 or 32-bit Z value storage */ - _mesa_unpack_depth_span(ctx, width, - depthRb->DataType, zValues, depthMax, - type, depthStencilSrc, &clippedUnpack); - if (zoom) { - _swrast_write_zoomed_z_span(ctx, imgX, imgY, width, x, - y + i, zValues); - } - else { - depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL); - } - } - } - - if (stencilMask != 0x0) { - GLstencil stencilValues[MAX_WIDTH]; - /* get stencil values, with shift/offset/mapping */ - _mesa_unpack_stencil_span(ctx, width, stencilType, stencilValues, - type, depthStencilSrc, &clippedUnpack, - ctx->_ImageTransferState); - if (zoom) - _swrast_write_zoomed_stencil_span(ctx, imgX, imgY, width, - x, y + i, stencilValues); - else - _swrast_write_stencil_span(ctx, width, x, y + i, stencilValues); - } - } - } -} - - -/** - * Execute software-based glDrawPixels. - * By time we get here, all error checking will have been done. - */ -void -_swrast_DrawPixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - RENDER_START(swrast,ctx); - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (swrast->NewState) - _swrast_validate_derived( ctx ); - - pixels = _mesa_map_drawpix_pbo(ctx, unpack, pixels); - if (!pixels) { - RENDER_FINISH(swrast,ctx); - return; - } - - switch (format) { - case GL_STENCIL_INDEX: - draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels ); - break; - case GL_DEPTH_COMPONENT: - draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels ); - break; - case GL_COLOR_INDEX: - if (ctx->Visual.rgbMode) - draw_rgba_pixels(ctx, x,y, width, height, format, type, unpack, pixels); - else - draw_index_pixels(ctx, x, y, width, height, type, unpack, pixels); - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels); - break; - case GL_DEPTH_STENCIL_EXT: - draw_depth_stencil_pixels(ctx, x, y, width, height, - type, unpack, pixels); - break; - default: - _mesa_problem(ctx, "unexpected format in _swrast_DrawPixels"); - /* don't return yet, clean-up */ - } - - RENDER_FINISH(swrast,ctx); - - _mesa_unmap_drapix_pbo(ctx, unpack); -} - - - -#if 0 /* experimental */ -/* - * Execute glDrawDepthPixelsMESA(). - */ -void -_swrast_DrawDepthPixelsMESA( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum colorFormat, GLenum colorType, - const GLvoid *colors, - GLenum depthType, const GLvoid *depths, - const struct gl_pixelstore_attrib *unpack ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (swrast->NewState) - _swrast_validate_derived( ctx ); - - RENDER_START(swrast,ctx); - - switch (colorFormat) { - case GL_COLOR_INDEX: - if (ctx->Visual.rgbMode) - draw_rgba_pixels(ctx, x,y, width, height, colorFormat, colorType, - unpack, colors); - else - draw_index_pixels(ctx, x, y, width, height, colorType, - unpack, colors); - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - draw_rgba_pixels(ctx, x, y, width, height, colorFormat, colorType, - unpack, colors); - break; - default: - _mesa_problem(ctx, "unexpected format in glDrawDepthPixelsMESA"); - } - - RENDER_FINISH(swrast,ctx); -} -#endif diff --git a/src/libs/mesa/mesa/swrast/s_feedback.c b/src/libs/mesa/mesa/swrast/s_feedback.c deleted file mode 100644 index aa79531277..0000000000 --- a/src/libs/mesa/mesa/swrast/s_feedback.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/feedback.h" -#include "main/macros.h" - -#include "s_context.h" -#include "s_feedback.h" -#include "s_triangle.h" - - - -static void -feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv) -{ - GLfloat win[4]; - const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0]; - const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0]; - - win[0] = v->attrib[FRAG_ATTRIB_WPOS][0]; - win[1] = v->attrib[FRAG_ATTRIB_WPOS][1]; - win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF; - win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3]; - - _mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc); -} - - -/* - * Put triangle in feedback buffer. - */ -void -_swrast_feedback_triangle(GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2) -{ - if (_swrast_culltriangle(ctx, v0, v1, v2)) { - FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN); - FEEDBACK_TOKEN(ctx, (GLfloat) 3); /* three vertices */ - - if (ctx->Light.ShadeModel == GL_SMOOTH) { - feedback_vertex(ctx, v0, v0); - feedback_vertex(ctx, v1, v1); - feedback_vertex(ctx, v2, v2); - } - else { - feedback_vertex(ctx, v0, v2); - feedback_vertex(ctx, v1, v2); - feedback_vertex(ctx, v2, v2); - } - } -} - - -void -_swrast_feedback_line(GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1) -{ - GLenum token = GL_LINE_TOKEN; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (swrast->StippleCounter == 0) - token = GL_LINE_RESET_TOKEN; - - FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) token); - - if (ctx->Light.ShadeModel == GL_SMOOTH) { - feedback_vertex(ctx, v0, v0); - feedback_vertex(ctx, v1, v1); - } - else { - feedback_vertex(ctx, v0, v1); - feedback_vertex(ctx, v1, v1); - } - - swrast->StippleCounter++; -} - - -void -_swrast_feedback_point(GLcontext *ctx, const SWvertex *v) -{ - FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) GL_POINT_TOKEN); - feedback_vertex(ctx, v, v); -} - - -void -_swrast_select_triangle(GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2) -{ - if (_swrast_culltriangle(ctx, v0, v1, v2)) { - const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - - _mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); - _mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); - _mesa_update_hitflag( ctx, v2->attrib[FRAG_ATTRIB_WPOS][2] * zs ); - } -} - - -void -_swrast_select_line(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) -{ - const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - _mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); - _mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); -} - - -void -_swrast_select_point(GLcontext *ctx, const SWvertex *v) -{ - const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; - _mesa_update_hitflag( ctx, v->attrib[FRAG_ATTRIB_WPOS][2] * zs ); -} diff --git a/src/libs/mesa/mesa/swrast/s_feedback.h b/src/libs/mesa/mesa/swrast/s_feedback.h deleted file mode 100644 index 9feab75dbb..0000000000 --- a/src/libs/mesa/mesa/swrast/s_feedback.h +++ /dev/null @@ -1,50 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_FEEDBACK_H -#define S_FEEDBACK_H - - -#include "swrast.h" - - -extern void _swrast_feedback_point( GLcontext *ctx, const SWvertex *v ); - -extern void _swrast_feedback_line( GLcontext *ctx, - const SWvertex *v1, const SWvertex *v2 ); - -extern void _swrast_feedback_triangle( GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2 ); - -extern void _swrast_select_point( GLcontext *ctx, const SWvertex *v ); - -extern void _swrast_select_line( GLcontext *ctx, - const SWvertex *v1, const SWvertex *v2 ); - -extern void _swrast_select_triangle( GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2 ); - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_fog.c b/src/libs/mesa/mesa/swrast/s_fog.c deleted file mode 100644 index b9ba265db6..0000000000 --- a/src/libs/mesa/mesa/swrast/s_fog.c +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" - -#include "s_context.h" -#include "s_fog.h" - - -/** - * Used to convert current raster distance to a fog factor in [0,1]. - */ -GLfloat -_swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) -{ - GLfloat d, f; - - switch (ctx->Fog.Mode) { - case GL_LINEAR: - if (ctx->Fog.Start == ctx->Fog.End) - d = 1.0F; - else - d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); - f = (ctx->Fog.End - z) * d; - return CLAMP(f, 0.0F, 1.0F); - case GL_EXP: - d = ctx->Fog.Density; - f = EXPF(-d * z); - f = CLAMP(f, 0.0F, 1.0F); - return f; - case GL_EXP2: - d = ctx->Fog.Density; - f = EXPF(-(d * d * z * z)); - f = CLAMP(f, 0.0F, 1.0F); - return f; - default: - _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor"); - return 0.0; - } -} - - -#define LINEAR_FOG(f, coord) f = (fogEnd - coord) * fogScale - -#define EXP_FOG(f, coord) f = EXPF(density * coord) - -#define EXP2_FOG(f, coord) \ -do { \ - GLfloat tmp = negDensitySquared * coord * coord; \ - if (tmp < FLT_MIN_10_EXP) \ - tmp = FLT_MIN_10_EXP; \ - f = EXPF(tmp); \ - } while(0) - - -#define BLEND_FOG(f, coord) f = coord - - - -/** - * Template code for computing fog blend factor and applying it to colors. - * \param TYPE either GLubyte, GLushort or GLfloat. - * \param COMPUTE_F code to compute the fog blend factor, f. - */ -#define FOG_LOOP(TYPE, FOG_FUNC) \ -if (span->arrayAttribs & FRAG_BIT_FOGC) { \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ - const GLfloat c = FABSF(fogCoord); \ - GLfloat f, oneMinusF; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - oneMinusF = 1.0F - f; \ - rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ - rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ - rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ - } \ -} \ -else { \ - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ - const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat c = FABSF(fogCoord) / w; \ - GLfloat f, oneMinusF; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - oneMinusF = 1.0F - f; \ - rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ - rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ - rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ - fogCoord += fogStep; \ - w += wStep; \ - } \ -} - -/* As above, but CI mode (XXX try to merge someday) */ -#define FOG_LOOP_CI(FOG_FUNC) \ -if (span->arrayAttribs & FRAG_BIT_FOGC) { \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ - const GLfloat c = FABSF(fogCoord); \ - GLfloat f; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ - } \ -} \ -else { \ - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ - const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat c = FABSF(fogCoord) / w; \ - GLfloat f; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ - fogCoord += fogStep; \ - w += wStep; \ - } \ -} - - - -/** - * Apply fog to a span of RGBA pixels. - * The fog value are either in the span->array->fog array or interpolated from - * the fog/fogStep values. - * They fog values are either fog coordinates (Z) or fog blend factors. - * _PreferPixelFog should be in sync with that state! - */ -void -_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLfloat rFog, gFog, bFog; - - ASSERT(swrast->_FogEnabled); - ASSERT(span->arrayMask & SPAN_RGBA); - - /* compute (scaled) fog color */ - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - rFog = ctx->Fog.Color[RCOMP] * 255.0; - gFog = ctx->Fog.Color[GCOMP] * 255.0; - bFog = ctx->Fog.Color[BCOMP] * 255.0; - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - rFog = ctx->Fog.Color[RCOMP] * 65535.0; - gFog = ctx->Fog.Color[GCOMP] * 65535.0; - bFog = ctx->Fog.Color[BCOMP] * 65535.0; - } - else { - rFog = ctx->Fog.Color[RCOMP]; - gFog = ctx->Fog.Color[GCOMP]; - bFog = ctx->Fog.Color[BCOMP]; - } - - if (swrast->_PreferPixelFog) { - /* The span's fog values are fog coordinates, now compute blend factors - * and blend the fragment colors with the fog color. - */ - switch (swrast->_FogMode) { - case GL_LINEAR: - { - const GLfloat fogEnd = ctx->Fog.End; - const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) - ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - FOG_LOOP(GLubyte, LINEAR_FOG); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - FOG_LOOP(GLushort, LINEAR_FOG); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, LINEAR_FOG); - } - } - break; - - case GL_EXP: - { - const GLfloat density = -ctx->Fog.Density; - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - FOG_LOOP(GLubyte, EXP_FOG); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - FOG_LOOP(GLushort, EXP_FOG); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, EXP_FOG); - } - } - break; - - case GL_EXP2: - { - const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - FOG_LOOP(GLubyte, EXP2_FOG); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - FOG_LOOP(GLushort, EXP2_FOG); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, EXP2_FOG); - } - } - break; - - default: - _mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span"); - return; - } - } - else { - /* The span's fog start/step/array values are blend factors in [0,1]. - * They were previously computed per-vertex. - */ - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - FOG_LOOP(GLubyte, BLEND_FOG); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - FOG_LOOP(GLushort, BLEND_FOG); - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); - FOG_LOOP(GLfloat, BLEND_FOG); - } - } -} - - -/** - * As above, but color index mode. - */ -void -_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint fogIndex = (GLuint) ctx->Fog.Index; - GLuint *index = span->array->index; - - ASSERT(swrast->_FogEnabled); - ASSERT(span->arrayMask & SPAN_INDEX); - - /* we need to compute fog blend factors */ - if (swrast->_PreferPixelFog) { - /* The span's fog values are fog coordinates, now compute blend factors - * and blend the fragment colors with the fog color. - */ - switch (ctx->Fog.Mode) { - case GL_LINEAR: - { - const GLfloat fogEnd = ctx->Fog.End; - const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) - ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - FOG_LOOP_CI(LINEAR_FOG); - } - break; - case GL_EXP: - { - const GLfloat density = -ctx->Fog.Density; - FOG_LOOP_CI(EXP_FOG); - } - break; - case GL_EXP2: - { - const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - FOG_LOOP_CI(EXP2_FOG); - } - break; - default: - _mesa_problem(ctx, "Bad fog mode in _swrast_fog_ci_span"); - return; - } - } - else { - /* The span's fog start/step/array values are blend factors in [0,1]. - * They were previously computed per-vertex. - */ - FOG_LOOP_CI(BLEND_FOG); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_fog.h b/src/libs/mesa/mesa/swrast/s_fog.h deleted file mode 100644 index 50760d88af..0000000000 --- a/src/libs/mesa/mesa/swrast/s_fog.h +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 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 S_FOG_H -#define S_FOG_H - - -#include "swrast.h" - - -extern GLfloat -_swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z); - -extern void -_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ); - -extern void -_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_fragprog.c b/src/libs/mesa/mesa/swrast/s_fragprog.c deleted file mode 100644 index c0bda32be6..0000000000 --- a/src/libs/mesa/mesa/swrast/s_fragprog.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/texstate.h" -#include "shader/prog_instruction.h" - -#include "s_fragprog.h" -#include "s_span.h" - - -/** - * Fetch a texel with given lod. - * Called via machine->FetchTexelLod() - */ -static void -fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, - GLuint unit, GLfloat color[4] ) -{ - const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - - if (texObj) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan rgba[4]; - - lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - - /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, texObj, 1, - (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); - } - else { - color[0] = color[1] = color[2] = 0.0F; - color[3] = 1.0F; - } -} - - -/** - * Fetch a texel with the given partial derivatives to compute a level - * of detail in the mipmap. - * Called via machine->FetchTexelDeriv() - */ -static void -fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], - const GLfloat texdx[4], const GLfloat texdy[4], - GLfloat lodBias, GLuint unit, GLfloat color[4] ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - - if (texObj) { - const struct gl_texture_image *texImg = - texObj->Image[0][texObj->BaseLevel]; - const GLfloat texW = (GLfloat) texImg->WidthScale; - const GLfloat texH = (GLfloat) texImg->HeightScale; - GLfloat lambda; - GLchan rgba[4]; - - lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ - texdx[1], texdy[1], /* dt/dx, dt/dy */ - texdx[3], texdy[2], /* dq/dx, dq/dy */ - texW, texH, - texcoord[0], texcoord[1], texcoord[3], - 1.0F / texcoord[3]) + lodBias; - - lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - - /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, texObj, 1, - (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); - } - else { - color[0] = color[1] = color[2] = 0.0F; - color[3] = 1.0F; - } -} - - -/** - * Initialize the virtual fragment program machine state prior to running - * fragment program on a fragment. This involves initializing the input - * registers, condition codes, etc. - * \param machine the virtual machine state to init - * \param program the fragment program we're about to run - * \param span the span of pixels we'll operate on - * \param col which element (column) of the span we'll operate on - */ -static void -init_machine(GLcontext *ctx, struct gl_program_machine *machine, - const struct gl_fragment_program *program, - const SWspan *span, GLuint col) -{ - if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { - /* Clear temporary registers (undefined for ARB_f_p) */ - _mesa_bzero(machine->Temporaries, - MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); - } - - /* Setup pointer to input attributes */ - machine->Attribs = span->array->attribs; - - machine->DerivX = (GLfloat (*)[4]) span->attrStepX; - machine->DerivY = (GLfloat (*)[4]) span->attrStepY; - machine->NumDeriv = FRAG_ATTRIB_MAX; - - machine->Samplers = program->Base.SamplerUnits; - - /* if running a GLSL program (not ARB_fragment_program) */ - if (ctx->Shader.CurrentProgram) { - /* Store front/back facing value in register FOGC.Y */ - machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = 1.0 - span->facing; - /* Note FOGC.ZW is gl_PointCoord if drawing a sprite */ - } - - machine->CurElement = col; - - /* init condition codes */ - machine->CondCodes[0] = COND_EQ; - machine->CondCodes[1] = COND_EQ; - machine->CondCodes[2] = COND_EQ; - machine->CondCodes[3] = COND_EQ; - - /* init call stack */ - machine->StackDepth = 0; - - machine->FetchTexelLod = fetch_texel_lod; - machine->FetchTexelDeriv = fetch_texel_deriv; -} - - -/** - * Run fragment program on the pixels in span from 'start' to 'end' - 1. - */ -static void -run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_fragment_program *program = ctx->FragmentProgram._Current; - const GLbitfield outputsWritten = program->Base.OutputsWritten; - struct gl_program_machine *machine = &swrast->FragProgMachine; - GLuint i; - - for (i = start; i < end; i++) { - if (span->array->mask[i]) { - init_machine(ctx, machine, program, span, i); - - if (_mesa_execute_program(ctx, &program->Base, machine)) { - - /* Store result color */ - if (outputsWritten & (1 << FRAG_RESULT_COLR)) { - COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], - machine->Outputs[FRAG_RESULT_COLR]); - } - else { - /* Multiple drawbuffers / render targets - * Note that colors beyond 0 and 1 will overwrite other - * attributes, such as FOGC, TEX0, TEX1, etc. That's OK. - */ - GLuint buf; - for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { - if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + buf))) { - COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i], - machine->Outputs[FRAG_RESULT_DATA0 + buf]); - } - } - } - - /* Store result depth/z */ - if (outputsWritten & (1 << FRAG_RESULT_DEPR)) { - const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPR][2]; - if (depth <= 0.0) - span->array->z[i] = 0; - else if (depth >= 1.0) - span->array->z[i] = ctx->DrawBuffer->_DepthMax; - else - span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF); - } - } - else { - /* killed fragment */ - span->array->mask[i] = GL_FALSE; - span->writeAll = GL_FALSE; - } - } - } -} - - -/** - * Execute the current fragment program for all the fragments - * in the given span. - */ -void -_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) -{ - const struct gl_fragment_program *program = ctx->FragmentProgram._Current; - - /* incoming colors should be floats */ - if (program->Base.InputsRead & FRAG_BIT_COL0) { - ASSERT(span->array->ChanType == GL_FLOAT); - } - - ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ - - run_program(ctx, span, 0, span->end); - - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { - span->interpMask &= ~SPAN_RGBA; - span->arrayMask |= SPAN_RGBA; - } - - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) { - span->interpMask &= ~SPAN_Z; - span->arrayMask |= SPAN_Z; - } - - ctx->_CurrentProgram = 0; -} - diff --git a/src/libs/mesa/mesa/swrast/s_fragprog.h b/src/libs/mesa/mesa/swrast/s_fragprog.h deleted file mode 100644 index e1b7e67918..0000000000 --- a/src/libs/mesa/mesa/swrast/s_fragprog.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2006 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 S_FRAGPROG_H -#define S_FRAGPROG_H - - -#include "s_context.h" - - -extern void -_swrast_exec_fragment_program(GLcontext *ctx, SWspan *span); - - -#endif /* S_FRAGPROG_H */ - diff --git a/src/libs/mesa/mesa/swrast/s_imaging.c b/src/libs/mesa/mesa/swrast/s_imaging.c deleted file mode 100644 index 591857c342..0000000000 --- a/src/libs/mesa/mesa/swrast/s_imaging.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -/* KW: Moved these here to remove knowledge of swrast from core mesa. - * Should probably pull the entire software implementation of these - * extensions into either swrast or a sister module. - */ - -#include "main/glheader.h" -#include "main/colortab.h" -#include "main/convolve.h" -#include "s_context.h" -#include "s_span.h" - - -void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - RENDER_START( swrast, ctx ); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - RENDER_FINISH(swrast,ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; - - _mesa_ColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - RENDER_START( swrast, ctx ); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - RENDER_FINISH(swrast,ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; - - _mesa_ColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - RENDER_START( swrast, ctx ); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, rgba ); - - RENDER_FINISH( swrast, ctx ); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; - - /* store as convolution filter */ - _mesa_ConvolutionFilter1D(target, internalFormat, width, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_pixelstore_attrib packSave; - GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4]; - GLint i; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - RENDER_START(swrast,ctx); - - /* read pixels from framebuffer */ - for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, CHAN_TYPE, rgba[i] ); - } - - RENDER_FINISH(swrast,ctx); - - /* - * HACK: save & restore context state so we can store this as a - * convolution filter via the GL api. Doesn't call any callbacks - * hanging off ctx->Unpack statechanges. - */ - - packSave = ctx->Unpack; /* save pixel packing params */ - - ctx->Unpack.Alignment = 1; - ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH; - ctx->Unpack.SkipPixels = 0; - ctx->Unpack.SkipRows = 0; - ctx->Unpack.ImageHeight = 0; - ctx->Unpack.SkipImages = 0; - ctx->Unpack.SwapBytes = GL_FALSE; - ctx->Unpack.LsbFirst = GL_FALSE; - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; - ctx->NewState |= _NEW_PACKUNPACK; - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; - - _mesa_ConvolutionFilter2D(target, internalFormat, width, height, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; - - ctx->Unpack = packSave; /* restore pixel packing params */ - ctx->NewState |= _NEW_PACKUNPACK; -} diff --git a/src/libs/mesa/mesa/swrast/s_lines.c b/src/libs/mesa/mesa/swrast/s_lines.c deleted file mode 100644 index 23cb9b57ef..0000000000 --- a/src/libs/mesa/mesa/swrast/s_lines.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "s_aaline.h" -#include "s_context.h" -#include "s_depth.h" -#include "s_feedback.h" -#include "s_lines.h" -#include "s_span.h" - - -/* - * Init the mask[] array to implement a line stipple. - */ -static void -compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint i; - - for (i = 0; i < len; i++) { - GLuint bit = (swrast->StippleCounter / ctx->Line.StippleFactor) & 0xf; - if ((1 << bit) & ctx->Line.StipplePattern) { - mask[i] = GL_TRUE; - } - else { - mask[i] = GL_FALSE; - } - swrast->StippleCounter++; - } -} - - -/* - * To draw a wide line we can simply redraw the span N times, side by side. - */ -static void -draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) -{ - const GLint width = (GLint) CLAMP(ctx->Line.Width, - ctx->Const.MinLineWidth, - ctx->Const.MaxLineWidth); - GLint start; - - ASSERT(span->end < MAX_WIDTH); - - if (width & 1) - start = width / 2; - else - start = width / 2 - 1; - - if (xMajor) { - GLint *y = span->array->y; - GLuint i; - GLint w; - for (w = 0; w < width; w++) { - if (w == 0) { - for (i = 0; i < span->end; i++) - y[i] -= start; - } - else { - for (i = 0; i < span->end; i++) - y[i]++; - } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, span); - else - _swrast_write_index_span(ctx, span); - } - } - else { - GLint *x = span->array->x; - GLuint i; - GLint w; - for (w = 0; w < width; w++) { - if (w == 0) { - for (i = 0; i < span->end; i++) - x[i] -= start; - } - else { - for (i = 0; i < span->end; i++) - x[i]++; - } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, span); - else - _swrast_write_index_span(ctx, span); - } - } -} - - - -/**********************************************************************/ -/***** Rasterization *****/ -/**********************************************************************/ - -/* Simple color index line (no stipple, width=1, no Z, no fog, no tex)*/ -#define NAME simple_no_z_ci_line -#define INTERP_INDEX -#define RENDER_SPAN(span) _swrast_write_index_span(ctx, &span) -#include "s_linetemp.h" - -/* Simple RGBA index line (no stipple, width=1, no Z, no fog, no tex)*/ -#define NAME simple_no_z_rgba_line -#define INTERP_RGBA -#define RENDER_SPAN(span) _swrast_write_rgba_span(ctx, &span); -#include "s_linetemp.h" - - -/* Z, fog, wide, stipple color index line */ -#define NAME ci_line -#define INTERP_INDEX -#define INTERP_Z -#define INTERP_ATTRIBS /* for fog */ -#define RENDER_SPAN(span) \ - if (ctx->Line.StippleFlag) { \ - span.arrayMask |= SPAN_MASK; \ - compute_stipple_mask(ctx, span.end, span.array->mask); \ - } \ - if (ctx->Line.Width > 1.0) { \ - draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ - } \ - else { \ - _swrast_write_index_span(ctx, &span); \ - } -#include "s_linetemp.h" - - -/* Z, fog, wide, stipple RGBA line */ -#define NAME rgba_line -#define INTERP_RGBA -#define INTERP_Z -#define RENDER_SPAN(span) \ - if (ctx->Line.StippleFlag) { \ - span.arrayMask |= SPAN_MASK; \ - compute_stipple_mask(ctx, span.end, span.array->mask); \ - } \ - if (ctx->Line.Width > 1.0) { \ - draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ - } \ - else { \ - _swrast_write_rgba_span(ctx, &span); \ - } -#include "s_linetemp.h" - - -/* General-purpose line (any/all features). */ -#define NAME general_line -#define INTERP_RGBA -#define INTERP_Z -#define INTERP_ATTRIBS -#define RENDER_SPAN(span) \ - if (ctx->Line.StippleFlag) { \ - span.arrayMask |= SPAN_MASK; \ - compute_stipple_mask(ctx, span.end, span.array->mask); \ - } \ - if (ctx->Line.Width > 1.0) { \ - draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ - } \ - else { \ - _swrast_write_rgba_span(ctx, &span); \ - } -#include "s_linetemp.h" - - - -void -_swrast_add_spec_terms_line(GLcontext *ctx, - const SWvertex *v0, const SWvertex *v1) -{ - SWvertex *ncv0 = (SWvertex *)v0; - SWvertex *ncv1 = (SWvertex *)v1; - GLfloat rSum, gSum, bSum; - GLchan cSave[2][4]; - - /* save original colors */ - COPY_CHAN4(cSave[0], ncv0->color); - COPY_CHAN4(cSave[1], ncv1->color); - /* sum v0 */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* sum v1 */ - rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 ); - /* restore original colors */ - COPY_CHAN4( ncv0->attrib[FRAG_ATTRIB_COL0], cSave[0] ); - COPY_CHAN4( ncv1->attrib[FRAG_ATTRIB_COL0], cSave[1] ); -} - - - -#ifdef DEBUG - -/* record the current line function name */ -static const char *lineFuncName = NULL; - -#define USE(lineFunc) \ -do { \ - lineFuncName = #lineFunc; \ - /*_mesa_printf("%s\n", lineFuncName);*/ \ - swrast->Line = lineFunc; \ -} while (0) - -#else - -#define USE(lineFunc) swrast->Line = lineFunc - -#endif - - - -/** - * Determine which line drawing function to use given the current - * rendering context. - * - * Please update the summary flag _SWRAST_NEW_LINE if you add or remove - * tests to this code. - */ -void -_swrast_choose_line( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean rgbmode = ctx->Visual.rgbMode; - GLboolean specular = (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); - - if (ctx->RenderMode == GL_RENDER) { - if (ctx->Line.SmoothFlag) { - /* antialiased lines */ - _swrast_choose_aa_line_function(ctx); - ASSERT(swrast->Line); - } - else if (ctx->Texture._EnabledCoordUnits - || ctx->FragmentProgram._Current - || swrast->_FogEnabled - || specular) { - USE(general_line); - } - else if (ctx->Depth.Test - || ctx->Line.Width != 1.0 - || ctx->Line.StippleFlag) { - /* no texture, but Z, fog, width>1, stipple, etc. */ - if (rgbmode) -#if CHAN_BITS == 32 - USE(general_line); -#else - USE(rgba_line); -#endif - else - USE(ci_line); - } - else { - ASSERT(!ctx->Depth.Test); - ASSERT(ctx->Line.Width == 1.0); - /* simple lines */ - if (rgbmode) - USE(simple_no_z_rgba_line); - else - USE(simple_no_z_ci_line); - } - } - else if (ctx->RenderMode == GL_FEEDBACK) { - USE(_swrast_feedback_line); - } - else { - ASSERT(ctx->RenderMode == GL_SELECT); - USE(_swrast_select_line); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_lines.h b/src/libs/mesa/mesa/swrast/s_lines.h deleted file mode 100644 index 22979a02b6..0000000000 --- a/src/libs/mesa/mesa/swrast/s_lines.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_LINES_H -#define S_LINES_H - -#include "swrast.h" - -void -_swrast_choose_line( GLcontext *ctx ); - -void -_swrast_add_spec_terms_line( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1 ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_linetemp.h b/src/libs/mesa/mesa/swrast/s_linetemp.h deleted file mode 100644 index 1abf8d6c7f..0000000000 --- a/src/libs/mesa/mesa/swrast/s_linetemp.h +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/* - * Line Rasterizer Template - * - * This file is #include'd to generate custom line rasterizers. - * - * The following macros may be defined to indicate what auxillary information - * must be interplated along the line: - * INTERP_Z - if defined, interpolate Z values - * INTERP_RGBA - if defined, interpolate RGBA values - * INTERP_INDEX - if defined, interpolate color index values - * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc) - * - * When one can directly address pixels in the color buffer the following - * macros can be defined and used to directly compute pixel addresses during - * rasterization (see pixelPtr): - * PIXEL_TYPE - the datatype of a pixel (GLubyte, GLushort, GLuint) - * BYTES_PER_ROW - number of bytes per row in the color buffer - * PIXEL_ADDRESS(X,Y) - returns the address of pixel at (X,Y) where - * Y==0 at bottom of screen and increases upward. - * - * Similarly, for direct depth buffer access, this type is used for depth - * buffer addressing: - * DEPTH_TYPE - either GLushort or GLuint - * - * Optionally, one may provide one-time setup code - * SETUP_CODE - code which is to be executed once per line - * - * To actually "plot" each pixel the PLOT macro must be defined... - * PLOT(X,Y) - code to plot a pixel. Example: - * if (Z < *zPtr) { - * *zPtr = Z; - * color = pack_rgb( FixedToInt(r0), FixedToInt(g0), - * FixedToInt(b0) ); - * put_pixel( X, Y, color ); - * } - * - * This code was designed for the origin to be in the lower-left corner. - * - */ - - -static void -NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - SWspan span; - GLuint interpFlags = 0; - GLint x0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][0]; - GLint x1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][0]; - GLint y0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][1]; - GLint y1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][1]; - GLint dx, dy; - GLint numPixels; - GLint xstep, ystep; -#if defined(DEPTH_TYPE) - const GLint depthBits = ctx->DrawBuffer->Visual.depthBits; - const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; - struct gl_renderbuffer *zrb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; -#define FixedToDepth(F) ((F) >> fixedToDepthShift) - GLint zPtrXstep, zPtrYstep; - DEPTH_TYPE *zPtr; -#elif defined(INTERP_Z) - const GLint depthBits = ctx->DrawBuffer->Visual.depthBits; -/*ctx->Visual.depthBits;*/ -#endif -#ifdef PIXEL_ADDRESS - PIXEL_TYPE *pixelPtr; - GLint pixelXstep, pixelYstep; -#endif - -#ifdef SETUP_CODE - SETUP_CODE -#endif - - (void) swrast; - - /* Cull primitives with malformed coordinates. - */ - { - GLfloat tmp = vert0->attrib[FRAG_ATTRIB_WPOS][0] + vert0->attrib[FRAG_ATTRIB_WPOS][1] - + vert1->attrib[FRAG_ATTRIB_WPOS][0] + vert1->attrib[FRAG_ATTRIB_WPOS][1]; - if (IS_INF_OR_NAN(tmp)) - return; - } - - /* - printf("%s():\n", __FUNCTION__); - printf(" (%f, %f, %f) -> (%f, %f, %f)\n", - vert0->attrib[FRAG_ATTRIB_WPOS][0], - vert0->attrib[FRAG_ATTRIB_WPOS][1], - vert0->attrib[FRAG_ATTRIB_WPOS][2], - vert1->attrib[FRAG_ATTRIB_WPOS][0], - vert1->attrib[FRAG_ATTRIB_WPOS][1], - vert1->attrib[FRAG_ATTRIB_WPOS][2]); - printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->color[0], vert0->color[1], vert0->color[2], - vert1->color[0], vert1->color[1], vert1->color[2]); - printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->specular[0], vert0->specular[1], vert0->specular[2], - vert1->specular[0], vert1->specular[1], vert1->specular[2]); - */ - -/* - * Despite being clipped to the view volume, the line's window coordinates - * may just lie outside the window bounds. That is, if the legal window - * coordinates are [0,W-1][0,H-1], it's possible for x==W and/or y==H. - * This quick and dirty code nudges the endpoints inside the window if - * necessary. - */ -#ifdef CLIP_HACK - { - GLint w = ctx->DrawBuffer->Width; - GLint h = ctx->DrawBuffer->Height; - if ((x0==w) | (x1==w)) { - if ((x0==w) & (x1==w)) - return; - x0 -= x0==w; - x1 -= x1==w; - } - if ((y0==h) | (y1==h)) { - if ((y0==h) & (y1==h)) - return; - y0 -= y0==h; - y1 -= y1==h; - } - } -#endif - - dx = x1 - x0; - dy = y1 - y0; - if (dx == 0 && dy == 0) - return; - - /* - printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy, - vert0->attrib[FRAG_ATTRIB_COL1][0], - vert0->attrib[FRAG_ATTRIB_COL1][1], - vert0->attrib[FRAG_ATTRIB_COL1][2], - vert0->attrib[FRAG_ATTRIB_COL1][3], - vert1->attrib[FRAG_ATTRIB_COL1][0], - vert1->attrib[FRAG_ATTRIB_COL1][1], - vert1->attrib[FRAG_ATTRIB_COL1][2], - vert1->attrib[FRAG_ATTRIB_COL1][3]); - */ - -#ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) zrb->GetPointer(ctx, zrb, x0, y0); -#endif -#ifdef PIXEL_ADDRESS - pixelPtr = (PIXEL_TYPE *) PIXEL_ADDRESS(x0,y0); -#endif - - if (dx<0) { - dx = -dx; /* make positive */ - xstep = -1; -#ifdef DEPTH_TYPE - zPtrXstep = -((GLint)sizeof(DEPTH_TYPE)); -#endif -#ifdef PIXEL_ADDRESS - pixelXstep = -((GLint)sizeof(PIXEL_TYPE)); -#endif - } - else { - xstep = 1; -#ifdef DEPTH_TYPE - zPtrXstep = ((GLint)sizeof(DEPTH_TYPE)); -#endif -#ifdef PIXEL_ADDRESS - pixelXstep = ((GLint)sizeof(PIXEL_TYPE)); -#endif - } - - if (dy<0) { - dy = -dy; /* make positive */ - ystep = -1; -#ifdef DEPTH_TYPE - zPtrYstep = -((GLint) (ctx->DrawBuffer->Width * sizeof(DEPTH_TYPE))); -#endif -#ifdef PIXEL_ADDRESS - pixelYstep = BYTES_PER_ROW; -#endif - } - else { - ystep = 1; -#ifdef DEPTH_TYPE - zPtrYstep = (GLint) (ctx->DrawBuffer->Width * sizeof(DEPTH_TYPE)); -#endif -#ifdef PIXEL_ADDRESS - pixelYstep = -(BYTES_PER_ROW); -#endif - } - - ASSERT(dx >= 0); - ASSERT(dy >= 0); - - numPixels = MAX2(dx, dy); - - /* - * Span setup: compute start and step values for all interpolated values. - */ -#ifdef INTERP_RGBA - interpFlags |= SPAN_RGBA; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - span.red = ChanToFixed(vert0->color[0]); - span.green = ChanToFixed(vert0->color[1]); - span.blue = ChanToFixed(vert0->color[2]); - span.alpha = ChanToFixed(vert0->color[3]); - span.redStep = (ChanToFixed(vert1->color[0]) - span.red ) / numPixels; - span.greenStep = (ChanToFixed(vert1->color[1]) - span.green) / numPixels; - span.blueStep = (ChanToFixed(vert1->color[2]) - span.blue ) / numPixels; - span.alphaStep = (ChanToFixed(vert1->color[3]) - span.alpha) / numPixels; - } - else { - span.red = ChanToFixed(vert1->color[0]); - span.green = ChanToFixed(vert1->color[1]); - span.blue = ChanToFixed(vert1->color[2]); - span.alpha = ChanToFixed(vert1->color[3]); - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; - span.alphaStep = 0; - } -#endif -#ifdef INTERP_INDEX - interpFlags |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - span.index = FloatToFixed(vert0->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_CI][0] - - vert0->attrib[FRAG_ATTRIB_CI][0]) / numPixels; - } - else { - span.index = FloatToFixed(vert1->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = 0; - } -#endif -#if defined(INTERP_Z) || defined(DEPTH_TYPE) - interpFlags |= SPAN_Z; - { - if (depthBits <= 16) { - span.z = FloatToFixed(vert0->attrib[FRAG_ATTRIB_WPOS][2]) + FIXED_HALF; - span.zStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_WPOS][2] - - vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels; - } - else { - /* don't use fixed point */ - span.z = (GLuint) vert0->attrib[FRAG_ATTRIB_WPOS][2]; - span.zStep = (GLint) (( vert1->attrib[FRAG_ATTRIB_WPOS][2] - - vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels); - } - } -#endif -#if defined(INTERP_ATTRIBS) - { - const GLfloat invLen = 1.0F / numPixels; - const GLfloat invw0 = vert0->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat invw1 = vert1->attrib[FRAG_ATTRIB_WPOS][3]; - - span.attrStart[FRAG_ATTRIB_WPOS][3] = invw0; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = (invw1 - invw0) * invLen; - span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; - - ATTRIB_LOOP_BEGIN - if (swrast->_InterpMode[attr] == GL_FLAT) { - COPY_4V(span.attrStart[attr], vert1->attrib[attr]); - ASSIGN_4V(span.attrStepX[attr], 0.0, 0.0, 0.0, 0.0); - } - else { - GLuint c; - for (c = 0; c < 4; c++) { - float da; - span.attrStart[attr][c] = invw0 * vert0->attrib[attr][c]; - da = (invw1 * vert1->attrib[attr][c]) - span.attrStart[attr][c]; - span.attrStepX[attr][c] = da * invLen; - } - } - ASSIGN_4V(span.attrStepY[attr], 0.0, 0.0, 0.0, 0.0); - ATTRIB_LOOP_END - } -#endif - - INIT_SPAN(span, GL_LINE); - span.end = numPixels; - span.interpMask = interpFlags; - span.arrayMask = SPAN_XY; - - span.facing = swrast->PointLineFacing; - - - /* - * Draw - */ - - if (dx > dy) { - /*** X-major line ***/ - GLint i; - GLint errorInc = dy+dy; - GLint error = errorInc-dx; - GLint errorDec = error-dx; - - for (i = 0; i < dx; i++) { -#ifdef DEPTH_TYPE - GLuint Z = FixedToDepth(span.z); -#endif -#ifdef PLOT - PLOT( x0, y0 ); -#else - span.array->x[i] = x0; - span.array->y[i] = y0; -#endif - x0 += xstep; -#ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep); - span.z += span.zStep; -#endif -#ifdef PIXEL_ADDRESS - pixelPtr = (PIXEL_TYPE*) ((GLubyte*) pixelPtr + pixelXstep); -#endif - if (error < 0) { - error += errorInc; - } - else { - error += errorDec; - y0 += ystep; -#ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep); -#endif -#ifdef PIXEL_ADDRESS - pixelPtr = (PIXEL_TYPE*) ((GLubyte*) pixelPtr + pixelYstep); -#endif - } - } - } - else { - /*** Y-major line ***/ - GLint i; - GLint errorInc = dx+dx; - GLint error = errorInc-dy; - GLint errorDec = error-dy; - - for (i=0;ix[i] = x0; - span.array->y[i] = y0; -#endif - y0 += ystep; -#ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep); - span.z += span.zStep; -#endif -#ifdef PIXEL_ADDRESS - pixelPtr = (PIXEL_TYPE*) ((GLubyte*) pixelPtr + pixelYstep); -#endif - if (error<0) { - error += errorInc; - } - else { - error += errorDec; - x0 += xstep; -#ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep); -#endif -#ifdef PIXEL_ADDRESS - pixelPtr = (PIXEL_TYPE*) ((GLubyte*) pixelPtr + pixelXstep); -#endif - } - } - } - -#ifdef RENDER_SPAN - RENDER_SPAN( span ); -#endif - - (void)span; - -} - - -#undef NAME -#undef INTERP_Z -#undef INTERP_RGBA -#undef INTERP_ATTRIBS -#undef INTERP_INDEX -#undef PIXEL_ADDRESS -#undef PIXEL_TYPE -#undef DEPTH_TYPE -#undef BYTES_PER_ROW -#undef SETUP_CODE -#undef PLOT -#undef CLIP_HACK -#undef FixedToDepth -#undef RENDER_SPAN diff --git a/src/libs/mesa/mesa/swrast/s_logic.c b/src/libs/mesa/mesa/swrast/s_logic.c deleted file mode 100644 index f0274b4c0b..0000000000 --- a/src/libs/mesa/mesa/swrast/s_logic.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/macros.h" - -#include "s_context.h" -#include "s_logic.h" -#include "s_span.h" - - -/** - * We do all logic ops on 4-byte GLuints. - * Depending on bytes per pixel, the mask array elements correspond to - * 1, 2 or 4 GLuints. - */ -#define LOGIC_OP_LOOP(MODE, MASKSTRIDE) \ -do { \ - GLuint i; \ - switch (MODE) { \ - case GL_CLEAR: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = 0; \ - } \ - } \ - break; \ - case GL_SET: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~0; \ - } \ - } \ - break; \ - case GL_COPY: \ - /* do nothing */ \ - break; \ - case GL_COPY_INVERTED: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~src[i]; \ - } \ - } \ - break; \ - case GL_NOOP: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = dest[i]; \ - } \ - } \ - break; \ - case GL_INVERT: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~dest[i]; \ - } \ - } \ - break; \ - case GL_AND: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] &= dest[i]; \ - } \ - } \ - break; \ - case GL_NAND: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~(src[i] & dest[i]); \ - } \ - } \ - break; \ - case GL_OR: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] |= dest[i]; \ - } \ - } \ - break; \ - case GL_NOR: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~(src[i] | dest[i]); \ - } \ - } \ - break; \ - case GL_XOR: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] ^= dest[i]; \ - } \ - } \ - break; \ - case GL_EQUIV: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~(src[i] ^ dest[i]); \ - } \ - } \ - break; \ - case GL_AND_REVERSE: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = src[i] & ~dest[i]; \ - } \ - } \ - break; \ - case GL_AND_INVERTED: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~src[i] & dest[i]; \ - } \ - } \ - break; \ - case GL_OR_REVERSE: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = src[i] | ~dest[i]; \ - } \ - } \ - break; \ - case GL_OR_INVERTED: \ - for (i = 0; i < n; i++) { \ - if (mask[i / MASKSTRIDE]) { \ - src[i] = ~src[i] | dest[i]; \ - } \ - } \ - break; \ - default: \ - _mesa_problem(ctx, "bad logicop mode");\ - } \ -} while (0) - - - -static INLINE void -logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], - const GLubyte mask[]) -{ - LOGIC_OP_LOOP(ctx->Color.LogicOp, 1); -} - - -static INLINE void -logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], - const GLubyte mask[]) -{ - LOGIC_OP_LOOP(ctx->Color.LogicOp, 2); -} - - -static INLINE void -logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], - const GLubyte mask[]) -{ - LOGIC_OP_LOOP(ctx->Color.LogicOp, 4); -} - - - -/* - * Apply the current logic operator to a span of CI pixels. This is only - * used if the device driver can't do logic ops. - */ -void -_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - GLuint dest[MAX_WIDTH]; - GLuint *index = span->array->index; - - ASSERT(span->end < MAX_WIDTH); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - /* Read dest values from frame buffer */ - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, sizeof(GLuint)); - } - else { - rb->GetRow(ctx, rb, span->end, span->x, span->y, dest); - } - - logicop_uint1(ctx, span->end, index, dest, span->array->mask); -} - - -/** - * Apply the current logic operator to a span of RGBA pixels. - * We can handle horizontal runs of pixels (spans) or arrays of x/y - * pixel coordinates. - */ -void -_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - void *rbPixels; - - ASSERT(span->end < MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(rb->DataType == span->array->ChanType); - - rbPixels = _swrast_get_dest_rgba(ctx, rb, span); - - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - /* treat 4*GLubyte as GLuint */ - logicop_uint1(ctx, span->end, - (GLuint *) span->array->rgba8, - (const GLuint *) rbPixels, span->array->mask); - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - /* treat 2*GLushort as GLuint */ - logicop_uint2(ctx, 2 * span->end, - (GLuint *) span->array->rgba16, - (const GLuint *) rbPixels, span->array->mask); - } - else { - logicop_uint4(ctx, 4 * span->end, - (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0], - (const GLuint *) rbPixels, span->array->mask); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_logic.h b/src/libs/mesa/mesa/swrast/s_logic.h deleted file mode 100644 index ba20cd7b32..0000000000 --- a/src/libs/mesa/mesa/swrast/s_logic.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 S_LOGIC_H -#define S_LOGIC_H - - -#include "swrast.h" - - -extern void -_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - - -extern void -_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_masking.c b/src/libs/mesa/mesa/swrast/s_masking.c deleted file mode 100644 index df779b0739..0000000000 --- a/src/libs/mesa/mesa/swrast/s_masking.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - - -/* - * Implement the effect of glColorMask and glIndexMask in software. - */ - - -#include "main/glheader.h" -#include "main/macros.h" - -#include "s_context.h" -#include "s_masking.h" -#include "s_span.h" - - -/** - * Apply the color mask to a span of rgba values. - */ -void -_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - const GLuint n = span->end; - void *rbPixels; - - ASSERT(n < MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(rb->DataType == span->array->ChanType); - - rbPixels = _swrast_get_dest_rgba(ctx, rb, span); - - /* - * Do component masking. - * Note that we're not using span->array->mask[] here. We could... - */ - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - /* treat 4xGLubyte as 1xGLuint */ - const GLuint srcMask = *((GLuint *) ctx->Color.ColorMask); - const GLuint dstMask = ~srcMask; - const GLuint *dst = (const GLuint *) rbPixels; - GLuint *src = (GLuint *) span->array->rgba8; - GLuint i; - for (i = 0; i < n; i++) { - src[i] = (src[i] & srcMask) | (dst[i] & dstMask); - } - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - /* 2-byte components */ - /* XXX try to use 64-bit arithmetic someday */ - const GLushort rMask = ctx->Color.ColorMask[RCOMP] ? 0xffff : 0x0; - const GLushort gMask = ctx->Color.ColorMask[GCOMP] ? 0xffff : 0x0; - const GLushort bMask = ctx->Color.ColorMask[BCOMP] ? 0xffff : 0x0; - const GLushort aMask = ctx->Color.ColorMask[ACOMP] ? 0xffff : 0x0; - const GLushort (*dst)[4] = (const GLushort (*)[4]) rbPixels; - GLushort (*src)[4] = span->array->rgba16; - GLuint i; - for (i = 0; i < n; i++) { - src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); - src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask); - src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask); - src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask); - } - } - else { - /* 4-byte components */ - const GLuint rMask = ctx->Color.ColorMask[RCOMP] ? ~0x0 : 0x0; - const GLuint gMask = ctx->Color.ColorMask[GCOMP] ? ~0x0 : 0x0; - const GLuint bMask = ctx->Color.ColorMask[BCOMP] ? ~0x0 : 0x0; - const GLuint aMask = ctx->Color.ColorMask[ACOMP] ? ~0x0 : 0x0; - const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels; - GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL0]; - GLuint i; - for (i = 0; i < n; i++) { - src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); - src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask); - src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask); - src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask); - } - } -} - - -/** - * Apply the index mask to a span of color index values. - */ -void -_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - const GLuint srcMask = ctx->Color.IndexMask; - const GLuint dstMask = ~srcMask; - GLuint *index = span->array->index; - GLuint dest[MAX_WIDTH]; - GLuint i; - - ASSERT(span->arrayMask & SPAN_INDEX); - ASSERT(span->end <= MAX_WIDTH); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, sizeof(GLuint)); - } - else { - _swrast_read_index_span(ctx, rb, span->end, span->x, span->y, dest); - } - - for (i = 0; i < span->end; i++) { - index[i] = (index[i] & srcMask) | (dest[i] & dstMask); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_masking.h b/src/libs/mesa/mesa/swrast/s_masking.h deleted file mode 100644 index 3260ca34e3..0000000000 --- a/src/libs/mesa/mesa/swrast/s_masking.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 S_MASKING_H -#define S_MASKING_H - - -#include "swrast.h" - - -extern void -_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - - -extern void -_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_points.c b/src/libs/mesa/mesa/swrast/s_points.c deleted file mode 100644 index 0a3ad97a71..0000000000 --- a/src/libs/mesa/mesa/swrast/s_points.c +++ /dev/null @@ -1,600 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/texstate.h" -#include "s_context.h" -#include "s_feedback.h" -#include "s_points.h" -#include "s_span.h" - - -/** - * Used to cull points with invalid coords - */ -#define CULL_INVALID(V) \ - do { \ - float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \ - + (V)->attrib[FRAG_ATTRIB_WPOS][1]; \ - if (IS_INF_OR_NAN(tmp)) \ - return; \ - } while(0) - - - -/** - * Get/compute the point size. - * The size may come from a vertex shader, or computed with attentuation - * or just the glPointSize value. - * Must also clamp to user-defined range and implmentation limits. - */ -static INLINE GLfloat -get_size(const GLcontext *ctx, const SWvertex *vert, GLboolean smoothed) -{ - GLfloat size; - - if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { - /* use vertex's point size */ - size = vert->pointSize; - } - else { - /* use constant point size */ - size = ctx->Point.Size; - } - /* always clamp to user-specified limits */ - size = CLAMP(size, ctx->Point.MinSize, ctx->Point.MaxSize); - /* clamp to implementation limits */ - if (smoothed) - size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA); - else - size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); - - return size; -} - - -/** - * Draw a point sprite - */ -static void -sprite_point(GLcontext *ctx, const SWvertex *vert) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - SWspan span; - GLfloat size; - GLuint tCoords[MAX_TEXTURE_COORD_UNITS + 1]; - GLuint numTcoords = 0; - GLfloat t0, dtdy; - - CULL_INVALID(vert); - - /* z coord */ - if (ctx->DrawBuffer->Visual.depthBits <= 16) - span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - else - span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - span.zStep = 0; - - size = get_size(ctx, vert, GL_FALSE); - - /* span init */ - INIT_SPAN(span, GL_POINT); - span.interpMask = SPAN_Z | SPAN_RGBA; - - span.facing = swrast->PointLineFacing; - - span.red = ChanToFixed(vert->color[0]); - span.green = ChanToFixed(vert->color[1]); - span.blue = ChanToFixed(vert->color[2]); - span.alpha = ChanToFixed(vert->color[3]); - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; - span.alphaStep = 0; - - /* need these for fragment programs */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; - - { - GLfloat s, r, dsdx; - - /* texcoord / pointcoord interpolants */ - s = 0.0; - dsdx = 1.0 / size; - if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) { - dtdy = 1.0 / size; - t0 = 0.5 * dtdy; - } - else { - /* GL_UPPER_LEFT */ - dtdy = -1.0 / size; - t0 = 1.0 + 0.5 * dtdy; - } - - ATTRIB_LOOP_BEGIN - if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { - const GLuint u = attr - FRAG_ATTRIB_TEX0; - /* a texcoord */ - if (ctx->Point.CoordReplace[u]) { - tCoords[numTcoords++] = attr; - - if (ctx->Point.SpriteRMode == GL_ZERO) - r = 0.0F; - else if (ctx->Point.SpriteRMode == GL_S) - r = vert->attrib[attr][0]; - else /* GL_R */ - r = vert->attrib[attr][2]; - - span.attrStart[attr][0] = s; - span.attrStart[attr][1] = 0.0; /* overwritten below */ - span.attrStart[attr][2] = r; - span.attrStart[attr][3] = 1.0; - - span.attrStepX[attr][0] = dsdx; - span.attrStepX[attr][1] = 0.0; - span.attrStepX[attr][2] = 0.0; - span.attrStepX[attr][3] = 0.0; - - span.attrStepY[attr][0] = 0.0; - span.attrStepY[attr][1] = dtdy; - span.attrStepY[attr][2] = 0.0; - span.attrStepY[attr][3] = 0.0; - - continue; - } - } - else if (attr == FRAG_ATTRIB_FOGC) { - /* GLSL gl_PointCoord is stored in fog.zw */ - span.attrStart[FRAG_ATTRIB_FOGC][2] = 0.0; - span.attrStart[FRAG_ATTRIB_FOGC][3] = 0.0; /* t0 set below */ - span.attrStepX[FRAG_ATTRIB_FOGC][2] = dsdx; - span.attrStepX[FRAG_ATTRIB_FOGC][3] = 0.0; - span.attrStepY[FRAG_ATTRIB_FOGC][2] = 0.0; - span.attrStepY[FRAG_ATTRIB_FOGC][3] = dtdy; - tCoords[numTcoords++] = FRAG_ATTRIB_FOGC; - continue; - } - /* use vertex's texcoord/attrib */ - COPY_4V(span.attrStart[attr], vert->attrib[attr]); - ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); - ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); - ATTRIB_LOOP_END; - } - - /* compute pos, bounds and render */ - { - const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; - const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; - GLint iSize = (GLint) (size + 0.5F); - GLint xmin, xmax, ymin, ymax, iy; - GLint iRadius; - GLfloat tcoord = t0; - - iSize = MAX2(1, iSize); - iRadius = iSize / 2; - - if (iSize & 1) { - /* odd size */ - xmin = (GLint) (x - iRadius); - xmax = (GLint) (x + iRadius); - ymin = (GLint) (y - iRadius); - ymax = (GLint) (y + iRadius); - } - else { - /* even size */ - /* 0.501 factor allows conformance to pass */ - xmin = (GLint) (x + 0.501) - iRadius; - xmax = xmin + iSize - 1; - ymin = (GLint) (y + 0.501) - iRadius; - ymax = ymin + iSize - 1; - } - - /* render spans */ - for (iy = ymin; iy <= ymax; iy++) { - GLuint i; - /* setup texcoord T for this row */ - for (i = 0; i < numTcoords; i++) { - if (tCoords[i] == FRAG_ATTRIB_FOGC) - span.attrStart[FRAG_ATTRIB_FOGC][3] = tcoord; - else - span.attrStart[tCoords[i]][1] = tcoord; - } - - /* these might get changed by span clipping */ - span.x = xmin; - span.y = iy; - span.end = xmax - xmin + 1; - - _swrast_write_rgba_span(ctx, &span); - - tcoord += dtdy; - } - } -} - - -/** - * Draw smooth/antialiased point. RGB or CI mode. - */ -static void -smooth_point(GLcontext *ctx, const SWvertex *vert) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; - SWspan span; - GLfloat size, alphaAtten; - - CULL_INVALID(vert); - - /* z coord */ - if (ctx->DrawBuffer->Visual.depthBits <= 16) - span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - else - span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - span.zStep = 0; - - size = get_size(ctx, vert, GL_TRUE); - - /* alpha attenuation / fade factor */ - if (ctx->Multisample._Enabled) { - if (vert->pointSize >= ctx->Point.Threshold) { - alphaAtten = 1.0F; - } - else { - GLfloat dsize = vert->pointSize / ctx->Point.Threshold; - alphaAtten = dsize * dsize; - } - } - else { - alphaAtten = 1.0; - } - (void) alphaAtten; /* not used */ - - /* span init */ - INIT_SPAN(span, GL_POINT); - span.interpMask = SPAN_Z | SPAN_RGBA; - span.arrayMask = SPAN_COVERAGE | SPAN_MASK; - - span.facing = swrast->PointLineFacing; - - span.red = ChanToFixed(vert->color[0]); - span.green = ChanToFixed(vert->color[1]); - span.blue = ChanToFixed(vert->color[2]); - span.alpha = ChanToFixed(vert->color[3]); - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; - span.alphaStep = 0; - - /* need these for fragment programs */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; - - ATTRIB_LOOP_BEGIN - COPY_4V(span.attrStart[attr], vert->attrib[attr]); - ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); - ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); - ATTRIB_LOOP_END - - /* compute pos, bounds and render */ - { - const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; - const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; - const GLfloat radius = 0.5F * size; - const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */ - const GLfloat rmax = radius + 0.7071F; - const GLfloat rmin2 = MAX2(0.0F, rmin * rmin); - const GLfloat rmax2 = rmax * rmax; - const GLfloat cscale = 1.0F / (rmax2 - rmin2); - const GLint xmin = (GLint) (x - radius); - const GLint xmax = (GLint) (x + radius); - const GLint ymin = (GLint) (y - radius); - const GLint ymax = (GLint) (y + radius); - GLint ix, iy; - - for (iy = ymin; iy <= ymax; iy++) { - - /* these might get changed by span clipping */ - span.x = xmin; - span.y = iy; - span.end = xmax - xmin + 1; - - /* compute coverage for each pixel in span */ - for (ix = xmin; ix <= xmax; ix++) { - const GLfloat dx = ix - x + 0.5F; - const GLfloat dy = iy - y + 0.5F; - const GLfloat dist2 = dx * dx + dy * dy; - GLfloat coverage; - - if (dist2 < rmax2) { - if (dist2 >= rmin2) { - /* compute partial coverage */ - coverage = 1.0F - (dist2 - rmin2) * cscale; - if (ciMode) { - /* coverage in [0,15] */ - coverage *= 15.0; - } - } - else { - /* full coverage */ - coverage = 1.0F; - } - span.array->mask[ix - xmin] = 1; - } - else { - /* zero coverage - fragment outside the radius */ - coverage = 0.0; - span.array->mask[ix - xmin] = 0; - } - span.array->coverage[ix - xmin] = coverage; - } - - /* render span */ - _swrast_write_rgba_span(ctx, &span); - - } - } -} - - -/** - * Draw large (size >= 1) non-AA point. RGB or CI mode. - */ -static void -large_point(GLcontext *ctx, const SWvertex *vert) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; - SWspan span; - GLfloat size; - - CULL_INVALID(vert); - - /* z coord */ - if (ctx->DrawBuffer->Visual.depthBits <= 16) - span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - else - span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - span.zStep = 0; - - size = get_size(ctx, vert, GL_FALSE); - - /* span init */ - INIT_SPAN(span, GL_POINT); - span.arrayMask = SPAN_XY; - span.facing = swrast->PointLineFacing; - - if (ciMode) { - span.interpMask = SPAN_Z | SPAN_INDEX; - span.index = FloatToFixed(vert->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = 0; - } - else { - span.interpMask = SPAN_Z | SPAN_RGBA; - span.red = ChanToFixed(vert->color[0]); - span.green = ChanToFixed(vert->color[1]); - span.blue = ChanToFixed(vert->color[2]); - span.alpha = ChanToFixed(vert->color[3]); - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; - span.alphaStep = 0; - } - - /* need these for fragment programs */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; - - ATTRIB_LOOP_BEGIN - COPY_4V(span.attrStart[attr], vert->attrib[attr]); - ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0); - ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0); - ATTRIB_LOOP_END - - /* compute pos, bounds and render */ - { - const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; - const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; - GLint iSize = (GLint) (size + 0.5F); - GLint xmin, xmax, ymin, ymax, ix, iy; - GLint iRadius; - - iSize = MAX2(1, iSize); - iRadius = iSize / 2; - - if (iSize & 1) { - /* odd size */ - xmin = (GLint) (x - iRadius); - xmax = (GLint) (x + iRadius); - ymin = (GLint) (y - iRadius); - ymax = (GLint) (y + iRadius); - } - else { - /* even size */ - /* 0.501 factor allows conformance to pass */ - xmin = (GLint) (x + 0.501) - iRadius; - xmax = xmin + iSize - 1; - ymin = (GLint) (y + 0.501) - iRadius; - ymax = ymin + iSize - 1; - } - - /* generate fragments */ - span.end = 0; - for (iy = ymin; iy <= ymax; iy++) { - for (ix = xmin; ix <= xmax; ix++) { - span.array->x[span.end] = ix; - span.array->y[span.end] = iy; - span.end++; - } - } - assert(span.end <= MAX_WIDTH); - _swrast_write_rgba_span(ctx, &span); - } -} - - -/** - * Draw size=1, single-pixel point - */ -static void -pixel_point(GLcontext *ctx, const SWvertex *vert) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; - /* - * Note that unlike the other functions, we put single-pixel points - * into a special span array in order to render as many points as - * possible with a single _swrast_write_rgba_span() call. - */ - SWspan *span = &(swrast->PointSpan); - GLuint count; - - CULL_INVALID(vert); - - /* Span init */ - span->interpMask = 0; - span->arrayMask = SPAN_XY | SPAN_Z; - if (ciMode) - span->arrayMask |= SPAN_INDEX; - else - span->arrayMask |= SPAN_RGBA; - /*span->arrayMask |= SPAN_LAMBDA;*/ - span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */ - - /* need these for fragment programs */ - span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; - span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; - span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; - - /* check if we need to flush */ - if (span->end >= MAX_WIDTH || - (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT)) || - span->facing != swrast->PointLineFacing) { - if (span->end > 0) { - if (ciMode) - _swrast_write_index_span(ctx, span); - else - _swrast_write_rgba_span(ctx, span); - span->end = 0; - } - } - - count = span->end; - - span->facing = swrast->PointLineFacing; - - /* fragment attributes */ - if (ciMode) { - span->array->index[count] = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; - } - else { - span->array->rgba[count][RCOMP] = vert->color[0]; - span->array->rgba[count][GCOMP] = vert->color[1]; - span->array->rgba[count][BCOMP] = vert->color[2]; - span->array->rgba[count][ACOMP] = vert->color[3]; - } - ATTRIB_LOOP_BEGIN - COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]); - ATTRIB_LOOP_END - - /* fragment position */ - span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0]; - span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1]; - span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); - - span->end = count + 1; - ASSERT(span->end <= MAX_WIDTH); -} - - -/** - * Add specular color to primary color, draw point, restore original - * primary color. - */ -void -_swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0) -{ - SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */ - GLfloat rSum, gSum, bSum; - GLchan cSave[4]; - - /* save */ - COPY_CHAN4(cSave, ncv0->color); - /* sum */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0); - /* restore */ - COPY_CHAN4(ncv0->color, cSave); -} - - -/** - * Examine current state to determine which point drawing function to use. - */ -void -_swrast_choose_point(GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLfloat size = CLAMP(ctx->Point.Size, - ctx->Point.MinSize, - ctx->Point.MaxSize); - - if (ctx->RenderMode == GL_RENDER) { - if (ctx->Point.PointSprite) { - swrast->Point = sprite_point; - } - else if (ctx->Point.SmoothFlag) { - swrast->Point = smooth_point; - } - else if (size > 1.0 || - ctx->Point._Attenuated || - ctx->VertexProgram.PointSizeEnabled) { - swrast->Point = large_point; - } - else { - swrast->Point = pixel_point; - } - } - else if (ctx->RenderMode == GL_FEEDBACK) { - swrast->Point = _swrast_feedback_point; - } - else { - /* GL_SELECT mode */ - swrast->Point = _swrast_select_point; - } -} diff --git a/src/libs/mesa/mesa/swrast/s_points.h b/src/libs/mesa/mesa/swrast/s_points.h deleted file mode 100644 index 9e39c601ef..0000000000 --- a/src/libs/mesa/mesa/swrast/s_points.h +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_POINTS_H -#define S_POINTS_H - -#include "swrast.h" - -extern void -_swrast_choose_point( GLcontext *ctx ); - -extern void -_swrast_add_spec_terms_point( GLcontext *ctx, - const SWvertex *v0 ); - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_readpix.c b/src/libs/mesa/mesa/swrast/s_readpix.c deleted file mode 100644 index f263045170..0000000000 --- a/src/libs/mesa/mesa/swrast/s_readpix.c +++ /dev/null @@ -1,620 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/colormac.h" -#include "main/convolve.h" -#include "main/context.h" -#include "main/feedback.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/pixel.h" -#include "main/state.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" -#include "s_stencil.h" - - -/* - * Read a block of color index pixels. - */ -static void -read_index_pixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - GLint i; - - if (!rb) - return; - - /* width should never be > MAX_WIDTH since we did clipping earlier */ - ASSERT(width <= MAX_WIDTH); - - /* process image row by row */ - for (i = 0; i < height; i++) { - GLuint index[MAX_WIDTH]; - GLvoid *dest; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y + i, index); - - dest = _mesa_image_address2d(packing, pixels, width, height, - GL_COLOR_INDEX, type, i, 0); - - _mesa_pack_index_span(ctx, width, type, dest, index, - &ctx->Pack, ctx->_ImageTransferState); - } -} - - - -/** - * Read pixels for format=GL_DEPTH_COMPONENT. - */ -static void -read_depth_pixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct gl_renderbuffer *rb = fb->_DepthBuffer; - const GLboolean biasOrScale - = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; - - if (!rb) - return; - - /* clipping should have been done already */ - ASSERT(x >= 0); - ASSERT(y >= 0); - ASSERT(x + width <= (GLint) rb->Width); - ASSERT(y + height <= (GLint) rb->Height); - /* width should never be > MAX_WIDTH since we did clipping earlier */ - ASSERT(width <= MAX_WIDTH); - - if (type == GL_UNSIGNED_SHORT && fb->Visual.depthBits == 16 - && !biasOrScale && !packing->SwapBytes) { - /* Special case: directly read 16-bit unsigned depth values. */ - GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT16); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - for (j = 0; j < height; j++, y++) { - void *dest =_mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_COMPONENT, type, j, 0); - rb->GetRow(ctx, rb, width, x, y, dest); - } - } - else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 24 - && !biasOrScale && !packing->SwapBytes) { - /* Special case: directly read 24-bit unsigned depth values. */ - GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT24); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - for (j = 0; j < height; j++, y++) { - GLuint *dest = (GLuint *) - _mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_COMPONENT, type, j, 0); - GLint k; - rb->GetRow(ctx, rb, width, x, y, dest); - /* convert range from 24-bit to 32-bit */ - for (k = 0; k < width; k++) { - /* Note: put MSByte of 24-bit value into LSByte */ - dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff); - } - } - } - else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 32 - && !biasOrScale && !packing->SwapBytes) { - /* Special case: directly read 32-bit unsigned depth values. */ - GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - for (j = 0; j < height; j++, y++) { - void *dest = _mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_COMPONENT, type, j, 0); - rb->GetRow(ctx, rb, width, x, y, dest); - } - } - else { - /* General case (slower) */ - GLint j; - for (j = 0; j < height; j++, y++) { - GLfloat depthValues[MAX_WIDTH]; - GLvoid *dest = _mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_COMPONENT, type, j, 0); - _swrast_read_depth_span_float(ctx, rb, width, x, y, depthValues); - _mesa_pack_depth_span(ctx, width, dest, type, depthValues, packing); - } - } -} - - -/** - * Read pixels for format=GL_STENCIL_INDEX. - */ -static void -read_stencil_pixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - GLint j; - - if (!rb) - return; - - /* width should never be > MAX_WIDTH since we did clipping earlier */ - ASSERT(width <= MAX_WIDTH); - - /* process image row by row */ - for (j=0;jReadBuffer->_ColorReadBuffer; - - if (!rb) - return GL_FALSE; - - ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); - - /* clipping should have already been done */ - ASSERT(x + width <= (GLint) rb->Width); - ASSERT(y + height <= (GLint) rb->Height); - - /* check for things we can't handle here */ - if (transferOps || - packing->SwapBytes || - packing->LsbFirst) { - return GL_FALSE; - } - - if (format == GL_RGBA && rb->DataType == type) { - const GLint dstStride = _mesa_image_row_stride(packing, width, - format, type); - GLubyte *dest - = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height, - format, type, 0, 0); - GLint row; - ASSERT(rb->GetRow); - for (row = 0; row < height; row++) { - rb->GetRow(ctx, rb, width, x, y + row, dest); - dest += dstStride; - } - return GL_TRUE; - } - - if (format == GL_RGB && - rb->DataType == GL_UNSIGNED_BYTE && - type == GL_UNSIGNED_BYTE) { - const GLint dstStride = _mesa_image_row_stride(packing, width, - format, type); - GLubyte *dest - = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height, - format, type, 0, 0); - GLint row; - ASSERT(rb->GetRow); - for (row = 0; row < height; row++) { - GLubyte tempRow[MAX_WIDTH][4]; - GLint col; - rb->GetRow(ctx, rb, width, x, y + row, tempRow); - /* convert RGBA to RGB */ - for (col = 0; col < width; col++) { - dest[col * 3 + 0] = tempRow[col][0]; - dest[col * 3 + 1] = tempRow[col][1]; - dest[col * 3 + 2] = tempRow[col][2]; - } - dest += dstStride; - } - return GL_TRUE; - } - - /* not handled */ - return GL_FALSE; -} - - -/** - * When we're using a low-precision color buffer (like 16-bit 5/6/5) - * we have to adjust our color values a bit to pass conformance. - * The problem is when a 5 or 6-bit color value is convert to an 8-bit - * value and then a floating point value, the floating point values don't - * increment uniformly as the 5 or 6-bit value is incremented. - * - * This function adjusts floating point values to compensate. - */ -static void -adjust_colors(GLcontext *ctx, GLuint n, GLfloat rgba[][4]) -{ - const GLuint rShift = 8 - ctx->Visual.redBits; - const GLuint gShift = 8 - ctx->Visual.greenBits; - const GLuint bShift = 8 - ctx->Visual.blueBits; - const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); - const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); - const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); - GLuint i; - for (i = 0; i < n; i++) { - GLint r, g, b; - /* convert float back to ubyte */ - CLAMPED_FLOAT_TO_UBYTE(r, rgba[i][RCOMP]); - CLAMPED_FLOAT_TO_UBYTE(g, rgba[i][GCOMP]); - CLAMPED_FLOAT_TO_UBYTE(b, rgba[i][BCOMP]); - /* using only the N most significant bits of the ubyte value, convert to - * float in [0,1]. - */ - rgba[i][RCOMP] = (GLfloat) (r >> rShift) * rScale; - rgba[i][GCOMP] = (GLfloat) (g >> gShift) * gScale; - rgba[i][BCOMP] = (GLfloat) (b >> bShift) * bScale; - } -} - - - -/* - * Read R, G, B, A, RGB, L, or LA pixels. - */ -static void -read_rgba_pixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLbitfield transferOps = ctx->_ImageTransferState; - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct gl_renderbuffer *rb = fb->_ColorReadBuffer; - - if (!rb) - return; - - if (type == GL_FLOAT && ((ctx->Color.ClampReadColor == GL_TRUE) || - (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB && - rb->DataType != GL_FLOAT))) - transferOps |= IMAGE_CLAMP_BIT; - - /* Try optimized path first */ - if (fast_read_rgba_pixels(ctx, x, y, width, height, - format, type, pixels, packing, transferOps)) { - return; /* done! */ - } - - /* width should never be > MAX_WIDTH since we did clipping earlier */ - ASSERT(width <= MAX_WIDTH); - - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - GLfloat *dest, *src, *tmpImage, *convImage; - GLint row; - - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!tmpImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); - return; - } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); - if (!convImage) { - _mesa_free(tmpImage); - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); - return; - } - - /* read full RGBA, FLOAT image */ - dest = tmpImage; - for (row = 0; row < height; row++, y++) { - if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest); - } - else { - GLuint index[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y, index); - _mesa_apply_ci_transfer_ops(ctx, - transferOps & IMAGE_SHIFT_OFFSET_BIT, - width, index); - _mesa_map_ci_to_rgba(ctx, width, index, (GLfloat (*)[4]) dest); - } - _mesa_apply_rgba_transfer_ops(ctx, - transferOps & IMAGE_PRE_CONVOLUTION_BITS, - width, (GLfloat (*)[4]) dest); - dest += width * 4; - } - - /* do convolution */ - if (ctx->Pixel.Convolution2DEnabled) { - _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage); - } - else { - ASSERT(ctx->Pixel.Separable2DEnabled); - _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); - } - _mesa_free(tmpImage); - - /* finish transfer ops and pack the resulting image */ - src = convImage; - for (row = 0; row < height; row++) { - GLvoid *dest; - dest = _mesa_image_address2d(packing, pixels, width, height, - format, type, row, 0); - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src, - format, type, dest, packing, - transferOps & IMAGE_POST_CONVOLUTION_BITS); - src += width * 4; - } - _mesa_free(convImage); - } - else { - /* no convolution */ - const GLint dstStride - = _mesa_image_row_stride(packing, width, format, type); - GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0]; - GLint row; - GLubyte *dst - = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height, - format, type, 0, 0); - - /* make sure we don't apply 1D convolution */ - transferOps &= ~(IMAGE_CONVOLUTION_BIT | - IMAGE_POST_CONVOLUTION_SCALE_BIAS); - - for (row = 0; row < height; row++, y++) { - - /* Get float rgba pixels */ - if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba); - } - else { - /* read CI and convert to RGBA */ - GLuint index[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y, index); - _mesa_apply_ci_transfer_ops(ctx, - transferOps & IMAGE_SHIFT_OFFSET_BIT, - width, index); - _mesa_map_ci_to_rgba(ctx, width, index, rgba); - } - - /* apply fudge factor for shallow color buffers */ - if (fb->Visual.redBits < 8 || - fb->Visual.greenBits < 8 || - fb->Visual.blueBits < 8) { - adjust_colors(ctx, width, rgba); - } - - /* pack the row of RGBA pixels into user's buffer */ - _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst, - packing, transferOps); - - dst += dstStride; - } - } -} - - -/** - * Read combined depth/stencil values. - * We'll have already done error checking to be sure the expected - * depth and stencil buffers really exist. - */ -static void -read_depth_stencil_pixels(GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - const GLboolean scaleOrBias - = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; - const GLboolean stencilTransfer = ctx->Pixel.IndexShift - || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag; - struct gl_renderbuffer *depthRb, *stencilRb; - - depthRb = ctx->ReadBuffer->_DepthBuffer; - stencilRb = ctx->ReadBuffer->_StencilBuffer; - - if (!depthRb || !stencilRb) - return; - - depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; - stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; - - if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT && - stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT && - depthRb == stencilRb && - !scaleOrBias && - !stencilTransfer) { - /* This is the ideal case. - * Reading GL_DEPTH_STENCIL pixels from combined depth/stencil buffer. - * Plus, no pixel transfer ops to worry about! - */ - GLint i; - GLint dstStride = _mesa_image_row_stride(packing, width, - GL_DEPTH_STENCIL_EXT, type); - GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, pixels, - width, height, - GL_DEPTH_STENCIL_EXT, - type, 0, 0); - for (i = 0; i < height; i++) { - depthRb->GetRow(ctx, depthRb, width, x, y + i, dst); - dst += dstStride; - } - } - else { - /* Reading GL_DEPTH_STENCIL pixels from separate depth/stencil buffers, - * or we need pixel transfer. - */ - GLint i; - depthRb = ctx->ReadBuffer->_DepthBuffer; - stencilRb = ctx->ReadBuffer->_StencilBuffer; - - for (i = 0; i < height; i++) { - GLstencil stencilVals[MAX_WIDTH]; - - GLuint *depthStencilDst = (GLuint *) - _mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_STENCIL_EXT, type, i, 0); - - _swrast_read_stencil_span(ctx, stencilRb, width, - x, y + i, stencilVals); - - if (!scaleOrBias && !stencilTransfer - && ctx->ReadBuffer->Visual.depthBits == 24) { - /* ideal case */ - GLuint zVals[MAX_WIDTH]; /* 24-bit values! */ - GLint j; - ASSERT(depthRb->DataType == GL_UNSIGNED_INT); - /* note, we've already been clipped */ - depthRb->GetRow(ctx, depthRb, width, x, y + i, zVals); - for (j = 0; j < width; j++) { - depthStencilDst[j] = (zVals[j] << 8) | (stencilVals[j] & 0xff); - } - } - else { - /* general case */ - GLfloat depthVals[MAX_WIDTH]; - _swrast_read_depth_span_float(ctx, depthRb, width, x, y + i, - depthVals); - _mesa_pack_depth_stencil_span(ctx, width, depthStencilDst, - depthVals, stencilVals, packing); - } - } - } -} - - - -/** - * Software fallback routine for ctx->Driver.ReadPixels(). - * By time we get here, all error checking will have been done. - */ -void -_swrast_ReadPixels( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *packing, - GLvoid *pixels ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_pixelstore_attrib clippedPacking = *packing; - - /* Need to do RENDER_START before clipping or anything else since this - * is where a driver may grab the hw lock and get an updated window - * size. - */ - RENDER_START(swrast, ctx); - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (swrast->NewState) - _swrast_validate_derived( ctx ); - - /* Do all needed clipping here, so that we can forget about it later */ - if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { - /* The ReadPixels region is totally outside the window bounds */ - RENDER_FINISH(swrast, ctx); - return; - } - - pixels = _mesa_map_readpix_pbo(ctx, &clippedPacking, pixels); - if (!pixels) - return; - - switch (format) { - case GL_COLOR_INDEX: - read_index_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); - break; - case GL_STENCIL_INDEX: - read_stencil_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); - break; - case GL_DEPTH_COMPONENT: - read_depth_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); - 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_RGBA: - case GL_BGR: - case GL_BGRA: - case GL_ABGR_EXT: - read_rgba_pixels(ctx, x, y, width, height, - format, type, pixels, &clippedPacking); - break; - case GL_DEPTH_STENCIL_EXT: - read_depth_stencil_pixels(ctx, x, y, width, height, - type, pixels, &clippedPacking); - break; - default: - _mesa_problem(ctx, "unexpected format in _swrast_ReadPixels"); - /* don't return yet, clean-up */ - } - - RENDER_FINISH(swrast, ctx); - - _mesa_unmap_readpix_pbo(ctx, &clippedPacking); -} diff --git a/src/libs/mesa/mesa/swrast/s_span.c b/src/libs/mesa/mesa/swrast/s_span.c deleted file mode 100644 index f07014fabd..0000000000 --- a/src/libs/mesa/mesa/swrast/s_span.c +++ /dev/null @@ -1,1755 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file swrast/s_span.c - * \brief Span processing functions used by all rasterization functions. - * This is where all the per-fragment tests are performed - * \author Brian Paul - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/image.h" - -#include "s_atifragshader.h" -#include "s_alpha.h" -#include "s_blend.h" -#include "s_context.h" -#include "s_depth.h" -#include "s_fog.h" -#include "s_logic.h" -#include "s_masking.h" -#include "s_fragprog.h" -#include "s_span.h" -#include "s_stencil.h" -#include "s_texcombine.h" - - -/** - * Set default fragment attributes for the span using the - * current raster values. Used prior to glDraw/CopyPixels - * and glBitmap. - */ -void -_swrast_span_default_attribs(GLcontext *ctx, SWspan *span) -{ - /* Z*/ - { - const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; - if (ctx->DrawBuffer->Visual.depthBits <= 16) - span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); - else { - GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; - tmpf = MIN2(tmpf, depthMax); - span->z = (GLint)tmpf; - } - span->zStep = 0; - span->interpMask |= SPAN_Z; - } - - /* W (for perspective correction) */ - span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0; - span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0; - span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; - - /* primary color, or color index */ - if (ctx->Visual.rgbMode) { - GLchan r, g, b, a; - UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); -#if CHAN_TYPE == GL_FLOAT - span->red = r; - span->green = g; - span->blue = b; - span->alpha = a; -#else - span->red = IntToFixed(r); - span->green = IntToFixed(g); - span->blue = IntToFixed(b); - span->alpha = IntToFixed(a); -#endif - span->redStep = 0; - span->greenStep = 0; - span->blueStep = 0; - span->alphaStep = 0; - span->interpMask |= SPAN_RGBA; - - COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - } - else { - span->index = FloatToFixed(ctx->Current.RasterIndex); - span->indexStep = 0; - span->interpMask |= SPAN_INDEX; - } - - /* Secondary color */ - if (ctx->Visual.rgbMode && (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)) - { - COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); - } - - /* fog */ - { - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLfloat fogVal; /* a coord or a blend factor */ - if (swrast->_PreferPixelFog) { - /* fog blend factors will be computed from fog coordinates per pixel */ - fogVal = ctx->Current.RasterDistance; - } - else { - /* fog blend factor should be computed from fogcoord now */ - fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); - } - span->attrStart[FRAG_ATTRIB_FOGC][0] = fogVal; - span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; - span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; - } - - /* texcoords */ - { - GLuint i; - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - const GLuint attr = FRAG_ATTRIB_TEX0 + i; - const GLfloat *tc = ctx->Current.RasterTexCoords[i]; - if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { - COPY_4V(span->attrStart[attr], tc); - } - else if (tc[3] > 0.0F) { - /* use (s/q, t/q, r/q, 1) */ - span->attrStart[attr][0] = tc[0] / tc[3]; - span->attrStart[attr][1] = tc[1] / tc[3]; - span->attrStart[attr][2] = tc[2] / tc[3]; - span->attrStart[attr][3] = 1.0; - } - else { - ASSIGN_4V(span->attrStart[attr], 0.0F, 0.0F, 0.0F, 1.0F); - } - ASSIGN_4V(span->attrStepX[attr], 0.0F, 0.0F, 0.0F, 0.0F); - ASSIGN_4V(span->attrStepY[attr], 0.0F, 0.0F, 0.0F, 0.0F); - } - } -} - - -/** - * Interpolate the active attributes (and'd with attrMask) to - * fill in span->array->attribs[]. - * Perspective correction will be done. The point/line/triangle function - * should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]! - */ -static INLINE void -interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - - /* - * Don't overwrite existing array values, such as colors that may have - * been produced by glDraw/CopyPixels. - */ - attrMask &= ~span->arrayAttribs; - - ATTRIB_LOOP_BEGIN - if (attrMask & (1 << attr)) { - const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; - const GLfloat dv0dx = span->attrStepX[attr][0]; - const GLfloat dv1dx = span->attrStepX[attr][1]; - const GLfloat dv2dx = span->attrStepX[attr][2]; - const GLfloat dv3dx = span->attrStepX[attr][3]; - GLfloat v0 = span->attrStart[attr][0]; - GLfloat v1 = span->attrStart[attr][1]; - GLfloat v2 = span->attrStart[attr][2]; - GLfloat v3 = span->attrStart[attr][3]; - GLuint k; - for (k = 0; k < span->end; k++) { - const GLfloat invW = 1.0f / w; - span->array->attribs[attr][k][0] = v0 * invW; - span->array->attribs[attr][k][1] = v1 * invW; - span->array->attribs[attr][k][2] = v2 * invW; - span->array->attribs[attr][k][3] = v3 * invW; - v0 += dv0dx; - v1 += dv1dx; - v2 += dv2dx; - v3 += dv3dx; - w += dwdx; - } - ASSERT((span->arrayAttribs & (1 << attr)) == 0); - span->arrayAttribs |= (1 << attr); - } - ATTRIB_LOOP_END -} - - -/** - * Interpolate primary colors to fill in the span->array->rgba8 (or rgb16) - * color array. - */ -static INLINE void -interpolate_int_colors(GLcontext *ctx, SWspan *span) -{ - const GLuint n = span->end; - GLuint i; - -#if CHAN_BITS != 32 - ASSERT(!(span->arrayMask & SPAN_RGBA)); -#endif - - switch (span->array->ChanType) { -#if CHAN_BITS != 32 - case GL_UNSIGNED_BYTE: - { - GLubyte (*rgba)[4] = span->array->rgba8; - if (span->interpMask & SPAN_FLAT) { - GLubyte color[4]; - color[RCOMP] = FixedToInt(span->red); - color[GCOMP] = FixedToInt(span->green); - color[BCOMP] = FixedToInt(span->blue); - color[ACOMP] = FixedToInt(span->alpha); - for (i = 0; i < n; i++) { - COPY_4UBV(rgba[i], color); - } - } - else { - GLfixed r = span->red; - GLfixed g = span->green; - GLfixed b = span->blue; - GLfixed a = span->alpha; - GLint dr = span->redStep; - GLint dg = span->greenStep; - GLint db = span->blueStep; - GLint da = span->alphaStep; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = FixedToChan(r); - rgba[i][GCOMP] = FixedToChan(g); - rgba[i][BCOMP] = FixedToChan(b); - rgba[i][ACOMP] = FixedToChan(a); - r += dr; - g += dg; - b += db; - a += da; - } - } - } - break; - case GL_UNSIGNED_SHORT: - { - GLushort (*rgba)[4] = span->array->rgba16; - if (span->interpMask & SPAN_FLAT) { - GLushort color[4]; - color[RCOMP] = FixedToInt(span->red); - color[GCOMP] = FixedToInt(span->green); - color[BCOMP] = FixedToInt(span->blue); - color[ACOMP] = FixedToInt(span->alpha); - for (i = 0; i < n; i++) { - COPY_4V(rgba[i], color); - } - } - else { - GLushort (*rgba)[4] = span->array->rgba16; - GLfixed r, g, b, a; - GLint dr, dg, db, da; - r = span->red; - g = span->green; - b = span->blue; - a = span->alpha; - dr = span->redStep; - dg = span->greenStep; - db = span->blueStep; - da = span->alphaStep; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = FixedToChan(r); - rgba[i][GCOMP] = FixedToChan(g); - rgba[i][BCOMP] = FixedToChan(b); - rgba[i][ACOMP] = FixedToChan(a); - r += dr; - g += dg; - b += db; - a += da; - } - } - } - break; -#endif - case GL_FLOAT: - interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); - break; - default: - _mesa_problem(NULL, "bad datatype in interpolate_int_colors"); - } - span->arrayMask |= SPAN_RGBA; -} - - -/** - * Populate the FRAG_ATTRIB_COL0 array. - */ -static INLINE void -interpolate_float_colors(SWspan *span) -{ - GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - const GLuint n = span->end; - GLuint i; - - assert(!(span->arrayAttribs & FRAG_BIT_COL0)); - - if (span->arrayMask & SPAN_RGBA) { - /* convert array of int colors */ - for (i = 0; i < n; i++) { - col0[i][0] = UBYTE_TO_FLOAT(span->array->rgba8[i][0]); - col0[i][1] = UBYTE_TO_FLOAT(span->array->rgba8[i][1]); - col0[i][2] = UBYTE_TO_FLOAT(span->array->rgba8[i][2]); - col0[i][3] = UBYTE_TO_FLOAT(span->array->rgba8[i][3]); - } - } - else { - /* interpolate red/green/blue/alpha to get float colors */ - ASSERT(span->interpMask & SPAN_RGBA); - if (span->interpMask & SPAN_FLAT) { - GLfloat r = FixedToFloat(span->red); - GLfloat g = FixedToFloat(span->green); - GLfloat b = FixedToFloat(span->blue); - GLfloat a = FixedToFloat(span->alpha); - for (i = 0; i < n; i++) { - ASSIGN_4V(col0[i], r, g, b, a); - } - } - else { - GLfloat r = FixedToFloat(span->red); - GLfloat g = FixedToFloat(span->green); - GLfloat b = FixedToFloat(span->blue); - GLfloat a = FixedToFloat(span->alpha); - GLfloat dr = FixedToFloat(span->redStep); - GLfloat dg = FixedToFloat(span->greenStep); - GLfloat db = FixedToFloat(span->blueStep); - GLfloat da = FixedToFloat(span->alphaStep); - for (i = 0; i < n; i++) { - col0[i][0] = r; - col0[i][1] = g; - col0[i][2] = b; - col0[i][3] = a; - r += dr; - g += dg; - b += db; - a += da; - } - } - } - - span->arrayAttribs |= FRAG_BIT_COL0; - span->array->ChanType = GL_FLOAT; -} - - - -/* Fill in the span.color.index array from the interpolation values */ -static INLINE void -interpolate_indexes(GLcontext *ctx, SWspan *span) -{ - GLfixed index = span->index; - const GLint indexStep = span->indexStep; - const GLuint n = span->end; - GLuint *indexes = span->array->index; - GLuint i; - (void) ctx; - - ASSERT(!(span->arrayMask & SPAN_INDEX)); - - if ((span->interpMask & SPAN_FLAT) || (indexStep == 0)) { - /* constant color */ - index = FixedToInt(index); - for (i = 0; i < n; i++) { - indexes[i] = index; - } - } - else { - /* interpolate */ - for (i = 0; i < n; i++) { - indexes[i] = FixedToInt(index); - index += indexStep; - } - } - span->arrayMask |= SPAN_INDEX; - span->interpMask &= ~SPAN_INDEX; -} - - -/** - * Fill in the span.zArray array from the span->z, zStep values. - */ -void -_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ) -{ - const GLuint n = span->end; - GLuint i; - - ASSERT(!(span->arrayMask & SPAN_Z)); - - if (ctx->DrawBuffer->Visual.depthBits <= 16) { - GLfixed zval = span->z; - GLuint *z = span->array->z; - for (i = 0; i < n; i++) { - z[i] = FixedToInt(zval); - zval += span->zStep; - } - } - else { - /* Deep Z buffer, no fixed->int shift */ - GLuint zval = span->z; - GLuint *z = span->array->z; - for (i = 0; i < n; i++) { - z[i] = zval; - zval += span->zStep; - } - } - span->interpMask &= ~SPAN_Z; - span->arrayMask |= SPAN_Z; -} - - -/** - * Compute mipmap LOD from partial derivatives. - * This the ideal solution, as given in the OpenGL spec. - */ -GLfloat -_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, - GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, - GLfloat s, GLfloat t, GLfloat q, GLfloat invQ) -{ - GLfloat dudx = texW * ((s + dsdx) / (q + dqdx) - s * invQ); - GLfloat dvdx = texH * ((t + dtdx) / (q + dqdx) - t * invQ); - GLfloat dudy = texW * ((s + dsdy) / (q + dqdy) - s * invQ); - GLfloat dvdy = texH * ((t + dtdy) / (q + dqdy) - t * invQ); - GLfloat x = SQRTF(dudx * dudx + dvdx * dvdx); - GLfloat y = SQRTF(dudy * dudy + dvdy * dvdy); - GLfloat rho = MAX2(x, y); - GLfloat lambda = LOG2(rho); - return lambda; -} - - -/** - * Compute mipmap LOD from partial derivatives. - * This is a faster approximation than above function. - */ -#if 0 -GLfloat -_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, - GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, - GLfloat s, GLfloat t, GLfloat q, GLfloat invQ) -{ - GLfloat dsdx2 = (s + dsdx) / (q + dqdx) - s * invQ; - GLfloat dtdx2 = (t + dtdx) / (q + dqdx) - t * invQ; - GLfloat dsdy2 = (s + dsdy) / (q + dqdy) - s * invQ; - GLfloat dtdy2 = (t + dtdy) / (q + dqdy) - t * invQ; - GLfloat maxU, maxV, rho, lambda; - dsdx2 = FABSF(dsdx2); - dsdy2 = FABSF(dsdy2); - dtdx2 = FABSF(dtdx2); - dtdy2 = FABSF(dtdy2); - maxU = MAX2(dsdx2, dsdy2) * texW; - maxV = MAX2(dtdx2, dtdy2) * texH; - rho = MAX2(maxU, maxV); - lambda = LOG2(rho); - return lambda; -} -#endif - - -/** - * Fill in the span.array->attrib[FRAG_ATTRIB_TEXn] arrays from the - * using the attrStart/Step values. - * - * This function only used during fixed-function fragment processing. - * - * Note: in the places where we divide by Q (or mult by invQ) we're - * really doing two things: perspective correction and texcoord - * projection. Remember, for texcoord (s,t,r,q) we need to index - * texels with (s/q, t/q, r/q). - */ -static void -interpolate_texcoords(GLcontext *ctx, SWspan *span) -{ - const GLuint maxUnit - = (ctx->Texture._EnabledCoordUnits > 1) ? ctx->Const.MaxTextureUnits : 1; - GLuint u; - - /* XXX CoordUnits vs. ImageUnits */ - for (u = 0; u < maxUnit; u++) { - if (ctx->Texture._EnabledCoordUnits & (1 << u)) { - const GLuint attr = FRAG_ATTRIB_TEX0 + u; - const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; - GLfloat texW, texH; - GLboolean needLambda; - GLfloat (*texcoord)[4] = span->array->attribs[attr]; - GLfloat *lambda = span->array->lambda[u]; - const GLfloat dsdx = span->attrStepX[attr][0]; - const GLfloat dsdy = span->attrStepY[attr][0]; - const GLfloat dtdx = span->attrStepX[attr][1]; - const GLfloat dtdy = span->attrStepY[attr][1]; - const GLfloat drdx = span->attrStepX[attr][2]; - const GLfloat dqdx = span->attrStepX[attr][3]; - const GLfloat dqdy = span->attrStepY[attr][3]; - GLfloat s = span->attrStart[attr][0]; - GLfloat t = span->attrStart[attr][1]; - GLfloat r = span->attrStart[attr][2]; - GLfloat q = span->attrStart[attr][3]; - - if (obj) { - const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel]; - needLambda = (obj->MinFilter != obj->MagFilter) - || ctx->FragmentProgram._Current; - texW = img->WidthScale; - texH = img->HeightScale; - } - else { - /* using a fragment program */ - texW = 1.0; - texH = 1.0; - needLambda = GL_FALSE; - } - - if (needLambda) { - GLuint i; - if (ctx->FragmentProgram._Current - || ctx->ATIFragmentShader._Enabled) { - /* do perspective correction but don't divide s, t, r by q */ - const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; - for (i = 0; i < span->end; i++) { - const GLfloat invW = 1.0F / w; - texcoord[i][0] = s * invW; - texcoord[i][1] = t * invW; - texcoord[i][2] = r * invW; - texcoord[i][3] = q * invW; - lambda[i] = _swrast_compute_lambda(dsdx, dsdy, dtdx, dtdy, - dqdx, dqdy, texW, texH, - s, t, q, invW); - s += dsdx; - t += dtdx; - r += drdx; - q += dqdx; - w += dwdx; - } - } - else { - for (i = 0; i < span->end; i++) { - const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q); - texcoord[i][0] = s * invQ; - texcoord[i][1] = t * invQ; - texcoord[i][2] = r * invQ; - texcoord[i][3] = q; - lambda[i] = _swrast_compute_lambda(dsdx, dsdy, dtdx, dtdy, - dqdx, dqdy, texW, texH, - s, t, q, invQ); - s += dsdx; - t += dtdx; - r += drdx; - q += dqdx; - } - } - span->arrayMask |= SPAN_LAMBDA; - } - else { - GLuint i; - if (ctx->FragmentProgram._Current || - ctx->ATIFragmentShader._Enabled) { - /* do perspective correction but don't divide s, t, r by q */ - const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; - for (i = 0; i < span->end; i++) { - const GLfloat invW = 1.0F / w; - texcoord[i][0] = s * invW; - texcoord[i][1] = t * invW; - texcoord[i][2] = r * invW; - texcoord[i][3] = q * invW; - lambda[i] = 0.0; - s += dsdx; - t += dtdx; - r += drdx; - q += dqdx; - w += dwdx; - } - } - else if (dqdx == 0.0F) { - /* Ortho projection or polygon's parallel to window X axis */ - const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q); - for (i = 0; i < span->end; i++) { - texcoord[i][0] = s * invQ; - texcoord[i][1] = t * invQ; - texcoord[i][2] = r * invQ; - texcoord[i][3] = q; - lambda[i] = 0.0; - s += dsdx; - t += dtdx; - r += drdx; - } - } - else { - for (i = 0; i < span->end; i++) { - const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q); - texcoord[i][0] = s * invQ; - texcoord[i][1] = t * invQ; - texcoord[i][2] = r * invQ; - texcoord[i][3] = q; - lambda[i] = 0.0; - s += dsdx; - t += dtdx; - r += drdx; - q += dqdx; - } - } - } /* lambda */ - } /* if */ - } /* for */ -} - - -/** - * Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array. - */ -static INLINE void -interpolate_wpos(GLcontext *ctx, SWspan *span) -{ - GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS]; - GLuint i; - const GLfloat zScale = 1.0 / ctx->DrawBuffer->_DepthMaxF; - GLfloat w, dw; - - if (span->arrayMask & SPAN_XY) { - for (i = 0; i < span->end; i++) { - wpos[i][0] = (GLfloat) span->array->x[i]; - wpos[i][1] = (GLfloat) span->array->y[i]; - } - } - else { - for (i = 0; i < span->end; i++) { - wpos[i][0] = (GLfloat) span->x + i; - wpos[i][1] = (GLfloat) span->y; - } - } - - w = span->attrStart[FRAG_ATTRIB_WPOS][3]; - dw = span->attrStepX[FRAG_ATTRIB_WPOS][3]; - for (i = 0; i < span->end; i++) { - wpos[i][2] = (GLfloat) span->array->z[i] * zScale; - wpos[i][3] = w; - w += dw; - } -} - - -/** - * Apply the current polygon stipple pattern to a span of pixels. - */ -static INLINE void -stipple_polygon_span(GLcontext *ctx, SWspan *span) -{ - GLubyte *mask = span->array->mask; - - ASSERT(ctx->Polygon.StippleFlag); - - if (span->arrayMask & SPAN_XY) { - /* arrays of x/y pixel coords */ - GLuint i; - for (i = 0; i < span->end; i++) { - const GLint col = span->array->x[i] % 32; - const GLint row = span->array->y[i] % 32; - const GLuint stipple = ctx->PolygonStipple[row]; - if (((1 << col) & stipple) == 0) { - mask[i] = 0; - } - } - } - else { - /* horizontal span of pixels */ - const GLuint highBit = 1 << 31; - const GLuint stipple = ctx->PolygonStipple[span->y % 32]; - GLuint i, m = highBit >> (GLuint) (span->x % 32); - for (i = 0; i < span->end; i++) { - if ((m & stipple) == 0) { - mask[i] = 0; - } - m = m >> 1; - if (m == 0) { - m = highBit; - } - } - } - span->writeAll = GL_FALSE; -} - - -/** - * Clip a pixel span to the current buffer/window boundaries: - * DrawBuffer->_Xmin, _Xmax, _Ymin, _Ymax. This will accomplish - * window clipping and scissoring. - * Return: GL_TRUE some pixels still visible - * GL_FALSE nothing visible - */ -static INLINE GLuint -clip_span( GLcontext *ctx, SWspan *span ) -{ - const GLint xmin = ctx->DrawBuffer->_Xmin; - const GLint xmax = ctx->DrawBuffer->_Xmax; - const GLint ymin = ctx->DrawBuffer->_Ymin; - const GLint ymax = ctx->DrawBuffer->_Ymax; - - if (span->arrayMask & SPAN_XY) { - /* arrays of x/y pixel coords */ - const GLint *x = span->array->x; - const GLint *y = span->array->y; - const GLint n = span->end; - GLubyte *mask = span->array->mask; - GLint i; - if (span->arrayMask & SPAN_MASK) { - /* note: using & intead of && to reduce branches */ - for (i = 0; i < n; i++) { - mask[i] &= (x[i] >= xmin) & (x[i] < xmax) - & (y[i] >= ymin) & (y[i] < ymax); - } - } - else { - /* note: using & intead of && to reduce branches */ - for (i = 0; i < n; i++) { - mask[i] = (x[i] >= xmin) & (x[i] < xmax) - & (y[i] >= ymin) & (y[i] < ymax); - } - } - return GL_TRUE; /* some pixels visible */ - } - else { - /* horizontal span of pixels */ - const GLint x = span->x; - const GLint y = span->y; - const GLint n = span->end; - - /* Trivial rejection tests */ - if (y < ymin || y >= ymax || x + n <= xmin || x >= xmax) { - span->end = 0; - return GL_FALSE; /* all pixels clipped */ - } - - /* Clip to the left */ - if (x < xmin) { - ASSERT(x + n > xmin); - span->writeAll = GL_FALSE; - _mesa_bzero(span->array->mask, (xmin - x) * sizeof(GLubyte)); - } - - /* Clip to right */ - if (x + n > xmax) { - ASSERT(x < xmax); - span->end = xmax - x; - } - - return GL_TRUE; /* some pixels visible */ - } -} - - -/** - * Apply all the per-fragment opertions to a span of color index fragments - * and write them to the enabled color drawbuffers. - * The 'span' parameter can be considered to be const. Note that - * span->interpMask and span->arrayMask may be changed but will be restored - * to their original values before returning. - */ -void -_swrast_write_index_span( GLcontext *ctx, SWspan *span) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLbitfield origInterpMask = span->interpMask; - const GLbitfield origArrayMask = span->arrayMask; - struct gl_framebuffer *fb = ctx->DrawBuffer; - - ASSERT(span->end <= MAX_WIDTH); - ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || - span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); - ASSERT((span->interpMask | span->arrayMask) & SPAN_INDEX); - /* - ASSERT((span->interpMask & span->arrayMask) == 0); - */ - - if (span->arrayMask & SPAN_MASK) { - /* mask was initialized by caller, probably glBitmap */ - span->writeAll = GL_FALSE; - } - else { - _mesa_memset(span->array->mask, 1, span->end); - span->writeAll = GL_TRUE; - } - - /* Clipping */ - if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) { - if (!clip_span(ctx, span)) { - return; - } - } - - /* Depth bounds test */ - if (ctx->Depth.BoundsTest && fb->Visual.depthBits > 0) { - if (!_swrast_depth_bounds_test(ctx, span)) { - return; - } - } - -#ifdef DEBUG - /* Make sure all fragments are within window bounds */ - if (span->arrayMask & SPAN_XY) { - GLuint i; - for (i = 0; i < span->end; i++) { - if (span->array->mask[i]) { - assert(span->array->x[i] >= fb->_Xmin); - assert(span->array->x[i] < fb->_Xmax); - assert(span->array->y[i] >= fb->_Ymin); - assert(span->array->y[i] < fb->_Ymax); - } - } - } -#endif - - /* Polygon Stippling */ - if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) { - stipple_polygon_span(ctx, span); - } - - /* Stencil and Z testing */ - if (ctx->Depth.Test || ctx->Stencil.Enabled) { - if (!(span->arrayMask & SPAN_Z)) - _swrast_span_interpolate_z(ctx, span); - - if (ctx->Stencil.Enabled) { - if (!_swrast_stencil_and_ztest_span(ctx, span)) { - span->arrayMask = origArrayMask; - return; - } - } - else { - ASSERT(ctx->Depth.Test); - if (!_swrast_depth_test_span(ctx, span)) { - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - return; - } - } - } - -#if FEATURE_ARB_occlusion_query - if (ctx->Query.CurrentOcclusionObject) { - /* update count of 'passed' fragments */ - struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; - GLuint i; - for (i = 0; i < span->end; i++) - q->Result += span->array->mask[i]; - } -#endif - - /* we have to wait until after occlusion to do this test */ - if (ctx->Color.IndexMask == 0) { - /* write no pixels */ - span->arrayMask = origArrayMask; - return; - } - - /* Interpolate the color indexes if needed */ - if (swrast->_FogEnabled || - ctx->Color.IndexLogicOpEnabled || - ctx->Color.IndexMask != 0xffffffff || - (span->arrayMask & SPAN_COVERAGE)) { - if (!(span->arrayMask & SPAN_INDEX) /*span->interpMask & SPAN_INDEX*/) { - interpolate_indexes(ctx, span); - } - } - - /* Fog */ - if (swrast->_FogEnabled) { - _swrast_fog_ci_span(ctx, span); - } - - /* Antialias coverage application */ - if (span->arrayMask & SPAN_COVERAGE) { - const GLfloat *coverage = span->array->coverage; - GLuint *index = span->array->index; - GLuint i; - for (i = 0; i < span->end; i++) { - ASSERT(coverage[i] < 16); - index[i] = (index[i] & ~0xf) | ((GLuint) coverage[i]); - } - } - - /* - * Write to renderbuffers - */ - { - const GLuint numBuffers = fb->_NumColorDrawBuffers; - GLuint buf; - - for (buf = 0; buf < numBuffers; buf++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buf]; - GLuint indexSave[MAX_WIDTH]; - - ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); - - if (numBuffers > 1) { - /* save indexes for second, third renderbuffer writes */ - _mesa_memcpy(indexSave, span->array->index, - span->end * sizeof(indexSave[0])); - } - - if (ctx->Color.IndexLogicOpEnabled) { - _swrast_logicop_ci_span(ctx, rb, span); - } - - if (ctx->Color.IndexMask != 0xffffffff) { - _swrast_mask_ci_span(ctx, rb, span); - } - - if (!(span->arrayMask & SPAN_INDEX) && span->indexStep == 0) { - /* all fragments have same color index */ - GLubyte index8; - GLushort index16; - GLuint index32; - void *value; - - if (rb->DataType == GL_UNSIGNED_BYTE) { - index8 = FixedToInt(span->index); - value = &index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - index16 = FixedToInt(span->index); - value = &index16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - index32 = FixedToInt(span->index); - value = &index32; - } - - if (span->arrayMask & SPAN_XY) { - rb->PutMonoValues(ctx, rb, span->end, span->array->x, - span->array->y, value, span->array->mask); - } - else { - rb->PutMonoRow(ctx, rb, span->end, span->x, span->y, - value, span->array->mask); - } - } - else { - /* each fragment is a different color */ - GLubyte index8[MAX_WIDTH]; - GLushort index16[MAX_WIDTH]; - void *values; - - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLuint k; - for (k = 0; k < span->end; k++) { - index8[k] = (GLubyte) span->array->index[k]; - } - values = index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLuint k; - for (k = 0; k < span->end; k++) { - index16[k] = (GLushort) span->array->index[k]; - } - values = index16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - values = span->array->index; - } - - if (span->arrayMask & SPAN_XY) { - rb->PutValues(ctx, rb, span->end, - span->array->x, span->array->y, - values, span->array->mask); - } - else { - rb->PutRow(ctx, rb, span->end, span->x, span->y, - values, span->array->mask); - } - } - - if (buf + 1 < numBuffers) { - /* restore original span values */ - _mesa_memcpy(span->array->index, indexSave, - span->end * sizeof(indexSave[0])); - } - } /* for buf */ - } - - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; -} - - -/** - * Add specular colors to primary colors. - * Only called during fixed-function operation. - * Result is float color array (FRAG_ATTRIB_COL0). - */ -static INLINE void -add_specular(GLcontext *ctx, SWspan *span) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLubyte *mask = span->array->mask; - GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; - GLuint i; - - ASSERT(!ctx->FragmentProgram._Current); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1); - (void) swrast; /* silence warning */ - - if (span->array->ChanType == GL_FLOAT) { - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); - } - } - else { - /* need float colors */ - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_float_colors(span); - } - } - - if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) { - /* XXX could avoid this and interpolate COL1 in the loop below */ - interpolate_active_attribs(ctx, span, FRAG_BIT_COL1); - } - - ASSERT(span->arrayAttribs & FRAG_BIT_COL0); - ASSERT(span->arrayAttribs & FRAG_BIT_COL1); - - for (i = 0; i < span->end; i++) { - if (mask[i]) { - col0[i][0] += col1[i][0]; - col0[i][1] += col1[i][1]; - col0[i][2] += col1[i][2]; - } - } - - span->array->ChanType = GL_FLOAT; -} - - -/** - * Apply antialiasing coverage value to alpha values. - */ -static INLINE void -apply_aa_coverage(SWspan *span) -{ - const GLfloat *coverage = span->array->coverage; - GLuint i; - if (span->array->ChanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = span->array->rgba8; - for (i = 0; i < span->end; i++) { - const GLfloat a = rgba[i][ACOMP] * coverage[i]; - rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0); - ASSERT(coverage[i] >= 0.0); - ASSERT(coverage[i] <= 1.0); - } - } - else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - GLushort (*rgba)[4] = span->array->rgba16; - for (i = 0; i < span->end; i++) { - const GLfloat a = rgba[i][ACOMP] * coverage[i]; - rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0, 65535.0); - } - } - else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - for (i = 0; i < span->end; i++) { - rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i]; - /* clamp later */ - } - } -} - - -/** - * Clamp span's float colors to [0,1] - */ -static INLINE void -clamp_colors(SWspan *span) -{ - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - GLuint i; - ASSERT(span->array->ChanType == GL_FLOAT); - for (i = 0; i < span->end; i++) { - rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); - rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); - rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); - rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); - } -} - - -/** - * Convert the span's color arrays to the given type. - * The only way 'output' can be greater than zero is when we have a fragment - * program that writes to gl_FragData[1] or higher. - * \param output which fragment program color output is being processed - */ -static INLINE void -convert_color_type(SWspan *span, GLenum newType, GLuint output) -{ - GLvoid *src, *dst; - - if (output > 0 || span->array->ChanType == GL_FLOAT) { - src = span->array->attribs[FRAG_ATTRIB_COL0 + output]; - span->array->ChanType = GL_FLOAT; - } - else if (span->array->ChanType == GL_UNSIGNED_BYTE) { - src = span->array->rgba8; - } - else { - ASSERT(span->array->ChanType == GL_UNSIGNED_SHORT); - src = span->array->rgba16; - } - - if (newType == GL_UNSIGNED_BYTE) { - dst = span->array->rgba8; - } - else if (newType == GL_UNSIGNED_SHORT) { - dst = span->array->rgba16; - } - else { - dst = span->array->attribs[FRAG_ATTRIB_COL0]; - } - - _mesa_convert_colors(span->array->ChanType, src, - newType, dst, - span->end, span->array->mask); - - span->array->ChanType = newType; - span->array->rgba = dst; -} - - - -/** - * Apply fragment shader, fragment program or normal texturing to span. - */ -static INLINE void -shade_texture_span(GLcontext *ctx, SWspan *span) -{ - GLbitfield inputsRead; - - /* Determine which fragment attributes are actually needed */ - if (ctx->FragmentProgram._Current) { - inputsRead = ctx->FragmentProgram._Current->Base.InputsRead; - } - else { - /* XXX we could be a bit smarter about this */ - inputsRead = ~0; - } - - if (ctx->FragmentProgram._Current || - ctx->ATIFragmentShader._Enabled) { - /* programmable shading */ - if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) { - convert_color_type(span, GL_FLOAT, 0); - } - if (span->primitive != GL_POINT || - (span->interpMask & SPAN_RGBA) || - ctx->Point.PointSprite) { - /* for single-pixel points, we populated the arrays already */ - interpolate_active_attribs(ctx, span, ~0); - } - span->array->ChanType = GL_FLOAT; - - if (!(span->arrayMask & SPAN_Z)) - _swrast_span_interpolate_z (ctx, span); - -#if 0 - if (inputsRead & FRAG_BIT_WPOS) -#else - /* XXX always interpolate wpos so that DDX/DDY work */ -#endif - interpolate_wpos(ctx, span); - - /* Run fragment program/shader now */ - if (ctx->FragmentProgram._Current) { - _swrast_exec_fragment_program(ctx, span); - } - else { - ASSERT(ctx->ATIFragmentShader._Enabled); - _swrast_exec_fragment_shader(ctx, span); - } - } - else if (ctx->Texture._EnabledUnits) { - /* conventional texturing */ - -#if CHAN_BITS == 32 - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_int_colors(ctx, span); - } -#else - if (!(span->arrayMask & SPAN_RGBA)) - interpolate_int_colors(ctx, span); -#endif - if ((span->arrayAttribs & FRAG_BITS_TEX_ANY) == 0x0) - interpolate_texcoords(ctx, span); - - _swrast_texture_span(ctx, span); - } -} - - - -/** - * Apply all the per-fragment operations to a span. - * This now includes texturing (_swrast_write_texture_span() is history). - * This function may modify any of the array values in the span. - * span->interpMask and span->arrayMask may be changed but will be restored - * to their original values before returning. - */ -void -_swrast_write_rgba_span( GLcontext *ctx, SWspan *span) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); - const GLbitfield origInterpMask = span->interpMask; - const GLbitfield origArrayMask = span->arrayMask; - const GLbitfield origArrayAttribs = span->arrayAttribs; - const GLenum origChanType = span->array->ChanType; - void * const origRgba = span->array->rgba; - const GLboolean shader = (ctx->FragmentProgram._Current - || ctx->ATIFragmentShader._Enabled); - const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits; - struct gl_framebuffer *fb = ctx->DrawBuffer; - - /* - printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, - span->interpMask, span->arrayMask); - */ - - ASSERT(span->primitive == GL_POINT || - span->primitive == GL_LINE || - span->primitive == GL_POLYGON || - span->primitive == GL_BITMAP); - ASSERT(span->end <= MAX_WIDTH); - - /* Fragment write masks */ - if (span->arrayMask & SPAN_MASK) { - /* mask was initialized by caller, probably glBitmap */ - span->writeAll = GL_FALSE; - } - else { - _mesa_memset(span->array->mask, 1, span->end); - span->writeAll = GL_TRUE; - } - - /* Clip to window/scissor box */ - if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) { - if (!clip_span(ctx, span)) { - return; - } - } - -#ifdef DEBUG - /* Make sure all fragments are within window bounds */ - if (span->arrayMask & SPAN_XY) { - GLuint i; - for (i = 0; i < span->end; i++) { - if (span->array->mask[i]) { - assert(span->array->x[i] >= fb->_Xmin); - assert(span->array->x[i] < fb->_Xmax); - assert(span->array->y[i] >= fb->_Ymin); - assert(span->array->y[i] < fb->_Ymax); - } - } - } -#endif - - /* Polygon Stippling */ - if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) { - stipple_polygon_span(ctx, span); - } - - /* This is the normal place to compute the fragment color/Z - * from texturing or shading. - */ - if (shaderOrTexture && !swrast->_DeferredTexture) { - shade_texture_span(ctx, span); - } - - /* Do the alpha test */ - if (ctx->Color.AlphaEnabled) { - if (!_swrast_alpha_test(ctx, span)) { - goto end; - } - } - - /* Stencil and Z testing */ - if (ctx->Stencil.Enabled || ctx->Depth.Test) { - if (!(span->arrayMask & SPAN_Z)) - _swrast_span_interpolate_z(ctx, span); - - if (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0) { - /* Combined Z/stencil tests */ - if (!_swrast_stencil_and_ztest_span(ctx, span)) { - goto end; - } - } - else if (fb->Visual.depthBits > 0) { - /* Just regular depth testing */ - ASSERT(ctx->Depth.Test); - ASSERT(span->arrayMask & SPAN_Z); - if (!_swrast_depth_test_span(ctx, span)) { - goto end; - } - } - } - -#if FEATURE_ARB_occlusion_query - if (ctx->Query.CurrentOcclusionObject) { - /* update count of 'passed' fragments */ - struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; - GLuint i; - for (i = 0; i < span->end; i++) - q->Result += span->array->mask[i]; - } -#endif - - /* We had to wait until now to check for glColorMask(0,0,0,0) because of - * the occlusion test. - */ - if (colorMask == 0x0) { - goto end; - } - - /* If we were able to defer fragment color computation to now, there's - * a good chance that many fragments will have already been killed by - * Z/stencil testing. - */ - if (shaderOrTexture && swrast->_DeferredTexture) { - shade_texture_span(ctx, span); - } - -#if CHAN_BITS == 32 - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); - } -#else - if ((span->arrayMask & SPAN_RGBA) == 0) { - interpolate_int_colors(ctx, span); - } -#endif - - ASSERT(span->arrayMask & SPAN_RGBA); - - if (!shader) { - /* Add base and specular colors */ - if (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - add_specular(ctx, span); - } - } - - /* Fog */ - if (swrast->_FogEnabled) { - _swrast_fog_rgba_span(ctx, span); - } - - /* Antialias coverage application */ - if (span->arrayMask & SPAN_COVERAGE) { - apply_aa_coverage(span); - } - - /* Clamp color/alpha values over the range [0.0, 1.0] before storage */ - if (ctx->Color.ClampFragmentColor == GL_TRUE && - span->array->ChanType == GL_FLOAT) { - clamp_colors(span); - } - - /* - * Write to renderbuffers. - * Depending on glDrawBuffer() state and the which color outputs are - * written by the fragment shader, we may either replicate one color to - * all renderbuffers or write a different color to each renderbuffer. - * multiFragOutputs=TRUE for the later case. - */ - { - const GLuint numBuffers = fb->_NumColorDrawBuffers; - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - const GLboolean multiFragOutputs = - (fp && fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0)); - GLuint buf; - - for (buf = 0; buf < numBuffers; buf++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buf]; - - /* color[fragOutput] will be written to buffer[buf] */ - - if (rb) { - GLchan rgbaSave[MAX_WIDTH][4]; - const GLuint fragOutput = multiFragOutputs ? buf : 0; - - if (rb->DataType != span->array->ChanType || fragOutput > 0) { - convert_color_type(span, rb->DataType, fragOutput); - } - - if (!multiFragOutputs && numBuffers > 1) { - /* save colors for second, third renderbuffer writes */ - _mesa_memcpy(rgbaSave, span->array->rgba, - 4 * span->end * sizeof(GLchan)); - } - - ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); - - if (ctx->Color._LogicOpEnabled) { - _swrast_logicop_rgba_span(ctx, rb, span); - } - else if (ctx->Color.BlendEnabled) { - _swrast_blend_span(ctx, rb, span); - } - - if (colorMask != 0xffffffff) { - _swrast_mask_rgba_span(ctx, rb, span); - } - - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - ASSERT(rb->PutValues); - rb->PutValues(ctx, rb, span->end, - span->array->x, span->array->y, - span->array->rgba, span->array->mask); - } - else { - /* horizontal run of pixels */ - ASSERT(rb->PutRow); - rb->PutRow(ctx, rb, span->end, span->x, span->y, - span->array->rgba, - span->writeAll ? NULL: span->array->mask); - } - - if (!multiFragOutputs && numBuffers > 1) { - /* restore original span values */ - _mesa_memcpy(span->array->rgba, rgbaSave, - 4 * span->end * sizeof(GLchan)); - } - - } /* if rb */ - } /* for buf */ - } - -end: - /* restore these values before returning */ - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - span->arrayAttribs = origArrayAttribs; - span->array->ChanType = origChanType; - span->array->rgba = origRgba; -} - - -/** - * Read RGBA pixels from a renderbuffer. Clipping will be done to prevent - * reading ouside the buffer's boundaries. - * \param dstType datatype for returned colors - * \param rgba the returned colors - */ -void -_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLenum dstType, - GLvoid *rgba) -{ - const GLint bufWidth = (GLint) rb->Width; - const GLint bufHeight = (GLint) rb->Height; - - if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { - /* completely above, below, or right */ - /* XXX maybe leave rgba values undefined? */ - _mesa_bzero(rgba, 4 * n * sizeof(GLchan)); - } - else { - GLint skip, length; - if (x < 0) { - /* left edge clipping */ - skip = -x; - length = (GLint) n - skip; - if (length < 0) { - /* completely left of window */ - return; - } - if (length > bufWidth) { - length = bufWidth; - } - } - else if ((GLint) (x + n) > bufWidth) { - /* right edge clipping */ - skip = 0; - length = bufWidth - x; - if (length < 0) { - /* completely to right of window */ - return; - } - } - else { - /* no clipping */ - skip = 0; - length = (GLint) n; - } - - ASSERT(rb); - ASSERT(rb->GetRow); - ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); - - if (rb->DataType == dstType) { - rb->GetRow(ctx, rb, length, x + skip, y, - (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(rb->DataType)); - } - else { - GLuint temp[MAX_WIDTH * 4]; - rb->GetRow(ctx, rb, length, x + skip, y, temp); - _mesa_convert_colors(rb->DataType, temp, - dstType, (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(dstType), - length, NULL); - } - } -} - - -/** - * Read CI pixels from a renderbuffer. Clipping will be done to prevent - * reading ouside the buffer's boundaries. - */ -void -_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint index[] ) -{ - const GLint bufWidth = (GLint) rb->Width; - const GLint bufHeight = (GLint) rb->Height; - - if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { - /* completely above, below, or right */ - _mesa_bzero(index, n * sizeof(GLuint)); - } - else { - GLint skip, length; - if (x < 0) { - /* left edge clipping */ - skip = -x; - length = (GLint) n - skip; - if (length < 0) { - /* completely left of window */ - return; - } - if (length > bufWidth) { - length = bufWidth; - } - } - else if ((GLint) (x + n) > bufWidth) { - /* right edge clipping */ - skip = 0; - length = bufWidth - x; - if (length < 0) { - /* completely to right of window */ - return; - } - } - else { - /* no clipping */ - skip = 0; - length = (GLint) n; - } - - ASSERT(rb->GetRow); - ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); - - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLubyte index8[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, length, x + skip, y, index8); - for (i = 0; i < length; i++) - index[skip + i] = index8[i]; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort index16[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, length, x + skip, y, index16); - for (i = 0; i < length; i++) - index[skip + i] = index16[i]; - } - else if (rb->DataType == GL_UNSIGNED_INT) { - rb->GetRow(ctx, rb, length, x + skip, y, index + skip); - } - } -} - - -/** - * Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid - * reading values outside the buffer bounds. - * We can use this for reading any format/type of renderbuffer. - * \param valueSize is the size in bytes of each value (pixel) put into the - * values array. - */ -void -_swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - void *values, GLuint valueSize) -{ - GLuint i, inCount = 0, inStart = 0; - - for (i = 0; i < count; i++) { - if (x[i] >= 0 && y[i] >= 0 && - x[i] < (GLint) rb->Width && y[i] < (GLint) rb->Height) { - /* inside */ - if (inCount == 0) - inStart = i; - inCount++; - } - else { - if (inCount > 0) { - /* read [inStart, inStart + inCount) */ - rb->GetValues(ctx, rb, inCount, x + inStart, y + inStart, - (GLubyte *) values + inStart * valueSize); - inCount = 0; - } - } - } - if (inCount > 0) { - /* read last values */ - rb->GetValues(ctx, rb, inCount, x + inStart, y + inStart, - (GLubyte *) values + inStart * valueSize); - } -} - - -/** - * Wrapper for gl_renderbuffer::PutRow() which does clipping. - * \param valueSize size of each value (pixel) in bytes - */ -void -_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const GLvoid *values, GLuint valueSize) -{ - GLint skip = 0; - - if (y < 0 || y >= (GLint) rb->Height) - return; /* above or below */ - - if (x + (GLint) count <= 0 || x >= (GLint) rb->Width) - return; /* entirely left or right */ - - if ((GLint) (x + count) > (GLint) rb->Width) { - /* right clip */ - GLint clip = x + count - rb->Width; - count -= clip; - } - - if (x < 0) { - /* left clip */ - skip = -x; - x = 0; - count -= skip; - } - - rb->PutRow(ctx, rb, count, x, y, - (const GLubyte *) values + skip * valueSize, NULL); -} - - -/** - * Wrapper for gl_renderbuffer::GetRow() which does clipping. - * \param valueSize size of each value (pixel) in bytes - */ -void -_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - GLvoid *values, GLuint valueSize) -{ - GLint skip = 0; - - if (y < 0 || y >= (GLint) rb->Height) - return; /* above or below */ - - if (x + (GLint) count <= 0 || x >= (GLint) rb->Width) - return; /* entirely left or right */ - - if (x + count > rb->Width) { - /* right clip */ - GLint clip = x + count - rb->Width; - count -= clip; - } - - if (x < 0) { - /* left clip */ - skip = -x; - x = 0; - count -= skip; - } - - rb->GetRow(ctx, rb, count, x, y, (GLubyte *) values + skip * valueSize); -} - - -/** - * Get RGBA pixels from the given renderbuffer. Put the pixel colors into - * the span's specular color arrays. The specular color arrays should no - * longer be needed by time this function is called. - * Used by blending, logicop and masking functions. - * \return pointer to the colors we read. - */ -void * -_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType); - void *rbPixels; - - /* - * Point rbPixels to a temporary space (use specular color arrays). - */ - rbPixels = span->array->attribs[FRAG_ATTRIB_COL1]; - - /* Get destination values from renderbuffer */ - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - rbPixels, pixelSize); - } - else { - _swrast_get_row(ctx, rb, span->end, span->x, span->y, - rbPixels, pixelSize); - } - - return rbPixels; -} diff --git a/src/libs/mesa/mesa/swrast/s_span.h b/src/libs/mesa/mesa/swrast/s_span.h deleted file mode 100644 index c4b47df58f..0000000000 --- a/src/libs/mesa/mesa/swrast/s_span.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 S_SPAN_H -#define S_SPAN_H - - -#include "swrast.h" - - -/** - * \defgroup SpanFlags - * Special bitflags to describe span data. - * - * In general, the point/line/triangle functions interpolate/emit the - * attributes specified by swrast->_ActiveAttribs (i.e. FRAT_BIT_* values). - * Some things don't fit into that, though, so we have these flags. - */ -/*@{*/ -#define SPAN_RGBA 0x01 /**< interpMask and arrayMask */ -#define SPAN_INDEX 0x02 /**< interpMask and arrayMask */ -#define SPAN_Z 0x04 /**< interpMask and arrayMask */ -#define SPAN_FLAT 0x08 /**< interpMask: flat shading? */ -#define SPAN_XY 0x10 /**< array.x[], y[] valid? */ -#define SPAN_MASK 0x20 /**< was array.mask[] filled in by caller? */ -#define SPAN_LAMBDA 0x40 /**< array.lambda[] valid? */ -#define SPAN_COVERAGE 0x80 /**< array.coverage[] valid? */ -/*@}*/ - - -/** - * \sw_span_arrays - * \brief Arrays of fragment values. - * - * These will either be computed from the span x/xStep values or - * filled in by glDraw/CopyPixels, etc. - * These arrays are separated out of sw_span to conserve memory. - */ -typedef struct sw_span_arrays -{ - /** Per-fragment attributes (indexed by FRAG_ATTRIB_* tokens) */ - /* XXX someday look at transposing first two indexes for better memory - * access pattern. - */ - GLfloat attribs[FRAG_ATTRIB_MAX][MAX_WIDTH][4]; - - /** This mask indicates which fragments are alive or culled */ - GLubyte mask[MAX_WIDTH]; - - GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */ - - /** Attribute arrays that don't fit into attribs[] array above */ - /*@{*/ - GLubyte rgba8[MAX_WIDTH][4]; - GLushort rgba16[MAX_WIDTH][4]; - GLchan (*rgba)[4]; /** either == rgba8 or rgba16 */ - GLint x[MAX_WIDTH]; /**< fragment X coords */ - GLint y[MAX_WIDTH]; /**< fragment Y coords */ - GLuint z[MAX_WIDTH]; /**< fragment Z coords */ - GLuint index[MAX_WIDTH]; /**< Color indexes */ - GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; /**< Texture LOD */ - GLfloat coverage[MAX_WIDTH]; /**< Fragment coverage for AA/smoothing */ - /*@}*/ -} SWspanarrays; - - -/** - * The SWspan structure describes the colors, Z, fogcoord, texcoords, - * etc for either a horizontal run or an array of independent pixels. - * We can either specify a base/step to indicate interpolated values, or - * fill in explicit arrays of values. The interpMask and arrayMask bitfields - * indicate which attributes are active interpolants or arrays, respectively. - * - * It would be interesting to experiment with multiprocessor rasterization - * with this structure. The triangle rasterizer could simply emit a - * stream of these structures which would be consumed by one or more - * span-processing threads which could run in parallel. - */ -typedef struct sw_span -{ - /** Coord of first fragment in horizontal span/run */ - GLint x, y; - - /** Number of fragments in the span */ - GLuint end; - - /** This flag indicates that mask[] array is effectively filled with ones */ - GLboolean writeAll; - - /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */ - GLenum primitive; - - /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */ - GLuint facing; - - /** - * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates - * which of the attrStart/StepX/StepY variables are relevant. - */ - GLbitfield interpMask; - - /** Fragment attribute interpolants */ - GLfloat attrStart[FRAG_ATTRIB_MAX][4]; /**< initial value */ - GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; /**< dvalue/dx */ - GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; /**< dvalue/dy */ - - /* XXX the rest of these will go away eventually... */ - - /* For horizontal spans, step is the partial derivative wrt X. - * For lines, step is the delta from one fragment to the next. - */ - GLfixed red, redStep; - GLfixed green, greenStep; - GLfixed blue, blueStep; - GLfixed alpha, alphaStep; - GLfixed index, indexStep; - GLfixed z, zStep; /**< XXX z should probably be GLuint */ - GLfixed intTex[2], intTexStep[2]; /**< (s,t) for unit[0] only */ - - /** - * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates - * which of the fragment arrays in the span_arrays struct are relevant. - */ - GLbitfield arrayMask; - - GLbitfield arrayAttribs; - - /** - * We store the arrays of fragment values in a separate struct so - * that we can allocate sw_span structs on the stack without using - * a lot of memory. The span_arrays struct is about 1.4MB while the - * sw_span struct is only about 512 bytes. - */ - SWspanarrays *array; -} SWspan; - - - -#define INIT_SPAN(S, PRIMITIVE) \ -do { \ - (S).primitive = (PRIMITIVE); \ - (S).interpMask = 0x0; \ - (S).arrayMask = 0x0; \ - (S).arrayAttribs = 0x0; \ - (S).end = 0; \ - (S).facing = 0; \ - (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ -} while (0) - - - -extern void -_swrast_span_default_attribs(GLcontext *ctx, SWspan *span); - -extern void -_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ); - -extern GLfloat -_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, - GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, - GLfloat s, GLfloat t, GLfloat q, GLfloat invQ); - -extern void -_swrast_write_index_span( GLcontext *ctx, SWspan *span); - - -extern void -_swrast_write_rgba_span( GLcontext *ctx, SWspan *span); - - -extern void -_swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba); - -extern void -_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint indx[] ); - -extern void -_swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - void *values, GLuint valueSize); - -extern void -_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const GLvoid *values, GLuint valueSize); - -extern void -_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - GLvoid *values, GLuint valueSize); - - -extern void * -_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_spantemp.h b/src/libs/mesa/mesa/swrast/s_spantemp.h deleted file mode 100644 index bab2ca7378..0000000000 --- a/src/libs/mesa/mesa/swrast/s_spantemp.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -/* - * Templates for the span/pixel-array write/read functions called via - * the gl_renderbuffer's GetRow, GetValues, PutRow, PutMonoRow, PutValues - * and PutMonoValues functions. - * - * Define the following macros before including this file: - * NAME(BASE) to generate the function name (i.e. add prefix or suffix) - * RB_TYPE the renderbuffer DataType - * CI_MODE if set, color index mode, else RGBA - * SPAN_VARS to declare any local variables - * INIT_PIXEL_PTR(P, X, Y) to initialize a pointer to a pixel - * INC_PIXEL_PTR(P) to increment a pixel pointer by one pixel - * STORE_PIXEL(DST, X, Y, VALUE) to store pixel values in buffer - * FETCH_PIXEL(DST, SRC) to fetch pixel values from buffer - * - * Note that in the STORE_PIXEL macros, we also pass in the (X,Y) coordinates - * for the pixels to be stored. This is useful when dithering and probably - * ignored otherwise. - */ - -#include "main/macros.h" - - -#ifdef CI_MODE -#define RB_COMPONENTS 1 -#elif !defined(RB_COMPONENTS) -#define RB_COMPONENTS 4 -#endif - - -static void -NAME(get_row)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, void *values ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else - RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - for (i = 0; i < count; i++) { - FETCH_PIXEL(dest[i], pixel); - INC_PIXEL_PTR(pixel); - } - (void) rb; -} - - -static void -NAME(get_values)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], void *values ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else - RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif - GLuint i; - for (i = 0; i < count; i++) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - FETCH_PIXEL(dest[i], pixel); - } - (void) rb; -} - - -static void -NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *values, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE (*src)[RB_COMPONENTS] = (const RB_TYPE (*)[RB_COMPONENTS]) values; - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - if (mask) { - for (i = 0; i < count; i++) { - if (mask[i]) { - STORE_PIXEL(pixel, x + i, y, src[i]); - } - INC_PIXEL_PTR(pixel); - } - } - else { - for (i = 0; i < count; i++) { - STORE_PIXEL(pixel, x + i, y, src[i]); - INC_PIXEL_PTR(pixel); - } - } - (void) rb; -} - - -#if !defined(CI_MODE) -static void -NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *values, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE (*src)[3] = (const RB_TYPE (*)[3]) values; - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { -#ifdef STORE_PIXEL_RGB - STORE_PIXEL_RGB(pixel, x + i, y, src[i]); -#else - STORE_PIXEL(pixel, x + i, y, src[i]); -#endif - } - INC_PIXEL_PTR(pixel); - } - (void) rb; -} -#endif - - -static void -NAME(put_mono_row)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *value, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE *src = (const RB_TYPE *) value; - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - if (mask) { - for (i = 0; i < count; i++) { - if (mask[i]) { - STORE_PIXEL(pixel, x + i, y, src); - } - INC_PIXEL_PTR(pixel); - } - } - else { - for (i = 0; i < count; i++) { - STORE_PIXEL(pixel, x + i, y, src); - INC_PIXEL_PTR(pixel); - } - } - (void) rb; -} - - -static void -NAME(put_values)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *values, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE (*src)[RB_COMPONENTS] = (const RB_TYPE (*)[RB_COMPONENTS]) values; - GLuint i; - ASSERT(mask); - for (i = 0; i < count; i++) { - if (mask[i]) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - STORE_PIXEL(pixel, x[i], y[i], src[i]); - } - } - (void) rb; -} - - -static void -NAME(put_mono_values)( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE *src = (const RB_TYPE *) value; - GLuint i; - ASSERT(mask); - for (i = 0; i < count; i++) { - if (mask[i]) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - STORE_PIXEL(pixel, x[i], y[i], src); - } - } - (void) rb; -} - - -#undef NAME -#undef RB_TYPE -#undef RB_COMPONENTS -#undef CI_MODE -#undef SPAN_VARS -#undef INIT_PIXEL_PTR -#undef INC_PIXEL_PTR -#undef STORE_PIXEL -#undef STORE_PIXEL_RGB -#undef FETCH_PIXEL diff --git a/src/libs/mesa/mesa/swrast/s_stencil.c b/src/libs/mesa/mesa/swrast/s_stencil.c deleted file mode 100644 index 2e84ddec71..0000000000 --- a/src/libs/mesa/mesa/swrast/s_stencil.c +++ /dev/null @@ -1,1250 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_stencil.h" -#include "s_span.h" - - - -/* Stencil Logic: - -IF stencil test fails THEN - Apply fail-op to stencil value - Don't write the pixel (RGBA,Z) -ELSE - IF doing depth test && depth test fails THEN - Apply zfail-op to stencil value - Write RGBA and Z to appropriate buffers - ELSE - Apply zpass-op to stencil value -ENDIF - -*/ - - -/** - * Apply the given stencil operator to the array of stencil values. - * Don't touch stencil[i] if mask[i] is zero. - * Input: n - size of stencil array - * oper - the stencil buffer operator - * face - 0 or 1 for front or back face operation - * 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( const GLcontext *ctx, GLenum oper, GLuint face, - GLuint n, GLstencil stencil[], const GLubyte mask[] ) -{ - const GLstencil ref = ctx->Stencil.Ref[face]; - const GLstencil wrtmask = ctx->Stencil.WriteMask[face]; - const GLstencil invmask = (GLstencil) (~wrtmask); - const GLstencil stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - GLuint i; - - switch (oper) { - case GL_KEEP: - /* do nothing */ - break; - case GL_ZERO: - if (invmask==0) { - for (i=0;i0) { - stencil[i] = (GLstencil) (s-1); - } - } - } - } - else { - for (i=0;i0) { - stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1))); - } - } - } - } - break; - case GL_INCR_WRAP_EXT: - if (invmask==0) { - for (i=0;iStencil.ValueMask[face]; - - ASSERT(n <= MAX_WIDTH); - - /* - * Perform stencil test. The results of this operation are stored - * in the fail[] array: - * IF fail[i] is non-zero THEN - * the stencil fail operator is to be applied - * ELSE - * the stencil fail operator is not to be applied - * ENDIF - */ - switch (ctx->Stencil.Function[face]) { - case GL_NEVER: - /* never pass; always fail */ - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;i s) { - /* passed */ - fail[i] = 0; - } - else { - fail[i] = 1; - mask[i] = 0; - } - } - else { - fail[i] = 0; - } - } - break; - case GL_GEQUAL: - r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); - for (i=0;i= s) { - /* passed */ - fail[i] = 0; - } - else { - fail[i] = 1; - mask[i] = 0; - } - } - else { - fail[i] = 0; - } - } - break; - case GL_EQUAL: - r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.FailFunc[face] != GL_KEEP) { - apply_stencil_op( ctx, ctx->Stencil.FailFunc[face], face, n, stencil, fail ); - } - - return !allfail; -} - - -/** - * Compute the zpass/zfail masks by comparing the pre- and post-depth test - * masks. - */ -static INLINE void -compute_pass_fail_masks(GLuint n, const GLubyte origMask[], - const GLubyte newMask[], - GLubyte passMask[], GLubyte failMask[]) -{ - GLuint i; - for (i = 0; i < n; i++) { - ASSERT(newMask[i] == 0 || newMask[i] == 1); - passMask[i] = origMask[i] & newMask[i]; - failMask[i] = origMask[i] & (newMask[i] ^ 1); - } -} - - -/** - * 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_FALSE - all fragments failed the testing - * GL_TRUE - one or more fragments passed the testing - * - */ -static GLboolean -stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - GLstencil stencilRow[MAX_WIDTH]; - GLstencil *stencil; - const GLuint n = span->end; - const GLint x = span->x; - const GLint y = span->y; - GLubyte *mask = span->array->mask; - - ASSERT((span->arrayMask & SPAN_XY) == 0); - ASSERT(ctx->Stencil.Enabled); - ASSERT(n <= MAX_WIDTH); -#ifdef DEBUG - if (ctx->Depth.Test) { - ASSERT(span->arrayMask & SPAN_Z); - } -#endif - - stencil = (GLstencil *) rb->GetPointer(ctx, rb, x, y); - if (!stencil) { - rb->GetRow(ctx, rb, n, x, y, stencilRow); - stencil = stencilRow; - } - - /* - * Apply the stencil test to the fragments. - * failMask[i] is 1 if the stencil test failed. - */ - if (do_stencil_test( ctx, face, n, stencil, mask ) == GL_FALSE) { - /* all fragments failed the stencil test, we're done. */ - span->writeAll = GL_FALSE; - if (!rb->GetPointer(ctx, rb, 0, 0)) { - /* put updated stencil values into buffer */ - rb->PutRow(ctx, rb, n, x, y, stencil, NULL); - } - 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. - */ - apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face, n, stencil, mask ); - } - else { - /* - * Perform depth buffering, then apply zpass or zfail stencil function. - */ - GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH]; - - /* save the current mask bits */ - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); - - /* apply the depth test */ - _swrast_depth_test_span(ctx, span); - - compute_pass_fail_masks(n, origMask, mask, passMask, failMask); - - /* apply the pass and fail operations */ - if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { - apply_stencil_op( ctx, ctx->Stencil.ZFailFunc[face], face, - n, stencil, failMask ); - } - if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) { - apply_stencil_op( ctx, ctx->Stencil.ZPassFunc[face], face, - n, stencil, passMask ); - } - } - - /* - * Write updated stencil values back into hardware stencil buffer. - */ - if (!rb->GetPointer(ctx, rb, 0, 0)) { - rb->PutRow(ctx, rb, n, x, y, stencil, NULL); - } - - span->writeAll = GL_FALSE; - - return GL_TRUE; /* one or more fragments passed both tests */ -} - - - -/* - * Return the address of a stencil buffer value given the window coords: - */ -#define STENCIL_ADDRESS(X, Y) (stencilStart + (Y) * stride + (X)) - - - -/** - * Apply the given stencil operator for each pixel in the array whose - * mask flag is set. - * \note 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, GLuint face, const GLubyte mask[] ) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - const GLstencil stencilMax = (1 << fb->Visual.stencilBits) - 1; - const GLstencil ref = ctx->Stencil.Ref[face]; - const GLstencil wrtmask = ctx->Stencil.WriteMask[face]; - const GLstencil invmask = (GLstencil) (~wrtmask); - GLuint i; - GLstencil *stencilStart = (GLubyte *) rb->Data; - const GLuint stride = rb->Width; - - ASSERT(rb->GetPointer(ctx, rb, 0, 0)); - ASSERT(sizeof(GLstencil) == 1); - - switch (oper) { - case GL_KEEP: - /* do nothing */ - break; - case GL_ZERO: - if (invmask==0) { - for (i=0;i0) { - *sptr = (GLstencil) (*sptr - 1); - } - } - } - } - else { - for (i=0;i0) { - *sptr = (GLstencil) ((invmask & *sptr) | (wrtmask & (*sptr-1))); - } - } - } - } - break; - case GL_INCR_WRAP_EXT: - if (invmask==0) { - for (i=0;iDrawBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - GLubyte fail[MAX_WIDTH]; - GLstencil r, s; - GLuint i; - GLboolean allfail = GL_FALSE; - const GLuint valueMask = ctx->Stencil.ValueMask[face]; - const GLstencil *stencilStart = (GLstencil *) rb->Data; - const GLuint stride = rb->Width; - - ASSERT(rb->GetPointer(ctx, rb, 0, 0)); - ASSERT(sizeof(GLstencil) == 1); - - /* - * Perform stencil test. The results of this operation are stored - * in the fail[] array: - * IF fail[i] is non-zero THEN - * the stencil fail operator is to be applied - * ELSE - * the stencil fail operator is not to be applied - * ENDIF - */ - - switch (ctx->Stencil.Function[face]) { - case GL_NEVER: - /* always fail */ - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;i s) { - /* passed */ - fail[i] = 0; - } - else { - fail[i] = 1; - mask[i] = 0; - } - } - else { - fail[i] = 0; - } - } - break; - case GL_GEQUAL: - r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); - for (i=0;i= s) { - /* passed */ - fail[i] = 0; - } - else { - fail[i] = 1; - mask[i] = 0; - } - } - else { - fail[i] = 0; - } - } - break; - case GL_EQUAL: - r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); - for (i=0;iStencil.Ref[face] & valueMask); - for (i=0;iStencil.FailFunc[face] != GL_KEEP) { - apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc[face], - face, fail ); - } - - return !allfail; -} - - - - -/** - * 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_ztest_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 - * 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_FALSE - all fragments failed the testing - * GL_TRUE - one or more fragments passed the testing - */ -static GLboolean -stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) -{ - GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH]; - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - const GLuint n = span->end; - const GLint *x = span->array->x; - const GLint *y = span->array->y; - GLubyte *mask = span->array->mask; - - ASSERT(span->arrayMask & SPAN_XY); - ASSERT(ctx->Stencil.Enabled); - ASSERT(n <= MAX_WIDTH); - - if (!rb->GetPointer(ctx, rb, 0, 0)) { - /* No direct access */ - GLstencil stencil[MAX_WIDTH]; - - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); - - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); - - (void) do_stencil_test(ctx, face, n, stencil, mask); - - if (ctx->Depth.Test == GL_FALSE) { - apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face, - n, stencil, mask); - } - else { - GLubyte tmpMask[MAX_WIDTH]; - _mesa_memcpy(tmpMask, mask, n * sizeof(GLubyte)); - - _swrast_depth_test_span(ctx, span); - - compute_pass_fail_masks(n, tmpMask, mask, passMask, failMask); - - if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { - apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face, - n, stencil, failMask); - } - if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) { - apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face, - n, stencil, passMask); - } - } - - /* Write updated stencil values into hardware stencil buffer */ - rb->PutValues(ctx, rb, n, x, y, stencil, origMask); - - return GL_TRUE; - } - else { - /* Direct access to stencil buffer */ - - if (stencil_test_pixels(ctx, face, n, x, y, mask) == GL_FALSE) { - /* all fragments failed the stencil test, we're done. */ - return GL_FALSE; - } - - if (ctx->Depth.Test==GL_FALSE) { - apply_stencil_op_to_pixels(ctx, n, x, y, - ctx->Stencil.ZPassFunc[face], face, mask); - } - else { - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); - - _swrast_depth_test_span(ctx, span); - - compute_pass_fail_masks(n, origMask, mask, passMask, failMask); - - if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { - apply_stencil_op_to_pixels(ctx, n, x, y, - ctx->Stencil.ZFailFunc[face], - face, failMask); - } - if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) { - apply_stencil_op_to_pixels(ctx, n, x, y, - ctx->Stencil.ZPassFunc[face], - face, passMask); - } - } - - return GL_TRUE; /* one or more fragments passed both tests */ - } -} - - -/** - * /return GL_TRUE = one or more fragments passed, - * GL_FALSE = all fragments failed. - */ -GLboolean -_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span) -{ - const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace; - - if (span->arrayMask & SPAN_XY) - return stencil_and_ztest_pixels(ctx, span, face); - else - return stencil_and_ztest_span(ctx, span, face); -} - - -#if 0 -GLuint -clip_span(GLuint bufferWidth, GLuint bufferHeight, - GLint x, GLint y, GLuint *count) -{ - GLuint n = *count; - GLuint skipPixels = 0; - - if (y < 0 || y >= bufferHeight || x + n <= 0 || x >= bufferWidth) { - /* totally out of bounds */ - n = 0; - } - else { - /* left clip */ - if (x < 0) { - skipPixels = -x; - x = 0; - n -= skipPixels; - } - /* right clip */ - if (x + n > bufferWidth) { - GLint dx = x + n - bufferWidth; - n -= dx; - } - } - - *count = n; - - return skipPixels; -} -#endif - - -/** - * 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 -_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLstencil stencil[]) -{ - if (y < 0 || y >= (GLint) rb->Height || - x + n <= 0 || x >= (GLint) rb->Width) { - /* span is completely outside framebuffer */ - return; /* undefined values OK */ - } - - if (x < 0) { - GLint dx = -x; - x = 0; - n -= dx; - stencil += dx; - } - if (x + n > (GLint) rb->Width) { - GLint dx = x + n - rb->Width; - n -= dx; - } - if (n <= 0) { - return; - } - - rb->GetRow(ctx, rb, n, x, y, stencil); -} - - - -/** - * Write a span of stencil values to the stencil buffer. This function - * applies the stencil write mask when needed. - * Used for glDraw/CopyPixels - * Input: n - how many pixels - * x, y - location of first pixel - * stencil - the array of stencil values - */ -void -_swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y, - const GLstencil stencil[] ) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_StencilBuffer; - const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1; - const GLuint stencilMask = ctx->Stencil.WriteMask[0]; - - if (y < 0 || y >= (GLint) rb->Height || - x + n <= 0 || x >= (GLint) rb->Width) { - /* span is completely outside framebuffer */ - return; /* undefined values OK */ - } - if (x < 0) { - GLint dx = -x; - x = 0; - n -= dx; - stencil += dx; - } - if (x + n > (GLint) rb->Width) { - GLint dx = x + n - rb->Width; - n -= dx; - } - if (n <= 0) { - return; - } - - if ((stencilMask & stencilMax) != stencilMax) { - /* need to apply writemask */ - GLstencil destVals[MAX_WIDTH], newVals[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, n, x, y, destVals); - for (i = 0; i < n; i++) { - newVals[i] - = (stencil[i] & stencilMask) | (destVals[i] & ~stencilMask); - } - rb->PutRow(ctx, rb, n, x, y, newVals, NULL); - } - else { - rb->PutRow(ctx, rb, n, x, y, stencil, NULL); - } -} - - - -/** - * Clear the stencil buffer. - */ -void -_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) -{ - const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits; - const GLuint mask = ctx->Stencil.WriteMask[0]; - const GLuint invMask = ~mask; - const GLuint clearVal = (ctx->Stencil.Clear & mask); - const GLuint stencilMax = (1 << stencilBits) - 1; - GLint x, y, width, height; - - if (!rb || mask == 0) - return; - - ASSERT(rb->DataType == GL_UNSIGNED_BYTE || - rb->DataType == GL_UNSIGNED_SHORT); - - ASSERT(rb->_BaseFormat == GL_STENCIL_INDEX); - - /* compute region to clear */ - x = ctx->DrawBuffer->_Xmin; - y = ctx->DrawBuffer->_Ymin; - width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - - if (rb->GetPointer(ctx, rb, 0, 0)) { - /* Direct buffer access */ - if ((mask & stencilMax) != stencilMax) { - /* need to mask the clear */ - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLint i, j; - for (i = 0; i < height; i++) { - GLubyte *stencil = (GLubyte*) rb->GetPointer(ctx, rb, x, y + i); - for (j = 0; j < width; j++) { - stencil[j] = (stencil[j] & invMask) | clearVal; - } - } - } - else { - GLint i, j; - for (i = 0; i < height; i++) { - GLushort *stencil = (GLushort*) rb->GetPointer(ctx, rb, x, y + i); - for (j = 0; j < width; j++) { - stencil[j] = (stencil[j] & invMask) | clearVal; - } - } - } - } - else { - /* no bit masking */ - if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) { - /* optimized case */ - /* Note: bottom-to-top raster assumed! */ - GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y); - GLuint len = width * height * sizeof(GLubyte); - _mesa_memset(stencil, clearVal, len); - } - else { - /* general case */ - GLint i; - for (i = 0; i < height; i++) { - GLvoid *stencil = rb->GetPointer(ctx, rb, x, y + i); - if (rb->DataType == GL_UNSIGNED_BYTE) { - _mesa_memset(stencil, clearVal, width); - } - else { - _mesa_memset16((short unsigned int*) stencil, clearVal, width); - } - } - } - } - } - else { - /* no direct access */ - if ((mask & stencilMax) != stencilMax) { - /* need to mask the clear */ - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLint i, j; - for (i = 0; i < height; i++) { - GLubyte stencil[MAX_WIDTH]; - rb->GetRow(ctx, rb, width, x, y + i, stencil); - for (j = 0; j < width; j++) { - stencil[j] = (stencil[j] & invMask) | clearVal; - } - rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL); - } - } - else { - GLint i, j; - for (i = 0; i < height; i++) { - GLushort stencil[MAX_WIDTH]; - rb->GetRow(ctx, rb, width, x, y + i, stencil); - for (j = 0; j < width; j++) { - stencil[j] = (stencil[j] & invMask) | clearVal; - } - rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL); - } - } - } - else { - /* no bit masking */ - const GLubyte clear8 = (GLubyte) clearVal; - const GLushort clear16 = (GLushort) clearVal; - const void *clear; - GLint i; - if (rb->DataType == GL_UNSIGNED_BYTE) { - clear = &clear8; - } - else { - clear = &clear16; - } - for (i = 0; i < height; i++) { - rb->PutMonoRow(ctx, rb, width, x, y + i, clear, NULL); - } - } - } -} diff --git a/src/libs/mesa/mesa/swrast/s_stencil.h b/src/libs/mesa/mesa/swrast/s_stencil.h deleted file mode 100644 index cd6cbc57b0..0000000000 --- a/src/libs/mesa/mesa/swrast/s_stencil.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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 S_STENCIL_H -#define S_STENCIL_H - - -#include "swrast.h" - - - -extern GLboolean -_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span); - - -extern void -_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, - GLint n, GLint x, GLint y, GLstencil stencil[]); - - -extern void -_swrast_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, - const GLstencil stencil[] ); - - -extern void -_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_texcombine.c b/src/libs/mesa/mesa/swrast/s_texcombine.c deleted file mode 100644 index 632d650007..0000000000 --- a/src/libs/mesa/mesa/swrast/s_texcombine.c +++ /dev/null @@ -1,1172 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/image.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/pixel.h" - -#include "s_context.h" -#include "s_texcombine.h" - - -#define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) ) -#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) ) -#if CHAN_BITS == 32 -typedef GLfloat ChanTemp; -#else -typedef GLuint ChanTemp; -#endif - - -/** - * Do texture application for GL_ARB/EXT_texture_env_combine. - * This function also supports GL_{EXT,ARB}_texture_env_dot3 and - * GL_ATI_texture_env_combine3. Since "classic" texture environments are - * implemented using GL_ARB_texture_env_combine-like state, this same function - * is used for classic texture environment application as well. - * - * \param ctx rendering context - * \param textureUnit the texture unit to apply - * \param n number of fragments to process (span width) - * \param primary_rgba incoming fragment color array - * \param texelBuffer pointer to texel colors for all texture units - * - * \param rgba incoming colors, which get modified here - */ -static void -texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, - CONST GLchan (*primary_rgba)[4], - CONST GLchan *texelBuffer, - GLchan (*rgba)[4] ) -{ - const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]); - const GLchan (*argRGB [3])[4]; - const GLchan (*argA [3])[4]; - const GLuint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB; - const GLuint Ashift = textureUnit->_CurrentCombine->ScaleShiftA; -#if CHAN_TYPE == GL_FLOAT - const GLchan RGBmult = (GLfloat) (1 << RGBshift); - const GLchan Amult = (GLfloat) (1 << Ashift); -#else - const GLint half = (CHAN_MAX + 1) / 2; -#endif - static const GLchan one[4] = { CHAN_MAX, CHAN_MAX, CHAN_MAX, CHAN_MAX }; - static const GLchan zero[4] = { 0, 0, 0, 0 }; - const GLuint numColorArgs = textureUnit->_CurrentCombine->_NumArgsRGB; - const GLuint numAlphaArgs = textureUnit->_CurrentCombine->_NumArgsA; - GLchan ccolor[3][MAX_WIDTH][4]; - GLuint i, j; - - ASSERT(ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine); - ASSERT(SWRAST_CONTEXT(ctx)->_AnyTextureCombine); - - /* - printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n", - textureUnit->_CurrentCombine->ModeRGB, - textureUnit->_CurrentCombine->ModeA, - textureUnit->_CurrentCombine->SourceRGB[0], - textureUnit->_CurrentCombine->SourceA[0], - textureUnit->_CurrentCombine->SourceRGB[1], - textureUnit->_CurrentCombine->SourceA[1]); - */ - - /* - * Do operand setup for up to 3 operands. Loop over the terms. - */ - for (j = 0; j < numColorArgs; j++) { - const GLenum srcRGB = textureUnit->_CurrentCombine->SourceRGB[j]; - - switch (srcRGB) { - case GL_TEXTURE: - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); - break; - case GL_PRIMARY_COLOR: - argRGB[j] = primary_rgba; - break; - case GL_PREVIOUS: - argRGB[j] = (const GLchan (*)[4]) rgba; - break; - case GL_CONSTANT: - { - GLchan (*c)[4] = ccolor[j]; - GLchan red, green, blue, alpha; - UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); - for (i = 0; i < n; i++) { - c[i][RCOMP] = red; - c[i][GCOMP] = green; - c[i][BCOMP] = blue; - c[i][ACOMP] = alpha; - } - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; - } - break; - /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. - */ - case GL_ZERO: - argRGB[j] = & zero; - break; - case GL_ONE: - argRGB[j] = & one; - break; - default: - /* ARB_texture_env_crossbar source */ - { - const GLuint srcUnit = srcRGB - GL_TEXTURE0; - ASSERT(srcUnit < ctx->Const.MaxTextureUnits); - if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) - return; - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); - } - } - - if (textureUnit->_CurrentCombine->OperandRGB[j] != GL_SRC_COLOR) { - const GLchan (*src)[4] = argRGB[j]; - GLchan (*dst)[4] = ccolor[j]; - - /* point to new arg[j] storage */ - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; - - if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_ONE_MINUS_SRC_COLOR) { - for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][RCOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][GCOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][BCOMP]; - } - } - else if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_SRC_ALPHA) { - for (i = 0; i < n; i++) { - dst[i][RCOMP] = src[i][ACOMP]; - dst[i][GCOMP] = src[i][ACOMP]; - dst[i][BCOMP] = src[i][ACOMP]; - } - } - else { - ASSERT(textureUnit->_CurrentCombine->OperandRGB[j] ==GL_ONE_MINUS_SRC_ALPHA); - for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][ACOMP]; - } - } - } - } - - /* - * Set up the argA[i] pointers - */ - for (j = 0; j < numAlphaArgs; j++) { - const GLenum srcA = textureUnit->_CurrentCombine->SourceA[j]; - - switch (srcA) { - case GL_TEXTURE: - argA[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); - break; - case GL_PRIMARY_COLOR: - argA[j] = primary_rgba; - break; - case GL_PREVIOUS: - argA[j] = (const GLchan (*)[4]) rgba; - break; - case GL_CONSTANT: - { - GLchan alpha, (*c)[4] = ccolor[j]; - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); - for (i = 0; i < n; i++) - c[i][ACOMP] = alpha; - argA[j] = (const GLchan (*)[4]) ccolor[j]; - } - break; - /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. - */ - case GL_ZERO: - argA[j] = & zero; - break; - case GL_ONE: - argA[j] = & one; - break; - default: - /* ARB_texture_env_crossbar source */ - { - const GLuint srcUnit = srcA - GL_TEXTURE0; - ASSERT(srcUnit < ctx->Const.MaxTextureUnits); - if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) - return; - argA[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); - } - } - - if (textureUnit->_CurrentCombine->OperandA[j] == GL_ONE_MINUS_SRC_ALPHA) { - const GLchan (*src)[4] = argA[j]; - GLchan (*dst)[4] = ccolor[j]; - argA[j] = (const GLchan (*)[4]) ccolor[j]; - for (i = 0; i < n; i++) { - dst[i][ACOMP] = CHAN_MAX - src[i][ACOMP]; - } - } - } - - /* - * Do the texture combine. - */ - switch (textureUnit->_CurrentCombine->ModeRGB) { - case GL_REPLACE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - if (RGBshift) { - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = arg0[i][RCOMP] * RGBmult; - rgba[i][GCOMP] = arg0[i][GCOMP] * RGBmult; - rgba[i][BCOMP] = arg0[i][BCOMP] * RGBmult; -#else - GLuint r = (GLuint) arg0[i][RCOMP] << RGBshift; - GLuint g = (GLuint) arg0[i][GCOMP] << RGBshift; - GLuint b = (GLuint) arg0[i][BCOMP] << RGBshift; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); -#endif - } - } - else { - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = arg0[i][RCOMP]; - rgba[i][GCOMP] = arg0[i][GCOMP]; - rgba[i][BCOMP] = arg0[i][BCOMP]; - } - } - } - break; - case GL_MODULATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * RGBmult; - rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * RGBmult; - rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * RGBmult; -#else - GLuint r = PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift; - GLuint g = PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift; - GLuint b = PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } - } - break; - case GL_ADD: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } - } - break; - case GL_ADD_SIGNED: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] -half; - GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] -half; - GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] -half; - r = (r < 0) ? 0 : r << RGBshift; - g = (g < 0) ? 0 : g << RGBshift; - b = (b < 0) ? 0 : b << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } - } - break; - case GL_INTERPOLATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] + - arg1[i][RCOMP] * (CHAN_MAXF - arg2[i][RCOMP])) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] + - arg1[i][GCOMP] * (CHAN_MAXF - arg2[i][GCOMP])) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] + - arg1[i][BCOMP] * (CHAN_MAXF - arg2[i][BCOMP])) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + PROD(arg1[i][RCOMP], CHAN_MAX - arg2[i][RCOMP])) - >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + PROD(arg1[i][GCOMP], CHAN_MAX - arg2[i][GCOMP])) - >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + PROD(arg1[i][BCOMP], CHAN_MAX - arg2[i][BCOMP])) - >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } - } - break; - case GL_SUBTRACT: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] - (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] - (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] - (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } - } - break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - { - /* Do not scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + - (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + - (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) - * 4.0F; - dot = CLAMP(dot, 0.0F, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; - } - } - break; - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - { - /* DO scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + - (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + - (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) - * 4.0F * RGBmult; - dot = CLAMP(dot, 0.0, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot <<= RGBshift; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; - } - } - break; - case GL_MODULATE_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP]) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + ((GLuint) arg1[i][RCOMP] << CHAN_BITS)) >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + ((GLuint) arg1[i][GCOMP] << CHAN_BITS)) >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + ((GLuint) arg1[i][BCOMP] << CHAN_BITS)) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } - } - break; - case GL_MODULATE_SIGNED_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + (((GLint) arg1[i][RCOMP] - half) << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + (((GLint) arg1[i][GCOMP] - half) << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + (((GLint) arg1[i][BCOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } - } - break; - case GL_MODULATE_SUBTRACT_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - - ((GLint) arg1[i][RCOMP] << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - - ((GLint) arg1[i][GCOMP] << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - - ((GLint) arg1[i][BCOMP] << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } - } - break; - default: - _mesa_problem(ctx, "invalid combine mode"); - } - - switch (textureUnit->_CurrentCombine->ModeA) { - case GL_REPLACE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - if (Ashift) { - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan a = arg0[i][ACOMP] * Amult; -#else - GLuint a = (GLuint) arg0[i][ACOMP] << Ashift; -#endif - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); - } - } - else { - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = arg0[i][ACOMP]; - } - } - } - break; - case GL_MODULATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * Amult; -#else - GLuint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift); - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } - } - break; - case GL_ADD: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] + arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } - } - break; - case GL_ADD_SIGNED: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half; - a = (a < 0) ? 0 : a << Ashift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } - } - break; - case GL_INTERPOLATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i=0; i> shift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } - } - break; - case GL_SUBTRACT: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] - (GLint) arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } - } - break; - case GL_MODULATE_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP]) * Amult; -#else - GLint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + ((GLuint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } - } - break; - case GL_MODULATE_SIGNED_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + (((GLint) arg1[i][ACOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } - } - break; - case GL_MODULATE_SUBTRACT_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - - ((GLint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } - } - break; - default: - _mesa_problem(ctx, "invalid combine mode"); - } - - /* Fix the alpha component for GL_DOT3_RGBA_EXT/ARB combining. - * This is kind of a kludge. It would have been better if the spec - * were written such that the GL_COMBINE_ALPHA value could be set to - * GL_DOT3. - */ - if (textureUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT || - textureUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) { - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = rgba[i][RCOMP]; - } - } -} -#undef PROD - - -/** - * Apply a conventional OpenGL texture env mode (REPLACE, ADD, BLEND, - * MODULATE, or DECAL) to an array of fragments. - * Input: textureUnit - pointer to texture unit to apply - * format - base internal texture format - * n - number of fragments - * primary_rgba - primary colors (may alias rgba for single texture) - * texels - array of texel colors - * InOut: rgba - incoming fragment colors modified by texel colors - * according to the texture environment mode. - */ -static void -texture_apply( const GLcontext *ctx, - const struct gl_texture_unit *texUnit, - GLuint n, - CONST GLchan primary_rgba[][4], CONST GLchan texel[][4], - GLchan rgba[][4] ) -{ - GLint baseLevel; - GLuint i; - GLchan Rc, Gc, Bc, Ac; - GLenum format; - (void) primary_rgba; - - ASSERT(texUnit); - ASSERT(texUnit->_Current); - - baseLevel = texUnit->_Current->BaseLevel; - ASSERT(texUnit->_Current->Image[0][baseLevel]); - - format = texUnit->_Current->Image[0][baseLevel]->_BaseFormat; - - if (format == GL_COLOR_INDEX || format == GL_YCBCR_MESA) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - format = texUnit->_Current->DepthMode; - } - - switch (texUnit->EnvMode) { - case GL_REPLACE: - switch (format) { - case GL_ALPHA: - for (i=0;iEnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(Gc, texUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(Bc, texUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(Ac, texUnit->EnvColor[3]); - switch (format) { - case GL_ALPHA: - for (i=0;iend < MAX_WIDTH); - - /* - * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR) - */ - if (swrast->_AnyTextureCombine) - MEMCPY(primary_rgba, span->array->rgba, 4 * span->end * sizeof(GLchan)); - - /* - * Must do all texture sampling before combining in order to - * accomodate GL_ARB_texture_env_crossbar. - */ - for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { - if (ctx->Texture.Unit[unit]._ReallyEnabled) { - const GLfloat (*texcoords)[4] - = (const GLfloat (*)[4]) - span->array->attribs[FRAG_ATTRIB_TEX0 + unit]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *curObj = texUnit->_Current; - GLfloat *lambda = span->array->lambda[unit]; - GLchan (*texels)[4] = (GLchan (*)[4]) - (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan))); - - /* adjust texture lod (lambda) */ - if (span->arrayMask & SPAN_LAMBDA) { - if (texUnit->LodBias + curObj->LodBias != 0.0F) { - /* apply LOD bias, but don't clamp yet */ - const GLfloat bias = CLAMP(texUnit->LodBias + curObj->LodBias, - -ctx->Const.MaxTextureLodBias, - ctx->Const.MaxTextureLodBias); - GLuint i; - for (i = 0; i < span->end; i++) { - lambda[i] += bias; - } - } - - if (curObj->MinLod != -1000.0 || curObj->MaxLod != 1000.0) { - /* apply LOD clamping to lambda */ - const GLfloat min = curObj->MinLod; - const GLfloat max = curObj->MaxLod; - GLuint i; - for (i = 0; i < span->end; i++) { - GLfloat l = lambda[i]; - lambda[i] = CLAMP(l, min, max); - } - } - } - - /* Sample the texture (span->end = number of fragments) */ - swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end, - texcoords, lambda, texels ); - - /* GL_SGI_texture_color_table */ - if (texUnit->ColorTableEnabled) { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#else - _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels); -#endif - } - } - } - - /* - * OK, now apply the texture (aka texture combine/blend). - * We modify the span->color.rgba values. - */ - for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { - if (ctx->Texture.Unit[unit]._ReallyEnabled) { - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if (texUnit->_CurrentCombine != &texUnit->_EnvMode ) { - texture_combine( ctx, unit, span->end, - (CONST GLchan (*)[4]) primary_rgba, - swrast->TexelBuffer, - span->array->rgba ); - } - else { - /* conventional texture blend */ - const GLchan (*texels)[4] = (const GLchan (*)[4]) - (swrast->TexelBuffer + unit * - (span->end * 4 * sizeof(GLchan))); - texture_apply( ctx, texUnit, span->end, - (CONST GLchan (*)[4]) primary_rgba, texels, - span->array->rgba ); - } - } - } -} diff --git a/src/libs/mesa/mesa/swrast/s_texcombine.h b/src/libs/mesa/mesa/swrast/s_texcombine.h deleted file mode 100644 index 9ed96efb87..0000000000 --- a/src/libs/mesa/mesa/swrast/s_texcombine.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 S_TEXCOMBINE_H -#define S_TEXCOMBINE_H - - -#include "swrast.h" - -extern void -_swrast_texture_span( GLcontext *ctx, SWspan *span ); - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_texfilter.c b/src/libs/mesa/mesa/swrast/s_texfilter.c deleted file mode 100644 index f86dbdb23a..0000000000 --- a/src/libs/mesa/mesa/swrast/s_texfilter.c +++ /dev/null @@ -1,3408 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2008 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. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/imports.h" -#include "main/texformat.h" - -#include "s_context.h" -#include "s_texfilter.h" - - -/* - * Note, the FRAC macro has to work perfectly. Otherwise you'll sometimes - * see 1-pixel bands of improperly weighted linear-filtered textures. - * The tests/texwrap.c demo is a good test. - * Also note, FRAC(x) doesn't truly return the fractional part of x for x < 0. - * Instead, if x < 0 then FRAC(x) = 1 - true_frac(x). - */ -#define FRAC(f) ((f) - IFLOOR(f)) - - -/** - * Constants for integer linear interpolation. - */ -#define ILERP_SCALE 65536.0F -#define ILERP_SHIFT 16 - - -/** - * Linear interpolation macros - */ -#define LERP(T, A, B) ( (A) + (T) * ((B) - (A)) ) -#define ILERP(IT, A, B) ( (A) + (((IT) * ((B) - (A))) >> ILERP_SHIFT) ) - - -/** - * Do 2D/biliner interpolation of float values. - * v00, v10, v01 and v11 are typically four texture samples in a square/box. - * a and b are the horizontal and vertical interpolants. - * It's important that this function is inlined when compiled with - * optimization! If we find that's not true on some systems, convert - * to a macro. - */ -static INLINE GLfloat -lerp_2d(GLfloat a, GLfloat b, - GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11) -{ - const GLfloat temp0 = LERP(a, v00, v10); - const GLfloat temp1 = LERP(a, v01, v11); - return LERP(b, temp0, temp1); -} - - -/** - * Do 2D/biliner interpolation of integer values. - * \sa lerp_2d - */ -static INLINE GLint -ilerp_2d(GLint ia, GLint ib, - GLint v00, GLint v10, GLint v01, GLint v11) -{ - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint temp0 = ILERP(ia, v00, v10); - const GLint temp1 = ILERP(ia, v01, v11); - return ILERP(ib, temp0, temp1); -} - - -/** - * Do 3D/trilinear interpolation of float values. - * \sa lerp_2d - */ -static INLINE GLfloat -lerp_3d(GLfloat a, GLfloat b, GLfloat c, - GLfloat v000, GLfloat v100, GLfloat v010, GLfloat v110, - GLfloat v001, GLfloat v101, GLfloat v011, GLfloat v111) -{ - const GLfloat temp00 = LERP(a, v000, v100); - const GLfloat temp10 = LERP(a, v010, v110); - const GLfloat temp01 = LERP(a, v001, v101); - const GLfloat temp11 = LERP(a, v011, v111); - const GLfloat temp0 = LERP(b, temp00, temp10); - const GLfloat temp1 = LERP(b, temp01, temp11); - return LERP(c, temp0, temp1); -} - - -/** - * Do 3D/trilinear interpolation of integer values. - * \sa lerp_2d - */ -static INLINE GLint -ilerp_3d(GLint ia, GLint ib, GLint ic, - GLint v000, GLint v100, GLint v010, GLint v110, - GLint v001, GLint v101, GLint v011, GLint v111) -{ - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint temp00 = ILERP(ia, v000, v100); - const GLint temp10 = ILERP(ia, v010, v110); - const GLint temp01 = ILERP(ia, v001, v101); - const GLint temp11 = ILERP(ia, v011, v111); - const GLint temp0 = ILERP(ib, temp00, temp10); - const GLint temp1 = ILERP(ib, temp01, temp11); - return ILERP(ic, temp0, temp1); -} - - -/** - * Do linear interpolation of colors. - */ -static INLINE void -lerp_rgba(GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) -{ -#if CHAN_TYPE == GL_FLOAT - result[0] = LERP(t, a[0], b[0]); - result[1] = LERP(t, a[1], b[1]); - result[2] = LERP(t, a[2], b[2]); - result[3] = LERP(t, a[3], b[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (LERP(t, a[0], b[0]) + 0.5); - result[1] = (GLchan) (LERP(t, a[1], b[1]) + 0.5); - result[2] = (GLchan) (LERP(t, a[2], b[2]) + 0.5); - result[3] = (GLchan) (LERP(t, a[3], b[3]) + 0.5); -#else - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint it = IROUND_POS(t * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ILERP(it, a[0], b[0]); - result[1] = ILERP(it, a[1], b[1]); - result[2] = ILERP(it, a[2], b[2]); - result[3] = ILERP(it, a[3], b[3]); -#endif -} - - -/** - * Do bilinear interpolation of colors. - */ -static INLINE void -lerp_rgba_2d(GLchan result[4], GLfloat a, GLfloat b, - const GLchan t00[4], const GLchan t10[4], - const GLchan t01[4], const GLchan t11[4]) -{ -#if CHAN_TYPE == GL_FLOAT - result[0] = lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]); - result[1] = lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]); - result[2] = lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]); - result[3] = lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]) + 0.5); - result[1] = (GLchan) (lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]) + 0.5); - result[2] = (GLchan) (lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]) + 0.5); - result[3] = (GLchan) (lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]) + 0.5); -#else - const GLint ia = IROUND_POS(a * ILERP_SCALE); - const GLint ib = IROUND_POS(b * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ilerp_2d(ia, ib, t00[0], t10[0], t01[0], t11[0]); - result[1] = ilerp_2d(ia, ib, t00[1], t10[1], t01[1], t11[1]); - result[2] = ilerp_2d(ia, ib, t00[2], t10[2], t01[2], t11[2]); - result[3] = ilerp_2d(ia, ib, t00[3], t10[3], t01[3], t11[3]); -#endif -} - - -/** - * Do trilinear interpolation of colors. - */ -static INLINE void -lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c, - const GLchan t000[4], const GLchan t100[4], - const GLchan t010[4], const GLchan t110[4], - const GLchan t001[4], const GLchan t101[4], - const GLchan t011[4], const GLchan t111[4]) -{ - GLuint k; - /* compiler should unroll these short loops */ -#if CHAN_TYPE == GL_FLOAT - for (k = 0; k < 4; k++) { - result[k] = lerp_3d(a, b, c, t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]); - } -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - for (k = 0; k < 4; k++) { - result[k] = (GLchan)(lerp_3d(a, b, c, - t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]) + 0.5F); - } -#else - GLint ia = IROUND_POS(a * ILERP_SCALE); - GLint ib = IROUND_POS(b * ILERP_SCALE); - GLint ic = IROUND_POS(c * ILERP_SCALE); - for (k = 0; k < 4; k++) { - result[k] = ilerp_3d(ia, ib, ic, t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]); - } -#endif -} - - -/** - * If A is a signed integer, A % B doesn't give the right value for A < 0 - * (in terms of texture repeat). Just casting to unsigned fixes that. - */ -#define REMAINDER(A, B) (((A) + (B) * 1024) % (B)) - - -/** - * Used to compute texel locations for linear sampling. - * Input: - * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER - * s = texcoord in [0,1] - * size = width (or height or depth) of texture - * Output: - * i0, i1 = returns two nearest texel indexes - * weight = returns blend factor between texels - */ -static INLINE void -linear_texel_locations(GLenum wrapMode, - const struct gl_texture_image *img, - GLint size, GLfloat s, - GLint *i0, GLint *i1, GLfloat *weight) -{ - GLfloat u; - switch (wrapMode) { - case GL_REPEAT: - u = s * size - 0.5F; - if (img->_IsPowerOfTwo) { - *i0 = IFLOOR(u) & (size - 1); - *i1 = (*i0 + 1) & (size - 1); - } - else { - *i0 = REMAINDER(IFLOOR(u), size); - *i1 = REMAINDER(*i0 + 1, size); - } - break; - case GL_CLAMP_TO_EDGE: - if (s <= 0.0F) - u = 0.0F; - else if (s >= 1.0F) - u = (GLfloat) size; - else - u = s * size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - if (*i0 < 0) - *i0 = 0; - if (*i1 >= (GLint) size) - *i1 = size - 1; - break; - case GL_CLAMP_TO_BORDER: - { - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s <= min) - u = min * size; - else if (s >= max) - u = max * size; - else - u = s * size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - } - break; - case GL_MIRRORED_REPEAT: - { - const GLint flr = IFLOOR(s); - if (flr & 1) - u = 1.0F - (s - (GLfloat) flr); - else - u = s - (GLfloat) flr; - u = (u * size) - 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - if (*i0 < 0) - *i0 = 0; - if (*i1 >= (GLint) size) - *i1 = size - 1; - } - break; - case GL_MIRROR_CLAMP_EXT: - u = FABSF(s); - if (u >= 1.0F) - u = (GLfloat) size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - break; - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - u = FABSF(s); - if (u >= 1.0F) - u = (GLfloat) size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - if (*i0 < 0) - *i0 = 0; - if (*i1 >= (GLint) size) - *i1 = size - 1; - break; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - { - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - u = FABSF(s); - if (u <= min) - u = min * size; - else if (u >= max) - u = max * size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - } - break; - case GL_CLAMP: - if (s <= 0.0F) - u = 0.0F; - else if (s >= 1.0F) - u = (GLfloat) size; - else - u = s * size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - break; - default: - _mesa_problem(NULL, "Bad wrap mode"); - u = 0.0F; - } - *weight = FRAC(u); -} - - -/** - * Used to compute texel location for nearest sampling. - */ -static INLINE GLint -nearest_texel_location(GLenum wrapMode, - const struct gl_texture_image *img, - GLint size, GLfloat s) -{ - GLint i; - - switch (wrapMode) { - case GL_REPEAT: - /* s limited to [0,1) */ - /* i limited to [0,size-1] */ - i = IFLOOR(s * size); - if (img->_IsPowerOfTwo) - i &= (size - 1); - else - i = REMAINDER(i, size); - return i; - case GL_CLAMP_TO_EDGE: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = 1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s < min) - i = 0; - else if (s > max) - i = size - 1; - else - i = IFLOOR(s * size); - } - return i; - case GL_CLAMP_TO_BORDER: - { - /* s limited to [min,max] */ - /* i limited to [-1, size] */ - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s <= min) - i = -1; - else if (s >= max) - i = size; - else - i = IFLOOR(s * size); - } - return i; - case GL_MIRRORED_REPEAT: - { - const GLfloat min = 1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - const GLint flr = IFLOOR(s); - GLfloat u; - if (flr & 1) - u = 1.0F - (s - (GLfloat) flr); - else - u = s - (GLfloat) flr; - if (u < min) - i = 0; - else if (u > max) - i = size - 1; - else - i = IFLOOR(u * size); - } - return i; - case GL_MIRROR_CLAMP_EXT: - { - /* s limited to [0,1] */ - /* i limited to [0,size-1] */ - const GLfloat u = FABSF(s); - if (u <= 0.0F) - i = 0; - else if (u >= 1.0F) - i = size - 1; - else - i = IFLOOR(u * size); - } - return i; - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = 1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - const GLfloat u = FABSF(s); - if (u < min) - i = 0; - else if (u > max) - i = size - 1; - else - i = IFLOOR(u * size); - } - return i; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - const GLfloat u = FABSF(s); - if (u < min) - i = -1; - else if (u > max) - i = size; - else - i = IFLOOR(u * size); - } - return i; - case GL_CLAMP: - /* s limited to [0,1] */ - /* i limited to [0,size-1] */ - if (s <= 0.0F) - i = 0; - else if (s >= 1.0F) - i = size - 1; - else - i = IFLOOR(s * size); - return i; - default: - _mesa_problem(NULL, "Bad wrap mode"); - return 0; - } -} - - -/* Power of two image sizes only */ -static INLINE void -linear_repeat_texel_location(GLuint size, GLfloat s, - GLint *i0, GLint *i1, GLfloat *weight) -{ - GLfloat u = s * size - 0.5F; - *i0 = IFLOOR(u) & (size - 1); - *i1 = (*i0 + 1) & (size - 1); - *weight = FRAC(u); -} - - -/** - * For linear interpolation between mipmap levels N and N+1, this function - * computes N. - */ -static INLINE GLint -linear_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda) -{ - if (lambda < 0.0F) - return tObj->BaseLevel; - else if (lambda > tObj->_MaxLambda) - return (GLint) (tObj->BaseLevel + tObj->_MaxLambda); - else - return (GLint) (tObj->BaseLevel + lambda); -} - - -/** - * Compute the nearest mipmap level to take texels from. - */ -static INLINE GLint -nearest_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda) -{ - GLfloat l; - GLint level; - if (lambda <= 0.5F) - l = 0.0F; - else if (lambda > tObj->_MaxLambda + 0.4999F) - l = tObj->_MaxLambda + 0.4999F; - else - l = lambda; - level = (GLint) (tObj->BaseLevel + l + 0.5F); - if (level > tObj->_MaxLevel) - level = tObj->_MaxLevel; - return level; -} - - - -/* - * Bitflags for texture border color sampling. - */ -#define I0BIT 1 -#define I1BIT 2 -#define J0BIT 4 -#define J1BIT 8 -#define K0BIT 16 -#define K1BIT 32 - - - -/** - * The lambda[] array values are always monotonic. Either the whole span - * will be minified, magnified, or split between the two. This function - * determines the subranges in [0, n-1] that are to be minified or magnified. - */ -static INLINE void -compute_min_mag_ranges(const struct gl_texture_object *tObj, - GLuint n, const GLfloat lambda[], - GLuint *minStart, GLuint *minEnd, - GLuint *magStart, GLuint *magEnd) -{ - GLfloat minMagThresh; - - /* we shouldn't be here if minfilter == magfilter */ - ASSERT(tObj->MinFilter != tObj->MagFilter); - - /* This bit comes from the OpenGL spec: */ - if (tObj->MagFilter == GL_LINEAR - && (tObj->MinFilter == GL_NEAREST_MIPMAP_NEAREST || - tObj->MinFilter == GL_NEAREST_MIPMAP_LINEAR)) { - minMagThresh = 0.5F; - } - else { - minMagThresh = 0.0F; - } - -#if 0 - /* DEBUG CODE: Verify that lambda[] is monotonic. - * We can't really use this because the inaccuracy in the LOG2 function - * causes this test to fail, yet the resulting texturing is correct. - */ - if (n > 1) { - GLuint i; - printf("lambda delta = %g\n", lambda[0] - lambda[n-1]); - if (lambda[0] >= lambda[n-1]) { /* decreasing */ - for (i = 0; i < n - 1; i++) { - ASSERT((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10)); - } - } - else { /* increasing */ - for (i = 0; i < n - 1; i++) { - ASSERT((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10)); - } - } - } -#endif /* DEBUG */ - - if (lambda[0] <= minMagThresh && (n <= 1 || lambda[n-1] <= minMagThresh)) { - /* magnification for whole span */ - *magStart = 0; - *magEnd = n; - *minStart = *minEnd = 0; - } - else if (lambda[0] > minMagThresh && (n <=1 || lambda[n-1] > minMagThresh)) { - /* minification for whole span */ - *minStart = 0; - *minEnd = n; - *magStart = *magEnd = 0; - } - else { - /* a mix of minification and magnification */ - GLuint i; - if (lambda[0] > minMagThresh) { - /* start with minification */ - for (i = 1; i < n; i++) { - if (lambda[i] <= minMagThresh) - break; - } - *minStart = 0; - *minEnd = i; - *magStart = i; - *magEnd = n; - } - else { - /* start with magnification */ - for (i = 1; i < n; i++) { - if (lambda[i] > minMagThresh) - break; - } - *magStart = 0; - *magEnd = i; - *minStart = i; - *minEnd = n; - } - } - -#if 0 - /* Verify the min/mag Start/End values - * We don't use this either (see above) - */ - { - GLint i; - for (i = 0; i < n; i++) { - if (lambda[i] > minMagThresh) { - /* minification */ - ASSERT(i >= *minStart); - ASSERT(i < *minEnd); - } - else { - /* magnification */ - ASSERT(i >= *magStart); - ASSERT(i < *magEnd); - } - } - } -#endif -} - - -/**********************************************************************/ -/* 1-D Texture Sampling Functions */ -/**********************************************************************/ - -/** - * Return the texture sample for coordinate (s) using GL_NEAREST filter. - */ -static INLINE void -sample_1d_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) -{ - const GLint width = img->Width2; /* without border, power of two */ - GLint i; - i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - /* skip over the border, if any */ - i += img->Border; - if (i < 0 || i >= (GLint) img->Width) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i, 0, 0, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s) using GL_LINEAR filter. - */ -static INLINE void -sample_1d_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) -{ - const GLint width = img->Width2; - GLint i0, i1; - GLbitfield useBorderColor = 0x0; - GLfloat a; - GLchan t0[4], t1[4]; /* texels */ - - linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - } - else { - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - } - - /* fetch texel colors */ - if (useBorderColor & I0BIT) { - COPY_CHAN4(t0, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, 0, 0, t0); - } - if (useBorderColor & I1BIT) { - COPY_CHAN4(t1, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, 0, 0, t1); - } - - lerp_rgba(rgba, a, t0, t1); -} - - -static void -sample_1d_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_1d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_1d_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_1d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_1d_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; - const GLfloat f = FRAC(lambda[i]); - sample_1d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_1d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_1d_linear_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; - const GLfloat f = FRAC(lambda[i]); - sample_1d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_1d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 1D texture, nearest filtering for both min/magnification */ -static void -sample_nearest_1d( GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_1d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 1D texture, linear filtering for both min/magnification */ -static void -sample_linear_1d( GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_1d_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 1D texture, using lambda to choose between min/magnification */ -static void -sample_lambda_1d( GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4] ) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - GLuint i; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - const GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - for (i = minStart; i < minEnd; i++) - sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = minStart; i < minEnd; i++) - sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_1d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_1d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_1d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_1d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_1d_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - switch (tObj->MagFilter) { - case GL_NEAREST: - for (i = magStart; i < magEnd; i++) - sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = magStart; i < magEnd; i++) - sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_1d_texture"); - return; - } - } -} - - -/**********************************************************************/ -/* 2-D Texture Sampling Functions */ -/**********************************************************************/ - - -/** - * Return the texture sample for coordinate (s,t) using GL_NEAREST filter. - */ -static INLINE void -sample_2d_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[]) -{ - const GLint width = img->Width2; /* without border, power of two */ - const GLint height = img->Height2; /* without border, power of two */ - GLint i, j; - (void) ctx; - - i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - j = nearest_texel_location(tObj->WrapT, img, height, texcoord[1]); - - /* skip over the border, if any */ - i += img->Border; - j += img->Border; - - if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i, j, 0, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s,t) using GL_LINEAR filter. - * New sampling code contributed by Lynn Quam . - */ -static INLINE void -sample_2d_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[]) -{ - const GLint width = img->Width2; - const GLint height = img->Height2; - GLint i0, j0, i1, j1; - GLbitfield useBorderColor = 0x0; - GLfloat a, b; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ - - linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); - - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - j0 += img->Border; - j1 += img->Border; - } - else { - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; - if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; - } - - /* fetch four texel colors */ - if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j0, 0, t00); - } - if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j0, 0, t10); - } - if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j1, 0, t01); - } - if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j1, 0, t11); - } - - lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); -} - - -/** - * As above, but we know WRAP_S == REPEAT and WRAP_T == REPEAT. - * We don't have to worry about the texture border. - */ -static INLINE void -sample_2d_linear_repeat(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[]) -{ - const GLint width = img->Width2; - const GLint height = img->Height2; - GLint i0, j0, i1, j1; - GLfloat wi, wj; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ - - (void) ctx; - - ASSERT(tObj->WrapS == GL_REPEAT); - ASSERT(tObj->WrapT == GL_REPEAT); - ASSERT(img->Border == 0); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); - ASSERT(img->_IsPowerOfTwo); - - linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); - linear_repeat_texel_location(height, texcoord[1], &j0, &j1, &wj); - - img->FetchTexelc(img, i0, j0, 0, t00); - img->FetchTexelc(img, i1, j0, 0, t10); - img->FetchTexelc(img, i0, j1, 0, t01); - img->FetchTexelc(img, i1, j1, 0, t11); - - lerp_rgba_2d(rgba, wi, wj, t00, t10, t01, t11); -} - - -static void -sample_2d_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_2d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_2d_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_2d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_2d_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_2d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_2d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_2d_linear_mipmap_linear( GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_2d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_2d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - ASSERT(tObj->WrapS == GL_REPEAT); - ASSERT(tObj->WrapT == GL_REPEAT); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level ], - texcoord[i], t0); - sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level+1], - texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 2D texture, nearest filtering for both min/magnification */ -static void -sample_nearest_2d(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_2d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 2D texture, linear filtering for both min/magnification */ -static void -sample_linear_2d(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - if (tObj->WrapS == GL_REPEAT && - tObj->WrapT == GL_REPEAT && - image->_IsPowerOfTwo && - image->Border == 0) { - for (i = 0; i < n; i++) { - sample_2d_linear_repeat(ctx, tObj, image, texcoords[i], rgba[i]); - } - } - else { - for (i = 0; i < n; i++) { - sample_2d_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } - } -} - - -/** - * Optimized 2-D texture sampling: - * S and T wrap mode == GL_REPEAT - * GL_NEAREST min/mag filter - * No border, - * RowStride == Width, - * Format = GL_RGB - */ -static void -opt_sample_rgb_2d(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel]; - const GLfloat width = (GLfloat) img->Width; - const GLfloat height = (GLfloat) img->Height; - const GLint colMask = img->Width - 1; - const GLint rowMask = img->Height - 1; - const GLint shift = img->WidthLog2; - GLuint k; - (void) ctx; - (void) lambda; - ASSERT(tObj->WrapS==GL_REPEAT); - ASSERT(tObj->WrapT==GL_REPEAT); - ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGB); - ASSERT(img->_IsPowerOfTwo); - - for (k=0; kData) + 3*pos; - rgba[k][RCOMP] = texel[0]; - rgba[k][GCOMP] = texel[1]; - rgba[k][BCOMP] = texel[2]; - } -} - - -/** - * Optimized 2-D texture sampling: - * S and T wrap mode == GL_REPEAT - * GL_NEAREST min/mag filter - * No border - * RowStride == Width, - * Format = GL_RGBA - */ -static void -opt_sample_rgba_2d(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel]; - const GLfloat width = (GLfloat) img->Width; - const GLfloat height = (GLfloat) img->Height; - const GLint colMask = img->Width - 1; - const GLint rowMask = img->Height - 1; - const GLint shift = img->WidthLog2; - GLuint i; - (void) ctx; - (void) lambda; - ASSERT(tObj->WrapS==GL_REPEAT); - ASSERT(tObj->WrapT==GL_REPEAT); - ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGBA); - ASSERT(img->_IsPowerOfTwo); - - for (i = 0; i < n; i++) { - const GLint col = IFLOOR(texcoords[i][0] * width) & colMask; - const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; - const GLint pos = (row << shift) | col; - const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - COPY_CHAN4(rgba[i], texel); - } -} - - -/** Sample 2D texture, using lambda to choose between min/magnification */ -static void -sample_lambda_2d(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel]; - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - - const GLboolean repeatNoBorderPOT = (tObj->WrapS == GL_REPEAT) - && (tObj->WrapT == GL_REPEAT) - && (tImg->Border == 0 && (tImg->Width == tImg->RowStride)) - && (tImg->TexFormat->BaseFormat != GL_COLOR_INDEX) - && tImg->_IsPowerOfTwo; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - const GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { - case MESA_FORMAT_RGB: - opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, - NULL, rgba + minStart); - break; - case MESA_FORMAT_RGBA: - opt_sample_rgba_2d(ctx, tObj, m, texcoords + minStart, - NULL, rgba + minStart); - break; - default: - sample_nearest_2d(ctx, tObj, m, texcoords + minStart, - NULL, rgba + minStart ); - } - } - else { - sample_nearest_2d(ctx, tObj, m, texcoords + minStart, - NULL, rgba + minStart); - } - break; - case GL_LINEAR: - sample_linear_2d(ctx, tObj, m, texcoords + minStart, - NULL, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_2d_nearest_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_2d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_2d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - if (repeatNoBorderPOT) - sample_2d_linear_mipmap_linear_repeat(ctx, tObj, m, - texcoords + minStart, lambda + minStart, rgba + minStart); - else - sample_2d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_2d_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - const GLuint m = magEnd - magStart; - - switch (tObj->MagFilter) { - case GL_NEAREST: - if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { - case MESA_FORMAT_RGB: - opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, - NULL, rgba + magStart); - break; - case MESA_FORMAT_RGBA: - opt_sample_rgba_2d(ctx, tObj, m, texcoords + magStart, - NULL, rgba + magStart); - break; - default: - sample_nearest_2d(ctx, tObj, m, texcoords + magStart, - NULL, rgba + magStart ); - } - } - else { - sample_nearest_2d(ctx, tObj, m, texcoords + magStart, - NULL, rgba + magStart); - } - break; - case GL_LINEAR: - sample_linear_2d(ctx, tObj, m, texcoords + magStart, - NULL, rgba + magStart); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_lambda_2d"); - } - } -} - - - -/**********************************************************************/ -/* 3-D Texture Sampling Functions */ -/**********************************************************************/ - -/** - * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. - */ -static INLINE void -sample_3d_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; /* without border, power of two */ - const GLint height = img->Height2; /* without border, power of two */ - const GLint depth = img->Depth2; /* without border, power of two */ - GLint i, j, k; - (void) ctx; - - i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - j = nearest_texel_location(tObj->WrapT, img, height, texcoord[1]); - k = nearest_texel_location(tObj->WrapR, img, depth, texcoord[2]); - - if (i < 0 || i >= (GLint) img->Width || - j < 0 || j >= (GLint) img->Height || - k < 0 || k >= (GLint) img->Depth) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i, j, k, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. - */ -static void -sample_3d_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; - const GLint height = img->Height2; - const GLint depth = img->Depth2; - GLint i0, j0, k0, i1, j1, k1; - GLbitfield useBorderColor = 0x0; - GLfloat a, b, c; - GLchan t000[4], t010[4], t001[4], t011[4]; - GLchan t100[4], t110[4], t101[4], t111[4]; - - linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); - linear_texel_locations(tObj->WrapR, img, depth, texcoord[2], &k0, &k1, &c); - - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - j0 += img->Border; - j1 += img->Border; - k0 += img->Border; - k1 += img->Border; - } - else { - /* check if sampling texture border color */ - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; - if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; - if (k0 < 0 || k0 >= depth) useBorderColor |= K0BIT; - if (k1 < 0 || k1 >= depth) useBorderColor |= K1BIT; - } - - /* Fetch texels */ - if (useBorderColor & (I0BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t000, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j0, k0, t000); - } - if (useBorderColor & (I1BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t100, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j0, k0, t100); - } - if (useBorderColor & (I0BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t010, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j1, k0, t010); - } - if (useBorderColor & (I1BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t110, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j1, k0, t110); - } - - if (useBorderColor & (I0BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t001, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j0, k1, t001); - } - if (useBorderColor & (I1BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t101, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j0, k1, t101); - } - if (useBorderColor & (I0BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t011, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j1, k1, t011); - } - if (useBorderColor & (I1BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t111, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j1, k1, t111); - } - - /* trilinear interpolation of samples */ - lerp_rgba_3d(rgba, a, b, c, t000, t100, t010, t110, t001, t101, t011, t111); -} - - -static void -sample_3d_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) -{ - GLuint i; - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_3d_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_3d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_3d_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_3d_linear_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_3d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_3d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 3D texture, nearest filtering for both min/magnification */ -static void -sample_nearest_3d(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_3d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 3D texture, linear filtering for both min/magnification */ -static void -sample_linear_3d(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_3d_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 3D texture, using lambda to choose between min/magnification */ -static void -sample_lambda_3d(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - GLuint i; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - for (i = minStart; i < minEnd; i++) - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = minStart; i < minEnd; i++) - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_3d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_3d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_3d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_3d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_3d_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - switch (tObj->MagFilter) { - case GL_NEAREST: - for (i = magStart; i < magEnd; i++) - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = magStart; i < magEnd; i++) - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_3d_texture"); - return; - } - } -} - - -/**********************************************************************/ -/* Texture Cube Map Sampling Functions */ -/**********************************************************************/ - -/** - * Choose one of six sides of a texture cube map given the texture - * coord (rx,ry,rz). Return pointer to corresponding array of texture - * images. - */ -static const struct gl_texture_image ** -choose_cube_face(const struct gl_texture_object *texObj, - const GLfloat texcoord[4], GLfloat newCoord[4]) -{ - /* - major axis - direction target sc tc ma - ---------- ------------------------------- --- --- --- - +rx TEXTURE_CUBE_MAP_POSITIVE_X_EXT -rz -ry rx - -rx TEXTURE_CUBE_MAP_NEGATIVE_X_EXT +rz -ry rx - +ry TEXTURE_CUBE_MAP_POSITIVE_Y_EXT +rx +rz ry - -ry TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT +rx -rz ry - +rz TEXTURE_CUBE_MAP_POSITIVE_Z_EXT +rx -ry rz - -rz TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT -rx -ry rz - */ - const GLfloat rx = texcoord[0]; - const GLfloat ry = texcoord[1]; - const GLfloat rz = texcoord[2]; - const GLfloat arx = FABSF(rx), ary = FABSF(ry), arz = FABSF(rz); - GLuint face; - GLfloat sc, tc, ma; - - if (arx > ary && arx > arz) { - if (rx >= 0.0F) { - face = FACE_POS_X; - sc = -rz; - tc = -ry; - ma = arx; - } - else { - face = FACE_NEG_X; - sc = rz; - tc = -ry; - ma = arx; - } - } - else if (ary > arx && ary > arz) { - if (ry >= 0.0F) { - face = FACE_POS_Y; - sc = rx; - tc = rz; - ma = ary; - } - else { - face = FACE_NEG_Y; - sc = rx; - tc = -rz; - ma = ary; - } - } - else { - if (rz > 0.0F) { - face = FACE_POS_Z; - sc = rx; - tc = -ry; - ma = arz; - } - else { - face = FACE_NEG_Z; - sc = -rx; - tc = -ry; - ma = arz; - } - } - - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; - return (const struct gl_texture_image **) texObj->Image[face]; -} - - -static void -sample_nearest_cube(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint i; - (void) lambda; - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - images = choose_cube_face(tObj, texcoords[i], newCoord); - sample_2d_nearest(ctx, tObj, images[tObj->BaseLevel], - newCoord, rgba[i]); - } -} - - -static void -sample_linear_cube(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - (void) lambda; - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - images = choose_cube_face(tObj, texcoords[i], newCoord); - sample_2d_linear(ctx, tObj, images[tObj->BaseLevel], - newCoord, rgba[i]); - } -} - - -static void -sample_cube_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - GLint level; - images = choose_cube_face(tObj, texcoord[i], newCoord); - - /* XXX we actually need to recompute lambda here based on the newCoords. - * But we would need the texcoords of adjacent fragments to compute that - * properly, and we don't have those here. - * For now, do an approximation: subtracting 1 from the chosen mipmap - * level seems to work in some test cases. - * The same adjustment is done in the next few functions. - */ - level = nearest_mipmap_level(tObj, lambda[i]); - level = MAX2(level - 1, 0); - - sample_2d_nearest(ctx, tObj, images[level], newCoord, rgba[i]); - } -} - - -static void -sample_cube_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - GLint level = nearest_mipmap_level(tObj, lambda[i]); - level = MAX2(level - 1, 0); /* see comment above */ - images = choose_cube_face(tObj, texcoord[i], newCoord); - sample_2d_linear(ctx, tObj, images[level], newCoord, rgba[i]); - } -} - - -static void -sample_cube_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - GLint level = linear_mipmap_level(tObj, lambda[i]); - level = MAX2(level - 1, 0); /* see comment above */ - images = choose_cube_face(tObj, texcoord[i], newCoord); - if (level >= tObj->_MaxLevel) { - sample_2d_nearest(ctx, tObj, images[tObj->_MaxLevel], - newCoord, rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_nearest(ctx, tObj, images[level ], newCoord, t0); - sample_2d_nearest(ctx, tObj, images[level+1], newCoord, t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_cube_linear_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - const struct gl_texture_image **images; - GLfloat newCoord[4]; - GLint level = linear_mipmap_level(tObj, lambda[i]); - level = MAX2(level - 1, 0); /* see comment above */ - images = choose_cube_face(tObj, texcoord[i], newCoord); - if (level >= tObj->_MaxLevel) { - sample_2d_linear(ctx, tObj, images[tObj->_MaxLevel], - newCoord, rgba[i]); - } - else { - GLchan t0[4], t1[4]; - const GLfloat f = FRAC(lambda[i]); - sample_2d_linear(ctx, tObj, images[level ], newCoord, t0); - sample_2d_linear(ctx, tObj, images[level+1], newCoord, t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample cube texture, using lambda to choose between min/magnification */ -static void -sample_lambda_cube(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - const GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - sample_nearest_cube(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR: - sample_linear_cube(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_cube_nearest_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_cube_linear_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_cube_nearest_mipmap_linear(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_cube_linear_mipmap_linear(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_lambda_cube"); - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - const GLuint m = magEnd - magStart; - switch (tObj->MagFilter) { - case GL_NEAREST: - sample_nearest_cube(ctx, tObj, m, texcoords + magStart, - lambda + magStart, rgba + magStart); - break; - case GL_LINEAR: - sample_linear_cube(ctx, tObj, m, texcoords + magStart, - lambda + magStart, rgba + magStart); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_lambda_cube"); - } - } -} - - -/**********************************************************************/ -/* Texture Rectangle Sampling Functions */ -/**********************************************************************/ - - -/** - * Do clamp/wrap for a texture rectangle coord, GL_NEAREST filter mode. - */ -static INLINE GLint -clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max) -{ - switch (wrapMode) { - case GL_CLAMP: - return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); - case GL_CLAMP_TO_EDGE: - return IFLOOR( CLAMP(coord, 0.5F, max - 0.5F) ); - case GL_CLAMP_TO_BORDER: - return IFLOOR( CLAMP(coord, -0.5F, max + 0.5F) ); - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_nearest"); - return 0; - } -} - - -/** - * As above, but GL_LINEAR filtering. - */ -static INLINE void -clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, - GLint *i0out, GLint *i1out, GLfloat *weight) -{ - GLfloat fcol; - GLint i0, i1; - switch (wrapMode) { - case GL_CLAMP: - /* Not exactly what the spec says, but it matches NVIDIA output */ - fcol = CLAMP(coord - 0.5F, 0.0, max-1); - i0 = IFLOOR(fcol); - i1 = i0 + 1; - break; - case GL_CLAMP_TO_EDGE: - fcol = CLAMP(coord, 0.5F, max - 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - if (i1 > max - 1) - i1 = max - 1; - break; - case GL_CLAMP_TO_BORDER: - fcol = CLAMP(coord, -0.5F, max + 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - break; - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_linear"); - i0 = i1 = 0; - fcol = 0.0F; - } - *i0out = i0; - *i1out = i1; - *weight = FRAC(fcol); -} - - -static void -sample_nearest_rect(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - const struct gl_texture_image *img = tObj->Image[0][0]; - const GLint width = img->Width; - const GLint height = img->Height; - GLuint i; - - (void) ctx; - (void) lambda; - - ASSERT(tObj->WrapS == GL_CLAMP || - tObj->WrapS == GL_CLAMP_TO_EDGE || - tObj->WrapS == GL_CLAMP_TO_BORDER); - ASSERT(tObj->WrapT == GL_CLAMP || - tObj->WrapT == GL_CLAMP_TO_EDGE || - tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); - - for (i = 0; i < n; i++) { - GLint row, col; - col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); - row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - if (col < 0 || col >= width || row < 0 || row >= height) - COPY_CHAN4(rgba[i], tObj->_BorderChan); - else - img->FetchTexelc(img, col, row, 0, rgba[i]); - } -} - - -static void -sample_linear_rect(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - const struct gl_texture_image *img = tObj->Image[0][0]; - const GLint width = img->Width; - const GLint height = img->Height; - GLuint i; - - (void) ctx; - (void) lambda; - - ASSERT(tObj->WrapS == GL_CLAMP || - tObj->WrapS == GL_CLAMP_TO_EDGE || - tObj->WrapS == GL_CLAMP_TO_BORDER); - ASSERT(tObj->WrapT == GL_CLAMP || - tObj->WrapT == GL_CLAMP_TO_EDGE || - tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); - - for (i = 0; i < n; i++) { - GLint i0, j0, i1, j1; - GLchan t00[4], t01[4], t10[4], t11[4]; - GLfloat a, b; - GLbitfield useBorderColor = 0x0; - - clamp_rect_coord_linear(tObj->WrapS, texcoords[i][0], width, - &i0, &i1, &a); - clamp_rect_coord_linear(tObj->WrapT, texcoords[i][1], height, - &j0, &j1, &b); - - /* compute integer rows/columns */ - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; - if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; - - /* get four texel samples */ - if (useBorderColor & (I0BIT | J0BIT)) - COPY_CHAN4(t00, tObj->_BorderChan); - else - img->FetchTexelc(img, i0, j0, 0, t00); - - if (useBorderColor & (I1BIT | J0BIT)) - COPY_CHAN4(t10, tObj->_BorderChan); - else - img->FetchTexelc(img, i1, j0, 0, t10); - - if (useBorderColor & (I0BIT | J1BIT)) - COPY_CHAN4(t01, tObj->_BorderChan); - else - img->FetchTexelc(img, i0, j1, 0, t01); - - if (useBorderColor & (I1BIT | J1BIT)) - COPY_CHAN4(t11, tObj->_BorderChan); - else - img->FetchTexelc(img, i1, j1, 0, t11); - - lerp_rgba_2d(rgba[i], a, b, t00, t10, t01, t11); - } -} - - -/** Sample Rect texture, using lambda to choose between min/magnification */ -static void -sample_lambda_rect(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint minStart, minEnd, magStart, magEnd; - - /* We only need lambda to decide between minification and magnification. - * There is no mipmapping with rectangular textures. - */ - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - if (tObj->MinFilter == GL_NEAREST) { - sample_nearest_rect(ctx, tObj, minEnd - minStart, - texcoords + minStart, NULL, rgba + minStart); - } - else { - sample_linear_rect(ctx, tObj, minEnd - minStart, - texcoords + minStart, NULL, rgba + minStart); - } - } - if (magStart < magEnd) { - if (tObj->MagFilter == GL_NEAREST) { - sample_nearest_rect(ctx, tObj, magEnd - magStart, - texcoords + magStart, NULL, rgba + magStart); - } - else { - sample_linear_rect(ctx, tObj, magEnd - magStart, - texcoords + magStart, NULL, rgba + magStart); - } - } -} - - - -/**********************************************************************/ -/* 2D Texture Array Sampling Functions */ -/**********************************************************************/ - -/** - * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. - */ -static void -sample_2d_array_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; /* without border, power of two */ - const GLint height = img->Height2; /* without border, power of two */ - const GLint depth = img->Depth; - GLint i, j; - GLint array; - (void) ctx; - - i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - j = nearest_texel_location(tObj->WrapT, img, height, texcoord[1]); - array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); - - if (i < 0 || i >= (GLint) img->Width || - j < 0 || j >= (GLint) img->Height || - array < 0 || array >= (GLint) img->Depth) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i, j, array, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. - */ -static void -sample_2d_array_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; - const GLint height = img->Height2; - const GLint depth = img->Depth; - GLint i0, j0, i1, j1; - GLint array; - GLbitfield useBorderColor = 0x0; - GLfloat a, b; - GLchan t00[4], t01[4], t10[4], t11[4]; - - linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); - array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); - - if (array < 0 || array >= depth) { - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - j0 += img->Border; - j1 += img->Border; - } - else { - /* check if sampling texture border color */ - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; - if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; - } - - /* Fetch texels */ - if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j0, array, t00); - } - if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j0, array, t10); - } - if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, j1, array, t01); - } - if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, j1, array, t11); - } - - /* trilinear interpolation of samples */ - lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); - } -} - - -static void -sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], - rgba[i]); - } -} - - -static void -sample_2d_array_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_2d_array_linear(ctx, tObj, tObj->Image[0][level], - texcoord[i], rgba[i]); - } -} - - -static void -sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level ], - texcoord[i], t0); - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level+1], - texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_2d_array_linear_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_2d_array_linear(ctx, tObj, tObj->Image[0][level ], - texcoord[i], t0); - sample_2d_array_linear(ctx, tObj, tObj->Image[0][level+1], - texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 2D Array texture, nearest filtering for both min/magnification */ -static void -sample_nearest_2d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_2d_array_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - - -/** Sample 2D Array texture, linear filtering for both min/magnification */ -static void -sample_linear_2d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_2d_array_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 2D Array texture, using lambda to choose between min/magnification */ -static void -sample_lambda_2d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - GLuint i; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - for (i = minStart; i < minEnd; i++) - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = minStart; i < minEnd; i++) - sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_2d_array_nearest_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_2d_array_linear_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_2d_array_nearest_mipmap_linear(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_2d_array_linear_mipmap_linear(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_2d_array_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - switch (tObj->MagFilter) { - case GL_NEAREST: - for (i = magStart; i < magEnd; i++) - sample_2d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = magStart; i < magEnd; i++) - sample_2d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_2d_array_texture"); - return; - } - } -} - - - - -/**********************************************************************/ -/* 1D Texture Array Sampling Functions */ -/**********************************************************************/ - -/** - * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. - */ -static void -sample_1d_array_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; /* without border, power of two */ - const GLint height = img->Height; - GLint i; - GLint array; - (void) ctx; - - i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); - - if (i < 0 || i >= (GLint) img->Width || - array < 0 || array >= (GLint) img->Height) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i, array, 0, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. - */ -static void -sample_1d_array_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLchan rgba[4]) -{ - const GLint width = img->Width2; - const GLint height = img->Height; - GLint i0, i1; - GLint array; - GLbitfield useBorderColor = 0x0; - GLfloat a; - GLchan t0[4], t1[4]; - - linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); - - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - } - else { - /* check if sampling texture border color */ - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - } - - if (array < 0 || array >= height) useBorderColor |= K0BIT; - - /* Fetch texels */ - if (useBorderColor & (I0BIT | K0BIT)) { - COPY_CHAN4(t0, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i0, array, 0, t0); - } - if (useBorderColor & (I1BIT | K0BIT)) { - COPY_CHAN4(t1, tObj->_BorderChan); - } - else { - img->FetchTexelc(img, i1, array, 0, t1); - } - - /* bilinear interpolation of samples */ - lerp_rgba(rgba, a, t0, t1); -} - - -static void -sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], - rgba[i]); - } -} - - -static void -sample_1d_array_linear_mipmap_nearest(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_1d_array_linear(ctx, tObj, tObj->Image[0][level], - texcoord[i], rgba[i]); - } -} - - -static void -sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_1d_array_linear_mipmap_linear(GLcontext *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLchan t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_1d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_1d_array_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 1D Array texture, nearest filtering for both min/magnification */ -static void -sample_nearest_1d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_1d_array_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 1D Array texture, linear filtering for both min/magnification */ -static void -sample_linear_1d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_1d_array_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 1D Array texture, using lambda to choose between min/magnification */ -static void -sample_lambda_1d_array(GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - GLuint i; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - GLuint m = minEnd - minStart; - switch (tObj->MinFilter) { - case GL_NEAREST: - for (i = minStart; i < minEnd; i++) - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = minStart; i < minEnd; i++) - sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_1d_array_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_1d_array_linear_mipmap_nearest(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_1d_array_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_1d_array_linear_mipmap_linear(ctx, tObj, m, - texcoords + minStart, - lambda + minStart, - rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_1d_array_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - switch (tObj->MagFilter) { - case GL_NEAREST: - for (i = magStart; i < magEnd; i++) - sample_1d_array_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = magStart; i < magEnd; i++) - sample_1d_array_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_1d_array_texture"); - return; - } - } -} - - -/** - * Sample a shadow/depth texture. - */ -static void -sample_depth_texture( GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan texel[][4] ) -{ - const GLint baseLevel = tObj->BaseLevel; - const struct gl_texture_image *img = tObj->Image[0][baseLevel]; - const GLint width = img->Width; - const GLint height = img->Height; - const GLint depth = img->Depth; - const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT) - ? 3 : 2; - GLchan ambient; - GLenum function; - GLchan result; - - (void) lambda; - - ASSERT(img->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - img->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT); - - ASSERT(tObj->Target == GL_TEXTURE_1D || - tObj->Target == GL_TEXTURE_2D || - tObj->Target == GL_TEXTURE_RECTANGLE_NV || - tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || - tObj->Target == GL_TEXTURE_2D_ARRAY_EXT); - - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient); - - /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ - - function = tObj->_Function; - if (tObj->MagFilter == GL_NEAREST) { - GLuint i; - for (i = 0; i < n; i++) { - GLfloat depthSample; - GLint col, row, slice; - - switch (tObj->Target) { - case GL_TEXTURE_RECTANGLE_ARB: - col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); - row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - slice = 0; - break; - - case GL_TEXTURE_1D: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = 0; - slice = 0; - break; - - case GL_TEXTURE_2D: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(tObj->WrapT, img, height, - texcoords[i][1]); - slice = 0; - break; - - case GL_TEXTURE_1D_ARRAY_EXT: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - slice = 0; - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(tObj->WrapT, img, height, - texcoords[i][1]); - slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); - break; - default: - col = row = slice = 0; - } - - if (col >= 0 && row >= 0 && col < width && row < height && - slice >= 0 && slice < depth) { - img->FetchTexelf(img, col, row, slice, &depthSample); - } - else { - depthSample = tObj->BorderColor[0]; - } - - switch (function) { - case GL_LEQUAL: - result = (texcoords[i][compare_coord] <= depthSample) ? CHAN_MAX : ambient; - break; - case GL_GEQUAL: - result = (texcoords[i][compare_coord] >= depthSample) ? CHAN_MAX : ambient; - break; - case GL_LESS: - result = (texcoords[i][compare_coord] < depthSample) ? CHAN_MAX : ambient; - break; - case GL_GREATER: - result = (texcoords[i][compare_coord] > depthSample) ? CHAN_MAX : ambient; - break; - case GL_EQUAL: - result = (texcoords[i][compare_coord] == depthSample) ? CHAN_MAX : ambient; - break; - case GL_NOTEQUAL: - result = (texcoords[i][compare_coord] != depthSample) ? CHAN_MAX : ambient; - break; - case GL_ALWAYS: - result = CHAN_MAX; - break; - case GL_NEVER: - result = ambient; - break; - case GL_NONE: - CLAMPED_FLOAT_TO_CHAN(result, depthSample); - break; - default: - _mesa_problem(ctx, "Bad compare func in sample_depth_texture"); - return; - } - - switch (tObj->DepthMode) { - case GL_LUMINANCE: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = CHAN_MAX; - break; - case GL_INTENSITY: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = result; - break; - case GL_ALPHA: - texel[i][RCOMP] = 0; - texel[i][GCOMP] = 0; - texel[i][BCOMP] = 0; - texel[i][ACOMP] = result; - break; - default: - _mesa_problem(ctx, "Bad depth texture mode"); - } - } - } - else { - GLuint i; - ASSERT(tObj->MagFilter == GL_LINEAR); - for (i = 0; i < n; i++) { - GLfloat depth00, depth01, depth10, depth11; - GLint i0, i1, j0, j1; - GLint slice; - GLfloat a, b; - GLuint useBorderTexel; - - switch (tObj->Target) { - case GL_TEXTURE_RECTANGLE_ARB: - clamp_rect_coord_linear(tObj->WrapS, texcoords[i][0], - width, &i0, &i1, &a); - clamp_rect_coord_linear(tObj->WrapT, texcoords[i][1], - height, &j0, &j1, &b); - slice = 0; - break; - - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, - texcoords[i][1], &j0, &j1, &b); - slice = 0; - break; - - case GL_TEXTURE_1D_ARRAY_EXT: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - j0 = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - j1 = j0; - slice = 0; - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, - texcoords[i][1], &j0, &j1, &b); - slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); - break; - default: - slice = 0; - } - - useBorderTexel = 0; - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { - j0 += img->Border; - j1 += img->Border; - } - } - else { - if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT; - if (i1 < 0 || i1 >= (GLint) width) useBorderTexel |= I1BIT; - if (j0 < 0 || j0 >= (GLint) height) useBorderTexel |= J0BIT; - if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT; - } - - if (slice < 0 || slice >= (GLint) depth) { - depth00 = tObj->BorderColor[0]; - depth01 = tObj->BorderColor[0]; - depth10 = tObj->BorderColor[0]; - depth11 = tObj->BorderColor[0]; - } - else { - /* get four depth samples from the texture */ - if (useBorderTexel & (I0BIT | J0BIT)) { - depth00 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i0, j0, slice, &depth00); - } - if (useBorderTexel & (I1BIT | J0BIT)) { - depth10 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i1, j0, slice, &depth10); - } - - if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { - if (useBorderTexel & (I0BIT | J1BIT)) { - depth01 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i0, j1, slice, &depth01); - } - if (useBorderTexel & (I1BIT | J1BIT)) { - depth11 = tObj->BorderColor[0]; - } - else { - img->FetchTexelf(img, i1, j1, slice, &depth11); - } - } - else { - depth01 = depth00; - depth11 = depth10; - } - } - - if (0) { - /* compute a single weighted depth sample and do one comparison */ - const GLfloat depthSample - = lerp_2d(a, b, depth00, depth10, depth01, depth11); - if ((depthSample <= texcoords[i][compare_coord] && function == GL_LEQUAL) || - (depthSample >= texcoords[i][compare_coord] && function == GL_GEQUAL)) { - result = ambient; - } - else { - result = CHAN_MAX; - } - } - else { - /* Do four depth/R comparisons and compute a weighted result. - * If this touches on somebody's I.P., I'll remove this code - * upon request. - */ - const GLfloat d = (CHAN_MAXF - (GLfloat) ambient) * 0.25F; - GLfloat luminance = CHAN_MAXF; - - switch (function) { - case GL_LEQUAL: - if (depth00 <= texcoords[i][compare_coord]) luminance -= d; - if (depth01 <= texcoords[i][compare_coord]) luminance -= d; - if (depth10 <= texcoords[i][compare_coord]) luminance -= d; - if (depth11 <= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_GEQUAL: - if (depth00 >= texcoords[i][compare_coord]) luminance -= d; - if (depth01 >= texcoords[i][compare_coord]) luminance -= d; - if (depth10 >= texcoords[i][compare_coord]) luminance -= d; - if (depth11 >= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_LESS: - if (depth00 < texcoords[i][compare_coord]) luminance -= d; - if (depth01 < texcoords[i][compare_coord]) luminance -= d; - if (depth10 < texcoords[i][compare_coord]) luminance -= d; - if (depth11 < texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_GREATER: - if (depth00 > texcoords[i][compare_coord]) luminance -= d; - if (depth01 > texcoords[i][compare_coord]) luminance -= d; - if (depth10 > texcoords[i][compare_coord]) luminance -= d; - if (depth11 > texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_EQUAL: - if (depth00 == texcoords[i][compare_coord]) luminance -= d; - if (depth01 == texcoords[i][compare_coord]) luminance -= d; - if (depth10 == texcoords[i][compare_coord]) luminance -= d; - if (depth11 == texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_NOTEQUAL: - if (depth00 != texcoords[i][compare_coord]) luminance -= d; - if (depth01 != texcoords[i][compare_coord]) luminance -= d; - if (depth10 != texcoords[i][compare_coord]) luminance -= d; - if (depth11 != texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_ALWAYS: - result = 0; - break; - case GL_NEVER: - result = CHAN_MAX; - break; - case GL_NONE: - /* ordinary bilinear filtering */ - { - const GLfloat depthSample - = lerp_2d(a, b, depth00, depth10, depth01, depth11); - CLAMPED_FLOAT_TO_CHAN(result, depthSample); - } - break; - default: - _mesa_problem(ctx, "Bad compare func in sample_depth_texture"); - return; - } - } - - switch (tObj->DepthMode) { - case GL_LUMINANCE: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = CHAN_MAX; - break; - case GL_INTENSITY: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = result; - break; - case GL_ALPHA: - texel[i][RCOMP] = 0; - texel[i][GCOMP] = 0; - texel[i][BCOMP] = 0; - texel[i][ACOMP] = result; - break; - default: - _mesa_problem(ctx, "Bad depth texture mode"); - } - } /* for */ - } /* if filter */ -} - - -#if 0 -/* - * Experimental depth texture sampling function. - */ -static void -sample_depth_texture2(const GLcontext *ctx, - const struct gl_texture_unit *texUnit, - GLuint n, const GLfloat texcoords[][4], - GLchan texel[][4]) -{ - const struct gl_texture_object *texObj = texUnit->_Current; - const GLint baseLevel = texObj->BaseLevel; - const struct gl_texture_image *texImage = texObj->Image[0][baseLevel]; - const GLuint width = texImage->Width; - const GLuint height = texImage->Height; - GLchan ambient; - GLboolean lequal, gequal; - - if (texObj->Target != GL_TEXTURE_2D) { - _mesa_problem(ctx, "only 2-D depth textures supported at this time"); - return; - } - - if (texObj->MinFilter != texObj->MagFilter) { - _mesa_problem(ctx, "mipmapped depth textures not supported at this time"); - return; - } - - /* XXX the GL_SGIX_shadow extension spec doesn't say what to do if - * GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object - * isn't a depth texture. - */ - if (texImage->TexFormat->BaseFormat != GL_DEPTH_COMPONENT) { - _mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture"); - return; - } - - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient); - - if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - lequal = GL_TRUE; - gequal = GL_FALSE; - } - else { - lequal = GL_FALSE; - gequal = GL_TRUE; - } - - { - GLuint i; - for (i = 0; i < n; i++) { - const GLint K = 3; - GLint col, row, ii, jj, imin, imax, jmin, jmax, samples, count; - GLfloat w; - GLchan lum; - col = nearest_texel_location(texObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(texObj->WrapT, img, height, - texcoords[i][1]); - - imin = col - K; - imax = col + K; - jmin = row - K; - jmax = row + K; - - if (imin < 0) imin = 0; - if (imax >= width) imax = width - 1; - if (jmin < 0) jmin = 0; - if (jmax >= height) jmax = height - 1; - - samples = (imax - imin + 1) * (jmax - jmin + 1); - count = 0; - for (jj = jmin; jj <= jmax; jj++) { - for (ii = imin; ii <= imax; ii++) { - GLfloat depthSample; - texImage->FetchTexelf(texImage, ii, jj, 0, &depthSample); - if ((depthSample <= r[i] && lequal) || - (depthSample >= r[i] && gequal)) { - count++; - } - } - } - - w = (GLfloat) count / (GLfloat) samples; - w = CHAN_MAXF - w * (CHAN_MAXF - (GLfloat) ambient); - lum = (GLint) w; - - texel[i][RCOMP] = lum; - texel[i][GCOMP] = lum; - texel[i][BCOMP] = lum; - texel[i][ACOMP] = CHAN_MAX; - } - } -} -#endif - - -/** - * We use this function when a texture object is in an "incomplete" state. - * When a fragment program attempts to sample an incomplete texture we - * return black (see issue 23 in GL_ARB_fragment_program spec). - * Note: fragment programs don't observe the texture enable/disable flags. - */ -static void -null_sample_func( GLcontext *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) -{ - GLuint i; - (void) ctx; - (void) tObj; - (void) texcoords; - (void) lambda; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = CHAN_MAX; - } -} - - -/** - * Choose the texture sampling function for the given texture object. - */ -texture_sample_func -_swrast_choose_texture_sample_func( GLcontext *ctx, - const struct gl_texture_object *t ) -{ - if (!t || !t->_Complete) { - return &null_sample_func; - } - else { - const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter); - const GLenum format = t->Image[0][t->BaseLevel]->TexFormat->BaseFormat; - - switch (t->Target) { - case GL_TEXTURE_1D: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { - return &sample_lambda_1d; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_1d; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_1d; - } - case GL_TEXTURE_2D: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { - return &sample_lambda_2d; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_2d; - } - else { - /* check for a few optimized cases */ - const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; - ASSERT(t->MinFilter == GL_NEAREST); - if (t->WrapS == GL_REPEAT && - t->WrapT == GL_REPEAT && - img->_IsPowerOfTwo && - img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGB) { - return &opt_sample_rgb_2d; - } - else if (t->WrapS == GL_REPEAT && - t->WrapT == GL_REPEAT && - img->_IsPowerOfTwo && - img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGBA) { - return &opt_sample_rgba_2d; - } - else { - return &sample_nearest_2d; - } - } - case GL_TEXTURE_3D: - if (needLambda) { - return &sample_lambda_3d; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_3d; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_3d; - } - case GL_TEXTURE_CUBE_MAP: - if (needLambda) { - return &sample_lambda_cube; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_cube; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_cube; - } - case GL_TEXTURE_RECTANGLE_NV: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { - return &sample_lambda_rect; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_rect; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_rect; - } - case GL_TEXTURE_1D_ARRAY_EXT: - if (needLambda) { - return &sample_lambda_1d_array; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_1d_array; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_1d_array; - } - case GL_TEXTURE_2D_ARRAY_EXT: - if (needLambda) { - return &sample_lambda_2d_array; - } - else if (t->MinFilter == GL_LINEAR) { - return &sample_linear_2d_array; - } - else { - ASSERT(t->MinFilter == GL_NEAREST); - return &sample_nearest_2d_array; - } - default: - _mesa_problem(ctx, - "invalid target in _swrast_choose_texture_sample_func"); - return &null_sample_func; - } - } -} diff --git a/src/libs/mesa/mesa/swrast/s_texfilter.h b/src/libs/mesa/mesa/swrast/s_texfilter.h deleted file mode 100644 index 2e265d685c..0000000000 --- a/src/libs/mesa/mesa/swrast/s_texfilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 S_TEXFILTER_H -#define S_TEXFILTER_H - - -#include "swrast.h" - - -extern texture_sample_func -_swrast_choose_texture_sample_func( GLcontext *ctx, - const struct gl_texture_object *tObj ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_texstore.c b/src/libs/mesa/mesa/swrast/s_texstore.c deleted file mode 100644 index 16b00b9fa1..0000000000 --- a/src/libs/mesa/mesa/swrast/s_texstore.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - -/* - * Authors: - * Brian Paul - */ - - -/* - * The functions in this file are mostly related to software texture fallbacks. - * This includes texture image transfer/packing and texel fetching. - * Hardware drivers will likely override most of this. - */ - - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/convolve.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/mipmap.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texstore.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" - - -/** - * Read an RGBA image from the frame buffer. - * This is used by glCopyTex[Sub]Image[12]D(). - * \param x window source x - * \param y window source y - * \param width image width - * \param height image height - * \param type datatype for returned GL_RGBA image - * \return pointer to image - */ -static GLvoid * -read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, - GLsizei width, GLsizei height ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); - const GLint stride = width * pixelSize; - GLint row; - GLubyte *image, *dst; - - image = (GLubyte *) _mesa_malloc(width * height * pixelSize); - if (!image) - return NULL; - - RENDER_START(swrast, ctx); - - dst = image; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst); - dst += stride; - } - - RENDER_FINISH(swrast, ctx); - - return image; -} - - -/** - * As above, but read data from depth buffer. Returned as GLuints. - * \sa read_color_image - */ -static GLuint * -read_depth_image( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint *image, *dst; - GLint i; - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - RENDER_START(swrast, ctx); - - dst = image; - for (i = 0; i < height; i++) { - _swrast_read_depth_span_uint(ctx, rb, width, x, y + i, dst); - dst += width; - } - - RENDER_FINISH(swrast, ctx); - - return image; -} - - -/** - * As above, but read data from depth+stencil buffers. - */ -static GLuint * -read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint *image, *dst; - GLint i; - - ASSERT(depthRb); - ASSERT(stencilRb); - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - RENDER_START(swrast, ctx); - - /* read from depth buffer */ - dst = image; - if (depthRb->DataType == GL_UNSIGNED_INT) { - for (i = 0; i < height; i++) { - _swrast_get_row(ctx, depthRb, width, x, y + i, dst, sizeof(GLuint)); - dst += width; - } - } - else { - GLushort z16[MAX_WIDTH]; - ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < height; i++) { - GLint j; - _swrast_get_row(ctx, depthRb, width, x, y + i, z16, sizeof(GLushort)); - /* convert GLushorts to GLuints */ - for (j = 0; j < width; j++) { - dst[j] = z16[j]; - } - dst += width; - } - } - - /* put depth values into bits 0xffffff00 */ - if (ctx->ReadBuffer->Visual.depthBits == 24) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] <<= 8; - } - } - else if (ctx->ReadBuffer->Visual.depthBits == 16) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] = (image[j] << 16) | (image[j] & 0xff00); - } - } - else { - /* this handles arbitrary depthBits >= 12 */ - const GLint rShift = ctx->ReadBuffer->Visual.depthBits; - const GLint lShift = 32 - rShift; - GLint j; - for (j = 0; j < width * height; j++) { - GLuint z = (image[j] << lShift); - image[j] = z | (z >> rShift); - } - } - - /* read stencil values and interleave into image array */ - dst = image; - for (i = 0; i < height; i++) { - GLstencil stencil[MAX_WIDTH]; - GLint j; - ASSERT(8 * sizeof(GLstencil) == stencilRb->StencilBits); - _swrast_get_row(ctx, stencilRb, width, x, y + i, - stencil, sizeof(GLstencil)); - for (j = 0; j < width; j++) { - dst[j] = (dst[j] & 0xffffff00) | (stencil[j] & 0xff); - } - dst += width; - } - - RENDER_FINISH(swrast, ctx); - - return image; -} - - -static GLboolean -is_depth_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_depth_stencil_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/* - * Fallback for Driver.CopyTexImage1D(). - */ -void -_swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexImage2D(). - * - * We implement CopyTexImage by reading the image from the framebuffer - * then passing it to the ctx->Driver.TexImage2D() function. - * - * Device drivers should try to implement direct framebuffer->texture copies. - */ -void -_swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage1D(). - */ -void -_swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - - /* call glTexSubImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" ); - return; - } - /* now call glTexSubImage1D to do the real work */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexSubImage2D(). - * - * Read the image from the framebuffer then hand it - * off to ctx->Driver.TexSubImage2D(). - */ -void -_swrast_copy_texsubimage2d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" ); - return; - } - /* now call glTexSubImage2D to do the real work */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage3D(). - */ -void -_swrast_copy_texsubimage3d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage3D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" ); - return; - } - /* now call glTexSubImage3D to do the real work */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_triangle.c b/src/libs/mesa/mesa/swrast/s_triangle.c deleted file mode 100644 index b01f1f967c..0000000000 --- a/src/libs/mesa/mesa/swrast/s_triangle.c +++ /dev/null @@ -1,1145 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/* - * When the device driver doesn't implement triangle rasterization it - * can hook in _swrast_Triangle, which eventually calls one of these - * functions to draw triangles. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/texformat.h" - -#include "s_aatriangle.h" -#include "s_context.h" -#include "s_feedback.h" -#include "s_span.h" -#include "s_triangle.h" - - -/* - * Just used for feedback mode. - */ -GLboolean -_swrast_culltriangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ) -{ - GLfloat ex = v1->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; - GLfloat ey = v1->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat fx = v2->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; - GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat c = ex*fy-ey*fx; - - if (c * SWRAST_CONTEXT(ctx)->_BackfaceCullSign > 0) - return 0; - - return 1; -} - - - -/* - * Render a smooth or flat-shaded color index triangle. - */ -#define NAME ci_triangle -#define INTERP_Z 1 -#define INTERP_ATTRIBS 1 /* just for fog */ -#define INTERP_INDEX 1 -#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span); -#include "s_tritemp.h" - - - -/* - * Render a flat-shaded RGBA triangle. - */ -#define NAME flat_rgba_triangle -#define INTERP_Z 1 -#define SETUP_CODE \ - ASSERT(ctx->Texture._EnabledCoordUnits == 0);\ - ASSERT(ctx->Light.ShadeModel==GL_FLAT); \ - span.interpMask |= SPAN_RGBA; \ - span.red = ChanToFixed(v2->color[0]); \ - span.green = ChanToFixed(v2->color[1]); \ - span.blue = ChanToFixed(v2->color[2]); \ - span.alpha = ChanToFixed(v2->color[3]); \ - span.redStep = 0; \ - span.greenStep = 0; \ - span.blueStep = 0; \ - span.alphaStep = 0; -#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); -#include "s_tritemp.h" - - - -/* - * Render a smooth-shaded RGBA triangle. - */ -#define NAME smooth_rgba_triangle -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define INTERP_ALPHA 1 -#define SETUP_CODE \ - { \ - /* texturing must be off */ \ - ASSERT(ctx->Texture._EnabledCoordUnits == 0); \ - ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \ - } -#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); -#include "s_tritemp.h" - - - -/* - * Render an RGB, GL_DECAL, textured triangle. - * Interpolate S,T only w/out mipmapping or perspective correction. - * - * No fog. No depth testing. - */ -#define NAME simple_textured_triangle -#define INTERP_INT_TEX 1 -#define S_SCALE twidth -#define T_SCALE theight - -#define SETUP_CODE \ - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ - ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ - if (!rb || !texture) { \ - return; \ - } - -#define RENDER_SPAN( span ) \ - GLuint i; \ - GLchan rgb[MAX_WIDTH][3]; \ - span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ - span.intTex[1] -= FIXED_HALF; \ - for (i = 0; i < span.end; i++) { \ - GLint s = FixedToInt(span.intTex[0]) & smask; \ - GLint t = FixedToInt(span.intTex[1]) & tmask; \ - GLint pos = (t << twidth_log2) + s; \ - pos = pos + pos + pos; /* multiply by 3 */ \ - rgb[i][RCOMP] = texture[pos]; \ - rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ - span.intTex[0] += span.intTexStep[0]; \ - span.intTex[1] += span.intTexStep[1]; \ - } \ - rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL); - -#include "s_tritemp.h" - - - -/* - * Render an RGB, GL_DECAL, textured triangle. - * Interpolate S,T, GL_LESS depth test, w/out mipmapping or - * perspective correction. - * Depth buffer bits must be <= sizeof(DEFAULT_SOFTWARE_DEPTH_TYPE) - * - * No fog. - */ -#define NAME simple_z_textured_triangle -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define INTERP_INT_TEX 1 -#define S_SCALE twidth -#define T_SCALE theight - -#define SETUP_CODE \ - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ - ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ - if (!rb || !texture) { \ - return; \ - } - -#define RENDER_SPAN( span ) \ - GLuint i; \ - GLchan rgb[MAX_WIDTH][3]; \ - span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ - span.intTex[1] -= FIXED_HALF; \ - for (i = 0; i < span.end; i++) { \ - const GLuint z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - GLint s = FixedToInt(span.intTex[0]) & smask; \ - GLint t = FixedToInt(span.intTex[1]) & tmask; \ - GLint pos = (t << twidth_log2) + s; \ - pos = pos + pos + pos; /* multiply by 3 */ \ - rgb[i][RCOMP] = texture[pos]; \ - rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ - zRow[i] = z; \ - span.array->mask[i] = 1; \ - } \ - else { \ - span.array->mask[i] = 0; \ - } \ - span.intTex[0] += span.intTexStep[0]; \ - span.intTex[1] += span.intTexStep[1]; \ - span.z += span.zStep; \ - } \ - rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask); - -#include "s_tritemp.h" - - -#if CHAN_TYPE != GL_FLOAT - -struct affine_info -{ - GLenum filter; - GLenum format; - GLenum envmode; - GLint smask, tmask; - GLint twidth_log2; - const GLchan *texture; - GLfixed er, eg, eb, ea; - GLint tbytesline, tsize; -}; - - -static INLINE GLint -ilerp(GLint t, GLint a, GLint b) -{ - return a + ((t * (b - a)) >> FIXED_SHIFT); -} - -static INLINE GLint -ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11) -{ - const GLint temp0 = ilerp(ia, v00, v10); - const GLint temp1 = ilerp(ia, v01, v11); - return ilerp(ib, temp0, temp1); -} - - -/* This function can handle GL_NEAREST or GL_LINEAR sampling of 2D RGB or RGBA - * textures with GL_REPLACE, GL_MODULATE, GL_BLEND, GL_DECAL or GL_ADD - * texture env modes. - */ -static INLINE void -affine_span(GLcontext *ctx, SWspan *span, - struct affine_info *info) -{ - GLchan sample[4]; /* the filtered texture sample */ - const GLuint texEnableSave = ctx->Texture._EnabledUnits; - - /* Instead of defining a function for each mode, a test is done - * between the outer and inner loops. This is to reduce code size - * and complexity. Observe that an optimizing compiler kills - * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST). - */ - -#define NEAREST_RGB \ - sample[RCOMP] = tex00[RCOMP]; \ - sample[GCOMP] = tex00[GCOMP]; \ - sample[BCOMP] = tex00[BCOMP]; \ - sample[ACOMP] = CHAN_MAX - -#define LINEAR_RGB \ - sample[RCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ - sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ - sample[BCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ - sample[ACOMP] = CHAN_MAX; - -#define NEAREST_RGBA COPY_CHAN4(sample, tex00) - -#define LINEAR_RGBA \ - sample[RCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ - sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ - sample[BCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ - sample[ACOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]) - -#define MODULATE \ - dest[RCOMP] = span->red * (sample[RCOMP] + 1u) >> (FIXED_SHIFT + 8); \ - dest[GCOMP] = span->green * (sample[GCOMP] + 1u) >> (FIXED_SHIFT + 8); \ - dest[BCOMP] = span->blue * (sample[BCOMP] + 1u) >> (FIXED_SHIFT + 8); \ - dest[ACOMP] = span->alpha * (sample[ACOMP] + 1u) >> (FIXED_SHIFT + 8) - -#define DECAL \ - dest[RCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->red + \ - ((sample[ACOMP] + 1) * sample[RCOMP] << FIXED_SHIFT)) \ - >> (FIXED_SHIFT + 8); \ - dest[GCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->green + \ - ((sample[ACOMP] + 1) * sample[GCOMP] << FIXED_SHIFT)) \ - >> (FIXED_SHIFT + 8); \ - dest[BCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->blue + \ - ((sample[ACOMP] + 1) * sample[BCOMP] << FIXED_SHIFT)) \ - >> (FIXED_SHIFT + 8); \ - dest[ACOMP] = FixedToInt(span->alpha) - -#define BLEND \ - dest[RCOMP] = ((CHAN_MAX - sample[RCOMP]) * span->red \ - + (sample[RCOMP] + 1) * info->er) >> (FIXED_SHIFT + 8); \ - dest[GCOMP] = ((CHAN_MAX - sample[GCOMP]) * span->green \ - + (sample[GCOMP] + 1) * info->eg) >> (FIXED_SHIFT + 8); \ - dest[BCOMP] = ((CHAN_MAX - sample[BCOMP]) * span->blue \ - + (sample[BCOMP] + 1) * info->eb) >> (FIXED_SHIFT + 8); \ - dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8) - -#define REPLACE COPY_CHAN4(dest, sample) - -#define ADD \ - { \ - GLint rSum = FixedToInt(span->red) + (GLint) sample[RCOMP]; \ - GLint gSum = FixedToInt(span->green) + (GLint) sample[GCOMP]; \ - GLint bSum = FixedToInt(span->blue) + (GLint) sample[BCOMP]; \ - dest[RCOMP] = MIN2(rSum, CHAN_MAX); \ - dest[GCOMP] = MIN2(gSum, CHAN_MAX); \ - dest[BCOMP] = MIN2(bSum, CHAN_MAX); \ - dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8); \ - } - -/* shortcuts */ - -#define NEAREST_RGB_REPLACE \ - NEAREST_RGB; \ - dest[0] = sample[0]; \ - dest[1] = sample[1]; \ - dest[2] = sample[2]; \ - dest[3] = FixedToInt(span->alpha); - -#define NEAREST_RGBA_REPLACE COPY_CHAN4(dest, tex00) - -#define SPAN_NEAREST(DO_TEX, COMPS) \ - for (i = 0; i < span->end; i++) { \ - /* Isn't it necessary to use FixedFloor below?? */ \ - GLint s = FixedToInt(span->intTex[0]) & info->smask; \ - GLint t = FixedToInt(span->intTex[1]) & info->tmask; \ - GLint pos = (t << info->twidth_log2) + s; \ - const GLchan *tex00 = info->texture + COMPS * pos; \ - DO_TEX; \ - span->red += span->redStep; \ - span->green += span->greenStep; \ - span->blue += span->blueStep; \ - span->alpha += span->alphaStep; \ - span->intTex[0] += span->intTexStep[0]; \ - span->intTex[1] += span->intTexStep[1]; \ - dest += 4; \ - } - -#define SPAN_LINEAR(DO_TEX, COMPS) \ - for (i = 0; i < span->end; i++) { \ - /* Isn't it necessary to use FixedFloor below?? */ \ - const GLint s = FixedToInt(span->intTex[0]) & info->smask; \ - const GLint t = FixedToInt(span->intTex[1]) & info->tmask; \ - const GLfixed sf = span->intTex[0] & FIXED_FRAC_MASK; \ - const GLfixed tf = span->intTex[1] & FIXED_FRAC_MASK; \ - const GLint pos = (t << info->twidth_log2) + s; \ - const GLchan *tex00 = info->texture + COMPS * pos; \ - const GLchan *tex10 = tex00 + info->tbytesline; \ - const GLchan *tex01 = tex00 + COMPS; \ - const GLchan *tex11 = tex10 + COMPS; \ - if (t == info->tmask) { \ - tex10 -= info->tsize; \ - tex11 -= info->tsize; \ - } \ - if (s == info->smask) { \ - tex01 -= info->tbytesline; \ - tex11 -= info->tbytesline; \ - } \ - DO_TEX; \ - span->red += span->redStep; \ - span->green += span->greenStep; \ - span->blue += span->blueStep; \ - span->alpha += span->alphaStep; \ - span->intTex[0] += span->intTexStep[0]; \ - span->intTex[1] += span->intTexStep[1]; \ - dest += 4; \ - } - - - GLuint i; - GLchan *dest = span->array->rgba[0]; - - /* Disable tex units so they're not re-applied in swrast_write_rgba_span */ - ctx->Texture._EnabledUnits = 0x0; - - span->intTex[0] -= FIXED_HALF; - span->intTex[1] -= FIXED_HALF; - switch (info->filter) { - case GL_NEAREST: - switch (info->format) { - case GL_RGB: - switch (info->envmode) { - case GL_MODULATE: - SPAN_NEAREST(NEAREST_RGB;MODULATE,3); - break; - case GL_DECAL: - case GL_REPLACE: - SPAN_NEAREST(NEAREST_RGB_REPLACE,3); - break; - case GL_BLEND: - SPAN_NEAREST(NEAREST_RGB;BLEND,3); - break; - case GL_ADD: - SPAN_NEAREST(NEAREST_RGB;ADD,3); - break; - default: - _mesa_problem(ctx, "bad tex env mode in SPAN_LINEAR"); - return; - } - break; - case GL_RGBA: - switch(info->envmode) { - case GL_MODULATE: - SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); - break; - case GL_DECAL: - SPAN_NEAREST(NEAREST_RGBA;DECAL,4); - break; - case GL_BLEND: - SPAN_NEAREST(NEAREST_RGBA;BLEND,4); - break; - case GL_ADD: - SPAN_NEAREST(NEAREST_RGBA;ADD,4); - break; - case GL_REPLACE: - SPAN_NEAREST(NEAREST_RGBA_REPLACE,4); - break; - default: - _mesa_problem(ctx, "bad tex env mode (2) in SPAN_LINEAR"); - return; - } - break; - } - break; - - case GL_LINEAR: - span->intTex[0] -= FIXED_HALF; - span->intTex[1] -= FIXED_HALF; - switch (info->format) { - case GL_RGB: - switch (info->envmode) { - case GL_MODULATE: - SPAN_LINEAR(LINEAR_RGB;MODULATE,3); - break; - case GL_DECAL: - case GL_REPLACE: - SPAN_LINEAR(LINEAR_RGB;REPLACE,3); - break; - case GL_BLEND: - SPAN_LINEAR(LINEAR_RGB;BLEND,3); - break; - case GL_ADD: - SPAN_LINEAR(LINEAR_RGB;ADD,3); - break; - default: - _mesa_problem(ctx, "bad tex env mode (3) in SPAN_LINEAR"); - return; - } - break; - case GL_RGBA: - switch (info->envmode) { - case GL_MODULATE: - SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); - break; - case GL_DECAL: - SPAN_LINEAR(LINEAR_RGBA;DECAL,4); - break; - case GL_BLEND: - SPAN_LINEAR(LINEAR_RGBA;BLEND,4); - break; - case GL_ADD: - SPAN_LINEAR(LINEAR_RGBA;ADD,4); - break; - case GL_REPLACE: - SPAN_LINEAR(LINEAR_RGBA;REPLACE,4); - break; - default: - _mesa_problem(ctx, "bad tex env mode (4) in SPAN_LINEAR"); - return; - } - break; - } - break; - } - span->interpMask &= ~SPAN_RGBA; - ASSERT(span->arrayMask & SPAN_RGBA); - - _swrast_write_rgba_span(ctx, span); - - /* re-enable texture units */ - ctx->Texture._EnabledUnits = texEnableSave; - -#undef SPAN_NEAREST -#undef SPAN_LINEAR -} - - - -/* - * Render an RGB/RGBA textured triangle without perspective correction. - */ -#define NAME affine_textured_triangle -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define INTERP_ALPHA 1 -#define INTERP_INT_TEX 1 -#define S_SCALE twidth -#define T_SCALE theight - -#define SETUP_CODE \ - struct affine_info info; \ - struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ - ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ - info.filter = obj->MinFilter; \ - info.envmode = unit->EnvMode; \ - span.arrayMask |= SPAN_RGBA; \ - \ - if (info.envmode == GL_BLEND) { \ - /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \ - info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \ - info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \ - info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \ - info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \ - } \ - if (!info.texture) { \ - /* this shouldn't happen */ \ - return; \ - } \ - \ - switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ - break; \ - case GL_RGB: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ - break; \ - case GL_RGBA: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ - break; \ - default: \ - _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\ - return; \ - } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; - -#define RENDER_SPAN( span ) affine_span(ctx, &span, &info); - -#include "s_tritemp.h" - - - -struct persp_info -{ - GLenum filter; - GLenum format; - GLenum envmode; - GLint smask, tmask; - GLint twidth_log2; - const GLchan *texture; - GLfixed er, eg, eb, ea; /* texture env color */ - GLint tbytesline, tsize; -}; - - -static INLINE void -fast_persp_span(GLcontext *ctx, SWspan *span, - struct persp_info *info) -{ - GLchan sample[4]; /* the filtered texture sample */ - - /* Instead of defining a function for each mode, a test is done - * between the outer and inner loops. This is to reduce code size - * and complexity. Observe that an optimizing compiler kills - * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST). - */ -#define SPAN_NEAREST(DO_TEX,COMP) \ - for (i = 0; i < span->end; i++) { \ - GLdouble invQ = tex_coord[2] ? \ - (1.0 / tex_coord[2]) : 1.0; \ - GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \ - GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \ - GLint s = IFLOOR(s_tmp) & info->smask; \ - GLint t = IFLOOR(t_tmp) & info->tmask; \ - GLint pos = (t << info->twidth_log2) + s; \ - const GLchan *tex00 = info->texture + COMP * pos; \ - DO_TEX; \ - span->red += span->redStep; \ - span->green += span->greenStep; \ - span->blue += span->blueStep; \ - span->alpha += span->alphaStep; \ - tex_coord[0] += tex_step[0]; \ - tex_coord[1] += tex_step[1]; \ - tex_coord[2] += tex_step[2]; \ - dest += 4; \ - } - -#define SPAN_LINEAR(DO_TEX,COMP) \ - for (i = 0; i < span->end; i++) { \ - GLdouble invQ = tex_coord[2] ? \ - (1.0 / tex_coord[2]) : 1.0; \ - const GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \ - const GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \ - const GLfixed s_fix = FloatToFixed(s_tmp) - FIXED_HALF; \ - const GLfixed t_fix = FloatToFixed(t_tmp) - FIXED_HALF; \ - const GLint s = FixedToInt(FixedFloor(s_fix)) & info->smask; \ - const GLint t = FixedToInt(FixedFloor(t_fix)) & info->tmask; \ - const GLfixed sf = s_fix & FIXED_FRAC_MASK; \ - const GLfixed tf = t_fix & FIXED_FRAC_MASK; \ - const GLint pos = (t << info->twidth_log2) + s; \ - const GLchan *tex00 = info->texture + COMP * pos; \ - const GLchan *tex10 = tex00 + info->tbytesline; \ - const GLchan *tex01 = tex00 + COMP; \ - const GLchan *tex11 = tex10 + COMP; \ - if (t == info->tmask) { \ - tex10 -= info->tsize; \ - tex11 -= info->tsize; \ - } \ - if (s == info->smask) { \ - tex01 -= info->tbytesline; \ - tex11 -= info->tbytesline; \ - } \ - DO_TEX; \ - span->red += span->redStep; \ - span->green += span->greenStep; \ - span->blue += span->blueStep; \ - span->alpha += span->alphaStep; \ - tex_coord[0] += tex_step[0]; \ - tex_coord[1] += tex_step[1]; \ - tex_coord[2] += tex_step[2]; \ - dest += 4; \ - } - - GLuint i; - GLfloat tex_coord[3], tex_step[3]; - GLchan *dest = span->array->rgba[0]; - - const GLuint savedTexEnable = ctx->Texture._EnabledUnits; - ctx->Texture._EnabledUnits = 0; - - tex_coord[0] = span->attrStart[FRAG_ATTRIB_TEX0][0] * (info->smask + 1); - tex_step[0] = span->attrStepX[FRAG_ATTRIB_TEX0][0] * (info->smask + 1); - tex_coord[1] = span->attrStart[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1); - tex_step[1] = span->attrStepX[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1); - /* span->attrStart[FRAG_ATTRIB_TEX0][2] only if 3D-texturing, here only 2D */ - tex_coord[2] = span->attrStart[FRAG_ATTRIB_TEX0][3]; - tex_step[2] = span->attrStepX[FRAG_ATTRIB_TEX0][3]; - - switch (info->filter) { - case GL_NEAREST: - switch (info->format) { - case GL_RGB: - switch (info->envmode) { - case GL_MODULATE: - SPAN_NEAREST(NEAREST_RGB;MODULATE,3); - break; - case GL_DECAL: - case GL_REPLACE: - SPAN_NEAREST(NEAREST_RGB_REPLACE,3); - break; - case GL_BLEND: - SPAN_NEAREST(NEAREST_RGB;BLEND,3); - break; - case GL_ADD: - SPAN_NEAREST(NEAREST_RGB;ADD,3); - break; - default: - _mesa_problem(ctx, "bad tex env mode (5) in SPAN_LINEAR"); - return; - } - break; - case GL_RGBA: - switch(info->envmode) { - case GL_MODULATE: - SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); - break; - case GL_DECAL: - SPAN_NEAREST(NEAREST_RGBA;DECAL,4); - break; - case GL_BLEND: - SPAN_NEAREST(NEAREST_RGBA;BLEND,4); - break; - case GL_ADD: - SPAN_NEAREST(NEAREST_RGBA;ADD,4); - break; - case GL_REPLACE: - SPAN_NEAREST(NEAREST_RGBA_REPLACE,4); - break; - default: - _mesa_problem(ctx, "bad tex env mode (6) in SPAN_LINEAR"); - return; - } - break; - } - break; - - case GL_LINEAR: - switch (info->format) { - case GL_RGB: - switch (info->envmode) { - case GL_MODULATE: - SPAN_LINEAR(LINEAR_RGB;MODULATE,3); - break; - case GL_DECAL: - case GL_REPLACE: - SPAN_LINEAR(LINEAR_RGB;REPLACE,3); - break; - case GL_BLEND: - SPAN_LINEAR(LINEAR_RGB;BLEND,3); - break; - case GL_ADD: - SPAN_LINEAR(LINEAR_RGB;ADD,3); - break; - default: - _mesa_problem(ctx, "bad tex env mode (7) in SPAN_LINEAR"); - return; - } - break; - case GL_RGBA: - switch (info->envmode) { - case GL_MODULATE: - SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); - break; - case GL_DECAL: - SPAN_LINEAR(LINEAR_RGBA;DECAL,4); - break; - case GL_BLEND: - SPAN_LINEAR(LINEAR_RGBA;BLEND,4); - break; - case GL_ADD: - SPAN_LINEAR(LINEAR_RGBA;ADD,4); - break; - case GL_REPLACE: - SPAN_LINEAR(LINEAR_RGBA;REPLACE,4); - break; - default: - _mesa_problem(ctx, "bad tex env mode (8) in SPAN_LINEAR"); - return; - } - break; - } - break; - } - - ASSERT(span->arrayMask & SPAN_RGBA); - _swrast_write_rgba_span(ctx, span); - -#undef SPAN_NEAREST -#undef SPAN_LINEAR - - /* restore state */ - ctx->Texture._EnabledUnits = savedTexEnable; -} - - -/* - * Render an perspective corrected RGB/RGBA textured triangle. - * The Q (aka V in Mesa) coordinate must be zero such that the divide - * by interpolated Q/W comes out right. - * - */ -#define NAME persp_textured_triangle -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define INTERP_ALPHA 1 -#define INTERP_ATTRIBS 1 - -#define SETUP_CODE \ - struct persp_info info; \ - const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ - ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ - info.filter = obj->MinFilter; \ - info.envmode = unit->EnvMode; \ - \ - if (info.envmode == GL_BLEND) { \ - /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \ - info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \ - info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \ - info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \ - info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \ - } \ - if (!info.texture) { \ - /* this shouldn't happen */ \ - return; \ - } \ - \ - switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ - break; \ - case GL_RGB: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ - break; \ - case GL_RGBA: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ - break; \ - default: \ - _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\ - return; \ - } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; - -#define RENDER_SPAN( span ) \ - span.interpMask &= ~SPAN_RGBA; \ - span.arrayMask |= SPAN_RGBA; \ - fast_persp_span(ctx, &span, &info); - -#include "s_tritemp.h" - -#endif /*CHAN_TYPE != GL_FLOAT*/ - - - -/* - * Render an RGBA triangle with arbitrary attributes. - */ -#define NAME general_triangle -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define INTERP_ALPHA 1 -#define INTERP_ATTRIBS 1 -#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); -#include "s_tritemp.h" - - - - -/* - * Special tri function for occlusion testing - */ -#define NAME occlusion_zless_triangle -#define INTERP_Z 1 -#define SETUP_CODE \ - struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer; \ - struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \ - ASSERT(ctx->Depth.Test); \ - ASSERT(!ctx->Depth.Mask); \ - ASSERT(ctx->Depth.Func == GL_LESS); \ - if (!q) { \ - return; \ - } -#define RENDER_SPAN( span ) \ - if (rb->DepthBits <= 16) { \ - GLuint i; \ - const GLushort *zRow = (const GLushort *) \ - rb->GetPointer(ctx, rb, span.x, span.y); \ - for (i = 0; i < span.end; i++) { \ - GLuint z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - q->Result++; \ - } \ - span.z += span.zStep; \ - } \ - } \ - else { \ - GLuint i; \ - const GLuint *zRow = (const GLuint *) \ - rb->GetPointer(ctx, rb, span.x, span.y); \ - for (i = 0; i < span.end; i++) { \ - if ((GLuint)span.z < zRow[i]) { \ - q->Result++; \ - } \ - span.z += span.zStep; \ - } \ - } -#include "s_tritemp.h" - - - -static void -nodraw_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ) -{ - (void) (ctx && v0 && v1 && v2); -} - - -/* - * This is used when separate specular color is enabled, but not - * texturing. We add the specular color to the primary color, - * draw the triangle, then restore the original primary color. - * Inefficient, but seldom needed. - */ -void -_swrast_add_spec_terms_triangle(GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2) -{ - SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */ - SWvertex *ncv1 = (SWvertex *)v1; - SWvertex *ncv2 = (SWvertex *)v2; - GLfloat rSum, gSum, bSum; - GLchan cSave[3][4]; - - /* save original colors */ - COPY_CHAN4( cSave[0], ncv0->color ); - COPY_CHAN4( cSave[1], ncv1->color ); - COPY_CHAN4( cSave[2], ncv2->color ); - /* sum v0 */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* sum v1 */ - rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); - /* sum v2 */ - rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 ); - /* restore original colors */ - COPY_CHAN4( ncv0->color, cSave[0] ); - COPY_CHAN4( ncv1->color, cSave[1] ); - COPY_CHAN4( ncv2->color, cSave[2] ); -} - - - -#ifdef DEBUG - -/* record the current triangle function name */ -const char *_mesa_triFuncName = NULL; - -#define USE(triFunc) \ -do { \ - _mesa_triFuncName = #triFunc; \ - /*printf("%s\n", _mesa_triFuncName);*/ \ - swrast->Triangle = triFunc; \ -} while (0) - -#else - -#define USE(triFunc) swrast->Triangle = triFunc; - -#endif - - - - -/* - * Determine which triangle rendering function to use given the current - * rendering context. - * - * Please update the summary flag _SWRAST_NEW_TRIANGLE if you add or - * remove tests to this code. - */ -void -_swrast_choose_triangle( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean rgbmode = ctx->Visual.rgbMode; - - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { - USE(nodraw_triangle); - return; - } - - if (ctx->RenderMode==GL_RENDER) { - - if (ctx->Polygon.SmoothFlag) { - _swrast_set_aa_triangle_function(ctx); - ASSERT(swrast->Triangle); - return; - } - - /* special case for occlusion testing */ - if (ctx->Query.CurrentOcclusionObject && - ctx->Depth.Test && - ctx->Depth.Mask == GL_FALSE && - ctx->Depth.Func == GL_LESS && - !ctx->Stencil.Enabled) { - if ((rgbmode && - ctx->Color.ColorMask[0] == 0 && - ctx->Color.ColorMask[1] == 0 && - ctx->Color.ColorMask[2] == 0 && - ctx->Color.ColorMask[3] == 0) - || - (!rgbmode && ctx->Color.IndexMask == 0)) { - USE(occlusion_zless_triangle); - return; - } - } - - if (!rgbmode) { - USE(ci_triangle); - return; - } - - /* - * XXX should examine swrast->_ActiveAttribMask to determine what - * needs to be interpolated. - */ - if (ctx->Texture._EnabledCoordUnits || - ctx->FragmentProgram._Current || - ctx->ATIFragmentShader._Enabled || - NEED_SECONDARY_COLOR(ctx) || - swrast->_FogEnabled) { - /* Ugh, we do a _lot_ of tests to pick the best textured tri func */ - const struct gl_texture_object *texObj2D; - const struct gl_texture_image *texImg; - GLenum minFilter, magFilter, envMode; - GLint format; - texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; - - texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL; - format = texImg ? texImg->TexFormat->MesaFormat : -1; - minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0; - magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0; - envMode = ctx->Texture.Unit[0].EnvMode; - - /* First see if we can use an optimized 2-D texture function */ - if (ctx->Texture._EnabledCoordUnits == 0x1 - && !ctx->FragmentProgram._Current - && !ctx->ATIFragmentShader._Enabled - && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT - && texObj2D->WrapS == GL_REPEAT - && texObj2D->WrapT == GL_REPEAT - && texImg->_IsPowerOfTwo - && texImg->Border == 0 - && texImg->Width == texImg->RowStride - && (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA) - && minFilter == magFilter - && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR - && !swrast->_FogEnabled - && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) { - if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { - if (minFilter == GL_NEAREST - && format == MESA_FORMAT_RGB - && (envMode == GL_REPLACE || envMode == GL_DECAL) - && ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT) - && ctx->Depth.Func == GL_LESS - && ctx->Depth.Mask == GL_TRUE) - || swrast->_RasterMask == TEXTURE_BIT) - && ctx->Polygon.StippleFlag == GL_FALSE - && ctx->DrawBuffer->Visual.depthBits <= 16) { - if (swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)) { - USE(simple_z_textured_triangle); - } - else { - USE(simple_textured_triangle); - } - } - else { -#if CHAN_BITS != 8 - USE(general_triangle); -#else - USE(affine_textured_triangle); -#endif - } - } - else { -#if CHAN_BITS != 8 - USE(general_triangle); -#else - USE(persp_textured_triangle); -#endif - } - } - else { - /* general case textured triangles */ - USE(general_triangle); - } - } - else { - ASSERT(!swrast->_FogEnabled); - ASSERT(!NEED_SECONDARY_COLOR(ctx)); - if (ctx->Light.ShadeModel==GL_SMOOTH) { - /* smooth shaded, no texturing, stippled or some raster ops */ -#if CHAN_BITS != 8 - USE(general_triangle); -#else - USE(smooth_rgba_triangle); -#endif - } - else { - /* flat shaded, no texturing, stippled or some raster ops */ -#if CHAN_BITS != 8 - USE(general_triangle); -#else - USE(flat_rgba_triangle); -#endif - } - } - } - else if (ctx->RenderMode==GL_FEEDBACK) { - USE(_swrast_feedback_triangle); - } - else { - /* GL_SELECT mode */ - USE(_swrast_select_triangle); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_triangle.h b/src/libs/mesa/mesa/swrast/s_triangle.h deleted file mode 100644 index b81932c730..0000000000 --- a/src/libs/mesa/mesa/swrast/s_triangle.h +++ /dev/null @@ -1,50 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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 S_TRIANGLES_H -#define S_TRIANGLES_H - - -#include "swrast.h" - - -extern GLboolean -_swrast_culltriangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2); - -extern void -_swrast_choose_triangle( GLcontext *ctx ); - -extern void -_swrast_add_spec_terms_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/s_trispan.h b/src/libs/mesa/mesa/swrast/s_trispan.h deleted file mode 100644 index 15207e863e..0000000000 --- a/src/libs/mesa/mesa/swrast/s_trispan.h +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 S_TRISPAN_H -#define S_TRISPAN_H - - -#endif /* S_TRISPAN_H */ diff --git a/src/libs/mesa/mesa/swrast/s_tritemp.h b/src/libs/mesa/mesa/swrast/s_tritemp.h deleted file mode 100644 index 8e3c5b5eeb..0000000000 --- a/src/libs/mesa/mesa/swrast/s_tritemp.h +++ /dev/null @@ -1,979 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - -/* - * Triangle Rasterizer Template - * - * This file is #include'd to generate custom triangle rasterizers. - * - * The following macros may be defined to indicate what auxillary information - * must be interpolated across the triangle: - * INTERP_Z - if defined, interpolate integer Z values - * INTERP_RGB - if defined, interpolate integer RGB values - * INTERP_ALPHA - if defined, interpolate integer Alpha values - * INTERP_INDEX - if defined, interpolate color index values - * INTERP_INT_TEX - if defined, interpolate integer ST texcoords - * (fast, simple 2-D texture mapping, without - * perspective correction) - * INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords, - * varying vars, etc) This also causes W to be - * computed for perspective correction). - * - * When one can directly address pixels in the color buffer the following - * macros can be defined and used to compute pixel addresses during - * rasterization (see pRow): - * PIXEL_TYPE - the datatype of a pixel (GLubyte, GLushort, GLuint) - * BYTES_PER_ROW - number of bytes per row in the color buffer - * PIXEL_ADDRESS(X,Y) - returns the address of pixel at (X,Y) where - * Y==0 at bottom of screen and increases upward. - * - * Similarly, for direct depth buffer access, this type is used for depth - * buffer addressing (see zRow): - * DEPTH_TYPE - either GLushort or GLuint - * - * Optionally, one may provide one-time setup code per triangle: - * SETUP_CODE - code which is to be executed once per triangle - * - * The following macro MUST be defined: - * RENDER_SPAN(span) - code to write a span of pixels. - * - * This code was designed for the origin to be in the lower-left corner. - * - * Inspired by triangle rasterizer code written by Allen Akin. Thanks Allen! - * - * - * Some notes on rasterization accuracy: - * - * This code uses fixed point arithmetic (the GLfixed type) to iterate - * over the triangle edges and interpolate ancillary data (such as Z, - * color, secondary color, etc). The number of fractional bits in - * GLfixed and the value of SUB_PIXEL_BITS has a direct bearing on the - * accuracy of rasterization. - * - * If SUB_PIXEL_BITS=4 then we'll snap the vertices to the nearest - * 1/16 of a pixel. If we're walking up a long, nearly vertical edge - * (dx=1/16, dy=1024) we'll need 4 + 10 = 14 fractional bits in - * GLfixed to walk the edge without error. If the maximum viewport - * height is 4K pixels, then we'll need 4 + 12 = 16 fractional bits. - * - * Historically, Mesa has used 11 fractional bits in GLfixed, snaps - * vertices to 1/16 pixel and allowed a maximum viewport height of 2K - * pixels. 11 fractional bits is actually insufficient for accurately - * rasterizing some triangles. More recently, the maximum viewport - * height was increased to 4K pixels. Thus, Mesa should be using 16 - * fractional bits in GLfixed. Unfortunately, there may be some issues - * with setting FIXED_FRAC_BITS=16, such as multiplication overflow. - * This will have to be examined in some detail... - * - * For now, if you find rasterization errors, particularly with tall, - * sliver triangles, try increasing FIXED_FRAC_BITS and/or decreasing - * SUB_PIXEL_BITS. - */ - - -/* - * Some code we unfortunately need to prevent negative interpolated colors. - */ -#ifndef CLAMP_INTERPOLANT -#define CLAMP_INTERPOLANT(CHANNEL, CHANNELSTEP, LEN) \ -do { \ - GLfixed endVal = span.CHANNEL + (LEN) * span.CHANNELSTEP; \ - if (endVal < 0) { \ - span.CHANNEL -= endVal; \ - } \ - if (span.CHANNEL < 0) { \ - span.CHANNEL = 0; \ - } \ -} while (0) -#endif - - -static void NAME(GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2 ) -{ - typedef struct { - const SWvertex *v0, *v1; /* Y(v0) < Y(v1) */ - GLfloat dx; /* X(v1) - X(v0) */ - GLfloat dy; /* Y(v1) - Y(v0) */ - GLfloat dxdy; /* dx/dy */ - GLfixed fdxdy; /* dx/dy in fixed-point */ - GLfloat adjy; /* adjust from v[0]->fy to fsy, scaled */ - GLfixed fsx; /* first sample point x coord */ - GLfixed fsy; - GLfixed fx0; /* fixed pt X of lower endpoint */ - GLint lines; /* number of lines to be sampled on this edge */ - } EdgeT; - - const SWcontext *swrast = SWRAST_CONTEXT(ctx); -#ifdef INTERP_Z - const GLint depthBits = ctx->DrawBuffer->Visual.depthBits; - const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; - const GLfloat maxDepth = ctx->DrawBuffer->_DepthMaxF; -#define FixedToDepth(F) ((F) >> fixedToDepthShift) -#endif - EdgeT eMaj, eTop, eBot; - GLfloat oneOverArea; - const SWvertex *vMin, *vMid, *vMax; /* Y(vMin)<=Y(vMid)<=Y(vMax) */ - GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign; - const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */ - GLfixed vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; - - SWspan span; - - (void) swrast; - - INIT_SPAN(span, GL_POLYGON); - span.y = 0; /* silence warnings */ - -#ifdef INTERP_Z - (void) fixedToDepthShift; -#endif - - /* - printf("%s()\n", __FUNCTION__); - printf(" %g, %g, %g\n", - v0->attrib[FRAG_ATTRIB_WPOS][0], - v0->attrib[FRAG_ATTRIB_WPOS][1], - v0->attrib[FRAG_ATTRIB_WPOS][2]); - printf(" %g, %g, %g\n", - v1->attrib[FRAG_ATTRIB_WPOS][0], - v1->attrib[FRAG_ATTRIB_WPOS][1], - v1->attrib[FRAG_ATTRIB_WPOS][2]); - printf(" %g, %g, %g\n", - v2->attrib[FRAG_ATTRIB_WPOS][0], - v2->attrib[FRAG_ATTRIB_WPOS][1], - v2->attrib[FRAG_ATTRIB_WPOS][2]); - */ - - /* Compute fixed point x,y coords w/ half-pixel offsets and snapping. - * And find the order of the 3 vertices along the Y axis. - */ - { - const GLfixed fy0 = FloatToFixed(v0->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; - const GLfixed fy1 = FloatToFixed(v1->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; - const GLfixed fy2 = FloatToFixed(v2->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; - if (fy0 <= fy1) { - if (fy1 <= fy2) { - /* y0 <= y1 <= y2 */ - vMin = v0; vMid = v1; vMax = v2; - vMin_fy = fy0; vMid_fy = fy1; vMax_fy = fy2; - } - else if (fy2 <= fy0) { - /* y2 <= y0 <= y1 */ - vMin = v2; vMid = v0; vMax = v1; - vMin_fy = fy2; vMid_fy = fy0; vMax_fy = fy1; - } - else { - /* y0 <= y2 <= y1 */ - vMin = v0; vMid = v2; vMax = v1; - vMin_fy = fy0; vMid_fy = fy2; vMax_fy = fy1; - bf = -bf; - } - } - else { - if (fy0 <= fy2) { - /* y1 <= y0 <= y2 */ - vMin = v1; vMid = v0; vMax = v2; - vMin_fy = fy1; vMid_fy = fy0; vMax_fy = fy2; - bf = -bf; - } - else if (fy2 <= fy1) { - /* y2 <= y1 <= y0 */ - vMin = v2; vMid = v1; vMax = v0; - vMin_fy = fy2; vMid_fy = fy1; vMax_fy = fy0; - bf = -bf; - } - else { - /* y1 <= y2 <= y0 */ - vMin = v1; vMid = v2; vMax = v0; - vMin_fy = fy1; vMid_fy = fy2; vMax_fy = fy0; - } - } - - /* fixed point X coords */ - vMin_fx = FloatToFixed(vMin->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; - vMid_fx = FloatToFixed(vMid->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; - vMax_fx = FloatToFixed(vMax->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; - } - - /* vertex/edge relationship */ - eMaj.v0 = vMin; eMaj.v1 = vMax; /*TODO: .v1's not needed */ - eTop.v0 = vMid; eTop.v1 = vMax; - eBot.v0 = vMin; eBot.v1 = vMid; - - /* compute deltas for each edge: vertex[upper] - vertex[lower] */ - eMaj.dx = FixedToFloat(vMax_fx - vMin_fx); - eMaj.dy = FixedToFloat(vMax_fy - vMin_fy); - eTop.dx = FixedToFloat(vMax_fx - vMid_fx); - eTop.dy = FixedToFloat(vMax_fy - vMid_fy); - eBot.dx = FixedToFloat(vMid_fx - vMin_fx); - eBot.dy = FixedToFloat(vMid_fy - vMin_fy); - - /* compute area, oneOverArea and perform backface culling */ - { - const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy; - - if (IS_INF_OR_NAN(area) || area == 0.0F) - return; - - if (area * bf * swrast->_BackfaceCullSign < 0.0) - return; - - oneOverArea = 1.0F / area; - - /* 0 = front, 1 = back */ - span.facing = oneOverArea * bf > 0.0F; - } - - /* Edge setup. For a triangle strip these could be reused... */ - { - eMaj.fsy = FixedCeil(vMin_fy); - eMaj.lines = FixedToInt(FixedCeil(vMax_fy - eMaj.fsy)); - if (eMaj.lines > 0) { - eMaj.dxdy = eMaj.dx / eMaj.dy; - eMaj.fdxdy = SignedFloatToFixed(eMaj.dxdy); - eMaj.adjy = (GLfloat) (eMaj.fsy - vMin_fy); /* SCALED! */ - eMaj.fx0 = vMin_fx; - eMaj.fsx = eMaj.fx0 + (GLfixed) (eMaj.adjy * eMaj.dxdy); - } - else { - return; /*CULLED*/ - } - - eTop.fsy = FixedCeil(vMid_fy); - eTop.lines = FixedToInt(FixedCeil(vMax_fy - eTop.fsy)); - if (eTop.lines > 0) { - eTop.dxdy = eTop.dx / eTop.dy; - eTop.fdxdy = SignedFloatToFixed(eTop.dxdy); - eTop.adjy = (GLfloat) (eTop.fsy - vMid_fy); /* SCALED! */ - eTop.fx0 = vMid_fx; - eTop.fsx = eTop.fx0 + (GLfixed) (eTop.adjy * eTop.dxdy); - } - - eBot.fsy = FixedCeil(vMin_fy); - eBot.lines = FixedToInt(FixedCeil(vMid_fy - eBot.fsy)); - if (eBot.lines > 0) { - eBot.dxdy = eBot.dx / eBot.dy; - eBot.fdxdy = SignedFloatToFixed(eBot.dxdy); - eBot.adjy = (GLfloat) (eBot.fsy - vMin_fy); /* SCALED! */ - eBot.fx0 = vMin_fx; - eBot.fsx = eBot.fx0 + (GLfixed) (eBot.adjy * eBot.dxdy); - } - } - - /* - * Conceptually, we view a triangle as two subtriangles - * separated by a perfectly horizontal line. The edge that is - * intersected by this line is one with maximal absolute dy; we - * call it a ``major'' edge. The other two edges are the - * ``top'' edge (for the upper subtriangle) and the ``bottom'' - * edge (for the lower subtriangle). If either of these two - * edges is horizontal or very close to horizontal, the - * corresponding subtriangle might cover zero sample points; - * we take care to handle such cases, for performance as well - * as correctness. - * - * By stepping rasterization parameters along the major edge, - * we can avoid recomputing them at the discontinuity where - * the top and bottom edges meet. However, this forces us to - * be able to scan both left-to-right and right-to-left. - * Also, we must determine whether the major edge is at the - * left or right side of the triangle. We do this by - * computing the magnitude of the cross-product of the major - * and top edges. Since this magnitude depends on the sine of - * the angle between the two edges, its sign tells us whether - * we turn to the left or to the right when travelling along - * the major edge to the top edge, and from this we infer - * whether the major edge is on the left or the right. - * - * Serendipitously, this cross-product magnitude is also a - * value we need to compute the iteration parameter - * derivatives for the triangle, and it can be used to perform - * backface culling because its sign tells us whether the - * triangle is clockwise or counterclockwise. In this code we - * refer to it as ``area'' because it's also proportional to - * the pixel area of the triangle. - */ - - { - GLint scan_from_left_to_right; /* true if scanning left-to-right */ -#ifdef INTERP_INDEX - GLfloat didx, didy; -#endif - - /* - * Execute user-supplied setup code - */ -#ifdef SETUP_CODE - SETUP_CODE -#endif - - scan_from_left_to_right = (oneOverArea < 0.0F); - - - /* compute d?/dx and d?/dy derivatives */ -#ifdef INTERP_Z - span.interpMask |= SPAN_Z; - { - GLfloat eMaj_dz = vMax->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; - GLfloat eBot_dz = vMid->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; - span.attrStepX[FRAG_ATTRIB_WPOS][2] = oneOverArea * (eMaj_dz * eBot.dy - eMaj.dy * eBot_dz); - if (span.attrStepX[FRAG_ATTRIB_WPOS][2] > maxDepth || - span.attrStepX[FRAG_ATTRIB_WPOS][2] < -maxDepth) { - /* probably a sliver triangle */ - span.attrStepX[FRAG_ATTRIB_WPOS][2] = 0.0; - span.attrStepY[FRAG_ATTRIB_WPOS][2] = 0.0; - } - else { - span.attrStepY[FRAG_ATTRIB_WPOS][2] = oneOverArea * (eMaj.dx * eBot_dz - eMaj_dz * eBot.dx); - } - if (depthBits <= 16) - span.zStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_WPOS][2]); - else - span.zStep = (GLint) span.attrStepX[FRAG_ATTRIB_WPOS][2]; - } -#endif -#ifdef INTERP_RGB - span.interpMask |= SPAN_RGBA; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_dr = (GLfloat) (vMax->color[RCOMP] - vMin->color[RCOMP]); - GLfloat eBot_dr = (GLfloat) (vMid->color[RCOMP] - vMin->color[RCOMP]); - GLfloat eMaj_dg = (GLfloat) (vMax->color[GCOMP] - vMin->color[GCOMP]); - GLfloat eBot_dg = (GLfloat) (vMid->color[GCOMP] - vMin->color[GCOMP]); - GLfloat eMaj_db = (GLfloat) (vMax->color[BCOMP] - vMin->color[BCOMP]); - GLfloat eBot_db = (GLfloat) (vMid->color[BCOMP] - vMin->color[BCOMP]); -# ifdef INTERP_ALPHA - GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]); - GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]); -# endif - span.attrStepX[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); - span.attrStepY[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg); - span.attrStepY[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); - span.attrStepY[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); - span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][0]); - span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][1]); - span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][2]); -# ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); - span.attrStepY[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); - span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][3]); -# endif /* INTERP_ALPHA */ - } - else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); - span.interpMask |= SPAN_FLAT; - span.attrStepX[FRAG_ATTRIB_COL0][0] = span.attrStepY[FRAG_ATTRIB_COL0][0] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL0][1] = span.attrStepY[FRAG_ATTRIB_COL0][1] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL0][2] = span.attrStepY[FRAG_ATTRIB_COL0][2] = 0.0F; - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; -# ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F; - span.alphaStep = 0; -# endif - } -#endif /* INTERP_RGB */ -#ifdef INTERP_INDEX - span.interpMask |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_di = vMax->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; - GLfloat eBot_di = vMid->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; - didx = oneOverArea * (eMaj_di * eBot.dy - eMaj.dy * eBot_di); - didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx); - span.indexStep = SignedFloatToFixed(didx); - } - else { - span.interpMask |= SPAN_FLAT; - didx = didy = 0.0F; - span.indexStep = 0; - } -#endif -#ifdef INTERP_INT_TEX - { - GLfloat eMaj_ds = (vMax->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; - GLfloat eBot_ds = (vMid->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; - GLfloat eMaj_dt = (vMax->attrib[FRAG_ATTRIB_TEX0][1] - vMin->attrib[FRAG_ATTRIB_TEX0][1]) * T_SCALE; - GLfloat eBot_dt = (vMid->attrib[FRAG_ATTRIB_TEX0][1] - vMin->attrib[FRAG_ATTRIB_TEX0][1]) * T_SCALE; - span.attrStepX[FRAG_ATTRIB_TEX0][0] = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds); - span.attrStepY[FRAG_ATTRIB_TEX0][0] = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx); - span.attrStepX[FRAG_ATTRIB_TEX0][1] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt); - span.attrStepY[FRAG_ATTRIB_TEX0][1] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx); - span.intTexStep[0] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][0]); - span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]); - } -#endif -#ifdef INTERP_ATTRIBS - { - /* attrib[FRAG_ATTRIB_WPOS][3] is 1/W */ - const GLfloat wMax = vMax->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat wMin = vMin->attrib[FRAG_ATTRIB_WPOS][3]; - const GLfloat wMid = vMid->attrib[FRAG_ATTRIB_WPOS][3]; - { - const GLfloat eMaj_dw = wMax - wMin; - const GLfloat eBot_dw = wMid - wMin; - span.attrStepX[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj_dw * eBot.dy - eMaj.dy * eBot_dw); - span.attrStepY[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj.dx * eBot_dw - eMaj_dw * eBot.dx); - } - ATTRIB_LOOP_BEGIN - if (swrast->_InterpMode[attr] == GL_FLAT) { - ASSIGN_4V(span.attrStepX[attr], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span.attrStepY[attr], 0.0, 0.0, 0.0, 0.0); - } - else { - GLuint c; - for (c = 0; c < 4; c++) { - GLfloat eMaj_da = vMax->attrib[attr][c] * wMax - vMin->attrib[attr][c] * wMin; - GLfloat eBot_da = vMid->attrib[attr][c] * wMid - vMin->attrib[attr][c] * wMin; - span.attrStepX[attr][c] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); - span.attrStepY[attr][c] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); - } - } - ATTRIB_LOOP_END - } -#endif - - /* - * We always sample at pixel centers. However, we avoid - * explicit half-pixel offsets in this code by incorporating - * the proper offset in each of x and y during the - * transformation to window coordinates. - * - * We also apply the usual rasterization rules to prevent - * cracks and overlaps. A pixel is considered inside a - * subtriangle if it meets all of four conditions: it is on or - * to the right of the left edge, strictly to the left of the - * right edge, on or below the top edge, and strictly above - * the bottom edge. (Some edges may be degenerate.) - * - * The following discussion assumes left-to-right scanning - * (that is, the major edge is on the left); the right-to-left - * case is a straightforward variation. - * - * We start by finding the half-integral y coordinate that is - * at or below the top of the triangle. This gives us the - * first scan line that could possibly contain pixels that are - * inside the triangle. - * - * Next we creep down the major edge until we reach that y, - * and compute the corresponding x coordinate on the edge. - * Then we find the half-integral x that lies on or just - * inside the edge. This is the first pixel that might lie in - * the interior of the triangle. (We won't know for sure - * until we check the other edges.) - * - * As we rasterize the triangle, we'll step down the major - * edge. For each step in y, we'll move an integer number - * of steps in x. There are two possible x step sizes, which - * we'll call the ``inner'' step (guaranteed to land on the - * edge or inside it) and the ``outer'' step (guaranteed to - * land on the edge or outside it). The inner and outer steps - * differ by one. During rasterization we maintain an error - * term that indicates our distance from the true edge, and - * select either the inner step or the outer step, whichever - * gets us to the first pixel that falls inside the triangle. - * - * All parameters (z, red, etc.) as well as the buffer - * addresses for color and z have inner and outer step values, - * so that we can increment them appropriately. This method - * eliminates the need to adjust parameters by creeping a - * sub-pixel amount into the triangle at each scanline. - */ - - { - GLint subTriangle; - GLfixed fxLeftEdge = 0, fxRightEdge = 0; - GLfixed fdxLeftEdge = 0, fdxRightEdge = 0; - GLfixed fError = 0, fdError = 0; -#ifdef PIXEL_ADDRESS - PIXEL_TYPE *pRow = NULL; - GLint dPRowOuter = 0, dPRowInner; /* offset in bytes */ -#endif -#ifdef INTERP_Z -# ifdef DEPTH_TYPE - struct gl_renderbuffer *zrb - = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; - DEPTH_TYPE *zRow = NULL; - GLint dZRowOuter = 0, dZRowInner; /* offset in bytes */ -# endif - GLuint zLeft = 0; - GLfixed fdzOuter = 0, fdzInner; -#endif -#ifdef INTERP_RGB - GLint rLeft = 0, fdrOuter = 0, fdrInner; - GLint gLeft = 0, fdgOuter = 0, fdgInner; - GLint bLeft = 0, fdbOuter = 0, fdbInner; -#endif -#ifdef INTERP_ALPHA - GLint aLeft = 0, fdaOuter = 0, fdaInner; -#endif -#ifdef INTERP_INDEX - GLfixed iLeft=0, diOuter=0, diInner; -#endif -#ifdef INTERP_INT_TEX - GLfixed sLeft=0, dsOuter=0, dsInner; - GLfixed tLeft=0, dtOuter=0, dtInner; -#endif -#ifdef INTERP_ATTRIBS - GLfloat wLeft = 0, dwOuter = 0, dwInner; - GLfloat attrLeft[FRAG_ATTRIB_MAX][4]; - GLfloat daOuter[FRAG_ATTRIB_MAX][4], daInner[FRAG_ATTRIB_MAX][4]; -#endif - - for (subTriangle=0; subTriangle<=1; subTriangle++) { - EdgeT *eLeft, *eRight; - int setupLeft, setupRight; - int lines; - - if (subTriangle==0) { - /* bottom half */ - if (scan_from_left_to_right) { - eLeft = &eMaj; - eRight = &eBot; - lines = eRight->lines; - setupLeft = 1; - setupRight = 1; - } - else { - eLeft = &eBot; - eRight = &eMaj; - lines = eLeft->lines; - setupLeft = 1; - setupRight = 1; - } - } - else { - /* top half */ - if (scan_from_left_to_right) { - eLeft = &eMaj; - eRight = &eTop; - lines = eRight->lines; - setupLeft = 0; - setupRight = 1; - } - else { - eLeft = &eTop; - eRight = &eMaj; - lines = eLeft->lines; - setupLeft = 1; - setupRight = 0; - } - if (lines == 0) - return; - } - - if (setupLeft && eLeft->lines > 0) { - const SWvertex *vLower = eLeft->v0; - const GLfixed fsy = eLeft->fsy; - const GLfixed fsx = eLeft->fsx; /* no fractional part */ - const GLfixed fx = FixedCeil(fsx); /* no fractional part */ - const GLfixed adjx = (GLfixed) (fx - eLeft->fx0); /* SCALED! */ - const GLfixed adjy = (GLfixed) eLeft->adjy; /* SCALED! */ - GLint idxOuter; - GLfloat dxOuter; - GLfixed fdxOuter; - - fError = fx - fsx - FIXED_ONE; - fxLeftEdge = fsx - FIXED_EPSILON; - fdxLeftEdge = eLeft->fdxdy; - fdxOuter = FixedFloor(fdxLeftEdge - FIXED_EPSILON); - fdError = fdxOuter - fdxLeftEdge + FIXED_ONE; - idxOuter = FixedToInt(fdxOuter); - dxOuter = (GLfloat) idxOuter; - span.y = FixedToInt(fsy); - - /* silence warnings on some compilers */ - (void) dxOuter; - (void) adjx; - (void) adjy; - (void) vLower; - -#ifdef PIXEL_ADDRESS - { - pRow = (PIXEL_TYPE *) PIXEL_ADDRESS(FixedToInt(fxLeftEdge), span.y); - dPRowOuter = -((int)BYTES_PER_ROW) + idxOuter * sizeof(PIXEL_TYPE); - /* negative because Y=0 at bottom and increases upward */ - } -#endif - /* - * Now we need the set of parameter (z, color, etc.) values at - * the point (fx, fsy). This gives us properly-sampled parameter - * values that we can step from pixel to pixel. Furthermore, - * although we might have intermediate results that overflow - * the normal parameter range when we step temporarily outside - * the triangle, we shouldn't overflow or underflow for any - * pixel that's actually inside the triangle. - */ - -#ifdef INTERP_Z - { - GLfloat z0 = vLower->attrib[FRAG_ATTRIB_WPOS][2]; - if (depthBits <= 16) { - /* interpolate fixed-pt values */ - GLfloat tmp = (z0 * FIXED_SCALE - + span.attrStepX[FRAG_ATTRIB_WPOS][2] * adjx - + span.attrStepY[FRAG_ATTRIB_WPOS][2] * adjy) + FIXED_HALF; - if (tmp < MAX_GLUINT / 2) - zLeft = (GLfixed) tmp; - else - zLeft = MAX_GLUINT / 2; - fdzOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_WPOS][2] + - dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); - } - else { - /* interpolate depth values w/out scaling */ - zLeft = (GLuint) (z0 + span.attrStepX[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjx) - + span.attrStepY[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjy)); - fdzOuter = (GLint) (span.attrStepY[FRAG_ATTRIB_WPOS][2] + - dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); - } -# ifdef DEPTH_TYPE - zRow = (DEPTH_TYPE *) - zrb->GetPointer(ctx, zrb, FixedToInt(fxLeftEdge), span.y); - dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE); -# endif - } -#endif -#ifdef INTERP_RGB - if (ctx->Light.ShadeModel == GL_SMOOTH) { - rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF; - gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF; - bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF; - fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]); - fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]); - fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]); -# ifdef INTERP_ALPHA - aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF; - fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); -# endif - } - else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); - rLeft = ChanToFixed(v2->color[RCOMP]); - gLeft = ChanToFixed(v2->color[GCOMP]); - bLeft = ChanToFixed(v2->color[BCOMP]); - fdrOuter = fdgOuter = fdbOuter = 0; -# ifdef INTERP_ALPHA - aLeft = ChanToFixed(v2->color[ACOMP]); - fdaOuter = 0; -# endif - } -#endif /* INTERP_RGB */ - - -#ifdef INTERP_INDEX - if (ctx->Light.ShadeModel == GL_SMOOTH) { - iLeft = (GLfixed)(vLower->attrib[FRAG_ATTRIB_CI][0] * FIXED_SCALE - + didx * adjx + didy * adjy) + FIXED_HALF; - diOuter = SignedFloatToFixed(didy + dxOuter * didx); - } - else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); - iLeft = FloatToFixed(v2->attrib[FRAG_ATTRIB_CI][0]); - diOuter = 0; - } -#endif -#ifdef INTERP_INT_TEX - { - GLfloat s0, t0; - s0 = vLower->attrib[FRAG_ATTRIB_TEX0][0] * S_SCALE; - sLeft = (GLfixed)(s0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][0] * adjx - + span.attrStepY[FRAG_ATTRIB_TEX0][0] * adjy) + FIXED_HALF; - dsOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][0] - + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][0]); - - t0 = vLower->attrib[FRAG_ATTRIB_TEX0][1] * T_SCALE; - tLeft = (GLfixed)(t0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][1] * adjx - + span.attrStepY[FRAG_ATTRIB_TEX0][1] * adjy) + FIXED_HALF; - dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] - + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]); - } -#endif -#ifdef INTERP_ATTRIBS - { - const GLuint attr = FRAG_ATTRIB_WPOS; - wLeft = vLower->attrib[FRAG_ATTRIB_WPOS][3] - + (span.attrStepX[attr][3] * adjx - + span.attrStepY[attr][3] * adjy) * (1.0F/FIXED_SCALE); - dwOuter = span.attrStepY[attr][3] + dxOuter * span.attrStepX[attr][3]; - } - ATTRIB_LOOP_BEGIN - const GLfloat invW = vLower->attrib[FRAG_ATTRIB_WPOS][3]; - if (swrast->_InterpMode[attr] == GL_FLAT) { - GLuint c; - for (c = 0; c < 4; c++) { - attrLeft[attr][c] = v2->attrib[attr][c] * invW; - daOuter[attr][c] = 0.0; - } - } - else { - GLuint c; - for (c = 0; c < 4; c++) { - const GLfloat a = vLower->attrib[attr][c] * invW; - attrLeft[attr][c] = a + ( span.attrStepX[attr][c] * adjx - + span.attrStepY[attr][c] * adjy) * (1.0F/FIXED_SCALE); - daOuter[attr][c] = span.attrStepY[attr][c] + dxOuter * span.attrStepX[attr][c]; - } - } - ATTRIB_LOOP_END -#endif - } /*if setupLeft*/ - - - if (setupRight && eRight->lines>0) { - fxRightEdge = eRight->fsx - FIXED_EPSILON; - fdxRightEdge = eRight->fdxdy; - } - - if (lines==0) { - continue; - } - - - /* Rasterize setup */ -#ifdef PIXEL_ADDRESS - dPRowInner = dPRowOuter + sizeof(PIXEL_TYPE); -#endif -#ifdef INTERP_Z -# ifdef DEPTH_TYPE - dZRowInner = dZRowOuter + sizeof(DEPTH_TYPE); -# endif - fdzInner = fdzOuter + span.zStep; -#endif -#ifdef INTERP_RGB - fdrInner = fdrOuter + span.redStep; - fdgInner = fdgOuter + span.greenStep; - fdbInner = fdbOuter + span.blueStep; -#endif -#ifdef INTERP_ALPHA - fdaInner = fdaOuter + span.alphaStep; -#endif -#ifdef INTERP_INDEX - diInner = diOuter + span.indexStep; -#endif -#ifdef INTERP_INT_TEX - dsInner = dsOuter + span.intTexStep[0]; - dtInner = dtOuter + span.intTexStep[1]; -#endif -#ifdef INTERP_ATTRIBS - dwInner = dwOuter + span.attrStepX[FRAG_ATTRIB_WPOS][3]; - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - daInner[attr][c] = daOuter[attr][c] + span.attrStepX[attr][c]; - } - ATTRIB_LOOP_END -#endif - - while (lines > 0) { - /* initialize the span interpolants to the leftmost value */ - /* ff = fixed-pt fragment */ - const GLint right = FixedToInt(fxRightEdge); - span.x = FixedToInt(fxLeftEdge); - if (right <= span.x) - span.end = 0; - else - span.end = right - span.x; - -#ifdef INTERP_Z - span.z = zLeft; -#endif -#ifdef INTERP_RGB - span.red = rLeft; - span.green = gLeft; - span.blue = bLeft; -#endif -#ifdef INTERP_ALPHA - span.alpha = aLeft; -#endif -#ifdef INTERP_INDEX - span.index = iLeft; -#endif -#ifdef INTERP_INT_TEX - span.intTex[0] = sLeft; - span.intTex[1] = tLeft; -#endif - -#ifdef INTERP_ATTRIBS - span.attrStart[FRAG_ATTRIB_WPOS][3] = wLeft; - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - span.attrStart[attr][c] = attrLeft[attr][c]; - } - ATTRIB_LOOP_END -#endif - - /* This is where we actually generate fragments */ - /* XXX the test for span.y > 0 _shouldn't_ be needed but - * it fixes a problem on 64-bit Opterons (bug 4842). - */ - if (span.end > 0 && span.y >= 0) { - const GLint len = span.end - 1; - (void) len; -#ifdef INTERP_RGB - CLAMP_INTERPOLANT(red, redStep, len); - CLAMP_INTERPOLANT(green, greenStep, len); - CLAMP_INTERPOLANT(blue, blueStep, len); -#endif -#ifdef INTERP_ALPHA - CLAMP_INTERPOLANT(alpha, alphaStep, len); -#endif -#ifdef INTERP_INDEX - CLAMP_INTERPOLANT(index, indexStep, len); -#endif - { - RENDER_SPAN( span ); - } - } - - /* - * Advance to the next scan line. Compute the - * new edge coordinates, and adjust the - * pixel-center x coordinate so that it stays - * on or inside the major edge. - */ - span.y++; - lines--; - - fxLeftEdge += fdxLeftEdge; - fxRightEdge += fdxRightEdge; - - fError += fdError; - if (fError >= 0) { - fError -= FIXED_ONE; - -#ifdef PIXEL_ADDRESS - pRow = (PIXEL_TYPE *) ((GLubyte *) pRow + dPRowOuter); -#endif -#ifdef INTERP_Z -# ifdef DEPTH_TYPE - zRow = (DEPTH_TYPE *) ((GLubyte *) zRow + dZRowOuter); -# endif - zLeft += fdzOuter; -#endif -#ifdef INTERP_RGB - rLeft += fdrOuter; - gLeft += fdgOuter; - bLeft += fdbOuter; -#endif -#ifdef INTERP_ALPHA - aLeft += fdaOuter; -#endif -#ifdef INTERP_INDEX - iLeft += diOuter; -#endif -#ifdef INTERP_INT_TEX - sLeft += dsOuter; - tLeft += dtOuter; -#endif -#ifdef INTERP_ATTRIBS - wLeft += dwOuter; - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - attrLeft[attr][c] += daOuter[attr][c]; - } - ATTRIB_LOOP_END -#endif - } - else { -#ifdef PIXEL_ADDRESS - pRow = (PIXEL_TYPE *) ((GLubyte *) pRow + dPRowInner); -#endif -#ifdef INTERP_Z -# ifdef DEPTH_TYPE - zRow = (DEPTH_TYPE *) ((GLubyte *) zRow + dZRowInner); -# endif - zLeft += fdzInner; -#endif -#ifdef INTERP_RGB - rLeft += fdrInner; - gLeft += fdgInner; - bLeft += fdbInner; -#endif -#ifdef INTERP_ALPHA - aLeft += fdaInner; -#endif -#ifdef INTERP_INDEX - iLeft += diInner; -#endif -#ifdef INTERP_INT_TEX - sLeft += dsInner; - tLeft += dtInner; -#endif -#ifdef INTERP_ATTRIBS - wLeft += dwInner; - ATTRIB_LOOP_BEGIN - GLuint c; - for (c = 0; c < 4; c++) { - attrLeft[attr][c] += daInner[attr][c]; - } - ATTRIB_LOOP_END -#endif - } - } /*while lines>0*/ - - } /* for subTriangle */ - - } - } -} - -#undef SETUP_CODE -#undef RENDER_SPAN - -#undef PIXEL_TYPE -#undef BYTES_PER_ROW -#undef PIXEL_ADDRESS -#undef DEPTH_TYPE - -#undef INTERP_Z -#undef INTERP_RGB -#undef INTERP_ALPHA -#undef INTERP_INDEX -#undef INTERP_INT_TEX -#undef INTERP_ATTRIBS - -#undef S_SCALE -#undef T_SCALE - -#undef FixedToDepth - -#undef NAME diff --git a/src/libs/mesa/mesa/swrast/s_zoom.c b/src/libs/mesa/mesa/swrast/s_zoom.c deleted file mode 100644 index a48eae1925..0000000000 --- a/src/libs/mesa/mesa/swrast/s_zoom.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 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. - */ - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/colormac.h" - -#include "s_context.h" -#include "s_span.h" -#include "s_stencil.h" -#include "s_zoom.h" - - -/** - * Compute the bounds of the region resulting from zooming a pixel span. - * The resulting region will be entirely inside the window/scissor bounds - * so no additional clipping is needed. - * \param imageX, imageY position of the mage being drawn (gl WindowPos) - * \param spanX, spanY position of span being drawing - * \param width number of pixels in span - * \param x0, x1 returned X bounds of zoomed region [x0, x1) - * \param y0, y1 returned Y bounds of zoomed region [y0, y1) - * \return GL_TRUE if any zoomed pixels visible, GL_FALSE if totally clipped - */ -static GLboolean -compute_zoomed_bounds(GLcontext *ctx, GLint imageX, GLint imageY, - GLint spanX, GLint spanY, GLint width, - GLint *x0, GLint *x1, GLint *y0, GLint *y1) -{ - const struct gl_framebuffer *fb = ctx->DrawBuffer; - GLint c0, c1, r0, r1; - - ASSERT(spanX >= imageX); - ASSERT(spanY >= imageY); - - /* - * Compute destination columns: [c0, c1) - */ - c0 = imageX + (GLint) ((spanX - imageX) * ctx->Pixel.ZoomX); - c1 = imageX + (GLint) ((spanX + width - imageX) * ctx->Pixel.ZoomX); - if (c1 < c0) { - /* swap */ - GLint tmp = c1; - c1 = c0; - c0 = tmp; - } - c0 = CLAMP(c0, fb->_Xmin, fb->_Xmax); - c1 = CLAMP(c1, fb->_Xmin, fb->_Xmax); - if (c0 == c1) { - return GL_FALSE; /* no width */ - } - - /* - * Compute destination rows: [r0, r1) - */ - r0 = imageY + (GLint) ((spanY - imageY) * ctx->Pixel.ZoomY); - r1 = imageY + (GLint) ((spanY + 1 - imageY) * ctx->Pixel.ZoomY); - if (r1 < r0) { - /* swap */ - GLint tmp = r1; - r1 = r0; - r0 = tmp; - } - r0 = CLAMP(r0, fb->_Ymin, fb->_Ymax); - r1 = CLAMP(r1, fb->_Ymin, fb->_Ymax); - if (r0 == r1) { - return GL_FALSE; /* no height */ - } - - *x0 = c0; - *x1 = c1; - *y0 = r0; - *y1 = r1; - - return GL_TRUE; -} - - -/** - * Convert a zoomed x image coordinate back to an unzoomed x coord. - * 'zx' is screen position of a pixel in the zoomed image, who's left edge - * is at 'imageX'. - * return corresponding x coord in the original, unzoomed image. - * This can use this for unzooming X or Y values. - */ -static INLINE GLint -unzoom_x(GLfloat zoomX, GLint imageX, GLint zx) -{ - /* - zx = imageX + (x - imageX) * zoomX; - zx - imageX = (x - imageX) * zoomX; - (zx - imageX) / zoomX = x - imageX; - */ - GLint x; - if (zoomX < 0.0) - zx++; - x = imageX + (GLint) ((zx - imageX) / zoomX); - return x; -} - - - -/** - * Helper function called from _swrast_write_zoomed_rgba/rgb/ - * index/depth_span(). - */ -static void -zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, - const GLvoid *src, GLenum format ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - SWspan zoomed; - GLint x0, x1, y0, y1; - GLint zoomedWidth; - - if (!compute_zoomed_bounds(ctx, imgX, imgY, span->x, span->y, span->end, - &x0, &x1, &y0, &y1)) { - return; /* totally clipped */ - } - - if (!swrast->ZoomedArrays) { - /* allocate on demand */ - swrast->ZoomedArrays = (SWspanarrays *) CALLOC(sizeof(SWspanarrays)); - if (!swrast->ZoomedArrays) - return; - } - - zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= MAX_WIDTH); - - /* no pixel arrays! must be horizontal spans. */ - ASSERT((span->arrayMask & SPAN_XY) == 0); - ASSERT(span->primitive == GL_BITMAP); - - INIT_SPAN(zoomed, GL_BITMAP); - zoomed.x = x0; - zoomed.end = zoomedWidth; - zoomed.array = swrast->ZoomedArrays; - zoomed.array->ChanType = span->array->ChanType; - if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) - zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba8; - else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) - zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16; - else - zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0]; - - COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]); - COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]); - COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]); - - zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0]; - zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0]; - zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0]; - - if (format == GL_RGBA || format == GL_RGB) { - /* copy Z info */ - zoomed.z = span->z; - zoomed.zStep = span->zStep; - /* we'll generate an array of colorss */ - zoomed.interpMask = span->interpMask & ~SPAN_RGBA; - zoomed.arrayMask |= SPAN_RGBA; - zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ - ASSERT(span->arrayMask & SPAN_RGBA); - } - else if (format == GL_COLOR_INDEX) { - /* copy Z info */ - zoomed.z = span->z; - zoomed.zStep = span->zStep; - /* we'll generate an array of color indexes */ - zoomed.interpMask = span->interpMask & ~SPAN_INDEX; - zoomed.arrayMask |= SPAN_INDEX; - ASSERT(span->arrayMask & SPAN_INDEX); - } - else if (format == GL_DEPTH_COMPONENT) { - /* Copy color info */ - zoomed.red = span->red; - zoomed.green = span->green; - zoomed.blue = span->blue; - zoomed.alpha = span->alpha; - zoomed.redStep = span->redStep; - zoomed.greenStep = span->greenStep; - zoomed.blueStep = span->blueStep; - zoomed.alphaStep = span->alphaStep; - /* we'll generate an array of depth values */ - zoomed.interpMask = span->interpMask & ~SPAN_Z; - zoomed.arrayMask |= SPAN_Z; - ASSERT(span->arrayMask & SPAN_Z); - } - else { - _mesa_problem(ctx, "Bad format in zoom_span"); - return; - } - - /* zoom the span horizontally */ - if (format == GL_RGBA) { - if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) { - const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - COPY_4UBV(zoomed.array->rgba8[i], rgba[j]); - } - } - else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { - const GLushort (*rgba)[4] = (const GLushort (*)[4]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - COPY_4V(zoomed.array->rgba16[i], rgba[j]); - } - } - else { - const GLfloat (*rgba)[4] = (const GLfloat (*)[4]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < span->end); - COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]); - } - } - } - else if (format == GL_RGB) { - if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) { - const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->rgba8[i][0] = rgb[j][0]; - zoomed.array->rgba8[i][1] = rgb[j][1]; - zoomed.array->rgba8[i][2] = rgb[j][2]; - zoomed.array->rgba8[i][3] = 0xff; - } - } - else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { - const GLushort (*rgb)[3] = (const GLushort (*)[3]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->rgba16[i][0] = rgb[j][0]; - zoomed.array->rgba16[i][1] = rgb[j][1]; - zoomed.array->rgba16[i][2] = rgb[j][2]; - zoomed.array->rgba16[i][3] = 0xffff; - } - } - else { - const GLfloat (*rgb)[3] = (const GLfloat (*)[3]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < span->end); - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F; - } - } - } - else if (format == GL_COLOR_INDEX) { - const GLuint *indexes = (const GLuint *) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->index[i] = indexes[j]; - } - } - else if (format == GL_DEPTH_COMPONENT) { - const GLuint *zValues = (const GLuint *) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->z[i] = zValues[j]; - } - /* Now, fall into either the RGB or COLOR_INDEX path below */ - format = ctx->Visual.rgbMode ? GL_RGBA : GL_COLOR_INDEX; - } - - /* write the span in rows [r0, r1) */ - if (format == GL_RGBA || format == GL_RGB) { - /* Writing the span may modify the colors, so make a backup now if we're - * going to call _swrast_write_zoomed_span() more than once. - * Also, clipping may change the span end value, so store it as well. - */ - const GLint end = zoomed.end; /* save */ - GLuint rgbaSave[MAX_WIDTH][4]; - const GLint pixelSize = - (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : - ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) - : 4 * sizeof(GLfloat)); - if (y1 - y0 > 1) { - MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); - } - for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { - _swrast_write_rgba_span(ctx, &zoomed); - zoomed.end = end; /* restore */ - if (y1 - y0 > 1) { - /* restore the colors */ - MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); - } - } - } - else if (format == GL_COLOR_INDEX) { - /* use specular color array for temp storage */ - GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; - const GLint end = zoomed.end; /* save */ - if (y1 - y0 > 1) { - MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); - } - for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { - _swrast_write_index_span(ctx, &zoomed); - zoomed.end = end; /* restore */ - if (y1 - y0 > 1) { - /* restore the colors */ - MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); - } - } - } -} - - -void -_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span, const GLvoid *rgba) -{ - zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA); -} - - -void -_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span, const GLvoid *rgb) -{ - zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB); -} - - -void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span) -{ - zoom_span(ctx, imgX, imgY, span, - (const GLvoid *) span->array->index, GL_COLOR_INDEX); -} - - -void -_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span) -{ - zoom_span(ctx, imgX, imgY, span, - (const GLvoid *) span->array->z, GL_DEPTH_COMPONENT); -} - - -/** - * Zoom/write stencil values. - * No per-fragment operations are applied. - */ -void -_swrast_write_zoomed_stencil_span(GLcontext *ctx, GLint imgX, GLint imgY, - GLint width, GLint spanX, GLint spanY, - const GLstencil stencil[]) -{ - GLstencil zoomedVals[MAX_WIDTH]; - GLint x0, x1, y0, y1, y; - GLint i, zoomedWidth; - - if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width, - &x0, &x1, &y0, &y1)) { - return; /* totally clipped */ - } - - zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= MAX_WIDTH); - - /* zoom the span horizontally */ - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX; - ASSERT(j >= 0); - ASSERT(j < width); - zoomedVals[i] = stencil[j]; - } - - /* write the zoomed spans */ - for (y = y0; y < y1; y++) { - _swrast_write_stencil_span(ctx, zoomedWidth, x0, y, zoomedVals); - } -} - - -/** - * Zoom/write z values (16 or 32-bit). - * No per-fragment operations are applied. - */ -void -_swrast_write_zoomed_z_span(GLcontext *ctx, GLint imgX, GLint imgY, - GLint width, GLint spanX, GLint spanY, - const GLvoid *z) -{ - struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer; - GLushort zoomedVals16[MAX_WIDTH]; - GLuint zoomedVals32[MAX_WIDTH]; - GLint x0, x1, y0, y1, y; - GLint i, zoomedWidth; - - if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width, - &x0, &x1, &y0, &y1)) { - return; /* totally clipped */ - } - - zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= MAX_WIDTH); - - /* zoom the span horizontally */ - if (rb->DataType == GL_UNSIGNED_SHORT) { - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX; - ASSERT(j >= 0); - ASSERT(j < width); - zoomedVals16[i] = ((GLushort *) z)[j]; - } - z = zoomedVals16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX; - ASSERT(j >= 0); - ASSERT(j < width); - zoomedVals32[i] = ((GLuint *) z)[j]; - } - z = zoomedVals32; - } - - /* write the zoomed spans */ - for (y = y0; y < y1; y++) { - rb->PutRow(ctx, rb, zoomedWidth, x0, y, z, NULL); - } -} diff --git a/src/libs/mesa/mesa/swrast/s_zoom.h b/src/libs/mesa/mesa/swrast/s_zoom.h deleted file mode 100644 index d2815b41a0..0000000000 --- a/src/libs/mesa/mesa/swrast/s_zoom.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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 S_ZOOM_H -#define S_ZOOM_H - -#include "swrast.h" - - -extern void -_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span, const GLvoid *rgba); - -extern void -_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span, const GLvoid *rgb); - -extern void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span); - -extern void -_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span); - - -extern void -_swrast_write_zoomed_stencil_span(GLcontext *ctx, GLint imgX, GLint imgY, - GLint width, GLint spanX, GLint spanY, - const GLstencil stencil[]); - -extern void -_swrast_write_zoomed_z_span(GLcontext *ctx, GLint imgX, GLint imgY, - GLint width, GLint spanX, GLint spanY, - const GLvoid *z); - - -#endif diff --git a/src/libs/mesa/mesa/swrast/swrast.h b/src/libs/mesa/mesa/swrast/swrast.h deleted file mode 100644 index 047f7991e6..0000000000 --- a/src/libs/mesa/mesa/swrast/swrast.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - */ - -/** - * \file swrast/swrast.h - * \brief Public interface to the software rasterization functions. - * \author Keith Whitwell - */ - -#ifndef SWRAST_H -#define SWRAST_H - -#include "main/mtypes.h" - -/** - * \struct SWvertex - * \brief Data-structure to handle vertices in the software rasterizer. - * - * The software rasterizer now uses this format for vertices. Thus a - * 'RasterSetup' stage or other translation is required between the - * tnl module and the swrast rasterization functions. This serves to - * isolate the swrast module from the internals of the tnl module, and - * improve its usefulness as a fallback mechanism for hardware - * drivers. - * - * wpos = attr[FRAG_ATTRIB_WPOS] and MUST BE THE FIRST values in the - * vertex because of the tnl clipping code. - - * wpos[0] and [1] are the screen-coords of SWvertex. - * wpos[2] is the z-buffer coord (if 16-bit Z buffer, in range [0,65535]). - * wpos[3] is 1/w where w is the clip-space W coord. This is the value - * that clip{XYZ} were multiplied by to get ndc{XYZ}. - * - * Full software drivers: - * - Register the rastersetup and triangle functions from - * utils/software_helper. - * - On statechange, update the rasterization pointers in that module. - * - * Rasterization hardware drivers: - * - Keep native rastersetup. - * - Implement native twoside,offset and unfilled triangle setup. - * - Implement a translator from native vertices to swrast vertices. - * - On partial fallback (mix of accelerated and unaccelerated - * prims), call a pass-through function which translates native - * vertices to SWvertices and calls the appropriate swrast function. - * - On total fallback (vertex format insufficient for state or all - * primitives unaccelerated), hook in swrast_setup instead. - */ -typedef struct { - GLfloat attrib[FRAG_ATTRIB_MAX][4]; - GLchan color[4]; /** integer color */ - GLfloat pointSize; -} SWvertex; - - -#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0 - - -struct swrast_device_driver; - - -/* These are the public-access functions exported from swrast. - */ - -extern GLboolean -_swrast_CreateContext( GLcontext *ctx ); - -extern void -_swrast_DestroyContext( GLcontext *ctx ); - -/* Get a (non-const) reference to the device driver struct for swrast. - */ -extern struct swrast_device_driver * -_swrast_GetDeviceDriverReference( GLcontext *ctx ); - -extern void -_swrast_Bitmap( GLcontext *ctx, - GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ); - -extern void -_swrast_CopyPixels( GLcontext *ctx, - GLint srcx, GLint srcy, - GLint destx, GLint desty, - GLsizei width, GLsizei height, - GLenum type ); - -extern void -_swrast_DrawPixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ); - -extern void -_swrast_ReadPixels( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - GLvoid *pixels ); - -extern void -_swrast_BlitFramebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); - -extern void -_swrast_Clear(GLcontext *ctx, GLbitfield buffers); - -extern void -_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value); - - - -/* Reset the stipple counter - */ -extern void -_swrast_ResetLineStipple( GLcontext *ctx ); - -/** - * Indicates front/back facing for subsequent points/lines when drawing - * unfilled polygons. Needed for two-side stencil. - */ -extern void -_swrast_SetFacing(GLcontext *ctx, GLuint facing); - -/* These will always render the correct point/line/triangle for the - * current state. - * - * For flatshaded primitives, the provoking vertex is the final one. - */ -extern void -_swrast_Point( GLcontext *ctx, const SWvertex *v ); - -extern void -_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ); - -extern void -_swrast_Triangle( GLcontext *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2 ); - -extern void -_swrast_Quad( GLcontext *ctx, - const SWvertex *v0, const SWvertex *v1, - const SWvertex *v2, const SWvertex *v3); - -extern void -_swrast_flush( GLcontext *ctx ); - -extern void -_swrast_render_primitive( GLcontext *ctx, GLenum mode ); - -extern void -_swrast_render_start( GLcontext *ctx ); - -extern void -_swrast_render_finish( GLcontext *ctx ); - -/* Tell the software rasterizer about core state changes. - */ -extern void -_swrast_InvalidateState( GLcontext *ctx, GLbitfield new_state ); - -/* Configure software rasterizer to match hardware rasterizer characteristics: - */ -extern void -_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value ); - -extern void -_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value ); - -/* Debug: - */ -extern void -_swrast_print_vertex( GLcontext *ctx, const SWvertex *v ); - - -/* - * Imaging fallbacks (a better solution should be found, perhaps - * moving all the imaging fallback code to a new module) - */ -extern void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, - GLsizei height); -extern void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - - -/* - * Texture fallbacks. Could also live in a new module - * with the rest of the texture store fallbacks? - */ -extern void -_swrast_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border); - -extern void -_swrast_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border); - - -extern void -_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width); - -extern void -_swrast_copy_texsubimage2d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - -extern void -_swrast_copy_texsubimage3d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - - -extern void -_swrast_eject_texture_images(GLcontext *ctx); - - -#if FEATURE_MESA_program_debug -extern void -_swrast_get_program_register(GLcontext *, enum register_file file, - GLuint index, GLfloat val[4]); -#endif /* FEATURE_MESA_program_debug */ - - -/** - * The driver interface for the software rasterizer. - * XXX this may go away. - * We may move these functions to ctx->Driver.RenderStart, RenderEnd. - */ -struct swrast_device_driver { - /* - * These are called before and after accessing renderbuffers during - * software rasterization. - * - * These are a suitable place for grabbing/releasing hardware locks. - * - * NOTE: The swrast triangle/line/point routines *DO NOT* call - * these functions. Locking in that case must be organized by the - * driver by other mechanisms. - */ - void (*SpanRenderStart)(GLcontext *ctx); - void (*SpanRenderFinish)(GLcontext *ctx); -}; - - - -#endif diff --git a/src/libs/mesa/mesa/swrast_setup/ss_context.c b/src/libs/mesa/mesa/swrast_setup/ss_context.c deleted file mode 100644 index 61172f9979..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_context.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/colormac.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "tnl/t_vertex.h" -#include "swrast_setup.h" -#include "ss_context.h" -#include "ss_triangle.h" - - -/* Need to check lighting state and vertex program state to know - * if two-sided lighting is in effect. - */ -#define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT|_NEW_PROGRAM) - - -#define VARYING_EMIT_STYLE EMIT_4F - - -GLboolean -_swsetup_CreateContext( GLcontext *ctx ) -{ - SScontext *swsetup = (SScontext *)CALLOC(sizeof(SScontext)); - - if (!swsetup) - return GL_FALSE; - - ctx->swsetup_context = swsetup; - - swsetup->NewState = ~0; - _swsetup_trifuncs_init( ctx ); - - _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, - sizeof(SWvertex) ); - - - return GL_TRUE; -} - -void -_swsetup_DestroyContext( GLcontext *ctx ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - - if (swsetup) { - FREE(swsetup); - ctx->swsetup_context = 0; - } - - _tnl_free_vertices( ctx ); -} - -static void -_swsetup_RenderPrimitive( GLcontext *ctx, GLenum mode ) -{ - SWSETUP_CONTEXT(ctx)->render_prim = mode; - _swrast_render_primitive( ctx, mode ); -} - - -/** - * Helper macros for setup_vertex_format() - */ -#define SWZ ((SWvertex *)0) -#define SWOffset(MEMBER) (((char *)&(SWZ->MEMBER)) - ((char *)SWZ)) - -#define EMIT_ATTR( ATTR, STYLE, MEMBER ) \ -do { \ - map[e].attrib = (ATTR); \ - map[e].format = (STYLE); \ - map[e].offset = SWOffset(MEMBER); \ - e++; \ -} while (0) - - -/** - * Tell the tnl module how to build SWvertex objects for swrast. - * We'll build the map[] array with that info and pass it to - * _tnl_install_attrs(). - */ -static void -setup_vertex_format(GLcontext *ctx) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - GLboolean intColors = !ctx->FragmentProgram._Current - && !ctx->ATIFragmentShader._Enabled - && ctx->RenderMode == GL_RENDER - && CHAN_TYPE == GL_UNSIGNED_BYTE; - - if (intColors != swsetup->intColors || - !RENDERINPUTS_EQUAL(tnl->render_inputs_bitset, - swsetup->last_index_bitset)) { - DECLARE_RENDERINPUTS(index_bitset); - struct tnl_attr_map map[_TNL_ATTRIB_MAX]; - int i, e = 0; - - swsetup->intColors = intColors; - - RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) { - if (swsetup->intColors) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); - else - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); - } - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); - } - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX )) { - EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, - attrib[FRAG_ATTRIB_CI][0] ); - } - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { - const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; - EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]); - } - - if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) - { - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F, - attrib[FRAG_ATTRIB_TEX0 + i] ); - } - } - } - - /* shader varying vars */ - if (RENDERINPUTS_TEST_RANGE( index_bitset, - _TNL_FIRST_GENERIC, _TNL_LAST_GENERIC )) { - for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_GENERIC(i) )) { - EMIT_ATTR( _TNL_ATTRIB_GENERIC(i), VARYING_EMIT_STYLE, - attrib[FRAG_ATTRIB_VAR0 + i] ); - } - } - } - - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) - EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, pointSize ); - - _tnl_install_attrs( ctx, map, e, - ctx->Viewport._WindowMap.m, - sizeof(SWvertex) ); - - RENDERINPUTS_COPY( swsetup->last_index_bitset, index_bitset ); - } -} - - -/** - * Prepare to render a vertex buffer. - * Called via tnl->Driver.Render.Start. - */ -static void -_swsetup_RenderStart( GLcontext *ctx ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - - if (swsetup->NewState & _SWSETUP_NEW_RENDERINDEX) { - _swsetup_choose_trifuncs(ctx); - } - - if (swsetup->NewState & _NEW_PROGRAM) { - RENDERINPUTS_ZERO( swsetup->last_index_bitset ); - } - - swsetup->NewState = 0; - - /* This will change if drawing unfilled tris */ - _swrast_SetFacing(ctx, 0); - - _swrast_render_start(ctx); - - /* Important */ - VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; - - setup_vertex_format(ctx); -} - - -/* - * We patch this function into tnl->Driver.Render.Finish. - * It's called when we finish rendering a vertex buffer. - */ -static void -_swsetup_RenderFinish( GLcontext *ctx ) -{ - _swrast_render_finish( ctx ); -} - -void -_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - swsetup->NewState |= new_state; - _tnl_invalidate_vertex_state( ctx, new_state ); -} - - -void -_swsetup_Wakeup( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - - tnl->Driver.Render.Start = _swsetup_RenderStart; - tnl->Driver.Render.Finish = _swsetup_RenderFinish; - tnl->Driver.Render.PrimitiveNotify = _swsetup_RenderPrimitive; - tnl->Driver.Render.Interp = _tnl_interp; - tnl->Driver.Render.CopyPV = _tnl_copy_pv; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; /* new */ - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; /* new */ - /* points */ - /* line */ - /* triangle */ - /* quad */ - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; - tnl->Driver.Render.BuildVertices = _tnl_build_vertices; - tnl->Driver.Render.Multipass = 0; - - _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_need_projected_coords( ctx, GL_TRUE ); - _swsetup_InvalidateState( ctx, ~0 ); - - swsetup->verts = (SWvertex *)tnl->clipspace.vertex_buf; - RENDERINPUTS_ZERO( swsetup->last_index_bitset ); -} - - -/** - * Populate a swrast SWvertex from an attrib-style vertex. - */ -void -_swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) -{ - const GLfloat *m = ctx->Viewport._WindowMap.m; - GLfloat tmp[4]; - GLuint i; - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp ); - - dest->attrib[FRAG_ATTRIB_WPOS][0] = m[0] * tmp[0] + m[12]; - dest->attrib[FRAG_ATTRIB_WPOS][1] = m[5] * tmp[1] + m[13]; - dest->attrib[FRAG_ATTRIB_WPOS][2] = m[10] * tmp[2] + m[14]; - dest->attrib[FRAG_ATTRIB_WPOS][3] = tmp[3]; - - /** XXX try to limit these loops someday */ - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0 + i, - dest->attrib[FRAG_ATTRIB_TEX0 + i] ); - - for (i = 0 ; i < ctx->Const.MaxVarying ; i++) - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i, - dest->attrib[FRAG_ATTRIB_VAR0 + i] ); - - if (ctx->Visual.rgbMode) { - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, - dest->attrib[FRAG_ATTRIB_COL0] ); - UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, - dest->attrib[FRAG_ATTRIB_COL1]); - } - else { - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp ); - dest->attrib[FRAG_ATTRIB_CI][0] = tmp[0]; - } - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); - dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; - - /* XXX See _tnl_get_attr about pointsize ... */ - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp ); - dest->pointSize = tmp[0]; -} - diff --git a/src/libs/mesa/mesa/swrast_setup/ss_context.h b/src/libs/mesa/mesa/swrast_setup/ss_context.h deleted file mode 100644 index 1ec293fade..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_context.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef SS_CONTEXT_H -#define SS_CONTEXT_H - -#include "main/mtypes.h" -#include "swrast/swrast.h" -#include "swrast_setup.h" -#include "tnl/t_context.h" - -typedef struct { - GLuint NewState; - GLenum render_prim; - DECLARE_RENDERINPUTS(last_index_bitset); - SWvertex *verts; - GLboolean intColors; -} SScontext; - -#define SWSETUP_CONTEXT(ctx) ((SScontext *)ctx->swsetup_context) - -#endif diff --git a/src/libs/mesa/mesa/swrast_setup/ss_triangle.c b/src/libs/mesa/mesa/swrast_setup/ss_triangle.c deleted file mode 100644 index 54e24c4c44..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_triangle.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/mtypes.h" - -#include "tnl/t_context.h" - -#include "ss_triangle.h" -#include "ss_context.h" - -#define SS_RGBA_BIT 0x1 -#define SS_OFFSET_BIT 0x2 -#define SS_TWOSIDE_BIT 0x4 -#define SS_UNFILLED_BIT 0x8 -#define SS_MAX_TRIFUNC 0x10 - -static tnl_triangle_func tri_tab[SS_MAX_TRIFUNC]; -static tnl_quad_func quad_tab[SS_MAX_TRIFUNC]; - - -static void _swsetup_render_line_tri( GLcontext *ctx, - GLuint e0, GLuint e1, GLuint e2, - GLuint facing ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - SWvertex *verts = swsetup->verts; - SWvertex *v0 = &verts[e0]; - SWvertex *v1 = &verts[e1]; - SWvertex *v2 = &verts[e2]; - GLchan c[2][4]; - GLfloat s[2][4]; - GLfloat i[2]; - - /* cull testing */ - if (ctx->Polygon.CullFlag) { - if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT) - return; - if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK) - return; - } - - _swrast_SetFacing(ctx, facing); - - if (ctx->Light.ShadeModel == GL_FLAT) { - COPY_CHAN4(c[0], v0->color); - COPY_CHAN4(c[1], v1->color); - COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); - i[0] = v0->attrib[FRAG_ATTRIB_CI][0]; - i[1] = v1->attrib[FRAG_ATTRIB_CI][0]; - - COPY_CHAN4(v0->color, v2->color); - COPY_CHAN4(v1->color, v2->color); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - v0->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; - v1->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; - } - - if (swsetup->render_prim == GL_POLYGON) { - if (ef[e2]) _swrast_Line( ctx, v2, v0 ); - if (ef[e0]) _swrast_Line( ctx, v0, v1 ); - if (ef[e1]) _swrast_Line( ctx, v1, v2 ); - } else { - if (ef[e0]) _swrast_Line( ctx, v0, v1 ); - if (ef[e1]) _swrast_Line( ctx, v1, v2 ); - if (ef[e2]) _swrast_Line( ctx, v2, v0 ); - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - COPY_CHAN4(v0->color, c[0]); - COPY_CHAN4(v1->color, c[1]); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); - v0->attrib[FRAG_ATTRIB_CI][0] = i[0]; - v1->attrib[FRAG_ATTRIB_CI][0] = i[1]; - } -} - -static void _swsetup_render_point_tri( GLcontext *ctx, - GLuint e0, GLuint e1, GLuint e2, - GLuint facing ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - SWvertex *verts = swsetup->verts; - SWvertex *v0 = &verts[e0]; - SWvertex *v1 = &verts[e1]; - SWvertex *v2 = &verts[e2]; - GLchan c[2][4]; - GLfloat s[2][4]; - GLfloat i[2]; - - /* cull testing */ - if (ctx->Polygon.CullFlag) { - if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT) - return; - if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK) - return; - } - - _swrast_SetFacing(ctx, facing); - - if (ctx->Light.ShadeModel == GL_FLAT) { - /* save colors/indexes for v0, v1 vertices */ - COPY_CHAN4(c[0], v0->color); - COPY_CHAN4(c[1], v1->color); - COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); - i[0] = v0->attrib[FRAG_ATTRIB_CI][0]; - i[1] = v1->attrib[FRAG_ATTRIB_CI][0]; - - /* copy v2 color/indexes to v0, v1 indexes */ - COPY_CHAN4(v0->color, v2->color); - COPY_CHAN4(v1->color, v2->color); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - v0->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; - v1->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; - } - - if (ef[e0]) _swrast_Point( ctx, v0 ); - if (ef[e1]) _swrast_Point( ctx, v1 ); - if (ef[e2]) _swrast_Point( ctx, v2 ); - - if (ctx->Light.ShadeModel == GL_FLAT) { - /* restore v0, v1 colores/indexes */ - COPY_CHAN4(v0->color, c[0]); - COPY_CHAN4(v1->color, c[1]); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); - v0->attrib[FRAG_ATTRIB_CI][0] = i[0]; - v1->attrib[FRAG_ATTRIB_CI][0] = i[1]; - } - _swrast_flush(ctx); -} - -#define SS_COLOR(a,b) UNCLAMPED_FLOAT_TO_RGBA_CHAN(a,b) -#define SS_SPEC(a,b) UNCLAMPED_FLOAT_TO_RGB_CHAN(a,b) -#define SS_IND(a,b) (a = b) - -#define IND (0) -#define TAG(x) x -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT) -#define TAG(x) x##_offset -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT) -#define TAG(x) x##_offset_twoside -#include "ss_tritmp.h" - -#define IND (SS_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (0|SS_RGBA_BIT) -#define TAG(x) x##_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_rgba -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_RGBA_BIT) -#define TAG(x) x##_twoside_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_twoside_rgba -#include "ss_tritmp.h" - -#define IND (SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_twoside_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_twoside_unfilled_rgba -#include "ss_tritmp.h" - - -void _swsetup_trifuncs_init( GLcontext *ctx ) -{ - (void) ctx; - - init(); - init_offset(); - init_twoside(); - init_offset_twoside(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_offset_twoside_unfilled(); - - init_rgba(); - init_offset_rgba(); - init_twoside_rgba(); - init_offset_twoside_rgba(); - init_unfilled_rgba(); - init_offset_unfilled_rgba(); - init_twoside_unfilled_rgba(); - init_offset_twoside_unfilled_rgba(); -} - - -static void swsetup_points( GLcontext *ctx, GLuint first, GLuint last ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - GLuint i; - - if (VB->Elts) { - for (i = first; i < last; i++) - if (VB->ClipMask[VB->Elts[i]] == 0) - _swrast_Point( ctx, &verts[VB->Elts[i]] ); - } - else { - for (i = first; i < last; i++) - if (VB->ClipMask[i] == 0) - _swrast_Point( ctx, &verts[i] ); - } -} - -static void swsetup_line( GLcontext *ctx, GLuint v0, GLuint v1 ) -{ - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - _swrast_Line( ctx, &verts[v0], &verts[v1] ); -} - - - -void _swsetup_choose_trifuncs( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint ind = 0; - - if (ctx->Polygon.OffsetPoint || - ctx->Polygon.OffsetLine || - ctx->Polygon.OffsetFill) - ind |= SS_OFFSET_BIT; - - if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) || - (ctx->VertexProgram._Current && ctx->VertexProgram.TwoSideEnabled)) - ind |= SS_TWOSIDE_BIT; - - /* We piggyback the two-sided stencil front/back determination on the - * unfilled triangle path. - */ - if (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL || - (ctx->Stencil.Enabled && ctx->Stencil._TestTwoSide)) - ind |= SS_UNFILLED_BIT; - - if (ctx->Visual.rgbMode) - ind |= SS_RGBA_BIT; - - tnl->Driver.Render.Triangle = tri_tab[ind]; - tnl->Driver.Render.Quad = quad_tab[ind]; - tnl->Driver.Render.Line = swsetup_line; - tnl->Driver.Render.Points = swsetup_points; -} diff --git a/src/libs/mesa/mesa/swrast_setup/ss_triangle.h b/src/libs/mesa/mesa/swrast_setup/ss_triangle.h deleted file mode 100644 index 007fa2e914..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_triangle.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef SS_TRIANGLE_H -#define SS_TRIANGLE_H - -#include "ss_context.h" - - -void _swsetup_trifuncs_init( GLcontext *ctx ); -void _swsetup_choose_trifuncs( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/swrast_setup/ss_tritmp.h b/src/libs/mesa/mesa/swrast_setup/ss_tritmp.h deleted file mode 100644 index 97d2f4a16b..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_tritmp.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - - -/** - * This is where we handle assigning vertex colors based on front/back - * facing, compute polygon offset and handle glPolygonMode(). - */ -static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - SWvertex *v[3]; - GLfloat z[3]; - GLfloat offset, oz0, oz1, oz2; - GLenum mode = GL_FILL; - GLuint facing = 0; - GLchan saved_color[3][4]; - GLfloat saved_col0[3][4]; - GLfloat saved_spec[3][4]; - GLfloat saved_index[3]; - - v[0] = &verts[e0]; - v[1] = &verts[e1]; - v[2] = &verts[e2]; - - if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT)) - { - GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; - GLfloat ey = v[0]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat fx = v[1]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; - GLfloat fy = v[1]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; - GLfloat cc = ex*fy - ey*fx; - - if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT)) - { - facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; - - if (IND & SS_UNFILLED_BIT) - mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode; - - if (facing == 1) { - if (IND & SS_TWOSIDE_BIT) { - if (IND & SS_RGBA_BIT) { - if (VB->ColorPtr[1]) { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; - - if (swsetup->intColors) { - COPY_CHAN4(saved_color[0], v[0]->color); - COPY_CHAN4(saved_color[1], v[1]->color); - COPY_CHAN4(saved_color[2], v[2]->color); - } - else { - COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); - } - - if (VB->ColorPtr[1]->stride) { - if (swsetup->intColors) { - SS_COLOR(v[0]->color, vbcolor[e0]); - SS_COLOR(v[1]->color, vbcolor[e1]); - SS_COLOR(v[2]->color, vbcolor[e2]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); - } - } - else { - /* flat shade */ - if (swsetup->intColors) { - SS_COLOR(v[0]->color, vbcolor[0]); - SS_COLOR(v[1]->color, vbcolor[0]); - SS_COLOR(v[2]->color, vbcolor[0]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - } - } - } - - if (VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - - COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); - - if (VB->SecondaryColorPtr[1]->stride) { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); - } - else { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - } - } - } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; - saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0]; - saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; - saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; - - SS_IND(v[0]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e0]); - SS_IND(v[1]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e1]); - SS_IND(v[2]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e2]); - } - } - } - } - - if (IND & SS_OFFSET_BIT) { - const GLfloat max = ctx->DrawBuffer->_DepthMaxF; - /* save original Z values (restored later) */ - z[0] = v[0]->attrib[FRAG_ATTRIB_WPOS][2]; - z[1] = v[1]->attrib[FRAG_ATTRIB_WPOS][2]; - z[2] = v[2]->attrib[FRAG_ATTRIB_WPOS][2]; - /* Note that Z values are already scaled to [0,65535] (for example) - * so no MRD value is used here. - */ - offset = ctx->Polygon.OffsetUnits; - if (cc * cc > 1e-16) { - const GLfloat ez = z[0] - z[2]; - const GLfloat fz = z[1] - z[2]; - const GLfloat oneOverArea = 1.0F / cc; - const GLfloat dzdx = FABSF((ey * fz - ez * fy) * oneOverArea); - const GLfloat dzdy = FABSF((ez * fx - ex * fz) * oneOverArea); - offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor; - } - /* new Z values */ - oz0 = CLAMP(v[0]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); - oz1 = CLAMP(v[1]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); - oz2 = CLAMP(v[2]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); - } - } - - if (mode == GL_POINT) { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) { - v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; - v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; - v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; - } - _swsetup_render_point_tri( ctx, e0, e1, e2, facing ); - } else if (mode == GL_LINE) { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) { - v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; - v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; - v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; - } - _swsetup_render_line_tri( ctx, e0, e1, e2, facing ); - } else { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) { - v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; - v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; - v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; - } - _swrast_Triangle( ctx, v[0], v[1], v[2] ); - } - - /* - * Restore original vertex colors, etc. - */ - if (IND & SS_OFFSET_BIT) { - v[0]->attrib[FRAG_ATTRIB_WPOS][2] = z[0]; - v[1]->attrib[FRAG_ATTRIB_WPOS][2] = z[1]; - v[2]->attrib[FRAG_ATTRIB_WPOS][2] = z[2]; - } - - if (IND & SS_TWOSIDE_BIT) { - if (facing == 1) { - if (IND & SS_RGBA_BIT) { - if (VB->ColorPtr[1]) { - if (swsetup->intColors) { - COPY_CHAN4(v[0]->color, saved_color[0]); - COPY_CHAN4(v[1]->color, saved_color[1]); - COPY_CHAN4(v[2]->color, saved_color[2]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); - } - } - - if (VB->SecondaryColorPtr[1]) { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); - } - } else { - v[0]->attrib[FRAG_ATTRIB_CI][0] = saved_index[0]; - v[1]->attrib[FRAG_ATTRIB_CI][0] = saved_index[1]; - v[2]->attrib[FRAG_ATTRIB_CI][0] = saved_index[2]; - } - } - } -} - - - -/* Need to fixup edgeflags when decomposing to triangles: - */ -static void TAG(quadfunc)( GLcontext *ctx, GLuint v0, - GLuint v1, GLuint v2, GLuint v3 ) -{ - if (IND & SS_UNFILLED_BIT) { - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->EdgeFlag) { /* XXX this test shouldn't be needed (bug 12614) */ - GLubyte ef1 = VB->EdgeFlag[v1]; - GLubyte ef3 = VB->EdgeFlag[v3]; - VB->EdgeFlag[v1] = 0; - TAG(triangle)( ctx, v0, v1, v3 ); - VB->EdgeFlag[v1] = ef1; - VB->EdgeFlag[v3] = 0; - TAG(triangle)( ctx, v1, v2, v3 ); - VB->EdgeFlag[v3] = ef3; - } - } else { - TAG(triangle)( ctx, v0, v1, v3 ); - TAG(triangle)( ctx, v1, v2, v3 ); - } -} - - - - -static void TAG(init)( void ) -{ - tri_tab[IND] = TAG(triangle); - quad_tab[IND] = TAG(quadfunc); -} - - -#undef IND -#undef TAG diff --git a/src/libs/mesa/mesa/swrast_setup/ss_vb.h b/src/libs/mesa/mesa/swrast_setup/ss_vb.h deleted file mode 100644 index 2ad1f56f39..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/ss_vb.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef SS_VB_H -#define SS_VB_H - -#include "main/mtypes.h" -#include "swrast_setup.h" - -void _swsetup_vb_init( GLcontext *ctx ); -void _swsetup_choose_rastersetup_func( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/swrast_setup/swrast_setup.h b/src/libs/mesa/mesa/swrast_setup/swrast_setup.h deleted file mode 100644 index 5dcbe2675b..0000000000 --- a/src/libs/mesa/mesa/swrast_setup/swrast_setup.h +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -/* Public interface to the swrast_setup module. This module provides - * an implementation of the driver interface to t_vb_render.c, and uses - * the software rasterizer (swrast) to perform actual rasterization. - * - * The internals of the implementation are private, but can be hooked - * into tnl at any time (except between RenderStart/RenderEnd) by - * calling _swsetup_Wakeup(). - */ - -#ifndef SWRAST_SETUP_H -#define SWRAST_SETUP_H - -#include "swrast/swrast.h" - -extern GLboolean -_swsetup_CreateContext( GLcontext *ctx ); - -extern void -_swsetup_DestroyContext( GLcontext *ctx ); - -extern void -_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ); - -extern void -_swsetup_Wakeup( GLcontext *ctx ); - -/* Helper function to translate a hardware vertex (as understood by - * the tnl/t_vertex.c code) to a swrast vertex. - */ -extern void -_swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ); - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_context.c b/src/libs/mesa/mesa/tnl/t_context.c deleted file mode 100644 index 19ec556dcd..0000000000 --- a/src/libs/mesa/mesa/tnl/t_context.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/light.h" - -#include "tnl.h" -#include "t_context.h" -#include "t_pipeline.h" -#include "t_vp_build.h" - -#include "vbo/vbo.h" - -GLboolean -_tnl_CreateContext( GLcontext *ctx ) -{ - TNLcontext *tnl; - - /* Create the TNLcontext structure - */ - ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) ); - - if (!tnl) { - return GL_FALSE; - } - - /* Initialize the VB. - */ - tnl->vb.Size = ctx->Const.MaxArrayLockSize + MAX_CLIPPED_VERTICES; - - - /* Initialize tnl state. - */ - if (ctx->VertexProgram._MaintainTnlProgram) { - _tnl_install_pipeline( ctx, _tnl_vp_pipeline ); - } else { - _tnl_install_pipeline( ctx, _tnl_default_pipeline ); - } - - tnl->NeedNdcCoords = GL_TRUE; - tnl->AllowVertexFog = GL_TRUE; - tnl->AllowPixelFog = GL_TRUE; - - /* Set a few default values in the driver struct. - */ - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables; - - tnl->nr_blocks = 0; - - return GL_TRUE; -} - - -void -_tnl_DestroyContext( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - _tnl_destroy_pipeline( ctx ); - - FREE(tnl); - ctx->swtnl_context = NULL; -} - - -void -_tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - const struct gl_vertex_program *vp = ctx->VertexProgram._Current; - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - - if (new_state & (_NEW_HINT | _NEW_PROGRAM)) { - ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog); - tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST)) - || !tnl->AllowPixelFog) && !fp; - } - - tnl->pipeline.new_state |= new_state; - - /* Calculate tnl->render_inputs. This bitmask indicates which vertex - * attributes need to be emitted to the rasterizer. - */ - if (ctx->Visual.rgbMode) { - GLuint i; - - RENDERINPUTS_ZERO( tnl->render_inputs_bitset ); - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); - - if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 ); - } - - if (NEED_SECONDARY_COLOR(ctx)) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 ); - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - if (ctx->Texture._EnabledCoordUnits & (1 << i) || - (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) ); - } - } - } - else { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR_INDEX ); - } - - if (ctx->Fog.Enabled) { - /* fixed-function fog */ - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG ); - } - else if (ctx->FragmentProgram._Current) { - struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - if (fp) { - if (fp->FogOption != GL_NONE || (fp->Base.InputsRead & FRAG_BIT_FOGC)) { - /* fragment program needs fog coord */ - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG ); - } - } - } - - if (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_EDGEFLAG ); - - if (ctx->RenderMode == GL_FEEDBACK) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 ); - - if (ctx->Point._Attenuated || - (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled)) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE ); - - /* check for varying vars which are written by the vertex program */ - if (vp) { - GLuint i; - for (i = 0; i < MAX_VARYING; i++) { - if (vp->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { - RENDERINPUTS_SET(tnl->render_inputs_bitset, - _TNL_ATTRIB_GENERIC(i)); - } - } - } -} - - -void -_tnl_wakeup( GLcontext *ctx ) -{ - /* Assume we haven't been getting state updates either: - */ - _tnl_InvalidateState( ctx, ~0 ); - -#if 0 - if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material( ctx, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); - } -#endif -} - - - - -/** - * Drivers call this function to tell the TCL module whether or not - * it wants Normalized Device Coords (NDC) computed. I.e. whether - * we should "Divide-by-W". Software renders will want that. - */ -void -_tnl_need_projected_coords( GLcontext *ctx, GLboolean mode ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->NeedNdcCoords = mode; -} - -void -_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->AllowVertexFog = value; - tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST)) - || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current; - -} - -void -_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->AllowPixelFog = value; - tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST)) - || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current; -} - diff --git a/src/libs/mesa/mesa/tnl/t_context.h b/src/libs/mesa/mesa/tnl/t_context.h deleted file mode 100644 index 0a6ce04614..0000000000 --- a/src/libs/mesa/mesa/tnl/t_context.h +++ /dev/null @@ -1,550 +0,0 @@ -/* - * mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file t_context.h - * \brief TnL module datatypes and definitions. - * \author Keith Whitwell - */ - - -/** - * \mainpage The TNL-module - * - * TNL stands for "transform and lighting", i.e. this module implements - * a pipeline that receives as input a buffer of vertices and does all - * necessary transformations (rotations, clipping, vertex shader etc.) - * and passes then the output to the rasterizer. - * - * The tnl_pipeline contains the array of all stages, which should be - * applied. Each stage is a black-box, which is described by an - * tnl_pipeline_stage. The function ::_tnl_run_pipeline applies all the - * stages to the vertex_buffer TNLcontext::vb, where the vertex data - * is stored. The last stage in the pipeline is the rasterizer. - * - */ - - -#ifndef _T_CONTEXT_H -#define _T_CONTEXT_H - -#include "main/glheader.h" -#include "main/mtypes.h" - -#include "math/m_matrix.h" -#include "math/m_vector.h" -#include "math/m_xform.h" - -#include "vbo/vbo.h" - -#define MAX_PIPELINE_STAGES 30 - -/* - * Note: The first attributes match the VERT_ATTRIB_* definitions - * in mtypes.h. However, the tnl module has additional attributes - * for materials, color indexes, edge flags, etc. - */ -/* Although it's nice to use these as bit indexes in a DWORD flag, we - * could manage without if necessary. Another limit currently is the - * number of bits allocated for these numbers in places like vertex - * program instruction formats and register layouts. - */ -/* The bit space exhaustion is a fact now, done by _TNL_ATTRIB_ATTRIBUTE* for - * GLSL vertex shader which cannot be aliased with conventional vertex attribs. - * Compacting _TNL_ATTRIB_MAT_* attribs would not work, they would not give - * as many free bits (11 plus already 1 free bit) as _TNL_ATTRIB_ATTRIBUTE* - * attribs want (16). - */ -enum { - _TNL_ATTRIB_POS = 0, - _TNL_ATTRIB_WEIGHT = 1, - _TNL_ATTRIB_NORMAL = 2, - _TNL_ATTRIB_COLOR0 = 3, - _TNL_ATTRIB_COLOR1 = 4, - _TNL_ATTRIB_FOG = 5, - _TNL_ATTRIB_COLOR_INDEX = 6, - _TNL_ATTRIB_EDGEFLAG = 7, - _TNL_ATTRIB_TEX0 = 8, - _TNL_ATTRIB_TEX1 = 9, - _TNL_ATTRIB_TEX2 = 10, - _TNL_ATTRIB_TEX3 = 11, - _TNL_ATTRIB_TEX4 = 12, - _TNL_ATTRIB_TEX5 = 13, - _TNL_ATTRIB_TEX6 = 14, - _TNL_ATTRIB_TEX7 = 15, - - _TNL_ATTRIB_GENERIC0 = 16, /* doesn't really exist! */ - _TNL_ATTRIB_GENERIC1 = 17, - _TNL_ATTRIB_GENERIC2 = 18, - _TNL_ATTRIB_GENERIC3 = 19, - _TNL_ATTRIB_GENERIC4 = 20, - _TNL_ATTRIB_GENERIC5 = 21, - _TNL_ATTRIB_GENERIC6 = 22, - _TNL_ATTRIB_GENERIC7 = 23, - _TNL_ATTRIB_GENERIC8 = 24, - _TNL_ATTRIB_GENERIC9 = 25, - _TNL_ATTRIB_GENERIC10 = 26, - _TNL_ATTRIB_GENERIC11 = 27, - _TNL_ATTRIB_GENERIC12 = 28, - _TNL_ATTRIB_GENERIC13 = 29, - _TNL_ATTRIB_GENERIC14 = 30, - _TNL_ATTRIB_GENERIC15 = 31, - - /* These alias with the generics, but they are not active - * concurrently, so it's not a problem. The TNL module - * doesn't have to do anything about this as this is how they - * are passed into the _draw_prims callback. - * - * When we generate fixed-function replacement programs (in - * t_vp_build.c currently), they refer to the appropriate - * generic attribute in order to pick up per-vertex material - * data. - */ - _TNL_ATTRIB_MAT_FRONT_AMBIENT = 16, - _TNL_ATTRIB_MAT_BACK_AMBIENT = 17, - _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 18, - _TNL_ATTRIB_MAT_BACK_DIFFUSE = 19, - _TNL_ATTRIB_MAT_FRONT_SPECULAR = 20, - _TNL_ATTRIB_MAT_BACK_SPECULAR = 21, - _TNL_ATTRIB_MAT_FRONT_EMISSION = 22, - _TNL_ATTRIB_MAT_BACK_EMISSION = 23, - _TNL_ATTRIB_MAT_FRONT_SHININESS = 24, - _TNL_ATTRIB_MAT_BACK_SHININESS = 25, - _TNL_ATTRIB_MAT_FRONT_INDEXES = 26, - _TNL_ATTRIB_MAT_BACK_INDEXES = 27, - - /* This is really a VERT_RESULT, not an attrib. Need to fix - * tnl to understand the difference. - */ - _TNL_ATTRIB_POINTSIZE = 16, - - _TNL_ATTRIB_MAX = 32 -} ; - -#define _TNL_ATTRIB_TEX(u) (_TNL_ATTRIB_TEX0 + (u)) -#define _TNL_ATTRIB_GENERIC(n) (_TNL_ATTRIB_GENERIC0 + (n)) - -/* special index used for handing invalid glVertexAttribute() indices */ -#define _TNL_ATTRIB_ERROR (_TNL_ATTRIB_GENERIC15 + 1) - -/** - * Handy attribute ranges: - */ -#define _TNL_FIRST_PROG _TNL_ATTRIB_WEIGHT -#define _TNL_LAST_PROG _TNL_ATTRIB_TEX7 - -#define _TNL_FIRST_TEX _TNL_ATTRIB_TEX0 -#define _TNL_LAST_TEX _TNL_ATTRIB_TEX7 - -#define _TNL_FIRST_GENERIC _TNL_ATTRIB_GENERIC0 -#define _TNL_LAST_GENERIC _TNL_ATTRIB_GENERIC15 - -#define _TNL_FIRST_MAT _TNL_ATTRIB_MAT_FRONT_AMBIENT /* GENERIC0 */ -#define _TNL_LAST_MAT _TNL_ATTRIB_MAT_BACK_INDEXES /* GENERIC11 */ - -/* Number of available generic attributes */ -#define _TNL_NUM_GENERIC 16 - -/* Number of attributes used for evaluators */ -#define _TNL_NUM_EVAL 16 - - -#define PRIM_BEGIN 0x10 -#define PRIM_END 0x20 -#define PRIM_MODE_MASK 0x0f - -static INLINE GLuint _tnl_translate_prim( const struct _mesa_prim *prim ) -{ - GLuint flag; - flag = prim->mode; - if (prim->begin) flag |= PRIM_BEGIN; - if (prim->end) flag |= PRIM_END; - return flag; -} - - - - -/** - * Contains the current state of a running pipeline. - */ -struct vertex_buffer -{ - GLuint Size; /**< Max vertices per vertex buffer, constant */ - - /* Constant over the pipeline. - */ - GLuint Count; /**< Number of vertices currently in buffer */ - - /* Pointers to current data. - * XXX some of these fields alias AttribPtr below and should be removed - * such as NormalPtr, TexCoordPtr, FogCoordPtr, etc. - */ - GLuint *Elts; - GLvector4f *ObjPtr; /* _TNL_BIT_POS */ - GLvector4f *EyePtr; /* _TNL_BIT_POS */ - GLvector4f *ClipPtr; /* _TNL_BIT_POS */ - GLvector4f *NdcPtr; /* _TNL_BIT_POS */ - GLubyte ClipOrMask; /* _TNL_BIT_POS */ - GLubyte ClipAndMask; /* _TNL_BIT_POS */ - GLubyte *ClipMask; /* _TNL_BIT_POS */ - GLvector4f *NormalPtr; /* _TNL_BIT_NORMAL */ - GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ - GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ - GLvector4f *TexCoordPtr[MAX_TEXTURE_COORD_UNITS]; /* VERT_TEX_0..n */ - GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */ - GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ - GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ - GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ - - const struct _mesa_prim *Primitive; - GLuint PrimitiveCount; - - /* Inputs to the vertex program stage */ - GLvector4f *AttribPtr[_TNL_ATTRIB_MAX]; /* GL_NV_vertex_program */ -}; - - -/** - * Describes an individual operation on the pipeline. - */ -struct tnl_pipeline_stage -{ - const char *name; - - /* Private data for the pipeline stage: - */ - void *privatePtr; - - /* Allocate private data - */ - GLboolean (*create)( GLcontext *ctx, struct tnl_pipeline_stage * ); - - /* Free private data. - */ - void (*destroy)( struct tnl_pipeline_stage * ); - - /* Called on any statechange or input array size change or - * input array change to/from zero stride. - */ - void (*validate)( GLcontext *ctx, struct tnl_pipeline_stage * ); - - /* Called from _tnl_run_pipeline(). The stage.changed_inputs value - * encodes all inputs to thee struct which have changed. If - * non-zero, recompute all affected outputs of the stage, otherwise - * execute any 'sideeffects' of the stage. - * - * Return value: GL_TRUE - keep going - * GL_FALSE - finished pipeline - */ - GLboolean (*run)( GLcontext *ctx, struct tnl_pipeline_stage * ); -}; - - - -/** Contains the array of all pipeline stages. - * The default values are defined at the end of t_pipeline.c - */ -struct tnl_pipeline { - - GLuint last_attrib_stride[_TNL_ATTRIB_MAX]; - GLuint last_attrib_size[_TNL_ATTRIB_MAX]; - GLuint input_changes; - GLuint new_state; - - struct tnl_pipeline_stage stages[MAX_PIPELINE_STAGES+1]; - GLuint nr_stages; -}; - -struct tnl_clipspace; -struct tnl_clipspace_attr; - -typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, - GLfloat *out, - const GLubyte *v ); - -typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, - GLubyte *v, - const GLfloat *in ); - -typedef void (*tnl_emit_func)( GLcontext *ctx, - GLuint count, - GLubyte *dest ); - - -/** - * Describes how to convert/move a vertex attribute from a vertex array - * to a vertex structure. - */ -struct tnl_clipspace_attr -{ - GLuint attrib; /* which vertex attrib (0=position, etc) */ - GLuint format; - GLuint vertoffset; /* position of the attrib in the vertex struct */ - GLuint vertattrsize; /* size of the attribute in bytes */ - GLubyte *inputptr; - GLuint inputstride; - GLuint inputsize; - const tnl_insert_func *insert; - tnl_insert_func emit; - tnl_extract_func extract; - const GLfloat *vp; /* NDC->Viewport mapping matrix */ -}; - - - - -typedef void (*tnl_points_func)( GLcontext *ctx, GLuint first, GLuint last ); -typedef void (*tnl_line_func)( GLcontext *ctx, GLuint v1, GLuint v2 ); -typedef void (*tnl_triangle_func)( GLcontext *ctx, - GLuint v1, GLuint v2, GLuint v3 ); -typedef void (*tnl_quad_func)( GLcontext *ctx, GLuint v1, GLuint v2, - GLuint v3, GLuint v4 ); -typedef void (*tnl_render_func)( GLcontext *ctx, GLuint start, GLuint count, - GLuint flags ); -typedef void (*tnl_interp_func)( GLcontext *ctx, - GLfloat t, GLuint dst, GLuint out, GLuint in, - GLboolean force_boundary ); -typedef void (*tnl_copy_pv_func)( GLcontext *ctx, GLuint dst, GLuint src ); -typedef void (*tnl_setup_func)( GLcontext *ctx, - GLuint start, GLuint end, - GLuint new_inputs); - - -struct tnl_attr_type { - GLuint format; - GLuint size; - GLuint stride; - GLuint offset; -}; - -struct tnl_clipspace_fastpath { - GLuint vertex_size; - GLuint attr_count; - GLboolean match_strides; - - struct tnl_attr_type *attr; - - tnl_emit_func func; - struct tnl_clipspace_fastpath *next; -}; - -/** - * Used to describe conversion of vertex arrays to vertex structures. - * I.e. Structure of arrays to arrays of structs. - */ -struct tnl_clipspace -{ - GLboolean need_extras; - - GLuint new_inputs; - - GLubyte *vertex_buf; - GLuint vertex_size; - GLuint max_vertex_size; - - struct tnl_clipspace_attr attr[_TNL_ATTRIB_MAX]; - GLuint attr_count; - - tnl_emit_func emit; - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - - /* Parameters and constants for codegen: - */ - GLboolean need_viewport; - GLfloat vp_scale[4]; - GLfloat vp_xlate[4]; - GLfloat chan_scale[4]; - GLfloat identity[4]; - - struct tnl_clipspace_fastpath *fastpath; - - void (*codegen_emit)( GLcontext *ctx ); -}; - - -struct tnl_device_driver -{ - /*** - *** TNL Pipeline - ***/ - - void (*RunPipeline)(GLcontext *ctx); - /* Replaces PipelineStart/PipelineFinish -- intended to allow - * drivers to wrap _tnl_run_pipeline() with code to validate state - * and grab/release hardware locks. - */ - - void (*NotifyMaterialChange)(GLcontext *ctx); - /* Alert tnl-aware drivers of changes to material. - */ - - void (*NotifyInputChanges)(GLcontext *ctx, GLuint bitmask); - /* Alert tnl-aware drivers of changes to size and stride of input - * arrays. - */ - - /*** - *** Rendering -- These functions called only from t_vb_render.c - ***/ - struct - { - void (*Start)(GLcontext *ctx); - void (*Finish)(GLcontext *ctx); - /* Called before and after all rendering operations, including DrawPixels, - * ReadPixels, Bitmap, span functions, and CopyTexImage, etc commands. - * These are a suitable place for grabbing/releasing hardware locks. - */ - - void (*PrimitiveNotify)(GLcontext *ctx, GLenum mode); - /* Called between RenderStart() and RenderFinish() to indicate the - * type of primitive we're about to draw. Mode will be one of the - * modes accepted by glBegin(). - */ - - tnl_interp_func Interp; - /* The interp function is called by the clipping routines when we need - * to generate an interpolated vertex. All pertinant vertex ancilliary - * data should be computed by interpolating between the 'in' and 'out' - * vertices. - */ - - tnl_copy_pv_func CopyPV; - /* The copy function is used to make a copy of a vertex. All pertinant - * vertex attributes should be copied. - */ - - void (*ClippedPolygon)( GLcontext *ctx, const GLuint *elts, GLuint n ); - /* Render a polygon with vertices whose indexes are in the - * array. - */ - - void (*ClippedLine)( GLcontext *ctx, GLuint v0, GLuint v1 ); - /* Render a line between the two vertices given by indexes v0 and v1. */ - - tnl_points_func Points; /* must now respect vb->elts */ - tnl_line_func Line; - tnl_triangle_func Triangle; - tnl_quad_func Quad; - /* These functions are called in order to render points, lines, - * triangles and quads. These are only called via the T&L module. - */ - - tnl_render_func *PrimTabVerts; - tnl_render_func *PrimTabElts; - /* Render whole unclipped primitives (points, lines, linestrips, - * lineloops, etc). The tables are indexed by the GL enum of the - * primitive to be rendered. RenderTabVerts is used for non-indexed - * arrays of vertices. RenderTabElts is used for indexed arrays of - * vertices. - */ - - void (*ResetLineStipple)( GLcontext *ctx ); - /* Reset the hardware's line stipple counter. - */ - - tnl_setup_func BuildVertices; - /* This function is called whenever new vertices are required for - * rendering. The vertices in question are those n such that start - * <= n < end. The new_inputs parameter indicates those fields of - * the vertex which need to be updated, if only a partial repair of - * the vertex is required. - * - * This function is called only from _tnl_render_stage in tnl/t_render.c. - */ - - - GLboolean (*Multipass)( GLcontext *ctx, GLuint passno ); - /* Driver may request additional render passes by returning GL_TRUE - * when this function is called. This function will be called - * after the first pass, and passes will be made until the function - * returns GL_FALSE. If no function is registered, only one pass - * is made. - * - * This function will be first invoked with passno == 1. - */ - } Render; -}; - - -#define DECLARE_RENDERINPUTS(name) BITSET64_DECLARE(name, _TNL_ATTRIB_MAX) -#define RENDERINPUTS_COPY BITSET64_COPY -#define RENDERINPUTS_EQUAL BITSET64_EQUAL -#define RENDERINPUTS_ZERO BITSET64_ZERO -#define RENDERINPUTS_ONES BITSET64_ONES -#define RENDERINPUTS_TEST BITSET64_TEST -#define RENDERINPUTS_SET BITSET64_SET -#define RENDERINPUTS_CLEAR BITSET64_CLEAR -#define RENDERINPUTS_TEST_RANGE BITSET64_TEST_RANGE -#define RENDERINPUTS_SET_RANGE BITSET64_SET_RANGE -#define RENDERINPUTS_CLEAR_RANGE BITSET64_CLEAR_RANGE - - -/** - * Context state for T&L context. - */ -typedef struct -{ - /* Driver interface. - */ - struct tnl_device_driver Driver; - - /* Pipeline - */ - struct tnl_pipeline pipeline; - struct vertex_buffer vb; - - /* Clipspace/ndc/window vertex managment: - */ - struct tnl_clipspace clipspace; - - /* Probably need a better configuration mechanism: - */ - GLboolean NeedNdcCoords; - GLboolean AllowVertexFog; - GLboolean AllowPixelFog; - GLboolean _DoVertexFog; /* eval fog function at each vertex? */ - - DECLARE_RENDERINPUTS(render_inputs_bitset); - - GLvector4f tmp_inputs[VERT_ATTRIB_MAX]; - - /* Temp storage for t_draw.c: - */ - GLubyte *block[VERT_ATTRIB_MAX]; - GLuint nr_blocks; - -} TNLcontext; - - - -#define TNL_CONTEXT(ctx) ((TNLcontext *)((ctx)->swtnl_context)) - - -#define TYPE_IDX(t) ((t) & 0xf) -#define MAX_TYPES TYPE_IDX(GL_DOUBLE)+1 /* 0xa + 1 */ - - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_draw.c b/src/libs/mesa/mesa/tnl/t_draw.c deleted file mode 100644 index fd647c1f4a..0000000000 --- a/src/libs/mesa/mesa/tnl/t_draw.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/state.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/enums.h" - -#include "t_context.h" -#include "t_pipeline.h" -#include "t_vp_build.h" -#include "t_vertex.h" -#include "tnl.h" - - - -static GLubyte *get_space(GLcontext *ctx, GLuint bytes) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLubyte *space = _mesa_malloc(bytes); - - tnl->block[tnl->nr_blocks++] = space; - return space; -} - - -static void free_space(GLcontext *ctx) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - for (i = 0; i < tnl->nr_blocks; i++) - _mesa_free(tnl->block[i]); - tnl->nr_blocks = 0; -} - - -/* Convert the incoming array to GLfloats. Understands the - * array->Normalized flag and selects the correct conversion method. - */ -#define CONVERT( TYPE, MACRO ) do { \ - GLuint i, j; \ - if (input->Normalized) { \ - for (i = 0; i < count; i++) { \ - const TYPE *in = (TYPE *)ptr; \ - for (j = 0; j < sz; j++) { \ - *fptr++ = MACRO(*in); \ - in++; \ - } \ - ptr += input->StrideB; \ - } \ - } else { \ - for (i = 0; i < count; i++) { \ - const TYPE *in = (TYPE *)ptr; \ - for (j = 0; j < sz; j++) { \ - *fptr++ = (GLfloat)(*in); \ - in++; \ - } \ - ptr += input->StrideB; \ - } \ - } \ -} while (0) - - - -/* Adjust pointer to point at first requested element, convert to - * floating point, populate VB->AttribPtr[]. - */ -static void _tnl_import_array( GLcontext *ctx, - GLuint attrib, - GLuint count, - const struct gl_client_array *input, - const GLubyte *ptr ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint stride = input->StrideB; - - if (input->Type != GL_FLOAT) { - const GLuint sz = input->Size; - GLubyte *buf = get_space(ctx, count * sz * sizeof(GLfloat)); - GLfloat *fptr = (GLfloat *)buf; - - switch (input->Type) { - case GL_BYTE: - CONVERT(GLbyte, BYTE_TO_FLOAT); - break; - case GL_UNSIGNED_BYTE: - CONVERT(GLubyte, UBYTE_TO_FLOAT); - break; - case GL_SHORT: - CONVERT(GLshort, SHORT_TO_FLOAT); - break; - case GL_UNSIGNED_SHORT: - CONVERT(GLushort, USHORT_TO_FLOAT); - break; - case GL_INT: - CONVERT(GLint, INT_TO_FLOAT); - break; - case GL_UNSIGNED_INT: - CONVERT(GLuint, UINT_TO_FLOAT); - break; - case GL_DOUBLE: - CONVERT(GLdouble, (GLfloat)); - break; - default: - assert(0); - break; - } - - ptr = buf; - stride = sz * sizeof(GLfloat); - } - - VB->AttribPtr[attrib] = &tnl->tmp_inputs[attrib]; - VB->AttribPtr[attrib]->data = (GLfloat (*)[4])ptr; - VB->AttribPtr[attrib]->start = (GLfloat *)ptr; - VB->AttribPtr[attrib]->count = count; - VB->AttribPtr[attrib]->stride = stride; - VB->AttribPtr[attrib]->size = input->Size; - - /* This should die, but so should the whole GLvector4f concept: - */ - VB->AttribPtr[attrib]->flags = (((1<Size)-1) | - VEC_NOT_WRITEABLE | - (stride == 4*sizeof(GLfloat) ? 0 : VEC_BAD_STRIDE)); - - VB->AttribPtr[attrib]->storage = NULL; -} - -#define CLIPVERTS ((6 + MAX_CLIP_PLANES) * 2) - - -static GLboolean *_tnl_import_edgeflag( GLcontext *ctx, - const GLvector4f *input, - GLuint count) -{ - const GLubyte *ptr = (const GLubyte *)input->data; - const GLuint stride = input->stride; - GLboolean *space = (GLboolean *)get_space(ctx, count + CLIPVERTS); - GLboolean *bptr = space; - GLuint i; - - for (i = 0; i < count; i++) { - *bptr++ = ((GLfloat *)ptr)[0] == 1.0; - ptr += stride; - } - - return space; -} - - -static void bind_inputs( GLcontext *ctx, - const struct gl_client_array *inputs[], - GLint count, - struct gl_buffer_object **bo, - GLuint *nr_bo ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - - /* Map all the VBOs - */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - const void *ptr; - - if (inputs[i]->BufferObj->Name) { - if (!inputs[i]->BufferObj->Pointer) { - bo[*nr_bo] = inputs[i]->BufferObj; - (*nr_bo)++; - ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER, - GL_READ_ONLY_ARB, - inputs[i]->BufferObj); - - assert(inputs[i]->BufferObj->Pointer); - } - - ptr = ADD_POINTERS(inputs[i]->BufferObj->Pointer, - inputs[i]->Ptr); - } - else - ptr = inputs[i]->Ptr; - - /* Just make sure the array is floating point, otherwise convert to - * temporary storage. - * - * XXX: remove the GLvector4f type at some stage and just use - * client arrays. - */ - _tnl_import_array(ctx, i, count, inputs[i], ptr); - } - - /* We process only the vertices between min & max index: - */ - VB->Count = count; - - - /* Legacy pointers -- remove one day. - */ - VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS]; - VB->NormalPtr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; - VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; - VB->ColorPtr[1] = NULL; - VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; - VB->IndexPtr[1] = NULL; - VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1]; - VB->SecondaryColorPtr[1] = NULL; - VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]; - } - - /* Clipping and drawing code still requires this to be a packed - * array of ubytes which can be written into. TODO: Fix and - * remove. - */ - if (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL) - { - VB->EdgeFlag = _tnl_import_edgeflag( ctx, - VB->AttribPtr[_TNL_ATTRIB_EDGEFLAG], - VB->Count ); - } - else { - /* the data previously pointed to by EdgeFlag may have been freed */ - VB->EdgeFlag = NULL; - } -} - - -/* Translate indices to GLuints and store in VB->Elts. - */ -static void bind_indices( GLcontext *ctx, - const struct _mesa_index_buffer *ib, - struct gl_buffer_object **bo, - GLuint *nr_bo) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - void *ptr; - - if (!ib) { - VB->Elts = NULL; - return; - } - - if (ib->obj->Name && !ib->obj->Pointer) { - bo[*nr_bo] = ib->obj; - (*nr_bo)++; - ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER, - GL_READ_ONLY_ARB, - ib->obj); - - assert(ib->obj->Pointer); - } - - ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); - - if (ib->type == GL_UNSIGNED_INT) { - VB->Elts = (GLuint *) ptr; - } - else { - GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint)); - VB->Elts = elts; - - if (ib->type == GL_UNSIGNED_SHORT) { - const GLushort *in = (GLushort *)ptr; - for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++); - } - else { - const GLubyte *in = (GLubyte *)ptr; - for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++); - } - } -} - -static void bind_prims( GLcontext *ctx, - const struct _mesa_prim *prim, - GLuint nr_prims ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - - VB->Primitive = prim; - VB->PrimitiveCount = nr_prims; -} - -static void unmap_vbos( GLcontext *ctx, - struct gl_buffer_object **bo, - GLuint nr_bo ) -{ - GLuint i; - for (i = 0; i < nr_bo; i++) { - ctx->Driver.UnmapBuffer(ctx, - 0, /* target -- I don't see why this would be needed */ - bo[i]); - } -} - - - -/* This is the main entrypoint into the slimmed-down software tnl - * module. In a regular swtnl driver, this can be plugged straight - * into the vbo->Driver.DrawPrims() callback. - */ -void _tnl_draw_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - const GLuint TEST_SPLIT = 0; - const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES; - - if (0) - { - GLuint i; - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - for (i = 0; i < nr_prims; i++) - _mesa_printf("prim %d: %s start %d count %d\n", i, - _mesa_lookup_enum_by_nr(prim[i].mode), - prim[i].start, - prim[i].count); - } - - if (min_index) { - /* We always translate away calls with min_index != 0. - */ - vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, - min_index, max_index, - _tnl_draw_prims ); - return; - } - else if (max_index > max) { - /* The software TNL pipeline has a fixed amount of storage for - * vertices and it is necessary to split incoming drawing commands - * if they exceed that limit. - */ - struct split_limits limits; - limits.max_verts = max; - limits.max_vb_size = ~0; - limits.max_indices = ~0; - - /* This will split the buffers one way or another and - * recursively call back into this function. - */ - vbo_split_prims( ctx, arrays, prim, nr_prims, ib, - 0, max_index, - _tnl_draw_prims, - &limits ); - } - else { - /* May need to map a vertex buffer object for every attribute plus - * one for the index buffer. - */ - struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1]; - GLuint nr_bo = 0; - - /* Binding inputs may imply mapping some vertex buffer objects. - * They will need to be unmapped below. - */ - bind_inputs(ctx, arrays, max_index+1, bo, &nr_bo); - bind_indices(ctx, ib, bo, &nr_bo); - bind_prims(ctx, prim, nr_prims ); - - TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); - - unmap_vbos(ctx, bo, nr_bo); - free_space(ctx); - } -} - diff --git a/src/libs/mesa/mesa/tnl/t_pipeline.c b/src/libs/mesa/mesa/tnl/t_pipeline.c deleted file mode 100644 index 357ef1e24b..0000000000 --- a/src/libs/mesa/mesa/tnl/t_pipeline.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/state.h" -#include "main/mtypes.h" - -#include "t_context.h" -#include "t_pipeline.h" -#include "t_vp_build.h" -#include "t_vertex.h" - -void _tnl_install_pipeline( GLcontext *ctx, - const struct tnl_pipeline_stage **stages ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - - tnl->pipeline.new_state = ~0; - - /* Create a writeable copy of each stage. - */ - for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) { - struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - MEMCPY(s, stages[i], sizeof(*s)); - if (s->create) - s->create(ctx, s); - } - - tnl->pipeline.nr_stages = i; -} - -void _tnl_destroy_pipeline( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - - for (i = 0 ; i < tnl->pipeline.nr_stages ; i++) { - struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - if (s->destroy) - s->destroy(s); - } - - tnl->pipeline.nr_stages = 0; -} - - - -static GLuint check_input_changes( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint i; - - for (i = 0; i <= _TNL_LAST_MAT; i++) { - if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] || - tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) { - tnl->pipeline.last_attrib_size[i] = tnl->vb.AttribPtr[i]->size; - tnl->pipeline.last_attrib_stride[i] = tnl->vb.AttribPtr[i]->stride; - tnl->pipeline.input_changes |= 1<pipeline.input_changes && - tnl->Driver.NotifyInputChanges) - tnl->Driver.NotifyInputChanges( ctx, tnl->pipeline.input_changes ); - - return tnl->pipeline.input_changes; -} - - -static GLuint check_output_changes( GLcontext *ctx ) -{ -#if 0 - TNLcontext *tnl = TNL_CONTEXT(ctx); - - for (i = 0; i < VERT_RESULT_MAX; i++) { - if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] || - tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) { - tnl->last_result_size[i] = tnl->vb.ResultPtr[i]->size; - tnl->last_result_stride[i] = tnl->vb.ResultPtr[i]->stride; - tnl->pipeline.output_changes |= 1<pipeline.output_changes) - tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes ); - - return tnl->pipeline.output_changes; -#else - return ~0; -#endif -} - - -void _tnl_run_pipeline( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - unsigned short __tmp; - GLuint i; - - if (!tnl->vb.Count) - return; - - /* Check for changed input sizes or change in stride to/from zero - * (ie const or non-const). - */ - if (check_input_changes( ctx ) || tnl->pipeline.new_state) { - if (ctx->VertexProgram._MaintainTnlProgram) - _tnl_UpdateFixedFunctionProgram( ctx ); - - for (i = 0; i < tnl->pipeline.nr_stages ; i++) { - struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - if (s->validate) - s->validate( ctx, s ); - } - - tnl->pipeline.new_state = 0; - tnl->pipeline.input_changes = 0; - - /* Pipeline can only change its output in response to either a - * statechange or an input size/stride change. No other changes - * are allowed. - */ - if (check_output_changes( ctx )) - _tnl_notify_pipeline_output_change( ctx ); - } - - START_FAST_MATH(__tmp); - - for (i = 0; i < tnl->pipeline.nr_stages ; i++) { - struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - if (!s->run( ctx, s )) - break; - } - - END_FAST_MATH(__tmp); -} - - - -/* The default pipeline. This is useful for software rasterizers, and - * simple hardware rasterizers. For customization, I don't recommend - * tampering with the internals of these stages in the way that - * drivers did in Mesa 3.4. These stages are basically black boxes, - * and should be left intact. - * - * To customize the pipeline, consider: - * - * - removing redundant stages (making sure that the software rasterizer - * can cope with this on fallback paths). An example is fog - * coordinate generation, which is not required in the FX driver. - * - * - replacing general-purpose machine-independent stages with - * general-purpose machine-specific stages. There is no example of - * this to date, though it must be borne in mind that all subsequent - * stages that reference the output of the new stage must cope with - * any machine-specific data introduced. This may not be easy - * unless there are no such stages (ie the new stage is the last in - * the pipe). - * - * - inserting optimized (but specialized) stages ahead of the - * general-purpose fallback implementation. For example, the old - * fastpath mechanism, which only works when the VB->Elts input is - * available, can be duplicated by placing the fastpath stage at the - * head of this pipeline. Such specialized stages are currently - * constrained to have no outputs (ie. they must either finish the * - * pipeline by returning GL_FALSE from run(), or do nothing). - * - * Some work can be done to lift some of the restrictions in the final - * case, if it becomes necessary to do so. - */ -const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, - &_tnl_vertex_program_stage, - &_tnl_fog_coordinate_stage, - &_tnl_render_stage, - NULL -}; - -const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = { - &_tnl_vertex_program_stage, - &_tnl_render_stage, - NULL -}; diff --git a/src/libs/mesa/mesa/tnl/t_pipeline.h b/src/libs/mesa/mesa/tnl/t_pipeline.h deleted file mode 100644 index d110010f04..0000000000 --- a/src/libs/mesa/mesa/tnl/t_pipeline.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - - - -#ifndef _T_PIPELINE_H_ -#define _T_PIPELINE_H_ - -#include "main/mtypes.h" -#include "t_context.h" - -extern void _tnl_run_pipeline( GLcontext *ctx ); - -extern void _tnl_destroy_pipeline( GLcontext *ctx ); - -extern void _tnl_install_pipeline( GLcontext *ctx, - const struct tnl_pipeline_stage **stages ); - - -/* These are implemented in the t_vb_*.c files: - */ -extern const struct tnl_pipeline_stage _tnl_vertex_transform_stage; -extern const struct tnl_pipeline_stage _tnl_vertex_cull_stage; -extern const struct tnl_pipeline_stage _tnl_normal_transform_stage; -extern const struct tnl_pipeline_stage _tnl_lighting_stage; -extern const struct tnl_pipeline_stage _tnl_fog_coordinate_stage; -extern const struct tnl_pipeline_stage _tnl_texgen_stage; -extern const struct tnl_pipeline_stage _tnl_texture_transform_stage; -extern const struct tnl_pipeline_stage _tnl_point_attenuation_stage; -extern const struct tnl_pipeline_stage _tnl_vertex_program_stage; -extern const struct tnl_pipeline_stage _tnl_render_stage; - -/* Shorthand to plug in the default pipeline: - */ -extern const struct tnl_pipeline_stage *_tnl_default_pipeline[]; -extern const struct tnl_pipeline_stage *_tnl_vp_pipeline[]; - - -/* Convenience routines provided by t_vb_render.c: - */ -extern tnl_render_func _tnl_render_tab_elts[]; -extern tnl_render_func _tnl_render_tab_verts[]; - -extern void _tnl_RenderClippedPolygon( GLcontext *ctx, - const GLuint *elts, GLuint n ); - -extern void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ); - - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_rasterpos.c b/src/libs/mesa/mesa/tnl/t_rasterpos.c deleted file mode 100644 index dfbe0f1806..0000000000 --- a/src/libs/mesa/mesa/tnl/t_rasterpos.c +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "feedback.h" -#include "light.h" -#include "main/macros.h" -#include "rastpos.h" -#include "simple_list.h" -#include "main/mtypes.h" - -#include "math/m_matrix.h" -#include "tnl/tnl.h" - - - -/** - * Clip a point against the view volume. - * - * \param v vertex vector describing the point to clip. - * - * \return zero if outside view volume, or one if inside. - */ -static GLuint -viewclip_point( const GLfloat v[] ) -{ - if ( v[0] > v[3] || v[0] < -v[3] - || v[1] > v[3] || v[1] < -v[3] - || v[2] > v[3] || v[2] < -v[3] ) { - return 0; - } - else { - return 1; - } -} - - -/** - * Clip a point against the far/near Z clipping planes. - * - * \param v vertex vector describing the point to clip. - * - * \return zero if outside view volume, or one if inside. - */ -static GLuint -viewclip_point_z( const GLfloat v[] ) -{ - if (v[2] > v[3] || v[2] < -v[3] ) { - return 0; - } - else { - return 1; - } -} - - -/** - * Clip a point against the user clipping planes. - * - * \param ctx GL context. - * \param v vertex vector describing the point to clip. - * - * \return zero if the point was clipped, or one otherwise. - */ -static GLuint -userclip_point( GLcontext *ctx, const GLfloat v[] ) -{ - GLuint p; - - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0] - + v[1] * ctx->Transform._ClipUserPlane[p][1] - + v[2] * ctx->Transform._ClipUserPlane[p][2] - + v[3] * ctx->Transform._ClipUserPlane[p][3]; - if (dot < 0.0F) { - return 0; - } - } - } - - return 1; -} - - -/** - * Compute lighting for the raster position. Both RGB and CI modes computed. - * \param ctx the context - * \param vertex vertex location - * \param normal normal vector - * \param Rcolor returned color - * \param Rspec returned specular color (if separate specular enabled) - * \param Rindex returned color index - */ -static void -shade_rastpos(GLcontext *ctx, - const GLfloat vertex[4], - const GLfloat normal[3], - GLfloat Rcolor[4], - GLfloat Rspec[4], - GLfloat *Rindex) -{ - /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor; - const struct gl_light *light; - GLfloat diffuseColor[4], specularColor[4]; /* for RGB mode only */ - GLfloat diffuseCI = 0.0, specularCI = 0.0; /* for CI mode only */ - - _mesa_validate_all_lighting_tables( ctx ); - - COPY_3V(diffuseColor, base[0]); - diffuseColor[3] = CLAMP( - ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); - ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 1.0); - - foreach (light, &ctx->Light.EnabledList) { - GLfloat attenuation = 1.0; - GLfloat VP[3]; /* vector from vertex to light pos */ - GLfloat n_dot_VP; - GLfloat diffuseContrib[3], specularContrib[3]; - - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* light at infinity */ - COPY_3V(VP, light->_VP_inf_norm); - attenuation = light->_VP_inf_spot_attenuation; - } - else { - /* local/positional light */ - GLfloat d; - - /* VP = vector from vertex pos to light[i].pos */ - SUB_3V(VP, light->_Position, vertex); - /* d = length(VP) */ - d = (GLfloat) LEN_3FV( VP ); - if (d > 1.0e-6) { - /* normalize VP */ - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - /* atti */ - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - - if (PV_dot_dir_CosCutoff) { - continue; - } - else { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; - - n_dot_VP = DOT3( normal, VP ); - - if (n_dot_VP < 0.0F) { - ACC_SCALE_SCALAR_3V(diffuseColor, attenuation, light->_MatAmbient[0]); - continue; - } - - /* Ambient + diffuse */ - COPY_3V(diffuseContrib, light->_MatAmbient[0]); - ACC_SCALE_SCALAR_3V(diffuseContrib, n_dot_VP, light->_MatDiffuse[0]); - diffuseCI += n_dot_VP * light->_dli * attenuation; - - /* Specular */ - { - const GLfloat *h; - GLfloat n_dot_h; - - ASSIGN_3V(specularContrib, 0.0, 0.0, 0.0); - - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); - NORMALIZE_3FV(VP); - h = VP; - } - else if (light->_Flags & LIGHT_POSITIONAL) { - ACC_3V(VP, ctx->_EyeZDir); - NORMALIZE_3FV(VP); - h = VP; - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = DOT3(normal, h); - - if (n_dot_h > 0.0F) { - GLfloat spec_coef; - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); - - if (spec_coef > 1.0e-10) { - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) { - ACC_SCALE_SCALAR_3V( specularContrib, spec_coef, - light->_MatSpecular[0]); - } - else { - ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef, - light->_MatSpecular[0]); - } - /*assert(light->_sli > 0.0);*/ - specularCI += spec_coef * light->_sli * attenuation; - } - } - } - - ACC_SCALE_SCALAR_3V( diffuseColor, attenuation, diffuseContrib ); - ACC_SCALE_SCALAR_3V( specularColor, attenuation, specularContrib ); - } - - if (ctx->Visual.rgbMode) { - Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); - Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); - Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); - Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); - Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); - Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); - Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); - Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); - } - else { - GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES]; - GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; - GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; - GLfloat i = (ind[MAT_INDEX_AMBIENT] - + diffuseCI * (1.0F-specularCI) * d_a - + specularCI * s_a); - if (i > ind[MAT_INDEX_SPECULAR]) { - i = ind[MAT_INDEX_SPECULAR]; - } - *Rindex = i; - } -} - - -/** - * Do texgen needed for glRasterPos. - * \param ctx rendering context - * \param vObj object-space vertex coordinate - * \param vEye eye-space vertex coordinate - * \param normal vertex normal - * \param unit texture unit number - * \param texcoord incoming texcoord and resulting texcoord - */ -static void -compute_texgen(GLcontext *ctx, const GLfloat vObj[4], const GLfloat vEye[4], - const GLfloat normal[3], GLuint unit, GLfloat texcoord[4]) -{ - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - - /* always compute sphere map terms, just in case */ - GLfloat u[3], two_nu, rx, ry, rz, m, mInv; - COPY_3V(u, vEye); - NORMALIZE_3FV(u); - two_nu = 2.0F * DOT3(normal, u); - rx = u[0] - normal[0] * two_nu; - ry = u[1] - normal[1] * two_nu; - rz = u[2] - normal[2] * two_nu; - m = rx * rx + ry * ry + (rz + 1.0F) * (rz + 1.0F); - if (m > 0.0F) - mInv = 0.5F * _mesa_inv_sqrtf(m); - else - mInv = 0.0F; - - if (texUnit->TexGenEnabled & S_BIT) { - switch (texUnit->GenModeS) { - case GL_OBJECT_LINEAR: - texcoord[0] = DOT4(vObj, texUnit->ObjectPlaneS); - break; - case GL_EYE_LINEAR: - texcoord[0] = DOT4(vEye, texUnit->EyePlaneS); - break; - case GL_SPHERE_MAP: - texcoord[0] = rx * mInv + 0.5F; - break; - case GL_REFLECTION_MAP: - texcoord[0] = rx; - break; - case GL_NORMAL_MAP: - texcoord[0] = normal[0]; - break; - default: - _mesa_problem(ctx, "Bad S texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & T_BIT) { - switch (texUnit->GenModeT) { - case GL_OBJECT_LINEAR: - texcoord[1] = DOT4(vObj, texUnit->ObjectPlaneT); - break; - case GL_EYE_LINEAR: - texcoord[1] = DOT4(vEye, texUnit->EyePlaneT); - break; - case GL_SPHERE_MAP: - texcoord[1] = ry * mInv + 0.5F; - break; - case GL_REFLECTION_MAP: - texcoord[1] = ry; - break; - case GL_NORMAL_MAP: - texcoord[1] = normal[1]; - break; - default: - _mesa_problem(ctx, "Bad T texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & R_BIT) { - switch (texUnit->GenModeR) { - case GL_OBJECT_LINEAR: - texcoord[2] = DOT4(vObj, texUnit->ObjectPlaneR); - break; - case GL_EYE_LINEAR: - texcoord[2] = DOT4(vEye, texUnit->EyePlaneR); - break; - case GL_REFLECTION_MAP: - texcoord[2] = rz; - break; - case GL_NORMAL_MAP: - texcoord[2] = normal[2]; - break; - default: - _mesa_problem(ctx, "Bad R texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & Q_BIT) { - switch (texUnit->GenModeQ) { - case GL_OBJECT_LINEAR: - texcoord[3] = DOT4(vObj, texUnit->ObjectPlaneQ); - break; - case GL_EYE_LINEAR: - texcoord[3] = DOT4(vEye, texUnit->EyePlaneQ); - break; - default: - _mesa_problem(ctx, "Bad Q texgen in compute_texgen()"); - return; - } - } -} - - -/** - * glRasterPos transformation. Typically called via ctx->Driver.RasterPos(). - * XXX some of this code (such as viewport xform, clip testing and setting - * of ctx->Current.Raster* fields) could get lifted up into the - * main/rasterpos.c code. - * - * \param vObj vertex position in object space - */ -void -_tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) -{ - if (ctx->VertexProgram._Enabled) { - /* XXX implement this */ - _mesa_problem(ctx, "Vertex programs not implemented for glRasterPos"); - return; - } - else { - GLfloat eye[4], clip[4], ndc[3], d; - GLfloat *norm, eyenorm[3]; - GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; - - /* apply modelview matrix: eye = MV * obj */ - TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, vObj ); - /* apply projection matrix: clip = Proj * eye */ - TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye ); - - /* clip to view volume */ - if (ctx->Transform.RasterPositionUnclipped) { - /* GL_IBM_rasterpos_clip: only clip against Z */ - if (viewclip_point_z(clip) == 0) { - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - } - else if (viewclip_point(clip) == 0) { - /* Normal OpenGL behaviour */ - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - - /* clip to user clipping planes */ - if (ctx->Transform.ClipPlanesEnabled && !userclip_point(ctx, clip)) { - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - - /* ndc = clip / W */ - d = (clip[3] == 0.0F) ? 1.0F : 1.0F / clip[3]; - ndc[0] = clip[0] * d; - ndc[1] = clip[1] * d; - ndc[2] = clip[2] * d; - /* wincoord = viewport_mapping(ndc) */ - ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX] - + ctx->Viewport._WindowMap.m[MAT_TX]); - ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] - + ctx->Viewport._WindowMap.m[MAT_TY]); - ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] - + ctx->Viewport._WindowMap.m[MAT_TZ]) - / ctx->DrawBuffer->_DepthMaxF; - ctx->Current.RasterPos[3] = clip[3]; - - /* compute raster distance */ - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) - ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; - else - ctx->Current.RasterDistance = - SQRTF( eye[0]*eye[0] + eye[1]*eye[1] + eye[2]*eye[2] ); - - /* compute transformed normal vector (for lighting or texgen) */ - if (ctx->_NeedEyeCoords) { - const GLfloat *inv = ctx->ModelviewMatrixStack.Top->inv; - TRANSFORM_NORMAL( eyenorm, objnorm, inv ); - norm = eyenorm; - } - else { - norm = objnorm; - } - - /* update raster color */ - if (ctx->Light.Enabled) { - /* lighting */ - shade_rastpos( ctx, vObj, norm, - ctx->Current.RasterColor, - ctx->Current.RasterSecondaryColor, - &ctx->Current.RasterIndex ); - } - else { - /* use current color or index */ - if (ctx->Visual.rgbMode) { - COPY_4FV(ctx->Current.RasterColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); - COPY_4FV(ctx->Current.RasterSecondaryColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); - } - else { - ctx->Current.RasterIndex - = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } - } - - /* texture coords */ - { - GLuint u; - for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { - GLfloat tc[4]; - COPY_4V(tc, ctx->Current.Attrib[VERT_ATTRIB_TEX0 + u]); - if (ctx->Texture.Unit[u].TexGenEnabled) { - compute_texgen(ctx, vObj, eye, norm, u, tc); - } - TRANSFORM_POINT(ctx->Current.RasterTexCoords[u], - ctx->TextureMatrixStack[u].Top->m, tc); - } - } - - ctx->Current.RasterPosValid = GL_TRUE; - } - - if (ctx->RenderMode == GL_SELECT) { - _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); - } -} diff --git a/src/libs/mesa/mesa/tnl/t_vb_cliptmp.h b/src/libs/mesa/mesa/tnl/t_vb_cliptmp.h deleted file mode 100644 index 788fe329ed..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_cliptmp.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#define CLIP_DOTPROD(K, A, B, C, D) X(K)*A + Y(K)*B + Z(K)*C + W(K)*D - -#define POLY_CLIP( PLANE_BIT, A, B, C, D ) \ -do { \ - if (mask & PLANE_BIT) { \ - GLuint idxPrev = inlist[0]; \ - GLfloat dpPrev = CLIP_DOTPROD(idxPrev, A, B, C, D ); \ - GLuint outcount = 0; \ - GLuint i; \ - \ - inlist[n] = inlist[0]; /* prevent rotation of vertices */ \ - for (i = 1; i <= n; i++) { \ - GLuint idx = inlist[i]; \ - GLfloat dp = CLIP_DOTPROD(idx, A, B, C, D ); \ - \ - if (!IS_NEGATIVE(dpPrev)) { \ - outlist[outcount++] = idxPrev; \ - } \ - \ - if (DIFFERENT_SIGNS(dp, dpPrev)) { \ - if (IS_NEGATIVE(dp)) { \ - /* Going out of bounds. Avoid division by zero as we \ - * know dp != dpPrev from DIFFERENT_SIGNS, above. \ - */ \ - GLfloat t = dp / (dp - dpPrev); \ - INTERP_4F( t, coord[newvert], coord[idx], coord[idxPrev]); \ - interp( ctx, t, newvert, idx, idxPrev, GL_TRUE ); \ - } else { \ - /* Coming back in. \ - */ \ - GLfloat t = dpPrev / (dpPrev - dp); \ - INTERP_4F( t, coord[newvert], coord[idxPrev], coord[idx]); \ - interp( ctx, t, newvert, idxPrev, idx, GL_FALSE ); \ - } \ - outlist[outcount++] = newvert++; \ - } \ - \ - idxPrev = idx; \ - dpPrev = dp; \ - } \ - \ - if (outcount < 3) \ - return; \ - \ - { \ - GLuint *tmp = inlist; \ - inlist = outlist; \ - outlist = tmp; \ - n = outcount; \ - } \ - } \ -} while (0) - - -#define LINE_CLIP(PLANE_BIT, A, B, C, D ) \ -do { \ - if (mask & PLANE_BIT) { \ - const GLfloat dp0 = CLIP_DOTPROD( v0, A, B, C, D ); \ - const GLfloat dp1 = CLIP_DOTPROD( v1, A, B, C, D ); \ - const GLboolean neg_dp0 = IS_NEGATIVE(dp0); \ - const GLboolean neg_dp1 = IS_NEGATIVE(dp1); \ - \ - /* For regular clipping, we know from the clipmask that one \ - * (or both) of these must be negative (otherwise we wouldn't \ - * be here). \ - * For userclip, there is only a single bit for all active \ - * planes, so we can end up here when there is nothing to do, \ - * hence the second IS_NEGATIVE() test: \ - */ \ - if (neg_dp0 && neg_dp1) \ - return; /* both vertices outside clip plane: discard */ \ - \ - if (neg_dp1) { \ - GLfloat t = dp1 / (dp1 - dp0); \ - if (t > t1) t1 = t; \ - } else if (neg_dp0) { \ - GLfloat t = dp0 / (dp0 - dp1); \ - if (t > t0) t0 = t; \ - } \ - if (t0 + t1 >= 1.0) \ - return; /* discard */ \ - } \ -} while (0) - - - -/* Clip a line against the viewport and user clip planes. - */ -static INLINE void -TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_interp_func interp = tnl->Driver.Render.Interp; - GLfloat (*coord)[4] = VB->ClipPtr->data; - GLuint newvert = VB->Count; - GLfloat t0 = 0; - GLfloat t1 = 0; - GLuint p; - const GLuint v0_orig = v0; - - if (mask & 0x3f) { - LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); - LINE_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); - LINE_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); - LINE_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); - LINE_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); - LINE_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - } - - if (mask & CLIP_USER_BIT) { - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - LINE_CLIP( CLIP_USER_BIT, a, b, c, d ); - } - } - } - - if (VB->ClipMask[v0]) { - INTERP_4F( t0, coord[newvert], coord[v0], coord[v1] ); - interp( ctx, t0, newvert, v0, v1, GL_FALSE ); - v0 = newvert; - newvert++; - } - else { - ASSERT(t0 == 0.0); - } - - /* Note: we need to use vertex v0_orig when computing the new - * interpolated/clipped vertex position, not the current v0 which - * may have got set when we clipped the other end of the line! - */ - if (VB->ClipMask[v1]) { - INTERP_4F( t1, coord[newvert], coord[v1], coord[v0_orig] ); - interp( ctx, t1, newvert, v1, v0_orig, GL_FALSE ); - - if (ctx->Light.ShadeModel == GL_FLAT) - tnl->Driver.Render.CopyPV( ctx, newvert, v1 ); - - v1 = newvert; - - newvert++; - } - else { - ASSERT(t1 == 0.0); - } - - tnl->Driver.Render.ClippedLine( ctx, v0, v1 ); -} - - -/* Clip a triangle against the viewport and user clip planes. - */ -static INLINE void -TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_interp_func interp = tnl->Driver.Render.Interp; - GLuint newvert = VB->Count; - GLfloat (*coord)[4] = VB->ClipPtr->data; - GLuint pv = v2; - GLuint vlist[2][MAX_CLIPPED_VERTICES]; - GLuint *inlist = vlist[0], *outlist = vlist[1]; - GLuint p; - GLuint n = 3; - - ASSIGN_3V(inlist, v2, v0, v1 ); /* pv rotated to slot zero */ - - if (mask & 0x3f) { - POLY_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); - POLY_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); - POLY_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); - POLY_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); - POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); - POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - } - - if (mask & CLIP_USER_BIT) { - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); - } - } - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - if (pv != inlist[0]) { - ASSERT( inlist[0] >= VB->Count ); - tnl->Driver.Render.CopyPV( ctx, inlist[0], pv ); - } - } - - tnl->Driver.Render.ClippedPolygon( ctx, inlist, n ); -} - - -/* Clip a quad against the viewport and user clip planes. - */ -static INLINE void -TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, - GLubyte mask ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_interp_func interp = tnl->Driver.Render.Interp; - GLuint newvert = VB->Count; - GLfloat (*coord)[4] = VB->ClipPtr->data; - GLuint pv = v3; - GLuint vlist[2][MAX_CLIPPED_VERTICES]; - GLuint *inlist = vlist[0], *outlist = vlist[1]; - GLuint p; - GLuint n = 4; - - ASSIGN_4V(inlist, v3, v0, v1, v2 ); /* pv rotated to slot zero */ - - if (mask & 0x3f) { - POLY_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); - POLY_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); - POLY_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); - POLY_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); - POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); - POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - } - - if (mask & CLIP_USER_BIT) { - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); - } - } - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - if (pv != inlist[0]) { - ASSERT( inlist[0] >= VB->Count ); - tnl->Driver.Render.CopyPV( ctx, inlist[0], pv ); - } - } - - tnl->Driver.Render.ClippedPolygon( ctx, inlist, n ); -} - -#undef W -#undef Z -#undef Y -#undef X -#undef SIZE -#undef TAG -#undef POLY_CLIP -#undef LINE_CLIP diff --git a/src/libs/mesa/mesa/tnl/t_vb_cull.c b/src/libs/mesa/mesa/tnl/t_vb_cull.c deleted file mode 100644 index 712901acf3..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_cull.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - - -/* EXT_vertex_cull. Not really a big win, but probably depends on - * your application. This stage not included in the default pipeline. - */ -static GLboolean run_cull_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - - const GLfloat a = ctx->Transform.CullObjPos[0]; - const GLfloat b = ctx->Transform.CullObjPos[1]; - const GLfloat c = ctx->Transform.CullObjPos[2]; - GLfloat *norm = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLuint stride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - GLuint count = VB->Count; - GLuint i; - - if (ctx->VertexProgram._Current || - !ctx->Transform.CullVertexFlag) - return GL_TRUE; - - VB->ClipOrMask &= ~CLIP_CULL_BIT; - VB->ClipAndMask |= CLIP_CULL_BIT; - - for (i = 0 ; i < count ; i++) { - GLfloat dp = (norm[0] * a + - norm[1] * b + - norm[2] * c); - - if (dp < 0) { - VB->ClipMask[i] |= CLIP_CULL_BIT; - VB->ClipOrMask |= CLIP_CULL_BIT; - } - else { - VB->ClipMask[i] &= ~CLIP_CULL_BIT; - VB->ClipAndMask &= ~CLIP_CULL_BIT; - } - - STRIDE_F(norm, stride); - } - - return !(VB->ClipAndMask & CLIP_CULL_BIT); -} - - - -const struct tnl_pipeline_stage _tnl_vertex_cull_stage = -{ - "EXT_cull_vertex", - NULL, /* private data */ - NULL, /* ctr */ - NULL, /* destructor */ - NULL, - run_cull_stage /* run -- initially set to init */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_fog.c b/src/libs/mesa/mesa/tnl/t_vb_fog.c deleted file mode 100644 index f3a7bd49f4..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_fog.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - -struct fog_stage_data { - GLvector4f fogcoord; /* has actual storage allocated */ -}; - -#define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->privatePtr) - -#define FOG_EXP_TABLE_SIZE 256 -#define FOG_MAX (10.0) -#define EXP_FOG_MAX .0006595 -#define FOG_INCR (FOG_MAX/FOG_EXP_TABLE_SIZE) -static GLfloat exp_table[FOG_EXP_TABLE_SIZE]; -static GLfloat inited = 0; - -#if 1 -#define NEG_EXP( result, narg ) \ -do { \ - GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR)); \ - GLint k = (GLint) f; \ - if (k > FOG_EXP_TABLE_SIZE-2) \ - result = (GLfloat) EXP_FOG_MAX; \ - else \ - result = exp_table[k] + (f-k)*(exp_table[k+1]-exp_table[k]); \ -} while (0) -#else -#define NEG_EXP( result, narg ) \ -do { \ - result = exp(-narg); \ -} while (0) -#endif - - -/** - * Initialize the exp_table[] lookup table for approximating exp(). - */ -static void -init_static_data( void ) -{ - GLfloat f = 0.0F; - GLint i = 0; - for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) { - exp_table[i] = EXPF(-f); - } - inited = 1; -} - - -/** - * Compute per-vertex fog blend factors from fog coordinates by - * evaluating the GL_LINEAR, GL_EXP or GL_EXP2 fog function. - * Fog coordinates are distances from the eye (typically between the - * near and far clip plane distances). - * Note that fogcoords may be negative, if eye z is source absolute - * value must be taken earlier. - * Fog blend factors are in the range [0,1]. - */ -static void -compute_fog_blend_factors(GLcontext *ctx, GLvector4f *out, const GLvector4f *in) -{ - GLfloat end = ctx->Fog.End; - GLfloat *v = in->start; - GLuint stride = in->stride; - GLuint n = in->count; - GLfloat (*data)[4] = out->data; - GLfloat d; - GLuint i; - - out->count = in->count; - - switch (ctx->Fog.Mode) { - case GL_LINEAR: - if (ctx->Fog.Start == ctx->Fog.End) - d = 1.0F; - else - d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); - for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { - const GLfloat z = *v; - GLfloat f = (end - z) * d; - data[i][0] = CLAMP(f, 0.0F, 1.0F); - } - break; - case GL_EXP: - d = ctx->Fog.Density; - for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride)) { - const GLfloat z = *v; - NEG_EXP( data[i][0], d * z ); - } - break; - case GL_EXP2: - d = ctx->Fog.Density*ctx->Fog.Density; - for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { - const GLfloat z = *v; - NEG_EXP( data[i][0], d * z * z ); - } - break; - default: - _mesa_problem(ctx, "Bad fog mode in make_fog_coord"); - return; - } -} - - -static GLboolean -run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - struct fog_stage_data *store = FOG_STAGE_DATA(stage); - GLvector4f *input; - - - if (!ctx->Fog.Enabled) - return GL_TRUE; - - if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && !ctx->VertexProgram._Current) { - GLuint i; - GLfloat *coord; - /* Fog is computed from vertex or fragment Z values */ - /* source = VB->ObjPtr or VB->EyePtr coords */ - /* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */ - VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; - - if (!ctx->_NeedEyeCoords) { - /* compute fog coords from object coords */ - const GLfloat *m = ctx->ModelviewMatrixStack.Top->m; - GLfloat plane[4]; - - /* Use this to store calculated eye z values: - */ - input = &store->fogcoord; - - plane[0] = m[2]; - plane[1] = m[6]; - plane[2] = m[10]; - plane[3] = m[14]; - /* Full eye coords weren't required, just calculate the - * eye Z values. - */ - _mesa_dotprod_tab[VB->ObjPtr->size]( (GLfloat *) input->data, - 4 * sizeof(GLfloat), - VB->ObjPtr, plane ); - - input->count = VB->ObjPtr->count; - - /* make sure coords are really positive - NOTE should avoid going through array twice */ - coord = input->start; - for (i = 0; i < input->count; i++) { - *coord = FABSF(*coord); - STRIDE_F(coord, input->stride); - } - } - else { - /* fog coordinates = eye Z coordinates - need to copy for ABS */ - input = &store->fogcoord; - - if (VB->EyePtr->size < 2) - _mesa_vector4f_clean_elem( VB->EyePtr, VB->Count, 2 ); - - input->stride = 4 * sizeof(GLfloat); - input->count = VB->EyePtr->count; - coord = VB->EyePtr->start; - for (i = 0 ; i < VB->EyePtr->count; i++) { - input->data[i][0] = FABSF(coord[2]); - STRIDE_F(coord, VB->EyePtr->stride); - } - } - } - else { - /* use glFogCoord() coordinates */ - input = VB->AttribPtr[_TNL_ATTRIB_FOG]; /* source data */ - - /* input->count may be one if glFogCoord was only called once - * before glBegin. But we need to compute fog for all vertices. - */ - input->count = VB->ObjPtr->count; - - VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; /* dest data */ - } - - if (tnl->_DoVertexFog) { - /* compute blend factors from fog coordinates */ - compute_fog_blend_factors( ctx, VB->AttribPtr[_TNL_ATTRIB_FOG], input ); - } - else { - /* results = incoming fog coords (compute fog per-fragment later) */ - VB->AttribPtr[_TNL_ATTRIB_FOG] = input; - } - - VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; - return GL_TRUE; -} - - - -/* Called the first time stage->run() is invoked. - */ -static GLboolean -alloc_fog_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct fog_stage_data *store; - stage->privatePtr = MALLOC(sizeof(*store)); - store = FOG_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - _mesa_vector4f_alloc( &store->fogcoord, 0, tnl->vb.Size, 32 ); - - if (!inited) - init_static_data(); - - return GL_TRUE; -} - - -static void -free_fog_data(struct tnl_pipeline_stage *stage) -{ - struct fog_stage_data *store = FOG_STAGE_DATA(stage); - if (store) { - _mesa_vector4f_free( &store->fogcoord ); - FREE( store ); - stage->privatePtr = NULL; - } -} - - -const struct tnl_pipeline_stage _tnl_fog_coordinate_stage = -{ - "build fog coordinates", /* name */ - NULL, /* private_data */ - alloc_fog_data, /* dtr */ - free_fog_data, /* dtr */ - NULL, /* check */ - run_fog_stage /* run -- initially set to init. */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_light.c b/src/libs/mesa/mesa/tnl/t_vb_light.c deleted file mode 100644 index f47f99397c..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_light.c +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/light.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/simple_list.h" -#include "main/mtypes.h" - -#include "math/m_translate.h" - -#include "t_context.h" -#include "t_pipeline.h" - -#define LIGHT_TWOSIDE 0x1 -#define LIGHT_MATERIAL 0x2 -#define MAX_LIGHT_FUNC 0x4 - -typedef void (*light_func)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ); - -/** - * Information for updating current material attributes from vertex color, - * for GL_COLOR_MATERIAL. - */ -struct material_cursor { - const GLfloat *ptr; /* points to src vertex color (in VB array) */ - GLuint stride; /* stride to next vertex color (bytes) */ - GLfloat *current; /* points to material attribute to update */ - GLuint size; /* vertex/color size: 1, 2, 3 or 4 */ -}; - -/** - * Data private to this pipeline stage. - */ -struct light_stage_data { - GLvector4f Input; - GLvector4f LitColor[2]; - GLvector4f LitSecondary[2]; - GLvector4f LitIndex[2]; - light_func *light_func_tab; - - struct material_cursor mat[MAT_ATTRIB_MAX]; - GLuint mat_count; - GLuint mat_bitmask; -}; - - -#define LIGHT_STAGE_DATA(stage) ((struct light_stage_data *)(stage->privatePtr)) - - - -/** - * In the case of colormaterial, the effected material attributes - * should already have been bound to point to the incoming color data, - * prior to running the pipeline. - * This function copies the vertex's color to the material attributes - * which are tracking glColor. - * It's called per-vertex in the lighting loop. - */ -static void -update_materials(GLcontext *ctx, struct light_stage_data *store) -{ - GLuint i; - - for (i = 0 ; i < store->mat_count ; i++) { - /* update the material */ - COPY_CLEAN_4V(store->mat[i].current, store->mat[i].size, store->mat[i].ptr); - /* increment src vertex color pointer */ - STRIDE_F(store->mat[i].ptr, store->mat[i].stride); - } - - /* recompute derived light/material values */ - _mesa_update_material( ctx, store->mat_bitmask ); - /* XXX we should only call this if we're tracking/changing the specular - * exponent. - */ - _mesa_validate_all_lighting_tables( ctx ); -} - - -/** - * Prepare things prior to running the lighting stage. - * Return number of material attributes which will track vertex color. - */ -static GLuint -prepare_materials(GLcontext *ctx, - struct vertex_buffer *VB, struct light_stage_data *store) -{ - GLuint i; - - store->mat_count = 0; - store->mat_bitmask = 0; - - /* Examine the ColorMaterialBitmask to determine which materials - * track vertex color. Override the material attribute's pointer - * with the color pointer for each one. - */ - if (ctx->Light.ColorMaterialEnabled) { - const GLuint bitmask = ctx->Light.ColorMaterialBitmask; - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) - if (bitmask & (1<AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->ColorPtr[0]; - } - - /* Now, for each material attribute that's tracking vertex color, save - * some values (ptr, stride, size, current) that we'll need in - * update_materials(), above, that'll actually copy the vertex color to - * the material attribute(s). - */ - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - if (VB->AttribPtr[i]->stride) { - const GLuint j = store->mat_count++; - const GLuint attr = i - _TNL_ATTRIB_MAT_FRONT_AMBIENT; - store->mat[j].ptr = VB->AttribPtr[i]->start; - store->mat[j].stride = VB->AttribPtr[i]->stride; - store->mat[j].size = VB->AttribPtr[i]->size; - store->mat[j].current = ctx->Light.Material.Attrib[attr]; - store->mat_bitmask |= (1<mat_count; -} - -/* Tables for all the shading functions. - */ -static light_func _tnl_light_tab[MAX_LIGHT_FUNC]; -static light_func _tnl_light_fast_tab[MAX_LIGHT_FUNC]; -static light_func _tnl_light_fast_single_tab[MAX_LIGHT_FUNC]; -static light_func _tnl_light_spec_tab[MAX_LIGHT_FUNC]; -static light_func _tnl_light_ci_tab[MAX_LIGHT_FUNC]; - -#define TAG(x) x -#define IDX (0) -#include "t_vb_lighttmp.h" - -#define TAG(x) x##_twoside -#define IDX (LIGHT_TWOSIDE) -#include "t_vb_lighttmp.h" - -#define TAG(x) x##_material -#define IDX (LIGHT_MATERIAL) -#include "t_vb_lighttmp.h" - -#define TAG(x) x##_twoside_material -#define IDX (LIGHT_TWOSIDE|LIGHT_MATERIAL) -#include "t_vb_lighttmp.h" - - -static void init_lighting_tables( void ) -{ - static int done; - - if (!done) { - init_light_tab(); - init_light_tab_twoside(); - init_light_tab_material(); - init_light_tab_twoside_material(); - done = 1; - } -} - - -static GLboolean run_lighting( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr; - GLuint idx; - - if (!ctx->Light.Enabled || ctx->VertexProgram._Current) - return GL_TRUE; - - /* Make sure we can talk about position x,y and z: - */ - if (input->size <= 2 && input == VB->ObjPtr) { - - _math_trans_4f( store->Input.data, - VB->ObjPtr->data, - VB->ObjPtr->stride, - GL_FLOAT, - VB->ObjPtr->size, - 0, - VB->Count ); - - if (input->size <= 2) { - /* Clean z. - */ - _mesa_vector4f_clean_elem(&store->Input, VB->Count, 2); - } - - if (input->size <= 1) { - /* Clean y. - */ - _mesa_vector4f_clean_elem(&store->Input, VB->Count, 1); - } - - input = &store->Input; - } - - idx = 0; - - if (prepare_materials( ctx, VB, store )) - idx |= LIGHT_MATERIAL; - - if (ctx->Light.Model.TwoSide) - idx |= LIGHT_TWOSIDE; - - /* The individual functions know about replaying side-effects - * vs. full re-execution. - */ - store->light_func_tab[idx]( ctx, VB, stage, input ); - - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = VB->IndexPtr[0]; - - return GL_TRUE; -} - - -/* Called in place of do_lighting when the light table may have changed. - */ -static void validate_lighting( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - light_func *tab; - - if (!ctx->Light.Enabled || ctx->VertexProgram._Current) - return; - - if (ctx->Visual.rgbMode) { - if (ctx->Light._NeedVertices) { - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - tab = _tnl_light_spec_tab; - else - tab = _tnl_light_tab; - } - else { - if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) - tab = _tnl_light_fast_single_tab; - else - tab = _tnl_light_fast_tab; - } - } - else - tab = _tnl_light_ci_tab; - - - LIGHT_STAGE_DATA(stage)->light_func_tab = tab; - - /* This and the above should only be done on _NEW_LIGHT: - */ - TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx ); -} - - - -/* Called the first time stage->run is called. In effect, don't - * allocate data until the first time the stage is run. - */ -static GLboolean init_lighting( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct light_stage_data *store; - GLuint size = tnl->vb.Size; - - stage->privatePtr = MALLOC(sizeof(*store)); - store = LIGHT_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - /* Do onetime init. - */ - init_lighting_tables(); - - _mesa_vector4f_alloc( &store->Input, 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitColor[0], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitColor[1], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitSecondary[0], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitSecondary[1], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitIndex[0], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitIndex[1], 0, size, 32 ); - - store->LitColor[0].size = 4; - store->LitColor[1].size = 4; - store->LitSecondary[0].size = 3; - store->LitSecondary[1].size = 3; - - store->LitIndex[0].size = 1; - store->LitIndex[0].stride = sizeof(GLfloat); - store->LitIndex[1].size = 1; - store->LitIndex[1].stride = sizeof(GLfloat); - - return GL_TRUE; -} - - - - -static void dtr( struct tnl_pipeline_stage *stage ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - - if (store) { - _mesa_vector4f_free( &store->Input ); - _mesa_vector4f_free( &store->LitColor[0] ); - _mesa_vector4f_free( &store->LitColor[1] ); - _mesa_vector4f_free( &store->LitSecondary[0] ); - _mesa_vector4f_free( &store->LitSecondary[1] ); - _mesa_vector4f_free( &store->LitIndex[0] ); - _mesa_vector4f_free( &store->LitIndex[1] ); - FREE( store ); - stage->privatePtr = NULL; - } -} - -const struct tnl_pipeline_stage _tnl_lighting_stage = -{ - "lighting", /* name */ - NULL, /* private_data */ - init_lighting, - dtr, /* destroy */ - validate_lighting, - run_lighting -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_lighttmp.h b/src/libs/mesa/mesa/tnl/t_vb_lighttmp.h deleted file mode 100644 index a78f27761f..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_lighttmp.h +++ /dev/null @@ -1,824 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - * - * - * Authors: - * Brian Paul - * Keith Whitwell - */ - - -#if IDX & LIGHT_TWOSIDE -# define NR_SIDES 2 -#else -# define NR_SIDES 1 -#endif - - -/* define TRACE to trace lighting code */ -/* #define TRACE 1 */ - -/* - * ctx is the current context - * VB is the vertex buffer - * stage is the lighting stage-private data - * input is the vector of eye or object-space vertex coordinates - */ -static void TAG(light_rgba_spec)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - GLfloat (*base)[3] = ctx->Light._BaseColor; - GLfloat sumA[2]; - GLuint j; - - const GLuint vstride = input->stride; - const GLfloat *vertex = (GLfloat *)input->data; - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - - GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; - GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data; -#if IDX & LIGHT_TWOSIDE - GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; - GLfloat (*Bspec)[4] = (GLfloat (*)[4]) store->LitSecondary[1].data; -#endif - - const GLuint nr = VB->Count; - -#ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); -#endif - - VB->ColorPtr[0] = &store->LitColor[0]; - VB->SecondaryColorPtr[0] = &store->LitSecondary[0]; - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; - -#if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; - VB->SecondaryColorPtr[1] = &store->LitSecondary[1]; - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif - - - store->LitColor[0].stride = 16; - store->LitColor[1].stride = 16; - - for (j = 0; j < nr; j++,STRIDE_F(vertex,vstride),STRIDE_F(normal,nstride)) { - GLfloat sum[2][3], spec[2][3]; - struct gl_light *light; - -#if IDX & LIGHT_MATERIAL - update_materials( ctx, store ); - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; -#if IDX & LIGHT_TWOSIDE - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif -#endif - - COPY_3V(sum[0], base[0]); - ZERO_3V(spec[0]); - -#if IDX & LIGHT_TWOSIDE - COPY_3V(sum[1], base[1]); - ZERO_3V(spec[1]); -#endif - - /* Add contribution from each enabled light source */ - foreach (light, &ctx->Light.EnabledList) { - GLfloat n_dot_h; - GLfloat correction; - GLint side; - GLfloat contrib[3]; - GLfloat attenuation; - GLfloat VP[3]; /* unit vector from vertex to light */ - GLfloat n_dot_VP; /* n dot VP */ - GLfloat *h; - - /* compute VP and attenuation */ - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* directional light */ - COPY_3V(VP, light->_VP_inf_norm); - attenuation = light->_VP_inf_spot_attenuation; - } - else { - GLfloat d; /* distance from vertex to light */ - - SUB_3V(VP, light->_Position, vertex); - - d = (GLfloat) LEN_3FV( VP ); - - if (d > 1e-6) { - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - /* spotlight attenuation */ - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - - if (PV_dot_dir_CosCutoff) { - continue; /* this light makes no contribution */ - } - else { - GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); - GLint k = (GLint) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; /* this light makes no contribution */ - - /* Compute dot product or normal and vector from V to light pos */ - n_dot_VP = DOT3( normal, VP ); - - /* Which side gets the diffuse & specular terms? */ - if (n_dot_VP < 0.0F) { - ACC_SCALE_SCALAR_3V(sum[0], attenuation, light->_MatAmbient[0]); -#if IDX & LIGHT_TWOSIDE - side = 1; - correction = -1; - n_dot_VP = -n_dot_VP; -#else - continue; -#endif - } - else { -#if IDX & LIGHT_TWOSIDE - ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]); -#endif - side = 0; - correction = 1; - } - - /* diffuse term */ - COPY_3V(contrib, light->_MatAmbient[side]); - ACC_SCALE_SCALAR_3V(contrib, n_dot_VP, light->_MatDiffuse[side]); - ACC_SCALE_SCALAR_3V(sum[side], attenuation, contrib ); - - /* specular term - cannibalize VP... */ - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); /* h = VP + VPe */ - h = VP; - NORMALIZE_3FV(h); - } - else if (light->_Flags & LIGHT_POSITIONAL) { - h = VP; - ACC_3V(h, ctx->_EyeZDir); - NORMALIZE_3FV(h); - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = correction * DOT3(normal, h); - - if (n_dot_h > 0.0F) { - GLfloat spec_coef; - struct gl_shine_tab *tab = ctx->_ShineTable[side]; - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef ); - - if (spec_coef > 1.0e-10) { - spec_coef *= attenuation; - ACC_SCALE_SCALAR_3V( spec[side], spec_coef, - light->_MatSpecular[side]); - } - } - } /*loop over lights*/ - - COPY_3V( Fcolor[j], sum[0] ); - COPY_3V( Fspec[j], spec[0] ); - Fcolor[j][3] = sumA[0]; - -#if IDX & LIGHT_TWOSIDE - COPY_3V( Bcolor[j], sum[1] ); - COPY_3V( Bspec[j], spec[1] ); - Bcolor[j][3] = sumA[1]; -#endif - } -} - - -static void TAG(light_rgba)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - GLuint j; - - GLfloat (*base)[3] = ctx->Light._BaseColor; - GLfloat sumA[2]; - - const GLuint vstride = input->stride; - const GLfloat *vertex = (GLfloat *) input->data; - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - - GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; -#if IDX & LIGHT_TWOSIDE - GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; -#endif - - const GLuint nr = VB->Count; - -#ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); -#endif - - VB->ColorPtr[0] = &store->LitColor[0]; - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; - -#if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif - - store->LitColor[0].stride = 16; - store->LitColor[1].stride = 16; - - for (j = 0; j < nr; j++,STRIDE_F(vertex,vstride),STRIDE_F(normal,nstride)) { - GLfloat sum[2][3]; - struct gl_light *light; - -#if IDX & LIGHT_MATERIAL - update_materials( ctx, store ); - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; -#if IDX & LIGHT_TWOSIDE - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif -#endif - - COPY_3V(sum[0], base[0]); - -#if IDX & LIGHT_TWOSIDE - COPY_3V(sum[1], base[1]); -#endif - - /* Add contribution from each enabled light source */ - foreach (light, &ctx->Light.EnabledList) { - - GLfloat n_dot_h; - GLfloat correction; - GLint side; - GLfloat contrib[3]; - GLfloat attenuation = 1.0; - GLfloat VP[3]; /* unit vector from vertex to light */ - GLfloat n_dot_VP; /* n dot VP */ - GLfloat *h; - - /* compute VP and attenuation */ - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* directional light */ - COPY_3V(VP, light->_VP_inf_norm); - attenuation = light->_VP_inf_spot_attenuation; - } - else { - GLfloat d; /* distance from vertex to light */ - - - SUB_3V(VP, light->_Position, vertex); - - d = (GLfloat) LEN_3FV( VP ); - - if ( d > 1e-6) { - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - /* spotlight attenuation */ - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - - if (PV_dot_dir_CosCutoff) { - continue; /* this light makes no contribution */ - } - else { - GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); - GLint k = (GLint) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; /* this light makes no contribution */ - - /* Compute dot product or normal and vector from V to light pos */ - n_dot_VP = DOT3( normal, VP ); - - /* which side are we lighting? */ - if (n_dot_VP < 0.0F) { - ACC_SCALE_SCALAR_3V(sum[0], attenuation, light->_MatAmbient[0]); -#if IDX & LIGHT_TWOSIDE - side = 1; - correction = -1; - n_dot_VP = -n_dot_VP; -#else - continue; -#endif - } - else { -#if IDX & LIGHT_TWOSIDE - ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]); -#endif - side = 0; - correction = 1; - } - - COPY_3V(contrib, light->_MatAmbient[side]); - - /* diffuse term */ - ACC_SCALE_SCALAR_3V(contrib, n_dot_VP, light->_MatDiffuse[side]); - - /* specular term - cannibalize VP... */ - { - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); /* h = VP + VPe */ - h = VP; - NORMALIZE_3FV(h); - } - else if (light->_Flags & LIGHT_POSITIONAL) { - h = VP; - ACC_3V(h, ctx->_EyeZDir); - NORMALIZE_3FV(h); - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = correction * DOT3(normal, h); - - if (n_dot_h > 0.0F) - { - GLfloat spec_coef; - struct gl_shine_tab *tab = ctx->_ShineTable[side]; - - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef ); - - ACC_SCALE_SCALAR_3V( contrib, spec_coef, - light->_MatSpecular[side]); - } - } - - ACC_SCALE_SCALAR_3V( sum[side], attenuation, contrib ); - } - - COPY_3V( Fcolor[j], sum[0] ); - Fcolor[j][3] = sumA[0]; - -#if IDX & LIGHT_TWOSIDE - COPY_3V( Bcolor[j], sum[1] ); - Bcolor[j][3] = sumA[1]; -#endif - } -} - - - - -/* As below, but with just a single light. - */ -static void TAG(light_fast_rgba_single)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) - -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; -#if IDX & LIGHT_TWOSIDE - GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; -#endif - const struct gl_light *light = ctx->Light.EnabledList.next; - GLuint j = 0; - GLfloat base[2][4]; -#if IDX & LIGHT_MATERIAL - const GLuint nr = VB->Count; -#else - const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count; -#endif - -#ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); -#endif - - (void) input; /* doesn't refer to Eye or Obj */ - - VB->ColorPtr[0] = &store->LitColor[0]; -#if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; -#endif - - if (nr > 1) { - store->LitColor[0].stride = 16; - store->LitColor[1].stride = 16; - } - else { - store->LitColor[0].stride = 0; - store->LitColor[1].stride = 0; - } - - for (j = 0; j < nr; j++, STRIDE_F(normal,nstride)) { - - GLfloat n_dot_VP; - -#if IDX & LIGHT_MATERIAL - update_materials( ctx, store ); -#endif - - /* No attenuation, so incoporate _MatAmbient into base color. - */ -#if !(IDX & LIGHT_MATERIAL) - if ( j == 0 ) -#endif - { - COPY_3V(base[0], light->_MatAmbient[0]); - ACC_3V(base[0], ctx->Light._BaseColor[0] ); - base[0][3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; - -#if IDX & LIGHT_TWOSIDE - COPY_3V(base[1], light->_MatAmbient[1]); - ACC_3V(base[1], ctx->Light._BaseColor[1]); - base[1][3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif - } - - n_dot_VP = DOT3(normal, light->_VP_inf_norm); - - if (n_dot_VP < 0.0F) { -#if IDX & LIGHT_TWOSIDE - GLfloat n_dot_h = -DOT3(normal, light->_h_inf_norm); - GLfloat sum[3]; - COPY_3V(sum, base[1]); - ACC_SCALE_SCALAR_3V(sum, -n_dot_VP, light->_MatDiffuse[1]); - if (n_dot_h > 0.0F) { - GLfloat spec; - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]); - } - COPY_3V(Bcolor[j], sum ); - Bcolor[j][3] = base[1][3]; -#endif - COPY_4FV(Fcolor[j], base[0]); - } - else { - GLfloat n_dot_h = DOT3(normal, light->_h_inf_norm); - GLfloat sum[3]; - COPY_3V(sum, base[0]); - ACC_SCALE_SCALAR_3V(sum, n_dot_VP, light->_MatDiffuse[0]); - if (n_dot_h > 0.0F) { - GLfloat spec; - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[0]); - - } - COPY_3V(Fcolor[j], sum ); - Fcolor[j][3] = base[0][3]; -#if IDX & LIGHT_TWOSIDE - COPY_4FV(Bcolor[j], base[1]); -#endif - } - } -} - - -/* Light infinite lights - */ -static void TAG(light_fast_rgba)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - GLfloat sumA[2]; - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; -#if IDX & LIGHT_TWOSIDE - GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; -#endif - GLuint j = 0; -#if IDX & LIGHT_MATERIAL - const GLuint nr = VB->Count; -#else - const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count; -#endif - const struct gl_light *light; - -#ifdef TRACE - fprintf(stderr, "%s %d\n", __FUNCTION__, nr ); -#endif - - (void) input; - - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; - - VB->ColorPtr[0] = &store->LitColor[0]; -#if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; -#endif - - if (nr > 1) { - store->LitColor[0].stride = 16; - store->LitColor[1].stride = 16; - } - else { - store->LitColor[0].stride = 0; - store->LitColor[1].stride = 0; - } - - for (j = 0; j < nr; j++, STRIDE_F(normal,nstride)) { - - GLfloat sum[2][3]; - -#if IDX & LIGHT_MATERIAL - update_materials( ctx, store ); - - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; -#if IDX & LIGHT_TWOSIDE - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; -#endif -#endif - - - COPY_3V(sum[0], ctx->Light._BaseColor[0]); -#if IDX & LIGHT_TWOSIDE - COPY_3V(sum[1], ctx->Light._BaseColor[1]); -#endif - - foreach (light, &ctx->Light.EnabledList) { - GLfloat n_dot_h, n_dot_VP, spec; - - ACC_3V(sum[0], light->_MatAmbient[0]); -#if IDX & LIGHT_TWOSIDE - ACC_3V(sum[1], light->_MatAmbient[1]); -#endif - - n_dot_VP = DOT3(normal, light->_VP_inf_norm); - - if (n_dot_VP > 0.0F) { - ACC_SCALE_SCALAR_3V(sum[0], n_dot_VP, light->_MatDiffuse[0]); - n_dot_h = DOT3(normal, light->_h_inf_norm); - if (n_dot_h > 0.0F) { - struct gl_shine_tab *tab = ctx->_ShineTable[0]; - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum[0], spec, light->_MatSpecular[0]); - } - } -#if IDX & LIGHT_TWOSIDE - else { - ACC_SCALE_SCALAR_3V(sum[1], -n_dot_VP, light->_MatDiffuse[1]); - n_dot_h = -DOT3(normal, light->_h_inf_norm); - if (n_dot_h > 0.0F) { - struct gl_shine_tab *tab = ctx->_ShineTable[1]; - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum[1], spec, light->_MatSpecular[1]); - } - } -#endif - } - - COPY_3V( Fcolor[j], sum[0] ); - Fcolor[j][3] = sumA[0]; - -#if IDX & LIGHT_TWOSIDE - COPY_3V( Bcolor[j], sum[1] ); - Bcolor[j][3] = sumA[1]; -#endif - } -} - - - - - -/* - * Use current lighting/material settings to compute the color indexes - * for an array of vertices. - * Input: n - number of vertices to light - * side - 0=use front material, 1=use back material - * vertex - array of [n] vertex position in eye coordinates - * normal - array of [n] surface normal vector - * Output: indexResult - resulting array of [n] color indexes - */ -static void TAG(light_ci)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - GLuint j; - const GLuint vstride = input->stride; - const GLfloat *vertex = (GLfloat *) input->data; - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLfloat *indexResult[2]; - const GLuint nr = VB->Count; - -#ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); -#endif - - VB->IndexPtr[0] = &store->LitIndex[0]; -#if IDX & LIGHT_TWOSIDE - VB->IndexPtr[1] = &store->LitIndex[1]; -#endif - - indexResult[0] = (GLfloat *)VB->IndexPtr[0]->data; -#if IDX & LIGHT_TWOSIDE - indexResult[1] = (GLfloat *)VB->IndexPtr[1]->data; -#endif - - /* loop over vertices */ - for (j=0; jLight.EnabledList) { - - GLfloat attenuation = 1.0F; - GLfloat VP[3]; /* unit vector from vertex to light */ - GLfloat n_dot_VP; /* dot product of l and n */ - GLfloat *h, n_dot_h, correction = 1.0; - - /* compute l and attenuation */ - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* directional light */ - COPY_3V(VP, light->_VP_inf_norm); - } - else { - GLfloat d; /* distance from vertex to light */ - - SUB_3V(VP, light->_Position, vertex); - - d = (GLfloat) LEN_3FV( VP ); - if ( d > 1e-6) { - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - /* spotlight attenuation */ - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - if (PV_dot_dir < light->_CosCutoff) { - continue; /* this light makes no contribution */ - } - else { - GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); - GLint k = (GLint) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; /* this light makes no contribution */ - - n_dot_VP = DOT3( normal, VP ); - - /* which side are we lighting? */ - if (n_dot_VP < 0.0F) { -#if IDX & LIGHT_TWOSIDE - side = 1; - correction = -1; - n_dot_VP = -n_dot_VP; -#else - continue; -#endif - } - - /* accumulate diffuse term */ - diffuse[side] += n_dot_VP * light->_dli * attenuation; - - /* specular term */ - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); /* h = VP + VPe */ - h = VP; - NORMALIZE_3FV(h); - } - else if (light->_Flags & LIGHT_POSITIONAL) { - h = VP; - /* Strangely, disabling this addition fixes a conformance - * problem. If this code is enabled, l_sed.c fails. - */ - /*ACC_3V(h, ctx->_EyeZDir);*/ - NORMALIZE_3FV(h); - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = correction * DOT3(normal, h); - if (n_dot_h > 0.0F) { - GLfloat spec_coef; - struct gl_shine_tab *tab = ctx->_ShineTable[side]; - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef); - specular[side] += spec_coef * light->_sli * attenuation; - } - } /*loop over lights*/ - - /* Now compute final color index */ - for (side = 0 ; side < NR_SIDES ; side++) { - const GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES + side]; - GLfloat index; - - if (specular[side] > 1.0F) { - index = ind[MAT_INDEX_SPECULAR]; - } - else { - GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; - GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; - index = (ind[MAT_INDEX_AMBIENT] - + diffuse[side] * (1.0F-specular[side]) * d_a - + specular[side] * s_a); - if (index > ind[MAT_INDEX_SPECULAR]) { - index = ind[MAT_INDEX_SPECULAR]; - } - } - indexResult[side][j] = index; - } - } /*for vertex*/ -} - - - -static void TAG(init_light_tab)( void ) -{ - _tnl_light_tab[IDX] = TAG(light_rgba); - _tnl_light_fast_tab[IDX] = TAG(light_fast_rgba); - _tnl_light_fast_single_tab[IDX] = TAG(light_fast_rgba_single); - _tnl_light_spec_tab[IDX] = TAG(light_rgba_spec); - _tnl_light_ci_tab[IDX] = TAG(light_ci); -} - - -#undef TAG -#undef IDX -#undef NR_SIDES diff --git a/src/libs/mesa/mesa/tnl/t_vb_normals.c b/src/libs/mesa/mesa/tnl/t_vb_normals.c deleted file mode 100644 index a4821cc1cc..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_normals.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - -struct normal_stage_data { - normal_func NormalTransform; - GLvector4f normal; -}; - -#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->privatePtr) - - -static GLboolean -run_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - struct normal_stage_data *store = NORMAL_STAGE_DATA(stage); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - const GLfloat *lengths; - - if (!store->NormalTransform) - return GL_TRUE; - - /* We can only use the display list's saved normal lengths if we've - * got a transformation matrix with uniform scaling. - */ - if (_math_matrix_is_general_scale(ctx->ModelviewMatrixStack.Top)) - lengths = NULL; - else - lengths = VB->NormalLengthPtr; - - store->NormalTransform( ctx->ModelviewMatrixStack.Top, - ctx->_ModelViewInvScale, - VB->AttribPtr[_TNL_ATTRIB_NORMAL], /* input normals */ - lengths, - &store->normal ); /* resulting normals */ - - if (VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count > 1) { - store->normal.stride = 4 * sizeof(GLfloat); - } - else { - store->normal.stride = 0; - } - - VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &store->normal; - VB->NormalPtr = &store->normal; - - VB->NormalLengthPtr = NULL; /* no longer valid */ - return GL_TRUE; -} - - -/** - * Examine current GL state and set the store->NormalTransform pointer - * to point to the appropriate normal transformation routine. - */ -static void -validate_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - struct normal_stage_data *store = NORMAL_STAGE_DATA(stage); - - if (ctx->VertexProgram._Current || - (!ctx->Light.Enabled && - !(ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS))) { - store->NormalTransform = NULL; - return; - } - - if (ctx->_NeedEyeCoords) { - /* Eye coordinates are needed, for whatever reasons. - * Do lighting in eye coordinates, as the GL spec says. - */ - GLuint transform = NORM_TRANSFORM_NO_ROT; - - if (_math_matrix_has_rotation(ctx->ModelviewMatrixStack.Top)) { - /* need to do full (3x3) matrix transform */ - transform = NORM_TRANSFORM; - } - - if (ctx->Transform.Normalize) { - store->NormalTransform = _mesa_normal_tab[transform | NORM_NORMALIZE]; - } - else if (ctx->Transform.RescaleNormals && - ctx->_ModelViewInvScale != 1.0) { - store->NormalTransform = _mesa_normal_tab[transform | NORM_RESCALE]; - } - else { - store->NormalTransform = _mesa_normal_tab[transform]; - } - } - else { - /* We don't need eye coordinates. - * Do lighting in object coordinates. Thus, we don't need to fully - * transform normal vectors (just leave them in object coordinates) - * but we still need to do normalization/rescaling if enabled. - */ - if (ctx->Transform.Normalize) { - store->NormalTransform = _mesa_normal_tab[NORM_NORMALIZE]; - } - else if (!ctx->Transform.RescaleNormals && - ctx->_ModelViewInvScale != 1.0) { - store->NormalTransform = _mesa_normal_tab[NORM_RESCALE]; - } - else { - store->NormalTransform = NULL; - } - } -} - - -/** - * Allocate stage's private data (storage for transformed normals). - */ -static GLboolean -alloc_normal_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct normal_stage_data *store; - - stage->privatePtr = _mesa_malloc(sizeof(*store)); - store = NORMAL_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - _mesa_vector4f_alloc( &store->normal, 0, tnl->vb.Size, 32 ); - return GL_TRUE; -} - - -/** - * Free stage's private data. - */ -static void -free_normal_data(struct tnl_pipeline_stage *stage) -{ - struct normal_stage_data *store = NORMAL_STAGE_DATA(stage); - if (store) { - _mesa_vector4f_free( &store->normal ); - _mesa_free( store ); - stage->privatePtr = NULL; - } -} - - -const struct tnl_pipeline_stage _tnl_normal_transform_stage = -{ - "normal transform", /* name */ - NULL, /* privatePtr */ - alloc_normal_data, /* create */ - free_normal_data, /* destroy */ - validate_normal_stage, /* validate */ - run_normal_stage /* run */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_points.c b/src/libs/mesa/mesa/tnl/t_vb_points.c deleted file mode 100644 index 01d055c1dd..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_points.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Brian Paul - */ - -#include "main/mtypes.h" -#include "main/imports.h" -#include "t_context.h" -#include "t_pipeline.h" - - -struct point_stage_data { - GLvector4f PointSize; -}; - -#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->privatePtr) - - -/** - * Compute point size for each vertex from the vertex eye-space Z - * coordinate and the point size attenuation factors. - * Only done when point size attenuation is enabled and vertex program is - * disabled. - */ -static GLboolean -run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - if (ctx->Point._Attenuated && !ctx->VertexProgram._Current) { - struct point_stage_data *store = POINT_STAGE_DATA(stage); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - const GLfloat *eyeCoord = (GLfloat *) VB->EyePtr->data + 2; - const GLint eyeCoordStride = VB->EyePtr->stride / sizeof(GLfloat); - const GLfloat p0 = ctx->Point.Params[0]; - const GLfloat p1 = ctx->Point.Params[1]; - const GLfloat p2 = ctx->Point.Params[2]; - const GLfloat pointSize = ctx->Point.Size; - GLfloat (*size)[4] = store->PointSize.data; - GLuint i; - - for (i = 0; i < VB->Count; i++) { - const GLfloat dist = FABSF(*eyeCoord); - const GLfloat q = p0 + dist * (p1 + dist * p2); - const GLfloat atten = (q != 0.0) ? SQRTF(1.0 / q) : 1.0; - size[i][0] = pointSize * atten; /* clamping done in rasterization */ - eyeCoord += eyeCoordStride; - } - - VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize; - } - - return GL_TRUE; -} - - -static GLboolean -alloc_point_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct point_stage_data *store; - stage->privatePtr = _mesa_malloc(sizeof(*store)); - store = POINT_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - _mesa_vector4f_alloc( &store->PointSize, 0, VB->Size, 32 ); - return GL_TRUE; -} - - -static void -free_point_data(struct tnl_pipeline_stage *stage) -{ - struct point_stage_data *store = POINT_STAGE_DATA(stage); - if (store) { - _mesa_vector4f_free( &store->PointSize ); - _mesa_free( store ); - stage->privatePtr = NULL; - } -} - - -const struct tnl_pipeline_stage _tnl_point_attenuation_stage = -{ - "point size attenuation", /* name */ - NULL, /* stage private data */ - alloc_point_data, /* alloc data */ - free_point_data, /* destructor */ - NULL, - run_point_stage /* run */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_program.c b/src/libs/mesa/mesa/tnl/t_vb_program.c deleted file mode 100644 index f99401ca6d..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_program.c +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -/** - * \file tnl/t_vb_program.c - * \brief Pipeline stage for executing vertex programs. - * \author Brian Paul, Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "shader/prog_instruction.h" -#include "shader/prog_statevars.h" -#include "shader/prog_execute.h" -#include "swrast/s_context.h" -#include "swrast/s_texfilter.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - - - -/*! - * Private storage for the vertex program pipeline stage. - */ -struct vp_stage_data { - /** The results of running the vertex program go into these arrays. */ - GLvector4f results[VERT_RESULT_MAX]; - - GLvector4f ndcCoords; /**< normalized device coords */ - GLubyte *clipmask; /**< clip flags */ - GLubyte ormask, andmask; /**< for clipping */ -}; - - -#define VP_STAGE_DATA(stage) ((struct vp_stage_data *)(stage->privatePtr)) - - -static void -userclip( GLcontext *ctx, - GLvector4f *clip, - GLubyte *clipmask, - GLubyte *clipormask, - GLubyte *clipandmask ) -{ - GLuint p; - - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - GLuint nr, i; - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - GLfloat *coord = (GLfloat *)clip->data; - GLuint stride = clip->stride; - GLuint count = clip->count; - - for (nr = 0, i = 0 ; i < count ; i++) { - GLfloat dp = (coord[0] * a + - coord[1] * b + - coord[2] * c + - coord[3] * d); - - if (dp < 0) { - nr++; - clipmask[i] |= CLIP_USER_BIT; - } - - STRIDE_F(coord, stride); - } - - if (nr > 0) { - *clipormask |= CLIP_USER_BIT; - if (nr == count) { - *clipandmask |= CLIP_USER_BIT; - return; - } - } - } - } -} - - -static GLboolean -do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - /* Cliptest and perspective divide. Clip functions must clear - * the clipmask. - */ - store->ormask = 0; - store->andmask = CLIP_FRUSTUM_BITS; - - if (tnl->NeedNdcCoords) { - VB->NdcPtr = - _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr, - &store->ndcCoords, - store->clipmask, - &store->ormask, - &store->andmask ); - } - else { - VB->NdcPtr = NULL; - _mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr, - NULL, - store->clipmask, - &store->ormask, - &store->andmask ); - } - - if (store->andmask) { - /* All vertices are outside the frustum */ - return GL_FALSE; - } - - /* Test userclip planes. This contributes to VB->ClipMask. - */ - /** XXX NEW_SLANG _Enabled ??? */ - if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled || - ctx->VertexProgram.Current->IsPositionInvariant)) { - userclip( ctx, - VB->ClipPtr, - store->clipmask, - &store->ormask, - &store->andmask ); - - if (store->andmask) { - return GL_FALSE; - } - } - - VB->ClipAndMask = store->andmask; - VB->ClipOrMask = store->ormask; - VB->ClipMask = store->clipmask; - - return GL_TRUE; -} - - -/** - * XXX the texture sampling code in this module is a bit of a hack. - * The texture sampling code is in swrast, though it doesn't have any - * real dependencies on the rest of swrast. It should probably be - * moved into main/ someday. - */ -static void -vp_fetch_texel(GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, - GLuint unit, GLfloat color[4]) -{ - GLchan rgba[4]; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, - 1, (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); -} - - -/** - * Called via ctx->Driver.ProgramStringNotify() after a new vertex program - * string has been parsed. - */ -void -_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program) -{ - /* No-op. - * If we had derived anything from the program that was private to this - * stage we'd recompute/validate it here. - */ -} - - -/** - * Initialize virtual machine state prior to executing vertex program. - */ -static void -init_machine(GLcontext *ctx, struct gl_program_machine *machine) -{ - /* Input registers get initialized from the current vertex attribs */ - MEMCPY(machine->VertAttribs, ctx->Current.Attrib, - MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat)); - - if (ctx->VertexProgram._Current->IsNVProgram) { - GLuint i; - /* Output/result regs are initialized to [0,0,0,1] */ - for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) { - ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F); - } - /* Temp regs are initialized to [0,0,0,0] */ - for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) { - ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F); - } - for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) { - ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0); - } - } - - machine->NumDeriv = 0; - - /* init condition codes */ - machine->CondCodes[0] = COND_EQ; - machine->CondCodes[1] = COND_EQ; - machine->CondCodes[2] = COND_EQ; - machine->CondCodes[3] = COND_EQ; - - /* init call stack */ - machine->StackDepth = 0; - - machine->FetchTexelLod = vp_fetch_texel; - machine->FetchTexelDeriv = NULL; /* not used by vertex programs */ - - machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits; -} - - -/** - * Map the texture images which the vertex program will access (if any). - */ -static void -map_textures(GLcontext *ctx, const struct gl_vertex_program *vp) -{ - GLuint u; - - if (!ctx->Driver.MapTexture) - return; - - for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { - if (vp->Base.TexturesUsed[u]) { - /* Note: _Current *should* correspond to the target indicated - * in TexturesUsed[u]. - */ - ctx->Driver.MapTexture(ctx, ctx->Texture.Unit[u]._Current); - } - } -} - - -/** - * Unmap the texture images which were used by the vertex program (if any). - */ -static void -unmap_textures(GLcontext *ctx, const struct gl_vertex_program *vp) -{ - GLuint u; - - if (!ctx->Driver.MapTexture) - return; - - for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { - if (vp->Base.TexturesUsed[u]) { - /* Note: _Current *should* correspond to the target indicated - * in TexturesUsed[u]. - */ - ctx->Driver.UnmapTexture(ctx, ctx->Texture.Unit[u]._Current); - } - } -} - - -/** - * This function executes vertex programs - */ -static GLboolean -run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vp_stage_data *store = VP_STAGE_DATA(stage); - struct vertex_buffer *VB = &tnl->vb; - struct gl_vertex_program *program = ctx->VertexProgram._Current; - struct gl_program_machine machine; - GLuint outputs[VERT_RESULT_MAX], numOutputs; - GLuint i, j; - - if (!program) - return GL_TRUE; - - if (program->IsNVProgram) { - _mesa_load_tracked_matrices(ctx); - } - else { - /* ARB program or vertex shader */ - _mesa_load_state_parameters(ctx, program->Base.Parameters); - } - - /* make list of outputs to save some time below */ - numOutputs = 0; - for (i = 0; i < VERT_RESULT_MAX; i++) { - if (program->Base.OutputsWritten & (1 << i)) { - outputs[numOutputs++] = i; - } - } - - map_textures(ctx, program); - - for (i = 0; i < VB->Count; i++) { - GLuint attr; - - init_machine(ctx, &machine); - -#if 0 - printf("Input %d: %f, %f, %f, %f\n", i, - VB->AttribPtr[0]->data[i][0], - VB->AttribPtr[0]->data[i][1], - VB->AttribPtr[0]->data[i][2], - VB->AttribPtr[0]->data[i][3]); - printf(" color: %f, %f, %f, %f\n", - VB->AttribPtr[3]->data[i][0], - VB->AttribPtr[3]->data[i][1], - VB->AttribPtr[3]->data[i][2], - VB->AttribPtr[3]->data[i][3]); - printf(" normal: %f, %f, %f, %f\n", - VB->AttribPtr[2]->data[i][0], - VB->AttribPtr[2]->data[i][1], - VB->AttribPtr[2]->data[i][2], - VB->AttribPtr[2]->data[i][3]); -#endif - - /* the vertex array case */ - for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if (program->Base.InputsRead & (1 << attr)) { - const GLubyte *ptr = (const GLubyte*) VB->AttribPtr[attr]->data; - const GLuint size = VB->AttribPtr[attr]->size; - const GLuint stride = VB->AttribPtr[attr]->stride; - const GLfloat *data = (GLfloat *) (ptr + stride * i); - COPY_CLEAN_4V(machine.VertAttribs[attr], size, data); - } - } - - /* execute the program */ - _mesa_execute_program(ctx, &program->Base, &machine); - - /* copy the output registers into the VB->attribs arrays */ - for (j = 0; j < numOutputs; j++) { - const GLuint attr = outputs[j]; - COPY_4V(store->results[attr].data[i], machine.Outputs[attr]); - } -#if 0 - printf("HPOS: %f %f %f %f\n", - machine.Outputs[0][0], - machine.Outputs[0][1], - machine.Outputs[0][2], - machine.Outputs[0][3]); -#endif - } - - unmap_textures(ctx, program); - - /* Fixup fog and point size results if needed */ - if (program->IsNVProgram) { - if (ctx->Fog.Enabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { - for (i = 0; i < VB->Count; i++) { - store->results[VERT_RESULT_FOGC].data[i][0] = 1.0; - } - } - - if (ctx->VertexProgram.PointSizeEnabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { - for (i = 0; i < VB->Count; i++) { - store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size; - } - } - } - - if (program->IsPositionInvariant) { - /* We need the exact same transform as in the fixed function path here - * to guarantee invariance, depending on compiler optimization flags - * results could be different otherwise. - */ - VB->ClipPtr = TransformRaw( &store->results[0], - &ctx->_ModelProjectMatrix, - VB->AttribPtr[0] ); - - /* Drivers expect this to be clean to element 4... - */ - switch (VB->ClipPtr->size) { - case 1: - /* impossible */ - case 2: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); - /* fall-through */ - case 3: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 ); - /* fall-through */ - case 4: - break; - } - } - else { - /* Setup the VB pointers so that the next pipeline stages get - * their data from the right place (the program output arrays). - */ - VB->ClipPtr = &store->results[VERT_RESULT_HPOS]; - VB->ClipPtr->size = 4; - VB->ClipPtr->count = VB->Count; - } - - VB->ColorPtr[0] = &store->results[VERT_RESULT_COL0]; - VB->ColorPtr[1] = &store->results[VERT_RESULT_BFC0]; - VB->SecondaryColorPtr[0] = &store->results[VERT_RESULT_COL1]; - VB->SecondaryColorPtr[1] = &store->results[VERT_RESULT_BFC1]; - VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC]; - - VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; - VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1]; - VB->AttribPtr[VERT_ATTRIB_FOG] = &store->results[VERT_RESULT_FOGC]; - VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->results[VERT_RESULT_PSIZ]; - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - VB->TexCoordPtr[i] = - VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] - = &store->results[VERT_RESULT_TEX0 + i]; - } - - for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (program->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { - /* Note: varying results get put into the generic attributes */ - VB->AttribPtr[VERT_ATTRIB_GENERIC0+i] - = &store->results[VERT_RESULT_VAR0 + i]; - } - } - - - /* Perform NDC and cliptest operations: - */ - return do_ndc_cliptest(ctx, store); -} - - -/** - * Called the first time stage->run is called. In effect, don't - * allocate data until the first time the stage is run. - */ -static GLboolean -init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &(tnl->vb); - struct vp_stage_data *store; - const GLuint size = VB->Size; - GLuint i; - - stage->privatePtr = MALLOC(sizeof(*store)); - store = VP_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - /* Allocate arrays of vertex output values */ - for (i = 0; i < VERT_RESULT_MAX; i++) { - _mesa_vector4f_alloc( &store->results[i], 0, size, 32 ); - store->results[i].size = 4; - } - - /* a few other misc allocations */ - _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 ); - store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); - - return GL_TRUE; -} - - -/** - * Destructor for this pipeline stage. - */ -static void -dtr(struct tnl_pipeline_stage *stage) -{ - struct vp_stage_data *store = VP_STAGE_DATA(stage); - - if (store) { - GLuint i; - - /* free the vertex program result arrays */ - for (i = 0; i < VERT_RESULT_MAX; i++) - _mesa_vector4f_free( &store->results[i] ); - - /* free misc arrays */ - _mesa_vector4f_free( &store->ndcCoords ); - ALIGN_FREE( store->clipmask ); - - FREE( store ); - stage->privatePtr = NULL; - } -} - - -static void -validate_vp_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - if (ctx->VertexProgram._Current) { - _swrast_update_texture_samplers(ctx); - } -} - - - -/** - * Public description of this pipeline stage. - */ -const struct tnl_pipeline_stage _tnl_vertex_program_stage = -{ - "vertex-program", - NULL, /* private_data */ - init_vp, /* create */ - dtr, /* destroy */ - validate_vp_stage, /* validate */ - run_vp /* run -- initially set to ctr */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_render.c b/src/libs/mesa/mesa/tnl/t_vb_render.c deleted file mode 100644 index c1bebc9942..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_render.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - * - * Authors: - * Keith Whitwell - */ - - -/* - * Render whole vertex buffers, including projection of vertices from - * clip space and clipping of primitives. - * - * This file makes calls to project vertices and to the point, line - * and triangle rasterizers via the function pointers: - * - * context->Driver.Render.* - * - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "t_pipeline.h" - - - -/**********************************************************************/ -/* Clip single primitives */ -/**********************************************************************/ - - -#define W(i) coord[i][3] -#define Z(i) coord[i][2] -#define Y(i) coord[i][1] -#define X(i) coord[i][0] -#define SIZE 4 -#define TAG(x) x##_4 -#include "t_vb_cliptmp.h" - - - -/**********************************************************************/ -/* Clip and render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* This does NOT include the CLIP_USER_BIT! */ -#define CLIPMASK (CLIP_FRUSTUM_BITS | CLIP_CULL_BIT) - - -/* Vertices, with the possibility of clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte ormask = c1|c2; \ - if (!ormask) \ - LineFunc( ctx, v1, v2 ); \ - else if (!(c1 & c2 & CLIPMASK)) \ - clip_line_4( ctx, v1, v2, ormask ); \ -} while (0) - -#define RENDER_TRI( v1, v2, v3 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \ - GLubyte ormask = c1|c2|c3; \ - if (!ormask) \ - TriangleFunc( ctx, v1, v2, v3 ); \ - else if (!(c1 & c2 & c3 & CLIPMASK)) \ - clip_tri_4( ctx, v1, v2, v3, ormask ); \ -} while (0) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte c3 = mask[v3], c4 = mask[v4]; \ - GLubyte ormask = c1|c2|c3|c4; \ - if (!ormask) \ - QuadFunc( ctx, v1, v2, v3, v4 ); \ - else if (!(c1 & c2 & c3 & c4 & CLIPMASK)) \ - clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \ -} while (0) - - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const GLubyte *mask = VB->ClipMask; \ - const GLuint sz = VB->ClipPtr->size; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; (void) mask; (void) sz; (void) stipple; - -#define TAG(x) clip_##x##_verts -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx ) -#define PRESERVE_VB_DEFS -#include "t_vb_rendertmp.h" - - - -/* Elts, with the possibility of clipping. - */ -#undef ELT -#undef TAG -#define ELT(x) elt[x] -#define TAG(x) clip_##x##_elts -#include "t_vb_rendertmp.h" - -/* TODO: do this for all primitives, verts and elts: - */ -static void clip_elt_triangles( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES]; - struct vertex_buffer *VB = &tnl->vb; - const GLuint * const elt = VB->Elts; - GLubyte *mask = VB->ClipMask; - GLuint last = count-2; - GLuint j; - (void) flags; - - tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES ); - - for (j=start; j < last; j+=3 ) { - GLubyte c1 = mask[elt[j]]; - GLubyte c2 = mask[elt[j+1]]; - GLubyte c3 = mask[elt[j+2]]; - GLubyte ormask = c1|c2|c3; - if (ormask) { - if (start < j) - render_tris( ctx, start, j, 0 ); - if (!(c1&c2&c3&CLIPMASK)) - clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask ); - start = j+3; - } - } - - if (start < j) - render_tris( ctx, start, j, 0 ); -} - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, no clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ - LineFunc( ctx, v1, v2 ) - -#define RENDER_TRI( v1, v2, v3 ) \ - TriangleFunc( ctx, v1, v2, v3 ) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ - QuadFunc( ctx, v1, v2, v3, v4 ) - -#define TAG(x) _tnl_##x##_verts - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; (void) stipple - -#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx ) -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RENDER_TAB_QUALIFIER -#define PRESERVE_VB_DEFS -#include "t_vb_rendertmp.h" - - -/* Elts, no clipping. - */ -#undef ELT -#define TAG(x) _tnl_##x##_elts -#define ELT(x) elt[x] -#include "t_vb_rendertmp.h" - - -/**********************************************************************/ -/* Helper functions for drivers */ -/**********************************************************************/ - -void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint *tmp = VB->Elts; - - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; -} - -void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - - -/**********************************************************************/ -/* Clip and render whole vertex buffers */ -/**********************************************************************/ - - -static GLboolean run_render( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_render_func *tab; - GLint pass = 0; - - /* Allow the drivers to lock before projected verts are built so - * that window coordinates are guarenteed not to change before - * rendering. - */ - ASSERT(tnl->Driver.Render.Start); - - tnl->Driver.Render.Start( ctx ); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 ); - - if (VB->ClipOrMask) { - tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts; - clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; - } - else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : - tnl->Driver.Render.PrimTabVerts); - } - - do - { - GLuint i; - - for (i = 0 ; i < VB->PrimitiveCount ; i++) - { - GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); - GLuint start = VB->Primitive[i].start; - GLuint length = VB->Primitive[i].count; - - assert((prim & PRIM_MODE_MASK) <= GL_POLYGON); - - if (MESA_VERBOSE & VERBOSE_PRIMS) - _mesa_debug(NULL, "MESA prim %s %d..%d\n", - _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), - start, start+length); - - if (length) - tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - tnl->Driver.Render.Finish( ctx ); - - return GL_FALSE; /* finished the pipe */ -} - - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - - - - -const struct tnl_pipeline_stage _tnl_render_stage = -{ - "render", /* name */ - NULL, /* private data */ - NULL, /* creator */ - NULL, /* destructor */ - NULL, /* validate */ - run_render /* run */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_rendertmp.h b/src/libs/mesa/mesa/tnl/t_vb_rendertmp.h deleted file mode 100644 index 2b5f4e93b2..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_rendertmp.h +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - * - * Authors: - * Keith Whitwell - */ - - -#ifndef POSTFIX -#define POSTFIX -#endif - -#ifndef INIT -#define INIT(x) -#endif - -#ifndef NEED_EDGEFLAG_SETUP -#define NEED_EDGEFLAG_SETUP 0 -#define EDGEFLAG_GET(a) 0 -#define EDGEFLAG_SET(a,b) (void)b -#endif - -#ifndef RESET_STIPPLE -#define RESET_STIPPLE -#endif - -#ifndef TEST_PRIM_END -#define TEST_PRIM_END(prim) (flags & PRIM_END) -#define TEST_PRIM_BEGIN(prim) (flags & PRIM_BEGIN) -#endif - -#ifndef ELT -#define ELT(x) x -#endif - -#ifndef RENDER_TAB_QUALIFIER -#define RENDER_TAB_QUALIFIER static -#endif - -static void TAG(render_points)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - (void) flags; - - INIT(GL_POINTS); - RENDER_POINTS( start, count ); - POSTFIX; -} - -static void TAG(render_lines)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - GLuint j; - LOCAL_VARS; - (void) flags; - - INIT(GL_LINES); - for (j=start+1; j - */ - -/* - * Regarding GL_NV_texgen_reflection: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - -/*********************************************************************** - * Automatic texture coordinate generation (texgen) code. - */ - - -struct texgen_stage_data; - -typedef void (*texgen_func)( GLcontext *ctx, - struct texgen_stage_data *store, - GLuint unit); - - -struct texgen_stage_data { - - /* Per-texunit derived state. - */ - GLuint TexgenSize[MAX_TEXTURE_COORD_UNITS]; - texgen_func TexgenFunc[MAX_TEXTURE_COORD_UNITS]; - - /* Temporary values used in texgen. - */ - GLfloat (*tmp_f)[3]; - GLfloat *tmp_m; - - /* Buffered outputs of the stage. - */ - GLvector4f texcoord[MAX_TEXTURE_COORD_UNITS]; -}; - - -#define TEXGEN_STAGE_DATA(stage) ((struct texgen_stage_data *)stage->privatePtr) - - - -static GLuint all_bits[5] = { - 0, - VEC_SIZE_1, - VEC_SIZE_2, - VEC_SIZE_3, - VEC_SIZE_4, -}; - -#define VEC_SIZE_FLAGS (VEC_SIZE_1|VEC_SIZE_2|VEC_SIZE_3|VEC_SIZE_4) - -#define TEXGEN_NEED_M (TEXGEN_SPHERE_MAP) -#define TEXGEN_NEED_F (TEXGEN_SPHERE_MAP | \ - TEXGEN_REFLECTION_MAP_NV) - - - -static void build_m3( GLfloat f[][3], GLfloat m[], - const GLvector4f *normal, - const GLvector4f *eye ) -{ - GLuint stride = eye->stride; - GLfloat *coord = (GLfloat *)eye->start; - GLuint count = eye->count; - const GLfloat *norm = normal->start; - GLuint i; - - for (i=0;istride)) { - GLfloat u[3], two_nu, fx, fy, fz; - COPY_3V( u, coord ); - NORMALIZE_3FV( u ); - two_nu = 2.0F * DOT3(norm,u); - 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); - if (m[i] != 0.0F) { - m[i] = 0.5F * _mesa_inv_sqrtf(m[i]); - } - } -} - - - -static void build_m2( GLfloat f[][3], GLfloat m[], - const GLvector4f *normal, - const GLvector4f *eye ) -{ - GLuint stride = eye->stride; - GLfloat *coord = eye->start; - GLuint count = eye->count; - - GLfloat *norm = normal->start; - GLuint i; - - for (i=0;istride)) { - GLfloat u[3], two_nu, fx, fy, fz; - COPY_2V( u, coord ); - u[2] = 0; - NORMALIZE_3FV( u ); - two_nu = 2.0F * DOT3(norm,u); - 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); - if (m[i] != 0.0F) { - m[i] = 0.5F * _mesa_inv_sqrtf(m[i]); - } - } -} - - - -typedef void (*build_m_func)( GLfloat f[][3], - GLfloat m[], - const GLvector4f *normal, - const GLvector4f *eye ); - - -static build_m_func build_m_tab[5] = { - NULL, - NULL, - build_m2, - build_m3, - build_m3 -}; - - -/* This is unusual in that we respect the stride of the output vector - * (f). This allows us to pass in either a texcoord vector4f, or a - * temporary vector3f. - */ -static void build_f3( GLfloat *f, - GLuint fstride, - const GLvector4f *normal, - const GLvector4f *eye ) -{ - GLuint stride = eye->stride; - GLfloat *coord = eye->start; - GLuint count = eye->count; - - GLfloat *norm = normal->start; - GLuint i; - - for (i=0;istride); - } -} - - -static void build_f2( GLfloat *f, - GLuint fstride, - const GLvector4f *normal, - const GLvector4f *eye ) -{ - GLuint stride = eye->stride; - GLfloat *coord = eye->start; - GLuint count = eye->count; - GLfloat *norm = normal->start; - GLuint i; - - for (i=0;istride); - } -} - -typedef void (*build_f_func)( GLfloat *f, - GLuint fstride, - const GLvector4f *normal_vec, - const GLvector4f *eye ); - - - -/* Just treat 4-vectors as 3-vectors. - */ -static build_f_func build_f_tab[5] = { - NULL, - NULL, - build_f2, - build_f3, - build_f3 -}; - - - -/* Special case texgen functions. - */ -static void texgen_reflection_map_nv( GLcontext *ctx, - struct texgen_stage_data *store, - GLuint unit ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; - GLvector4f *out = &store->texcoord[unit]; - - build_f_tab[VB->EyePtr->size]( out->start, - out->stride, - VB->AttribPtr[_TNL_ATTRIB_NORMAL], - VB->EyePtr ); - - out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; - out->count = VB->Count; - out->size = MAX2(in->size, 3); - if (in->size == 4) - _mesa_copy_tab[0x8]( out, in ); -} - - - -static void texgen_normal_map_nv( GLcontext *ctx, - struct texgen_stage_data *store, - GLuint unit ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; - GLvector4f *out = &store->texcoord[unit]; - GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; - GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start; - GLuint count = VB->Count; - GLuint i; - const GLfloat *norm = normal->start; - - for (i=0;istride)) { - texcoord[i][0] = norm[0]; - texcoord[i][1] = norm[1]; - texcoord[i][2] = norm[2]; - } - - - out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; - out->count = count; - out->size = MAX2(in->size, 3); - if (in->size == 4) - _mesa_copy_tab[0x8]( out, in ); -} - - -static void texgen_sphere_map( GLcontext *ctx, - struct texgen_stage_data *store, - GLuint unit ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; - GLvector4f *out = &store->texcoord[unit]; - GLfloat (*texcoord)[4] = (GLfloat (*)[4]) out->start; - GLuint count = VB->Count; - GLuint i; - GLfloat (*f)[3] = store->tmp_f; - GLfloat *m = store->tmp_m; - - (build_m_tab[VB->EyePtr->size])( store->tmp_f, - store->tmp_m, - VB->AttribPtr[_TNL_ATTRIB_NORMAL], - VB->EyePtr ); - - out->size = MAX2(in->size,2); - - for (i=0;icount = count; - out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_2; - if (in->size > 2) - _mesa_copy_tab[all_bits[in->size] & ~0x3]( out, in ); -} - - - -static void texgen( GLcontext *ctx, - struct texgen_stage_data *store, - GLuint unit ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; - GLvector4f *out = &store->texcoord[unit]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const GLvector4f *obj = VB->ObjPtr; - const GLvector4f *eye = VB->EyePtr; - const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; - const GLfloat *m = store->tmp_m; - const GLuint count = VB->Count; - GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; - GLfloat (*f)[3] = store->tmp_f; - GLuint copy; - - if (texUnit->_GenFlags & TEXGEN_NEED_M) { - build_m_tab[eye->size]( store->tmp_f, store->tmp_m, normal, eye ); - } else if (texUnit->_GenFlags & TEXGEN_NEED_F) { - build_f_tab[eye->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); - } - - - out->size = MAX2(in->size, store->TexgenSize[unit]); - out->flags |= (in->flags & VEC_SIZE_FLAGS) | texUnit->TexGenEnabled; - out->count = count; - - copy = (all_bits[in->size] & ~texUnit->TexGenEnabled); - if (copy) - _mesa_copy_tab[copy]( out, in ); - - if (texUnit->TexGenEnabled & S_BIT) { - GLuint i; - switch (texUnit->GenModeS) { - case GL_OBJECT_LINEAR: - _mesa_dotprod_tab[obj->size]( (GLfloat *)out->data, - sizeof(out->data[0]), obj, - texUnit->ObjectPlaneS ); - break; - case GL_EYE_LINEAR: - _mesa_dotprod_tab[eye->size]( (GLfloat *)out->data, - sizeof(out->data[0]), eye, - texUnit->EyePlaneS ); - break; - case GL_SPHERE_MAP: - for (i = 0; i < count; i++) - texcoord[i][0] = f[i][0] * m[i] + 0.5F; - break; - case GL_REFLECTION_MAP_NV: - for (i=0;istart; - for (i=0;istride)) { - texcoord[i][0] = norm[0]; - } - break; - } - default: - _mesa_problem(ctx, "Bad S texgen"); - } - } - - if (texUnit->TexGenEnabled & T_BIT) { - GLuint i; - switch (texUnit->GenModeT) { - case GL_OBJECT_LINEAR: - _mesa_dotprod_tab[obj->size]( &(out->data[0][1]), - sizeof(out->data[0]), obj, - texUnit->ObjectPlaneT ); - break; - case GL_EYE_LINEAR: - _mesa_dotprod_tab[eye->size]( &(out->data[0][1]), - sizeof(out->data[0]), eye, - texUnit->EyePlaneT ); - break; - case GL_SPHERE_MAP: - for (i = 0; i < count; i++) - texcoord[i][1] = f[i][1] * m[i] + 0.5F; - break; - case GL_REFLECTION_MAP_NV: - for (i=0;istart; - for (i=0;istride)) { - texcoord[i][1] = norm[1]; - } - break; - } - default: - _mesa_problem(ctx, "Bad T texgen"); - } - } - - if (texUnit->TexGenEnabled & R_BIT) { - GLuint i; - switch (texUnit->GenModeR) { - case GL_OBJECT_LINEAR: - _mesa_dotprod_tab[obj->size]( &(out->data[0][2]), - sizeof(out->data[0]), obj, - texUnit->ObjectPlaneR ); - break; - case GL_EYE_LINEAR: - _mesa_dotprod_tab[eye->size]( &(out->data[0][2]), - sizeof(out->data[0]), eye, - texUnit->EyePlaneR ); - break; - case GL_REFLECTION_MAP_NV: - for (i=0;istart; - for (i=0;istride)) { - texcoord[i][2] = norm[2]; - } - break; - } - default: - _mesa_problem(ctx, "Bad R texgen"); - } - } - - if (texUnit->TexGenEnabled & Q_BIT) { - switch (texUnit->GenModeQ) { - case GL_OBJECT_LINEAR: - _mesa_dotprod_tab[obj->size]( &(out->data[0][3]), - sizeof(out->data[0]), obj, - texUnit->ObjectPlaneQ ); - break; - case GL_EYE_LINEAR: - _mesa_dotprod_tab[eye->size]( &(out->data[0][3]), - sizeof(out->data[0]), eye, - texUnit->EyePlaneQ ); - break; - default: - _mesa_problem(ctx, "Bad Q texgen"); - } - } -} - - - - -static GLboolean run_texgen_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); - GLuint i; - - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) - return GL_TRUE; - - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - - if (texUnit->TexGenEnabled) { - - store->TexgenFunc[i]( ctx, store, i ); - - VB->TexCoordPtr[i] = - VB->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->texcoord[i]; - } - } - - return GL_TRUE; -} - - -static void validate_texgen_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); - GLuint i; - - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) - return; - - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - - if (texUnit->TexGenEnabled) { - GLuint sz; - - if (texUnit->TexGenEnabled & Q_BIT) - sz = 4; - else if (texUnit->TexGenEnabled & R_BIT) - sz = 3; - else if (texUnit->TexGenEnabled & T_BIT) - sz = 2; - else - sz = 1; - - store->TexgenSize[i] = sz; - store->TexgenFunc[i] = texgen; /* general solution */ - - /* look for special texgen cases */ - if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) { - if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) { - store->TexgenFunc[i] = texgen_reflection_map_nv; - } - else if (texUnit->_GenFlags == TEXGEN_NORMAL_MAP_NV) { - store->TexgenFunc[i] = texgen_normal_map_nv; - } - } - else if (texUnit->TexGenEnabled == (S_BIT|T_BIT) && - texUnit->_GenFlags == TEXGEN_SPHERE_MAP) { - store->TexgenFunc[i] = texgen_sphere_map; - } - } - } -} - - - - - -/* Called the first time stage->run() is invoked. - */ -static GLboolean alloc_texgen_data( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct texgen_stage_data *store; - GLuint i; - - stage->privatePtr = CALLOC(sizeof(*store)); - store = TEXGEN_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) - _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 ); - - store->tmp_f = (GLfloat (*)[3]) MALLOC(VB->Size * sizeof(GLfloat) * 3); - store->tmp_m = (GLfloat *) MALLOC(VB->Size * sizeof(GLfloat)); - - return GL_TRUE; -} - - -static void free_texgen_data( struct tnl_pipeline_stage *stage ) - -{ - struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); - GLuint i; - - if (store) { - for (i = 0 ; i < MAX_TEXTURE_COORD_UNITS ; i++) - if (store->texcoord[i].data) - _mesa_vector4f_free( &store->texcoord[i] ); - - - if (store->tmp_f) FREE( store->tmp_f ); - if (store->tmp_m) FREE( store->tmp_m ); - FREE( store ); - stage->privatePtr = NULL; - } -} - - - -const struct tnl_pipeline_stage _tnl_texgen_stage = -{ - "texgen", /* name */ - NULL, /* private data */ - alloc_texgen_data, /* destructor */ - free_texgen_data, /* destructor */ - validate_texgen_stage, /* check */ - run_texgen_stage /* run -- initially set to alloc data */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_texmat.c b/src/libs/mesa/mesa/tnl/t_vb_texmat.c deleted file mode 100644 index 0abe8cc35d..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_texmat.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - -/* Is there any real benefit seperating texmat from texgen? It means - * we need two lots of intermediate storage. Any changes to - * _NEW_TEXTURE will invalidate both sets -- it's only on changes to - * *only* _NEW_TEXTURE_MATRIX that texgen survives but texmat doesn't. - * - * However, the seperation of this code from the complex texgen stuff - * is very appealing. - */ -struct texmat_stage_data { - GLvector4f texcoord[MAX_TEXTURE_COORD_UNITS]; -}; - -#define TEXMAT_STAGE_DATA(stage) ((struct texmat_stage_data *)stage->privatePtr) - - - -static GLboolean run_texmat_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct texmat_stage_data *store = TEXMAT_STAGE_DATA(stage); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLuint i; - - if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Current) - return GL_TRUE; - - /* ENABLE_TEXMAT implies that the texture matrix is not the - * identity, so we don't have to check that here. - */ - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { - if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) { - (void) TransformRaw( &store->texcoord[i], - ctx->TextureMatrixStack[i].Top, - VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]); - - VB->TexCoordPtr[i] = - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &store->texcoord[i]; - } - } - - return GL_TRUE; -} - - -/* Called the first time stage->run() is invoked. - */ -static GLboolean alloc_texmat_data( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct texmat_stage_data *store; - GLuint i; - - stage->privatePtr = CALLOC(sizeof(*store)); - store = TEXMAT_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) - _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 ); - - return GL_TRUE; -} - - -static void free_texmat_data( struct tnl_pipeline_stage *stage ) -{ - struct texmat_stage_data *store = TEXMAT_STAGE_DATA(stage); - GLuint i; - - if (store) { - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) - if (store->texcoord[i].data) - _mesa_vector4f_free( &store->texcoord[i] ); - FREE( store ); - stage->privatePtr = NULL; - } -} - - - -const struct tnl_pipeline_stage _tnl_texture_transform_stage = -{ - "texture transform", /* name */ - NULL, /* private data */ - alloc_texmat_data, - free_texmat_data, /* destructor */ - NULL, - run_texmat_stage, -}; diff --git a/src/libs/mesa/mesa/tnl/t_vb_vertex.c b/src/libs/mesa/mesa/tnl/t_vb_vertex.c deleted file mode 100644 index 30aa7c4086..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vb_vertex.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "math/m_xform.h" - -#include "t_context.h" -#include "t_pipeline.h" - - - -struct vertex_stage_data { - GLvector4f eye; - GLvector4f clip; - GLvector4f proj; - GLubyte *clipmask; - GLubyte ormask; - GLubyte andmask; -}; - -#define VERTEX_STAGE_DATA(stage) ((struct vertex_stage_data *)stage->privatePtr) - - - - -/* This function implements cliptesting for user-defined clip planes. - * The clipping of primitives to these planes is implemented in - * t_render_clip.h. - */ -#define USER_CLIPTEST(NAME, SZ) \ -static void NAME( GLcontext *ctx, \ - GLvector4f *clip, \ - GLubyte *clipmask, \ - GLubyte *clipormask, \ - GLubyte *clipandmask ) \ -{ \ - GLuint p; \ - \ - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) \ - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { \ - GLuint nr, i; \ - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; \ - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; \ - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; \ - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; \ - GLfloat *coord = (GLfloat *)clip->data; \ - GLuint stride = clip->stride; \ - GLuint count = clip->count; \ - \ - for (nr = 0, i = 0 ; i < count ; i++) { \ - GLfloat dp = coord[0] * a + coord[1] * b; \ - if (SZ > 2) dp += coord[2] * c; \ - if (SZ > 3) dp += coord[3] * d; else dp += d; \ - \ - if (dp < 0) { \ - nr++; \ - clipmask[i] |= CLIP_USER_BIT; \ - } \ - \ - STRIDE_F(coord, stride); \ - } \ - \ - if (nr > 0) { \ - *clipormask |= CLIP_USER_BIT; \ - if (nr == count) { \ - *clipandmask |= CLIP_USER_BIT; \ - return; \ - } \ - } \ - } \ -} - - -USER_CLIPTEST(userclip2, 2) -USER_CLIPTEST(userclip3, 3) -USER_CLIPTEST(userclip4, 4) - -static void (*(usercliptab[5]))( GLcontext *, - GLvector4f *, GLubyte *, - GLubyte *, GLubyte * ) = -{ - NULL, - NULL, - userclip2, - userclip3, - userclip4 -}; - - - -static GLboolean run_vertex_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct vertex_stage_data *store = (struct vertex_stage_data *)stage->privatePtr; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - - if (ctx->VertexProgram._Current) - return GL_TRUE; - - if (ctx->_NeedEyeCoords) { - /* Separate modelview transformation: - * Use combined ModelProject to avoid some depth artifacts - */ - if (ctx->ModelviewMatrixStack.Top->type == MATRIX_IDENTITY) - VB->EyePtr = VB->ObjPtr; - else - VB->EyePtr = TransformRaw( &store->eye, - ctx->ModelviewMatrixStack.Top, - VB->ObjPtr); - } - - VB->ClipPtr = TransformRaw( &store->clip, - &ctx->_ModelProjectMatrix, - VB->ObjPtr ); - - /* Drivers expect this to be clean to element 4... - */ - switch (VB->ClipPtr->size) { - case 1: - /* impossible */ - case 2: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); - /* fall-through */ - case 3: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 ); - /* fall-through */ - case 4: - break; - } - - - /* Cliptest and perspective divide. Clip functions must clear - * the clipmask. - */ - store->ormask = 0; - store->andmask = CLIP_FRUSTUM_BITS; - - if (tnl->NeedNdcCoords) { - VB->NdcPtr = - _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr, - &store->proj, - store->clipmask, - &store->ormask, - &store->andmask ); - } - else { - VB->NdcPtr = NULL; - _mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr, - NULL, - store->clipmask, - &store->ormask, - &store->andmask ); - } - - if (store->andmask) - return GL_FALSE; - - - /* Test userclip planes. This contributes to VB->ClipMask, so - * is essentially required to be in this stage. - */ - if (ctx->Transform.ClipPlanesEnabled) { - usercliptab[VB->ClipPtr->size]( ctx, - VB->ClipPtr, - store->clipmask, - &store->ormask, - &store->andmask ); - - if (store->andmask) - return GL_FALSE; - } - - VB->ClipAndMask = store->andmask; - VB->ClipOrMask = store->ormask; - VB->ClipMask = store->clipmask; - - return GL_TRUE; -} - - -static GLboolean init_vertex_stage( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct vertex_stage_data *store; - GLuint size = VB->Size; - - stage->privatePtr = CALLOC(sizeof(*store)); - store = VERTEX_STAGE_DATA(stage); - if (!store) - return GL_FALSE; - - _mesa_vector4f_alloc( &store->eye, 0, size, 32 ); - _mesa_vector4f_alloc( &store->clip, 0, size, 32 ); - _mesa_vector4f_alloc( &store->proj, 0, size, 32 ); - - store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); - - if (!store->clipmask || - !store->eye.data || - !store->clip.data || - !store->proj.data) - return GL_FALSE; - - return GL_TRUE; -} - -static void dtr( struct tnl_pipeline_stage *stage ) -{ - struct vertex_stage_data *store = VERTEX_STAGE_DATA(stage); - - if (store) { - _mesa_vector4f_free( &store->eye ); - _mesa_vector4f_free( &store->clip ); - _mesa_vector4f_free( &store->proj ); - ALIGN_FREE( store->clipmask ); - FREE(store); - stage->privatePtr = NULL; - stage->run = init_vertex_stage; - } -} - - -const struct tnl_pipeline_stage _tnl_vertex_transform_stage = -{ - "modelview/project/cliptest/divide", - NULL, /* private data */ - init_vertex_stage, - dtr, /* destructor */ - NULL, - run_vertex_stage /* run -- initially set to init */ -}; diff --git a/src/libs/mesa/mesa/tnl/t_vertex.c b/src/libs/mesa/mesa/tnl/t_vertex.c deleted file mode 100644 index 10b78f820e..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vertex.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Copyright 2003 Tungsten Graphics, inc. - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" - -#include "t_context.h" -#include "t_vertex.h" - -#define DBG 0 - -/* Build and manage clipspace/ndc/window vertices. - */ - -static GLboolean match_fastpath( struct tnl_clipspace *vtx, - const struct tnl_clipspace_fastpath *fp) -{ - GLuint j; - - if (vtx->attr_count != fp->attr_count) - return GL_FALSE; - - for (j = 0; j < vtx->attr_count; j++) - if (vtx->attr[j].format != fp->attr[j].format || - vtx->attr[j].inputsize != fp->attr[j].size || - vtx->attr[j].vertoffset != fp->attr[j].offset) - return GL_FALSE; - - if (fp->match_strides) { - if (vtx->vertex_size != fp->vertex_size) - return GL_FALSE; - - for (j = 0; j < vtx->attr_count; j++) - if (vtx->attr[j].inputstride != fp->attr[j].stride) - return GL_FALSE; - } - - return GL_TRUE; -} - -static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx ) -{ - struct tnl_clipspace_fastpath *fp = vtx->fastpath; - - for ( ; fp ; fp = fp->next) { - if (match_fastpath(vtx, fp)) { - vtx->emit = fp->func; - return GL_TRUE; - } - } - - return GL_FALSE; -} - -void _tnl_register_fastpath( struct tnl_clipspace *vtx, - GLboolean match_strides ) -{ - struct tnl_clipspace_fastpath *fastpath = CALLOC_STRUCT(tnl_clipspace_fastpath); - GLuint i; - - fastpath->vertex_size = vtx->vertex_size; - fastpath->attr_count = vtx->attr_count; - fastpath->match_strides = match_strides; - fastpath->func = vtx->emit; - fastpath->attr = (struct tnl_attr_type *) - _mesa_malloc(vtx->attr_count * sizeof(fastpath->attr[0])); - - for (i = 0; i < vtx->attr_count; i++) { - fastpath->attr[i].format = vtx->attr[i].format; - fastpath->attr[i].stride = vtx->attr[i].inputstride; - fastpath->attr[i].size = vtx->attr[i].inputsize; - fastpath->attr[i].offset = vtx->attr[i].vertoffset; - } - - fastpath->next = vtx->fastpath; - vtx->fastpath = fastpath; -} - - - -/*********************************************************************** - * Build codegen functions or return generic ones: - */ -static void choose_emit_func( GLcontext *ctx, GLuint count, GLubyte *dest) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - GLuint j; - - for (j = 0; j < attr_count; j++) { - GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; - a[j].inputstride = vptr->stride; - a[j].inputsize = vptr->size; - a[j].emit = a[j].insert[vptr->size - 1]; /* not always used */ - } - - vtx->emit = NULL; - - /* Does this match an existing (hardwired, codegen or known-bad) - * fastpath? - */ - if (search_fastpath_emit(vtx)) { - /* Use this result. If it is null, then it is already known - * that the current state will fail for codegen and there is no - * point trying again. - */ - } - else if (vtx->codegen_emit) { - vtx->codegen_emit(ctx); - } - - if (!vtx->emit) { - _tnl_generate_hardwired_emit(ctx); - } - - /* Otherwise use the generic version: - */ - if (!vtx->emit) - vtx->emit = _tnl_generic_emit; - - vtx->emit( ctx, count, dest ); -} - - - -static void choose_interp_func( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - - if (vtx->need_extras && - (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - vtx->interp = _tnl_generic_interp_extras; - } else { - vtx->interp = _tnl_generic_interp; - } - - vtx->interp( ctx, t, edst, eout, ein, force_boundary ); -} - - -static void choose_copy_pv_func( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - - if (vtx->need_extras && - (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - vtx->copy_pv = _tnl_generic_copy_pv_extras; - } else { - vtx->copy_pv = _tnl_generic_copy_pv; - } - - vtx->copy_pv( ctx, edst, esrc ); -} - - -/*********************************************************************** - * Public entrypoints, mostly dispatch to the above: - */ - - -/* Interpolate between two vertices to produce a third: - */ -void _tnl_interp( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - vtx->interp( ctx, t, edst, eout, ein, force_boundary ); -} - -/* Copy colors from one vertex to another: - */ -void _tnl_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - vtx->copy_pv( ctx, edst, esrc ); -} - - -/* Extract a named attribute from a hardware vertex. Will have to - * reverse any viewport transformation, swizzling or other conversions - * which may have been applied: - */ -void _tnl_get_attr( GLcontext *ctx, const void *vin, - GLenum attr, GLfloat *dest ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - const struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - GLuint j; - - for (j = 0; j < attr_count; j++) { - if (a[j].attrib == attr) { - a[j].extract( &a[j], dest, (GLubyte *)vin + a[j].vertoffset ); - return; - } - } - - /* Else return the value from ctx->Current. - */ - if (attr == _TNL_ATTRIB_POINTSIZE) { - /* If the hardware vertex doesn't have point size then use size from - * GLcontext. XXX this will be wrong if drawing attenuated points! - */ - dest[0] = ctx->Point.Size; - } - else { - _mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); - } -} - - -/* Complementary operation to the above. - */ -void _tnl_set_attr( GLcontext *ctx, void *vout, - GLenum attr, const GLfloat *src ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - const struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - GLuint j; - - for (j = 0; j < attr_count; j++) { - if (a[j].attrib == attr) { - a[j].insert[4-1]( &a[j], (GLubyte *)vout + a[j].vertoffset, src ); - return; - } - } -} - - -void *_tnl_get_vertex( GLcontext *ctx, GLuint nr ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - - return vtx->vertex_buf + nr * vtx->vertex_size; -} - -void _tnl_invalidate_vertex_state( GLcontext *ctx, GLuint new_state ) -{ - if (new_state & (_DD_NEW_TRI_LIGHT_TWOSIDE|_DD_NEW_TRI_UNFILLED) ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - vtx->new_inputs = ~0; - vtx->interp = choose_interp_func; - vtx->copy_pv = choose_copy_pv_func; - } -} - -static void invalidate_funcs( struct tnl_clipspace *vtx ) -{ - vtx->emit = choose_emit_func; - vtx->interp = choose_interp_func; - vtx->copy_pv = choose_copy_pv_func; - vtx->new_inputs = ~0; -} - -GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, - GLuint nr, const GLfloat *vp, - GLuint unpacked_size ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - GLuint offset = 0; - GLuint i, j; - - assert(nr < _TNL_ATTRIB_MAX); - assert(nr == 0 || map[0].attrib == VERT_ATTRIB_POS); - - vtx->new_inputs = ~0; - vtx->need_viewport = GL_FALSE; - - if (vp) { - vtx->need_viewport = GL_TRUE; - } - - for (j = 0, i = 0; i < nr; i++) { - const GLuint format = map[i].format; - if (format == EMIT_PAD) { - if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); - - offset += map[i].offset; - - } - else { - GLuint tmpoffset; - - if (unpacked_size) - tmpoffset = map[i].offset; - else - tmpoffset = offset; - - if (vtx->attr_count != j || - vtx->attr[j].attrib != map[i].attrib || - vtx->attr[j].format != format || - vtx->attr[j].vertoffset != tmpoffset) { - invalidate_funcs(vtx); - - vtx->attr[j].attrib = map[i].attrib; - vtx->attr[j].format = format; - vtx->attr[j].vp = vp; - vtx->attr[j].insert = _tnl_format_info[format].insert; - vtx->attr[j].extract = _tnl_format_info[format].extract; - vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize; - vtx->attr[j].vertoffset = tmpoffset; - } - - - if (DBG) - _mesa_printf("%d: %s, vp %p, offset %d\n", i, - _tnl_format_info[format].name, (void *)vp, - vtx->attr[j].vertoffset); - - offset += _tnl_format_info[format].attrsize; - j++; - } - } - - vtx->attr_count = j; - - if (unpacked_size) - vtx->vertex_size = unpacked_size; - else - vtx->vertex_size = offset; - - assert(vtx->vertex_size <= vtx->max_vertex_size); - return vtx->vertex_size; -} - - - -void _tnl_invalidate_vertices( GLcontext *ctx, GLuint newinputs ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - vtx->new_inputs |= newinputs; -} - - -/* This event has broader use beyond this file - will move elsewhere - * and probably invoke a driver callback. - */ -void _tnl_notify_pipeline_output_change( GLcontext *ctx ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - invalidate_funcs(vtx); -} - - -static void adjust_input_ptrs( GLcontext *ctx, GLint diff) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_attr *a = vtx->attr; - const GLuint count = vtx->attr_count; - int j; - - diff -= 1; - for (j=0; jAttribPtr[a->attrib]; - (a++)->inputptr += diff*vptr->stride; - } -} - -static void update_input_ptrs( GLcontext *ctx, GLuint start ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_attr *a = vtx->attr; - const GLuint count = vtx->attr_count; - GLuint j; - - for (j = 0; j < count; j++) { - GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; - - if (vtx->emit != choose_emit_func) { - assert(a[j].inputstride == vptr->stride); - assert(a[j].inputsize == vptr->size); - } - - a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride; - } - - if (a->vp) { - vtx->vp_scale[0] = a->vp[MAT_SX]; - vtx->vp_scale[1] = a->vp[MAT_SY]; - vtx->vp_scale[2] = a->vp[MAT_SZ]; - vtx->vp_scale[3] = 1.0; - vtx->vp_xlate[0] = a->vp[MAT_TX]; - vtx->vp_xlate[1] = a->vp[MAT_TY]; - vtx->vp_xlate[2] = a->vp[MAT_TZ]; - vtx->vp_xlate[3] = 0.0; - } -} - - -void _tnl_build_vertices( GLcontext *ctx, - GLuint start, - GLuint end, - GLuint newinputs ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - update_input_ptrs( ctx, start ); - vtx->emit( ctx, end - start, - (GLubyte *)(vtx->vertex_buf + - start * vtx->vertex_size)); -} - -/* Emit VB vertices start..end to dest. Note that VB vertex at - * postion start will be emitted to dest at position zero. - */ -void *_tnl_emit_vertices_to_buffer( GLcontext *ctx, - GLuint start, - GLuint end, - void *dest ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - - update_input_ptrs(ctx, start); - /* Note: dest should not be adjusted for non-zero 'start' values: - */ - vtx->emit( ctx, end - start, (GLubyte*) dest ); - return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start)); -} - -/* Emit indexed VB vertices start..end to dest. Note that VB vertex at - * postion start will be emitted to dest at position zero. - */ - -void *_tnl_emit_indexed_vertices_to_buffer( GLcontext *ctx, - const GLuint *elts, - GLuint start, - GLuint end, - void *dest ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - GLuint oldIndex; - GLubyte *cdest = dest; - - update_input_ptrs(ctx, oldIndex = elts[start++]); - vtx->emit( ctx, 1, cdest ); - cdest += vtx->vertex_size; - - for (; start < end; ++start) { - adjust_input_ptrs(ctx, elts[start] - oldIndex); - oldIndex = elts[start]; - vtx->emit( ctx, 1, cdest); - cdest += vtx->vertex_size; - } - - return (void *) cdest; -} - - -void _tnl_init_vertices( GLcontext *ctx, - GLuint vb_size, - GLuint max_vertex_size ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - - _tnl_install_attrs( ctx, NULL, 0, NULL, 0 ); - - vtx->need_extras = GL_TRUE; - if (max_vertex_size > vtx->max_vertex_size) { - _tnl_free_vertices( ctx ); - vtx->max_vertex_size = max_vertex_size; - vtx->vertex_buf = (GLubyte *)ALIGN_CALLOC(vb_size * max_vertex_size, 32 ); - invalidate_funcs(vtx); - } - - switch(CHAN_TYPE) { - case GL_UNSIGNED_BYTE: - vtx->chan_scale[0] = 255.0; - vtx->chan_scale[1] = 255.0; - vtx->chan_scale[2] = 255.0; - vtx->chan_scale[3] = 255.0; - break; - case GL_UNSIGNED_SHORT: - vtx->chan_scale[0] = 65535.0; - vtx->chan_scale[1] = 65535.0; - vtx->chan_scale[2] = 65535.0; - vtx->chan_scale[3] = 65535.0; - break; - default: - vtx->chan_scale[0] = 1.0; - vtx->chan_scale[1] = 1.0; - vtx->chan_scale[2] = 1.0; - vtx->chan_scale[3] = 1.0; - break; - } - - vtx->identity[0] = 0.0; - vtx->identity[1] = 0.0; - vtx->identity[2] = 0.0; - vtx->identity[3] = 1.0; - - vtx->codegen_emit = NULL; - -#ifdef USE_SSE_ASM - if (!_mesa_getenv("MESA_NO_CODEGEN")) - vtx->codegen_emit = _tnl_generate_sse_emit; -#endif -} - - -void _tnl_free_vertices( GLcontext *ctx ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_fastpath *fp, *tmp; - - if (vtx->vertex_buf) { - ALIGN_FREE(vtx->vertex_buf); - vtx->vertex_buf = NULL; - } - - for (fp = vtx->fastpath ; fp ; fp = tmp) { - tmp = fp->next; - FREE(fp->attr); - - /* KW: At the moment, fp->func is constrained to be allocated by - * _mesa_exec_alloc(), as the hardwired fastpaths in - * t_vertex_generic.c are handled specially. It would be nice - * to unify them, but this probably won't change until this - * module gets another overhaul. - */ - _mesa_exec_free((void *) fp->func); - FREE(fp); - } - - vtx->fastpath = NULL; -} diff --git a/src/libs/mesa/mesa/tnl/t_vertex.h b/src/libs/mesa/mesa/tnl/t_vertex.h deleted file mode 100644 index 2dfd7b57f0..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vertex.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2003 Tungsten Graphics, inc. - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - -#ifndef _TNL_VERTEX_H -#define _TNL_VERTEX_H - -#include "main/mtypes.h" -#include "t_context.h" - -/* New mechanism to specify hardware vertices so that tnl can build - * and manipulate them directly. - */ - - -/* It will probably be necessary to allow drivers to specify new - * emit-styles to cover all the wierd and wacky things out there. - */ -enum tnl_attr_format { - EMIT_1F, - EMIT_2F, - EMIT_3F, - EMIT_4F, - EMIT_2F_VIEWPORT, /* do viewport transform and emit */ - EMIT_3F_VIEWPORT, /* do viewport transform and emit */ - EMIT_4F_VIEWPORT, /* do viewport transform and emit */ - EMIT_3F_XYW, /* for projective texture */ - EMIT_1UB_1F, /* for fog coordinate */ - EMIT_3UB_3F_RGB, /* for specular color */ - EMIT_3UB_3F_BGR, /* for specular color */ - EMIT_4UB_4F_RGBA, /* for color */ - EMIT_4UB_4F_BGRA, /* for color */ - EMIT_4UB_4F_ARGB, /* for color */ - EMIT_4UB_4F_ABGR, /* for color */ - EMIT_4CHAN_4F_RGBA, /* for swrast color */ - EMIT_PAD, /* leave a hole of 'offset' bytes */ - EMIT_MAX -}; - -struct tnl_attr_map { - GLuint attrib; /* _TNL_ATTRIB_ enum */ - enum tnl_attr_format format; - GLuint offset; -}; - -struct tnl_format_info { - const char *name; - tnl_extract_func extract; - tnl_insert_func insert[4]; - const GLuint attrsize; -}; - -extern const struct tnl_format_info _tnl_format_info[EMIT_MAX]; - - -/* Interpolate between two vertices to produce a third: - */ -extern void _tnl_interp( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ); - -/* Copy colors from one vertex to another: - */ -extern void _tnl_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ); - - -/* Extract a named attribute from a hardware vertex. Will have to - * reverse any viewport transformation, swizzling or other conversions - * which may have been applied: - */ -extern void _tnl_get_attr( GLcontext *ctx, const void *vertex, GLenum attrib, - GLfloat *dest ); - -/* Complementary to the above. - */ -extern void _tnl_set_attr( GLcontext *ctx, void *vout, GLenum attrib, - const GLfloat *src ); - - -extern void *_tnl_get_vertex( GLcontext *ctx, GLuint nr ); - -extern GLuint _tnl_install_attrs( GLcontext *ctx, - const struct tnl_attr_map *map, - GLuint nr, const GLfloat *vp, - GLuint unpacked_size ); - -extern void _tnl_free_vertices( GLcontext *ctx ); - -extern void _tnl_init_vertices( GLcontext *ctx, - GLuint vb_size, - GLuint max_vertex_size ); - -extern void *_tnl_emit_vertices_to_buffer( GLcontext *ctx, - GLuint start, - GLuint end, - void *dest ); - -/* This function isn't optimal. Check out - * gallium/auxilary/translate for a more comprehensive implementation of - * the same functionality. - */ - -extern void *_tnl_emit_indexed_vertices_to_buffer( GLcontext *ctx, - const GLuint *elts, - GLuint start, - GLuint end, - void *dest ); - - -extern void _tnl_build_vertices( GLcontext *ctx, - GLuint start, - GLuint end, - GLuint newinputs ); - -extern void _tnl_invalidate_vertices( GLcontext *ctx, GLuint newinputs ); - -extern void _tnl_invalidate_vertex_state( GLcontext *ctx, GLuint new_state ); - -extern void _tnl_notify_pipeline_output_change( GLcontext *ctx ); - - -#define GET_VERTEX_STATE(ctx) &(TNL_CONTEXT(ctx)->clipspace) - -/* Internal function: - */ -void _tnl_register_fastpath( struct tnl_clipspace *vtx, - GLboolean match_strides ); - - -/* t_vertex_generic.c -- Internal functions for t_vertex.c - */ -void _tnl_generic_copy_pv_extras( GLcontext *ctx, - GLuint dst, GLuint src ); - -void _tnl_generic_interp_extras( GLcontext *ctx, - GLfloat t, - GLuint dst, GLuint out, GLuint in, - GLboolean force_boundary ); - -void _tnl_generic_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ); - -void _tnl_generic_interp( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ); - -void _tnl_generic_emit( GLcontext *ctx, - GLuint count, - GLubyte *v ); - -void _tnl_generate_hardwired_emit( GLcontext *ctx ); - -/* t_vertex_sse.c -- Internal functions for t_vertex.c - */ -void _tnl_generate_sse_emit( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_vertex_generic.c b/src/libs/mesa/mesa/tnl/t_vertex_generic.c deleted file mode 100644 index 9812f8c808..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vertex_generic.c +++ /dev/null @@ -1,1155 +0,0 @@ - -/* - * Copyright 2003 Tungsten Graphics, inc. - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/simple_list.h" -#include "t_context.h" -#include "t_vertex.h" - - -#if 0 -#define DEBUG_INSERT printf("%s\n", __FUNCTION__) -#else -#define DEBUG_INSERT -#endif - - -/* - * These functions take the NDC coordinates pointed to by 'in', apply the - * NDC->Viewport mapping and store the results at 'v'. - */ - -static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[10] * in[2] + vp[14]; - out[3] = in[3]; -} - -static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[10] * in[2] + vp[14]; - out[3] = 1; -} - -static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[14]; - out[3] = 1; -} - -static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[13]; - out[2] = vp[14]; - out[3] = 1; -} - -static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[10] * in[2] + vp[14]; -} - -static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[14]; -} - -static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[13]; - out[2] = vp[14]; -} - -static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[5] * in[1] + vp[13]; -} - -static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = vp[0] * in[0] + vp[12]; - out[1] = vp[13]; -} - - -/* - * These functions do the same as above, except for the viewport mapping. - */ - -static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[2]; - out[3] = in[3]; -} - -static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[2]; - out[3] = 1; -} - -static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = 0; - out[3] = 1; -} - -static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = 0; - out[2] = 0; - out[3] = 1; -} - -static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[3]; -} - -static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - (void) a; (void) v; (void) in; - DEBUG_INSERT; - _mesa_exit(1); -} - -static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[2]; -} - -static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; - out[2] = 0; -} - -static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = 0; - out[2] = 0; -} - - -static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = in[1]; -} - -static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; - out[1] = 0; -} - -static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - GLfloat *out = (GLfloat *)(v); - (void) a; - DEBUG_INSERT; - out[0] = in[0]; -} - -static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; (void) v; (void) in; -} - -static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLchan *c = (GLchan *)v; - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); - UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]); -} - -static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLchan *c = (GLchan *)v; - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); - c[3] = CHAN_MAX; -} - -static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLchan *c = (GLchan *)v; - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - c[2] = 0; - c[3] = CHAN_MAX; -} - -static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - GLchan *c = (GLchan *)v; - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - c[1] = 0; - c[2] = 0; - c[3] = CHAN_MAX; -} - -static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); -} - -static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - v[2] = 0; - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - v[1] = 0; - v[2] = 0; - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); -} - -static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - v[0] = 0; - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - v[1] = 0; - v[0] = 0; - v[3] = 0xff; -} - -static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]); - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); -} - -static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]); - v[0] = 0xff; -} - -static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - v[3] = 0x00; - v[0] = 0xff; -} - -static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); - v[2] = 0x00; - v[3] = 0x00; - v[0] = 0xff; -} - -static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]); - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); -} - -static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]); - v[0] = 0xff; -} - -static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); - v[1] = 0x00; - v[0] = 0xff; -} - -static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); - v[2] = 0x00; - v[1] = 0x00; - v[0] = 0xff; -} - -static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); -} - -static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - v[2] = 0; -} - -static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); - v[1] = 0; - v[2] = 0; -} - -static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); -} - -static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); - v[0] = 0; -} - -static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); - v[1] = 0; - v[0] = 0; -} - - -static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, - const GLfloat *in ) -{ - DEBUG_INSERT; - (void) a; - UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); -} - - -/*********************************************************************** - * Functions to perform the reverse operations to the above, for - * swrast translation and clip-interpolation. - * - * Currently always extracts a full 4 floats. - */ - -static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - const GLfloat * const vp = a->vp; - - /* Although included for completeness, the position coordinate is - * usually handled differently during clipping. - */ - DEBUG_INSERT; - out[0] = (in[0] - vp[12]) / vp[0]; - out[1] = (in[1] - vp[13]) / vp[5]; - out[2] = (in[2] - vp[14]) / vp[10]; - out[3] = in[3]; -} - -static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = (in[0] - vp[12]) / vp[0]; - out[1] = (in[1] - vp[13]) / vp[5]; - out[2] = (in[2] - vp[14]) / vp[10]; - out[3] = 1; -} - - -static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - const GLfloat * const vp = a->vp; - DEBUG_INSERT; - out[0] = (in[0] - vp[12]) / vp[0]; - out[1] = (in[1] - vp[13]) / vp[5]; - out[2] = 0; - out[3] = 1; -} - - -static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - (void) a; - - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[2]; - out[3] = in[3]; -} - -static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - (void) a; - - out[0] = in[0]; - out[1] = in[1]; - out[2] = 0; - out[3] = in[2]; -} - - -static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - (void) a; - - out[0] = in[0]; - out[1] = in[1]; - out[2] = in[2]; - out[3] = 1; -} - - -static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - (void) a; - - out[0] = in[0]; - out[1] = in[1]; - out[2] = 0; - out[3] = 1; -} - -static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - const GLfloat *in = (const GLfloat *)v; - (void) a; - - out[0] = in[0]; - out[1] = 0; - out[2] = 0; - out[3] = 1; -} - -static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - GLchan *c = (GLchan *)v; - (void) a; - - out[0] = CHAN_TO_FLOAT(c[0]); - out[1] = CHAN_TO_FLOAT(c[1]); - out[2] = CHAN_TO_FLOAT(c[2]); - out[3] = CHAN_TO_FLOAT(c[3]); -} - -static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[0] = UBYTE_TO_FLOAT(v[0]); - out[1] = UBYTE_TO_FLOAT(v[1]); - out[2] = UBYTE_TO_FLOAT(v[2]); - out[3] = UBYTE_TO_FLOAT(v[3]); -} - -static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[2] = UBYTE_TO_FLOAT(v[0]); - out[1] = UBYTE_TO_FLOAT(v[1]); - out[0] = UBYTE_TO_FLOAT(v[2]); - out[3] = UBYTE_TO_FLOAT(v[3]); -} - -static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[3] = UBYTE_TO_FLOAT(v[0]); - out[0] = UBYTE_TO_FLOAT(v[1]); - out[1] = UBYTE_TO_FLOAT(v[2]); - out[2] = UBYTE_TO_FLOAT(v[3]); -} - -static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[3] = UBYTE_TO_FLOAT(v[0]); - out[2] = UBYTE_TO_FLOAT(v[1]); - out[1] = UBYTE_TO_FLOAT(v[2]); - out[0] = UBYTE_TO_FLOAT(v[3]); -} - -static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[0] = UBYTE_TO_FLOAT(v[0]); - out[1] = UBYTE_TO_FLOAT(v[1]); - out[2] = UBYTE_TO_FLOAT(v[2]); - out[3] = 1; -} - -static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, - const GLubyte *v ) -{ - (void) a; - out[2] = UBYTE_TO_FLOAT(v[0]); - out[1] = UBYTE_TO_FLOAT(v[1]); - out[0] = UBYTE_TO_FLOAT(v[2]); - out[3] = 1; -} - -static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) -{ - (void) a; - out[0] = UBYTE_TO_FLOAT(v[0]); - out[1] = 0; - out[2] = 0; - out[3] = 1; -} - - -const struct tnl_format_info _tnl_format_info[EMIT_MAX] = -{ - { "1f", - extract_1f, - { insert_1f_1, insert_1f_1, insert_1f_1, insert_1f_1 }, - sizeof(GLfloat) }, - - { "2f", - extract_2f, - { insert_2f_1, insert_2f_2, insert_2f_2, insert_2f_2 }, - 2 * sizeof(GLfloat) }, - - { "3f", - extract_3f, - { insert_3f_1, insert_3f_2, insert_3f_3, insert_3f_3 }, - 3 * sizeof(GLfloat) }, - - { "4f", - extract_4f, - { insert_4f_1, insert_4f_2, insert_4f_3, insert_4f_4 }, - 4 * sizeof(GLfloat) }, - - { "2f_viewport", - extract_2f_viewport, - { insert_2f_viewport_1, insert_2f_viewport_2, insert_2f_viewport_2, - insert_2f_viewport_2 }, - 2 * sizeof(GLfloat) }, - - { "3f_viewport", - extract_3f_viewport, - { insert_3f_viewport_1, insert_3f_viewport_2, insert_3f_viewport_3, - insert_3f_viewport_3 }, - 3 * sizeof(GLfloat) }, - - { "4f_viewport", - extract_4f_viewport, - { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3, - insert_4f_viewport_4 }, - 4 * sizeof(GLfloat) }, - - { "3f_xyw", - extract_3f_xyw, - { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, - insert_3f_xyw_4 }, - 3 * sizeof(GLfloat) }, - - { "1ub_1f", - extract_1ub_1f, - { insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1 }, - sizeof(GLubyte) }, - - { "3ub_3f_rgb", - extract_3ub_3f_rgb, - { insert_3ub_3f_rgb_1, insert_3ub_3f_rgb_2, insert_3ub_3f_rgb_3, - insert_3ub_3f_rgb_3 }, - 3 * sizeof(GLubyte) }, - - { "3ub_3f_bgr", - extract_3ub_3f_bgr, - { insert_3ub_3f_bgr_1, insert_3ub_3f_bgr_2, insert_3ub_3f_bgr_3, - insert_3ub_3f_bgr_3 }, - 3 * sizeof(GLubyte) }, - - { "4ub_4f_rgba", - extract_4ub_4f_rgba, - { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, - insert_4ub_4f_rgba_4 }, - 4 * sizeof(GLubyte) }, - - { "4ub_4f_bgra", - extract_4ub_4f_bgra, - { insert_4ub_4f_bgra_1, insert_4ub_4f_bgra_2, insert_4ub_4f_bgra_3, - insert_4ub_4f_bgra_4 }, - 4 * sizeof(GLubyte) }, - - { "4ub_4f_argb", - extract_4ub_4f_argb, - { insert_4ub_4f_argb_1, insert_4ub_4f_argb_2, insert_4ub_4f_argb_3, - insert_4ub_4f_argb_4 }, - 4 * sizeof(GLubyte) }, - - { "4ub_4f_abgr", - extract_4ub_4f_abgr, - { insert_4ub_4f_abgr_1, insert_4ub_4f_abgr_2, insert_4ub_4f_abgr_3, - insert_4ub_4f_abgr_4 }, - 4 * sizeof(GLubyte) }, - - { "4chan_4f_rgba", - extract_4chan_4f_rgba, - { insert_4chan_4f_rgba_1, insert_4chan_4f_rgba_2, insert_4chan_4f_rgba_3, - insert_4chan_4f_rgba_4 }, - 4 * sizeof(GLchan) }, - - { "pad", - NULL, - { NULL, NULL, NULL, NULL }, - 0 } - -}; - - - - -/*********************************************************************** - * Hardwired fastpaths for emitting whole vertices or groups of - * vertices - */ -#define EMIT5(NR, F0, F1, F2, F3, F4, NAME) \ -static void NAME( GLcontext *ctx, \ - GLuint count, \ - GLubyte *v ) \ -{ \ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); \ - struct tnl_clipspace_attr *a = vtx->attr; \ - GLuint i; \ - \ - for (i = 0 ; i < count ; i++, v += vtx->vertex_size) { \ - if (NR > 0) { \ - F0( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr ); \ - a[0].inputptr += a[0].inputstride; \ - } \ - \ - if (NR > 1) { \ - F1( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr ); \ - a[1].inputptr += a[1].inputstride; \ - } \ - \ - if (NR > 2) { \ - F2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr ); \ - a[2].inputptr += a[2].inputstride; \ - } \ - \ - if (NR > 3) { \ - F3( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr ); \ - a[3].inputptr += a[3].inputstride; \ - } \ - \ - if (NR > 4) { \ - F4( &a[4], v + a[4].vertoffset, (GLfloat *)a[4].inputptr ); \ - a[4].inputptr += a[4].inputstride; \ - } \ - } \ -} - - -#define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \ - insert_null, insert_null, NAME) - -#define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \ - insert_null, NAME) - -#define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \ - insert_null, NAME) - - -EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4) -EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4) -EMIT2(insert_3f_3, insert_4ub_4f_rgba_4, emit_xyz3_rgba4) - -EMIT3(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_viewport4_rgba4_st2) -EMIT3(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, emit_viewport4_bgra4_st2) -EMIT3(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_xyzw4_rgba4_st2) - -EMIT4(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_viewport4_rgba4_st2_st2) -EMIT4(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, insert_2f_2, emit_viewport4_bgra4_st2_st2) -EMIT4(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_xyzw4_rgba4_st2_st2) - - -/* Use the codegen paths to select one of a number of hardwired - * fastpaths. - */ -void _tnl_generate_hardwired_emit( GLcontext *ctx ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - tnl_emit_func func = NULL; - - /* Does it fit a hardwired fastpath? Help! this is growing out of - * control! - */ - switch (vtx->attr_count) { - case 2: - if (vtx->attr[0].emit == insert_3f_viewport_3) { - if (vtx->attr[1].emit == insert_4ub_4f_bgra_4) - func = emit_viewport3_bgra4; - else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) - func = emit_viewport3_rgba4; - } - else if (vtx->attr[0].emit == insert_3f_3 && - vtx->attr[1].emit == insert_4ub_4f_rgba_4) { - func = emit_xyz3_rgba4; - } - break; - case 3: - if (vtx->attr[2].emit == insert_2f_2) { - if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { - if (vtx->attr[0].emit == insert_4f_viewport_4) - func = emit_viewport4_rgba4_st2; - else if (vtx->attr[0].emit == insert_4f_4) - func = emit_xyzw4_rgba4_st2; - } - else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && - vtx->attr[0].emit == insert_4f_viewport_4) - func = emit_viewport4_bgra4_st2; - } - break; - case 4: - if (vtx->attr[2].emit == insert_2f_2 && - vtx->attr[3].emit == insert_2f_2) { - if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { - if (vtx->attr[0].emit == insert_4f_viewport_4) - func = emit_viewport4_rgba4_st2_st2; - else if (vtx->attr[0].emit == insert_4f_4) - func = emit_xyzw4_rgba4_st2_st2; - } - else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && - vtx->attr[0].emit == insert_4f_viewport_4) - func = emit_viewport4_bgra4_st2_st2; - } - break; - } - - vtx->emit = func; -} - -/*********************************************************************** - * Generic (non-codegen) functions for whole vertices or groups of - * vertices - */ - -void _tnl_generic_emit( GLcontext *ctx, - GLuint count, - GLubyte *v ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - const GLuint stride = vtx->vertex_size; - GLuint i, j; - - for (i = 0 ; i < count ; i++, v += stride) { - for (j = 0; j < attr_count; j++) { - GLfloat *in = (GLfloat *)a[j].inputptr; - a[j].inputptr += a[j].inputstride; - a[j].emit( &a[j], v + a[j].vertoffset, in ); - } - } -} - - -void _tnl_generic_interp( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - const GLubyte *vin = vtx->vertex_buf + ein * vtx->vertex_size; - const GLubyte *vout = vtx->vertex_buf + eout * vtx->vertex_size; - GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size; - const struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - GLuint j; - (void) force_boundary; - - if (tnl->NeedNdcCoords) { - const GLfloat *dstclip = VB->ClipPtr->data[edst]; - if (dstclip[3] != 0.0) { - const GLfloat w = 1.0f / dstclip[3]; - GLfloat pos[4]; - - pos[0] = dstclip[0] * w; - pos[1] = dstclip[1] * w; - pos[2] = dstclip[2] * w; - pos[3] = w; - - a[0].insert[4-1]( &a[0], vdst, pos ); - } - } - else { - a[0].insert[4-1]( &a[0], vdst, VB->ClipPtr->data[edst] ); - } - - - for (j = 1; j < attr_count; j++) { - GLfloat fin[4], fout[4], fdst[4]; - - a[j].extract( &a[j], fin, vin + a[j].vertoffset ); - a[j].extract( &a[j], fout, vout + a[j].vertoffset ); - - INTERP_F( t, fdst[3], fout[3], fin[3] ); - INTERP_F( t, fdst[2], fout[2], fin[2] ); - INTERP_F( t, fdst[1], fout[1], fin[1] ); - INTERP_F( t, fdst[0], fout[0], fin[0] ); - - a[j].insert[4-1]( &a[j], vdst + a[j].vertoffset, fdst ); - } -} - - -/* Extract color attributes from one vertex and insert them into - * another. (Shortcircuit extract/insert with memcpy). - */ -void _tnl_generic_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - GLubyte *vsrc = vtx->vertex_buf + esrc * vtx->vertex_size; - GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size; - const struct tnl_clipspace_attr *a = vtx->attr; - const GLuint attr_count = vtx->attr_count; - GLuint j; - - for (j = 0; j < attr_count; j++) { - if (a[j].attrib == VERT_ATTRIB_COLOR0 || - a[j].attrib == VERT_ATTRIB_COLOR1) { - - _mesa_memcpy( vdst + a[j].vertoffset, - vsrc + a[j].vertoffset, - a[j].vertattrsize ); - } - } -} - - -/* Helper functions for hardware which doesn't put back colors and/or - * edgeflags into vertices. - */ -void _tnl_generic_interp_extras( GLcontext *ctx, - GLfloat t, - GLuint dst, GLuint out, GLuint in, - GLboolean force_boundary ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - /* If stride is zero, ColorPtr[1] is constant across the VB, so - * there is no point interpolating between two values as they will - * be identical. In all other cases, this value is generated by - * t_vb_lighttmp.h and has a stride of 4 dwords. - */ - if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); - - INTERP_4F( t, - VB->ColorPtr[1]->data[dst], - VB->ColorPtr[1]->data[out], - VB->ColorPtr[1]->data[in] ); - } - - if (VB->SecondaryColorPtr[1]) { - assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat)); - - INTERP_3F( t, - VB->SecondaryColorPtr[1]->data[dst], - VB->SecondaryColorPtr[1]->data[out], - VB->SecondaryColorPtr[1]->data[in] ); - } - - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = LINTERP( t, - VB->IndexPtr[1]->data[out][0], - VB->IndexPtr[1]->data[in][0] ); - } - - if (VB->EdgeFlag) { - VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary; - } - - _tnl_generic_interp(ctx, t, dst, out, in, force_boundary); -} - -void _tnl_generic_copy_pv_extras( GLcontext *ctx, - GLuint dst, GLuint src ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - /* See above comment: - */ - if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { - COPY_4FV( VB->ColorPtr[1]->data[dst], - VB->ColorPtr[1]->data[src] ); - } - - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], - VB->SecondaryColorPtr[1]->data[src] ); - } - - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0]; - } - - _tnl_generic_copy_pv(ctx, dst, src); -} - - diff --git a/src/libs/mesa/mesa/tnl/t_vertex_sse.c b/src/libs/mesa/mesa/tnl/t_vertex_sse.c deleted file mode 100644 index 7a255d680a..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vertex_sse.c +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright 2003 Tungsten Graphics, inc. - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/colormac.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "t_context.h" -#include "t_vertex.h" - -#if defined(USE_SSE_ASM) - -#include "x86/rtasm/x86sse.h" -#include "x86/common_x86_asm.h" - - -/** - * Number of bytes to allocate for generated SSE functions - */ -#define MAX_SSE_CODE_SIZE 1024 - - -#define X 0 -#define Y 1 -#define Z 2 -#define W 3 - - -struct x86_program { - struct x86_function func; - - GLcontext *ctx; - GLboolean inputs_safe; - GLboolean outputs_safe; - GLboolean have_sse2; - - struct x86_reg identity; - struct x86_reg chan0; -}; - - -static struct x86_reg get_identity( struct x86_program *p ) -{ - return p->identity; -} - -static void emit_load4f_4( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movups(&p->func, dest, arg0); -} - -static void emit_load4f_3( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Have to jump through some hoops: - * - * c 0 0 0 - * c 0 0 1 - * 0 0 c 1 - * a b c 1 - */ - sse_movss(&p->func, dest, x86_make_disp(arg0, 8)); - sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) ); - sse_shufps(&p->func, dest, dest, SHUF(Y,Z,X,W) ); - sse_movlps(&p->func, dest, arg0); -} - -static void emit_load4f_2( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Initialize from identity, then pull in low two words: - */ - sse_movups(&p->func, dest, get_identity(p)); - sse_movlps(&p->func, dest, arg0); -} - -static void emit_load4f_1( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Pull in low word, then swizzle in identity */ - sse_movss(&p->func, dest, arg0); - sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) ); -} - - - -static void emit_load3f_3( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Over-reads by 1 dword - potential SEGV if input is a vertex - * array. - */ - if (p->inputs_safe) { - sse_movups(&p->func, dest, arg0); - } - else { - /* c 0 0 0 - * c c c c - * a b c c - */ - sse_movss(&p->func, dest, x86_make_disp(arg0, 8)); - sse_shufps(&p->func, dest, dest, SHUF(X,X,X,X)); - sse_movlps(&p->func, dest, arg0); - } -} - -static void emit_load3f_2( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - emit_load4f_2(p, dest, arg0); -} - -static void emit_load3f_1( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Loading from memory erases the upper bits. */ - sse_movss(&p->func, dest, arg0); -} - -static void emit_load2f_2( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movlps(&p->func, dest, arg0); -} - -static void emit_load2f_1( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - /* Loading from memory erases the upper bits. */ - sse_movss(&p->func, dest, arg0); -} - -static void emit_load1f_1( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movss(&p->func, dest, arg0); -} - -static void (*load[4][4])( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) = { - { emit_load1f_1, - emit_load1f_1, - emit_load1f_1, - emit_load1f_1 }, - - { emit_load2f_1, - emit_load2f_2, - emit_load2f_2, - emit_load2f_2 }, - - { emit_load3f_1, - emit_load3f_2, - emit_load3f_3, - emit_load3f_3 }, - - { emit_load4f_1, - emit_load4f_2, - emit_load4f_3, - emit_load4f_4 } -}; - -static void emit_load( struct x86_program *p, - struct x86_reg dest, - GLuint sz, - struct x86_reg src, - GLuint src_sz) -{ - load[sz-1][src_sz-1](p, dest, src); -} - -static void emit_store4f( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movups(&p->func, dest, arg0); -} - -static void emit_store3f( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - if (p->outputs_safe) { - /* Emit the extra dword anyway. This may hurt writecombining, - * may cause other problems. - */ - sse_movups(&p->func, dest, arg0); - } - else { - /* Alternate strategy - emit two, shuffle, emit one. - */ - sse_movlps(&p->func, dest, arg0); - sse_shufps(&p->func, arg0, arg0, SHUF(Z,Z,Z,Z) ); /* NOTE! destructive */ - sse_movss(&p->func, x86_make_disp(dest,8), arg0); - } -} - -static void emit_store2f( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movlps(&p->func, dest, arg0); -} - -static void emit_store1f( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) -{ - sse_movss(&p->func, dest, arg0); -} - - -static void (*store[4])( struct x86_program *p, - struct x86_reg dest, - struct x86_reg arg0 ) = -{ - emit_store1f, - emit_store2f, - emit_store3f, - emit_store4f -}; - -static void emit_store( struct x86_program *p, - struct x86_reg dest, - GLuint sz, - struct x86_reg temp ) - -{ - store[sz-1](p, dest, temp); -} - -static void emit_pack_store_4ub( struct x86_program *p, - struct x86_reg dest, - struct x86_reg temp ) -{ - /* Scale by 255.0 - */ - sse_mulps(&p->func, temp, p->chan0); - - if (p->have_sse2) { - sse2_cvtps2dq(&p->func, temp, temp); - sse2_packssdw(&p->func, temp, temp); - sse2_packuswb(&p->func, temp, temp); - sse_movss(&p->func, dest, temp); - } - else { - struct x86_reg mmx0 = x86_make_reg(file_MMX, 0); - struct x86_reg mmx1 = x86_make_reg(file_MMX, 1); - sse_cvtps2pi(&p->func, mmx0, temp); - sse_movhlps(&p->func, temp, temp); - sse_cvtps2pi(&p->func, mmx1, temp); - mmx_packssdw(&p->func, mmx0, mmx1); - mmx_packuswb(&p->func, mmx0, mmx0); - mmx_movd(&p->func, dest, mmx0); - } -} - -static GLint get_offset( const void *a, const void *b ) -{ - return (const char *)b - (const char *)a; -} - -/* Not much happens here. Eventually use this function to try and - * avoid saving/reloading the source pointers each vertex (if some of - * them can fit in registers). - */ -static void get_src_ptr( struct x86_program *p, - struct x86_reg srcREG, - struct x86_reg vtxREG, - struct tnl_clipspace_attr *a ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx); - struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr)); - - /* Load current a[j].inputptr - */ - x86_mov(&p->func, srcREG, ptr_to_src); -} - -static void update_src_ptr( struct x86_program *p, - struct x86_reg srcREG, - struct x86_reg vtxREG, - struct tnl_clipspace_attr *a ) -{ - if (a->inputstride) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx); - struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr)); - - /* add a[j].inputstride (hardcoded value - could just as easily - * pull the stride value from memory each time). - */ - x86_lea(&p->func, srcREG, x86_make_disp(srcREG, a->inputstride)); - - /* save new value of a[j].inputptr - */ - x86_mov(&p->func, ptr_to_src, srcREG); - } -} - - -/* Lots of hardcoding - * - * EAX -- pointer to current output vertex - * ECX -- pointer to current attribute - * - */ -static GLboolean build_vertex_emit( struct x86_program *p ) -{ - GLcontext *ctx = p->ctx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - GLuint j = 0; - - struct x86_reg vertexEAX = x86_make_reg(file_REG32, reg_AX); - struct x86_reg srcECX = x86_make_reg(file_REG32, reg_CX); - struct x86_reg countEBP = x86_make_reg(file_REG32, reg_BP); - struct x86_reg vtxESI = x86_make_reg(file_REG32, reg_SI); - struct x86_reg temp = x86_make_reg(file_XMM, 0); - struct x86_reg vp0 = x86_make_reg(file_XMM, 1); - struct x86_reg vp1 = x86_make_reg(file_XMM, 2); - struct x86_reg temp2 = x86_make_reg(file_XMM, 3); - GLubyte *fixup, *label; - - /* Push a few regs? - */ - x86_push(&p->func, countEBP); - x86_push(&p->func, vtxESI); - - - /* Get vertex count, compare to zero - */ - x86_xor(&p->func, srcECX, srcECX); - x86_mov(&p->func, countEBP, x86_fn_arg(&p->func, 2)); - x86_cmp(&p->func, countEBP, srcECX); - fixup = x86_jcc_forward(&p->func, cc_E); - - /* Initialize destination register. - */ - x86_mov(&p->func, vertexEAX, x86_fn_arg(&p->func, 3)); - - /* Dereference ctx to get tnl, then vtx: - */ - x86_mov(&p->func, vtxESI, x86_fn_arg(&p->func, 1)); - x86_mov(&p->func, vtxESI, x86_make_disp(vtxESI, get_offset(ctx, &ctx->swtnl_context))); - vtxESI = x86_make_disp(vtxESI, get_offset(tnl, &tnl->clipspace)); - - - /* Possibly load vp0, vp1 for viewport calcs: - */ - if (vtx->need_viewport) { - sse_movups(&p->func, vp0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_scale[0]))); - sse_movups(&p->func, vp1, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_xlate[0]))); - } - - /* always load, needed or not: - */ - sse_movups(&p->func, p->chan0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->chan_scale[0]))); - sse_movups(&p->func, p->identity, x86_make_disp(vtxESI, get_offset(vtx, &vtx->identity[0]))); - - /* Note address for loop jump */ - label = x86_get_label(&p->func); - - /* Emit code for each of the attributes. Currently routes - * everything through SSE registers, even when it might be more - * efficient to stick with regular old x86. No optimization or - * other tricks - enough new ground to cover here just getting - * things working. - */ - while (j < vtx->attr_count) { - struct tnl_clipspace_attr *a = &vtx->attr[j]; - struct x86_reg dest = x86_make_disp(vertexEAX, a->vertoffset); - - /* Now, load an XMM reg from src, perhaps transform, then save. - * Could be shortcircuited in specific cases: - */ - switch (a->format) { - case EMIT_1F: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 1, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_2F: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 2, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_3F: - /* Potentially the worst case - hardcode 2+1 copying: - */ - if (0) { - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 3, temp); - update_src_ptr(p, srcECX, vtxESI, a); - } - else { - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 2, temp); - if (a->inputsize > 2) { - emit_load(p, temp, 1, x86_make_disp(srcECX, 8), 1); - emit_store(p, x86_make_disp(dest,8), 1, temp); - } - else { - sse_movss(&p->func, x86_make_disp(dest,8), get_identity(p)); - } - update_src_ptr(p, srcECX, vtxESI, a); - } - break; - case EMIT_4F: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 4, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_2F_VIEWPORT: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize); - sse_mulps(&p->func, temp, vp0); - sse_addps(&p->func, temp, vp1); - emit_store(p, dest, 2, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_3F_VIEWPORT: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); - sse_mulps(&p->func, temp, vp0); - sse_addps(&p->func, temp, vp1); - emit_store(p, dest, 3, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_4F_VIEWPORT: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - sse_mulps(&p->func, temp, vp0); - sse_addps(&p->func, temp, vp1); - emit_store(p, dest, 4, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_3F_XYW: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - sse_shufps(&p->func, temp, temp, SHUF(X,Y,W,Z)); - emit_store(p, dest, 3, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - - case EMIT_1UB_1F: - /* Test for PAD3 + 1UB: - */ - if (j > 0 && - a[-1].vertoffset + a[-1].vertattrsize <= a->vertoffset - 3) - { - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize); - sse_shufps(&p->func, temp, temp, SHUF(X,X,X,X)); - emit_pack_store_4ub(p, x86_make_disp(dest, -3), temp); /* overkill! */ - update_src_ptr(p, srcECX, vtxESI, a); - } - else { - _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); - return GL_FALSE; - } - break; - case EMIT_3UB_3F_RGB: - case EMIT_3UB_3F_BGR: - /* Test for 3UB + PAD1: - */ - if (j == vtx->attr_count - 1 || - a[1].vertoffset >= a->vertoffset + 4) { - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); - if (a->format == EMIT_3UB_3F_BGR) - sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W)); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - } - /* Test for 3UB + 1UB: - */ - else if (j < vtx->attr_count - 1 && - a[1].format == EMIT_1UB_1F && - a[1].vertoffset == a->vertoffset + 3) { - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); - update_src_ptr(p, srcECX, vtxESI, a); - - /* Make room for incoming value: - */ - sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z)); - - get_src_ptr(p, srcECX, vtxESI, &a[1]); - emit_load(p, temp2, 1, x86_deref(srcECX), a[1].inputsize); - sse_movss(&p->func, temp, temp2); - update_src_ptr(p, srcECX, vtxESI, &a[1]); - - /* Rearrange and possibly do BGR conversion: - */ - if (a->format == EMIT_3UB_3F_BGR) - sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X)); - else - sse_shufps(&p->func, temp, temp, SHUF(Y,Z,W,X)); - - emit_pack_store_4ub(p, dest, temp); - j++; /* NOTE: two attrs consumed */ - } - else { - _mesa_printf("Can't emit 3ub\n"); - return GL_FALSE; /* add this later */ - } - break; - - case EMIT_4UB_4F_RGBA: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_4UB_4F_BGRA: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W)); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_4UB_4F_ARGB: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z)); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_4UB_4F_ABGR: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X)); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case EMIT_4CHAN_4F_RGBA: - switch (CHAN_TYPE) { - case GL_UNSIGNED_BYTE: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - emit_pack_store_4ub(p, dest, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case GL_FLOAT: - get_src_ptr(p, srcECX, vtxESI, a); - emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); - emit_store(p, dest, 4, temp); - update_src_ptr(p, srcECX, vtxESI, a); - break; - case GL_UNSIGNED_SHORT: - default: - _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); - return GL_FALSE; - } - break; - default: - _mesa_printf("unknown a[%d].format %d\n", j, a->format); - return GL_FALSE; /* catch any new opcodes */ - } - - /* Increment j by at least 1 - may have been incremented above also: - */ - j++; - } - - /* Next vertex: - */ - x86_lea(&p->func, vertexEAX, x86_make_disp(vertexEAX, vtx->vertex_size)); - - /* decr count, loop if not zero - */ - x86_dec(&p->func, countEBP); - x86_test(&p->func, countEBP, countEBP); - x86_jcc(&p->func, cc_NZ, label); - - /* Exit mmx state? - */ - if (p->func.need_emms) - mmx_emms(&p->func); - - /* Land forward jump here: - */ - x86_fixup_fwd_jump(&p->func, fixup); - - /* Pop regs and return - */ - x86_pop(&p->func, x86_get_base_reg(vtxESI)); - x86_pop(&p->func, countEBP); - x86_ret(&p->func); - - assert(!vtx->emit); - vtx->emit = (tnl_emit_func)x86_get_func(&p->func); - - assert( (char *) p->func.csr - (char *) p->func.store <= MAX_SSE_CODE_SIZE ); - return GL_TRUE; -} - - - -void _tnl_generate_sse_emit( GLcontext *ctx ) -{ - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct x86_program p; - - if (!cpu_has_xmm) { - vtx->codegen_emit = NULL; - return; - } - - _mesa_memset(&p, 0, sizeof(p)); - - p.ctx = ctx; - p.inputs_safe = 0; /* for now */ - p.outputs_safe = 0; /* for now */ - p.have_sse2 = cpu_has_xmm2; - p.identity = x86_make_reg(file_XMM, 6); - p.chan0 = x86_make_reg(file_XMM, 7); - - if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) { - vtx->emit = NULL; - return; - } - - if (build_vertex_emit(&p)) { - _tnl_register_fastpath( vtx, GL_TRUE ); - } - else { - /* Note the failure so that we don't keep trying to codegen an - * impossible state: - */ - _tnl_register_fastpath( vtx, GL_FALSE ); - x86_release_func(&p.func); - } -} - -#else - -void _tnl_generate_sse_emit( GLcontext *ctx ) -{ - /* Dummy version for when USE_SSE_ASM not defined */ -} - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_vp_build.c b/src/libs/mesa/mesa/tnl/t_vp_build.c deleted file mode 100644 index 7be4d95af6..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vp_build.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 2007 Tungsten Graphics 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 - * TUNGSTEN GRAPHICS 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. - */ - -/** - * \file t_vp_build.c - * Create a vertex program to execute the current fixed function T&L pipeline. - * \author Keith Whitwell - */ - - -#include "main/glheader.h" -#include "main/ffvertex_prog.h" -#include "t_vp_build.h" - - -/** - * XXX This should go away someday, but still referenced by some drivers... - */ -void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) -{ - const struct gl_vertex_program *prev = ctx->VertexProgram._Current; - - if (!ctx->VertexProgram._Current || - ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) { - ctx->VertexProgram._Current - = ctx->VertexProgram._TnlProgram - = _mesa_get_fixed_func_vertex_program(ctx); - } - - /* Tell the driver about the change. Could define a new target for - * this? - */ - if (ctx->VertexProgram._Current != prev && ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, - (struct gl_program *) ctx->VertexProgram._Current); - } -} diff --git a/src/libs/mesa/mesa/tnl/t_vp_build.h b/src/libs/mesa/mesa/tnl/t_vp_build.h deleted file mode 100644 index d1c147ff03..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vp_build.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 2005 Tungsten Graphics 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 - * TUNGSTEN GRAPHICS 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 T_VP_BUILD_H -#define T_VP_BUILD_H - -#include "main/mtypes.h" - - -extern void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ); - -#endif diff --git a/src/libs/mesa/mesa/tnl/t_vtx_x86_gcc.S b/src/libs/mesa/mesa/tnl/t_vtx_x86_gcc.S deleted file mode 100644 index 93753be759..0000000000 --- a/src/libs/mesa/mesa/tnl/t_vtx_x86_gcc.S +++ /dev/null @@ -1,561 +0,0 @@ -/************************************************************************** - -Copyright 2004 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on 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 -ATI, TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - * Daniel Borca - */ - -#if defined (__DJGPP__) || defined (__MINGW32__) || defined (__CYGWIN__) -#define GLOBL( x ) \ -.globl _##x; \ -_##x: -#else /* !defined (__DJGPP__) && !defined (__MINGW32__) && !defined (__CYGWIN__) */ -#define GLOBL( x ) \ -.globl x; \ -x: -#endif /* !defined (__DJGPP__) && !defined (__MINGW32__) && !defined (__CYGWIN__) */ - - -#if !defined (STDCALL_API) -#define RETCLEAN( x ) ret -#else -#define RETCLEAN( x ) ret $x -#endif - - -#define _JMP(x) \ -.byte 0xe9; \ -.long x - -#define _CALL(x) \ -.byte 0xe8; \ -.long x - - -/* Someone who knew a lot about this sort of thing would use this - * macro to note current offsets, etc in a special region of the - * object file & just make everything work out neat. I don't know - * enough to do that... - */ - -#define SUBST( x ) (0x10101010 + x) - - -.data - - -/* [dBorca] TODO - * Unfold functions for each vertex size? - * Build super-specialized SSE versions? - * - * There is a trick in Vertex*fv: under certain conditions, - * we tail to _tnl_wrap_filled_vertex(ctx). This means that - * if Vertex*fv is STDCALL, then _tnl_wrap_filled_vertex must - * be STDCALL as well, because (GLcontext *) and (GLfloat *) - * have the same size. - */ -.align 4 -GLOBL ( _tnl_x86_Vertex1fv ) - movl 4(%esp), %ecx - push %edi - push %esi - movl SUBST(0), %edi /* 0x0 --> tnl->vtx.vbptr */ - movl (%ecx), %edx /* load v[0] */ - movl %edx, (%edi) /* tnl->vtx.vbptr[0] = v[0] */ - addl $4, %edi /* tnl->vtx.vbptr += 1 */ - movl $SUBST(1), %ecx /* 0x1 --> (tnl->vtx.vertex_size - 1) */ - movl $SUBST(2), %esi /* 0x2 --> (tnl->vtx.vertex + 1) */ - repz - movsl %ds:(%esi), %es:(%edi) - movl %edi, SUBST(0) /* 0x0 --> tnl->vtx.vbptr */ - movl SUBST(3), %edx /* 0x3 --> counter */ - pop %esi - pop %edi - dec %edx /* counter-- */ - movl %edx, SUBST(3) /* 0x3 --> counter */ - je .0 /* if (counter == 0) goto .0 */ - RETCLEAN(4) /* return */ - .balign 16 -.0: - movl $SUBST(4), %eax /* load ctx */ - movl %eax, 4(%esp) /* push ctx */ - _JMP (SUBST(5)) /* jmp _tnl_wrap_filled_vertex */ -GLOBL ( _tnl_x86_Vertex1fv_end ) - -.align 4 -GLOBL ( _tnl_x86_Vertex2fv ) - movl 4(%esp), %ecx - push %edi - push %esi - movl SUBST(0), %edi /* load tnl->vtx.vbptr */ - movl (%ecx), %edx /* load v[0] */ - movl 4(%ecx), %eax /* load v[1] */ - movl %edx, (%edi) /* tnl->vtx.vbptr[0] = v[0] */ - movl %eax, 4(%edi) /* tnl->vtx.vbptr[1] = v[1] */ - addl $8, %edi /* tnl->vtx.vbptr += 2 */ - movl $SUBST(1), %ecx /* vertex_size - 2 */ - movl $SUBST(2), %esi /* tnl->vtx.vertex + 2 */ - repz - movsl %ds:(%esi), %es:(%edi) - movl %edi, SUBST(0) /* save tnl->vtx.vbptr */ - movl SUBST(3), %edx /* load counter */ - pop %esi - pop %edi - dec %edx /* counter-- */ - movl %edx, SUBST(3) /* save counter */ - je .1 /* if (counter == 0) goto .1 */ - RETCLEAN(4) /* return */ - .balign 16 -.1: - movl $SUBST(4), %eax /* load ctx */ - movl %eax, 4(%esp) /* push ctx */ - _JMP (SUBST(5)) /* jmp _tnl_wrap_filled_vertex */ -GLOBL ( _tnl_x86_Vertex2fv_end ) - -.align 4 -GLOBL ( _tnl_x86_Vertex3fv ) - movl 4(%esp), %ecx - push %edi - push %esi - movl SUBST(0), %edi /* load tnl->vtx.vbptr */ - movl (%ecx), %edx /* load v[0] */ - movl 4(%ecx), %eax /* load v[1] */ - movl 8(%ecx), %esi /* load v[2] */ - movl %edx, (%edi) /* tnl->vtx.vbptr[0] = v[0] */ - movl %eax, 4(%edi) /* tnl->vtx.vbptr[1] = v[1] */ - movl %esi, 8(%edi) /* tnl->vtx.vbptr[2] = v[2] */ - addl $12, %edi /* tnl->vtx.vbptr += 3 */ - movl $SUBST(1), %ecx /* vertex_size - 3 */ - movl $SUBST(2), %esi /* tnl->vtx.vertex + 3 */ - repz - movsl %ds:(%esi), %es:(%edi) - movl %edi, SUBST(0) /* save tnl->vtx.vbptr */ - movl SUBST(3), %edx /* load counter */ - pop %esi - pop %edi - dec %edx /* counter-- */ - movl %edx, SUBST(3) /* save counter */ - je .2 /* if (counter == 0) goto .2 */ - RETCLEAN(4) /* return */ - .balign 16 -.2: - movl $SUBST(4), %eax /* load ctx */ - movl %eax, 4(%esp) /* push ctx */ - _JMP (SUBST(5)) /* jmp _tnl_wrap_filled_vertex */ -GLOBL ( _tnl_x86_Vertex3fv_end ) - -.align 4 -GLOBL ( _tnl_x86_Vertex4fv ) - movl 4(%esp), %ecx - push %edi - push %esi - movl SUBST(0), %edi /* load tnl->vtx.vbptr */ - movl (%ecx), %edx /* load v[0] */ - movl 4(%ecx), %eax /* load v[1] */ - movl 8(%ecx), %esi /* load v[2] */ - movl 12(%ecx), %ecx /* load v[3] */ - movl %edx, (%edi) /* tnl->vtx.vbptr[0] = v[0] */ - movl %eax, 4(%edi) /* tnl->vtx.vbptr[1] = v[1] */ - movl %esi, 8(%edi) /* tnl->vtx.vbptr[2] = v[2] */ - movl %ecx, 12(%edi) /* tnl->vtx.vbptr[3] = v[3] */ - addl $16, %edi /* tnl->vtx.vbptr += 4 */ - movl $SUBST(1), %ecx /* vertex_size - 4 */ - movl $SUBST(2), %esi /* tnl->vtx.vertex + 4 */ - repz - movsl %ds:(%esi), %es:(%edi) - movl %edi, SUBST(0) /* save tnl->vtx.vbptr */ - movl SUBST(3), %edx /* load counter */ - pop %esi - pop %edi - dec %edx /* counter-- */ - movl %edx, SUBST(3) /* save counter */ - je .3 /* if (counter == 0) goto .3 */ - RETCLEAN(4) /* return */ - .balign 16 -.3: - movl $SUBST(4), %eax /* load ctx */ - movl %eax, 4(%esp) /* push ctx */ - _JMP (SUBST(5)) /* jmp _tnl_wrap_filled_vertex */ -GLOBL ( _tnl_x86_Vertex4fv_end ) - - -/** - * Generic handlers for vector format data. - */ -GLOBL( _tnl_x86_Attribute1fv ) - movl 4(%esp), %ecx - movl (%ecx), %eax /* load v[0] */ - movl %eax, SUBST(0) /* store v[0] to current vertex */ - RETCLEAN(4) -GLOBL ( _tnl_x86_Attribute1fv_end ) - -GLOBL( _tnl_x86_Attribute2fv ) - movl 4(%esp), %ecx - movl (%ecx), %eax /* load v[0] */ - movl 4(%ecx), %edx /* load v[1] */ - movl %eax, SUBST(0) /* store v[0] to current vertex */ - movl %edx, SUBST(1) /* store v[1] to current vertex */ - RETCLEAN(4) -GLOBL ( _tnl_x86_Attribute2fv_end ) - -GLOBL( _tnl_x86_Attribute3fv ) - movl 4(%esp), %ecx - movl (%ecx), %eax /* load v[0] */ - movl 4(%ecx), %edx /* load v[1] */ - movl 8(%ecx), %ecx /* load v[2] */ - movl %eax, SUBST(0) /* store v[0] to current vertex */ - movl %edx, SUBST(1) /* store v[1] to current vertex */ - movl %ecx, SUBST(2) /* store v[2] to current vertex */ - RETCLEAN(4) -GLOBL ( _tnl_x86_Attribute3fv_end ) - -GLOBL( _tnl_x86_Attribute4fv ) - movl 4(%esp), %ecx - movl (%ecx), %eax /* load v[0] */ - movl 4(%ecx), %edx /* load v[1] */ - movl %eax, SUBST(0) /* store v[0] to current vertex */ - movl %edx, SUBST(1) /* store v[1] to current vertex */ - movl 8(%ecx), %eax /* load v[2] */ - movl 12(%ecx), %edx /* load v[3] */ - movl %eax, SUBST(2) /* store v[2] to current vertex */ - movl %edx, SUBST(3) /* store v[3] to current vertex */ - RETCLEAN(4) -GLOBL ( _tnl_x86_Attribute4fv_end ) - - -/* Choosers: - * - * Must generate all of these ahead of first usage. Generate at - * compile-time? - */ -GLOBL( _tnl_x86_choose_fv ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl $SUBST(0), (%esp) /* arg 0 - attrib */ - movl $SUBST(1), 4(%esp) /* arg 1 - N */ - _CALL (SUBST(2)) /* call do_choose */ - add $12, %esp /* tear down stack frame */ - jmp *%eax /* jump to new func */ -GLOBL ( _tnl_x86_choose_fv_end ) - - -/* FIRST LEVEL FUNCTIONS -- these are plugged directly into GL dispatch. - * - * In the 1st level dispatch functions, switch to a different - * calling convention -- (const GLfloat *v) in %ecx. - * - * As with regular (x86) dispatch, don't create a new stack frame - - * just let the 'ret' in the dispatched function return straight - * back to the original caller. - * - * Vertex/Normal/Color, etc: the address of the function pointer - * is known at codegen time. - */ - -/* Unfortunately, have to play with the stack in the non-fv case: - */ -#if !defined (STDCALL_API) -GLOBL( _tnl_x86_dispatch_attrf1 ) -GLOBL( _tnl_x86_dispatch_attrf2 ) -GLOBL( _tnl_x86_dispatch_attrf3 ) -GLOBL( _tnl_x86_dispatch_attrf4 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - leal 16(%esp), %edx /* address of first float on stack */ - movl %edx, (%esp) /* save as 'v' */ - call *SUBST(0) /* 0x0 --> tabfv[attr][n] */ - addl $12, %esp /* tear down frame */ - ret /* return */ -GLOBL( _tnl_x86_dispatch_attrf4_end ) -GLOBL( _tnl_x86_dispatch_attrf3_end ) -GLOBL( _tnl_x86_dispatch_attrf2_end ) -GLOBL( _tnl_x86_dispatch_attrf1_end ) - -#else /* defined(STDCALL_API) */ - -GLOBL( _tnl_x86_dispatch_attrf1 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - leal 16(%esp), %edx /* address of first float on stack */ - movl %edx, (%esp) /* save as 'v' */ - call *SUBST(0) /* 0x0 --> tabfv[attr][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $4 /* return */ -GLOBL( _tnl_x86_dispatch_attrf1_end ) - -GLOBL( _tnl_x86_dispatch_attrf2 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - leal 16(%esp), %edx /* address of first float on stack */ - movl %edx, (%esp) /* save as 'v' */ - call *SUBST(0) /* 0x0 --> tabfv[attr][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $8 /* return */ -GLOBL( _tnl_x86_dispatch_attrf2_end ) - -GLOBL( _tnl_x86_dispatch_attrf3 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - leal 16(%esp), %edx /* address of first float on stack */ - movl %edx, (%esp) /* save as 'v' */ - call *SUBST(0) /* 0x0 --> tabfv[attr][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $12 /* return */ -GLOBL( _tnl_x86_dispatch_attrf3_end ) - -GLOBL( _tnl_x86_dispatch_attrf4 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - leal 16(%esp), %edx /* address of first float on stack */ - movl %edx, (%esp) /* save as 'v' */ - call *SUBST(0) /* 0x0 --> tabfv[attr][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $16 /* return */ -GLOBL( _tnl_x86_dispatch_attrf4_end ) -#endif /* defined(STDCALL_API) */ - -/* The fv case is simpler: - */ -GLOBL( _tnl_x86_dispatch_attrfv ) - jmp *SUBST(0) /* 0x0 --> tabfv[attr][n] */ -GLOBL( _tnl_x86_dispatch_attrfv_end ) - - -/* MultiTexcoord: the address of the function pointer must be - * calculated, but can use the index argument slot to hold 'v', and - * avoid setting up a new stack frame. - * - * [dBorca] - * right, this would be the preferred approach, but gcc does not - * clean up the stack after each function call when optimizing (-fdefer-pop); - * can it make assumptions about what's already on the stack? I dunno, - * but in this case, we can't mess with the caller's stack frame, and - * we must use a model like `_x86_dispatch_attrfv' above. Caveat emptor! - */ - -/* Also, will only need a maximum of four of each of these per context: - */ -#if !defined (STDCALL_API) -GLOBL( _tnl_x86_dispatch_multitexcoordf1 ) -GLOBL( _tnl_x86_dispatch_multitexcoordf2 ) -GLOBL( _tnl_x86_dispatch_multitexcoordf3 ) -GLOBL( _tnl_x86_dispatch_multitexcoordf4 ) - movl 4(%esp), %ecx - leal 8(%esp), %edx - andl $7, %ecx - movl %edx, 4(%esp) - sall $4, %ecx - jmp *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ -GLOBL( _tnl_x86_dispatch_multitexcoordf4_end ) -GLOBL( _tnl_x86_dispatch_multitexcoordf3_end ) -GLOBL( _tnl_x86_dispatch_multitexcoordf2_end ) -GLOBL( _tnl_x86_dispatch_multitexcoordf1_end ) - -GLOBL( _tnl_x86_dispatch_multitexcoordfv ) - movl 4(%esp), %ecx - movl 8(%esp), %edx - andl $7, %ecx - movl %edx, 4(%esp) - sall $4, %ecx - jmp *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ -GLOBL( _tnl_x86_dispatch_multitexcoordfv_end ) - -#else /* defined (STDCALL_API) */ - -GLOBL( _tnl_x86_dispatch_multitexcoordf1 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %ecx - leal 20(%esp), %edx - andl $7, %ecx - movl %edx, (%esp) - sall $4, %ecx - call *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $8 /* return */ -GLOBL( _tnl_x86_dispatch_multitexcoordf1_end ) - -GLOBL( _tnl_x86_dispatch_multitexcoordf2 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %ecx - leal 20(%esp), %edx - andl $7, %ecx - movl %edx, (%esp) - sall $4, %ecx - call *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $12 /* return */ -GLOBL( _tnl_x86_dispatch_multitexcoordf2_end ) - -GLOBL( _tnl_x86_dispatch_multitexcoordf3 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %ecx - leal 20(%esp), %edx - andl $7, %ecx - movl %edx, (%esp) - sall $4, %ecx - call *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $16 /* return */ -GLOBL( _tnl_x86_dispatch_multitexcoordf3_end ) - -GLOBL( _tnl_x86_dispatch_multitexcoordf4 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %ecx - leal 20(%esp), %edx - andl $7, %ecx - movl %edx, (%esp) - sall $4, %ecx - call *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $20 /* return */ -GLOBL( _tnl_x86_dispatch_multitexcoordf4_end ) - -GLOBL( _tnl_x86_dispatch_multitexcoordfv ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %ecx - movl 20(%esp), %edx - andl $7, %ecx - movl %edx, (%esp) - sall $4, %ecx - call *SUBST(0)(%ecx) /* 0x0 - tabfv[tex0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $8 /* return */ -GLOBL( _tnl_x86_dispatch_multitexcoordfv_end ) -#endif /* defined (STDCALL_API) */ - - -/* VertexAttrib: the address of the function pointer must be - * calculated. - */ -#if !defined (STDCALL_API) -GLOBL( _tnl_x86_dispatch_vertexattribf1 ) -GLOBL( _tnl_x86_dispatch_vertexattribf2 ) -GLOBL( _tnl_x86_dispatch_vertexattribf3 ) -GLOBL( _tnl_x86_dispatch_vertexattribf4 ) - movl 4(%esp), %eax - cmpl $16, %eax - jb .8 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.8: - leal 8(%esp), %ecx /* calculate 'v' */ - movl %ecx, 4(%esp) /* save in 1st arg slot */ - sall $4, %eax - jmp *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ -GLOBL( _tnl_x86_dispatch_vertexattribf4_end ) -GLOBL( _tnl_x86_dispatch_vertexattribf3_end ) -GLOBL( _tnl_x86_dispatch_vertexattribf2_end ) -GLOBL( _tnl_x86_dispatch_vertexattribf1_end ) - -GLOBL( _tnl_x86_dispatch_vertexattribfv ) - movl 4(%esp), %eax - cmpl $16, %eax - jb .9 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.9: - movl 8(%esp), %ecx /* load 'v' */ - movl %ecx, 4(%esp) /* save in 1st arg slot */ - sall $4, %eax - jmp *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ -GLOBL( _tnl_x86_dispatch_vertexattribfv_end ) - -#else /* defined (STDCALL_API) */ - -GLOBL( _tnl_x86_dispatch_vertexattribf1 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %eax - cmpl $16, %eax - jb .81 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.81: - leal 20(%esp), %ecx /* load 'v' */ - movl %ecx, (%esp) /* save in 1st arg slot */ - sall $4, %eax - call *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $8 /* return */ -GLOBL( _tnl_x86_dispatch_vertexattribf1_end ) - -GLOBL( _tnl_x86_dispatch_vertexattribf2 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %eax - cmpl $16, %eax - jb .82 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.82: - leal 20(%esp), %ecx /* load 'v' */ - movl %ecx, (%esp) /* save in 1st arg slot */ - sall $4, %eax - call *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $12 /* return */ -GLOBL( _tnl_x86_dispatch_vertexattribf2_end ) - -GLOBL( _tnl_x86_dispatch_vertexattribf3 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %eax - cmpl $16, %eax - jb .83 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.83: - leal 20(%esp), %ecx /* load 'v' */ - movl %ecx, (%esp) /* save in 1st arg slot */ - sall $4, %eax - call *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $16 /* return */ -GLOBL( _tnl_x86_dispatch_vertexattribf3_end ) - -GLOBL( _tnl_x86_dispatch_vertexattribf4 ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %eax - cmpl $16, %eax - jb .84 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.84: - leal 20(%esp), %ecx /* load 'v' */ - movl %ecx, (%esp) /* save in 1st arg slot */ - sall $4, %eax - call *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $20 /* return */ -GLOBL( _tnl_x86_dispatch_vertexattribf4_end ) - -GLOBL( _tnl_x86_dispatch_vertexattribfv ) - subl $12, %esp /* gcc does 16 byte alignment of stack frames? */ - movl 16(%esp), %eax - cmpl $16, %eax - jb .9 /* "cmovge" is not supported on all CPUs */ - movl $16, %eax -.9: - movl 20(%esp), %ecx /* load 'v' */ - movl %ecx, (%esp) /* save in 1st arg slot */ - sall $4, %eax - call *SUBST(0)(%eax) /* 0x0 - tabfv[0][n] */ - addl $8, %esp /* tear down frame (4 shaved off by the callee) */ - ret $8 /* return */ -GLOBL( _tnl_x86_dispatch_vertexattribfv_end ) -#endif /* defined (STDCALL_API) */ - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/tnl/tnl.h b/src/libs/mesa/mesa/tnl/tnl.h deleted file mode 100644 index 9a1717bf89..0000000000 --- a/src/libs/mesa/mesa/tnl/tnl.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef _TNL_H -#define _TNL_H - -#include "main/mtypes.h" - - - -/* These are the public-access functions exported from tnl. (A few - * more are currently hooked into dispatch directly by the module - * itself.) - */ -extern GLboolean -_tnl_CreateContext( GLcontext *ctx ); - -extern void -_tnl_DestroyContext( GLcontext *ctx ); - -extern void -_tnl_InvalidateState( GLcontext *ctx, GLuint new_state ); - -/* Functions to revive the tnl module after being unhooked from - * dispatch and/or driver callbacks. - */ - -extern void -_tnl_wakeup( GLcontext *ctx ); - -/* Driver configuration options: - */ -extern void -_tnl_need_projected_coords( GLcontext *ctx, GLboolean flag ); - - -/* Control whether T&L does per-vertex fog - */ -extern void -_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value ); - -extern void -_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value ); - -extern void -_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program); - -struct _mesa_prim; -struct _mesa_index_buffer; - -void -_tnl_draw_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index); - - -extern void -_tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]); - -#endif diff --git a/src/libs/mesa/mesa/tnl_dd/imm/NOTES.imm b/src/libs/mesa/mesa/tnl_dd/imm/NOTES.imm deleted file mode 100644 index 9b2bd65e4b..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/NOTES.imm +++ /dev/null @@ -1,112 +0,0 @@ - -NOTE: - -These files are incomplete. They do not yet form a working -implementation of hte concepts discused below. - - -OVERVIEW - -The t_dd_imm_* files form a set of templates to produce driver - -specific software tnl modules for a small subset of transformation and -lighting states. - -The approach is quite different to the large vertex buffers of the -src/tnl module, and is based around a cache of four recent vertices -and a 'current' vertex which is updated directly from the Color, -Normal, Texcoord, SecondaryColor and Fog entrypoints. - -The current vertex is actually a composite of the ctx->Current values -and a partial hardware vertex maintained where the hardware values -differ from those in ctx->Current. For example, clamped color values -are kept in the hardware vertex, while texcoords remain in -ctx->Current. - -A crude diagram: - - +--------------+ +-------------------+ - | ctx->Current | | Current-HW-vertex | - +--------------+ +-------------------+ - \ / - \ / - \ / - \ / - --------- -------- - | | - v v - +--------+ +--------+ +--------+ +--------+ - | vert-0 | | vert-1 | | vert-2 | | vert-3 | - +--------+ +--------+ +--------+ +--------+ - | - | - v - - DMA - - -Here values from ctx->Current and current-HW-vertex are merged to -build vert-2, which is then dumped to hardware (DMA). A state machine -determines which vertex is built in turn, and how the vertices are -used to present primitives to hardware. These actions all occur -during a call to Vertex{234}f{v}. - -Each vert-n includes clip coordinates and a clipmask in addition to -the hardware (window) coordinates. This information allows clipping -to take place directly on these vertices, if need be. - -t_dd_imm_capi.h - - Color{34}{fub}{v}() implementations. These update both - ctx->Current (unclamped float colors) and current-HW-vertex - with hardware-specific color values (typically unsigned - bytes). - - When lighting is enabled, the functions from src/api_noop.c - should be used, which just update ctx->Current. (The - current-hw-vertex colors are produced from lighting, which is - keyed to Normal3f). - -t_dd_imm_vb.c - - Support functions for clipping and fallback. See - t_dd_imm_primtmp.h. - -t_dd_imm_napi.c -t_dd_imm_napi.h - - Versions of Normal3f{v} to perform lighting with one or more - infinite lights. Updates ctx->Current.Normal and the current - HW colors. - - When lighting is disabled, use the functions from api_noop.c - instead. - - -t_dd_imm_primtmp.h - - State machine to control emission of vertices and primitives - to hardware. Called indirectly from Vertex{234}f{v}. Capable - of supporting hardware strip and fan primitives, and of - decomposing to discreet primitives for clipping or fallback, - or where the native primitive is unavailable. - -t_dd_imm_tapi.h - - Implementations of TexCoord{v} and MultiTexCoord4f{v}ARB to - fire a callback when transitioning to projective texture. - Most drivers will need to change vertex format at this point, - some may need to enable a software rasterization fallback. - -t_dd_imm_vapi.h - - Implementations of Vertex{234}f{v}. These perform - transformation and cliptesting on their arguments, then jump - into the state machine implemented in primtmp.h. - -t_dd_imm_vertex.h - - Support functions for building and clip-interpolating hardware - vertices. Called from primtmp.h. - - -Keith Whitwell, June 2001. \ No newline at end of file diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_capi.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_capi.h deleted file mode 100644 index eecbf0da5d..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_capi.h +++ /dev/null @@ -1,419 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - */ - -/* Template for immediate mode color functions. - * - * FIXME: Floating-point color versions of these... - */ - - -static void TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f); - CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f); - CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f); - CURRENT_COLOR( ACOMP ) = 1.0f; -#else - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b ); - CURRENT_COLOR( ACOMP ) = 255; -#endif -} - -static void TAG(Color3fv)( const GLfloat *v ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f); - CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f); - CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f); - CURRENT_COLOR( ACOMP ) = 1.0f; -#else - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] ); - CURRENT_COLOR( ACOMP ) = 255; -#endif -} - -static void TAG(Color3ub)( GLubyte r, GLubyte g, GLubyte b ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r ); - CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g ); - CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b ); - CURRENT_COLOR( ACOMP ) = 1.0f; -#else - CURRENT_COLOR( RCOMP ) = r; - CURRENT_COLOR( GCOMP ) = g; - CURRENT_COLOR( BCOMP ) = b; - CURRENT_COLOR( ACOMP ) = 255; -#endif -} - -static void TAG(Color3ubv)( const GLubyte *v ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] ); - CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] ); - CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] ); - CURRENT_COLOR( ACOMP ) = 1.0f; -#else - CURRENT_COLOR( RCOMP ) = v[0]; - CURRENT_COLOR( GCOMP ) = v[1]; - CURRENT_COLOR( BCOMP ) = v[2]; - CURRENT_COLOR( ACOMP ) = 255; -#endif -} - -static void TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f); - CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f); - CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f); - CURRENT_COLOR( ACOMP ) = CLAMP(a, 0.0f, 1.0f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), a ); -#endif -} - -static void TAG(Color4fv)( const GLfloat *v ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f); - CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f); - CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f); - CURRENT_COLOR( ACOMP ) = CLAMP(v[3], 0.0f, 1.0f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] ); - UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), v[3] ); -#endif -} - -static void TAG(Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r ); - CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g ); - CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b ); - CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( a ); -#else - CURRENT_COLOR( RCOMP ) = r; - CURRENT_COLOR( GCOMP ) = g; - CURRENT_COLOR( BCOMP ) = b; - CURRENT_COLOR( ACOMP ) = a; -#endif -} - -static void TAG(Color4ubv)( const GLubyte *v ) -{ - GET_CURRENT; -#ifdef COLOR_IS_FLOAT - CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] ); - CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] ); - CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] ); - CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( v[3] ); -#else - CURRENT_COLOR( RCOMP ) = v[0]; - CURRENT_COLOR( GCOMP ) = v[1]; - CURRENT_COLOR( BCOMP ) = v[2]; - CURRENT_COLOR( ACOMP ) = v[3]; -#endif -} - - -static void TAG(ColorMaterial3f)( GLfloat r, GLfloat g, GLfloat b ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = r; - color[1] = g; - color[2] = b; - color[3] = 1.0; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = v[0]; - color[1] = v[1]; - color[2] = v[2]; - color[3] = 1.0; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial3ub)( GLubyte r, GLubyte g, GLubyte b ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = UBYTE_TO_FLOAT( r ); - color[1] = UBYTE_TO_FLOAT( g ); - color[2] = UBYTE_TO_FLOAT( b ); - color[3] = 1.0; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial3ubv)( const GLubyte *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = UBYTE_TO_FLOAT( v[0] ); - color[1] = UBYTE_TO_FLOAT( v[1] ); - color[2] = UBYTE_TO_FLOAT( v[2] ); - color[3] = 1.0; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = r; - color[1] = g; - color[2] = b; - color[3] = a; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial4fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = v[0]; - color[1] = v[1]; - color[2] = v[2]; - color[3] = v[3]; - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = UBYTE_TO_FLOAT( r ); - color[1] = UBYTE_TO_FLOAT( g ); - color[2] = UBYTE_TO_FLOAT( b ); - color[3] = UBYTE_TO_FLOAT( a ); - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - -static void TAG(ColorMaterial4ubv)( const GLubyte *v ) -{ - GET_CURRENT_CONTEXT(ctx); - GLfloat *color = ctx->Current.Color; - - color[0] = UBYTE_TO_FLOAT( v[0] ); - color[1] = UBYTE_TO_FLOAT( v[1] ); - color[2] = UBYTE_TO_FLOAT( v[2] ); - color[3] = UBYTE_TO_FLOAT( v[3] ); - - _mesa_update_color_material( ctx, color ); - RECALC_BASE_COLOR( ctx ); -} - - - - - -/* ============================================================= - * Color chooser functions: - */ - -static void TAG(choose_Color3f)( GLfloat r, GLfloat g, GLfloat b ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color3f(ctx->Exec, TAG(ColorMaterial3f)); - } else { - SET_Color3f(ctx->Exec, _mesa_noop_Color3f); - } - } else { - SET_Color3f(ctx->Exec, TAG(Color3f)); - } - glColor3f( r, g, b ); -} - -static void TAG(choose_Color3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color3fv(ctx->Exec, TAG(ColorMaterial3fv)); - } else { - SET_Color3fv(ctx->Exec, _mesa_noop_Color3fv); - } - } else { - SET_Color3fv(ctx->Exec, TAG(Color3fv)); - } - glColor3fv( v ); -} - -static void TAG(choose_Color3ub)( GLubyte r, GLubyte g, GLubyte b ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color3ub(ctx->Exec, TAG(ColorMaterial3ub)); - } else { - SET_Color3ub(ctx->Exec, _mesa_noop_Color3ub); - } - } else { - SET_Color3ub(ctx->Exec, TAG(Color3ub)); - } - glColor3ub( r, g, b ); -} - -static void TAG(choose_Color3ubv)( const GLubyte *v ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color3ubv(ctx->Exec, TAG(ColorMaterial3ubv)); - } else { - SET_Color3ubv(ctx->Exec, _mesa_noop_Color3ubv); - } - } else { - SET_Color3ubv(ctx->Exec, TAG(Color3ubv)); - } - glColor3ubv( v ); -} - -static void TAG(choose_Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color4f(ctx->Exec, TAG(ColorMaterial4f)); - } else { - SET_Color4f(ctx->Exec, _mesa_noop_Color4f); - } - } else { - SET_Color4f(ctx->Exec, TAG(Color4f)); - } - glColor4f( r, g, b, a ); -} - -static void TAG(choose_Color4fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color4fv(ctx->Exec, TAG(ColorMaterial4fv)); - } else { - SET_Color4fv(ctx->Exec, _mesa_noop_Color4fv); - } - } else { - SET_Color4fv(ctx->Exec, TAG(Color4fv)); - } - glColor4fv( v ); -} - -static void TAG(choose_Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color4ub(ctx->Exec, TAG(ColorMaterial4ub)); - } else { - SET_Color4ub(ctx->Exec, _mesa_noop_Color4ub); - } - } else { - SET_Color4ub(ctx->Exec, TAG(Color4ub)); - } - glColor4ub( r, g, b, a ); -} - -static void TAG(choose_Color4ubv)( const GLubyte *v ) -{ - GET_CURRENT_CONTEXT(ctx); - - if ( ctx->Light.Enabled ) { - if ( ctx->Light.ColorMaterialEnabled ) { - SET_Color4ubv(ctx->Exec, TAG(ColorMaterial4ubv)); - } else { - SET_Color4ubv(ctx->Exec, _mesa_noop_Color4ubv); - } - } else { - SET_Color4ubv(ctx->Exec, TAG(Color4ubv)); - } - glColor4ubv( v ); -} - - - -#undef GET_CURRENT -#undef CURRENT_COLOR -#undef CURRENT_SPECULAR -#undef COLOR_IS_FLOAT -#undef RECALC_BASE_COLOR -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_napi.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_napi.h deleted file mode 100644 index 9844f615ff..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_napi.h +++ /dev/null @@ -1,226 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - * Keith Whitwell - */ - -/* Template for immediate mode normal functions. Optimize for infinite - * lights when doing software lighting. - */ - -static void TAG(Normal3f_single)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_VERTEX; - const struct gl_light *light = ctx->Light.EnabledList.prev; - GLfloat n_dot_h, n_dot_VP, spec, sum[3]; - GLfloat *normal = ctx->Current.Normal; - GLfloat scale = 1.0; - - ASSIGN_3V( normal, x, y, z ); - COPY_3V( sum, BASE_COLOR ); - - if ( IND & NORM_RESCALE ) { - scale = ctx->_ModelViewInvScale; - } else if ( IND & NORM_NORMALIZE ) { - scale = LEN_3FV( normal ); - if ( scale != 0.0 ) scale = 1.0 / scale; - } - - n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale; - if ( n_dot_VP > 0.0F ) { - ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); - n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale; - if ( n_dot_h > 0.0F ) { - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); - } - } - -#ifdef LIT_COLOR_IS_FLOAT - LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); - LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); - LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); -#endif - LIT_COLOR( ACOMP ) = LIT_ALPHA; -} - -static void TAG(Normal3fv_single)( const GLfloat *normal ) -{ - GET_CURRENT_VERTEX; - const struct gl_light *light = ctx->Light.EnabledList.prev; - GLfloat n_dot_h, n_dot_VP, spec, sum[3]; - GLfloat scale = 1.0; - - COPY_3V( ctx->Current.Normal, normal ); - COPY_3V( sum, BASE_COLOR ); - - if ( IND & NORM_RESCALE ) { - scale = ctx->_ModelViewInvScale; - } else if ( IND & NORM_NORMALIZE ) { - scale = LEN_3FV( normal ); - if ( scale != 0.0 ) scale = 1.0 / scale; - } - - n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale; - if ( n_dot_VP > 0.0F ) { - ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); - n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale; - if ( n_dot_h > 0.0F ) { - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); - } - } - -#ifdef LIT_COLOR_IS_FLOAT - LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); - LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); - LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); -#endif - LIT_COLOR( ACOMP ) = LIT_ALPHA; -} - - -static void TAG(Normal3f_multi)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_VERTEX; - struct gl_light *light; - GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3]; - GLfloat *normal; - - ASSIGN_3V( ctx->Current.Normal, x, y, z ); - COPY_3V( sum, BASE_COLOR ); - - if ( IND & NORM_RESCALE ) { - normal = tmp; - ASSIGN_3V( normal, x, y, z ); - SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale ); - } else if ( IND & NORM_NORMALIZE ) { - normal = tmp; - ASSIGN_3V( normal, x, y, z ); - NORMALIZE_3FV( normal ); - } else { - normal = ctx->Current.Normal; - } - - foreach ( light, &ctx->Light.EnabledList ) { - n_dot_VP = DOT3( normal, light->_VP_inf_norm ); - if ( n_dot_VP > 0.0F ) { - ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); - n_dot_h = DOT3( normal, light->_h_inf_norm ); - if ( n_dot_h > 0.0F ) { - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); - } - } - } - -#ifdef LIT_COLOR_IS_FLOAT - LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); - LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); - LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); -#endif - LIT_COLOR( ACOMP ) = LIT_ALPHA; -} - -static void TAG(Normal3fv_multi)( const GLfloat *n ) -{ - GET_CURRENT_VERTEX; - struct gl_light *light; - GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3]; - GLfloat *normal; - - COPY_3V( ctx->Current.Normal, n ); - COPY_3V( sum, BASE_COLOR ); - - if ( IND & NORM_RESCALE ) { - normal = tmp; - COPY_3V( normal, n ); - SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale ); - } else if ( IND & NORM_NORMALIZE ) { - normal = tmp; - COPY_3V( normal, n ); - NORMALIZE_3FV( normal ); - } else { - normal = ctx->Current.Normal; - } - - foreach ( light, &ctx->Light.EnabledList ) { - n_dot_VP = DOT3( normal, light->_VP_inf_norm ); - if ( n_dot_VP > 0.0F ) { - ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); - n_dot_h = DOT3( normal, light->_h_inf_norm ); - if ( n_dot_h > 0.0F ) { - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); - ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); - } - } - } - -#ifdef LIT_COLOR_IS_FLOAT - LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); - LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); - LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); -#else - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); - UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); -#endif - LIT_COLOR( ACOMP ) = LIT_ALPHA; -} - - - -static void TAG(init_norm)( void ) -{ - norm_tab[IND].normal3f_single = TAG(Normal3f_single); - norm_tab[IND].normal3fv_single = TAG(Normal3fv_single); - norm_tab[IND].normal3f_multi = TAG(Normal3f_multi); - norm_tab[IND].normal3fv_multi = TAG(Normal3fv_multi); -} - - - -#ifndef PRESERVE_NORMAL_DEFS -#undef GET_CURRENT -#undef GET_CURRENT_VERTEX -#undef LIT_COLOR -#undef LIT_COLOR_IS_FLOAT -#endif -#undef PRESERVE_NORMAL_DEFS -#undef IND -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_primtmp.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_primtmp.h deleted file mode 100644 index 97dca3fd42..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_primtmp.h +++ /dev/null @@ -1,570 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - * Gareth Hughes - */ - -/* Template for immediate mode vertices. - * - * Probably instantiate once for each vertex format used: - * - TINY_VERTICES - * - TEX0_VERTICES - * - TEX1_VERTICES - * - PTEX_VERTICES - * - * Have to handle TEX->PTEX transition somehow. - */ - -#define DBG 0 - - - -/* ============================================================= - * GL_POINTS - */ - -static void TAG(flush_point_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - if ( !v0->mask ) { - LOCAL_VARS; - DRAW_POINT( v0 ); - } -} - - -/* ============================================================= - * GL_LINES - */ - -static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_line_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - FLUSH_VERTEX = TAG(flush_line_1); - ACTIVE_VERTEX = IMM_VERTICES( 1 ); -} - -static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v1 = v0 - 1; - ACTIVE_VERTEX = IMM_VERTICES( 0 ); - FLUSH_VERTEX = TAG(flush_line_0); - if (FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_LINE( ctx, v1, v0 ); - else - DRAW_LINE( ctx, v1, v0 ); -} - - -/* ============================================================= - * GL_LINE_LOOP - */ - -static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_line_loop_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_line_loop_1); -} - -#define DRAW_LINELOOP_LINE( a, b ) \ - if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) { \ - CLIP_OR_DRAW_LINE( ctx, a, b ); \ - } else if (EXTEND_PRIM( 1 )) { \ - EMIT_VERTEX( b ); \ - } else { \ - BEGIN_PRIM( GL_LINE_STRIP, 2 ); \ - EMIT_VERTEX( a ); \ - EMIT_VERTEX( b ); \ - } - -static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v1 = v0 - 1; - ACTIVE_VERTEX = v1; - FLUSH_VERTEX = TAG(flush_line_loop_2); - DRAW_LINELOOP_LINE( v1, v0 ); -} - -static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v1 = v0 + 1; - ACTIVE_VERTEX = v1; - FLUSH_VERTEX = TAG(flush_line_loop_1); - DRAW_LINELOOP_LINE( v1, v0 ); -} - -static void TAG(end_line_loop)( GLcontext *ctx ) -{ - LOCAL_VARS; - - if ( FLUSH_VERTEX != TAG(flush_line_loop_0) ) { - TNL_VERTEX *v1 = ACTIVE_VERTEX; - TNL_VERTEX *v0 = IMM_VERTICES( 0 ); - DRAW_LINELOOP_LINE( v1, v0 ); - } -} - - - -/* ============================================================= - * GL_LINE_STRIP - */ - -static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_line_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_line_strip_0b); -} - - -static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v1 = v0 - 1; - - ACTIVE_VERTEX = v1; - FLUSH_VERTEX = TAG(flush_line_strip_2); - - if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_LINE( ctx, v1, v0 ); - else if (EXTEND_PRIM( 1 )) { - EMIT_VERTEX( v0 ); - } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); - EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } -} - -static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v1 = v0 + 1; - - ACTIVE_VERTEX = v1; - FLUSH_VERTEX = TAG(flush_line_strip_1); - - if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_LINE( ctx, v1, v0 ); - else if (EXTEND_PRIM( 1 )) { - EMIT_VERTEX( v0 ); - } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); - EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } -} - - - -/* ============================================================= - * GL_TRIANGLES - */ - -static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_triangle_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_triangle_1); - BEGIN_PRIM( GL_TRIANGLES, 0 ); -} - -static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_triangle_2); -} - -static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v2 = v0 - 2; - TNL_VERTEX *v1 = v0 - 1; - - if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); - - ACTIVE_VERTEX = v2; - FLUSH_VERTEX = TAG(flush_triangle_0); - - /* nothing gained by trying to emit as hw primitives -- that - * happens normally in this case. - */ - if (FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); - else - DRAW_TRI( ctx, v2, v1, v0 ); -} - - - - -/* ============================================================= - * GL_TRIANGLE_STRIP - */ - -static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_tri_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 1 ); - FLUSH_VERTEX = TAG(flush_tri_strip_1); -} - -static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 2 ); - FLUSH_VERTEX = TAG(flush_tri_strip_2); -} - -#define DO_TRISTRIP_TRI( vert0, vert1 ) \ - if (!HAVE_TRI_STRIP || FALLBACK_OR_CLIPPING) { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - TAG(draw_tri)( ctx, v2, v1, v0 ); \ - } else if (EXTEND_PRIM( 1 )) { \ - EMIT_VERTEX( v0 ); \ - } else { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - BEGIN_PRIM( GL_TRIANGLE_STRIP, 3 ); \ - EMIT_VERTEX( v2 ); \ - EMIT_VERTEX( v1 ); \ - EMIT_VERTEX( v0 ); \ - } - -static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - FLUSH_VERTEX = TAG(flush_tri_strip_3); - ACTIVE_VERTEX = IMM_VERTICES( 3 ); - DO_TRISTRIP_TRI( 0, 1 ); -} - -static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - FLUSH_VERTEX = TAG(flush_tri_strip_4); - ACTIVE_VERTEX = IMM_VERTICES( 0 ); - DO_TRISTRIP_TRI( 1, 2 ); -} - -static void TAG(flush_tri_strip_4)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - FLUSH_VERTEX = TAG(flush_tri_strip_5); - ACTIVE_VERTEX = IMM_VERTICES( 1 ); - DO_TRISTRIP_TRI( 2, 3 ); -} - -static void TAG(flush_tri_strip_5)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - FLUSH_VERTEX = TAG(flush_tri_strip_2); - ACTIVE_VERTEX = IMM_VERTICES( 2 ); - DO_TRISTRIP_TRI( 0, 3 ); -} - - - -/* ============================================================= - * GL_TRIANGLE_FAN - */ - -static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_tri_fan_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_tri_fan_1); -} - -static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - ACTIVE_VERTEX = v0 + 1; - FLUSH_VERTEX = TAG(flush_tri_fan_2); -} - -#define DO_TRIFAN_TRI( vert0, vert1 ) \ - if (!HAVE_TRI_FAN || FALLBACK_OR_CLIPPING) { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - TAG(draw_tri)( ctx, v2, v1, v0 ); \ - } else if (EXTEND_PRIM( 1 )) { \ - EMIT_VERTEX( v0 ); \ - } else { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - BEGIN_PRIM( GL_TRIANGLE_FAN, 3 ); \ - EMIT_VERTEX( v2 ); \ - EMIT_VERTEX( v1 ); \ - EMIT_VERTEX( v0 ); \ - } - -static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 1 ); - FLUSH_VERTEX = TAG(flush_tri_fan_3 ); - DO_TRIFAN_TRI( 0, 1 ); -} - -static void TAG(flush_tri_fan_3)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 2 ); - FLUSH_VERTEX = TAG(flush_tri_fan_2 ); - DO_TRIFAN_TRI( 0, 2 ); -} - - - -/* ============================================================= - * GL_QUADS - */ - -static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_quad_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_1); -} - -static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_2); -} - -static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_3); -} - -static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v3 = v0 - 3; - TNL_VERTEX *v2 = v0 - 2; - TNL_VERTEX *v1 = v0 - 1; - - IMM_VERTEX( v0 ) = v3; - FLUSH_VERTEX = TAG(flush_quad_0); - - if (!HAVE_HW_QUADS || FALLBACK_OR_CLIPPING) { - CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 ); - CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); - } else { - EXTEND_PRIM_NF( GL_QUADS, 4 ); - EMIT_VERTEX( v3 ); - EMIT_VERTEX( v2 ); - EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } -} - - - -/* ============================================================= - * GL_QUAD_STRIP - */ - -static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_quad_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - IMM_VERTEX( v3 ) = v0; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_strip_1); -} - -static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - IMM_VERTEX( v2 ) = v0; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_strip_2); -} - -static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - - IMM_VERTEX( v1 ) = v0; - IMM_VERTEX( v0 ) = v0 + 1; - FLUSH_VERTEX = TAG(flush_quad_strip_3); -} - -static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - TNL_VERTEX *v3 = IMM_VERTEX( v3 ); - TNL_VERTEX *v2 = IMM_VERTEX( v2 ); - TNL_VERTEX *v1 = IMM_VERTEX( v1 ); - - IMM_VERTEX( v0 ) = v3; - IMM_VERTEX( v2 ) = v0; - IMM_VERTEX( v3 ) = v1; - FLUSH_VERTEX = TAG(flush_quad_strip_2); - - if (FALLBACK_OR_CLIPPING) { - CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 ); - CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); - } else { - DRAW_TRI( ctx, v3, v2, v0 ); - DRAW_TRI( ctx, v2, v1, v0 ); - } -} - - - -/* ============================================================= - * GL_POLYGON - */ - -static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 ); -static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 ); - -static void TAG(flush_poly_0)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 1 ); - FLUSH_VERTEX = TAG(flush_poly_1); -} - -static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 2 ); - FLUSH_VERTEX = TAG(flush_poly_2); -} - -#define DO_POLY_TRI( vert0, vert1 ) \ - if (!HAVE_POLYGONS || FALLBACK_OR_CLIPPING) { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - TAG(draw_tri)( ctx, v1, v0, v2 ); \ - } else if (EXTEND_PRIM( 1 )) { \ - EMIT_VERTEX( v0 ); \ - } else { \ - TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ - TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ - BEGIN_PRIM( GL_POLYGON, 3 ); \ - EMIT_VERTEX( v2 ); \ - EMIT_VERTEX( v1 ); \ - EMIT_VERTEX( v0 ); \ - } - -static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 1 ); - FLUSH_VERTEX = TAG(flush_poly_3); - DO_POLY_TRI( 0, 1 ); -} - -static void TAG(flush_poly_3)( GLcontext *ctx, TNL_VERTEX *v0 ) -{ - LOCAL_VARS; - ACTIVE_VERTEX = IMM_VERTICES( 2 ); - FLUSH_VERTEX = TAG(flush_poly_2); - DO_POLY_TRI( 0, 2 ); -} - - -void (*TAG(flush_tab)[GL_POLYGON+1])( GLcontext *, TNL_VERTEX * ) = -{ - TAG(flush_point), - TAG(flush_line_0), - TAG(flush_line_loop_0), - TAG(flush_line_strip_0), - TAG(flush_triangle_0), - TAG(flush_tri_strip_0), - TAG(flush_tri_fan_0), - TAG(flush_quad_0), - TAG(flush_quad_strip_0), - TAG(flush_poly_0), -}; - - -#ifndef PRESERVE_PRIM_DEFS -#undef LOCAL_VARS -#undef GET_INTERP_FUNC -#undef IMM_VERTEX -#undef IMM_VERTICES -#undef FLUSH_VERTEX -#endif -#undef PRESERVE_PRIM_DEFS -#undef EXTEND_PRIM -#undef EMIT_VERTEX -#undef EMIT_VERTEX_TRI -#undef EMIT_VERTEX_LINE -#undef EMIT_VERTEX_POINT -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_tapi.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_tapi.h deleted file mode 100644 index b82a9abebf..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_tapi.h +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - * Keith Whitwell - */ - -/* Template for immediate mode texture coordinate functions. - */ - -#ifndef DO_PROJ_TEX -#error "Need to define DO_PROJ_TEX" -#endif - - -/* ============================================================= - * Notify on calls to texture4f, to allow switch to projected texture - * vertex format: - */ - -static void TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) -{ - GET_CURRENT; - DO_PROJ_TEX; - TEXCOORD4( s, t, r, q ); -} - -static void TAG(TexCoord4fv)( const GLfloat *v ) -{ - GET_CURRENT; - DO_PROJ_TEX; - TEXCOORD4( v[0], v[1], v[2], v[3] ); -} - -static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s, - GLfloat t, GLfloat r, GLfloat q ) -{ - GET_CURRENT; - DO_PROJ_TEX; - MULTI_TEXCOORD4( unit, s, t, r, q ); -} - -static void TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *v ) -{ - GET_CURRENT; - DO_PROJ_TEX; - MULTI_TEXCOORD4( unit, v[0], v[1], v[2], v[3] ); -} - - - -#undef DO_PROJ_TEX -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vapi.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vapi.h deleted file mode 100644 index 95e93b1c83..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vapi.h +++ /dev/null @@ -1,159 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - * Keith Whitwell - */ - -/* Template for immediate mode vertex functions. - */ - -#define DBG 0 - -#define VERTEX( ox, oy, oz, ow ) -do { - GET_CURRENT_VERTEX; - GLfloat w; - GLuint mask; - const GLfloat * const m = ctx->_ModelProjectMatrix.m; - - if (DO_FULL_MATRIX) { - VERTEX_CLIP(0) = m[0] * ox + m[4] * oy + m[8] * oz + m[12] * ow; - VERTEX_CLIP(1) = m[1] * ox + m[5] * oy + m[9] * oz + m[13] * ow; - VERTEX_CLIP(2) = m[2] * ox + m[6] * oy + m[10] * oz + m[14] * ow; - VERTEX_CLIP(3) = m[3] * ox + m[7] * oy + m[11] * oz + m[15] * ow; - w = VERTEX_CLIP(3); - } - else if (DO_NOROT_MATRIX) { - VERTEX_CLIP(0) = m[0] * ox + m[12] * ow; - VERTEX_CLIP(1) = m[5] * oy + m[13] * ow; - VERTEX_CLIP(2) = m[10] * oz + m[14] * ow; - VERTEX_CLIP(3) = ow; - w = ow; - } - else { - ASSERT (DO_IDENTITY_MATRIX); - VERTEX_CLIP(0) = ox; - VERTEX_CLIP(1) = oy; - VERTEX_CLIP(2) = oz; - VERTEX_CLIP(3) = ow; - w = ow; - } - - mask = 0; - if (DO_CLIP_TEST) { - if ( VERTEX_CLIP(0) > w ) mask |= CLIP_RIGHT_BIT; - if ( VERTEX_CLIP(0) < -w ) mask |= CLIP_LEFT_BIT; - if ( VERTEX_CLIP(1) > w ) mask |= CLIP_TOP_BIT; - if ( VERTEX_CLIP(1) < -w ) mask |= CLIP_BOTTOM_BIT; - if ( VERTEX_CLIP(2) > w ) mask |= CLIP_FAR_BIT; - if ( VERTEX_CLIP(2) < -w ) mask |= CLIP_NEAR_BIT; - VERTEX_MASK(v) = mask; - } - - if (!mask) { - if (HAVE_VERTEX_WIN) { - if (!HAVE_HW_VIEWPORT) { - const GLfloat *s = GET_VIEWPORT_MATRIX(); - if (HAVE_W && HAVE_HW_DIVIDE) { - VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) + s[12]; - VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) + s[13]; - VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) + s[14]; - VERTEX_WIN( 3 ) = w; - } - else { - const GLfloat oow = 1.0/w; /* possibly opt away */ - VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) * oow + s[12]; - VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) * oow + s[13]; - VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) * oow + s[14]; - if (HAVE_W) - VERTEX_WIN( 3 ) = oow; - } - } - else if (HAVE_W && HAVE_HW_DIVIDE) { - if (!VERTEX_WIN_IS_VERTEX_CLIP) { - VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 ); - VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 ); - VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 ); - VERTEX_WIN( 3 ) = w; - } - } - else { - const GLfloat oow = 1.0/w; /* possibly opt away */ - VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 ) * oow; - VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 ) * oow; - VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 ) * oow; - if (HAVE_W) - VERTEX_WIN( 3 ) = oow; - } - } - } else if (!FALLBACK_OR_CLIPPING) { - SET_CLIPPING(); /* transition to clipping */ - } - - COPY_VERTEX_FROM_CURRENT; - BUILD_PRIM_FROM_VERTEX; -} - -/* Let the compiler optimize away the constant operations: - */ -static void VTAG(Vertex2f)( GLfloat ox, GLfloat oy ) -{ - /* Cliptest on clip[2] could also be eliminated... - */ - VERTEX( ox, oy, 0, 1 ); -} - -static void VTAG(Vertex2fv)( const GLfloat *obj ) -{ - /* Cliptest on clip[2] could also be eliminated... - */ - VERTEX( obj[0], obj[1], 0, 1 ); -} - -static void VTAG(Vertex3f)( GLfloat ox, GLfloat oy, GLfloat oz ) -{ - VERTEX( ox, oy, oz, 1 ); -} - -static void VTAG(Vertex3fv)( const GLfloat *obj ) -{ - VERTEX( obj[0], obj[1], obj[2], 1 ); -} - -static void VTAG(Vertex4f)( GLfloat ox, GLfloat oy, GLfloat oz, GLfloat ow ) -{ - VERTEX( ox, oy, oz, ow ); -} - -static void VTAG(Vertex4fv)( const GLfloat *obj ) -{ - VERTEX( obj[0], obj[1], obj[2], obj[3] ); -} - - -#undef DO_FULL_MATRIX -#undef VTAG -#undef VERTEX diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vb.c b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vb.c deleted file mode 100644 index 0c4462f556..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vb.c +++ /dev/null @@ -1,204 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -/* Template to build clipping routines to support t_dd_imm_primtmp.h. - * - * The TAG(draw_line) and TAG(draw_triangle) routines are called in - * clipping and fallback scenarios, and when the native hardware - * primitive (eg polygons) is unavailable. - */ - - -#define CLIP_DOTPROD(K, A, B, C, D) \ - (CLIP_X(K)*A + CLIP_Y(K)*B + \ - CLIP_Z(K)*C + CLIP_W(K)*D) - -#define POLY_CLIP( PLANE, A, B, C, D ) \ -do { \ - if (mask & PLANE) { \ - TNL_VERTEX **indata = inlist[in]; \ - TNL_VERTEX **outdata = inlist[in ^= 1]; \ - TNL_VERTEX *J = indata[0]; \ - GLfloat dpJ = CLIP_DOTPROD(J, A, B, C, D ); \ - GLuint outcount = 0; \ - GLuint i; \ - \ - indata[n] = indata[0]; /* prevent rotation of vertices */ \ - for (i = 1; i <= n; i++) { \ - TNL_VERTEX *I = indata[i]; \ - GLfloat dpI = CLIP_DOTPROD(idx, A, B, C, D ); \ - \ - if (!NEGATIVE(dpPrev)) { \ - outdata[outcount++] = J; \ - } \ - \ - if (DIFFERENT_SIGNS(dpI, dpJ)) { \ - TNL_VERTEX *O = verts++; \ - outdata[outcount++] = O; \ - if (NEGATIVE(dpI)) { \ - /* Going out of bounds. Avoid division by zero as we \ - * know dp != dpPrev from DIFFERENT_SIGNS, above. \ - */ \ - GLfloat t = dpI / (dpI - dpJ); \ - INTERP( ctx, t, O, I, J ); \ - } else { \ - /* Coming back in. \ - */ \ - GLfloat t = dpJ / (dpJ - dpI); \ - INTERP( ctx, t, O, J, I ); \ - } \ - } \ - \ - J = I; \ - dpJ = dpI; \ - } \ - \ - if (outcount < 3) \ - return; \ - \ - nr = outcount; \ - } \ -} while (0) - - -#define LINE_CLIP(PLANE, A, B, C, D ) \ -do { \ - if (mask & PLANE) { \ - GLfloat dpI = CLIP_DOTPROD( I, A, B, C, D ); \ - GLfloat dpJ = CLIP_DOTPROD( J, A, B, C, D ); \ - \ - if (DIFFERENT_SIGNS(dpI, dpJ)) { \ - TNL_VERTEX *O = verts++; \ - if (NEGATIVE(dpJ)) { \ - GLfloat t = dpI / (dpI - dpJ); \ - INTERP( ctx, t, O, I, J ); \ - J = O; \ - } else { \ - GLfloat t = dpJ / (dpJ - dpI); \ - INTERP( ctx, t, O, J, I ); \ - I = O; \ - } \ - } \ - else if (NEGATIVE(dpI)) \ - return; \ - } \ -} while (0) - - - -/* Clip a line against the viewport and user clip planes. - */ -static void TAG(clip_draw_line)( GLcontext *ctx, - TNL_VERTEX *I, - TNL_VERTEX *J, - GLuint mask ) -{ - LOCAL_VARS; - GET_INTERP_FUNC; - TNL_VERTEX tmp[MAX_CLIPPED_VERTICES]; - TNL_VERTEX *verts = tmp; - TNL_VERTEX *pv = J; - - LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); - LINE_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); - LINE_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); - LINE_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); - LINE_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); - LINE_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - - if ((ctx->_TriangleCaps & DD_FLATSHADE) && J != pv) - COPY_PV( ctx, J, pv ); - - DRAW_LINE( I, J ); -} - - -/* Clip a triangle against the viewport and user clip planes. - */ -static void TAG(clip_draw_triangle)( GLcontext *ctx, - TNL_VERTEX *v0, - TNL_VERTEX *v1, - TNL_VERTEX *v2, - GLuint mask ) -{ - LOCAL_VARS; - GET_INTERP_FUNC; - TNL_VERTEX tmp[MAX_CLIPPED_VERTICES]; - TNL_VERTEX *verts = tmp; - TNL_VERTEX *(inlist[2][MAX_CLIPPED_VERTICES]); - TNL_VERTEX **out; - GLuint in = 0; - GLuint n = 3; - GLuint i; - - ASSIGN_3V(inlist, v2, v0, v1 ); /* pv rotated to slot zero */ - - POLY_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); - POLY_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); - POLY_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); - POLY_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); - POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); - POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - - if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) - COPY_PV( ctx, inlist[0], v2 ); - - out = inlist[in]; - DRAW_POLYGON( out, n ); -} - - -static __inline void TAG(draw_triangle)( GLcontext *ctx, - TNL_VERTEX *v0, - TNL_VERTEX *v1, - TNL_VERTEX *v2 ) -{ - LOCAL_VARS; - GLubyte ormask = (v0->mask | v1->mask | v2->mask); - - if ( !ormask ) { - DRAW_TRI( v0, v1, v2 ); - } else if ( !(v0->mask & v1->mask & v2->mask) ) { - TAG(clip_draw_triangle)( ctx, v0, v1, v2, ormask ); - } -} - -static __inline void TAG(draw_line)( GLcontext *ctx, - TNL_VERTEX *v0, - TNL_VERTEX *v1 ) -{ - LOCAL_VARS; - GLubyte ormask = (v0->mask | v1->mask); - - if ( !ormask ) { - DRAW_LINE( v0, v1 ); - } else if ( !(v0->mask & v1->mask) ) { - TAG(clip_draw_line)( ctx, v0, v1, ormask ); - } -} - diff --git a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h b/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h deleted file mode 100644 index 2f76553cff..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h +++ /dev/null @@ -1,268 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -/* Template to build support for t_dd_imm_* tnl module using vertices - * as defined in t_dd_vertex.h. - * - * See t_dd_vbtmp.h for definitions of arguments to this file. - * Unfortunately it seems necessary to duplicate a lot of that code. - */ - -#ifndef LOCALVARS -#define LOCALVARS -#endif - - - -/* COPY_VERTEX_FROM_CURRENT in t_dd_imm_vapi.c - */ -static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v ) -{ - LOCALVARS - ; - - /* This template assumes (like t_dd_vbtmp.h) that color is ubyte. - */ - if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) - { - const GLubyte *col = GET_HARDWARE_COLOR(); - if (HAVE_RGBA_COLOR) { - v->v.ui[4] = *(GLuint *)&col; - } else { - v->v.color.blue = col[2]; - v->v.color.green = col[1]; - v->v.color.red = col[0]; - v->v.color.alpha = col[3]; - } - } - else { - if (HAVE_RGBA_COLOR) { - v->v.ui[3] = *(GLuint *)col; - } - else { - v->tv.color.blue = col[2]; - v->tv.color.green = col[1]; - v->tv.color.red = col[0]; - v->tv.color.alpha = col[3]; - } - } - - if (DO_TEX0) { - GLfloat *tc = ctx->Current.Texture[0]; - v->v.u0 = tc[0]; - v->v.v0 = tc[1]; - if (DO_PTEX) { - if (HAVE_PTEX_VERTICES) { - v->pv.q0 = tc[3]; - } - else { - float rhw = 1.0 / tc[3]; - v->v.w *= tc[3]; - v->v.u0 *= rhw; - v->v.v0 *= rhw; - } - } - } - if (DO_TEX1) { - GLfloat *tc = ctx->Current.Texture[1]; - if (DO_PTEX) { - v->pv.u1 = tc[0]; - v->pv.v1 = tc[1]; - v->pv.q1 = tc[3]; - } - else { - v->v.u1 = tc[0]; - v->v.v1 = tc[1]; - } - } - else if (DO_PTEX) { - *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ - } - if (DO_TEX2) { - GLfloat *tc = ctx->Current.Texture[2]; - if (DO_PTEX) { - v->pv.u2 = tc[0]; - v->pv.v2 = tc[1]; - v->pv.q2 = tc[3]; - } - else { - v->v.u2 = tc[0]; - v->v.v2 = tc[1]; - } - } - if (DO_TEX3) { - GLfloat *tc = ctx->Current.Texture[3]; - if (DO_PTEX) { - v->pv.u3 = tc[0]; - v->pv.v3 = tc[1]; - v->pv.q3 = tc[3]; - } - else { - v->v.u3 = tc[0]; - v->v.v3 = tc[1]; - } - } -} - - - - -static void TAG(interp)( GLcontext *ctx, - GLfloat t, - TNL_VERTEX *dst, - TNL_VERTEX *in, - TNL_VERTEX *out ) -{ - LOCALVARS - const GLfloat *s = GET_VIEWPORT_MAT(); - GLfloat w; - - (void)s; - - if (HAVE_HW_DIVIDE) { - VIEWPORT_X( dst->v.v.x, dst->clip[0] ); - VIEWPORT_Y( dst->v.v.y, dst->clip[1] ); - VIEWPORT_Z( dst->v.v.z, dst->clip[2] ); - w = dstclip[3]; - } - else { - w = 1.0 / dst->clip[3]; - VIEWPORT_X( dst->v.v.x, dst->clip[0] * w ); - VIEWPORT_Y( dst->v.v.y, dst->clip[1] * w ); - VIEWPORT_Z( dst->v.v.z, dst->clip[2] * w ); - } - - if (HAVE_HW_DIVIDE || DO_TEX0) { - - dst->v.v.w = w; - - INTERP_UB( t, dst->v.ub4[4][0], out->v.ub4[4][0], in->v.ub4[4][0] ); - INTERP_UB( t, dst->v.ub4[4][1], out->v.ub4[4][1], in->v.ub4[4][1] ); - INTERP_UB( t, dst->v.ub4[4][2], out->v.ub4[4][2], in->v.ub4[4][2] ); - INTERP_UB( t, dst->v.ub4[4][3], out->v.ub4[4][3], in->v.ub4[4][3] ); - - if (DO_TEX0) { - if (DO_PTEX) { - if (HAVE_PTEX_VERTICES) { - INTERP_F( t, dst->v.pv.u0, out->v.pv.u0, in->v.pv.u0 ); - INTERP_F( t, dst->v.pv.v0, out->v.pv.v0, in->v.pv.v0 ); - INTERP_F( t, dst->v.pv.q0, out->v.pv.q0, in->v.pv.q0 ); - } else { - GLfloat wout = out->clip[3]; /* projected clip */ - GLfloat win = in->clip[3]; /* projected clip */ - GLfloat qout = out->v.pv.w / wout; - GLfloat qin = in->v.pv.w / win; - GLfloat qdst, rqdst; - - ASSERT( !HAVE_HW_DIVIDE ); /* assert win, wout projected clip */ - - INTERP_F( t, dst->v.v.u0, out->v.v.u0 * qout, in->v.v.u0 * qin ); - INTERP_F( t, dst->v.v.v0, out->v.v.v0 * qout, in->v.v.v0 * qin ); - INTERP_F( t, qdst, qout, qin ); - - rqdst = 1.0 / qdst; - dst->v.v.u0 *= rqdst; - dst->v.v.v0 *= rqdst; - dst->v.v.w *= rqdst; - } - } - else { - INTERP_F( t, dst->v.v.u0, out->v.v.u0, in->v.v.u0 ); - INTERP_F( t, dst->v.v.v0, out->v.v.v0, in->v.v.v0 ); - } - } - if (DO_TEX1) { - if (DO_PTEX) { - INTERP_F( t, dst->v.pv.u1, out->v.pv.u1, in->v.pv.u1 ); - INTERP_F( t, dst->v.pv.v1, out->v.pv.v1, in->v.pv.v1 ); - INTERP_F( t, dst->v.pv.q1, out->v.pv.q1, in->v.pv.q1 ); - } else { - INTERP_F( t, dst->v.v.u1, out->v.v.u1, in->v.v.u1 ); - INTERP_F( t, dst->v.v.v1, out->v.v.v1, in->v.v.v1 ); - } - } - else if (DO_PTEX) { - dst->v.pv.q0 = 0.0; /* must be a valid float on radeon */ - } - if (DO_TEX2) { - if (DO_PTEX) { - INTERP_F( t, dst->v.pv.u2, out->v.pv.u2, in->v.pv.u2 ); - INTERP_F( t, dst->v.pv.v2, out->v.pv.v2, in->v.pv.v2 ); - INTERP_F( t, dst->v.pv.q2, out->v.pv.q2, in->v.pv.q2 ); - } else { - INTERP_F( t, dst->v.v.u2, out->v.v.u2, in->v.v.u2 ); - INTERP_F( t, dst->v.v.v2, out->v.v.v2, in->v.v.v2 ); - } - } - if (DO_TEX3) { - if (DO_PTEX) { - INTERP_F( t, dst->v.pv.u3, out->v.pv.u3, in->v.pv.u3 ); - INTERP_F( t, dst->v.pv.v3, out->v.pv.v3, in->v.pv.v3 ); - INTERP_F( t, dst->v.pv.q3, out->v.pv.q3, in->v.pv.q3 ); - } else { - INTERP_F( t, dst->v.v.u3, out->v.v.u3, in->v.v.u3 ); - INTERP_F( t, dst->v.v.v3, out->v.v.v3, in->v.v.v3 ); - } - } - } else { - /* 4-dword vertex. Color is in v[3] and there is no oow coordinate. - */ - INTERP_UB( t, dst->v.ub4[3][0], out->v.ub4[3][0], in->v.ub4[3][0] ); - INTERP_UB( t, dst->v.ub4[3][1], out->v.ub4[3][1], in->v.ub4[3][1] ); - INTERP_UB( t, dst->v.ub4[3][2], out->v.ub4[3][2], in->v.ub4[3][2] ); - INTERP_UB( t, dst->v.ub4[3][3], out->v.ub4[3][3], in->v.ub4[3][3] ); - } -} - - -static __inline void TAG(copy_pv)( GLcontext *ctx, - TNL_VERTEX *dst, - TNL_VERTEX *src ) -{ - if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) { - dst->v.v.ui[4] = src->v.v.ui[4]; - } - else { - dst->v.v.ui[3] = src->v.v.ui[3]; - } -} - - - -static void TAG(init)( void ) -{ - setup_tab[IND].emit = TAG(emit_vfmt); - setup_tab[IND].interp = TAG(interp_vfmt); -} - - -#undef IND -#undef TAG - - - diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd.c b/src/libs/mesa/mesa/tnl_dd/t_dd.c deleted file mode 100644 index 731da5c320..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd.c +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - -static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - i810ContextPtr imesa = I810_CONTEXT( ctx ); - GLubyte *i810verts = (GLubyte *)imesa->verts; - GLuint shift = imesa->vertex_stride_shift; - i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); - i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); - dst->ui[4] = src->ui[4]; - dst->ui[5] = src->ui[5]; -} - -static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - i810ContextPtr imesa = I810_CONTEXT( ctx ); - GLubyte *i810verts = (GLubyte *)imesa->verts; - GLuint shift = imesa->vertex_stride_shift; - i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); - i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); - dst->ui[4] = src->ui[4]; -} - -static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - i810ContextPtr imesa = I810_CONTEXT( ctx ); - GLubyte *i810verts = (GLubyte *)imesa->verts; - GLuint shift = imesa->vertex_stride_shift; - i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); - i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); - dst->ui[3] = src->ui[3]; -} diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp.h b/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp.h deleted file mode 100644 index e4b535fb68..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp.h +++ /dev/null @@ -1,1257 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -/** - * \file t_dd_dmatmp.h - * Template for render stages which build and emit vertices directly - * to fixed-size dma buffers. Useful for rendering strips and other - * native primitives where clipping and per-vertex tweaks such as - * those in t_dd_tritmp.h are not required. - * - * Produces code for both inline triangles and indexed triangles. - * Where various primitive types are unaccelerated by hardware, the - * code attempts to fallback to other primitive types (quadstrips to - * tristrips, lineloops to linestrips), or to indexed vertices. - */ - -#if !defined(HAVE_TRIANGLES) -#error "must have at least triangles to use render template" -#endif - -#if !HAVE_ELTS -#define ELTS_VARS(buf) -#define ALLOC_ELTS(nr) 0 -#define EMIT_ELT( offset, elt ) -#define EMIT_TWO_ELTS( offset, elt0, elt1 ) -#define INCR_ELTS( nr ) -#define ELT_INIT(prim) -#define GET_CURRENT_VB_MAX_ELTS() 0 -#define GET_SUBSEQUENT_VB_MAX_ELTS() 0 -#define RELEASE_ELT_VERTS() -#define EMIT_INDEXED_VERTS( ctx, start, count ) -#endif - -#ifndef EMIT_TWO_ELTS -#define EMIT_TWO_ELTS( offset, elt0, elt1 ) \ -do { \ - EMIT_ELT( offset, elt0 ); \ - EMIT_ELT( offset+1, elt1 ); \ -} while (0) -#endif - - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - - - - -#if (HAVE_ELTS) -static void *TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr, - void *buf) -{ - GLint i; - LOCAL_VARS; - ELTS_VARS(buf); - - for ( i = 0 ; i+1 < nr ; i+=2, elts += 2 ) { - EMIT_TWO_ELTS( 0, elts[0], elts[1] ); - INCR_ELTS( 2 ); - } - - if (i < nr) { - EMIT_ELT( 0, elts[0] ); - INCR_ELTS( 1 ); - } - - return (void *)ELTPTR; -} -#endif - -static __inline void *TAG(emit_verts)( GLcontext *ctx, GLuint start, - GLuint count, void *buf ) -{ - return EMIT_VERTS(ctx, start, count, buf); -} - -/*********************************************************************** - * Render non-indexed primitives. - ***********************************************************************/ - -static void TAG(render_points_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_POINTS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - GLuint j, nr; - - INIT( GL_POINTS ); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_lines_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINES) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - GLuint j, nr; - - INIT( GL_LINES ); - - /* Emit whole number of lines in total and in each buffer: - */ - count -= (count-start) & 1; - currentsz = GET_CURRENT_VB_MAX_VERTS(); - currentsz -= currentsz & 1; - dmasz -= dmasz & 1; - - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_line_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINE_STRIPS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - GLuint j, nr; - - INIT( GL_LINE_STRIP ); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j + 1 < count; j += nr - 1 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - FLUSH(); - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_line_loop_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINE_STRIPS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - GLuint j, nr; - - INIT( GL_LINE_STRIP ); - - if (flags & PRIM_BEGIN) - j = start; - else - j = start + 1; - - /* Ensure last vertex won't wrap buffers: - */ - currentsz = GET_CURRENT_VB_MAX_VERTS(); - currentsz--; - dmasz--; - - if (currentsz < 8) { - currentsz = dmasz; - } - - if (j + 1 < count) { - for ( ; j + 1 < count; j += nr - 1 ) { - nr = MIN2( currentsz, count - j ); - - if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) - { - void *tmp; - tmp = ALLOC_VERTS(nr+1); - tmp = TAG(emit_verts)( ctx, j, nr, tmp ); - tmp = TAG(emit_verts)( ctx, start, 1, tmp ); - } - else { - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - } - - } - else if (start + 1 < count && (flags & PRIM_END)) { - void *tmp; - tmp = ALLOC_VERTS(2); - tmp = TAG(emit_verts)( ctx, start+1, 1, tmp ); - tmp = TAG(emit_verts)( ctx, start, 1, tmp ); - } - - FLUSH(); - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_triangles_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/3) * 3; - int currentsz; - GLuint j, nr; - - INIT(GL_TRIANGLES); - - currentsz = (GET_CURRENT_VB_MAX_VERTS()/3) * 3; - - /* Emit whole number of tris in total. dmasz is already a multiple - * of 3. - */ - count -= (count-start)%3; - - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } -} - - - -static void TAG(render_tri_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_TRI_STRIPS) { - LOCAL_VARS; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - - INIT(GL_TRIANGLE_STRIP); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - - if (currentsz < 8) { - currentsz = dmasz; - } - - /* From here on emit even numbers of tris when wrapping over buffers: - */ - dmasz -= (dmasz & 1); - currentsz -= (currentsz & 1); - - for (j = start ; j + 2 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - FLUSH(); - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_tri_fan_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_TRI_FANS) { - LOCAL_VARS; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - - INIT(GL_TRIANGLE_FAN); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - for (j = start + 1 ; j + 1 < count; j += nr - 2 ) { - void *tmp; - nr = MIN2( currentsz, count - j + 1 ); - tmp = ALLOC_VERTS( nr ); - tmp = TAG(emit_verts)( ctx, start, 1, tmp ); - tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp ); - currentsz = dmasz; - } - - FLUSH(); - } - else { - /* Could write code to emit these as indexed vertices (for the - * g400, for instance). - */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_poly_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_POLYGONS) { - LOCAL_VARS; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - - INIT(GL_POLYGON); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - for (j = start + 1 ; j + 1 < count ; j += nr - 2 ) { - void *tmp; - nr = MIN2( currentsz, count - j + 1 ); - tmp = ALLOC_VERTS( nr ); - tmp = TAG(emit_verts)( ctx, start, 1, tmp ); - tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp ); - currentsz = dmasz; - } - - FLUSH(); - } - else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) { - TAG(render_tri_fan_verts)( ctx, start, count, flags ); - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_quad_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - GLuint j, nr; - - if (HAVE_QUAD_STRIPS) { - LOCAL_VARS; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - - INIT(GL_QUAD_STRIP); - - currentsz = GET_CURRENT_VB_MAX_VERTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - dmasz -= (dmasz & 2); - currentsz -= (currentsz & 2); - - for (j = start ; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - FLUSH(); - - } else if (HAVE_TRI_STRIPS && - ctx->Light.ShadeModel == GL_FLAT && - TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) { - if (HAVE_ELTS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint j, nr; - - EMIT_INDEXED_VERTS( ctx, start, count ); - - /* Simulate flat-shaded quadstrips using indexed vertices: - */ - ELT_INIT( GL_TRIANGLES ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 1; - count -= (count-start) & 1; - currentsz -= currentsz & 1; - - if (currentsz < 12) - currentsz = dmasz; - - currentsz = currentsz/6*2; - dmasz = dmasz/6*2; - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - if (nr >= 4) { - GLint quads = (nr/2)-1; - GLint i; - ELTS_VARS( ALLOC_ELTS( quads*6 ) ); - - for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) { - EMIT_TWO_ELTS( 0, (i+0), (i+1) ); - EMIT_TWO_ELTS( 2, (i+2), (i+1) ); - EMIT_TWO_ELTS( 4, (i+3), (i+2) ); - INCR_ELTS( 6 ); - } - - FLUSH(); - } - currentsz = dmasz; - } - - RELEASE_ELT_VERTS(); - FLUSH(); - } - else { - /* Vertices won't fit in a single buffer or elts not - * available - should never happen. - */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } - } - else if (HAVE_TRI_STRIPS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); - int currentsz; - - /* Emit smooth-shaded quadstrips as tristrips: - */ - FLUSH(); - INIT( GL_TRIANGLE_STRIP ); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 1; - currentsz = GET_CURRENT_VB_MAX_VERTS(); - currentsz -= currentsz & 1; - count -= (count-start) & 1; - - if (currentsz < 8) { - currentsz = dmasz; - } - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - - FLUSH(); - - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_quads_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_QUADS) { - LOCAL_VARS; - int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4; - int currentsz; - GLuint j, nr; - - INIT(GL_QUADS); - - /* Emit whole number of quads in total. dmasz is already a multiple - * of 4. - */ - count -= (count-start)%4; - - currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4; - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr) { - nr = MIN2( currentsz, count - j ); - TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); - currentsz = dmasz; - } - } - else if (HAVE_ELTS) { - /* Hardware doesn't have a quad primitive type -- try to - * simulate it using indexed vertices and the triangle - * primitive: - */ - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint j, nr; - - EMIT_INDEXED_VERTS( ctx, start, count ); - - FLUSH(); - ELT_INIT( GL_TRIANGLES ); - currentsz = GET_CURRENT_VB_MAX_ELTS(); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 3; - count -= (count-start) & 3; - currentsz -= currentsz & 3; - - /* Adjust for rendering as triangles: - */ - currentsz = currentsz/6*4; - dmasz = dmasz/6*4; - - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr ) { - nr = MIN2( currentsz, count - j ); - if (nr >= 4) { - GLint quads = nr/4; - GLint i; - ELTS_VARS( ALLOC_ELTS( quads*6 ) ); - - for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) { - EMIT_TWO_ELTS( 0, (i+0), (i+1) ); - EMIT_TWO_ELTS( 2, (i+3), (i+1) ); - EMIT_TWO_ELTS( 4, (i+2), (i+3) ); - INCR_ELTS( 6 ); - } - - FLUSH(); - } - currentsz = dmasz; - } - - RELEASE_ELT_VERTS(); - } - else if (HAVE_TRIANGLES) { - /* Hardware doesn't have a quad primitive type -- try to - * simulate it using triangle primitive. This is a win for - * gears, but is it useful in the broader world? - */ - LOCAL_VARS; - GLuint j; - - INIT(GL_TRIANGLES); - - for (j = start; j < count-3; j += 4) { - void *tmp = ALLOC_VERTS( 6 ); - /* Send v0, v1, v3 - */ - tmp = EMIT_VERTS(ctx, j, 2, tmp); - tmp = EMIT_VERTS(ctx, j + 3, 1, tmp); - /* Send v1, v2, v3 - */ - tmp = EMIT_VERTS(ctx, j + 1, 3, tmp); - } - } - else { - /* Vertices won't fit in a single buffer, should never happen. - */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_noop)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ -} - - - - -static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] = -{ - TAG(render_points_verts), - TAG(render_lines_verts), - TAG(render_line_loop_verts), - TAG(render_line_strip_verts), - TAG(render_triangles_verts), - TAG(render_tri_strip_verts), - TAG(render_tri_fan_verts), - TAG(render_quads_verts), - TAG(render_quad_strip_verts), - TAG(render_poly_verts), - TAG(render_noop), -}; - - -/**************************************************************************** - * Render elts using hardware indexed verts * - ****************************************************************************/ - -#if (HAVE_ELTS) -static void TAG(render_points_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_POINTS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - - ELT_INIT( GL_POINTS ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - - -static void TAG(render_lines_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINES) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - - ELT_INIT( GL_LINES ); - - /* Emit whole number of lines in total and in each buffer: - */ - count -= (count-start) & 1; - currentsz -= currentsz & 1; - dmasz -= dmasz & 1; - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_line_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINE_STRIPS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - - FLUSH(); /* always a new primitive */ - ELT_INIT( GL_LINE_STRIP ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j + 1 < count; j += nr - 1 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } else { - /* TODO: Try to emit as indexed lines. - */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_line_loop_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_LINE_STRIPS) { - LOCAL_VARS; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - - FLUSH(); - ELT_INIT( GL_LINE_STRIP ); - - if (flags & PRIM_BEGIN) - j = start; - else - j = start + 1; - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - /* Ensure last vertex doesn't wrap: - */ - currentsz--; - dmasz--; - - if (j + 1 < count) { - for ( ; j + 1 < count; j += nr - 1 ) { - nr = MIN2( currentsz, count - j ); - - if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) - { - void *tmp; - tmp = ALLOC_ELTS(nr+1); - tmp = TAG(emit_elts)( ctx, elts+j, nr, tmp ); - tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp ); - } - else { - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - currentsz = dmasz; - } - } - - } - else if (start + 1 < count && (flags & PRIM_END)) { - void *tmp; - tmp = ALLOC_ELTS(2); - tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp ); - tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp ); - } - - FLUSH(); - } else { - /* TODO: Try to emit as indexed lines */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -/* For verts, we still eliminate the copy from main memory to dma - * buffers. For elts, this is probably no better (worse?) than the - * standard path. - */ -static void TAG(render_triangles_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/3*3; - int currentsz; - GLuint j, nr; - - FLUSH(); - ELT_INIT( GL_TRIANGLES ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - - /* Emit whole number of tris in total. dmasz is already a multiple - * of 3. - */ - count -= (count-start)%3; - currentsz -= currentsz%3; - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } -} - - - -static void TAG(render_tri_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_TRI_STRIPS) { - LOCAL_VARS; - GLuint j, nr; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - - FLUSH(); - ELT_INIT( GL_TRIANGLE_STRIP ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - /* Keep the same winding over multiple buffers: - */ - dmasz -= (dmasz & 1); - currentsz -= (currentsz & 1); - - for (j = start ; j + 2 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } else { - /* TODO: try to emit as indexed triangles */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_tri_fan_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_TRI_FANS) { - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - - FLUSH(); - ELT_INIT( GL_TRIANGLE_FAN ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - for (j = start + 1 ; j + 1 < count; j += nr - 2 ) { - void *tmp; - nr = MIN2( currentsz, count - j + 1 ); - tmp = ALLOC_ELTS( nr ); - tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp ); - tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp ); - FLUSH(); - currentsz = dmasz; - } - } else { - /* TODO: try to emit as indexed triangles */ - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - - -static void TAG(render_poly_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_POLYGONS) { - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - GLuint j, nr; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - - FLUSH(); - ELT_INIT( GL_POLYGON ); - - currentsz = GET_CURRENT_VB_MAX_ELTS(); - if (currentsz < 8) { - currentsz = dmasz; - } - - for (j = start + 1 ; j + 1 < count; j += nr - 2 ) { - void *tmp; - nr = MIN2( currentsz, count - j + 1 ); - tmp = ALLOC_ELTS( nr ); - tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp ); - tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp ); - FLUSH(); - currentsz = dmasz; - } - } else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) { - TAG(render_tri_fan_verts)( ctx, start, count, flags ); - } else { - fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); - return; - } -} - -static void TAG(render_quad_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_QUAD_STRIPS && 0) { - } - else if (HAVE_TRI_STRIPS) { - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint j, nr; - - FLUSH(); - currentsz = GET_CURRENT_VB_MAX_ELTS(); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 1; - count -= (count-start) & 1; - currentsz -= currentsz & 1; - - if (currentsz < 12) - currentsz = dmasz; - - if (ctx->Light.ShadeModel == GL_FLAT) { - ELT_INIT( GL_TRIANGLES ); - - currentsz = currentsz/6*2; - dmasz = dmasz/6*2; - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - - if (nr >= 4) - { - GLint i; - GLint quads = (nr/2)-1; - ELTS_VARS( ALLOC_ELTS( quads*6 ) ); - - for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) { - EMIT_TWO_ELTS( 0, elts[0], elts[1] ); - EMIT_TWO_ELTS( 2, elts[2], elts[1] ); - EMIT_TWO_ELTS( 4, elts[3], elts[2] ); - INCR_ELTS( 6 ); - } - - FLUSH(); - } - - currentsz = dmasz; - } - } - else { - ELT_INIT( GL_TRIANGLE_STRIP ); - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } - } -} - - -static void TAG(render_quads_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (HAVE_QUADS) { - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/4*4; - int currentsz; - GLuint j, nr; - - FLUSH(); - ELT_INIT( GL_TRIANGLES ); - - currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4; - - count -= (count-start)%4; - - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j < count; j += nr) { - nr = MIN2( currentsz, count - j ); - TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) ); - FLUSH(); - currentsz = dmasz; - } - } else { - LOCAL_VARS; - GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; - int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); - int currentsz; - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES ); - currentsz = GET_CURRENT_VB_MAX_ELTS(); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 3; - count -= (count-start) & 3; - currentsz -= currentsz & 3; - - /* Adjust for rendering as triangles: - */ - currentsz = currentsz/6*4; - dmasz = dmasz/6*4; - - if (currentsz < 8) - currentsz = dmasz; - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( currentsz, count - j ); - - if (nr >= 4) - { - GLint quads = nr/4; - GLint i; - ELTS_VARS( ALLOC_ELTS( quads * 6 ) ); - - for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) { - EMIT_TWO_ELTS( 0, elts[0], elts[1] ); - EMIT_TWO_ELTS( 2, elts[3], elts[1] ); - EMIT_TWO_ELTS( 4, elts[2], elts[3] ); - INCR_ELTS( 6 ); - } - - FLUSH(); - } - - currentsz = dmasz; - } - } -} - - - -static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] = -{ - TAG(render_points_elts), - TAG(render_lines_elts), - TAG(render_line_loop_elts), - TAG(render_line_strip_elts), - TAG(render_triangles_elts), - TAG(render_tri_strip_elts), - TAG(render_tri_fan_elts), - TAG(render_quads_elts), - TAG(render_quad_strip_elts), - TAG(render_poly_elts), - TAG(render_noop), -}; - - - -#endif - - - -/* Pre-check the primitives in the VB to prevent the need for - * fallbacks later on. - */ -static GLboolean TAG(validate_render)( GLcontext *ctx, - struct vertex_buffer *VB ) -{ - GLint i; - - if (VB->ClipOrMask & ~CLIP_CULL_BIT) - return GL_FALSE; - - if (VB->Elts && !HAVE_ELTS) - return GL_FALSE; - - for (i = 0 ; i < VB->PrimitiveCount ; i++) { - GLuint prim = VB->Primitive[i].mode; - GLuint count = VB->Primitive[i].count; - GLboolean ok = GL_FALSE; - - if (!count) - continue; - - switch (prim & PRIM_MODE_MASK) { - case GL_POINTS: - ok = HAVE_POINTS; - break; - case GL_LINES: - ok = HAVE_LINES && !ctx->Line.StippleFlag; - break; - case GL_LINE_STRIP: - ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag; - break; - case GL_LINE_LOOP: - ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag; - break; - case GL_TRIANGLES: - ok = HAVE_TRIANGLES; - break; - case GL_TRIANGLE_STRIP: - ok = HAVE_TRI_STRIPS; - break; - case GL_TRIANGLE_FAN: - ok = HAVE_TRI_FANS; - break; - case GL_POLYGON: - if (HAVE_POLYGONS) { - ok = GL_TRUE; - } - else { - ok = (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH); - } - break; - case GL_QUAD_STRIP: - if (VB->Elts) { - ok = HAVE_TRI_STRIPS; - } - else if (HAVE_QUAD_STRIPS) { - ok = GL_TRUE; - } else if (HAVE_TRI_STRIPS && - ctx->Light.ShadeModel == GL_FLAT && - VB->ColorPtr[0]->stride != 0) { - if (HAVE_ELTS) { - ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS(); - } - else { - ok = GL_FALSE; - } - } - else - ok = HAVE_TRI_STRIPS; - break; - case GL_QUADS: - if (HAVE_QUADS) { - ok = GL_TRUE; - } else if (HAVE_ELTS) { - ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS(); - } - else { - ok = HAVE_TRIANGLES; /* flatshading is ok. */ - } - break; - default: - break; - } - - if (!ok) { -/* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */ - return GL_FALSE; - } - } - - return GL_TRUE; -} - diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp2.h b/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp2.h deleted file mode 100644 index 2380c49fdf..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_dmatmp2.h +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -/** - * \file t_dd_dmatmp2.h - * Template for render stages which build and emit vertices directly - * to fixed-size dma buffers. Useful for rendering strips and other - * native primitives where clipping and per-vertex tweaks such as - * those in t_dd_tritmp.h are not required. - * - */ - -#if !HAVE_TRIANGLES || !HAVE_POINTS || !HAVE_LINES -#error "must have points, lines & triangles to use render template" -#endif - -#if !HAVE_TRI_STRIPS || !HAVE_TRI_FANS -#error "must have tri strip and fans to use render template" -#endif - -#if !HAVE_LINE_STRIPS -#error "must have line strips to use render template" -#endif - -#if !HAVE_POLYGONS -#error "must have polygons to use render template" -#endif - -#if !HAVE_ELTS -#error "must have elts to use render template" -#endif - - -#ifndef EMIT_TWO_ELTS -#define EMIT_TWO_ELTS( dest, offset, elt0, elt1 ) \ -do { \ - (dest)[offset] = (elt0); \ - (dest)[offset+1] = (elt1); \ -} while (0) -#endif - - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - - -static ELT_TYPE *TAG(emit_elts)( GLcontext *ctx, - ELT_TYPE *dest, - GLuint *elts, GLuint nr ) -{ - GLint i; - LOCAL_VARS; - - for ( i = 0 ; i+1 < nr ; i+=2, elts += 2 ) { - EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] ); - dest += 2; - } - if (i < nr) { - EMIT_ELT( dest, 0, elts[0] ); - dest += 1; - } - - return dest; -} - -static ELT_TYPE *TAG(emit_consecutive_elts)( GLcontext *ctx, - ELT_TYPE *dest, - GLuint start, GLuint nr ) -{ - GLint i; - LOCAL_VARS; - - for ( i = 0 ; i+1 < nr ; i+=2, start += 2 ) { - EMIT_TWO_ELTS( dest, 0, start, start+1 ); - dest += 2; - } - if (i < nr) { - EMIT_ELT( dest, 0, start ); - dest += 1; - } - - return dest; -} - -/*********************************************************************** - * Render non-indexed primitives. - ***********************************************************************/ - - - -static void TAG(render_points_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (start < count) { - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count ); - } -} - -static void TAG(render_lines_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - count -= (count-start) & 1; - - if (start+1 >= count) - return; - - if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) { - RESET_STIPPLE(); - AUTO_STIPPLE( GL_TRUE ); - } - - EMIT_PRIM( ctx, GL_LINES, HW_LINES, start, count ); - - if ((flags & PRIM_END) && ctx->Line.StippleFlag) - AUTO_STIPPLE( GL_FALSE ); -} - - -static void TAG(render_line_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (start+1 >= count) - return; - - if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) - RESET_STIPPLE(); - - - if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) - { - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - - ELT_INIT( GL_LINES, HW_LINES ); - - /* Emit whole number of lines in each full buffer. - */ - dmasz = dmasz/2; - - - for (j = start; j + 1 < count; j += nr - 1 ) { - ELT_TYPE *dest; - GLint i; - - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( (nr-1)*2 ); - - for ( i = j ; i+1 < j+nr ; i+=1 ) { - EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); - dest += 2; - } - - CLOSE_ELTS(); - } - } - else - EMIT_PRIM( ctx, GL_LINE_STRIP, HW_LINE_STRIP, start, count ); -} - - -static void TAG(render_line_loop_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint j, nr; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (flags & PRIM_BEGIN) { - j = start; - if (ctx->Line.StippleFlag) - RESET_STIPPLE( ); - } - else - j = start + 1; - - if (flags & PRIM_END) { - - if (start+1 >= count) - return; - - if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) { - int dmasz = GET_MAX_HW_ELTS(); - - ELT_INIT( GL_LINES, HW_LINES ); - - /* Emit whole number of lines in each full buffer. - */ - dmasz = dmasz/2; - - /* Ensure last vertex doesn't wrap: - */ - dmasz--; - - for (; j + 1 < count; ) { - GLint i; - ELT_TYPE *dest; - - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr*2 ); /* allocs room for 1 more line */ - - for ( i = 0 ; i < nr - 1 ; i+=1 ) { - EMIT_TWO_ELTS( dest, 0, (j+i), (j+i+1) ); - dest += 2; - } - - j += nr - 1; - - /* Emit 1 more line into space alloced above */ - if (j + 1 >= count) { - EMIT_TWO_ELTS( dest, 0, (j), (start) ); - dest += 2; - } - - CLOSE_ELTS(); - } - } - else - { - int dmasz = GET_MAX_HW_ELTS() - 1; - - ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); - - for ( ; j + 1 < count; ) { - nr = MIN2( dmasz, count - j ); - if (j + nr < count) { - ELT_TYPE *dest = ALLOC_ELTS( nr ); - dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr ); - j += nr - 1; - CLOSE_ELTS(); - } - else if (nr) { - ELT_TYPE *dest = ALLOC_ELTS( nr + 1 ); - dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr ); - dest = TAG(emit_consecutive_elts)( ctx, dest, start, 1 ); - j += nr; - CLOSE_ELTS(); - } - } - } - } else { - TAG(render_line_strip_verts)( ctx, j, count, flags ); - } -} - - -static void TAG(render_triangles_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - count -= (count-start)%3; - - if (start+2 >= count) { - return; - } - - /* need a PREFER_DISCRETE_ELT_PRIM here too.. - */ - EMIT_PRIM( ctx, GL_TRIANGLES, HW_TRIANGLES, start, count ); -} - - - -static void TAG(render_tri_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (start + 2 >= count) - return; - - if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { - int dmasz = GET_MAX_HW_ELTS(); - int parity = 0; - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - /* Emit even number of tris in each full buffer. - */ - dmasz = dmasz/3; - dmasz -= dmasz & 1; - - for (j = start; j + 2 < count; j += nr - 2 ) { - ELT_TYPE *dest; - GLint i; - - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( (nr-2)*3 ); - - for ( i = j ; i+2 < j+nr ; i++, parity^=1 ) { - EMIT_ELT( dest, 0, (i+0+parity) ); - EMIT_ELT( dest, 1, (i+1-parity) ); - EMIT_ELT( dest, 2, (i+2) ); - dest += 3; - } - - CLOSE_ELTS(); - } - } - else - EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count ); -} - -static void TAG(render_tri_fan_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (start+2 >= count) - return; - - if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - dmasz = dmasz/3; - - for (j = start + 1; j + 1 < count; j += nr - 1 ) { - ELT_TYPE *dest; - GLint i; - - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( (nr-1)*3 ); - - for ( i = j ; i+1 < j+nr ; i++ ) { - EMIT_ELT( dest, 0, (start) ); - EMIT_ELT( dest, 1, (i) ); - EMIT_ELT( dest, 2, (i+1) ); - dest += 3; - } - - CLOSE_ELTS(); - } - } - else { - EMIT_PRIM( ctx, GL_TRIANGLE_FAN, HW_TRIANGLE_FAN, start, count ); - } -} - - -static void TAG(render_poly_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (start+2 >= count) - return; - - EMIT_PRIM( ctx, GL_POLYGON, HW_POLYGON, start, count ); -} - -static void TAG(render_quad_strip_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - count -= (count-start) & 1; - - if (start+3 >= count) - return; - - if (HAVE_QUAD_STRIPS) { - EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count ); - } - else if (ctx->Light.ShadeModel == GL_FLAT) { - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz = (dmasz/6)*2; - - for (j = start; j + 3 < count; j += nr - 2 ) { - ELT_TYPE *dest; - GLint quads, i; - - nr = MIN2( dmasz, count - j ); - quads = (nr/2)-1; - dest = ALLOC_ELTS( quads*6 ); - - for ( i = j ; i < j+quads*2 ; i+=2 ) { - EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); - EMIT_TWO_ELTS( dest, 2, (i+2), (i+1) ); - EMIT_TWO_ELTS( dest, 4, (i+3), (i+2) ); - dest += 6; - } - - CLOSE_ELTS(); - } - } - else { - EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count ); - } -} - - -static void TAG(render_quads_verts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - count -= (count-start)%4; - - if (start+3 >= count) - return; - - if (HAVE_QUADS) { - EMIT_PRIM( ctx, GL_QUADS, HW_QUADS, start, count ); - } - else { - /* Hardware doesn't have a quad primitive type -- simulate it - * using indexed vertices and the triangle primitive: - */ - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - /* Adjust for rendering as triangles: - */ - dmasz = (dmasz/6)*4; - - for (j = start; j < count; j += nr ) { - ELT_TYPE *dest; - GLint quads, i; - - nr = MIN2( dmasz, count - j ); - quads = nr/4; - dest = ALLOC_ELTS( quads*6 ); - - for ( i = j ; i < j+quads*4 ; i+=4 ) { - EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); - EMIT_TWO_ELTS( dest, 2, (i+3), (i+1) ); - EMIT_TWO_ELTS( dest, 4, (i+2), (i+3) ); - dest += 6; - } - - CLOSE_ELTS(); - } - } -} - -static void TAG(render_noop)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ -} - - - - -static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] = -{ - TAG(render_points_verts), - TAG(render_lines_verts), - TAG(render_line_loop_verts), - TAG(render_line_strip_verts), - TAG(render_triangles_verts), - TAG(render_tri_strip_verts), - TAG(render_tri_fan_verts), - TAG(render_quads_verts), - TAG(render_quad_strip_verts), - TAG(render_poly_verts), - TAG(render_noop), -}; - - -/**************************************************************************** - * Render elts using hardware indexed verts * - ****************************************************************************/ - -static void TAG(render_points_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - ELT_TYPE *dest; - - ELT_INIT( GL_POINTS, HW_POINTS ); - - for (j = start; j < count; j += nr ) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } -} - - - -static void TAG(render_lines_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - ELT_TYPE *dest; - - if (start+1 >= count) - return; - - if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) { - RESET_STIPPLE(); - AUTO_STIPPLE( GL_TRUE ); - } - - ELT_INIT( GL_LINES, HW_LINES ); - - /* Emit whole number of lines in total and in each buffer: - */ - count -= (count-start) & 1; - dmasz -= dmasz & 1; - - for (j = start; j < count; j += nr ) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } - - if ((flags & PRIM_END) && ctx->Line.StippleFlag) - AUTO_STIPPLE( GL_FALSE ); -} - - -static void TAG(render_line_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - ELT_TYPE *dest; - - if (start+1 >= count) - return; - - ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); - - if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) - RESET_STIPPLE(); - - for (j = start; j + 1 < count; j += nr - 1 ) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } -} - - -static void TAG(render_line_loop_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - int dmasz = GET_MAX_HW_ELTS(); - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - ELT_TYPE *dest; - - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - - if (flags & PRIM_BEGIN) - j = start; - else - j = start + 1; - - - if (flags & PRIM_END) { - if (start+1 >= count) - return; - } - else { - if (j+1 >= count) - return; - } - - ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); - - if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) - RESET_STIPPLE(); - - - /* Ensure last vertex doesn't wrap: - */ - dmasz--; - - for ( ; j + 1 < count; ) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr+1 ); /* Reserve possible space for last elt */ - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - j += nr - 1; - if (j + 1 >= count && (flags & PRIM_END)) { - dest = TAG(emit_elts)( ctx, dest, elts+start, 1 ); - } - CLOSE_ELTS(); - } -} - - -static void TAG(render_triangles_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint *elts = GET_MESA_ELTS(); - int dmasz = GET_MAX_HW_ELTS()/3*3; - GLuint j, nr; - ELT_TYPE *dest; - - if (start+2 >= count) - return; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - - /* Emit whole number of tris in total. dmasz is already a multiple - * of 3. - */ - count -= (count-start)%3; - - for (j = start; j < count; j += nr) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } -} - - - -static void TAG(render_tri_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint j, nr; - GLuint *elts = GET_MESA_ELTS(); - int dmasz = GET_MAX_HW_ELTS(); - ELT_TYPE *dest; - - if (start+2 >= count) - return; - - ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 ); - - /* Keep the same winding over multiple buffers: - */ - dmasz -= (dmasz & 1); - - for (j = start ; j + 2 < count; j += nr - 2 ) { - nr = MIN2( dmasz, count - j ); - - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } -} - -static void TAG(render_tri_fan_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - int dmasz = GET_MAX_HW_ELTS(); - ELT_TYPE *dest; - - if (start+2 >= count) - return; - - ELT_INIT( GL_TRIANGLE_FAN, HW_TRIANGLE_FAN ); - - for (j = start + 1 ; j + 1 < count; j += nr - 1 ) { - nr = MIN2( dmasz, count - j + 1 ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+start, 1 ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 ); - CLOSE_ELTS(); - } -} - - -static void TAG(render_poly_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - GLuint *elts = GET_MESA_ELTS(); - GLuint j, nr; - int dmasz = GET_MAX_HW_ELTS(); - ELT_TYPE *dest; - - if (start+2 >= count) - return; - - ELT_INIT( GL_POLYGON, HW_POLYGON ); - - for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) { - nr = MIN2( dmasz, count - j + 1 ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+start, 1 ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 ); - CLOSE_ELTS(); - } -} - -static void TAG(render_quad_strip_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (start+3 >= count) - return; - - if (HAVE_QUAD_STRIPS && 0) { - } - else { - LOCAL_VARS; - GLuint *elts = GET_MESA_ELTS(); - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - ELT_TYPE *dest; - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 1; - count -= (count-start) & 1; - - if (ctx->Light.ShadeModel == GL_FLAT) { - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - dmasz = dmasz/6*2; - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( dmasz, count - j ); - - if (nr >= 4) - { - GLint quads = (nr/2)-1; - ELT_TYPE *dest = ALLOC_ELTS( quads*6 ); - GLint i; - - for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) { - EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] ); - EMIT_TWO_ELTS( dest, 2, elts[2], elts[1] ); - EMIT_TWO_ELTS( dest, 4, elts[3], elts[2] ); - dest += 6; - } - - CLOSE_ELTS(); - } - } - } - else { - ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 ); - - for (j = start; j + 3 < count; j += nr - 2 ) { - nr = MIN2( dmasz, count - j ); - dest = ALLOC_ELTS( nr ); - dest = TAG(emit_elts)( ctx, dest, elts+j, nr ); - CLOSE_ELTS(); - } - } - } -} - - -static void TAG(render_quads_elts)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - if (start+3 >= count) - return; - - if (HAVE_QUADS && 0) { - } else { - LOCAL_VARS; - GLuint *elts = GET_MESA_ELTS(); - int dmasz = GET_MAX_HW_ELTS(); - GLuint j, nr; - - ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); - - /* Emit whole number of quads in total, and in each buffer. - */ - dmasz -= dmasz & 3; - count -= (count-start) & 3; - - /* Adjust for rendering as triangles: - */ - dmasz = dmasz/6*4; - - for (j = start; j + 3 < count; j += nr ) { - nr = MIN2( dmasz, count - j ); - - { - GLint quads = nr/4; - ELT_TYPE *dest = ALLOC_ELTS( quads * 6 ); - GLint i; - - for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) { - EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] ); - EMIT_TWO_ELTS( dest, 2, elts[3], elts[1] ); - EMIT_TWO_ELTS( dest, 4, elts[2], elts[3] ); - dest += 6; - } - - CLOSE_ELTS(); - } - } - } -} - - - -static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] = -{ - TAG(render_points_elts), - TAG(render_lines_elts), - TAG(render_line_loop_elts), - TAG(render_line_strip_elts), - TAG(render_triangles_elts), - TAG(render_tri_strip_elts), - TAG(render_tri_fan_elts), - TAG(render_quads_elts), - TAG(render_quad_strip_elts), - TAG(render_poly_elts), - TAG(render_noop), -}; diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_rendertmp.h b/src/libs/mesa/mesa/tnl_dd/t_dd_rendertmp.h deleted file mode 100644 index b9f030195d..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_rendertmp.h +++ /dev/null @@ -1,434 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ - - -#ifndef POSTFIX -#define POSTFIX -#endif - -#ifndef INIT -#define INIT(x) -#endif - -#ifndef NEED_EDGEFLAG_SETUP -#define NEED_EDGEFLAG_SETUP 0 -#define EDGEFLAG_GET(a) 0 -#define EDGEFLAG_SET(a,b) (void)b -#endif - -#ifndef RESET_STIPPLE -#define RESET_STIPPLE -#endif - -#ifndef RESET_OCCLUSION -#define RESET_OCCLUSION -#endif - -#ifndef TEST_PRIM_END -#define TEST_PRIM_END(flags) (flags & PRIM_END) -#define TEST_PRIM_BEGIN(flags) (flags & PRIM_BEGIN) -#define TEST_PRIM_PARITY(flags) (flags & PRIM_PARITY) -#endif - -#ifndef ELT -#define ELT(x) x -#endif - -#ifndef RENDER_TAB_QUALIFIER -#define RENDER_TAB_QUALIFIER static -#endif - -static void TAG(render_points)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - LOCAL_VARS; - (void) flags; - - RESET_OCCLUSION; - INIT(GL_POINTS); - RENDER_POINTS( start, count ); - POSTFIX; -} - -static void TAG(render_lines)( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - GLuint j; - LOCAL_VARS; - (void) flags; - - RESET_OCCLUSION; - INIT(GL_LINES); - for (j=start+1; j - */ - - -/* Template for building functions to plug into the driver interface - * of t_vb_render.c: - * ctx->Driver.QuadFunc - * ctx->Driver.TriangleFunc - * ctx->Driver.LineFunc - * ctx->Driver.PointsFunc - * - * DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles, - * and restore vertices afterwards. - * DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore - * vertices after rendering. - * DO_FLAT: For hardware without native flatshading, copy provoking colors - * into the other vertices. Restore after rendering. - * DO_UNFILLED: Decompose triangles to lines and points where appropriate. - * DO_TWOSTENCIL:Gross hack for two-sided stencil. - * - * HAVE_RGBA: Vertices have rgba values (otherwise index values). - * HAVE_SPEC: Vertices have secondary rgba values. - * - * VERT_X(v): Alias for vertex x value. - * VERT_Y(v): Alias for vertex y value. - * VERT_Z(v): Alias for vertex z value. - * DEPTH_SCALE: Scale for constant offset. - * REVERSE_DEPTH: Viewport depth range reversed. - * - * VERTEX: Hardware vertex type. - * GET_VERTEX(n): Retreive vertex with index n. - * AREA_IS_CCW(a): Return true if triangle with signed area a is ccw. - * - * VERT_SET_RGBA: Assign vertex rgba from VB color. - * VERT_COPY_RGBA: Copy vertex rgba another vertex. - * VERT_SAVE_RGBA: Save vertex rgba to a local variable. - * VERT_RESTORE_RGBA: Restore vertex rgba from a local variable. - * --> Similar for IND and SPEC. - * - * LOCAL_VARS(n): (At least) define local vars for save/restore rgba. - * - */ - -#if HAVE_RGBA -#define VERT_SET_IND( v, c ) (void) c -#define VERT_COPY_IND( v0, v1 ) -#define VERT_SAVE_IND( idx ) -#define VERT_RESTORE_IND( idx ) -#if HAVE_BACK_COLORS -#define VERT_SET_RGBA( v, c ) -#endif -#else -#define VERT_SET_RGBA( v, c ) (void) c -#define VERT_COPY_RGBA( v0, v1 ) -#define VERT_SAVE_RGBA( idx ) -#define VERT_RESTORE_RGBA( idx ) -#if HAVE_BACK_COLORS -#define VERT_SET_IND( v, c ) -#endif -#endif - -#if !HAVE_SPEC -#define VERT_SET_SPEC( v, c ) (void) c -#define VERT_COPY_SPEC( v0, v1 ) -#define VERT_SAVE_SPEC( idx ) -#define VERT_RESTORE_SPEC( idx ) -#if HAVE_BACK_COLORS -#define VERT_COPY_SPEC1( v ) -#endif -#else -#if HAVE_BACK_COLORS -#define VERT_SET_SPEC( v, c ) -#endif -#endif - -#if !HAVE_BACK_COLORS -#define VERT_COPY_SPEC1( v ) -#define VERT_COPY_IND1( v ) -#define VERT_COPY_RGBA1( v ) -#endif - -#ifndef INSANE_VERTICES -#define VERT_SET_Z(v,val) VERT_Z(v) = val -#define VERT_Z_ADD(v,val) VERT_Z(v) += val -#endif - -#ifndef REVERSE_DEPTH -#define REVERSE_DEPTH 0 -#endif - -/* disable twostencil for un-aware drivers */ -#ifndef HAVE_STENCIL_TWOSIDE -#define HAVE_STENCIL_TWOSIDE 0 -#endif -#ifndef DO_TWOSTENCIL -#define DO_TWOSTENCIL 0 -#endif -#ifndef SETUP_STENCIL -#define SETUP_STENCIL(f) -#endif -#ifndef UNSET_STENCIL -#define UNSET_STENCIL(f) -#endif - -#if DO_TRI -static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; - VERTEX *v[3]; - GLfloat offset = 0; - GLfloat z[3]; - GLenum mode = GL_FILL; - GLuint facing = 0; - LOCAL_VARS(3); - -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - v[0] = (VERTEX *)GET_VERTEX(e0); - v[1] = (VERTEX *)GET_VERTEX(e1); - v[2] = (VERTEX *)GET_VERTEX(e2); - - if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL) - { - GLfloat ex = VERT_X(v[0]) - VERT_X(v[2]); - GLfloat ey = VERT_Y(v[0]) - VERT_Y(v[2]); - GLfloat fx = VERT_X(v[1]) - VERT_X(v[2]); - GLfloat fy = VERT_Y(v[1]) - VERT_Y(v[2]); - GLfloat cc = ex*fy - ey*fx; - - if (DO_TWOSIDE || DO_UNFILLED || DO_TWOSTENCIL) - { - facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit; - - if (DO_UNFILLED) { - if (facing) { - mode = ctx->Polygon.BackMode; - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode != GL_FRONT) { - return; - } - } else { - mode = ctx->Polygon.FrontMode; - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode != GL_BACK) { - return; - } - } - } - - if (DO_TWOSIDE && facing == 1) - { - if (HAVE_RGBA) { - if (HAVE_BACK_COLORS) { - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_COPY_RGBA1( v[0] ); - VERT_COPY_RGBA1( v[1] ); - } - VERT_SAVE_RGBA( 2 ); - VERT_COPY_RGBA1( v[2] ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_COPY_SPEC1( v[0] ); - VERT_COPY_SPEC1( v[1] ); - } - VERT_SAVE_SPEC( 2 ); - VERT_COPY_SPEC1( v[2] ); - } - } - else { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; - (void) vbcolor; - - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - } - VERT_SAVE_RGBA( 2 ); - - if (VB->ColorPtr[1]->stride) { - ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat)); - - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[e0] ); - VERT_SET_RGBA( v[1], vbcolor[e1] ); - } - VERT_SET_RGBA( v[2], vbcolor[e2] ); - } - else { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[0] ); - VERT_SET_RGBA( v[1], vbcolor[0] ); - } - VERT_SET_RGBA( v[2], vbcolor[0] ); - } - - if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - ASSERT(VB->SecondaryColorPtr[1]->stride == 4*sizeof(GLfloat)); - - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SET_SPEC( v[0], vbspec[e0] ); - VERT_SET_SPEC( v[1], vbspec[e1] ); - } - VERT_SAVE_SPEC( 2 ); - VERT_SET_SPEC( v[2], vbspec[e2] ); - } - } - } - else { - GLfloat (*vbindex) = (GLfloat *)VB->IndexPtr[1]->data; - if (!DO_FLAT) { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SET_IND( v[0], vbindex[e0] ); - VERT_SET_IND( v[1], vbindex[e1] ); - } - VERT_SAVE_IND( 2 ); - VERT_SET_IND( v[2], vbindex[e2] ); - } - } - } - - - if (DO_OFFSET) - { - offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE; - z[0] = VERT_Z(v[0]); - z[1] = VERT_Z(v[1]); - z[2] = VERT_Z(v[2]); - if (cc * cc > 1e-16) { - GLfloat ic = 1.0 / cc; - GLfloat ez = z[0] - z[2]; - GLfloat fz = z[1] - z[2]; - GLfloat a = ey*fz - ez*fy; - GLfloat b = ez*fx - ex*fz; - GLfloat ac = a * ic; - GLfloat bc = b * ic; - if ( ac < 0.0f ) ac = -ac; - if ( bc < 0.0f ) bc = -bc; - offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor / ctx->DrawBuffer->_MRD; - } - offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0); - } - } - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_COPY_RGBA( v[0], v[2] ); - VERT_COPY_RGBA( v[1], v[2] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_COPY_SPEC( v[0], v[2] ); - VERT_COPY_SPEC( v[1], v[2] ); - } - } - else { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_COPY_IND( v[0], v[2] ); - VERT_COPY_IND( v[1], v[2] ); - } - } - - if (mode == GL_POINT) { - if (DO_OFFSET && ctx->Polygon.OffsetPoint) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - } - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - UNFILLED_TRI( ctx, GL_POINT, e0, e1, e2 ); - UNSET_STENCIL(facing); - } else { - UNFILLED_TRI( ctx, GL_POINT, e0, e1, e2 ); - } - } else if (mode == GL_LINE) { - if (DO_OFFSET && ctx->Polygon.OffsetLine) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - } - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - UNFILLED_TRI( ctx, GL_LINE, e0, e1, e2 ); - UNSET_STENCIL(facing); - } else { - UNFILLED_TRI( ctx, GL_LINE, e0, e1, e2 ); - } - } else { - if (DO_OFFSET && ctx->Polygon.OffsetFill) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - } - if (DO_UNFILLED) - RASTERIZE( GL_TRIANGLES ); - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - TRI( v[0], v[1], v[2] ); - UNSET_STENCIL(facing); - } else { - TRI( v[0], v[1], v[2] ); - } - } - - if (DO_OFFSET) - { - VERT_SET_Z(v[0], z[0]); - VERT_SET_Z(v[1], z[1]); - VERT_SET_Z(v[2], z[2]); - } - - if (DO_TWOSIDE && facing == 1) - { - if (HAVE_RGBA) { - if (!DO_FLAT) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - } - VERT_RESTORE_RGBA( 2 ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - } - VERT_RESTORE_SPEC( 2 ); - } - } - else { - if (!DO_FLAT) { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - } - VERT_RESTORE_IND( 2 ); - } - } - - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - } - } - else { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - } - } -} -#endif - -#if DO_QUAD -#if DO_FULL_QUAD -static void TAG(quadr)( GLcontext *ctx, - GLuint e0, GLuint e1, GLuint e2, GLuint e3 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; - VERTEX *v[4]; - GLfloat offset = 0; - GLfloat z[4]; - GLenum mode = GL_FILL; - GLuint facing = 0; - LOCAL_VARS(4); - - v[0] = (VERTEX *)GET_VERTEX(e0); - v[1] = (VERTEX *)GET_VERTEX(e1); - v[2] = (VERTEX *)GET_VERTEX(e2); - v[3] = (VERTEX *)GET_VERTEX(e3); - - if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL) - { - GLfloat ex = VERT_X(v[2]) - VERT_X(v[0]); - GLfloat ey = VERT_Y(v[2]) - VERT_Y(v[0]); - GLfloat fx = VERT_X(v[3]) - VERT_X(v[1]); - GLfloat fy = VERT_Y(v[3]) - VERT_Y(v[1]); - GLfloat cc = ex*fy - ey*fx; - - if (DO_TWOSIDE || DO_UNFILLED || DO_TWOSTENCIL) - { - facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit; - - if (DO_UNFILLED) { - if (facing) { - mode = ctx->Polygon.BackMode; - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode != GL_FRONT) { - return; - } - } else { - mode = ctx->Polygon.FrontMode; - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode != GL_BACK) { - return; - } - } - } - - if (DO_TWOSIDE && facing == 1) - { - if (HAVE_RGBA) { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; - (void)vbcolor; - - if (HAVE_BACK_COLORS) { - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - VERT_COPY_RGBA1( v[0] ); - VERT_COPY_RGBA1( v[1] ); - VERT_COPY_RGBA1( v[2] ); - } - VERT_SAVE_RGBA( 3 ); - VERT_COPY_RGBA1( v[3] ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_COPY_SPEC1( v[0] ); - VERT_COPY_SPEC1( v[1] ); - VERT_COPY_SPEC1( v[2] ); - } - VERT_SAVE_SPEC( 3 ); - VERT_COPY_SPEC1( v[3] ); - } - } - else { - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - } - VERT_SAVE_RGBA( 3 ); - - if (VB->ColorPtr[1]->stride) { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[e0] ); - VERT_SET_RGBA( v[1], vbcolor[e1] ); - VERT_SET_RGBA( v[2], vbcolor[e2] ); - } - VERT_SET_RGBA( v[3], vbcolor[e3] ); - } - else { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[0] ); - VERT_SET_RGBA( v[1], vbcolor[0] ); - VERT_SET_RGBA( v[2], vbcolor[0] ); - } - VERT_SET_RGBA( v[3], vbcolor[0] ); - } - - if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - ASSERT(VB->SecondaryColorPtr[1]->stride==4*sizeof(GLfloat)); - - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_SET_SPEC( v[0], vbspec[e0] ); - VERT_SET_SPEC( v[1], vbspec[e1] ); - VERT_SET_SPEC( v[2], vbspec[e2] ); - } - VERT_SAVE_SPEC( 3 ); - VERT_SET_SPEC( v[3], vbspec[e3] ); - } - } - } - else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; - if (!DO_FLAT) { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SAVE_IND( 2 ); - VERT_SET_IND( v[0], vbindex[e0] ); - VERT_SET_IND( v[1], vbindex[e1] ); - VERT_SET_IND( v[2], vbindex[e2] ); - } - VERT_SAVE_IND( 3 ); - VERT_SET_IND( v[3], vbindex[e3] ); - } - } - } - - - if (DO_OFFSET) - { - offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE; - z[0] = VERT_Z(v[0]); - z[1] = VERT_Z(v[1]); - z[2] = VERT_Z(v[2]); - z[3] = VERT_Z(v[3]); - if (cc * cc > 1e-16) { - GLfloat ez = z[2] - z[0]; - GLfloat fz = z[3] - z[1]; - GLfloat a = ey*fz - ez*fy; - GLfloat b = ez*fx - ex*fz; - GLfloat ic = 1.0 / cc; - GLfloat ac = a * ic; - GLfloat bc = b * ic; - if ( ac < 0.0f ) ac = -ac; - if ( bc < 0.0f ) bc = -bc; - offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor / ctx->DrawBuffer->_MRD; - } - offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0); - } - } - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - VERT_COPY_RGBA( v[0], v[3] ); - VERT_COPY_RGBA( v[1], v[3] ); - VERT_COPY_RGBA( v[2], v[3] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_COPY_SPEC( v[0], v[3] ); - VERT_COPY_SPEC( v[1], v[3] ); - VERT_COPY_SPEC( v[2], v[3] ); - } - } - else { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SAVE_IND( 2 ); - VERT_COPY_IND( v[0], v[3] ); - VERT_COPY_IND( v[1], v[3] ); - VERT_COPY_IND( v[2], v[3] ); - } - } - - if (mode == GL_POINT) { - if (( DO_OFFSET) && ctx->Polygon.OffsetPoint) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - VERT_Z_ADD(v[3], offset); - } - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - UNFILLED_QUAD( ctx, GL_POINT, e0, e1, e2, e3 ); - UNSET_STENCIL(facing); - } else { - UNFILLED_QUAD( ctx, GL_POINT, e0, e1, e2, e3 ); - } - } else if (mode == GL_LINE) { - if (DO_OFFSET && ctx->Polygon.OffsetLine) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - VERT_Z_ADD(v[3], offset); - } - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - UNFILLED_QUAD( ctx, GL_LINE, e0, e1, e2, e3 ); - UNSET_STENCIL(facing); - } else { - UNFILLED_QUAD( ctx, GL_LINE, e0, e1, e2, e3 ); - } - } else { - if (DO_OFFSET && ctx->Polygon.OffsetFill) { - VERT_Z_ADD(v[0], offset); - VERT_Z_ADD(v[1], offset); - VERT_Z_ADD(v[2], offset); - VERT_Z_ADD(v[3], offset); - } - RASTERIZE( GL_QUADS ); - if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) { - SETUP_STENCIL(facing); - QUAD( (v[0]), (v[1]), (v[2]), (v[3]) ); - UNSET_STENCIL(facing); - } else { - QUAD( (v[0]), (v[1]), (v[2]), (v[3]) ); - } - } - - if (DO_OFFSET) - { - VERT_SET_Z(v[0], z[0]); - VERT_SET_Z(v[1], z[1]); - VERT_SET_Z(v[2], z[2]); - VERT_SET_Z(v[3], z[3]); - } - - if (DO_TWOSIDE && facing == 1) - { - if (HAVE_RGBA) { - if (!DO_FLAT) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - VERT_RESTORE_RGBA( 2 ); - } - VERT_RESTORE_RGBA( 3 ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - VERT_RESTORE_SPEC( 2 ); - } - VERT_RESTORE_SPEC( 3 ); - } - } - else { - if (!DO_FLAT) { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - VERT_RESTORE_IND( 2 ); - } - VERT_RESTORE_IND( 3 ); - } - } - - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - VERT_RESTORE_RGBA( 2 ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - VERT_RESTORE_SPEC( 2 ); - } - } - else { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - VERT_RESTORE_IND( 2 ); - } - } -} -#else -static void TAG(quadr)( GLcontext *ctx, GLuint e0, - GLuint e1, GLuint e2, GLuint e3 ) -{ - if (DO_UNFILLED) { - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte ef1 = VB->EdgeFlag[e1]; - GLubyte ef3 = VB->EdgeFlag[e3]; - VB->EdgeFlag[e1] = 0; - TAG(triangle)( ctx, e0, e1, e3 ); - VB->EdgeFlag[e1] = ef1; - VB->EdgeFlag[e3] = 0; - TAG(triangle)( ctx, e1, e2, e3 ); - VB->EdgeFlag[e3] = ef3; - } else { - TAG(triangle)( ctx, e0, e1, e3 ); - TAG(triangle)( ctx, e1, e2, e3 ); - } -} -#endif -#endif - -#if DO_LINE -static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - VERTEX *v[2]; - LOCAL_VARS(2); - - v[0] = (VERTEX *)GET_VERTEX(e0); - v[1] = (VERTEX *)GET_VERTEX(e1); - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA( 0 ); - VERT_COPY_RGBA( v[0], v[1] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_SAVE_SPEC( 0 ); - VERT_COPY_SPEC( v[0], v[1] ); - } - } - else { - VERT_SAVE_IND( 0 ); - VERT_COPY_IND( v[0], v[1] ); - } - } - - LINE( v[0], v[1] ); - - if (DO_FLAT) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA( 0 ); - - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { - VERT_RESTORE_SPEC( 0 ); - } - } - else { - VERT_RESTORE_IND( 0 ); - } - } -} -#endif - -#if DO_POINTS -static void TAG(points)( GLcontext *ctx, GLuint first, GLuint last ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; - GLuint i; - LOCAL_VARS(1); - - if (VB->Elts == 0) { - for ( i = first ; i < last ; i++ ) { - if ( VB->ClipMask[i] == 0 ) { - VERTEX *v = (VERTEX *)GET_VERTEX(i); - POINT( v ); - } - } - } else { - for ( i = first ; i < last ; i++ ) { - GLuint e = VB->Elts[i]; - if ( VB->ClipMask[e] == 0 ) { - VERTEX *v = (VERTEX *)GET_VERTEX(e); - POINT( v ); - } - } - } -} -#endif - -static void TAG(init)( void ) -{ -#if DO_QUAD - TAB[IND].quad = TAG(quadr); -#endif -#if DO_TRI - TAB[IND].triangle = TAG(triangle); -#endif -#if DO_LINE - TAB[IND].line = TAG(line); -#endif -#if DO_POINTS - TAB[IND].points = TAG(points); -#endif -} - -#undef IND -#undef TAG - -#if HAVE_RGBA -#undef VERT_SET_IND -#undef VERT_COPY_IND -#undef VERT_SAVE_IND -#undef VERT_RESTORE_IND -#if HAVE_BACK_COLORS -#undef VERT_SET_RGBA -#endif -#else -#undef VERT_SET_RGBA -#undef VERT_COPY_RGBA -#undef VERT_SAVE_RGBA -#undef VERT_RESTORE_RGBA -#if HAVE_BACK_COLORS -#undef VERT_SET_IND -#endif -#endif - -#if !HAVE_SPEC -#undef VERT_SET_SPEC -#undef VERT_COPY_SPEC -#undef VERT_SAVE_SPEC -#undef VERT_RESTORE_SPEC -#if HAVE_BACK_COLORS -#undef VERT_COPY_SPEC1 -#endif -#else -#if HAVE_BACK_COLORS -#undef VERT_SET_SPEC -#endif -#endif - -#if !HAVE_BACK_COLORS -#undef VERT_COPY_SPEC1 -#undef VERT_COPY_IND1 -#undef VERT_COPY_RGBA1 -#endif - -#ifndef INSANE_VERTICES -#undef VERT_SET_Z -#undef VERT_Z_ADD -#endif diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_unfilled.h b/src/libs/mesa/mesa/tnl_dd/t_dd_unfilled.h deleted file mode 100644 index e4d82aa080..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_unfilled.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - -#if HAVE_RGBA -#define VERT_SET_IND( v, c ) -#define VERT_COPY_IND( v0, v1 ) -#define VERT_SAVE_IND( idx ) -#define VERT_RESTORE_IND( idx ) -#endif - -#if !HAVE_SPEC -#define VERT_SET_SPEC( v, c ) -#define VERT_COPY_SPEC( v0, v1 ) -#define VERT_SAVE_SPEC( idx ) -#define VERT_RESTORE_SPEC( idx ) -#endif - -static void TAG(unfilled_tri)( GLcontext *ctx, - GLenum mode, - GLuint e0, GLuint e1, GLuint e2 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - VERTEX *v[3]; - LOCAL_VARS(3); - - v[0] = (VERTEX *)GET_VERTEX(e0); - v[1] = (VERTEX *)GET_VERTEX(e1); - v[2] = (VERTEX *)GET_VERTEX(e2); - - if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA(0); - VERT_SAVE_RGBA(1); - VERT_COPY_RGBA(v[0], v[2]); - VERT_COPY_RGBA(v[1], v[2]); - - if (HAVE_SPEC) { - VERT_SAVE_SPEC(0); - VERT_SAVE_SPEC(1); - VERT_COPY_SPEC(v[0], v[2]); - VERT_COPY_SPEC(v[1], v[2]); - } - } else { - VERT_SAVE_IND(0); - VERT_SAVE_IND(1); - VERT_COPY_IND(v[0], v[2]); - VERT_COPY_IND(v[1], v[2]); - } - } - -/* fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */ -/* _mesa_lookup_enum_by_nr( mode ), */ -/* ef[e0], ef[e1], ef[e2]); */ - - if (mode == GL_POINT) { - RASTERIZE(GL_POINTS); - if (ef[e0]) POINT( v[0] ); - if (ef[e1]) POINT( v[1] ); - if (ef[e2]) POINT( v[2] ); - } - else { - RASTERIZE(GL_LINES); - if (RENDER_PRIMITIVE == GL_POLYGON) { - if (ef[e2]) LINE( v[2], v[0] ); - if (ef[e0]) LINE( v[0], v[1] ); - if (ef[e1]) LINE( v[1], v[2] ); - } - else { - if (ef[e0]) LINE( v[0], v[1] ); - if (ef[e1]) LINE( v[1], v[2] ); - if (ef[e2]) LINE( v[2], v[0] ); - } - } - - if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA(0); - VERT_RESTORE_RGBA(1); - - if (HAVE_SPEC) { - VERT_RESTORE_SPEC(0); - VERT_RESTORE_SPEC(1); - } - } else { - VERT_RESTORE_IND(0); - VERT_RESTORE_IND(1); - } - } -} - - -static void TAG(unfilled_quad)( GLcontext *ctx, - GLenum mode, - GLuint e0, GLuint e1, - GLuint e2, GLuint e3 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - VERTEX *v[4]; - LOCAL_VARS(4); - - v[0] = (VERTEX *)GET_VERTEX(e0); - v[1] = (VERTEX *)GET_VERTEX(e1); - v[2] = (VERTEX *)GET_VERTEX(e2); - v[3] = (VERTEX *)GET_VERTEX(e3); - - /* Hardware flatshading breaks down here. If the hardware doesn't - * support flatshading, this will already have been done: - */ - if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA(0); - VERT_SAVE_RGBA(1); - VERT_SAVE_RGBA(2); - VERT_COPY_RGBA(v[0], v[3]); - VERT_COPY_RGBA(v[1], v[3]); - VERT_COPY_RGBA(v[2], v[3]); - - if (HAVE_SPEC) { - VERT_SAVE_SPEC(0); - VERT_SAVE_SPEC(1); - VERT_SAVE_SPEC(2); - VERT_COPY_SPEC(v[0], v[3]); - VERT_COPY_SPEC(v[1], v[3]); - VERT_COPY_SPEC(v[2], v[3]); - } - } else { - VERT_SAVE_IND(0); - VERT_SAVE_IND(1); - VERT_SAVE_IND(2); - VERT_COPY_IND(v[0], v[3]); - VERT_COPY_IND(v[1], v[3]); - VERT_COPY_IND(v[2], v[3]); - } - } - - if (mode == GL_POINT) { - RASTERIZE(GL_POINTS); - if (ef[e0]) POINT( v[0] ); - if (ef[e1]) POINT( v[1] ); - if (ef[e2]) POINT( v[2] ); - if (ef[e3]) POINT( v[3] ); - } - else { - RASTERIZE(GL_LINES); - if (ef[e0]) LINE( v[0], v[1] ); - if (ef[e1]) LINE( v[1], v[2] ); - if (ef[e2]) LINE( v[2], v[3] ); - if (ef[e3]) LINE( v[3], v[0] ); - } - - if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA(0); - VERT_RESTORE_RGBA(1); - VERT_RESTORE_RGBA(2); - - if (HAVE_SPEC) { - VERT_RESTORE_SPEC(0); - VERT_RESTORE_SPEC(1); - VERT_RESTORE_SPEC(2); - } - } else { - VERT_RESTORE_IND(0); - VERT_RESTORE_IND(1); - VERT_RESTORE_IND(2); - } - } -} - - -#if HAVE_RGBA -#undef VERT_SET_IND -#undef VERT_COPY_IND -#undef VERT_SAVE_IND -#undef VERT_RESTORE_IND -#endif - -#if !HAVE_SPEC -#undef VERT_SET_SPEC -#undef VERT_COPY_SPEC -#undef VERT_SAVE_SPEC -#undef VERT_RESTORE_SPEC -#endif - -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_vb.c b/src/libs/mesa/mesa/tnl_dd/t_dd_vb.c deleted file mode 100644 index 3cedd90119..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_vb.c +++ /dev/null @@ -1,344 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Keith Whitwell - */ -#include "math/m_translate.h" - -#if (HAVE_HW_VIEWPORT) -#define UNVIEWPORT_VARS -#define UNVIEWPORT_X(x) x -#define UNVIEWPORT_Y(x) x -#define UNVIEWPORT_Z(x) x -#endif - -#ifndef LOCALVARS -#define LOCALVARS -#endif - -#ifndef CHECK_HW_DIVIDE -#define CHECK_HW_DIVIDE 1 -#endif - -/* These don't need to be duplicated, but there's currently nowhere - * really convenient to put them. Need to build some actual .o files in - * this directory? - */ -static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - LOCALVARS - GLubyte *verts = GET_VERTEX_STORE(); - GLuint size = GET_VERTEX_SIZE(); - GLuint *dst = (GLuint *)(verts + (edst * size)); - GLuint *src = (GLuint *)(verts + (esrc * size)); - dst[4] = src[4]; - dst[5] = src[5]; -} - -static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - LOCALVARS - GLubyte *verts = GET_VERTEX_STORE(); - GLuint size = GET_VERTEX_SIZE(); - GLuint *dst = (GLuint *)(verts + (edst * size)); - GLuint *src = (GLuint *)(verts + (esrc * size)); - dst[4] = src[4]; -} - -static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - LOCALVARS - GLubyte *verts = GET_VERTEX_STORE(); - GLuint size = GET_VERTEX_SIZE(); - GLuint *dst = (GLuint *)(verts + (edst * size)); - GLuint *src = (GLuint *)(verts + (esrc * size)); - dst[3] = src[3]; -} - - -void TAG(translate_vertex)(GLcontext *ctx, - const VERTEX *src, - SWvertex *dst) -{ - LOCALVARS - GLuint format = GET_VERTEX_FORMAT(); - GLfloat *s = ctx->Viewport._WindowMap.m; - UNVIEWPORT_VARS; - - if (format == TINY_VERTEX_FORMAT) { - if (HAVE_HW_VIEWPORT) { - dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; - dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; - dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; - dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; - } else { - dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); - dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); - dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); - dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; - } - - dst->color[0] = src->tv.color.red; - dst->color[1] = src->tv.color.green; - dst->color[2] = src->tv.color.blue; - dst->color[3] = src->tv.color.alpha; - } - else { - if (HAVE_HW_VIEWPORT) { - if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { - GLfloat oow = 1.0 / src->v.w; - dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x * oow + s[12]; - dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y * oow + s[13]; - dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z * oow + s[14]; - dst->attrib[FRAG_ATTRIB_WPOS][3] = oow; - } else { - dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; - dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; - dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; - dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; - } - } else { - dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); - dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); - dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); - dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; - } - - dst->color[0] = src->v.color.red; - dst->color[1] = src->v.color.green; - dst->color[2] = src->v.color.blue; - dst->color[3] = src->v.color.alpha; - - dst->attrib[FRAG_ATTRIB_COL1][0] = UBYTE_TO_FLOAT(src->v.specular.red); - dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(src->v.specular.green); - dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(src->v.specular.blue); - - dst->attrib[FRAG_ATTRIB_FOGC][0] = UBYTE_TO_FLOAT(src->v.specular.alpha); - - if (HAVE_PTEX_VERTICES && - ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || - (format == PROJ_TEX1_VERTEX_FORMAT))) { - - dst->attrib[FRAG_ATTRIB_TEX0][0] = src->pv.u0; - dst->attrib[FRAG_ATTRIB_TEX0][1] = src->pv.v0; - dst->attrib[FRAG_ATTRIB_TEX0][3] = src->pv.q0; - - dst->attrib[FRAG_ATTRIB_TEX1][0] = src->pv.u1; - dst->attrib[FRAG_ATTRIB_TEX1][1] = src->pv.v1; - dst->attrib[FRAG_ATTRIB_TEX1][3] = src->pv.q1; - - if (HAVE_TEX2_VERTICES) { - dst->attrib[FRAG_ATTRIB_TEX2][0] = src->pv.u2; - dst->attrib[FRAG_ATTRIB_TEX2][1] = src->pv.v2; - dst->attrib[FRAG_ATTRIB_TEX2][3] = src->pv.q2; - } - - if (HAVE_TEX3_VERTICES) { - dst->attrib[FRAG_ATTRIB_TEX3][0] = src->pv.u3; - dst->attrib[FRAG_ATTRIB_TEX3][1] = src->pv.v3; - dst->attrib[FRAG_ATTRIB_TEX3][3] = src->pv.q3; - } - } - else { - dst->attrib[FRAG_ATTRIB_TEX0][0] = src->v.u0; - dst->attrib[FRAG_ATTRIB_TEX0][1] = src->v.v0; - dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0; - - dst->attrib[FRAG_ATTRIB_TEX1][0] = src->v.u1; - dst->attrib[FRAG_ATTRIB_TEX1][1] = src->v.v1; - dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0; - - if (HAVE_TEX2_VERTICES) { - dst->attrib[FRAG_ATTRIB_TEX2][0] = src->v.u2; - dst->attrib[FRAG_ATTRIB_TEX2][1] = src->v.v2; - dst->attrib[FRAG_ATTRIB_TEX2][3] = 1.0; - } - - if (HAVE_TEX3_VERTICES) { - dst->attrib[FRAG_ATTRIB_TEX3][0] = src->v.u3; - dst->attrib[FRAG_ATTRIB_TEX3][1] = src->v.v3; - dst->attrib[FRAG_ATTRIB_TEX3][3] = 1.0; - } - } - } - - dst->pointSize = ctx->Point.Size; -} - - - -void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v ) -{ - LOCALVARS - GLuint format = GET_VERTEX_FORMAT(); - - fprintf(stderr, "(%x) ", format); - - switch (format) { -#if HAVE_TINY_VERTICES - case TINY_VERTEX_FORMAT: - fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n", - v->v.x, v->v.y, v->v.z, - v->tv.color.red, - v->tv.color.green, - v->tv.color.blue, - v->tv.color.alpha); - break; -#endif -#if HAVE_NOTEX_VERTICES - case NOTEX_VERTEX_FORMAT: - fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n", - v->v.x, v->v.y, v->v.z, v->v.w, - v->v.color.red, - v->v.color.green, - v->v.color.blue, - v->v.color.alpha, - v->v.specular.red, - v->v.specular.green, - v->v.specular.blue, - v->v.specular.alpha); - break; -#endif -#if HAVE_TEX0_VERTICES - case TEX0_VERTEX_FORMAT: - fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n", - v->v.x, v->v.y, v->v.z, v->v.w, - v->v.color.red, - v->v.color.green, - v->v.color.blue, - v->v.color.alpha, - v->v.u0, - v->v.v0); - break; -#endif -#if HAVE_TEX1_VERTICES - case TEX1_VERTEX_FORMAT: - fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n", - v->v.x, v->v.y, v->v.z, v->v.w, - v->v.color.red, - v->v.color.green, - v->v.color.blue, - v->v.color.alpha, - v->v.u0, - v->v.v0, - v->v.u1, - v->v.u2); - break; -#endif -#if HAVE_PTEX_VERTICES - case PROJ_TEX1_VERTEX_FORMAT: - fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n", - v->v.x, v->v.y, v->v.z, v->v.w, - v->v.color.red, - v->v.color.green, - v->v.color.blue, - v->v.color.alpha, - v->pv.u0, - v->pv.v0, - v->pv.q0, - v->pv.u1, - v->pv.v1, - v->pv.q1); - break; -#endif - default: - fprintf(stderr, "???\n"); - break; - } - - fprintf(stderr, "\n"); -} - - - -/* Interpolate the elements of the VB not included in typical hardware - * vertices. - * - * NOTE: All these arrays are guarenteed by tnl to be writeable and - * have good stride. - */ -#ifndef INTERP_QUALIFIER -#define INTERP_QUALIFIER static -#endif - -#define GET_COLOR(ptr, idx) ((ptr)->data[idx]) - - -INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, - GLfloat t, - GLuint dst, GLuint out, GLuint in, - GLboolean force_boundary ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - if (VB->ColorPtr[1]) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); - - INTERP_4F( t, - GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], out), - GET_COLOR(VB->ColorPtr[1], in) ); - - if (VB->SecondaryColorPtr[1]) { - INTERP_3F( t, - GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], out), - GET_COLOR(VB->SecondaryColorPtr[1], in) ); - } - } - - if (VB->EdgeFlag) { - VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary; - } - - INTERP_VERTEX(ctx, t, dst, out, in, force_boundary); -} - -INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, - GLuint dst, GLuint src ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); - - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], src) ); - } - } - - COPY_PV_VERTEX(ctx, dst, src); -} - - -#undef INTERP_QUALIFIER -#undef GET_COLOR - -#undef IND -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_vbtmp.h b/src/libs/mesa/mesa/tnl_dd/t_dd_vbtmp.h deleted file mode 100644 index 92dd8931c3..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_vbtmp.h +++ /dev/null @@ -1,675 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0.1 - * - * Copyright (C) 1999-2003 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. - * - * Authors: - * Keith Whitwell - */ - - -/* Unlike the other templates here, this assumes quite a bit about the - * underlying hardware. Specifically it assumes a d3d-like vertex - * format, with a layout more or less constrained to look like the - * following: - * - * union { - * struct { - * float x, y, z, w; - * struct { char r, g, b, a; } color; - * struct { char r, g, b, fog; } spec; - * float u0, v0; - * float u1, v1; - * float u2, v2; - * float u3, v3; - * } v; - * struct { - * float x, y, z, w; - * struct { char r, g, b, a; } color; - * struct { char r, g, b, fog; } spec; - * float u0, v0, q0; - * float u1, v1, q1; - * float u2, v2, q2; - * float u3, v3, q3; - * } pv; - * struct { - * float x, y, z; - * struct { char r, g, b, a; } color; - * } tv; - * float f[16]; - * unsigned int ui[16]; - * unsigned char ub4[4][16]; - * } - * - - * VERTEX: hw vertex type as above - * VERTEX_COLOR: hw color struct type in VERTEX - * - * DO_XYZW: Emit xyz and maybe w coordinates. - * DO_RGBA: Emit color. - * DO_SPEC: Emit specular color. - * DO_FOG: Emit fog coordinate in specular alpha. - * DO_TEX0: Emit tex0 u,v coordinates. - * DO_TEX1: Emit tex1 u,v coordinates. - * DO_TEX2: Emit tex2 u,v coordinates. - * DO_TEX3: Emit tex3 u,v coordinates. - * DO_PTEX: Emit tex0,1,2,3 q coordinates where possible. - * - * HAVE_RGBA_COLOR: Hardware takes color in rgba order (else bgra). - * - * HAVE_HW_VIEWPORT: Hardware performs viewport transform. - * HAVE_HW_DIVIDE: Hardware performs perspective divide. - * - * HAVE_TINY_VERTICES: Hardware understands v.tv format. - * HAVE_PTEX_VERTICES: Hardware understands v.pv format. - * HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0. - * - * Additionally, this template assumes it is emitting *transformed* - * vertices; the modifications to emit untransformed vertices (ie. to - * t&l hardware) are probably too great to cooexist with the code - * already in this file. - * - * NOTE: The PTEX vertex format always includes TEX0 and TEX1, even if - * only TEX0 is enabled, in order to maintain a vertex size which is - * an exact number of quadwords. - */ - -#if (HAVE_HW_VIEWPORT) -#define VIEWPORT_X(dst,x) dst = x -#define VIEWPORT_Y(dst,y) dst = y -#define VIEWPORT_Z(dst,z) dst = z -#else -#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12] -#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13] -#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14] -#endif - -#if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES) -#error "can't cope with this combination" -#endif - -#ifndef LOCALVARS -#define LOCALVARS -#endif - -#ifndef CHECK_HW_DIVIDE -#define CHECK_HW_DIVIDE 1 -#endif - -#if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES) - -static void TAG(emit)( GLcontext *ctx, - GLuint start, GLuint end, - void *dest, - GLuint stride ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4]; - GLfloat (*tc2)[4], (*tc3)[4]; - GLfloat (*col)[4], (*spec)[4]; - GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride; - GLuint tc2_stride, tc3_stride; - GLuint tc0_size, tc1_size, col_size; - GLuint tc2_size, tc3_size; - GLfloat (*coord)[4]; - GLuint coord_stride; - VERTEX *v = (VERTEX *)dest; - const GLfloat *s = GET_VIEWPORT_MAT(); - const GLubyte *mask = VB->ClipMask; - int i; - -/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */ -/* __FUNCTION__, VB->importable_data, start, end); */ - - if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { - (void) s; - coord = VB->ClipPtr->data; - coord_stride = VB->ClipPtr->stride; - } - else { - coord = VB->NdcPtr->data; - coord_stride = VB->NdcPtr->stride; - } - - if (DO_TEX3) { - const GLuint t3 = GET_TEXSOURCE(3); - tc3 = VB->TexCoordPtr[t3]->data; - tc3_stride = VB->TexCoordPtr[t3]->stride; - if (DO_PTEX) - tc3_size = VB->TexCoordPtr[t3]->size; - } - - if (DO_TEX2) { - const GLuint t2 = GET_TEXSOURCE(2); - tc2 = VB->TexCoordPtr[t2]->data; - tc2_stride = VB->TexCoordPtr[t2]->stride; - if (DO_PTEX) - tc2_size = VB->TexCoordPtr[t2]->size; - } - - if (DO_TEX1) { - const GLuint t1 = GET_TEXSOURCE(1); - tc1 = VB->TexCoordPtr[t1]->data; - tc1_stride = VB->TexCoordPtr[t1]->stride; - if (DO_PTEX) - tc1_size = VB->TexCoordPtr[t1]->size; - } - - if (DO_TEX0) { - const GLuint t0 = GET_TEXSOURCE(0); - tc0_stride = VB->TexCoordPtr[t0]->stride; - tc0 = VB->TexCoordPtr[t0]->data; - if (DO_PTEX) - tc0_size = VB->TexCoordPtr[t0]->size; - } - - if (DO_RGBA) { - col_stride = VB->ColorPtr[0]->stride; - col = VB->ColorPtr[0]->data; - col_size = VB->ColorPtr[0]->size; - } - - if (DO_SPEC) { - if (VB->SecondaryColorPtr[0]) { - spec_stride = VB->SecondaryColorPtr[0]->stride; - spec = VB->SecondaryColorPtr[0]->data; - } else { - spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; - spec_stride = 0; - } - } - - if (DO_FOG) { - if (VB->FogCoordPtr) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; - } - else { - static GLfloat tmp[4] = {0, 0, 0, 0}; - fog = &tmp; - fog_stride = 0; - } - } - - /* May have nonstandard strides: - */ - if (start) { - STRIDE_4F(coord, start * coord_stride); - if (DO_TEX0) - STRIDE_4F(tc0, start * tc0_stride); - if (DO_TEX1) - STRIDE_4F(tc1, start * tc1_stride); - if (DO_TEX2) - STRIDE_4F(tc2, start * tc2_stride); - if (DO_TEX3) - STRIDE_4F(tc3, start * tc3_stride); - if (DO_RGBA) - STRIDE_4F(col, start * col_stride); - if (DO_SPEC) - STRIDE_4F(spec, start * spec_stride); - if (DO_FOG) - STRIDE_4F(fog, start * fog_stride); - } - - for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) { - if (DO_XYZW) { - if (HAVE_HW_VIEWPORT || mask[i] == 0) { - VIEWPORT_X(v->v.x, coord[0][0]); - VIEWPORT_Y(v->v.y, coord[0][1]); - VIEWPORT_Z(v->v.z, coord[0][2]); - v->v.w = coord[0][3]; - } - STRIDE_4F(coord, coord_stride); - } - if (DO_RGBA) { - UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.red, col[0][0]); - UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.green, col[0][1]); - UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.blue, col[0][2]); - if (col_size == 4) { - UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.alpha, col[0][3]); - } else { - v->v.color.alpha = CHAN_MAX; - } - STRIDE_4F(col, col_stride); - } - if (DO_SPEC) { - UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.red, spec[0][0]); - UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.green, spec[0][1]); - UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.blue, spec[0][2]); - STRIDE_4F(spec, spec_stride); - } - if (DO_FOG) { - UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.alpha, fog[0][0]); - STRIDE_4F(fog, fog_stride); - } - if (DO_TEX0) { - v->v.u0 = tc0[0][0]; - v->v.v0 = tc0[0][1]; - if (DO_PTEX) { - if (HAVE_PTEX_VERTICES) { - if (tc0_size == 4) - v->pv.q0 = tc0[0][3]; - else - v->pv.q0 = 1.0; - } - else if (tc0_size == 4) { - float rhw = 1.0 / tc0[0][3]; - v->v.w *= tc0[0][3]; - v->v.u0 *= rhw; - v->v.v0 *= rhw; - } - } - STRIDE_4F(tc0, tc0_stride); - } - if (DO_TEX1) { - if (DO_PTEX) { - v->pv.u1 = tc1[0][0]; - v->pv.v1 = tc1[0][1]; - if (tc1_size == 4) - v->pv.q1 = tc1[0][3]; - else - v->pv.q1 = 1.0; - } - else { - v->v.u1 = tc1[0][0]; - v->v.v1 = tc1[0][1]; - } - STRIDE_4F(tc1, tc1_stride); - } - else if (DO_PTEX) { - *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ - } - if (DO_TEX2) { - if (DO_PTEX) { - v->pv.u2 = tc2[0][0]; - v->pv.v2 = tc2[0][1]; - if (tc2_size == 4) - v->pv.q2 = tc2[0][3]; - else - v->pv.q2 = 1.0; - } - else { - v->v.u2 = tc2[0][0]; - v->v.v2 = tc2[0][1]; - } - STRIDE_4F(tc2, tc2_stride); - } - if (DO_TEX3) { - if (DO_PTEX) { - v->pv.u3 = tc3[0][0]; - v->pv.v3 = tc3[0][1]; - if (tc3_size == 4) - v->pv.q3 = tc3[0][3]; - else - v->pv.q3 = 1.0; - } - else { - v->v.u3 = tc3[0][0]; - v->v.v3 = tc3[0][1]; - } - STRIDE_4F(tc3, tc3_stride); - } - } - -} -#else - -#if HAVE_HW_DIVIDE -#error "cannot use tiny vertices with hw perspective divide" -#endif - -static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, - void *dest, GLuint stride ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLfloat (*col)[4]; - GLuint col_stride, col_size; - GLfloat (*coord)[4] = VB->NdcPtr->data; - GLuint coord_stride = VB->NdcPtr->stride; - GLfloat *v = (GLfloat *)dest; - const GLubyte *mask = VB->ClipMask; - const GLfloat *s = GET_VIEWPORT_MAT(); - int i; - - (void) s; - - ASSERT(stride == 4); - - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; - col_size = VB->ColorPtr[0]->size; - -/* fprintf(stderr, "%s(small) importable %x\n", */ -/* __FUNCTION__, VB->importable_data); */ - - /* Pack what's left into a 4-dword vertex. Color is in a different - * place, and there is no 'w' coordinate. - */ - if (start) { - STRIDE_4F(coord, start * coord_stride); - STRIDE_4F(col, start * col_stride); - } - - for (i=start; i < end; i++, v+=4) { - if (DO_XYZW) { - if (HAVE_HW_VIEWPORT || mask[i] == 0) { - VIEWPORT_X(v[0], coord[0][0]); - VIEWPORT_Y(v[1], coord[0][1]); - VIEWPORT_Z(v[2], coord[0][2]); - } - STRIDE_4F( coord, coord_stride ); - } - if (DO_RGBA) { - VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3]; - UNCLAMPED_FLOAT_TO_UBYTE(c->red, col[0][0]); - UNCLAMPED_FLOAT_TO_UBYTE(c->green, col[0][1]); - UNCLAMPED_FLOAT_TO_UBYTE(c->blue, col[0][2]); - if (col_size == 4) { - UNCLAMPED_FLOAT_TO_UBYTE(c->alpha, col[0][3]); - } else { - c->alpha = CHAN_MAX; - } - STRIDE_4F( col, col_stride ); - } -/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */ -/* i, v[0], v[1], v[2], *(int *)&v[3]); */ - } -} - -#endif /* emit */ - -#if (DO_XYZW) && (DO_RGBA) - - -#if (HAVE_PTEX_VERTICES) -static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - /* Force 'missing' texcoords to something valid. - */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; - - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; - - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; - - if (DO_PTEX) - return GL_TRUE; - - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) || - (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4)) - return GL_FALSE; - - return GL_TRUE; -} -#else -static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - /* Force 'missing' texcoords to something valid. - */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; - - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; - - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; - - if (DO_PTEX) - return GL_TRUE; - - /* No hardware support for projective texture. Can fake it for - * TEX0 only. - */ - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) { - PTEX_FALLBACK(); - return GL_FALSE; - } - - if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) { - if (DO_TEX1 || DO_TEX2 || DO_TEX3) { - PTEX_FALLBACK(); - } - return GL_FALSE; - } - - return GL_TRUE; -} -#endif /* ptex */ - - -static void TAG(interp)( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ) -{ - LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ddverts = GET_VERTEX_STORE(); - GLuint size = GET_VERTEX_SIZE(); - const GLfloat *dstclip = VB->ClipPtr->data[edst]; - GLfloat w; - const GLfloat *s = GET_VIEWPORT_MAT(); - - VERTEX *dst = (VERTEX *)(ddverts + (edst * size)); - VERTEX *in = (VERTEX *)(ddverts + (ein * size)); - VERTEX *out = (VERTEX *)(ddverts + (eout * size)); - - (void)s; - - if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { - VIEWPORT_X( dst->v.x, dstclip[0] ); - VIEWPORT_Y( dst->v.y, dstclip[1] ); - VIEWPORT_Z( dst->v.z, dstclip[2] ); - w = dstclip[3]; - } - else { - w = 1.0 / dstclip[3]; - VIEWPORT_X( dst->v.x, dstclip[0] * w ); - VIEWPORT_Y( dst->v.y, dstclip[1] * w ); - VIEWPORT_Z( dst->v.z, dstclip[2] * w ); - } - - if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || - DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 || - DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) { - - dst->v.w = w; - - INTERP_UB( t, dst->ub4[4][0], out->ub4[4][0], in->ub4[4][0] ); - INTERP_UB( t, dst->ub4[4][1], out->ub4[4][1], in->ub4[4][1] ); - INTERP_UB( t, dst->ub4[4][2], out->ub4[4][2], in->ub4[4][2] ); - INTERP_UB( t, dst->ub4[4][3], out->ub4[4][3], in->ub4[4][3] ); - - if (DO_SPEC) { - INTERP_UB( t, dst->v.specular.red, out->v.specular.red, in->v.specular.red ); - INTERP_UB( t, dst->v.specular.green, out->v.specular.green, in->v.specular.green ); - INTERP_UB( t, dst->v.specular.blue, out->v.specular.blue, in->v.specular.blue ); - } - if (DO_FOG) { - INTERP_UB( t, dst->v.specular.alpha, out->v.specular.alpha, in->v.specular.alpha ); - } - if (DO_TEX0) { - if (DO_PTEX) { - if (HAVE_PTEX_VERTICES) { - INTERP_F( t, dst->pv.u0, out->pv.u0, in->pv.u0 ); - INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 ); - INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 ); - } else { - GLfloat wout = VB->NdcPtr->data[eout][3]; - GLfloat win = VB->NdcPtr->data[ein][3]; - GLfloat qout = out->pv.w / wout; - GLfloat qin = in->pv.w / win; - GLfloat qdst, rqdst; - - ASSERT( !HAVE_HW_DIVIDE ); - - INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin ); - INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin ); - INTERP_F( t, qdst, qout, qin ); - - rqdst = 1.0 / qdst; - dst->v.u0 *= rqdst; - dst->v.v0 *= rqdst; - dst->v.w *= rqdst; - } - } - else { - INTERP_F( t, dst->v.u0, out->v.u0, in->v.u0 ); - INTERP_F( t, dst->v.v0, out->v.v0, in->v.v0 ); - } - } - if (DO_TEX1) { - if (DO_PTEX) { - INTERP_F( t, dst->pv.u1, out->pv.u1, in->pv.u1 ); - INTERP_F( t, dst->pv.v1, out->pv.v1, in->pv.v1 ); - INTERP_F( t, dst->pv.q1, out->pv.q1, in->pv.q1 ); - } else { - INTERP_F( t, dst->v.u1, out->v.u1, in->v.u1 ); - INTERP_F( t, dst->v.v1, out->v.v1, in->v.v1 ); - } - } - else if (DO_PTEX) { - dst->pv.q1 = 0.0; /* must be a valid float on radeon */ - } - if (DO_TEX2) { - if (DO_PTEX) { - INTERP_F( t, dst->pv.u2, out->pv.u2, in->pv.u2 ); - INTERP_F( t, dst->pv.v2, out->pv.v2, in->pv.v2 ); - INTERP_F( t, dst->pv.q2, out->pv.q2, in->pv.q2 ); - } else { - INTERP_F( t, dst->v.u2, out->v.u2, in->v.u2 ); - INTERP_F( t, dst->v.v2, out->v.v2, in->v.v2 ); - } - } - if (DO_TEX3) { - if (DO_PTEX) { - INTERP_F( t, dst->pv.u3, out->pv.u3, in->pv.u3 ); - INTERP_F( t, dst->pv.v3, out->pv.v3, in->pv.v3 ); - INTERP_F( t, dst->pv.q3, out->pv.q3, in->pv.q3 ); - } else { - INTERP_F( t, dst->v.u3, out->v.u3, in->v.u3 ); - INTERP_F( t, dst->v.v3, out->v.v3, in->v.v3 ); - } - } - } else { - /* 4-dword vertex. Color is in v[3] and there is no oow coordinate. - */ - INTERP_UB( t, dst->ub4[3][0], out->ub4[3][0], in->ub4[3][0] ); - INTERP_UB( t, dst->ub4[3][1], out->ub4[3][1], in->ub4[3][1] ); - INTERP_UB( t, dst->ub4[3][2], out->ub4[3][2], in->ub4[3][2] ); - INTERP_UB( t, dst->ub4[3][3], out->ub4[3][3], in->ub4[3][3] ); - } -} - -#endif /* rgba && xyzw */ - - -static void TAG(init)( void ) -{ - setup_tab[IND].emit = TAG(emit); - -#if (DO_XYZW && DO_RGBA) - setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes); - setup_tab[IND].interp = TAG(interp); -#endif - - if (DO_SPEC) - setup_tab[IND].copy_pv = copy_pv_rgba4_spec5; - else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 || - DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) - setup_tab[IND].copy_pv = copy_pv_rgba4; - else - setup_tab[IND].copy_pv = copy_pv_rgba3; - - if (DO_TEX3) { - if (DO_PTEX) { - ASSERT(HAVE_PTEX_VERTICES); - setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 18; - } - else { - setup_tab[IND].vertex_format = TEX3_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 14; - } - } - else if (DO_TEX2) { - if (DO_PTEX) { - ASSERT(HAVE_PTEX_VERTICES); - setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 18; - } - else { - setup_tab[IND].vertex_format = TEX2_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 12; - } - } - else if (DO_TEX1) { - if (DO_PTEX) { - ASSERT(HAVE_PTEX_VERTICES); - setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 12; - } - else { - setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 10; - } - } - else if (DO_TEX0) { - if (DO_PTEX && HAVE_PTEX_VERTICES) { - setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 12; - } else { - setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 8; - } - } - else if (!HAVE_HW_DIVIDE && !DO_SPEC && !DO_FOG && HAVE_TINY_VERTICES) { - setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 4; - } else if (HAVE_NOTEX_VERTICES) { - setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 6; - } else { - setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT; - setup_tab[IND].vertex_size = 8; - } -} - - -#undef IND -#undef TAG diff --git a/src/libs/mesa/mesa/tnl_dd/t_dd_vertex.h b/src/libs/mesa/mesa/tnl_dd/t_dd_vertex.h deleted file mode 100644 index d45dd09fbd..0000000000 --- a/src/libs/mesa/mesa/tnl_dd/t_dd_vertex.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.0.3 - * - * Copyright (C) 1999-2002 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. - * - * Authors: - * Keith Whitwell - */ - -typedef struct { - GLfloat x, y, z, w; -} TAG(_coord_t); - -#ifdef COLOR_IS_RGBA -typedef struct { -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN - GLubyte alpha, blue, green, red; -#else - GLubyte red, green, blue, alpha; -#endif -} TAG(_color_t); -#else -typedef struct { -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN - GLubyte alpha, red, green, blue; -#else - GLubyte blue, green, red, alpha; -#endif -} TAG(_color_t); -#endif - -typedef union { - struct { - GLfloat x, y, z, w; - TAG(_color_t) color; - TAG(_color_t) specular; - GLfloat u0, v0; - GLfloat u1, v1; - GLfloat u2, v2; - GLfloat u3, v3; - } v; - struct { - GLfloat x, y, z, w; - TAG(_color_t) color; - TAG(_color_t) specular; - GLfloat u0, v0, q0; - GLfloat u1, v1, q1; - GLfloat u2, v2, q2; - GLfloat u3, v3, q3; - } pv; - struct { - GLfloat x, y, z; - TAG(_color_t) color; - } tv; - GLfloat f[24]; - GLuint ui[24]; - GLubyte ub4[24][4]; -} TAG(Vertex), *TAG(VertexPtr); - diff --git a/src/libs/mesa/mesa/vbo/vbo.h b/src/libs/mesa/mesa/vbo/vbo.h deleted file mode 100644 index 4c51b44cda..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file vbo_context.h - * \brief VBO builder module datatypes and definitions. - * \author Keith Whitwell - */ - - -#ifndef _VBO_H -#define _VBO_H - -#include "main/mtypes.h" - -struct _mesa_prim { - GLuint mode:8; - GLuint indexed:1; - GLuint begin:1; - GLuint end:1; - GLuint weak:1; - GLuint pad:20; - - GLuint start; - GLuint count; -}; - -/* Would like to call this a "vbo_index_buffer", but this would be - * confusing as the indices are not neccessarily yet in a non-null - * buffer object. - */ -struct _mesa_index_buffer { - GLuint count; - GLenum type; - struct gl_buffer_object *obj; - const void *ptr; -}; - - - -GLboolean _vbo_CreateContext( GLcontext *ctx ); -void _vbo_DestroyContext( GLcontext *ctx ); -void _vbo_InvalidateState( GLcontext *ctx, GLuint new_state ); - - -typedef void (*vbo_draw_func)( GLcontext *ctx, - const struct gl_client_array **arrays, - const struct _mesa_prim *prims, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index ); - - - - -/* Utility function to cope with various constraints on tnl modules or - * hardware. This can be used to split an incoming set of arrays and - * primitives against the following constraints: - * - Maximum number of indices in index buffer. - * - Maximum number of vertices referenced by index buffer. - * - Maximum hardware vertex buffer size. - */ -struct split_limits { - GLuint max_verts; - GLuint max_indices; - GLuint max_vb_size; /* bytes */ -}; - - -void vbo_split_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw, - const struct split_limits *limits ); - - -/* Helpers for dealing translating away non-zero min_index. - */ -GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] ); - -void vbo_rebase_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw ); - - -void vbo_use_buffer_objects(GLcontext *ctx); - - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_attrib.h b/src/libs/mesa/mesa/vbo/vbo_attrib.h deleted file mode 100644 index 0ae928f2af..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_attrib.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright (C) Intel Corp. 2006. All Rights Reserved. - Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to - develop this 3D driver. - - 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 (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 NONINFRINGEMENT. - IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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: - * Keith Whitwell - */ - -#ifndef VBO_ATTRIB_H -#define VBO_ATTRIB_H - - -/* - * Note: The first attributes match the VERT_ATTRIB_* definitions - * in mtypes.h. However, the tnl module has additional attributes - * for materials, color indexes, edge flags, etc. - */ -/* Although it's nice to use these as bit indexes in a DWORD flag, we - * could manage without if necessary. Another limit currently is the - * number of bits allocated for these numbers in places like vertex - * program instruction formats and register layouts. - */ -enum { - VBO_ATTRIB_POS = 0, - VBO_ATTRIB_WEIGHT = 1, - VBO_ATTRIB_NORMAL = 2, - VBO_ATTRIB_COLOR0 = 3, - VBO_ATTRIB_COLOR1 = 4, - VBO_ATTRIB_FOG = 5, - VBO_ATTRIB_INDEX = 6, - VBO_ATTRIB_EDGEFLAG = 7, - VBO_ATTRIB_TEX0 = 8, - VBO_ATTRIB_TEX1 = 9, - VBO_ATTRIB_TEX2 = 10, - VBO_ATTRIB_TEX3 = 11, - VBO_ATTRIB_TEX4 = 12, - VBO_ATTRIB_TEX5 = 13, - VBO_ATTRIB_TEX6 = 14, - VBO_ATTRIB_TEX7 = 15, - - VBO_ATTRIB_GENERIC0 = 16, /* Not used? */ - VBO_ATTRIB_GENERIC1 = 17, - VBO_ATTRIB_GENERIC2 = 18, - VBO_ATTRIB_GENERIC3 = 19, - VBO_ATTRIB_GENERIC4 = 20, - VBO_ATTRIB_GENERIC5 = 21, - VBO_ATTRIB_GENERIC6 = 22, - VBO_ATTRIB_GENERIC7 = 23, - VBO_ATTRIB_GENERIC8 = 24, - VBO_ATTRIB_GENERIC9 = 25, - VBO_ATTRIB_GENERIC10 = 26, - VBO_ATTRIB_GENERIC11 = 27, - VBO_ATTRIB_GENERIC12 = 28, - VBO_ATTRIB_GENERIC13 = 29, - VBO_ATTRIB_GENERIC14 = 30, - VBO_ATTRIB_GENERIC15 = 31, - - /* XXX: in the vertex program InputsRead flag, we alias - * materials and generics and use knowledge about the program - * (whether it is a fixed-function emulation) to - * differentiate. Here we must keep them apart instead. - */ - VBO_ATTRIB_MAT_FRONT_AMBIENT = 32, - VBO_ATTRIB_MAT_BACK_AMBIENT = 33, - VBO_ATTRIB_MAT_FRONT_DIFFUSE = 34, - VBO_ATTRIB_MAT_BACK_DIFFUSE = 35, - VBO_ATTRIB_MAT_FRONT_SPECULAR = 36, - VBO_ATTRIB_MAT_BACK_SPECULAR = 37, - VBO_ATTRIB_MAT_FRONT_EMISSION = 38, - VBO_ATTRIB_MAT_BACK_EMISSION = 39, - VBO_ATTRIB_MAT_FRONT_SHININESS = 40, - VBO_ATTRIB_MAT_BACK_SHININESS = 41, - VBO_ATTRIB_MAT_FRONT_INDEXES = 42, - VBO_ATTRIB_MAT_BACK_INDEXES = 43, - - VBO_ATTRIB_MAX = 44 -}; - -#define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT -#define VBO_ATTRIB_LAST_MATERIAL VBO_ATTRIB_MAT_BACK_INDEXES - -#define VBO_MAX_COPIED_VERTS 3 - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_attrib_tmp.h b/src/libs/mesa/mesa/vbo/vbo_attrib_tmp.h deleted file mode 100644 index ff11c7d59a..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_attrib_tmp.h +++ /dev/null @@ -1,486 +0,0 @@ -/************************************************************************** - -Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -TUNGSTEN GRAPHICS AND/OR THEIR 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. - -**************************************************************************/ - -#define ATTR1FV( A, V ) ATTR( A, 1, (V)[0], 0, 0, 1 ) -#define ATTR2FV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 ) -#define ATTR3FV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 ) -#define ATTR4FV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] ) - -#define ATTR1F( A, X ) ATTR( A, 1, X, 0, 0, 1 ) -#define ATTR2F( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 ) -#define ATTR3F( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 ) -#define ATTR4F( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W ) - -#define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] ) - -static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR2F( VBO_ATTRIB_POS, x, y ); -} - -static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR2FV( VBO_ATTRIB_POS, v ); -} - -static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3F( VBO_ATTRIB_POS, x, y, z ); -} - -static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3FV( VBO_ATTRIB_POS, v ); -} - -static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4F( VBO_ATTRIB_POS, x, y, z, w ); -} - -static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4FV( VBO_ATTRIB_POS, v ); -} - -static void GLAPIENTRY TAG(TexCoord1f)( GLfloat x ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1F( VBO_ATTRIB_TEX0, x ); -} - -static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1FV( VBO_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY TAG(TexCoord2f)( GLfloat x, GLfloat y ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR2F( VBO_ATTRIB_TEX0, x, y ); -} - -static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR2FV( VBO_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY TAG(TexCoord3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3F( VBO_ATTRIB_TEX0, x, y, z ); -} - -static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3FV( VBO_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY TAG(TexCoord4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4F( VBO_ATTRIB_TEX0, x, y, z, w ); -} - -static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4FV( VBO_ATTRIB_TEX0, v ); -} - -static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3F( VBO_ATTRIB_NORMAL, x, y, z ); -} - -static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3FV( VBO_ATTRIB_NORMAL, v ); -} - -static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat x ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1F( VBO_ATTRIB_FOG, x ); -} - -static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1FV( VBO_ATTRIB_FOG, v ); -} - -static void GLAPIENTRY TAG(Color3f)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3F( VBO_ATTRIB_COLOR0, x, y, z ); -} - -static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3FV( VBO_ATTRIB_COLOR0, v ); -} - -static void GLAPIENTRY TAG(Color4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4F( VBO_ATTRIB_COLOR0, x, y, z, w ); -} - -static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR4FV( VBO_ATTRIB_COLOR0, v ); -} - -static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat x, GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3F( VBO_ATTRIB_COLOR1, x, y, z ); -} - -static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR3FV( VBO_ATTRIB_COLOR1, v ); -} - - -static void GLAPIENTRY TAG(EdgeFlag)( GLboolean b ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1F( VBO_ATTRIB_EDGEFLAG, (GLfloat)b ); -} - -static void GLAPIENTRY TAG(Indexf)( GLfloat f ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1F( VBO_ATTRIB_INDEX, f ); -} - -static void GLAPIENTRY TAG(Indexfv)( const GLfloat *f ) -{ - GET_CURRENT_CONTEXT( ctx ); - ATTR1FV( VBO_ATTRIB_INDEX, f ); -} - - -static void GLAPIENTRY TAG(MultiTexCoord1f)( GLenum target, GLfloat x ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR1F( attr, x ); -} - -static void GLAPIENTRY TAG(MultiTexCoord1fv)( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR1FV( attr, v ); -} - -static void GLAPIENTRY TAG(MultiTexCoord2f)( GLenum target, GLfloat x, GLfloat y ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR2F( attr, x, y ); -} - -static void GLAPIENTRY TAG(MultiTexCoord2fv)( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR2FV( attr, v ); -} - -static void GLAPIENTRY TAG(MultiTexCoord3f)( GLenum target, GLfloat x, GLfloat y, - GLfloat z) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR3F( attr, x, y, z ); -} - -static void GLAPIENTRY TAG(MultiTexCoord3fv)( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR3FV( attr, v ); -} - -static void GLAPIENTRY TAG(MultiTexCoord4f)( GLenum target, GLfloat x, GLfloat y, - GLfloat z, GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR4F( attr, x, y, z, w ); -} - -static void GLAPIENTRY TAG(MultiTexCoord4fv)( GLenum target, const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR4FV( attr, v ); -} - - -static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR1F(0, x); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR1F(VBO_ATTRIB_GENERIC0 + index, x); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR1FV(0, v); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x, - GLfloat y ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR2F(0, x, y); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR2FV(0, v); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x, - GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR3F(0, x, y, z); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR3FV(0, v); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x, - GLfloat y, GLfloat z, - GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR4F(0, x, y, z, w); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w); - else - ERROR(); -} - -static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index == 0) - ATTR4FV(0, v); - else if (index < MAX_VERTEX_ATTRIBS) - ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v); - else - ERROR(); -} - - -/* In addition to supporting NV_vertex_program, these entrypoints are - * used by the display list and other code specifically because of - * their property of aliasing with other attributes. (See - * vbo_save_loopback.c) - */ -static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR1F(index, x); -} - -static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR1FV(index, v); -} - -static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, - GLfloat y ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR2F(index, x, y); -} - -static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR2FV(index, v); -} - -static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, - GLfloat y, GLfloat z ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR3F(index, x, y, z); -} - -static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR3FV(index, v); -} - -static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, - GLfloat y, GLfloat z, - GLfloat w ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR4F(index, x, y, z, w); -} - -static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, - const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - if (index < VBO_ATTRIB_MAX) - ATTR4FV(index, v); -} - - -#define MAT( ATTR, N, face, params ) \ -do { \ - if (face != GL_BACK) \ - MAT_ATTR( ATTR, N, params ); /* front */ \ - if (face != GL_FRONT) \ - MAT_ATTR( ATTR + 1, N, params ); /* back */ \ -} while (0) - - -/* Colormaterial conflicts are dealt with later. - */ -static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, - const GLfloat *params ) -{ - GET_CURRENT_CONTEXT( ctx ); - switch (pname) { - case GL_EMISSION: - MAT( VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params ); - break; - case GL_AMBIENT: - MAT( VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); - break; - case GL_DIFFUSE: - MAT( VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); - break; - case GL_SPECULAR: - MAT( VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params ); - break; - case GL_SHININESS: - MAT( VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params ); - break; - case GL_COLOR_INDEXES: - MAT( VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params ); - break; - case GL_AMBIENT_AND_DIFFUSE: - MAT( VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); - MAT( VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); - break; - default: - ERROR(); - return; - } -} - - -#undef ATTR1FV -#undef ATTR2FV -#undef ATTR3FV -#undef ATTR4FV - -#undef ATTR1F -#undef ATTR2F -#undef ATTR3F -#undef ATTR4F - -#undef MAT -#undef MAT_ATTR diff --git a/src/libs/mesa/mesa/vbo/vbo_context.c b/src/libs/mesa/mesa/vbo/vbo_context.c deleted file mode 100644 index a73a46b9c8..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_context.c +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/imports.h" -#include "main/mtypes.h" -#include "main/api_arrayelt.h" -#include "vbo.h" -#include "vbo_context.h" - -/* Reach out and grab this to use as the default: - */ -extern void _tnl_draw_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prims, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index ); - - - -#define NR_LEGACY_ATTRIBS 16 -#define NR_GENERIC_ATTRIBS 16 -#define NR_MAT_ATTRIBS 12 - -static GLuint check_size( const GLfloat *attr ) -{ - if (attr[3] != 1.0) return 4; - if (attr[2] != 0.0) return 3; - if (attr[1] != 0.0) return 2; - return 1; -} - -static void init_legacy_currval(GLcontext *ctx) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct gl_client_array *arrays = vbo->legacy_currval; - GLuint i; - - memset(arrays, 0, sizeof(*arrays) * NR_LEGACY_ATTRIBS); - - /* Set up a constant (StrideB == 0) array for each current - * attribute: - */ - for (i = 0; i < NR_LEGACY_ATTRIBS; i++) { - struct gl_client_array *cl = &arrays[i]; - - /* Size will have to be determined at runtime: - */ - cl->Size = check_size(ctx->Current.Attrib[i]); - cl->Stride = 0; - cl->StrideB = 0; - cl->Enabled = 1; - cl->Type = GL_FLOAT; - cl->Ptr = (const void *)ctx->Current.Attrib[i]; - cl->BufferObj = ctx->Array.NullBufferObj; - } -} - - -static void init_generic_currval(GLcontext *ctx) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct gl_client_array *arrays = vbo->generic_currval; - GLuint i; - - memset(arrays, 0, sizeof(*arrays) * NR_GENERIC_ATTRIBS); - - for (i = 0; i < NR_GENERIC_ATTRIBS; i++) { - struct gl_client_array *cl = &arrays[i]; - - /* This will have to be determined at runtime: - */ - cl->Size = 1; - cl->Type = GL_FLOAT; - cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i]; - cl->Stride = 0; - cl->StrideB = 0; - cl->Enabled = 1; - cl->BufferObj = ctx->Array.NullBufferObj; - } -} - - -static void init_mat_currval(GLcontext *ctx) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct gl_client_array *arrays = vbo->mat_currval; - GLuint i; - - ASSERT(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX); - - memset(arrays, 0, sizeof(*arrays) * NR_MAT_ATTRIBS); - - /* Set up a constant (StrideB == 0) array for each current - * attribute: - */ - for (i = 0; i < NR_MAT_ATTRIBS; i++) { - struct gl_client_array *cl = &arrays[i]; - - /* Size is fixed for the material attributes, for others will - * be determined at runtime: - */ - switch (i - VERT_ATTRIB_GENERIC0) { - case MAT_ATTRIB_FRONT_SHININESS: - case MAT_ATTRIB_BACK_SHININESS: - cl->Size = 1; - break; - case MAT_ATTRIB_FRONT_INDEXES: - case MAT_ATTRIB_BACK_INDEXES: - cl->Size = 3; - break; - default: - cl->Size = 4; - break; - } - - cl->Ptr = (const void *)ctx->Light.Material.Attrib[i]; - cl->Type = GL_FLOAT; - cl->Stride = 0; - cl->StrideB = 0; - cl->Enabled = 1; - cl->BufferObj = ctx->Array.NullBufferObj; - } -} - -#if 0 - -static void vbo_exec_current_init( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - GLint i; - - /* setup the pointers for the typical 16 vertex attributes */ - for (i = 0; i < VBO_ATTRIB_FIRST_MATERIAL; i++) - exec->vtx.current[i] = ctx->Current.Attrib[i]; - - /* setup pointers for the 12 material attributes */ - for (i = 0; i < MAT_ATTRIB_MAX; i++) - exec->vtx.current[VBO_ATTRIB_FIRST_MATERIAL + i] = - ctx->Light.Material.Attrib[i]; -} -#endif - -GLboolean _vbo_CreateContext( GLcontext *ctx ) -{ - struct vbo_context *vbo = CALLOC_STRUCT(vbo_context); - - ctx->swtnl_im = (void *)vbo; - - /* Initialize the arrayelt helper - */ - if (!ctx->aelt_context && - !_ae_create_context( ctx )) { - return GL_FALSE; - } - - /* TODO: remove these pointers. - */ - vbo->legacy_currval = &vbo->currval[VBO_ATTRIB_POS]; - vbo->generic_currval = &vbo->currval[VBO_ATTRIB_GENERIC0]; - vbo->mat_currval = &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT]; - - init_legacy_currval( ctx ); - init_generic_currval( ctx ); - init_mat_currval( ctx ); - - /* Build mappings from VERT_ATTRIB -> VBO_ATTRIB depending on type - * of vertex program active. - */ - { - GLuint i; - - /* When no vertex program, pull in the material attributes in - * the 16..32 generic range. - */ - for (i = 0; i < 16; i++) - vbo->map_vp_none[i] = i; - for (i = 0; i < 12; i++) - vbo->map_vp_none[16+i] = VBO_ATTRIB_MAT_FRONT_AMBIENT + i; - for (i = 0; i < 4; i++) - vbo->map_vp_none[28+i] = i; - - for (i = 0; i < VERT_ATTRIB_MAX; i++) - vbo->map_vp_arb[i] = i; - } - - - /* By default: - */ - vbo->draw_prims = _tnl_draw_prims; - - /* Hook our functions into exec and compile dispatch tables. These - * will pretty much be permanently installed, which means that the - * vtxfmt mechanism can be removed now. - */ - vbo_exec_init( ctx ); -#if FEATURE_dlist - vbo_save_init( ctx ); -#endif - - return GL_TRUE; -} - -void _vbo_InvalidateState( GLcontext *ctx, GLuint new_state ) -{ - _ae_invalidate_state(ctx, new_state); - vbo_exec_invalidate_state(ctx, new_state); -} - - -void _vbo_DestroyContext( GLcontext *ctx ) -{ - if (ctx->aelt_context) { - _ae_destroy_context( ctx ); - ctx->aelt_context = NULL; - } - - vbo_exec_destroy(ctx); -#if FEATURE_dlist - vbo_save_destroy(ctx); -#endif - FREE(vbo_context(ctx)); - ctx->swtnl_im = NULL; -} diff --git a/src/libs/mesa/mesa/vbo/vbo_context.h b/src/libs/mesa/mesa/vbo/vbo_context.h deleted file mode 100644 index bf405eb693..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_context.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file vbo_context.h - * \brief VBO builder module datatypes and definitions. - * \author Keith Whitwell - */ - - -/** - * \mainpage The VBO builder module - * - * This module hooks into the GL dispatch table and catches all vertex - * building and drawing commands, such as glVertex3f, glBegin and - * glDrawArrays. The module stores all incoming vertex data as arrays - * in GL vertex buffer objects (VBOs), and translates all drawing - * commands into calls to a driver supplied DrawPrimitives() callback. - * - * The module captures both immediate mode and display list drawing, - * and manages the allocation, reference counting and deallocation of - * vertex buffer objects itself. - * - * The DrawPrimitives() callback can be either implemented by the - * driver itself or hooked to the tnl module's _tnl_draw_primitives() - * function for hardware without tnl capablilties or during fallbacks. - */ - - -#ifndef _VBO_CONTEXT_H -#define _VBO_CONTEXT_H - -#include "vbo.h" -#include "vbo_attrib.h" -#include "vbo_exec.h" -#if FEATURE_dlist -#include "vbo_save.h" -#endif - - -struct vbo_context { - struct gl_client_array currval[VBO_ATTRIB_MAX]; - - /* These point into the above. TODO: remove. - */ - struct gl_client_array *legacy_currval; - struct gl_client_array *generic_currval; - struct gl_client_array *mat_currval; - - GLuint map_vp_none[32]; - GLuint map_vp_arb[32]; - - GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->Current, ctx->Light.Material */ - GLfloat CurrentFloatEdgeFlag; - - - struct vbo_exec_context exec; -#if FEATURE_dlist - struct vbo_save_context save; -#endif - - /* Callback into the driver. This must always succeed, the driver - * is responsible for initiating any fallback actions required: - */ - vbo_draw_func draw_prims; -}; - - -static INLINE struct vbo_context *vbo_context(GLcontext *ctx) -{ - return (struct vbo_context *)(ctx->swtnl_im); -} - -enum { - VP_NONE = 1, - VP_NV, - VP_ARB -}; - -static INLINE GLuint get_program_mode( GLcontext *ctx ) -{ - if (!ctx->VertexProgram._Current) - return VP_NONE; - else if (ctx->VertexProgram._Current->IsNVProgram) - return VP_NV; - else - return VP_ARB; -} - - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_exec.c b/src/libs/mesa/mesa/vbo/vbo_exec.c deleted file mode 100644 index 635f239acc..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/api_arrayelt.h" -#include "main/glheader.h" -#include "main/imports.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/vtxfmt.h" - -#include "vbo_context.h" - -void vbo_exec_init( GLcontext *ctx ) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - exec->ctx = ctx; - - /* Initialize the arrayelt helper - */ - if (!ctx->aelt_context && - !_ae_create_context( ctx )) - return; - - vbo_exec_vtx_init( exec ); - vbo_exec_array_init( exec ); - - /* Hook our functions into exec and compile dispatch tables. - */ - _mesa_install_exec_vtxfmt( ctx, &exec->vtxfmt ); - - ctx->Driver.NeedFlush = 0; - ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; - ctx->Driver.FlushVertices = vbo_exec_FlushVertices; - - vbo_exec_invalidate_state( ctx, ~0 ); -} - - -void vbo_exec_destroy( GLcontext *ctx ) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - if (ctx->aelt_context) { - _ae_destroy_context( ctx ); - ctx->aelt_context = NULL; - } - - vbo_exec_vtx_destroy( exec ); - vbo_exec_array_destroy( exec ); -} - -/* Really want to install these callbacks to a central facility to be - * invoked according to the state flags. That will have to wait for a - * mesa rework: - */ -void vbo_exec_invalidate_state( GLcontext *ctx, GLuint new_state ) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - if (new_state & (_NEW_PROGRAM|_NEW_EVAL)) - exec->eval.recalculate_maps = 1; - - _ae_invalidate_state(ctx, new_state); -} - - - - - diff --git a/src/libs/mesa/mesa/vbo/vbo_exec.h b/src/libs/mesa/mesa/vbo/vbo_exec.h deleted file mode 100644 index ddbcbe1181..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec.h +++ /dev/null @@ -1,168 +0,0 @@ -/************************************************************************** - -Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - * - */ - -#ifndef __VBO_EXEC_H__ -#define __VBO_EXEC_H__ - -#include "main/mtypes.h" -#include "vbo.h" -#include "vbo_attrib.h" - - -#define VBO_MAX_PRIM 64 - -/* Wierd implementation stuff: - */ -#define VBO_VERT_BUFFER_SIZE (1024*16) /* dwords == 64k */ -#define VBO_MAX_ATTR_CODEGEN 16 -#define ERROR_ATTRIB 16 - - - - -struct vbo_exec_eval1_map { - struct gl_1d_map *map; - GLuint sz; -}; - -struct vbo_exec_eval2_map { - struct gl_2d_map *map; - GLuint sz; -}; - - - -struct vbo_exec_copied_vtx { - GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS]; - GLuint nr; -}; - - -typedef void (*vbo_attrfv_func)( const GLfloat * ); - - -struct vbo_exec_context -{ - GLcontext *ctx; - GLvertexformat vtxfmt; - - struct { - struct gl_buffer_object *bufferobj; - GLubyte *buffer_map; - - GLuint vertex_size; - - struct _mesa_prim prim[VBO_MAX_PRIM]; - GLuint prim_count; - - GLfloat *vbptr; /* cursor, points into buffer */ - GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current vertex */ - - GLuint vert_count; - GLuint max_vert; - struct vbo_exec_copied_vtx copied; - - GLubyte attrsz[VBO_ATTRIB_MAX]; - GLubyte active_sz[VBO_ATTRIB_MAX]; - - GLfloat *attrptr[VBO_ATTRIB_MAX]; - struct gl_client_array arrays[VBO_ATTRIB_MAX]; - - /* According to program mode, the values above plus current - * values are squashed down to the 32 attributes passed to the - * vertex program below: - */ - GLuint program_mode; - GLuint enabled_flags; - const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; - } vtx; - - - struct { - GLboolean recalculate_maps; - struct vbo_exec_eval1_map map1[VERT_ATTRIB_MAX]; - struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX]; - } eval; - - struct { - GLuint program_mode; - GLuint enabled_flags; - GLuint array_obj; - - /* These just mirror the current arrayobj (todo: make arrayobj - * look like this and remove the mirror): - */ - const struct gl_client_array *legacy_array[16]; - const struct gl_client_array *generic_array[16]; - - /* Arrays and current values manipulated according to program - * mode, etc. These are the attributes as seen by vertex - * programs: - */ - const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; - } array; -}; - - - -/* External API: - */ -void vbo_exec_init( GLcontext *ctx ); -void vbo_exec_destroy( GLcontext *ctx ); -void vbo_exec_invalidate_state( GLcontext *ctx, GLuint new_state ); -void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ); - - -/* Internal functions: - */ -void vbo_exec_array_init( struct vbo_exec_context *exec ); -void vbo_exec_array_destroy( struct vbo_exec_context *exec ); - - -void vbo_exec_vtx_init( struct vbo_exec_context *exec ); -void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ); -void vbo_exec_vtx_flush( struct vbo_exec_context *exec ); -void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ); - -void vbo_exec_eval_update( struct vbo_exec_context *exec ); - -void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, - GLfloat u, GLfloat v ); - -void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec, - GLfloat u); - -extern GLboolean -vbo_validate_shaders(GLcontext *ctx); - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_exec_api.c b/src/libs/mesa/mesa/vbo/vbo_exec_api.c deleted file mode 100644 index f6daa253fd..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec_api.c +++ /dev/null @@ -1,777 +0,0 @@ -/************************************************************************** - -Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/vtxfmt.h" -#if FEATURE_dlist -#include "main/dlist.h" -#endif -#include "main/state.h" -#include "main/light.h" -#include "main/api_arrayelt.h" -#include "main/api_noop.h" -#include "glapi/dispatch.h" - -#include "vbo_context.h" - -#ifdef ERROR -#undef ERROR -#endif - - -static void reset_attrfv( struct vbo_exec_context *exec ); - - -/* Close off the last primitive, execute the buffer, restart the - * primitive. - */ -static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) -{ - if (exec->vtx.prim_count == 0) { - exec->vtx.copied.nr = 0; - exec->vtx.vert_count = 0; - exec->vtx.vbptr = (GLfloat *)exec->vtx.buffer_map; - } - else { - GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin; - GLuint last_count; - - if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { - GLint i = exec->vtx.prim_count - 1; - assert(i >= 0); - exec->vtx.prim[i].count = (exec->vtx.vert_count - - exec->vtx.prim[i].start); - } - - last_count = exec->vtx.prim[exec->vtx.prim_count-1].count; - - /* Execute the buffer and save copied vertices. - */ - if (exec->vtx.vert_count) - vbo_exec_vtx_flush( exec ); - else { - exec->vtx.prim_count = 0; - exec->vtx.copied.nr = 0; - } - - /* Emit a glBegin to start the new list. - */ - assert(exec->vtx.prim_count == 0); - - if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { - exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive; - exec->vtx.prim[0].start = 0; - exec->vtx.prim[0].count = 0; - exec->vtx.prim_count++; - - if (exec->vtx.copied.nr == last_count) - exec->vtx.prim[0].begin = last_begin; - } - } -} - - -/* Deal with buffer wrapping where provoked by the vertex buffer - * filling up, as opposed to upgrade_vertex(). - */ -void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) -{ - GLfloat *data = exec->vtx.copied.buffer; - GLuint i; - - /* Run pipeline on current vertices, copy wrapped vertices - * to exec->vtx.copied. - */ - vbo_exec_wrap_buffers( exec ); - - /* Copy stored stored vertices to start of new list. - */ - assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr); - - for (i = 0 ; i < exec->vtx.copied.nr ; i++) { - _mesa_memcpy( exec->vtx.vbptr, data, - exec->vtx.vertex_size * sizeof(GLfloat)); - exec->vtx.vbptr += exec->vtx.vertex_size; - data += exec->vtx.vertex_size; - exec->vtx.vert_count++; - } - - exec->vtx.copied.nr = 0; -} - - -/* - * Copy the active vertex's values to the ctx->Current fields. - */ -static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - struct vbo_context *vbo = vbo_context(ctx); - GLuint i; - - for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { - if (exec->vtx.attrsz[i]) { - GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; - - /* Note: the exec->vtx.current[i] pointers point into the - * ctx->Current.Attrib and ctx->Light.Material.Attrib arrays. - */ - if (exec->vtx.attrptr[i]) { - - COPY_CLEAN_4V(current, - exec->vtx.attrsz[i], - exec->vtx.attrptr[i]); - - } - - /* Given that we explicitly state size here, there is no need - * for the COPY_CLEAN above, could just copy 16 bytes and be - * done. The only problem is when Mesa accesses ctx->Current - * directly. - */ - vbo->currval[i].Size = exec->vtx.attrsz[i]; - - /* This triggers rather too much recalculation of Mesa state - * that doesn't get used (eg light positions). - */ - if (i >= VBO_ATTRIB_MAT_FRONT_AMBIENT && - i <= VBO_ATTRIB_MAT_BACK_INDEXES) - ctx->NewState |= _NEW_LIGHT; - } - } - - /* Colormaterial -- this kindof sucks. - */ - if (ctx->Light.ColorMaterialEnabled && - exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) { - _mesa_update_color_material(ctx, - ctx->Current.Attrib[VBO_ATTRIB_COLOR0]); - } - - ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; -} - - -static void vbo_exec_copy_from_current( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - struct vbo_context *vbo = vbo_context(ctx); - GLint i; - - for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { - const GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; - switch (exec->vtx.attrsz[i]) { - case 4: exec->vtx.attrptr[i][3] = current[3]; - case 3: exec->vtx.attrptr[i][2] = current[2]; - case 2: exec->vtx.attrptr[i][1] = current[1]; - case 1: exec->vtx.attrptr[i][0] = current[0]; - break; - } - } - - ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; -} - - -/* Flush existing data, set new attrib size, replay copied vertices. - */ -static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, - GLuint attr, - GLuint newsz ) -{ - GLcontext *ctx = exec->ctx; - struct vbo_context *vbo = vbo_context(ctx); - GLint lastcount = exec->vtx.vert_count; - GLfloat *tmp; - GLuint oldsz; - GLuint i; - - /* Run pipeline on current vertices, copy wrapped vertices - * to exec->vtx.copied. - */ - vbo_exec_wrap_buffers( exec ); - - - /* Do a COPY_TO_CURRENT to ensure back-copying works for the case - * when the attribute already exists in the vertex and is having - * its size increased. - */ - vbo_exec_copy_to_current( exec ); - - - /* Heuristic: Attempt to isolate attributes received outside - * begin/end so that they don't bloat the vertices. - */ - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END && - exec->vtx.attrsz[attr] == 0 && - lastcount > 8 && - exec->vtx.vertex_size) { - reset_attrfv( exec ); - } - - /* Fix up sizes: - */ - oldsz = exec->vtx.attrsz[attr]; - exec->vtx.attrsz[attr] = newsz; - - exec->vtx.vertex_size += newsz - oldsz; - exec->vtx.max_vert = VBO_VERT_BUFFER_SIZE / exec->vtx.vertex_size; - exec->vtx.vert_count = 0; - exec->vtx.vbptr = (GLfloat *)exec->vtx.buffer_map; - - - /* Recalculate all the attrptr[] values - */ - for (i = 0, tmp = exec->vtx.vertex ; i < VBO_ATTRIB_MAX ; i++) { - if (exec->vtx.attrsz[i]) { - exec->vtx.attrptr[i] = tmp; - tmp += exec->vtx.attrsz[i]; - } - else - exec->vtx.attrptr[i] = NULL; /* will not be dereferenced */ - } - - /* Copy from current to repopulate the vertex with correct values. - */ - vbo_exec_copy_from_current( exec ); - - /* Replay stored vertices to translate them - * to new format here. - * - * -- No need to replay - just copy piecewise - */ - if (exec->vtx.copied.nr) - { - GLfloat *data = exec->vtx.copied.buffer; - GLfloat *dest = exec->vtx.vbptr; - GLuint j; - - assert(exec->vtx.vbptr == (GLfloat *)exec->vtx.buffer_map); - - for (i = 0 ; i < exec->vtx.copied.nr ; i++) { - for (j = 0 ; j < VBO_ATTRIB_MAX ; j++) { - if (exec->vtx.attrsz[j]) { - if (j == attr) { - if (oldsz) { - COPY_CLEAN_4V( dest, oldsz, data ); - data += oldsz; - dest += newsz; - } else { - const GLfloat *current = (const GLfloat *)vbo->currval[j].Ptr; - COPY_SZ_4V( dest, newsz, current ); - dest += newsz; - } - } - else { - GLuint sz = exec->vtx.attrsz[j]; - COPY_SZ_4V( dest, sz, data ); - dest += sz; - data += sz; - } - } - } - } - - exec->vtx.vbptr = dest; - exec->vtx.vert_count += exec->vtx.copied.nr; - exec->vtx.copied.nr = 0; - } -} - - -static void vbo_exec_fixup_vertex( GLcontext *ctx, - GLuint attr, GLuint sz ) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - int i; - - if (sz > exec->vtx.attrsz[attr]) { - /* New size is larger. Need to flush existing vertices and get - * an enlarged vertex format. - */ - vbo_exec_wrap_upgrade_vertex( exec, attr, sz ); - } - else if (sz < exec->vtx.active_sz[attr]) { - static const GLfloat id[4] = { 0, 0, 0, 1 }; - - /* New size is smaller - just need to fill in some - * zeros. Don't need to flush or wrap. - */ - for (i = sz ; i <= exec->vtx.attrsz[attr] ; i++) - exec->vtx.attrptr[attr][i-1] = id[i-1]; - } - - exec->vtx.active_sz[attr] = sz; - - /* Does setting NeedFlush belong here? Necessitates resetting - * vtxfmt on each flush (otherwise flags won't get reset - * afterwards). - */ - if (attr == 0) - exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; - else - exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; -} - - - - -/* - */ -#define ATTR( A, N, V0, V1, V2, V3 ) \ -do { \ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ - \ - if (exec->vtx.active_sz[A] != N) \ - vbo_exec_fixup_vertex(ctx, A, N); \ - \ - { \ - GLfloat *dest = exec->vtx.attrptr[A]; \ - if (N>0) dest[0] = V0; \ - if (N>1) dest[1] = V1; \ - if (N>2) dest[2] = V2; \ - if (N>3) dest[3] = V3; \ - } \ - \ - if ((A) == 0) { \ - GLuint i; \ - \ - for (i = 0; i < exec->vtx.vertex_size; i++) \ - exec->vtx.vbptr[i] = exec->vtx.vertex[i]; \ - \ - exec->vtx.vbptr += exec->vtx.vertex_size; \ - exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; \ - \ - if (++exec->vtx.vert_count >= exec->vtx.max_vert) \ - vbo_exec_vtx_wrap( exec ); \ - } \ -} while (0) - - -#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) -#define TAG(x) vbo_##x - -#include "vbo_attrib_tmp.h" - - - - - -/* Eval - */ -static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) -{ - GET_CURRENT_CONTEXT( ctx ); - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - { - GLint i; - if (exec->eval.recalculate_maps) - vbo_exec_eval_update( exec ); - - for (i = 0; i <= VBO_ATTRIB_TEX7; i++) { - if (exec->eval.map1[i].map) - if (exec->vtx.active_sz[i] != exec->eval.map1[i].sz) - vbo_exec_fixup_vertex( ctx, i, exec->eval.map1[i].sz ); - } - } - - - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); - - vbo_exec_do_EvalCoord1f( exec, u ); - - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); -} - -static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) -{ - GET_CURRENT_CONTEXT( ctx ); - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - { - GLint i; - if (exec->eval.recalculate_maps) - vbo_exec_eval_update( exec ); - - for (i = 0; i <= VBO_ATTRIB_TEX7; i++) { - if (exec->eval.map2[i].map) - if (exec->vtx.active_sz[i] != exec->eval.map2[i].sz) - vbo_exec_fixup_vertex( ctx, i, exec->eval.map2[i].sz ); - } - - if (ctx->Eval.AutoNormal) - if (exec->vtx.active_sz[VBO_ATTRIB_NORMAL] != 3) - vbo_exec_fixup_vertex( ctx, VBO_ATTRIB_NORMAL, 3 ); - } - - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); - - vbo_exec_do_EvalCoord2f( exec, u, v ); - - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); -} - -static void GLAPIENTRY vbo_exec_EvalCoord1fv( const GLfloat *u ) -{ - vbo_exec_EvalCoord1f( u[0] ); -} - -static void GLAPIENTRY vbo_exec_EvalCoord2fv( const GLfloat *u ) -{ - vbo_exec_EvalCoord2f( u[0], u[1] ); -} - -static void GLAPIENTRY vbo_exec_EvalPoint1( GLint i ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLfloat du = ((ctx->Eval.MapGrid1u2 - ctx->Eval.MapGrid1u1) / - (GLfloat) ctx->Eval.MapGrid1un); - GLfloat u = i * du + ctx->Eval.MapGrid1u1; - - vbo_exec_EvalCoord1f( u ); -} - - -static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) -{ - GET_CURRENT_CONTEXT( ctx ); - GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) / - (GLfloat) ctx->Eval.MapGrid2un); - GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) / - (GLfloat) ctx->Eval.MapGrid2vn); - GLfloat u = i * du + ctx->Eval.MapGrid2u1; - GLfloat v = j * dv + ctx->Eval.MapGrid2v1; - - vbo_exec_EvalCoord2f( u, v ); -} - - -/** - * Check if programs/shaders are enabled and valid at glBegin time. - */ -GLboolean -vbo_validate_shaders(GLcontext *ctx) -{ - if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || - (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { - return GL_FALSE; - } - if (ctx->Shader.CurrentProgram && !ctx->Shader.CurrentProgram->LinkStatus) { - return GL_FALSE; - } - return GL_TRUE; -} - - -/* Build a list of primitives on the fly. Keep - * ctx->Driver.CurrentExecPrimitive uptodate as well. - */ -static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) -{ - GET_CURRENT_CONTEXT( ctx ); - - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - int i; - - if (ctx->NewState) { - _mesa_update_state( ctx ); - - CALL_Begin(ctx->Exec, (mode)); - return; - } - - if (!vbo_validate_shaders(ctx)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBegin (invalid vertex/fragment program)"); - return; - } - - /* Heuristic: attempt to isolate attributes occuring outside - * begin/end pairs. - */ - if (exec->vtx.vertex_size && !exec->vtx.attrsz[0]) - vbo_exec_FlushVertices( ctx, ~0 ); - - i = exec->vtx.prim_count++; - exec->vtx.prim[i].mode = mode; - exec->vtx.prim[i].begin = 1; - exec->vtx.prim[i].end = 0; - exec->vtx.prim[i].indexed = 0; - exec->vtx.prim[i].weak = 0; - exec->vtx.prim[i].pad = 0; - exec->vtx.prim[i].start = exec->vtx.vert_count; - exec->vtx.prim[i].count = 0; - - ctx->Driver.CurrentExecPrimitive = mode; - } - else - _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" ); - -} - -static void GLAPIENTRY vbo_exec_End( void ) -{ - GET_CURRENT_CONTEXT( ctx ); - - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - int idx = exec->vtx.vert_count; - int i = exec->vtx.prim_count - 1; - - exec->vtx.prim[i].end = 1; - exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; - - ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; - - if (exec->vtx.prim_count == VBO_MAX_PRIM) - vbo_exec_vtx_flush( exec ); - } - else - _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" ); -} - - -static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) -{ - GLvertexformat *vfmt = &exec->vtxfmt; - - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Begin = vbo_exec_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif - vfmt->End = vbo_exec_End; - vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; - vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; - vfmt->EvalCoord2f = vbo_exec_EvalCoord2f; - vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv; - vfmt->EvalPoint1 = vbo_exec_EvalPoint1; - vfmt->EvalPoint2 = vbo_exec_EvalPoint2; - - vfmt->Rectf = _mesa_noop_Rectf; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; - - - /* from attrib_tmp.h: - */ - vfmt->Color3f = vbo_Color3f; - vfmt->Color3fv = vbo_Color3fv; - vfmt->Color4f = vbo_Color4f; - vfmt->Color4fv = vbo_Color4fv; - vfmt->FogCoordfEXT = vbo_FogCoordfEXT; - vfmt->FogCoordfvEXT = vbo_FogCoordfvEXT; - vfmt->MultiTexCoord1fARB = vbo_MultiTexCoord1f; - vfmt->MultiTexCoord1fvARB = vbo_MultiTexCoord1fv; - vfmt->MultiTexCoord2fARB = vbo_MultiTexCoord2f; - vfmt->MultiTexCoord2fvARB = vbo_MultiTexCoord2fv; - vfmt->MultiTexCoord3fARB = vbo_MultiTexCoord3f; - vfmt->MultiTexCoord3fvARB = vbo_MultiTexCoord3fv; - vfmt->MultiTexCoord4fARB = vbo_MultiTexCoord4f; - vfmt->MultiTexCoord4fvARB = vbo_MultiTexCoord4fv; - vfmt->Normal3f = vbo_Normal3f; - vfmt->Normal3fv = vbo_Normal3fv; - vfmt->SecondaryColor3fEXT = vbo_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = vbo_SecondaryColor3fvEXT; - vfmt->TexCoord1f = vbo_TexCoord1f; - vfmt->TexCoord1fv = vbo_TexCoord1fv; - vfmt->TexCoord2f = vbo_TexCoord2f; - vfmt->TexCoord2fv = vbo_TexCoord2fv; - vfmt->TexCoord3f = vbo_TexCoord3f; - vfmt->TexCoord3fv = vbo_TexCoord3fv; - vfmt->TexCoord4f = vbo_TexCoord4f; - vfmt->TexCoord4fv = vbo_TexCoord4fv; - vfmt->Vertex2f = vbo_Vertex2f; - vfmt->Vertex2fv = vbo_Vertex2fv; - vfmt->Vertex3f = vbo_Vertex3f; - vfmt->Vertex3fv = vbo_Vertex3fv; - vfmt->Vertex4f = vbo_Vertex4f; - vfmt->Vertex4fv = vbo_Vertex4fv; - - vfmt->VertexAttrib1fARB = vbo_VertexAttrib1fARB; - vfmt->VertexAttrib1fvARB = vbo_VertexAttrib1fvARB; - vfmt->VertexAttrib2fARB = vbo_VertexAttrib2fARB; - vfmt->VertexAttrib2fvARB = vbo_VertexAttrib2fvARB; - vfmt->VertexAttrib3fARB = vbo_VertexAttrib3fARB; - vfmt->VertexAttrib3fvARB = vbo_VertexAttrib3fvARB; - vfmt->VertexAttrib4fARB = vbo_VertexAttrib4fARB; - vfmt->VertexAttrib4fvARB = vbo_VertexAttrib4fvARB; - - vfmt->VertexAttrib1fNV = vbo_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = vbo_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = vbo_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = vbo_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = vbo_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = vbo_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = vbo_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = vbo_VertexAttrib4fvNV; - - vfmt->Materialfv = vbo_Materialfv; - - vfmt->EdgeFlag = vbo_EdgeFlag; - vfmt->Indexf = vbo_Indexf; - vfmt->Indexfv = vbo_Indexfv; - -} - - -/** - * Tell the VBO module to use a real OpenGL vertex buffer object to - * store accumulated immediate-mode vertex data. - * This replaces the malloced buffer which was created in - * vb_exec_vtx_init() below. - */ -void vbo_use_buffer_objects(GLcontext *ctx) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - /* Any buffer name but 0 can be used here since this bufferobj won't - * go into the bufferobj hashtable. - */ - GLuint bufName = 0xaabbccdd; - GLenum target = GL_ARRAY_BUFFER_ARB; - GLenum access = GL_READ_WRITE_ARB; - GLenum usage = GL_STREAM_DRAW_ARB; - GLsizei size = VBO_VERT_BUFFER_SIZE * sizeof(GLfloat); - - /* Make sure this func is only used once */ - assert(exec->vtx.bufferobj == ctx->Array.NullBufferObj); - if (exec->vtx.buffer_map) { - _mesa_align_free(exec->vtx.buffer_map); - } - - /* Allocate a real buffer object now */ - exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target); - ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); - - /* and map it */ - exec->vtx.buffer_map - = ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); -} - - - -void vbo_exec_vtx_init( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - struct vbo_context *vbo = vbo_context(ctx); - GLuint i; - - /* Allocate a buffer object. Will just reuse this object - * continuously. - */ - _mesa_reference_buffer_object(ctx, - &exec->vtx.bufferobj, - ctx->Array.NullBufferObj); - - ASSERT(!exec->vtx.buffer_map); - exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64); - vbo_exec_vtxfmt_init( exec ); - - /* Hook our functions into the dispatch table. - */ - _mesa_install_exec_vtxfmt( exec->ctx, &exec->vtxfmt ); - - for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { - exec->vtx.attrsz[i] = 0; - exec->vtx.active_sz[i] = 0; - exec->vtx.inputs[i] = &exec->vtx.arrays[i]; - } - - { - struct gl_client_array *arrays = exec->vtx.arrays; - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0])); - } - - exec->vtx.vertex_size = 0; -} - - -void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) -{ - if (exec->vtx.bufferobj->Name) { - /* using a real VBO for vertex data */ - GLcontext *ctx = exec->ctx; - _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL); - } - else { - /* just using malloc'd space for vertex data */ - if (exec->vtx.buffer_map) { - ALIGN_FREE(exec->vtx.buffer_map); - exec->vtx.buffer_map = NULL; - } - } -} - - -void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) - return; - - if (exec->vtx.vert_count) { - vbo_exec_vtx_flush( exec ); - } - - if (exec->vtx.vertex_size) { - vbo_exec_copy_to_current( exec ); - reset_attrfv( exec ); - } - - exec->ctx->Driver.NeedFlush = 0; -} - - -static void reset_attrfv( struct vbo_exec_context *exec ) -{ - GLuint i; - - for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { - exec->vtx.attrsz[i] = 0; - exec->vtx.active_sz[i] = 0; - } - - exec->vtx.vertex_size = 0; -} - diff --git a/src/libs/mesa/mesa/vbo/vbo_exec_array.c b/src/libs/mesa/mesa/vbo/vbo_exec_array.c deleted file mode 100644 index 660f9695a5..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec_array.c +++ /dev/null @@ -1,408 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/state.h" -#include "main/api_validate.h" -#include "main/api_noop.h" - -#include "vbo_context.h" - -/* Compute min and max elements for drawelements calls. - */ -static void get_minmax_index( GLuint count, GLuint type, - const GLvoid *indices, - GLuint *min_index, - GLuint *max_index) -{ - GLuint i; - - switch(type) { - case GL_UNSIGNED_INT: { - const GLuint *ui_indices = (const GLuint *)indices; - GLuint max_ui = ui_indices[count-1]; - GLuint min_ui = ui_indices[0]; - for (i = 0; i < count; i++) { - if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; - if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; - } - *min_index = min_ui; - *max_index = max_ui; - break; - } - case GL_UNSIGNED_SHORT: { - const GLushort *us_indices = (const GLushort *)indices; - GLuint max_us = us_indices[count-1]; - GLuint min_us = us_indices[0]; - for (i = 0; i < count; i++) { - if (us_indices[i] > max_us) max_us = us_indices[i]; - if (us_indices[i] < min_us) min_us = us_indices[i]; - } - *min_index = min_us; - *max_index = max_us; - break; - } - case GL_UNSIGNED_BYTE: { - const GLubyte *ub_indices = (const GLubyte *)indices; - GLuint max_ub = ub_indices[count-1]; - GLuint min_ub = ub_indices[0]; - for (i = 0; i < count; i++) { - if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; - if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; - } - *min_index = min_ub; - *max_index = max_ub; - break; - } - default: - assert(0); - break; - } -} - - -/* Just translate the arrayobj into a sane layout. - */ -static void bind_array_obj( GLcontext *ctx ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - GLuint i; - - /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array - * rather than as individual named arrays. Then this function can - * go away. - */ - exec->array.legacy_array[VERT_ATTRIB_POS] = &ctx->Array.ArrayObj->Vertex; - exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &vbo->legacy_currval[VERT_ATTRIB_WEIGHT]; - exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &ctx->Array.ArrayObj->Normal; - exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &ctx->Array.ArrayObj->Color; - exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &ctx->Array.ArrayObj->SecondaryColor; - exec->array.legacy_array[VERT_ATTRIB_FOG] = &ctx->Array.ArrayObj->FogCoord; - exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &ctx->Array.ArrayObj->Index; - if (ctx->Array.ArrayObj->PointSize.Enabled) { - /* this aliases COLOR_INDEX */ - exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &ctx->Array.ArrayObj->PointSize; - } - exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &ctx->Array.ArrayObj->EdgeFlag; - - for (i = 0; i < 8; i++) - exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &ctx->Array.ArrayObj->TexCoord[i]; - - for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) { - assert(i < Elements(ctx->Array.ArrayObj->VertexAttrib)); - assert(i < Elements(exec->array.generic_array)); - exec->array.generic_array[i] = &ctx->Array.ArrayObj->VertexAttrib[i]; - } - - exec->array.array_obj = ctx->Array.ArrayObj->Name; -} - -static void recalculate_input_bindings( GLcontext *ctx ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - const struct gl_client_array **inputs = &exec->array.inputs[0]; - GLuint i; - - exec->array.program_mode = get_program_mode(ctx); - exec->array.enabled_flags = ctx->Array.ArrayObj->_Enabled; - - switch (exec->array.program_mode) { - case VP_NONE: - /* When no vertex program is active, we put the material values - * into the generic slots. This is the only situation where - * material values are available as per-vertex attributes. - */ - for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else - inputs[i] = &vbo->legacy_currval[i]; - } - - for (i = 0; i < MAT_ATTRIB_MAX; i++) { - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->mat_currval[i]; - } - - /* Could use just about anything, just to fill in the empty - * slots: - */ - for (i = MAT_ATTRIB_MAX; i < VERT_ATTRIB_MAX - VERT_ATTRIB_GENERIC0; i++) - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; - - break; - case VP_NV: - /* NV_vertex_program - attribute arrays alias and override - * conventional, legacy arrays. No materials, and the generic - * slots are vacant. - */ - for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.generic_array[i]->Enabled) - inputs[i] = exec->array.generic_array[i]; - else if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else - inputs[i] = &vbo->legacy_currval[i]; - } - - /* Could use just about anything, just to fill in the empty - * slots: - */ - for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) - inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0]; - - break; - case VP_ARB: - /* ARB_vertex_program - Only the attribute zero (position) array - * aliases and overrides the legacy position array. - * - * Otherwise, legacy attributes available in the legacy slots, - * generic attributes in the generic slots and materials are not - * available as per-vertex attributes. - */ - if (exec->array.generic_array[0]->Enabled) - inputs[0] = exec->array.generic_array[0]; - else if (exec->array.legacy_array[0]->Enabled) - inputs[0] = exec->array.legacy_array[0]; - else - inputs[0] = &vbo->legacy_currval[0]; - - - for (i = 1; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else - inputs[i] = &vbo->legacy_currval[i]; - } - - for (i = 0; i < 16; i++) { - if (exec->array.generic_array[i]->Enabled) - inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i]; - else - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; - } - break; - } -} - -static void bind_arrays( GLcontext *ctx ) -{ -#if 0 - if (ctx->Array.ArrayObj.Name != exec->array.array_obj) { - bind_array_obj(ctx); - recalculate_input_bindings(ctx); - } - else if (exec->array.program_mode != get_program_mode(ctx) || - exec->array.enabled_flags != ctx->Array.ArrayObj->_Enabled) { - - recalculate_input_bindings(ctx); - } -#else - bind_array_obj(ctx); - recalculate_input_bindings(ctx); -#endif -} - - - -/*********************************************************************** - * API functions. - */ - -static void GLAPIENTRY -vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct _mesa_prim prim[1]; - - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) - return; - - FLUSH_CURRENT( ctx, 0 ); - - if (ctx->NewState) - _mesa_update_state( ctx ); - - if (!vbo_validate_shaders(ctx)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawArrays(bad shader)"); - return; - } - - bind_arrays( ctx ); - - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].mode = mode; - prim[0].start = start; - prim[0].count = count; - prim[0].indexed = 0; - - vbo->draw_prims( ctx, exec->array.inputs, prim, 1, NULL, start, start + count - 1 ); -} - - - -static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct _mesa_index_buffer ib; - struct _mesa_prim prim[1]; - - if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, type, indices )) - return; - - FLUSH_CURRENT( ctx, 0 ); - - if (ctx->NewState) - _mesa_update_state( ctx ); - - if (!vbo_validate_shaders(ctx)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements(bad shader)"); - return; - } - - bind_arrays( ctx ); - - ib.count = count; - ib.type = type; - ib.obj = ctx->Array.ElementArrayBufferObj; - ib.ptr = indices; - - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].mode = mode; - prim[0].start = 0; - prim[0].count = count; - prim[0].indexed = 1; - - /* Need to give special consideration to rendering a range of - * indices starting somewhere above zero. Typically the - * application is issuing multiple DrawRangeElements() to draw - * successive primitives layed out linearly in the vertex arrays. - * Unless the vertex arrays are all in a VBO (or locked as with - * CVA), the OpenGL semantics imply that we need to re-read or - * re-upload the vertex data on each draw call. - * - * In the case of hardware tnl, we want to avoid starting the - * upload at zero, as it will mean every draw call uploads an - * increasing amount of not-used vertex data. Worse - in the - * software tnl module, all those vertices might be transformed and - * lit but never rendered. - * - * If we just upload or transform the vertices in start..end, - * however, the indices will be incorrect. - * - * At this level, we don't know exactly what the requirements of - * the backend are going to be, though it will likely boil down to - * either: - * - * 1) Do nothing, everything is in a VBO and is processed once - * only. - * - * 2) Adjust the indices and vertex arrays so that start becomes - * zero. - * - * Rather than doing anything here, I'll provide a helper function - * for the latter case elsewhere. - */ - - vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib, start, end ); -} - -static void GLAPIENTRY -vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint min_index = 0; - GLuint max_index = 0; - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) - return; - - if (!vbo_validate_shaders(ctx)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawElements(bad shader)"); - return; - } - - if (ctx->Array.ElementArrayBufferObj->Name) { - const GLvoid *map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ctx->Array.ElementArrayBufferObj); - - get_minmax_index(count, type, ADD_POINTERS(map, indices), &min_index, &max_index); - - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ctx->Array.ElementArrayBufferObj); - } - else { - get_minmax_index(count, type, indices, &min_index, &max_index); - } - - vbo_exec_DrawRangeElements(mode, min_index, max_index, count, type, indices); -} - - -/*********************************************************************** - * Initialization - */ - - - - -void vbo_exec_array_init( struct vbo_exec_context *exec ) -{ -#if 1 - exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays; - exec->vtxfmt.DrawElements = vbo_exec_DrawElements; - exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; -#else - exec->vtxfmt.DrawArrays = _mesa_noop_DrawArrays; - exec->vtxfmt.DrawElements = _mesa_noop_DrawElements; - exec->vtxfmt.DrawRangeElements = _mesa_noop_DrawRangeElements; -#endif -} - - -void vbo_exec_array_destroy( struct vbo_exec_context *exec ) -{ - /* nothing to do */ -} diff --git a/src/libs/mesa/mesa/vbo/vbo_exec_draw.c b/src/libs/mesa/mesa/vbo/vbo_exec_draw.c deleted file mode 100644 index 74b7a1ffba..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec_draw.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/state.h" -#include "main/macros.h" - -#include "vbo_context.h" - - -static void vbo_exec_debug_verts( struct vbo_exec_context *exec ) -{ - GLuint count = exec->vtx.vert_count; - GLuint i; - - _mesa_printf("%s: %u vertices %d primitives, %d vertsize\n", - __FUNCTION__, - count, - exec->vtx.prim_count, - exec->vtx.vertex_size); - - for (i = 0 ; i < exec->vtx.prim_count ; i++) { - struct _mesa_prim *prim = &exec->vtx.prim[i]; - _mesa_printf(" prim %d: %s%s %d..%d %s %s\n", - i, - _mesa_lookup_enum_by_nr(prim->mode), - prim->weak ? " (weak)" : "", - prim->start, - prim->start + prim->count, - prim->begin ? "BEGIN" : "(wrap)", - prim->end ? "END" : "(wrap)"); - } -} - - -/* - * NOTE: Need to have calculated primitives by this point -- do it on the fly. - * NOTE: Old 'parity' issue is gone. - */ -static GLuint vbo_copy_vertices( struct vbo_exec_context *exec ) -{ - GLuint nr = exec->vtx.prim[exec->vtx.prim_count-1].count; - GLuint ovf, i; - GLuint sz = exec->vtx.vertex_size; - GLfloat *dst = exec->vtx.copied.buffer; - GLfloat *src = ((GLfloat *)exec->vtx.buffer_map + - exec->vtx.prim[exec->vtx.prim_count-1].start * - exec->vtx.vertex_size); - - - switch( exec->ctx->Driver.CurrentExecPrimitive ) - { - case GL_POINTS: - return 0; - case GL_LINES: - ovf = nr&1; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); - return i; - case GL_TRIANGLES: - ovf = nr%3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); - return i; - case GL_QUADS: - ovf = nr&3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); - return i; - case GL_LINE_STRIP: - if (nr == 0) - return 0; - else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); - return 1; - } - case GL_LINE_LOOP: - case GL_TRIANGLE_FAN: - case GL_POLYGON: - if (nr == 0) - return 0; - else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); - return 1; - } else { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) ); - return 2; - } - case GL_TRIANGLE_STRIP: - /* no parity issue, but need to make sure the tri is not drawn twice */ - if (nr & 1) { - exec->vtx.prim[exec->vtx.prim_count-1].count--; - } - /* fallthrough */ - case GL_QUAD_STRIP: - switch (nr) { - case 0: ovf = 0; break; - case 1: ovf = 1; break; - default: ovf = 2 + (nr&1); break; - } - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); - return i; - case PRIM_OUTSIDE_BEGIN_END: - return 0; - default: - assert(0); - return 0; - } -} - - - -/* TODO: populate these as the vertex is defined: - */ -static void vbo_exec_bind_arrays( GLcontext *ctx ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct gl_client_array *arrays = exec->vtx.arrays; - GLuint count = exec->vtx.vert_count; - GLubyte *data = exec->vtx.buffer_map; - const GLuint *map; - GLuint attr; - - /* Install the default (ie Current) attributes first, then overlay - * all active ones. - */ - switch (get_program_mode(exec->ctx)) { - case VP_NONE: - for (attr = 0; attr < 16; attr++) { - exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; - } - for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { - exec->vtx.inputs[attr + 16] = &vbo->mat_currval[attr]; - } - map = vbo->map_vp_none; - break; - case VP_NV: - case VP_ARB: - /* The aliasing of attributes for NV vertex programs has already - * occurred. NV vertex programs cannot access material values, - * nor attributes greater than VERT_ATTRIB_TEX7. - */ - for (attr = 0; attr < 16; attr++) { - exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; - exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr]; - } - map = vbo->map_vp_arb; - - /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read. - * In that case we effectively need to route the data from - * glVertexAttrib(0, val) calls to feed into the GENERIC0 input. - */ - if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 && - (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) { - exec->vtx.inputs[16] = exec->vtx.inputs[0]; - exec->vtx.attrsz[16] = exec->vtx.attrsz[0]; - exec->vtx.attrptr[16] = exec->vtx.attrptr[0]; - exec->vtx.attrsz[0] = 0; - } - break; - default: - assert(0); - } - - /* Make all active attributes (including edgeflag) available as - * arrays of floats. - */ - for (attr = 0; attr < VERT_ATTRIB_MAX ; attr++) { - const GLuint src = map[attr]; - - if (exec->vtx.attrsz[src]) { - /* override the default array set above */ - exec->vtx.inputs[attr] = &arrays[attr]; - - if (exec->vtx.bufferobj->Name) { - /* a real buffer obj: Ptr is an offset, not a pointer*/ - int offset; - assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */ - offset = (GLbyte *) data - (GLbyte *) exec->vtx.bufferobj->Pointer; - assert(offset >= 0); - arrays[attr].Ptr = (void *) offset; - } - else { - /* Ptr into ordinary app memory */ - arrays[attr].Ptr = (void *) data; - } - arrays[attr].Size = exec->vtx.attrsz[src]; - arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); - arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); - arrays[attr].Type = GL_FLOAT; - arrays[attr].Enabled = 1; - _mesa_reference_buffer_object(ctx, - &arrays[attr].BufferObj, - exec->vtx.bufferobj); - arrays[attr]._MaxElement = count; /* ??? */ - - data += exec->vtx.attrsz[src] * sizeof(GLfloat); - } - } -} - - -/** - * Execute the buffer and save copied verts. - */ -void vbo_exec_vtx_flush( struct vbo_exec_context *exec ) -{ - if (0) - vbo_exec_debug_verts( exec ); - - - if (exec->vtx.prim_count && - exec->vtx.vert_count) { - - exec->vtx.copied.nr = vbo_copy_vertices( exec ); - - if (exec->vtx.copied.nr != exec->vtx.vert_count) { - GLcontext *ctx = exec->ctx; - - GLenum target = GL_ARRAY_BUFFER_ARB; - GLenum access = GL_READ_WRITE_ARB; - GLenum usage = GL_STREAM_DRAW_ARB; - GLsizei size = VBO_VERT_BUFFER_SIZE * sizeof(GLfloat); - - /* Before the unmap (why?) - */ - vbo_exec_bind_arrays( ctx ); - - /* if using a real VBO, unmap it before drawing */ - if (exec->vtx.bufferobj->Name) { - ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); - exec->vtx.buffer_map = NULL; - } - - vbo_context(ctx)->draw_prims( ctx, - exec->vtx.inputs, - exec->vtx.prim, - exec->vtx.prim_count, - NULL, - 0, - exec->vtx.vert_count - 1); - - /* If using a real VBO, get new storage */ - if (exec->vtx.bufferobj->Name) { - ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); - exec->vtx.buffer_map = - ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); - } - } - } - - exec->vtx.prim_count = 0; - exec->vtx.vert_count = 0; - exec->vtx.vbptr = (GLfloat *)exec->vtx.buffer_map; -} diff --git a/src/libs/mesa/mesa/vbo/vbo_exec_eval.c b/src/libs/mesa/mesa/vbo/vbo_exec_eval.c deleted file mode 100644 index 0c691b3a5c..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_exec_eval.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - * - * Authors: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "math/m_eval.h" -#include "glapi/dispatch.h" -#include "vbo_exec.h" - - -static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) -{ - exec->eval.map1[attr].map = NULL; -} - -static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) -{ - exec->eval.map2[attr].map = NULL; -} - -static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, - struct gl_1d_map *map ) -{ - if (!exec->eval.map1[attr].map) { - exec->eval.map1[attr].map = map; - exec->eval.map1[attr].sz = dim; - } -} - -static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, - struct gl_2d_map *map ) -{ - if (!exec->eval.map2[attr].map) { - exec->eval.map2[attr].map = map; - exec->eval.map2[attr].sz = dim; - } -} - -void vbo_exec_eval_update( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - GLuint attr; - - /* Vertex program maps have priority over conventional attribs */ - - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - clear_active_eval1( exec, attr ); - clear_active_eval2( exec, attr ); - } - - /* _NEW_PROGRAM */ - if (ctx->VertexProgram._Enabled) { - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - /* _NEW_EVAL */ - if (ctx->Eval.Map1Attrib[attr]) - set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - - if (ctx->Eval.Map2Attrib[attr]) - set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); - } - } - - if (ctx->Eval.Map1Color4) - set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); - - if (ctx->Eval.Map2Color4) - set_active_eval2( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map2Color4 ); - - if (ctx->Eval.Map1TextureCoord4) - set_active_eval1( exec, VBO_ATTRIB_TEX0, 4, &ctx->EvalMap.Map1Texture4 ); - else if (ctx->Eval.Map1TextureCoord3) - set_active_eval1( exec, VBO_ATTRIB_TEX0, 3, &ctx->EvalMap.Map1Texture3 ); - else if (ctx->Eval.Map1TextureCoord2) - set_active_eval1( exec, VBO_ATTRIB_TEX0, 2, &ctx->EvalMap.Map1Texture2 ); - else if (ctx->Eval.Map1TextureCoord1) - set_active_eval1( exec, VBO_ATTRIB_TEX0, 1, &ctx->EvalMap.Map1Texture1 ); - - if (ctx->Eval.Map2TextureCoord4) - set_active_eval2( exec, VBO_ATTRIB_TEX0, 4, &ctx->EvalMap.Map2Texture4 ); - else if (ctx->Eval.Map2TextureCoord3) - set_active_eval2( exec, VBO_ATTRIB_TEX0, 3, &ctx->EvalMap.Map2Texture3 ); - else if (ctx->Eval.Map2TextureCoord2) - set_active_eval2( exec, VBO_ATTRIB_TEX0, 2, &ctx->EvalMap.Map2Texture2 ); - else if (ctx->Eval.Map2TextureCoord1) - set_active_eval2( exec, VBO_ATTRIB_TEX0, 1, &ctx->EvalMap.Map2Texture1 ); - - if (ctx->Eval.Map1Normal) - set_active_eval1( exec, VBO_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map1Normal ); - - if (ctx->Eval.Map2Normal) - set_active_eval2( exec, VBO_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map2Normal ); - - if (ctx->Eval.Map1Vertex4) - set_active_eval1( exec, VBO_ATTRIB_POS, 4, &ctx->EvalMap.Map1Vertex4 ); - else if (ctx->Eval.Map1Vertex3) - set_active_eval1( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map1Vertex3 ); - - if (ctx->Eval.Map2Vertex4) - set_active_eval2( exec, VBO_ATTRIB_POS, 4, &ctx->EvalMap.Map2Vertex4 ); - else if (ctx->Eval.Map2Vertex3) - set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); - - exec->eval.recalculate_maps = 0; -} - - - -void vbo_exec_do_EvalCoord1f(struct vbo_exec_context *exec, GLfloat u) -{ - GLuint attr; - - for (attr = 1; attr <= VBO_ATTRIB_TEX7; attr++) { - struct gl_1d_map *map = exec->eval.map1[attr].map; - if (map) { - GLfloat uu = (u - map->u1) * map->du; - GLfloat data[4]; - - ASSIGN_4V(data, 0, 0, 0, 1); - - _math_horner_bezier_curve(map->Points, data, uu, - exec->eval.map1[attr].sz, - map->Order); - - COPY_SZ_4V( exec->vtx.attrptr[attr], - exec->vtx.attrsz[attr], - data ); - } - } - - /** Vertex -- EvalCoord1f is a noop if this map not enabled: - **/ - if (exec->eval.map1[0].map) { - struct gl_1d_map *map = exec->eval.map1[0].map; - GLfloat uu = (u - map->u1) * map->du; - GLfloat vertex[4]; - - ASSIGN_4V(vertex, 0, 0, 0, 1); - - _math_horner_bezier_curve(map->Points, vertex, uu, - exec->eval.map1[0].sz, - map->Order); - - if (exec->eval.map1[0].sz == 4) - CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); - else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); - } -} - - - -void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, - GLfloat u, GLfloat v ) -{ - GLuint attr; - - for (attr = 1; attr <= VBO_ATTRIB_TEX7; attr++) { - struct gl_2d_map *map = exec->eval.map2[attr].map; - if (map) { - GLfloat uu = (u - map->u1) * map->du; - GLfloat vv = (v - map->v1) * map->dv; - GLfloat data[4]; - - ASSIGN_4V(data, 0, 0, 0, 1); - - _math_horner_bezier_surf(map->Points, - data, - uu, vv, - exec->eval.map2[attr].sz, - map->Uorder, map->Vorder); - - COPY_SZ_4V( exec->vtx.attrptr[attr], - exec->vtx.attrsz[attr], - data ); - } - } - - /** Vertex -- EvalCoord2f is a noop if this map not enabled: - **/ - if (exec->eval.map2[0].map) { - struct gl_2d_map *map = exec->eval.map2[0].map; - GLfloat uu = (u - map->u1) * map->du; - GLfloat vv = (v - map->v1) * map->dv; - GLfloat vertex[4]; - - ASSIGN_4V(vertex, 0, 0, 0, 1); - - if (exec->ctx->Eval.AutoNormal) { - GLfloat normal[4]; - GLfloat du[4], dv[4]; - - _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, - exec->eval.map2[0].sz, - map->Uorder, map->Vorder); - - if (exec->eval.map2[0].sz == 4) { - du[0] = du[0]*vertex[3] - du[3]*vertex[0]; - du[1] = du[1]*vertex[3] - du[3]*vertex[1]; - du[2] = du[2]*vertex[3] - du[3]*vertex[2]; - - dv[0] = dv[0]*vertex[3] - dv[3]*vertex[0]; - dv[1] = dv[1]*vertex[3] - dv[3]*vertex[1]; - dv[2] = dv[2]*vertex[3] - dv[3]*vertex[2]; - } - - - CROSS3(normal, du, dv); - NORMALIZE_3FV(normal); - normal[3] = 1.0; - - COPY_SZ_4V( exec->vtx.attrptr[VBO_ATTRIB_NORMAL], - exec->vtx.attrsz[VBO_ATTRIB_NORMAL], - normal ); - - } - else { - _math_horner_bezier_surf(map->Points, vertex, uu, vv, - exec->eval.map2[0].sz, - map->Uorder, map->Vorder); - } - - if (exec->vtx.attrsz[0] == 4) - CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); - else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); - } -} - - diff --git a/src/libs/mesa/mesa/vbo/vbo_rebase.c b/src/libs/mesa/mesa/vbo/vbo_rebase.c deleted file mode 100644 index dae778e741..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_rebase.c +++ /dev/null @@ -1,222 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - -/* Helper for drivers which find themselves rendering a range of - * indices starting somewhere above zero. Typically the application - * is issuing multiple DrawArrays() or DrawElements() to draw - * successive primitives layed out linearly in the vertex arrays. - * Unless the vertex arrays are all in a VBO, the OpenGL semantics - * imply that we need to re-upload the vertex data on each draw call. - * In that case, we want to avoid starting the upload at zero, as it - * will mean every draw call uploads an increasing amount of not-used - * vertex data. Worse - in the software tnl module, all those - * vertices will be transformed and lit. - * - * If we just upload the new data, however, the indices will be - * incorrect as we tend to upload each set of vertex data to a new - * region. - * - * This file provides a helper to adjust the arrays, primitives and - * indices of a draw call so that it can be re-issued with a min_index - * of zero. - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "vbo.h" - - -#define REBASE(TYPE) \ -static void *rebase_##TYPE( const void *ptr, \ - GLuint count, \ - TYPE min_index ) \ -{ \ - const TYPE *in = (TYPE *)ptr; \ - TYPE *tmp_indices = malloc(count * sizeof(TYPE)); \ - GLuint i; \ - \ - for (i = 0; i < count; i++) \ - tmp_indices[i] = in[i] - min_index; \ - \ - return (void *)tmp_indices; \ -} - - -REBASE(GLuint) -REBASE(GLushort) -REBASE(GLubyte) - -GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] ) -{ - GLuint i; - - for (i = 0; i < VERT_ATTRIB_MAX; i++) - if (arrays[i]->StrideB && - arrays[i]->BufferObj->Name == 0) - return GL_FALSE; - - return GL_TRUE; -} - -/* Adjust primitives, indices and vertex definitions so that min_index - * becomes zero. There are lots of reasons for wanting to do this, eg: - * - * Software tnl: - * - any time min_index != 0, otherwise unused vertices lower than - * min_index will be transformed. - * - * Hardware tnl: - * - if ib != NULL and min_index != 0, otherwise vertices lower than - * min_index will be uploaded. Requires adjusting index values. - * - * - if ib == NULL and min_index != 0, just for convenience so this doesn't - * have to be handled within the driver. - * - * Hardware tnl with VBO support: - * - as above, but only when vertices are not (all?) in VBO's. - * - can't save time by trying to upload half a vbo - typically it is - * all or nothing. - */ -void vbo_rebase_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw ) -{ - struct gl_client_array tmp_arrays[VERT_ATTRIB_MAX]; - const struct gl_client_array *tmp_array_pointers[VERT_ATTRIB_MAX]; - - struct _mesa_index_buffer tmp_ib; - struct _mesa_prim *tmp_prims = NULL; - void *tmp_indices = NULL; - GLuint i; - - assert(min_index != 0); - - if (0) - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - - if (ib) { - /* Unfortunately need to adjust each index individually. - */ - GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer; - void *ptr; - - if (map_ib) - ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER, - GL_READ_ONLY_ARB, - ib->obj); - - - ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); - - /* Some users might prefer it if we translated elements to - * GLuints here. Others wouldn't... - */ - switch (ib->type) { - case GL_UNSIGNED_INT: - tmp_indices = rebase_GLuint( ptr, ib->count, min_index ); - break; - case GL_UNSIGNED_SHORT: - tmp_indices = rebase_GLushort( ptr, ib->count, min_index ); - break; - case GL_UNSIGNED_BYTE: - tmp_indices = rebase_GLubyte( ptr, ib->count, min_index ); - break; - } - - if (map_ib) - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER, - ib->obj); - - tmp_ib.obj = ctx->Array.NullBufferObj; - tmp_ib.ptr = tmp_indices; - tmp_ib.count = ib->count; - tmp_ib.type = ib->type; - - ib = &tmp_ib; - } - else { - /* Otherwise the primitives need adjustment. - */ - tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); - - for (i = 0; i < nr_prims; i++) { - /* If this fails, it could indicate an application error: - */ - assert(prim[i].start >= min_index); - - tmp_prims[i] = prim[i]; - tmp_prims[i].start -= min_index; - } - - prim = tmp_prims; - } - - /* Just need to adjust the pointer values on each incoming array. - * This works for VBO and non-vbo rendering and shouldn't pesimize - * VBO-based upload schemes. However this may still not be a fast - * path for hardware tnl for VBO based rendering as most machines - * will be happier if you just specify a starting vertex value in - * each primitive. - * - * For drivers with hardware tnl, you only want to do this if you - * are forced to, eg non-VBO indexed rendering with start != 0. - */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - tmp_arrays[i] = *arrays[i]; - tmp_arrays[i].Ptr += min_index * tmp_arrays[i].StrideB; - tmp_array_pointers[i] = &tmp_arrays[i]; - } - - /* Re-issue the draw call. - */ - draw( ctx, - tmp_array_pointers, - prim, - nr_prims, - ib, - 0, - max_index - min_index ); - - if (tmp_indices) - _mesa_free(tmp_indices); - - if (tmp_prims) - _mesa_free(tmp_prims); -} - - - diff --git a/src/libs/mesa/mesa/vbo/vbo_save.c b/src/libs/mesa/mesa/vbo/vbo_save.c deleted file mode 100644 index 9757c3d9f6..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_save.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/mtypes.h" -#include "main/bufferobj.h" -#include "main/dlist.h" -#include "main/vtxfmt.h" -#include "main/imports.h" - -#include "vbo_context.h" - - - -static void vbo_save_callback_init( GLcontext *ctx ) -{ - ctx->Driver.NewList = vbo_save_NewList; - ctx->Driver.EndList = vbo_save_EndList; - ctx->Driver.SaveFlushVertices = vbo_save_SaveFlushVertices; - ctx->Driver.BeginCallList = vbo_save_BeginCallList; - ctx->Driver.EndCallList = vbo_save_EndCallList; - ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin; -} - - - -void vbo_save_init( GLcontext *ctx ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_save_context *save = &vbo->save; - - save->ctx = ctx; - - vbo_save_api_init( save ); - vbo_save_callback_init(ctx); - - { - struct gl_client_array *arrays = save->arrays; - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0])); - } - - ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; -} - - -void vbo_save_destroy( GLcontext *ctx ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_save_context *save = &vbo->save; - GLuint i; - - if (save->prim_store) { - if ( --save->prim_store->refcount == 0 ) { - FREE( save->prim_store ); - save->prim_store = NULL; - } - if ( --save->vertex_store->refcount == 0 ) { - _mesa_reference_buffer_object(ctx, - &save->vertex_store->bufferobj, NULL); - FREE( save->vertex_store ); - save->vertex_store = NULL; - } - } - - for (i = 0; i < VBO_ATTRIB_MAX; i++) { - _mesa_reference_buffer_object(ctx, &save->arrays[i].BufferObj, NULL); - } -} - - - - -/* Note that this can occur during the playback of a display list: - */ -void vbo_save_fallback( GLcontext *ctx, GLboolean fallback ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - if (fallback) - save->replay_flags |= VBO_SAVE_FALLBACK; - else - save->replay_flags &= ~VBO_SAVE_FALLBACK; -} - - diff --git a/src/libs/mesa/mesa/vbo/vbo_save.h b/src/libs/mesa/mesa/vbo/vbo_save.h deleted file mode 100644 index b7e9baabf8..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_save.h +++ /dev/null @@ -1,177 +0,0 @@ -/************************************************************************** - -Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - * - */ - -#ifndef VBO_SAVE_H -#define VBO_SAVE_H - -#include "main/mtypes.h" -#include "vbo.h" -#include "vbo_attrib.h" - - -struct vbo_save_copied_vtx { - GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS]; - GLuint nr; -}; - - -/* For display lists, this structure holds a run of vertices of the - * same format, and a strictly well-formed set of begin/end pairs, - * starting on the first vertex and ending at the last. Vertex - * copying on buffer breaks is precomputed according to these - * primitives, though there are situations where the copying will need - * correction at execute-time, perhaps by replaying the list as - * immediate mode commands. - * - * On executing this list, the 'current' values may be updated with - * the values of the final vertex, and often no fixup of the start of - * the vertex list is required. - * - * Eval and other commands that don't fit into these vertex lists are - * compiled using the fallback opcode mechanism provided by dlist.c. - */ -struct vbo_save_vertex_list { - GLubyte attrsz[VBO_ATTRIB_MAX]; - GLuint vertex_size; - - GLuint buffer_offset; - GLuint count; - GLuint wrap_count; /* number of copied vertices at start */ - GLboolean dangling_attr_ref; /* current attr implicitly referenced - outside the list */ - - struct _mesa_prim *prim; - GLuint prim_count; - - struct vbo_save_vertex_store *vertex_store; - struct vbo_save_primitive_store *prim_store; -}; - -/* These buffers should be a reasonable size to support upload to - * hardware. Current vbo implementation will re-upload on any - * changes, so don't make too big or apps which dynamically create - * dlists and use only a few times will suffer. - * - * Consider stategy of uploading regions from the VBO on demand in the - * case of dynamic vbos. Then make the dlist code signal that - * likelyhood as it occurs. No reason we couldn't change usage - * internally even though this probably isn't allowed for client VBOs? - */ -#define VBO_SAVE_BUFFER_SIZE (8*1024) /* dwords */ -#define VBO_SAVE_PRIM_SIZE 128 -#define VBO_SAVE_PRIM_WEAK 0x40 - -#define VBO_SAVE_FALLBACK 0x10000000 - -/* Storage to be shared among several vertex_lists. - */ -struct vbo_save_vertex_store { - struct gl_buffer_object *bufferobj; - GLfloat *buffer; - GLuint used; - GLuint refcount; -}; - -struct vbo_save_primitive_store { - struct _mesa_prim buffer[VBO_SAVE_PRIM_SIZE]; - GLuint used; - GLuint refcount; -}; - - -struct vbo_save_context { - GLcontext *ctx; - GLvertexformat vtxfmt; - struct gl_client_array arrays[VBO_ATTRIB_MAX]; - const struct gl_client_array *inputs[VBO_ATTRIB_MAX]; - - GLubyte attrsz[VBO_ATTRIB_MAX]; - GLubyte active_sz[VBO_ATTRIB_MAX]; - GLuint vertex_size; - - GLfloat *buffer; - GLuint count; - GLuint wrap_count; - GLuint replay_flags; - - struct _mesa_prim *prim; - GLuint prim_count, prim_max; - - struct vbo_save_vertex_store *vertex_store; - struct vbo_save_primitive_store *prim_store; - - GLfloat *vbptr; /* cursor, points into buffer */ - GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current values */ - GLfloat *attrptr[VBO_ATTRIB_MAX]; - GLuint vert_count; - GLuint max_vert; - GLboolean dangling_attr_ref; - GLboolean have_materials; - - GLuint opcode_vertex_list; - - struct vbo_save_copied_vtx copied; - - GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */ - GLubyte *currentsz[VBO_ATTRIB_MAX]; -}; - - -void vbo_save_init( GLcontext *ctx ); -void vbo_save_destroy( GLcontext *ctx ); -void vbo_save_fallback( GLcontext *ctx, GLboolean fallback ); - -/* save_loopback.c: - */ -void vbo_loopback_vertex_list( GLcontext *ctx, - const GLfloat *buffer, - const GLubyte *attrsz, - const struct _mesa_prim *prim, - GLuint prim_count, - GLuint wrap_count, - GLuint vertex_size); - -/* Callbacks: - */ -void vbo_save_EndList( GLcontext *ctx ); -void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode ); -void vbo_save_EndCallList( GLcontext *ctx ); -void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *list ); -void vbo_save_SaveFlushVertices( GLcontext *ctx ); -GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode ); - -void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ); - -void vbo_save_api_init( struct vbo_save_context *save ); - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_save_api.c b/src/libs/mesa/mesa/vbo/vbo_save_api.c deleted file mode 100644 index f69a33d817..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_save_api.c +++ /dev/null @@ -1,1189 +0,0 @@ -/************************************************************************** - -Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -TUNGSTEN GRAPHICS AND/OR THEIR 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: - * Keith Whitwell - */ - - - -/* Display list compiler attempts to store lists of vertices with the - * same vertex layout. Additionally it attempts to minimize the need - * for execute-time fixup of these vertex lists, allowing them to be - * cached on hardware. - * - * There are still some circumstances where this can be thwarted, for - * example by building a list that consists of one very long primitive - * (eg Begin(Triangles), 1000 vertices, End), and calling that list - * from inside a different begin/end object (Begin(Lines), CallList, - * End). - * - * In that case the code will have to replay the list as individual - * commands through the Exec dispatch table, or fix up the copied - * vertices at execute-time. - * - * The other case where fixup is required is when a vertex attribute - * is introduced in the middle of a primitive. Eg: - * Begin(Lines) - * TexCoord1f() Vertex2f() - * TexCoord1f() Color3f() Vertex2f() - * End() - * - * If the current value of Color isn't known at compile-time, this - * primitive will require fixup. - * - * - * The list compiler currently doesn't attempt to compile lists - * containing EvalCoord or EvalPoint commands. On encountering one of - * these, compilation falls back to opcodes. - * - * This could be improved to fallback only when a mix of EvalCoord and - * Vertex commands are issued within a single primitive. - */ - - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/dlist.h" -#include "main/enums.h" -#include "main/macros.h" -#include "main/api_validate.h" -#include "main/api_arrayelt.h" -#include "main/vtxfmt.h" -#include "glapi/dispatch.h" - -#include "vbo_context.h" - - -#ifdef ERROR -#undef ERROR -#endif - - -/* An interesting VBO number/name to help with debugging */ -#define VBO_BUF_ID 12345 - - -/* - * NOTE: Old 'parity' issue is gone, but copying can still be - * wrong-footed on replay. - */ -static GLuint _save_copy_vertices( GLcontext *ctx, - const struct vbo_save_vertex_list *node, - const GLfloat *src_buffer) -{ - struct vbo_save_context *save = &vbo_context( ctx )->save; - const struct _mesa_prim *prim = &node->prim[node->prim_count-1]; - GLuint nr = prim->count; - GLuint sz = save->vertex_size; - const GLfloat *src = src_buffer + prim->start * sz; - GLfloat *dst = save->copied.buffer; - GLuint ovf, i; - - if (prim->end) - return 0; - - switch( prim->mode ) - { - case GL_POINTS: - return 0; - case GL_LINES: - ovf = nr&1; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_TRIANGLES: - ovf = nr%3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_QUADS: - ovf = nr&3; - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - case GL_LINE_STRIP: - if (nr == 0) - return 0; - else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); - return 1; - } - case GL_LINE_LOOP: - case GL_TRIANGLE_FAN: - case GL_POLYGON: - if (nr == 0) - return 0; - else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - return 1; - } else { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); - return 2; - } - case GL_TRIANGLE_STRIP: - case GL_QUAD_STRIP: - switch (nr) { - case 0: ovf = 0; break; - case 1: ovf = 1; break; - default: ovf = 2 + (nr&1); break; - } - for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); - return i; - default: - assert(0); - return 0; - } -} - - -static struct vbo_save_vertex_store *alloc_vertex_store( GLcontext *ctx ) -{ - struct vbo_save_vertex_store *vertex_store = CALLOC_STRUCT(vbo_save_vertex_store); - - /* obj->Name needs to be non-zero, but won't ever be examined more - * closely than that. In particular these buffers won't be entered - * into the hash and can never be confused with ones visible to the - * user. Perhaps there could be a special number for internal - * buffers: - */ - vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, - VBO_BUF_ID, - GL_ARRAY_BUFFER_ARB); - - ctx->Driver.BufferData( ctx, - GL_ARRAY_BUFFER_ARB, - VBO_SAVE_BUFFER_SIZE * sizeof(GLfloat), - NULL, - GL_STATIC_DRAW_ARB, - vertex_store->bufferobj); - - vertex_store->buffer = NULL; - vertex_store->used = 0; - vertex_store->refcount = 1; - - return vertex_store; -} - -static void free_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *vertex_store ) -{ - assert(!vertex_store->buffer); - - if (vertex_store->bufferobj) { - _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL); - } - - FREE( vertex_store ); -} - -static GLfloat *map_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *vertex_store ) -{ - assert(vertex_store->bufferobj); - assert(!vertex_store->buffer); - vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, /* not used */ - GL_WRITE_ONLY, /* not used */ - vertex_store->bufferobj); - - assert(vertex_store->buffer); - return vertex_store->buffer + vertex_store->used; -} - -static void unmap_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *vertex_store ) -{ - ctx->Driver.UnmapBuffer( ctx, GL_ARRAY_BUFFER_ARB, vertex_store->bufferobj ); - vertex_store->buffer = NULL; -} - - -static struct vbo_save_primitive_store *alloc_prim_store( GLcontext *ctx ) -{ - struct vbo_save_primitive_store *store = CALLOC_STRUCT(vbo_save_primitive_store); - (void) ctx; - store->used = 0; - store->refcount = 1; - return store; -} - -static void _save_reset_counters( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - save->prim = save->prim_store->buffer + save->prim_store->used; - save->buffer = (save->vertex_store->buffer + - save->vertex_store->used); - - assert(save->buffer == save->vbptr); - - if (save->vertex_size) - save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / - save->vertex_size); - else - save->max_vert = 0; - - save->vert_count = 0; - save->prim_count = 0; - save->prim_max = VBO_SAVE_PRIM_SIZE - save->prim_store->used; - save->dangling_attr_ref = 0; -} - - -/* Insert the active immediate struct onto the display list currently - * being built. - */ -static void _save_compile_vertex_list( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - struct vbo_save_vertex_list *node; - - /* Allocate space for this structure in the display list currently - * being compiled. - */ - node = (struct vbo_save_vertex_list *) - _mesa_alloc_instruction(ctx, save->opcode_vertex_list, sizeof(*node)); - - if (!node) - return; - - /* Duplicate our template, increment refcounts to the storage structs: - */ - _mesa_memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); - node->vertex_size = save->vertex_size; - node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat); - node->count = save->vert_count; - node->wrap_count = save->copied.nr; - node->dangling_attr_ref = save->dangling_attr_ref; - node->prim = save->prim; - node->prim_count = save->prim_count; - node->vertex_store = save->vertex_store; - node->prim_store = save->prim_store; - - node->vertex_store->refcount++; - node->prim_store->refcount++; - - assert(node->attrsz[VBO_ATTRIB_POS] != 0 || - node->count == 0); - - if (save->dangling_attr_ref) - ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS; - - save->vertex_store->used += save->vertex_size * node->count; - save->prim_store->used += node->prim_count; - - - /* Copy duplicated vertices - */ - save->copied.nr = _save_copy_vertices( ctx, node, save->buffer ); - - - /* Deal with GL_COMPILE_AND_EXECUTE: - */ - if (ctx->ExecuteFlag) { - struct _glapi_table *dispatch = GET_DISPATCH(); - - _glapi_set_dispatch(ctx->Exec); - - vbo_loopback_vertex_list( ctx, - (const GLfloat *)((const char *)save->vertex_store->buffer + - node->buffer_offset), - node->attrsz, - node->prim, - node->prim_count, - node->wrap_count, - node->vertex_size); - - _glapi_set_dispatch(dispatch); - } - - - /* Decide whether the storage structs are full, or can be used for - * the next vertex lists as well. - */ - if (save->vertex_store->used > - VBO_SAVE_BUFFER_SIZE - 16 * (save->vertex_size + 4)) { - - /* Unmap old store: - */ - unmap_vertex_store( ctx, save->vertex_store ); - - /* Release old reference: - */ - save->vertex_store->refcount--; - assert(save->vertex_store->refcount != 0); - save->vertex_store = NULL; - - /* Allocate and map new store: - */ - save->vertex_store = alloc_vertex_store( ctx ); - save->vbptr = map_vertex_store( ctx, save->vertex_store ); - } - - if (save->prim_store->used > VBO_SAVE_PRIM_SIZE - 6) { - save->prim_store->refcount--; - assert(save->prim_store->refcount != 0); - save->prim_store = alloc_prim_store( ctx ); - } - - /* Reset our structures for the next run of vertices: - */ - _save_reset_counters( ctx ); -} - - -/* TODO -- If no new vertices have been stored, don't bother saving - * it. - */ -static void _save_wrap_buffers( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLint i = save->prim_count - 1; - GLenum mode; - GLboolean weak; - - assert(i < (GLint) save->prim_max); - assert(i >= 0); - - /* Close off in-progress primitive. - */ - save->prim[i].count = (save->vert_count - - save->prim[i].start); - mode = save->prim[i].mode; - weak = save->prim[i].weak; - - /* store the copied vertices, and allocate a new list. - */ - _save_compile_vertex_list( ctx ); - - /* Restart interrupted primitive - */ - save->prim[0].mode = mode; - save->prim[0].weak = weak; - save->prim[0].begin = 0; - save->prim[0].end = 0; - save->prim[0].pad = 0; - save->prim[0].start = 0; - save->prim[0].count = 0; - save->prim_count = 1; -} - - - -/* Called only when buffers are wrapped as the result of filling the - * vertex_store struct. - */ -static void _save_wrap_filled_vertex( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLfloat *data = save->copied.buffer; - GLuint i; - - /* Emit a glEnd to close off the last vertex list. - */ - _save_wrap_buffers( ctx ); - - /* Copy stored stored vertices to start of new list. - */ - assert(save->max_vert - save->vert_count > save->copied.nr); - - for (i = 0 ; i < save->copied.nr ; i++) { - _mesa_memcpy( save->vbptr, data, save->vertex_size * sizeof(GLfloat)); - data += save->vertex_size; - save->vbptr += save->vertex_size; - save->vert_count++; - } -} - - -static void _save_copy_to_current( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLuint i; - - for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { - if (save->attrsz[i]) { - save->currentsz[i][0] = save->attrsz[i]; - COPY_CLEAN_4V(save->current[i], - save->attrsz[i], - save->attrptr[i]); - } - } -} - - -static void _save_copy_from_current( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLint i; - - for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { - switch (save->attrsz[i]) { - case 4: save->attrptr[i][3] = save->current[i][3]; - case 3: save->attrptr[i][2] = save->current[i][2]; - case 2: save->attrptr[i][1] = save->current[i][1]; - case 1: save->attrptr[i][0] = save->current[i][0]; - case 0: break; - } - } -} - - - - -/* Flush existing data, set new attrib size, replay copied vertices. - */ -static void _save_upgrade_vertex( GLcontext *ctx, - GLuint attr, - GLuint newsz ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLuint oldsz; - GLuint i; - GLfloat *tmp; - - /* Store the current run of vertices, and emit a GL_END. Emit a - * BEGIN in the new buffer. - */ - if (save->vert_count) - _save_wrap_buffers( ctx ); - else - assert( save->copied.nr == 0 ); - - /* Do a COPY_TO_CURRENT to ensure back-copying works for the case - * when the attribute already exists in the vertex and is having - * its size increased. - */ - _save_copy_to_current( ctx ); - - /* Fix up sizes: - */ - oldsz = save->attrsz[attr]; - save->attrsz[attr] = newsz; - - save->vertex_size += newsz - oldsz; - save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / - save->vertex_size); - save->vert_count = 0; - - /* Recalculate all the attrptr[] values: - */ - for (i = 0, tmp = save->vertex ; i < VBO_ATTRIB_MAX ; i++) { - if (save->attrsz[i]) { - save->attrptr[i] = tmp; - tmp += save->attrsz[i]; - } - else - save->attrptr[i] = NULL; /* will not be dereferenced. */ - } - - /* Copy from current to repopulate the vertex with correct values. - */ - _save_copy_from_current( ctx ); - - /* Replay stored vertices to translate them to new format here. - * - * If there are copied vertices and the new (upgraded) attribute - * has not been defined before, this list is somewhat degenerate, - * and will need fixup at runtime. - */ - if (save->copied.nr) - { - GLfloat *data = save->copied.buffer; - GLfloat *dest = save->buffer; - GLuint j; - - /* Need to note this and fix up at runtime (or loopback): - */ - if (attr != VBO_ATTRIB_POS && save->currentsz[attr][0] == 0) { - assert(oldsz == 0); - save->dangling_attr_ref = GL_TRUE; - } - - for (i = 0 ; i < save->copied.nr ; i++) { - for (j = 0 ; j < VBO_ATTRIB_MAX ; j++) { - if (save->attrsz[j]) { - if (j == attr) { - if (oldsz) { - COPY_CLEAN_4V( dest, oldsz, data ); - data += oldsz; - dest += newsz; - } - else { - COPY_SZ_4V( dest, newsz, save->current[attr] ); - dest += newsz; - } - } - else { - GLint sz = save->attrsz[j]; - COPY_SZ_4V( dest, sz, data ); - data += sz; - dest += sz; - } - } - } - } - - save->vbptr = dest; - save->vert_count += save->copied.nr; - } -} - -static void save_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - if (sz > save->attrsz[attr]) { - /* New size is larger. Need to flush existing vertices and get - * an enlarged vertex format. - */ - _save_upgrade_vertex( ctx, attr, sz ); - } - else if (sz < save->active_sz[attr]) { - static GLfloat id[4] = { 0, 0, 0, 1 }; - GLuint i; - - /* New size is equal or smaller - just need to fill in some - * zeros. - */ - for (i = sz ; i <= save->attrsz[attr] ; i++) - save->attrptr[attr][i-1] = id[i-1]; - } - - save->active_sz[attr] = sz; -} - -static void _save_reset_vertex( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLuint i; - - for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { - save->attrsz[i] = 0; - save->active_sz[i] = 0; - } - - save->vertex_size = 0; -} - - - -#define ERROR() _mesa_compile_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); - - -/* Only one size for each attribute may be active at once. Eg. if - * Color3f is installed/active, then Color4f may not be, even if the - * vertex actually contains 4 color coordinates. This is because the - * 3f version won't otherwise set color[3] to 1.0 -- this is the job - * of the chooser function when switching between Color4f and Color3f. - */ -#define ATTR( A, N, V0, V1, V2, V3 ) \ -do { \ - struct vbo_save_context *save = &vbo_context(ctx)->save; \ - \ - if (save->active_sz[A] != N) \ - save_fixup_vertex(ctx, A, N); \ - \ - { \ - GLfloat *dest = save->attrptr[A]; \ - if (N>0) dest[0] = V0; \ - if (N>1) dest[1] = V1; \ - if (N>2) dest[2] = V2; \ - if (N>3) dest[3] = V3; \ - } \ - \ - if ((A) == 0) { \ - GLuint i; \ - \ - for (i = 0; i < save->vertex_size; i++) \ - save->vbptr[i] = save->vertex[i]; \ - \ - save->vbptr += save->vertex_size; \ - \ - if (++save->vert_count >= save->max_vert) \ - _save_wrap_filled_vertex( ctx ); \ - } \ -} while (0) - -#define TAG(x) _save_##x - -#include "vbo_attrib_tmp.h" - - - - -/* Cope with EvalCoord/CallList called within a begin/end object: - * -- Flush current buffer - * -- Fallback to opcodes for the rest of the begin/end object. - */ -#define DO_FALLBACK(ctx) \ -do { \ - struct vbo_save_context *save = &vbo_context(ctx)->save; \ - \ - if (save->vert_count || save->prim_count) \ - _save_compile_vertex_list( ctx ); \ - \ - _save_copy_to_current( ctx ); \ - _save_reset_vertex( ctx ); \ - _save_reset_counters( ctx ); \ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); \ - ctx->Driver.SaveNeedFlush = 0; \ -} while (0) - -static void GLAPIENTRY _save_EvalCoord1f( GLfloat u ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalCoord1f( u ); -} - -static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalCoord1fv( v ); -} - -static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalCoord2f( u, v ); -} - -static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalCoord2fv( v ); -} - -static void GLAPIENTRY _save_EvalPoint1( GLint i ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalPoint1( i ); -} - -static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->EvalPoint2( i, j ); -} - -static void GLAPIENTRY _save_CallList( GLuint l ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->CallList( l ); -} - -static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v ) -{ - GET_CURRENT_CONTEXT(ctx); - DO_FALLBACK(ctx); - ctx->Save->CallLists( n, type, v ); -} - - - - -/* This begin is hooked into ... Updating of - * ctx->Driver.CurrentSavePrimitive is already taken care of. - */ -GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - GLuint i = save->prim_count++; - - assert(i < save->prim_max); - save->prim[i].mode = mode & ~VBO_SAVE_PRIM_WEAK; - save->prim[i].begin = 1; - save->prim[i].end = 0; - save->prim[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0; - save->prim[i].pad = 0; - save->prim[i].start = save->vert_count; - save->prim[i].count = 0; - - _mesa_install_save_vtxfmt( ctx, &save->vtxfmt ); - ctx->Driver.SaveNeedFlush = 1; - return GL_TRUE; -} - - - -static void GLAPIENTRY _save_End( void ) -{ - GET_CURRENT_CONTEXT( ctx ); - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLint i = save->prim_count - 1; - - ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; - save->prim[i].end = 1; - save->prim[i].count = (save->vert_count - - save->prim[i].start); - - if (i == (GLint) save->prim_max - 1) { - _save_compile_vertex_list( ctx ); - assert(save->copied.nr == 0); - } - - /* Swap out this vertex format while outside begin/end. Any color, - * etc. received between here and the next begin will be compiled - * as opcodes. - */ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -} - - -/* These are all errors as this vtxfmt is only installed inside - * begin/end pairs. - */ -static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) count; (void) type; (void) indices; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" ); -} - - -static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); -} - -static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) start; (void) count; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" ); -} - -static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) x1; (void) y1; (void) x2; (void) y2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" ); -} - -static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) i1; (void) i2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" ); -} - -static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2, - GLint j1, GLint j2 ) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; (void) i1; (void) i2; (void) j1; (void) j2; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" ); -} - -static void GLAPIENTRY _save_Begin( GLenum mode ) -{ - GET_CURRENT_CONTEXT( ctx ); - (void) mode; - _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" ); -} - - -/* Unlike the functions above, these are to be hooked into the vtxfmt - * maintained in ctx->ListState, active when the list is known or - * suspected to be outside any begin/end primitive. - */ -static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - GET_CURRENT_CONTEXT(ctx); - vbo_save_NotifyBegin( ctx, GL_QUADS | VBO_SAVE_PRIM_WEAK ); - CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 )); - CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 )); - CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 )); - CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 )); - CALL_End(GET_DISPATCH(), ()); -} - - -static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) - return; - - _ae_map_vbos( ctx ); - - vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK ); - - for (i = 0; i < count; i++) - CALL_ArrayElement(GET_DISPATCH(), (start + i)); - CALL_End(GET_DISPATCH(), ()); - - _ae_unmap_vbos( ctx ); -} - -/* Could do better by copying the arrays and element list intact and - * then emitting an indexed prim at runtime. - */ -static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) - return; - - _ae_map_vbos( ctx ); - - if (ctx->Array.ElementArrayBufferObj->Name) - indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices); - - vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK ); - - switch (type) { - case GL_UNSIGNED_BYTE: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] )); - break; - case GL_UNSIGNED_SHORT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] )); - break; - case GL_UNSIGNED_INT: - for (i = 0 ; i < count ; i++) - CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] )); - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); - break; - } - - CALL_End(GET_DISPATCH(), ()); - - _ae_unmap_vbos( ctx ); -} - -static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - if (_mesa_validate_DrawRangeElements( ctx, mode, - start, end, - count, type, indices )) - _save_OBE_DrawElements( mode, count, type, indices ); -} - - - - - -static void _save_vtxfmt_init( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLvertexformat *vfmt = &save->vtxfmt; - - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Begin = _save_Begin; - vfmt->Color3f = _save_Color3f; - vfmt->Color3fv = _save_Color3fv; - vfmt->Color4f = _save_Color4f; - vfmt->Color4fv = _save_Color4fv; - vfmt->EdgeFlag = _save_EdgeFlag; - vfmt->End = _save_End; - vfmt->FogCoordfEXT = _save_FogCoordfEXT; - vfmt->FogCoordfvEXT = _save_FogCoordfvEXT; - vfmt->Indexf = _save_Indexf; - vfmt->Indexfv = _save_Indexfv; - vfmt->Materialfv = _save_Materialfv; - vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f; - vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv; - vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f; - vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv; - vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f; - vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv; - vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f; - vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv; - vfmt->Normal3f = _save_Normal3f; - vfmt->Normal3fv = _save_Normal3fv; - vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT; - vfmt->TexCoord1f = _save_TexCoord1f; - vfmt->TexCoord1fv = _save_TexCoord1fv; - vfmt->TexCoord2f = _save_TexCoord2f; - vfmt->TexCoord2fv = _save_TexCoord2fv; - vfmt->TexCoord3f = _save_TexCoord3f; - vfmt->TexCoord3fv = _save_TexCoord3fv; - vfmt->TexCoord4f = _save_TexCoord4f; - vfmt->TexCoord4fv = _save_TexCoord4fv; - vfmt->Vertex2f = _save_Vertex2f; - vfmt->Vertex2fv = _save_Vertex2fv; - vfmt->Vertex3f = _save_Vertex3f; - vfmt->Vertex3fv = _save_Vertex3fv; - vfmt->Vertex4f = _save_Vertex4f; - vfmt->Vertex4fv = _save_Vertex4fv; - vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB; - vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB; - vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB; - vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB; - vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB; - vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB; - vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB; - vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB; - - vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV; - - /* This will all require us to fallback to saving the list as opcodes: - */ - vfmt->CallList = _save_CallList; /* inside begin/end */ - vfmt->CallLists = _save_CallLists; /* inside begin/end */ - vfmt->EvalCoord1f = _save_EvalCoord1f; - vfmt->EvalCoord1fv = _save_EvalCoord1fv; - vfmt->EvalCoord2f = _save_EvalCoord2f; - vfmt->EvalCoord2fv = _save_EvalCoord2fv; - vfmt->EvalPoint1 = _save_EvalPoint1; - vfmt->EvalPoint2 = _save_EvalPoint2; - - /* These are all errors as we at least know we are in some sort of - * begin/end pair: - */ - vfmt->EvalMesh1 = _save_EvalMesh1; - vfmt->EvalMesh2 = _save_EvalMesh2; - vfmt->Begin = _save_Begin; - vfmt->Rectf = _save_Rectf; - vfmt->DrawArrays = _save_DrawArrays; - vfmt->DrawElements = _save_DrawElements; - vfmt->DrawRangeElements = _save_DrawRangeElements; - -} - - -void vbo_save_SaveFlushVertices( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - /* Noop when we are actually active: - */ - if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM || - ctx->Driver.CurrentSavePrimitive <= GL_POLYGON) - return; - - if (save->vert_count || - save->prim_count) - _save_compile_vertex_list( ctx ); - - _save_copy_to_current( ctx ); - _save_reset_vertex( ctx ); - _save_reset_counters( ctx ); - ctx->Driver.SaveNeedFlush = 0; -} - -void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - (void) list; (void) mode; - - if (!save->prim_store) - save->prim_store = alloc_prim_store( ctx ); - - if (!save->vertex_store) - save->vertex_store = alloc_vertex_store( ctx ); - - save->vbptr = map_vertex_store( ctx, save->vertex_store ); - - _save_reset_vertex( ctx ); - _save_reset_counters( ctx ); - ctx->Driver.SaveNeedFlush = 0; -} - -void vbo_save_EndList( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - /* EndList called inside a (saved) Begin/End pair? - */ - if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) { - - if (save->prim_count > 0) { - GLint i = save->prim_count - 1; - ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; - save->prim[i].end = 0; - save->prim[i].count = (save->vert_count - - save->prim[i].start); - } - - /* Make sure this vertex list gets replayed by the "loopback" - * mechanism: - */ - save->dangling_attr_ref = 1; - vbo_save_SaveFlushVertices( ctx ); - - /* Swap out this vertex format while outside begin/end. Any color, - * etc. received between here and the next begin will be compiled - * as opcodes. - */ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); - } - - unmap_vertex_store( ctx, save->vertex_store ); - - assert(save->vertex_size == 0); -} - -void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - save->replay_flags |= dlist->flags; -} - -void vbo_save_EndCallList( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - - if (ctx->ListState.CallDepth == 1) { - /* This is correct: want to keep only the VBO_SAVE_FALLBACK - * flag, if it is set: - */ - save->replay_flags &= VBO_SAVE_FALLBACK; - } -} - - -static void vbo_destroy_vertex_list( GLcontext *ctx, void *data ) -{ - struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data; - (void) ctx; - - if ( --node->vertex_store->refcount == 0 ) - free_vertex_store( ctx, node->vertex_store ); - - if ( --node->prim_store->refcount == 0 ) - FREE( node->prim_store ); -} - - -static void vbo_print_vertex_list( GLcontext *ctx, void *data ) -{ - struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data; - GLuint i; - (void) ctx; - - _mesa_debug(NULL, "VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", - node->count, - node->prim_count, - node->vertex_size); - - for (i = 0 ; i < node->prim_count ; i++) { - struct _mesa_prim *prim = &node->prim[i]; - _mesa_debug(NULL, " prim %d: %s%s %d..%d %s %s\n", - i, - _mesa_lookup_enum_by_nr(prim->mode), - prim->weak ? " (weak)" : "", - prim->start, - prim->start + prim->count, - (prim->begin) ? "BEGIN" : "(wrap)", - (prim->end) ? "END" : "(wrap)"); - } -} - - -static void _save_current_init( GLcontext *ctx ) -{ - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLint i; - - for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) { - const GLuint j = i - VBO_ATTRIB_POS; - ASSERT(j < VERT_ATTRIB_MAX); - save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j]; - save->current[i] = ctx->ListState.CurrentAttrib[j]; - } - - for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) { - const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL; - ASSERT(j < MAT_ATTRIB_MAX); - save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j]; - save->current[i] = ctx->ListState.CurrentMaterial[j]; - } -} - -/** - * Initialize the display list compiler - */ -void vbo_save_api_init( struct vbo_save_context *save ) -{ - GLcontext *ctx = save->ctx; - GLuint i; - - save->opcode_vertex_list = - _mesa_alloc_opcode( ctx, - sizeof(struct vbo_save_vertex_list), - vbo_save_playback_vertex_list, - vbo_destroy_vertex_list, - vbo_print_vertex_list ); - - ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin; - - _save_vtxfmt_init( ctx ); - _save_current_init( ctx ); - - /* These will actually get set again when binding/drawing */ - for (i = 0; i < VBO_ATTRIB_MAX; i++) - save->inputs[i] = &save->arrays[i]; - - /* Hook our array functions into the outside-begin-end vtxfmt in - * ctx->ListState. - */ - ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; - ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays; - ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements; - ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -} - diff --git a/src/libs/mesa/mesa/vbo/vbo_save_draw.c b/src/libs/mesa/mesa/vbo/vbo_save_draw.c deleted file mode 100644 index ed40b5c725..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_save_draw.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.2 - * - * Copyright (C) 1999-2008 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. - */ - -/* Author: - * Keith Whitwell - */ - -#include "main/glheader.h" -#include "main/bufferobj.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/light.h" -#include "main/state.h" - -#include "vbo_context.h" - - -/* - * After playback, copy everything but the position from the - * last vertex to the saved state - */ -static void _playback_copy_to_current( GLcontext *ctx, - const struct vbo_save_vertex_list *node ) -{ - struct vbo_context *vbo = vbo_context(ctx); - GLfloat vertex[VBO_ATTRIB_MAX * 4], *data = vertex; - GLuint i, offset; - - if (node->count) - offset = (node->buffer_offset + - (node->count-1) * node->vertex_size * sizeof(GLfloat)); - else - offset = node->buffer_offset; - - ctx->Driver.GetBufferSubData( ctx, 0, offset, - node->vertex_size * sizeof(GLfloat), - data, node->vertex_store->bufferobj ); - - data += node->attrsz[0]; /* skip vertex position */ - - for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { - if (node->attrsz[i]) { - GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; - - COPY_CLEAN_4V(current, - node->attrsz[i], - data); - - vbo->currval[i].Size = node->attrsz[i]; - - data += node->attrsz[i]; - - if (i >= VBO_ATTRIB_FIRST_MATERIAL && - i <= VBO_ATTRIB_LAST_MATERIAL) - ctx->NewState |= _NEW_LIGHT; - } - } - - /* Colormaterial -- this kindof sucks. - */ - if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR0]); - } - - /* CurrentExecPrimitive - */ - if (node->prim_count) { - const struct _mesa_prim *prim = &node->prim[node->prim_count - 1]; - if (prim->end) - ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; - else - ctx->Driver.CurrentExecPrimitive = prim->mode; - } -} - - - -/* Treat the vertex storage as a VBO, define vertex arrays pointing - * into it: - */ -static void vbo_bind_vertex_list( GLcontext *ctx, - const struct vbo_save_vertex_list *node ) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_save_context *save = &vbo->save; - struct gl_client_array *arrays = save->arrays; - GLuint data = node->buffer_offset; - const GLuint *map; - GLuint attr; - GLubyte node_attrsz[VBO_ATTRIB_MAX]; /* copy of node->attrsz[] */ - - memcpy(node_attrsz, node->attrsz, sizeof(node->attrsz)); - - /* Install the default (ie Current) attributes first, then overlay - * all active ones. - */ - switch (get_program_mode(ctx)) { - case VP_NONE: - for (attr = 0; attr < 16; attr++) { - save->inputs[attr] = &vbo->legacy_currval[attr]; - } - for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { - save->inputs[attr + 16] = &vbo->mat_currval[attr]; - } - map = vbo->map_vp_none; - break; - case VP_NV: - case VP_ARB: - /* The aliasing of attributes for NV vertex programs has already - * occurred. NV vertex programs cannot access material values, - * nor attributes greater than VERT_ATTRIB_TEX7. - */ - for (attr = 0; attr < 16; attr++) { - save->inputs[attr] = &vbo->legacy_currval[attr]; - save->inputs[attr + 16] = &vbo->generic_currval[attr]; - } - map = vbo->map_vp_arb; - - /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read. - * In that case we effectively need to route the data from - * glVertexAttrib(0, val) calls to feed into the GENERIC0 input. - */ - if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 && - (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) { - save->inputs[16] = save->inputs[0]; - node_attrsz[16] = node_attrsz[0]; - node_attrsz[0] = 0; - } - break; - default: - assert(0); - } - - for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - GLuint src = map[attr]; - - if (node_attrsz[src]) { - /* override the default array set above */ - save->inputs[attr] = &arrays[attr]; - - arrays[attr].Ptr = (const GLubyte *) data; - arrays[attr].Size = node->attrsz[src]; - arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat); - arrays[attr].Stride = node->vertex_size * sizeof(GLfloat); - arrays[attr].Type = GL_FLOAT; - arrays[attr].Enabled = 1; - _mesa_reference_buffer_object(ctx, - &arrays[attr].BufferObj, - node->vertex_store->bufferobj); - arrays[attr]._MaxElement = node->count; /* ??? */ - - assert(arrays[attr].BufferObj->Name); - - data += node->attrsz[src] * sizeof(GLfloat); - } - } -} - -static void vbo_save_loopback_vertex_list( GLcontext *ctx, - const struct vbo_save_vertex_list *list ) -{ - const char *buffer = ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - GL_READ_ONLY, /* ? */ - list->vertex_store->bufferobj); - - vbo_loopback_vertex_list( ctx, - (const GLfloat *)(buffer + list->buffer_offset), - list->attrsz, - list->prim, - list->prim_count, - list->wrap_count, - list->vertex_size); - - ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, - list->vertex_store->bufferobj); -} - - -/** - * Execute the buffer and save copied verts. - */ -void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ) -{ - const struct vbo_save_vertex_list *node = (const struct vbo_save_vertex_list *) data; - struct vbo_save_context *save = &vbo_context(ctx)->save; - - FLUSH_CURRENT(ctx, 0); - - if (node->prim_count > 0 && node->count > 0) { - - if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END && - node->prim[0].begin) { - - /* Degenerate case: list is called inside begin/end pair and - * includes operations such as glBegin or glDrawArrays. - */ - if (0) - _mesa_printf("displaylist recursive begin"); - - vbo_save_loopback_vertex_list( ctx, node ); - return; - } - else if (save->replay_flags) { - /* Various degnerate cases: translate into immediate mode - * calls rather than trying to execute in place. - */ - vbo_save_loopback_vertex_list( ctx, node ); - return; - } - - if (ctx->NewState) - _mesa_update_state( ctx ); - - /* XXX also need to check if shader enabled, but invalid */ - if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || - (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBegin (invalid vertex/fragment program)"); - return; - } - - vbo_bind_vertex_list( ctx, node ); - - vbo_context(ctx)->draw_prims( ctx, - save->inputs, - node->prim, - node->prim_count, - NULL, - 0, /* Node is a VBO, so this is ok */ - node->count - 1); - } - - /* Copy to current? - */ - _playback_copy_to_current( ctx, node ); -} diff --git a/src/libs/mesa/mesa/vbo/vbo_save_loopback.c b/src/libs/mesa/mesa/vbo/vbo_save_loopback.c deleted file mode 100644 index 92ca4ea95d..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_save_loopback.c +++ /dev/null @@ -1,191 +0,0 @@ -/************************************************************************** - * - * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include "main/context.h" -#include "main/glheader.h" -#include "main/enums.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "glapi/dispatch.h" -#include "glapi/glapi.h" - -#include "vbo_context.h" - - - -typedef void (*attr_func)( GLcontext *ctx, GLint target, const GLfloat * ); - - -/* This file makes heavy use of the aliasing of NV vertex attributes - * with the legacy attributes, and also with ARB and Material - * attributes as currently implemented. - */ -static void VertexAttrib1fvNV(GLcontext *ctx, GLint target, const GLfloat *v) -{ - CALL_VertexAttrib1fvNV(ctx->Exec, (target, v)); -} - -static void VertexAttrib2fvNV(GLcontext *ctx, GLint target, const GLfloat *v) -{ - CALL_VertexAttrib2fvNV(ctx->Exec, (target, v)); -} - -static void VertexAttrib3fvNV(GLcontext *ctx, GLint target, const GLfloat *v) -{ - CALL_VertexAttrib3fvNV(ctx->Exec, (target, v)); -} - -static void VertexAttrib4fvNV(GLcontext *ctx, GLint target, const GLfloat *v) -{ - CALL_VertexAttrib4fvNV(ctx->Exec, (target, v)); -} - -static attr_func vert_attrfunc[4] = { - VertexAttrib1fvNV, - VertexAttrib2fvNV, - VertexAttrib3fvNV, - VertexAttrib4fvNV -}; - -struct loopback_attr { - GLint target; - GLint sz; - attr_func func; -}; - -/* Don't emit ends and begins on wrapped primitives. Don't replay - * wrapped vertices. If we get here, it's probably because the the - * precalculated wrapping is wrong. - */ -static void loopback_prim( GLcontext *ctx, - const GLfloat *buffer, - const struct _mesa_prim *prim, - GLuint wrap_count, - GLuint vertex_size, - const struct loopback_attr *la, GLuint nr ) -{ - GLint start = prim->start; - GLint end = start + prim->count; - const GLfloat *data; - GLint j; - GLuint k; - - if (0) - _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n", - _mesa_lookup_enum_by_nr(prim->mode), - prim->begin ? "begin" : "..", - prim->end ? "end" : "..", - start, - end); - - if (prim->begin) { - CALL_Begin(GET_DISPATCH(), ( prim->mode )); - } - else { - assert(start == 0); - start += wrap_count; - } - - data = buffer + start * vertex_size; - - for (j = start ; j < end ; j++) { - const GLfloat *tmp = data + la[0].sz; - - for (k = 1 ; k < nr ; k++) { - la[k].func( ctx, la[k].target, tmp ); - tmp += la[k].sz; - } - - /* Fire the vertex - */ - la[0].func( ctx, VBO_ATTRIB_POS, data ); - data = tmp; - } - - if (prim->end) { - CALL_End(GET_DISPATCH(), ()); - } -} - -/* Primitives generated by DrawArrays/DrawElements/Rectf may be - * caught here. If there is no primitive in progress, execute them - * normally, otherwise need to track and discard the generated - * primitives. - */ -static void loopback_weak_prim( GLcontext *ctx, - const struct _mesa_prim *prim ) -{ - /* Use the prim_weak flag to ensure that if this primitive - * wraps, we don't mistake future vertex_lists for part of the - * surrounding primitive. - * - * While this flag is set, we are simply disposing of data - * generated by an operation now known to be a noop. - */ - if (prim->begin) - ctx->Driver.CurrentExecPrimitive |= VBO_SAVE_PRIM_WEAK; - if (prim->end) - ctx->Driver.CurrentExecPrimitive &= ~VBO_SAVE_PRIM_WEAK; -} - - -void vbo_loopback_vertex_list( GLcontext *ctx, - const GLfloat *buffer, - const GLubyte *attrsz, - const struct _mesa_prim *prim, - GLuint prim_count, - GLuint wrap_count, - GLuint vertex_size) -{ - struct loopback_attr la[VBO_ATTRIB_MAX]; - GLuint i, nr = 0; - - /* All Legacy, NV, ARB and Material attributes are routed through - * the NV attributes entrypoints: - */ - for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { - if (attrsz[i]) { - la[nr].target = i; - la[nr].sz = attrsz[i]; - la[nr].func = vert_attrfunc[attrsz[i]-1]; - nr++; - } - } - - for (i = 0 ; i < prim_count ; i++) { - if ((prim[i].mode & VBO_SAVE_PRIM_WEAK) && - (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END)) - { - loopback_weak_prim( ctx, &prim[i] ); - } - else - { - loopback_prim( ctx, buffer, &prim[i], wrap_count, vertex_size, la, nr ); - } - } -} diff --git a/src/libs/mesa/mesa/vbo/vbo_split.c b/src/libs/mesa/mesa/vbo/vbo_split.c deleted file mode 100644 index 58e879628d..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_split.c +++ /dev/null @@ -1,161 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - -/* Deal with hardware and/or swtnl maximums: - * - maximum number of vertices in buffer - * - maximum number of elements (maybe zero) - * - * The maximums may vary with opengl state (eg if a larger hardware - * vertex is required in this state, the maximum number of vertices - * may be smaller than in another state). - * - * We want buffer splitting to be a convenience function for the code - * actually drawing the primitives rather than a system-wide maximum, - * otherwise it is hard to avoid pessimism. - * - * For instance, if a driver has no hardware limits on vertex buffer - * dimensions, it would not ordinarily want to split vbos. But if - * there is an unexpected fallback, eg memory manager fails to upload - * textures, it will want to pass the drawing commands onto swtnl, - * which does have limitations. A convenience function allows swtnl - * to split the drawing and vbos internally without imposing its - * limitations on drivers which want to use it as a fallback path. - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "vbo_split.h" -#include "vbo.h" - -/* True if a primitive can be split without copying of vertices, false - * otherwise. - */ -GLboolean split_prim_inplace(GLenum mode, GLuint *first, GLuint *incr) -{ - switch (mode) { - case GL_POINTS: - *first = 1; - *incr = 1; - return GL_TRUE; - case GL_LINES: - *first = 2; - *incr = 2; - return GL_TRUE; - case GL_LINE_STRIP: - *first = 2; - *incr = 1; - return GL_TRUE; - case GL_TRIANGLES: - *first = 3; - *incr = 3; - return GL_TRUE; - case GL_TRIANGLE_STRIP: - *first = 3; - *incr = 1; - return GL_TRUE; - case GL_QUADS: - *first = 4; - *incr = 4; - return GL_TRUE; - case GL_QUAD_STRIP: - *first = 4; - *incr = 2; - return GL_TRUE; - default: - *first = 0; - *incr = 1; /* so that count % incr works */ - return GL_FALSE; - } -} - - - -void vbo_split_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw, - const struct split_limits *limits ) -{ - - if (ib) { - if (limits->max_indices == 0) { - /* Could traverse the indices, re-emitting vertices in turn. - * But it's hard to see why this case would be needed - for - * software tnl, it is better to convert to non-indexed - * rendering after transformation is complete, as is done in - * the t_dd_rendertmp.h templates. Are there any devices - * with hardware tnl that cannot do indexed rendering? - * - * For now, this path is disabled. - */ - assert(0); - } - else if (max_index - min_index >= limits->max_verts) { - /* The vertex buffers are too large for hardware (or the - * swtnl module). Traverse the indices, re-emitting vertices - * in turn. Use a vertex cache to preserve some of the - * sharing from the original index list. - */ - vbo_split_copy(ctx, arrays, prim, nr_prims, ib, - draw, limits ); - } - else if (ib->count > limits->max_indices) { - /* The index buffer is too large for hardware. Try to split - * on whole-primitive boundaries, otherwise try to split the - * individual primitives. - */ - vbo_split_inplace(ctx, arrays, prim, nr_prims, ib, - min_index, max_index, draw, limits ); - } - else { - /* Why were we called? */ - assert(0); - } - } - else { - if (max_index - min_index >= limits->max_verts) { - /* The vertex buffer is too large for hardware (or the swtnl - * module). Try to split on whole-primitive boundaries, - * otherwise try to split the individual primitives. - */ - vbo_split_inplace(ctx, arrays, prim, nr_prims, ib, - min_index, max_index, draw, limits ); - } - else { - /* Why were we called? */ - assert(0); - } - } -} - diff --git a/src/libs/mesa/mesa/vbo/vbo_split.h b/src/libs/mesa/mesa/vbo/vbo_split.h deleted file mode 100644 index 05888d048c..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_split.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file vbo_context.h - * \brief VBO builder module datatypes and definitions. - * \author Keith Whitwell - */ - - -/** - * \mainpage The VBO splitter - * - * This is the private data used internally to the vbo_split_prims() - * helper function. Nobody outside the vbo_split* files needs to - * include or know about this structure. - */ - - -#ifndef _VBO_SPLIT_H -#define _VBO_SPLIT_H - -#include "vbo.h" - - -/* True if a primitive can be split without copying of vertices, false - * otherwise. - */ -GLboolean split_prim_inplace(GLenum mode, GLuint *first, GLuint *incr); - -void vbo_split_inplace( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw, - const struct split_limits *limits ); - -/* Requires ib != NULL: - */ -void vbo_split_copy( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - vbo_draw_func draw, - const struct split_limits *limits ); - -#endif diff --git a/src/libs/mesa/mesa/vbo/vbo_split_copy.c b/src/libs/mesa/mesa/vbo/vbo_split_copy.c deleted file mode 100644 index 685cc0fdf6..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_split_copy.c +++ /dev/null @@ -1,558 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - -/* Split indexed primitives with per-vertex copying. - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/enums.h" -#include "main/mtypes.h" - -#include "vbo_split.h" -#include "vbo.h" - - -#define ELT_TABLE_SIZE 16 - -/* Used for vertex-level splitting of indexed buffers. Note that - * non-indexed primitives may be converted to indexed in some cases - * (eg loops, fans) in order to use this splitting path. - */ -struct copy_context { - - GLcontext *ctx; - const struct gl_client_array **array; - const struct _mesa_prim *prim; - GLuint nr_prims; - const struct _mesa_index_buffer *ib; - vbo_draw_func draw; - - const struct split_limits *limits; - - struct { - GLuint attr; - GLuint size; - const struct gl_client_array *array; - const GLubyte *src_ptr; - - struct gl_client_array dstarray; - - } varying[VERT_ATTRIB_MAX]; - GLuint nr_varying; - - const struct gl_client_array *dstarray_ptr[VERT_ATTRIB_MAX]; - struct _mesa_index_buffer dstib; - - GLuint *translated_elt_buf; - const GLuint *srcelt; - - /* A baby hash table to avoid re-emitting (some) duplicate - * vertices when splitting indexed primitives. - */ - struct { - GLuint in; - GLuint out; - } vert_cache[ELT_TABLE_SIZE]; - - - GLuint vertex_size; - GLubyte *dstbuf; - GLubyte *dstptr; /* dstptr == dstbuf + dstelt_max * vertsize */ - GLuint dstbuf_size; /* in vertices */ - GLuint dstbuf_nr; /* count of emitted vertices, also the - * largest value in dstelt. Our - * MaxIndex. - */ - - GLuint *dstelt; - GLuint dstelt_nr; - GLuint dstelt_size; - -#define MAX_PRIM 32 - struct _mesa_prim dstprim[MAX_PRIM]; - GLuint dstprim_nr; - -}; - - -static GLuint type_size( GLenum type ) -{ - switch(type) { - case GL_BYTE: return sizeof(GLbyte); - case GL_UNSIGNED_BYTE: return sizeof(GLubyte); - case GL_SHORT: return sizeof(GLshort); - case GL_UNSIGNED_SHORT: return sizeof(GLushort); - case GL_INT: return sizeof(GLint); - case GL_UNSIGNED_INT: return sizeof(GLuint); - case GL_FLOAT: return sizeof(GLfloat); - case GL_DOUBLE: return sizeof(GLdouble); - default: return 0; - } -} - -static GLuint attr_size( const struct gl_client_array *array ) -{ - return array->Size * type_size(array->Type); -} - - -/* Starts returning true slightly before the buffer fills, to ensure - * that there is sufficient room for any remaining vertices to finish - * off the prim: - */ -static GLboolean check_flush( struct copy_context *copy ) -{ - GLenum mode = copy->dstprim[copy->dstprim_nr].mode; - - if (GL_TRIANGLE_STRIP == mode && - copy->dstelt_nr & 1) { /* see bug9962 */ - return GL_FALSE; - } - - if (copy->dstbuf_nr + 4 > copy->dstbuf_size) - return GL_TRUE; - - if (copy->dstelt_nr + 4 > copy->dstelt_size) - return GL_TRUE; - - return GL_FALSE; -} - -static void flush( struct copy_context *copy ) -{ - GLuint i; - - /* Set some counters: - */ - copy->dstib.count = copy->dstelt_nr; - - copy->draw( copy->ctx, - copy->dstarray_ptr, - copy->dstprim, - copy->dstprim_nr, - ©->dstib, - 0, - copy->dstbuf_nr ); - - /* Reset all pointers: - */ - copy->dstprim_nr = 0; - copy->dstelt_nr = 0; - copy->dstbuf_nr = 0; - copy->dstptr = copy->dstbuf; - - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy->vert_cache[i].in = ~0; -} - - - -static void begin( struct copy_context *copy, GLenum mode, GLboolean begin_flag ) -{ - struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr]; - -/* _mesa_printf("begin %s (%d)\n", _mesa_lookup_enum_by_nr(mode), begin_flag); */ - - prim->mode = mode; - prim->begin = begin_flag; -} - - -/* Use a hashtable to attempt to identify recently-emitted vertices - * and avoid re-emitting them. - */ -static GLuint elt(struct copy_context *copy, GLuint elt_idx) -{ - GLuint elt = copy->srcelt[elt_idx]; - GLuint slot = elt & (ELT_TABLE_SIZE-1); - -/* _mesa_printf("elt %d\n", elt); */ - - /* Look up the incoming element in the vertex cache. Re-emit if - * necessary. - */ - if (copy->vert_cache[slot].in != elt) { - GLubyte *csr = copy->dstptr; - GLuint i; - -/* _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */ - - for (i = 0; i < copy->nr_varying; i++) { - const struct gl_client_array *srcarray = copy->varying[i].array; - const GLubyte *srcptr = copy->varying[i].src_ptr + elt * srcarray->StrideB; - - memcpy(csr, srcptr, copy->varying[i].size); - csr += copy->varying[i].size; - - if (0) - { - const GLuint *f = (const GLuint *)srcptr; - GLuint j; - _mesa_printf(" varying %d: ", i); - for(j = 0; j < copy->varying[i].size / 4; j++) - _mesa_printf("%x ", f[j]); - _mesa_printf("\n"); - } - - } - - copy->vert_cache[slot].in = elt; - copy->vert_cache[slot].out = copy->dstbuf_nr++; - copy->dstptr += copy->vertex_size; - - assert(csr == copy->dstptr); - assert(copy->dstptr == (copy->dstbuf + - copy->dstbuf_nr * - copy->vertex_size)); - } -/* else */ -/* _mesa_printf(" --> reuse vertex\n"); */ - -/* _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out); */ - copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out; - return check_flush(copy); -} - -static void end( struct copy_context *copy, GLboolean end_flag ) -{ - struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr]; - -/* _mesa_printf("end (%d)\n", end_flag); */ - - prim->end = end_flag; - prim->count = copy->dstelt_nr - prim->start; - - if (++copy->dstprim_nr == MAX_PRIM || - check_flush(copy)) - flush(copy); -} - - - -static void replay_elts( struct copy_context *copy ) -{ - GLuint i, j, k; - GLboolean split; - - for (i = 0; i < copy->nr_prims; i++) { - const struct _mesa_prim *prim = ©->prim[i]; - const GLuint start = prim->start; - GLuint first, incr; - - switch (prim->mode) { - - case GL_LINE_LOOP: - /* Convert to linestrip and emit the final vertex explicitly, - * but only in the resultant strip that requires it. - */ - j = 0; - while (j != prim->count) { - begin(copy, GL_LINE_STRIP, prim->begin && j == 0); - - for (split = GL_FALSE; j != prim->count && !split; j++) - split = elt(copy, start + j); - - if (j == prim->count) { - /* Done, emit final line. Split doesn't matter as - * it is always raised a bit early so we can emit - * the last verts if necessary! - */ - if (prim->end) - (void)elt(copy, start + 0); - - end(copy, prim->end); - } - else { - /* Wrap - */ - assert(split); - end(copy, 0); - j--; - } - } - break; - - case GL_TRIANGLE_FAN: - case GL_POLYGON: - j = 2; - while (j != prim->count) { - begin(copy, prim->mode, prim->begin && j == 0); - - split = elt(copy, start+0); - assert(!split); - - split = elt(copy, start+j-1); - assert(!split); - - for (; j != prim->count && !split; j++) - split = elt(copy, start+j); - - end(copy, prim->end && j == prim->count); - - if (j != prim->count) { - /* Wrapped the primitive, need to repeat some vertices: - */ - j -= 1; - } - } - break; - - default: - (void)split_prim_inplace(prim->mode, &first, &incr); - - j = 0; - while (j != prim->count) { - - begin(copy, prim->mode, prim->begin && j == 0); - - split = 0; - for (k = 0; k < first; k++, j++) - split |= elt(copy, start+j); - - assert(!split); - - for (; j != prim->count && !split; ) - for (k = 0; k < incr; k++, j++) - split |= elt(copy, start+j); - - end(copy, prim->end && j == prim->count); - - if (j != prim->count) { - /* Wrapped the primitive, need to repeat some vertices: - */ - assert(j > first - incr); - j -= (first - incr); - } - } - break; - } - } - - if (copy->dstprim_nr) - flush(copy); -} - - -static void replay_init( struct copy_context *copy ) -{ - GLcontext *ctx = copy->ctx; - GLuint i; - GLuint offset; - const GLvoid *srcptr; - - /* Make a list of varying attributes and their vbo's. Also - * calculate vertex size. - */ - copy->vertex_size = 0; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - struct gl_buffer_object *vbo = copy->array[i]->BufferObj; - - if (copy->array[i]->StrideB == 0) { - copy->dstarray_ptr[i] = copy->array[i]; - } - else { - GLuint j = copy->nr_varying++; - - copy->varying[j].attr = i; - copy->varying[j].array = copy->array[i]; - copy->varying[j].size = attr_size(copy->array[i]); - copy->vertex_size += attr_size(copy->array[i]); - - if (vbo->Name && !vbo->Pointer) - ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - GL_WRITE_ONLY, /* XXX */ - vbo); - - copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer, - copy->array[i]->Ptr); - - copy->dstarray_ptr[i] = ©->varying[j].dstarray; - } - } - - /* There must always be an index buffer. Currently require the - * caller convert non-indexed prims to indexed. Could alternately - * do it internally. - */ - if (copy->ib->obj->Name && !copy->ib->obj->Pointer) - ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, /* XXX */ - GL_WRITE_ONLY, /* XXX */ - copy->ib->obj); - - srcptr = (const GLubyte *)ADD_POINTERS(copy->ib->obj->Pointer, copy->ib->ptr); - - switch (copy->ib->type) { - case GL_UNSIGNED_BYTE: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); - copy->srcelt = copy->translated_elt_buf; - - for (i = 0; i < copy->ib->count; i++) - copy->translated_elt_buf[i] = ((const GLubyte *)srcptr)[i]; - break; - - case GL_UNSIGNED_SHORT: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); - copy->srcelt = copy->translated_elt_buf; - - for (i = 0; i < copy->ib->count; i++) - copy->translated_elt_buf[i] = ((const GLushort *)srcptr)[i]; - break; - - case GL_UNSIGNED_INT: - copy->translated_elt_buf = NULL; - copy->srcelt = (const GLuint *)srcptr; - break; - } - - - /* Figure out the maximum allowed vertex buffer size: - */ - if (copy->vertex_size * copy->limits->max_verts <= copy->limits->max_vb_size) { - copy->dstbuf_size = copy->limits->max_verts; - } - else { - copy->dstbuf_size = copy->limits->max_vb_size / copy->vertex_size; - } - - /* Allocate an output vertex buffer: - * - * XXX: This should be a VBO! - */ - copy->dstbuf = _mesa_malloc(copy->dstbuf_size * - copy->vertex_size); - copy->dstptr = copy->dstbuf; - - /* Setup new vertex arrays to point into the output buffer: - */ - for (offset = 0, i = 0; i < copy->nr_varying; i++) { - const struct gl_client_array *src = copy->varying[i].array; - struct gl_client_array *dst = ©->varying[i].dstarray; - - dst->Size = src->Size; - dst->Type = src->Type; - dst->Stride = copy->vertex_size; - dst->StrideB = copy->vertex_size; - dst->Ptr = copy->dstbuf + offset; - dst->Enabled = GL_TRUE; - dst->Normalized = src->Normalized; - dst->BufferObj = ctx->Array.NullBufferObj; - dst->_MaxElement = copy->dstbuf_size; /* may be less! */ - - offset += copy->varying[i].size; - } - - /* Allocate an output element list: - */ - copy->dstelt_size = MIN2(65536, - copy->ib->count * 2 + 3); - copy->dstelt_size = MIN2(copy->dstelt_size, - copy->limits->max_indices); - copy->dstelt = _mesa_malloc(sizeof(GLuint) * copy->dstelt_size); - copy->dstelt_nr = 0; - - /* Setup the new index buffer to point to the allocated element - * list: - */ - copy->dstib.count = 0; /* duplicates dstelt_nr */ - copy->dstib.type = GL_UNSIGNED_INT; - copy->dstib.obj = ctx->Array.NullBufferObj; - copy->dstib.ptr = copy->dstelt; -} - - -static void replay_finish( struct copy_context *copy ) -{ - GLcontext *ctx = copy->ctx; - GLuint i; - - /* Free our vertex and index buffers: - */ - _mesa_free(copy->translated_elt_buf); - _mesa_free(copy->dstbuf); - _mesa_free(copy->dstelt); - - /* Unmap VBO's - */ - for (i = 0; i < copy->nr_varying; i++) { - struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj; - - if (vbo->Name && vbo->Pointer) - ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, vbo); - } - - /* Unmap index buffer: - */ - if (copy->ib->obj->Name && copy->ib->obj->Pointer) { - ctx->Driver.UnmapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, /* XXX */ - copy->ib->obj); - } -} - -void vbo_split_copy( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - vbo_draw_func draw, - const struct split_limits *limits ) -{ - struct copy_context copy; - GLuint i; - - memset(©, 0, sizeof(copy)); - - /* Require indexed primitives: - */ - assert(ib); - - copy.ctx = ctx; - copy.array = arrays; - copy.prim = prim; - copy.nr_prims = nr_prims; - copy.ib = ib; - copy.draw = draw; - copy.limits = limits; - - - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy.vert_cache[i].in = ~0; - - - replay_init(©); - replay_elts(©); - replay_finish(©); -} diff --git a/src/libs/mesa/mesa/vbo/vbo_split_inplace.c b/src/libs/mesa/mesa/vbo/vbo_split_inplace.c deleted file mode 100644 index fbc856e93b..0000000000 --- a/src/libs/mesa/mesa/vbo/vbo_split_inplace.c +++ /dev/null @@ -1,286 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Keith Whitwell - */ - - -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/enums.h" -#include "vbo_split.h" - - -#define MAX_PRIM 32 - -/* Used for splitting without copying. - */ -struct split_context { - GLcontext *ctx; - const struct gl_client_array **array; - const struct _mesa_prim *prim; - GLuint nr_prims; - const struct _mesa_index_buffer *ib; - GLuint min_index; - GLuint max_index; - vbo_draw_func draw; - - const struct split_limits *limits; - - struct _mesa_prim dstprim[MAX_PRIM]; - GLuint dstprim_nr; -}; - - - - -static void flush_vertex( struct split_context *split ) -{ - GLuint min_index, max_index; - - if (!split->dstprim_nr) - return; - - if (split->ib) { - /* This should basically be multipass rendering over the same - * unchanging set of VBO's. Would like the driver not to - * re-upload the data, or swtnl not to re-transform the - * vertices. - */ - assert(split->max_index - split->min_index < split->limits->max_verts); - min_index = split->min_index; - max_index = split->max_index; - } - else { - /* Non-indexed rendering. Cannot assume that the primitives are - * ordered by increasing vertex, because of entrypoints like - * MultiDrawArrays. - */ - GLuint i; - min_index = split->dstprim[0].start; - max_index = min_index + split->dstprim[0].count - 1; - - for (i = 1; i < split->dstprim_nr; i++) { - GLuint tmp_min = split->dstprim[i].start; - GLuint tmp_max = tmp_min + split->dstprim[i].count - 1; - - if (tmp_min < min_index) - min_index = tmp_min; - - if (tmp_max > max_index) - max_index = tmp_max; - } - } - - assert(max_index >= min_index); - - split->draw( split->ctx, - split->array, - split->dstprim, - split->dstprim_nr, - NULL, - min_index, - max_index); - - split->dstprim_nr = 0; -} - - -static struct _mesa_prim *next_outprim( struct split_context *split ) -{ - if (split->dstprim_nr == MAX_PRIM-1) { - flush_vertex(split); - } - - { - struct _mesa_prim *prim = &split->dstprim[split->dstprim_nr++]; - memset(prim, 0, sizeof(*prim)); - return prim; - } -} - -static int align(int value, int alignment) -{ - return (value + alignment - 1) & ~(alignment - 1); -} - - - -/* Break large primitives into smaller ones. If not possible, convert - * the primitive to indexed and pass to split_elts(). - */ -static void split_prims( struct split_context *split) -{ - GLuint csr = 0; - GLuint i; - - for (i = 0; i < split->nr_prims; i++) { - const struct _mesa_prim *prim = &split->prim[i]; - GLuint first, incr; - GLboolean split_inplace = split_prim_inplace(prim->mode, &first, &incr); - GLuint count; - - /* Always wrap on an even numbered vertex to avoid problems with - * triangle strips. - */ - GLuint available = align(split->limits->max_verts - csr - 1, 2); - assert(split->limits->max_verts >= csr); - - if (prim->count < first) - continue; - - count = prim->count - (prim->count - first) % incr; - - - if ((available < count && !split_inplace) || - (available < first && split_inplace)) { - flush_vertex(split); - csr = 0; - available = align(split->limits->max_verts - csr - 1, 2); - } - - if (available >= count) { - struct _mesa_prim *outprim = next_outprim(split); - *outprim = *prim; - csr += prim->count; - available = align(split->limits->max_verts - csr - 1, 2); - } - else if (split_inplace) { - GLuint j, nr; - - - for (j = 0 ; j < count ; ) { - GLuint remaining = count - j; - struct _mesa_prim *outprim = next_outprim(split); - - nr = MIN2( available, remaining ); - - nr -= (nr - first) % incr; - - outprim->mode = prim->mode; - outprim->begin = (j == 0 && prim->begin); - outprim->end = (nr == remaining && prim->end); - outprim->start = prim->start + j; - outprim->count = nr; - - if (nr == remaining) { - /* Finished. - */ - j += nr; - csr += nr; - available = align(split->limits->max_verts - csr - 1, 2); - } - else { - /* Wrapped the primitive: - */ - j += nr - (first - incr); - flush_vertex(split); - csr = 0; - available = align(split->limits->max_verts - csr - 1, 2); - } - } - } - else if (split->ib == NULL) { - /* XXX: could at least send the first max_verts off from the - * inplace buffers. - */ - - /* else convert to indexed primitive and pass to split_elts, - * which will do the necessary copying and turn it back into a - * vertex primitive for rendering... - */ - struct _mesa_index_buffer ib; - struct _mesa_prim tmpprim; - GLuint *elts = malloc(count * sizeof(GLuint)); - GLuint j; - - for (j = 0; j < count; j++) - elts[j] = prim->start + j; - - ib.count = count; - ib.type = GL_UNSIGNED_INT; - ib.obj = split->ctx->Array.NullBufferObj; - ib.ptr = elts; - - tmpprim = *prim; - tmpprim.indexed = 1; - tmpprim.start = 0; - tmpprim.count = count; - - flush_vertex(split); - - vbo_split_copy(split->ctx, - split->array, - &tmpprim, 1, - &ib, - split->draw, - split->limits); - - free(elts); - } - else { - flush_vertex(split); - - vbo_split_copy(split->ctx, - split->array, - prim, 1, - split->ib, - split->draw, - split->limits); - } - } - - flush_vertex(split); -} - - -void vbo_split_inplace( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index, - vbo_draw_func draw, - const struct split_limits *limits ) -{ - struct split_context split; - - memset(&split, 0, sizeof(split)); - - split.ctx = ctx; - split.array = arrays; - split.prim = prim; - split.nr_prims = nr_prims; - split.ib = ib; - split.min_index = min_index; - split.max_index = max_index; - split.draw = draw; - split.limits = limits; - - split_prims( &split ); -} - - diff --git a/src/libs/mesa/mesa/x86-64/glapi_x86-64.S b/src/libs/mesa/mesa/x86-64/glapi_x86-64.S deleted file mode 100644 index cb34061b36..0000000000 --- a/src/libs/mesa/mesa/x86-64/glapi_x86-64.S +++ /dev/null @@ -1,29422 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_x86-64_asm.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * IBM, - * AND/OR THEIR 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. - */ - -/* If we build with gcc's -fvisibility=hidden flag, we'll need to change - * the symbol visibility mode to 'default'. - */ - -#include "../x86/assyntax.h" - -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 -# pragma GCC visibility push(default) -# define HIDDEN(x) .hidden x -#else -# define HIDDEN(x) -#endif - -# if defined(USE_MGL_NAMESPACE) -# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n)) -# define _glapi_Dispatch _mglapi_Dispatch -# else -# define GL_PREFIX(n) GLNAME(CONCAT(gl,n)) -# endif - -#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) -# define THREADS -#endif - - .text - -#ifdef GLX_USE_TLS - - .globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch) -_x86_64_get_get_dispatch: - lea _x86_64_get_dispatch(%rip), %rax - ret - - .p2align 4,,15 -_x86_64_get_dispatch: - movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax - movq %fs:(%rax), %rax - ret - .size _x86_64_get_dispatch, .-_x86_64_get_dispatch - -#elif defined(PTHREADS) - - .extern _glapi_Dispatch - .extern _gl_DispatchTSD - .extern pthread_getspecific - - .p2align 4,,15 -_x86_64_get_dispatch: - movq _gl_DispatchTSD(%rip), %rdi - jmp pthread_getspecific@PLT - -#elif defined(THREADS) - - .extern _glapi_get_dispatch - -#endif - - .p2align 4,,15 - .globl GL_PREFIX(NewList) - .type GL_PREFIX(NewList), @function -GL_PREFIX(NewList): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 0(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq (%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 0(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 0(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(NewList), .-GL_PREFIX(NewList) - - .p2align 4,,15 - .globl GL_PREFIX(EndList) - .type GL_PREFIX(EndList), @function -GL_PREFIX(EndList): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 8(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 8(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 8(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 8(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EndList), .-GL_PREFIX(EndList) - - .p2align 4,,15 - .globl GL_PREFIX(CallList) - .type GL_PREFIX(CallList), @function -GL_PREFIX(CallList): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 16(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 16(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 16(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 16(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CallList), .-GL_PREFIX(CallList) - - .p2align 4,,15 - .globl GL_PREFIX(CallLists) - .type GL_PREFIX(CallLists), @function -GL_PREFIX(CallLists): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 24(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 24(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 24(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 24(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CallLists), .-GL_PREFIX(CallLists) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteLists) - .type GL_PREFIX(DeleteLists), @function -GL_PREFIX(DeleteLists): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 32(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 32(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 32(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 32(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteLists), .-GL_PREFIX(DeleteLists) - - .p2align 4,,15 - .globl GL_PREFIX(GenLists) - .type GL_PREFIX(GenLists), @function -GL_PREFIX(GenLists): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 40(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 40(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 40(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 40(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenLists), .-GL_PREFIX(GenLists) - - .p2align 4,,15 - .globl GL_PREFIX(ListBase) - .type GL_PREFIX(ListBase), @function -GL_PREFIX(ListBase): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 48(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 48(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 48(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 48(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ListBase), .-GL_PREFIX(ListBase) - - .p2align 4,,15 - .globl GL_PREFIX(Begin) - .type GL_PREFIX(Begin), @function -GL_PREFIX(Begin): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 56(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 56(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 56(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 56(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Begin), .-GL_PREFIX(Begin) - - .p2align 4,,15 - .globl GL_PREFIX(Bitmap) - .type GL_PREFIX(Bitmap), @function -GL_PREFIX(Bitmap): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 64(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - movq %rdx, 48(%rsp) - call _x86_64_get_dispatch@PLT - movq 48(%rsp), %rdx - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 64(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 64(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - movq %rdx, 48(%rsp) - call _glapi_get_dispatch - movq 48(%rsp), %rdx - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 64(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Bitmap), .-GL_PREFIX(Bitmap) - - .p2align 4,,15 - .globl GL_PREFIX(Color3b) - .type GL_PREFIX(Color3b), @function -GL_PREFIX(Color3b): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 72(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 72(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 72(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 72(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3b), .-GL_PREFIX(Color3b) - - .p2align 4,,15 - .globl GL_PREFIX(Color3bv) - .type GL_PREFIX(Color3bv), @function -GL_PREFIX(Color3bv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 80(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 80(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 80(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 80(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3bv), .-GL_PREFIX(Color3bv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3d) - .type GL_PREFIX(Color3d), @function -GL_PREFIX(Color3d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 88(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 88(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 88(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 88(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3d), .-GL_PREFIX(Color3d) - - .p2align 4,,15 - .globl GL_PREFIX(Color3dv) - .type GL_PREFIX(Color3dv), @function -GL_PREFIX(Color3dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 96(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 96(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 96(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 96(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3dv), .-GL_PREFIX(Color3dv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3f) - .type GL_PREFIX(Color3f), @function -GL_PREFIX(Color3f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 104(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3f), .-GL_PREFIX(Color3f) - - .p2align 4,,15 - .globl GL_PREFIX(Color3fv) - .type GL_PREFIX(Color3fv), @function -GL_PREFIX(Color3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3fv), .-GL_PREFIX(Color3fv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3i) - .type GL_PREFIX(Color3i), @function -GL_PREFIX(Color3i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3i), .-GL_PREFIX(Color3i) - - .p2align 4,,15 - .globl GL_PREFIX(Color3iv) - .type GL_PREFIX(Color3iv), @function -GL_PREFIX(Color3iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3iv), .-GL_PREFIX(Color3iv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3s) - .type GL_PREFIX(Color3s), @function -GL_PREFIX(Color3s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 136(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3s), .-GL_PREFIX(Color3s) - - .p2align 4,,15 - .globl GL_PREFIX(Color3sv) - .type GL_PREFIX(Color3sv), @function -GL_PREFIX(Color3sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3sv), .-GL_PREFIX(Color3sv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3ub) - .type GL_PREFIX(Color3ub), @function -GL_PREFIX(Color3ub): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 152(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3ub), .-GL_PREFIX(Color3ub) - - .p2align 4,,15 - .globl GL_PREFIX(Color3ubv) - .type GL_PREFIX(Color3ubv), @function -GL_PREFIX(Color3ubv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 160(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3ubv), .-GL_PREFIX(Color3ubv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3ui) - .type GL_PREFIX(Color3ui), @function -GL_PREFIX(Color3ui): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3ui), .-GL_PREFIX(Color3ui) - - .p2align 4,,15 - .globl GL_PREFIX(Color3uiv) - .type GL_PREFIX(Color3uiv), @function -GL_PREFIX(Color3uiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3uiv), .-GL_PREFIX(Color3uiv) - - .p2align 4,,15 - .globl GL_PREFIX(Color3us) - .type GL_PREFIX(Color3us), @function -GL_PREFIX(Color3us): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3us), .-GL_PREFIX(Color3us) - - .p2align 4,,15 - .globl GL_PREFIX(Color3usv) - .type GL_PREFIX(Color3usv), @function -GL_PREFIX(Color3usv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color3usv), .-GL_PREFIX(Color3usv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4b) - .type GL_PREFIX(Color4b), @function -GL_PREFIX(Color4b): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 200(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4b), .-GL_PREFIX(Color4b) - - .p2align 4,,15 - .globl GL_PREFIX(Color4bv) - .type GL_PREFIX(Color4bv), @function -GL_PREFIX(Color4bv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4bv), .-GL_PREFIX(Color4bv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4d) - .type GL_PREFIX(Color4d), @function -GL_PREFIX(Color4d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 216(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4d), .-GL_PREFIX(Color4d) - - .p2align 4,,15 - .globl GL_PREFIX(Color4dv) - .type GL_PREFIX(Color4dv), @function -GL_PREFIX(Color4dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 224(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4dv), .-GL_PREFIX(Color4dv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4f) - .type GL_PREFIX(Color4f), @function -GL_PREFIX(Color4f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 232(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4f), .-GL_PREFIX(Color4f) - - .p2align 4,,15 - .globl GL_PREFIX(Color4fv) - .type GL_PREFIX(Color4fv), @function -GL_PREFIX(Color4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4fv), .-GL_PREFIX(Color4fv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4i) - .type GL_PREFIX(Color4i), @function -GL_PREFIX(Color4i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4i), .-GL_PREFIX(Color4i) - - .p2align 4,,15 - .globl GL_PREFIX(Color4iv) - .type GL_PREFIX(Color4iv), @function -GL_PREFIX(Color4iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4iv), .-GL_PREFIX(Color4iv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4s) - .type GL_PREFIX(Color4s), @function -GL_PREFIX(Color4s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4s), .-GL_PREFIX(Color4s) - - .p2align 4,,15 - .globl GL_PREFIX(Color4sv) - .type GL_PREFIX(Color4sv), @function -GL_PREFIX(Color4sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 272(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4sv), .-GL_PREFIX(Color4sv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4ub) - .type GL_PREFIX(Color4ub), @function -GL_PREFIX(Color4ub): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4ub), .-GL_PREFIX(Color4ub) - - .p2align 4,,15 - .globl GL_PREFIX(Color4ubv) - .type GL_PREFIX(Color4ubv), @function -GL_PREFIX(Color4ubv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 288(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4ubv), .-GL_PREFIX(Color4ubv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4ui) - .type GL_PREFIX(Color4ui), @function -GL_PREFIX(Color4ui): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4ui), .-GL_PREFIX(Color4ui) - - .p2align 4,,15 - .globl GL_PREFIX(Color4uiv) - .type GL_PREFIX(Color4uiv), @function -GL_PREFIX(Color4uiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 304(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4uiv), .-GL_PREFIX(Color4uiv) - - .p2align 4,,15 - .globl GL_PREFIX(Color4us) - .type GL_PREFIX(Color4us), @function -GL_PREFIX(Color4us): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 312(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4us), .-GL_PREFIX(Color4us) - - .p2align 4,,15 - .globl GL_PREFIX(Color4usv) - .type GL_PREFIX(Color4usv), @function -GL_PREFIX(Color4usv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 320(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Color4usv), .-GL_PREFIX(Color4usv) - - .p2align 4,,15 - .globl GL_PREFIX(EdgeFlag) - .type GL_PREFIX(EdgeFlag), @function -GL_PREFIX(EdgeFlag): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EdgeFlag), .-GL_PREFIX(EdgeFlag) - - .p2align 4,,15 - .globl GL_PREFIX(EdgeFlagv) - .type GL_PREFIX(EdgeFlagv), @function -GL_PREFIX(EdgeFlagv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EdgeFlagv), .-GL_PREFIX(EdgeFlagv) - - .p2align 4,,15 - .globl GL_PREFIX(End) - .type GL_PREFIX(End), @function -GL_PREFIX(End): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 344(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(End), .-GL_PREFIX(End) - - .p2align 4,,15 - .globl GL_PREFIX(Indexd) - .type GL_PREFIX(Indexd), @function -GL_PREFIX(Indexd): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 352(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexd), .-GL_PREFIX(Indexd) - - .p2align 4,,15 - .globl GL_PREFIX(Indexdv) - .type GL_PREFIX(Indexdv), @function -GL_PREFIX(Indexdv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexdv), .-GL_PREFIX(Indexdv) - - .p2align 4,,15 - .globl GL_PREFIX(Indexf) - .type GL_PREFIX(Indexf), @function -GL_PREFIX(Indexf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 368(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexf), .-GL_PREFIX(Indexf) - - .p2align 4,,15 - .globl GL_PREFIX(Indexfv) - .type GL_PREFIX(Indexfv), @function -GL_PREFIX(Indexfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 376(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexfv), .-GL_PREFIX(Indexfv) - - .p2align 4,,15 - .globl GL_PREFIX(Indexi) - .type GL_PREFIX(Indexi), @function -GL_PREFIX(Indexi): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 384(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexi), .-GL_PREFIX(Indexi) - - .p2align 4,,15 - .globl GL_PREFIX(Indexiv) - .type GL_PREFIX(Indexiv), @function -GL_PREFIX(Indexiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 392(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexiv), .-GL_PREFIX(Indexiv) - - .p2align 4,,15 - .globl GL_PREFIX(Indexs) - .type GL_PREFIX(Indexs), @function -GL_PREFIX(Indexs): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 400(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexs), .-GL_PREFIX(Indexs) - - .p2align 4,,15 - .globl GL_PREFIX(Indexsv) - .type GL_PREFIX(Indexsv), @function -GL_PREFIX(Indexsv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 408(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexsv), .-GL_PREFIX(Indexsv) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3b) - .type GL_PREFIX(Normal3b), @function -GL_PREFIX(Normal3b): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 416(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3b), .-GL_PREFIX(Normal3b) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3bv) - .type GL_PREFIX(Normal3bv), @function -GL_PREFIX(Normal3bv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 424(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3bv), .-GL_PREFIX(Normal3bv) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3d) - .type GL_PREFIX(Normal3d), @function -GL_PREFIX(Normal3d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 432(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3d), .-GL_PREFIX(Normal3d) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3dv) - .type GL_PREFIX(Normal3dv), @function -GL_PREFIX(Normal3dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3dv), .-GL_PREFIX(Normal3dv) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3f) - .type GL_PREFIX(Normal3f), @function -GL_PREFIX(Normal3f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 448(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3f), .-GL_PREFIX(Normal3f) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3fv) - .type GL_PREFIX(Normal3fv), @function -GL_PREFIX(Normal3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3fv), .-GL_PREFIX(Normal3fv) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3i) - .type GL_PREFIX(Normal3i), @function -GL_PREFIX(Normal3i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 464(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3i), .-GL_PREFIX(Normal3i) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3iv) - .type GL_PREFIX(Normal3iv), @function -GL_PREFIX(Normal3iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 472(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3iv), .-GL_PREFIX(Normal3iv) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3s) - .type GL_PREFIX(Normal3s), @function -GL_PREFIX(Normal3s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 480(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3s), .-GL_PREFIX(Normal3s) - - .p2align 4,,15 - .globl GL_PREFIX(Normal3sv) - .type GL_PREFIX(Normal3sv), @function -GL_PREFIX(Normal3sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 488(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Normal3sv), .-GL_PREFIX(Normal3sv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2d) - .type GL_PREFIX(RasterPos2d), @function -GL_PREFIX(RasterPos2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 496(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2d), .-GL_PREFIX(RasterPos2d) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2dv) - .type GL_PREFIX(RasterPos2dv), @function -GL_PREFIX(RasterPos2dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 504(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2dv), .-GL_PREFIX(RasterPos2dv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2f) - .type GL_PREFIX(RasterPos2f), @function -GL_PREFIX(RasterPos2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 512(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2f), .-GL_PREFIX(RasterPos2f) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2fv) - .type GL_PREFIX(RasterPos2fv), @function -GL_PREFIX(RasterPos2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 520(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2fv), .-GL_PREFIX(RasterPos2fv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2i) - .type GL_PREFIX(RasterPos2i), @function -GL_PREFIX(RasterPos2i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 528(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2i), .-GL_PREFIX(RasterPos2i) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2iv) - .type GL_PREFIX(RasterPos2iv), @function -GL_PREFIX(RasterPos2iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2iv), .-GL_PREFIX(RasterPos2iv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2s) - .type GL_PREFIX(RasterPos2s), @function -GL_PREFIX(RasterPos2s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2s), .-GL_PREFIX(RasterPos2s) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos2sv) - .type GL_PREFIX(RasterPos2sv), @function -GL_PREFIX(RasterPos2sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 552(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos2sv), .-GL_PREFIX(RasterPos2sv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3d) - .type GL_PREFIX(RasterPos3d), @function -GL_PREFIX(RasterPos3d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 560(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3d), .-GL_PREFIX(RasterPos3d) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3dv) - .type GL_PREFIX(RasterPos3dv), @function -GL_PREFIX(RasterPos3dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3dv), .-GL_PREFIX(RasterPos3dv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3f) - .type GL_PREFIX(RasterPos3f), @function -GL_PREFIX(RasterPos3f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 576(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3f), .-GL_PREFIX(RasterPos3f) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3fv) - .type GL_PREFIX(RasterPos3fv), @function -GL_PREFIX(RasterPos3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3fv), .-GL_PREFIX(RasterPos3fv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3i) - .type GL_PREFIX(RasterPos3i), @function -GL_PREFIX(RasterPos3i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 592(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3i), .-GL_PREFIX(RasterPos3i) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3iv) - .type GL_PREFIX(RasterPos3iv), @function -GL_PREFIX(RasterPos3iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 600(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3iv), .-GL_PREFIX(RasterPos3iv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3s) - .type GL_PREFIX(RasterPos3s), @function -GL_PREFIX(RasterPos3s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 608(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3s), .-GL_PREFIX(RasterPos3s) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos3sv) - .type GL_PREFIX(RasterPos3sv), @function -GL_PREFIX(RasterPos3sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos3sv), .-GL_PREFIX(RasterPos3sv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4d) - .type GL_PREFIX(RasterPos4d), @function -GL_PREFIX(RasterPos4d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 624(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4d), .-GL_PREFIX(RasterPos4d) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4dv) - .type GL_PREFIX(RasterPos4dv), @function -GL_PREFIX(RasterPos4dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 632(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4dv), .-GL_PREFIX(RasterPos4dv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4f) - .type GL_PREFIX(RasterPos4f), @function -GL_PREFIX(RasterPos4f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 640(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4f), .-GL_PREFIX(RasterPos4f) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4fv) - .type GL_PREFIX(RasterPos4fv), @function -GL_PREFIX(RasterPos4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4fv), .-GL_PREFIX(RasterPos4fv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4i) - .type GL_PREFIX(RasterPos4i), @function -GL_PREFIX(RasterPos4i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 656(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4i), .-GL_PREFIX(RasterPos4i) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4iv) - .type GL_PREFIX(RasterPos4iv), @function -GL_PREFIX(RasterPos4iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4iv), .-GL_PREFIX(RasterPos4iv) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4s) - .type GL_PREFIX(RasterPos4s), @function -GL_PREFIX(RasterPos4s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 672(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4s), .-GL_PREFIX(RasterPos4s) - - .p2align 4,,15 - .globl GL_PREFIX(RasterPos4sv) - .type GL_PREFIX(RasterPos4sv), @function -GL_PREFIX(RasterPos4sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RasterPos4sv), .-GL_PREFIX(RasterPos4sv) - - .p2align 4,,15 - .globl GL_PREFIX(Rectd) - .type GL_PREFIX(Rectd), @function -GL_PREFIX(Rectd): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 688(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectd), .-GL_PREFIX(Rectd) - - .p2align 4,,15 - .globl GL_PREFIX(Rectdv) - .type GL_PREFIX(Rectdv), @function -GL_PREFIX(Rectdv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 696(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectdv), .-GL_PREFIX(Rectdv) - - .p2align 4,,15 - .globl GL_PREFIX(Rectf) - .type GL_PREFIX(Rectf), @function -GL_PREFIX(Rectf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 704(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectf), .-GL_PREFIX(Rectf) - - .p2align 4,,15 - .globl GL_PREFIX(Rectfv) - .type GL_PREFIX(Rectfv), @function -GL_PREFIX(Rectfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 712(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectfv), .-GL_PREFIX(Rectfv) - - .p2align 4,,15 - .globl GL_PREFIX(Recti) - .type GL_PREFIX(Recti), @function -GL_PREFIX(Recti): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Recti), .-GL_PREFIX(Recti) - - .p2align 4,,15 - .globl GL_PREFIX(Rectiv) - .type GL_PREFIX(Rectiv), @function -GL_PREFIX(Rectiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 728(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectiv), .-GL_PREFIX(Rectiv) - - .p2align 4,,15 - .globl GL_PREFIX(Rects) - .type GL_PREFIX(Rects), @function -GL_PREFIX(Rects): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 736(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rects), .-GL_PREFIX(Rects) - - .p2align 4,,15 - .globl GL_PREFIX(Rectsv) - .type GL_PREFIX(Rectsv), @function -GL_PREFIX(Rectsv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 744(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rectsv), .-GL_PREFIX(Rectsv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1d) - .type GL_PREFIX(TexCoord1d), @function -GL_PREFIX(TexCoord1d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 752(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1d), .-GL_PREFIX(TexCoord1d) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1dv) - .type GL_PREFIX(TexCoord1dv), @function -GL_PREFIX(TexCoord1dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 760(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1dv), .-GL_PREFIX(TexCoord1dv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1f) - .type GL_PREFIX(TexCoord1f), @function -GL_PREFIX(TexCoord1f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 768(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1f), .-GL_PREFIX(TexCoord1f) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1fv) - .type GL_PREFIX(TexCoord1fv), @function -GL_PREFIX(TexCoord1fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 776(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1fv), .-GL_PREFIX(TexCoord1fv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1i) - .type GL_PREFIX(TexCoord1i), @function -GL_PREFIX(TexCoord1i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 784(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1i), .-GL_PREFIX(TexCoord1i) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1iv) - .type GL_PREFIX(TexCoord1iv), @function -GL_PREFIX(TexCoord1iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 792(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1iv), .-GL_PREFIX(TexCoord1iv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1s) - .type GL_PREFIX(TexCoord1s), @function -GL_PREFIX(TexCoord1s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 800(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1s), .-GL_PREFIX(TexCoord1s) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord1sv) - .type GL_PREFIX(TexCoord1sv), @function -GL_PREFIX(TexCoord1sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 808(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord1sv), .-GL_PREFIX(TexCoord1sv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2d) - .type GL_PREFIX(TexCoord2d), @function -GL_PREFIX(TexCoord2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 816(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2d), .-GL_PREFIX(TexCoord2d) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2dv) - .type GL_PREFIX(TexCoord2dv), @function -GL_PREFIX(TexCoord2dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 824(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2dv), .-GL_PREFIX(TexCoord2dv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2f) - .type GL_PREFIX(TexCoord2f), @function -GL_PREFIX(TexCoord2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 832(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2f), .-GL_PREFIX(TexCoord2f) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2fv) - .type GL_PREFIX(TexCoord2fv), @function -GL_PREFIX(TexCoord2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 840(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2fv), .-GL_PREFIX(TexCoord2fv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2i) - .type GL_PREFIX(TexCoord2i), @function -GL_PREFIX(TexCoord2i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2i), .-GL_PREFIX(TexCoord2i) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2iv) - .type GL_PREFIX(TexCoord2iv), @function -GL_PREFIX(TexCoord2iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 856(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2iv), .-GL_PREFIX(TexCoord2iv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2s) - .type GL_PREFIX(TexCoord2s), @function -GL_PREFIX(TexCoord2s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2s), .-GL_PREFIX(TexCoord2s) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord2sv) - .type GL_PREFIX(TexCoord2sv), @function -GL_PREFIX(TexCoord2sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 872(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord2sv), .-GL_PREFIX(TexCoord2sv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3d) - .type GL_PREFIX(TexCoord3d), @function -GL_PREFIX(TexCoord3d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 880(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3d), .-GL_PREFIX(TexCoord3d) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3dv) - .type GL_PREFIX(TexCoord3dv), @function -GL_PREFIX(TexCoord3dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3dv), .-GL_PREFIX(TexCoord3dv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3f) - .type GL_PREFIX(TexCoord3f), @function -GL_PREFIX(TexCoord3f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 896(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3f), .-GL_PREFIX(TexCoord3f) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3fv) - .type GL_PREFIX(TexCoord3fv), @function -GL_PREFIX(TexCoord3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 904(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3fv), .-GL_PREFIX(TexCoord3fv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3i) - .type GL_PREFIX(TexCoord3i), @function -GL_PREFIX(TexCoord3i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3i), .-GL_PREFIX(TexCoord3i) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3iv) - .type GL_PREFIX(TexCoord3iv), @function -GL_PREFIX(TexCoord3iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 920(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3iv), .-GL_PREFIX(TexCoord3iv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3s) - .type GL_PREFIX(TexCoord3s), @function -GL_PREFIX(TexCoord3s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3s), .-GL_PREFIX(TexCoord3s) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord3sv) - .type GL_PREFIX(TexCoord3sv), @function -GL_PREFIX(TexCoord3sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 936(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord3sv), .-GL_PREFIX(TexCoord3sv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4d) - .type GL_PREFIX(TexCoord4d), @function -GL_PREFIX(TexCoord4d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 944(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4d), .-GL_PREFIX(TexCoord4d) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4dv) - .type GL_PREFIX(TexCoord4dv), @function -GL_PREFIX(TexCoord4dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4dv), .-GL_PREFIX(TexCoord4dv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4f) - .type GL_PREFIX(TexCoord4f), @function -GL_PREFIX(TexCoord4f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 960(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4f), .-GL_PREFIX(TexCoord4f) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4fv) - .type GL_PREFIX(TexCoord4fv), @function -GL_PREFIX(TexCoord4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 968(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4fv), .-GL_PREFIX(TexCoord4fv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4i) - .type GL_PREFIX(TexCoord4i), @function -GL_PREFIX(TexCoord4i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 976(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4i), .-GL_PREFIX(TexCoord4i) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4iv) - .type GL_PREFIX(TexCoord4iv), @function -GL_PREFIX(TexCoord4iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 984(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4iv), .-GL_PREFIX(TexCoord4iv) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4s) - .type GL_PREFIX(TexCoord4s), @function -GL_PREFIX(TexCoord4s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 992(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4s), .-GL_PREFIX(TexCoord4s) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoord4sv) - .type GL_PREFIX(TexCoord4sv), @function -GL_PREFIX(TexCoord4sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoord4sv), .-GL_PREFIX(TexCoord4sv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2d) - .type GL_PREFIX(Vertex2d), @function -GL_PREFIX(Vertex2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1008(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2d), .-GL_PREFIX(Vertex2d) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2dv) - .type GL_PREFIX(Vertex2dv), @function -GL_PREFIX(Vertex2dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2dv), .-GL_PREFIX(Vertex2dv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2f) - .type GL_PREFIX(Vertex2f), @function -GL_PREFIX(Vertex2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1024(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2f), .-GL_PREFIX(Vertex2f) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2fv) - .type GL_PREFIX(Vertex2fv), @function -GL_PREFIX(Vertex2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2fv), .-GL_PREFIX(Vertex2fv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2i) - .type GL_PREFIX(Vertex2i), @function -GL_PREFIX(Vertex2i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2i), .-GL_PREFIX(Vertex2i) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2iv) - .type GL_PREFIX(Vertex2iv), @function -GL_PREFIX(Vertex2iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2iv), .-GL_PREFIX(Vertex2iv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2s) - .type GL_PREFIX(Vertex2s), @function -GL_PREFIX(Vertex2s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1056(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2s), .-GL_PREFIX(Vertex2s) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex2sv) - .type GL_PREFIX(Vertex2sv), @function -GL_PREFIX(Vertex2sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex2sv), .-GL_PREFIX(Vertex2sv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3d) - .type GL_PREFIX(Vertex3d), @function -GL_PREFIX(Vertex3d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1072(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3d), .-GL_PREFIX(Vertex3d) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3dv) - .type GL_PREFIX(Vertex3dv), @function -GL_PREFIX(Vertex3dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3dv), .-GL_PREFIX(Vertex3dv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3f) - .type GL_PREFIX(Vertex3f), @function -GL_PREFIX(Vertex3f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1088(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3f), .-GL_PREFIX(Vertex3f) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3fv) - .type GL_PREFIX(Vertex3fv), @function -GL_PREFIX(Vertex3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3fv), .-GL_PREFIX(Vertex3fv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3i) - .type GL_PREFIX(Vertex3i), @function -GL_PREFIX(Vertex3i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3i), .-GL_PREFIX(Vertex3i) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3iv) - .type GL_PREFIX(Vertex3iv), @function -GL_PREFIX(Vertex3iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3iv), .-GL_PREFIX(Vertex3iv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3s) - .type GL_PREFIX(Vertex3s), @function -GL_PREFIX(Vertex3s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3s), .-GL_PREFIX(Vertex3s) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex3sv) - .type GL_PREFIX(Vertex3sv), @function -GL_PREFIX(Vertex3sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex3sv), .-GL_PREFIX(Vertex3sv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4d) - .type GL_PREFIX(Vertex4d), @function -GL_PREFIX(Vertex4d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1136(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4d), .-GL_PREFIX(Vertex4d) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4dv) - .type GL_PREFIX(Vertex4dv), @function -GL_PREFIX(Vertex4dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4dv), .-GL_PREFIX(Vertex4dv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4f) - .type GL_PREFIX(Vertex4f), @function -GL_PREFIX(Vertex4f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1152(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4f), .-GL_PREFIX(Vertex4f) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4fv) - .type GL_PREFIX(Vertex4fv), @function -GL_PREFIX(Vertex4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1160(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4fv), .-GL_PREFIX(Vertex4fv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4i) - .type GL_PREFIX(Vertex4i), @function -GL_PREFIX(Vertex4i): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4i), .-GL_PREFIX(Vertex4i) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4iv) - .type GL_PREFIX(Vertex4iv), @function -GL_PREFIX(Vertex4iv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4iv), .-GL_PREFIX(Vertex4iv) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4s) - .type GL_PREFIX(Vertex4s), @function -GL_PREFIX(Vertex4s): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4s), .-GL_PREFIX(Vertex4s) - - .p2align 4,,15 - .globl GL_PREFIX(Vertex4sv) - .type GL_PREFIX(Vertex4sv), @function -GL_PREFIX(Vertex4sv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Vertex4sv), .-GL_PREFIX(Vertex4sv) - - .p2align 4,,15 - .globl GL_PREFIX(ClipPlane) - .type GL_PREFIX(ClipPlane), @function -GL_PREFIX(ClipPlane): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1200(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClipPlane), .-GL_PREFIX(ClipPlane) - - .p2align 4,,15 - .globl GL_PREFIX(ColorMaterial) - .type GL_PREFIX(ColorMaterial), @function -GL_PREFIX(ColorMaterial): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorMaterial), .-GL_PREFIX(ColorMaterial) - - .p2align 4,,15 - .globl GL_PREFIX(CullFace) - .type GL_PREFIX(CullFace), @function -GL_PREFIX(CullFace): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1216(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CullFace), .-GL_PREFIX(CullFace) - - .p2align 4,,15 - .globl GL_PREFIX(Fogf) - .type GL_PREFIX(Fogf), @function -GL_PREFIX(Fogf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1224(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Fogf), .-GL_PREFIX(Fogf) - - .p2align 4,,15 - .globl GL_PREFIX(Fogfv) - .type GL_PREFIX(Fogfv), @function -GL_PREFIX(Fogfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1232(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Fogfv), .-GL_PREFIX(Fogfv) - - .p2align 4,,15 - .globl GL_PREFIX(Fogi) - .type GL_PREFIX(Fogi), @function -GL_PREFIX(Fogi): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Fogi), .-GL_PREFIX(Fogi) - - .p2align 4,,15 - .globl GL_PREFIX(Fogiv) - .type GL_PREFIX(Fogiv), @function -GL_PREFIX(Fogiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Fogiv), .-GL_PREFIX(Fogiv) - - .p2align 4,,15 - .globl GL_PREFIX(FrontFace) - .type GL_PREFIX(FrontFace), @function -GL_PREFIX(FrontFace): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FrontFace), .-GL_PREFIX(FrontFace) - - .p2align 4,,15 - .globl GL_PREFIX(Hint) - .type GL_PREFIX(Hint), @function -GL_PREFIX(Hint): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Hint), .-GL_PREFIX(Hint) - - .p2align 4,,15 - .globl GL_PREFIX(Lightf) - .type GL_PREFIX(Lightf), @function -GL_PREFIX(Lightf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1272(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Lightf), .-GL_PREFIX(Lightf) - - .p2align 4,,15 - .globl GL_PREFIX(Lightfv) - .type GL_PREFIX(Lightfv), @function -GL_PREFIX(Lightfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Lightfv), .-GL_PREFIX(Lightfv) - - .p2align 4,,15 - .globl GL_PREFIX(Lighti) - .type GL_PREFIX(Lighti), @function -GL_PREFIX(Lighti): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1288(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Lighti), .-GL_PREFIX(Lighti) - - .p2align 4,,15 - .globl GL_PREFIX(Lightiv) - .type GL_PREFIX(Lightiv), @function -GL_PREFIX(Lightiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Lightiv), .-GL_PREFIX(Lightiv) - - .p2align 4,,15 - .globl GL_PREFIX(LightModelf) - .type GL_PREFIX(LightModelf), @function -GL_PREFIX(LightModelf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1304(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LightModelf), .-GL_PREFIX(LightModelf) - - .p2align 4,,15 - .globl GL_PREFIX(LightModelfv) - .type GL_PREFIX(LightModelfv), @function -GL_PREFIX(LightModelfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1312(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LightModelfv), .-GL_PREFIX(LightModelfv) - - .p2align 4,,15 - .globl GL_PREFIX(LightModeli) - .type GL_PREFIX(LightModeli), @function -GL_PREFIX(LightModeli): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1320(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LightModeli), .-GL_PREFIX(LightModeli) - - .p2align 4,,15 - .globl GL_PREFIX(LightModeliv) - .type GL_PREFIX(LightModeliv), @function -GL_PREFIX(LightModeliv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LightModeliv), .-GL_PREFIX(LightModeliv) - - .p2align 4,,15 - .globl GL_PREFIX(LineStipple) - .type GL_PREFIX(LineStipple), @function -GL_PREFIX(LineStipple): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LineStipple), .-GL_PREFIX(LineStipple) - - .p2align 4,,15 - .globl GL_PREFIX(LineWidth) - .type GL_PREFIX(LineWidth), @function -GL_PREFIX(LineWidth): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1344(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LineWidth), .-GL_PREFIX(LineWidth) - - .p2align 4,,15 - .globl GL_PREFIX(Materialf) - .type GL_PREFIX(Materialf), @function -GL_PREFIX(Materialf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1352(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Materialf), .-GL_PREFIX(Materialf) - - .p2align 4,,15 - .globl GL_PREFIX(Materialfv) - .type GL_PREFIX(Materialfv), @function -GL_PREFIX(Materialfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Materialfv), .-GL_PREFIX(Materialfv) - - .p2align 4,,15 - .globl GL_PREFIX(Materiali) - .type GL_PREFIX(Materiali), @function -GL_PREFIX(Materiali): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1368(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Materiali), .-GL_PREFIX(Materiali) - - .p2align 4,,15 - .globl GL_PREFIX(Materialiv) - .type GL_PREFIX(Materialiv), @function -GL_PREFIX(Materialiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1376(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Materialiv), .-GL_PREFIX(Materialiv) - - .p2align 4,,15 - .globl GL_PREFIX(PointSize) - .type GL_PREFIX(PointSize), @function -GL_PREFIX(PointSize): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1384(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointSize), .-GL_PREFIX(PointSize) - - .p2align 4,,15 - .globl GL_PREFIX(PolygonMode) - .type GL_PREFIX(PolygonMode), @function -GL_PREFIX(PolygonMode): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1392(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonMode), .-GL_PREFIX(PolygonMode) - - .p2align 4,,15 - .globl GL_PREFIX(PolygonStipple) - .type GL_PREFIX(PolygonStipple), @function -GL_PREFIX(PolygonStipple): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1400(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonStipple), .-GL_PREFIX(PolygonStipple) - - .p2align 4,,15 - .globl GL_PREFIX(Scissor) - .type GL_PREFIX(Scissor), @function -GL_PREFIX(Scissor): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1408(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Scissor), .-GL_PREFIX(Scissor) - - .p2align 4,,15 - .globl GL_PREFIX(ShadeModel) - .type GL_PREFIX(ShadeModel), @function -GL_PREFIX(ShadeModel): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1416(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ShadeModel), .-GL_PREFIX(ShadeModel) - - .p2align 4,,15 - .globl GL_PREFIX(TexParameterf) - .type GL_PREFIX(TexParameterf), @function -GL_PREFIX(TexParameterf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1424(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexParameterf), .-GL_PREFIX(TexParameterf) - - .p2align 4,,15 - .globl GL_PREFIX(TexParameterfv) - .type GL_PREFIX(TexParameterfv), @function -GL_PREFIX(TexParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1432(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexParameterfv), .-GL_PREFIX(TexParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(TexParameteri) - .type GL_PREFIX(TexParameteri), @function -GL_PREFIX(TexParameteri): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexParameteri), .-GL_PREFIX(TexParameteri) - - .p2align 4,,15 - .globl GL_PREFIX(TexParameteriv) - .type GL_PREFIX(TexParameteriv), @function -GL_PREFIX(TexParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1448(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexParameteriv), .-GL_PREFIX(TexParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(TexImage1D) - .type GL_PREFIX(TexImage1D), @function -GL_PREFIX(TexImage1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexImage1D), .-GL_PREFIX(TexImage1D) - - .p2align 4,,15 - .globl GL_PREFIX(TexImage2D) - .type GL_PREFIX(TexImage2D), @function -GL_PREFIX(TexImage2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1464(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexImage2D), .-GL_PREFIX(TexImage2D) - - .p2align 4,,15 - .globl GL_PREFIX(TexEnvf) - .type GL_PREFIX(TexEnvf), @function -GL_PREFIX(TexEnvf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1472(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexEnvf), .-GL_PREFIX(TexEnvf) - - .p2align 4,,15 - .globl GL_PREFIX(TexEnvfv) - .type GL_PREFIX(TexEnvfv), @function -GL_PREFIX(TexEnvfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1480(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexEnvfv), .-GL_PREFIX(TexEnvfv) - - .p2align 4,,15 - .globl GL_PREFIX(TexEnvi) - .type GL_PREFIX(TexEnvi), @function -GL_PREFIX(TexEnvi): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1488(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexEnvi), .-GL_PREFIX(TexEnvi) - - .p2align 4,,15 - .globl GL_PREFIX(TexEnviv) - .type GL_PREFIX(TexEnviv), @function -GL_PREFIX(TexEnviv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1496(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexEnviv), .-GL_PREFIX(TexEnviv) - - .p2align 4,,15 - .globl GL_PREFIX(TexGend) - .type GL_PREFIX(TexGend), @function -GL_PREFIX(TexGend): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1504(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGend), .-GL_PREFIX(TexGend) - - .p2align 4,,15 - .globl GL_PREFIX(TexGendv) - .type GL_PREFIX(TexGendv), @function -GL_PREFIX(TexGendv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1512(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGendv), .-GL_PREFIX(TexGendv) - - .p2align 4,,15 - .globl GL_PREFIX(TexGenf) - .type GL_PREFIX(TexGenf), @function -GL_PREFIX(TexGenf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1520(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 1520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGenf), .-GL_PREFIX(TexGenf) - - .p2align 4,,15 - .globl GL_PREFIX(TexGenfv) - .type GL_PREFIX(TexGenfv), @function -GL_PREFIX(TexGenfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1528(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGenfv), .-GL_PREFIX(TexGenfv) - - .p2align 4,,15 - .globl GL_PREFIX(TexGeni) - .type GL_PREFIX(TexGeni), @function -GL_PREFIX(TexGeni): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGeni), .-GL_PREFIX(TexGeni) - - .p2align 4,,15 - .globl GL_PREFIX(TexGeniv) - .type GL_PREFIX(TexGeniv), @function -GL_PREFIX(TexGeniv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexGeniv), .-GL_PREFIX(TexGeniv) - - .p2align 4,,15 - .globl GL_PREFIX(FeedbackBuffer) - .type GL_PREFIX(FeedbackBuffer), @function -GL_PREFIX(FeedbackBuffer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1552(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FeedbackBuffer), .-GL_PREFIX(FeedbackBuffer) - - .p2align 4,,15 - .globl GL_PREFIX(SelectBuffer) - .type GL_PREFIX(SelectBuffer), @function -GL_PREFIX(SelectBuffer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1560(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SelectBuffer), .-GL_PREFIX(SelectBuffer) - - .p2align 4,,15 - .globl GL_PREFIX(RenderMode) - .type GL_PREFIX(RenderMode), @function -GL_PREFIX(RenderMode): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RenderMode), .-GL_PREFIX(RenderMode) - - .p2align 4,,15 - .globl GL_PREFIX(InitNames) - .type GL_PREFIX(InitNames), @function -GL_PREFIX(InitNames): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 1576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1576(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 1576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(InitNames), .-GL_PREFIX(InitNames) - - .p2align 4,,15 - .globl GL_PREFIX(LoadName) - .type GL_PREFIX(LoadName), @function -GL_PREFIX(LoadName): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadName), .-GL_PREFIX(LoadName) - - .p2align 4,,15 - .globl GL_PREFIX(PassThrough) - .type GL_PREFIX(PassThrough), @function -GL_PREFIX(PassThrough): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1592(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PassThrough), .-GL_PREFIX(PassThrough) - - .p2align 4,,15 - .globl GL_PREFIX(PopName) - .type GL_PREFIX(PopName), @function -GL_PREFIX(PopName): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 1600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1600(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 1600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PopName), .-GL_PREFIX(PopName) - - .p2align 4,,15 - .globl GL_PREFIX(PushName) - .type GL_PREFIX(PushName), @function -GL_PREFIX(PushName): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1608(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PushName), .-GL_PREFIX(PushName) - - .p2align 4,,15 - .globl GL_PREFIX(DrawBuffer) - .type GL_PREFIX(DrawBuffer), @function -GL_PREFIX(DrawBuffer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawBuffer), .-GL_PREFIX(DrawBuffer) - - .p2align 4,,15 - .globl GL_PREFIX(Clear) - .type GL_PREFIX(Clear), @function -GL_PREFIX(Clear): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1624(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Clear), .-GL_PREFIX(Clear) - - .p2align 4,,15 - .globl GL_PREFIX(ClearAccum) - .type GL_PREFIX(ClearAccum), @function -GL_PREFIX(ClearAccum): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1632(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 1632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClearAccum), .-GL_PREFIX(ClearAccum) - - .p2align 4,,15 - .globl GL_PREFIX(ClearIndex) - .type GL_PREFIX(ClearIndex), @function -GL_PREFIX(ClearIndex): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1640(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClearIndex), .-GL_PREFIX(ClearIndex) - - .p2align 4,,15 - .globl GL_PREFIX(ClearColor) - .type GL_PREFIX(ClearColor), @function -GL_PREFIX(ClearColor): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClearColor), .-GL_PREFIX(ClearColor) - - .p2align 4,,15 - .globl GL_PREFIX(ClearStencil) - .type GL_PREFIX(ClearStencil), @function -GL_PREFIX(ClearStencil): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1656(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClearStencil), .-GL_PREFIX(ClearStencil) - - .p2align 4,,15 - .globl GL_PREFIX(ClearDepth) - .type GL_PREFIX(ClearDepth), @function -GL_PREFIX(ClearDepth): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClearDepth), .-GL_PREFIX(ClearDepth) - - .p2align 4,,15 - .globl GL_PREFIX(StencilMask) - .type GL_PREFIX(StencilMask), @function -GL_PREFIX(StencilMask): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1672(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilMask), .-GL_PREFIX(StencilMask) - - .p2align 4,,15 - .globl GL_PREFIX(ColorMask) - .type GL_PREFIX(ColorMask), @function -GL_PREFIX(ColorMask): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorMask), .-GL_PREFIX(ColorMask) - - .p2align 4,,15 - .globl GL_PREFIX(DepthMask) - .type GL_PREFIX(DepthMask), @function -GL_PREFIX(DepthMask): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1688(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DepthMask), .-GL_PREFIX(DepthMask) - - .p2align 4,,15 - .globl GL_PREFIX(IndexMask) - .type GL_PREFIX(IndexMask), @function -GL_PREFIX(IndexMask): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1696(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IndexMask), .-GL_PREFIX(IndexMask) - - .p2align 4,,15 - .globl GL_PREFIX(Accum) - .type GL_PREFIX(Accum), @function -GL_PREFIX(Accum): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1704(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Accum), .-GL_PREFIX(Accum) - - .p2align 4,,15 - .globl GL_PREFIX(Disable) - .type GL_PREFIX(Disable), @function -GL_PREFIX(Disable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1712(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Disable), .-GL_PREFIX(Disable) - - .p2align 4,,15 - .globl GL_PREFIX(Enable) - .type GL_PREFIX(Enable), @function -GL_PREFIX(Enable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Enable), .-GL_PREFIX(Enable) - - .p2align 4,,15 - .globl GL_PREFIX(Finish) - .type GL_PREFIX(Finish), @function -GL_PREFIX(Finish): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 1728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1728(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 1728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Finish), .-GL_PREFIX(Finish) - - .p2align 4,,15 - .globl GL_PREFIX(Flush) - .type GL_PREFIX(Flush), @function -GL_PREFIX(Flush): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 1736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1736(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 1736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Flush), .-GL_PREFIX(Flush) - - .p2align 4,,15 - .globl GL_PREFIX(PopAttrib) - .type GL_PREFIX(PopAttrib), @function -GL_PREFIX(PopAttrib): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 1744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1744(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 1744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PopAttrib), .-GL_PREFIX(PopAttrib) - - .p2align 4,,15 - .globl GL_PREFIX(PushAttrib) - .type GL_PREFIX(PushAttrib), @function -GL_PREFIX(PushAttrib): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1752(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PushAttrib), .-GL_PREFIX(PushAttrib) - - .p2align 4,,15 - .globl GL_PREFIX(Map1d) - .type GL_PREFIX(Map1d), @function -GL_PREFIX(Map1d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %rcx, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %rcx - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1760(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %rcx, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %rcx - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Map1d), .-GL_PREFIX(Map1d) - - .p2align 4,,15 - .globl GL_PREFIX(Map1f) - .type GL_PREFIX(Map1f), @function -GL_PREFIX(Map1f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %rcx, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %rcx - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1768(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %rcx, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %rcx - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Map1f), .-GL_PREFIX(Map1f) - - .p2align 4,,15 - .globl GL_PREFIX(Map2d) - .type GL_PREFIX(Map2d), @function -GL_PREFIX(Map2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $88, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - movq %rcx, 56(%rsp) - movq %r8, 64(%rsp) - movq %r9, 72(%rsp) - call _x86_64_get_dispatch@PLT - movq 72(%rsp), %r9 - movq 64(%rsp), %r8 - movq 56(%rsp), %rcx - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $88, %rsp - movq 1776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1776(%rax), %r11 - jmp *%r11 -1: - subq $88, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - movq %rcx, 56(%rsp) - movq %r8, 64(%rsp) - movq %r9, 72(%rsp) - call _glapi_get_dispatch - movq 72(%rsp), %r9 - movq 64(%rsp), %r8 - movq 56(%rsp), %rcx - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $88, %rsp - movq 1776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Map2d), .-GL_PREFIX(Map2d) - - .p2align 4,,15 - .globl GL_PREFIX(Map2f) - .type GL_PREFIX(Map2f), @function -GL_PREFIX(Map2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $88, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - movq %rcx, 56(%rsp) - movq %r8, 64(%rsp) - movq %r9, 72(%rsp) - call _x86_64_get_dispatch@PLT - movq 72(%rsp), %r9 - movq 64(%rsp), %r8 - movq 56(%rsp), %rcx - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $88, %rsp - movq 1784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1784(%rax), %r11 - jmp *%r11 -1: - subq $88, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdx, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - movq %rcx, 56(%rsp) - movq %r8, 64(%rsp) - movq %r9, 72(%rsp) - call _glapi_get_dispatch - movq 72(%rsp), %r9 - movq 64(%rsp), %r8 - movq 56(%rsp), %rcx - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %rdx - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $88, %rsp - movq 1784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Map2f), .-GL_PREFIX(Map2f) - - .p2align 4,,15 - .globl GL_PREFIX(MapGrid1d) - .type GL_PREFIX(MapGrid1d), @function -GL_PREFIX(MapGrid1d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1792(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapGrid1d), .-GL_PREFIX(MapGrid1d) - - .p2align 4,,15 - .globl GL_PREFIX(MapGrid1f) - .type GL_PREFIX(MapGrid1f), @function -GL_PREFIX(MapGrid1f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1800(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapGrid1f), .-GL_PREFIX(MapGrid1f) - - .p2align 4,,15 - .globl GL_PREFIX(MapGrid2d) - .type GL_PREFIX(MapGrid2d), @function -GL_PREFIX(MapGrid2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1808(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapGrid2d), .-GL_PREFIX(MapGrid2d) - - .p2align 4,,15 - .globl GL_PREFIX(MapGrid2f) - .type GL_PREFIX(MapGrid2f), @function -GL_PREFIX(MapGrid2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1816(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %rsi, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %rsi - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $56, %rsp - movq 1816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapGrid2f), .-GL_PREFIX(MapGrid2f) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord1d) - .type GL_PREFIX(EvalCoord1d), @function -GL_PREFIX(EvalCoord1d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1824(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord1d), .-GL_PREFIX(EvalCoord1d) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord1dv) - .type GL_PREFIX(EvalCoord1dv), @function -GL_PREFIX(EvalCoord1dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1832(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord1dv), .-GL_PREFIX(EvalCoord1dv) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord1f) - .type GL_PREFIX(EvalCoord1f), @function -GL_PREFIX(EvalCoord1f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1840(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 1840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord1f), .-GL_PREFIX(EvalCoord1f) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord1fv) - .type GL_PREFIX(EvalCoord1fv), @function -GL_PREFIX(EvalCoord1fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord1fv), .-GL_PREFIX(EvalCoord1fv) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord2d) - .type GL_PREFIX(EvalCoord2d), @function -GL_PREFIX(EvalCoord2d): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1856(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord2d), .-GL_PREFIX(EvalCoord2d) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord2dv) - .type GL_PREFIX(EvalCoord2dv), @function -GL_PREFIX(EvalCoord2dv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord2dv), .-GL_PREFIX(EvalCoord2dv) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord2f) - .type GL_PREFIX(EvalCoord2f), @function -GL_PREFIX(EvalCoord2f): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1872(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord2f), .-GL_PREFIX(EvalCoord2f) - - .p2align 4,,15 - .globl GL_PREFIX(EvalCoord2fv) - .type GL_PREFIX(EvalCoord2fv), @function -GL_PREFIX(EvalCoord2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1880(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalCoord2fv), .-GL_PREFIX(EvalCoord2fv) - - .p2align 4,,15 - .globl GL_PREFIX(EvalMesh1) - .type GL_PREFIX(EvalMesh1), @function -GL_PREFIX(EvalMesh1): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalMesh1), .-GL_PREFIX(EvalMesh1) - - .p2align 4,,15 - .globl GL_PREFIX(EvalPoint1) - .type GL_PREFIX(EvalPoint1), @function -GL_PREFIX(EvalPoint1): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1896(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalPoint1), .-GL_PREFIX(EvalPoint1) - - .p2align 4,,15 - .globl GL_PREFIX(EvalMesh2) - .type GL_PREFIX(EvalMesh2), @function -GL_PREFIX(EvalMesh2): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1904(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 1904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalMesh2), .-GL_PREFIX(EvalMesh2) - - .p2align 4,,15 - .globl GL_PREFIX(EvalPoint2) - .type GL_PREFIX(EvalPoint2), @function -GL_PREFIX(EvalPoint2): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EvalPoint2), .-GL_PREFIX(EvalPoint2) - - .p2align 4,,15 - .globl GL_PREFIX(AlphaFunc) - .type GL_PREFIX(AlphaFunc), @function -GL_PREFIX(AlphaFunc): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1920(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AlphaFunc), .-GL_PREFIX(AlphaFunc) - - .p2align 4,,15 - .globl GL_PREFIX(BlendFunc) - .type GL_PREFIX(BlendFunc), @function -GL_PREFIX(BlendFunc): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BlendFunc), .-GL_PREFIX(BlendFunc) - - .p2align 4,,15 - .globl GL_PREFIX(LogicOp) - .type GL_PREFIX(LogicOp), @function -GL_PREFIX(LogicOp): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1936(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LogicOp), .-GL_PREFIX(LogicOp) - - .p2align 4,,15 - .globl GL_PREFIX(StencilFunc) - .type GL_PREFIX(StencilFunc), @function -GL_PREFIX(StencilFunc): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1944(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilFunc), .-GL_PREFIX(StencilFunc) - - .p2align 4,,15 - .globl GL_PREFIX(StencilOp) - .type GL_PREFIX(StencilOp), @function -GL_PREFIX(StencilOp): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 1952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 1952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilOp), .-GL_PREFIX(StencilOp) - - .p2align 4,,15 - .globl GL_PREFIX(DepthFunc) - .type GL_PREFIX(DepthFunc), @function -GL_PREFIX(DepthFunc): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 1960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1960(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 1960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DepthFunc), .-GL_PREFIX(DepthFunc) - - .p2align 4,,15 - .globl GL_PREFIX(PixelZoom) - .type GL_PREFIX(PixelZoom), @function -GL_PREFIX(PixelZoom): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1968(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 1968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelZoom), .-GL_PREFIX(PixelZoom) - - .p2align 4,,15 - .globl GL_PREFIX(PixelTransferf) - .type GL_PREFIX(PixelTransferf), @function -GL_PREFIX(PixelTransferf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1976(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelTransferf), .-GL_PREFIX(PixelTransferf) - - .p2align 4,,15 - .globl GL_PREFIX(PixelTransferi) - .type GL_PREFIX(PixelTransferi), @function -GL_PREFIX(PixelTransferi): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 1984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1984(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 1984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelTransferi), .-GL_PREFIX(PixelTransferi) - - .p2align 4,,15 - .globl GL_PREFIX(PixelStoref) - .type GL_PREFIX(PixelStoref), @function -GL_PREFIX(PixelStoref): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 1992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 1992(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 1992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelStoref), .-GL_PREFIX(PixelStoref) - - .p2align 4,,15 - .globl GL_PREFIX(PixelStorei) - .type GL_PREFIX(PixelStorei), @function -GL_PREFIX(PixelStorei): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelStorei), .-GL_PREFIX(PixelStorei) - - .p2align 4,,15 - .globl GL_PREFIX(PixelMapfv) - .type GL_PREFIX(PixelMapfv), @function -GL_PREFIX(PixelMapfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2008(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelMapfv), .-GL_PREFIX(PixelMapfv) - - .p2align 4,,15 - .globl GL_PREFIX(PixelMapuiv) - .type GL_PREFIX(PixelMapuiv), @function -GL_PREFIX(PixelMapuiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelMapuiv), .-GL_PREFIX(PixelMapuiv) - - .p2align 4,,15 - .globl GL_PREFIX(PixelMapusv) - .type GL_PREFIX(PixelMapusv), @function -GL_PREFIX(PixelMapusv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2024(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PixelMapusv), .-GL_PREFIX(PixelMapusv) - - .p2align 4,,15 - .globl GL_PREFIX(ReadBuffer) - .type GL_PREFIX(ReadBuffer), @function -GL_PREFIX(ReadBuffer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ReadBuffer), .-GL_PREFIX(ReadBuffer) - - .p2align 4,,15 - .globl GL_PREFIX(CopyPixels) - .type GL_PREFIX(CopyPixels), @function -GL_PREFIX(CopyPixels): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyPixels), .-GL_PREFIX(CopyPixels) - - .p2align 4,,15 - .globl GL_PREFIX(ReadPixels) - .type GL_PREFIX(ReadPixels), @function -GL_PREFIX(ReadPixels): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ReadPixels), .-GL_PREFIX(ReadPixels) - - .p2align 4,,15 - .globl GL_PREFIX(DrawPixels) - .type GL_PREFIX(DrawPixels), @function -GL_PREFIX(DrawPixels): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2056(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawPixels), .-GL_PREFIX(DrawPixels) - - .p2align 4,,15 - .globl GL_PREFIX(GetBooleanv) - .type GL_PREFIX(GetBooleanv), @function -GL_PREFIX(GetBooleanv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBooleanv), .-GL_PREFIX(GetBooleanv) - - .p2align 4,,15 - .globl GL_PREFIX(GetClipPlane) - .type GL_PREFIX(GetClipPlane), @function -GL_PREFIX(GetClipPlane): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2072(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetClipPlane), .-GL_PREFIX(GetClipPlane) - - .p2align 4,,15 - .globl GL_PREFIX(GetDoublev) - .type GL_PREFIX(GetDoublev), @function -GL_PREFIX(GetDoublev): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetDoublev), .-GL_PREFIX(GetDoublev) - - .p2align 4,,15 - .globl GL_PREFIX(GetError) - .type GL_PREFIX(GetError), @function -GL_PREFIX(GetError): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 2088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2088(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 2088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetError), .-GL_PREFIX(GetError) - - .p2align 4,,15 - .globl GL_PREFIX(GetFloatv) - .type GL_PREFIX(GetFloatv), @function -GL_PREFIX(GetFloatv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetFloatv), .-GL_PREFIX(GetFloatv) - - .p2align 4,,15 - .globl GL_PREFIX(GetIntegerv) - .type GL_PREFIX(GetIntegerv), @function -GL_PREFIX(GetIntegerv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetIntegerv), .-GL_PREFIX(GetIntegerv) - - .p2align 4,,15 - .globl GL_PREFIX(GetLightfv) - .type GL_PREFIX(GetLightfv), @function -GL_PREFIX(GetLightfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetLightfv), .-GL_PREFIX(GetLightfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetLightiv) - .type GL_PREFIX(GetLightiv), @function -GL_PREFIX(GetLightiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetLightiv), .-GL_PREFIX(GetLightiv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMapdv) - .type GL_PREFIX(GetMapdv), @function -GL_PREFIX(GetMapdv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMapdv), .-GL_PREFIX(GetMapdv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMapfv) - .type GL_PREFIX(GetMapfv), @function -GL_PREFIX(GetMapfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2136(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMapfv), .-GL_PREFIX(GetMapfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMapiv) - .type GL_PREFIX(GetMapiv), @function -GL_PREFIX(GetMapiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMapiv), .-GL_PREFIX(GetMapiv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMaterialfv) - .type GL_PREFIX(GetMaterialfv), @function -GL_PREFIX(GetMaterialfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2152(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMaterialfv), .-GL_PREFIX(GetMaterialfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMaterialiv) - .type GL_PREFIX(GetMaterialiv), @function -GL_PREFIX(GetMaterialiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2160(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMaterialiv), .-GL_PREFIX(GetMaterialiv) - - .p2align 4,,15 - .globl GL_PREFIX(GetPixelMapfv) - .type GL_PREFIX(GetPixelMapfv), @function -GL_PREFIX(GetPixelMapfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetPixelMapfv), .-GL_PREFIX(GetPixelMapfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetPixelMapuiv) - .type GL_PREFIX(GetPixelMapuiv), @function -GL_PREFIX(GetPixelMapuiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetPixelMapuiv), .-GL_PREFIX(GetPixelMapuiv) - - .p2align 4,,15 - .globl GL_PREFIX(GetPixelMapusv) - .type GL_PREFIX(GetPixelMapusv), @function -GL_PREFIX(GetPixelMapusv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetPixelMapusv), .-GL_PREFIX(GetPixelMapusv) - - .p2align 4,,15 - .globl GL_PREFIX(GetPolygonStipple) - .type GL_PREFIX(GetPolygonStipple), @function -GL_PREFIX(GetPolygonStipple): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetPolygonStipple), .-GL_PREFIX(GetPolygonStipple) - - .p2align 4,,15 - .globl GL_PREFIX(GetString) - .type GL_PREFIX(GetString), @function -GL_PREFIX(GetString): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2200(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetString), .-GL_PREFIX(GetString) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexEnvfv) - .type GL_PREFIX(GetTexEnvfv), @function -GL_PREFIX(GetTexEnvfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexEnvfv), .-GL_PREFIX(GetTexEnvfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexEnviv) - .type GL_PREFIX(GetTexEnviv), @function -GL_PREFIX(GetTexEnviv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2216(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexEnviv), .-GL_PREFIX(GetTexEnviv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexGendv) - .type GL_PREFIX(GetTexGendv), @function -GL_PREFIX(GetTexGendv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2224(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexGendv), .-GL_PREFIX(GetTexGendv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexGenfv) - .type GL_PREFIX(GetTexGenfv), @function -GL_PREFIX(GetTexGenfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2232(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexGenfv), .-GL_PREFIX(GetTexGenfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexGeniv) - .type GL_PREFIX(GetTexGeniv), @function -GL_PREFIX(GetTexGeniv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexGeniv), .-GL_PREFIX(GetTexGeniv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexImage) - .type GL_PREFIX(GetTexImage), @function -GL_PREFIX(GetTexImage): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexImage), .-GL_PREFIX(GetTexImage) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexParameterfv) - .type GL_PREFIX(GetTexParameterfv), @function -GL_PREFIX(GetTexParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexParameterfv), .-GL_PREFIX(GetTexParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexParameteriv) - .type GL_PREFIX(GetTexParameteriv), @function -GL_PREFIX(GetTexParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexParameteriv), .-GL_PREFIX(GetTexParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexLevelParameterfv) - .type GL_PREFIX(GetTexLevelParameterfv), @function -GL_PREFIX(GetTexLevelParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2272(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexLevelParameterfv), .-GL_PREFIX(GetTexLevelParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetTexLevelParameteriv) - .type GL_PREFIX(GetTexLevelParameteriv), @function -GL_PREFIX(GetTexLevelParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTexLevelParameteriv), .-GL_PREFIX(GetTexLevelParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(IsEnabled) - .type GL_PREFIX(IsEnabled), @function -GL_PREFIX(IsEnabled): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2288(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsEnabled), .-GL_PREFIX(IsEnabled) - - .p2align 4,,15 - .globl GL_PREFIX(IsList) - .type GL_PREFIX(IsList), @function -GL_PREFIX(IsList): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsList), .-GL_PREFIX(IsList) - - .p2align 4,,15 - .globl GL_PREFIX(DepthRange) - .type GL_PREFIX(DepthRange), @function -GL_PREFIX(DepthRange): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2304(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DepthRange), .-GL_PREFIX(DepthRange) - - .p2align 4,,15 - .globl GL_PREFIX(Frustum) - .type GL_PREFIX(Frustum), @function -GL_PREFIX(Frustum): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - movq %xmm4, 32(%rsp) - movq %xmm5, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm5 - movq 32(%rsp), %xmm4 - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $56, %rsp - movq 2312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2312(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - movq %xmm4, 32(%rsp) - movq %xmm5, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm5 - movq 32(%rsp), %xmm4 - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $56, %rsp - movq 2312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Frustum), .-GL_PREFIX(Frustum) - - .p2align 4,,15 - .globl GL_PREFIX(LoadIdentity) - .type GL_PREFIX(LoadIdentity), @function -GL_PREFIX(LoadIdentity): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 2320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2320(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 2320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadIdentity), .-GL_PREFIX(LoadIdentity) - - .p2align 4,,15 - .globl GL_PREFIX(LoadMatrixf) - .type GL_PREFIX(LoadMatrixf), @function -GL_PREFIX(LoadMatrixf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadMatrixf), .-GL_PREFIX(LoadMatrixf) - - .p2align 4,,15 - .globl GL_PREFIX(LoadMatrixd) - .type GL_PREFIX(LoadMatrixd), @function -GL_PREFIX(LoadMatrixd): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadMatrixd), .-GL_PREFIX(LoadMatrixd) - - .p2align 4,,15 - .globl GL_PREFIX(MatrixMode) - .type GL_PREFIX(MatrixMode), @function -GL_PREFIX(MatrixMode): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2344(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MatrixMode), .-GL_PREFIX(MatrixMode) - - .p2align 4,,15 - .globl GL_PREFIX(MultMatrixf) - .type GL_PREFIX(MultMatrixf), @function -GL_PREFIX(MultMatrixf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2352(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultMatrixf), .-GL_PREFIX(MultMatrixf) - - .p2align 4,,15 - .globl GL_PREFIX(MultMatrixd) - .type GL_PREFIX(MultMatrixd), @function -GL_PREFIX(MultMatrixd): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultMatrixd), .-GL_PREFIX(MultMatrixd) - - .p2align 4,,15 - .globl GL_PREFIX(Ortho) - .type GL_PREFIX(Ortho), @function -GL_PREFIX(Ortho): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - movq %xmm4, 32(%rsp) - movq %xmm5, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm5 - movq 32(%rsp), %xmm4 - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $56, %rsp - movq 2368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2368(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - movq %xmm4, 32(%rsp) - movq %xmm5, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm5 - movq 32(%rsp), %xmm4 - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $56, %rsp - movq 2368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Ortho), .-GL_PREFIX(Ortho) - - .p2align 4,,15 - .globl GL_PREFIX(PopMatrix) - .type GL_PREFIX(PopMatrix), @function -GL_PREFIX(PopMatrix): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 2376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2376(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 2376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PopMatrix), .-GL_PREFIX(PopMatrix) - - .p2align 4,,15 - .globl GL_PREFIX(PushMatrix) - .type GL_PREFIX(PushMatrix), @function -GL_PREFIX(PushMatrix): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 2384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2384(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 2384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PushMatrix), .-GL_PREFIX(PushMatrix) - - .p2align 4,,15 - .globl GL_PREFIX(Rotated) - .type GL_PREFIX(Rotated), @function -GL_PREFIX(Rotated): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 2392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2392(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 2392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rotated), .-GL_PREFIX(Rotated) - - .p2align 4,,15 - .globl GL_PREFIX(Rotatef) - .type GL_PREFIX(Rotatef), @function -GL_PREFIX(Rotatef): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 2400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2400(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 2400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Rotatef), .-GL_PREFIX(Rotatef) - - .p2align 4,,15 - .globl GL_PREFIX(Scaled) - .type GL_PREFIX(Scaled), @function -GL_PREFIX(Scaled): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2408(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Scaled), .-GL_PREFIX(Scaled) - - .p2align 4,,15 - .globl GL_PREFIX(Scalef) - .type GL_PREFIX(Scalef), @function -GL_PREFIX(Scalef): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2416(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Scalef), .-GL_PREFIX(Scalef) - - .p2align 4,,15 - .globl GL_PREFIX(Translated) - .type GL_PREFIX(Translated), @function -GL_PREFIX(Translated): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2424(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Translated), .-GL_PREFIX(Translated) - - .p2align 4,,15 - .globl GL_PREFIX(Translatef) - .type GL_PREFIX(Translatef), @function -GL_PREFIX(Translatef): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2432(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Translatef), .-GL_PREFIX(Translatef) - - .p2align 4,,15 - .globl GL_PREFIX(Viewport) - .type GL_PREFIX(Viewport), @function -GL_PREFIX(Viewport): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Viewport), .-GL_PREFIX(Viewport) - - .p2align 4,,15 - .globl GL_PREFIX(ArrayElement) - .type GL_PREFIX(ArrayElement), @function -GL_PREFIX(ArrayElement): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2448(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ArrayElement), .-GL_PREFIX(ArrayElement) - - .p2align 4,,15 - .globl GL_PREFIX(BindTexture) - .type GL_PREFIX(BindTexture), @function -GL_PREFIX(BindTexture): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindTexture), .-GL_PREFIX(BindTexture) - - .p2align 4,,15 - .globl GL_PREFIX(ColorPointer) - .type GL_PREFIX(ColorPointer), @function -GL_PREFIX(ColorPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2464(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorPointer), .-GL_PREFIX(ColorPointer) - - .p2align 4,,15 - .globl GL_PREFIX(DisableClientState) - .type GL_PREFIX(DisableClientState), @function -GL_PREFIX(DisableClientState): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2472(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DisableClientState), .-GL_PREFIX(DisableClientState) - - .p2align 4,,15 - .globl GL_PREFIX(DrawArrays) - .type GL_PREFIX(DrawArrays), @function -GL_PREFIX(DrawArrays): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2480(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawArrays), .-GL_PREFIX(DrawArrays) - - .p2align 4,,15 - .globl GL_PREFIX(DrawElements) - .type GL_PREFIX(DrawElements), @function -GL_PREFIX(DrawElements): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2488(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawElements), .-GL_PREFIX(DrawElements) - - .p2align 4,,15 - .globl GL_PREFIX(EdgeFlagPointer) - .type GL_PREFIX(EdgeFlagPointer), @function -GL_PREFIX(EdgeFlagPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2496(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EdgeFlagPointer), .-GL_PREFIX(EdgeFlagPointer) - - .p2align 4,,15 - .globl GL_PREFIX(EnableClientState) - .type GL_PREFIX(EnableClientState), @function -GL_PREFIX(EnableClientState): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2504(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EnableClientState), .-GL_PREFIX(EnableClientState) - - .p2align 4,,15 - .globl GL_PREFIX(IndexPointer) - .type GL_PREFIX(IndexPointer), @function -GL_PREFIX(IndexPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2512(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IndexPointer), .-GL_PREFIX(IndexPointer) - - .p2align 4,,15 - .globl GL_PREFIX(Indexub) - .type GL_PREFIX(Indexub), @function -GL_PREFIX(Indexub): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2520(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexub), .-GL_PREFIX(Indexub) - - .p2align 4,,15 - .globl GL_PREFIX(Indexubv) - .type GL_PREFIX(Indexubv), @function -GL_PREFIX(Indexubv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2528(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Indexubv), .-GL_PREFIX(Indexubv) - - .p2align 4,,15 - .globl GL_PREFIX(InterleavedArrays) - .type GL_PREFIX(InterleavedArrays), @function -GL_PREFIX(InterleavedArrays): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(InterleavedArrays), .-GL_PREFIX(InterleavedArrays) - - .p2align 4,,15 - .globl GL_PREFIX(NormalPointer) - .type GL_PREFIX(NormalPointer), @function -GL_PREFIX(NormalPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(NormalPointer), .-GL_PREFIX(NormalPointer) - - .p2align 4,,15 - .globl GL_PREFIX(PolygonOffset) - .type GL_PREFIX(PolygonOffset), @function -GL_PREFIX(PolygonOffset): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2552(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 2552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonOffset), .-GL_PREFIX(PolygonOffset) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoordPointer) - .type GL_PREFIX(TexCoordPointer), @function -GL_PREFIX(TexCoordPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2560(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoordPointer), .-GL_PREFIX(TexCoordPointer) - - .p2align 4,,15 - .globl GL_PREFIX(VertexPointer) - .type GL_PREFIX(VertexPointer), @function -GL_PREFIX(VertexPointer): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexPointer), .-GL_PREFIX(VertexPointer) - - .p2align 4,,15 - .globl GL_PREFIX(AreTexturesResident) - .type GL_PREFIX(AreTexturesResident), @function -GL_PREFIX(AreTexturesResident): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2576(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AreTexturesResident), .-GL_PREFIX(AreTexturesResident) - - .p2align 4,,15 - .globl GL_PREFIX(CopyTexImage1D) - .type GL_PREFIX(CopyTexImage1D), @function -GL_PREFIX(CopyTexImage1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyTexImage1D), .-GL_PREFIX(CopyTexImage1D) - - .p2align 4,,15 - .globl GL_PREFIX(CopyTexImage2D) - .type GL_PREFIX(CopyTexImage2D), @function -GL_PREFIX(CopyTexImage2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2592(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyTexImage2D), .-GL_PREFIX(CopyTexImage2D) - - .p2align 4,,15 - .globl GL_PREFIX(CopyTexSubImage1D) - .type GL_PREFIX(CopyTexSubImage1D), @function -GL_PREFIX(CopyTexSubImage1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2600(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyTexSubImage1D), .-GL_PREFIX(CopyTexSubImage1D) - - .p2align 4,,15 - .globl GL_PREFIX(CopyTexSubImage2D) - .type GL_PREFIX(CopyTexSubImage2D), @function -GL_PREFIX(CopyTexSubImage2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2608(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyTexSubImage2D), .-GL_PREFIX(CopyTexSubImage2D) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteTextures) - .type GL_PREFIX(DeleteTextures), @function -GL_PREFIX(DeleteTextures): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteTextures), .-GL_PREFIX(DeleteTextures) - - .p2align 4,,15 - .globl GL_PREFIX(GenTextures) - .type GL_PREFIX(GenTextures), @function -GL_PREFIX(GenTextures): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2624(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenTextures), .-GL_PREFIX(GenTextures) - - .p2align 4,,15 - .globl GL_PREFIX(GetPointerv) - .type GL_PREFIX(GetPointerv), @function -GL_PREFIX(GetPointerv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 2632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2632(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 2632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetPointerv), .-GL_PREFIX(GetPointerv) - - .p2align 4,,15 - .globl GL_PREFIX(IsTexture) - .type GL_PREFIX(IsTexture), @function -GL_PREFIX(IsTexture): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2640(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsTexture), .-GL_PREFIX(IsTexture) - - .p2align 4,,15 - .globl GL_PREFIX(PrioritizeTextures) - .type GL_PREFIX(PrioritizeTextures), @function -GL_PREFIX(PrioritizeTextures): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PrioritizeTextures), .-GL_PREFIX(PrioritizeTextures) - - .p2align 4,,15 - .globl GL_PREFIX(TexSubImage1D) - .type GL_PREFIX(TexSubImage1D), @function -GL_PREFIX(TexSubImage1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2656(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexSubImage1D), .-GL_PREFIX(TexSubImage1D) - - .p2align 4,,15 - .globl GL_PREFIX(TexSubImage2D) - .type GL_PREFIX(TexSubImage2D), @function -GL_PREFIX(TexSubImage2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexSubImage2D), .-GL_PREFIX(TexSubImage2D) - - .p2align 4,,15 - .globl GL_PREFIX(PopClientAttrib) - .type GL_PREFIX(PopClientAttrib), @function -GL_PREFIX(PopClientAttrib): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 2672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2672(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 2672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PopClientAttrib), .-GL_PREFIX(PopClientAttrib) - - .p2align 4,,15 - .globl GL_PREFIX(PushClientAttrib) - .type GL_PREFIX(PushClientAttrib), @function -GL_PREFIX(PushClientAttrib): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PushClientAttrib), .-GL_PREFIX(PushClientAttrib) - - .p2align 4,,15 - .globl GL_PREFIX(BlendColor) - .type GL_PREFIX(BlendColor), @function -GL_PREFIX(BlendColor): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2688(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BlendColor), .-GL_PREFIX(BlendColor) - - .p2align 4,,15 - .globl GL_PREFIX(BlendEquation) - .type GL_PREFIX(BlendEquation), @function -GL_PREFIX(BlendEquation): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2696(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BlendEquation), .-GL_PREFIX(BlendEquation) - - .p2align 4,,15 - .globl GL_PREFIX(DrawRangeElements) - .type GL_PREFIX(DrawRangeElements), @function -GL_PREFIX(DrawRangeElements): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2704(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawRangeElements), .-GL_PREFIX(DrawRangeElements) - - .p2align 4,,15 - .globl GL_PREFIX(ColorTable) - .type GL_PREFIX(ColorTable), @function -GL_PREFIX(ColorTable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2712(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorTable), .-GL_PREFIX(ColorTable) - - .p2align 4,,15 - .globl GL_PREFIX(ColorTableParameterfv) - .type GL_PREFIX(ColorTableParameterfv), @function -GL_PREFIX(ColorTableParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorTableParameterfv), .-GL_PREFIX(ColorTableParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(ColorTableParameteriv) - .type GL_PREFIX(ColorTableParameteriv), @function -GL_PREFIX(ColorTableParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2728(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorTableParameteriv), .-GL_PREFIX(ColorTableParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(CopyColorTable) - .type GL_PREFIX(CopyColorTable), @function -GL_PREFIX(CopyColorTable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2736(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyColorTable), .-GL_PREFIX(CopyColorTable) - - .p2align 4,,15 - .globl GL_PREFIX(GetColorTable) - .type GL_PREFIX(GetColorTable), @function -GL_PREFIX(GetColorTable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2744(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetColorTable), .-GL_PREFIX(GetColorTable) - - .p2align 4,,15 - .globl GL_PREFIX(GetColorTableParameterfv) - .type GL_PREFIX(GetColorTableParameterfv), @function -GL_PREFIX(GetColorTableParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2752(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetColorTableParameterfv), .-GL_PREFIX(GetColorTableParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetColorTableParameteriv) - .type GL_PREFIX(GetColorTableParameteriv), @function -GL_PREFIX(GetColorTableParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2760(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetColorTableParameteriv), .-GL_PREFIX(GetColorTableParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(ColorSubTable) - .type GL_PREFIX(ColorSubTable), @function -GL_PREFIX(ColorSubTable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2768(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorSubTable), .-GL_PREFIX(ColorSubTable) - - .p2align 4,,15 - .globl GL_PREFIX(CopyColorSubTable) - .type GL_PREFIX(CopyColorSubTable), @function -GL_PREFIX(CopyColorSubTable): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2776(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyColorSubTable), .-GL_PREFIX(CopyColorSubTable) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionFilter1D) - .type GL_PREFIX(ConvolutionFilter1D), @function -GL_PREFIX(ConvolutionFilter1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2784(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionFilter1D), .-GL_PREFIX(ConvolutionFilter1D) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionFilter2D) - .type GL_PREFIX(ConvolutionFilter2D), @function -GL_PREFIX(ConvolutionFilter2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2792(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionFilter2D), .-GL_PREFIX(ConvolutionFilter2D) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionParameterf) - .type GL_PREFIX(ConvolutionParameterf), @function -GL_PREFIX(ConvolutionParameterf): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 2800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2800(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $24, %rsp - movq 2800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionParameterf), .-GL_PREFIX(ConvolutionParameterf) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionParameterfv) - .type GL_PREFIX(ConvolutionParameterfv), @function -GL_PREFIX(ConvolutionParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2808(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionParameterfv), .-GL_PREFIX(ConvolutionParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionParameteri) - .type GL_PREFIX(ConvolutionParameteri), @function -GL_PREFIX(ConvolutionParameteri): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2816(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionParameteri), .-GL_PREFIX(ConvolutionParameteri) - - .p2align 4,,15 - .globl GL_PREFIX(ConvolutionParameteriv) - .type GL_PREFIX(ConvolutionParameteriv), @function -GL_PREFIX(ConvolutionParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2824(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ConvolutionParameteriv), .-GL_PREFIX(ConvolutionParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(CopyConvolutionFilter1D) - .type GL_PREFIX(CopyConvolutionFilter1D), @function -GL_PREFIX(CopyConvolutionFilter1D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2832(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyConvolutionFilter1D), .-GL_PREFIX(CopyConvolutionFilter1D) - - .p2align 4,,15 - .globl GL_PREFIX(CopyConvolutionFilter2D) - .type GL_PREFIX(CopyConvolutionFilter2D), @function -GL_PREFIX(CopyConvolutionFilter2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2840(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyConvolutionFilter2D), .-GL_PREFIX(CopyConvolutionFilter2D) - - .p2align 4,,15 - .globl GL_PREFIX(GetConvolutionFilter) - .type GL_PREFIX(GetConvolutionFilter), @function -GL_PREFIX(GetConvolutionFilter): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetConvolutionFilter), .-GL_PREFIX(GetConvolutionFilter) - - .p2align 4,,15 - .globl GL_PREFIX(GetConvolutionParameterfv) - .type GL_PREFIX(GetConvolutionParameterfv), @function -GL_PREFIX(GetConvolutionParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2856(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetConvolutionParameterfv), .-GL_PREFIX(GetConvolutionParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetConvolutionParameteriv) - .type GL_PREFIX(GetConvolutionParameteriv), @function -GL_PREFIX(GetConvolutionParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetConvolutionParameteriv), .-GL_PREFIX(GetConvolutionParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(GetSeparableFilter) - .type GL_PREFIX(GetSeparableFilter), @function -GL_PREFIX(GetSeparableFilter): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2872(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetSeparableFilter), .-GL_PREFIX(GetSeparableFilter) - - .p2align 4,,15 - .globl GL_PREFIX(SeparableFilter2D) - .type GL_PREFIX(SeparableFilter2D), @function -GL_PREFIX(SeparableFilter2D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2880(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SeparableFilter2D), .-GL_PREFIX(SeparableFilter2D) - - .p2align 4,,15 - .globl GL_PREFIX(GetHistogram) - .type GL_PREFIX(GetHistogram), @function -GL_PREFIX(GetHistogram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetHistogram), .-GL_PREFIX(GetHistogram) - - .p2align 4,,15 - .globl GL_PREFIX(GetHistogramParameterfv) - .type GL_PREFIX(GetHistogramParameterfv), @function -GL_PREFIX(GetHistogramParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2896(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetHistogramParameterfv), .-GL_PREFIX(GetHistogramParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetHistogramParameteriv) - .type GL_PREFIX(GetHistogramParameteriv), @function -GL_PREFIX(GetHistogramParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2904(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetHistogramParameteriv), .-GL_PREFIX(GetHistogramParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMinmax) - .type GL_PREFIX(GetMinmax), @function -GL_PREFIX(GetMinmax): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMinmax), .-GL_PREFIX(GetMinmax) - - .p2align 4,,15 - .globl GL_PREFIX(GetMinmaxParameterfv) - .type GL_PREFIX(GetMinmaxParameterfv), @function -GL_PREFIX(GetMinmaxParameterfv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2920(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMinmaxParameterfv), .-GL_PREFIX(GetMinmaxParameterfv) - - .p2align 4,,15 - .globl GL_PREFIX(GetMinmaxParameteriv) - .type GL_PREFIX(GetMinmaxParameteriv), @function -GL_PREFIX(GetMinmaxParameteriv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetMinmaxParameteriv), .-GL_PREFIX(GetMinmaxParameteriv) - - .p2align 4,,15 - .globl GL_PREFIX(Histogram) - .type GL_PREFIX(Histogram), @function -GL_PREFIX(Histogram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2936(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Histogram), .-GL_PREFIX(Histogram) - - .p2align 4,,15 - .globl GL_PREFIX(Minmax) - .type GL_PREFIX(Minmax), @function -GL_PREFIX(Minmax): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 2944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2944(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 2944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Minmax), .-GL_PREFIX(Minmax) - - .p2align 4,,15 - .globl GL_PREFIX(ResetHistogram) - .type GL_PREFIX(ResetHistogram), @function -GL_PREFIX(ResetHistogram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ResetHistogram), .-GL_PREFIX(ResetHistogram) - - .p2align 4,,15 - .globl GL_PREFIX(ResetMinmax) - .type GL_PREFIX(ResetMinmax), @function -GL_PREFIX(ResetMinmax): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2960(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ResetMinmax), .-GL_PREFIX(ResetMinmax) - - .p2align 4,,15 - .globl GL_PREFIX(TexImage3D) - .type GL_PREFIX(TexImage3D), @function -GL_PREFIX(TexImage3D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2968(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexImage3D), .-GL_PREFIX(TexImage3D) - - .p2align 4,,15 - .globl GL_PREFIX(TexSubImage3D) - .type GL_PREFIX(TexSubImage3D), @function -GL_PREFIX(TexSubImage3D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2976(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexSubImage3D), .-GL_PREFIX(TexSubImage3D) - - .p2align 4,,15 - .globl GL_PREFIX(CopyTexSubImage3D) - .type GL_PREFIX(CopyTexSubImage3D), @function -GL_PREFIX(CopyTexSubImage3D): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2984(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 2984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CopyTexSubImage3D), .-GL_PREFIX(CopyTexSubImage3D) - - .p2align 4,,15 - .globl GL_PREFIX(ActiveTextureARB) - .type GL_PREFIX(ActiveTextureARB), @function -GL_PREFIX(ActiveTextureARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 2992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 2992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 2992(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 2992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ActiveTextureARB), .-GL_PREFIX(ActiveTextureARB) - - .p2align 4,,15 - .globl GL_PREFIX(ClientActiveTextureARB) - .type GL_PREFIX(ClientActiveTextureARB), @function -GL_PREFIX(ClientActiveTextureARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ClientActiveTextureARB), .-GL_PREFIX(ClientActiveTextureARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1dARB) - .type GL_PREFIX(MultiTexCoord1dARB), @function -GL_PREFIX(MultiTexCoord1dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3008(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1dARB), .-GL_PREFIX(MultiTexCoord1dARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1dvARB) - .type GL_PREFIX(MultiTexCoord1dvARB), @function -GL_PREFIX(MultiTexCoord1dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1dvARB), .-GL_PREFIX(MultiTexCoord1dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1fARB) - .type GL_PREFIX(MultiTexCoord1fARB), @function -GL_PREFIX(MultiTexCoord1fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3024(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1fARB), .-GL_PREFIX(MultiTexCoord1fARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1fvARB) - .type GL_PREFIX(MultiTexCoord1fvARB), @function -GL_PREFIX(MultiTexCoord1fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1fvARB), .-GL_PREFIX(MultiTexCoord1fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1iARB) - .type GL_PREFIX(MultiTexCoord1iARB), @function -GL_PREFIX(MultiTexCoord1iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1iARB), .-GL_PREFIX(MultiTexCoord1iARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1ivARB) - .type GL_PREFIX(MultiTexCoord1ivARB), @function -GL_PREFIX(MultiTexCoord1ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1ivARB), .-GL_PREFIX(MultiTexCoord1ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1sARB) - .type GL_PREFIX(MultiTexCoord1sARB), @function -GL_PREFIX(MultiTexCoord1sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3056(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1sARB), .-GL_PREFIX(MultiTexCoord1sARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord1svARB) - .type GL_PREFIX(MultiTexCoord1svARB), @function -GL_PREFIX(MultiTexCoord1svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord1svARB), .-GL_PREFIX(MultiTexCoord1svARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2dARB) - .type GL_PREFIX(MultiTexCoord2dARB), @function -GL_PREFIX(MultiTexCoord2dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3072(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2dARB), .-GL_PREFIX(MultiTexCoord2dARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2dvARB) - .type GL_PREFIX(MultiTexCoord2dvARB), @function -GL_PREFIX(MultiTexCoord2dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2dvARB), .-GL_PREFIX(MultiTexCoord2dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2fARB) - .type GL_PREFIX(MultiTexCoord2fARB), @function -GL_PREFIX(MultiTexCoord2fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3088(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2fARB), .-GL_PREFIX(MultiTexCoord2fARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2fvARB) - .type GL_PREFIX(MultiTexCoord2fvARB), @function -GL_PREFIX(MultiTexCoord2fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2fvARB), .-GL_PREFIX(MultiTexCoord2fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2iARB) - .type GL_PREFIX(MultiTexCoord2iARB), @function -GL_PREFIX(MultiTexCoord2iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2iARB), .-GL_PREFIX(MultiTexCoord2iARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2ivARB) - .type GL_PREFIX(MultiTexCoord2ivARB), @function -GL_PREFIX(MultiTexCoord2ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2ivARB), .-GL_PREFIX(MultiTexCoord2ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2sARB) - .type GL_PREFIX(MultiTexCoord2sARB), @function -GL_PREFIX(MultiTexCoord2sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2sARB), .-GL_PREFIX(MultiTexCoord2sARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord2svARB) - .type GL_PREFIX(MultiTexCoord2svARB), @function -GL_PREFIX(MultiTexCoord2svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord2svARB), .-GL_PREFIX(MultiTexCoord2svARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3dARB) - .type GL_PREFIX(MultiTexCoord3dARB), @function -GL_PREFIX(MultiTexCoord3dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3136(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3dARB), .-GL_PREFIX(MultiTexCoord3dARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3dvARB) - .type GL_PREFIX(MultiTexCoord3dvARB), @function -GL_PREFIX(MultiTexCoord3dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3dvARB), .-GL_PREFIX(MultiTexCoord3dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3fARB) - .type GL_PREFIX(MultiTexCoord3fARB), @function -GL_PREFIX(MultiTexCoord3fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3152(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3fARB), .-GL_PREFIX(MultiTexCoord3fARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3fvARB) - .type GL_PREFIX(MultiTexCoord3fvARB), @function -GL_PREFIX(MultiTexCoord3fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3160(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3fvARB), .-GL_PREFIX(MultiTexCoord3fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3iARB) - .type GL_PREFIX(MultiTexCoord3iARB), @function -GL_PREFIX(MultiTexCoord3iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3iARB), .-GL_PREFIX(MultiTexCoord3iARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3ivARB) - .type GL_PREFIX(MultiTexCoord3ivARB), @function -GL_PREFIX(MultiTexCoord3ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3ivARB), .-GL_PREFIX(MultiTexCoord3ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3sARB) - .type GL_PREFIX(MultiTexCoord3sARB), @function -GL_PREFIX(MultiTexCoord3sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3sARB), .-GL_PREFIX(MultiTexCoord3sARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord3svARB) - .type GL_PREFIX(MultiTexCoord3svARB), @function -GL_PREFIX(MultiTexCoord3svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord3svARB), .-GL_PREFIX(MultiTexCoord3svARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4dARB) - .type GL_PREFIX(MultiTexCoord4dARB), @function -GL_PREFIX(MultiTexCoord4dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3200(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4dARB), .-GL_PREFIX(MultiTexCoord4dARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4dvARB) - .type GL_PREFIX(MultiTexCoord4dvARB), @function -GL_PREFIX(MultiTexCoord4dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4dvARB), .-GL_PREFIX(MultiTexCoord4dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4fARB) - .type GL_PREFIX(MultiTexCoord4fARB), @function -GL_PREFIX(MultiTexCoord4fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3216(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4fARB), .-GL_PREFIX(MultiTexCoord4fARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4fvARB) - .type GL_PREFIX(MultiTexCoord4fvARB), @function -GL_PREFIX(MultiTexCoord4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3224(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4fvARB), .-GL_PREFIX(MultiTexCoord4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4iARB) - .type GL_PREFIX(MultiTexCoord4iARB), @function -GL_PREFIX(MultiTexCoord4iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3232(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4iARB), .-GL_PREFIX(MultiTexCoord4iARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4ivARB) - .type GL_PREFIX(MultiTexCoord4ivARB), @function -GL_PREFIX(MultiTexCoord4ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4ivARB), .-GL_PREFIX(MultiTexCoord4ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4sARB) - .type GL_PREFIX(MultiTexCoord4sARB), @function -GL_PREFIX(MultiTexCoord4sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4sARB), .-GL_PREFIX(MultiTexCoord4sARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultiTexCoord4svARB) - .type GL_PREFIX(MultiTexCoord4svARB), @function -GL_PREFIX(MultiTexCoord4svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB) - - .p2align 4,,15 - .globl GL_PREFIX(AttachShader) - .type GL_PREFIX(AttachShader), @function -GL_PREFIX(AttachShader): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader) - - .p2align 4,,15 - .globl GL_PREFIX(CreateProgram) - .type GL_PREFIX(CreateProgram), @function -GL_PREFIX(CreateProgram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 3272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3272(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 3272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram) - - .p2align 4,,15 - .globl GL_PREFIX(CreateShader) - .type GL_PREFIX(CreateShader), @function -GL_PREFIX(CreateShader): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteProgram) - .type GL_PREFIX(DeleteProgram), @function -GL_PREFIX(DeleteProgram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3288(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteShader) - .type GL_PREFIX(DeleteShader), @function -GL_PREFIX(DeleteShader): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader) - - .p2align 4,,15 - .globl GL_PREFIX(DetachShader) - .type GL_PREFIX(DetachShader), @function -GL_PREFIX(DetachShader): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3304(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader) - - .p2align 4,,15 - .globl GL_PREFIX(GetAttachedShaders) - .type GL_PREFIX(GetAttachedShaders), @function -GL_PREFIX(GetAttachedShaders): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3312(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramInfoLog) - .type GL_PREFIX(GetProgramInfoLog), @function -GL_PREFIX(GetProgramInfoLog): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3320(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramiv) - .type GL_PREFIX(GetProgramiv), @function -GL_PREFIX(GetProgramiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv) - - .p2align 4,,15 - .globl GL_PREFIX(GetShaderInfoLog) - .type GL_PREFIX(GetShaderInfoLog), @function -GL_PREFIX(GetShaderInfoLog): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog) - - .p2align 4,,15 - .globl GL_PREFIX(GetShaderiv) - .type GL_PREFIX(GetShaderiv), @function -GL_PREFIX(GetShaderiv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3344(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv) - - .p2align 4,,15 - .globl GL_PREFIX(IsProgram) - .type GL_PREFIX(IsProgram), @function -GL_PREFIX(IsProgram): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3352(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram) - - .p2align 4,,15 - .globl GL_PREFIX(IsShader) - .type GL_PREFIX(IsShader), @function -GL_PREFIX(IsShader): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader) - - .p2align 4,,15 - .globl GL_PREFIX(StencilFuncSeparate) - .type GL_PREFIX(StencilFuncSeparate), @function -GL_PREFIX(StencilFuncSeparate): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3368(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate) - - .p2align 4,,15 - .globl GL_PREFIX(StencilMaskSeparate) - .type GL_PREFIX(StencilMaskSeparate), @function -GL_PREFIX(StencilMaskSeparate): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3376(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate) - - .p2align 4,,15 - .globl GL_PREFIX(StencilOpSeparate) - .type GL_PREFIX(StencilOpSeparate), @function -GL_PREFIX(StencilOpSeparate): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3384(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix2x3fv) - .type GL_PREFIX(UniformMatrix2x3fv), @function -GL_PREFIX(UniformMatrix2x3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3392(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix2x4fv) - .type GL_PREFIX(UniformMatrix2x4fv), @function -GL_PREFIX(UniformMatrix2x4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3400(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix3x2fv) - .type GL_PREFIX(UniformMatrix3x2fv), @function -GL_PREFIX(UniformMatrix3x2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3408(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix3x4fv) - .type GL_PREFIX(UniformMatrix3x4fv), @function -GL_PREFIX(UniformMatrix3x4fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3416(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix4x2fv) - .type GL_PREFIX(UniformMatrix4x2fv), @function -GL_PREFIX(UniformMatrix4x2fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3424(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix4x3fv) - .type GL_PREFIX(UniformMatrix4x3fv), @function -GL_PREFIX(UniformMatrix4x3fv): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3432(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv) - - .p2align 4,,15 - .globl GL_PREFIX(LoadTransposeMatrixdARB) - .type GL_PREFIX(LoadTransposeMatrixdARB), @function -GL_PREFIX(LoadTransposeMatrixdARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB) - - .p2align 4,,15 - .globl GL_PREFIX(LoadTransposeMatrixfARB) - .type GL_PREFIX(LoadTransposeMatrixfARB), @function -GL_PREFIX(LoadTransposeMatrixfARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3448(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultTransposeMatrixdARB) - .type GL_PREFIX(MultTransposeMatrixdARB), @function -GL_PREFIX(MultTransposeMatrixdARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB) - - .p2align 4,,15 - .globl GL_PREFIX(MultTransposeMatrixfARB) - .type GL_PREFIX(MultTransposeMatrixfARB), @function -GL_PREFIX(MultTransposeMatrixfARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3464(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB) - - .p2align 4,,15 - .globl GL_PREFIX(SampleCoverageARB) - .type GL_PREFIX(SampleCoverageARB), @function -GL_PREFIX(SampleCoverageARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3472(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage1DARB) - .type GL_PREFIX(CompressedTexImage1DARB), @function -GL_PREFIX(CompressedTexImage1DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3480(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage2DARB) - .type GL_PREFIX(CompressedTexImage2DARB), @function -GL_PREFIX(CompressedTexImage2DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3488(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage3DARB) - .type GL_PREFIX(CompressedTexImage3DARB), @function -GL_PREFIX(CompressedTexImage3DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3496(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage1DARB) - .type GL_PREFIX(CompressedTexSubImage1DARB), @function -GL_PREFIX(CompressedTexSubImage1DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3504(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage2DARB) - .type GL_PREFIX(CompressedTexSubImage2DARB), @function -GL_PREFIX(CompressedTexSubImage2DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3512(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage3DARB) - .type GL_PREFIX(CompressedTexSubImage3DARB), @function -GL_PREFIX(CompressedTexSubImage3DARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3520(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetCompressedTexImageARB) - .type GL_PREFIX(GetCompressedTexImageARB), @function -GL_PREFIX(GetCompressedTexImageARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3528(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB) - - .p2align 4,,15 - .globl GL_PREFIX(DisableVertexAttribArrayARB) - .type GL_PREFIX(DisableVertexAttribArrayARB), @function -GL_PREFIX(DisableVertexAttribArrayARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB) - - .p2align 4,,15 - .globl GL_PREFIX(EnableVertexAttribArrayARB) - .type GL_PREFIX(EnableVertexAttribArrayARB), @function -GL_PREFIX(EnableVertexAttribArrayARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 3544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 3544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramEnvParameterdvARB) - .type GL_PREFIX(GetProgramEnvParameterdvARB), @function -GL_PREFIX(GetProgramEnvParameterdvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3552(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramEnvParameterfvARB) - .type GL_PREFIX(GetProgramEnvParameterfvARB), @function -GL_PREFIX(GetProgramEnvParameterfvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3560(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramLocalParameterdvARB) - .type GL_PREFIX(GetProgramLocalParameterdvARB), @function -GL_PREFIX(GetProgramLocalParameterdvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramLocalParameterfvARB) - .type GL_PREFIX(GetProgramLocalParameterfvARB), @function -GL_PREFIX(GetProgramLocalParameterfvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3576(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramStringARB) - .type GL_PREFIX(GetProgramStringARB), @function -GL_PREFIX(GetProgramStringARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramivARB) - .type GL_PREFIX(GetProgramivARB), @function -GL_PREFIX(GetProgramivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3592(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribdvARB) - .type GL_PREFIX(GetVertexAttribdvARB), @function -GL_PREFIX(GetVertexAttribdvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3600(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribfvARB) - .type GL_PREFIX(GetVertexAttribfvARB), @function -GL_PREFIX(GetVertexAttribfvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3608(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribivARB) - .type GL_PREFIX(GetVertexAttribivARB), @function -GL_PREFIX(GetVertexAttribivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4dARB) - .type GL_PREFIX(ProgramEnvParameter4dARB), @function -GL_PREFIX(ProgramEnvParameter4dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3624(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4dvARB) - .type GL_PREFIX(ProgramEnvParameter4dvARB), @function -GL_PREFIX(ProgramEnvParameter4dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3632(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4fARB) - .type GL_PREFIX(ProgramEnvParameter4fARB), @function -GL_PREFIX(ProgramEnvParameter4fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3640(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4fvARB) - .type GL_PREFIX(ProgramEnvParameter4fvARB), @function -GL_PREFIX(ProgramEnvParameter4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4dARB) - .type GL_PREFIX(ProgramLocalParameter4dARB), @function -GL_PREFIX(ProgramLocalParameter4dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3656(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4dvARB) - .type GL_PREFIX(ProgramLocalParameter4dvARB), @function -GL_PREFIX(ProgramLocalParameter4dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4fARB) - .type GL_PREFIX(ProgramLocalParameter4fARB), @function -GL_PREFIX(ProgramLocalParameter4fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3672(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) - call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4fvARB) - .type GL_PREFIX(ProgramLocalParameter4fvARB), @function -GL_PREFIX(ProgramLocalParameter4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramStringARB) - .type GL_PREFIX(ProgramStringARB), @function -GL_PREFIX(ProgramStringARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3688(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dARB) - .type GL_PREFIX(VertexAttrib1dARB), @function -GL_PREFIX(VertexAttrib1dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3696(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dvARB) - .type GL_PREFIX(VertexAttrib1dvARB), @function -GL_PREFIX(VertexAttrib1dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3704(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fARB) - .type GL_PREFIX(VertexAttrib1fARB), @function -GL_PREFIX(VertexAttrib1fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3712(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fvARB) - .type GL_PREFIX(VertexAttrib1fvARB), @function -GL_PREFIX(VertexAttrib1fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1sARB) - .type GL_PREFIX(VertexAttrib1sARB), @function -GL_PREFIX(VertexAttrib1sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3728(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1svARB) - .type GL_PREFIX(VertexAttrib1svARB), @function -GL_PREFIX(VertexAttrib1svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3736(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dARB) - .type GL_PREFIX(VertexAttrib2dARB), @function -GL_PREFIX(VertexAttrib2dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3744(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dvARB) - .type GL_PREFIX(VertexAttrib2dvARB), @function -GL_PREFIX(VertexAttrib2dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3752(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fARB) - .type GL_PREFIX(VertexAttrib2fARB), @function -GL_PREFIX(VertexAttrib2fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3760(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 3760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fvARB) - .type GL_PREFIX(VertexAttrib2fvARB), @function -GL_PREFIX(VertexAttrib2fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3768(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2sARB) - .type GL_PREFIX(VertexAttrib2sARB), @function -GL_PREFIX(VertexAttrib2sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 3776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3776(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 3776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2svARB) - .type GL_PREFIX(VertexAttrib2svARB), @function -GL_PREFIX(VertexAttrib2svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3784(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dARB) - .type GL_PREFIX(VertexAttrib3dARB), @function -GL_PREFIX(VertexAttrib3dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3792(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dvARB) - .type GL_PREFIX(VertexAttrib3dvARB), @function -GL_PREFIX(VertexAttrib3dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3800(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fARB) - .type GL_PREFIX(VertexAttrib3fARB), @function -GL_PREFIX(VertexAttrib3fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3808(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fvARB) - .type GL_PREFIX(VertexAttrib3fvARB), @function -GL_PREFIX(VertexAttrib3fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3816(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3sARB) - .type GL_PREFIX(VertexAttrib3sARB), @function -GL_PREFIX(VertexAttrib3sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3824(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3svARB) - .type GL_PREFIX(VertexAttrib3svARB), @function -GL_PREFIX(VertexAttrib3svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3832(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NbvARB) - .type GL_PREFIX(VertexAttrib4NbvARB), @function -GL_PREFIX(VertexAttrib4NbvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3840(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NivARB) - .type GL_PREFIX(VertexAttrib4NivARB), @function -GL_PREFIX(VertexAttrib4NivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NsvARB) - .type GL_PREFIX(VertexAttrib4NsvARB), @function -GL_PREFIX(VertexAttrib4NsvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3856(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NubARB) - .type GL_PREFIX(VertexAttrib4NubARB), @function -GL_PREFIX(VertexAttrib4NubARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NubvARB) - .type GL_PREFIX(VertexAttrib4NubvARB), @function -GL_PREFIX(VertexAttrib4NubvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3872(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NuivARB) - .type GL_PREFIX(VertexAttrib4NuivARB), @function -GL_PREFIX(VertexAttrib4NuivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3880(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NusvARB) - .type GL_PREFIX(VertexAttrib4NusvARB), @function -GL_PREFIX(VertexAttrib4NusvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4bvARB) - .type GL_PREFIX(VertexAttrib4bvARB), @function -GL_PREFIX(VertexAttrib4bvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3896(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dARB) - .type GL_PREFIX(VertexAttrib4dARB), @function -GL_PREFIX(VertexAttrib4dARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3904(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dvARB) - .type GL_PREFIX(VertexAttrib4dvARB), @function -GL_PREFIX(VertexAttrib4dvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fARB) - .type GL_PREFIX(VertexAttrib4fARB), @function -GL_PREFIX(VertexAttrib4fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3920(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 3920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fvARB) - .type GL_PREFIX(VertexAttrib4fvARB), @function -GL_PREFIX(VertexAttrib4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ivARB) - .type GL_PREFIX(VertexAttrib4ivARB), @function -GL_PREFIX(VertexAttrib4ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3936(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4sARB) - .type GL_PREFIX(VertexAttrib4sARB), @function -GL_PREFIX(VertexAttrib4sARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3944(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4svARB) - .type GL_PREFIX(VertexAttrib4svARB), @function -GL_PREFIX(VertexAttrib4svARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ubvARB) - .type GL_PREFIX(VertexAttrib4ubvARB), @function -GL_PREFIX(VertexAttrib4ubvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3960(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4uivARB) - .type GL_PREFIX(VertexAttrib4uivARB), @function -GL_PREFIX(VertexAttrib4uivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3968(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4usvARB) - .type GL_PREFIX(VertexAttrib4usvARB), @function -GL_PREFIX(VertexAttrib4usvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3976(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribPointerARB) - .type GL_PREFIX(VertexAttribPointerARB), @function -GL_PREFIX(VertexAttribPointerARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3984(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 3984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB) - - .p2align 4,,15 - .globl GL_PREFIX(BindBufferARB) - .type GL_PREFIX(BindBufferARB), @function -GL_PREFIX(BindBufferARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 3992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 3992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 3992(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 3992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB) - - .p2align 4,,15 - .globl GL_PREFIX(BufferDataARB) - .type GL_PREFIX(BufferDataARB), @function -GL_PREFIX(BufferDataARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB) - - .p2align 4,,15 - .globl GL_PREFIX(BufferSubDataARB) - .type GL_PREFIX(BufferSubDataARB), @function -GL_PREFIX(BufferSubDataARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4008(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteBuffersARB) - .type GL_PREFIX(DeleteBuffersARB), @function -GL_PREFIX(DeleteBuffersARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB) - - .p2align 4,,15 - .globl GL_PREFIX(GenBuffersARB) - .type GL_PREFIX(GenBuffersARB), @function -GL_PREFIX(GenBuffersARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4024(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetBufferParameterivARB) - .type GL_PREFIX(GetBufferParameterivARB), @function -GL_PREFIX(GetBufferParameterivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetBufferPointervARB) - .type GL_PREFIX(GetBufferPointervARB), @function -GL_PREFIX(GetBufferPointervARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetBufferSubDataARB) - .type GL_PREFIX(GetBufferSubDataARB), @function -GL_PREFIX(GetBufferSubDataARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB) - - .p2align 4,,15 - .globl GL_PREFIX(IsBufferARB) - .type GL_PREFIX(IsBufferARB), @function -GL_PREFIX(IsBufferARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4056(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB) - - .p2align 4,,15 - .globl GL_PREFIX(MapBufferARB) - .type GL_PREFIX(MapBufferARB), @function -GL_PREFIX(MapBufferARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB) - - .p2align 4,,15 - .globl GL_PREFIX(UnmapBufferARB) - .type GL_PREFIX(UnmapBufferARB), @function -GL_PREFIX(UnmapBufferARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4072(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB) - - .p2align 4,,15 - .globl GL_PREFIX(BeginQueryARB) - .type GL_PREFIX(BeginQueryARB), @function -GL_PREFIX(BeginQueryARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteQueriesARB) - .type GL_PREFIX(DeleteQueriesARB), @function -GL_PREFIX(DeleteQueriesARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4088(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB) - - .p2align 4,,15 - .globl GL_PREFIX(EndQueryARB) - .type GL_PREFIX(EndQueryARB), @function -GL_PREFIX(EndQueryARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB) - - .p2align 4,,15 - .globl GL_PREFIX(GenQueriesARB) - .type GL_PREFIX(GenQueriesARB), @function -GL_PREFIX(GenQueriesARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetQueryObjectivARB) - .type GL_PREFIX(GetQueryObjectivARB), @function -GL_PREFIX(GetQueryObjectivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetQueryObjectuivARB) - .type GL_PREFIX(GetQueryObjectuivARB), @function -GL_PREFIX(GetQueryObjectuivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetQueryivARB) - .type GL_PREFIX(GetQueryivARB), @function -GL_PREFIX(GetQueryivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB) - - .p2align 4,,15 - .globl GL_PREFIX(IsQueryARB) - .type GL_PREFIX(IsQueryARB), @function -GL_PREFIX(IsQueryARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4136(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB) - - .p2align 4,,15 - .globl GL_PREFIX(AttachObjectARB) - .type GL_PREFIX(AttachObjectARB), @function -GL_PREFIX(AttachObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(CompileShaderARB) - .type GL_PREFIX(CompileShaderARB), @function -GL_PREFIX(CompileShaderARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4152(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB) - - .p2align 4,,15 - .globl GL_PREFIX(CreateProgramObjectARB) - .type GL_PREFIX(CreateProgramObjectARB), @function -GL_PREFIX(CreateProgramObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 4160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4160(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 4160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(CreateShaderObjectARB) - .type GL_PREFIX(CreateShaderObjectARB), @function -GL_PREFIX(CreateShaderObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteObjectARB) - .type GL_PREFIX(DeleteObjectARB), @function -GL_PREFIX(DeleteObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(DetachObjectARB) - .type GL_PREFIX(DetachObjectARB), @function -GL_PREFIX(DetachObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetActiveUniformARB) - .type GL_PREFIX(GetActiveUniformARB), @function -GL_PREFIX(GetActiveUniformARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetAttachedObjectsARB) - .type GL_PREFIX(GetAttachedObjectsARB), @function -GL_PREFIX(GetAttachedObjectsARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4200(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetHandleARB) - .type GL_PREFIX(GetHandleARB), @function -GL_PREFIX(GetHandleARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetInfoLogARB) - .type GL_PREFIX(GetInfoLogARB), @function -GL_PREFIX(GetInfoLogARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4216(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetObjectParameterfvARB) - .type GL_PREFIX(GetObjectParameterfvARB), @function -GL_PREFIX(GetObjectParameterfvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4224(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetObjectParameterivARB) - .type GL_PREFIX(GetObjectParameterivARB), @function -GL_PREFIX(GetObjectParameterivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4232(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetShaderSourceARB) - .type GL_PREFIX(GetShaderSourceARB), @function -GL_PREFIX(GetShaderSourceARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetUniformLocationARB) - .type GL_PREFIX(GetUniformLocationARB), @function -GL_PREFIX(GetUniformLocationARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetUniformfvARB) - .type GL_PREFIX(GetUniformfvARB), @function -GL_PREFIX(GetUniformfvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetUniformivARB) - .type GL_PREFIX(GetUniformivARB), @function -GL_PREFIX(GetUniformivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB) - - .p2align 4,,15 - .globl GL_PREFIX(LinkProgramARB) - .type GL_PREFIX(LinkProgramARB), @function -GL_PREFIX(LinkProgramARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4272(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB) - - .p2align 4,,15 - .globl GL_PREFIX(ShaderSourceARB) - .type GL_PREFIX(ShaderSourceARB), @function -GL_PREFIX(ShaderSourceARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform1fARB) - .type GL_PREFIX(Uniform1fARB), @function -GL_PREFIX(Uniform1fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4288(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform1fvARB) - .type GL_PREFIX(Uniform1fvARB), @function -GL_PREFIX(Uniform1fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform1iARB) - .type GL_PREFIX(Uniform1iARB), @function -GL_PREFIX(Uniform1iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4304(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform1ivARB) - .type GL_PREFIX(Uniform1ivARB), @function -GL_PREFIX(Uniform1ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4312(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform2fARB) - .type GL_PREFIX(Uniform2fARB), @function -GL_PREFIX(Uniform2fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4320(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform2fvARB) - .type GL_PREFIX(Uniform2fvARB), @function -GL_PREFIX(Uniform2fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform2iARB) - .type GL_PREFIX(Uniform2iARB), @function -GL_PREFIX(Uniform2iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform2ivARB) - .type GL_PREFIX(Uniform2ivARB), @function -GL_PREFIX(Uniform2ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4344(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform3fARB) - .type GL_PREFIX(Uniform3fARB), @function -GL_PREFIX(Uniform3fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 4352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4352(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 4352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform3fvARB) - .type GL_PREFIX(Uniform3fvARB), @function -GL_PREFIX(Uniform3fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform3iARB) - .type GL_PREFIX(Uniform3iARB), @function -GL_PREFIX(Uniform3iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4368(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform3ivARB) - .type GL_PREFIX(Uniform3ivARB), @function -GL_PREFIX(Uniform3ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4376(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform4fARB) - .type GL_PREFIX(Uniform4fARB), @function -GL_PREFIX(Uniform4fARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 4384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4384(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 4384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform4fvARB) - .type GL_PREFIX(Uniform4fvARB), @function -GL_PREFIX(Uniform4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4392(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform4iARB) - .type GL_PREFIX(Uniform4iARB), @function -GL_PREFIX(Uniform4iARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4400(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB) - - .p2align 4,,15 - .globl GL_PREFIX(Uniform4ivARB) - .type GL_PREFIX(Uniform4ivARB), @function -GL_PREFIX(Uniform4ivARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4408(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix2fvARB) - .type GL_PREFIX(UniformMatrix2fvARB), @function -GL_PREFIX(UniformMatrix2fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4416(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix3fvARB) - .type GL_PREFIX(UniformMatrix3fvARB), @function -GL_PREFIX(UniformMatrix3fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4424(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix4fvARB) - .type GL_PREFIX(UniformMatrix4fvARB), @function -GL_PREFIX(UniformMatrix4fvARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4432(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB) - - .p2align 4,,15 - .globl GL_PREFIX(UseProgramObjectARB) - .type GL_PREFIX(UseProgramObjectARB), @function -GL_PREFIX(UseProgramObjectARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB) - - .p2align 4,,15 - .globl GL_PREFIX(ValidateProgramARB) - .type GL_PREFIX(ValidateProgramARB), @function -GL_PREFIX(ValidateProgramARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4448(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB) - - .p2align 4,,15 - .globl GL_PREFIX(BindAttribLocationARB) - .type GL_PREFIX(BindAttribLocationARB), @function -GL_PREFIX(BindAttribLocationARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetActiveAttribARB) - .type GL_PREFIX(GetActiveAttribARB), @function -GL_PREFIX(GetActiveAttribARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4464(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB) - - .p2align 4,,15 - .globl GL_PREFIX(GetAttribLocationARB) - .type GL_PREFIX(GetAttribLocationARB), @function -GL_PREFIX(GetAttribLocationARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4472(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB) - - .p2align 4,,15 - .globl GL_PREFIX(DrawBuffersARB) - .type GL_PREFIX(DrawBuffersARB), @function -GL_PREFIX(DrawBuffersARB): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4480(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB) - - .p2align 4,,15 - .globl GL_PREFIX(PolygonOffsetEXT) - .type GL_PREFIX(PolygonOffsetEXT), @function -GL_PREFIX(PolygonOffsetEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4488(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_562) - .type GL_PREFIX(_dispatch_stub_562), @function - HIDDEN(GL_PREFIX(_dispatch_stub_562)) -GL_PREFIX(_dispatch_stub_562): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4496(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_563) - .type GL_PREFIX(_dispatch_stub_563), @function - HIDDEN(GL_PREFIX(_dispatch_stub_563)) -GL_PREFIX(_dispatch_stub_563): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4504(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_563), .-GL_PREFIX(_dispatch_stub_563) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_564) - .type GL_PREFIX(_dispatch_stub_564), @function - HIDDEN(GL_PREFIX(_dispatch_stub_564)) -GL_PREFIX(_dispatch_stub_564): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4512(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_564), .-GL_PREFIX(_dispatch_stub_564) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_565) - .type GL_PREFIX(_dispatch_stub_565), @function - HIDDEN(GL_PREFIX(_dispatch_stub_565)) -GL_PREFIX(_dispatch_stub_565): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4520(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_566) - .type GL_PREFIX(_dispatch_stub_566), @function - HIDDEN(GL_PREFIX(_dispatch_stub_566)) -GL_PREFIX(_dispatch_stub_566): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4528(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_567) - .type GL_PREFIX(_dispatch_stub_567), @function - HIDDEN(GL_PREFIX(_dispatch_stub_567)) -GL_PREFIX(_dispatch_stub_567): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_567), .-GL_PREFIX(_dispatch_stub_567) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_568) - .type GL_PREFIX(_dispatch_stub_568), @function - HIDDEN(GL_PREFIX(_dispatch_stub_568)) -GL_PREFIX(_dispatch_stub_568): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_568), .-GL_PREFIX(_dispatch_stub_568) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_569) - .type GL_PREFIX(_dispatch_stub_569), @function - HIDDEN(GL_PREFIX(_dispatch_stub_569)) -GL_PREFIX(_dispatch_stub_569): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4552(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569) - - .p2align 4,,15 - .globl GL_PREFIX(ColorPointerEXT) - .type GL_PREFIX(ColorPointerEXT), @function -GL_PREFIX(ColorPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4560(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(EdgeFlagPointerEXT) - .type GL_PREFIX(EdgeFlagPointerEXT), @function -GL_PREFIX(EdgeFlagPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(IndexPointerEXT) - .type GL_PREFIX(IndexPointerEXT), @function -GL_PREFIX(IndexPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4576(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(NormalPointerEXT) - .type GL_PREFIX(NormalPointerEXT), @function -GL_PREFIX(NormalPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(TexCoordPointerEXT) - .type GL_PREFIX(TexCoordPointerEXT), @function -GL_PREFIX(TexCoordPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4592(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(VertexPointerEXT) - .type GL_PREFIX(VertexPointerEXT), @function -GL_PREFIX(VertexPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4600(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(PointParameterfEXT) - .type GL_PREFIX(PointParameterfEXT), @function -GL_PREFIX(PointParameterfEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4608(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT) - - .p2align 4,,15 - .globl GL_PREFIX(PointParameterfvEXT) - .type GL_PREFIX(PointParameterfvEXT), @function -GL_PREFIX(PointParameterfvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(LockArraysEXT) - .type GL_PREFIX(LockArraysEXT), @function -GL_PREFIX(LockArraysEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4624(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT) - - .p2align 4,,15 - .globl GL_PREFIX(UnlockArraysEXT) - .type GL_PREFIX(UnlockArraysEXT), @function -GL_PREFIX(UnlockArraysEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 4632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4632(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 4632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_580) - .type GL_PREFIX(_dispatch_stub_580), @function - HIDDEN(GL_PREFIX(_dispatch_stub_580)) -GL_PREFIX(_dispatch_stub_580): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4640(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_581) - .type GL_PREFIX(_dispatch_stub_581), @function - HIDDEN(GL_PREFIX(_dispatch_stub_581)) -GL_PREFIX(_dispatch_stub_581): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3bEXT) - .type GL_PREFIX(SecondaryColor3bEXT), @function -GL_PREFIX(SecondaryColor3bEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4656(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3bvEXT) - .type GL_PREFIX(SecondaryColor3bvEXT), @function -GL_PREFIX(SecondaryColor3bvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3dEXT) - .type GL_PREFIX(SecondaryColor3dEXT), @function -GL_PREFIX(SecondaryColor3dEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4672(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3dvEXT) - .type GL_PREFIX(SecondaryColor3dvEXT), @function -GL_PREFIX(SecondaryColor3dvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3fEXT) - .type GL_PREFIX(SecondaryColor3fEXT), @function -GL_PREFIX(SecondaryColor3fEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4688(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3fvEXT) - .type GL_PREFIX(SecondaryColor3fvEXT), @function -GL_PREFIX(SecondaryColor3fvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4696(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3iEXT) - .type GL_PREFIX(SecondaryColor3iEXT), @function -GL_PREFIX(SecondaryColor3iEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4704(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3ivEXT) - .type GL_PREFIX(SecondaryColor3ivEXT), @function -GL_PREFIX(SecondaryColor3ivEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4712(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3sEXT) - .type GL_PREFIX(SecondaryColor3sEXT), @function -GL_PREFIX(SecondaryColor3sEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3svEXT) - .type GL_PREFIX(SecondaryColor3svEXT), @function -GL_PREFIX(SecondaryColor3svEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4728(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3ubEXT) - .type GL_PREFIX(SecondaryColor3ubEXT), @function -GL_PREFIX(SecondaryColor3ubEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4736(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3ubvEXT) - .type GL_PREFIX(SecondaryColor3ubvEXT), @function -GL_PREFIX(SecondaryColor3ubvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4744(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3uiEXT) - .type GL_PREFIX(SecondaryColor3uiEXT), @function -GL_PREFIX(SecondaryColor3uiEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4752(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3uivEXT) - .type GL_PREFIX(SecondaryColor3uivEXT), @function -GL_PREFIX(SecondaryColor3uivEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4760(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3usEXT) - .type GL_PREFIX(SecondaryColor3usEXT), @function -GL_PREFIX(SecondaryColor3usEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4768(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColor3usvEXT) - .type GL_PREFIX(SecondaryColor3usvEXT), @function -GL_PREFIX(SecondaryColor3usvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4776(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(SecondaryColorPointerEXT) - .type GL_PREFIX(SecondaryColorPointerEXT), @function -GL_PREFIX(SecondaryColorPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4784(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(MultiDrawArraysEXT) - .type GL_PREFIX(MultiDrawArraysEXT), @function -GL_PREFIX(MultiDrawArraysEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4792(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT) - - .p2align 4,,15 - .globl GL_PREFIX(MultiDrawElementsEXT) - .type GL_PREFIX(MultiDrawElementsEXT), @function -GL_PREFIX(MultiDrawElementsEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4800(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FogCoordPointerEXT) - .type GL_PREFIX(FogCoordPointerEXT), @function -GL_PREFIX(FogCoordPointerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4808(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FogCoorddEXT) - .type GL_PREFIX(FogCoorddEXT), @function -GL_PREFIX(FogCoorddEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 4816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4816(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 4816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FogCoorddvEXT) - .type GL_PREFIX(FogCoorddvEXT), @function -GL_PREFIX(FogCoorddvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4824(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FogCoordfEXT) - .type GL_PREFIX(FogCoordfEXT), @function -GL_PREFIX(FogCoordfEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $8, %rsp - movq %xmm0, (%rsp) - call _x86_64_get_dispatch@PLT - movq (%rsp), %xmm0 - addq $8, %rsp - movq 4832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4832(%rax), %r11 - jmp *%r11 -1: - subq $8, %rsp - movq %xmm0, (%rsp) - call _glapi_get_dispatch - movq (%rsp), %xmm0 - addq $8, %rsp - movq 4832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FogCoordfvEXT) - .type GL_PREFIX(FogCoordfvEXT), @function -GL_PREFIX(FogCoordfvEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4840(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_606) - .type GL_PREFIX(_dispatch_stub_606), @function - HIDDEN(GL_PREFIX(_dispatch_stub_606)) -GL_PREFIX(_dispatch_stub_606): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 4848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 4848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606) - - .p2align 4,,15 - .globl GL_PREFIX(BlendFuncSeparateEXT) - .type GL_PREFIX(BlendFuncSeparateEXT), @function -GL_PREFIX(BlendFuncSeparateEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4856(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FlushVertexArrayRangeNV) - .type GL_PREFIX(FlushVertexArrayRangeNV), @function -GL_PREFIX(FlushVertexArrayRangeNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 4864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4864(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 4864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexArrayRangeNV) - .type GL_PREFIX(VertexArrayRangeNV), @function -GL_PREFIX(VertexArrayRangeNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4872(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerInputNV) - .type GL_PREFIX(CombinerInputNV), @function -GL_PREFIX(CombinerInputNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4880(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerOutputNV) - .type GL_PREFIX(CombinerOutputNV), @function -GL_PREFIX(CombinerOutputNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerParameterfNV) - .type GL_PREFIX(CombinerParameterfNV), @function -GL_PREFIX(CombinerParameterfNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4896(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 4896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerParameterfvNV) - .type GL_PREFIX(CombinerParameterfvNV), @function -GL_PREFIX(CombinerParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4904(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerParameteriNV) - .type GL_PREFIX(CombinerParameteriNV), @function -GL_PREFIX(CombinerParameteriNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV) - - .p2align 4,,15 - .globl GL_PREFIX(CombinerParameterivNV) - .type GL_PREFIX(CombinerParameterivNV), @function -GL_PREFIX(CombinerParameterivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4920(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(FinalCombinerInputNV) - .type GL_PREFIX(FinalCombinerInputNV), @function -GL_PREFIX(FinalCombinerInputNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetCombinerInputParameterfvNV) - .type GL_PREFIX(GetCombinerInputParameterfvNV), @function -GL_PREFIX(GetCombinerInputParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4936(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetCombinerInputParameterivNV) - .type GL_PREFIX(GetCombinerInputParameterivNV), @function -GL_PREFIX(GetCombinerInputParameterivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4944(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetCombinerOutputParameterfvNV) - .type GL_PREFIX(GetCombinerOutputParameterfvNV), @function -GL_PREFIX(GetCombinerOutputParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetCombinerOutputParameterivNV) - .type GL_PREFIX(GetCombinerOutputParameterivNV), @function -GL_PREFIX(GetCombinerOutputParameterivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4960(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetFinalCombinerInputParameterfvNV) - .type GL_PREFIX(GetFinalCombinerInputParameterfvNV), @function -GL_PREFIX(GetFinalCombinerInputParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4968(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetFinalCombinerInputParameterivNV) - .type GL_PREFIX(GetFinalCombinerInputParameterivNV), @function -GL_PREFIX(GetFinalCombinerInputParameterivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4976(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(ResizeBuffersMESA) - .type GL_PREFIX(ResizeBuffersMESA), @function -GL_PREFIX(ResizeBuffersMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 4984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4984(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 4984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2dMESA) - .type GL_PREFIX(WindowPos2dMESA), @function -GL_PREFIX(WindowPos2dMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 4992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 4992(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2dvMESA) - .type GL_PREFIX(WindowPos2dvMESA), @function -GL_PREFIX(WindowPos2dvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2fMESA) - .type GL_PREFIX(WindowPos2fMESA), @function -GL_PREFIX(WindowPos2fMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5008(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2fvMESA) - .type GL_PREFIX(WindowPos2fvMESA), @function -GL_PREFIX(WindowPos2fvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2iMESA) - .type GL_PREFIX(WindowPos2iMESA), @function -GL_PREFIX(WindowPos2iMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5024(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2ivMESA) - .type GL_PREFIX(WindowPos2ivMESA), @function -GL_PREFIX(WindowPos2ivMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2sMESA) - .type GL_PREFIX(WindowPos2sMESA), @function -GL_PREFIX(WindowPos2sMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos2svMESA) - .type GL_PREFIX(WindowPos2svMESA), @function -GL_PREFIX(WindowPos2svMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3dMESA) - .type GL_PREFIX(WindowPos3dMESA), @function -GL_PREFIX(WindowPos3dMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5056(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3dvMESA) - .type GL_PREFIX(WindowPos3dvMESA), @function -GL_PREFIX(WindowPos3dvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3fMESA) - .type GL_PREFIX(WindowPos3fMESA), @function -GL_PREFIX(WindowPos3fMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5072(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 5072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3fvMESA) - .type GL_PREFIX(WindowPos3fvMESA), @function -GL_PREFIX(WindowPos3fvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3iMESA) - .type GL_PREFIX(WindowPos3iMESA), @function -GL_PREFIX(WindowPos3iMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5088(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3ivMESA) - .type GL_PREFIX(WindowPos3ivMESA), @function -GL_PREFIX(WindowPos3ivMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3sMESA) - .type GL_PREFIX(WindowPos3sMESA), @function -GL_PREFIX(WindowPos3sMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos3svMESA) - .type GL_PREFIX(WindowPos3svMESA), @function -GL_PREFIX(WindowPos3svMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4dMESA) - .type GL_PREFIX(WindowPos4dMESA), @function -GL_PREFIX(WindowPos4dMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 5120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5120(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 5120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4dvMESA) - .type GL_PREFIX(WindowPos4dvMESA), @function -GL_PREFIX(WindowPos4dvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4fMESA) - .type GL_PREFIX(WindowPos4fMESA), @function -GL_PREFIX(WindowPos4fMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 5136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5136(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) - movq %xmm2, 16(%rsp) - movq %xmm3, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm3 - movq 16(%rsp), %xmm2 - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $40, %rsp - movq 5136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4fvMESA) - .type GL_PREFIX(WindowPos4fvMESA), @function -GL_PREFIX(WindowPos4fvMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4iMESA) - .type GL_PREFIX(WindowPos4iMESA), @function -GL_PREFIX(WindowPos4iMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5152(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4ivMESA) - .type GL_PREFIX(WindowPos4ivMESA), @function -GL_PREFIX(WindowPos4ivMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5160(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5160(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5160(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5160(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4sMESA) - .type GL_PREFIX(WindowPos4sMESA), @function -GL_PREFIX(WindowPos4sMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5168(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5168(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5168(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5168(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA) - - .p2align 4,,15 - .globl GL_PREFIX(WindowPos4svMESA) - .type GL_PREFIX(WindowPos4svMESA), @function -GL_PREFIX(WindowPos4svMESA): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5176(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5176(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5176(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5176(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_648) - .type GL_PREFIX(_dispatch_stub_648), @function - HIDDEN(GL_PREFIX(_dispatch_stub_648)) -GL_PREFIX(_dispatch_stub_648): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5184(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5184(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5184(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5184(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_649) - .type GL_PREFIX(_dispatch_stub_649), @function - HIDDEN(GL_PREFIX(_dispatch_stub_649)) -GL_PREFIX(_dispatch_stub_649): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5192(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5192(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5192(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5192(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_650) - .type GL_PREFIX(_dispatch_stub_650), @function - HIDDEN(GL_PREFIX(_dispatch_stub_650)) -GL_PREFIX(_dispatch_stub_650): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5200(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5200(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5200(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5200(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_651) - .type GL_PREFIX(_dispatch_stub_651), @function - HIDDEN(GL_PREFIX(_dispatch_stub_651)) -GL_PREFIX(_dispatch_stub_651): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5208(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5208(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5208(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5208(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_652) - .type GL_PREFIX(_dispatch_stub_652), @function - HIDDEN(GL_PREFIX(_dispatch_stub_652)) -GL_PREFIX(_dispatch_stub_652): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5216(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5216(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5216(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5216(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_653) - .type GL_PREFIX(_dispatch_stub_653), @function - HIDDEN(GL_PREFIX(_dispatch_stub_653)) -GL_PREFIX(_dispatch_stub_653): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5224(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5224(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5224(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5224(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_654) - .type GL_PREFIX(_dispatch_stub_654), @function - HIDDEN(GL_PREFIX(_dispatch_stub_654)) -GL_PREFIX(_dispatch_stub_654): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5232(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5232(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5232(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5232(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_655) - .type GL_PREFIX(_dispatch_stub_655), @function - HIDDEN(GL_PREFIX(_dispatch_stub_655)) -GL_PREFIX(_dispatch_stub_655): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5240(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5240(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5240(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5240(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_655), .-GL_PREFIX(_dispatch_stub_655) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_656) - .type GL_PREFIX(_dispatch_stub_656), @function - HIDDEN(GL_PREFIX(_dispatch_stub_656)) -GL_PREFIX(_dispatch_stub_656): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5248(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5248(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5248(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5248(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656) - - .p2align 4,,15 - .globl GL_PREFIX(AreProgramsResidentNV) - .type GL_PREFIX(AreProgramsResidentNV), @function -GL_PREFIX(AreProgramsResidentNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5256(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5256(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5256(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5256(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV) - - .p2align 4,,15 - .globl GL_PREFIX(BindProgramNV) - .type GL_PREFIX(BindProgramNV), @function -GL_PREFIX(BindProgramNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5264(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5264(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5264(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5264(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteProgramsNV) - .type GL_PREFIX(DeleteProgramsNV), @function -GL_PREFIX(DeleteProgramsNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5272(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5272(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5272(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5272(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV) - - .p2align 4,,15 - .globl GL_PREFIX(ExecuteProgramNV) - .type GL_PREFIX(ExecuteProgramNV), @function -GL_PREFIX(ExecuteProgramNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5280(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5280(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5280(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5280(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV) - - .p2align 4,,15 - .globl GL_PREFIX(GenProgramsNV) - .type GL_PREFIX(GenProgramsNV), @function -GL_PREFIX(GenProgramsNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5288(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5288(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5288(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5288(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramParameterdvNV) - .type GL_PREFIX(GetProgramParameterdvNV), @function -GL_PREFIX(GetProgramParameterdvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5296(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5296(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5296(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5296(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramParameterfvNV) - .type GL_PREFIX(GetProgramParameterfvNV), @function -GL_PREFIX(GetProgramParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5304(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5304(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5304(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5304(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramStringNV) - .type GL_PREFIX(GetProgramStringNV), @function -GL_PREFIX(GetProgramStringNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5312(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5312(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5312(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5312(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramivNV) - .type GL_PREFIX(GetProgramivNV), @function -GL_PREFIX(GetProgramivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5320(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5320(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5320(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5320(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetTrackMatrixivNV) - .type GL_PREFIX(GetTrackMatrixivNV), @function -GL_PREFIX(GetTrackMatrixivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5328(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5328(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5328(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5328(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribPointervNV) - .type GL_PREFIX(GetVertexAttribPointervNV), @function -GL_PREFIX(GetVertexAttribPointervNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5336(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5336(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5336(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5336(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribdvNV) - .type GL_PREFIX(GetVertexAttribdvNV), @function -GL_PREFIX(GetVertexAttribdvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5344(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5344(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5344(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5344(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribfvNV) - .type GL_PREFIX(GetVertexAttribfvNV), @function -GL_PREFIX(GetVertexAttribfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5352(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5352(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5352(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5352(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribivNV) - .type GL_PREFIX(GetVertexAttribivNV), @function -GL_PREFIX(GetVertexAttribivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5360(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5360(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5360(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5360(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV) - - .p2align 4,,15 - .globl GL_PREFIX(IsProgramNV) - .type GL_PREFIX(IsProgramNV), @function -GL_PREFIX(IsProgramNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5368(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5368(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5368(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5368(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV) - - .p2align 4,,15 - .globl GL_PREFIX(LoadProgramNV) - .type GL_PREFIX(LoadProgramNV), @function -GL_PREFIX(LoadProgramNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5376(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5376(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5376(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5376(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramParameters4dvNV) - .type GL_PREFIX(ProgramParameters4dvNV), @function -GL_PREFIX(ProgramParameters4dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5384(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5384(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5384(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5384(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramParameters4fvNV) - .type GL_PREFIX(ProgramParameters4fvNV), @function -GL_PREFIX(ProgramParameters4fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5392(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5392(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5392(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5392(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(RequestResidentProgramsNV) - .type GL_PREFIX(RequestResidentProgramsNV), @function -GL_PREFIX(RequestResidentProgramsNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5400(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5400(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5400(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5400(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV) - - .p2align 4,,15 - .globl GL_PREFIX(TrackMatrixNV) - .type GL_PREFIX(TrackMatrixNV), @function -GL_PREFIX(TrackMatrixNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5408(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5408(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5408(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5408(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dNV) - .type GL_PREFIX(VertexAttrib1dNV), @function -GL_PREFIX(VertexAttrib1dNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5416(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5416(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5416(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5416(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dvNV) - .type GL_PREFIX(VertexAttrib1dvNV), @function -GL_PREFIX(VertexAttrib1dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5424(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5424(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5424(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5424(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fNV) - .type GL_PREFIX(VertexAttrib1fNV), @function -GL_PREFIX(VertexAttrib1fNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5432(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5432(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5432(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5432(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fvNV) - .type GL_PREFIX(VertexAttrib1fvNV), @function -GL_PREFIX(VertexAttrib1fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5440(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5440(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5440(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5440(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1sNV) - .type GL_PREFIX(VertexAttrib1sNV), @function -GL_PREFIX(VertexAttrib1sNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5448(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5448(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5448(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5448(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1svNV) - .type GL_PREFIX(VertexAttrib1svNV), @function -GL_PREFIX(VertexAttrib1svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5456(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5456(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5456(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5456(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dNV) - .type GL_PREFIX(VertexAttrib2dNV), @function -GL_PREFIX(VertexAttrib2dNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5464(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5464(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5464(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5464(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dvNV) - .type GL_PREFIX(VertexAttrib2dvNV), @function -GL_PREFIX(VertexAttrib2dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5472(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5472(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5472(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5472(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fNV) - .type GL_PREFIX(VertexAttrib2fNV), @function -GL_PREFIX(VertexAttrib2fNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5480(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5480(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5480(%rax), %r11 - jmp *%r11 -1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp - movq 5480(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fvNV) - .type GL_PREFIX(VertexAttrib2fvNV), @function -GL_PREFIX(VertexAttrib2fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5488(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5488(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5488(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2sNV) - .type GL_PREFIX(VertexAttrib2sNV), @function -GL_PREFIX(VertexAttrib2sNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5496(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5496(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5496(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5496(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2svNV) - .type GL_PREFIX(VertexAttrib2svNV), @function -GL_PREFIX(VertexAttrib2svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5504(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5504(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5504(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5504(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dNV) - .type GL_PREFIX(VertexAttrib3dNV), @function -GL_PREFIX(VertexAttrib3dNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5512(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5512(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5512(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5512(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dvNV) - .type GL_PREFIX(VertexAttrib3dvNV), @function -GL_PREFIX(VertexAttrib3dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5520(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5520(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5520(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5520(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fNV) - .type GL_PREFIX(VertexAttrib3fNV), @function -GL_PREFIX(VertexAttrib3fNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5528(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5528(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5528(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5528(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fvNV) - .type GL_PREFIX(VertexAttrib3fvNV), @function -GL_PREFIX(VertexAttrib3fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5536(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5536(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5536(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5536(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3sNV) - .type GL_PREFIX(VertexAttrib3sNV), @function -GL_PREFIX(VertexAttrib3sNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5544(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5544(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5544(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5544(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3svNV) - .type GL_PREFIX(VertexAttrib3svNV), @function -GL_PREFIX(VertexAttrib3svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5552(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5552(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5552(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5552(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dNV) - .type GL_PREFIX(VertexAttrib4dNV), @function -GL_PREFIX(VertexAttrib4dNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5560(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5560(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5560(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5560(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dvNV) - .type GL_PREFIX(VertexAttrib4dvNV), @function -GL_PREFIX(VertexAttrib4dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5568(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5568(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5568(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5568(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fNV) - .type GL_PREFIX(VertexAttrib4fNV), @function -GL_PREFIX(VertexAttrib4fNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5576(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5576(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5576(%rax), %r11 - jmp *%r11 -1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) - call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp - movq 5576(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fvNV) - .type GL_PREFIX(VertexAttrib4fvNV), @function -GL_PREFIX(VertexAttrib4fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5584(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5584(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5584(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5584(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4sNV) - .type GL_PREFIX(VertexAttrib4sNV), @function -GL_PREFIX(VertexAttrib4sNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5592(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5592(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5592(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5592(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4svNV) - .type GL_PREFIX(VertexAttrib4svNV), @function -GL_PREFIX(VertexAttrib4svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5600(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5600(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5600(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5600(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ubNV) - .type GL_PREFIX(VertexAttrib4ubNV), @function -GL_PREFIX(VertexAttrib4ubNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5608(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5608(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5608(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5608(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ubvNV) - .type GL_PREFIX(VertexAttrib4ubvNV), @function -GL_PREFIX(VertexAttrib4ubvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5616(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5616(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5616(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5616(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribPointerNV) - .type GL_PREFIX(VertexAttribPointerNV), @function -GL_PREFIX(VertexAttribPointerNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5624(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5624(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5624(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5624(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs1dvNV) - .type GL_PREFIX(VertexAttribs1dvNV), @function -GL_PREFIX(VertexAttribs1dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5632(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5632(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5632(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5632(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs1fvNV) - .type GL_PREFIX(VertexAttribs1fvNV), @function -GL_PREFIX(VertexAttribs1fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5640(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5640(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5640(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5640(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs1svNV) - .type GL_PREFIX(VertexAttribs1svNV), @function -GL_PREFIX(VertexAttribs1svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5648(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5648(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5648(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5648(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs2dvNV) - .type GL_PREFIX(VertexAttribs2dvNV), @function -GL_PREFIX(VertexAttribs2dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5656(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5656(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5656(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5656(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs2fvNV) - .type GL_PREFIX(VertexAttribs2fvNV), @function -GL_PREFIX(VertexAttribs2fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5664(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5664(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5664(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5664(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs2svNV) - .type GL_PREFIX(VertexAttribs2svNV), @function -GL_PREFIX(VertexAttribs2svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5672(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5672(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5672(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5672(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs3dvNV) - .type GL_PREFIX(VertexAttribs3dvNV), @function -GL_PREFIX(VertexAttribs3dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5680(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5680(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5680(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5680(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs3fvNV) - .type GL_PREFIX(VertexAttribs3fvNV), @function -GL_PREFIX(VertexAttribs3fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5688(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5688(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5688(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5688(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs3svNV) - .type GL_PREFIX(VertexAttribs3svNV), @function -GL_PREFIX(VertexAttribs3svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5696(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5696(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5696(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5696(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs4dvNV) - .type GL_PREFIX(VertexAttribs4dvNV), @function -GL_PREFIX(VertexAttribs4dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5704(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5704(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5704(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5704(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs4fvNV) - .type GL_PREFIX(VertexAttribs4fvNV), @function -GL_PREFIX(VertexAttribs4fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5712(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5712(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5712(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5712(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs4svNV) - .type GL_PREFIX(VertexAttribs4svNV), @function -GL_PREFIX(VertexAttribs4svNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5720(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5720(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5720(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5720(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV) - - .p2align 4,,15 - .globl GL_PREFIX(VertexAttribs4ubvNV) - .type GL_PREFIX(VertexAttribs4ubvNV), @function -GL_PREFIX(VertexAttribs4ubvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5728(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5728(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5728(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5728(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV) - - .p2align 4,,15 - .globl GL_PREFIX(AlphaFragmentOp1ATI) - .type GL_PREFIX(AlphaFragmentOp1ATI), @function -GL_PREFIX(AlphaFragmentOp1ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5736(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5736(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5736(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5736(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI) - - .p2align 4,,15 - .globl GL_PREFIX(AlphaFragmentOp2ATI) - .type GL_PREFIX(AlphaFragmentOp2ATI), @function -GL_PREFIX(AlphaFragmentOp2ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5744(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5744(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5744(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5744(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI) - - .p2align 4,,15 - .globl GL_PREFIX(AlphaFragmentOp3ATI) - .type GL_PREFIX(AlphaFragmentOp3ATI), @function -GL_PREFIX(AlphaFragmentOp3ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5752(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5752(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5752(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5752(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI) - - .p2align 4,,15 - .globl GL_PREFIX(BeginFragmentShaderATI) - .type GL_PREFIX(BeginFragmentShaderATI), @function -GL_PREFIX(BeginFragmentShaderATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5760(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 5760(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5760(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 5760(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI) - - .p2align 4,,15 - .globl GL_PREFIX(BindFragmentShaderATI) - .type GL_PREFIX(BindFragmentShaderATI), @function -GL_PREFIX(BindFragmentShaderATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5768(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5768(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5768(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5768(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI) - - .p2align 4,,15 - .globl GL_PREFIX(ColorFragmentOp1ATI) - .type GL_PREFIX(ColorFragmentOp1ATI), @function -GL_PREFIX(ColorFragmentOp1ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5776(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5776(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5776(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5776(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI) - - .p2align 4,,15 - .globl GL_PREFIX(ColorFragmentOp2ATI) - .type GL_PREFIX(ColorFragmentOp2ATI), @function -GL_PREFIX(ColorFragmentOp2ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5784(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5784(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5784(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5784(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI) - - .p2align 4,,15 - .globl GL_PREFIX(ColorFragmentOp3ATI) - .type GL_PREFIX(ColorFragmentOp3ATI), @function -GL_PREFIX(ColorFragmentOp3ATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5792(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5792(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5792(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5792(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteFragmentShaderATI) - .type GL_PREFIX(DeleteFragmentShaderATI), @function -GL_PREFIX(DeleteFragmentShaderATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5800(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5800(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5800(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5800(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI) - - .p2align 4,,15 - .globl GL_PREFIX(EndFragmentShaderATI) - .type GL_PREFIX(EndFragmentShaderATI), @function -GL_PREFIX(EndFragmentShaderATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5808(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - movq 5808(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5808(%rax), %r11 - jmp *%r11 -1: - pushq %rbp - call _glapi_get_dispatch - popq %rbp - movq 5808(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI) - - .p2align 4,,15 - .globl GL_PREFIX(GenFragmentShadersATI) - .type GL_PREFIX(GenFragmentShadersATI), @function -GL_PREFIX(GenFragmentShadersATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5816(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5816(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5816(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5816(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI) - - .p2align 4,,15 - .globl GL_PREFIX(PassTexCoordATI) - .type GL_PREFIX(PassTexCoordATI), @function -GL_PREFIX(PassTexCoordATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5824(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5824(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5824(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5824(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI) - - .p2align 4,,15 - .globl GL_PREFIX(SampleMapATI) - .type GL_PREFIX(SampleMapATI), @function -GL_PREFIX(SampleMapATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5832(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 5832(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5832(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 5832(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI) - - .p2align 4,,15 - .globl GL_PREFIX(SetFragmentShaderConstantATI) - .type GL_PREFIX(SetFragmentShaderConstantATI), @function -GL_PREFIX(SetFragmentShaderConstantATI): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5840(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5840(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5840(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5840(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI) - - .p2align 4,,15 - .globl GL_PREFIX(PointParameteriNV) - .type GL_PREFIX(PointParameteriNV), @function -GL_PREFIX(PointParameteriNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5848(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5848(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5848(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5848(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV) - - .p2align 4,,15 - .globl GL_PREFIX(PointParameterivNV) - .type GL_PREFIX(PointParameterivNV), @function -GL_PREFIX(PointParameterivNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5856(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5856(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5856(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5856(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_733) - .type GL_PREFIX(_dispatch_stub_733), @function - HIDDEN(GL_PREFIX(_dispatch_stub_733)) -GL_PREFIX(_dispatch_stub_733): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5864(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5864(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5864(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5864(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_734) - .type GL_PREFIX(_dispatch_stub_734), @function - HIDDEN(GL_PREFIX(_dispatch_stub_734)) -GL_PREFIX(_dispatch_stub_734): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5872(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5872(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5872(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5872(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_735) - .type GL_PREFIX(_dispatch_stub_735), @function - HIDDEN(GL_PREFIX(_dispatch_stub_735)) -GL_PREFIX(_dispatch_stub_735): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5880(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5880(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5880(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5880(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_736) - .type GL_PREFIX(_dispatch_stub_736), @function - HIDDEN(GL_PREFIX(_dispatch_stub_736)) -GL_PREFIX(_dispatch_stub_736): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5888(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5888(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5888(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5888(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_737) - .type GL_PREFIX(_dispatch_stub_737), @function - HIDDEN(GL_PREFIX(_dispatch_stub_737)) -GL_PREFIX(_dispatch_stub_737): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5896(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5896(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5896(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5896(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramNamedParameterdvNV) - .type GL_PREFIX(GetProgramNamedParameterdvNV), @function -GL_PREFIX(GetProgramNamedParameterdvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5904(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5904(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5904(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5904(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV) - - .p2align 4,,15 - .globl GL_PREFIX(GetProgramNamedParameterfvNV) - .type GL_PREFIX(GetProgramNamedParameterfvNV), @function -GL_PREFIX(GetProgramNamedParameterfvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5912(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5912(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5912(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5912(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramNamedParameter4dNV) - .type GL_PREFIX(ProgramNamedParameter4dNV), @function -GL_PREFIX(ProgramNamedParameter4dNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5920(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %rdx, 16(%rsp) - movq %xmm0, 24(%rsp) - movq %xmm1, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - call _x86_64_get_dispatch@PLT - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %xmm1 - movq 24(%rsp), %xmm0 - movq 16(%rsp), %rdx - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 5920(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5920(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %rdx, 16(%rsp) - movq %xmm0, 24(%rsp) - movq %xmm1, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - call _glapi_get_dispatch - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %xmm1 - movq 24(%rsp), %xmm0 - movq 16(%rsp), %rdx - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 5920(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramNamedParameter4dvNV) - .type GL_PREFIX(ProgramNamedParameter4dvNV), @function -GL_PREFIX(ProgramNamedParameter4dvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5928(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5928(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5928(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5928(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramNamedParameter4fNV) - .type GL_PREFIX(ProgramNamedParameter4fNV), @function -GL_PREFIX(ProgramNamedParameter4fNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5936(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %rdx, 16(%rsp) - movq %xmm0, 24(%rsp) - movq %xmm1, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - call _x86_64_get_dispatch@PLT - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %xmm1 - movq 24(%rsp), %xmm0 - movq 16(%rsp), %rdx - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 5936(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5936(%rax), %r11 - jmp *%r11 -1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %rdx, 16(%rsp) - movq %xmm0, 24(%rsp) - movq %xmm1, 32(%rsp) - movq %xmm2, 40(%rsp) - movq %xmm3, 48(%rsp) - call _glapi_get_dispatch - movq 48(%rsp), %xmm3 - movq 40(%rsp), %xmm2 - movq 32(%rsp), %xmm1 - movq 24(%rsp), %xmm0 - movq 16(%rsp), %rdx - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 5936(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV) - - .p2align 4,,15 - .globl GL_PREFIX(ProgramNamedParameter4fvNV) - .type GL_PREFIX(ProgramNamedParameter4fvNV), @function -GL_PREFIX(ProgramNamedParameter4fvNV): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5944(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5944(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5944(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 5944(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_744) - .type GL_PREFIX(_dispatch_stub_744), @function - HIDDEN(GL_PREFIX(_dispatch_stub_744)) -GL_PREFIX(_dispatch_stub_744): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5952(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5952(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5952(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5952(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_744), .-GL_PREFIX(_dispatch_stub_744) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_745) - .type GL_PREFIX(_dispatch_stub_745), @function - HIDDEN(GL_PREFIX(_dispatch_stub_745)) -GL_PREFIX(_dispatch_stub_745): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5960(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5960(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5960(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5960(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745) - - .p2align 4,,15 - .globl GL_PREFIX(BindFramebufferEXT) - .type GL_PREFIX(BindFramebufferEXT), @function -GL_PREFIX(BindFramebufferEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5968(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5968(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5968(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5968(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT) - - .p2align 4,,15 - .globl GL_PREFIX(BindRenderbufferEXT) - .type GL_PREFIX(BindRenderbufferEXT), @function -GL_PREFIX(BindRenderbufferEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5976(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5976(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5976(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5976(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT) - - .p2align 4,,15 - .globl GL_PREFIX(CheckFramebufferStatusEXT) - .type GL_PREFIX(CheckFramebufferStatusEXT), @function -GL_PREFIX(CheckFramebufferStatusEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5984(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 5984(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5984(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 5984(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteFramebuffersEXT) - .type GL_PREFIX(DeleteFramebuffersEXT), @function -GL_PREFIX(DeleteFramebuffersEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 5992(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 5992(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 5992(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 5992(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT) - - .p2align 4,,15 - .globl GL_PREFIX(DeleteRenderbuffersEXT) - .type GL_PREFIX(DeleteRenderbuffersEXT), @function -GL_PREFIX(DeleteRenderbuffersEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6000(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 6000(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6000(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 6000(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FramebufferRenderbufferEXT) - .type GL_PREFIX(FramebufferRenderbufferEXT), @function -GL_PREFIX(FramebufferRenderbufferEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6008(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6008(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6008(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6008(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FramebufferTexture1DEXT) - .type GL_PREFIX(FramebufferTexture1DEXT), @function -GL_PREFIX(FramebufferTexture1DEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6016(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6016(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6016(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6016(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FramebufferTexture2DEXT) - .type GL_PREFIX(FramebufferTexture2DEXT), @function -GL_PREFIX(FramebufferTexture2DEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6024(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6024(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6024(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6024(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT) - - .p2align 4,,15 - .globl GL_PREFIX(FramebufferTexture3DEXT) - .type GL_PREFIX(FramebufferTexture3DEXT), @function -GL_PREFIX(FramebufferTexture3DEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6032(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6032(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6032(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6032(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT) - - .p2align 4,,15 - .globl GL_PREFIX(GenFramebuffersEXT) - .type GL_PREFIX(GenFramebuffersEXT), @function -GL_PREFIX(GenFramebuffersEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6040(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 6040(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6040(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 6040(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT) - - .p2align 4,,15 - .globl GL_PREFIX(GenRenderbuffersEXT) - .type GL_PREFIX(GenRenderbuffersEXT), @function -GL_PREFIX(GenRenderbuffersEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6048(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 6048(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6048(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 6048(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT) - - .p2align 4,,15 - .globl GL_PREFIX(GenerateMipmapEXT) - .type GL_PREFIX(GenerateMipmapEXT), @function -GL_PREFIX(GenerateMipmapEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6056(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 6056(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6056(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 6056(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT) - - .p2align 4,,15 - .globl GL_PREFIX(GetFramebufferAttachmentParameterivEXT) - .type GL_PREFIX(GetFramebufferAttachmentParameterivEXT), @function -GL_PREFIX(GetFramebufferAttachmentParameterivEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6064(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6064(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6064(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6064(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT) - - .p2align 4,,15 - .globl GL_PREFIX(GetRenderbufferParameterivEXT) - .type GL_PREFIX(GetRenderbufferParameterivEXT), @function -GL_PREFIX(GetRenderbufferParameterivEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6072(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 6072(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6072(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 6072(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT) - - .p2align 4,,15 - .globl GL_PREFIX(IsFramebufferEXT) - .type GL_PREFIX(IsFramebufferEXT), @function -GL_PREFIX(IsFramebufferEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6080(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 6080(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6080(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 6080(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT) - - .p2align 4,,15 - .globl GL_PREFIX(IsRenderbufferEXT) - .type GL_PREFIX(IsRenderbufferEXT), @function -GL_PREFIX(IsRenderbufferEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6088(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - call _x86_64_get_dispatch@PLT - popq %rdi - movq 6088(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6088(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - call _glapi_get_dispatch - popq %rdi - movq 6088(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT) - - .p2align 4,,15 - .globl GL_PREFIX(RenderbufferStorageEXT) - .type GL_PREFIX(RenderbufferStorageEXT), @function -GL_PREFIX(RenderbufferStorageEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6096(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6096(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6096(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6096(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_763) - .type GL_PREFIX(_dispatch_stub_763), @function - HIDDEN(GL_PREFIX(_dispatch_stub_763)) -GL_PREFIX(_dispatch_stub_763): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6104(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6104(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6104(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6104(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_763), .-GL_PREFIX(_dispatch_stub_763) - - .p2align 4,,15 - .globl GL_PREFIX(FramebufferTextureLayerEXT) - .type GL_PREFIX(FramebufferTextureLayerEXT), @function -GL_PREFIX(FramebufferTextureLayerEXT): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6112(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6112(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6112(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6112(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_765) - .type GL_PREFIX(_dispatch_stub_765), @function - HIDDEN(GL_PREFIX(_dispatch_stub_765)) -GL_PREFIX(_dispatch_stub_765): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6120(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6120(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6120(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6120(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_765), .-GL_PREFIX(_dispatch_stub_765) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_766) - .type GL_PREFIX(_dispatch_stub_766), @function - HIDDEN(GL_PREFIX(_dispatch_stub_766)) -GL_PREFIX(_dispatch_stub_766): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6128(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6128(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6128(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6128(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_767) - .type GL_PREFIX(_dispatch_stub_767), @function - HIDDEN(GL_PREFIX(_dispatch_stub_767)) -GL_PREFIX(_dispatch_stub_767): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6136(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6136(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6136(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 6136(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_768) - .type GL_PREFIX(_dispatch_stub_768), @function - HIDDEN(GL_PREFIX(_dispatch_stub_768)) -GL_PREFIX(_dispatch_stub_768): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6144(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 6144(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6144(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 6144(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) - - .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_769) - .type GL_PREFIX(_dispatch_stub_769), @function - HIDDEN(GL_PREFIX(_dispatch_stub_769)) -GL_PREFIX(_dispatch_stub_769): -#if defined(GLX_USE_TLS) - call _x86_64_get_dispatch@PLT - movq 6152(%rax), %r11 - jmp *%r11 -#elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 6152(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax - je 1f - movq 6152(%rax), %r11 - jmp *%r11 -1: - pushq %rdi - pushq %rsi - pushq %rdx - call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 6152(%rax), %r11 - jmp *%r11 -#endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769) - - .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) - .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) - .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays) -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(AreTexturesResidentEXT) ; .set GL_PREFIX(AreTexturesResidentEXT), GL_PREFIX(AreTexturesResident) -#endif - .globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D) - .globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D) - .globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D) - .globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D) -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures) -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(GenTexturesEXT) ; .set GL_PREFIX(GenTexturesEXT), GL_PREFIX(GenTextures) -#endif - .globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv) -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(IsTextureEXT) ; .set GL_PREFIX(IsTextureEXT), GL_PREFIX(IsTexture) -#endif - .globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures) - .globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D) - .globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D) - .globl GL_PREFIX(BlendColorEXT) ; .set GL_PREFIX(BlendColorEXT), GL_PREFIX(BlendColor) - .globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation) - .globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements) - .globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable) -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(GetColorTable) -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(GetColorTableParameterfv) -#endif -#ifndef GLX_INDIRECT_RENDERING - .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(GetColorTableParameteriv) -#endif - .globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D) - .globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D) - .globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D) - .globl GL_PREFIX(ActiveTexture) ; .set GL_PREFIX(ActiveTexture), GL_PREFIX(ActiveTextureARB) - .globl GL_PREFIX(ClientActiveTexture) ; .set GL_PREFIX(ClientActiveTexture), GL_PREFIX(ClientActiveTextureARB) - .globl GL_PREFIX(MultiTexCoord1d) ; .set GL_PREFIX(MultiTexCoord1d), GL_PREFIX(MultiTexCoord1dARB) - .globl GL_PREFIX(MultiTexCoord1dv) ; .set GL_PREFIX(MultiTexCoord1dv), GL_PREFIX(MultiTexCoord1dvARB) - .globl GL_PREFIX(MultiTexCoord1f) ; .set GL_PREFIX(MultiTexCoord1f), GL_PREFIX(MultiTexCoord1fARB) - .globl GL_PREFIX(MultiTexCoord1fv) ; .set GL_PREFIX(MultiTexCoord1fv), GL_PREFIX(MultiTexCoord1fvARB) - .globl GL_PREFIX(MultiTexCoord1i) ; .set GL_PREFIX(MultiTexCoord1i), GL_PREFIX(MultiTexCoord1iARB) - .globl GL_PREFIX(MultiTexCoord1iv) ; .set GL_PREFIX(MultiTexCoord1iv), GL_PREFIX(MultiTexCoord1ivARB) - .globl GL_PREFIX(MultiTexCoord1s) ; .set GL_PREFIX(MultiTexCoord1s), GL_PREFIX(MultiTexCoord1sARB) - .globl GL_PREFIX(MultiTexCoord1sv) ; .set GL_PREFIX(MultiTexCoord1sv), GL_PREFIX(MultiTexCoord1svARB) - .globl GL_PREFIX(MultiTexCoord2d) ; .set GL_PREFIX(MultiTexCoord2d), GL_PREFIX(MultiTexCoord2dARB) - .globl GL_PREFIX(MultiTexCoord2dv) ; .set GL_PREFIX(MultiTexCoord2dv), GL_PREFIX(MultiTexCoord2dvARB) - .globl GL_PREFIX(MultiTexCoord2f) ; .set GL_PREFIX(MultiTexCoord2f), GL_PREFIX(MultiTexCoord2fARB) - .globl GL_PREFIX(MultiTexCoord2fv) ; .set GL_PREFIX(MultiTexCoord2fv), GL_PREFIX(MultiTexCoord2fvARB) - .globl GL_PREFIX(MultiTexCoord2i) ; .set GL_PREFIX(MultiTexCoord2i), GL_PREFIX(MultiTexCoord2iARB) - .globl GL_PREFIX(MultiTexCoord2iv) ; .set GL_PREFIX(MultiTexCoord2iv), GL_PREFIX(MultiTexCoord2ivARB) - .globl GL_PREFIX(MultiTexCoord2s) ; .set GL_PREFIX(MultiTexCoord2s), GL_PREFIX(MultiTexCoord2sARB) - .globl GL_PREFIX(MultiTexCoord2sv) ; .set GL_PREFIX(MultiTexCoord2sv), GL_PREFIX(MultiTexCoord2svARB) - .globl GL_PREFIX(MultiTexCoord3d) ; .set GL_PREFIX(MultiTexCoord3d), GL_PREFIX(MultiTexCoord3dARB) - .globl GL_PREFIX(MultiTexCoord3dv) ; .set GL_PREFIX(MultiTexCoord3dv), GL_PREFIX(MultiTexCoord3dvARB) - .globl GL_PREFIX(MultiTexCoord3f) ; .set GL_PREFIX(MultiTexCoord3f), GL_PREFIX(MultiTexCoord3fARB) - .globl GL_PREFIX(MultiTexCoord3fv) ; .set GL_PREFIX(MultiTexCoord3fv), GL_PREFIX(MultiTexCoord3fvARB) - .globl GL_PREFIX(MultiTexCoord3i) ; .set GL_PREFIX(MultiTexCoord3i), GL_PREFIX(MultiTexCoord3iARB) - .globl GL_PREFIX(MultiTexCoord3iv) ; .set GL_PREFIX(MultiTexCoord3iv), GL_PREFIX(MultiTexCoord3ivARB) - .globl GL_PREFIX(MultiTexCoord3s) ; .set GL_PREFIX(MultiTexCoord3s), GL_PREFIX(MultiTexCoord3sARB) - .globl GL_PREFIX(MultiTexCoord3sv) ; .set GL_PREFIX(MultiTexCoord3sv), GL_PREFIX(MultiTexCoord3svARB) - .globl GL_PREFIX(MultiTexCoord4d) ; .set GL_PREFIX(MultiTexCoord4d), GL_PREFIX(MultiTexCoord4dARB) - .globl GL_PREFIX(MultiTexCoord4dv) ; .set GL_PREFIX(MultiTexCoord4dv), GL_PREFIX(MultiTexCoord4dvARB) - .globl GL_PREFIX(MultiTexCoord4f) ; .set GL_PREFIX(MultiTexCoord4f), GL_PREFIX(MultiTexCoord4fARB) - .globl GL_PREFIX(MultiTexCoord4fv) ; .set GL_PREFIX(MultiTexCoord4fv), GL_PREFIX(MultiTexCoord4fvARB) - .globl GL_PREFIX(MultiTexCoord4i) ; .set GL_PREFIX(MultiTexCoord4i), GL_PREFIX(MultiTexCoord4iARB) - .globl GL_PREFIX(MultiTexCoord4iv) ; .set GL_PREFIX(MultiTexCoord4iv), GL_PREFIX(MultiTexCoord4ivARB) - .globl GL_PREFIX(MultiTexCoord4s) ; .set GL_PREFIX(MultiTexCoord4s), GL_PREFIX(MultiTexCoord4sARB) - .globl GL_PREFIX(MultiTexCoord4sv) ; .set GL_PREFIX(MultiTexCoord4sv), GL_PREFIX(MultiTexCoord4svARB) - .globl GL_PREFIX(LoadTransposeMatrixd) ; .set GL_PREFIX(LoadTransposeMatrixd), GL_PREFIX(LoadTransposeMatrixdARB) - .globl GL_PREFIX(LoadTransposeMatrixf) ; .set GL_PREFIX(LoadTransposeMatrixf), GL_PREFIX(LoadTransposeMatrixfARB) - .globl GL_PREFIX(MultTransposeMatrixd) ; .set GL_PREFIX(MultTransposeMatrixd), GL_PREFIX(MultTransposeMatrixdARB) - .globl GL_PREFIX(MultTransposeMatrixf) ; .set GL_PREFIX(MultTransposeMatrixf), GL_PREFIX(MultTransposeMatrixfARB) - .globl GL_PREFIX(SampleCoverage) ; .set GL_PREFIX(SampleCoverage), GL_PREFIX(SampleCoverageARB) - .globl GL_PREFIX(CompressedTexImage1D) ; .set GL_PREFIX(CompressedTexImage1D), GL_PREFIX(CompressedTexImage1DARB) - .globl GL_PREFIX(CompressedTexImage2D) ; .set GL_PREFIX(CompressedTexImage2D), GL_PREFIX(CompressedTexImage2DARB) - .globl GL_PREFIX(CompressedTexImage3D) ; .set GL_PREFIX(CompressedTexImage3D), GL_PREFIX(CompressedTexImage3DARB) - .globl GL_PREFIX(CompressedTexSubImage1D) ; .set GL_PREFIX(CompressedTexSubImage1D), GL_PREFIX(CompressedTexSubImage1DARB) - .globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB) - .globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB) - .globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB) - .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB) - .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB) - .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB) - .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB) - .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB) - .globl GL_PREFIX(ProgramParameter4dNV) ; .set GL_PREFIX(ProgramParameter4dNV), GL_PREFIX(ProgramEnvParameter4dARB) - .globl GL_PREFIX(ProgramParameter4dvNV) ; .set GL_PREFIX(ProgramParameter4dvNV), GL_PREFIX(ProgramEnvParameter4dvARB) - .globl GL_PREFIX(ProgramParameter4fNV) ; .set GL_PREFIX(ProgramParameter4fNV), GL_PREFIX(ProgramEnvParameter4fARB) - .globl GL_PREFIX(ProgramParameter4fvNV) ; .set GL_PREFIX(ProgramParameter4fvNV), GL_PREFIX(ProgramEnvParameter4fvARB) - .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB) - .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB) - .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB) - .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB) - .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB) - .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB) - .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB) - .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB) - .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB) - .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB) - .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB) - .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB) - .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB) - .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB) - .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB) - .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB) - .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB) - .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB) - .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB) - .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB) - .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB) - .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB) - .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB) - .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB) - .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB) - .globl GL_PREFIX(VertexAttrib4bv) ; .set GL_PREFIX(VertexAttrib4bv), GL_PREFIX(VertexAttrib4bvARB) - .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB) - .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB) - .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB) - .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB) - .globl GL_PREFIX(VertexAttrib4iv) ; .set GL_PREFIX(VertexAttrib4iv), GL_PREFIX(VertexAttrib4ivARB) - .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB) - .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB) - .globl GL_PREFIX(VertexAttrib4ubv) ; .set GL_PREFIX(VertexAttrib4ubv), GL_PREFIX(VertexAttrib4ubvARB) - .globl GL_PREFIX(VertexAttrib4uiv) ; .set GL_PREFIX(VertexAttrib4uiv), GL_PREFIX(VertexAttrib4uivARB) - .globl GL_PREFIX(VertexAttrib4usv) ; .set GL_PREFIX(VertexAttrib4usv), GL_PREFIX(VertexAttrib4usvARB) - .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB) - .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB) - .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB) - .globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB) - .globl GL_PREFIX(DeleteBuffers) ; .set GL_PREFIX(DeleteBuffers), GL_PREFIX(DeleteBuffersARB) - .globl GL_PREFIX(GenBuffers) ; .set GL_PREFIX(GenBuffers), GL_PREFIX(GenBuffersARB) - .globl GL_PREFIX(GetBufferParameteriv) ; .set GL_PREFIX(GetBufferParameteriv), GL_PREFIX(GetBufferParameterivARB) - .globl GL_PREFIX(GetBufferPointerv) ; .set GL_PREFIX(GetBufferPointerv), GL_PREFIX(GetBufferPointervARB) - .globl GL_PREFIX(GetBufferSubData) ; .set GL_PREFIX(GetBufferSubData), GL_PREFIX(GetBufferSubDataARB) - .globl GL_PREFIX(IsBuffer) ; .set GL_PREFIX(IsBuffer), GL_PREFIX(IsBufferARB) - .globl GL_PREFIX(MapBuffer) ; .set GL_PREFIX(MapBuffer), GL_PREFIX(MapBufferARB) - .globl GL_PREFIX(UnmapBuffer) ; .set GL_PREFIX(UnmapBuffer), GL_PREFIX(UnmapBufferARB) - .globl GL_PREFIX(BeginQuery) ; .set GL_PREFIX(BeginQuery), GL_PREFIX(BeginQueryARB) - .globl GL_PREFIX(DeleteQueries) ; .set GL_PREFIX(DeleteQueries), GL_PREFIX(DeleteQueriesARB) - .globl GL_PREFIX(EndQuery) ; .set GL_PREFIX(EndQuery), GL_PREFIX(EndQueryARB) - .globl GL_PREFIX(GenQueries) ; .set GL_PREFIX(GenQueries), GL_PREFIX(GenQueriesARB) - .globl GL_PREFIX(GetQueryObjectiv) ; .set GL_PREFIX(GetQueryObjectiv), GL_PREFIX(GetQueryObjectivARB) - .globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB) - .globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB) - .globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB) - .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB) - .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB) - .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB) - .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB) - .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB) - .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB) - .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB) - .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB) - .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB) - .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB) - .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB) - .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB) - .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB) - .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB) - .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB) - .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB) - .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB) - .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB) - .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB) - .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB) - .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB) - .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB) - .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB) - .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB) - .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB) - .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB) - .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB) - .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB) - .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB) - .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB) - .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB) - .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB) - .globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB) - .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB) - .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT) - .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT) - .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT) - .globl GL_PREFIX(PointParameterfvARB) ; .set GL_PREFIX(PointParameterfvARB), GL_PREFIX(PointParameterfvEXT) - .globl GL_PREFIX(SecondaryColor3b) ; .set GL_PREFIX(SecondaryColor3b), GL_PREFIX(SecondaryColor3bEXT) - .globl GL_PREFIX(SecondaryColor3bv) ; .set GL_PREFIX(SecondaryColor3bv), GL_PREFIX(SecondaryColor3bvEXT) - .globl GL_PREFIX(SecondaryColor3d) ; .set GL_PREFIX(SecondaryColor3d), GL_PREFIX(SecondaryColor3dEXT) - .globl GL_PREFIX(SecondaryColor3dv) ; .set GL_PREFIX(SecondaryColor3dv), GL_PREFIX(SecondaryColor3dvEXT) - .globl GL_PREFIX(SecondaryColor3f) ; .set GL_PREFIX(SecondaryColor3f), GL_PREFIX(SecondaryColor3fEXT) - .globl GL_PREFIX(SecondaryColor3fv) ; .set GL_PREFIX(SecondaryColor3fv), GL_PREFIX(SecondaryColor3fvEXT) - .globl GL_PREFIX(SecondaryColor3i) ; .set GL_PREFIX(SecondaryColor3i), GL_PREFIX(SecondaryColor3iEXT) - .globl GL_PREFIX(SecondaryColor3iv) ; .set GL_PREFIX(SecondaryColor3iv), GL_PREFIX(SecondaryColor3ivEXT) - .globl GL_PREFIX(SecondaryColor3s) ; .set GL_PREFIX(SecondaryColor3s), GL_PREFIX(SecondaryColor3sEXT) - .globl GL_PREFIX(SecondaryColor3sv) ; .set GL_PREFIX(SecondaryColor3sv), GL_PREFIX(SecondaryColor3svEXT) - .globl GL_PREFIX(SecondaryColor3ub) ; .set GL_PREFIX(SecondaryColor3ub), GL_PREFIX(SecondaryColor3ubEXT) - .globl GL_PREFIX(SecondaryColor3ubv) ; .set GL_PREFIX(SecondaryColor3ubv), GL_PREFIX(SecondaryColor3ubvEXT) - .globl GL_PREFIX(SecondaryColor3ui) ; .set GL_PREFIX(SecondaryColor3ui), GL_PREFIX(SecondaryColor3uiEXT) - .globl GL_PREFIX(SecondaryColor3uiv) ; .set GL_PREFIX(SecondaryColor3uiv), GL_PREFIX(SecondaryColor3uivEXT) - .globl GL_PREFIX(SecondaryColor3us) ; .set GL_PREFIX(SecondaryColor3us), GL_PREFIX(SecondaryColor3usEXT) - .globl GL_PREFIX(SecondaryColor3usv) ; .set GL_PREFIX(SecondaryColor3usv), GL_PREFIX(SecondaryColor3usvEXT) - .globl GL_PREFIX(SecondaryColorPointer) ; .set GL_PREFIX(SecondaryColorPointer), GL_PREFIX(SecondaryColorPointerEXT) - .globl GL_PREFIX(MultiDrawArrays) ; .set GL_PREFIX(MultiDrawArrays), GL_PREFIX(MultiDrawArraysEXT) - .globl GL_PREFIX(MultiDrawElements) ; .set GL_PREFIX(MultiDrawElements), GL_PREFIX(MultiDrawElementsEXT) - .globl GL_PREFIX(FogCoordPointer) ; .set GL_PREFIX(FogCoordPointer), GL_PREFIX(FogCoordPointerEXT) - .globl GL_PREFIX(FogCoordd) ; .set GL_PREFIX(FogCoordd), GL_PREFIX(FogCoorddEXT) - .globl GL_PREFIX(FogCoorddv) ; .set GL_PREFIX(FogCoorddv), GL_PREFIX(FogCoorddvEXT) - .globl GL_PREFIX(FogCoordf) ; .set GL_PREFIX(FogCoordf), GL_PREFIX(FogCoordfEXT) - .globl GL_PREFIX(FogCoordfv) ; .set GL_PREFIX(FogCoordfv), GL_PREFIX(FogCoordfvEXT) - .globl GL_PREFIX(BlendFuncSeparate) ; .set GL_PREFIX(BlendFuncSeparate), GL_PREFIX(BlendFuncSeparateEXT) - .globl GL_PREFIX(WindowPos2d) ; .set GL_PREFIX(WindowPos2d), GL_PREFIX(WindowPos2dMESA) - .globl GL_PREFIX(WindowPos2dARB) ; .set GL_PREFIX(WindowPos2dARB), GL_PREFIX(WindowPos2dMESA) - .globl GL_PREFIX(WindowPos2dv) ; .set GL_PREFIX(WindowPos2dv), GL_PREFIX(WindowPos2dvMESA) - .globl GL_PREFIX(WindowPos2dvARB) ; .set GL_PREFIX(WindowPos2dvARB), GL_PREFIX(WindowPos2dvMESA) - .globl GL_PREFIX(WindowPos2f) ; .set GL_PREFIX(WindowPos2f), GL_PREFIX(WindowPos2fMESA) - .globl GL_PREFIX(WindowPos2fARB) ; .set GL_PREFIX(WindowPos2fARB), GL_PREFIX(WindowPos2fMESA) - .globl GL_PREFIX(WindowPos2fv) ; .set GL_PREFIX(WindowPos2fv), GL_PREFIX(WindowPos2fvMESA) - .globl GL_PREFIX(WindowPos2fvARB) ; .set GL_PREFIX(WindowPos2fvARB), GL_PREFIX(WindowPos2fvMESA) - .globl GL_PREFIX(WindowPos2i) ; .set GL_PREFIX(WindowPos2i), GL_PREFIX(WindowPos2iMESA) - .globl GL_PREFIX(WindowPos2iARB) ; .set GL_PREFIX(WindowPos2iARB), GL_PREFIX(WindowPos2iMESA) - .globl GL_PREFIX(WindowPos2iv) ; .set GL_PREFIX(WindowPos2iv), GL_PREFIX(WindowPos2ivMESA) - .globl GL_PREFIX(WindowPos2ivARB) ; .set GL_PREFIX(WindowPos2ivARB), GL_PREFIX(WindowPos2ivMESA) - .globl GL_PREFIX(WindowPos2s) ; .set GL_PREFIX(WindowPos2s), GL_PREFIX(WindowPos2sMESA) - .globl GL_PREFIX(WindowPos2sARB) ; .set GL_PREFIX(WindowPos2sARB), GL_PREFIX(WindowPos2sMESA) - .globl GL_PREFIX(WindowPos2sv) ; .set GL_PREFIX(WindowPos2sv), GL_PREFIX(WindowPos2svMESA) - .globl GL_PREFIX(WindowPos2svARB) ; .set GL_PREFIX(WindowPos2svARB), GL_PREFIX(WindowPos2svMESA) - .globl GL_PREFIX(WindowPos3d) ; .set GL_PREFIX(WindowPos3d), GL_PREFIX(WindowPos3dMESA) - .globl GL_PREFIX(WindowPos3dARB) ; .set GL_PREFIX(WindowPos3dARB), GL_PREFIX(WindowPos3dMESA) - .globl GL_PREFIX(WindowPos3dv) ; .set GL_PREFIX(WindowPos3dv), GL_PREFIX(WindowPos3dvMESA) - .globl GL_PREFIX(WindowPos3dvARB) ; .set GL_PREFIX(WindowPos3dvARB), GL_PREFIX(WindowPos3dvMESA) - .globl GL_PREFIX(WindowPos3f) ; .set GL_PREFIX(WindowPos3f), GL_PREFIX(WindowPos3fMESA) - .globl GL_PREFIX(WindowPos3fARB) ; .set GL_PREFIX(WindowPos3fARB), GL_PREFIX(WindowPos3fMESA) - .globl GL_PREFIX(WindowPos3fv) ; .set GL_PREFIX(WindowPos3fv), GL_PREFIX(WindowPos3fvMESA) - .globl GL_PREFIX(WindowPos3fvARB) ; .set GL_PREFIX(WindowPos3fvARB), GL_PREFIX(WindowPos3fvMESA) - .globl GL_PREFIX(WindowPos3i) ; .set GL_PREFIX(WindowPos3i), GL_PREFIX(WindowPos3iMESA) - .globl GL_PREFIX(WindowPos3iARB) ; .set GL_PREFIX(WindowPos3iARB), GL_PREFIX(WindowPos3iMESA) - .globl GL_PREFIX(WindowPos3iv) ; .set GL_PREFIX(WindowPos3iv), GL_PREFIX(WindowPos3ivMESA) - .globl GL_PREFIX(WindowPos3ivARB) ; .set GL_PREFIX(WindowPos3ivARB), GL_PREFIX(WindowPos3ivMESA) - .globl GL_PREFIX(WindowPos3s) ; .set GL_PREFIX(WindowPos3s), GL_PREFIX(WindowPos3sMESA) - .globl GL_PREFIX(WindowPos3sARB) ; .set GL_PREFIX(WindowPos3sARB), GL_PREFIX(WindowPos3sMESA) - .globl GL_PREFIX(WindowPos3sv) ; .set GL_PREFIX(WindowPos3sv), GL_PREFIX(WindowPos3svMESA) - .globl GL_PREFIX(WindowPos3svARB) ; .set GL_PREFIX(WindowPos3svARB), GL_PREFIX(WindowPos3svMESA) - .globl GL_PREFIX(BindProgramARB) ; .set GL_PREFIX(BindProgramARB), GL_PREFIX(BindProgramNV) - .globl GL_PREFIX(DeleteProgramsARB) ; .set GL_PREFIX(DeleteProgramsARB), GL_PREFIX(DeleteProgramsNV) - .globl GL_PREFIX(GenProgramsARB) ; .set GL_PREFIX(GenProgramsARB), GL_PREFIX(GenProgramsNV) - .globl GL_PREFIX(GetVertexAttribPointerv) ; .set GL_PREFIX(GetVertexAttribPointerv), GL_PREFIX(GetVertexAttribPointervNV) - .globl GL_PREFIX(GetVertexAttribPointervARB) ; .set GL_PREFIX(GetVertexAttribPointervARB), GL_PREFIX(GetVertexAttribPointervNV) - .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV) - .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV) - .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV) - .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_745) - -#if defined(GLX_USE_TLS) && defined(__linux__) - .section ".note.ABI-tag", "a" - .p2align 2 - .long 1f - 0f /* name length */ - .long 3f - 2f /* data length */ - .long 1 /* note length */ -0: .asciz "GNU" /* vendor name */ -1: .p2align 2 -2: .long 0 /* note data: the ABI tag */ - .long 2,4,20 /* Minimum kernel version w/TLS */ -3: .p2align 2 /* pad out section */ -#endif /* GLX_USE_TLS */ - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86-64/x86-64.c b/src/libs/mesa/mesa/x86-64/x86-64.c deleted file mode 100644 index 96f8da87f0..0000000000 --- a/src/libs/mesa/mesa/x86-64/x86-64.c +++ /dev/null @@ -1,129 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2003 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-64 optimizations shamelessy converted from x86/sse/3dnow assembly by - * Mikko Tiihonen - */ - -#ifdef USE_X86_64_ASM - -#include "main/glheader.h" -#include "main/context.h" -#include "math/m_xform.h" -#include "tnl/t_context.h" -#include "x86-64.h" -#include "../x86/common_x86_macros.h" - -#ifdef DEBUG -#include "math/m_debug.h" -#endif - -extern void _mesa_x86_64_cpuid(unsigned int *regs); - -DECLARE_XFORM_GROUP( x86_64, 4 ) -DECLARE_XFORM_GROUP( 3dnow, 4 ) - -#else -/* just to silence warning below */ -#include "x86-64.h" -#endif - -/* -extern void _mesa_x86_64_transform_points4_general( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_identity( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_perspective( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_3d( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_3d_no_rot( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_2d_no_rot( XFORM_ARGS ); -extern void _mesa_x86_64_transform_points4_2d( XFORM_ARGS ); -*/ - -#ifdef USE_X86_64_ASM -static void message( const char *msg ) -{ - GLboolean debug; -#ifdef DEBUG - debug = GL_TRUE; -#else - if ( _mesa_getenv( "MESA_DEBUG" ) ) { - debug = GL_TRUE; - } else { - debug = GL_FALSE; - } -#endif - if ( debug ) { - _mesa_debug( NULL, "%s", msg ); - } -} -#endif - - -void _mesa_init_all_x86_64_transform_asm(void) -{ -#ifdef USE_X86_64_ASM - unsigned int regs[4]; - - if ( _mesa_getenv( "MESA_NO_ASM" ) ) { - return; - } - - message("Initializing x86-64 optimizations\n"); - - - _mesa_transform_tab[4][MATRIX_GENERAL] = - _mesa_x86_64_transform_points4_general; - _mesa_transform_tab[4][MATRIX_IDENTITY] = - _mesa_x86_64_transform_points4_identity; - _mesa_transform_tab[4][MATRIX_3D] = - _mesa_x86_64_transform_points4_3d; - - regs[0] = 0x80000001; - regs[1] = 0x00000000; - regs[2] = 0x00000000; - regs[3] = 0x00000000; - _mesa_x86_64_cpuid(regs); - if (regs[3] & (1U << 31)) { - message("3Dnow! detected\n"); - _mesa_transform_tab[4][MATRIX_3D_NO_ROT] = - _mesa_3dnow_transform_points4_3d_no_rot; - _mesa_transform_tab[4][MATRIX_PERSPECTIVE] = - _mesa_3dnow_transform_points4_perspective; - _mesa_transform_tab[4][MATRIX_2D_NO_ROT] = - _mesa_3dnow_transform_points4_2d_no_rot; - _mesa_transform_tab[4][MATRIX_2D] = - _mesa_3dnow_transform_points4_2d; - - } - - -#ifdef DEBUG_MATH - _math_test_all_transform_functions("x86_64"); - _math_test_all_cliptest_functions("x86_64"); - _math_test_all_normal_transform_functions("x86_64"); -#endif - -#endif -} diff --git a/src/libs/mesa/mesa/x86-64/x86-64.h b/src/libs/mesa/mesa/x86-64/x86-64.h deleted file mode 100644 index 1d931fa345..0000000000 --- a/src/libs/mesa/mesa/x86-64/x86-64.h +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 __X86_64_ASM_H__ -#define __X86_64_ASM_H__ - -extern void _mesa_init_all_x86_64_transform_asm( void ); - -#endif diff --git a/src/libs/mesa/mesa/x86-64/xform4.S b/src/libs/mesa/mesa/x86-64/xform4.S deleted file mode 100644 index 805969127d..0000000000 --- a/src/libs/mesa/mesa/x86-64/xform4.S +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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 USE_X86_64_ASM - -#include "matypes.h" - -.text - -.align 16 -.globl _mesa_x86_64_cpuid -_mesa_x86_64_cpuid: - pushq %rbx - movl (%rdi), %eax - movl 8(%rdi), %ecx - - cpuid - - movl %ebx, 4(%rdi) - movl %eax, (%rdi) - movl %ecx, 8(%rdi) - movl %edx, 12(%rdi) - popq %rbx - ret - -.align 16 -.globl _mesa_x86_64_transform_points4_general -_mesa_x86_64_transform_points4_general: -/* - * rdi = dest - * rsi = matrix - * rdx = source - */ - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - .byte 0x66, 0x66, 0x66, 0x90 /* manual align += 3 */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - testl %ecx, %ecx /* verify non-zero count */ - prefetchnta 64(%rsi) - jz p4_general_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - prefetch 16(%rdx) - - movaps 0(%rsi), %xmm4 /* m3 | m2 | m1 | m0 */ - movaps 16(%rsi), %xmm5 /* m7 | m6 | m5 | m4 */ - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - movaps 32(%rsi), %xmm6 /* m11 | m10 | m9 | m8 */ - movaps 48(%rsi), %xmm7 /* m15 | m14 | m13 | m12 */ - -p4_general_loop: - - movups (%rdx), %xmm8 /* ox | oy | oz | ow */ - prefetchw 16(%rdi) - - pshufd $0x00, %xmm8, %xmm0 /* ox | ox | ox | ox */ - addq %rax, %rdx - pshufd $0x55, %xmm8, %xmm1 /* oy | oy | oy | oy */ - mulps %xmm4, %xmm0 /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */ - pshufd $0xAA, %xmm8, %xmm2 /* oz | oz | oz | ox */ - mulps %xmm5, %xmm1 /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */ - pshufd $0xFF, %xmm8, %xmm3 /* ow | ow | ow | ow */ - mulps %xmm6, %xmm2 /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */ - addps %xmm1, %xmm0 /* ox*m3+oy*m7 | ... */ - mulps %xmm7, %xmm3 /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */ - addps %xmm2, %xmm0 /* ox*m3+oy*m7+oz*m11 | ... */ - prefetch 16(%rdx) - addps %xmm3, %xmm0 /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */ - - movaps %xmm0, (%rdi) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */ - addq $16, %rdi - - decl %ecx - jnz p4_general_loop - -p4_general_done: - .byte 0xf3 - ret - -.section .rodata - -.align 16 -p4_constants: -.byte 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff -.byte 0x00, 0x00, 0x00, 0x00 - -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.float 0f+1.0 - -.text -.align 16 -.globl _mesa_x86_64_transform_points4_3d -/* - * this is slower than _mesa_x86_64_transform_points4_general - * because it ensures that the last matrix row (or is it column?) is 0,0,0,1 - */ -_mesa_x86_64_transform_points4_3d: - - leaq p4_constants(%rip), %rax - - prefetchnta 64(%rsi) - - movaps (%rax), %xmm9 - movaps 16(%rax), %xmm10 - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - testl %ecx, %ecx /* verify non-zero count */ - jz p4_3d_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - prefetch 16(%rdx) - - movaps 0(%rsi), %xmm4 /* m3 | m2 | m1 | m0 */ - movaps 16(%rsi), %xmm5 /* m7 | m6 | m5 | m4 */ - andps %xmm9, %xmm4 /* 0.0 | m2 | m1 | m0 */ - movaps 32(%rsi), %xmm6 /* m11 | m10 | m9 | m8 */ - andps %xmm9, %xmm5 /* 0.0 | m6 | m5 | m4 */ - movaps 48(%rsi), %xmm7 /* m15 | m14 | m13 | m12 */ - andps %xmm9, %xmm6 /* 0.0 | m10 | m9 | m8 */ - andps %xmm9, %xmm7 /* 0.0 | m14 | m13 | m12 */ - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - orps %xmm10, %xmm7 /* 1.0 | m14 | m13 | m12 */ - -p4_3d_loop: - - movups (%rdx), %xmm8 /* ox | oy | oz | ow */ - prefetchw 16(%rdi) - - pshufd $0x00, %xmm8, %xmm0 /* ox | ox | ox | ox */ - addq %rax, %rdx - pshufd $0x55, %xmm8, %xmm1 /* oy | oy | oy | oy */ - mulps %xmm4, %xmm0 /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */ - pshufd $0xAA, %xmm8, %xmm2 /* oz | oz | oz | ox */ - mulps %xmm5, %xmm1 /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */ - pshufd $0xFF, %xmm8, %xmm3 /* ow | ow | ow | ow */ - mulps %xmm6, %xmm2 /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */ - addps %xmm1, %xmm0 /* ox*m3+oy*m7 | ... */ - mulps %xmm7, %xmm3 /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */ - addps %xmm2, %xmm0 /* ox*m3+oy*m7+oz*m11 | ... */ - prefetch 16(%rdx) - addps %xmm3, %xmm0 /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */ - - movaps %xmm0, (%rdi) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */ - addq $16, %rdi - - dec %ecx - jnz p4_3d_loop - -p4_3d_done: - .byte 0xf3 - ret - - -.align 16 -.globl _mesa_x86_64_transform_points4_identity -_mesa_x86_64_transform_points4_identity: - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - test %ecx, %ecx - jz p4_identity_done - - movq V4F_START(%rdx), %rsi /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - prefetch 64(%rsi) - prefetchw 64(%rdi) - - add %ecx, %ecx - - rep movsq - -p4_identity_done: - .byte 0xf3 - ret - - -.align 16 -.globl _mesa_3dnow_transform_points4_3d_no_rot -_mesa_3dnow_transform_points4_3d_no_rot: - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - test %ecx, %ecx - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - jz p4_3d_no_rot_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - prefetch (%rdx) - - movd (%rsi), %mm0 /* | m00 */ - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - punpckldq 20(%rsi), %mm0 /* m11 | m00 */ - - movd 40(%rsi), %mm2 /* | m22 */ - movq 48(%rsi), %mm1 /* m31 | m30 */ - - punpckldq 56(%rsi), %mm2 /* m11 | m00 */ - -p4_3d_no_rot_loop: - - prefetchw 32(%rdi) - - movq (%rdx), %mm4 /* x1 | x0 */ - movq 8(%rdx), %mm5 /* x3 | x2 */ - movd 12(%rdx), %mm7 /* | x3 */ - - movq %mm5, %mm6 /* x3 | x2 */ - pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */ - - punpckhdq %mm6, %mm6 /* x3 | x3 */ - pfmul %mm2, %mm5 /* x3*m32 | x2*m22 */ - - pfmul %mm1, %mm6 /* x3*m31 | x3*m30 */ - pfacc %mm7, %mm5 /* x3 | x2*m22+x3*m32 */ - - pfadd %mm6, %mm4 /* x1*m11+x3*m31 | x0*m00+x3*m30 */ - - addq %rax, %rdx - movq %mm4, (%rdi) /* write r0, r1 */ - movq %mm5, 8(%rdi) /* write r2, r3 */ - - addq $16, %rdi - - decl %ecx - prefetch 32(%rdx) - jnz p4_3d_no_rot_loop - -p4_3d_no_rot_done: - femms - ret - - -.align 16 -.globl _mesa_3dnow_transform_points4_perspective -_mesa_3dnow_transform_points4_perspective: - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - test %ecx, %ecx - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - jz p4_perspective_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - movd (%rsi), %mm0 /* | m00 */ - pxor %mm7, %mm7 /* 0 | 0 */ - punpckldq 20(%rsi), %mm0 /* m11 | m00 */ - - movq 32(%rsi), %mm2 /* m21 | m20 */ - prefetch (%rdx) - - movd 40(%rsi), %mm1 /* | m22 */ - - .byte 0x66, 0x66, 0x90 /* manual align += 3 */ - punpckldq 56(%rsi), %mm1 /* m32 | m22 */ - - -p4_perspective_loop: - - prefetchw 32(%rdi) /* prefetch 2 vertices ahead */ - - movq (%rdx), %mm4 /* x1 | x0 */ - movq 8(%rdx), %mm5 /* x3 | x2 */ - movd 8(%rdx), %mm3 /* | x2 */ - - movq %mm5, %mm6 /* x3 | x2 */ - pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */ - - punpckldq %mm5, %mm5 /* x2 | x2 */ - - pfmul %mm2, %mm5 /* x2*m21 | x2*m20 */ - pfsubr %mm7, %mm3 /* | -x2 */ - - pfmul %mm1, %mm6 /* x3*m32 | x2*m22 */ - pfadd %mm4, %mm5 /* x1*m11+x2*m21 | x0*m00+x2*m20 */ - - pfacc %mm3, %mm6 /* -x2 | x2*m22+x3*m32 */ - - movq %mm5, (%rdi) /* write r0, r1 */ - addq %rax, %rdx - movq %mm6, 8(%rdi) /* write r2, r3 */ - - addq $16, %rdi - - decl %ecx - prefetch 32(%rdx) /* hopefully stride is zero */ - jnz p4_perspective_loop - -p4_perspective_done: - femms - ret - -.align 16 -.globl _mesa_3dnow_transform_points4_2d_no_rot -_mesa_3dnow_transform_points4_2d_no_rot: - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - test %ecx, %ecx - .byte 0x90 /* manual align += 1 */ - jz p4_2d_no_rot_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - movd (%rsi), %mm0 /* | m00 */ - prefetch (%rdx) - punpckldq 20(%rsi), %mm0 /* m11 | m00 */ - - movq 48(%rsi), %mm1 /* m31 | m30 */ - -p4_2d_no_rot_loop: - - prefetchw 32(%rdi) /* prefetch 2 vertices ahead */ - - movq (%rdx), %mm4 /* x1 | x0 */ - movq 8(%rdx), %mm5 /* x3 | x2 */ - - pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */ - movq %mm5, %mm6 /* x3 | x2 */ - - punpckhdq %mm6, %mm6 /* x3 | x3 */ - - addq %rax, %rdx - pfmul %mm1, %mm6 /* x3*m31 | x3*m30 */ - - prefetch 32(%rdx) /* hopefully stride is zero */ - pfadd %mm4, %mm6 /* x1*m11+x3*m31 | x0*m00+x3*m30 */ - - movq %mm6, (%rdi) /* write r0, r1 */ - movq %mm5, 8(%rdi) /* write r2, r3 */ - - addq $16, %rdi - - decl %ecx - jnz p4_2d_no_rot_loop - -p4_2d_no_rot_done: - femms - ret - - -.align 16 -.globl _mesa_3dnow_transform_points4_2d -_mesa_3dnow_transform_points4_2d: - - movl V4F_COUNT(%rdx), %ecx /* count */ - movzx V4F_STRIDE(%rdx), %eax /* stride */ - - movl %ecx, V4F_COUNT(%rdi) /* set dest count */ - movl $4, V4F_SIZE(%rdi) /* set dest size */ - .byte 0x66, 0x66, 0x90 /* manual align += 4 */ - orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - - test %ecx, %ecx - .byte 0x66, 0x66, 0x90 /* manual align += 4 */ - jz p4_2d_done - - movq V4F_START(%rdx), %rdx /* ptr to first src vertex */ - movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ - - movd (%rsi), %mm0 /* | m00 */ - movd 4(%rsi), %mm1 /* | m01 */ - - prefetch (%rdx) - - punpckldq 16(%rsi), %mm0 /* m10 | m00 */ - .byte 0x66, 0x66, 0x90 /* manual align += 4 */ - punpckldq 20(%rsi), %mm1 /* m11 | m01 */ - - movq 48(%rsi), %mm2 /* m31 | m30 */ - -p4_2d_loop: - - prefetchw 32(%rdi) /* prefetch 2 vertices ahead */ - - movq (%rdx), %mm3 /* x1 | x0 */ - movq 8(%rdx), %mm5 /* x3 | x2 */ - - movq %mm3, %mm4 /* x1 | x0 */ - movq %mm5, %mm6 /* x3 | x2 */ - - pfmul %mm1, %mm4 /* x1*m11 | x0*m01 */ - punpckhdq %mm6, %mm6 /* x3 | x3 */ - - pfmul %mm0, %mm3 /* x1*m10 | x0*m00 */ - - addq %rax, %rdx - pfacc %mm4, %mm3 /* x0*m01+x1*m11 | x0*m00+x1*m10 */ - - pfmul %mm2, %mm6 /* x3*m31 | x3*m30 */ - prefetch 32(%rdx) /* hopefully stride is zero */ - - pfadd %mm6, %mm3 /* r1 | r0 */ - - movq %mm3, (%rdi) /* write r0, r1 */ - movq %mm5, 8(%rdi) /* write r2, r3 */ - - addq $16, %rdi - - decl %ecx - jnz p4_2d_loop - -p4_2d_done: - femms - ret - -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow.c b/src/libs/mesa/mesa/x86/3dnow.c deleted file mode 100644 index c037a61761..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow.c +++ /dev/null @@ -1,91 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0.1 - * - * Copyright (C) 1999-2003 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. - */ - -/* - * 3DNow! optimizations contributed by - * Holger Waechtler - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "math/m_xform.h" -#include "tnl/t_context.h" - -#include "3dnow.h" -#include "common_x86_macros.h" - -#ifdef DEBUG_MATH -#include "math/m_debug.h" -#endif - - -#ifdef USE_3DNOW_ASM -DECLARE_XFORM_GROUP( 3dnow, 2 ) -DECLARE_XFORM_GROUP( 3dnow, 3 ) -DECLARE_XFORM_GROUP( 3dnow, 4 ) - -DECLARE_NORM_GROUP( 3dnow ) - - -extern void _ASMAPI -_mesa_v16_3dnow_general_xform( GLfloat *first_vert, - const GLfloat *m, - const GLfloat *src, - GLuint src_stride, - GLuint count ); - -extern void _ASMAPI -_mesa_3dnow_project_vertices( GLfloat *first, - GLfloat *last, - const GLfloat *m, - GLuint stride ); - -extern void _ASMAPI -_mesa_3dnow_project_clipped_vertices( GLfloat *first, - GLfloat *last, - const GLfloat *m, - GLuint stride, - const GLubyte *clipmask ); -#endif - - -void _mesa_init_3dnow_transform_asm( void ) -{ -#ifdef USE_3DNOW_ASM - ASSIGN_XFORM_GROUP( 3dnow, 2 ); - ASSIGN_XFORM_GROUP( 3dnow, 3 ); - ASSIGN_XFORM_GROUP( 3dnow, 4 ); - - /* There's a bug somewhere in the 3dnow_normal.S file that causes - * bad shading. Disable for now. - ASSIGN_NORM_GROUP( 3dnow ); - */ - -#ifdef DEBUG_MATH - _math_test_all_transform_functions( "3DNow!" ); - _math_test_all_normal_transform_functions( "3DNow!" ); -#endif -#endif -} diff --git a/src/libs/mesa/mesa/x86/3dnow.h b/src/libs/mesa/mesa/x86/3dnow.h deleted file mode 100644 index df9f2638d7..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * 3DNow! optimizations contributed by - * Holger Waechtler - */ - -#ifndef __3DNOW_H__ -#define __3DNOW_H__ - -#include "math/m_xform.h" - -void _mesa_init_3dnow_transform_asm( void ); - -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow_normal.S b/src/libs/mesa/mesa/x86/3dnow_normal.S deleted file mode 100644 index 7f5f6b357f..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow_normal.S +++ /dev/null @@ -1,852 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 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. - */ - -/* - * 3Dnow assembly code by Holger Waechtler - */ - -#ifdef USE_3DNOW_ASM - -#include "assyntax.h" -#include "matypes.h" -#include "norm_args.h" - - SEG_TEXT - -#define M(i) REGOFF(i * 4, ECX) -#define STRIDE REGOFF(12, ESI) - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals) -HIDDEN(_mesa_3dnow_transform_normalize_normals) -GLNAME(_mesa_3dnow_transform_normalize_normals): - -#define FRAME_OFFSET 12 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - PUSH_L ( EBP ) - - MOV_L ( ARG_LENGTHS, EDI ) - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */ - MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - - CMP_L ( CONST(0), EBP ) /* count > 0 ?? */ - JE ( LLBL (G3TN_end) ) - - MOV_L ( REGOFF (V4F_COUNT, ESI), EBP ) - FEMMS - - PUSH_L ( EBP ) - PUSH_L ( EAX ) - PUSH_L ( EDX ) /* save counter & pointer for */ - /* the normalize pass */ -#undef FRAME_OFFSET -#define FRAME_OFFSET 24 - - MOVQ ( M(0), MM3 ) /* m1 | m0 */ - MOVQ ( M(4), MM4 ) /* m5 | m4 */ - - MOVD ( M(2), MM5 ) /* | m2 */ - PUNPCKLDQ ( M(6), MM5 ) /* m6 | m2 */ - - MOVQ ( M(8), MM6 ) /* m9 | m8 */ - MOVQ ( M(10), MM7 ) /* | m10 */ - - CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */ - JNE ( LLBL (G3TN_scale_end ) ) - - MOVD ( ARG_SCALE, MM0 ) /* | scale */ - PUNPCKLDQ ( MM0, MM0 ) /* scale | scale */ - - PFMUL ( MM0, MM3 ) /* scale * m1 | scale * m0 */ - PFMUL ( MM0, MM4 ) /* scale * m5 | scale * m4 */ - PFMUL ( MM0, MM5 ) /* scale * m6 | scale * m2 */ - PFMUL ( MM0, MM6 ) /* scale * m9 | scale * m8 */ - PFMUL ( MM0, MM7 ) /* | scale * m10 */ - -ALIGNTEXT32 -LLBL (G3TN_scale_end): -LLBL (G3TN_transform): - MOVQ ( REGIND (EDX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */ - - MOVQ ( MM0, MM1 ) /* x1 | x0 */ - PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ - - PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PREFETCHW ( REGIND(EAX) ) - - PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */ - PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */ - - PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */ - PFADD ( MM2, MM0 ) /* x0*m4+x1*m5+x2*m6| x0*m0+...+x2**/ - - MOVQ ( REGIND (EDX), MM1 ) /* x1 | x0 */ - MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */ - - PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */ - MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */ - - PFMUL ( MM7, MM2 ) /* | x2*m10 */ - PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */ - - PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m*/ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - JNZ ( LLBL (G3TN_transform) ) - - - POP_L ( EDX ) /* end of transform --- */ - POP_L ( EAX ) /* now normalizing ... */ - POP_L ( EBP ) - - CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */ - JE ( LLBL (G3TN_norm ) ) /* calculate lengths */ - - -ALIGNTEXT32 -LLBL (G3TN_norm_w_lengths): - - PREFETCHW ( REGOFF(12,EAX) ) - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - - MOVD ( REGIND (EDI), MM3 ) /* | length (x) */ - PFMUL ( MM3, MM1 ) /* | x2 (normalize*/ - - PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */ - PFMUL ( MM3, MM0 ) /* x1 (normalized) | x0 (normalize*/ - - ADD_L ( STRIDE, EDX ) /* next normal */ - ADD_L ( CONST(4), EDI ) /* next length */ - - PREFETCH ( REGIND(EDI) ) - - MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */ - MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */ - - ADD_L ( CONST(16), EAX ) /* next r */ - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - - JNZ ( LLBL (G3TN_norm_w_lengths) ) - JMP ( LLBL (G3TN_exit_3dnow) ) - -ALIGNTEXT32 -LLBL (G3TN_norm): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND (EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - - MOVQ ( MM0, MM3 ) /* x1 | x0 */ - MOVQ ( MM1, MM4 ) /* | x2 */ - - PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PFMUL ( MM1, MM4 ) /* | x2*x2 */ - PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */ - - PFACC ( MM3, MM3 ) /* **not used** | x0*x0+x1*x1+x2**/ - PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */ - - MOVQ ( MM5, MM4 ) - PUNPCKLDQ ( MM3, MM3 ) - - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - PFMUL ( MM5, MM5 ) - - PFRSQIT1 ( MM3, MM5 ) - PFRCPIT2 ( MM4, MM5 ) - - PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalize*/ - - MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */ - PFMUL ( MM5, MM1 ) /* | x2 (normalize*/ - - MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - JNZ ( LLBL (G3TN_norm) ) - -LLBL (G3TN_exit_3dnow): - FEMMS - -LLBL (G3TN_end): - POP_L ( EBP ) - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot) -HIDDEN(_mesa_3dnow_transform_normalize_normals_no_rot) -GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 12 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - PUSH_L ( EBP ) - - MOV_L ( ARG_LENGTHS, EDI ) - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */ - MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - - CMP_L ( CONST(0), EBP ) /* count > 0 ?? */ - JE ( LLBL (G3TNNR_end) ) - - FEMMS - - MOVD ( M(0), MM0 ) /* | m0 */ - PUNPCKLDQ ( M(5), MM0 ) /* m5 | m0 */ - - MOVD ( M(10), MM2 ) /* | m10 */ - PUNPCKLDQ ( MM2, MM2 ) /* m10 | m10 */ - - CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */ - JNE ( LLBL (G3TNNR_scale_end ) ) - - MOVD ( ARG_SCALE, MM7 ) /* | scale */ - PUNPCKLDQ ( MM7, MM7 ) /* scale | scale */ - - PFMUL ( MM7, MM0 ) /* scale * m5 | scale * m0 */ - PFMUL ( MM7, MM2 ) /* scale * m10 | scale * m10 */ - -ALIGNTEXT32 -LLBL (G3TNNR_scale_end): - CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */ - JE ( LLBL (G3TNNR_norm) ) /* need to calculate lengths */ - - MOVD ( REGIND(EDI), MM3 ) /* | length (x) */ - - -ALIGNTEXT32 -LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */ - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */ - - PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - PFMUL ( MM2, MM7 ) /* | x2*m10 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PFMUL ( MM3, MM7 ) /* | x2 (normalized) */ - PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */ - - ADD_L ( CONST(4), EDI ) /* next length */ - PFMUL ( MM3, MM6 ) /* x1 (normalized) | x0 (normalized) */ - - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */ - - MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ - MOVD ( REGIND(EDI), MM3 ) /* | length (x) */ - - JNZ ( LLBL (G3TNNR_norm_w_lengths) ) - JMP ( LLBL (G3TNNR_exit_3dnow) ) - -ALIGNTEXT32 -LLBL (G3TNNR_norm): /* need to calculate lengths */ - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */ - - PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PFMUL ( MM2, MM7 ) /* | x2*m10 */ - MOVQ ( MM6, MM3 ) /* x1 (transformed)| x0 (transformed) */ - - MOVQ ( MM7, MM4 ) /* | x2 (transformed) */ - PFMUL ( MM6, MM3 ) /* x1*x1 | x0*x0 */ - - - PFMUL ( MM7, MM4 ) /* | x2*x2 */ - PFACC ( MM3, MM3 ) /* **not used** | x0*x0+x1*x1 */ - - PFADD ( MM4, MM3 ) /* | x0*x0+x1*x1+x2*x2*/ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */ - MOVQ ( MM5, MM4 ) - - PUNPCKLDQ ( MM3, MM3 ) - PFMUL ( MM5, MM5 ) - - PFRSQIT1 ( MM3, MM5 ) - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - - PFRCPIT2 ( MM4, MM5 ) - PFMUL ( MM5, MM6 ) /* x1 (normalized) | x0 (normalized) */ - - MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */ - PFMUL ( MM5, MM7 ) /* | x2 (normalized) */ - - MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ - JNZ ( LLBL (G3TNNR_norm) ) - - -LLBL (G3TNNR_exit_3dnow): - FEMMS - -LLBL (G3TNNR_end): - POP_L ( EBP ) - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot) -HIDDEN(_mesa_3dnow_transform_rescale_normals_no_rot) -GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 12 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - PUSH_L ( EBP ) - - MOV_L ( ARG_IN, EAX ) - MOV_L ( ARG_DEST, EDX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EBP ) /* dest->count = in->count */ - MOV_L ( EBP, REGOFF(V4F_COUNT, EDX) ) - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - MOV_L ( REGOFF(V4F_START, EDX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - - CMP_L ( CONST(0), EBP ) - JE ( LLBL (G3TRNR_end) ) - - FEMMS - - MOVD ( ARG_SCALE, MM6 ) /* | scale */ - PUNPCKLDQ ( MM6, MM6 ) /* scale | scale */ - - MOVD ( REGIND(ECX), MM0 ) /* | m0 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m5 | m0 */ - - PFMUL ( MM6, MM0 ) /* scale*m5 | scale*m0 */ - MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */ - - PFMUL ( MM6, MM2 ) /* | scale*m10 */ - -ALIGNTEXT32 -LLBL (G3TRNR_rescale): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */ - - PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - PFMUL ( MM2, MM5 ) /* | x2*m10 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ - - MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JNZ ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */ - - FEMMS - -LLBL (G3TRNR_end): - POP_L ( EBP ) - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals) -HIDDEN(_mesa_3dnow_transform_rescale_normals) -GLNAME(_mesa_3dnow_transform_rescale_normals): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 8 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */ - MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - - CMP_L ( CONST(0), EDI ) - JE ( LLBL (G3TR_end) ) - - FEMMS - - MOVQ ( REGIND(ECX), MM3 ) /* m1 | m0 */ - - MOVQ ( REGOFF(16,ECX), MM4 ) /* m5 | m4 */ - MOVD ( ARG_SCALE, MM0 ) /* scale */ - - MOVD ( REGOFF(8,ECX), MM5 ) /* | m2 */ - PUNPCKLDQ ( MM0, MM0 ) /* scale | scale */ - - PUNPCKLDQ ( REGOFF(24, ECX), MM5 ) - PFMUL ( MM0, MM3 ) /* scale*m1 | scale*m0 */ - - MOVQ ( REGOFF(32, ECX), MM6 ) /* m9 | m8*/ - PFMUL ( MM0, MM4 ) /* scale*m5 | scale*m4 */ - - MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */ - PFMUL ( MM0, MM5 ) /* scale*m6 | scale*m2 */ - - PFMUL ( MM0, MM6 ) /* scale*m9 | scale*m8 */ - - PFMUL ( MM0, MM7 ) /* | scale*m10 */ - -ALIGNTEXT32 -LLBL (G3TR_rescale): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ - - MOVQ ( MM0, MM1 ) /* x1 | x0 */ - PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ - - PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */ - PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */ - - MOVQ ( REGIND(EDX), MM1 ) /* x1 | x0 */ - - PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */ - PFADD ( MM2, MM0 ) /* x0*m4...+x2*m6| x0*m0+x1*m1+x2*m2 */ - - MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */ - PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */ - - PFMUL ( MM7, MM2 ) /* | x2*m10 */ - PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */ - - PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ - MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - - SUB_L ( CONST(1), EDI ) /* decrement normal counter */ - JNZ ( LLBL (G3TR_rescale) ) - - FEMMS - -LLBL (G3TR_end): - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_normals_no_rot) -HIDDEN(_mesa_3dnow_transform_normals_no_rot) -GLNAME(_mesa_3dnow_transform_normals_no_rot): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 8 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */ - MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - - CMP_L ( CONST(0), EDI ) - JE ( LLBL (G3TNR_end) ) - - FEMMS - - MOVD ( REGIND(ECX), MM0 ) /* | m0 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m5 | m0 */ - - MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */ - PUNPCKLDQ ( MM2, MM2 ) /* m10 | m10 */ - -ALIGNTEXT32 -LLBL (G3TNR_transform): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */ - - PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */ - ADD_L ( STRIDE, EDX) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - PFMUL ( MM2, MM5 ) /* | x2*m10 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - SUB_L ( CONST(1), EDI ) /* decrement normal counter */ - MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ - - MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JNZ ( LLBL (G3TNR_transform) ) - - FEMMS - -LLBL (G3TNR_end): - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_transform_normals) -HIDDEN(_mesa_3dnow_transform_normals) -GLNAME(_mesa_3dnow_transform_normals): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 8 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( ARG_MAT, ECX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */ - MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */ - MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */ - - CMP_L ( CONST(0), EDI ) /* count > 0 ?? */ - JE ( LLBL (G3T_end) ) - - FEMMS - - MOVQ ( REGIND(ECX), MM3 ) /* m1 | m0 */ - MOVQ ( REGOFF(16, ECX), MM4 ) /* m5 | m4 */ - - MOVD ( REGOFF(8, ECX), MM5 ) /* | m2 */ - PUNPCKLDQ ( REGOFF(24, ECX), MM5 ) /* m6 | m2 */ - - MOVQ ( REGOFF(32, ECX), MM6 ) /* m9 | m8 */ - MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */ - -ALIGNTEXT32 -LLBL (G3T_transform): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ - - MOVQ ( MM0, MM1 ) /* x1 | x0 */ - PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ - - PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */ - PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */ - - PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */ - PFADD ( MM2, MM0 ) /* x0*m4...+x2*m6| x0*m0+x1*m1+x2*m2 */ - - MOVQ ( REGIND(EDX), MM1 ) /* x1 | x0 */ - MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */ - - PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */ - MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ - - PFMUL ( MM7, MM2 ) /* | x2*m10 */ - ADD_L ( STRIDE, EDX ) /* next normal */ - - PREFETCH ( REGIND(EDX) ) - - PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */ - PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ - - MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - SUB_L ( CONST(1), EDI ) /* decrement normal counter */ - - JNZ ( LLBL (G3T_transform) ) - - FEMMS - -LLBL (G3T_end): - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_normalize_normals) -HIDDEN(_mesa_3dnow_normalize_normals) -GLNAME(_mesa_3dnow_normalize_normals): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 12 - - PUSH_L ( EDI ) - PUSH_L ( ESI ) - PUSH_L ( EBP ) - - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */ - MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), ECX ) /* in->start */ - MOV_L ( ARG_LENGTHS, EDX ) - - CMP_L ( CONST(0), EBP ) /* count > 0 ?? */ - JE ( LLBL (G3N_end) ) - - FEMMS - - CMP_L ( CONST(0), EDX ) /* lengths == 0 ? */ - JE ( LLBL (G3N_norm2) ) /* calculate lengths */ - -ALIGNTEXT32 -LLBL (G3N_norm1): /* use precalculated lengths */ - - PREFETCH ( REGIND(EAX) ) - - MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */ - - MOVD ( REGIND(EDX), MM3 ) /* | length (x) */ - PFMUL ( MM3, MM1 ) /* | x2 (normalized) */ - - PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */ - ADD_L ( STRIDE, ECX ) /* next normal */ - - PREFETCH ( REGIND(ECX) ) - - PFMUL ( MM3, MM0 ) /* x1 (normalized) | x0 (normalized) */ - MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */ - - MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */ - ADD_L ( CONST(16), EAX ) /* next r */ - - ADD_L ( CONST(4), EDX ) /* next length */ - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - - JNZ ( LLBL (G3N_norm1) ) - - JMP ( LLBL (G3N_end1) ) - -ALIGNTEXT32 -LLBL (G3N_norm2): /* need to calculate lengths */ - - PREFETCHW ( REGIND(EAX) ) - - PREFETCH ( REGIND(ECX) ) - - MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */ - - MOVQ ( MM0, MM3 ) /* x1 | x0 */ - ADD_L ( STRIDE, ECX ) /* next normal */ - - PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */ - MOVQ ( MM1, MM4 ) /* | x2 */ - - ADD_L ( CONST(16), EAX ) /* next r */ - PFMUL ( MM1, MM4 ) /* | x2*x2 */ - - PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */ - PFACC ( MM3, MM3 ) /* x0*x0+...+x2*x2 | x0*x0+x1*x1+x2*x2*/ - - PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */ - MOVQ ( MM5, MM4 ) - - PUNPCKLDQ ( MM3, MM3 ) - PFMUL ( MM5, MM5 ) - - PFRSQIT1 ( MM3, MM5 ) - SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - - PFRCPIT2 ( MM4, MM5 ) - - PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalized) */ - MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */ - - PFMUL ( MM5, MM1 ) /* | x2 (normalized) */ - MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - - JNZ ( LLBL (G3N_norm2) ) - -LLBL (G3N_end1): - FEMMS - -LLBL (G3N_end): - POP_L ( EBP ) - POP_L ( ESI ) - POP_L ( EDI ) - RET - - - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_3dnow_rescale_normals) -HIDDEN(_mesa_3dnow_rescale_normals) -GLNAME(_mesa_3dnow_rescale_normals): - -#undef FRAME_OFFSET -#define FRAME_OFFSET 8 - PUSH_L ( EDI ) - PUSH_L ( ESI ) - - MOV_L ( ARG_IN, ESI ) - MOV_L ( ARG_DEST, EAX ) - MOV_L ( REGOFF(V4F_COUNT, ESI), EDX ) /* dest->count = in->count */ - MOV_L ( EDX, REGOFF(V4F_COUNT, EAX) ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */ - MOV_L ( REGOFF(V4F_START, ESI), ECX ) /* in->start */ - - CMP_L ( CONST(0), EDX ) - JE ( LLBL (G3R_end) ) - - FEMMS - - MOVD ( ARG_SCALE, MM0 ) /* scale */ - PUNPCKLDQ ( MM0, MM0 ) - -ALIGNTEXT32 -LLBL (G3R_rescale): - - PREFETCHW ( REGIND(EAX) ) - - MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */ - MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */ - - PFMUL ( MM0, MM1 ) /* x1*scale | x0*scale */ - ADD_L ( STRIDE, ECX ) /* next normal */ - - PREFETCH ( REGIND(ECX) ) - - PFMUL ( MM0, MM2 ) /* | x2*scale */ - ADD_L ( CONST(16), EAX ) /* next r */ - - MOVQ ( MM1, REGOFF(-16, EAX) ) /* write r0, r1 */ - MOVD ( MM2, REGOFF(-8, EAX) ) /* write r2 */ - - SUB_L ( CONST(1), EDX ) /* decrement normal counter */ - JNZ ( LLBL (G3R_rescale) ) - - FEMMS - -LLBL (G3R_end): - POP_L ( ESI ) - POP_L ( EDI ) - RET - -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow_xform1.S b/src/libs/mesa/mesa/x86/3dnow_xform1.S deleted file mode 100644 index a73301a8d6..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow_xform1.S +++ /dev/null @@ -1,437 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 USE_3DNOW_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FRAME_OFFSET 4 - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_general ) -HIDDEN(_mesa_3dnow_transform_points1_general) -GLNAME( _mesa_3dnow_transform_points1_general ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPGR_3 ) ) - - MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ - MOVQ ( REGOFF(8, ECX), MM1 ) /* m03 | m02 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - MOVQ ( REGOFF(56, ECX), MM3 ) /* m33 | m32 */ - -ALIGNTEXT16 -LLBL( G3TPGR_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ - - MOVQ ( MM4, MM5 ) /* x0 | x0 */ - PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ - - PFMUL ( MM1, MM5 ) /* x0*m03 | x0*m02 */ - PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ - - PFADD ( MM3, MM5 ) /* x0*m03+m33 | x0*m02+m32 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - - MOVQ ( MM5, REGOFF(8, EDX) ) /* write r3, r2 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TPGR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPGR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_identity ) -HIDDEN(_mesa_3dnow_transform_points1_identity) -GLNAME( _mesa_3dnow_transform_points1_identity ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(1), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPIR_4) ) - -ALIGNTEXT16 -LLBL( G3TPIR_3 ): - - MOVD ( REGIND(EAX), MM0 ) /* | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - MOVD ( MM0, REGIND(EDX) ) /* | r0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPIR_3 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPIR_4 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_3d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points1_3d_no_rot) -GLNAME( _mesa_3dnow_transform_points1_3d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3NRR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TP3NRR_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - PFMUL ( MM0, MM4 ) /* | x0*m00 */ - - PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - - MOVD ( MM3, REGOFF(8, EDX) ) /* write r2 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP3NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3NRR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_perspective ) -HIDDEN(_mesa_3dnow_transform_points1_perspective) -GLNAME( _mesa_3dnow_transform_points1_perspective ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPPR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TPPR_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* 0 | x0 */ - PFMUL ( MM0, MM4 ) /* 0 | x0*m00 */ - - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - MOVQ ( MM3, REGOFF(8, EDX) ) /* write r2 (=m32), r3 (=0) */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPPR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPPR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_2d ) -HIDDEN(_mesa_3dnow_transform_points1_2d) -GLNAME( _mesa_3dnow_transform_points1_2d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2R_3 ) ) - - MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2R_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ - - PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ - PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ - - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2R_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_2d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points1_2d_no_rot) -GLNAME( _mesa_3dnow_transform_points1_2d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2NRR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2NRR_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - PFMUL ( MM0, MM4 ) /* | x0*m00 */ - PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */ - - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2NRR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points1_3d ) -HIDDEN(_mesa_3dnow_transform_points1_3d) -GLNAME( _mesa_3dnow_transform_points1_3d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(4, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3R_3 ) ) - - MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ - MOVD ( REGOFF(8, ECX), MM1 ) /* | m02 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TP3R_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ - - MOVQ ( MM4, MM5 ) /* | x0 */ - PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ - - PFMUL ( MM1, MM5 ) /* | x0*m02 */ - PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ - - PFADD ( MM3, MM5 ) /* | x0*m02+m32 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - - MOVD ( MM5, REGOFF(8, EDX) ) /* write r2 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP3R_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3R_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow_xform2.S b/src/libs/mesa/mesa/x86/3dnow_xform2.S deleted file mode 100644 index 2988fb7bfd..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow_xform2.S +++ /dev/null @@ -1,477 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 USE_3DNOW_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FRAME_OFFSET 4 - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_general ) -HIDDEN(_mesa_3dnow_transform_points2_general) -GLNAME( _mesa_3dnow_transform_points2_general ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPGR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */ - - MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */ - - MOVD ( REGOFF(8, ECX), MM2 ) /* | m02 */ - PUNPCKLDQ ( REGOFF(24, ECX), MM2 ) /* m12 | m02 */ - - MOVD ( REGOFF(12, ECX), MM3 ) /* | m03 */ - PUNPCKLDQ ( REGOFF(28, ECX), MM3 ) /* m13 | m03 */ - - MOVQ ( REGOFF(48, ECX), MM4 ) /* m31 | m30 */ - MOVQ ( REGOFF(56, ECX), MM5 ) /* m33 | m32 */ - -ALIGNTEXT16 -LLBL( G3TPGR_2 ): - - MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */ - MOVQ ( MM6, MM7 ) /* x1 | x0 */ - - PFMUL ( MM0, MM6 ) /* x1*m10 | x0*m00 */ - PFMUL ( MM1, MM7 ) /* x1*m11 | x0*m01 */ - - PFACC ( MM7, MM6 ) /* x0*m01+x1*m11 | x0*x00+x1*m10 */ - PFADD ( MM4, MM6 ) /* x0*...*m11+m31 | x0*...*m10+m30 */ - - MOVQ ( MM6, REGIND(EDX) ) /* write r1, r0 */ - MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */ - - MOVQ ( MM6, MM7 ) /* x1 | x0 */ - PFMUL ( MM2, MM6 ) /* x1*m12 | x0*m02 */ - - PFMUL ( MM3, MM7 ) /* x1*m13 | x0*m03 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - PFACC ( MM7, MM6 ) /* x0*m03+x1*m13 | x0*x02+x1*m12 */ - PFADD ( MM5, MM6 ) /* x0*...*m13+m33 | x0*...*m12+m32 */ - - MOVQ ( MM6, REGOFF(8, EDX) ) /* write r3, r2 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPGR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPGR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_perspective ) -HIDDEN(_mesa_3dnow_transform_points2_perspective) -GLNAME( _mesa_3dnow_transform_points2_perspective ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPPR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TPPR_2 ): - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - MOVQ ( MM3, REGOFF(8, EDX) ) /* write r2 (=m32), r3 (=0) */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPPR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPPR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_3d ) -HIDDEN(_mesa_3dnow_transform_points2_3d) -GLNAME( _mesa_3dnow_transform_points2_3d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3 ), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3R_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */ - - MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */ - - MOVD ( REGOFF(8, ECX), MM2 ) /* | m02 */ - PUNPCKLDQ ( REGOFF(24, ECX), MM2 ) /* m12 | m02 */ - - MOVQ ( REGOFF(48, ECX), MM4 ) /* m31 | m30 */ - MOVD ( REGOFF(56, ECX), MM5 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TP3R_2 ): - - MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */ - MOVQ ( MM6, MM7 ) /* x1 | x0 */ - - PFMUL ( MM0, MM6 ) /* x1*m10 | x0*m00 */ - PFMUL ( MM1, MM7 ) /* x1*m11 | x0*m01 */ - - PFACC ( MM7, MM6 ) /* x0*m01+x1*m11 | x0*x00+x1*m10 */ - PFADD ( MM4, MM6 ) /* x0*...*m11+m31 | x0*...*m10+m30 */ - - MOVQ ( MM6, REGIND(EDX) ) /* write r1, r0 */ - MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */ - - MOVQ ( MM6, MM7 ) /* x1 | x0 */ - PFMUL ( MM2, MM6 ) /* x1*m12 | x0*m02 */ - - PFACC ( MM7, MM6 ) /* ***trash*** | x0*x02+x1*m12 */ - PFADD ( MM5, MM6 ) /* ***trash*** | x0*...*m12+m32 */ - - MOVD ( MM6, REGOFF(8, EDX) ) /* write r2 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP3R_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3R_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_3d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points2_3d_no_rot) -GLNAME( _mesa_3dnow_transform_points2_3d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3 ), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3NRR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TP3NRR_2 ): - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - - PFADD ( MM2, MM4 ) /* x1*m11+m31 | x0*m00+m30 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - - MOVD ( MM3, REGOFF(8, EDX) ) /* write r2 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP3NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3NRR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_2d ) -HIDDEN(_mesa_3dnow_transform_points2_2d) -GLNAME( _mesa_3dnow_transform_points2_2d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2R_3 ) ) - - MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ - MOVQ ( REGOFF(16, ECX), MM1 ) /* m11 | m10 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2R_2 ): - - MOVD ( REGIND(EAX), MM4 ) /* | x0 */ - MOVD ( REGOFF(4, EAX), MM5 ) /* | x1 */ - - PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ - PUNPCKLDQ ( MM5, MM5 ) /* x1 | x1 */ - - PFMUL ( MM1, MM5 ) /* x1*m11 | x1*m10 */ - PFADD ( MM2, MM4 ) /* x...x1*m11+31 | x0*..*m10+m30 */ - - PFADD ( MM5, MM4 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2R_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_2d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points2_2d_no_rot) -GLNAME( _mesa_3dnow_transform_points2_2d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2NRR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2NRR_2 ): - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */ - - MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2NRR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points2_identity ) -HIDDEN(_mesa_3dnow_transform_points2_identity) -GLNAME( _mesa_3dnow_transform_points2_identity ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPIR_3 ) ) - -ALIGNTEXT16 -LLBL( G3TPIR_3 ): - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ - - MOVQ ( MM0, REGIND(EDX) ) /* r1 | r0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPIR_3 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPIR_4 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow_xform3.S b/src/libs/mesa/mesa/x86/3dnow_xform3.S deleted file mode 100644 index a356aaee76..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow_xform3.S +++ /dev/null @@ -1,561 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 USE_3DNOW_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FRAME_OFFSET 4 - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_general ) -HIDDEN(_mesa_3dnow_transform_points3_general) -GLNAME( _mesa_3dnow_transform_points3_general ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPGR_2 ) ) - - PREFETCHW ( REGIND(EDX) ) - -ALIGNTEXT16 -LLBL( G3TPGR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - MOVQ ( MM0, MM1 ) /* x1 | x0 */ - PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ - - PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */ - MOVQ ( MM2, MM5 ) /* x2 | x2 */ - - PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */ - PFMUL ( REGOFF(32, ECX), MM2 ) /* x2*m9 | x2*m8 */ - - MOVQ ( MM0, MM3 ) /* x0 | x0 */ - PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */ - - MOVQ ( MM1, MM4 ) /* x1 | x1 */ - PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */ - - PFADD ( REGOFF(48, ECX), MM2 ) /* x2*m9+m13 | x2*m8+m12 */ - PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */ - - PFADD ( REGOFF(56, ECX), MM5 ) /* x2*m11+m15 | x2*m10+m14 */ - PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */ - - PFMUL ( REGOFF(8, ECX), MM3 ) /* x0*m3 | x0*m2 */ - PFADD ( MM1, MM2 ) /* r1 | r0 */ - - PFMUL ( REGOFF(24, ECX), MM4 ) /* x1*m7 | x1*m6 */ - ADD_L ( CONST(16), EDX ) /* next output vertex */ - - PFADD ( MM3, MM4 ) /* x0*m3+x1*m7 | x0*m2+x1*m6 */ - MOVQ ( MM2, REGOFF(-16, EDX) ) /* write r0, r1 */ - - PFADD ( MM4, MM5 ) /* r3 | r2 */ - MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPGR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_perspective ) -HIDDEN(_mesa_3dnow_transform_points3_perspective) -GLNAME( _mesa_3dnow_transform_points3_perspective ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPPR_2 ) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCHW ( REGIND(EDX) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVQ ( REGOFF(32, ECX), MM1 ) /* m21 | m20 */ - MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */ - - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - -ALIGNTEXT16 -LLBL( G3TPPR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - PXOR ( MM7, MM7 ) /* 0 | 0 */ - MOVQ ( MM5, MM6 ) /* | x2 */ - - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - PFSUB ( MM5, MM7 ) /* | -x2 */ - - PFMUL ( MM2, MM6 ) /* | x2*m22 */ - PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */ - - ADD_L ( CONST(16), EDX ) /* next r */ - PFMUL ( MM1, MM5 ) /* x2*m21 | x2*m20 */ - - PFADD ( MM3, MM6 ) /* | x2*m22+m32 */ - PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */ - - MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVD ( MM6, REGOFF(-8, EDX) ) /* write r2 */ - - MOVD ( MM7, REGOFF(-4, EDX) ) /* write r3 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPPR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_3d ) -HIDDEN(_mesa_3dnow_transform_points3_3d) -GLNAME( _mesa_3dnow_transform_points3_3d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3R_2 ) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCH ( REGIND(EDX) ) - - MOVD ( REGOFF(8, ECX), MM7 ) /* | m2 */ - PUNPCKLDQ ( REGOFF(24, ECX), MM7 ) /* m6 | m2 */ - - -ALIGNTEXT16 -LLBL( G3TP3R_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - MOVQ ( MM0, MM2 ) /* x1 | x0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PUNPCKLDQ ( MM2, MM2 ) /* x0 | x0 */ - MOVQ ( MM0, MM3 ) /* x1 | x0 */ - - PFMUL ( REGIND(ECX), MM2 ) /* x0*m1 | x0*m0 */ - PUNPCKHDQ ( MM3, MM3 ) /* x1 | x1 */ - - MOVQ ( MM1, MM4 ) /* | x2 */ - PFMUL ( REGOFF(16, ECX), MM3 ) /* x1*m5 | x1*m4 */ - - PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */ - PFADD ( MM2, MM3 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */ - - PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */ - PFADD ( REGOFF(48, ECX), MM3 ) /* x0*m1+...+m11 | x0*m0+x1*m4+m12 */ - - PFMUL ( MM7, MM0 ) /* x1*m6 | x0*m2 */ - PFADD ( MM4, MM3 ) /* r1 | r0 */ - - PFMUL ( REGOFF(40, ECX), MM1 ) /* | x2*m10 */ - PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m14 | x2*m10 */ - - PFACC ( MM0, MM1 ) - - MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */ - PFACC ( MM1, MM1 ) /* | r2 */ - - MOVD ( MM1, REGOFF(-8, EDX) ) /* write r2 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3R_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_3d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points3_3d_no_rot) -GLNAME( _mesa_3dnow_transform_points3_3d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3NRR_2 ) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCHW ( REGIND(EDX) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */ - PUNPCKLDQ ( MM2, MM2 ) /* m22 | m22 */ - - MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - - PUNPCKLDQ ( MM3, MM3 ) /* m32 | m32 */ - - -ALIGNTEXT16 -LLBL( G3TP3NRR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCHW ( REGIND(EAX) ) - - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - - PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */ - PFMUL ( MM2, MM5 ) /* | x2*m22 */ - - PFADD ( MM3, MM5 ) /* | x2*m22+m32 */ - MOVQ ( MM4, REGIND(EDX) ) /* write r0, r1 */ - - ADD_L ( CONST(16), EDX ) /* next r */ - DEC_L ( ESI ) /* decrement vertex counter */ - - MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 */ - JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3NRR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_2d ) -HIDDEN(_mesa_3dnow_transform_points3_2d) -GLNAME( _mesa_3dnow_transform_points3_2d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2R_3) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCHW ( REGIND(EDX) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */ - - MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2R_2 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - MOVQ ( MM3, MM4 ) /* x1 | x0 */ - PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */ - - ADD_L ( CONST(16), EDX ) /* next r */ - PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */ - - PFACC ( MM4, MM3 ) /* x0*m00+x1*m10 | x0*m01+x1*m11 */ - MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */ - - PFADD ( MM2, MM3 ) /* x0*...*m10+m30 | x0*...*m11+m31 */ - MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2R_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_2d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points3_2d_no_rot) -GLNAME( _mesa_3dnow_transform_points3_2d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2NRR_2 ) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCHW ( REGIND(EDX) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - - -ALIGNTEXT16 -LLBL( G3TP2NRR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */ - - MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP2NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2NRR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points3_identity ) -HIDDEN(_mesa_3dnow_transform_points3_identity) -GLNAME( _mesa_3dnow_transform_points3_identity ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPIR_2 ) ) - - PREFETCHW ( REGIND(EDX) ) - -ALIGNTEXT16 -LLBL( G3TPIR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ADD_L ( CONST(16), EDX ) /* next r */ - - DEC_L ( ESI ) /* decrement vertex counter */ - MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */ - - MOVD ( MM1, REGOFF(-8, EDX) ) /* | r2 */ - JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPIR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/3dnow_xform4.S b/src/libs/mesa/mesa/x86/3dnow_xform4.S deleted file mode 100644 index b2b7c64f23..0000000000 --- a/src/libs/mesa/mesa/x86/3dnow_xform4.S +++ /dev/null @@ -1,570 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 USE_3DNOW_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FRAME_OFFSET 4 - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_general ) -HIDDEN(_mesa_3dnow_transform_points4_general) -GLNAME( _mesa_3dnow_transform_points4_general ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPGR_2 ) ) - - PREFETCHW ( REGIND(EDX) ) - -ALIGNTEXT16 -LLBL( G3TPGR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - MOVQ ( MM0, MM2 ) /* x1 | x0 */ - MOVQ ( MM4, MM6 ) /* x3 | x2 */ - - PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */ - PUNPCKHDQ ( MM2, MM2 ) /* x1 | x1 */ - - MOVQ ( MM0, MM1 ) /* x0 | x0 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */ - MOVQ ( MM2, MM3 ) /* x1 | x1 */ - - PFMUL ( REGOFF(8, ECX), MM1 ) /* x0*m3 | x0*m2 */ - PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */ - - PFMUL ( REGOFF(16, ECX), MM2 ) /* x1*m5 | x1*m4 */ - MOVQ ( MM4, MM5 ) /* x2 | x2 */ - - PFMUL ( REGOFF(24, ECX), MM3 ) /* x1*m7 | x1*m6 */ - PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */ - - PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */ - MOVQ ( MM6, MM7 ) /* x3 | x3 */ - - PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */ - PFADD ( MM0, MM2 ) - - PFMUL ( REGOFF(48, ECX), MM6 ) /* x3*m13 | x3*m12 */ - PFADD ( MM1, MM3 ) - - PFMUL ( REGOFF(56, ECX), MM7 ) /* x3*m15 | x3*m14 */ - PFADD ( MM4, MM6 ) - - PFADD ( MM5, MM7 ) - PFADD ( MM2, MM6 ) - - PFADD ( MM3, MM7 ) - MOVQ ( MM6, REGOFF(-16, EDX) ) - - MOVQ ( MM7, REGOFF(-8, EDX) ) - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPGR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_perspective ) -HIDDEN(_mesa_3dnow_transform_points4_perspective) -GLNAME( _mesa_3dnow_transform_points4_perspective ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPPR_2 ) ) - - PREFETCH ( REGIND(EAX) ) - PREFETCHW ( REGIND(EDX) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVD ( REGOFF(40, ECX), MM1 ) /* | m22 */ - PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m32 | m22 */ - - MOVQ ( REGOFF(32, ECX), MM2 ) /* m21 | m20 */ - PXOR ( MM7, MM7 ) /* 0 | 0 */ - -ALIGNTEXT16 -LLBL( G3TPPR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - MOVD ( REGOFF(8, EAX), MM3 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */ - - MOVQ ( MM5, MM6 ) /* x3 | x2 */ - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - - PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PFMUL ( MM2, MM5 ) /* x2*m21 | x2*m20 */ - PFSUBR ( MM7, MM3 ) /* | -x2 */ - - PFMUL ( MM1, MM6 ) /* x3*m32 | x2*m22 */ - PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */ - - PFACC ( MM3, MM6 ) /* -x2 | x2*m22+x3*m32 */ - MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */ - - MOVQ ( MM6, REGOFF(-8, EDX) ) /* write r2, r3 */ - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPPR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_3d ) -HIDDEN(_mesa_3dnow_transform_points4_3d) -GLNAME( _mesa_3dnow_transform_points4_3d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3R_2 ) ) - - MOVD ( REGOFF(8, ECX), MM6 ) /* | m2 */ - PUNPCKLDQ ( REGOFF(24, ECX), MM6 ) /* m6 | m2 */ - - MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */ - PUNPCKLDQ ( REGOFF(56, ECX), MM7 ) /* m14 | m10 */ - -ALIGNTEXT16 -LLBL( G3TP3R_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - PREFETCH ( REGOFF(32, EAX) ) /* hopefully array is tightly packed */ - - MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */ - - MOVQ ( MM2, MM0 ) /* x1 | x0 */ - MOVQ ( MM3, MM4 ) /* x3 | x2 */ - - MOVQ ( MM0, MM1 ) /* x1 | x0 */ - MOVQ ( MM4, MM5 ) /* x3 | x2 */ - - PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */ - PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */ - - PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */ - PUNPCKLDQ ( MM3, MM3 ) /* x2 | x2 */ - - PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */ - PUNPCKHDQ ( MM4, MM4 ) /* x3 | x3 */ - - PFMUL ( MM6, MM2 ) /* x1*m6 | x0*m2 */ - PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */ - - PFMUL ( REGOFF(32, ECX), MM3 ) /* x2*m9 | x2*m8 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PFMUL ( REGOFF(48, ECX), MM4 ) /* x3*m13 | x3*m12 */ - PFADD ( MM1, MM3 ) /* x0*m1+..+x2*m9 | x0*m0+...+x2*m8 */ - - PFMUL ( MM7, MM5 ) /* x3*m14 | x2*m10 */ - PFADD ( MM3, MM4 ) /* r1 | r0 */ - - PFACC ( MM2, MM5 ) /* x0*m2+x1*m6 | x2*m10+x3*m14 */ - MOVD ( REGOFF(12, EAX), MM0 ) /* | x3 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PFACC ( MM0, MM5 ) /* r3 | r2 */ - - MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3R_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_3d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points4_3d_no_rot) -GLNAME( _mesa_3dnow_transform_points4_3d_no_rot ): - - PUSH_L ( ESI ) - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP3NRR_2 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */ - PUNPCKLDQ ( REGOFF(56, ECX), MM2 ) /* m32 | m22 */ - - MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP3NRR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */ - - MOVQ ( MM5, MM6 ) /* x3 | x2 */ - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - - PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */ - PFMUL ( MM2, MM5 ) /* x3*m32 | x2*m22 */ - - PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */ - PFACC ( MM7, MM5 ) /* x3 | x2*m22+x3*m32 */ - - PFADD ( MM6, MM4 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP3NRR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_2d ) -HIDDEN(_mesa_3dnow_transform_points4_2d) -GLNAME( _mesa_3dnow_transform_points4_2d ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2R_2 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */ - - MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */ - - MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2R_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - MOVQ ( MM3, MM4 ) /* x1 | x0 */ - MOVQ ( MM5, MM6 ) /* x3 | x2 */ - - PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */ - PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */ - - PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */ - ADD_L ( CONST(16), EDX ) /* next r */ - - PFACC ( MM4, MM3 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */ - PFMUL ( MM2, MM6 ) /* x3*m31 | x3*m30 */ - - PFADD ( MM6, MM3 ) /* r1 | r0 */ - MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - - MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TP2R_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2R_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_2d_no_rot ) -HIDDEN(_mesa_3dnow_transform_points4_2d_no_rot) -GLNAME( _mesa_3dnow_transform_points4_2d_no_rot ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TP2NRR_3 ) ) - - MOVD ( REGIND(ECX), MM0 ) /* | m00 */ - PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ - - MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - -ALIGNTEXT16 -LLBL( G3TP2NRR_2 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ - MOVQ ( MM5, MM6 ) /* x3 | x2 */ - - ADD_L ( CONST(16), EDX ) /* next r */ - PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */ - - PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */ - PFADD ( MM4, MM6 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */ - - MOVQ ( MM6, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - - JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TP2NRR_3 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_3dnow_transform_points4_identity ) -HIDDEN(_mesa_3dnow_transform_points4_identity) -GLNAME( _mesa_3dnow_transform_points4_identity ): - - PUSH_L ( ESI ) - - MOV_L ( ARG_DEST, ECX ) - MOV_L ( ARG_MATRIX, ESI ) - MOV_L ( ARG_SOURCE, EAX ) - MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) - OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) - MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) - MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) - - PUSH_L ( EDI ) - - MOV_L ( REGOFF(V4F_START, ECX), EDX ) - MOV_L ( ESI, ECX ) - MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) - MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) - MOV_L ( REGOFF(V4F_START, EAX), EAX ) - - TEST_L ( ESI, ESI ) - JZ ( LLBL( G3TPIR_2 ) ) - -ALIGNTEXT16 -LLBL( G3TPIR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - PREFETCH ( REGIND(EAX) ) - - ADD_L ( CONST(16), EDX ) /* next r */ - MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */ - - MOVQ ( MM1, REGOFF(-8, EDX) ) /* r3 | r2 */ - - DEC_L ( ESI ) /* decrement vertex counter */ - JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */ - -LLBL( G3TPIR_2 ): - - FEMMS - POP_L ( EDI ) - POP_L ( ESI ) - RET -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/assyntax.h b/src/libs/mesa/mesa/x86/assyntax.h deleted file mode 100644 index 524944f73a..0000000000 --- a/src/libs/mesa/mesa/x86/assyntax.h +++ /dev/null @@ -1,1747 +0,0 @@ - -#ifndef __ASSYNTAX_H__ -#define __ASSYNTAX_H__ - -/* - * Copyright 1992 Vrije Universiteit, The Netherlands - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the Vrije Universiteit not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The Vrije Universiteit makes no - * representations about the suitability of this software for any purpose. - * It is provided "as is" without express or implied warranty. - * - * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * assyntax.h - * - * Select the syntax appropriate to the 386 assembler being used - * To add support for more assemblers add more columns to the CHOICE - * macro. Note that register names must also have uppercase names - * to avoid macro recursion. e.g., #define ah %ah recurses! - * - * NB 1. Some of the macros for certain assemblers imply that the code is to - * run in protected mode!! Caveat emptor. - * - * NB 2. 486 specific instructions are not included. This is to discourage - * their accidental use in code that is intended to run on 386 and 486 - * systems. - * - * Supported assemblers: - * - * (a) AT&T SysVr4 as(1): define ATT_ASSEMBLER - * (b) GNU Assembler gas: define GNU_ASSEMBLER (default) - * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER - * (d) The Netwide Assembler: define NASM_ASSEMBLER - * (e) Microsoft Assembler: define MASM_ASSEMBLER (UNTESTED!) - * - * The following naming conventions have been used to identify the various - * data types: - * _SR = segment register version - * Integer: - * _Q = quadword = 64 bits - * _L = long = 32 bits - * _W = short = 16 bits - * _B = byte = 8 bits - * Floating-point: - * _X = m80real = 80 bits - * _D = double = 64 bits - * _S = single = 32 bits - * - * Author: Gregory J. Sharp, Sept 1992 - * Vrije Universiteit, Amsterdam, The Netherlands - * - * [support for Intel syntax added by Josh Vanderhoof, 1999] - */ - -#if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)) - -/* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */ -#if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER) -#define ATT_ASSEMBLER -#endif - -#if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER) -#define GNU_ASSEMBLER -#endif - -#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__)) -#define CONCAT(x, y) x ## y -#define CONCAT3(x, y, z) x ## y ## z -#else -#define CONCAT(x, y) x/**/y -#define CONCAT3(x, y, z) x/**/y/**/z -#endif - -#ifdef ACK_ASSEMBLER - -/* Assume we write code for 32-bit protected mode! */ - -/* Redefine register names for GAS & AT&T assemblers */ -#define AL al -#define AH ah -#define AX ax -#define EAX ax -#define BL bl -#define BH bh -#define BX bx -#define EBX bx -#define CL cl -#define CH ch -#define CX cx -#define ECX cx -#define DL dl -#define DH dh -#define DX dx -#define EDX dx -#define BP bp -#define EBP bp -#define SI si -#define ESI si -#define DI di -#define EDI di -#define SP sp -#define ESP sp -#define CS cs -#define SS ss -#define DS ds -#define ES es -#define FS fs -#define GS gs -/* Control Registers */ -#define CR0 cr0 -#define CR1 cr1 -#define CR2 cr2 -#define CR3 cr3 -/* Debug Registers */ -#define DR0 dr0 -#define DR1 dr1 -#define DR2 dr2 -#define DR3 dr3 -#define DR4 dr4 -#define DR5 dr5 -#define DR6 dr6 -#define DR7 dr7 -/* Floating-point Stack */ -#define ST st - -#define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text - - -#define _WTOG o16 /* word toggle for _W instructions */ -#define _LTOG /* long toggle for _L instructions */ -#define ADDR_TOGGLE a16 -#define OPSZ_TOGGLE o16 -#define USE16 .use16 -#define USE32 .use32 - -#define CHOICE(a,b,c) c - -#else /* AT&T or GAS */ - -/* Redefine register names for GAS & AT&T assemblers */ -#define AL %al -#define AH %ah -#define AX %ax -#define EAX %eax -#define BL %bl -#define BH %bh -#define BX %bx -#define EBX %ebx -#define CL %cl -#define CH %ch -#define CX %cx -#define ECX %ecx -#define DL %dl -#define DH %dh -#define DX %dx -#define EDX %edx -#define BP %bp -#define EBP %ebp -#define SI %si -#define ESI %esi -#define DI %di -#define EDI %edi -#define SP %sp -#define ESP %esp -#define CS %cs -#define SS %ss -#define DS %ds -#define ES %es -#define FS %fs -#define GS %gs -/* Control Registers */ -#define CR0 %cr0 -#define CR1 %cr1 -#define CR2 %cr2 -#define CR3 %cr3 -/* Debug Registers */ -#define DR0 %db0 -#define DR1 %db1 -#define DR2 %db2 -#define DR3 %db3 -#define DR4 %db4 -#define DR5 %db5 -#define DR6 %db6 -#define DR7 %db7 -/* Floating-point Stack */ -#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) -#ifdef GNU_ASSEMBLER -#define ST0 %st(0) -#else -#define ST0 %st -#endif -/* MMX Registers */ -#define MM0 %mm0 -#define MM1 %mm1 -#define MM2 %mm2 -#define MM3 %mm3 -#define MM4 %mm4 -#define MM5 %mm5 -#define MM6 %mm6 -#define MM7 %mm7 -/* SSE Registers */ -#define XMM0 %xmm0 -#define XMM1 %xmm1 -#define XMM2 %xmm2 -#define XMM3 %xmm3 -#define XMM4 %xmm4 -#define XMM5 %xmm5 -#define XMM6 %xmm6 -#define XMM7 %xmm7 - -#define AS_BEGIN -#define USE16 -#define USE32 - -#ifdef GNU_ASSEMBLER - -#define ADDR_TOGGLE aword -#define OPSZ_TOGGLE word - -#define CHOICE(a,b,c) b - -#else -/* - * AT&T ASSEMBLER SYNTAX - * ********************* - */ -#define CHOICE(a,b,c) a - -#define ADDR_TOGGLE addr16 -#define OPSZ_TOGGLE data16 - -#endif /* GNU_ASSEMBLER */ -#endif /* ACK_ASSEMBLER */ - - -#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) -#define GLNAME(a) a -#else -#define GLNAME(a) CONCAT(_,a) -#endif - - - /****************************************/ - /* */ - /* Select the various choices */ - /* */ - /****************************************/ - - -/* Redefine assembler directives */ -/*********************************/ -#define GLOBL CHOICE(.globl, .globl, .extern) -#define GLOBAL GLOBL -#define EXTERN GLOBL -#ifndef __AOUT__ -#define ALIGNTEXT32 CHOICE(.align 32, .balign 32, .align 32) -#define ALIGNTEXT16 CHOICE(.align 16, .balign 16, .align 16) -#define ALIGNTEXT8 CHOICE(.align 8, .balign 8, .align 8) -#define ALIGNTEXT4 CHOICE(.align 4, .balign 4, .align 4) -#define ALIGNTEXT2 CHOICE(.align 2, .balign 2, .align 2) -/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is - * guaranteed to be filled with NOPs. Otherwise it does nothing. - */ -#define ALIGNTEXT32ifNOP CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/) -#define ALIGNTEXT16ifNOP CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/) -#define ALIGNTEXT8ifNOP CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/) -#define ALIGNTEXT4ifNOP CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/) -#define ALIGNDATA32 CHOICE(.align 32, .balign ARG2(32,0x0), .align 32) -#define ALIGNDATA16 CHOICE(.align 16, .balign ARG2(16,0x0), .align 16) -#define ALIGNDATA8 CHOICE(.align 8, .balign ARG2(8,0x0), .align 8) -#define ALIGNDATA4 CHOICE(.align 4, .balign ARG2(4,0x0), .align 4) -#define ALIGNDATA2 CHOICE(.align 2, .balign ARG2(2,0x0), .align 2) -#else -/* 'as -aout' on FreeBSD doesn't have .balign */ -#define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32) -#define ALIGNTEXT16 CHOICE(.align 16, .align ARG2(4,0x90), .align 16) -#define ALIGNTEXT8 CHOICE(.align 8, .align ARG2(3,0x90), .align 8) -#define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4) -#define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2) -/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is - * guaranteed to be filled with NOPs. Otherwise it does nothing. - */ -#define ALIGNTEXT32ifNOP CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/) -#define ALIGNTEXT16ifNOP CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/) -#define ALIGNTEXT8ifNOP CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/) -#define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/) -#define ALIGNDATA32 CHOICE(.align 32, .align ARG2(5,0x0), .align 32) -#define ALIGNDATA16 CHOICE(.align 16, .align ARG2(4,0x0), .align 16) -#define ALIGNDATA8 CHOICE(.align 8, .align ARG2(3,0x0), .align 8) -#define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4) -#define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2) -#endif /* __AOUT__ */ -#define FILE(s) CHOICE(.file s, .file s, .file s) -#define STRING(s) CHOICE(.string s, .asciz s, .asciz s) -#define D_LONG CHOICE(.long, .long, .data4) -#define D_WORD CHOICE(.value, .short, .data2) -#define D_BYTE CHOICE(.byte, .byte, .data1) -#define SPACE CHOICE(.comm, .space, .space) -#define COMM CHOICE(.comm, .comm, .comm) -#define SEG_DATA CHOICE(.data, .data, .sect .data) -#define SEG_TEXT CHOICE(.text, .text, .sect .text) -#define SEG_BSS CHOICE(.bss, .bss, .sect .bss) - -#ifdef GNU_ASSEMBLER -#define D_SPACE(n) . = . + n -#else -#define D_SPACE(n) .space n -#endif - -/* Addressing Modes */ -/* Immediate Mode */ -#define ADDR(a) CHOICE(CONCAT($,a), $a, a) -#define CONST(a) CHOICE(CONCAT($,a), $a, a) - -/* Indirect Mode */ -#define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */ -#define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */ -/* Register b indirect plus displacement a */ -#define REGOFF(a, b) CHOICE(a(b), a(b), a(b)) -/* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode - * which has no scaling - */ -#define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i)) -/* Reg indirect Base + (Index * Scale) */ -#define REGBIS(b,i,s) CHOICE((b,i,s), (b,i,s), (b)(i*s)) -/* Reg indirect Base + (Index * Scale) + Displacement */ -#define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s)) -/* Displaced Scaled Index: */ -#define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s)) -/* Indexed Base: */ -#define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i)) -/* Displaced Base: */ -#define REGDB(d,b) CHOICE(d(b), d(b), d(b)) -/* Variable indirect: */ -#define VARINDIRECT(var) CHOICE(*var, *var, (var)) -/* Use register contents as jump/call target: */ -#define CODEPTR(reg) CHOICE(*reg, *reg, reg) - -/* For expressions requiring bracketing - * eg. (CRT0_PM | CRT_EM) - */ - -#define EXPR(a) CHOICE([a], (a), [a]) -#define ENOT(a) CHOICE(0!a, ~a, ~a) -#define EMUL(a,b) CHOICE(a\*b, a*b, a*b) -#define EDIV(a,b) CHOICE(a\/b, a/b, a/b) - -/* - * We have to beat the problem of commas within arguments to choice. - * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI - * and other known cpp definitions evaluate arguments before substitution - * so the following works. - */ -#define ARG2(a, b) a,b -#define ARG3(a,b,c) a,b,c - -/* Redefine assembler commands */ -#define AAA CHOICE(aaa, aaa, aaa) -#define AAD CHOICE(aad, aad, aad) -#define AAM CHOICE(aam, aam, aam) -#define AAS CHOICE(aas, aas, aas) -#define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a)) -#define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a)) -#define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a)) -#define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a)) -#define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a)) -#define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a)) -#define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a)) -#define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a)) -#define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a)) -#define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a)) -#define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a)) -#define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a)) -#define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a)) -#define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a)) -#define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a)) -#define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a)) -#define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a)) -#define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a)) -#define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a)) -#define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a)) -#define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a)) -#define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a)) -#define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a)) -#define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a)) -#define CALL(a) CHOICE(call a, call a, call a) -#define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a) -#define CBW CHOICE(cbtw, cbw, cbw) -#define CWDE CHOICE(cwtd, cwde, cwde) -#define CLC CHOICE(clc, clc, clc) -#define CLD CHOICE(cld, cld, cld) -#define CLI CHOICE(cli, cli, cli) -#define CLTS CHOICE(clts, clts, clts) -#define CMC CHOICE(cmc, cmc, cmc) -#define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a)) -#define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a)) -#define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a)) -#define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps) -#define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps) -#define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb) -#define CWD CHOICE(cwtl, cwd, cwd) -#define CDQ CHOICE(cltd, cdq, cdq) -#define DAA CHOICE(daa, daa, daa) -#define DAS CHOICE(das, das, das) -#define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a) -#define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a) -#define DEC_B(a) CHOICE(decb a, decb a, decb a) -#define DIV_L(a) CHOICE(divl a, divl a, div a) -#define DIV_W(a) CHOICE(divw a, divw a, div a) -#define DIV_B(a) CHOICE(divb a, divb a, divb a) -#define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a)) -#define HLT CHOICE(hlt, hlt, hlt) -#define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a) -#define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a) -#define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a) -/* More forms than this for imul!! */ -#define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a)) -#define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a)) -#define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a) -#define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX) -#define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX) -#define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX) -/* Please AS code writer: use the following ONLY, if you refer to ports<256 - * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer - */ -#if defined (sun) -#define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a) -#define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a) -#define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a) -#else -#define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a) -#define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a) -#define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a) -#endif -#define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a) -#define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a) -#define INC_B(a) CHOICE(incb a, incb a, incb a) -#define INS_L CHOICE(insl, insl, _LTOG ins) -#define INS_W CHOICE(insw, insw, _WTOG ins) -#define INS_B CHOICE(insb, insb, insb) -#define INT(a) CHOICE(int a, int a, int a) -#define INT3 CHOICE(int CONST(3), int3, int CONST(3)) -#define INTO CHOICE(into, into, into) -#define IRET CHOICE(iret, iret, iret) -#define IRETD CHOICE(iret, iret, iretd) -#define JA(a) CHOICE(ja a, ja a, ja a) -#define JAE(a) CHOICE(jae a, jae a, jae a) -#define JB(a) CHOICE(jb a, jb a, jb a) -#define JBE(a) CHOICE(jbe a, jbe a, jbe a) -#define JC(a) CHOICE(jc a, jc a, jc a) -#define JE(a) CHOICE(je a, je a, je a) -#define JG(a) CHOICE(jg a, jg a, jg a) -#define JGE(a) CHOICE(jge a, jge a, jge a) -#define JL(a) CHOICE(jl a, jl a, jl a) -#define JLE(a) CHOICE(jle a, jle a, jle a) -#define JNA(a) CHOICE(jna a, jna a, jna a) -#define JNAE(a) CHOICE(jnae a, jnae a, jnae a) -#define JNB(a) CHOICE(jnb a, jnb a, jnb a) -#define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a) -#define JNC(a) CHOICE(jnc a, jnc a, jnc a) -#define JNE(a) CHOICE(jne a, jne a, jne a) -#define JNG(a) CHOICE(jng a, jng a, jng a) -#define JNGE(a) CHOICE(jnge a, jnge a, jnge a) -#define JNL(a) CHOICE(jnl a, jnl a, jnl a) -#define JNLE(a) CHOICE(jnle a, jnle a, jnle a) -#define JNO(a) CHOICE(jno a, jno a, jno a) -#define JNP(a) CHOICE(jnp a, jnp a, jnp a) -#define JNS(a) CHOICE(jns a, jns a, jns a) -#define JNZ(a) CHOICE(jnz a, jnz a, jnz a) -#define JO(a) CHOICE(jo a, jo a, jo a) -#define JP(a) CHOICE(jp a, jp a, jp a) -#define JPE(a) CHOICE(jpe a, jpe a, jpe a) -#define JPO(a) CHOICE(jpo a, jpo a, jpo a) -#define JS(a) CHOICE(js a, js a, js a) -#define JZ(a) CHOICE(jz a, jz a, jz a) -#define JMP(a) CHOICE(jmp a, jmp a, jmp a) -#define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a) -#define LAHF CHOICE(lahf, lahf, lahf) -#if !defined(_REAL_MODE) && !defined(_V86_MODE) -#define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a)) -#endif -#define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a)) -#define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a)) -#define LEAVE CHOICE(leave, leave, leave) -#define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a) -#define LIDT(a) CHOICE(lidt a, lidt a, lidt a) -#define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a)) -#define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a)) -#define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a)) -#define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a)) -#define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a)) -#define LLDT(a) CHOICE(lldt a, lldt a, lldt a) -#define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a) -#define LOCK CHOICE(lock, lock, lock) -#define LODS_L CHOICE(lodsl, lodsl, _LTOG lods) -#define LODS_W CHOICE(lodsw, lodsw, _WTOG lods) -#define LODS_B CHOICE(lodsb, lodsb, lodsb) -#define LOOP(a) CHOICE(loop a, loop a, loop a) -#define LOOPE(a) CHOICE(loope a, loope a, loope a) -#define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a) -#define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a) -#define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a) -#if !defined(_REAL_MODE) && !defined(_V86_MODE) -#define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a)) -#endif -#define LTR(a) CHOICE(ltr a, ltr a, ltr a) -#define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a)) -#define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a)) -#define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a)) -#define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a)) -#define MOVS_L CHOICE(movsl, movsl, _LTOG movs) -#define MOVS_W CHOICE(movsw, movsw, _WTOG movs) -#define MOVS_B CHOICE(movsb, movsb, movsb) -#define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a)) -#define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a)) -#define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a)) -#define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a)) -#define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a)) -#define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a)) -#define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a) -#define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a) -#define MUL_B(a) CHOICE(mulb a, mulb a, mulb a) -#define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a) -#define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a) -#define NEG_B(a) CHOICE(negb a, negb a, negb a) -#define NOP CHOICE(nop, nop, nop) -#define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a) -#define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a) -#define NOT_B(a) CHOICE(notb a, notb a, notb a) -#define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a)) -#define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a)) -#define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a)) -#define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX) -#define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX) -#define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX) -/* Please AS code writer: use the following ONLY, if you refer to ports<256 - * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer - */ -#define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a) -#define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a) -#define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a) -#define OUTS_L CHOICE(outsl, outsl, _LTOG outs) -#define OUTS_W CHOICE(outsw, outsw, _WTOG outs) -#define OUTS_B CHOICE(outsb, outsb, outsb) -#define POP_SR(a) CHOICE(pop a, pop a, pop a) -#define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a) -#define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a) -#define POPA_L CHOICE(popal, popal, _LTOG popa) -#define POPA_W CHOICE(popaw, popaw, _WTOG popa) -#define POPF_L CHOICE(popfl, popfl, _LTOG popf) -#define POPF_W CHOICE(popfw, popfw, _WTOG popf) -#define PUSH_SR(a) CHOICE(push a, push a, push a) -#define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a) -#define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a) -#define PUSH_B(a) CHOICE(push a, pushb a, push a) -#define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha) -#define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha) -#define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf) -#define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf) -#define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a)) -#define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a)) -#define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a)) -#define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a)) -#define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a)) -#define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a)) -#define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a)) -#define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a)) -#define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a)) -#define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a)) -#define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a)) -#define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a)) -#define REP CHOICE(rep ;, rep ;, repe) -#define REPE CHOICE(repz ;, repe ;, repe) -#define REPNE CHOICE(repnz ;, repne ;, repne) -#define REPNZ REPNE -#define REPZ REPE -#define RET CHOICE(ret, ret, ret) -#define SAHF CHOICE(sahf, sahf, sahf) -#define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a)) -#define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a)) -#define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a)) -#define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a)) -#define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a)) -#define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a)) -#define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a)) -#define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a)) -#define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a)) -#define SCAS_L CHOICE(scasl, scasl, _LTOG scas) -#define SCAS_W CHOICE(scasw, scasw, _WTOG scas) -#define SCAS_B CHOICE(scasb, scasb, scasb) -#define SETA(a) CHOICE(seta a, seta a, seta a) -#define SETAE(a) CHOICE(setae a, setae a, setae a) -#define SETB(a) CHOICE(setb a, setb a, setb a) -#define SETBE(a) CHOICE(setbe a, setbe a, setbe a) -#define SETC(a) CHOICE(setc a, setb a, setb a) -#define SETE(a) CHOICE(sete a, sete a, sete a) -#define SETG(a) CHOICE(setg a, setg a, setg a) -#define SETGE(a) CHOICE(setge a, setge a, setge a) -#define SETL(a) CHOICE(setl a, setl a, setl a) -#define SETLE(a) CHOICE(setle a, setle a, setle a) -#define SETNA(a) CHOICE(setna a, setna a, setna a) -#define SETNAE(a) CHOICE(setnae a, setnae a, setnae a) -#define SETNB(a) CHOICE(setnb a, setnb a, setnb a) -#define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a) -#define SETNC(a) CHOICE(setnc a, setnb a, setnb a) -#define SETNE(a) CHOICE(setne a, setne a, setne a) -#define SETNG(a) CHOICE(setng a, setng a, setng a) -#define SETNGE(a) CHOICE(setnge a, setnge a, setnge a) -#define SETNL(a) CHOICE(setnl a, setnl a, setnl a) -#define SETNLE(a) CHOICE(setnle a, setnle a, setnle a) -#define SETNO(a) CHOICE(setno a, setno a, setno a) -#define SETNP(a) CHOICE(setnp a, setnp a, setnp a) -#define SETNS(a) CHOICE(setns a, setns a, setna a) -#define SETNZ(a) CHOICE(setnz a, setnz a, setnz a) -#define SETO(a) CHOICE(seto a, seto a, seto a) -#define SETP(a) CHOICE(setp a, setp a, setp a) -#define SETPE(a) CHOICE(setpe a, setpe a, setpe a) -#define SETPO(a) CHOICE(setpo a, setpo a, setpo a) -#define SETS(a) CHOICE(sets a, sets a, seta a) -#define SETZ(a) CHOICE(setz a, setz a, setz a) -#define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a) -#define SIDT(a) CHOICE(sidt a, sidt a, sidt a) -#define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a)) -#define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a)) -#define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a)) -#define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a)) -#define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL)) -#define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a)) -#define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL)) -#define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a)) -#define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a)) -#define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a)) -#define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a)) -#define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL)) -#define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a)) -#define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL)) -#define SLDT(a) CHOICE(sldt a, sldt a, sldt a) -#define SMSW(a) CHOICE(smsw a, smsw a, smsw a) -#define STC CHOICE(stc, stc, stc) -#define STD CHOICE(std, std, std) -#define STI CHOICE(sti, sti, sti) -#define STOS_L CHOICE(stosl, stosl, _LTOG stos) -#define STOS_W CHOICE(stosw, stosw, _WTOG stos) -#define STOS_B CHOICE(stosb, stosb, stosb) -#define STR(a) CHOICE(str a, str a, str a) -#define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a)) -#define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a)) -#define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a)) -#define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a)) -#define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a)) -#define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a)) -#define VERR(a) CHOICE(verr a, verr a, verr a) -#define VERW(a) CHOICE(verw a, verw a, verw a) -#define WAIT CHOICE(wait, wait, wait) -#define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a)) -#define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a)) -#define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a)) -#define XLAT CHOICE(xlat, xlat, xlat) -#define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a)) -#define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a)) -#define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a)) - - -/* Floating Point Instructions */ -#define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1) -#define FABS CHOICE(fabs, fabs, fabs) -#define FADD_D(a) CHOICE(faddl a, faddl a, faddd a) -#define FADD_S(a) CHOICE(fadds a, fadds a, fadds a) -#define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a)) -#define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a)) -#define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a) -#define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a) -#define FBLD(a) CHOICE(fbld a, fbld a, fbld a) -#define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a) -#define FCHS CHOICE(fchs, fchs, fchs) -#define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex) -#define FNCLEX CHOICE(fnclex, fnclex, fclex) -#define FCOM(a) CHOICE(fcom a, fcom a, fcom a) -#define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a) -#define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a) -#define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a) -#define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a) -#define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a) -#define FCOMPP CHOICE(fcompp, fcompp, fcompp) -#define FCOS CHOICE(fcos, fcos, fcos) -#define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp) -#define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a) -#define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a) -#define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a)) -#define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a)) -#define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a) -#define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a) -#define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a) -#define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a) -#define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a)) -#define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a)) -#define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a) -#define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a) -#define FFREE(a) CHOICE(ffree a, ffree a, ffree a) -#define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a) -#define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a) -#define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a) -#define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a) -#define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a) -#define FILD_L(a) CHOICE(fildl a, fildl a, fildl a) -#define FILD_W(a) CHOICE(fild a, filds a, filds a) -#define FINCSTP CHOICE(fincstp, fincstp, fincstp) -#define FINIT CHOICE(finit, wait; fninit, wait; finit) -#define FNINIT CHOICE(fninit, fninit, finit) -#define FIST_L(a) CHOICE(fistl a, fistl a, fistl a) -#define FIST_W(a) CHOICE(fist a, fists a, fists a) -#define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a) -#define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a) -#define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a) -#define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */ -#define FLD_D(a) CHOICE(fldl a, fldl a, fldd a) -#define FLD_S(a) CHOICE(flds a, flds a, flds a) -#define FLD1 CHOICE(fld1, fld1, fld1) -#define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t) -#define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e) -#define FLDPI CHOICE(fldpi, fldpi, fldpi) -#define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2) -#define FLDLN2 CHOICE(fldln2, fldln2, fldln2) -#define FLDZ CHOICE(fldz, fldz, fldz) -#define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a) -#define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a) -#define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a) -#define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a) -#define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a)) -#define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a)) -#define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a) -#define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a) -#define FNOP CHOICE(fnop, fnop, fnop) -#define FPATAN CHOICE(fpatan, fpatan, fpatan) -#define FPREM CHOICE(fprem, fprem, fprem) -#define FPREM1 CHOICE(fprem1, fprem1, fprem1) -#define FPTAN CHOICE(fptan, fptan, fptan) -#define FRNDINT CHOICE(frndint, frndint, frndint) -#define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a) -#define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a) -#define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a) -#define FSCALE CHOICE(fscale, fscale, fscale) -#define FSIN CHOICE(fsin, fsin, fsin) -#define FSINCOS CHOICE(fsincos, fsincos, fsincos) -#define FSQRT CHOICE(fsqrt, fsqrt, fsqrt) -#define FST_D(a) CHOICE(fstl a, fstl a, fstd a) -#define FST_S(a) CHOICE(fsts a, fsts a, fsts a) -#define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a) -#define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a) -#define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a) -#define FSTP(a) CHOICE(fstp a, fstp a, fstp a) -#define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a) -#define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a) -#define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a) -#define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a) -#define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a) -#define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a) -#define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a) -#define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a) -#define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a)) -#define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a)) -#define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a) -#define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a) -#define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a) -#define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a) -#define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a)) -#define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a)) -#define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a) -#define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a) -#define FTST CHOICE(ftst, ftst, ftst) -#define FUCOM(a) CHOICE(fucom a, fucom a, fucom a) -#define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a) -#define FUCOMPP CHOICE(fucompp, fucompp, fucompp) -#define FWAIT CHOICE(wait, wait, wait) -#define FXAM CHOICE(fxam, fxam, fxam) -#define FXCH(a) CHOICE(fxch a, fxch a, fxch a) -#define FXTRACT CHOICE(fxtract, fxtract, fxtract) -#define FYL2X CHOICE(fyl2x, fyl2x, fyl2x) -#define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1) - -/* New instructions */ -#define CPUID CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162)) -#define RDTSC CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49)) - -#else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */ - - /****************************************/ - /* */ - /* Intel style assemblers. */ - /* (NASM and MASM) */ - /* */ - /****************************************/ - -#define P_EAX EAX -#define L_EAX EAX -#define W_AX AX -#define B_AH AH -#define B_AL AL - -#define P_EBX EBX -#define L_EBX EBX -#define W_BX BX -#define B_BH BH -#define B_BL BL - -#define P_ECX ECX -#define L_ECX ECX -#define W_CX CX -#define B_CH CH -#define B_CL CL - -#define P_EDX EDX -#define L_EDX EDX -#define W_DX DX -#define B_DH DH -#define B_DL DL - -#define P_EBP EBP -#define L_EBP EBP -#define W_BP BP - -#define P_ESI ESI -#define L_ESI ESI -#define W_SI SI - -#define P_EDI EDI -#define L_EDI EDI -#define W_DI DI - -#define P_ESP ESP -#define L_ESP ESP -#define W_SP SP - -#define W_CS CS -#define W_SS SS -#define W_DS DS -#define W_ES ES -#define W_FS FS -#define W_GS GS - -#define X_ST ST -#define D_ST ST -#define L_ST ST - -#define P_MM0 mm0 -#define P_MM1 mm1 -#define P_MM2 mm2 -#define P_MM3 mm3 -#define P_MM4 mm4 -#define P_MM5 mm5 -#define P_MM6 mm6 -#define P_MM7 mm7 - -#define P_XMM0 xmm0 -#define P_XMM1 xmm1 -#define P_XMM2 xmm2 -#define P_XMM3 xmm3 -#define P_XMM4 xmm4 -#define P_XMM5 xmm5 -#define P_XMM6 xmm6 -#define P_XMM7 xmm7 - -#define CONCAT(x, y) x ## y -#define CONCAT3(x, y, z) x ## y ## z - -#if defined(NASM_ASSEMBLER) - -#define ST(n) st ## n -#define ST0 st0 - -#define TBYTE_PTR tword -#define QWORD_PTR qword -#define DWORD_PTR dword -#define WORD_PTR word -#define BYTE_PTR byte - -#define OFFSET - -#define GLOBL GLOBAL -#define ALIGNTEXT32 ALIGN 32 -#define ALIGNTEXT16 ALIGN 16 -#define ALIGNTEXT8 ALIGN 8 -#define ALIGNTEXT4 ALIGN 4 -#define ALIGNTEXT2 ALIGN 2 -#define ALIGNTEXT32ifNOP ALIGN 32 -#define ALIGNTEXT16ifNOP ALIGN 16 -#define ALIGNTEXT8ifNOP ALIGN 8 -#define ALIGNTEXT4ifNOP ALIGN 4 -#define ALIGNDATA32 ALIGN 32 -#define ALIGNDATA16 ALIGN 16 -#define ALIGNDATA8 ALIGN 8 -#define ALIGNDATA4 ALIGN 4 -#define ALIGNDATA2 ALIGN 2 -#define FILE(s) -#define STRING(s) db s -#define D_LONG dd -#define D_WORD dw -#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 - -#define AS_BEGIN - -/* Jcc's should be handled better than this... */ -#define NEAR near - -#else /* MASM */ - -#define TBYTE_PTR tbyte ptr -#define QWORD_PTR qword ptr -#define DWORD_PTR dword ptr -#define WORD_PTR word ptr -#define BYTE_PTR byte ptr - -#define OFFSET offset - -#define GLOBL GLOBAL -#define ALIGNTEXT32 ALIGN 32 -#define ALIGNTEXT16 ALIGN 16 -#define ALIGNTEXT8 ALIGN 8 -#define ALIGNTEXT4 ALIGN 4 -#define ALIGNTEXT2 ALIGN 2 -#define ALIGNTEXT32ifNOP ALIGN 32 -#define ALIGNTEXT16ifNOP ALIGN 16 -#define ALIGNTEXT8ifNOP ALIGN 8 -#define ALIGNTEXT4ifNOP ALIGN 4 -#define ALIGNDATA32 ALIGN 32 -#define ALIGNDATA16 ALIGN 16 -#define ALIGNDATA8 ALIGN 8 -#define ALIGNDATA4 ALIGN 4 -#define ALIGNDATA2 ALIGN 2 -#define FILE(s) -#define STRING(s) db s -#define D_LONG dd -#define D_WORD dw -#define D_BYTE db -/* #define SPACE */ -/* #define COMM */ -#define SEG_DATA .DATA -#define SEG_TEXT .CODE -#define SEG_BSS .DATA - -#define D_SPACE(n) db n REP 0 - -#define AS_BEGIN - -#define NEAR - -#endif - -#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \ - || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \ - || (defined(__FreeBSD__) && __FreeBSD__ >= 3) \ - || (defined(__NetBSD__) && defined(__ELF__)) -#define GLNAME(a) a -#else -#define GLNAME(a) CONCAT(_, a) -#endif - -/* - * Addressing Modes - */ - -/* Immediate Mode */ -#define P_ADDR(a) OFFSET a -#define X_ADDR(a) OFFSET a -#define D_ADDR(a) OFFSET a -#define L_ADDR(a) OFFSET a -#define W_ADDR(a) OFFSET a -#define B_ADDR(a) OFFSET a - -#define P_CONST(a) a -#define X_CONST(a) a -#define D_CONST(a) a -#define L_CONST(a) a -#define W_CONST(a) a -#define B_CONST(a) a - -/* Indirect Mode */ -#ifdef NASM_ASSEMBLER -#define P_CONTENT(a) [a] -#define X_CONTENT(a) TBYTE_PTR [a] -#define D_CONTENT(a) QWORD_PTR [a] -#define L_CONTENT(a) DWORD_PTR [a] -#define W_CONTENT(a) WORD_PTR [a] -#define B_CONTENT(a) BYTE_PTR [a] -#else -#define P_CONTENT(a) a -#define X_CONTENT(a) TBYTE_PTR a -#define D_CONTENT(a) QWORD_PTR a -#define L_CONTENT(a) DWORD_PTR a -#define W_CONTENT(a) WORD_PTR a -#define B_CONTENT(a) BYTE_PTR a -#endif - -/* Register a indirect */ -#define P_REGIND(a) [a] -#define X_REGIND(a) TBYTE_PTR [a] -#define D_REGIND(a) QWORD_PTR [a] -#define L_REGIND(a) DWORD_PTR [a] -#define W_REGIND(a) WORD_PTR [a] -#define B_REGIND(a) BYTE_PTR [a] - -/* Register b indirect plus displacement a */ -#define P_REGOFF(a, b) [b + a] -#define X_REGOFF(a, b) TBYTE_PTR [b + a] -#define D_REGOFF(a, b) QWORD_PTR [b + a] -#define L_REGOFF(a, b) DWORD_PTR [b + a] -#define W_REGOFF(a, b) WORD_PTR [b + a] -#define B_REGOFF(a, b) BYTE_PTR [b + a] - -/* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode - * which has no scaling - */ -#define P_REGBID(b, i, d) [b + i + d] -#define X_REGBID(b, i, d) TBYTE_PTR [b + i + d] -#define D_REGBID(b, i, d) QWORD_PTR [b + i + d] -#define L_REGBID(b, i, d) DWORD_PTR [b + i + d] -#define W_REGBID(b, i, d) WORD_PTR [b + i + d] -#define B_REGBID(b, i, d) BYTE_PTR [b + i + d] - -/* Reg indirect Base + (Index * Scale) */ -#define P_REGBIS(b, i, s) [b + i * s] -#define X_REGBIS(b, i, s) TBYTE_PTR [b + i * s] -#define D_REGBIS(b, i, s) QWORD_PTR [b + i * s] -#define L_REGBIS(b, i, s) DWORD_PTR [b + i * s] -#define W_REGBIS(b, i, s) WORD_PTR [b + i * s] -#define B_REGBIS(b, i, s) BYTE_PTR [b + i * s] - -/* Reg indirect Base + (Index * Scale) + Displacement */ -#define P_REGBISD(b, i, s, d) [b + i * s + d] -#define X_REGBISD(b, i, s, d) TBYTE_PTR [b + i * s + d] -#define D_REGBISD(b, i, s, d) QWORD_PTR [b + i * s + d] -#define L_REGBISD(b, i, s, d) DWORD_PTR [b + i * s + d] -#define W_REGBISD(b, i, s, d) WORD_PTR [b + i * s + d] -#define B_REGBISD(b, i, s, d) BYTE_PTR [b + i * s + d] - -/* Displaced Scaled Index: */ -#define P_REGDIS(d, i, s) [i * s + d] -#define X_REGDIS(d, i, s) TBYTE_PTR [i * s + d] -#define D_REGDIS(d, i, s) QWORD_PTR [i * s + d] -#define L_REGDIS(d, i, s) DWORD_PTR [i * s + d] -#define W_REGDIS(d, i, s) WORD_PTR [i * s + d] -#define B_REGDIS(d, i, s) BYTE_PTR [i * s + d] - -/* Indexed Base: */ -#define P_REGBI(b, i) [b + i] -#define X_REGBI(b, i) TBYTE_PTR [b + i] -#define D_REGBI(b, i) QWORD_PTR [b + i] -#define L_REGBI(b, i) DWORD_PTR [b + i] -#define W_REGBI(b, i) WORD_PTR [b + i] -#define B_REGBI(b, i) BYTE_PTR [b + i] - -/* Displaced Base: */ -#define P_REGDB(d, b) [b + d] -#define X_REGDB(d, b) TBYTE_PTR [b + d] -#define D_REGDB(d, b) QWORD_PTR [b + d] -#define L_REGDB(d, b) DWORD_PTR [b + d] -#define W_REGDB(d, b) WORD_PTR [b + d] -#define B_REGDB(d, b) BYTE_PTR [b + d] - -/* Variable indirect: */ -#define VARINDIRECT(var) [var] - -/* Use register contents as jump/call target: */ -#define CODEPTR(reg) P_(reg) - -/* - * Redefine assembler commands - */ - -#define P_(a) P_ ## a -#define X_(a) X_ ## a -#define D_(a) D_ ## a -#define SR_(a) W_ ## a -#define S_(a) L_ ## a -#define L_(a) L_ ## a -#define W_(a) W_ ## a -#define B_(a) B_ ## a - -#define AAA aaa -#define AAD aad -#define AAM aam -#define AAS aas -#define ADC_L(a, b) adc L_(b), L_(a) -#define ADC_W(a, b) adc W_(b), W_(a) -#define ADC_B(a, b) adc B_(b), B_(a) -#define ADD_L(a, b) add L_(b), L_(a) -#define ADD_W(a, b) add W_(b), W_(a) -#define ADD_B(a, b) add B_(b), B_(a) -#define AND_L(a, b) and L_(b), L_(a) -#define AND_W(a, b) and W_(b), W_(a) -#define AND_B(a, b) and B_(b), B_(a) -#define ARPL(a,b) arpl W_(b), a -#define BOUND_L(a, b) bound L_(b), L_(a) -#define BOUND_W(a, b) bound W_(b), W_(a) -#define BSF_L(a, b) bsf L_(b), L_(a) -#define BSF_W(a, b) bsf W_(b), W_(a) -#define BSR_L(a, b) bsr L_(b), L_(a) -#define BSR_W(a, b) bsr W_(b), W_(a) -#define BT_L(a, b) bt L_(b), L_(a) -#define BT_W(a, b) bt W_(b), W_(a) -#define BTC_L(a, b) btc L_(b), L_(a) -#define BTC_W(a, b) btc W_(b), W_(a) -#define BTR_L(a, b) btr L_(b), L_(a) -#define BTR_W(a, b) btr W_(b), W_(a) -#define BTS_L(a, b) bts L_(b), L_(a) -#define BTS_W(a, b) bts W_(b), W_(a) -#define CALL(a) call a -#define CALLF(s,a) call far s:a -#define CBW cbw -#define CWDE cwde -#define CLC clc -#define CLD cld -#define CLI cli -#define CLTS clts -#define CMC cmc -#define CMP_L(a, b) cmp L_(b), L_(a) -#define CMP_W(a, b) cmp W_(b), W_(a) -#define CMP_B(a, b) cmp B_(b), B_(a) -#define CMPS_L cmpsd -#define CMPS_W cmpsw -#define CMPS_B cmpsb -#define CPUID cpuid -#define CWD cwd -#define CDQ cdq -#define DAA daa -#define DAS das -#define DEC_L(a) dec L_(a) -#define DEC_W(a) dec W_(a) -#define DEC_B(a) dec B_(a) -#define DIV_L(a) div L_(a) -#define DIV_W(a) div W_(a) -#define DIV_B(a) div B_(a) -#define ENTER(a,b) enter b, a -#define HLT hlt -#define IDIV_L(a) idiv L_(a) -#define IDIV_W(a) idiv W_(a) -#define IDIV_B(a) idiv B_(a) -#define IMUL_L(a, b) imul L_(b), L_(a) -#define IMUL_W(a, b) imul W_(b), W_(a) -#define IMUL_B(a) imul B_(a) -#define IN_L in EAX, DX -#define IN_W in AX, DX -#define IN_B in AL, DX -#define IN1_L(a) in1 L_(a) -#define IN1_W(a) in1 W_(a) -#define IN1_B(a) in1 B_(a) -#define INC_L(a) inc L_(a) -#define INC_W(a) inc W_(a) -#define INC_B(a) inc B_(a) -#define INS_L ins -#define INS_W ins -#define INS_B ins -#define INT(a) int B_(a) -#define INT3 int3 -#define INTO into -#define IRET iret -#define IRETD iretd -#define JA(a) ja NEAR a -#define JAE(a) jae NEAR a -#define JB(a) jb NEAR a -#define JBE(a) jbe NEAR a -#define JC(a) jc NEAR a -#define JE(a) je NEAR a -#define JG(a) jg NEAR a -#define JGE(a) jge NEAR a -#define JL(a) jl NEAR a -#define JLE(a) jle NEAR a -#define JNA(a) jna NEAR a -#define JNAE(a) jnae NEAR a -#define JNB(a) jnb NEAR a -#define JNBE(a) jnbe NEAR a -#define JNC(a) jnc NEAR a -#define JNE(a) jne NEAR a -#define JNG(a) jng NEAR a -#define JNGE(a) jnge NEAR a -#define JNL(a) jnl NEAR a -#define JNLE(a) jnle NEAR a -#define JNO(a) jno NEAR a -#define JNP(a) jnp NEAR a -#define JNS(a) jns NEAR a -#define JNZ(a) jnz NEAR a -#define JO(a) jo NEAR a -#define JP(a) jp NEAR a -#define JPE(a) jpe NEAR a -#define JPO(a) jpo NEAR a -#define JS(a) js NEAR a -#define JZ(a) jz NEAR a -#define JMP(a) jmp a -#define JMPF(s,a) jmp far s:a -#define LAHF lahf -#define LAR(a, b) lar b, a -#define LEA_L(a, b) lea P_(b), P_(a) -#define LEA_W(a, b) lea P_(b), P_(a) -#define LEAVE leave -#define LGDT(a) lgdt a -#define LIDT(a) lidt a -#define LDS(a, b) lds b, P_(a) -#define LES(a, b) les b, P_(a) -#define LFS(a, b) lfs b, P_(a) -#define LGS(a, b) lgs b, P_(a) -#define LSS(a, b) lss b, P_(a) -#define LLDT(a) lldt a -#define LMSW(a) lmsw a -#define LOCK lock -#define LODS_L lodsd -#define LODS_W lodsw -#define LODS_B lodsb -#define LOOP(a) loop a -#define LOOPE(a) loope a -#define LOOPZ(a) loopz a -#define LOOPNE(a) loopne a -#define LOOPNZ(a) loopnz a -#define LSL(a, b) lsl b, a -#define LTR(a) ltr a -#define MOV_SR(a, b) mov SR_(b), SR_(a) -#define MOV_L(a, b) mov L_(b), L_(a) -#define MOV_W(a, b) mov W_(b), W_(a) -#define MOV_B(a, b) mov B_(b), B_(a) -#define MOVS_L movsd -#define MOVS_W movsw -#define MOVS_B movsb -#define MOVSX_BL(a, b) movsx B_(b), B_(a) -#define MOVSX_BW(a, b) movsx B_(b), B_(a) -#define MOVSX_WL(a, b) movsx W_(b), W_(a) -#define MOVZX_BL(a, b) movzx B_(b), B_(a) -#define MOVZX_BW(a, b) movzx B_(b), B_(a) -#define MOVZX_WL(a, b) movzx W_(b), W_(a) -#define MUL_L(a) mul L_(a) -#define MUL_W(a) mul W_(a) -#define MUL_B(a) mul B_(a) -#define NEG_L(a) neg L_(a) -#define NEG_W(a) neg W_(a) -#define NEG_B(a) neg B_(a) -#define NOP nop -#define NOT_L(a) not L_(a) -#define NOT_W(a) not W_(a) -#define NOT_B(a) not B_(a) -#define OR_L(a,b) or L_(b), L_(a) -#define OR_W(a,b) or W_(b), W_(a) -#define OR_B(a,b) or B_(b), B_(a) -#define OUT_L out DX, EAX -#define OUT_W out DX, AX -#define OUT_B out DX, AL -#define OUT1_L(a) out1 L_(a) -#define OUT1_W(a) out1 W_(a) -#define OUT1_B(a) out1 B_(a) -#define OUTS_L outsd -#define OUTS_W outsw -#define OUTS_B outsb -#define POP_SR(a) pop SR_(a) -#define POP_L(a) pop L_(a) -#define POP_W(a) pop W_(a) -#define POPA_L popad -#define POPA_W popa -#define POPF_L popfd -#define POPF_W popf -#define PUSH_SR(a) push SR_(a) -#define PUSH_L(a) push L_(a) -#define PUSH_W(a) push W_(a) -#define PUSH_B(a) push B_(a) -#define PUSHA_L pushad -#define PUSHA_W pusha -#define PUSHF_L pushfd -#define PUSHF_W pushf -#define RCL_L(a, b) rcl L_(b), L_(a) -#define RCL_W(a, b) rcl W_(b), W_(a) -#define RCL_B(a, b) rcl B_(b), B_(a) -#define RCR_L(a, b) rcr L_(b), L_(a) -#define RCR_W(a, b) rcr W_(b), W_(a) -#define RCR_B(a, b) rcr B_(b), B_(a) -#define RDTSC rdtsc -#define ROL_L(a, b) rol L_(b), L_(a) -#define ROL_W(a, b) rol W_(b), W_(a) -#define ROL_B(a, b) rol B_(b), B_(a) -#define ROR_L(a, b) ror L_(b), L_(a) -#define ROR_W(a, b) ror W_(b), W_(a) -#define ROR_B(a, b) ror B_(b), B_(a) -#define REP rep -#define REPE repe -#define REPNE repne -#define REPNZ REPNE -#define REPZ REPE -#define RET ret -#define SAHF sahf -#define SAL_L(a, b) sal L_(b), B_(a) -#define SAL_W(a, b) sal W_(b), B_(a) -#define SAL_B(a, b) sal B_(b), B_(a) -#define SAR_L(a, b) sar L_(b), B_(a) -#define SAR_W(a, b) sar W_(b), B_(a) -#define SAR_B(a, b) sar B_(b), B_(a) -#define SBB_L(a, b) sbb L_(b), L_(a) -#define SBB_W(a, b) sbb W_(b), W_(a) -#define SBB_B(a, b) sbb B_(b), B_(a) -#define SCAS_L scas -#define SCAS_W scas -#define SCAS_B scas -#define SETA(a) seta a -#define SETAE(a) setae a -#define SETB(a) setb a -#define SETBE(a) setbe a -#define SETC(a) setc a -#define SETE(a) sete a -#define SETG(a) setg a -#define SETGE(a) setge a -#define SETL(a) setl a -#define SETLE(a) setle a -#define SETNA(a) setna a -#define SETNAE(a) setnae a -#define SETNB(a) setnb a -#define SETNBE(a) setnbe a -#define SETNC(a) setnc a -#define SETNE(a) setne a -#define SETNG(a) setng a -#define SETNGE(a) setnge a -#define SETNL(a) setnl a -#define SETNLE(a) setnle a -#define SETNO(a) setno a -#define SETNP(a) setnp a -#define SETNS(a) setns a -#define SETNZ(a) setnz a -#define SETO(a) seto a -#define SETP(a) setp a -#define SETPE(a) setpe a -#define SETPO(a) setpo a -#define SETS(a) sets a -#define SETZ(a) setz a -#define SGDT(a) sgdt a -#define SIDT(a) sidt a -#define SHL_L(a, b) shl L_(b), B_(a) -#define SHL_W(a, b) shl W_(b), B_(a) -#define SHL_B(a, b) shl B_(b), B_(a) -#define SHLD_L(a,b,c) shld -#define SHLD2_L(a,b) shld L_(b), L_(a) -#define SHLD_W(a,b,c) shld -#define SHLD2_W(a,b) shld W_(b), W_(a) -#define SHR_L(a, b) shr L_(b), B_(a) -#define SHR_W(a, b) shr W_(b), B_(a) -#define SHR_B(a, b) shr B_(b), B_(a) -#define SHRD_L(a,b,c) shrd -#define SHRD2_L(a,b) shrd L_(b), L_(a) -#define SHRD_W(a,b,c) shrd -#define SHRD2_W(a,b) shrd W_(b), W_(a) -#define SLDT(a) sldt a -#define SMSW(a) smsw a -#define STC stc -#define STD std -#define STI sti -#define STOS_L stosd -#define STOS_W stosw -#define STOS_B stosb -#define STR(a) str a -#define SUB_L(a, b) sub L_(b), L_(a) -#define SUB_W(a, b) sub W_(b), W_(a) -#define SUB_B(a, b) sub B_(b), B_(a) -#define TEST_L(a, b) test L_(b), L_(a) -#define TEST_W(a, b) test W_(b), W_(a) -#define TEST_B(a, b) test B_(b), B_(a) -#define VERR(a) verr a -#define VERW(a) verw a -#define WAIT wait -#define XCHG_L(a, b) xchg L_(b), L_(a) -#define XCHG_W(a, b) xchg W_(b), W_(a) -#define XCHG_B(a, b) xchg B_(b), B_(a) -#define XLAT xlat -#define XOR_L(a, b) xor L_(b), L_(a) -#define XOR_W(a, b) xor W_(b), W_(a) -#define XOR_B(a, b) xor B_(b), B_(a) - - -/* Floating Point Instructions */ -#define F2XM1 f2xm1 -#define FABS fabs -#define FADD_D(a) fadd D_(a) -#define FADD_S(a) fadd S_(a) -#define FADD2(a, b) fadd b, a -#define FADDP(a, b) faddp b, a -#define FIADD_L(a) fiadd L_(a) -#define FIADD_W(a) fiadd W_(a) -#define FBLD(a) fbld a -#define FBSTP(a) fbstp a -#define FCHS fchs -#define FCLEX fclex -#define FNCLEX fnclex -#define FCOM(a) fcom a -#define FCOM_D(a) fcom D_(a) -#define FCOM_S(a) fcom S_(a) -#define FCOMP(a) fcomp a -#define FCOMP_D(a) fcomp D_(a) -#define FCOMP_S(a) fcomp S_(a) -#define FCOMPP fcompp -#define FCOS fcos -#define FDECSTP fdecstp -#define FDIV_D(a) fdiv D_(a) -#define FDIV_S(a) fdiv S_(a) -#define FDIV2(a, b) fdiv b, a -#define FDIVP(a, b) fdivp b, a -#define FIDIV_L(a) fidiv L_(a) -#define FIDIV_W(a) fidiv W_(a) -#define FDIVR_D(a) fdivr D_(a) -#define FDIVR_S(a) fdivr S_(a) -#define FDIVR2(a, b) fdivr b, a -#define FDIVRP(a, b) fdivrp b, a -#define FIDIVR_L(a) fidivr L_(a) -#define FIDIVR_W(a) fidivr W_(a) -#define FFREE(a) ffree a -#define FICOM_L(a) ficom L_(a) -#define FICOM_W(a) ficom W_(a) -#define FICOMP_L(a) ficomp L_(a) -#define FICOMP_W(a) ficomp W_(a) -#define FILD_Q(a) fild D_(a) -#define FILD_L(a) fild L_(a) -#define FILD_W(a) fild W_(a) -#define FINCSTP fincstp -#define FINIT finit -#define FNINIT fninit -#define FIST_L(a) fist L_(a) -#define FIST_W(a) fist W_(a) -#define FISTP_Q(a) fistp D_(a) -#define FISTP_L(a) fistp L_(a) -#define FISTP_W(a) fistp W_(a) -#define FLD_X(a) fld X_(a) -#define FLD_D(a) fld D_(a) -#define FLD_S(a) fld S_(a) -#define FLD1 fld1 -#define FLDL2T fldl2t -#define FLDL2E fldl2e -#define FLDPI fldpi -#define FLDLG2 fldlg2 -#define FLDLN2 fldln2 -#define FLDZ fldz -#define FLDCW(a) fldcw a -#define FLDENV(a) fldenv a -#define FMUL_S(a) fmul S_(a) -#define FMUL_D(a) fmul D_(a) -#define FMUL2(a, b) fmul b, a -#define FMULP(a, b) fmulp b, a -#define FIMUL_L(a) fimul L_(a) -#define FIMUL_W(a) fimul W_(a) -#define FNOP fnop -#define FPATAN fpatan -#define FPREM fprem -#define FPREM1 fprem1 -#define FPTAN fptan -#define FRNDINT frndint -#define FRSTOR(a) frstor a -#define FSAVE(a) fsave a -#define FNSAVE(a) fnsave a -#define FSCALE fscale -#define FSIN fsin -#define FSINCOS fsincos -#define FSQRT fsqrt -#define FST_D(a) fst D_(a) -#define FST_S(a) fst S_(a) -#define FSTP_X(a) fstp X_(a) -#define FSTP_D(a) fstp D_(a) -#define FSTP_S(a) fstp S_(a) -#define FSTP(a) fstp a -#define FSTCW(a) fstcw a -#define FNSTCW(a) fnstcw a -#define FSTENV(a) fstenv a -#define FNSTENV(a) fnstenv a -#define FSTSW(a) fstsw a -#define FNSTSW(a) fnstsw a -#define FSUB_S(a) fsub S_(a) -#define FSUB_D(a) fsub D_(a) -#define FSUB2(a, b) fsub b, a -#define FSUBP(a, b) fsubp b, a -#define FISUB_L(a) fisub L_(a) -#define FISUB_W(a) fisub W_(a) -#define FSUBR_S(a) fsubr S_(a) -#define FSUBR_D(a) fsubr D_(a) -#define FSUBR2(a, b) fsubr b, a -#define FSUBRP(a, b) fsubrp b, a -#define FISUBR_L(a) fisubr L_(a) -#define FISUBR_W(a) fisubr W_(a) -#define FTST ftst -#define FUCOM(a) fucom a -#define FUCOMP(a) fucomp a -#define FUCOMPP fucompp -#define FWAIT fwait -#define FXAM fxam -#define FXCH(a) fxch a -#define FXTRACT fxtract -#define FYL2X fyl2x -#define FYL2XP1 fyl2xp1 - -#endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */ - - /****************************************/ - /* */ - /* Extensions to x86 insn set - */ - /* MMX, 3DNow! */ - /* */ - /****************************************/ - -#if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER) -#define P_ARG1(a) P_ ## a -#define P_ARG2(a, b) P_ ## b, P_ ## a -#define P_ARG3(a, b, c) P_ ## c, P_ ## b, P_ ## a -#else -#define P_ARG1(a) a -#define P_ARG2(a, b) a, b -#define P_ARG3(a, b, c) a, b, c -#endif - -/* MMX */ -#define MOVD(a, b) movd P_ARG2(a, b) -#define MOVQ(a, b) movq P_ARG2(a, b) - -#define PADDB(a, b) paddb P_ARG2(a, b) -#define PADDW(a, b) paddw P_ARG2(a, b) -#define PADDD(a, b) paddd P_ARG2(a, b) - -#define PADDSB(a, b) paddsb P_ARG2(a, b) -#define PADDSW(a, b) paddsw P_ARG2(a, b) - -#define PADDUSB(a, b) paddusb P_ARG2(a, b) -#define PADDUSW(a, b) paddusw P_ARG2(a, b) - -#define PSUBB(a, b) psubb P_ARG2(a, b) -#define PSUBW(a, b) psubw P_ARG2(a, b) -#define PSUBD(a, b) psubd P_ARG2(a, b) - -#define PSUBSB(a, b) psubsb P_ARG2(a, b) -#define PSUBSW(a, b) psubsw P_ARG2(a, b) - -#define PSUBUSB(a, b) psubusb P_ARG2(a, b) -#define PSUBUSW(a, b) psubusw P_ARG2(a, b) - -#define PCMPEQB(a, b) pcmpeqb P_ARG2(a, b) -#define PCMPEQW(a, b) pcmpeqw P_ARG2(a, b) -#define PCMPEQD(a, b) pcmpeqd P_ARG2(a, b) - -#define PCMPGTB(a, b) pcmpgtb P_ARG2(a, b) -#define PCMPGTW(a, b) pcmpgtw P_ARG2(a, b) -#define PCMPGTD(a, b) pcmpgtd P_ARG2(a, b) - -#define PMULHW(a, b) pmulhw P_ARG2(a, b) -#define PMULLW(a, b) pmullw P_ARG2(a, b) - -#define PMADDWD(a, b) pmaddwd P_ARG2(a, b) - -#define PAND(a, b) pand P_ARG2(a, b) - -#define PANDN(a, b) pandn P_ARG2(a, b) - -#define POR(a, b) por P_ARG2(a, b) - -#define PXOR(a, b) pxor P_ARG2(a, b) - -#define PSRAW(a, b) psraw P_ARG2(a, b) -#define PSRAD(a, b) psrad P_ARG2(a, b) - -#define PSRLW(a, b) psrlw P_ARG2(a, b) -#define PSRLD(a, b) psrld P_ARG2(a, b) -#define PSRLQ(a, b) psrlq P_ARG2(a, b) - -#define PSLLW(a, b) psllw P_ARG2(a, b) -#define PSLLD(a, b) pslld P_ARG2(a, b) -#define PSLLQ(a, b) psllq P_ARG2(a, b) - -#define PACKSSWB(a, b) packsswb P_ARG2(a, b) -#define PACKSSDW(a, b) packssdw P_ARG2(a, b) -#define PACKUSWB(a, b) packuswb P_ARG2(a, b) - -#define PUNPCKHBW(a, b) punpckhbw P_ARG2(a, b) -#define PUNPCKHWD(a, b) punpckhwd P_ARG2(a, b) -#define PUNPCKHDQ(a, b) punpckhdq P_ARG2(a, b) -#define PUNPCKLBW(a, b) punpcklbw P_ARG2(a, b) -#define PUNPCKLWD(a, b) punpcklwd P_ARG2(a, b) -#define PUNPCKLDQ(a, b) punpckldq P_ARG2(a, b) - -#define EMMS emms - -/* AMD 3DNow! */ -#define PAVGUSB(a, b) pavgusb P_ARG2(a, b) -#define PFADD(a, b) pfadd P_ARG2(a, b) -#define PFSUB(a, b) pfsub P_ARG2(a, b) -#define PFSUBR(a, b) pfsubr P_ARG2(a, b) -#define PFACC(a, b) pfacc P_ARG2(a, b) -#define PFCMPGE(a, b) pfcmpge P_ARG2(a, b) -#define PFCMPGT(a, b) pfcmpgt P_ARG2(a, b) -#define PFCMPEQ(a, b) pfcmpeq P_ARG2(a, b) -#define PFMIN(a, b) pfmin P_ARG2(a, b) -#define PFMAX(a, b) pfmax P_ARG2(a, b) -#define PI2FD(a, b) pi2fd P_ARG2(a, b) -#define PF2ID(a, b) pf2id P_ARG2(a, b) -#define PFRCP(a, b) pfrcp P_ARG2(a, b) -#define PFRSQRT(a, b) pfrsqrt P_ARG2(a, b) -#define PFMUL(a, b) pfmul P_ARG2(a, b) -#define PFRCPIT1(a, b) pfrcpit1 P_ARG2(a, b) -#define PFRSQIT1(a, b) pfrsqit1 P_ARG2(a, b) -#define PFRCPIT2(a, b) pfrcpit2 P_ARG2(a, b) -#define PMULHRW(a, b) pmulhrw P_ARG2(a, b) - -#define FEMMS femms -#define PREFETCH(a) prefetch P_ARG1(a) -#define PREFETCHW(a) prefetchw P_ARG1(a) - -/* Intel SSE */ -#define ADDPS(a, b) addps P_ARG2(a, b) -#define ADDSS(a, b) addss P_ARG2(a, b) -#define ANDNPS(a, b) andnps P_ARG2(a, b) -#define ANDPS(a, b) andps P_ARG2(a, b) -/* NASM only knows the pseudo ops for these. -#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_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) -#define CVTSI2SS(a, b) cvtsi2ss P_ARG2(a, b) -#define CVTSS2SI(a, b) cvtss2si P_ARG2(a, b) -#define CVTTPS2PI(a, b) cvttps2pi P_ARG2(a, b) -#define CVTTSS2SI(a, b) cvttss2si P_ARG2(a, b) -#define DIVPS(a, b) divps P_ARG2(a, b) -#define DIVSS(a, b) divss P_ARG2(a, b) -#define FXRSTOR(a) fxrstor P_ARG1(a) -#define FXSAVE(a) fxsave P_ARG1(a) -#define LDMXCSR(a) ldmxcsr P_ARG1(a) -#define MAXPS(a, b) maxps P_ARG2(a, b) -#define MAXSS(a, b) maxss P_ARG2(a, b) -#define MINPS(a, b) minps P_ARG2(a, b) -#define MINSS(a, b) minss P_ARG2(a, b) -#define MOVAPS(a, b) movaps P_ARG2(a, b) -#define MOVHLPS(a, b) movhlps P_ARG2(a, b) -#define MOVHPS(a, b) movhps P_ARG2(a, b) -#define MOVLHPS(a, b) movlhps P_ARG2(a, b) -#define MOVLPS(a, b) movlps P_ARG2(a, b) -#define MOVMSKPS(a, b) movmskps P_ARG2(a, b) -#define MOVNTPS(a, b) movntps P_ARG2(a, b) -#define MOVNTQ(a, b) movntq P_ARG2(a, b) -#define MOVSS(a, b) movss P_ARG2(a, b) -#define MOVUPS(a, b) movups P_ARG2(a, b) -#define MULPS(a, b) mulps P_ARG2(a, b) -#define MULSS(a, b) mulss P_ARG2(a, b) -#define ORPS(a, b) orps P_ARG2(a, b) -#define RCPPS(a, b) rcpps P_ARG2(a, b) -#define RCPSS(a, b) rcpss P_ARG2(a, b) -#define RSQRTPS(a, b) rsqrtps P_ARG2(a, b) -#define RSQRTSS(a, b) rsqrtss P_ARG2(a, b) -#define SHUFPS(a, b, c) shufps P_ARG3(a, b, c) -#define SQRTPS(a, b) sqrtps P_ARG2(a, b) -#define SQRTSS(a, b) sqrtss P_ARG2(a, b) -#define STMXCSR(a) stmxcsr P_ARG1(a) -#define SUBPS(a, b) subps P_ARG2(a, b) -#define UCOMISS(a, b) ucomiss P_ARG2(a, b) -#define UNPCKHPS(a, b) unpckhps P_ARG2(a, b) -#define UNPCKLPS(a, b) unpcklps P_ARG2(a, b) -#define XORPS(a, b) xorps P_ARG2(a, b) - -#define PREFETCHNTA(a) prefetchnta P_ARG1(a) -#define PREFETCHT0(a) prefetcht0 P_ARG1(a) -#define PREFETCHT1(a) prefetcht1 P_ARG1(a) -#define PREFETCHT2(a) prefetcht2 P_ARG1(a) -#define SFENCE sfence - -/* Added by BrianP for FreeBSD (per David Dawes) */ -#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__) -#define LLBL(a) CONCAT(.L,a) -#define LLBL2(a,b) CONCAT3(.L,a,b) -#else -#define LLBL(a) a -#define LLBL2(a,b) CONCAT(a,b) -#endif - -/* Segment overrides */ -#define SEGCS D_BYTE 46 -#define SEGDS D_BYTE 62 -#define SEGES D_BYTE 38 -#define SEGFS D_BYTE 100 -#define SEGGS D_BYTE 101 - -/* Temporary labels: valid until next non-local label */ -#ifdef NASM_ASSEMBLER -#define TLBL(a) CONCAT(.,a) -#else -#define TLBL(a) CONCAT(a,$) -#endif - -/* Hidden symbol visibility support. - * If we build with gcc's -fvisibility=hidden flag, we'll need to change - * the symbol visibility mode to 'default'. - */ -#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) -# define HIDDEN(x) .hidden x -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) -# pragma GCC visibility push(default) -# define HIDDEN(x) .hidden x -#else -# define HIDDEN(x) -#endif - -#endif /* __ASSYNTAX_H__ */ diff --git a/src/libs/mesa/mesa/x86/clip_args.h b/src/libs/mesa/mesa/x86/clip_args.h deleted file mode 100644 index 796611fbfd..0000000000 --- a/src/libs/mesa/mesa/x86/clip_args.h +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Clip test function interface for assembly code. Simply define - * FRAME_OFFSET to the number of bytes pushed onto the stack before - * using the ARG_* argument macros. - * - * Gareth Hughes - */ - -#ifndef __CLIP_ARGS_H__ -#define __CLIP_ARGS_H__ - -/* - * Offsets for clip_func arguments - * - * typedef GLvector4f *(*clip_func)( GLvector4f *clip_vec, - * GLvector4f *proj_vec, - * GLubyte clipMask[], - * GLubyte *orMask, - * GLubyte *andMask ); - */ - -#define OFFSET_SOURCE 4 -#define OFFSET_DEST 8 -#define OFFSET_CLIP 12 -#define OFFSET_OR 16 -#define OFFSET_AND 20 - -#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP) -#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP) -#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP) -#define ARG_OR REGOFF(FRAME_OFFSET+OFFSET_OR, ESP) -#define ARG_AND REGOFF(FRAME_OFFSET+OFFSET_AND, ESP) - -#endif diff --git a/src/libs/mesa/mesa/x86/common_x86.c b/src/libs/mesa/mesa/x86/common_x86.c deleted file mode 100644 index 5321547935..0000000000 --- a/src/libs/mesa/mesa/x86/common_x86.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - */ - -/** - * \file common_x86.c - * - * Check CPU capabilities & initialize optimized funtions for this particular - * processor. - * - * Changed by Andre Werthmann for using the new SSE functions. - * - * \author Holger Waechtler - * \author Andre Werthmann - */ - -/* XXX these includes should probably go into imports.h or glheader.h */ -#if defined(USE_SSE_ASM) && defined(__linux__) -#include -#endif -#if defined(USE_SSE_ASM) && defined(__FreeBSD__) -#include -#include -#endif -#if defined(USE_SSE_ASM) && defined(__OpenBSD__) -#include -#include -#include -#endif - -#include "main/imports.h" -#include "common_x86_asm.h" - - -int _mesa_x86_cpu_features = 0; - -/* No reason for this to be public. - */ -extern GLuint _ASMAPI _mesa_x86_has_cpuid(void); -extern void _ASMAPI _mesa_x86_cpuid(GLuint op, GLuint *reg_eax, GLuint *reg_ebx, GLuint *reg_ecx, GLuint *reg_edx); -extern GLuint _ASMAPI _mesa_x86_cpuid_eax(GLuint op); -extern GLuint _ASMAPI _mesa_x86_cpuid_ebx(GLuint op); -extern GLuint _ASMAPI _mesa_x86_cpuid_ecx(GLuint op); -extern GLuint _ASMAPI _mesa_x86_cpuid_edx(GLuint op); - - -#if defined(USE_SSE_ASM) -/* - * We must verify that the Streaming SIMD Extensions are truly supported - * on this processor before we go ahead and hook out the optimized code. - * - * However, I have been told by Alan Cox that all 2.4 (and later) Linux - * kernels provide full SSE support on all processors that expose SSE via - * the CPUID mechanism. - */ -extern void _mesa_test_os_sse_support( void ); -extern void _mesa_test_os_sse_exception_support( void ); - -#if defined(WIN32) -#ifndef STATUS_FLOAT_MULTIPLE_TRAPS -# define STATUS_FLOAT_MULTIPLE_TRAPS (0xC00002B5L) -#endif -static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) -{ - PEXCEPTION_RECORD rec = exp->ExceptionRecord; - PCONTEXT ctx = exp->ContextRecord; - - if ( rec->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION ) { - _mesa_debug(NULL, "EXCEPTION_ILLEGAL_INSTRUCTION\n" ); - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); - } else if ( rec->ExceptionCode == STATUS_FLOAT_MULTIPLE_TRAPS ) { - _mesa_debug(NULL, "STATUS_FLOAT_MULTIPLE_TRAPS\n"); - /* Windows seems to clear the exception flag itself, we just have to increment Eip */ - } else { - _mesa_debug(NULL, "UNEXPECTED EXCEPTION (0x%08x), terminating!\n" ); - return EXCEPTION_EXECUTE_HANDLER; - } - - if ( (ctx->ContextFlags & CONTEXT_CONTROL) != CONTEXT_CONTROL ) { - _mesa_debug(NULL, "Context does not contain control registers, terminating!\n"); - return EXCEPTION_EXECUTE_HANDLER; - } - ctx->Eip += 3; - - return EXCEPTION_CONTINUE_EXECUTION; -} -#endif /* WIN32 */ - - -static void check_os_sse_support( void ) -{ -#if defined(__FreeBSD__) - { - int ret, enabled; - unsigned int len; - len = sizeof(enabled); - ret = sysctlbyname("hw.instruction_sse", &enabled, &len, NULL, 0); - if (ret || !enabled) - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); - } -#elif defined (__NetBSD__) - { - int ret, enabled; - size_t len = sizeof(enabled); - ret = sysctlbyname("machdep.sse", &enabled, &len, (void *)NULL, 0); - if (ret || !enabled) - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); - } -#elif defined(__OpenBSD__) - { - int mib[2]; - int ret, enabled; - size_t len = sizeof(enabled); - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_SSE; - - ret = sysctl(mib, 2, &enabled, &len, NULL, 0); - if (ret || !enabled) - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); - } -#elif defined(WIN32) - LPTOP_LEVEL_EXCEPTION_FILTER oldFilter; - - /* Install our ExceptionFilter */ - oldFilter = SetUnhandledExceptionFilter( ExceptionFilter ); - - if ( cpu_has_xmm ) { - _mesa_debug(NULL, "Testing OS support for SSE...\n"); - - _mesa_test_os_sse_support(); - - if ( cpu_has_xmm ) { - _mesa_debug(NULL, "Yes.\n"); - } else { - _mesa_debug(NULL, "No!\n"); - } - } - - if ( cpu_has_xmm ) { - _mesa_debug(NULL, "Testing OS support for SSE unmasked exceptions...\n"); - - _mesa_test_os_sse_exception_support(); - - if ( cpu_has_xmm ) { - _mesa_debug(NULL, "Yes.\n"); - } else { - _mesa_debug(NULL, "No!\n"); - } - } - - /* Restore previous exception filter */ - SetUnhandledExceptionFilter( oldFilter ); - - if ( cpu_has_xmm ) { - _mesa_debug(NULL, "Tests of OS support for SSE passed.\n"); - } else { - _mesa_debug(NULL, "Tests of OS support for SSE failed!\n"); - } -#else - /* Do nothing on other platforms for now. - */ - _mesa_debug(NULL, "Not testing OS support for SSE, leaving enabled.\n"); -#endif /* __FreeBSD__ */ -} - -#endif /* USE_SSE_ASM */ - - -void _mesa_init_all_x86_transform_asm( void ) -{ -#ifdef USE_X86_ASM - _mesa_x86_cpu_features = 0; - - if (!_mesa_x86_has_cpuid()) { - _mesa_debug(NULL, "CPUID not detected\n"); - } - else { - GLuint cpu_features; - GLuint cpu_ext_features; - GLuint cpu_ext_info; - char cpu_vendor[13]; - GLuint result; - - /* get vendor name */ - _mesa_x86_cpuid(0, &result, (GLuint *)(cpu_vendor + 0), (GLuint *)(cpu_vendor + 8), (GLuint *)(cpu_vendor + 4)); - cpu_vendor[12] = '\0'; - - _mesa_debug(NULL, "CPU vendor: %s\n", cpu_vendor); - - /* get cpu features */ - cpu_features = _mesa_x86_cpuid_edx(1); - - if (cpu_features & X86_CPU_FPU) - _mesa_x86_cpu_features |= X86_FEATURE_FPU; - if (cpu_features & X86_CPU_CMOV) - _mesa_x86_cpu_features |= X86_FEATURE_CMOV; - -#ifdef USE_MMX_ASM - if (cpu_features & X86_CPU_MMX) - _mesa_x86_cpu_features |= X86_FEATURE_MMX; -#endif - -#ifdef USE_SSE_ASM - if (cpu_features & X86_CPU_XMM) - _mesa_x86_cpu_features |= X86_FEATURE_XMM; - if (cpu_features & X86_CPU_XMM2) - _mesa_x86_cpu_features |= X86_FEATURE_XMM2; -#endif - - /* query extended cpu features */ - if ((cpu_ext_info = _mesa_x86_cpuid_eax(0x80000000)) > 0x80000000) { - if (cpu_ext_info >= 0x80000001) { - - cpu_ext_features = _mesa_x86_cpuid_edx(0x80000001); - - if (cpu_features & X86_CPU_MMX) { - -#ifdef USE_3DNOW_ASM - if (cpu_ext_features & X86_CPUEXT_3DNOW) - _mesa_x86_cpu_features |= X86_FEATURE_3DNOW; - if (cpu_ext_features & X86_CPUEXT_3DNOW_EXT) - _mesa_x86_cpu_features |= X86_FEATURE_3DNOWEXT; -#endif - -#ifdef USE_MMX_ASM - if (cpu_ext_features & X86_CPUEXT_MMX_EXT) - _mesa_x86_cpu_features |= X86_FEATURE_MMXEXT; -#endif - } - } - - /* query cpu name */ - if (cpu_ext_info >= 0x80000002) { - GLuint ofs; - char cpu_name[49]; - for (ofs = 0; ofs < 3; ofs++) - _mesa_x86_cpuid(0x80000002+ofs, (GLuint *)(cpu_name + (16*ofs)+0), (GLuint *)(cpu_name + (16*ofs)+4), (GLuint *)(cpu_name + (16*ofs)+8), (GLuint *)(cpu_name + (16*ofs)+12)); - cpu_name[48] = '\0'; /* the name should be NULL terminated, but just to be sure */ - - _mesa_debug(NULL, "CPU name: %s\n", cpu_name); - } - } - - } - - if ( _mesa_getenv( "MESA_NO_ASM" ) ) { - _mesa_x86_cpu_features = 0; - } - - if ( _mesa_x86_cpu_features ) { - _mesa_init_x86_transform_asm(); - } - -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - if ( _mesa_getenv( "MESA_NO_MMX" ) == 0 ) { - _mesa_debug(NULL, "MMX cpu detected.\n"); - } else { - _mesa_x86_cpu_features &= ~(X86_FEATURE_MMX); - } - } -#endif - -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - if ( _mesa_getenv( "MESA_NO_3DNOW" ) == 0 ) { - _mesa_debug(NULL, "3DNow! cpu detected.\n"); - _mesa_init_3dnow_transform_asm(); - } else { - _mesa_x86_cpu_features &= ~(X86_FEATURE_3DNOW); - } - } -#endif - -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - if ( _mesa_getenv( "MESA_NO_SSE" ) == 0 ) { - _mesa_debug(NULL, "SSE cpu detected.\n"); - if ( _mesa_getenv( "MESA_FORCE_SSE" ) == 0 ) { - check_os_sse_support(); - } - if ( cpu_has_xmm ) { - _mesa_init_sse_transform_asm(); - } - } else { - _mesa_debug(NULL, "SSE cpu detected, but switched off by user.\n"); - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); - } - } -#endif -#endif -} - diff --git a/src/libs/mesa/mesa/x86/common_x86_asm.S b/src/libs/mesa/mesa/x86/common_x86_asm.S deleted file mode 100644 index ea4047a0e1..0000000000 --- a/src/libs/mesa/mesa/x86/common_x86_asm.S +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - */ - -/* - * Check extended CPU capabilities. Now justs returns the raw CPUID - * feature information, allowing the higher level code to interpret the - * results. - * - * Written by Holger Waechtler - * - * Cleaned up and simplified by Gareth Hughes - * - */ - -/* - * NOTE: Avoid using spaces in between '(' ')' and arguments, especially - * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces - * in there will break the build on some platforms. - */ - -#include "matypes.h" -#include "assyntax.h" -#include "common_x86_features.h" - - SEG_TEXT - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_has_cpuid) -HIDDEN(_mesa_x86_has_cpuid) -GLNAME(_mesa_x86_has_cpuid): - - /* Test for the CPUID command. If the ID Flag bit in EFLAGS - * (bit 21) is writable, the CPUID command is present */ - PUSHF_L - POP_L (EAX) - MOV_L (EAX, ECX) - XOR_L (CONST(0x00200000), EAX) - PUSH_L (EAX) - POPF_L - PUSHF_L - POP_L (EAX) - - /* Verify the ID Flag bit has been written. */ - CMP_L (ECX, EAX) - SETNE (AL) - XOR_L (CONST(0xff), EAX) - - RET - - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_cpuid) -HIDDEN(_mesa_x86_cpuid) -GLNAME(_mesa_x86_cpuid): - - MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */ - PUSH_L (EDI) - PUSH_L (EBX) - - CPUID - - MOV_L (REGOFF(16, ESP), EDI) /* *eax */ - MOV_L (EAX, REGIND(EDI)) - MOV_L (REGOFF(20, ESP), EDI) /* *ebx */ - MOV_L (EBX, REGIND(EDI)) - MOV_L (REGOFF(24, ESP), EDI) /* *ecx */ - MOV_L (ECX, REGIND(EDI)) - MOV_L (REGOFF(28, ESP), EDI) /* *edx */ - MOV_L (EDX, REGIND(EDI)) - - POP_L (EBX) - POP_L (EDI) - RET - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_cpuid_eax) -HIDDEN(_mesa_x86_cpuid_eax) -GLNAME(_mesa_x86_cpuid_eax): - - MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */ - PUSH_L (EBX) - - CPUID - - POP_L (EBX) - RET - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_cpuid_ebx) -HIDDEN(_mesa_x86_cpuid_ebx) -GLNAME(_mesa_x86_cpuid_ebx): - - MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */ - PUSH_L (EBX) - - CPUID - MOV_L (EBX, EAX) /* return EBX */ - - POP_L (EBX) - RET - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_cpuid_ecx) -HIDDEN(_mesa_x86_cpuid_ecx) -GLNAME(_mesa_x86_cpuid_ecx): - - MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */ - PUSH_L (EBX) - - CPUID - MOV_L (ECX, EAX) /* return ECX */ - - POP_L (EBX) - RET - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_x86_cpuid_edx) -HIDDEN(_mesa_x86_cpuid_edx) -GLNAME(_mesa_x86_cpuid_edx): - - MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */ - PUSH_L (EBX) - - CPUID - MOV_L (EDX, EAX) /* return EDX */ - - POP_L (EBX) - RET - -#ifdef USE_SSE_ASM -/* Execute an SSE instruction to see if the operating system correctly - * supports SSE. A signal handler for SIGILL should have been set - * before calling this function, otherwise this could kill the client - * application. - * - * -----> !!!! ATTENTION DEVELOPERS !!!! <----- - * - * If you're debugging with gdb and you get stopped in this function, - * just type 'continue'! Execution will proceed normally. - * See freedesktop.org bug #1709 for more info. - */ -ALIGNTEXT4 -GLOBL GLNAME( _mesa_test_os_sse_support ) -HIDDEN(_mesa_test_os_sse_support) -GLNAME( _mesa_test_os_sse_support ): - - XORPS ( XMM0, XMM0 ) - - RET - - -/* Perform an SSE divide-by-zero to see if the operating system - * correctly supports unmasked SIMD FPU exceptions. Signal handlers for - * SIGILL and SIGFPE should have been set before calling this function, - * otherwise this could kill the client application. - */ -ALIGNTEXT4 -GLOBL GLNAME( _mesa_test_os_sse_exception_support ) -HIDDEN(_mesa_test_os_sse_exception_support) -GLNAME( _mesa_test_os_sse_exception_support ): - - PUSH_L ( EBP ) - MOV_L ( ESP, EBP ) - SUB_L ( CONST( 8 ), ESP ) - - /* Save the original MXCSR register value. - */ - STMXCSR ( REGOFF( -4, EBP ) ) - - /* Unmask the divide-by-zero exception and perform one. - */ - STMXCSR ( REGOFF( -8, EBP ) ) - AND_L ( CONST( 0xfffffdff ), REGOFF( -8, EBP ) ) - LDMXCSR ( REGOFF( -8, EBP ) ) - - XORPS ( XMM0, XMM0 ) - - PUSH_L ( CONST( 0x3f800000 ) ) - PUSH_L ( CONST( 0x3f800000 ) ) - PUSH_L ( CONST( 0x3f800000 ) ) - PUSH_L ( CONST( 0x3f800000 ) ) - - MOVUPS ( REGIND( ESP ), XMM1 ) - - DIVPS ( XMM0, XMM1 ) - - /* Restore the original MXCSR register value. - */ - LDMXCSR ( REGOFF( -4, EBP ) ) - - LEAVE - RET - -#endif - - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/common_x86_asm.h b/src/libs/mesa/mesa/x86/common_x86_asm.h deleted file mode 100644 index 89312b2437..0000000000 --- a/src/libs/mesa/mesa/x86/common_x86_asm.h +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Check CPU capabilities & initialize optimized funtions for this particular - * processor. - * - * Written by Holger Waechtler - * Changed by Andre Werthmann for using the - * new SSE functions - * - * Reimplemented by Gareth Hughes in a more - * future-proof manner, based on code in the Linux kernel. - */ - -#ifndef __COMMON_X86_ASM_H__ -#define __COMMON_X86_ASM_H__ - -/* Do not reference mtypes.h from this file. - */ -#include "common_x86_features.h" - -#ifdef USE_X86_ASM -#include "x86.h" -#ifdef USE_3DNOW_ASM -#include "3dnow.h" -#endif -#ifdef USE_SSE_ASM -#include "sse.h" -#endif -#endif - -extern int _mesa_x86_cpu_features; - -extern void _mesa_init_all_x86_transform_asm( void ); - -#endif diff --git a/src/libs/mesa/mesa/x86/common_x86_features.h b/src/libs/mesa/mesa/x86/common_x86_features.h deleted file mode 100644 index 676af8c1f8..0000000000 --- a/src/libs/mesa/mesa/x86/common_x86_features.h +++ /dev/null @@ -1,67 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2001 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 CPUID feature information. The raw data is returned by - * _mesa_identify_x86_cpu_features() and interpreted with the cpu_has_* - * helper macros. - * - * Gareth Hughes - */ - -#ifndef __COMMON_X86_FEATURES_H__ -#define __COMMON_X86_FEATURES_H__ - -#define X86_FEATURE_FPU (1<<0) -#define X86_FEATURE_CMOV (1<<1) -#define X86_FEATURE_MMXEXT (1<<2) -#define X86_FEATURE_MMX (1<<3) -#define X86_FEATURE_FXSR (1<<4) -#define X86_FEATURE_XMM (1<<5) -#define X86_FEATURE_XMM2 (1<<6) -#define X86_FEATURE_3DNOWEXT (1<<7) -#define X86_FEATURE_3DNOW (1<<8) - -/* standard X86 CPU features */ -#define X86_CPU_FPU (1<<0) -#define X86_CPU_CMOV (1<<15) -#define X86_CPU_MMX (1<<23) -#define X86_CPU_XMM (1<<25) -#define X86_CPU_XMM2 (1<<26) - -/* extended X86 CPU features */ -#define X86_CPUEXT_MMX_EXT (1<<22) -#define X86_CPUEXT_3DNOW_EXT (1<<30) -#define X86_CPUEXT_3DNOW (1<<31) - -#define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX) -#define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT) -#define cpu_has_xmm (_mesa_x86_cpu_features & X86_FEATURE_XMM) -#define cpu_has_xmm2 (_mesa_x86_cpu_features & X86_FEATURE_XMM2) -#define cpu_has_3dnow (_mesa_x86_cpu_features & X86_FEATURE_3DNOW) -#define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT) - -#endif - diff --git a/src/libs/mesa/mesa/x86/common_x86_macros.h b/src/libs/mesa/mesa/x86/common_x86_macros.h deleted file mode 100644 index 462f32b3f2..0000000000 --- a/src/libs/mesa/mesa/x86/common_x86_macros.h +++ /dev/null @@ -1,106 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - * - * Authors: - * Gareth Hughes - */ - -#ifndef __COMMON_X86_MACROS_H__ -#define __COMMON_X86_MACROS_H__ - - -/* ============================================================= - * Transformation function declarations: - */ - -#define XFORM_ARGS GLvector4f *to_vec, \ - const GLfloat m[16], \ - const GLvector4f *from_vec - -#define DECLARE_XFORM_GROUP( pfx, sz ) \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS ); - -#define ASSIGN_XFORM_GROUP( pfx, sz ) \ - _mesa_transform_tab[sz][MATRIX_GENERAL] = \ - _mesa_##pfx##_transform_points##sz##_general; \ - _mesa_transform_tab[sz][MATRIX_IDENTITY] = \ - _mesa_##pfx##_transform_points##sz##_identity; \ - _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_3d_no_rot; \ - _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \ - _mesa_##pfx##_transform_points##sz##_perspective; \ - _mesa_transform_tab[sz][MATRIX_2D] = \ - _mesa_##pfx##_transform_points##sz##_2d; \ - _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_2d_no_rot; \ - _mesa_transform_tab[sz][MATRIX_3D] = \ - _mesa_##pfx##_transform_points##sz##_3d; - - -/* ============================================================= - * Normal transformation function declarations: - */ - -#define NORM_ARGS const GLmatrix *mat, \ - GLfloat scale, \ - const GLvector4f *in, \ - const GLfloat *lengths, \ - GLvector4f *dest - -#define DECLARE_NORM_GROUP( pfx ) \ -extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS ); - -#define ASSIGN_NORM_GROUP( pfx ) \ - _mesa_normal_tab[NORM_RESCALE] = \ - _mesa_##pfx##_rescale_normals; \ - _mesa_normal_tab[NORM_NORMALIZE] = \ - _mesa_##pfx##_normalize_normals; \ - _mesa_normal_tab[NORM_TRANSFORM] = \ - _mesa_##pfx##_transform_normals; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = \ - _mesa_##pfx##_transform_normals_no_rot; \ - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = \ - _mesa_##pfx##_transform_rescale_normals; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = \ - _mesa_##pfx##_transform_rescale_normals_no_rot; \ - _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = \ - _mesa_##pfx##_transform_normalize_normals; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = \ - _mesa_##pfx##_transform_normalize_normals_no_rot; - - -#endif diff --git a/src/libs/mesa/mesa/x86/gen_matypes.c b/src/libs/mesa/mesa/x86/gen_matypes.c deleted file mode 100644 index 4804abe2e9..0000000000 --- a/src/libs/mesa/mesa/x86/gen_matypes.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 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. - * - * Authors: - * Gareth Hughes - */ - -/* - * This generates an asm version of mtypes.h (called matypes.h), so that - * Mesa's x86 assembly code can access the internal structures easily. - * This will be particularly useful when developing new x86 asm code for - * Mesa, including lighting, clipping, texture image conversion etc. - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "tnl/t_context.h" - - -#undef offsetof -#define offsetof( type, member ) ((size_t) &((type *)0)->member) - - -#define OFFSET_HEADER( x ) \ -do { \ - printf( "\n" ); \ - printf( "\n" ); \ - printf( "/* =====================================================" \ - "========\n" ); \ - printf( " * Offsets for %s\n", x ); \ - printf( " */\n" ); \ - printf( "\n" ); \ -} while (0) - -#define DEFINE_HEADER( x ) \ -do { \ - printf( "\n" ); \ - printf( "/*\n" ); \ - printf( " * Flags for %s\n", x ); \ - printf( " */\n" ); \ - printf( "\n" ); \ -} while (0) - -#if 1 -// Haiku build system: support for cross-compilation -#define OFFSET( s, t, m ) \ - printf( "#undef %s\n", s); \ - printf( "DEFINE_COMPUTED_ASM_MACRO(%s, offsetof(%s, %s));\n", s, #t, #m ); -#elif defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64) -#define OFFSET( s, t, m ) \ - printf( "#define %s\t%ld\n", s, offsetof( t, m ) ); -#else -#define OFFSET( s, t, m ) \ - printf( "#define %s\t%d\n", s, offsetof( t, m ) ); -#endif - -#if 1 -// Haiku build system: support for cross-compilation -#define SIZEOF( s, t ) \ - printf( "#undef %s\n", s); \ - printf( "DEFINE_COMPUTED_ASM_MACRO(%s, sizeof(%s));\n", s, #t ); -#elif defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64) -#define SIZEOF( s, t ) \ - printf( "#define %s\t%ld\n", s, sizeof(t) ); -#else -#define SIZEOF( s, t ) \ - printf( "#define %s\t%d\n", s, sizeof(t) ); -#endif - -#if 1 -// Haiku build system: support for cross-compilation -#define DEFINE( s, d ) \ - printf( "#undef %s\n", s); \ - printf( "#define %s\t0x%x\n", s, d ); \ - printf( "DEFINE_COMPUTED_ASM_MACRO(%s, %#x);\n", s, d ); -#else -#define DEFINE( s, d ) \ - printf( "#define %s\t0x%x\n", s, d ); -#endif - - - -int main( int argc, char **argv ) -{ - printf( "/*\n" ); - printf( " * This file is automatically generated from the Mesa internal type\n" ); - printf( " * definitions. Do not edit directly.\n" ); - printf( " */\n" ); - printf( "\n" ); - printf( "#ifndef __ASM_TYPES_H__\n" ); - printf( "#define __ASM_TYPES_H__\n" ); - printf( "\n" ); - - #if 1 - // Haiku build system: support for cross-compilation - printf("#include "); - printf( "\n" ); - printf( "#include \"main/glheader.h\"\n" ); - printf( "#include \"main/mtypes.h\"\n" ); - printf( "#include \"tnl/t_context.h\"" ); - printf( "\n" ); - printf( "void dummy() {\n" ); - #endif - - /* GLcontext offsets: - */ - OFFSET_HEADER( "GLcontext" ); - - OFFSET( "CTX_DRIVER_CTX ", GLcontext, DriverCtx ); - printf( "\n" ); - OFFSET( "CTX_LIGHT_ENABLED ", GLcontext, Light.Enabled ); - OFFSET( "CTX_LIGHT_SHADE_MODEL ", GLcontext, Light.ShadeModel ); - OFFSET( "CTX_LIGHT_COLOR_MAT_FACE ", GLcontext, Light.ColorMaterialFace ); - OFFSET( "CTX_LIGHT_COLOR_MAT_MODE ", GLcontext, Light.ColorMaterialMode ); - OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", GLcontext, Light.ColorMaterialBitmask ); - OFFSET( "CTX_LIGHT_COLOR_MAT_ENABLED ", GLcontext, Light.ColorMaterialEnabled ); - OFFSET( "CTX_LIGHT_ENABLED_LIST ", GLcontext, Light.EnabledList ); - OFFSET( "CTX_LIGHT_NEED_VERTS ", GLcontext, Light._NeedVertices ); - OFFSET( "CTX_LIGHT_FLAGS ", GLcontext, Light._Flags ); - OFFSET( "CTX_LIGHT_BASE_COLOR ", GLcontext, Light._BaseColor ); - - - /* struct vertex_buffer offsets: - */ - OFFSET_HEADER( "struct vertex_buffer" ); - - OFFSET( "VB_SIZE ", struct vertex_buffer, Size ); - OFFSET( "VB_COUNT ", struct vertex_buffer, Count ); - printf( "\n" ); - OFFSET( "VB_ELTS ", struct vertex_buffer, Elts ); - OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, ObjPtr ); - OFFSET( "VB_EYE_PTR ", struct vertex_buffer, EyePtr ); - OFFSET( "VB_CLIP_PTR ", struct vertex_buffer, ClipPtr ); - OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr ); - OFFSET( "VB_CLIP_OR_MASK ", struct vertex_buffer, ClipOrMask ); - OFFSET( "VB_CLIP_MASK ", struct vertex_buffer, ClipMask ); - OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, NormalPtr ); - OFFSET( "VB_EDGE_FLAG ", struct vertex_buffer, EdgeFlag ); - OFFSET( "VB_TEX0_COORD_PTR ", struct vertex_buffer, TexCoordPtr[0] ); - OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, TexCoordPtr[1] ); - OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, TexCoordPtr[2] ); - OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, TexCoordPtr[3] ); - OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr ); - OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); - OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); - OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); - OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive ); - printf( "\n" ); - - DEFINE_HEADER( "struct vertex_buffer" ); - - /* XXX use new labels here someday after vertex proram is done */ - DEFINE( "VERT_BIT_OBJ ", VERT_BIT_POS ); - DEFINE( "VERT_BIT_NORM ", VERT_BIT_NORMAL ); - DEFINE( "VERT_BIT_RGBA ", VERT_BIT_COLOR0 ); - DEFINE( "VERT_BIT_SPEC_RGB ", VERT_BIT_COLOR1 ); - DEFINE( "VERT_BIT_FOG_COORD ", VERT_BIT_FOG ); - DEFINE( "VERT_BIT_TEX0 ", VERT_BIT_TEX0 ); - DEFINE( "VERT_BIT_TEX1 ", VERT_BIT_TEX1 ); - DEFINE( "VERT_BIT_TEX2 ", VERT_BIT_TEX2 ); - DEFINE( "VERT_BIT_TEX3 ", VERT_BIT_TEX3 ); - - - /* GLvector4f offsets: - */ - OFFSET_HEADER( "GLvector4f" ); - - OFFSET( "V4F_DATA ", GLvector4f, data ); - OFFSET( "V4F_START ", GLvector4f, start ); - OFFSET( "V4F_COUNT ", GLvector4f, count ); - OFFSET( "V4F_STRIDE ", GLvector4f, stride ); - OFFSET( "V4F_SIZE ", GLvector4f, size ); - OFFSET( "V4F_FLAGS ", GLvector4f, flags ); - - DEFINE_HEADER( "GLvector4f" ); - - DEFINE( "VEC_MALLOC ", VEC_MALLOC ); - DEFINE( "VEC_NOT_WRITEABLE ", VEC_NOT_WRITEABLE ); - DEFINE( "VEC_BAD_STRIDE ", VEC_BAD_STRIDE ); - printf( "\n" ); - DEFINE( "VEC_SIZE_1 ", VEC_SIZE_1 ); - DEFINE( "VEC_SIZE_2 ", VEC_SIZE_2 ); - DEFINE( "VEC_SIZE_3 ", VEC_SIZE_3 ); - DEFINE( "VEC_SIZE_4 ", VEC_SIZE_4 ); - - - /* GLmatrix offsets: - */ - OFFSET_HEADER( "GLmatrix" ); - - OFFSET( "MATRIX_DATA ", GLmatrix, m ); - OFFSET( "MATRIX_INV ", GLmatrix, inv ); - OFFSET( "MATRIX_FLAGS ", GLmatrix, flags ); - OFFSET( "MATRIX_TYPE ", GLmatrix, type ); - - - /* struct gl_light offsets: - */ - OFFSET_HEADER( "struct gl_light" ); - - OFFSET( "LIGHT_NEXT ", struct gl_light, next ); - OFFSET( "LIGHT_PREV ", struct gl_light, prev ); - printf( "\n" ); - OFFSET( "LIGHT_AMBIENT ", struct gl_light, Ambient ); - OFFSET( "LIGHT_DIFFUSE ", struct gl_light, Diffuse ); - OFFSET( "LIGHT_SPECULAR ", struct gl_light, Specular ); - OFFSET( "LIGHT_EYE_POSITION ", struct gl_light, EyePosition ); - OFFSET( "LIGHT_EYE_DIRECTION ", struct gl_light, EyeDirection ); - OFFSET( "LIGHT_SPOT_EXPONENT ", struct gl_light, SpotExponent ); - OFFSET( "LIGHT_SPOT_CUTOFF ", struct gl_light, SpotCutoff ); - OFFSET( "LIGHT_COS_CUTOFF ", struct gl_light, _CosCutoff ); - OFFSET( "LIGHT_CONST_ATTEN ", struct gl_light, ConstantAttenuation ); - OFFSET( "LIGHT_LINEAR_ATTEN ", struct gl_light, LinearAttenuation ); - OFFSET( "LIGHT_QUADRATIC_ATTEN ", struct gl_light, QuadraticAttenuation ); - OFFSET( "LIGHT_ENABLED ", struct gl_light, Enabled ); - printf( "\n" ); - OFFSET( "LIGHT_FLAGS ", struct gl_light, _Flags ); - printf( "\n" ); - OFFSET( "LIGHT_POSITION ", struct gl_light, _Position ); - OFFSET( "LIGHT_VP_INF_NORM ", struct gl_light, _VP_inf_norm ); - OFFSET( "LIGHT_H_INF_NORM ", struct gl_light, _h_inf_norm ); - OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormDirection ); - OFFSET( "LIGHT_VP_INF_SPOT_ATTEN ", struct gl_light, _VP_inf_spot_attenuation ); - printf( "\n" ); - OFFSET( "LIGHT_SPOT_EXP_TABLE ", struct gl_light, _SpotExpTable ); - OFFSET( "LIGHT_MAT_AMBIENT ", struct gl_light, _MatAmbient ); - OFFSET( "LIGHT_MAT_DIFFUSE ", struct gl_light, _MatDiffuse ); - OFFSET( "LIGHT_MAT_SPECULAR ", struct gl_light, _MatSpecular ); - printf( "\n" ); - SIZEOF( "SIZEOF_GL_LIGHT ", struct gl_light ); - - DEFINE_HEADER( "struct gl_light" ); - - DEFINE( "LIGHT_SPOT ", LIGHT_SPOT ); - DEFINE( "LIGHT_LOCAL_VIEWER ", LIGHT_LOCAL_VIEWER ); - DEFINE( "LIGHT_POSITIONAL ", LIGHT_POSITIONAL ); - printf( "\n" ); - DEFINE( "LIGHT_NEED_VERTICES ", LIGHT_NEED_VERTICES ); - - - /* struct gl_lightmodel offsets: - */ - OFFSET_HEADER( "struct gl_lightmodel" ); - - OFFSET( "LIGHT_MODEL_AMBIENT ", struct gl_lightmodel, Ambient ); - OFFSET( "LIGHT_MODEL_LOCAL_VIEWER ", struct gl_lightmodel, LocalViewer ); - OFFSET( "LIGHT_MODEL_TWO_SIDE ", struct gl_lightmodel, TwoSide ); - OFFSET( "LIGHT_MODEL_COLOR_CONTROL ", struct gl_lightmodel, ColorControl ); - - #if 1 - // Haiku build system: support for cross-compilation - printf("}"); - printf( "\n" ); - #endif - - printf( "\n" ); - printf( "\n" ); - printf( "#endif /* __ASM_TYPES_H__ */\n" ); - - return 0; -} diff --git a/src/libs/mesa/mesa/x86/glapi_x86.S b/src/libs/mesa/mesa/x86/glapi_x86.S deleted file mode 100644 index b99c2b6520..0000000000 --- a/src/libs/mesa/mesa/x86/glapi_x86.S +++ /dev/null @@ -1,1293 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_x86_asm.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004, 2005 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "assyntax.h" -#include "glapi/glapioffsets.h" - -#if defined(STDCALL_API) -# if defined(USE_MGL_NAMESPACE) -# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2)) -# else -# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2)) -# endif -#else -# if defined(USE_MGL_NAMESPACE) -# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n)) -# define _glapi_Dispatch _mglapi_Dispatch -# else -# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n)) -# endif -#endif - -#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX)) - -#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) -#define GLOBL_FN(x) GLOBL x ; .type x, function -#else -#define GLOBL_FN(x) GLOBL x -#endif - -#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) -# define THREADS -#endif - -#ifdef GLX_USE_TLS - -#ifdef GLX_X86_READONLY_TEXT -# define CTX_INSNS MOV_L(GS:(EAX), EAX) -#else -# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ -#endif - -# define GL_STUB(fn,off,fn_alt) \ -ALIGNTEXT16; \ -GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ -GL_PREFIX(fn, fn_alt): \ - CALL(_x86_get_dispatch) ; \ - CTX_INSNS ; \ - JMP(GL_OFFSET(off)) - -#elif defined(PTHREADS) -# define GL_STUB(fn,off,fn_alt) \ -ALIGNTEXT16; \ -GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ -GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ - TEST_L(EAX, EAX) ; \ - JE(1f) ; \ - JMP(GL_OFFSET(off)) ; \ -1: CALL(_x86_get_dispatch) ; \ - JMP(GL_OFFSET(off)) -#elif defined(THREADS) -# define GL_STUB(fn,off,fn_alt) \ -ALIGNTEXT16; \ -GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ -GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ - TEST_L(EAX, EAX) ; \ - JE(1f) ; \ - JMP(GL_OFFSET(off)) ; \ -1: CALL(_glapi_get_dispatch) ; \ - JMP(GL_OFFSET(off)) -#else /* Non-threaded version. */ -# define GL_STUB(fn,off,fn_alt) \ -ALIGNTEXT16; \ -GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ -GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ - JMP(GL_OFFSET(off)) -#endif - -#ifdef HAVE_ALIAS -# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \ - .globl GL_PREFIX(fn, fn_alt) ; \ - .set GL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt) -#else -# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \ - GL_STUB(fn, off, fn_alt) -#endif - -SEG_TEXT - -#ifdef GLX_USE_TLS - - GLOBL GLNAME(_x86_get_dispatch) - HIDDEN(GLNAME(_x86_get_dispatch)) -ALIGNTEXT16 -GLNAME(_x86_get_dispatch): - call 1f -1: popl %eax - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax - movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax - ret - -#elif defined(PTHREADS) -EXTERN GLNAME(_glapi_Dispatch) -EXTERN GLNAME(_gl_DispatchTSD) -EXTERN GLNAME(pthread_getspecific) - -ALIGNTEXT16 -GLNAME(_x86_get_dispatch): - SUB_L(CONST(24), ESP) - PUSH_L(GLNAME(_gl_DispatchTSD)) - CALL(GLNAME(pthread_getspecific)) - ADD_L(CONST(28), ESP) - RET -#elif defined(THREADS) -EXTERN GLNAME(_glapi_get_dispatch) -#endif - -#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT ) - .section wtext, "awx", @progbits -#endif /* defined( GLX_USE_TLS ) */ - - ALIGNTEXT16 - GLOBL GLNAME(gl_dispatch_functions_start) - HIDDEN(GLNAME(gl_dispatch_functions_start)) -GLNAME(gl_dispatch_functions_start): - - GL_STUB(NewList, _gloffset_NewList, NewList@8) - GL_STUB(EndList, _gloffset_EndList, EndList@0) - GL_STUB(CallList, _gloffset_CallList, CallList@4) - GL_STUB(CallLists, _gloffset_CallLists, CallLists@12) - GL_STUB(DeleteLists, _gloffset_DeleteLists, DeleteLists@8) - GL_STUB(GenLists, _gloffset_GenLists, GenLists@4) - GL_STUB(ListBase, _gloffset_ListBase, ListBase@4) - GL_STUB(Begin, _gloffset_Begin, Begin@4) - GL_STUB(Bitmap, _gloffset_Bitmap, Bitmap@28) - GL_STUB(Color3b, _gloffset_Color3b, Color3b@12) - GL_STUB(Color3bv, _gloffset_Color3bv, Color3bv@4) - GL_STUB(Color3d, _gloffset_Color3d, Color3d@24) - GL_STUB(Color3dv, _gloffset_Color3dv, Color3dv@4) - GL_STUB(Color3f, _gloffset_Color3f, Color3f@12) - GL_STUB(Color3fv, _gloffset_Color3fv, Color3fv@4) - GL_STUB(Color3i, _gloffset_Color3i, Color3i@12) - GL_STUB(Color3iv, _gloffset_Color3iv, Color3iv@4) - GL_STUB(Color3s, _gloffset_Color3s, Color3s@12) - GL_STUB(Color3sv, _gloffset_Color3sv, Color3sv@4) - GL_STUB(Color3ub, _gloffset_Color3ub, Color3ub@12) - GL_STUB(Color3ubv, _gloffset_Color3ubv, Color3ubv@4) - GL_STUB(Color3ui, _gloffset_Color3ui, Color3ui@12) - GL_STUB(Color3uiv, _gloffset_Color3uiv, Color3uiv@4) - GL_STUB(Color3us, _gloffset_Color3us, Color3us@12) - GL_STUB(Color3usv, _gloffset_Color3usv, Color3usv@4) - GL_STUB(Color4b, _gloffset_Color4b, Color4b@16) - GL_STUB(Color4bv, _gloffset_Color4bv, Color4bv@4) - GL_STUB(Color4d, _gloffset_Color4d, Color4d@32) - GL_STUB(Color4dv, _gloffset_Color4dv, Color4dv@4) - GL_STUB(Color4f, _gloffset_Color4f, Color4f@16) - GL_STUB(Color4fv, _gloffset_Color4fv, Color4fv@4) - GL_STUB(Color4i, _gloffset_Color4i, Color4i@16) - GL_STUB(Color4iv, _gloffset_Color4iv, Color4iv@4) - GL_STUB(Color4s, _gloffset_Color4s, Color4s@16) - GL_STUB(Color4sv, _gloffset_Color4sv, Color4sv@4) - GL_STUB(Color4ub, _gloffset_Color4ub, Color4ub@16) - GL_STUB(Color4ubv, _gloffset_Color4ubv, Color4ubv@4) - GL_STUB(Color4ui, _gloffset_Color4ui, Color4ui@16) - GL_STUB(Color4uiv, _gloffset_Color4uiv, Color4uiv@4) - GL_STUB(Color4us, _gloffset_Color4us, Color4us@16) - GL_STUB(Color4usv, _gloffset_Color4usv, Color4usv@4) - GL_STUB(EdgeFlag, _gloffset_EdgeFlag, EdgeFlag@4) - GL_STUB(EdgeFlagv, _gloffset_EdgeFlagv, EdgeFlagv@4) - GL_STUB(End, _gloffset_End, End@0) - GL_STUB(Indexd, _gloffset_Indexd, Indexd@8) - GL_STUB(Indexdv, _gloffset_Indexdv, Indexdv@4) - GL_STUB(Indexf, _gloffset_Indexf, Indexf@4) - GL_STUB(Indexfv, _gloffset_Indexfv, Indexfv@4) - GL_STUB(Indexi, _gloffset_Indexi, Indexi@4) - GL_STUB(Indexiv, _gloffset_Indexiv, Indexiv@4) - GL_STUB(Indexs, _gloffset_Indexs, Indexs@4) - GL_STUB(Indexsv, _gloffset_Indexsv, Indexsv@4) - GL_STUB(Normal3b, _gloffset_Normal3b, Normal3b@12) - GL_STUB(Normal3bv, _gloffset_Normal3bv, Normal3bv@4) - GL_STUB(Normal3d, _gloffset_Normal3d, Normal3d@24) - GL_STUB(Normal3dv, _gloffset_Normal3dv, Normal3dv@4) - GL_STUB(Normal3f, _gloffset_Normal3f, Normal3f@12) - GL_STUB(Normal3fv, _gloffset_Normal3fv, Normal3fv@4) - GL_STUB(Normal3i, _gloffset_Normal3i, Normal3i@12) - GL_STUB(Normal3iv, _gloffset_Normal3iv, Normal3iv@4) - GL_STUB(Normal3s, _gloffset_Normal3s, Normal3s@12) - GL_STUB(Normal3sv, _gloffset_Normal3sv, Normal3sv@4) - GL_STUB(RasterPos2d, _gloffset_RasterPos2d, RasterPos2d@16) - GL_STUB(RasterPos2dv, _gloffset_RasterPos2dv, RasterPos2dv@4) - GL_STUB(RasterPos2f, _gloffset_RasterPos2f, RasterPos2f@8) - GL_STUB(RasterPos2fv, _gloffset_RasterPos2fv, RasterPos2fv@4) - GL_STUB(RasterPos2i, _gloffset_RasterPos2i, RasterPos2i@8) - GL_STUB(RasterPos2iv, _gloffset_RasterPos2iv, RasterPos2iv@4) - GL_STUB(RasterPos2s, _gloffset_RasterPos2s, RasterPos2s@8) - GL_STUB(RasterPos2sv, _gloffset_RasterPos2sv, RasterPos2sv@4) - GL_STUB(RasterPos3d, _gloffset_RasterPos3d, RasterPos3d@24) - GL_STUB(RasterPos3dv, _gloffset_RasterPos3dv, RasterPos3dv@4) - GL_STUB(RasterPos3f, _gloffset_RasterPos3f, RasterPos3f@12) - GL_STUB(RasterPos3fv, _gloffset_RasterPos3fv, RasterPos3fv@4) - GL_STUB(RasterPos3i, _gloffset_RasterPos3i, RasterPos3i@12) - GL_STUB(RasterPos3iv, _gloffset_RasterPos3iv, RasterPos3iv@4) - GL_STUB(RasterPos3s, _gloffset_RasterPos3s, RasterPos3s@12) - GL_STUB(RasterPos3sv, _gloffset_RasterPos3sv, RasterPos3sv@4) - GL_STUB(RasterPos4d, _gloffset_RasterPos4d, RasterPos4d@32) - GL_STUB(RasterPos4dv, _gloffset_RasterPos4dv, RasterPos4dv@4) - GL_STUB(RasterPos4f, _gloffset_RasterPos4f, RasterPos4f@16) - GL_STUB(RasterPos4fv, _gloffset_RasterPos4fv, RasterPos4fv@4) - GL_STUB(RasterPos4i, _gloffset_RasterPos4i, RasterPos4i@16) - GL_STUB(RasterPos4iv, _gloffset_RasterPos4iv, RasterPos4iv@4) - GL_STUB(RasterPos4s, _gloffset_RasterPos4s, RasterPos4s@16) - GL_STUB(RasterPos4sv, _gloffset_RasterPos4sv, RasterPos4sv@4) - GL_STUB(Rectd, _gloffset_Rectd, Rectd@32) - GL_STUB(Rectdv, _gloffset_Rectdv, Rectdv@8) - GL_STUB(Rectf, _gloffset_Rectf, Rectf@16) - GL_STUB(Rectfv, _gloffset_Rectfv, Rectfv@8) - GL_STUB(Recti, _gloffset_Recti, Recti@16) - GL_STUB(Rectiv, _gloffset_Rectiv, Rectiv@8) - GL_STUB(Rects, _gloffset_Rects, Rects@16) - GL_STUB(Rectsv, _gloffset_Rectsv, Rectsv@8) - GL_STUB(TexCoord1d, _gloffset_TexCoord1d, TexCoord1d@8) - GL_STUB(TexCoord1dv, _gloffset_TexCoord1dv, TexCoord1dv@4) - GL_STUB(TexCoord1f, _gloffset_TexCoord1f, TexCoord1f@4) - GL_STUB(TexCoord1fv, _gloffset_TexCoord1fv, TexCoord1fv@4) - GL_STUB(TexCoord1i, _gloffset_TexCoord1i, TexCoord1i@4) - GL_STUB(TexCoord1iv, _gloffset_TexCoord1iv, TexCoord1iv@4) - GL_STUB(TexCoord1s, _gloffset_TexCoord1s, TexCoord1s@4) - GL_STUB(TexCoord1sv, _gloffset_TexCoord1sv, TexCoord1sv@4) - GL_STUB(TexCoord2d, _gloffset_TexCoord2d, TexCoord2d@16) - GL_STUB(TexCoord2dv, _gloffset_TexCoord2dv, TexCoord2dv@4) - GL_STUB(TexCoord2f, _gloffset_TexCoord2f, TexCoord2f@8) - GL_STUB(TexCoord2fv, _gloffset_TexCoord2fv, TexCoord2fv@4) - GL_STUB(TexCoord2i, _gloffset_TexCoord2i, TexCoord2i@8) - GL_STUB(TexCoord2iv, _gloffset_TexCoord2iv, TexCoord2iv@4) - GL_STUB(TexCoord2s, _gloffset_TexCoord2s, TexCoord2s@8) - GL_STUB(TexCoord2sv, _gloffset_TexCoord2sv, TexCoord2sv@4) - GL_STUB(TexCoord3d, _gloffset_TexCoord3d, TexCoord3d@24) - GL_STUB(TexCoord3dv, _gloffset_TexCoord3dv, TexCoord3dv@4) - GL_STUB(TexCoord3f, _gloffset_TexCoord3f, TexCoord3f@12) - GL_STUB(TexCoord3fv, _gloffset_TexCoord3fv, TexCoord3fv@4) - GL_STUB(TexCoord3i, _gloffset_TexCoord3i, TexCoord3i@12) - GL_STUB(TexCoord3iv, _gloffset_TexCoord3iv, TexCoord3iv@4) - GL_STUB(TexCoord3s, _gloffset_TexCoord3s, TexCoord3s@12) - GL_STUB(TexCoord3sv, _gloffset_TexCoord3sv, TexCoord3sv@4) - GL_STUB(TexCoord4d, _gloffset_TexCoord4d, TexCoord4d@32) - GL_STUB(TexCoord4dv, _gloffset_TexCoord4dv, TexCoord4dv@4) - GL_STUB(TexCoord4f, _gloffset_TexCoord4f, TexCoord4f@16) - GL_STUB(TexCoord4fv, _gloffset_TexCoord4fv, TexCoord4fv@4) - GL_STUB(TexCoord4i, _gloffset_TexCoord4i, TexCoord4i@16) - GL_STUB(TexCoord4iv, _gloffset_TexCoord4iv, TexCoord4iv@4) - GL_STUB(TexCoord4s, _gloffset_TexCoord4s, TexCoord4s@16) - GL_STUB(TexCoord4sv, _gloffset_TexCoord4sv, TexCoord4sv@4) - GL_STUB(Vertex2d, _gloffset_Vertex2d, Vertex2d@16) - GL_STUB(Vertex2dv, _gloffset_Vertex2dv, Vertex2dv@4) - GL_STUB(Vertex2f, _gloffset_Vertex2f, Vertex2f@8) - GL_STUB(Vertex2fv, _gloffset_Vertex2fv, Vertex2fv@4) - GL_STUB(Vertex2i, _gloffset_Vertex2i, Vertex2i@8) - GL_STUB(Vertex2iv, _gloffset_Vertex2iv, Vertex2iv@4) - GL_STUB(Vertex2s, _gloffset_Vertex2s, Vertex2s@8) - GL_STUB(Vertex2sv, _gloffset_Vertex2sv, Vertex2sv@4) - GL_STUB(Vertex3d, _gloffset_Vertex3d, Vertex3d@24) - GL_STUB(Vertex3dv, _gloffset_Vertex3dv, Vertex3dv@4) - GL_STUB(Vertex3f, _gloffset_Vertex3f, Vertex3f@12) - GL_STUB(Vertex3fv, _gloffset_Vertex3fv, Vertex3fv@4) - GL_STUB(Vertex3i, _gloffset_Vertex3i, Vertex3i@12) - GL_STUB(Vertex3iv, _gloffset_Vertex3iv, Vertex3iv@4) - GL_STUB(Vertex3s, _gloffset_Vertex3s, Vertex3s@12) - GL_STUB(Vertex3sv, _gloffset_Vertex3sv, Vertex3sv@4) - GL_STUB(Vertex4d, _gloffset_Vertex4d, Vertex4d@32) - GL_STUB(Vertex4dv, _gloffset_Vertex4dv, Vertex4dv@4) - GL_STUB(Vertex4f, _gloffset_Vertex4f, Vertex4f@16) - GL_STUB(Vertex4fv, _gloffset_Vertex4fv, Vertex4fv@4) - GL_STUB(Vertex4i, _gloffset_Vertex4i, Vertex4i@16) - GL_STUB(Vertex4iv, _gloffset_Vertex4iv, Vertex4iv@4) - GL_STUB(Vertex4s, _gloffset_Vertex4s, Vertex4s@16) - GL_STUB(Vertex4sv, _gloffset_Vertex4sv, Vertex4sv@4) - GL_STUB(ClipPlane, _gloffset_ClipPlane, ClipPlane@8) - GL_STUB(ColorMaterial, _gloffset_ColorMaterial, ColorMaterial@8) - GL_STUB(CullFace, _gloffset_CullFace, CullFace@4) - GL_STUB(Fogf, _gloffset_Fogf, Fogf@8) - GL_STUB(Fogfv, _gloffset_Fogfv, Fogfv@8) - GL_STUB(Fogi, _gloffset_Fogi, Fogi@8) - GL_STUB(Fogiv, _gloffset_Fogiv, Fogiv@8) - GL_STUB(FrontFace, _gloffset_FrontFace, FrontFace@4) - GL_STUB(Hint, _gloffset_Hint, Hint@8) - GL_STUB(Lightf, _gloffset_Lightf, Lightf@12) - GL_STUB(Lightfv, _gloffset_Lightfv, Lightfv@12) - GL_STUB(Lighti, _gloffset_Lighti, Lighti@12) - GL_STUB(Lightiv, _gloffset_Lightiv, Lightiv@12) - GL_STUB(LightModelf, _gloffset_LightModelf, LightModelf@8) - GL_STUB(LightModelfv, _gloffset_LightModelfv, LightModelfv@8) - GL_STUB(LightModeli, _gloffset_LightModeli, LightModeli@8) - GL_STUB(LightModeliv, _gloffset_LightModeliv, LightModeliv@8) - GL_STUB(LineStipple, _gloffset_LineStipple, LineStipple@8) - GL_STUB(LineWidth, _gloffset_LineWidth, LineWidth@4) - GL_STUB(Materialf, _gloffset_Materialf, Materialf@12) - GL_STUB(Materialfv, _gloffset_Materialfv, Materialfv@12) - GL_STUB(Materiali, _gloffset_Materiali, Materiali@12) - GL_STUB(Materialiv, _gloffset_Materialiv, Materialiv@12) - GL_STUB(PointSize, _gloffset_PointSize, PointSize@4) - GL_STUB(PolygonMode, _gloffset_PolygonMode, PolygonMode@8) - GL_STUB(PolygonStipple, _gloffset_PolygonStipple, PolygonStipple@4) - GL_STUB(Scissor, _gloffset_Scissor, Scissor@16) - GL_STUB(ShadeModel, _gloffset_ShadeModel, ShadeModel@4) - GL_STUB(TexParameterf, _gloffset_TexParameterf, TexParameterf@12) - GL_STUB(TexParameterfv, _gloffset_TexParameterfv, TexParameterfv@12) - GL_STUB(TexParameteri, _gloffset_TexParameteri, TexParameteri@12) - GL_STUB(TexParameteriv, _gloffset_TexParameteriv, TexParameteriv@12) - GL_STUB(TexImage1D, _gloffset_TexImage1D, TexImage1D@32) - GL_STUB(TexImage2D, _gloffset_TexImage2D, TexImage2D@36) - GL_STUB(TexEnvf, _gloffset_TexEnvf, TexEnvf@12) - GL_STUB(TexEnvfv, _gloffset_TexEnvfv, TexEnvfv@12) - GL_STUB(TexEnvi, _gloffset_TexEnvi, TexEnvi@12) - GL_STUB(TexEnviv, _gloffset_TexEnviv, TexEnviv@12) - GL_STUB(TexGend, _gloffset_TexGend, TexGend@16) - GL_STUB(TexGendv, _gloffset_TexGendv, TexGendv@12) - GL_STUB(TexGenf, _gloffset_TexGenf, TexGenf@12) - GL_STUB(TexGenfv, _gloffset_TexGenfv, TexGenfv@12) - GL_STUB(TexGeni, _gloffset_TexGeni, TexGeni@12) - GL_STUB(TexGeniv, _gloffset_TexGeniv, TexGeniv@12) - GL_STUB(FeedbackBuffer, _gloffset_FeedbackBuffer, FeedbackBuffer@12) - GL_STUB(SelectBuffer, _gloffset_SelectBuffer, SelectBuffer@8) - GL_STUB(RenderMode, _gloffset_RenderMode, RenderMode@4) - GL_STUB(InitNames, _gloffset_InitNames, InitNames@0) - GL_STUB(LoadName, _gloffset_LoadName, LoadName@4) - GL_STUB(PassThrough, _gloffset_PassThrough, PassThrough@4) - GL_STUB(PopName, _gloffset_PopName, PopName@0) - GL_STUB(PushName, _gloffset_PushName, PushName@4) - GL_STUB(DrawBuffer, _gloffset_DrawBuffer, DrawBuffer@4) - GL_STUB(Clear, _gloffset_Clear, Clear@4) - GL_STUB(ClearAccum, _gloffset_ClearAccum, ClearAccum@16) - GL_STUB(ClearIndex, _gloffset_ClearIndex, ClearIndex@4) - GL_STUB(ClearColor, _gloffset_ClearColor, ClearColor@16) - GL_STUB(ClearStencil, _gloffset_ClearStencil, ClearStencil@4) - GL_STUB(ClearDepth, _gloffset_ClearDepth, ClearDepth@8) - GL_STUB(StencilMask, _gloffset_StencilMask, StencilMask@4) - GL_STUB(ColorMask, _gloffset_ColorMask, ColorMask@16) - GL_STUB(DepthMask, _gloffset_DepthMask, DepthMask@4) - GL_STUB(IndexMask, _gloffset_IndexMask, IndexMask@4) - GL_STUB(Accum, _gloffset_Accum, Accum@8) - GL_STUB(Disable, _gloffset_Disable, Disable@4) - GL_STUB(Enable, _gloffset_Enable, Enable@4) - GL_STUB(Finish, _gloffset_Finish, Finish@0) - GL_STUB(Flush, _gloffset_Flush, Flush@0) - GL_STUB(PopAttrib, _gloffset_PopAttrib, PopAttrib@0) - GL_STUB(PushAttrib, _gloffset_PushAttrib, PushAttrib@4) - GL_STUB(Map1d, _gloffset_Map1d, Map1d@32) - GL_STUB(Map1f, _gloffset_Map1f, Map1f@24) - GL_STUB(Map2d, _gloffset_Map2d, Map2d@56) - GL_STUB(Map2f, _gloffset_Map2f, Map2f@40) - GL_STUB(MapGrid1d, _gloffset_MapGrid1d, MapGrid1d@20) - GL_STUB(MapGrid1f, _gloffset_MapGrid1f, MapGrid1f@12) - GL_STUB(MapGrid2d, _gloffset_MapGrid2d, MapGrid2d@40) - GL_STUB(MapGrid2f, _gloffset_MapGrid2f, MapGrid2f@24) - GL_STUB(EvalCoord1d, _gloffset_EvalCoord1d, EvalCoord1d@8) - GL_STUB(EvalCoord1dv, _gloffset_EvalCoord1dv, EvalCoord1dv@4) - GL_STUB(EvalCoord1f, _gloffset_EvalCoord1f, EvalCoord1f@4) - GL_STUB(EvalCoord1fv, _gloffset_EvalCoord1fv, EvalCoord1fv@4) - GL_STUB(EvalCoord2d, _gloffset_EvalCoord2d, EvalCoord2d@16) - GL_STUB(EvalCoord2dv, _gloffset_EvalCoord2dv, EvalCoord2dv@4) - GL_STUB(EvalCoord2f, _gloffset_EvalCoord2f, EvalCoord2f@8) - GL_STUB(EvalCoord2fv, _gloffset_EvalCoord2fv, EvalCoord2fv@4) - GL_STUB(EvalMesh1, _gloffset_EvalMesh1, EvalMesh1@12) - GL_STUB(EvalPoint1, _gloffset_EvalPoint1, EvalPoint1@4) - GL_STUB(EvalMesh2, _gloffset_EvalMesh2, EvalMesh2@20) - GL_STUB(EvalPoint2, _gloffset_EvalPoint2, EvalPoint2@8) - GL_STUB(AlphaFunc, _gloffset_AlphaFunc, AlphaFunc@8) - GL_STUB(BlendFunc, _gloffset_BlendFunc, BlendFunc@8) - GL_STUB(LogicOp, _gloffset_LogicOp, LogicOp@4) - GL_STUB(StencilFunc, _gloffset_StencilFunc, StencilFunc@12) - GL_STUB(StencilOp, _gloffset_StencilOp, StencilOp@12) - GL_STUB(DepthFunc, _gloffset_DepthFunc, DepthFunc@4) - GL_STUB(PixelZoom, _gloffset_PixelZoom, PixelZoom@8) - GL_STUB(PixelTransferf, _gloffset_PixelTransferf, PixelTransferf@8) - GL_STUB(PixelTransferi, _gloffset_PixelTransferi, PixelTransferi@8) - GL_STUB(PixelStoref, _gloffset_PixelStoref, PixelStoref@8) - GL_STUB(PixelStorei, _gloffset_PixelStorei, PixelStorei@8) - GL_STUB(PixelMapfv, _gloffset_PixelMapfv, PixelMapfv@12) - GL_STUB(PixelMapuiv, _gloffset_PixelMapuiv, PixelMapuiv@12) - GL_STUB(PixelMapusv, _gloffset_PixelMapusv, PixelMapusv@12) - GL_STUB(ReadBuffer, _gloffset_ReadBuffer, ReadBuffer@4) - GL_STUB(CopyPixels, _gloffset_CopyPixels, CopyPixels@20) - GL_STUB(ReadPixels, _gloffset_ReadPixels, ReadPixels@28) - GL_STUB(DrawPixels, _gloffset_DrawPixels, DrawPixels@20) - GL_STUB(GetBooleanv, _gloffset_GetBooleanv, GetBooleanv@8) - GL_STUB(GetClipPlane, _gloffset_GetClipPlane, GetClipPlane@8) - GL_STUB(GetDoublev, _gloffset_GetDoublev, GetDoublev@8) - GL_STUB(GetError, _gloffset_GetError, GetError@0) - GL_STUB(GetFloatv, _gloffset_GetFloatv, GetFloatv@8) - GL_STUB(GetIntegerv, _gloffset_GetIntegerv, GetIntegerv@8) - GL_STUB(GetLightfv, _gloffset_GetLightfv, GetLightfv@12) - GL_STUB(GetLightiv, _gloffset_GetLightiv, GetLightiv@12) - GL_STUB(GetMapdv, _gloffset_GetMapdv, GetMapdv@12) - GL_STUB(GetMapfv, _gloffset_GetMapfv, GetMapfv@12) - GL_STUB(GetMapiv, _gloffset_GetMapiv, GetMapiv@12) - GL_STUB(GetMaterialfv, _gloffset_GetMaterialfv, GetMaterialfv@12) - GL_STUB(GetMaterialiv, _gloffset_GetMaterialiv, GetMaterialiv@12) - GL_STUB(GetPixelMapfv, _gloffset_GetPixelMapfv, GetPixelMapfv@8) - GL_STUB(GetPixelMapuiv, _gloffset_GetPixelMapuiv, GetPixelMapuiv@8) - GL_STUB(GetPixelMapusv, _gloffset_GetPixelMapusv, GetPixelMapusv@8) - GL_STUB(GetPolygonStipple, _gloffset_GetPolygonStipple, GetPolygonStipple@4) - GL_STUB(GetString, _gloffset_GetString, GetString@4) - GL_STUB(GetTexEnvfv, _gloffset_GetTexEnvfv, GetTexEnvfv@12) - GL_STUB(GetTexEnviv, _gloffset_GetTexEnviv, GetTexEnviv@12) - GL_STUB(GetTexGendv, _gloffset_GetTexGendv, GetTexGendv@12) - GL_STUB(GetTexGenfv, _gloffset_GetTexGenfv, GetTexGenfv@12) - GL_STUB(GetTexGeniv, _gloffset_GetTexGeniv, GetTexGeniv@12) - GL_STUB(GetTexImage, _gloffset_GetTexImage, GetTexImage@20) - GL_STUB(GetTexParameterfv, _gloffset_GetTexParameterfv, GetTexParameterfv@12) - GL_STUB(GetTexParameteriv, _gloffset_GetTexParameteriv, GetTexParameteriv@12) - GL_STUB(GetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv, GetTexLevelParameterfv@16) - GL_STUB(GetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv, GetTexLevelParameteriv@16) - GL_STUB(IsEnabled, _gloffset_IsEnabled, IsEnabled@4) - GL_STUB(IsList, _gloffset_IsList, IsList@4) - GL_STUB(DepthRange, _gloffset_DepthRange, DepthRange@16) - GL_STUB(Frustum, _gloffset_Frustum, Frustum@48) - GL_STUB(LoadIdentity, _gloffset_LoadIdentity, LoadIdentity@0) - GL_STUB(LoadMatrixf, _gloffset_LoadMatrixf, LoadMatrixf@4) - GL_STUB(LoadMatrixd, _gloffset_LoadMatrixd, LoadMatrixd@4) - GL_STUB(MatrixMode, _gloffset_MatrixMode, MatrixMode@4) - GL_STUB(MultMatrixf, _gloffset_MultMatrixf, MultMatrixf@4) - GL_STUB(MultMatrixd, _gloffset_MultMatrixd, MultMatrixd@4) - GL_STUB(Ortho, _gloffset_Ortho, Ortho@48) - GL_STUB(PopMatrix, _gloffset_PopMatrix, PopMatrix@0) - GL_STUB(PushMatrix, _gloffset_PushMatrix, PushMatrix@0) - GL_STUB(Rotated, _gloffset_Rotated, Rotated@32) - GL_STUB(Rotatef, _gloffset_Rotatef, Rotatef@16) - GL_STUB(Scaled, _gloffset_Scaled, Scaled@24) - GL_STUB(Scalef, _gloffset_Scalef, Scalef@12) - GL_STUB(Translated, _gloffset_Translated, Translated@24) - GL_STUB(Translatef, _gloffset_Translatef, Translatef@12) - GL_STUB(Viewport, _gloffset_Viewport, Viewport@16) - GL_STUB(ArrayElement, _gloffset_ArrayElement, ArrayElement@4) - GL_STUB(BindTexture, _gloffset_BindTexture, BindTexture@8) - GL_STUB(ColorPointer, _gloffset_ColorPointer, ColorPointer@16) - GL_STUB(DisableClientState, _gloffset_DisableClientState, DisableClientState@4) - GL_STUB(DrawArrays, _gloffset_DrawArrays, DrawArrays@12) - GL_STUB(DrawElements, _gloffset_DrawElements, DrawElements@16) - GL_STUB(EdgeFlagPointer, _gloffset_EdgeFlagPointer, EdgeFlagPointer@8) - GL_STUB(EnableClientState, _gloffset_EnableClientState, EnableClientState@4) - GL_STUB(IndexPointer, _gloffset_IndexPointer, IndexPointer@12) - GL_STUB(Indexub, _gloffset_Indexub, Indexub@4) - GL_STUB(Indexubv, _gloffset_Indexubv, Indexubv@4) - GL_STUB(InterleavedArrays, _gloffset_InterleavedArrays, InterleavedArrays@12) - GL_STUB(NormalPointer, _gloffset_NormalPointer, NormalPointer@12) - GL_STUB(PolygonOffset, _gloffset_PolygonOffset, PolygonOffset@8) - GL_STUB(TexCoordPointer, _gloffset_TexCoordPointer, TexCoordPointer@16) - GL_STUB(VertexPointer, _gloffset_VertexPointer, VertexPointer@16) - GL_STUB(AreTexturesResident, _gloffset_AreTexturesResident, AreTexturesResident@12) - GL_STUB(CopyTexImage1D, _gloffset_CopyTexImage1D, CopyTexImage1D@28) - GL_STUB(CopyTexImage2D, _gloffset_CopyTexImage2D, CopyTexImage2D@32) - GL_STUB(CopyTexSubImage1D, _gloffset_CopyTexSubImage1D, CopyTexSubImage1D@24) - GL_STUB(CopyTexSubImage2D, _gloffset_CopyTexSubImage2D, CopyTexSubImage2D@32) - GL_STUB(DeleteTextures, _gloffset_DeleteTextures, DeleteTextures@8) - GL_STUB(GenTextures, _gloffset_GenTextures, GenTextures@8) - GL_STUB(GetPointerv, _gloffset_GetPointerv, GetPointerv@8) - GL_STUB(IsTexture, _gloffset_IsTexture, IsTexture@4) - GL_STUB(PrioritizeTextures, _gloffset_PrioritizeTextures, PrioritizeTextures@12) - GL_STUB(TexSubImage1D, _gloffset_TexSubImage1D, TexSubImage1D@28) - GL_STUB(TexSubImage2D, _gloffset_TexSubImage2D, TexSubImage2D@36) - GL_STUB(PopClientAttrib, _gloffset_PopClientAttrib, PopClientAttrib@0) - GL_STUB(PushClientAttrib, _gloffset_PushClientAttrib, PushClientAttrib@4) - GL_STUB(BlendColor, _gloffset_BlendColor, BlendColor@16) - GL_STUB(BlendEquation, _gloffset_BlendEquation, BlendEquation@4) - GL_STUB(DrawRangeElements, _gloffset_DrawRangeElements, DrawRangeElements@24) - GL_STUB(ColorTable, _gloffset_ColorTable, ColorTable@24) - GL_STUB(ColorTableParameterfv, _gloffset_ColorTableParameterfv, ColorTableParameterfv@12) - GL_STUB(ColorTableParameteriv, _gloffset_ColorTableParameteriv, ColorTableParameteriv@12) - GL_STUB(CopyColorTable, _gloffset_CopyColorTable, CopyColorTable@20) - GL_STUB(GetColorTable, _gloffset_GetColorTable, GetColorTable@16) - GL_STUB(GetColorTableParameterfv, _gloffset_GetColorTableParameterfv, GetColorTableParameterfv@12) - GL_STUB(GetColorTableParameteriv, _gloffset_GetColorTableParameteriv, GetColorTableParameteriv@12) - GL_STUB(ColorSubTable, _gloffset_ColorSubTable, ColorSubTable@24) - GL_STUB(CopyColorSubTable, _gloffset_CopyColorSubTable, CopyColorSubTable@20) - GL_STUB(ConvolutionFilter1D, _gloffset_ConvolutionFilter1D, ConvolutionFilter1D@24) - GL_STUB(ConvolutionFilter2D, _gloffset_ConvolutionFilter2D, ConvolutionFilter2D@28) - GL_STUB(ConvolutionParameterf, _gloffset_ConvolutionParameterf, ConvolutionParameterf@12) - GL_STUB(ConvolutionParameterfv, _gloffset_ConvolutionParameterfv, ConvolutionParameterfv@12) - GL_STUB(ConvolutionParameteri, _gloffset_ConvolutionParameteri, ConvolutionParameteri@12) - GL_STUB(ConvolutionParameteriv, _gloffset_ConvolutionParameteriv, ConvolutionParameteriv@12) - GL_STUB(CopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1D@20) - GL_STUB(CopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2D@24) - GL_STUB(GetConvolutionFilter, _gloffset_GetConvolutionFilter, GetConvolutionFilter@16) - GL_STUB(GetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfv@12) - GL_STUB(GetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv, GetConvolutionParameteriv@12) - GL_STUB(GetSeparableFilter, _gloffset_GetSeparableFilter, GetSeparableFilter@24) - GL_STUB(SeparableFilter2D, _gloffset_SeparableFilter2D, SeparableFilter2D@32) - GL_STUB(GetHistogram, _gloffset_GetHistogram, GetHistogram@20) - GL_STUB(GetHistogramParameterfv, _gloffset_GetHistogramParameterfv, GetHistogramParameterfv@12) - GL_STUB(GetHistogramParameteriv, _gloffset_GetHistogramParameteriv, GetHistogramParameteriv@12) - GL_STUB(GetMinmax, _gloffset_GetMinmax, GetMinmax@20) - GL_STUB(GetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfv@12) - GL_STUB(GetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv, GetMinmaxParameteriv@12) - GL_STUB(Histogram, _gloffset_Histogram, Histogram@16) - GL_STUB(Minmax, _gloffset_Minmax, Minmax@12) - GL_STUB(ResetHistogram, _gloffset_ResetHistogram, ResetHistogram@4) - GL_STUB(ResetMinmax, _gloffset_ResetMinmax, ResetMinmax@4) - GL_STUB(TexImage3D, _gloffset_TexImage3D, TexImage3D@40) - GL_STUB(TexSubImage3D, _gloffset_TexSubImage3D, TexSubImage3D@44) - GL_STUB(CopyTexSubImage3D, _gloffset_CopyTexSubImage3D, CopyTexSubImage3D@36) - GL_STUB(ActiveTextureARB, _gloffset_ActiveTextureARB, ActiveTextureARB@4) - GL_STUB(ClientActiveTextureARB, _gloffset_ClientActiveTextureARB, ClientActiveTextureARB@4) - GL_STUB(MultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB, MultiTexCoord1dARB@12) - GL_STUB(MultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB, MultiTexCoord1dvARB@8) - GL_STUB(MultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB, MultiTexCoord1fARB@8) - GL_STUB(MultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB, MultiTexCoord1fvARB@8) - GL_STUB(MultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB, MultiTexCoord1iARB@8) - GL_STUB(MultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB, MultiTexCoord1ivARB@8) - GL_STUB(MultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB, MultiTexCoord1sARB@8) - GL_STUB(MultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB, MultiTexCoord1svARB@8) - GL_STUB(MultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB, MultiTexCoord2dARB@20) - GL_STUB(MultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB, MultiTexCoord2dvARB@8) - GL_STUB(MultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB, MultiTexCoord2fARB@12) - GL_STUB(MultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB, MultiTexCoord2fvARB@8) - GL_STUB(MultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB, MultiTexCoord2iARB@12) - GL_STUB(MultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB, MultiTexCoord2ivARB@8) - GL_STUB(MultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB, MultiTexCoord2sARB@12) - GL_STUB(MultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB, MultiTexCoord2svARB@8) - GL_STUB(MultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB, MultiTexCoord3dARB@28) - GL_STUB(MultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB, MultiTexCoord3dvARB@8) - GL_STUB(MultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB, MultiTexCoord3fARB@16) - GL_STUB(MultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB, MultiTexCoord3fvARB@8) - GL_STUB(MultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB, MultiTexCoord3iARB@16) - GL_STUB(MultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB, MultiTexCoord3ivARB@8) - GL_STUB(MultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB, MultiTexCoord3sARB@16) - GL_STUB(MultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB, MultiTexCoord3svARB@8) - GL_STUB(MultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB, MultiTexCoord4dARB@36) - GL_STUB(MultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB, MultiTexCoord4dvARB@8) - GL_STUB(MultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB, MultiTexCoord4fARB@20) - GL_STUB(MultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB, MultiTexCoord4fvARB@8) - GL_STUB(MultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB, MultiTexCoord4iARB@20) - GL_STUB(MultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4ivARB@8) - GL_STUB(MultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB, MultiTexCoord4sARB@20) - GL_STUB(MultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB, MultiTexCoord4svARB@8) - GL_STUB(AttachShader, _gloffset_AttachShader, AttachShader@8) - GL_STUB(CreateProgram, _gloffset_CreateProgram, CreateProgram@0) - GL_STUB(CreateShader, _gloffset_CreateShader, CreateShader@4) - GL_STUB(DeleteProgram, _gloffset_DeleteProgram, DeleteProgram@4) - GL_STUB(DeleteShader, _gloffset_DeleteShader, DeleteShader@4) - GL_STUB(DetachShader, _gloffset_DetachShader, DetachShader@8) - GL_STUB(GetAttachedShaders, _gloffset_GetAttachedShaders, GetAttachedShaders@16) - GL_STUB(GetProgramInfoLog, _gloffset_GetProgramInfoLog, GetProgramInfoLog@16) - GL_STUB(GetProgramiv, _gloffset_GetProgramiv, GetProgramiv@12) - GL_STUB(GetShaderInfoLog, _gloffset_GetShaderInfoLog, GetShaderInfoLog@16) - GL_STUB(GetShaderiv, _gloffset_GetShaderiv, GetShaderiv@12) - GL_STUB(IsProgram, _gloffset_IsProgram, IsProgram@4) - GL_STUB(IsShader, _gloffset_IsShader, IsShader@4) - GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16) - GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8) - GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16) - GL_STUB(UniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv, UniformMatrix2x3fv@16) - GL_STUB(UniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv, UniformMatrix2x4fv@16) - GL_STUB(UniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv, UniformMatrix3x2fv@16) - GL_STUB(UniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv, UniformMatrix3x4fv@16) - GL_STUB(UniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv, UniformMatrix4x2fv@16) - GL_STUB(UniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv, UniformMatrix4x3fv@16) - GL_STUB(LoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4) - GL_STUB(LoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4) - GL_STUB(MultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixdARB@4) - GL_STUB(MultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB, MultTransposeMatrixfARB@4) - GL_STUB(SampleCoverageARB, _gloffset_SampleCoverageARB, SampleCoverageARB@8) - GL_STUB(CompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB, CompressedTexImage1DARB@28) - GL_STUB(CompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB, CompressedTexImage2DARB@32) - GL_STUB(CompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB, CompressedTexImage3DARB@36) - GL_STUB(CompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28) - GL_STUB(CompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36) - GL_STUB(CompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44) - GL_STUB(GetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB, GetCompressedTexImageARB@12) - GL_STUB(DisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4) - GL_STUB(EnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4) - GL_STUB(GetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB, GetProgramEnvParameterdvARB@12) - GL_STUB(GetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB, GetProgramEnvParameterfvARB@12) - GL_STUB(GetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB, GetProgramLocalParameterdvARB@12) - GL_STUB(GetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB, GetProgramLocalParameterfvARB@12) - GL_STUB(GetProgramStringARB, _gloffset_GetProgramStringARB, GetProgramStringARB@12) - GL_STUB(GetProgramivARB, _gloffset_GetProgramivARB, GetProgramivARB@12) - GL_STUB(GetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB, GetVertexAttribdvARB@12) - GL_STUB(GetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB, GetVertexAttribfvARB@12) - GL_STUB(GetVertexAttribivARB, _gloffset_GetVertexAttribivARB, GetVertexAttribivARB@12) - GL_STUB(ProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40) - GL_STUB(ProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12) - GL_STUB(ProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24) - GL_STUB(ProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12) - GL_STUB(ProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB, ProgramLocalParameter4dARB@40) - GL_STUB(ProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB, ProgramLocalParameter4dvARB@12) - GL_STUB(ProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB, ProgramLocalParameter4fARB@24) - GL_STUB(ProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB, ProgramLocalParameter4fvARB@12) - GL_STUB(ProgramStringARB, _gloffset_ProgramStringARB, ProgramStringARB@16) - GL_STUB(VertexAttrib1dARB, _gloffset_VertexAttrib1dARB, VertexAttrib1dARB@12) - GL_STUB(VertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB, VertexAttrib1dvARB@8) - GL_STUB(VertexAttrib1fARB, _gloffset_VertexAttrib1fARB, VertexAttrib1fARB@8) - GL_STUB(VertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB, VertexAttrib1fvARB@8) - GL_STUB(VertexAttrib1sARB, _gloffset_VertexAttrib1sARB, VertexAttrib1sARB@8) - GL_STUB(VertexAttrib1svARB, _gloffset_VertexAttrib1svARB, VertexAttrib1svARB@8) - GL_STUB(VertexAttrib2dARB, _gloffset_VertexAttrib2dARB, VertexAttrib2dARB@20) - GL_STUB(VertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB, VertexAttrib2dvARB@8) - GL_STUB(VertexAttrib2fARB, _gloffset_VertexAttrib2fARB, VertexAttrib2fARB@12) - GL_STUB(VertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB, VertexAttrib2fvARB@8) - GL_STUB(VertexAttrib2sARB, _gloffset_VertexAttrib2sARB, VertexAttrib2sARB@12) - GL_STUB(VertexAttrib2svARB, _gloffset_VertexAttrib2svARB, VertexAttrib2svARB@8) - GL_STUB(VertexAttrib3dARB, _gloffset_VertexAttrib3dARB, VertexAttrib3dARB@28) - GL_STUB(VertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB, VertexAttrib3dvARB@8) - GL_STUB(VertexAttrib3fARB, _gloffset_VertexAttrib3fARB, VertexAttrib3fARB@16) - GL_STUB(VertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB, VertexAttrib3fvARB@8) - GL_STUB(VertexAttrib3sARB, _gloffset_VertexAttrib3sARB, VertexAttrib3sARB@16) - GL_STUB(VertexAttrib3svARB, _gloffset_VertexAttrib3svARB, VertexAttrib3svARB@8) - GL_STUB(VertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB, VertexAttrib4NbvARB@8) - GL_STUB(VertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB, VertexAttrib4NivARB@8) - GL_STUB(VertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB, VertexAttrib4NsvARB@8) - GL_STUB(VertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB, VertexAttrib4NubARB@20) - GL_STUB(VertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB, VertexAttrib4NubvARB@8) - GL_STUB(VertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB, VertexAttrib4NuivARB@8) - GL_STUB(VertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB, VertexAttrib4NusvARB@8) - GL_STUB(VertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB, VertexAttrib4bvARB@8) - GL_STUB(VertexAttrib4dARB, _gloffset_VertexAttrib4dARB, VertexAttrib4dARB@36) - GL_STUB(VertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB, VertexAttrib4dvARB@8) - GL_STUB(VertexAttrib4fARB, _gloffset_VertexAttrib4fARB, VertexAttrib4fARB@20) - GL_STUB(VertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB, VertexAttrib4fvARB@8) - GL_STUB(VertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB, VertexAttrib4ivARB@8) - GL_STUB(VertexAttrib4sARB, _gloffset_VertexAttrib4sARB, VertexAttrib4sARB@20) - GL_STUB(VertexAttrib4svARB, _gloffset_VertexAttrib4svARB, VertexAttrib4svARB@8) - GL_STUB(VertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubvARB@8) - GL_STUB(VertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB, VertexAttrib4uivARB@8) - GL_STUB(VertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB, VertexAttrib4usvARB@8) - GL_STUB(VertexAttribPointerARB, _gloffset_VertexAttribPointerARB, VertexAttribPointerARB@24) - GL_STUB(BindBufferARB, _gloffset_BindBufferARB, BindBufferARB@8) - GL_STUB(BufferDataARB, _gloffset_BufferDataARB, BufferDataARB@16) - GL_STUB(BufferSubDataARB, _gloffset_BufferSubDataARB, BufferSubDataARB@16) - GL_STUB(DeleteBuffersARB, _gloffset_DeleteBuffersARB, DeleteBuffersARB@8) - GL_STUB(GenBuffersARB, _gloffset_GenBuffersARB, GenBuffersARB@8) - GL_STUB(GetBufferParameterivARB, _gloffset_GetBufferParameterivARB, GetBufferParameterivARB@12) - GL_STUB(GetBufferPointervARB, _gloffset_GetBufferPointervARB, GetBufferPointervARB@12) - GL_STUB(GetBufferSubDataARB, _gloffset_GetBufferSubDataARB, GetBufferSubDataARB@16) - GL_STUB(IsBufferARB, _gloffset_IsBufferARB, IsBufferARB@4) - GL_STUB(MapBufferARB, _gloffset_MapBufferARB, MapBufferARB@8) - GL_STUB(UnmapBufferARB, _gloffset_UnmapBufferARB, UnmapBufferARB@4) - GL_STUB(BeginQueryARB, _gloffset_BeginQueryARB, BeginQueryARB@8) - GL_STUB(DeleteQueriesARB, _gloffset_DeleteQueriesARB, DeleteQueriesARB@8) - GL_STUB(EndQueryARB, _gloffset_EndQueryARB, EndQueryARB@4) - GL_STUB(GenQueriesARB, _gloffset_GenQueriesARB, GenQueriesARB@8) - GL_STUB(GetQueryObjectivARB, _gloffset_GetQueryObjectivARB, GetQueryObjectivARB@12) - GL_STUB(GetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB, GetQueryObjectuivARB@12) - GL_STUB(GetQueryivARB, _gloffset_GetQueryivARB, GetQueryivARB@12) - GL_STUB(IsQueryARB, _gloffset_IsQueryARB, IsQueryARB@4) - GL_STUB(AttachObjectARB, _gloffset_AttachObjectARB, AttachObjectARB@8) - GL_STUB(CompileShaderARB, _gloffset_CompileShaderARB, CompileShaderARB@4) - GL_STUB(CreateProgramObjectARB, _gloffset_CreateProgramObjectARB, CreateProgramObjectARB@0) - GL_STUB(CreateShaderObjectARB, _gloffset_CreateShaderObjectARB, CreateShaderObjectARB@4) - GL_STUB(DeleteObjectARB, _gloffset_DeleteObjectARB, DeleteObjectARB@4) - GL_STUB(DetachObjectARB, _gloffset_DetachObjectARB, DetachObjectARB@8) - GL_STUB(GetActiveUniformARB, _gloffset_GetActiveUniformARB, GetActiveUniformARB@28) - GL_STUB(GetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB, GetAttachedObjectsARB@16) - GL_STUB(GetHandleARB, _gloffset_GetHandleARB, GetHandleARB@4) - GL_STUB(GetInfoLogARB, _gloffset_GetInfoLogARB, GetInfoLogARB@16) - GL_STUB(GetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB, GetObjectParameterfvARB@12) - GL_STUB(GetObjectParameterivARB, _gloffset_GetObjectParameterivARB, GetObjectParameterivARB@12) - GL_STUB(GetShaderSourceARB, _gloffset_GetShaderSourceARB, GetShaderSourceARB@16) - GL_STUB(GetUniformLocationARB, _gloffset_GetUniformLocationARB, GetUniformLocationARB@8) - GL_STUB(GetUniformfvARB, _gloffset_GetUniformfvARB, GetUniformfvARB@12) - GL_STUB(GetUniformivARB, _gloffset_GetUniformivARB, GetUniformivARB@12) - GL_STUB(LinkProgramARB, _gloffset_LinkProgramARB, LinkProgramARB@4) - GL_STUB(ShaderSourceARB, _gloffset_ShaderSourceARB, ShaderSourceARB@16) - GL_STUB(Uniform1fARB, _gloffset_Uniform1fARB, Uniform1fARB@8) - GL_STUB(Uniform1fvARB, _gloffset_Uniform1fvARB, Uniform1fvARB@12) - GL_STUB(Uniform1iARB, _gloffset_Uniform1iARB, Uniform1iARB@8) - GL_STUB(Uniform1ivARB, _gloffset_Uniform1ivARB, Uniform1ivARB@12) - GL_STUB(Uniform2fARB, _gloffset_Uniform2fARB, Uniform2fARB@12) - GL_STUB(Uniform2fvARB, _gloffset_Uniform2fvARB, Uniform2fvARB@12) - GL_STUB(Uniform2iARB, _gloffset_Uniform2iARB, Uniform2iARB@12) - GL_STUB(Uniform2ivARB, _gloffset_Uniform2ivARB, Uniform2ivARB@12) - GL_STUB(Uniform3fARB, _gloffset_Uniform3fARB, Uniform3fARB@16) - GL_STUB(Uniform3fvARB, _gloffset_Uniform3fvARB, Uniform3fvARB@12) - GL_STUB(Uniform3iARB, _gloffset_Uniform3iARB, Uniform3iARB@16) - GL_STUB(Uniform3ivARB, _gloffset_Uniform3ivARB, Uniform3ivARB@12) - GL_STUB(Uniform4fARB, _gloffset_Uniform4fARB, Uniform4fARB@20) - GL_STUB(Uniform4fvARB, _gloffset_Uniform4fvARB, Uniform4fvARB@12) - GL_STUB(Uniform4iARB, _gloffset_Uniform4iARB, Uniform4iARB@20) - GL_STUB(Uniform4ivARB, _gloffset_Uniform4ivARB, Uniform4ivARB@12) - GL_STUB(UniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB, UniformMatrix2fvARB@16) - GL_STUB(UniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB, UniformMatrix3fvARB@16) - GL_STUB(UniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB, UniformMatrix4fvARB@16) - GL_STUB(UseProgramObjectARB, _gloffset_UseProgramObjectARB, UseProgramObjectARB@4) - GL_STUB(ValidateProgramARB, _gloffset_ValidateProgramARB, ValidateProgramARB@4) - GL_STUB(BindAttribLocationARB, _gloffset_BindAttribLocationARB, BindAttribLocationARB@12) - GL_STUB(GetActiveAttribARB, _gloffset_GetActiveAttribARB, GetActiveAttribARB@28) - GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8) - GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8) - GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8) - GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8) - HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8)) - GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8) - HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8)) - GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8) - HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8)) - GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8) - HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8)) - GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8) - HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8)) - GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8) - HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8)) - GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8) - HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8)) - GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4) - HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4)) - GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20) - GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12) - GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16) - GL_STUB(NormalPointerEXT, _gloffset_NormalPointerEXT, NormalPointerEXT@16) - GL_STUB(TexCoordPointerEXT, _gloffset_TexCoordPointerEXT, TexCoordPointerEXT@20) - GL_STUB(VertexPointerEXT, _gloffset_VertexPointerEXT, VertexPointerEXT@20) - GL_STUB(PointParameterfEXT, _gloffset_PointParameterfEXT, PointParameterfEXT@8) - GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8) - GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8) - GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0) - GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8) - HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8)) - GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8) - HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8)) - GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12) - GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) - GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24) - GL_STUB(SecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT, SecondaryColor3dvEXT@4) - GL_STUB(SecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT, SecondaryColor3fEXT@12) - GL_STUB(SecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT, SecondaryColor3fvEXT@4) - GL_STUB(SecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT, SecondaryColor3iEXT@12) - GL_STUB(SecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT, SecondaryColor3ivEXT@4) - GL_STUB(SecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT, SecondaryColor3sEXT@12) - GL_STUB(SecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT, SecondaryColor3svEXT@4) - GL_STUB(SecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT, SecondaryColor3ubEXT@12) - GL_STUB(SecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4) - GL_STUB(SecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT, SecondaryColor3uiEXT@12) - GL_STUB(SecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT, SecondaryColor3uivEXT@4) - GL_STUB(SecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT, SecondaryColor3usEXT@12) - GL_STUB(SecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT, SecondaryColor3usvEXT@4) - GL_STUB(SecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT, SecondaryColorPointerEXT@16) - GL_STUB(MultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT, MultiDrawArraysEXT@16) - GL_STUB(MultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT, MultiDrawElementsEXT@20) - GL_STUB(FogCoordPointerEXT, _gloffset_FogCoordPointerEXT, FogCoordPointerEXT@12) - GL_STUB(FogCoorddEXT, _gloffset_FogCoorddEXT, FogCoorddEXT@8) - GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4) - GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4) - GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4) - GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4) - HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4)) - GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) - GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0) - GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8) - GL_STUB(CombinerInputNV, _gloffset_CombinerInputNV, CombinerInputNV@24) - GL_STUB(CombinerOutputNV, _gloffset_CombinerOutputNV, CombinerOutputNV@40) - GL_STUB(CombinerParameterfNV, _gloffset_CombinerParameterfNV, CombinerParameterfNV@8) - GL_STUB(CombinerParameterfvNV, _gloffset_CombinerParameterfvNV, CombinerParameterfvNV@8) - GL_STUB(CombinerParameteriNV, _gloffset_CombinerParameteriNV, CombinerParameteriNV@8) - GL_STUB(CombinerParameterivNV, _gloffset_CombinerParameterivNV, CombinerParameterivNV@8) - GL_STUB(FinalCombinerInputNV, _gloffset_FinalCombinerInputNV, FinalCombinerInputNV@16) - GL_STUB(GetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV, GetCombinerInputParameterfvNV@20) - GL_STUB(GetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV, GetCombinerInputParameterivNV@20) - GL_STUB(GetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV, GetCombinerOutputParameterfvNV@16) - GL_STUB(GetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV, GetCombinerOutputParameterivNV@16) - GL_STUB(GetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV, GetFinalCombinerInputParameterfvNV@12) - GL_STUB(GetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV, GetFinalCombinerInputParameterivNV@12) - GL_STUB(ResizeBuffersMESA, _gloffset_ResizeBuffersMESA, ResizeBuffersMESA@0) - GL_STUB(WindowPos2dMESA, _gloffset_WindowPos2dMESA, WindowPos2dMESA@16) - GL_STUB(WindowPos2dvMESA, _gloffset_WindowPos2dvMESA, WindowPos2dvMESA@4) - GL_STUB(WindowPos2fMESA, _gloffset_WindowPos2fMESA, WindowPos2fMESA@8) - GL_STUB(WindowPos2fvMESA, _gloffset_WindowPos2fvMESA, WindowPos2fvMESA@4) - GL_STUB(WindowPos2iMESA, _gloffset_WindowPos2iMESA, WindowPos2iMESA@8) - GL_STUB(WindowPos2ivMESA, _gloffset_WindowPos2ivMESA, WindowPos2ivMESA@4) - GL_STUB(WindowPos2sMESA, _gloffset_WindowPos2sMESA, WindowPos2sMESA@8) - GL_STUB(WindowPos2svMESA, _gloffset_WindowPos2svMESA, WindowPos2svMESA@4) - GL_STUB(WindowPos3dMESA, _gloffset_WindowPos3dMESA, WindowPos3dMESA@24) - GL_STUB(WindowPos3dvMESA, _gloffset_WindowPos3dvMESA, WindowPos3dvMESA@4) - GL_STUB(WindowPos3fMESA, _gloffset_WindowPos3fMESA, WindowPos3fMESA@12) - GL_STUB(WindowPos3fvMESA, _gloffset_WindowPos3fvMESA, WindowPos3fvMESA@4) - GL_STUB(WindowPos3iMESA, _gloffset_WindowPos3iMESA, WindowPos3iMESA@12) - GL_STUB(WindowPos3ivMESA, _gloffset_WindowPos3ivMESA, WindowPos3ivMESA@4) - GL_STUB(WindowPos3sMESA, _gloffset_WindowPos3sMESA, WindowPos3sMESA@12) - GL_STUB(WindowPos3svMESA, _gloffset_WindowPos3svMESA, WindowPos3svMESA@4) - GL_STUB(WindowPos4dMESA, _gloffset_WindowPos4dMESA, WindowPos4dMESA@32) - GL_STUB(WindowPos4dvMESA, _gloffset_WindowPos4dvMESA, WindowPos4dvMESA@4) - GL_STUB(WindowPos4fMESA, _gloffset_WindowPos4fMESA, WindowPos4fMESA@16) - GL_STUB(WindowPos4fvMESA, _gloffset_WindowPos4fvMESA, WindowPos4fvMESA@4) - GL_STUB(WindowPos4iMESA, _gloffset_WindowPos4iMESA, WindowPos4iMESA@16) - GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4) - GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16) - GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4) - GL_STUB(_dispatch_stub_648, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_648@20) - HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@20)) - GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_649@24) - HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@24)) - GL_STUB(_dispatch_stub_650, _gloffset_DeleteFencesNV, _dispatch_stub_650@8) - HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8)) - GL_STUB(_dispatch_stub_651, _gloffset_FinishFenceNV, _dispatch_stub_651@4) - HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@4)) - GL_STUB(_dispatch_stub_652, _gloffset_GenFencesNV, _dispatch_stub_652@8) - HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8)) - GL_STUB(_dispatch_stub_653, _gloffset_GetFenceivNV, _dispatch_stub_653@12) - HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@12)) - GL_STUB(_dispatch_stub_654, _gloffset_IsFenceNV, _dispatch_stub_654@4) - HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4)) - GL_STUB(_dispatch_stub_655, _gloffset_SetFenceNV, _dispatch_stub_655@8) - HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@8)) - GL_STUB(_dispatch_stub_656, _gloffset_TestFenceNV, _dispatch_stub_656@4) - HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@4)) - GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12) - GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8) - GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8) - GL_STUB(ExecuteProgramNV, _gloffset_ExecuteProgramNV, ExecuteProgramNV@12) - GL_STUB(GenProgramsNV, _gloffset_GenProgramsNV, GenProgramsNV@8) - GL_STUB(GetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV, GetProgramParameterdvNV@16) - GL_STUB(GetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV, GetProgramParameterfvNV@16) - GL_STUB(GetProgramStringNV, _gloffset_GetProgramStringNV, GetProgramStringNV@12) - GL_STUB(GetProgramivNV, _gloffset_GetProgramivNV, GetProgramivNV@12) - GL_STUB(GetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV, GetTrackMatrixivNV@16) - GL_STUB(GetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV, GetVertexAttribPointervNV@12) - GL_STUB(GetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV, GetVertexAttribdvNV@12) - GL_STUB(GetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV, GetVertexAttribfvNV@12) - GL_STUB(GetVertexAttribivNV, _gloffset_GetVertexAttribivNV, GetVertexAttribivNV@12) - GL_STUB(IsProgramNV, _gloffset_IsProgramNV, IsProgramNV@4) - GL_STUB(LoadProgramNV, _gloffset_LoadProgramNV, LoadProgramNV@16) - GL_STUB(ProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV, ProgramParameters4dvNV@16) - GL_STUB(ProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV, ProgramParameters4fvNV@16) - GL_STUB(RequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV, RequestResidentProgramsNV@8) - GL_STUB(TrackMatrixNV, _gloffset_TrackMatrixNV, TrackMatrixNV@16) - GL_STUB(VertexAttrib1dNV, _gloffset_VertexAttrib1dNV, VertexAttrib1dNV@12) - GL_STUB(VertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV, VertexAttrib1dvNV@8) - GL_STUB(VertexAttrib1fNV, _gloffset_VertexAttrib1fNV, VertexAttrib1fNV@8) - GL_STUB(VertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV, VertexAttrib1fvNV@8) - GL_STUB(VertexAttrib1sNV, _gloffset_VertexAttrib1sNV, VertexAttrib1sNV@8) - GL_STUB(VertexAttrib1svNV, _gloffset_VertexAttrib1svNV, VertexAttrib1svNV@8) - GL_STUB(VertexAttrib2dNV, _gloffset_VertexAttrib2dNV, VertexAttrib2dNV@20) - GL_STUB(VertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV, VertexAttrib2dvNV@8) - GL_STUB(VertexAttrib2fNV, _gloffset_VertexAttrib2fNV, VertexAttrib2fNV@12) - GL_STUB(VertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV, VertexAttrib2fvNV@8) - GL_STUB(VertexAttrib2sNV, _gloffset_VertexAttrib2sNV, VertexAttrib2sNV@12) - GL_STUB(VertexAttrib2svNV, _gloffset_VertexAttrib2svNV, VertexAttrib2svNV@8) - GL_STUB(VertexAttrib3dNV, _gloffset_VertexAttrib3dNV, VertexAttrib3dNV@28) - GL_STUB(VertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV, VertexAttrib3dvNV@8) - GL_STUB(VertexAttrib3fNV, _gloffset_VertexAttrib3fNV, VertexAttrib3fNV@16) - GL_STUB(VertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV, VertexAttrib3fvNV@8) - GL_STUB(VertexAttrib3sNV, _gloffset_VertexAttrib3sNV, VertexAttrib3sNV@16) - GL_STUB(VertexAttrib3svNV, _gloffset_VertexAttrib3svNV, VertexAttrib3svNV@8) - GL_STUB(VertexAttrib4dNV, _gloffset_VertexAttrib4dNV, VertexAttrib4dNV@36) - GL_STUB(VertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV, VertexAttrib4dvNV@8) - GL_STUB(VertexAttrib4fNV, _gloffset_VertexAttrib4fNV, VertexAttrib4fNV@20) - GL_STUB(VertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV, VertexAttrib4fvNV@8) - GL_STUB(VertexAttrib4sNV, _gloffset_VertexAttrib4sNV, VertexAttrib4sNV@20) - GL_STUB(VertexAttrib4svNV, _gloffset_VertexAttrib4svNV, VertexAttrib4svNV@8) - GL_STUB(VertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV, VertexAttrib4ubNV@20) - GL_STUB(VertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV, VertexAttrib4ubvNV@8) - GL_STUB(VertexAttribPointerNV, _gloffset_VertexAttribPointerNV, VertexAttribPointerNV@20) - GL_STUB(VertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV, VertexAttribs1dvNV@12) - GL_STUB(VertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV, VertexAttribs1fvNV@12) - GL_STUB(VertexAttribs1svNV, _gloffset_VertexAttribs1svNV, VertexAttribs1svNV@12) - GL_STUB(VertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV, VertexAttribs2dvNV@12) - GL_STUB(VertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV, VertexAttribs2fvNV@12) - GL_STUB(VertexAttribs2svNV, _gloffset_VertexAttribs2svNV, VertexAttribs2svNV@12) - GL_STUB(VertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV, VertexAttribs3dvNV@12) - GL_STUB(VertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV, VertexAttribs3fvNV@12) - GL_STUB(VertexAttribs3svNV, _gloffset_VertexAttribs3svNV, VertexAttribs3svNV@12) - GL_STUB(VertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV, VertexAttribs4dvNV@12) - GL_STUB(VertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV, VertexAttribs4fvNV@12) - GL_STUB(VertexAttribs4svNV, _gloffset_VertexAttribs4svNV, VertexAttribs4svNV@12) - GL_STUB(VertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV, VertexAttribs4ubvNV@12) - GL_STUB(AlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI, AlphaFragmentOp1ATI@24) - GL_STUB(AlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI, AlphaFragmentOp2ATI@36) - GL_STUB(AlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI, AlphaFragmentOp3ATI@48) - GL_STUB(BeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI, BeginFragmentShaderATI@0) - GL_STUB(BindFragmentShaderATI, _gloffset_BindFragmentShaderATI, BindFragmentShaderATI@4) - GL_STUB(ColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI, ColorFragmentOp1ATI@28) - GL_STUB(ColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI, ColorFragmentOp2ATI@40) - GL_STUB(ColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI, ColorFragmentOp3ATI@52) - GL_STUB(DeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI, DeleteFragmentShaderATI@4) - GL_STUB(EndFragmentShaderATI, _gloffset_EndFragmentShaderATI, EndFragmentShaderATI@0) - GL_STUB(GenFragmentShadersATI, _gloffset_GenFragmentShadersATI, GenFragmentShadersATI@4) - GL_STUB(PassTexCoordATI, _gloffset_PassTexCoordATI, PassTexCoordATI@12) - GL_STUB(SampleMapATI, _gloffset_SampleMapATI, SampleMapATI@12) - GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8) - GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8) - GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8) - GL_STUB(_dispatch_stub_733, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_733@4) - HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@4)) - GL_STUB(_dispatch_stub_734, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_734@4) - HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4)) - GL_STUB(_dispatch_stub_735, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_735@8) - HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8)) - GL_STUB(_dispatch_stub_736, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_736@8) - HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8)) - GL_STUB(_dispatch_stub_737, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_737@4) - HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4)) - GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16) - GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16) - GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44) - GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16) - GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28) - GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16) - GL_STUB(_dispatch_stub_744, _gloffset_DepthBoundsEXT, _dispatch_stub_744@16) - HIDDEN(GL_PREFIX(_dispatch_stub_744, _dispatch_stub_744@16)) - GL_STUB(_dispatch_stub_745, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_745@8) - HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@8)) - GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8) - GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8) - GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) - GL_STUB(DeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT, DeleteFramebuffersEXT@8) - GL_STUB(DeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8) - GL_STUB(FramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16) - GL_STUB(FramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT, FramebufferTexture1DEXT@20) - GL_STUB(FramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT, FramebufferTexture2DEXT@20) - GL_STUB(FramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT, FramebufferTexture3DEXT@24) - GL_STUB(GenFramebuffersEXT, _gloffset_GenFramebuffersEXT, GenFramebuffersEXT@8) - GL_STUB(GenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT, GenRenderbuffersEXT@8) - GL_STUB(GenerateMipmapEXT, _gloffset_GenerateMipmapEXT, GenerateMipmapEXT@4) - GL_STUB(GetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16) - GL_STUB(GetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12) - GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4) - GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4) - GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16) - GL_STUB(_dispatch_stub_763, _gloffset_BlitFramebufferEXT, _dispatch_stub_763@40) - HIDDEN(GL_PREFIX(_dispatch_stub_763, _dispatch_stub_763@40)) - GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) - GL_STUB(_dispatch_stub_765, _gloffset_StencilFuncSeparateATI, _dispatch_stub_765@16) - HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@16)) - GL_STUB(_dispatch_stub_766, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_766@16) - HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16)) - GL_STUB(_dispatch_stub_767, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_767@16) - HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16)) - GL_STUB(_dispatch_stub_768, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_768@12) - HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@12)) - GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_769@12) - HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@12)) - GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) - GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) - GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(AreTexturesResidentEXT, _gloffset_AreTexturesResident, AreTexturesResidentEXT@12, AreTexturesResident, AreTexturesResident@12) -#endif - GL_STUB_ALIAS(CopyTexImage1DEXT, _gloffset_CopyTexImage1D, CopyTexImage1DEXT@28, CopyTexImage1D, CopyTexImage1D@28) - GL_STUB_ALIAS(CopyTexImage2DEXT, _gloffset_CopyTexImage2D, CopyTexImage2DEXT@32, CopyTexImage2D, CopyTexImage2D@32) - GL_STUB_ALIAS(CopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D, CopyTexSubImage1DEXT@24, CopyTexSubImage1D, CopyTexSubImage1D@24) - GL_STUB_ALIAS(CopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D, CopyTexSubImage2DEXT@32, CopyTexSubImage2D, CopyTexSubImage2D@32) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(DeleteTexturesEXT, _gloffset_DeleteTextures, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GenTexturesEXT, _gloffset_GenTextures, GenTexturesEXT@8, GenTextures, GenTextures@8) -#endif - GL_STUB_ALIAS(GetPointervEXT, _gloffset_GetPointerv, GetPointervEXT@8, GetPointerv, GetPointerv@8) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(IsTextureEXT, _gloffset_IsTexture, IsTextureEXT@4, IsTexture, IsTexture@4) -#endif - GL_STUB_ALIAS(PrioritizeTexturesEXT, _gloffset_PrioritizeTextures, PrioritizeTexturesEXT@12, PrioritizeTextures, PrioritizeTextures@12) - GL_STUB_ALIAS(TexSubImage1DEXT, _gloffset_TexSubImage1D, TexSubImage1DEXT@28, TexSubImage1D, TexSubImage1D@28) - GL_STUB_ALIAS(TexSubImage2DEXT, _gloffset_TexSubImage2D, TexSubImage2DEXT@36, TexSubImage2D, TexSubImage2D@36) - GL_STUB_ALIAS(BlendColorEXT, _gloffset_BlendColor, BlendColorEXT@16, BlendColor, BlendColor@16) - GL_STUB_ALIAS(BlendEquationEXT, _gloffset_BlendEquation, BlendEquationEXT@4, BlendEquation, BlendEquation@4) - GL_STUB_ALIAS(DrawRangeElementsEXT, _gloffset_DrawRangeElements, DrawRangeElementsEXT@24, DrawRangeElements, DrawRangeElements@24) - GL_STUB_ALIAS(ColorTableSGI, _gloffset_ColorTable, ColorTableSGI@24, ColorTable, ColorTable@24) - GL_STUB_ALIAS(ColorTableEXT, _gloffset_ColorTable, ColorTableEXT@24, ColorTable, ColorTable@24) - GL_STUB_ALIAS(ColorTableParameterfvSGI, _gloffset_ColorTableParameterfv, ColorTableParameterfvSGI@12, ColorTableParameterfv, ColorTableParameterfv@12) - GL_STUB_ALIAS(ColorTableParameterivSGI, _gloffset_ColorTableParameteriv, ColorTableParameterivSGI@12, ColorTableParameteriv, ColorTableParameteriv@12) - GL_STUB_ALIAS(CopyColorTableSGI, _gloffset_CopyColorTable, CopyColorTableSGI@20, CopyColorTable, CopyColorTable@20) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableSGI, _gloffset_GetColorTable, GetColorTableSGI@16, GetColorTable, GetColorTable@16) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableEXT, _gloffset_GetColorTable, GetColorTableEXT@16, GetColorTable, GetColorTable@16) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvSGI@12, GetColorTableParameterfv, GetColorTableParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterivSGI, _gloffset_GetColorTableParameteriv, GetColorTableParameterivSGI@12, GetColorTableParameteriv, GetColorTableParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12) -#endif - GL_STUB_ALIAS(ColorSubTableEXT, _gloffset_ColorSubTable, ColorSubTableEXT@24, ColorSubTable, ColorSubTable@24) - GL_STUB_ALIAS(CopyColorSubTableEXT, _gloffset_CopyColorSubTable, CopyColorSubTableEXT@20, CopyColorSubTable, CopyColorSubTable@20) - GL_STUB_ALIAS(ConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D, ConvolutionFilter1DEXT@24, ConvolutionFilter1D, ConvolutionFilter1D@24) - GL_STUB_ALIAS(ConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D, ConvolutionFilter2DEXT@28, ConvolutionFilter2D, ConvolutionFilter2D@28) - GL_STUB_ALIAS(ConvolutionParameterfEXT, _gloffset_ConvolutionParameterf, ConvolutionParameterfEXT@12, ConvolutionParameterf, ConvolutionParameterf@12) - GL_STUB_ALIAS(ConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv, ConvolutionParameterfvEXT@12, ConvolutionParameterfv, ConvolutionParameterfv@12) - GL_STUB_ALIAS(ConvolutionParameteriEXT, _gloffset_ConvolutionParameteri, ConvolutionParameteriEXT@12, ConvolutionParameteri, ConvolutionParameteri@12) - GL_STUB_ALIAS(ConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv, ConvolutionParameterivEXT@12, ConvolutionParameteriv, ConvolutionParameteriv@12) - GL_STUB_ALIAS(CopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1DEXT@20, CopyConvolutionFilter1D, CopyConvolutionFilter1D@20) - GL_STUB_ALIAS(CopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2DEXT@24, CopyConvolutionFilter2D, CopyConvolutionFilter2D@24) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionFilterEXT, _gloffset_GetConvolutionFilter, GetConvolutionFilterEXT@16, GetConvolutionFilter, GetConvolutionFilter@16) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfvEXT@12, GetConvolutionParameterfv, GetConvolutionParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetConvolutionParameterivEXT, _gloffset_GetConvolutionParameteriv, GetConvolutionParameterivEXT@12, GetConvolutionParameteriv, GetConvolutionParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetSeparableFilterEXT, _gloffset_GetSeparableFilter, GetSeparableFilterEXT@24, GetSeparableFilter, GetSeparableFilter@24) -#endif - GL_STUB_ALIAS(SeparableFilter2DEXT, _gloffset_SeparableFilter2D, SeparableFilter2DEXT@32, SeparableFilter2D, SeparableFilter2D@32) -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramEXT, _gloffset_GetHistogram, GetHistogramEXT@20, GetHistogram, GetHistogram@20) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfv, GetHistogramParameterfvEXT@12, GetHistogramParameterfv, GetHistogramParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetHistogramParameterivEXT, _gloffset_GetHistogramParameteriv, GetHistogramParameterivEXT@12, GetHistogramParameteriv, GetHistogramParameteriv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxEXT, _gloffset_GetMinmax, GetMinmaxEXT@20, GetMinmax, GetMinmax@20) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfvEXT@12, GetMinmaxParameterfv, GetMinmaxParameterfv@12) -#endif -#ifndef GLX_INDIRECT_RENDERING - GL_STUB_ALIAS(GetMinmaxParameterivEXT, _gloffset_GetMinmaxParameteriv, GetMinmaxParameterivEXT@12, GetMinmaxParameteriv, GetMinmaxParameteriv@12) -#endif - GL_STUB_ALIAS(HistogramEXT, _gloffset_Histogram, HistogramEXT@16, Histogram, Histogram@16) - GL_STUB_ALIAS(MinmaxEXT, _gloffset_Minmax, MinmaxEXT@12, Minmax, Minmax@12) - GL_STUB_ALIAS(ResetHistogramEXT, _gloffset_ResetHistogram, ResetHistogramEXT@4, ResetHistogram, ResetHistogram@4) - GL_STUB_ALIAS(ResetMinmaxEXT, _gloffset_ResetMinmax, ResetMinmaxEXT@4, ResetMinmax, ResetMinmax@4) - GL_STUB_ALIAS(TexImage3DEXT, _gloffset_TexImage3D, TexImage3DEXT@40, TexImage3D, TexImage3D@40) - GL_STUB_ALIAS(TexSubImage3DEXT, _gloffset_TexSubImage3D, TexSubImage3DEXT@44, TexSubImage3D, TexSubImage3D@44) - GL_STUB_ALIAS(CopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D, CopyTexSubImage3DEXT@36, CopyTexSubImage3D, CopyTexSubImage3D@36) - GL_STUB_ALIAS(ActiveTexture, _gloffset_ActiveTextureARB, ActiveTexture@4, ActiveTextureARB, ActiveTextureARB@4) - GL_STUB_ALIAS(ClientActiveTexture, _gloffset_ClientActiveTextureARB, ClientActiveTexture@4, ClientActiveTextureARB, ClientActiveTextureARB@4) - GL_STUB_ALIAS(MultiTexCoord1d, _gloffset_MultiTexCoord1dARB, MultiTexCoord1d@12, MultiTexCoord1dARB, MultiTexCoord1dARB@12) - GL_STUB_ALIAS(MultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB, MultiTexCoord1dv@8, MultiTexCoord1dvARB, MultiTexCoord1dvARB@8) - GL_STUB_ALIAS(MultiTexCoord1f, _gloffset_MultiTexCoord1fARB, MultiTexCoord1f@8, MultiTexCoord1fARB, MultiTexCoord1fARB@8) - GL_STUB_ALIAS(MultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB, MultiTexCoord1fv@8, MultiTexCoord1fvARB, MultiTexCoord1fvARB@8) - GL_STUB_ALIAS(MultiTexCoord1i, _gloffset_MultiTexCoord1iARB, MultiTexCoord1i@8, MultiTexCoord1iARB, MultiTexCoord1iARB@8) - GL_STUB_ALIAS(MultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB, MultiTexCoord1iv@8, MultiTexCoord1ivARB, MultiTexCoord1ivARB@8) - GL_STUB_ALIAS(MultiTexCoord1s, _gloffset_MultiTexCoord1sARB, MultiTexCoord1s@8, MultiTexCoord1sARB, MultiTexCoord1sARB@8) - GL_STUB_ALIAS(MultiTexCoord1sv, _gloffset_MultiTexCoord1svARB, MultiTexCoord1sv@8, MultiTexCoord1svARB, MultiTexCoord1svARB@8) - GL_STUB_ALIAS(MultiTexCoord2d, _gloffset_MultiTexCoord2dARB, MultiTexCoord2d@20, MultiTexCoord2dARB, MultiTexCoord2dARB@20) - GL_STUB_ALIAS(MultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB, MultiTexCoord2dv@8, MultiTexCoord2dvARB, MultiTexCoord2dvARB@8) - GL_STUB_ALIAS(MultiTexCoord2f, _gloffset_MultiTexCoord2fARB, MultiTexCoord2f@12, MultiTexCoord2fARB, MultiTexCoord2fARB@12) - GL_STUB_ALIAS(MultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB, MultiTexCoord2fv@8, MultiTexCoord2fvARB, MultiTexCoord2fvARB@8) - GL_STUB_ALIAS(MultiTexCoord2i, _gloffset_MultiTexCoord2iARB, MultiTexCoord2i@12, MultiTexCoord2iARB, MultiTexCoord2iARB@12) - GL_STUB_ALIAS(MultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB, MultiTexCoord2iv@8, MultiTexCoord2ivARB, MultiTexCoord2ivARB@8) - GL_STUB_ALIAS(MultiTexCoord2s, _gloffset_MultiTexCoord2sARB, MultiTexCoord2s@12, MultiTexCoord2sARB, MultiTexCoord2sARB@12) - GL_STUB_ALIAS(MultiTexCoord2sv, _gloffset_MultiTexCoord2svARB, MultiTexCoord2sv@8, MultiTexCoord2svARB, MultiTexCoord2svARB@8) - GL_STUB_ALIAS(MultiTexCoord3d, _gloffset_MultiTexCoord3dARB, MultiTexCoord3d@28, MultiTexCoord3dARB, MultiTexCoord3dARB@28) - GL_STUB_ALIAS(MultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB, MultiTexCoord3dv@8, MultiTexCoord3dvARB, MultiTexCoord3dvARB@8) - GL_STUB_ALIAS(MultiTexCoord3f, _gloffset_MultiTexCoord3fARB, MultiTexCoord3f@16, MultiTexCoord3fARB, MultiTexCoord3fARB@16) - GL_STUB_ALIAS(MultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB, MultiTexCoord3fv@8, MultiTexCoord3fvARB, MultiTexCoord3fvARB@8) - GL_STUB_ALIAS(MultiTexCoord3i, _gloffset_MultiTexCoord3iARB, MultiTexCoord3i@16, MultiTexCoord3iARB, MultiTexCoord3iARB@16) - GL_STUB_ALIAS(MultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB, MultiTexCoord3iv@8, MultiTexCoord3ivARB, MultiTexCoord3ivARB@8) - GL_STUB_ALIAS(MultiTexCoord3s, _gloffset_MultiTexCoord3sARB, MultiTexCoord3s@16, MultiTexCoord3sARB, MultiTexCoord3sARB@16) - GL_STUB_ALIAS(MultiTexCoord3sv, _gloffset_MultiTexCoord3svARB, MultiTexCoord3sv@8, MultiTexCoord3svARB, MultiTexCoord3svARB@8) - GL_STUB_ALIAS(MultiTexCoord4d, _gloffset_MultiTexCoord4dARB, MultiTexCoord4d@36, MultiTexCoord4dARB, MultiTexCoord4dARB@36) - GL_STUB_ALIAS(MultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB, MultiTexCoord4dv@8, MultiTexCoord4dvARB, MultiTexCoord4dvARB@8) - GL_STUB_ALIAS(MultiTexCoord4f, _gloffset_MultiTexCoord4fARB, MultiTexCoord4f@20, MultiTexCoord4fARB, MultiTexCoord4fARB@20) - GL_STUB_ALIAS(MultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB, MultiTexCoord4fv@8, MultiTexCoord4fvARB, MultiTexCoord4fvARB@8) - GL_STUB_ALIAS(MultiTexCoord4i, _gloffset_MultiTexCoord4iARB, MultiTexCoord4i@20, MultiTexCoord4iARB, MultiTexCoord4iARB@20) - GL_STUB_ALIAS(MultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4iv@8, MultiTexCoord4ivARB, MultiTexCoord4ivARB@8) - GL_STUB_ALIAS(MultiTexCoord4s, _gloffset_MultiTexCoord4sARB, MultiTexCoord4s@20, MultiTexCoord4sARB, MultiTexCoord4sARB@20) - GL_STUB_ALIAS(MultiTexCoord4sv, _gloffset_MultiTexCoord4svARB, MultiTexCoord4sv@8, MultiTexCoord4svARB, MultiTexCoord4svARB@8) - GL_STUB_ALIAS(StencilOpSeparateATI, _gloffset_StencilOpSeparate, StencilOpSeparateATI@16, StencilOpSeparate, StencilOpSeparate@16) - GL_STUB_ALIAS(LoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixd@4, LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4) - GL_STUB_ALIAS(LoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixf@4, LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4) - GL_STUB_ALIAS(MultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixd@4, MultTransposeMatrixdARB, MultTransposeMatrixdARB@4) - GL_STUB_ALIAS(MultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB, MultTransposeMatrixf@4, MultTransposeMatrixfARB, MultTransposeMatrixfARB@4) - GL_STUB_ALIAS(SampleCoverage, _gloffset_SampleCoverageARB, SampleCoverage@8, SampleCoverageARB, SampleCoverageARB@8) - GL_STUB_ALIAS(CompressedTexImage1D, _gloffset_CompressedTexImage1DARB, CompressedTexImage1D@28, CompressedTexImage1DARB, CompressedTexImage1DARB@28) - GL_STUB_ALIAS(CompressedTexImage2D, _gloffset_CompressedTexImage2DARB, CompressedTexImage2D@32, CompressedTexImage2DARB, CompressedTexImage2DARB@32) - GL_STUB_ALIAS(CompressedTexImage3D, _gloffset_CompressedTexImage3DARB, CompressedTexImage3D@36, CompressedTexImage3DARB, CompressedTexImage3DARB@36) - GL_STUB_ALIAS(CompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB, CompressedTexSubImage1D@28, CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28) - GL_STUB_ALIAS(CompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36) - GL_STUB_ALIAS(CompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44) - GL_STUB_ALIAS(GetCompressedTexImage, _gloffset_GetCompressedTexImageARB, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12) - GL_STUB_ALIAS(DisableVertexAttribArray, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4) - GL_STUB_ALIAS(EnableVertexAttribArray, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4) - GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12) - GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12) - GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12) - GL_STUB_ALIAS(ProgramParameter4dNV, _gloffset_ProgramEnvParameter4dARB, ProgramParameter4dNV@40, ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40) - GL_STUB_ALIAS(ProgramParameter4dvNV, _gloffset_ProgramEnvParameter4dvARB, ProgramParameter4dvNV@12, ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12) - GL_STUB_ALIAS(ProgramParameter4fNV, _gloffset_ProgramEnvParameter4fARB, ProgramParameter4fNV@24, ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24) - GL_STUB_ALIAS(ProgramParameter4fvNV, _gloffset_ProgramEnvParameter4fvARB, ProgramParameter4fvNV@12, ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12) - GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12) - GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8) - GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8) - GL_STUB_ALIAS(VertexAttrib1fv, _gloffset_VertexAttrib1fvARB, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8) - GL_STUB_ALIAS(VertexAttrib1s, _gloffset_VertexAttrib1sARB, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8) - GL_STUB_ALIAS(VertexAttrib1sv, _gloffset_VertexAttrib1svARB, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8) - GL_STUB_ALIAS(VertexAttrib2d, _gloffset_VertexAttrib2dARB, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20) - GL_STUB_ALIAS(VertexAttrib2dv, _gloffset_VertexAttrib2dvARB, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8) - GL_STUB_ALIAS(VertexAttrib2f, _gloffset_VertexAttrib2fARB, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12) - GL_STUB_ALIAS(VertexAttrib2fv, _gloffset_VertexAttrib2fvARB, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8) - GL_STUB_ALIAS(VertexAttrib2s, _gloffset_VertexAttrib2sARB, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12) - GL_STUB_ALIAS(VertexAttrib2sv, _gloffset_VertexAttrib2svARB, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8) - GL_STUB_ALIAS(VertexAttrib3d, _gloffset_VertexAttrib3dARB, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28) - GL_STUB_ALIAS(VertexAttrib3dv, _gloffset_VertexAttrib3dvARB, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8) - GL_STUB_ALIAS(VertexAttrib3f, _gloffset_VertexAttrib3fARB, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16) - GL_STUB_ALIAS(VertexAttrib3fv, _gloffset_VertexAttrib3fvARB, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8) - GL_STUB_ALIAS(VertexAttrib3s, _gloffset_VertexAttrib3sARB, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16) - GL_STUB_ALIAS(VertexAttrib3sv, _gloffset_VertexAttrib3svARB, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8) - GL_STUB_ALIAS(VertexAttrib4Nbv, _gloffset_VertexAttrib4NbvARB, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8) - GL_STUB_ALIAS(VertexAttrib4Niv, _gloffset_VertexAttrib4NivARB, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8) - GL_STUB_ALIAS(VertexAttrib4Nsv, _gloffset_VertexAttrib4NsvARB, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8) - GL_STUB_ALIAS(VertexAttrib4Nub, _gloffset_VertexAttrib4NubARB, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20) - GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8) - GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8) - GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8) - GL_STUB_ALIAS(VertexAttrib4bv, _gloffset_VertexAttrib4bvARB, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8) - GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36) - GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8) - GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20) - GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8) - GL_STUB_ALIAS(VertexAttrib4iv, _gloffset_VertexAttrib4ivARB, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8) - GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20) - GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8) - GL_STUB_ALIAS(VertexAttrib4ubv, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8) - GL_STUB_ALIAS(VertexAttrib4uiv, _gloffset_VertexAttrib4uivARB, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8) - GL_STUB_ALIAS(VertexAttrib4usv, _gloffset_VertexAttrib4usvARB, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8) - GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24) - GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8) - GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16) - GL_STUB_ALIAS(BufferSubData, _gloffset_BufferSubDataARB, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16) - GL_STUB_ALIAS(DeleteBuffers, _gloffset_DeleteBuffersARB, DeleteBuffers@8, DeleteBuffersARB, DeleteBuffersARB@8) - GL_STUB_ALIAS(GenBuffers, _gloffset_GenBuffersARB, GenBuffers@8, GenBuffersARB, GenBuffersARB@8) - GL_STUB_ALIAS(GetBufferParameteriv, _gloffset_GetBufferParameterivARB, GetBufferParameteriv@12, GetBufferParameterivARB, GetBufferParameterivARB@12) - GL_STUB_ALIAS(GetBufferPointerv, _gloffset_GetBufferPointervARB, GetBufferPointerv@12, GetBufferPointervARB, GetBufferPointervARB@12) - GL_STUB_ALIAS(GetBufferSubData, _gloffset_GetBufferSubDataARB, GetBufferSubData@16, GetBufferSubDataARB, GetBufferSubDataARB@16) - GL_STUB_ALIAS(IsBuffer, _gloffset_IsBufferARB, IsBuffer@4, IsBufferARB, IsBufferARB@4) - GL_STUB_ALIAS(MapBuffer, _gloffset_MapBufferARB, MapBuffer@8, MapBufferARB, MapBufferARB@8) - GL_STUB_ALIAS(UnmapBuffer, _gloffset_UnmapBufferARB, UnmapBuffer@4, UnmapBufferARB, UnmapBufferARB@4) - GL_STUB_ALIAS(BeginQuery, _gloffset_BeginQueryARB, BeginQuery@8, BeginQueryARB, BeginQueryARB@8) - GL_STUB_ALIAS(DeleteQueries, _gloffset_DeleteQueriesARB, DeleteQueries@8, DeleteQueriesARB, DeleteQueriesARB@8) - GL_STUB_ALIAS(EndQuery, _gloffset_EndQueryARB, EndQuery@4, EndQueryARB, EndQueryARB@4) - GL_STUB_ALIAS(GenQueries, _gloffset_GenQueriesARB, GenQueries@8, GenQueriesARB, GenQueriesARB@8) - GL_STUB_ALIAS(GetQueryObjectiv, _gloffset_GetQueryObjectivARB, GetQueryObjectiv@12, GetQueryObjectivARB, GetQueryObjectivARB@12) - GL_STUB_ALIAS(GetQueryObjectuiv, _gloffset_GetQueryObjectuivARB, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12) - GL_STUB_ALIAS(GetQueryiv, _gloffset_GetQueryivARB, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12) - GL_STUB_ALIAS(IsQuery, _gloffset_IsQueryARB, IsQuery@4, IsQueryARB, IsQueryARB@4) - GL_STUB_ALIAS(CompileShader, _gloffset_CompileShaderARB, CompileShader@4, CompileShaderARB, CompileShaderARB@4) - GL_STUB_ALIAS(GetActiveUniform, _gloffset_GetActiveUniformARB, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28) - GL_STUB_ALIAS(GetShaderSource, _gloffset_GetShaderSourceARB, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16) - GL_STUB_ALIAS(GetUniformLocation, _gloffset_GetUniformLocationARB, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8) - GL_STUB_ALIAS(GetUniformfv, _gloffset_GetUniformfvARB, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12) - GL_STUB_ALIAS(GetUniformiv, _gloffset_GetUniformivARB, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12) - GL_STUB_ALIAS(LinkProgram, _gloffset_LinkProgramARB, LinkProgram@4, LinkProgramARB, LinkProgramARB@4) - GL_STUB_ALIAS(ShaderSource, _gloffset_ShaderSourceARB, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16) - GL_STUB_ALIAS(Uniform1f, _gloffset_Uniform1fARB, Uniform1f@8, Uniform1fARB, Uniform1fARB@8) - GL_STUB_ALIAS(Uniform1fv, _gloffset_Uniform1fvARB, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12) - GL_STUB_ALIAS(Uniform1i, _gloffset_Uniform1iARB, Uniform1i@8, Uniform1iARB, Uniform1iARB@8) - GL_STUB_ALIAS(Uniform1iv, _gloffset_Uniform1ivARB, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12) - GL_STUB_ALIAS(Uniform2f, _gloffset_Uniform2fARB, Uniform2f@12, Uniform2fARB, Uniform2fARB@12) - GL_STUB_ALIAS(Uniform2fv, _gloffset_Uniform2fvARB, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12) - GL_STUB_ALIAS(Uniform2i, _gloffset_Uniform2iARB, Uniform2i@12, Uniform2iARB, Uniform2iARB@12) - GL_STUB_ALIAS(Uniform2iv, _gloffset_Uniform2ivARB, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12) - GL_STUB_ALIAS(Uniform3f, _gloffset_Uniform3fARB, Uniform3f@16, Uniform3fARB, Uniform3fARB@16) - GL_STUB_ALIAS(Uniform3fv, _gloffset_Uniform3fvARB, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12) - GL_STUB_ALIAS(Uniform3i, _gloffset_Uniform3iARB, Uniform3i@16, Uniform3iARB, Uniform3iARB@16) - GL_STUB_ALIAS(Uniform3iv, _gloffset_Uniform3ivARB, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12) - GL_STUB_ALIAS(Uniform4f, _gloffset_Uniform4fARB, Uniform4f@20, Uniform4fARB, Uniform4fARB@20) - GL_STUB_ALIAS(Uniform4fv, _gloffset_Uniform4fvARB, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12) - GL_STUB_ALIAS(Uniform4i, _gloffset_Uniform4iARB, Uniform4i@20, Uniform4iARB, Uniform4iARB@20) - GL_STUB_ALIAS(Uniform4iv, _gloffset_Uniform4ivARB, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12) - GL_STUB_ALIAS(UniformMatrix2fv, _gloffset_UniformMatrix2fvARB, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16) - GL_STUB_ALIAS(UniformMatrix3fv, _gloffset_UniformMatrix3fvARB, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16) - GL_STUB_ALIAS(UniformMatrix4fv, _gloffset_UniformMatrix4fvARB, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16) - GL_STUB_ALIAS(UseProgram, _gloffset_UseProgramObjectARB, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4) - GL_STUB_ALIAS(ValidateProgram, _gloffset_ValidateProgramARB, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4) - GL_STUB_ALIAS(BindAttribLocation, _gloffset_BindAttribLocationARB, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12) - GL_STUB_ALIAS(GetActiveAttrib, _gloffset_GetActiveAttribARB, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28) - GL_STUB_ALIAS(GetAttribLocation, _gloffset_GetAttribLocationARB, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8) - GL_STUB_ALIAS(DrawBuffers, _gloffset_DrawBuffersARB, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8) - GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8) - GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8) - GL_STUB_ALIAS(PointParameterfARB, _gloffset_PointParameterfEXT, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8) - GL_STUB_ALIAS(PointParameterfSGIS, _gloffset_PointParameterfEXT, PointParameterfSGIS@8, PointParameterfEXT, PointParameterfEXT@8) - GL_STUB_ALIAS(PointParameterfv, _gloffset_PointParameterfvEXT, PointParameterfv@8, PointParameterfvEXT, PointParameterfvEXT@8) - GL_STUB_ALIAS(PointParameterfvARB, _gloffset_PointParameterfvEXT, PointParameterfvARB@8, PointParameterfvEXT, PointParameterfvEXT@8) - GL_STUB_ALIAS(PointParameterfvSGIS, _gloffset_PointParameterfvEXT, PointParameterfvSGIS@8, PointParameterfvEXT, PointParameterfvEXT@8) - GL_STUB_ALIAS(SecondaryColor3b, _gloffset_SecondaryColor3bEXT, SecondaryColor3b@12, SecondaryColor3bEXT, SecondaryColor3bEXT@12) - GL_STUB_ALIAS(SecondaryColor3bv, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bv@4, SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) - GL_STUB_ALIAS(SecondaryColor3d, _gloffset_SecondaryColor3dEXT, SecondaryColor3d@24, SecondaryColor3dEXT, SecondaryColor3dEXT@24) - GL_STUB_ALIAS(SecondaryColor3dv, _gloffset_SecondaryColor3dvEXT, SecondaryColor3dv@4, SecondaryColor3dvEXT, SecondaryColor3dvEXT@4) - GL_STUB_ALIAS(SecondaryColor3f, _gloffset_SecondaryColor3fEXT, SecondaryColor3f@12, SecondaryColor3fEXT, SecondaryColor3fEXT@12) - GL_STUB_ALIAS(SecondaryColor3fv, _gloffset_SecondaryColor3fvEXT, SecondaryColor3fv@4, SecondaryColor3fvEXT, SecondaryColor3fvEXT@4) - GL_STUB_ALIAS(SecondaryColor3i, _gloffset_SecondaryColor3iEXT, SecondaryColor3i@12, SecondaryColor3iEXT, SecondaryColor3iEXT@12) - GL_STUB_ALIAS(SecondaryColor3iv, _gloffset_SecondaryColor3ivEXT, SecondaryColor3iv@4, SecondaryColor3ivEXT, SecondaryColor3ivEXT@4) - GL_STUB_ALIAS(SecondaryColor3s, _gloffset_SecondaryColor3sEXT, SecondaryColor3s@12, SecondaryColor3sEXT, SecondaryColor3sEXT@12) - GL_STUB_ALIAS(SecondaryColor3sv, _gloffset_SecondaryColor3svEXT, SecondaryColor3sv@4, SecondaryColor3svEXT, SecondaryColor3svEXT@4) - GL_STUB_ALIAS(SecondaryColor3ub, _gloffset_SecondaryColor3ubEXT, SecondaryColor3ub@12, SecondaryColor3ubEXT, SecondaryColor3ubEXT@12) - GL_STUB_ALIAS(SecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT, SecondaryColor3ubv@4, SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4) - GL_STUB_ALIAS(SecondaryColor3ui, _gloffset_SecondaryColor3uiEXT, SecondaryColor3ui@12, SecondaryColor3uiEXT, SecondaryColor3uiEXT@12) - GL_STUB_ALIAS(SecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT, SecondaryColor3uiv@4, SecondaryColor3uivEXT, SecondaryColor3uivEXT@4) - GL_STUB_ALIAS(SecondaryColor3us, _gloffset_SecondaryColor3usEXT, SecondaryColor3us@12, SecondaryColor3usEXT, SecondaryColor3usEXT@12) - GL_STUB_ALIAS(SecondaryColor3usv, _gloffset_SecondaryColor3usvEXT, SecondaryColor3usv@4, SecondaryColor3usvEXT, SecondaryColor3usvEXT@4) - GL_STUB_ALIAS(SecondaryColorPointer, _gloffset_SecondaryColorPointerEXT, SecondaryColorPointer@16, SecondaryColorPointerEXT, SecondaryColorPointerEXT@16) - GL_STUB_ALIAS(MultiDrawArrays, _gloffset_MultiDrawArraysEXT, MultiDrawArrays@16, MultiDrawArraysEXT, MultiDrawArraysEXT@16) - GL_STUB_ALIAS(MultiDrawElements, _gloffset_MultiDrawElementsEXT, MultiDrawElements@20, MultiDrawElementsEXT, MultiDrawElementsEXT@20) - GL_STUB_ALIAS(FogCoordPointer, _gloffset_FogCoordPointerEXT, FogCoordPointer@12, FogCoordPointerEXT, FogCoordPointerEXT@12) - GL_STUB_ALIAS(FogCoordd, _gloffset_FogCoorddEXT, FogCoordd@8, FogCoorddEXT, FogCoorddEXT@8) - GL_STUB_ALIAS(FogCoorddv, _gloffset_FogCoorddvEXT, FogCoorddv@4, FogCoorddvEXT, FogCoorddvEXT@4) - GL_STUB_ALIAS(FogCoordf, _gloffset_FogCoordfEXT, FogCoordf@4, FogCoordfEXT, FogCoordfEXT@4) - GL_STUB_ALIAS(FogCoordfv, _gloffset_FogCoordfvEXT, FogCoordfv@4, FogCoordfvEXT, FogCoordfvEXT@4) - GL_STUB_ALIAS(BlendFuncSeparate, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparate@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) - GL_STUB_ALIAS(BlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateINGR@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) - GL_STUB_ALIAS(WindowPos2d, _gloffset_WindowPos2dMESA, WindowPos2d@16, WindowPos2dMESA, WindowPos2dMESA@16) - GL_STUB_ALIAS(WindowPos2dARB, _gloffset_WindowPos2dMESA, WindowPos2dARB@16, WindowPos2dMESA, WindowPos2dMESA@16) - GL_STUB_ALIAS(WindowPos2dv, _gloffset_WindowPos2dvMESA, WindowPos2dv@4, WindowPos2dvMESA, WindowPos2dvMESA@4) - GL_STUB_ALIAS(WindowPos2dvARB, _gloffset_WindowPos2dvMESA, WindowPos2dvARB@4, WindowPos2dvMESA, WindowPos2dvMESA@4) - GL_STUB_ALIAS(WindowPos2f, _gloffset_WindowPos2fMESA, WindowPos2f@8, WindowPos2fMESA, WindowPos2fMESA@8) - GL_STUB_ALIAS(WindowPos2fARB, _gloffset_WindowPos2fMESA, WindowPos2fARB@8, WindowPos2fMESA, WindowPos2fMESA@8) - GL_STUB_ALIAS(WindowPos2fv, _gloffset_WindowPos2fvMESA, WindowPos2fv@4, WindowPos2fvMESA, WindowPos2fvMESA@4) - GL_STUB_ALIAS(WindowPos2fvARB, _gloffset_WindowPos2fvMESA, WindowPos2fvARB@4, WindowPos2fvMESA, WindowPos2fvMESA@4) - GL_STUB_ALIAS(WindowPos2i, _gloffset_WindowPos2iMESA, WindowPos2i@8, WindowPos2iMESA, WindowPos2iMESA@8) - GL_STUB_ALIAS(WindowPos2iARB, _gloffset_WindowPos2iMESA, WindowPos2iARB@8, WindowPos2iMESA, WindowPos2iMESA@8) - GL_STUB_ALIAS(WindowPos2iv, _gloffset_WindowPos2ivMESA, WindowPos2iv@4, WindowPos2ivMESA, WindowPos2ivMESA@4) - GL_STUB_ALIAS(WindowPos2ivARB, _gloffset_WindowPos2ivMESA, WindowPos2ivARB@4, WindowPos2ivMESA, WindowPos2ivMESA@4) - GL_STUB_ALIAS(WindowPos2s, _gloffset_WindowPos2sMESA, WindowPos2s@8, WindowPos2sMESA, WindowPos2sMESA@8) - GL_STUB_ALIAS(WindowPos2sARB, _gloffset_WindowPos2sMESA, WindowPos2sARB@8, WindowPos2sMESA, WindowPos2sMESA@8) - GL_STUB_ALIAS(WindowPos2sv, _gloffset_WindowPos2svMESA, WindowPos2sv@4, WindowPos2svMESA, WindowPos2svMESA@4) - GL_STUB_ALIAS(WindowPos2svARB, _gloffset_WindowPos2svMESA, WindowPos2svARB@4, WindowPos2svMESA, WindowPos2svMESA@4) - GL_STUB_ALIAS(WindowPos3d, _gloffset_WindowPos3dMESA, WindowPos3d@24, WindowPos3dMESA, WindowPos3dMESA@24) - GL_STUB_ALIAS(WindowPos3dARB, _gloffset_WindowPos3dMESA, WindowPos3dARB@24, WindowPos3dMESA, WindowPos3dMESA@24) - GL_STUB_ALIAS(WindowPos3dv, _gloffset_WindowPos3dvMESA, WindowPos3dv@4, WindowPos3dvMESA, WindowPos3dvMESA@4) - GL_STUB_ALIAS(WindowPos3dvARB, _gloffset_WindowPos3dvMESA, WindowPos3dvARB@4, WindowPos3dvMESA, WindowPos3dvMESA@4) - GL_STUB_ALIAS(WindowPos3f, _gloffset_WindowPos3fMESA, WindowPos3f@12, WindowPos3fMESA, WindowPos3fMESA@12) - GL_STUB_ALIAS(WindowPos3fARB, _gloffset_WindowPos3fMESA, WindowPos3fARB@12, WindowPos3fMESA, WindowPos3fMESA@12) - GL_STUB_ALIAS(WindowPos3fv, _gloffset_WindowPos3fvMESA, WindowPos3fv@4, WindowPos3fvMESA, WindowPos3fvMESA@4) - GL_STUB_ALIAS(WindowPos3fvARB, _gloffset_WindowPos3fvMESA, WindowPos3fvARB@4, WindowPos3fvMESA, WindowPos3fvMESA@4) - GL_STUB_ALIAS(WindowPos3i, _gloffset_WindowPos3iMESA, WindowPos3i@12, WindowPos3iMESA, WindowPos3iMESA@12) - GL_STUB_ALIAS(WindowPos3iARB, _gloffset_WindowPos3iMESA, WindowPos3iARB@12, WindowPos3iMESA, WindowPos3iMESA@12) - GL_STUB_ALIAS(WindowPos3iv, _gloffset_WindowPos3ivMESA, WindowPos3iv@4, WindowPos3ivMESA, WindowPos3ivMESA@4) - GL_STUB_ALIAS(WindowPos3ivARB, _gloffset_WindowPos3ivMESA, WindowPos3ivARB@4, WindowPos3ivMESA, WindowPos3ivMESA@4) - GL_STUB_ALIAS(WindowPos3s, _gloffset_WindowPos3sMESA, WindowPos3s@12, WindowPos3sMESA, WindowPos3sMESA@12) - GL_STUB_ALIAS(WindowPos3sARB, _gloffset_WindowPos3sMESA, WindowPos3sARB@12, WindowPos3sMESA, WindowPos3sMESA@12) - GL_STUB_ALIAS(WindowPos3sv, _gloffset_WindowPos3svMESA, WindowPos3sv@4, WindowPos3svMESA, WindowPos3svMESA@4) - GL_STUB_ALIAS(WindowPos3svARB, _gloffset_WindowPos3svMESA, WindowPos3svARB@4, WindowPos3svMESA, WindowPos3svMESA@4) - GL_STUB_ALIAS(BindProgramARB, _gloffset_BindProgramNV, BindProgramARB@8, BindProgramNV, BindProgramNV@8) - GL_STUB_ALIAS(DeleteProgramsARB, _gloffset_DeleteProgramsNV, DeleteProgramsARB@8, DeleteProgramsNV, DeleteProgramsNV@8) - GL_STUB_ALIAS(GenProgramsARB, _gloffset_GenProgramsNV, GenProgramsARB@8, GenProgramsNV, GenProgramsNV@8) - GL_STUB_ALIAS(GetVertexAttribPointerv, _gloffset_GetVertexAttribPointervNV, GetVertexAttribPointerv@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12) - GL_STUB_ALIAS(GetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV, GetVertexAttribPointervARB@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12) - GL_STUB_ALIAS(IsProgramARB, _gloffset_IsProgramNV, IsProgramARB@4, IsProgramNV, IsProgramNV@4) - GL_STUB_ALIAS(PointParameteri, _gloffset_PointParameteriNV, PointParameteri@8, PointParameteriNV, PointParameteriNV@8) - GL_STUB_ALIAS(PointParameteriv, _gloffset_PointParameterivNV, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8) - - GLOBL GLNAME(gl_dispatch_functions_end) - HIDDEN(GLNAME(gl_dispatch_functions_end)) - ALIGNTEXT16 -GLNAME(gl_dispatch_functions_end): - -#if defined(GLX_USE_TLS) && defined(__linux__) - .section ".note.ABI-tag", "a" - .p2align 2 - .long 1f - 0f /* name length */ - .long 3f - 2f /* data length */ - .long 1 /* note length */ -0: .asciz "GNU" /* vendor name */ -1: .p2align 2 -2: .long 0 /* note data: the ABI tag */ - .long 2,4,20 /* Minimum kernel version w/TLS */ -3: .p2align 2 /* pad out section */ -#endif /* GLX_USE_TLS */ - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/mmx.h b/src/libs/mesa/mesa/x86/mmx.h deleted file mode 100644 index 5641936bdb..0000000000 --- a/src/libs/mesa/mesa/x86/mmx.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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 ASM_MMX_H -#define ASM_MMX_H - -extern void _ASMAPI -_mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -extern void _ASMAPI -_mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -extern void _ASMAPI -_mesa_mmx_blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -extern void _ASMAPI -_mesa_mmx_blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -extern void _ASMAPI -_mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -#endif diff --git a/src/libs/mesa/mesa/x86/mmx_blend.S b/src/libs/mesa/mesa/x86/mmx_blend.S deleted file mode 100644 index eeaf43ea93..0000000000 --- a/src/libs/mesa/mesa/x86/mmx_blend.S +++ /dev/null @@ -1,402 +0,0 @@ - ; -/* - * Written by Jos� Fonseca - */ - - -#ifdef USE_MMX_ASM -#include "assyntax.h" -#include "matypes.h" - -/* integer multiplication - alpha plus one - * - * makes the following approximation to the division (Sree) - * - * rgb*a/255 ~= (rgb*(a+1)) >> 256 - * - * which is the fastest method that satisfies the following OpenGL criteria - * - * 0*0 = 0 and 255*255 = 255 - * - * note that MX1 is a register with 0xffffffffffffffff constant which can be easily obtained making - * - * PCMPEQW ( MX1, MX1 ) - */ -#define GMB_MULT_AP1( MP1, MA1, MP2, MA2, MX1 ) \ - PSUBW ( MX1, MA1 ) /* a1 + 1 | a1 + 1 | a1 + 1 | a1 + 1 */ ;\ - PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\ - ;\ -TWO(PSUBW ( MX1, MA2 )) /* a2 + 1 | a2 + 1 | a2 + 1 | a2 + 1 */ ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\ - ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 ~= t1/255 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 */ - - -/* integer multiplication - geometric series - * - * takes the geometric series approximation to the division - * - * t/255 = (t >> 8) + (t >> 16) + (t >> 24) .. - * - * in this case just the first two terms to fit in 16bit arithmetic - * - * t/255 ~= (t + (t >> 8)) >> 8 - * - * note that just by itself it doesn't satisfies the OpenGL criteria, as 255*255 = 254, - * so the special case a = 255 must be accounted or roundoff must be used - */ -#define GMB_MULT_GS( MP1, MA1, MP2, MA2 ) \ - PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\ - ;\ - MOVQ ( MA1, MP1 ) ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\ - ;\ -TWO(MOVQ ( MA2, MP2 )) ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\ - ;\ - PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\ - PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\ - ;\ -TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ - - -/* integer multiplication - geometric series plus rounding - * - * when using a geometric series division instead of truncating the result - * use roundoff in the approximation (Jim Blinn) - * - * t = rgb*a + 0x80 - * - * achieving the exact results - * - * note that M80 is register with the 0x0080008000800080 constant - */ -#define GMB_MULT_GSR( MP1, MA1, MP2, MA2, M80 ) \ - PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\ - PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\ - ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\ -TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\ - ;\ - MOVQ ( MA1, MP1 ) ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\ - ;\ -TWO(MOVQ ( MA2, MP2 )) ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\ - ;\ - PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\ - PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\ - ;\ -TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ - - -/* linear interpolation - geometric series - */ -#define GMB_LERP_GS( MP1, MQ1, MA1, MP2, MQ2, MA2) \ - PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\ - PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\ - PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\ - ;\ -TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\ -TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\ - ;\ - MOVQ ( MA1, MP1 ) ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\ - ;\ -TWO(MOVQ ( MA2, MP2 )) ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\ - ;\ - PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\ -TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\ - ;\ - PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\ -TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\ - ;\ - PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ - - -/* linear interpolation - geometric series with roundoff - * - * this is a generalization of Blinn's formula to signed arithmetic - * - * note that M80 is a register with the 0x0080008000800080 constant - */ -#define GMB_LERP_GSR( MP1, MQ1, MA1, MP2, MQ2, MA2, M80) \ - PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\ - PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\ - PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\ - ;\ -TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\ -TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\ - ;\ - PSRLW ( CONST(15), MP1 ) /* q1 > p1 ? 1 : 0 */ ;\ -TWO(PSRLW ( CONST(15), MP2 )) /* q2 > q2 ? 1 : 0 */ ;\ - ;\ - PSLLW ( CONST(8), MP1 ) /* q1 > p1 ? 0x100 : 0 */ ;\ -TWO(PSLLW ( CONST(8), MP2 )) /* q2 > q2 ? 0x100 : 0 */ ;\ - ;\ - PSUBW ( MP1, MA1 ) /* t1 -=? 0x100 */ ;\ -TWO(PSUBW ( MP2, MA2 )) /* t2 -=? 0x100 */ ;\ - ;\ - PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\ -TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\ - ;\ - MOVQ ( MA1, MP1 ) ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\ - ;\ -TWO(MOVQ ( MA2, MP2 )) ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\ - ;\ - PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\ -TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\ - ;\ - PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\ -TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\ - ;\ - PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ - - -/* linear interpolation - geometric series with correction - * - * instead of the roundoff this adds a small correction to satisfy the OpenGL criteria - * - * t/255 ~= (t + (t >> 8) + (t >> 15)) >> 8 - * - * note that although is faster than rounding off it doesn't give always the exact results - */ -#define GMB_LERP_GSC( MP1, MQ1, MA1, MP2, MQ2, MA2) \ - PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\ - PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\ - PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\ - ;\ -TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\ -TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\ -TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\ - ;\ - MOVQ ( MA1, MP1 ) ;\ - PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\ - ;\ -TWO(MOVQ ( MA2, MP2 )) ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\ - ;\ - PADDW ( MA1, MP1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\ - PSRLW ( CONST(7), MA1 ) /* t1 >> 15 */ ;\ - ;\ -TWO(PADDW ( MA2, MP2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\ -TWO(PSRLW ( CONST(7), MA2 )) /* t2 >> 15 */ ;\ - ;\ - PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) + (t1 >>15) ~= (t1/255) << 8 */ ;\ -TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) + (t2 >>15) ~= (t2/255) << 8 */ ;\ - ;\ - PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\ -TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\ - ;\ - PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ - - -/* common blending setup code - * - * note that M00 is a register with 0x0000000000000000 constant which can be easily obtained making - * - * PXOR ( M00, M00 ) - */ -#define GMB_LOAD(rgba, dest, MPP, MQQ) \ -ONE(MOVD ( REGIND(rgba), MPP )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\ -ONE(MOVD ( REGIND(dest), MQQ )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\ - ;\ -TWO(MOVQ ( REGIND(rgba), MPP )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\ -TWO(MOVQ ( REGIND(dest), MQQ )) /* pa2 | pb2 | pg2 | pr2 | pa1 | pb1 | pg1 | pr1 */ - -#define GMB_UNPACK(MP1, MQ1, MP2, MQ2, M00) \ -TWO(MOVQ ( MP1, MP2 )) ;\ -TWO(MOVQ ( MQ1, MQ2 )) ;\ - ;\ - PUNPCKLBW ( M00, MQ1 ) /* qa1 | qb1 | qg1 | qr1 */ ;\ -TWO(PUNPCKHBW ( M00, MQ2 )) /* qa2 | qb2 | qg2 | qr2 */ ;\ - PUNPCKLBW ( M00, MP1 ) /* pa1 | pb1 | pg1 | pr1 */ ;\ -TWO(PUNPCKHBW ( M00, MP2 )) /* pa2 | pb2 | pg2 | pr2 */ - -#define GMB_ALPHA(MP1, MA1, MP2, MA2) \ - MOVQ ( MP1, MA1 ) ;\ -TWO(MOVQ ( MP2, MA2 )) ;\ - ;\ - PUNPCKHWD ( MA1, MA1 ) /* pa1 | pa1 | | */ ;\ -TWO(PUNPCKHWD ( MA2, MA2 )) /* pa2 | pa2 | | */ ;\ - PUNPCKHDQ ( MA1, MA1 ) /* pa1 | pa1 | pa1 | pa1 */ ;\ -TWO(PUNPCKHDQ ( MA2, MA2 )) /* pa2 | pa2 | pa2 | pa2 */ - -#define GMB_PACK( MS1, MS2 ) \ - PACKUSWB ( MS2, MS1 ) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\ - -#define GMB_STORE(rgba, MSS ) \ -ONE(MOVD ( MSS, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\ -TWO(MOVQ ( MSS, REGIND(rgba) )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ - -/* Kevin F. Quinn 2 July 2006 - * Replace data segment constants with text-segment - * constants (via pushl/movq) - SEG_DATA - -ALIGNDATA8 -const_0080: - D_LONG 0x00800080, 0x00800080 - -const_80: - D_LONG 0x80808080, 0x80808080 -*/ -#define const_0080_l 0x00800080 -#define const_0080_h 0x00800080 -#define const_80_l 0x80808080 -#define const_80_h 0x80808080 - - SEG_TEXT - - -/* Blend transparency function - */ - -#define TAG(x) CONCAT(x,_transparency) -#define LLTAG(x) LLBL2(x,_transparency) - -#define INIT \ - PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\ - GMB_ALPHA( MM1, MM3, MM4, MM6 ) ;\ - GMB_LERP_GSC( MM1, MM2, MM3, MM4, MM5, MM6 ) ;\ - GMB_PACK( MM3, MM6 ) ;\ - GMB_STORE( rgba, MM3 ) - -#include "mmx_blendtmp.h" - - -/* Blend add function - * - * FIXME: Add some loop unrolling here... - */ - -#define TAG(x) CONCAT(x,_add) -#define LLTAG(x) LLBL2(x,_add) - -#define INIT - -#define MAIN( rgba, dest ) \ -ONE(MOVD ( REGIND(rgba), MM1 )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\ -ONE(MOVD ( REGIND(dest), MM2 )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\ -ONE(PADDUSB ( MM2, MM1 )) ;\ -ONE(MOVD ( MM1, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\ - ;\ -TWO(MOVQ ( REGIND(rgba), MM1 )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\ -TWO(PADDUSB ( REGIND(dest), MM1 )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\ -TWO(MOVQ ( MM1, REGIND(rgba) )) - -#include "mmx_blendtmp.h" - - -/* Blend min function - */ - -#define TAG(x) CONCAT(x,_min) -#define LLTAG(x) LLBL2(x,_min) - -/* Kevin F. Quinn 2nd July 2006 - * Replace data segment constants with text-segment instructions -#define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) - */ -#define INIT \ - PUSH_L ( CONST(const_80_h) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\ - PUSH_L ( CONST(const_80_l) ) ;\ - MOVQ ( REGIND(ESP), MM7 ) ;\ - ADD_L ( CONST(8), ESP) - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - MOVQ ( MM1, MM3 ) ;\ - MOVQ ( MM2, MM4 ) ;\ - PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\ - PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\ - PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\ - PAND ( MM4, MM1 ) /* q > p ? p : 0 */ ;\ - PANDN ( MM2, MM4 ) /* q > p ? 0 : q */ ;\ - POR ( MM1, MM4 ) /* q > p ? p : q */ ;\ - GMB_STORE( rgba, MM4 ) - -#include "mmx_blendtmp.h" - - -/* Blend max function - */ - -#define TAG(x) CONCAT(x,_max) -#define LLTAG(x) LLBL2(x,_max) - -/* Kevin F. Quinn 2nd July 2006 - * Replace data segment constants with text-segment instructions -#define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) - */ -#define INIT \ - PUSH_L ( CONST(const_80_l) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\ - PUSH_L ( CONST(const_80_h) ) ;\ - MOVQ ( REGIND(ESP), MM7 ) ;\ - ADD_L ( CONST(8), ESP) - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - MOVQ ( MM1, MM3 ) ;\ - MOVQ ( MM2, MM4 ) ;\ - PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\ - PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\ - PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\ - PAND ( MM4, MM2 ) /* q > p ? q : 0 */ ;\ - PANDN ( MM1, MM4 ) /* q > p ? 0 : p */ ;\ - POR ( MM2, MM4 ) /* q > p ? p : q */ ;\ - GMB_STORE( rgba, MM4 ) - -#include "mmx_blendtmp.h" - - -/* Blend modulate function - */ - -#define TAG(x) CONCAT(x,_modulate) -#define LLTAG(x) LLBL2(x,_modulate) - -/* Kevin F. Quinn 2nd July 2006 - * Replace data segment constants with text-segment instructions -#define INIT \ - MOVQ ( CONTENT(const_0080), MM7 ) - */ -#define INIT \ - PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ ;\ - PUSH_L ( CONST(const_0080_l) ) /* 0x0080 | 0x0080 | 0x0080 | 0x0080 */ ;\ - PUSH_L ( CONST(const_0080_h) ) ;\ - MOVQ ( REGIND(ESP), MM7 ) ;\ - ADD_L ( CONST(8), ESP) - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\ - GMB_MULT_GSR( MM1, MM2, MM4, MM5, MM7 ) ;\ - GMB_PACK( MM2, MM5 ) ;\ - GMB_STORE( rgba, MM2 ) - -#include "mmx_blendtmp.h" - -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/mmx_blendtmp.h b/src/libs/mesa/mesa/x86/mmx_blendtmp.h deleted file mode 100644 index c2fdeb62b3..0000000000 --- a/src/libs/mesa/mesa/x86/mmx_blendtmp.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Written by José Fonseca - */ - - -/* - * void _mesa_mmx_blend( GLcontext *ctx, - * GLuint n, - * const GLubyte mask[], - * GLchan rgba[][4], - * CONST GLchan dest[][4] ) - * - */ -ALIGNTEXT16 -GLOBL GLNAME( TAG(_mesa_mmx_blend) ) -HIDDEN( TAG(_mesa_mmx_blend) ) -GLNAME( TAG(_mesa_mmx_blend) ): - - PUSH_L ( EBP ) - MOV_L ( ESP, EBP ) - PUSH_L ( ESI ) - PUSH_L ( EDI ) - PUSH_L ( EBX ) - - MOV_L ( REGOFF(12, EBP), ECX ) /* n */ - CMP_L ( CONST(0), ECX) - JE ( LLTAG(GMB_return) ) - - MOV_L ( REGOFF(16, EBP), EBX ) /* mask */ - MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */ - MOV_L ( REGOFF(24, EBP), ESI ) /* dest */ - - INIT - - TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */ - JZ ( LLTAG(GMB_align_end) ) - - CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */ - JE ( LLTAG(GMB_align_continue) ) - - /* runin */ -#define ONE(x) x -#define TWO(x) - MAIN ( EDI, ESI ) -#undef ONE -#undef TWO - -LLTAG(GMB_align_continue): - - DEC_L ( ECX ) /* n -= 1 */ - INC_L ( EBX ) /* mask += 1 */ - ADD_L ( CONST(4), EDI ) /* rgba += 1 */ - ADD_L ( CONST(4), ESI ) /* dest += 1 */ - -LLTAG(GMB_align_end): - - CMP_L ( CONST(2), ECX) - JB ( LLTAG(GMB_loop_end) ) - -ALIGNTEXT16 -LLTAG(GMB_loop_begin): - - CMP_W ( CONST(0), REGIND(EBX) ) /* *mask == 0 && *(mask + 1) == 0 */ - JE ( LLTAG(GMB_loop_continue) ) - - /* main loop */ -#define ONE(x) -#define TWO(x) x - MAIN ( EDI, ESI ) -#undef ONE -#undef TWO - -LLTAG(GMB_loop_continue): - - DEC_L ( ECX ) - DEC_L ( ECX ) /* n -= 2 */ - ADD_L ( CONST(2), EBX ) /* mask += 2 */ - ADD_L ( CONST(8), EDI ) /* rgba += 2 */ - ADD_L ( CONST(8), ESI ) /* dest += 2 */ - CMP_L ( CONST(2), ECX ) - JAE ( LLTAG(GMB_loop_begin) ) - -LLTAG(GMB_loop_end): - - CMP_L ( CONST(1), ECX ) - JB ( LLTAG(GMB_done) ) - - CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */ - JE ( LLTAG(GMB_done) ) - - /* runout */ -#define ONE(x) x -#define TWO(x) - MAIN ( EDI, ESI ) -#undef ONE -#undef TWO - -LLTAG(GMB_done): - - EMMS - -LLTAG(GMB_return): - - POP_L ( EBX ) - POP_L ( EDI ) - POP_L ( ESI ) - MOV_L ( EBP, ESP ) - POP_L ( EBP ) - RET - -#undef TAG -#undef LLTAG -#undef INIT -#undef MAIN diff --git a/src/libs/mesa/mesa/x86/norm_args.h b/src/libs/mesa/mesa/x86/norm_args.h deleted file mode 100644 index 5d352838be..0000000000 --- a/src/libs/mesa/mesa/x86/norm_args.h +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Normal transform function interface for assembly code. Simply define - * FRAME_OFFSET to the number of bytes pushed onto the stack before - * using the ARG_* argument macros. - * - * Gareth Hughes - */ - -#ifndef __NORM_ARGS_H__ -#define __NORM_ARGS_H__ - -/* Offsets for normal_func arguments - * - * typedef void (*normal_func)( CONST GLmatrix *mat, - * GLfloat scale, - * CONST GLvector4f *in, - * CONST GLfloat lengths[], - * GLvector4f *dest ); - */ -#define OFFSET_MAT 4 -#define OFFSET_SCALE 8 -#define OFFSET_IN 12 -#define OFFSET_LENGTHS 16 -#define OFFSET_DEST 20 - -#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_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP) - -#endif diff --git a/src/libs/mesa/mesa/x86/read_rgba_span_x86.S b/src/libs/mesa/mesa/x86/read_rgba_span_x86.S deleted file mode 100644 index 80144b889c..0000000000 --- a/src/libs/mesa/mesa/x86/read_rgba_span_x86.S +++ /dev/null @@ -1,678 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file read_rgba_span_x86.S - * Optimized routines to transfer pixel data from the framebuffer to a - * buffer in main memory. - * - * \author Ian Romanick - */ - - .file "read_rgba_span_x86.S" -#if !defined(__DJGPP__) && !defined(__MINGW32__) /* this one cries for assyntax.h */ -/* Kevin F. Quinn 2nd July 2006 - * Replaced data segment constants with text-segment instructions. - */ -#define LOAD_MASK(mvins,m1,m2) \ - pushl $0xff00ff00 ;\ - pushl $0xff00ff00 ;\ - pushl $0xff00ff00 ;\ - pushl $0xff00ff00 ;\ - mvins (%esp), m1 ;\ - pushl $0x00ff0000 ;\ - pushl $0x00ff0000 ;\ - pushl $0x00ff0000 ;\ - pushl $0x00ff0000 ;\ - mvins (%esp), m2 ;\ - addl $32, %esp - -/* I implemented these as macros because they appear in several places, - * and I've tweaked them a number of times. I got tired of changing every - * place they appear. :) - */ - -#define DO_ONE_PIXEL() \ - movl (%ebx), %eax ; \ - addl $4, %ebx ; \ - bswap %eax /* ARGB -> BGRA */ ; \ - rorl $8, %eax /* BGRA -> ABGR */ ; \ - movl %eax, (%ecx) /* ABGR -> R, G, B, A */ ; \ - addl $4, %ecx - -#define DO_ONE_LAST_PIXEL() \ - movl (%ebx), %eax ; \ - bswap %eax /* ARGB -> BGRA */ ; \ - rorl $8, %eax /* BGRA -> ABGR */ ; \ - movl %eax, (%ecx) /* ABGR -> R, G, B, A */ ; \ - - -/** - * MMX optimized version of the BGRA8888_REV to RGBA copy routine. - * - * \warning - * This function assumes that the caller will issue the EMMS instruction - * at the correct places. - */ - -.globl _generic_read_RGBA_span_BGRA8888_REV_MMX -.hidden _generic_read_RGBA_span_BGRA8888_REV_MMX - .type _generic_read_RGBA_span_BGRA8888_REV_MMX, @function -_generic_read_RGBA_span_BGRA8888_REV_MMX: - pushl %ebx - -#ifdef USE_INNER_EMMS - emms -#endif - LOAD_MASK(movq,%mm1,%mm2) - - movl 8(%esp), %ebx /* source pointer */ - movl 16(%esp), %edx /* number of pixels to copy */ - movl 12(%esp), %ecx /* destination pointer */ - - testl %edx, %edx - jle .L20 /* Bail if there's nothing to do. */ - - movl %ebx, %eax - - negl %eax - sarl $2, %eax - andl $1, %eax - je .L17 - - subl %eax, %edx - DO_ONE_PIXEL() -.L17: - - /* Would it be faster to unroll this loop once and process 4 pixels - * per pass, instead of just two? - */ - - movl %edx, %eax - shrl %eax - jmp .L18 -.L19: - movq (%ebx), %mm0 - addl $8, %ebx - - /* These 9 instructions do what PSHUFB (if there were such an - * instruction) could do in 1. :( - */ - - movq %mm0, %mm3 - movq %mm0, %mm4 - - pand %mm2, %mm3 - psllq $16, %mm4 - psrlq $16, %mm3 - pand %mm2, %mm4 - - pand %mm1, %mm0 - por %mm4, %mm3 - por %mm3, %mm0 - - movq %mm0, (%ecx) - addl $8, %ecx - subl $1, %eax -.L18: - jne .L19 - -#ifdef USE_INNER_EMMS - emms -#endif - - /* At this point there are either 1 or 0 pixels remaining to be - * converted. Convert the last pixel, if needed. - */ - - testl $1, %edx - je .L20 - - DO_ONE_LAST_PIXEL() - -.L20: - popl %ebx - ret - .size _generic_read_RGBA_span_BGRA8888_REV_MMX, .-_generic_read_RGBA_span_BGRA8888_REV_MMX - - -/** - * SSE optimized version of the BGRA8888_REV to RGBA copy routine. SSE - * instructions are only actually used to read data from the framebuffer. - * In practice, the speed-up is pretty small. - * - * \todo - * Do some more testing and determine if there's any reason to have this - * function in addition to the MMX version. - * - * \warning - * This function assumes that the caller will issue the EMMS instruction - * at the correct places. - */ - -.globl _generic_read_RGBA_span_BGRA8888_REV_SSE -.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE - .type _generic_read_RGBA_span_BGRA8888_REV_SSE, @function -_generic_read_RGBA_span_BGRA8888_REV_SSE: - pushl %esi - pushl %ebx - pushl %ebp - -#ifdef USE_INNER_EMMS - emms -#endif - - LOAD_MASK(movq,%mm1,%mm2) - - movl 16(%esp), %ebx /* source pointer */ - movl 24(%esp), %edx /* number of pixels to copy */ - movl 20(%esp), %ecx /* destination pointer */ - - testl %edx, %edx - jle .L35 /* Bail if there's nothing to do. */ - - movl %esp, %ebp - subl $16, %esp - andl $0xfffffff0, %esp - - movl %ebx, %eax - movl %edx, %esi - - negl %eax - andl $15, %eax - sarl $2, %eax - cmpl %edx, %eax - cmovle %eax, %esi - - subl %esi, %edx - - testl $1, %esi - je .L32 - - DO_ONE_PIXEL() -.L32: - - testl $2, %esi - je .L31 - - movq (%ebx), %mm0 - addl $8, %ebx - - movq %mm0, %mm3 - movq %mm0, %mm4 - - pand %mm2, %mm3 - psllq $16, %mm4 - psrlq $16, %mm3 - pand %mm2, %mm4 - - pand %mm1, %mm0 - por %mm4, %mm3 - por %mm3, %mm0 - - movq %mm0, (%ecx) - addl $8, %ecx -.L31: - - movl %edx, %eax - shrl $2, %eax - jmp .L33 -.L34: - movaps (%ebx), %xmm0 - addl $16, %ebx - - /* This would be so much better if we could just move directly from - * an SSE register to an MMX register. Unfortunately, that - * functionality wasn't introduced until SSE2 with the MOVDQ2Q - * instruction. - */ - - movaps %xmm0, (%esp) - movq (%esp), %mm0 - movq 8(%esp), %mm5 - - movq %mm0, %mm3 - movq %mm0, %mm4 - movq %mm5, %mm6 - movq %mm5, %mm7 - - pand %mm2, %mm3 - pand %mm2, %mm6 - - psllq $16, %mm4 - psllq $16, %mm7 - - psrlq $16, %mm3 - psrlq $16, %mm6 - - pand %mm2, %mm4 - pand %mm2, %mm7 - - pand %mm1, %mm0 - pand %mm1, %mm5 - - por %mm4, %mm3 - por %mm7, %mm6 - - por %mm3, %mm0 - por %mm6, %mm5 - - movq %mm0, (%ecx) - movq %mm5, 8(%ecx) - addl $16, %ecx - - subl $1, %eax -.L33: - jne .L34 - -#ifdef USE_INNER_EMMS - emms -#endif - movl %ebp, %esp - - /* At this point there are either [0, 3] pixels remaining to be - * converted. - */ - - testl $2, %edx - je .L36 - - movq (%ebx), %mm0 - addl $8, %ebx - - movq %mm0, %mm3 - movq %mm0, %mm4 - - pand %mm2, %mm3 - psllq $16, %mm4 - psrlq $16, %mm3 - pand %mm2, %mm4 - - pand %mm1, %mm0 - por %mm4, %mm3 - por %mm3, %mm0 - - movq %mm0, (%ecx) - addl $8, %ecx -.L36: - - testl $1, %edx - je .L35 - - DO_ONE_LAST_PIXEL() -.L35: - popl %ebp - popl %ebx - popl %esi - ret - .size _generic_read_RGBA_span_BGRA8888_REV_SSE, .-_generic_read_RGBA_span_BGRA8888_REV_SSE - - -/** - * SSE2 optimized version of the BGRA8888_REV to RGBA copy routine. - */ - - .text -.globl _generic_read_RGBA_span_BGRA8888_REV_SSE2 -.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE2 - .type _generic_read_RGBA_span_BGRA8888_REV_SSE2, @function -_generic_read_RGBA_span_BGRA8888_REV_SSE2: - pushl %esi - pushl %ebx - - LOAD_MASK(movdqu,%xmm1,%xmm2) - - movl 12(%esp), %ebx /* source pointer */ - movl 20(%esp), %edx /* number of pixels to copy */ - movl 16(%esp), %ecx /* destination pointer */ - - movl %ebx, %eax - movl %edx, %esi - - testl %edx, %edx - jle .L46 /* Bail if there's nothing to do. */ - - /* If the source pointer isn't a multiple of 16 we have to process - * a few pixels the "slow" way to get the address aligned for - * the SSE fetch intsructions. - */ - - negl %eax - andl $15, %eax - sarl $2, %eax - - cmpl %edx, %eax - cmovbe %eax, %esi - subl %esi, %edx - - testl $1, %esi - je .L41 - - DO_ONE_PIXEL() -.L41: - testl $2, %esi - je .L40 - - movq (%ebx), %xmm0 - addl $8, %ebx - - movdqa %xmm0, %xmm3 - movdqa %xmm0, %xmm4 - andps %xmm1, %xmm0 - - andps %xmm2, %xmm3 - pslldq $2, %xmm4 - psrldq $2, %xmm3 - andps %xmm2, %xmm4 - - orps %xmm4, %xmm3 - orps %xmm3, %xmm0 - - movq %xmm0, (%ecx) - addl $8, %ecx -.L40: - - /* Would it be worth having a specialized version of this loop for - * the case where the destination is 16-byte aligned? That version - * would be identical except that it could use movedqa instead of - * movdqu. - */ - - movl %edx, %eax - shrl $2, %eax - jmp .L42 -.L43: - movdqa (%ebx), %xmm0 - addl $16, %ebx - - movdqa %xmm0, %xmm3 - movdqa %xmm0, %xmm4 - andps %xmm1, %xmm0 - - andps %xmm2, %xmm3 - pslldq $2, %xmm4 - psrldq $2, %xmm3 - andps %xmm2, %xmm4 - - orps %xmm4, %xmm3 - orps %xmm3, %xmm0 - - movdqu %xmm0, (%ecx) - addl $16, %ecx - subl $1, %eax -.L42: - jne .L43 - - - /* There may be upto 3 pixels remaining to be copied. Take care - * of them now. We do the 2 pixel case first because the data - * will be aligned. - */ - - testl $2, %edx - je .L47 - - movq (%ebx), %xmm0 - addl $8, %ebx - - movdqa %xmm0, %xmm3 - movdqa %xmm0, %xmm4 - andps %xmm1, %xmm0 - - andps %xmm2, %xmm3 - pslldq $2, %xmm4 - psrldq $2, %xmm3 - andps %xmm2, %xmm4 - - orps %xmm4, %xmm3 - orps %xmm3, %xmm0 - - movq %xmm0, (%ecx) - addl $8, %ecx -.L47: - - testl $1, %edx - je .L46 - - DO_ONE_LAST_PIXEL() -.L46: - - popl %ebx - popl %esi - ret - .size _generic_read_RGBA_span_BGRA8888_REV_SSE2, .-_generic_read_RGBA_span_BGRA8888_REV_SSE2 - - - -#define MASK_565_L 0x07e0f800 -#define MASK_565_H 0x0000001f -/* Setting SCALE_ADJUST to 5 gives a perfect match with the - * classic C implementation in Mesa. Setting SCALE_ADJUST - * to 0 is slightly faster but at a small cost to accuracy. - */ -#define SCALE_ADJUST 5 -#if SCALE_ADJUST == 5 -#define PRESCALE_L 0x00100001 -#define PRESCALE_H 0x00000200 -#define SCALE_L 0x40C620E8 -#define SCALE_H 0x0000839d -#elif SCALE_ADJUST == 0 -#define PRESCALE_L 0x00200001 -#define PRESCALE_H 0x00000800 -#define SCALE_L 0x01040108 -#define SCALE_H 0x00000108 -#else -#error SCALE_ADJUST must either be 5 or 0. -#endif -#define ALPHA_L 0x00000000 -#define ALPHA_H 0x00ff0000 - -/** - * MMX optimized version of the RGB565 to RGBA copy routine. - */ - - .text - .globl _generic_read_RGBA_span_RGB565_MMX - .hidden _generic_read_RGBA_span_RGB565_MMX - .type _generic_read_RGBA_span_RGB565_MMX, @function - -_generic_read_RGBA_span_RGB565_MMX: - -#ifdef USE_INNER_EMMS - emms -#endif - - movl 4(%esp), %eax /* source pointer */ - movl 8(%esp), %edx /* destination pointer */ - movl 12(%esp), %ecx /* number of pixels to copy */ - - pushl $MASK_565_H - pushl $MASK_565_L - movq (%esp), %mm5 - pushl $PRESCALE_H - pushl $PRESCALE_L - movq (%esp), %mm6 - pushl $SCALE_H - pushl $SCALE_L - movq (%esp), %mm7 - pushl $ALPHA_H - pushl $ALPHA_L - movq (%esp), %mm3 - addl $32,%esp - - sarl $2, %ecx - jle .L01 /* Bail early if the count is negative. */ - jmp .L02 - -.L03: - /* Fetch 4 RGB565 pixels into %mm4. Distribute the first and - * second pixels into the four words of %mm0 and %mm2. - */ - - movq (%eax), %mm4 - addl $8, %eax - - pshufw $0x00, %mm4, %mm0 - pshufw $0x55, %mm4, %mm2 - - - /* Mask the pixels so that each word of each register contains only - * one color component. - */ - - pand %mm5, %mm0 - pand %mm5, %mm2 - - - /* Adjust the component values so that they are as small as possible, - * but large enough so that we can multiply them by an unsigned 16-bit - * number and get a value as large as 0x00ff0000. - */ - - pmullw %mm6, %mm0 - pmullw %mm6, %mm2 -#if SCALE_ADJUST > 0 - psrlw $SCALE_ADJUST, %mm0 - psrlw $SCALE_ADJUST, %mm2 -#endif - - /* Scale the input component values to be on the range - * [0, 0x00ff0000]. This it the real magic of the whole routine. - */ - - pmulhuw %mm7, %mm0 - pmulhuw %mm7, %mm2 - - - /* Always set the alpha value to 0xff. - */ - - por %mm3, %mm0 - por %mm3, %mm2 - - - /* Pack the 16-bit values to 8-bit values and store the converted - * pixel data. - */ - - packuswb %mm2, %mm0 - movq %mm0, (%edx) - addl $8, %edx - - pshufw $0xaa, %mm4, %mm0 - pshufw $0xff, %mm4, %mm2 - - pand %mm5, %mm0 - pand %mm5, %mm2 - pmullw %mm6, %mm0 - pmullw %mm6, %mm2 -#if SCALE_ADJUST > 0 - psrlw $SCALE_ADJUST, %mm0 - psrlw $SCALE_ADJUST, %mm2 -#endif - pmulhuw %mm7, %mm0 - pmulhuw %mm7, %mm2 - - por %mm3, %mm0 - por %mm3, %mm2 - - packuswb %mm2, %mm0 - - movq %mm0, (%edx) - addl $8, %edx - - subl $1, %ecx -.L02: - jne .L03 - - - /* At this point there can be at most 3 pixels left to process. If - * there is either 2 or 3 left, process 2. - */ - - movl 12(%esp), %ecx - testl $0x02, %ecx - je .L04 - - movd (%eax), %mm4 - addl $4, %eax - - pshufw $0x00, %mm4, %mm0 - pshufw $0x55, %mm4, %mm2 - - pand %mm5, %mm0 - pand %mm5, %mm2 - pmullw %mm6, %mm0 - pmullw %mm6, %mm2 -#if SCALE_ADJUST > 0 - psrlw $SCALE_ADJUST, %mm0 - psrlw $SCALE_ADJUST, %mm2 -#endif - pmulhuw %mm7, %mm0 - pmulhuw %mm7, %mm2 - - por %mm3, %mm0 - por %mm3, %mm2 - - packuswb %mm2, %mm0 - - movq %mm0, (%edx) - addl $8, %edx - -.L04: - /* At this point there can be at most 1 pixel left to process. - * Process it if needed. - */ - - testl $0x01, %ecx - je .L01 - - movzxw (%eax), %ecx - movd %ecx, %mm4 - - pshufw $0x00, %mm4, %mm0 - - pand %mm5, %mm0 - pmullw %mm6, %mm0 -#if SCALE_ADJUST > 0 - psrlw $SCALE_ADJUST, %mm0 -#endif - pmulhuw %mm7, %mm0 - - por %mm3, %mm0 - - packuswb %mm0, %mm0 - - movd %mm0, (%edx) - -.L01: -#ifdef USE_INNER_EMMS - emms -#endif - ret -#endif /* !defined(__DJGPP__) && !defined(__MINGW32__) */ - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/read_rgba_span_x86.h b/src/libs/mesa/mesa/x86/read_rgba_span_x86.h deleted file mode 100644 index 564b1bb0f9..0000000000 --- a/src/libs/mesa/mesa/x86/read_rgba_span_x86.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file read_rgba_span_x86.h - * - * \author Ian Romanick - */ - -#ifndef READ_RGBA_SPAN_X86_H -#define READ_RGBA_SPAN_X86_H - -#if defined(USE_SSE_ASM) || defined(USE_MMX_ASM) -#include "x86/common_x86_asm.h" -#endif - -#if defined(USE_SSE_ASM) -extern void _generic_read_RGBA_span_BGRA8888_REV_SSE2( const unsigned char *, - unsigned char *, unsigned ); -#endif - -#if defined(USE_SSE_ASM) -extern void _generic_read_RGBA_span_BGRA8888_REV_SSE( const unsigned char *, - unsigned char *, unsigned ); -#endif - -#if defined(USE_MMX_ASM) -extern void _generic_read_RGBA_span_BGRA8888_REV_MMX( const unsigned char *, - unsigned char *, unsigned ); - -extern void _generic_read_RGBA_span_RGB565_MMX( const unsigned char *, - unsigned char *, unsigned ); -#endif - -#endif /* READ_RGBA_SPAN_X86_H */ diff --git a/src/libs/mesa/mesa/x86/rtasm/x86sse.c b/src/libs/mesa/mesa/x86/rtasm/x86sse.c deleted file mode 100644 index e68f8dfec1..0000000000 --- a/src/libs/mesa/mesa/x86/rtasm/x86sse.c +++ /dev/null @@ -1,1194 +0,0 @@ -#if defined(__i386__) || defined(__386__) - -#include "main/imports.h" -#include "x86sse.h" - -#define DISASSEM 0 -#define X86_TWOB 0x0f - -static unsigned char *cptr( void (*label)() ) -{ - return (unsigned char *)(unsigned long)label; -} - - -static void do_realloc( struct x86_function *p ) -{ - if (p->size == 0) { - p->size = 1024; - p->store = _mesa_exec_malloc(p->size); - p->csr = p->store; - } - else { - unsigned used = p->csr - p->store; - unsigned char *tmp = p->store; - p->size *= 2; - p->store = _mesa_exec_malloc(p->size); - memcpy(p->store, tmp, used); - p->csr = p->store + used; - _mesa_exec_free(tmp); - } -} - -/* Emit bytes to the instruction stream: - */ -static unsigned char *reserve( struct x86_function *p, int bytes ) -{ - if (p->csr + bytes - p->store > p->size) - do_realloc(p); - - { - unsigned char *csr = p->csr; - p->csr += bytes; - return csr; - } -} - - - -static void emit_1b( struct x86_function *p, char b0 ) -{ - char *csr = (char *)reserve(p, 1); - *csr = b0; -} - -static void emit_1i( struct x86_function *p, int i0 ) -{ - int *icsr = (int *)reserve(p, sizeof(i0)); - *icsr = i0; -} - -static void emit_1ub( struct x86_function *p, unsigned char b0 ) -{ - unsigned char *csr = reserve(p, 1); - *csr++ = b0; -} - -static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) -{ - unsigned char *csr = reserve(p, 2); - *csr++ = b0; - *csr++ = b1; -} - -static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) -{ - unsigned char *csr = reserve(p, 3); - *csr++ = b0; - *csr++ = b1; - *csr++ = b2; -} - - -/* Build a modRM byte + possible displacement. No treatment of SIB - * indexing. BZZT - no way to encode an absolute address. - */ -static void emit_modrm( struct x86_function *p, - struct x86_reg reg, - struct x86_reg regmem ) -{ - unsigned char val = 0; - - assert(reg.mod == mod_REG); - - val |= regmem.mod << 6; /* mod field */ - val |= reg.idx << 3; /* reg field */ - val |= regmem.idx; /* r/m field */ - - emit_1ub(p, val); - - /* Oh-oh we've stumbled into the SIB thing. - */ - if (regmem.file == file_REG32 && - regmem.idx == reg_SP) { - emit_1ub(p, 0x24); /* simplistic! */ - } - - switch (regmem.mod) { - case mod_REG: - case mod_INDIRECT: - break; - case mod_DISP8: - emit_1b(p, regmem.disp); - break; - case mod_DISP32: - emit_1i(p, regmem.disp); - break; - default: - assert(0); - break; - } -} - - -static void emit_modrm_noreg( struct x86_function *p, - unsigned op, - struct x86_reg regmem ) -{ - struct x86_reg dummy = x86_make_reg(file_REG32, op); - emit_modrm(p, dummy, regmem); -} - -/* Many x86 instructions have two opcodes to cope with the situations - * where the destination is a register or memory reference - * respectively. This function selects the correct opcode based on - * the arguments presented. - */ -static void emit_op_modrm( struct x86_function *p, - unsigned char op_dst_is_reg, - unsigned char op_dst_is_mem, - struct x86_reg dst, - struct x86_reg src ) -{ - switch (dst.mod) { - case mod_REG: - emit_1ub(p, op_dst_is_reg); - emit_modrm(p, dst, src); - break; - case mod_INDIRECT: - case mod_DISP32: - case mod_DISP8: - assert(src.mod == mod_REG); - emit_1ub(p, op_dst_is_mem); - emit_modrm(p, src, dst); - break; - default: - assert(0); - break; - } -} - - - - - - - -/* Create and manipulate registers and regmem values: - */ -struct x86_reg x86_make_reg( enum x86_reg_file file, - enum x86_reg_name idx ) -{ - struct x86_reg reg; - - reg.file = file; - reg.idx = idx; - reg.mod = mod_REG; - reg.disp = 0; - - return reg; -} - -struct x86_reg x86_make_disp( struct x86_reg reg, - int disp ) -{ - assert(reg.file == file_REG32); - - if (reg.mod == mod_REG) - reg.disp = disp; - else - reg.disp += disp; - - if (reg.disp == 0) - reg.mod = mod_INDIRECT; - else if (reg.disp <= 127 && reg.disp >= -128) - reg.mod = mod_DISP8; - else - reg.mod = mod_DISP32; - - return reg; -} - -struct x86_reg x86_deref( struct x86_reg reg ) -{ - return x86_make_disp(reg, 0); -} - -struct x86_reg x86_get_base_reg( struct x86_reg reg ) -{ - return x86_make_reg( reg.file, reg.idx ); -} - -unsigned char *x86_get_label( struct x86_function *p ) -{ - return p->csr; -} - - - -/*********************************************************************** - * x86 instructions - */ - - -void x86_jcc( struct x86_function *p, - enum x86_cc cc, - unsigned char *label ) -{ - int offset = label - (x86_get_label(p) + 2); - - if (offset <= 127 && offset >= -128) { - emit_1ub(p, 0x70 + cc); - emit_1b(p, (char) offset); - } - else { - offset = label - (x86_get_label(p) + 6); - emit_2ub(p, 0x0f, 0x80 + cc); - emit_1i(p, offset); - } -} - -/* Always use a 32bit offset for forward jumps: - */ -unsigned char *x86_jcc_forward( struct x86_function *p, - enum x86_cc cc ) -{ - emit_2ub(p, 0x0f, 0x80 + cc); - emit_1i(p, 0); - return x86_get_label(p); -} - -unsigned char *x86_jmp_forward( struct x86_function *p) -{ - emit_1ub(p, 0xe9); - emit_1i(p, 0); - return x86_get_label(p); -} - -unsigned char *x86_call_forward( struct x86_function *p) -{ - emit_1ub(p, 0xe8); - emit_1i(p, 0); - return x86_get_label(p); -} - -/* Fixup offset from forward jump: - */ -void x86_fixup_fwd_jump( struct x86_function *p, - unsigned char *fixup ) -{ - *(int *)(fixup - 4) = x86_get_label(p) - fixup; -} - -void x86_jmp( struct x86_function *p, unsigned char *label) -{ - emit_1ub(p, 0xe9); - emit_1i(p, label - x86_get_label(p) - 4); -} - -#if 0 -/* This doesn't work once we start reallocating & copying the - * generated code on buffer fills, because the call is relative to the - * current pc. - */ -void x86_call( struct x86_function *p, void (*label)()) -{ - emit_1ub(p, 0xe8); - emit_1i(p, cptr(label) - x86_get_label(p) - 4); -} -#else -void x86_call( struct x86_function *p, struct x86_reg reg) -{ - emit_1ub(p, 0xff); - emit_modrm(p, reg, reg); -} -#endif - - -/* michal: - * Temporary. As I need immediate operands, and dont want to mess with the codegen, - * I load the immediate into general purpose register and use it. - */ -void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) -{ - assert(dst.mod == mod_REG); - emit_1ub(p, 0xb8 + dst.idx); - emit_1i(p, imm); -} - -void x86_push( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x50 + reg.idx); - p->stack_offset += 4; -} - -void x86_pop( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x58 + reg.idx); - p->stack_offset -= 4; -} - -void x86_inc( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x40 + reg.idx); -} - -void x86_dec( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x48 + reg.idx); -} - -void x86_ret( struct x86_function *p ) -{ - emit_1ub(p, 0xc3); -} - -void x86_sahf( struct x86_function *p ) -{ - emit_1ub(p, 0x9e); -} - -void x86_mov( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x8b, 0x89, dst, src ); -} - -void x86_xor( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x33, 0x31, dst, src ); -} - -void x86_cmp( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x3b, 0x39, dst, src ); -} - -void x86_lea( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, 0x8d); - emit_modrm( p, dst, src ); -} - -void x86_test( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, 0x85); - emit_modrm( p, dst, src ); -} - -void x86_add( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm(p, 0x03, 0x01, dst, src ); -} - -void x86_mul( struct x86_function *p, - struct x86_reg src ) -{ - assert (src.file == file_REG32 && src.mod == mod_REG); - emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); -} - -void x86_sub( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm(p, 0x2b, 0x29, dst, src ); -} - -void x86_or( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x0b, 0x09, dst, src ); -} - -void x86_and( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x23, 0x21, dst, src ); -} - - - -/*********************************************************************** - * SSE instructions - */ - - -void sse_movss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, 0xF3, X86_TWOB); - emit_op_modrm( p, 0x10, 0x11, dst, src ); -} - -void sse_movaps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x28, 0x29, dst, src ); -} - -void sse_movups( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x10, 0x11, dst, src ); -} - -void sse_movhps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod != mod_REG || src.mod != mod_REG); - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ -} - -void sse_movlps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod != mod_REG || src.mod != mod_REG); - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ -} - -void sse_maxps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5F); - emit_modrm( p, dst, src ); -} - -void sse_maxss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x5F); - emit_modrm( p, dst, src ); -} - -void sse_divss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x5E); - emit_modrm( p, dst, src ); -} - -void sse_minps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5D); - emit_modrm( p, dst, src ); -} - -void sse_subps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5C); - emit_modrm( p, dst, src ); -} - -void sse_mulps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x59); - emit_modrm( p, dst, src ); -} - -void sse_mulss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x59); - emit_modrm( p, dst, src ); -} - -void sse_addps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x58); - emit_modrm( p, dst, src ); -} - -void sse_addss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x58); - emit_modrm( p, dst, src ); -} - -void sse_andnps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x55); - emit_modrm( p, dst, src ); -} - -void sse_andps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x54); - emit_modrm( p, dst, src ); -} - -void sse_rsqrtps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x52); - emit_modrm( p, dst, src ); -} - -void sse_rsqrtss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x52); - emit_modrm( p, dst, src ); - -} - -void sse_movhlps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod == mod_REG && src.mod == mod_REG); - emit_2ub(p, X86_TWOB, 0x12); - emit_modrm( p, dst, src ); -} - -void sse_movlhps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod == mod_REG && src.mod == mod_REG); - emit_2ub(p, X86_TWOB, 0x16); - emit_modrm( p, dst, src ); -} - -void sse_orps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x56); - emit_modrm( p, dst, src ); -} - -void sse_xorps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x57); - emit_modrm( p, dst, src ); -} - -void sse_cvtps2pi( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_XMM || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x2d); - emit_modrm( p, dst, src ); -} - - -/* Shufps can also be used to implement a reduced swizzle when dest == - * arg0. - */ -void sse_shufps( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char shuf) -{ - emit_2ub(p, X86_TWOB, 0xC6); - emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); -} - -void sse_cmpps( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char cc) -{ - emit_2ub(p, X86_TWOB, 0xC2); - emit_modrm(p, dest, arg0); - emit_1ub(p, cc); -} - -void sse_pmovmskb( struct x86_function *p, - struct x86_reg dest, - struct x86_reg src) -{ - emit_3ub(p, 0x66, X86_TWOB, 0xD7); - emit_modrm(p, dest, src); -} - -/*********************************************************************** - * SSE2 instructions - */ - -/** - * Perform a reduced swizzle: - */ -void sse2_pshufd( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char shuf) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x70); - emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); -} - -void sse2_cvttps2dq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); - emit_modrm( p, dst, src ); -} - -void sse2_cvtps2dq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x5B); - emit_modrm( p, dst, src ); -} - -void sse2_packssdw( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x6B); - emit_modrm( p, dst, src ); -} - -void sse2_packsswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x63); - emit_modrm( p, dst, src ); -} - -void sse2_packuswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x67); - emit_modrm( p, dst, src ); -} - -void sse2_rcpps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x53); - emit_modrm( p, dst, src ); -} - -void sse2_rcpss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x53); - emit_modrm( p, dst, src ); -} - -void sse2_movd( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, 0x66, X86_TWOB); - emit_op_modrm( p, 0x6e, 0x7e, dst, src ); -} - - - - -/*********************************************************************** - * x87 instructions - */ -void x87_fist( struct x86_function *p, struct x86_reg dst ) -{ - emit_1ub(p, 0xdb); - emit_modrm_noreg(p, 2, dst); -} - -void x87_fistp( struct x86_function *p, struct x86_reg dst ) -{ - emit_1ub(p, 0xdb); - emit_modrm_noreg(p, 3, dst); -} - -void x87_fild( struct x86_function *p, struct x86_reg arg ) -{ - emit_1ub(p, 0xdf); - emit_modrm_noreg(p, 0, arg); -} - -void x87_fldz( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xee); -} - - -void x87_fldcw( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_REG32); - assert(arg.mod != mod_REG); - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 5, arg); -} - -void x87_fld1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe8); -} - -void x87_fldl2e( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xea); -} - -void x87_fldln2( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xed); -} - -void x87_fwait( struct x86_function *p ) -{ - emit_1ub(p, 0x9b); -} - -void x87_fnclex( struct x86_function *p ) -{ - emit_2ub(p, 0xdb, 0xe2); -} - -void x87_fclex( struct x86_function *p ) -{ - x87_fwait(p); - x87_fnclex(p); -} - - -static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, - unsigned char dst0ub0, - unsigned char dst0ub1, - unsigned char arg0ub0, - unsigned char arg0ub1, - unsigned char argmem_noreg) -{ - assert(dst.file == file_x87); - - if (arg.file == file_x87) { - if (dst.idx == 0) - emit_2ub(p, dst0ub0, dst0ub1+arg.idx); - else if (arg.idx == 0) - emit_2ub(p, arg0ub0, arg0ub1+arg.idx); - else - assert(0); - } - else if (dst.idx == 0) { - assert(arg.file == file_REG32); - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, argmem_noreg, arg); - } - else - assert(0); -} - -void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xc8, - 0xdc, 0xc8, - 4); -} - -void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xe0, - 0xdc, 0xe8, - 4); -} - -void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xe8, - 0xdc, 0xe0, - 5); -} - -void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xc0, - 0xdc, 0xc0, - 0); -} - -void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xf0, - 0xdc, 0xf8, - 6); -} - -void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xf8, - 0xdc, 0xf0, - 7); -} - -void x87_fmulp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xc8+dst.idx); -} - -void x87_fsubp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xe8+dst.idx); -} - -void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xe0+dst.idx); -} - -void x87_faddp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xc0+dst.idx); -} - -void x87_fdivp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xf8+dst.idx); -} - -void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xf0+dst.idx); -} - -void x87_fucom( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xdd, 0xe0+arg.idx); -} - -void x87_fucomp( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xdd, 0xe8+arg.idx); -} - -void x87_fucompp( struct x86_function *p ) -{ - emit_2ub(p, 0xda, 0xe9); -} - -void x87_fxch( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xd9, 0xc8+arg.idx); -} - -void x87_fabs( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe1); -} - -void x87_fchs( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe0); -} - -void x87_fcos( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xff); -} - - -void x87_fprndint( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfc); -} - -void x87_fscale( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfd); -} - -void x87_fsin( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfe); -} - -void x87_fsincos( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfb); -} - -void x87_fsqrt( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfa); -} - -void x87_fxtract( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf4); -} - -/* st0 = (2^st0)-1 - * - * Restrictions: -1.0 <= st0 <= 1.0 - */ -void x87_f2xm1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf0); -} - -/* st1 = st1 * log2(st0); - * pop_stack; - */ -void x87_fyl2x( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf1); -} - -/* st1 = st1 * log2(st0 + 1.0); - * pop_stack; - * - * A fast operation, with restrictions: -.29 < st0 < .29 - */ -void x87_fyl2xp1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf9); -} - - -void x87_fld( struct x86_function *p, struct x86_reg arg ) -{ - if (arg.file == file_x87) - emit_2ub(p, 0xd9, 0xc0 + arg.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 0, arg); - } -} - -void x87_fst( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xdd, 0xd0 + dst.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 2, dst); - } -} - -void x87_fstp( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xdd, 0xd8 + dst.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 3, dst); - } -} - -void x87_fcom( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xd8, 0xd0 + dst.idx); - else { - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, 2, dst); - } -} - -void x87_fcomp( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xd8, 0xd8 + dst.idx); - else { - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, 3, dst); - } -} - - -void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_REG32); - - if (dst.idx == reg_AX && - dst.mod == mod_REG) - emit_2ub(p, 0xdf, 0xe0); - else { - emit_1ub(p, 0xdd); - emit_modrm_noreg(p, 7, dst); - } -} - - - - -/*********************************************************************** - * MMX instructions - */ - -void mmx_emms( struct x86_function *p ) -{ - assert(p->need_emms); - emit_2ub(p, 0x0f, 0x77); - p->need_emms = 0; -} - -void mmx_packssdw( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_MMX || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x6b); - emit_modrm( p, dst, src ); -} - -void mmx_packuswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_MMX || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x67); - emit_modrm( p, dst, src ); -} - -void mmx_movd( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - p->need_emms = 1; - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x6e, 0x7e, dst, src ); -} - -void mmx_movq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - p->need_emms = 1; - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x6f, 0x7f, dst, src ); -} - - -/*********************************************************************** - * Helper functions - */ - - -/* Retreive a reference to one of the function arguments, taking into - * account any push/pop activity: - */ -struct x86_reg x86_fn_arg( struct x86_function *p, - unsigned arg ) -{ - return x86_make_disp(x86_make_reg(file_REG32, reg_SP), - p->stack_offset + arg * 4); /* ??? */ -} - - -void x86_init_func( struct x86_function *p ) -{ - p->size = 0; - p->store = NULL; - p->csr = p->store; -} - -int x86_init_func_size( struct x86_function *p, unsigned code_size ) -{ - p->size = code_size; - p->store = _mesa_exec_malloc(code_size); - p->csr = p->store; - return p->store != NULL; -} - -void x86_release_func( struct x86_function *p ) -{ - _mesa_exec_free(p->store); - p->store = NULL; - p->csr = NULL; - p->size = 0; -} - - -void (*x86_get_func( struct x86_function *p ))(void) -{ - if (DISASSEM && p->store) - _mesa_printf("disassemble %p %p\n", p->store, p->csr); - return (void (*)(void)) (unsigned long) p->store; -} - -#else - -void x86sse_dummy( void ) -{ -} - -#endif diff --git a/src/libs/mesa/mesa/x86/rtasm/x86sse.h b/src/libs/mesa/mesa/x86/rtasm/x86sse.h deleted file mode 100644 index f6282f5bd4..0000000000 --- a/src/libs/mesa/mesa/x86/rtasm/x86sse.h +++ /dev/null @@ -1,256 +0,0 @@ - -#ifndef _X86SSE_H_ -#define _X86SSE_H_ - -#if defined(__i386__) || defined(__386__) - -/* It is up to the caller to ensure that instructions issued are - * suitable for the host cpu. There are no checks made in this module - * for mmx/sse/sse2 support on the cpu. - */ -struct x86_reg { - unsigned file:3; - unsigned idx:3; - unsigned mod:2; /* mod_REG if this is just a register */ - int disp:24; /* only +/- 23bits of offset - should be enough... */ -}; - -struct x86_function { - unsigned size; - unsigned char *store; - unsigned char *csr; - unsigned stack_offset; - int need_emms; - const char *fn; -}; - -enum x86_reg_file { - file_REG32, - file_MMX, - file_XMM, - file_x87 -}; - -/* Values for mod field of modr/m byte - */ -enum x86_reg_mod { - mod_INDIRECT, - mod_DISP8, - mod_DISP32, - mod_REG -}; - -enum x86_reg_name { - reg_AX, - reg_CX, - reg_DX, - reg_BX, - reg_SP, - reg_BP, - reg_SI, - reg_DI -}; - - -enum x86_cc { - cc_O, /* overflow */ - cc_NO, /* not overflow */ - cc_NAE, /* not above or equal / carry */ - cc_AE, /* above or equal / not carry */ - cc_E, /* equal / zero */ - cc_NE /* not equal / not zero */ -}; - -enum sse_cc { - cc_Equal, - cc_LessThan, - cc_LessThanEqual, - cc_Unordered, - cc_NotEqual, - cc_NotLessThan, - cc_NotLessThanEqual, - cc_Ordered -}; - -#define cc_Z cc_E -#define cc_NZ cc_NE - -/* Begin/end/retreive function creation: - */ - - -void x86_init_func( struct x86_function *p ); -int x86_init_func_size( struct x86_function *p, unsigned code_size ); -void x86_release_func( struct x86_function *p ); -void (*x86_get_func( struct x86_function *p ))( void ); - - - -/* Create and manipulate registers and regmem values: - */ -struct x86_reg x86_make_reg( enum x86_reg_file file, - enum x86_reg_name idx ); - -struct x86_reg x86_make_disp( struct x86_reg reg, - int disp ); - -struct x86_reg x86_deref( struct x86_reg reg ); - -struct x86_reg x86_get_base_reg( struct x86_reg reg ); - - -/* Labels, jumps and fixup: - */ -unsigned char *x86_get_label( struct x86_function *p ); - -void x86_jcc( struct x86_function *p, - enum x86_cc cc, - unsigned char *label ); - -unsigned char *x86_jcc_forward( struct x86_function *p, - enum x86_cc cc ); - -unsigned char *x86_jmp_forward( struct x86_function *p); - -unsigned char *x86_call_forward( struct x86_function *p); - -void x86_fixup_fwd_jump( struct x86_function *p, - unsigned char *fixup ); - -void x86_jmp( struct x86_function *p, unsigned char *label ); - -/* void x86_call( struct x86_function *p, void (*label)() ); */ -void x86_call( struct x86_function *p, struct x86_reg reg); - -/* michal: - * Temporary. As I need immediate operands, and dont want to mess with the codegen, - * I load the immediate into general purpose register and use it. - */ -void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ); - - -/* Macro for sse_shufps() and sse2_pshufd(): - */ -#define SHUF(_x,_y,_z,_w) (((_x)<<0) | ((_y)<<2) | ((_z)<<4) | ((_w)<<6)) -#define SHUF_NOOP RSW(0,1,2,3) -#define GET_SHUF(swz, idx) (((swz) >> ((idx)*2)) & 0x3) - -void mmx_emms( struct x86_function *p ); -void mmx_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_movq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); - -void sse2_cvtps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_cvttps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packsswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_pshufd( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf ); -void sse2_rcpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_rcpss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); - -void sse_addps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_addss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_cvtps2pi( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_divss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_andnps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_andps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_cmpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src, - unsigned char cc ); -void sse_maxps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_maxss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_minps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movaps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movhlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movlhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movups( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_mulps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_mulss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_orps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_xorps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_subps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_rsqrtps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_rsqrtss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf ); -void sse_pmovmskb( struct x86_function *p, struct x86_reg dest, struct x86_reg src ); - -void x86_add( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_and( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_cmp( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_dec( struct x86_function *p, struct x86_reg reg ); -void x86_inc( struct x86_function *p, struct x86_reg reg ); -void x86_lea( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_mov( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_mul( struct x86_function *p, struct x86_reg src ); -void x86_or( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_pop( struct x86_function *p, struct x86_reg reg ); -void x86_push( struct x86_function *p, struct x86_reg reg ); -void x86_ret( struct x86_function *p ); -void x86_sub( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_test( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_xor( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_sahf( struct x86_function *p ); - -void x87_f2xm1( struct x86_function *p ); -void x87_fabs( struct x86_function *p ); -void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_faddp( struct x86_function *p, struct x86_reg dst ); -void x87_fchs( struct x86_function *p ); -void x87_fclex( struct x86_function *p ); -void x87_fcom( struct x86_function *p, struct x86_reg dst ); -void x87_fcomp( struct x86_function *p, struct x86_reg dst ); -void x87_fcos( struct x86_function *p ); -void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fdivp( struct x86_function *p, struct x86_reg dst ); -void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fdivrp( struct x86_function *p, struct x86_reg dst ); -void x87_fild( struct x86_function *p, struct x86_reg arg ); -void x87_fist( struct x86_function *p, struct x86_reg dst ); -void x87_fistp( struct x86_function *p, struct x86_reg dst ); -void x87_fld( struct x86_function *p, struct x86_reg arg ); -void x87_fld1( struct x86_function *p ); -void x87_fldcw( struct x86_function *p, struct x86_reg arg ); -void x87_fldl2e( struct x86_function *p ); -void x87_fldln2( struct x86_function *p ); -void x87_fldz( struct x86_function *p ); -void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fmulp( struct x86_function *p, struct x86_reg dst ); -void x87_fnclex( struct x86_function *p ); -void x87_fprndint( struct x86_function *p ); -void x87_fscale( struct x86_function *p ); -void x87_fsin( struct x86_function *p ); -void x87_fsincos( struct x86_function *p ); -void x87_fsqrt( struct x86_function *p ); -void x87_fst( struct x86_function *p, struct x86_reg dst ); -void x87_fstp( struct x86_function *p, struct x86_reg dst ); -void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fsubp( struct x86_function *p, struct x86_reg dst ); -void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fsubrp( struct x86_function *p, struct x86_reg dst ); -void x87_fxch( struct x86_function *p, struct x86_reg dst ); -void x87_fxtract( struct x86_function *p ); -void x87_fyl2x( struct x86_function *p ); -void x87_fyl2xp1( struct x86_function *p ); -void x87_fwait( struct x86_function *p ); -void x87_fnstsw( struct x86_function *p, struct x86_reg dst ); -void x87_fucompp( struct x86_function *p ); -void x87_fucomp( struct x86_function *p, struct x86_reg arg ); -void x87_fucom( struct x86_function *p, struct x86_reg arg ); - - - -/* Retreive a reference to one of the function arguments, taking into - * account any push/pop activity. Note - doesn't track explict - * manipulation of ESP by other instructions. - */ -struct x86_reg x86_fn_arg( struct x86_function *p, unsigned arg ); - -#endif -#endif diff --git a/src/libs/mesa/mesa/x86/sse.c b/src/libs/mesa/mesa/x86/sse.c deleted file mode 100644 index 1c185387c6..0000000000 --- a/src/libs/mesa/mesa/x86/sse.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.0 - * - * Copyright (C) 1999-2004 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 - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "math/m_xform.h" -#include "tnl/t_context.h" - -#include "sse.h" -#include "common_x86_macros.h" - -#ifdef DEBUG_MATH -#include "math/m_debug.h" -#endif - - -#ifdef USE_SSE_ASM -DECLARE_XFORM_GROUP( sse, 2 ) -DECLARE_XFORM_GROUP( sse, 3 ) - -#if 1 -/* Some functions are not written in SSE-assembly, because the fpu ones are faster */ -extern void _ASMAPI _mesa_sse_transform_normals_no_rot( NORM_ARGS ); -extern void _ASMAPI _mesa_sse_transform_rescale_normals( NORM_ARGS ); -extern void _ASMAPI _mesa_sse_transform_rescale_normals_no_rot( NORM_ARGS ); - -extern void _ASMAPI _mesa_sse_transform_points4_general( XFORM_ARGS ); -extern void _ASMAPI _mesa_sse_transform_points4_3d( XFORM_ARGS ); -/* XXX this function segfaults, see below */ -extern void _ASMAPI _mesa_sse_transform_points4_identity( XFORM_ARGS ); -/* XXX this one works, see below */ -extern void _ASMAPI _mesa_x86_transform_points4_identity( XFORM_ARGS ); -#else -DECLARE_NORM_GROUP( sse ) -#endif - - -extern void _ASMAPI -_mesa_v16_sse_general_xform( GLfloat *first_vert, - const GLfloat *m, - const GLfloat *src, - GLuint src_stride, - GLuint count ); - -extern void _ASMAPI -_mesa_sse_project_vertices( GLfloat *first, - GLfloat *last, - const GLfloat *m, - GLuint stride ); - -extern void _ASMAPI -_mesa_sse_project_clipped_vertices( GLfloat *first, - GLfloat *last, - const GLfloat *m, - GLuint stride, - const GLubyte *clipmask ); -#endif - - -void _mesa_init_sse_transform_asm( void ) -{ -#ifdef USE_SSE_ASM - ASSIGN_XFORM_GROUP( sse, 2 ); - ASSIGN_XFORM_GROUP( sse, 3 ); - -#if 1 - /* TODO: Finish these off. - */ - _mesa_transform_tab[4][MATRIX_GENERAL] = - _mesa_sse_transform_points4_general; - _mesa_transform_tab[4][MATRIX_3D] = - _mesa_sse_transform_points4_3d; - /* XXX NOTE: _mesa_sse_transform_points4_identity segfaults with the - conformance tests, so use the x86 version. - */ - _mesa_transform_tab[4][MATRIX_IDENTITY] = - _mesa_x86_transform_points4_identity;/*_mesa_sse_transform_points4_identity;*/ - - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = - _mesa_sse_transform_normals_no_rot; - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = - _mesa_sse_transform_rescale_normals; - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = - _mesa_sse_transform_rescale_normals_no_rot; -#else - ASSIGN_XFORM_GROUP( sse, 4 ); - - ASSIGN_NORM_GROUP( sse ); -#endif - -#ifdef DEBUG_MATH - _math_test_all_transform_functions( "SSE" ); - _math_test_all_normal_transform_functions( "SSE" ); -#endif -#endif -} - diff --git a/src/libs/mesa/mesa/x86/sse.h b/src/libs/mesa/mesa/x86/sse.h deleted file mode 100644 index 521f91e411..0000000000 --- a/src/libs/mesa/mesa/x86/sse.h +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 - */ - -#ifndef __SSE_H__ -#define __SSE_H__ - -#include "math/m_xform.h" - -void _mesa_init_sse_transform_asm( void ); - -#endif diff --git a/src/libs/mesa/mesa/x86/sse_normal.S b/src/libs/mesa/mesa/x86/sse_normal.S deleted file mode 100644 index a8c0d38c7e..0000000000 --- a/src/libs/mesa/mesa/x86/sse_normal.S +++ /dev/null @@ -1,261 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/** 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 ! - */ - -#ifdef USE_SSE_ASM -#include "assyntax.h" -#include "matypes.h" -#include "norm_args.h" - - SEG_TEXT - -#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) - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_sse_transform_rescale_normals_no_rot) -HIDDEN(_mesa_sse_transform_rescale_normals_no_rot) -GLNAME(_mesa_sse_transform_rescale_normals_no_rot): - -#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(MATRIX_INV, EDX), EDX) /* matrix->inv */ - - MOV_L ( REGOFF(V4F_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(V4F_COUNT, EDI) ) /* set dest-count */ - - IMUL_L( CONST(16), 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 ( 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(16), 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(_mesa_sse_transform_rescale_normals) -HIDDEN(_mesa_sse_transform_rescale_normals) -GLNAME(_mesa_sse_transform_rescale_normals): - -#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(MATRIX_INV, EDX), EDX) /* matrix->inv */ - - MOV_L ( REGOFF(V4F_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(V4F_COUNT, EDI) ) /* set dest-count */ - - IMUL_L( CONST(16), 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(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(16), 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(_mesa_sse_transform_normals_no_rot) -HIDDEN(_mesa_sse_transform_normals_no_rot) -GLNAME(_mesa_sse_transform_normals_no_rot): - -#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(MATRIX_INV, EDX), EDX) /* matrix->inv */ - - MOV_L ( REGOFF(V4F_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(V4F_COUNT, EDI) ) /* set dest-count */ - - IMUL_L( CONST(16), 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 */ - -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(16), 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 -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/sse_xform1.S b/src/libs/mesa/mesa/x86/sse_xform1.S deleted file mode 100644 index 4aa9de607c..0000000000 --- a/src/libs/mesa/mesa/x86/sse_xform1.S +++ /dev/null @@ -1,446 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/** 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 ! - */ - -#ifdef USE_SSE_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define S(i) REGOFF(i * 4, ESI) -#define D(i) REGOFF(i * 4, EDI) -#define M(i) REGOFF(i * 4, EDX) - - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_sse_transform_points1_general) -HIDDEN( _mesa_sse_transform_points1_general ) -GLNAME( _mesa_sse_transform_points1_general ): - -#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 - MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */ - MOVAPS( 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(_mesa_sse_transform_points1_identity) -HIDDEN(_mesa_sse_transform_points1_identity) -GLNAME( _mesa_sse_transform_points1_identity ): - -#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(_mesa_sse_transform_points1_3d_no_rot) -HIDDEN(_mesa_sse_transform_points1_3d_no_rot) -GLNAME(_mesa_sse_transform_points1_3d_no_rot): - -#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(_mesa_sse_transform_points1_perspective) -HIDDEN(_mesa_sse_transform_points1_perspective) -GLNAME(_mesa_sse_transform_points1_perspective): - -#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(_mesa_sse_transform_points1_2d) -HIDDEN(_mesa_sse_transform_points1_2d) -GLNAME(_mesa_sse_transform_points1_2d): - -#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(_mesa_sse_transform_points1_2d_no_rot) -HIDDEN(_mesa_sse_transform_points1_2d_no_rot) -GLNAME(_mesa_sse_transform_points1_2d_no_rot): - -#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(_mesa_sse_transform_points1_3d) -HIDDEN(_mesa_sse_transform_points1_3d) -GLNAME(_mesa_sse_transform_points1_3d): - -#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 - MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */ - MOVAPS( 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 -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/sse_xform2.S b/src/libs/mesa/mesa/x86/sse_xform2.S deleted file mode 100644 index 91b82e7297..0000000000 --- a/src/libs/mesa/mesa/x86/sse_xform2.S +++ /dev/null @@ -1,465 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/** 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 ! - */ - -#ifdef USE_SSE_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define S(i) REGOFF(i * 4, ESI) -#define D(i) REGOFF(i * 4, EDI) -#define M(i) REGOFF(i * 4, EDX) - - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_sse_transform_points2_general) -HIDDEN (_mesa_sse_transform_points2_general) -GLNAME( _mesa_sse_transform_points2_general ): - -#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 - MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */ - MOVAPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */ - MOVAPS( 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 ) - MOVAPS( 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(_mesa_sse_transform_points2_identity) -HIDDEN(_mesa_sse_transform_points2_identity) -GLNAME( _mesa_sse_transform_points2_identity ): - -#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(_mesa_sse_transform_points2_3d_no_rot) -HIDDEN(_mesa_sse_transform_points2_3d_no_rot) -GLNAME(_mesa_sse_transform_points2_3d_no_rot): - -#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(_mesa_sse_transform_points2_perspective) -HIDDEN(_mesa_sse_transform_points2_perspective) -GLNAME(_mesa_sse_transform_points2_perspective): - -#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(_mesa_sse_transform_points2_2d) -HIDDEN(_mesa_sse_transform_points2_2d) -GLNAME(_mesa_sse_transform_points2_2d): - -#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(_mesa_sse_transform_points2_2d_no_rot) -HIDDEN(_mesa_sse_transform_points2_2d_no_rot) -GLNAME(_mesa_sse_transform_points2_2d_no_rot): - -#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(_mesa_sse_transform_points2_3d) -HIDDEN(_mesa_sse_transform_points2_3d) -GLNAME(_mesa_sse_transform_points2_3d): - -#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 - MOVAPS( M(0), XMM0 ) /* m2 | m1 | m0 */ - MOVAPS( M(4), XMM1 ) /* m6 | m5 | m4 */ - MOVAPS( 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 -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/sse_xform3.S b/src/libs/mesa/mesa/x86/sse_xform3.S deleted file mode 100644 index 1fc79ef21b..0000000000 --- a/src/libs/mesa/mesa/x86/sse_xform3.S +++ /dev/null @@ -1,511 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/** 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 ! - */ - -#ifdef USE_SSE_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define S(i) REGOFF(i * 4, ESI) -#define D(i) REGOFF(i * 4, EDI) -#define M(i) REGOFF(i * 4, EDX) - - -ALIGNTEXT4 -GLOBL GLNAME(_mesa_sse_transform_points3_general) -HIDDEN(_mesa_sse_transform_points3_general) -GLNAME( _mesa_sse_transform_points3_general ): - -#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 - MOVAPS ( REGOFF(0, EDX), XMM0 ) /* m0 | m1 | m2 | m3 */ - MOVAPS ( REGOFF(16, EDX), XMM1 ) /* m4 | m5 | m6 | m7 */ - MOVAPS ( REGOFF(32, EDX), XMM2 ) /* m8 | m9 | m10 | m11 */ - MOVAPS ( 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 ) - - MOVAPS ( 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(_mesa_sse_transform_points3_identity) -HIDDEN(_mesa_sse_transform_points3_identity) -GLNAME( _mesa_sse_transform_points3_identity ): - -#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(_mesa_sse_transform_points3_3d_no_rot) -HIDDEN(_mesa_sse_transform_points3_3d_no_rot) -GLNAME(_mesa_sse_transform_points3_3d_no_rot): - -#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(_mesa_sse_transform_points3_perspective) -HIDDEN(_mesa_sse_transform_points3_perspective) -GLNAME(_mesa_sse_transform_points3_perspective): - -#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(_mesa_sse_transform_points3_2d) -HIDDEN(_mesa_sse_transform_points3_2d) -GLNAME(_mesa_sse_transform_points3_2d): - -#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(_mesa_sse_transform_points3_2d_no_rot) -HIDDEN(_mesa_sse_transform_points3_2d_no_rot) -GLNAME(_mesa_sse_transform_points3_2d_no_rot): - -#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(_mesa_sse_transform_points3_3d) -HIDDEN(_mesa_sse_transform_points3_3d) -GLNAME(_mesa_sse_transform_points3_3d): - -#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 - MOVAPS( M(0), XMM0 ) /* m2 | m1 | m0 */ - MOVAPS( M(4), XMM1 ) /* m6 | m5 | m4 */ - MOVAPS( M(8), XMM2 ) /* m10 | m9 | m8 */ - MOVAPS( 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 -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/sse_xform4.S b/src/libs/mesa/mesa/x86/sse_xform4.S deleted file mode 100644 index fb1fa741c0..0000000000 --- a/src/libs/mesa/mesa/x86/sse_xform4.S +++ /dev/null @@ -1,235 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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 USE_SSE_ASM -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FRAME_OFFSET 8 - -#define SRC(i) REGOFF(i * 4, ESI) -#define DST(i) REGOFF(i * 4, EDI) -#define MAT(i) REGOFF(i * 4, EDX) - -#define SELECT(r0, r1, r2, r3) CONST( r0 * 64 + r1 * 16 + r2 * 4 + r3 ) - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_sse_transform_points4_general ) -HIDDEN(_mesa_sse_transform_points4_general) -GLNAME( _mesa_sse_transform_points4_general ): - - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) /* verify non-zero count */ - JE( LLBL( sse_general_done ) ) - - 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 */ - - MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */ - MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */ - - PREFETCHT0( REGIND(ESI) ) - - MOVAPS( MAT(0), XMM4 ) /* m3 | m2 | m1 | m0 */ - MOVAPS( MAT(4), XMM5 ) /* m7 | m6 | m5 | m4 */ - MOVAPS( MAT(8), XMM6 ) /* m11 | m10 | m9 | m8 */ - MOVAPS( MAT(12), XMM7 ) /* m15 | m14 | m13 | m12 */ - -ALIGNTEXT16 -LLBL( sse_general_loop ): - - MOVSS( SRC(0), XMM0 ) /* ox */ - SHUFPS( CONST(0x0), XMM0, XMM0 ) /* ox | ox | ox | ox */ - MULPS( XMM4, XMM0 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */ - - MOVSS( SRC(1), XMM1 ) /* oy */ - SHUFPS( CONST(0x0), XMM1, XMM1 ) /* oy | oy | oy | oy */ - MULPS( XMM5, XMM1 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */ - - MOVSS( SRC(2), XMM2 ) /* oz */ - SHUFPS( CONST(0x0), XMM2, XMM2 ) /* oz | oz | oz | oz */ - MULPS( XMM6, XMM2 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */ - - MOVSS( SRC(3), XMM3 ) /* ow */ - SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ow | ow | ow | ow */ - MULPS( XMM7, XMM3 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */ - - ADDPS( XMM1, XMM0 ) /* ox*m3+oy*m7 | ... */ - ADDPS( XMM2, XMM0 ) /* ox*m3+oy*m7+oz*m11 | ... */ - ADDPS( XMM3, XMM0 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */ - MOVAPS( XMM0, DST(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */ - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - - DEC_L( ECX ) - JNZ( LLBL( sse_general_loop ) ) - -LLBL( sse_general_done ): - - POP_L( EDI ) - POP_L( ESI ) - RET - - - - -ALIGNTEXT4 -GLOBL GLNAME( _mesa_sse_transform_points4_3d ) -HIDDEN(_mesa_sse_transform_points4_3d) -GLNAME( _mesa_sse_transform_points4_3d ): - - PUSH_L( ESI ) - PUSH_L( EDI ) - - 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( 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 */ - - MOVAPS( MAT(0), XMM0 ) /* m3 | m2 | m1 | m0 */ - MOVAPS( MAT(4), XMM1 ) /* m7 | m6 | m5 | m4 */ - MOVAPS( MAT(8), XMM2 ) /* m11 | m10 | m9 | m8 */ - MOVAPS( MAT(12), XMM3 ) /* m15 | m14 | m13 | m12 */ - -ALIGNTEXT32 -LLBL( K_GTP43P3DR_top ): - MOVSS( SRC(0), XMM4 ) /* ox */ - SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */ - MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */ - - MOVSS( SRC(1), XMM5 ) /* oy */ - SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */ - MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */ - - MOVSS( SRC(2), XMM6 ) /* oz */ - SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */ - MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */ - - MOVSS( SRC(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 | ... */ - MOVAPS( XMM4, DST(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */ - - MOVSS( SRC(3), XMM4 ) /* ow */ - MOVSS( XMM4, DST(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 - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_sse_transform_points4_identity ) -HIDDEN(_mesa_sse_transform_points4_identity) -GLNAME( _mesa_sse_transform_points4_identity ): - - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) /* verify non-zero count */ - JE( LLBL( sse_identity_done ) ) - - 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 */ - - MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */ - MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */ - -ALIGNTEXT16 -LLBL( sse_identity_loop ): - - PREFETCHNTA( REGOFF(32, ESI) ) - - MOVAPS( REGIND(ESI), XMM0 ) - ADD_L( EAX, ESI ) - - MOVAPS( XMM0, REGIND(EDI) ) - ADD_L( CONST(16), EDI ) - - DEC_L( ECX ) - JNZ( LLBL( sse_identity_loop ) ) - -LLBL( sse_identity_done ): - - POP_L( EDI ) - POP_L( ESI ) - RET -#endif - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/x86.c b/src/libs/mesa/mesa/x86/x86.c deleted file mode 100644 index ce649f66b0..0000000000 --- a/src/libs/mesa/mesa/x86/x86.c +++ /dev/null @@ -1,95 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Intel x86 assembly code by Josh Vanderhoof - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "math/m_xform.h" -#include "tnl/t_context.h" - -#include "x86.h" -#include "common_x86_macros.h" - -#ifdef DEBUG_MATH -#include "math/m_debug.h" -#endif - - -#ifdef USE_X86_ASM -DECLARE_XFORM_GROUP( x86, 2 ) -DECLARE_XFORM_GROUP( x86, 3 ) -DECLARE_XFORM_GROUP( x86, 4 ) - - -extern GLvector4f * _ASMAPI -_mesa_x86_cliptest_points4( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ); - -extern GLvector4f * _ASMAPI -_mesa_x86_cliptest_points4_np( GLvector4f *clip_vec, - GLvector4f *proj_vec, - GLubyte clipMask[], - GLubyte *orMask, - GLubyte *andMask ); - -extern void _ASMAPI -_mesa_v16_x86_cliptest_points4( GLfloat *first_vert, - GLfloat *last_vert, - GLubyte *or_mask, - GLubyte *and_mask, - GLubyte *clip_mask ); - -extern void _ASMAPI -_mesa_v16_x86_general_xform( GLfloat *dest, - const GLfloat *m, - const GLfloat *src, - GLuint src_stride, - GLuint count ); -#endif - - -void _mesa_init_x86_transform_asm( void ) -{ -#ifdef USE_X86_ASM - ASSIGN_XFORM_GROUP( x86, 2 ); - ASSIGN_XFORM_GROUP( x86, 3 ); - ASSIGN_XFORM_GROUP( x86, 4 ); - - _mesa_clip_tab[4] = _mesa_x86_cliptest_points4; - _mesa_clip_np_tab[4] = _mesa_x86_cliptest_points4_np; - -#ifdef DEBUG_MATH - _math_test_all_transform_functions( "x86" ); - _math_test_all_cliptest_functions( "x86" ); -#endif -#endif -} - diff --git a/src/libs/mesa/mesa/x86/x86.h b/src/libs/mesa/mesa/x86/x86.h deleted file mode 100644 index 97651ec6ee..0000000000 --- a/src/libs/mesa/mesa/x86/x86.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Intel x86 assembly code by Josh Vanderhoof - */ - -#ifndef __X86_H__ -#define __X86_H__ - -extern void _mesa_init_x86_transform_asm( void ); - -#endif diff --git a/src/libs/mesa/mesa/x86/x86_cliptest.S b/src/libs/mesa/mesa/x86/x86_cliptest.S deleted file mode 100644 index e413aee61e..0000000000 --- a/src/libs/mesa/mesa/x86/x86_cliptest.S +++ /dev/null @@ -1,407 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * NOTE: Avoid using spaces in between '(' ')' and arguments, especially - * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces - * in there will break the build on some platforms. - */ - -#include "assyntax.h" -#include "matypes.h" -#include "clip_args.h" - -#define SRC0 REGOFF(0, ESI) -#define SRC1 REGOFF(4, ESI) -#define SRC2 REGOFF(8, ESI) -#define SRC3 REGOFF(12, ESI) -#define DST0 REGOFF(0, EDI) -#define DST1 REGOFF(4, EDI) -#define DST2 REGOFF(8, EDI) -#define DST3 REGOFF(12, EDI) -#define MAT0 REGOFF(0, EDX) -#define MAT1 REGOFF(4, EDX) -#define MAT2 REGOFF(8, EDX) -#define MAT3 REGOFF(12, EDX) - - -/* - * Table for clip test. - * - * bit6 = SRC3 < 0 - * bit5 = SRC2 < 0 - * bit4 = abs(S(2)) > abs(S(3)) - * bit3 = SRC1 < 0 - * bit2 = abs(S(1)) > abs(S(3)) - * bit1 = SRC0 < 0 - * bit0 = abs(S(0)) > abs(S(3)) - */ - - SEG_DATA - -clip_table: - D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06 - D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a - D_BYTE 0x20, 0x21, 0x20, 0x22, 0x24, 0x25, 0x24, 0x26 - D_BYTE 0x20, 0x21, 0x20, 0x22, 0x28, 0x29, 0x28, 0x2a - D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06 - D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a - D_BYTE 0x10, 0x11, 0x10, 0x12, 0x14, 0x15, 0x14, 0x16 - D_BYTE 0x10, 0x11, 0x10, 0x12, 0x18, 0x19, 0x18, 0x1a - D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36 - D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a - D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x27, 0x25, 0x27, 0x26 - D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x2b, 0x29, 0x2b, 0x2a - D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36 - D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a - D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x17, 0x15, 0x17, 0x16 - D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x1b, 0x19, 0x1b, 0x1a - - - SEG_TEXT - -/* - * _mesa_x86_cliptest_points4 - * - * AL: ormask - * AH: andmask - * EBX: temp0 - * ECX: temp1 - * EDX: clipmask[] - * ESI: clip[] - * EDI: proj[] - * EBP: temp2 - */ - -#if defined(__ELF__) && defined(__PIC__) && defined(GNU_ASSEMBLER) && !defined(ELFPIC) -#define ELFPIC -#endif - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_cliptest_points4 ) -HIDDEN(_mesa_x86_cliptest_points4) -GLNAME( _mesa_x86_cliptest_points4 ): - -#ifdef ELFPIC -#define FRAME_OFFSET 20 -#else -#define FRAME_OFFSET 16 -#endif - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBP ) - PUSH_L( EBX ) - -#ifdef ELFPIC - /* store pointer to clip_table on stack */ - CALL( LLBL(ctp4_get_eip) ) - ADD_L( CONST(_GLOBAL_OFFSET_TABLE_), EBX ) - MOV_L( REGOFF(clip_table@GOT, EBX), EBX ) - PUSH_L( EBX ) - JMP( LLBL(ctp4_clip_table_ready) ) - -LLBL(ctp4_get_eip): - /* store eip in ebx */ - MOV_L( REGIND(ESP), EBX ) - RET - -LLBL(ctp4_clip_table_ready): -#endif - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_CLIP, EDX ) - MOV_L( ARG_OR, EBX ) - - MOV_L( ARG_AND, EBP ) - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - MOV_L( EAX, ARG_SOURCE ) /* put stride in ARG_SOURCE */ - - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDX, ECX ) - - MOV_L( ECX, ARG_CLIP ) /* put clipmask + count in ARG_CLIP */ - CMP_L( ECX, EDX ) - - MOV_B( REGIND(EBX), AL ) - MOV_B( REGIND(EBP), AH ) - - JZ( LLBL(ctp4_finish) ) - -ALIGNTEXT16 -LLBL(ctp4_top): - - FLD1 /* F3 */ - FDIV_S( SRC3 ) /* GH: don't care about div-by-zero */ - - MOV_L( SRC3, EBP ) - MOV_L( SRC2, EBX ) - - XOR_L( ECX, ECX ) - ADD_L( EBP, EBP ) /* ebp = abs(S(3))*2 ; carry = sign of S(3) */ - - ADC_L( ECX, ECX ) - ADD_L( EBX, EBX ) /* ebx = abs(S(2))*2 ; carry = sign of S(2) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(2))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - MOV_L( SRC1, EBX ) - - ADD_L( EBX, EBX ) /* ebx = abs(S(1))*2 ; carry = sign of S(1) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(1))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - MOV_L( SRC0, EBX ) - - ADD_L( EBX, EBX ) /* ebx = abs(S(0))*2 ; carry = sign of S(0) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(0))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - -#ifdef ELFPIC - MOV_L( REGIND(ESP), EBP ) /* clip_table */ - - MOV_B( REGBI(EBP, ECX), CL ) -#else - MOV_B( REGOFF(clip_table,ECX), CL ) -#endif - - OR_B( CL, AL ) - AND_B( CL, AH ) - - TEST_B( CL, CL ) - MOV_B( CL, REGIND(EDX) ) - - JZ( LLBL(ctp4_proj) ) - -LLBL(ctp4_noproj): - - FSTP( ST(0) ) /* */ - - MOV_L( CONST(0), DST0 ) - MOV_L( CONST(0), DST1 ) - MOV_L( CONST(0), DST2 ) - MOV_L( CONST(0x3f800000), DST3 ) - - JMP( LLBL(ctp4_next) ) - -LLBL(ctp4_proj): - - FLD_S( SRC0 ) /* F0 F3 */ - FMUL2( ST(1), ST0 ) - - FLD_S( SRC1 ) /* F1 F0 F3 */ - FMUL2( ST(2), ST0 ) - - FLD_S( SRC2 ) /* F2 F1 F0 F3 */ - FMUL2( ST(3), ST0 ) - - FXCH( ST(2) ) /* F0 F1 F2 F3 */ - FSTP_S( DST0 ) /* F1 F2 F3 */ - FSTP_S( DST1 ) /* F2 F3 */ - FSTP_S( DST2 ) /* F3 */ - FSTP_S( DST3 ) /* */ - -LLBL(ctp4_next): - - INC_L( EDX ) - ADD_L( CONST(16), EDI ) - - ADD_L( ARG_SOURCE, ESI ) - CMP_L( EDX, ARG_CLIP ) - - JNZ( LLBL(ctp4_top) ) - - MOV_L( ARG_OR, ECX ) - MOV_L( ARG_AND, EDX ) - - MOV_B( AL, REGIND(ECX) ) - MOV_B( AH, REGIND(EDX) ) - -LLBL(ctp4_finish): - - MOV_L( ARG_DEST, EAX ) -#ifdef ELFPIC - POP_L( ESI ) /* discard ptr to clip_table */ -#endif - POP_L( EBX ) - POP_L( EBP ) - POP_L( EDI ) - POP_L( ESI ) - - RET - - - - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_cliptest_points4_np ) -HIDDEN(_mesa_x86_cliptest_points4_np) -GLNAME( _mesa_x86_cliptest_points4_np ): - -#ifdef ELFPIC -#define FRAME_OFFSET 20 -#else -#define FRAME_OFFSET 16 -#endif - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBP ) - PUSH_L( EBX ) - -#ifdef ELFPIC - /* store pointer to clip_table on stack */ - CALL( LLBL(ctp4_np_get_eip) ) - ADD_L( CONST(_GLOBAL_OFFSET_TABLE_), EBX ) - MOV_L( REGOFF(clip_table@GOT, EBX), EBX ) - PUSH_L( EBX ) - JMP( LLBL(ctp4_np_clip_table_ready) ) - -LLBL(ctp4_np_get_eip): - /* store eip in ebx */ - MOV_L( REGIND(ESP), EBX ) - RET - -LLBL(ctp4_np_clip_table_ready): -#endif - - MOV_L( ARG_SOURCE, ESI ) - /* slot */ - - MOV_L( ARG_CLIP, EDX ) - MOV_L( ARG_OR, EBX ) - - MOV_L( ARG_AND, EBP ) - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( EAX, ARG_DEST ) /* put stride in ARG_DEST */ - ADD_L( EDX, ECX ) - - MOV_L( ECX, EDI ) /* put clipmask + count in EDI */ - CMP_L( ECX, EDX ) - - MOV_B( REGIND(EBX), AL ) - MOV_B( REGIND(EBP), AH ) - - JZ( LLBL(ctp4_np_finish) ) - -ALIGNTEXT16 -LLBL(ctp4_np_top): - - MOV_L( SRC3, EBP ) - MOV_L( SRC2, EBX ) - - XOR_L( ECX, ECX ) - ADD_L( EBP, EBP ) /* ebp = abs(S(3))*2 ; carry = sign of S(3) */ - - ADC_L( ECX, ECX ) - ADD_L( EBX, EBX ) /* ebx = abs(S(2))*2 ; carry = sign of S(2) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(2))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - MOV_L( SRC1, EBX ) - - ADD_L( EBX, EBX ) /* ebx = abs(S(1))*2 ; carry = sign of S(1) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(1))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - MOV_L( SRC0, EBX ) - - ADD_L( EBX, EBX ) /* ebx = abs(S(0))*2 ; carry = sign of S(0) */ - - ADC_L( ECX, ECX ) - CMP_L( EBX, EBP ) /* carry = abs(S(0))*2 > abs(S(3))*2 */ - - ADC_L( ECX, ECX ) - -#ifdef ELFPIC - MOV_L( REGIND(ESP), EBP ) /* clip_table */ - - MOV_B( REGBI(EBP, ECX), CL ) -#else - MOV_B( REGOFF(clip_table,ECX), CL ) -#endif - - OR_B( CL, AL ) - AND_B( CL, AH ) - - TEST_B( CL, CL ) - MOV_B( CL, REGIND(EDX) ) - - INC_L( EDX ) - /* slot */ - - ADD_L( ARG_DEST, ESI ) - CMP_L( EDX, EDI ) - - JNZ( LLBL(ctp4_np_top) ) - - MOV_L( ARG_OR, ECX ) - MOV_L( ARG_AND, EDX ) - - MOV_B( AL, REGIND(ECX) ) - MOV_B( AH, REGIND(EDX) ) - -LLBL(ctp4_np_finish): - - MOV_L( ARG_SOURCE, EAX ) -#ifdef ELFPIC - POP_L( ESI ) /* discard ptr to clip_table */ -#endif - POP_L( EBX ) - POP_L( EBP ) - POP_L( EDI ) - POP_L( ESI ) - - RET - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/x86_xform2.S b/src/libs/mesa/mesa/x86/x86_xform2.S deleted file mode 100644 index 980725ef51..0000000000 --- a/src/libs/mesa/mesa/x86/x86_xform2.S +++ /dev/null @@ -1,574 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * NOTE: Avoid using spaces in between '(' ')' and arguments, especially - * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces - * in there will break the build on some platforms. - */ - -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FP_ONE 1065353216 -#define FP_ZERO 0 - -#define SRC0 REGOFF(0, ESI) -#define SRC1 REGOFF(4, ESI) -#define SRC2 REGOFF(8, ESI) -#define SRC3 REGOFF(12, ESI) -#define DST0 REGOFF(0, EDI) -#define DST1 REGOFF(4, EDI) -#define DST2 REGOFF(8, EDI) -#define DST3 REGOFF(12, EDI) -#define MAT0 REGOFF(0, EDX) -#define MAT1 REGOFF(4, EDX) -#define MAT2 REGOFF(8, EDX) -#define MAT3 REGOFF(12, EDX) -#define MAT4 REGOFF(16, EDX) -#define MAT5 REGOFF(20, EDX) -#define MAT6 REGOFF(24, EDX) -#define MAT7 REGOFF(28, EDX) -#define MAT8 REGOFF(32, EDX) -#define MAT9 REGOFF(36, EDX) -#define MAT10 REGOFF(40, EDX) -#define MAT11 REGOFF(44, EDX) -#define MAT12 REGOFF(48, EDX) -#define MAT13 REGOFF(52, EDX) -#define MAT14 REGOFF(56, EDX) -#define MAT15 REGOFF(60, EDX) - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_general ) -HIDDEN(_mesa_x86_transform_points2_general) -GLNAME( _mesa_x86_transform_points2_general ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_gr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p2_gr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - FLD_S( SRC0 ) /* F7 F6 F5 F4 */ - FMUL_S( MAT3 ) - - FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT6 ) - FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT7 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FXCH( ST(3) ) /* F4 F6 F5 F7 */ - FADD_S( MAT12 ) - FXCH( ST(2) ) /* F5 F6 F4 F7 */ - FADD_S( MAT13 ) - FXCH( ST(1) ) /* F6 F5 F4 F7 */ - FADD_S( MAT14 ) - FXCH( ST(3) ) /* F7 F5 F4 F6 */ - FADD_S( MAT15 ) - - FXCH( ST(2) ) /* F4 F5 F7 F6 */ - FSTP_S( DST0 ) /* F5 F7 F6 */ - FSTP_S( DST1 ) /* F7 F6 */ - FXCH( ST(1) ) /* F6 F7 */ - FSTP_S( DST2 ) /* F7 */ - FSTP_S( DST3 ) /* */ - -LLBL(x86_p2_gr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_gr_loop) ) - -LLBL(x86_p2_gr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_perspective ) -HIDDEN(_mesa_x86_transform_points2_perspective) -GLNAME( _mesa_x86_transform_points2_perspective ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_pr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - - MOV_L( MAT14, EBX ) - -ALIGNTEXT16 -LLBL(x86_p2_pr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F1 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F4 F1 */ - FSTP_S( DST0 ) /* F1 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - MOV_L( CONST(FP_ZERO), DST3 ) - -LLBL(x86_p2_pr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_pr_loop) ) - -LLBL(x86_p2_pr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_3d ) -HIDDEN(_mesa_x86_transform_points2_3d) -GLNAME( _mesa_x86_transform_points2_3d ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_3dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p2_3dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - - FLD_S( SRC1 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT6 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - FXCH( ST(2) ) /* F4 F5 F6 */ - FADD_S( MAT12 ) - FXCH( ST(1) ) /* F5 F4 F6 */ - FADD_S( MAT13 ) - FXCH( ST(2) ) /* F6 F4 F5 */ - FADD_S( MAT14 ) - - FXCH( ST(1) ) /* F4 F6 F5 */ - FSTP_S( DST0 ) /* F6 F5 */ - FXCH( ST(1) ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - -LLBL(x86_p2_3dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_3dr_loop) ) - -LLBL(x86_p2_3dr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_3d_no_rot ) -HIDDEN(_mesa_x86_transform_points2_3d_no_rot) -GLNAME( _mesa_x86_transform_points2_3d_no_rot ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_3dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - - MOV_L( MAT14, EBX ) - -ALIGNTEXT16 -LLBL(x86_p2_3dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F1 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F4 F1 */ - FADD_S( MAT12 ) - FLD_S( MAT13 ) /* F5 F4 F1 */ - FXCH( ST(2) ) /* F1 F4 F5 */ - FADDP( ST0, ST(2) ) /* F4 F5 */ - - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - -LLBL(x86_p2_3dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_3dnrr_loop) ) - -LLBL(x86_p2_3dnrr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_2d ) -HIDDEN(_mesa_x86_transform_points2_2d) -GLNAME( _mesa_x86_transform_points2_2d ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_2dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p2_2dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - - FLD_S( SRC1 ) /* F0 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F0 F1 F5 F4 */ - FADDP( ST0, ST(3) ) /* F1 F5 F4 */ - FADDP( ST0, ST(1) ) /* F5 F4 */ - - FXCH( ST(1) ) /* F4 F5 */ - FADD_S( MAT12 ) - FXCH( ST(1) ) /* F5 F4 */ - FADD_S( MAT13 ) - - FXCH( ST(1) ) /* F4 F5 */ - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - -LLBL(x86_p2_2dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_2dr_loop) ) - -LLBL(x86_p2_2dr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT4 -GLOBL GLNAME( _mesa_x86_transform_points2_2d_no_rot ) -HIDDEN(_mesa_x86_transform_points2_2d_no_rot) -GLNAME( _mesa_x86_transform_points2_2d_no_rot ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_2dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p2_2dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F1 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F4 F1 */ - FADD_S( MAT12 ) - FLD_S( MAT13 ) /* F5 F4 F1 */ - FXCH( ST(2) ) /* F1 F4 F5 */ - FADDP( ST0, ST(2) ) /* F4 F5 */ - - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - -LLBL(x86_p2_2dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_2dnrr_loop) ) - -LLBL(x86_p2_2dnrr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points2_identity ) -HIDDEN(_mesa_x86_transform_points2_identity) -GLNAME( _mesa_x86_transform_points2_identity ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p2_ir_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - - CMP_L( ESI, EDI ) - JE( LLBL(x86_p2_ir_done) ) - -ALIGNTEXT16 -LLBL(x86_p2_ir_loop): - - MOV_L( SRC0, EBX ) - MOV_L( SRC1, EDX ) - - MOV_L( EBX, DST0 ) - MOV_L( EDX, DST1 ) - -LLBL(x86_p2_ir_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p2_ir_loop) ) - -LLBL(x86_p2_ir_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/x86_xform3.S b/src/libs/mesa/mesa/x86/x86_xform3.S deleted file mode 100644 index 1c782f1c5c..0000000000 --- a/src/libs/mesa/mesa/x86/x86_xform3.S +++ /dev/null @@ -1,644 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * NOTE: Avoid using spaces in between '(' ')' and arguments, especially - * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces - * in there will break the build on some platforms. - */ - -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FP_ONE 1065353216 -#define FP_ZERO 0 - -#define SRC0 REGOFF(0, ESI) -#define SRC1 REGOFF(4, ESI) -#define SRC2 REGOFF(8, ESI) -#define SRC3 REGOFF(12, ESI) -#define DST0 REGOFF(0, EDI) -#define DST1 REGOFF(4, EDI) -#define DST2 REGOFF(8, EDI) -#define DST3 REGOFF(12, EDI) -#define MAT0 REGOFF(0, EDX) -#define MAT1 REGOFF(4, EDX) -#define MAT2 REGOFF(8, EDX) -#define MAT3 REGOFF(12, EDX) -#define MAT4 REGOFF(16, EDX) -#define MAT5 REGOFF(20, EDX) -#define MAT6 REGOFF(24, EDX) -#define MAT7 REGOFF(28, EDX) -#define MAT8 REGOFF(32, EDX) -#define MAT9 REGOFF(36, EDX) -#define MAT10 REGOFF(40, EDX) -#define MAT11 REGOFF(44, EDX) -#define MAT12 REGOFF(48, EDX) -#define MAT13 REGOFF(52, EDX) -#define MAT14 REGOFF(56, EDX) -#define MAT15 REGOFF(60, EDX) - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_general ) -HIDDEN(_mesa_x86_transform_points3_general) -GLNAME( _mesa_x86_transform_points3_general ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_gr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_gr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - FLD_S( SRC0 ) /* F7 F6 F5 F4 */ - FMUL_S( MAT3 ) - - FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT6 ) - FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT7 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FLD_S( SRC2 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT10 ) - FLD_S( SRC2 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT11 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FXCH( ST(3) ) /* F4 F6 F5 F7 */ - FADD_S( MAT12 ) - FXCH( ST(2) ) /* F5 F6 F4 F7 */ - FADD_S( MAT13 ) - FXCH( ST(1) ) /* F6 F5 F4 F7 */ - FADD_S( MAT14 ) - FXCH( ST(3) ) /* F7 F5 F4 F6 */ - FADD_S( MAT15 ) - - FXCH( ST(2) ) /* F4 F5 F7 F6 */ - FSTP_S( DST0 ) /* F5 F7 F6 */ - FSTP_S( DST1 ) /* F7 F6 */ - FXCH( ST(1) ) /* F6 F7 */ - FSTP_S( DST2 ) /* F7 */ - FSTP_S( DST3 ) /* */ - -LLBL(x86_p3_gr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_gr_loop) ) - -LLBL(x86_p3_gr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_perspective ) -HIDDEN(_mesa_x86_transform_points3_perspective) -GLNAME( _mesa_x86_transform_points3_perspective ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_pr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_pr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F5 F4 */ - FMUL_S( MAT5 ) - - FLD_S( SRC2 ) /* F0 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F2 F1 F0 F5 F4 */ - FMUL_S( MAT10 ) - - FXCH( ST(2) ) /* F0 F1 F2 F5 F4 */ - FADDP( ST0, ST(4) ) /* F1 F2 F5 F4 */ - FADDP( ST0, ST(2) ) /* F2 F5 F4 */ - FLD_S( MAT14 ) /* F6 F2 F5 F4 */ - FXCH( ST(1) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - MOV_L( SRC2, EBX ) - XOR_L( CONST(-2147483648), EBX )/* change sign */ - - FXCH( ST(2) ) /* F4 F5 F6 */ - FSTP_S( DST0 ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - MOV_L( EBX, DST3 ) - -LLBL(x86_p3_pr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_pr_loop) ) - -LLBL(x86_p3_pr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_3d ) -HIDDEN(_mesa_x86_transform_points3_3d) -GLNAME( _mesa_x86_transform_points3_3d ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_3dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_3dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - - FLD_S( SRC1 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT6 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - FLD_S( SRC2 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT10 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - FXCH( ST(2) ) /* F4 F5 F6 */ - FADD_S( MAT12 ) - FXCH( ST(1) ) /* F5 F4 F6 */ - FADD_S( MAT13 ) - FXCH( ST(2) ) /* F6 F4 F5 */ - FADD_S( MAT14 ) - - FXCH( ST(1) ) /* F4 F6 F5 */ - FSTP_S( DST0 ) /* F6 F5 */ - FXCH( ST(1) ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - -LLBL(x86_p3_3dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_3dr_loop) ) - -LLBL(x86_p3_3dr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_3d_no_rot ) -HIDDEN(_mesa_x86_transform_points3_3d_no_rot) -GLNAME( _mesa_x86_transform_points3_3d_no_rot ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_3dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_3dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F1 F4 */ - FMUL_S( MAT5 ) - - FLD_S( SRC2 ) /* F2 F1 F4 */ - FMUL_S( MAT10 ) - - FXCH( ST(2) ) /* F4 F1 F2 */ - FADD_S( MAT12 ) - FLD_S( MAT13 ) /* F5 F4 F1 F2 */ - FXCH( ST(2) ) /* F1 F4 F5 F2 */ - FADDP( ST0, ST(2) ) /* F4 F5 F2 */ - FLD_S( MAT14 ) /* F6 F4 F5 F2 */ - FXCH( ST(3) ) /* F2 F4 F5 F6 */ - FADDP( ST0, ST(3) ) /* F4 F5 F6 */ - - FSTP_S( DST0 ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - -LLBL(x86_p3_3dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_3dnrr_loop) ) - -LLBL(x86_p3_3dnrr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_2d ) -HIDDEN(_mesa_x86_transform_points3_2d) -GLNAME( _mesa_x86_transform_points3_2d ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_2dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_2dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - - FLD_S( SRC1 ) /* F0 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F0 F1 F5 F4 */ - FADDP( ST0, ST(3) ) /* F1 F5 F4 */ - FADDP( ST0, ST(1) ) /* F5 F4 */ - - FXCH( ST(1) ) /* F4 F5 */ - FADD_S( MAT12 ) - FXCH( ST(1) ) /* F5 F4 */ - FADD_S( MAT13 ) - - MOV_L( SRC2, EBX ) - - FXCH( ST(1) ) /* F4 F5 */ - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - -LLBL(x86_p3_2dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_2dr_loop) ) - -LLBL(x86_p3_2dr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_2d_no_rot ) -HIDDEN(_mesa_x86_transform_points3_2d_no_rot) -GLNAME( _mesa_x86_transform_points3_2d_no_rot ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_2dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p3_2dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F1 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F4 F1 */ - FADD_S( MAT12 ) - FLD_S( MAT13 ) /* F5 F4 F1 */ - - FXCH( ST(2) ) /* F1 F4 F5 */ - FADDP( ST0, ST(2) ) /* F4 F5 */ - - MOV_L( SRC2, EBX ) - - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - -LLBL(x86_p3_2dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_2dnrr_loop) ) - -LLBL(x86_p3_2dnrr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points3_identity ) -HIDDEN(_mesa_x86_transform_points3_identity) -GLNAME(_mesa_x86_transform_points3_identity ): - -#define FRAME_OFFSET 16 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - PUSH_L( EBP ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p3_ir_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - - CMP_L( ESI, EDI ) - JE( LLBL(x86_p3_ir_done) ) - -ALIGNTEXT16 -LLBL(x86_p3_ir_loop): - -#if 1 - MOV_L( SRC0, EBX ) - MOV_L( SRC1, EBP ) - MOV_L( SRC2, EDX ) - - MOV_L( EBX, DST0 ) - MOV_L( EBP, DST1 ) - MOV_L( EDX, DST2 ) -#else - FLD_S( SRC0 ) - FLD_S( SRC1 ) - FLD_S( SRC2 ) - - FSTP_S( DST2 ) - FSTP_S( DST1 ) - FSTP_S( DST0 ) -#endif - -LLBL(x86_p3_ir_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p3_ir_loop) ) - -LLBL(x86_p3_ir_done): - - POP_L( EBP ) - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/x86_xform4.S b/src/libs/mesa/mesa/x86/x86_xform4.S deleted file mode 100644 index 97a841138e..0000000000 --- a/src/libs/mesa/mesa/x86/x86_xform4.S +++ /dev/null @@ -1,677 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * NOTE: Avoid using spaces in between '(' ')' and arguments, especially - * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces - * in there will break the build on some platforms. - */ - -#include "assyntax.h" -#include "matypes.h" -#include "xform_args.h" - - SEG_TEXT - -#define FP_ONE 1065353216 -#define FP_ZERO 0 - -#define SRC0 REGOFF(0, ESI) -#define SRC1 REGOFF(4, ESI) -#define SRC2 REGOFF(8, ESI) -#define SRC3 REGOFF(12, ESI) -#define DST0 REGOFF(0, EDI) -#define DST1 REGOFF(4, EDI) -#define DST2 REGOFF(8, EDI) -#define DST3 REGOFF(12, EDI) -#define MAT0 REGOFF(0, EDX) -#define MAT1 REGOFF(4, EDX) -#define MAT2 REGOFF(8, EDX) -#define MAT3 REGOFF(12, EDX) -#define MAT4 REGOFF(16, EDX) -#define MAT5 REGOFF(20, EDX) -#define MAT6 REGOFF(24, EDX) -#define MAT7 REGOFF(28, EDX) -#define MAT8 REGOFF(32, EDX) -#define MAT9 REGOFF(36, EDX) -#define MAT10 REGOFF(40, EDX) -#define MAT11 REGOFF(44, EDX) -#define MAT12 REGOFF(48, EDX) -#define MAT13 REGOFF(52, EDX) -#define MAT14 REGOFF(56, EDX) -#define MAT15 REGOFF(60, EDX) - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_general ) -HIDDEN(_mesa_x86_transform_points4_general) -GLNAME( _mesa_x86_transform_points4_general ): - -#define FRAME_OFFSET 8 - PUSH_L( ESI ) - PUSH_L( EDI ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_gr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_gr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - FLD_S( SRC0 ) /* F7 F6 F5 F4 */ - FMUL_S( MAT3 ) - - FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT6 ) - FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT7 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FLD_S( SRC2 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT10 ) - FLD_S( SRC2 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT11 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FLD_S( SRC3 ) /* F0 F7 F6 F5 F4 */ - FMUL_S( MAT12 ) - FLD_S( SRC3 ) /* F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT13 ) - FLD_S( SRC3 ) /* F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT14 ) - FLD_S( SRC3 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */ - FMUL_S( MAT15 ) - - FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */ - FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */ - - FXCH( ST(3) ) /* F4 F6 F5 F7 */ - FSTP_S( DST0 ) /* F6 F5 F7 */ - FXCH( ST(1) ) /* F5 F6 F7 */ - FSTP_S( DST1 ) /* F6 F7 */ - FSTP_S( DST2 ) /* F7 */ - FSTP_S( DST3 ) /* */ - -LLBL(x86_p4_gr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_gr_loop) ) - -LLBL(x86_p4_gr_done): - - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_perspective ) -HIDDEN(_mesa_x86_transform_points4_perspective) -GLNAME( _mesa_x86_transform_points4_perspective ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_pr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_pr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F5 F4 */ - FMUL_S( MAT5 ) - - FLD_S( SRC2 ) /* F0 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F6 F1 F0 F5 F4 */ - FMUL_S( MAT10 ) - - FXCH( ST(2) ) /* F0 F1 F6 F5 F4 */ - FADDP( ST0, ST(4) ) /* F1 F6 F5 F4 */ - FADDP( ST0, ST(2) ) /* F6 F5 F4 */ - - FLD_S( SRC3 ) /* F2 F6 F5 F4 */ - FMUL_S( MAT14 ) - - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - MOV_L( SRC2, EBX ) - XOR_L( CONST(-2147483648), EBX )/* change sign */ - - FXCH( ST(2) ) /* F4 F5 F6 */ - FSTP_S( DST0 ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - MOV_L( EBX, DST3 ) - -LLBL(x86_p4_pr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_pr_loop) ) - -LLBL(x86_p4_pr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_3d ) -HIDDEN(_mesa_x86_transform_points4_3d) -GLNAME( _mesa_x86_transform_points4_3d ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_3dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_3dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - FLD_S( SRC0 ) /* F6 F5 F4 */ - FMUL_S( MAT2 ) - - FLD_S( SRC1 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT5 ) - FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT6 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - FLD_S( SRC2 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT8 ) - FLD_S( SRC2 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT9 ) - FLD_S( SRC2 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT10 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - FLD_S( SRC3 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT12 ) - FLD_S( SRC3 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT13 ) - FLD_S( SRC3 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT14 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - MOV_L( SRC3, EBX ) - - FXCH( ST(2) ) /* F4 F5 F6 */ - FSTP_S( DST0 ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - MOV_L( EBX, DST3 ) - -LLBL(x86_p4_3dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_3dr_loop) ) - -LLBL(x86_p4_3dr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME(_mesa_x86_transform_points4_3d_no_rot) -HIDDEN(_mesa_x86_transform_points4_3d_no_rot) -GLNAME(_mesa_x86_transform_points4_3d_no_rot): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_3dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_3dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F5 F4 */ - FMUL_S( MAT5 ) - - FLD_S( SRC2 ) /* F6 F5 F4 */ - FMUL_S( MAT10 ) - - FLD_S( SRC3 ) /* F0 F6 F5 F4 */ - FMUL_S( MAT12 ) - FLD_S( SRC3 ) /* F1 F0 F6 F5 F4 */ - FMUL_S( MAT13 ) - FLD_S( SRC3 ) /* F2 F1 F0 F6 F5 F4 */ - FMUL_S( MAT14 ) - - FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */ - FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */ - FADDP( ST0, ST(1) ) /* F6 F5 F4 */ - - MOV_L( SRC3, EBX ) - - FXCH( ST(2) ) /* F4 F5 F6 */ - FSTP_S( DST0 ) /* F5 F6 */ - FSTP_S( DST1 ) /* F6 */ - FSTP_S( DST2 ) /* */ - MOV_L( EBX, DST3 ) - -LLBL(x86_p4_3dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_3dnrr_loop) ) - -LLBL(x86_p4_3dnrr_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_2d ) -HIDDEN(_mesa_x86_transform_points4_2d) -GLNAME( _mesa_x86_transform_points4_2d ): - -#define FRAME_OFFSET 16 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - PUSH_L( EBP ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_2dr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_2dr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - FLD_S( SRC0 ) /* F5 F4 */ - FMUL_S( MAT1 ) - - FLD_S( SRC1 ) /* F0 F5 F4 */ - FMUL_S( MAT4 ) - FLD_S( SRC1 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT5 ) - - FXCH( ST(1) ) /* F0 F1 F5 F4 */ - FADDP( ST0, ST(3) ) /* F1 F5 F4 */ - FADDP( ST0, ST(1) ) /* F5 F4 */ - - FLD_S( SRC3 ) /* F0 F5 F4 */ - FMUL_S( MAT12 ) - FLD_S( SRC3 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT13 ) - - FXCH( ST(1) ) /* F0 F1 F5 F4 */ - FADDP( ST0, ST(3) ) /* F1 F5 F4 */ - FADDP( ST0, ST(1) ) /* F5 F4 */ - - MOV_L( SRC2, EBX ) - MOV_L( SRC3, EBP ) - - FXCH( ST(1) ) /* F4 F5 */ - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - MOV_L( EBP, DST3 ) - -LLBL(x86_p4_2dr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_2dr_loop) ) - -LLBL(x86_p4_2dr_done): - - POP_L( EBP ) - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_2d_no_rot ) -HIDDEN(_mesa_x86_transform_points4_2d_no_rot) -GLNAME( _mesa_x86_transform_points4_2d_no_rot ): - -#define FRAME_OFFSET 16 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - PUSH_L( EBP ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_2dnrr_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - -ALIGNTEXT16 -LLBL(x86_p4_2dnrr_loop): - - FLD_S( SRC0 ) /* F4 */ - FMUL_S( MAT0 ) - - FLD_S( SRC1 ) /* F5 F4 */ - FMUL_S( MAT5 ) - - FLD_S( SRC3 ) /* F0 F5 F4 */ - FMUL_S( MAT12 ) - FLD_S( SRC3 ) /* F1 F0 F5 F4 */ - FMUL_S( MAT13 ) - - FXCH( ST(1) ) /* F0 F1 F5 F4 */ - FADDP( ST0, ST(3) ) /* F1 F5 F4 */ - FADDP( ST0, ST(1) ) /* F5 F4 */ - - MOV_L( SRC2, EBX ) - MOV_L( SRC3, EBP ) - - FXCH( ST(1) ) /* F4 F5 */ - FSTP_S( DST0 ) /* F5 */ - FSTP_S( DST1 ) /* */ - MOV_L( EBX, DST2 ) - MOV_L( EBP, DST3 ) - -LLBL(x86_p4_2dnrr_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_2dnrr_loop) ) - -LLBL(x86_p4_2dnrr_done): - - POP_L( EBP ) - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET -#undef FRAME_OFFSET - - - - -ALIGNTEXT16 -GLOBL GLNAME( _mesa_x86_transform_points4_identity ) -HIDDEN(_mesa_x86_transform_points4_identity) -GLNAME( _mesa_x86_transform_points4_identity ): - -#define FRAME_OFFSET 12 - PUSH_L( ESI ) - PUSH_L( EDI ) - PUSH_L( EBX ) - - MOV_L( ARG_SOURCE, ESI ) - MOV_L( ARG_DEST, EDI ) - - MOV_L( ARG_MATRIX, EDX ) - MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) - - TEST_L( ECX, ECX ) - JZ( LLBL(x86_p4_ir_done) ) - - MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) - OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) - - MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) - MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) - - SHL_L( CONST(4), ECX ) - MOV_L( REGOFF(V4F_START, ESI), ESI ) - - MOV_L( REGOFF(V4F_START, EDI), EDI ) - ADD_L( EDI, ECX ) - - CMP_L( ESI, EDI ) - JE( LLBL(x86_p4_ir_done) ) - -ALIGNTEXT16 -LLBL(x86_p4_ir_loop): - - MOV_L( SRC0, EBX ) - MOV_L( SRC1, EDX ) - - MOV_L( EBX, DST0 ) - MOV_L( EDX, DST1 ) - - MOV_L( SRC2, EBX ) - MOV_L( SRC3, EDX ) - - MOV_L( EBX, DST2 ) - MOV_L( EDX, DST3 ) - -LLBL(x86_p4_ir_skip): - - ADD_L( CONST(16), EDI ) - ADD_L( EAX, ESI ) - CMP_L( ECX, EDI ) - JNE( LLBL(x86_p4_ir_loop) ) - -LLBL(x86_p4_ir_done): - - POP_L( EBX ) - POP_L( EDI ) - POP_L( ESI ) - RET - -#if defined (__ELF__) && defined (__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/src/libs/mesa/mesa/x86/xform_args.h b/src/libs/mesa/mesa/x86/xform_args.h deleted file mode 100644 index b773f5198d..0000000000 --- a/src/libs/mesa/mesa/x86/xform_args.h +++ /dev/null @@ -1,51 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 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. - */ - -/* - * Transform function interface for assembly code. Simply define - * FRAME_OFFSET to the number of bytes pushed onto the stack before - * using the ARG_* argument macros. - * - * Gareth Hughes - */ - -#ifndef __XFORM_ARGS_H__ -#define __XFORM_ARGS_H__ - -/* Offsets for transform_func arguments - * - * typedef void (*transform_func)( GLvector4f *to_vec, - * const GLfloat m[16], - * const GLvector4f *from_vec ); - */ -#define OFFSET_DEST 4 -#define OFFSET_MATRIX 8 -#define OFFSET_SOURCE 12 - -#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) - -#endif diff --git a/src/preferences/opengl/Jamfile b/src/preferences/opengl/Jamfile index 2ae1d1ab33..0bd2fc492d 100644 --- a/src/preferences/opengl/Jamfile +++ b/src/preferences/opengl/Jamfile @@ -1,4 +1,11 @@ SubDir HAIKU_TOP src preferences opengl ; +SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; + +# For GCC2 +if $(HAIKU_GCC_VERSION[1]) < 3 { + SubDirC++Flags --no-warnings ; +} + UsePrivateHeaders interface ;